mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-12-02 17:13:33 +01:00
feat(admin): errors page built around issues, linked to repositories and users
The admin Errors page now shows one list of issues: records grouped by error code (or exception type), service and route, each with a plain-language title, a likely cause, its impact (failures, repositories, users), a trend and when it was last seen. Expected 4xx answers sit in a collapsed group; slow and interrupted requests are left out and counted, with a link to Performance. - GET /api/admin/errors/issues groups server-side (admin-error-issues.ts). It reads central logs when they answer and the Redis history otherwise, accepts validated repoId/userId/service/window filters and resolves repository owners and user names when the database is connected. - The cause is derived from external_request records of the same requests (#990 field names), fast 429s, storage and network codes, and the first application stack frame; otherwise it says nothing is known. - Issue page (?issue=) with cause, affected repositories and owners, who hit it, failures over time and occurrences. Request view (&occurrence=) with a waterfall from the existing correlation lookup and Request, Exception and All fields tabs; missing data shows as "not recorded". - Repositories (search = one repoId) and user admin pages list their issues, with a "failing now" banner. - The source switch, export, clear history, telemetry and 24-hour counters move to a collapsed "Settings and diagnostics" section. - Synthetic fixtures shared by dev-mock and preview-errors; old errors-page CSS removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c281841f91
commit
2abd6beaa9
21 files changed
+2053
-2323
No files matched your search
@@ -0,0 +1,436 @@
|
||||
import { nextTick } from "vue";
|
||||
|
||||
// Admin › Errors: one list of issues built server-side (GET /api/admin/errors/issues)
|
||||
// from central logs, or from the Redis history when central logs do not answer.
|
||||
// The page has three views in one route, driven by the URL query so they are
|
||||
// deep-linkable and the browser Back button works:
|
||||
// /admin/errors the issue list
|
||||
// /admin/errors?issue=<id> one issue
|
||||
// /admin/errors?issue=<id>&occurrence=n one occurrence (request view)
|
||||
|
||||
export const WINDOW_LABELS = { "15m": "last 15 min", "1h": "last hour", "6h": "last 6 h", "24h": "last 24 h" };
|
||||
const UUID = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;
|
||||
const REPO_ID = /^[A-Za-z0-9_-]{3,200}$/;
|
||||
const USER_ID = /^[a-f0-9]{24}$/;
|
||||
const SIGNED_IN = { owner: "Owner", coauthor: "Co-author", admin: "Admin" };
|
||||
|
||||
/** Splits the search box into server filters (repo:<id>, user:<id>) and free text. */
|
||||
export function parseIssueSearch(text) {
|
||||
const out = { repoId: "", userId: "", free: "", invalid: "" };
|
||||
const rest = [];
|
||||
for (const token of String(text || "").trim().split(/\s+/).filter(Boolean)) {
|
||||
const match = token.match(/^(repo|user):(.*)$/i);
|
||||
if (!match) { rest.push(token); continue; }
|
||||
const value = match[2];
|
||||
if (match[1].toLowerCase() === "repo" && REPO_ID.test(value)) out.repoId = value;
|
||||
else if (match[1].toLowerCase() === "user" && USER_ID.test(value)) out.userId = value;
|
||||
else out.invalid = token;
|
||||
}
|
||||
out.free = rest.join(" ").toLowerCase();
|
||||
return out;
|
||||
}
|
||||
|
||||
export function issueMatches(issue, free) {
|
||||
if (!free) return true;
|
||||
const hay = [issue.title, issue.code, issue.service, issue.route, issue.method, issue.queue, issue.status, issue.cause?.label, issue.cause?.summary]
|
||||
.filter(value => value !== null && value !== undefined).join(" ").toLowerCase();
|
||||
return free.split(" ").every(word => hay.includes(word));
|
||||
}
|
||||
|
||||
const statusOf = event => Number(event?.status || event?.httpStatus) || 0;
|
||||
const time = value => Date.parse(value);
|
||||
const isExternal = event => event?.event === "external_request";
|
||||
const DATA = new Set(["mongodb", "redis"]);
|
||||
|
||||
/** Rows for the request waterfall: one per recorded event, positioned by timestamp and duration. */
|
||||
export function waterfall(events, issue) {
|
||||
const rows = (events || []).filter(event => Number.isFinite(time(event.timestamp))).map((event, index) => {
|
||||
const end = time(event.timestamp);
|
||||
const ms = Number(event.ms);
|
||||
const start = Number.isFinite(ms) && ms >= 0 ? end - ms : end;
|
||||
const external = isExternal(event);
|
||||
const host = String(event.upstreamHost || "");
|
||||
const kind = external ? "external" : DATA.has(event.service) ? "data" : event.service === "nginx" ? "edge" : "app";
|
||||
const label = external ? `${host === "storage" ? "Storage" : /github/.test(host) ? "GitHub" : "External"}${event.upstreamMethod ? " · " + event.upstreamMethod : ""}`
|
||||
: event.errorCode || event.errorType || String(event.event || "event").replace(/_/g, " ");
|
||||
const sub = external ? (event.upstreamEndpoint || host || "endpoint not recorded")
|
||||
: [event.service, event.route || (event.queue ? "job " + event.queue : "")].filter(Boolean).join(" · ");
|
||||
const status = external ? Number(event.upstreamStatus) || event.errorCode || "" : statusOf(event) || "";
|
||||
const failed = external ? Number(event.upstreamStatus) >= 400 || !!event.errorCode : statusOf(event) >= 500 || event.severity === "error";
|
||||
const failure = !external && !!issue && !["edge_request", "request_completed"].includes(event.event) &&
|
||||
((issue.errorCode && event.errorCode === issue.errorCode) || (!issue.errorCode && issue.errorType && event.errorType === issue.errorType));
|
||||
return { key: index, event, start, end, ms: Number.isFinite(ms) ? ms : null, kind, label, sub, status, failed, failure };
|
||||
});
|
||||
if (!rows.length) return { rows, span: 0 };
|
||||
// Start order; at equal starts the enclosing (longer) step first.
|
||||
rows.sort((a, b) => a.start - b.start || (b.end - b.start) - (a.end - a.start));
|
||||
rows.forEach((row, index) => { row.key = index; });
|
||||
const min = Math.min(...rows.map(row => row.start)), max = Math.max(...rows.map(row => row.end));
|
||||
const span = Math.max(1, max - min);
|
||||
for (const row of rows) {
|
||||
row.left = ((row.start - min) / span) * 100;
|
||||
row.width = Math.max(0.6, ((row.end - row.start) / span) * 100);
|
||||
if (row.left + row.width > 100) row.left = Math.max(0, 100 - row.width);
|
||||
row.offset = Math.round(row.start - min);
|
||||
}
|
||||
if (!rows.some(row => row.failure)) {
|
||||
const last = [...rows].reverse().find(row => row.failed && row.kind === "app");
|
||||
if (last) last.failure = true;
|
||||
}
|
||||
return { rows, span: Math.round(span) };
|
||||
}
|
||||
|
||||
/** Plain-language viewer label for #991's viewer field. */
|
||||
export function viewerLabel(viewer) {
|
||||
if (!viewer) return "";
|
||||
if (SIGNED_IN[viewer]) return `Signed in as ${SIGNED_IN[viewer].toLowerCase()}`;
|
||||
return "Viewer not signed in";
|
||||
}
|
||||
|
||||
const relTime = (iso, now = Date.now()) => {
|
||||
const t = time(iso);
|
||||
if (!Number.isFinite(t)) return "";
|
||||
const s = Math.max(0, Math.floor((now - t) / 1000));
|
||||
if (s < 60) return "just now";
|
||||
const m = Math.floor(s / 60);
|
||||
if (m < 60) return `${m} min ago`;
|
||||
const h = Math.floor(m / 60);
|
||||
if (h < 24) return `${h} h ago`;
|
||||
return `${Math.floor(h / 24)} d ago`;
|
||||
};
|
||||
const clock = (iso, seconds = false) => {
|
||||
const d = new Date(iso);
|
||||
return Number.isNaN(d.getTime()) ? "" : d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", ...(seconds ? { second: "2-digit" } : {}), hour12: false });
|
||||
};
|
||||
const dayTime = iso => {
|
||||
const d = new Date(iso);
|
||||
if (Number.isNaN(d.getTime())) return "";
|
||||
const today = new Date().toDateString() === d.toDateString();
|
||||
return (today ? "Today " : d.toLocaleDateString(undefined, { month: "short", day: "numeric" }) + " · ") + clock(iso, true);
|
||||
};
|
||||
// Fills the fields the page reads, so a partial or unexpected answer renders as empty.
|
||||
export function normalizeIssues(data) {
|
||||
const value = data && typeof data === "object" && !Array.isArray(data) ? data : {};
|
||||
return { source: "central", window: "24h", filters: {}, names: { repos: {}, users: {} }, captured: 0, ...value,
|
||||
issues: Array.isArray(value.issues) ? value.issues : [],
|
||||
expected: { count: 0, groups: [], ...(value.expected || {}) }, excluded: { slow: 0, interrupted: 0, ...(value.excluded || {}) },
|
||||
summary: { issues: 0, failingNow: 0, failedRecords: 0, repositories: 0, users: 0, upstreamShare: 0, ...(value.summary || {}) } };
|
||||
}
|
||||
const fmtNumber = n => Number(n || 0).toLocaleString("en-US");
|
||||
|
||||
// Shared by the Errors page and the repository/user admin pages.
|
||||
function installFormatters(state) {
|
||||
state.errRelTime = iso => relTime(iso);
|
||||
state.errClock = (iso, seconds) => clock(iso, seconds);
|
||||
state.errDayTime = iso => dayTime(iso);
|
||||
state.errNumber = fmtNumber;
|
||||
state.errPlural = (n, word, many) => `${fmtNumber(n)} ${n === 1 ? word : (many || word + "s")}`;
|
||||
state.errStatusClass = status => Number(status) >= 500 ? "is-error" : Number(status) >= 400 ? "is-warn" : "is-neutral";
|
||||
state.errIssueHref = (id, extra = "") => `/admin/errors?issue=${encodeURIComponent(id)}${extra}`;
|
||||
state.errRepoHref = id => `/admin/repositories?search=${encodeURIComponent(id)}`;
|
||||
state.errUserHref = id => `/admin/users/${encodeURIComponent(id)}`;
|
||||
state.errTrendMax = trend => Math.max(1, ...(trend || [0]));
|
||||
state.viewerLabel = viewerLabel;
|
||||
}
|
||||
|
||||
/**
|
||||
* Errors for one repository or user, shown on the admin Repositories (filtered to
|
||||
* one repository) and User pages. `filter()` returns { repoId } or { userId } or null.
|
||||
*/
|
||||
export function installEntityErrors(state, http, filter, { onScopeDispose } = {}) {
|
||||
installFormatters(state);
|
||||
state.entityErrors = { loading: false, failed: false, data: null, key: "" };
|
||||
let version = 0, disposed = false;
|
||||
state.loadEntityErrors = async (force = false) => {
|
||||
const params = filter();
|
||||
const key = params ? JSON.stringify(params) : "";
|
||||
if (!force && key === state.entityErrors.key) return;
|
||||
const current = ++version;
|
||||
state.entityErrors = { loading: !!params, failed: false, data: null, key };
|
||||
if (!params) return;
|
||||
try {
|
||||
const response = await http.get("/api/admin/errors/issues", { params: { window: "24h", ...params } });
|
||||
if (disposed || current !== version) return;
|
||||
state.entityErrors = { loading: false, failed: false, data: normalizeIssues(response.data), key };
|
||||
} catch {
|
||||
if (!disposed && current === version) state.entityErrors = { loading: false, failed: true, data: null, key };
|
||||
}
|
||||
};
|
||||
// Issues for this entity, the expected ones last and marked.
|
||||
state.entityIssues = () => state.entityErrors.data?.issues || [];
|
||||
state.entityFailingNow = () => state.entityIssues().filter(issue => issue.failingNow);
|
||||
state.entityExpected = () => state.entityErrors.data?.expected?.groups || [];
|
||||
const dispose = () => { disposed = true; version++; };
|
||||
if (onScopeDispose) onScopeDispose(dispose); else state.on?.("dispose", dispose);
|
||||
}
|
||||
|
||||
export const errorsAdminController = function (state, http, location, interval) {
|
||||
state.watch("user.status", () => { if (state.user == null) location.url("/"); });
|
||||
if (state.user == null) location.url("/");
|
||||
installFormatters(state);
|
||||
|
||||
let version = 0, traceVersion = 0, statsVersion = 0, disposed = false;
|
||||
let lastIssueId = null, lastOccurrence = null;
|
||||
state.issueData = null;
|
||||
state.issueLoading = true;
|
||||
state.issueFailure = "";
|
||||
state.issueFilters = { window: "24h", service: "", source: "auto" };
|
||||
// ?q= pre-fills the search, so repository and user pages can link here filtered.
|
||||
const initialQuery = location.search?.() || {};
|
||||
state.issueSearch = typeof initialQuery.q === "string" ? initialQuery.q.slice(0, 200) : "";
|
||||
state.errView = "list";
|
||||
state.selectedIssue = null;
|
||||
state.missingIssue = "";
|
||||
state.occurrenceIndex = -1;
|
||||
state.requestTab = "timeline";
|
||||
state.trace = null;
|
||||
state.traceLoading = false;
|
||||
state.expandedSteps = {};
|
||||
state.copyStatus = "";
|
||||
state.settingsOpen = false;
|
||||
state.telemetry = null;
|
||||
state.telemetryState = "idle";
|
||||
state.stats = null;
|
||||
state.statsState = "idle";
|
||||
state.redisCollecting = null;
|
||||
state.windowLabels = WINDOW_LABELS;
|
||||
|
||||
const searchFilters = () => parseIssueSearch(state.issueSearch);
|
||||
state.searchFilters = searchFilters;
|
||||
state.visibleIssues = () => {
|
||||
const { free } = searchFilters();
|
||||
return (state.issueData?.issues || []).filter(issue => issueMatches(issue, free));
|
||||
};
|
||||
state.sourceLine = () => {
|
||||
const data = state.issueData;
|
||||
if (!data) return "";
|
||||
const from = data.source === "central" ? "From central logs" : "From application history (Redis)";
|
||||
return `${from} · ${WINDOW_LABELS[data.window] || data.window}`;
|
||||
};
|
||||
state.sourceNote = () => {
|
||||
const data = state.issueData;
|
||||
if (!data) return "";
|
||||
if (data.source === "history" && data.centralState === "skipped") return "Central logs are not used while this switch is on.";
|
||||
if (data.source === "history") return ({ disabled: "Central logs are not configured.", unreachable: "Central logs did not answer.", busy: "Central logs are busy.", misconfigured: "Central log configuration is invalid." })[data.centralState] || "";
|
||||
if (data.state === "partial") return "Partial: a record limit or an invalid record reduced coverage.";
|
||||
return "";
|
||||
};
|
||||
state.ownerOf = repoId => state.issueData?.names?.repos?.[repoId] || state.entityErrors?.data?.names?.repos?.[repoId] || null;
|
||||
state.userName = userId => state.issueData?.names?.users?.[userId] || null;
|
||||
|
||||
async function load({ quiet = false } = {}) {
|
||||
const current = ++version;
|
||||
const search = searchFilters();
|
||||
const params = { window: state.issueFilters.window };
|
||||
if (state.issueFilters.service) params.service = state.issueFilters.service;
|
||||
if (state.issueFilters.source === "history") params.source = "history";
|
||||
if (search.repoId) params.repoId = search.repoId;
|
||||
if (search.userId) params.userId = search.userId;
|
||||
if (!quiet) state.issueLoading = true;
|
||||
state.issueFailure = "";
|
||||
try {
|
||||
const response = await http.get("/api/admin/errors/issues", { params });
|
||||
if (disposed || current !== version) return;
|
||||
state.issueData = normalizeIssues(response.data);
|
||||
state.redisCollecting = response.data?.redisCollecting !== false;
|
||||
state.issueLoading = false;
|
||||
syncFromRoute(false);
|
||||
} catch (error) {
|
||||
if (disposed || current !== version) return;
|
||||
state.issueFailure = error?.status === 400 ? "These filters are not valid. Check repo: and user: values." : "Could not load errors. Check the connection and retry.";
|
||||
} finally { if (!disposed && current === version) state.issueLoading = false; }
|
||||
}
|
||||
state.refreshIssues = () => load();
|
||||
let serverKey = "";
|
||||
const serverFilterKey = () => { const s = searchFilters(); return [state.issueFilters.window, state.issueFilters.service, state.issueFilters.source, s.repoId, s.userId].join("|"); };
|
||||
state.applyFilters = () => { const key = serverFilterKey(); if (key !== serverKey) { serverKey = key; load(); } };
|
||||
serverKey = serverFilterKey();
|
||||
state.setSource = source => { state.issueFilters.source = source; state.applyFilters(); };
|
||||
state.watch("issueFilters.window", () => state.applyFilters(), false, false);
|
||||
state.watch("issueFilters.service", () => state.applyFilters(), false, false);
|
||||
// repo:<id> and user:<id> are server filters; free text filters the loaded issues.
|
||||
let searchTimer = null;
|
||||
state.watch("issueSearch", () => { window.clearTimeout(searchTimer); searchTimer = window.setTimeout(() => { if (!disposed) state.applyFilters(); }, 300); }, false, false);
|
||||
|
||||
// ---- Views and routing -------------------------------------------------
|
||||
const query = () => location.search?.() || {};
|
||||
function syncFromRoute(moveFocus = true) {
|
||||
const q = query();
|
||||
const issueId = typeof q.issue === "string" ? q.issue : "";
|
||||
if (!issueId) {
|
||||
const was = state.errView;
|
||||
state.errView = "list"; state.selectedIssue = null; state.occurrenceIndex = -1; state.missingIssue = "";
|
||||
clearTrace();
|
||||
if (moveFocus && was !== "list") focusRow();
|
||||
return;
|
||||
}
|
||||
const issue = (state.issueData?.issues || []).find(item => item.id === issueId) || null;
|
||||
state.selectedIssue = issue;
|
||||
state.missingIssue = issue || state.issueLoading ? "" : issueId;
|
||||
const index = Number.parseInt(q.occurrence, 10);
|
||||
const occurrence = issue && Number.isInteger(index) && index >= 0 && index < issue.occurrences.length ? index : -1;
|
||||
const view = occurrence >= 0 ? "request" : "issue";
|
||||
const changed = view !== state.errView || issueId !== lastIssueId || occurrence !== state.occurrenceIndex;
|
||||
state.errView = view;
|
||||
lastIssueId = issueId;
|
||||
if (occurrence !== state.occurrenceIndex) { state.occurrenceIndex = occurrence; state.expandedSteps = {}; if (occurrence >= 0) loadTrace(); else clearTrace(); }
|
||||
if (view === "request" && ["timeline", "request", "exception", "fields"].includes(q.tab)) state.requestTab = q.tab;
|
||||
if (moveFocus && changed) focusHeading();
|
||||
}
|
||||
async function focusHeading() {
|
||||
await nextTick();
|
||||
if (disposed) return;
|
||||
const heading = document.getElementById("errs-detail-title");
|
||||
heading?.focus({ preventScroll: true });
|
||||
const view = document.querySelector(".app-view");
|
||||
if (view) view.scrollTop = 0;
|
||||
}
|
||||
async function focusRow() {
|
||||
await nextTick();
|
||||
if (disposed) return;
|
||||
const link = lastIssueId && document.querySelector(`[data-issue-link="${lastIssueId}"]`);
|
||||
if (link) { link.focus({ preventScroll: true }); link.scrollIntoView?.({ block: "nearest" }); }
|
||||
else document.getElementById("errs-search")?.focus();
|
||||
}
|
||||
state.on("routeUpdate", () => syncFromRoute(true));
|
||||
state.currentOccurrence = () => state.selectedIssue?.occurrences?.[state.occurrenceIndex] || null;
|
||||
state.occurrenceHref = index => state.errIssueHref(state.selectedIssue?.id || "", `&occurrence=${index}`);
|
||||
state.openOccurrence = index => { if (state.selectedIssue) { lastOccurrence = index; location.url(state.occurrenceHref(index)); } };
|
||||
state.lastOccurrence = () => lastOccurrence;
|
||||
|
||||
// ---- Request view ------------------------------------------------------
|
||||
function clearTrace() { traceVersion++; state.trace = null; state.traceLoading = false; }
|
||||
async function loadTrace() {
|
||||
const occurrence = state.currentOccurrence();
|
||||
clearTrace();
|
||||
const kind = UUID.test(occurrence?.requestId || "") ? "requestId" : UUID.test(occurrence?.jobId || "") ? "jobId" : "";
|
||||
if (!kind || state.issueData?.source !== "central") return;
|
||||
const current = traceVersion;
|
||||
state.traceLoading = true;
|
||||
try {
|
||||
const response = await http.get("/api/admin/errors/correlation", { params: { kind, id: occurrence[kind], window: state.issueData?.window || "24h" } });
|
||||
if (!disposed && current === traceVersion) state.trace = response.data;
|
||||
} catch {
|
||||
if (!disposed && current === traceVersion) state.trace = { state: "unreachable", events: [] };
|
||||
} finally { if (!disposed && current === traceVersion) state.traceLoading = false; }
|
||||
}
|
||||
state.traceKind = () => {
|
||||
const occurrence = state.currentOccurrence();
|
||||
return UUID.test(occurrence?.requestId || "") ? "request" : UUID.test(occurrence?.jobId || "") ? "job" : "";
|
||||
};
|
||||
state.waterfall = () => waterfall(state.trace?.events?.length ? state.trace.events : [state.occurrenceRecord()].filter(Boolean), state.selectedIssue);
|
||||
// The fullest record of this occurrence: the matching trace event, else the occurrence projection.
|
||||
state.occurrenceRecord = () => {
|
||||
const occurrence = state.currentOccurrence();
|
||||
if (!occurrence) return null;
|
||||
const issue = state.selectedIssue;
|
||||
const events = state.trace?.events || [];
|
||||
const match = events.find(event => event.timestamp === occurrence.timestamp && event.service === occurrence.service)
|
||||
|| events.find(event => !["edge_request", "request_completed", "external_request"].includes(event.event) &&
|
||||
((issue?.errorCode && event.errorCode === issue.errorCode) || (!issue?.errorCode && issue?.errorType && event.errorType === issue.errorType)));
|
||||
if (match) return match;
|
||||
return state.occurrenceIndex === 0 && issue?.sample ? issue.sample : occurrence;
|
||||
};
|
||||
state.exceptionRecord = () => {
|
||||
const record = state.occurrenceRecord();
|
||||
if (record?.errorStack || record?.errorType) return { record, fromSample: false };
|
||||
const sample = state.selectedIssue?.sample;
|
||||
return sample?.errorStack || sample?.errorType ? { record: sample, fromSample: true } : { record: null, fromSample: false };
|
||||
};
|
||||
state.toggleStep = key => { state.expandedSteps = { ...state.expandedSteps, [key]: !state.expandedSteps[key] }; };
|
||||
state.requestTabs = [["timeline", "Timeline"], ["request", "Request"], ["exception", "Exception"], ["fields", "All fields"]];
|
||||
state.selectRequestTab = (tab, focus = false) => {
|
||||
state.requestTab = tab;
|
||||
if (focus) nextTick(() => document.getElementById("errs-tab-" + tab)?.focus());
|
||||
};
|
||||
state.requestTabKey = (event, tab) => {
|
||||
const keys = state.requestTabs.map(([key]) => key);
|
||||
const index = keys.indexOf(tab);
|
||||
const next = { ArrowRight: index + 1, ArrowLeft: index - 1, Home: 0, End: keys.length - 1 }[event.key];
|
||||
if (next === undefined) return;
|
||||
event.preventDefault();
|
||||
state.selectRequestTab(keys[(next + keys.length) % keys.length], true);
|
||||
};
|
||||
state.requestTitle = () => {
|
||||
const o = state.currentOccurrence();
|
||||
if (!o) return "";
|
||||
const where = o.requestPath || o.route || state.selectedIssue?.route;
|
||||
if (!where) return o.jobId ? `Job ${state.selectedIssue?.queue || ""}`.trim() : `${state.selectedIssue?.code || "Record"} · route not recorded`;
|
||||
return `${o.method || state.selectedIssue?.method || ""} ${where}`.trim();
|
||||
};
|
||||
// The failing record rarely carries a duration; the request's own records do.
|
||||
state.requestMs = () => {
|
||||
const o = state.currentOccurrence();
|
||||
if (Number.isFinite(Number(o?.ms)) && o.ms !== undefined) return Number(o.ms);
|
||||
const envelope = (state.trace?.events || []).find(event => event.event === "request_completed" && Number.isFinite(Number(event.ms)));
|
||||
return envelope ? Number(envelope.ms) : null;
|
||||
};
|
||||
state.curlFor = occurrence => occurrence?.requestPath && ["GET", "HEAD"].includes(occurrence.method || "GET")
|
||||
? `curl -i ${occurrence.method === "HEAD" ? "-I " : ""}'${window.location.origin}${occurrence.requestPath}'` : "";
|
||||
state.copyValue = async (value, label) => {
|
||||
try { await navigator.clipboard.writeText(String(value)); state.copyStatus = `${label} copied.`; }
|
||||
catch { state.copyStatus = "Copy is not available in this browser. Select the text instead."; }
|
||||
};
|
||||
state.recordJson = record => JSON.stringify(record || {}, null, 2);
|
||||
|
||||
// ---- Settings and diagnostics (lazy) -----------------------------------
|
||||
state.toggleSettings = event => {
|
||||
state.settingsOpen = !!event?.target?.open;
|
||||
if (!state.settingsOpen) return;
|
||||
if (state.statsState === "idle") loadStats();
|
||||
if (state.telemetryState === "idle") loadTelemetry();
|
||||
};
|
||||
async function loadStats() {
|
||||
const current = ++statsVersion;
|
||||
state.statsState = "loading";
|
||||
try {
|
||||
const response = await http.get("/api/admin/errors/stats");
|
||||
if (disposed || current !== statsVersion) return;
|
||||
state.stats = response.data;
|
||||
state.statsState = response.data?.available === false ? "unavailable" : "ready";
|
||||
} catch { if (!disposed && current === statsVersion) state.statsState = "unavailable"; }
|
||||
}
|
||||
async function loadTelemetry() {
|
||||
state.telemetryState = "loading";
|
||||
try {
|
||||
const response = await http.get("/api/admin/errors/investigation", { params: { window: "1h" } });
|
||||
if (disposed) return;
|
||||
state.telemetry = response.data;
|
||||
state.telemetryState = "ready";
|
||||
} catch { if (!disposed) state.telemetryState = "unavailable"; }
|
||||
}
|
||||
state.telemetryText = value => ({
|
||||
ready: "Central logs answer.", empty: "Central logs answer; nothing to report in the last hour.", partial: "Central logs answer with partial coverage.",
|
||||
stale: "Central logs answer, but expected application telemetry is stale or missing.", disabled: "Central logs are not configured.",
|
||||
misconfigured: "Central log configuration is invalid.", unreachable: "Central logs did not answer.", busy: "Central logs are busy. Retry shortly.",
|
||||
})[value] || "Central log status is unknown.";
|
||||
state.statBarHeight = (bucket, key) => {
|
||||
const max = Math.max(1, ...(state.stats?.buckets || []).map(b => (b.error || 0) + (b.warn || 0) + (b.info || 0)));
|
||||
return Math.round(((bucket[key] || 0) / max) * 40);
|
||||
};
|
||||
state.clearHistory = async () => {
|
||||
if (!window.confirm("Clear the Redis error history? Central logs are not affected.")) return;
|
||||
try { await http.delete("/api/admin/errors"); state.copyStatus = "Redis history cleared."; state.statsState = "idle"; loadStats(); load(); }
|
||||
catch { state.copyStatus = "Could not clear the Redis history."; }
|
||||
};
|
||||
state.exportHistory = async () => {
|
||||
try {
|
||||
const response = await http.get("/api/admin/errors", { params: { offset: 0, limit: 5000 } });
|
||||
const cols = ["ts", "level", "module", "message", "service", "status", "route", "repoId", "userId", "viewer", "requestId"];
|
||||
const lines = [cols.join(",")];
|
||||
for (const entry of response.data?.entries || []) {
|
||||
const row = { ...(entry.raw?.[0] || {}), ...entry };
|
||||
lines.push(cols.map(col => { const v = row[col] == null ? "" : String(row[col]); return /[",\n]/.test(v) ? `"${v.replace(/"/g, '""')}"` : v; }).join(","));
|
||||
}
|
||||
const url = URL.createObjectURL(new Blob([lines.join("\n")], { type: "text/csv;charset=utf-8" }));
|
||||
const a = document.createElement("a");
|
||||
a.href = url; a.download = `errors-${new Date().toISOString().slice(0, 19)}.csv`;
|
||||
document.body.appendChild(a); a.click(); a.remove(); URL.revokeObjectURL(url);
|
||||
state.copyStatus = "Redis history exported.";
|
||||
} catch { state.copyStatus = "Could not export the Redis history."; }
|
||||
};
|
||||
|
||||
load().then(() => { if (state.errView !== "list") focusHeading(); });
|
||||
const poll = interval(() => { if (state.errView === "list" && !state.issueLoading && document.visibilityState !== "hidden") load({ quiet: true }); }, 60000);
|
||||
state.on("dispose", () => { disposed = true; window.clearTimeout(searchTimer); version++; traceVersion++; statsVersion++; interval.cancel(poll); });
|
||||
};
|
||||
@@ -1,156 +0,0 @@
|
||||
import { nextTick } from "vue";
|
||||
|
||||
// Central counts never include the separately displayed Redis mirror.
|
||||
export function installLogInvestigation(state, http) {
|
||||
state.errorSource = "central";
|
||||
state.logView = { search: "", severity: "", sort: "recent" };
|
||||
state.selectedLog = null;
|
||||
state.logDetailTab = "overview";
|
||||
state.logSeverity = (sample) => Number(sample?.status || sample?.httpStatus) >= 500 || ["error", "fatal"].includes(sample?.severity) ? "error" : sample?.severity === "warn" ? "warn" : "info";
|
||||
state.filteredLogGroups = () => {
|
||||
const search = state.logView.search.trim().toLowerCase();
|
||||
return (state.logData?.groups || []).filter(group =>
|
||||
(!state.logView.severity || state.logSeverity(group.sample) === state.logView.severity) &&
|
||||
(!search || Object.values(group.sample).join(" ").toLowerCase().includes(search))
|
||||
).slice().sort((a, b) => state.logView.sort === "count" ? b.count - a.count : Date.parse(b.last) - Date.parse(a.last));
|
||||
};
|
||||
state.shortLogId = id => id ? id.slice(0, 8) : "";
|
||||
state.isLogIdentifier = (key, value) => typeof value === "string" && value.length > 16 && /(?:id|sha|release)$/i.test(key);
|
||||
state.compactLogValue = value => String(value).slice(0, 8) + "…" + String(value).slice(-4);
|
||||
state.logCopyStatus = "";
|
||||
state.copyLogValue = async value => {
|
||||
try { await navigator.clipboard.writeText(String(value)); state.logCopyStatus = "Full value copied"; }
|
||||
catch { state.logCopyStatus = "Copy unavailable. Expand the value to select it."; }
|
||||
};
|
||||
state.logExplanation = sample => {
|
||||
const service = sample.service || "The application";
|
||||
const event = ({job_failed:"reported a failed job",request_failed:"reported a failed request",request_aborted:"reported an aborted request",edge_request:"recorded an edge request",http_access:"recorded an HTTP request"})[sample.event] || ("recorded “" + (sample.event || "application event") + "”");
|
||||
const status = Number(sample.status || sample.httpStatus);
|
||||
const meaning = ({502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"})[status];
|
||||
return service + " " + event + (status ? " with HTTP " + status + (meaning ? " (" + meaning + ")" : "") : "") + ".";
|
||||
};
|
||||
state.logEvidence = sample => [
|
||||
sample.errorCode ? "Recorded error code: " + sample.errorCode + "." : "No error code was included in this sample.",
|
||||
sample.ms !== undefined ? "Recorded duration: " + sample.ms + " ms." : "",
|
||||
sample.attempt !== undefined ? "Recorded attempt: " + sample.attempt + "." : "",
|
||||
sample.queue ? "Queue: " + sample.queue + "." : "",
|
||||
].filter(Boolean).join(" ");
|
||||
state.occurrenceTime = value => Number.isFinite(Date.parse(value)) ? new Date(value).toLocaleString(undefined, {dateStyle:"medium",timeStyle:"medium"}) : "Time not captured";
|
||||
state.historyOccurrences = row => (row?._related || []).slice().sort((a,b) => Date.parse(b.ts)-Date.parse(a.ts));
|
||||
state.historyDetailFields = row => {
|
||||
try { const value = JSON.parse(row?._detailJson || "{}"); return value && typeof value === "object" ? Object.entries(value) : [["value", value]]; }
|
||||
catch { return [["record", row?._detailJson || ""]]; }
|
||||
};
|
||||
state.logFieldText = value => typeof value === "object" ? JSON.stringify(value) : String(value ?? "");
|
||||
state.captureErrorScroll = origin => {
|
||||
const positions = [];
|
||||
for (let element = origin?.parentElement; element; element = element.parentElement) positions.push({element,top:element.scrollTop,left:element.scrollLeft});
|
||||
return positions;
|
||||
};
|
||||
state.restoreErrorScroll = positions => positions.forEach(({element,top,left}) => { if(element.isConnected) {element.scrollTop=top;element.scrollLeft=left;} });
|
||||
let traceOrigin = null, detailOrigin = null, traceSource = null, listScroll = [];
|
||||
state.selectLog = async (group, origin) => {
|
||||
detailOrigin = origin || document.activeElement;
|
||||
listScroll = state.captureErrorScroll(detailOrigin);
|
||||
traceVersion++; state.trace = null; state.traceSelection = null; state.traceLoading = false;
|
||||
state.logDetailTab = "overview";
|
||||
state.selectedLog = group;
|
||||
await nextTick();
|
||||
if (disposed || state.selectedLog !== group || state.errorSource !== "central") return;
|
||||
document.getElementById("log-detail-title")?.focus({ preventScroll: true });
|
||||
document.querySelector(".log-inspector")?.scrollIntoView?.({ block: "start" });
|
||||
const kind = ["requestId","jobId"].find(key=>state.logTraceId(group,key));
|
||||
if (kind) state.lookupTrace(kind,group.sample[kind],document.getElementById("trace-selector-"+kind),group.sample,true);
|
||||
};
|
||||
state.closeLogDetail = async () => {
|
||||
state.selectedLog = null;
|
||||
traceVersion++; state.trace = null; state.traceSelection = null; state.traceLoading = false;
|
||||
await nextTick();
|
||||
if (detailOrigin?.isConnected) { detailOrigin.focus({preventScroll:true}); state.restoreErrorScroll(listScroll); }
|
||||
else document.getElementById("error-source-central")?.focus();
|
||||
};
|
||||
state.logFilters = { window: "1h", service: "", release: "" };
|
||||
state.logAppliedFilters = { ...state.logFilters };
|
||||
state.logData = null;
|
||||
state.logLoading = false;
|
||||
state.logFailure = "";
|
||||
state.logSnapshotStale = false;
|
||||
state.trace = null;
|
||||
state.traceLoading = false;
|
||||
state.traceSelection = null;
|
||||
const uuid = /^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i;
|
||||
let version = 0, traceVersion = 0, disposed = false;
|
||||
state.logStateText = (value) => ({
|
||||
ready: "Central logs available", empty: "No warnings, errors or HTTP 5xx returned in this window",
|
||||
disabled: "Central lookup is not configured. Application history is available in the other source.",
|
||||
misconfigured: "Central lookup configuration is invalid. Ask an operator to check it.",
|
||||
unreachable: "Central logging is unreachable. Application history is available in the other source.",
|
||||
busy: "Central lookup is busy. Retry shortly.", partial: "Partial results: a result limit or invalid record reduced coverage.",
|
||||
stale: "Central logging responds, but expected application telemetry is stale or missing.",
|
||||
}[value] || "Central log status has not been checked");
|
||||
state.refreshLogs = async () => {
|
||||
const current = ++version;
|
||||
const filters = { ...state.logFilters };
|
||||
state.logLoading = true; state.logFailure = "";
|
||||
state.trace = null; state.traceSelection = null; state.traceLoading = false; state.selectedLog = null; traceVersion++;
|
||||
try {
|
||||
const response = await http.get("/api/admin/errors/investigation", { params: filters });
|
||||
if (disposed || current !== version) return;
|
||||
state.logData = response.data;
|
||||
state.logAppliedFilters = filters;
|
||||
state.logSnapshotStale = !!response.data?.end && Date.now() - Date.parse(response.data.end) > 90000;
|
||||
} catch (error) {
|
||||
if (disposed || current !== version) return;
|
||||
state.logData = null;
|
||||
state.logFailure = error?.status === 400 ? "Use a Git release SHA or ‘unknown’ and retry." : "Could not load central log status. Retry or open Application history.";
|
||||
} finally { if (!disposed && current === version) state.logLoading = false; }
|
||||
};
|
||||
state.lookupTrace = async (kind, id, origin, sample, preserveFocus = false) => {
|
||||
if (!["requestId", "jobId"].includes(kind) || !uuid.test(id || "")) return;
|
||||
if (state.errorSource === "central" && state.selectedLog) state.logDetailTab = "timeline";
|
||||
if (state.errorSource === "history") state.historyView = "timeline";
|
||||
traceSource = state.errorSource;
|
||||
traceOrigin = origin || document.activeElement;
|
||||
const current = ++traceVersion;
|
||||
state.traceSelection = { kind, id, context: sample ? {
|
||||
event: sample.errorCode || sample.event || sample.displayMessage || sample.message,
|
||||
service: sample.service || sample.module,
|
||||
} : null }; state.trace = null; state.traceLoading = true;
|
||||
await nextTick();
|
||||
if (disposed || current !== traceVersion) return;
|
||||
const heading = document.getElementById("log-timeline-title");
|
||||
if (!preserveFocus) { heading?.focus(); heading?.scrollIntoView?.({ block: "nearest" }); }
|
||||
try {
|
||||
const response = await http.get("/api/admin/errors/correlation", { params: { kind, id, window: state.logData?.window || state.logAppliedFilters.window } });
|
||||
if (!disposed && current === traceVersion) state.trace = response.data;
|
||||
} catch {
|
||||
if (!disposed && current === traceVersion) state.trace = { state: "unreachable", events: [] };
|
||||
} finally { if (!disposed && current === traceVersion) state.traceLoading = false; }
|
||||
};
|
||||
state.showLogTimeline = origin => {
|
||||
state.logDetailTab = "timeline";
|
||||
if (state.traceSelection) return;
|
||||
const kind = ["requestId","jobId"].find(key=>state.logTraceId(state.selectedLog,key));
|
||||
if (kind) state.lookupTrace(kind,state.selectedLog.sample[kind],origin,state.selectedLog.sample);
|
||||
};
|
||||
state.closeTrace = async () => {
|
||||
state.logDetailTab = "overview";
|
||||
state.historyView = "overview";
|
||||
traceVersion++; state.trace = null; state.traceSelection = null; state.traceLoading = false;
|
||||
await nextTick();
|
||||
if (traceOrigin?.isConnected && traceSource === state.errorSource) traceOrigin.focus();
|
||||
else document.getElementById("error-source-" + state.errorSource)?.focus();
|
||||
};
|
||||
state.logTraceId = (row, kind) => {
|
||||
const value = row?.sample?.[kind] || row?.raw?.find(value => value && typeof value === "object")?.[kind];
|
||||
return uuid.test(value || "") ? value : null;
|
||||
};
|
||||
state.watch("errorSource", () => {
|
||||
traceVersion++; state.trace = null; state.traceSelection = null; state.traceLoading = false; state.selectedLog = null; state.historySelected = null; state.historyView = "overview"; state.expanded = {};
|
||||
}, false, false);
|
||||
const freshnessTimer = window.setInterval(() => {
|
||||
state.logSnapshotStale = !!state.logData?.end && Date.now() - Date.parse(state.logData.end) > 90000;
|
||||
}, 15000);
|
||||
state.on("dispose", () => { disposed = true; version++; traceVersion++; window.clearInterval(freshnessTimer); });
|
||||
state.refreshLogs();
|
||||
}
|
||||
+13
-501
@@ -1,4 +1,5 @@
|
||||
import { installLogInvestigation } from "./admin-log-investigation.js";
|
||||
import { installEntityErrors } from "./admin-errors.js";
|
||||
export { errorsAdminController } from "./admin-errors.js";
|
||||
import { reactive, onScopeDispose, nextTick } from "vue";
|
||||
import { createTimers, createListeners } from "./state.js";
|
||||
import { duration, statusMsg, number as formatNumber, date as formatDate } from "./formatters.js";
|
||||
@@ -299,6 +300,7 @@ export const repositoriesAdminController = function (state, http, location) {
|
||||
state.totalPage = Math.ceil(res.data.total / state.query.limit);
|
||||
state.repositories = res.data.results;
|
||||
state.allSelected = false;
|
||||
state.loadEntityErrors();
|
||||
},
|
||||
(err) => {
|
||||
state.fetchError = (err && err.data && err.data.error) || "Failed to load repositories";
|
||||
@@ -325,6 +327,13 @@ export const repositoriesAdminController = function (state, http, location) {
|
||||
: state.statusCountFor(k),
|
||||
onChange: () => { state.query.page = 1; },
|
||||
});
|
||||
// A search that names exactly one repository (as the Errors page links do)
|
||||
// shows that repository's issues above the list.
|
||||
state.errorRepoId = () => {
|
||||
const search = String(state.query.search || "").trim();
|
||||
return /^[A-Za-z0-9_-]{3,200}$/.test(search) && (state.repositories || []).some((repo) => repo.repoId === search) ? search : "";
|
||||
};
|
||||
installEntityErrors(state, http, () => state.errorRepoId() ? { repoId: state.errorRepoId() } : null);
|
||||
getRepositories();
|
||||
getStatusCounts();
|
||||
|
||||
@@ -682,12 +691,15 @@ export const userAdminController = function (state, http, location, params) {
|
||||
http.get("/api/admin/users/" + username, {}).then(
|
||||
(res) => {
|
||||
state.userInfo = res.data;
|
||||
state.loadEntityErrors();
|
||||
},
|
||||
(err) => {
|
||||
console.error(err);
|
||||
}
|
||||
);
|
||||
}
|
||||
// Issues whose records carry this user's internal _id (#991).
|
||||
installEntityErrors(state, http, () => /^[a-f0-9]{24}$/.test(state.userInfo?._id || "") ? { userId: state.userInfo._id } : null);
|
||||
getUser(params.username);
|
||||
getUserRepositories(params.username);
|
||||
|
||||
@@ -1421,506 +1433,6 @@ export const queuesAdminController = function (state, http, location, interval,
|
||||
});
|
||||
};
|
||||
|
||||
export const errorsAdminController = function (state, http, location, interval) {
|
||||
installLogInvestigation(state, http);
|
||||
state.redisCollecting = null;
|
||||
state.redisLoading = false;
|
||||
let historyVersion = 0, statsVersion = 0, statsPending = false, disposed = false;
|
||||
state.redisStatsState = "loading";
|
||||
const timers = createTimers();
|
||||
state.watch("user.status", () => {
|
||||
if (state.user == null) {
|
||||
location.url("/");
|
||||
}
|
||||
});
|
||||
if (state.user == null) {
|
||||
location.url("/");
|
||||
}
|
||||
|
||||
state.entries = [];
|
||||
state.visible = [];
|
||||
state.available = null;
|
||||
state.cap = 1000;
|
||||
state.total = 0;
|
||||
state.pageSize = 250;
|
||||
state.expanded = {};
|
||||
state.historySelected = null;
|
||||
state.historyView = "overview";
|
||||
let historyOrigin = null, historyScroll = [];
|
||||
state.detailTab = {};
|
||||
state.copyHint = "";
|
||||
state.parsedFilterCount = 0;
|
||||
state.stats = { last24h: 0, prev24h: 0, delta: 0, severity: { error: 0, warn: 0, info: 0 }, unique: { error: 0, warn: 0, info: 0 }, buckets: [], dropped: 0 };
|
||||
state.query = {
|
||||
search: "",
|
||||
bucket: "",
|
||||
sort: "recent",
|
||||
group: "code",
|
||||
autoRefresh: true,
|
||||
};
|
||||
|
||||
state.relTime = (iso) => {
|
||||
if (!iso) return "";
|
||||
const t = new Date(iso).getTime();
|
||||
if (isNaN(t)) return iso;
|
||||
const diff = Math.max(0, Date.now() - t);
|
||||
const s = Math.floor(diff / 1000);
|
||||
if (s < 5) return "just now";
|
||||
if (s < 60) return `${s}s ago`;
|
||||
const m = Math.floor(s / 60);
|
||||
if (m < 60) return `${m}m ago`;
|
||||
const h = Math.floor(m / 60);
|
||||
if (h < 24) return `${h}h ago`;
|
||||
const d = Math.floor(h / 24);
|
||||
if (d < 7) return `${d}d ago`;
|
||||
return new Date(iso).toLocaleDateString(undefined, { year: "numeric", month: "short", day: "numeric" });
|
||||
};
|
||||
state.absTime = (iso) => {
|
||||
if (!iso) return "";
|
||||
const d = new Date(iso);
|
||||
if (isNaN(d.getTime())) return iso;
|
||||
return d.toLocaleString(undefined, { year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" });
|
||||
};
|
||||
state.absTimeShort = (iso) => {
|
||||
if (!iso) return "";
|
||||
const d = new Date(iso);
|
||||
if (isNaN(d.getTime())) return iso;
|
||||
return d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit", second: "2-digit", hour12: false });
|
||||
};
|
||||
|
||||
// Decorate each entry once with derived display fields. Pre-computing
|
||||
// avoids returning new arrays from template functions each digest
|
||||
// cycle (which trips Angular's $rootScope:infdig).
|
||||
// snake_case-ish identifier looking like an error key. Accepts both
|
||||
// pure lowercase ("repo_not_found") and the mixed-case style this
|
||||
// codebase uses ("repoId_already_used", "invalid_repoId").
|
||||
const errorKeyRe = /^[a-zA-Z][a-zA-Z0-9]*(?:_[a-zA-Z0-9]+)+$/;
|
||||
function bucketFor(detail, level) {
|
||||
const s =
|
||||
(detail && (detail.httpStatus || detail.status)) || null;
|
||||
if (typeof s === "number") {
|
||||
if (s >= 500) return "error";
|
||||
if (s === 401 || s === 403 || s === 404) return "info";
|
||||
if (s >= 400) return "warn";
|
||||
}
|
||||
if (level === "error") return "error";
|
||||
if (level === "warn") return "warn";
|
||||
return "info";
|
||||
}
|
||||
function decorate(e) {
|
||||
// Preserve the API's safe record before adding UI-only fields. Raw and
|
||||
// Copy JSON must not silently omit fields through the summary projection.
|
||||
e._rawJson = JSON.stringify(e, null, 2);
|
||||
const detail = (e.raw || []).find(
|
||||
(a) => a && typeof a === "object" && !Array.isArray(a)
|
||||
);
|
||||
if (detail) {
|
||||
if (detail.message && errorKeyRe.test(detail.message)) {
|
||||
e.displayMessage = detail.message;
|
||||
e.displayContext = e.message;
|
||||
} else if (detail.code && errorKeyRe.test(String(detail.code))) {
|
||||
e.displayMessage = String(detail.code);
|
||||
e.displayContext = e.message;
|
||||
} else if (
|
||||
detail.name &&
|
||||
detail.name !== "AnonymousError" &&
|
||||
detail.name !== "Error"
|
||||
) {
|
||||
// Plain JS errors (SyntaxError, TypeError, RangeError, ...) — use
|
||||
// the class name as the visible code; the original message is
|
||||
// shown as italic context.
|
||||
e.displayMessage = detail.name;
|
||||
e.displayContext = detail.message || e.message;
|
||||
} else {
|
||||
e.displayMessage = e.message;
|
||||
}
|
||||
e._status = detail.httpStatus || detail.status || null;
|
||||
e._url = detail.url || null;
|
||||
e._method = detail.method || null;
|
||||
e._repoId = detail.repoId || detail.detail || null;
|
||||
e._userId = /^[a-f0-9]{24}$/.test(String(detail.userId || "")) ? detail.userId : null;
|
||||
e._viewer = ["owner", "coauthor", "admin", "visitor", "anonymous"].includes(detail.viewer) ? detail.viewer : null;
|
||||
e._detail = detail.detail && detail.detail !== e._repoId ? detail.detail : null;
|
||||
// Walk into `cause` (and `err` for streamer-style entries) to
|
||||
// surface the deepest stack.
|
||||
let s = detail.errorStack || detail.causeStack ? [detail.errorType, detail.errorStack, detail.causeType ? "Caused by " + detail.causeType : null, detail.causeStack].filter(Boolean).join("\n") : (typeof detail.stack === "string" ? detail.stack : null);
|
||||
var roots = [detail.cause, detail.err].filter(Boolean);
|
||||
for (var ri = 0; !s && ri < roots.length; ri++) {
|
||||
var c = roots[ri];
|
||||
while (!s && c && typeof c === "object") {
|
||||
if (typeof c.stack === "string") s = c.stack;
|
||||
c = c.cause;
|
||||
}
|
||||
}
|
||||
e._stack = s;
|
||||
} else {
|
||||
e.displayMessage = e.message;
|
||||
e._status = null;
|
||||
e._url = null;
|
||||
e._stack = null;
|
||||
}
|
||||
e._bucket = bucketFor(detail, e.level);
|
||||
e._detailJson = renderDisplayPayload(e, detail);
|
||||
return e;
|
||||
}
|
||||
|
||||
// Build a curated, column-aligned payload for the readable Details tab. Mirrors
|
||||
// the reference admin design: name / code / kind / httpStatus / module /
|
||||
// detail / url / ts on aligned colons. We can't just JSON.stringify the
|
||||
// raw entry because it includes the human "anonymous error" wrapper
|
||||
// arg and the keys aren't column-aligned.
|
||||
function renderDisplayPayload(entry, detail) {
|
||||
const fields = [];
|
||||
const push = (k, v) => {
|
||||
if (v === undefined || v === null || v === "") return;
|
||||
fields.push([k, v]);
|
||||
};
|
||||
for (const key of ["service", "event", "severity", "requestId", "jobId"]) push(key, detail && detail[key]);
|
||||
push("name", detail && detail.name);
|
||||
push("code", entry.displayMessage || (detail && detail.message));
|
||||
if (entry._bucket) push("kind", entry._bucket);
|
||||
push("httpStatus", detail && detail.httpStatus);
|
||||
if (detail && detail.status && !(detail.httpStatus)) push("status", detail.status);
|
||||
push("module", entry.module);
|
||||
// AnonymousError.detail() can return a JSON-encoded string for
|
||||
// structured payloads (e.g. {"repoId":"...","terms":[],"fullName":...}).
|
||||
// Try to parse it so the renderer can pretty-print it multi-line
|
||||
// instead of dumping an unreadable escape-soup blob.
|
||||
let detailValue = detail && detail.detail;
|
||||
if (typeof detailValue === "string") {
|
||||
const trimmed = detailValue.trim();
|
||||
if (trimmed[0] === "{" || trimmed[0] === "[") {
|
||||
try {
|
||||
detailValue = JSON.parse(detailValue);
|
||||
} catch {
|
||||
/* leave as string */
|
||||
}
|
||||
}
|
||||
}
|
||||
push("detail", detailValue);
|
||||
push("repoId", detail && detail.repoId);
|
||||
push("filePath", detail && detail.filePath);
|
||||
push("upstreamStatus", detail && detail.upstreamStatus);
|
||||
push("upstreamBody", detail && detail.upstreamBody);
|
||||
push("url", entry._url);
|
||||
push("err", detail && detail.err);
|
||||
push("cause", detail && !detail.err && detail.cause);
|
||||
push("ts", entry.ts);
|
||||
if (!fields.length) return JSON.stringify(entry, null, 2);
|
||||
const keyW = fields.reduce((w, f) => Math.max(w, f[0].length), 0);
|
||||
const lines = ["{"];
|
||||
fields.forEach(([k, v], i) => {
|
||||
const key = `"${k}":`.padEnd(keyW + 3, " ");
|
||||
const prefix = ` ${key} `;
|
||||
const comma = i < fields.length - 1 ? "," : "";
|
||||
let val;
|
||||
if (v && typeof v === "object") {
|
||||
// Indent continuation lines under the value column so the nested
|
||||
// object reads like a column instead of breaking flow.
|
||||
const pad = " ".repeat(prefix.length);
|
||||
val = JSON.stringify(v, null, 2)
|
||||
.split("\n")
|
||||
.map((ln, idx) => (idx === 0 ? ln : pad + ln))
|
||||
.join("\n");
|
||||
} else if (typeof v === "number" || typeof v === "boolean") {
|
||||
val = String(v);
|
||||
} else {
|
||||
val = JSON.stringify(v);
|
||||
}
|
||||
lines.push(`${prefix}${val}${comma}`);
|
||||
});
|
||||
lines.push("}");
|
||||
return lines.join("\n");
|
||||
}
|
||||
|
||||
// Lightweight filter parser. Pulls `key:value` and `status:>=400` style
|
||||
// tokens out of the search box; everything else falls back to a free
|
||||
// text contains-match against the rendered fields.
|
||||
function parseFilter(input) {
|
||||
const filters = [];
|
||||
let free = "";
|
||||
const re = /(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g;
|
||||
let lastEnd = 0;
|
||||
let m;
|
||||
while ((m = re.exec(input))) {
|
||||
free += input.slice(lastEnd, m.index);
|
||||
lastEnd = re.lastIndex;
|
||||
filters.push({ key: m[1], op: m[2] || "=", val: m[3] });
|
||||
}
|
||||
free += input.slice(lastEnd);
|
||||
return { filters, free: free.trim().toLowerCase() };
|
||||
}
|
||||
function matchFilter(row, parsed) {
|
||||
for (const f of parsed.filters) {
|
||||
const cmp = (a, b, op) => {
|
||||
const an = parseFloat(a);
|
||||
const bn = parseFloat(b);
|
||||
if (op === "=") return String(a) === String(b);
|
||||
if (op === "!=") return String(a) !== String(b);
|
||||
if (op === ">=") return an >= bn;
|
||||
if (op === "<=") return an <= bn;
|
||||
if (op === ">") return an > bn;
|
||||
if (op === "<") return an < bn;
|
||||
return true;
|
||||
};
|
||||
let v;
|
||||
if (f.key === "code") v = row.displayMessage;
|
||||
else if (f.key === "module") v = row.module;
|
||||
else if (f.key === "status") v = row._status;
|
||||
else if (f.key === "url") v = row._url;
|
||||
else if (f.key === "repo") v = row._repoId;
|
||||
else if (f.key === "level") v = row.level;
|
||||
else continue;
|
||||
if (v == null) return false;
|
||||
if (!cmp(v, f.val, f.op)) return false;
|
||||
}
|
||||
if (parsed.free) {
|
||||
const hay = (
|
||||
(row.displayMessage || "") + " " +
|
||||
(row.module || "") + " " +
|
||||
(row._url || "") + " " +
|
||||
JSON.stringify(row.raw || [])
|
||||
).toLowerCase();
|
||||
if (hay.indexOf(parsed.free) === -1) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function recompute() {
|
||||
const parsed = parseFilter(state.query.search || "");
|
||||
state.parsedFilterCount = parsed.filters.length;
|
||||
const bucket = state.query.bucket;
|
||||
let rows = state.entries.filter((e) => {
|
||||
if (bucket && e._bucket !== bucket) return false;
|
||||
return matchFilter(e, parsed);
|
||||
});
|
||||
|
||||
const group = state.query.group;
|
||||
if (group) {
|
||||
const keyOf = (r) =>
|
||||
group === "module" ? JSON.stringify([r.module, r._bucket]) : JSON.stringify([r.raw?.[0]?.service || "unknown", r.module, r.displayMessage || r.message || "_", r._bucket, r._status]);
|
||||
const map = new Map();
|
||||
for (const r of rows) {
|
||||
const k = keyOf(r);
|
||||
if (!map.has(k)) {
|
||||
const seed = Object.assign({}, r);
|
||||
seed._key = `${group}:${k}`;
|
||||
seed._related = [r];
|
||||
seed._firstSeen = r.ts;
|
||||
seed._lastHourCount = 0;
|
||||
seed.count = 1;
|
||||
map.set(k, seed);
|
||||
} else {
|
||||
const g = map.get(k);
|
||||
g.count++;
|
||||
g._related.push(r);
|
||||
if (new Date(r.ts) > new Date(g.ts)) {
|
||||
g.ts = r.ts;
|
||||
g._url = r._url;
|
||||
g._status = r._status;
|
||||
}
|
||||
if (new Date(r.ts) < new Date(g._firstSeen)) g._firstSeen = r.ts;
|
||||
}
|
||||
}
|
||||
// count "this hour"
|
||||
const cutoffH = Date.now() - 3600 * 1000;
|
||||
for (const g of map.values()) {
|
||||
g._lastHourCount = g._related.filter((r) => new Date(r.ts).getTime() >= cutoffH).length;
|
||||
}
|
||||
rows = Array.from(map.values());
|
||||
} else {
|
||||
rows = rows.map((r, i) => {
|
||||
r._key = "row:" + i + ":" + r.ts;
|
||||
r._related = [r];
|
||||
r._firstSeen = r.ts;
|
||||
r._lastHourCount = 0;
|
||||
r.count = 1;
|
||||
return r;
|
||||
});
|
||||
}
|
||||
|
||||
// Errors surface first, then warnings, then routine info; within a level, the chosen order.
|
||||
const rank = (r) => ({ error: 0, warn: 1, info: 2 })[r._bucket] ?? 1;
|
||||
if (state.query.sort === "count") {
|
||||
rows.sort((a, b) => rank(a) - rank(b) || b.count - a.count || new Date(b.ts) - new Date(a.ts));
|
||||
} else {
|
||||
rows.sort((a, b) => rank(a) - rank(b) || new Date(b.ts) - new Date(a.ts));
|
||||
}
|
||||
state.visible = rows;
|
||||
// A filter that matches nothing in the loaded window keeps reading older pages
|
||||
// (bounded) so a 5xx counted in the tiles is not reported as "No errors captured".
|
||||
const filtering = !!(state.query.bucket || (state.query.search || "").trim());
|
||||
// The default view also reads on until the server errors counted in the tiles appear.
|
||||
const errorsHidden = !filtering && (state.stats?.severity?.error || 0) > 0 && !rows.some((r) => r._bucket === "error") && state.entries.length < 1500;
|
||||
if (((filtering && !rows.length) || errorsHidden) && state.canLoadMore?.() && !state._autoLoading && state.entries.length < 2500) {
|
||||
state._autoLoading = true;
|
||||
loadEntries(true);
|
||||
}
|
||||
}
|
||||
|
||||
function loadEntries(append) {
|
||||
if (append && state.redisLoading) return;
|
||||
const current = ++historyVersion;
|
||||
state.redisLoading = true;
|
||||
// On auto-refresh after the user has paginated ("Load older"),
|
||||
// request the SAME-sized window from the head so we don't blow away
|
||||
// their loaded tail. Newer entries take the top, the oldest visible
|
||||
// ones drop off naturally as the redis list rotates.
|
||||
const offset = append ? (state.redisNextOffset || state.entries.length) : 0;
|
||||
const limit = append
|
||||
? state.pageSize
|
||||
: Math.max(state.pageSize, state.redisNextOffset || state.entries.length || state.pageSize);
|
||||
http
|
||||
.get("/api/admin/errors", { params: { offset, limit } })
|
||||
.then(
|
||||
(res) => {
|
||||
if (disposed || current !== historyVersion) return;
|
||||
state.redisLoading = false;
|
||||
const next = (res.data.entries || []).map(decorate);
|
||||
state.entries = append ? state.entries.concat(next) : next;
|
||||
state.redisRedacted = (append ? state.redisRedacted || 0 : 0) + (res.data.redactedEntries || 0);
|
||||
state.redisNextOffset = res.data.nextOffset ?? (offset + (res.data.entries || []).length);
|
||||
state.available = !!res.data.available;
|
||||
state.redisCollecting = res.data.redisCollecting !== false;
|
||||
state.cap = res.data.max || state.cap;
|
||||
state.total = res.data.total || state.entries.length;
|
||||
state._autoLoading = false;
|
||||
recompute();
|
||||
},
|
||||
() => { if (disposed || current !== historyVersion) return; state.redisLoading = false; state._autoLoading = false; state.available = false; }
|
||||
);
|
||||
}
|
||||
state.loadMore = () => loadEntries(true);
|
||||
state.canLoadMore = () => (state.redisNextOffset || state.entries.length) < state.total;
|
||||
function loadStats(background = false) {
|
||||
if (background && statsPending) return;
|
||||
const current = ++statsVersion;
|
||||
statsPending = true;
|
||||
http.get("/api/admin/errors/stats").then(
|
||||
(res) => {
|
||||
if (disposed || current !== statsVersion) return;
|
||||
statsPending = false;
|
||||
const s = res.data || {};
|
||||
state.redisStatsState = s.available === false ? "unavailable" : "ready";
|
||||
const delta = s.prev24h ? Math.round(((s.last24h - s.prev24h) / s.prev24h) * 100) : 0;
|
||||
state.stats = {
|
||||
last24h: s.last24h || 0,
|
||||
prev24h: s.prev24h || 0,
|
||||
delta,
|
||||
severity: s.severity || { error: 0, warn: 0, info: 0 },
|
||||
unique: s.unique || { error: 0, warn: 0, info: 0 },
|
||||
buckets: s.buckets || [],
|
||||
dropped: s.dropped || 0,
|
||||
};
|
||||
recompute();
|
||||
},
|
||||
() => { if (!disposed && current === statsVersion) { statsPending = false; state.redisStatsState = "unavailable"; } }
|
||||
);
|
||||
}
|
||||
function load(background = false) {
|
||||
// Polls must not invalidate a slow head or pagination request. Explicit
|
||||
// refreshes still supersede it; stats refresh independently of entries.
|
||||
if (!background || !state.redisLoading) loadEntries();
|
||||
loadStats(background);
|
||||
}
|
||||
|
||||
// Volume chart: errors and warnings carry the height (scaled to their own peak, up to 44px);
|
||||
// routine info traffic is a faint band on top, capped at 16px. Exact counts are in the tooltip.
|
||||
state.barPx = (b, key) => {
|
||||
const all = state.stats.buckets || [];
|
||||
let maxEW = 0, maxInfo = 0;
|
||||
for (const x of all) { maxEW = Math.max(maxEW, (x.error || 0) + (x.warn || 0)); maxInfo = Math.max(maxInfo, x.info || 0); }
|
||||
const part = b[key] || 0;
|
||||
if (!part) return 0;
|
||||
if (key === "info") return maxInfo ? Math.max(2, Math.round((part / maxInfo) * (maxEW ? 16 : 60))) : 0;
|
||||
const ew = (b.error || 0) + (b.warn || 0);
|
||||
const h = Math.round((ew / maxEW) * 44);
|
||||
return Math.max(4, Math.round((part / ew) * h));
|
||||
};
|
||||
state.bucketTitle = (b) => {
|
||||
const t = new Date(b.hour);
|
||||
return `${t.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })} · ${b.error || 0} err · ${b.warn || 0} warn · ${b.info || 0} info`;
|
||||
};
|
||||
|
||||
state.toggle = async (row, origin) => {
|
||||
historyOrigin = origin || document.activeElement;
|
||||
historyScroll = state.captureErrorScroll(historyOrigin);
|
||||
state.historySelected = row;
|
||||
state.historyView = "overview";
|
||||
state.expanded = {[row._key]:true};
|
||||
await nextTick();
|
||||
document.getElementById("history-inspector-title")?.focus({preventScroll:true});
|
||||
document.getElementById("history-inspector-title")?.scrollIntoView?.({block:"nearest"});
|
||||
};
|
||||
state.showHistoryTimeline = origin => {
|
||||
state.historyView = "timeline";
|
||||
if(state.traceSelection) return;
|
||||
const kind=["requestId","jobId"].find(key=>state.logTraceId(state.historySelected,key));
|
||||
if(kind) state.lookupTrace(kind,state.logTraceId(state.historySelected,kind),origin,state.historySelected);
|
||||
};
|
||||
state.closeHistory = async () => {
|
||||
const key = state.historySelected?._key;
|
||||
state.historySelected = null; state.expanded = {};
|
||||
if (state.traceSelection) await state.closeTrace();
|
||||
await nextTick();
|
||||
const target = historyOrigin?.isConnected ? historyOrigin : [...document.querySelectorAll('[data-history-key]')].find(node=>node.dataset.historyKey===key);
|
||||
target?.focus({preventScroll:true});
|
||||
state.restoreErrorScroll(historyScroll);
|
||||
};
|
||||
state.setBucket = (b) => {
|
||||
state.query.bucket = b;
|
||||
};
|
||||
|
||||
state.refreshNow = () => { state.historySelected = null; state.historyView = "overview"; state.expanded = {}; if (state.traceSelection) state.closeTrace(); load(); };
|
||||
state.clearAll = () => {
|
||||
if (!confirm("Clear Redis error history? Central logs are unaffected.")) return;
|
||||
http.delete("/api/admin/errors").then(() => state.refreshNow(), (err) => console.error(err));
|
||||
};
|
||||
state.exportCsv = () => {
|
||||
const cols = ["ts", "level", "module", "displayMessage", "_status", "_url", "_repoId"];
|
||||
const lines = [cols.join(",")];
|
||||
for (const r of state.visible) {
|
||||
lines.push(cols.map((c) => {
|
||||
const v = r[c] == null ? "" : String(r[c]);
|
||||
return /[",\n]/.test(v) ? `"${v.replace(/"/g, '""')}"` : v;
|
||||
}).join(","));
|
||||
}
|
||||
const blob = new Blob([lines.join("\n")], { type: "text/csv;charset=utf-8" });
|
||||
const url = URL.createObjectURL(blob);
|
||||
const a = document.createElement("a");
|
||||
a.href = url;
|
||||
a.download = `errors-${new Date().toISOString().slice(0, 19)}.csv`;
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
URL.revokeObjectURL(url);
|
||||
};
|
||||
function flashCopy(label) {
|
||||
state.copyHint = `${label} copied`;
|
||||
timers.timeout(() => { state.copyHint = ""; }, 1500);
|
||||
}
|
||||
state.copyJson = (row) => {
|
||||
navigator.clipboard.writeText(row._rawJson).then(() => flashCopy("JSON"));
|
||||
};
|
||||
state.copyCurl = (row) => {
|
||||
if (!row._url) return;
|
||||
const method = row._method || "GET";
|
||||
const cmd = `curl -X ${method} '${window.location.origin}${row._url}'`;
|
||||
navigator.clipboard.writeText(cmd).then(() => flashCopy("curl"));
|
||||
};
|
||||
|
||||
load();
|
||||
const stop = interval(() => {
|
||||
if (state.query.autoRefresh) load(true);
|
||||
}, 15000);
|
||||
state.on("dispose", () => { disposed = true; historyVersion++; statsVersion++; interval.cancel(stop); });
|
||||
|
||||
state.watch("query.search", recompute);
|
||||
state.watch("query.bucket", recompute);
|
||||
state.watch("query.sort", recompute);
|
||||
state.watch("query.group", recompute);
|
||||
};
|
||||
|
||||
export const overviewAdminController = function (state, http, location, interval) {
|
||||
state.Math = Math;
|
||||
state.watch("user.status", () => {
|
||||
|
||||
@@ -5,6 +5,7 @@ import { render as signinTemplate } from "../partials/signin.htm";
|
||||
import { render as template0 } from "../partials/404.htm";
|
||||
import { render as template1 } from "../partials/admin/conferences.htm";
|
||||
import { render as template2 } from "../partials/admin/errors.htm";
|
||||
import { render as adminEntityErrorsTemplate } from "../partials/admin/entityErrors.htm";
|
||||
import { render as template3 } from "../partials/admin/overview.htm";
|
||||
import { render as template4 } from "../partials/admin/queues.htm";
|
||||
import { render as template5 } from "../partials/admin/repositories.htm";
|
||||
@@ -39,6 +40,7 @@ export const templates = {
|
||||
"partials/admin/emails.htm": adminEmailsTemplate,
|
||||
"partials/admin/conferences.htm": template1,
|
||||
"partials/admin/errors.htm": template2,
|
||||
"partials/admin/entityErrors.htm": adminEntityErrorsTemplate,
|
||||
"partials/admin/overview.htm": template3,
|
||||
"partials/admin/queues.htm": template4,
|
||||
"partials/admin/repositories.htm": template5,
|
||||
|
||||
Vendored
+54
-55
@@ -1,55 +1,54 @@
|
||||
"use strict";(()=>{var vl=Object.defineProperty;var yl=e=>{throw TypeError(e)};var Sf=(e,t,s)=>t in e?vl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var Ef=(e,t)=>{for(var s in t)vl(e,s,{get:t[s],enumerable:!0})};var tt=(e,t,s)=>Sf(e,typeof t!="symbol"?t+"":t,s),Ar=(e,t,s)=>t.has(e)||yl("Cannot "+s);var ae=(e,t,s)=>(Ar(e,t,"read from private field"),s?s.call(e):t.get(e)),Le=(e,t,s)=>t.has(e)?yl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Ue=(e,t,s,i)=>(Ar(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),qe=(e,t,s)=>(Ar(e,t,"access private method"),s);var bl=(e,t,s,i)=>({set _(o){Ue(e,t,o,s)},get _(){return ae(e,t,i)}});var ve=["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 ye={markdown:"/script/markdown.6c8dfb7b1d.min.js",notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",editor:"/script/editor.4f142d3adc.min.js"};function wl(e){let t=e.location.hash.slice(1);if(e.history.replaceState(null,"","/review-link"),t.length>2048)return null;let s=new URLSearchParams(t);if([...s.keys()].length!==3||[...s.keys()].some(u=>!["clientId","intentId","token"].includes(u)))return null;let i=s.get("clientId"),o=s.get("intentId"),r=s.get("token");return!/^[a-f0-9]{32}$/.test(i||"")||!/^[a-f0-9]{32}$/.test(o||"")||!/^[a-f0-9]{64}$/.test(r||"")?null:{contract:"4open.artifacts/1",clientId:i,intentId:o,token:r}}function kl(e,t){let{http:s,promises:i,window:o}=t,r=t.takeReviewHandoff(),u=r?{clientId:r.clientId,intentId:r.intentId}:null,f,c,v,h,y,g=!0,C,w=i.defer(),S=()=>[...o.crypto.getRandomValues(new Uint8Array(16))].map(_=>_.toString(16).padStart(2,"0")).join("");Object.assign(e,{repositoryId:"",handoffEnabled:!1,busy:!1,preview:null,acceptAccess:!1,acceptRetention:!1,uncertain:!1,saved:!1,expired:!1,error:r?"":"Open a new artifact link from your submission. This link is missing or invalid."});let N=()=>g&&e.user?.username===y;function b(){g=!1,r=f=c=void 0,w.resolve(),o.clearTimeout(C)}e.on("dispose",b),e.on("routeLeave",b),e.watch(()=>e.user?.username,_=>{!y&&_?y=_:y&&_!==y&&(b(),e.preview=null,e.repositoryId="",e.busy=!1,e.saved=!1,e.handoffEnabled=!1,e.error="Your account changed. Open a new artifact link from your submission.")});let T=()=>({timeout:w.promise,headers:{"Content-Type":"application/json","X-Review-CSRF":c}}),M=_=>_?.status===404?"Artifact linking is not available on this server.":_?.status===401?"Sign in, then open a new artifact link from your submission.":_?.status===403?"This account cannot approve this repository or this link.":"The request could not be completed. You can retry from this page.";e.loadPreview=async()=>{if(!g||!r||e.busy||e.uncertain||e.saved||!e.user?.username)return;y=e.user.username;let _=e.repositoryId.trim();if(!/^[A-Za-z0-9_-]{3,128}$/.test(_)){e.error="Enter the anonymous repository ID from its URL.";return}e.busy=!0,e.error="",e.preview=null,f=void 0,e.acceptAccess=e.acceptRetention=!1,e.expired=!1,o.clearTimeout(C),h||(h=S());try{let H=(await s.get("/api/review-consent/csrf",{timeout:w.promise})).data;if(!N())return;if(c=H.csrf,e.handoffEnabled=H.handoffEnabled===!0,!/^[a-f0-9]{64}$/.test(c||""))throw new Error("invalid_csrf");let oe=(await s.post("/api/review-consent/preview",{repositoryId:_,intent:{...r,requestId:h}},T())).data;if(!N())return;if(!oe||typeof oe.ticket!="string"||!oe.ticket||oe.ticket.length>8192||typeof oe.repositoryName!="string"||!["restricted-review","anonymous-liLine truncated
|
||||
`))),e[bn]=Bo(o);let r=i||o.props&&o.props.type==="number";Fn(e,t?"change":"input",u=>{u.target.composing||e[bn](ga(e.value,s,r))}),(s||r)&&Fn(e,"change",()=>{e.value=ga(e.value,s,r)}),t||(Fn(e,"compositionstart",Th),Fn(e,"compositionend",au),Fn(e,"change",au))},mounted(e,{value:t,modifiers:{trim:s,number:i}}){let o=t??"",r=e[Hi];delete e[Hi],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[bn](ga(e.value,s,i)):e.value=o},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:i,trim:o,number:r}},u){if(e[bn]=Bo(u),e.composing)return;let f=(r||e.type==="number")&&!/^0\d/.test(e.value)?Vo(e.value):e.value,c=t??"";if(f===c)return;let v=e.getRootNode();(v instanceof Document||v instanceof ShadowRoot)&&v.activeElement===e&&e.type!=="range"&&(i&&t===s||o&&e.value.trim()===c)||(e.value=c)}},ya={deep:!0,created(e,t,s){e[bn]=Bo(s),Fn(e,"change",()=>{let i=e._modelValue,o=Fs(e),r=e.checked,u=e[bn];if(Ee(i)){let f=vi(i,o),c=f!==-1;if(r&&!c)u(i.concat(o));else if(!r&&c){let v=[...i];v.splice(f,1),u(v)}}else if(Zt(i)){let f=new Set(i);r?f.add(o):f.delete(o),u(f)}else u(fu(e,r))})},mounted:lu,beforeUpdate(e,t,s){e[bn]=Bo(s),lu(e,t,s)}};function lu(e,{value:t,oldValue:s},i){e._modelValue=t;let o;if(Ee(t))o=vi(t,i.props.value)>-1;else if(Zt(t))o=t.has(i.props.value);else{if(t===s)return;o=xt(t,fu(e,!0))}e.checked!==o&&(e.checked=o)}var Nt={deep:!0,created(e,{value:t,modifiers:{number:s}},i){e._modelValue=t,Fn(e,"change",()=>{let o=Array.prototype.filter.call(e.options,c=>c.selected).map(c=>s?Vo(Fs(c)):Fs(c)),r=e.multiple,u=r?Zt(e._modelValue)?new Set(o):o:o[0],f=e._pendingValue=[r,r?Ee(u)?o.slice():o:u];try{e[bn](u)}finally{ze(()=>{e._pendingValue===f&&(e._pendingValue=void 0)})}}),e[bn]=Bo(i)},mounted(e,{value:t}){du(e,t)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[bn]=Bo(s)},updated(e,{value:t}){let s=e._pendingValue;e._pendingValue=void 0,(!s||s[0]!==e.multiple||!Ph(t,s[1],s[0]))&&du(e,t)}};function Ph(e,t,s){if(!s)return xt(e,t);if(Ee(e))return xt(e,t);if(Zt(e)){if(e.size!==t.length)return!1;for(let i of t)if(!e.has(i))return!1;return!0}return!1}function du(e,t){let s=e.multiple,i=Ee(t);if(!(s&&!i&&!Zt(t))){for(let o=0,r=e.options.length;o<r;o++){let u=e.options[o],f=Fs(u);if(s)if(i){let c=typeof f;c==="string"||c==="number"?u.selected=t.some(v=>String(v)===String(f)):u.selected=vi(t,f)>-1}else u.selected=t.has(f);else if(xt(Fs(u),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Fs(e){return"_value"in e?e._value:e.value}function fu(e,t){let s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}var Dh=["ctrl","shift","alt","meta"],Ah={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)=>Dh.some(s=>e[`${s}Key`]&&!t.includes(s))},de=(e,t)=>{if(!e)return e;let s=e._withMods||(e._withMods={}),i=t.join(".");return s[i]||(s[i]=((o,...r)=>{for(let u=0;u<t.length;u++){let f=Ah[t[u]];if(f&&f(o,t))return}return e(o,...r)}))},Ih={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},$t=(e,t)=>{let s=e._withKeys||(e._withKeys={}),i=t.join(".");return s[i]||(s[i]=(o=>{if(!("key"in o))return;let r=dn(o.key);if(t.some(u=>u===r||Ih[u]===r))return e(o)}))},Oh=pt({patchProp:Eh},lh),uu;function Mh(){return uu||(uu=Hd(Oh))}var mu=((...e)=>{let t=Mh().createApp(...e),{mount:s}=t;return t.mount=i=>{let o=Lh(i);if(!o)return;let r=t._component;!Ae(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");let u=s(o,!1,Vh(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),u},t});function Vh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Lh(e){return at(e)?document.querySelector(e):e}var co=typeof document<"u";function gu(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function qh(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&gu(e.default)}var Ze=Object.assign;function Gi(e,t){let s={};for(let i in t){let o=t[i];s[i]=Xt(o)?o.map(e):e(o)}return s}var Ho=()=>{},Xt=Array.isArray;function ka(e,t){let s={};for(let i in e)s[i]=i in t?t[i]:e[i];return s}var vu=/#/g,$h=/&/g,Fh=/\//g,_h=/=/g,Uh=/\?/g,yu=/\+/g,Bh=/%5B/g,zh=/%5D/g,bu=/%5E/g,Hh=/%60/g,wu=/%7B/g,jh=/%7C/g,ku=/%7D/g,Gh=/%20/g;function Ca(e){return e==null?"":encodeURI(""+e).replace(jh,"|").replace(Bh,"[").replace(zh,"]")}function Cu(e){return Ca(e).replace(wu,"{").replace(ku,"}").replace(bu,"^")}function ba(e){return Ca(e).replace(yu,"%2B").replace(Gh,"+").replace(vu,"%23").replace($h,"%26").replace(Hh,"`").replace(wu,"{").replace(ku,"}").replace(bu,"^")}function Wh(e){return ba(e).replace(_h,"%3D")}function Kh(e){return CLine truncated
|
||||
"use strict";(()=>{var kl=Object.defineProperty;var Cl=e=>{throw TypeError(e)};var Mf=(e,t,s)=>t in e?kl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var Vf=(e,t)=>{for(var s in t)kl(e,s,{get:t[s],enumerable:!0})};var tt=(e,t,s)=>Mf(e,typeof t!="symbol"?t+"":t,s),Ar=(e,t,s)=>t.has(e)||Cl("Cannot "+s);var re=(e,t,s)=>(Ar(e,t,"read from private field"),s?s.call(e):t.get(e)),qe=(e,t,s)=>t.has(e)?Cl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Ue=(e,t,s,r)=>(Ar(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),Le=(e,t,s)=>(Ar(e,t,"access private method"),s);var El=(e,t,s,r)=>({set _(i){Ue(e,t,i,s)},get _(){return re(e,t,r)}});var ge=["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 ve={markdown:"/script/markdown.6c8dfb7b1d.min.js",notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",editor:"/script/editor.4f142d3adc.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js"};function Sl(e){let t=e.location.hash.slice(1);if(e.history.replaceState(null,"","/review-link"),t.length>2048)return null;let s=new URLSearchParams(t);if([...s.keys()].length!==3||[...s.keys()].some(u=>!["clientId","intentId","token"].includes(u)))return null;let r=s.get("clientId"),i=s.get("intentId"),o=s.get("token");return!/^[a-f0-9]{32}$/.test(r||"")||!/^[a-f0-9]{32}$/.test(i||"")||!/^[a-f0-9]{64}$/.test(o||"")?null:{contract:"4open.artifacts/1",clientId:r,intentId:i,token:o}}function Nl(e,t){let{http:s,promises:r,window:i}=t,o=t.takeReviewHandoff(),u=o?{clientId:o.clientId,intentId:o.intentId}:null,p,c,v,h,y,g=!0,E,k=r.defer(),C=()=>[...i.crypto.getRandomValues(new Uint8Array(16))].map(F=>F.toString(16).padStart(2,"0")).join("");Object.assign(e,{repositoryId:"",handoffEnabled:!1,busy:!1,preview:null,acceptAccess:!1,acceptRetention:!1,uncertain:!1,saved:!1,expired:!1,error:o?"":"Open a new artifact link from your submission. This link is missing or invalid."});let N=()=>g&&e.user?.username===y;function b(){g=!1,o=p=c=void 0,k.resolve(),i.clearTimeout(E)}e.on("dispose",b),e.on("routeLeave",b),e.watch(()=>e.user?.username,F=>{!y&&F?y=F:y&&F!==y&&(b(),e.preview=null,e.repositoryId="",e.busy=!1,e.saved=!1,e.handoffEnabled=!1,e.error="Your account changed. Open a new artifact link from your submission.")});let D=()=>({timeout:k.promise,headers:{"Content-Type":"application/json","X-Review-CSRF":c}}),V=F=>F?.status===404?"Artifact linking is not available on this server.":F?.status===401?"Sign in, then open a new artifact link from your submission.":F?.status===403?"This account cannot approve this repository or this link.":"The request could not be completed. You can retry from this page.";e.loadPreview=async()=>{if(!g||!o||e.busy||e.uncertain||e.saved||!e.user?.username)return;y=e.user.username;let F=e.repositoryId.trim();if(!/^[A-Za-z0-9_-]{3,128}$/.test(F)){e.error="Enter the anonymous repository ID from its URL.";return}e.busy=!0,e.error="",e.preview=null,p=void 0,e.acceptAccess=e.acceptRetention=!1,e.expired=!1,i.clearTimeout(E),h||(h=C());try{let _=(await s.get("/api/review-consent/csrf",{timeout:k.promise})).data;if(!N())return;if(c=_.csrf,e.handoffEnabled=_.handoffEnabled===!0,!/^[a-f0-9]{64}$/.test(c||""))throw new Error("invalid_csrf");let x=(await s.post("/api/review-consent/preview",{repositoryId:F,intent:{...o,requestId:h}},D())).data;if(!N())return;if(!x||typeof x.ticket!="string"||!x.ticket||x.ticket.length>8192||typeof x.repositoryName!="string"||!["restricted-review","anonymous-link"].iLine truncated
|
||||
`))),e[bn]=Bs(i);let o=r||i.props&&i.props.type==="number";$n(e,t?"change":"input",u=>{u.target.composing||e[bn](va(e.value,s,o))}),(s||o)&&$n(e,"change",()=>{e.value=va(e.value,s,o)}),t||($n(e,"compositionstart",Fh),$n(e,"compositionend",cu),$n(e,"change",cu))},mounted(e,{value:t,modifiers:{trim:s,number:r}}){let i=t??"",o=e[zi];delete e[zi],o!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==o?e[bn](va(e.value,s,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:r,trim:i,number:o}},u){if(e[bn]=Bs(u),e.composing)return;let p=(o||e.type==="number")&&!/^0\d/.test(e.value)?Ms(e.value):e.value,c=t??"";if(p===c)return;let v=e.getRootNode();(v instanceof Document||v instanceof ShadowRoot)&&v.activeElement===e&&e.type!=="range"&&(r&&t===s||i&&e.value.trim()===c)||(e.value=c)}},ba={deep:!0,created(e,t,s){e[bn]=Bs(s),$n(e,"change",()=>{let r=e._modelValue,i=$o(e),o=e.checked,u=e[bn];if(Se(r)){let p=vi(r,i),c=p!==-1;if(o&&!c)u(r.concat(i));else if(!o&&c){let v=[...r];v.splice(p,1),u(v)}}else if(Zt(r)){let p=new Set(r);o?p.add(i):p.delete(i),u(p)}else u(vu(e,o))})},mounted:pu,beforeUpdate(e,t,s){e[bn]=Bs(s),pu(e,t,s)}};function pu(e,{value:t,oldValue:s},r){e._modelValue=t;let i;if(Se(t))i=vi(t,r.props.value)>-1;else if(Zt(t))i=t.has(r.props.value);else{if(t===s)return;i=xt(t,vu(e,!0))}e.checked!==i&&(e.checked=i)}var Tt={deep:!0,created(e,{value:t,modifiers:{number:s}},r){e._modelValue=t,$n(e,"change",()=>{let i=Array.prototype.filter.call(e.options,c=>c.selected).map(c=>s?Ms($o(c)):$o(c)),o=e.multiple,u=o?Zt(e._modelValue)?new Set(i):i:i[0],p=e._pendingValue=[o,o?Se(u)?i.slice():i:u];try{e[bn](u)}finally{Xe(()=>{e._pendingValue===p&&(e._pendingValue=void 0)})}}),e[bn]=Bs(r)},mounted(e,{value:t}){fu(e,t)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[bn]=Bs(s)},updated(e,{value:t}){let s=e._pendingValue;e._pendingValue=void 0,(!s||s[0]!==e.multiple||!$h(t,s[1],s[0]))&&fu(e,t)}};function $h(e,t,s){if(!s)return xt(e,t);if(Se(e))return xt(e,t);if(Zt(e)){if(e.size!==t.length)return!1;for(let r of t)if(!e.has(r))return!1;return!0}return!1}function fu(e,t){let s=e.multiple,r=Se(t);if(!(s&&!r&&!Zt(t))){for(let i=0,o=e.options.length;i<o;i++){let u=e.options[i],p=$o(u);if(s)if(r){let c=typeof p;c==="string"||c==="number"?u.selected=t.some(v=>String(v)===String(p)):u.selected=vi(t,p)>-1}else u.selected=t.has(p);else if(xt($o(u),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function $o(e){return"_value"in e?e._value:e.value}function vu(e,t){let s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}var Uh=["ctrl","shift","alt","meta"],Bh={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)=>Uh.some(s=>e[`${s}Key`]&&!t.includes(s))},le=(e,t)=>{if(!e)return e;let s=e._withMods||(e._withMods={}),r=t.join(".");return s[r]||(s[r]=((i,...o)=>{for(let u=0;u<t.length;u++){let p=Bh[t[u]];if(p&&p(i,t))return}return e(i,...o)}))},_h={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ft=(e,t)=>{let s=e._withKeys||(e._withKeys={}),r=t.join(".");return s[r]||(s[r]=(i=>{if(!("key"in i))return;let o=dn(i.key);if(t.some(u=>u===o||_h[u]===o))return e(i)}))},Hh=pt({patchProp:Vh},yh),mu;function zh(){return mu||(mu=Kd(Hh))}var yu=((...e)=>{let t=zh().createApp(...e),{mount:s}=t;return t.mount=r=>{let i=Gh(r);if(!i)return;let o=t._component;!Ae(o)&&!o.render&&!o.template&&(o.template=i.innerHTML),i.nodeType===1&&(i.textContent="");let u=s(i,!1,jh(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),u},t});function jh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Gh(e){return at(e)?document.querySelector(e):e}var us=typeof document<"u";function wu(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Wh(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&wu(e.default)}var Je=Object.assign;function Gi(e,t){let s={};for(let r in t){let i=t[r];s[r]=Qt(i)?i.map(e):e(i)}return s}var Hs=()=>{},Qt=Array.isArray;function Ca(e,t){let s={};for(let r in e)s[r]=r in t?t[r]:e[r];return s}var ku=/#/g,Kh=/&/g,Yh=/\//g,Xh=/=/g,Qh=/\?/g,Cu=/\+/g,Jh=/%5B/g,Zh=/%5D/g,Eu=/%5E/g,xh=/%60/g,Su=/%7B/g,eg=/%7C/g,Nu=/%7D/g,tg=/%20/g;function Ea(e){return e==null?"":encodeURI(""+e).replace(eg,"|").replace(Jh,"[").replace(Zh,"]")}function Ru(e){return Ea(e).replace(Su,"{").replace(Nu,"}").replace(Eu,"^")}function wa(e){return Ea(e).replace(Cu,"%2B").replace(tg,"+").replace(ku,"%23").replace(Kh,"%26").replace(xh,"`").replace(Su,"{").replace(Nu,"}").replace(Eu,"^")}function ng(e){return wa(e).replace(Xh,"%3D")}function sg(e){return ELine truncated
|
||||
${JSON.stringify(e)}${t?`
|
||||
while being at
|
||||
`+JSON.stringify(t):""}`},[ut.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${ng(t)}" via a navigation guard.`},[ut.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[ut.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[ut.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function uo(e,t){return Ze(new Error,{type:e,[Iu]:!0},t)}function wn(e,t){return e instanceof Error&&Iu in e&&(t==null||!!(e.type&t))}var tg=["params","query","hash"];function ng(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let s of tg)s in e&&(t[s]=e[s]);return JSON.stringify(t,null,2)}function Ou(e){let t={};if(e===""||e==="?")return t;let s=(e[0]==="?"?e.slice(1):e).split("&");for(let i=0;i<s.length;++i){let o=s[i].replace(yu," "),r=o.indexOf("="),u=zo(r<0?o:o.slice(0,r)),f=r<0?null:zo(o.slice(r+1));if(u in t){let c=t[u];Xt(c)||(c=t[u]=[c]),c.push(f)}else t[u]=f}return t}function Ta(e){let t="";for(let s in e){let i=e[s];if(s=Wh(s),i==null){i!==void 0&&(t+=(t.length?"&":"")+s);continue}(Xt(i)?i.map(o=>o&&ba(o)):[i&&ba(i)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+s,o!=null&&(t+="="+o))})}return t}function Mu(e){let t={};for(let s in e){let i=e[s];i!==void 0&&(t[s]=Xt(i)?i.map(o=>o==null?null:""+o):i==null?i:""+i)}return t}var Vu=Symbol(""),Pa=Symbol(""),Ji=Symbol(""),Xi=Symbol(""),Qi=Symbol("");function jo(){let e=[];function t(i){return e.push(i),()=>{let o=e.indexOf(i);o>-1&&e.splice(o,1)}}function s(){e=[]}return{add:t,list:()=>e.slice(),reset:s}}function In(e,t,s,i,o,r=u=>u()){let u=i&&(i.enterCallbacks[o]=i.enterCallbacks[o]||[]);return()=>new Promise((f,c)=>{let v=g=>{g===!1?c(uo(ut.NAVIGATION_ABORTED,{from:s,to:t})):g instanceof Error?c(g):eg(g)?c(uo(ut.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(u&&i.enterCallbacks[o]===u&&typeof g=="function"&&u.push(g),f())},h=r(()=>e.call(i&&i.instances[o],t,s,v)),y=Promise.resolve(h);e.length<3&&(y=y.then(v)),y.catch(g=>c(g))})}function Zi(e,t,s,i,o=r=>r()){let r=[];for(let u of e)for(let f in u.components){let c=u.components[f];if(!(t!=="beforeRouteEnter"&&!u.instances[f]))if(gu(c)){let v=(c.__vccOpts||c)[t];v&&r.push(In(v,s,i,u,f,o))}else{let v=c();r.push(()=>v.then(h=>{if(!h)throw new Error(`Couldn't resolve component "${f}" at "${u.path}"`);let y=qh(h)?h.default:h;u.mods[f]=h,u.components[f]=y;let g=(y.__vccOpts||y)[t];return g&&In(g,s,i,u,f,o)()}))}}return r}function Lu(e,t){let s=[],i=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let u=0;u<r;u++){let f=t.matched[u];f&&(e.matched.find(v=>lo(v,f))?i.push(f):s.push(f));let c=e.matched[u];c&&(t.matched.find(v=>lo(v,c))||o.push(c))}return[s,i,o]}var og=()=>location.protocol+"//"+location.host;function Wu(e,t){let{pathname:s,search:i,hash:o}=t,r=e.indexOf("#");if(r>-1){let u=o.includes(e.slice(r))?e.slice(r).length:1,f=o.slice(u);return f[0]!=="/"&&(f="/"+f),Sa(f,"")}return Sa(s,e)+i+o}function sg(e,t,s,i){let o=[],r=[],u=null,f=({state:g})=>{let C=Wu(e,location),w=s.value,S=t.value,N=0;if(g){if(s.value=C,t.value=g,u&&u===w){u=null;return}N=S?g.position-S.position:0}else i(C);o.forEach(b=>{b(s.value,w,{delta:N,type:Ki.pop,direction:N?N>0?Yi.forward:Yi.back:Yi.unknown})})};function c(){u=s.value}function v(g){o.push(g);let C=()=>{let w=o.indexOf(g);w>-1&&o.splice(w,1)};return r.push(C),C}function h(){if(document.visibilityState==="hidden"){let{history:g}=window;if(!g.state)return;g.replaceState(Ze({},g.state,{scroll:_s()}),"")}}function y(){for(let g of r)g();r=[],window.removeEventListener("popstate",f),window.removeEventListener("pagehide",h),document.removeEventListener("visibilitychange",h)}return window.addEventListener("popstate",f),window.addEventListener("pagehide",h),document.addEventListener("visibilitychange",h),{pauseListeners:c,listen:v,destroy:y}}function qu(e,t,s,i=!1,o=!1){return{back:e,current:t,forward:s,replaced:i,position:window.history.length,scroll:o?_s():null}}function ig(e){let{history:t,location:s}=window,i={value:Wu(e,s)},o={value:t.state};o.value||r(i.value,{back:null,current:i.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(c,v,h){let y=e.indexOf("#"),g=y>-1?(s.host&&document.querySelector("base")?e:e.slice(y))+c:og()+e+c;try{t[h?"replaceState":"pushState"](v,"",g),o.value=v}catch(C){console.error(C),s[h?"replace":"assign"](g)}}function u(c,v){r(c,Ze({},t.state,qu(o.value.back,c,o.value.forward,!0),v,{position:o.value.position}),!0),i.value=c}function f(c,v){let h=Ze({},o.value,t.state,{forward:c,scroll:_s()});r(h.current,h,!0),r(c,Ze({},qu(i.value,c,null),{position:h.position+1},v),!1),i.value=c}return{location:i,state:o,push:f,replace:u}}function Ku(e){e=Ru(e);let t=ig(e),s=sg(e,t.state,t.location,t.replace);function i(r,u=!0){u||s.pauseListeners(),history.go(r)}let o=Ze({locatLine truncated
|
||||
`).forEach((F,E)=>{for(let[q,W]of C){let j=q.exec(F);if(j&&!/^(if|for|while|switch|return|catch)$/.test(j[1])){I.push({name:j[1],kind:W,line:E+1});break}}}),w={content:e.content,list:I.slice(0,300)},w.list},e.goToSymbol=function(I){e.symbolsOpen=!1;let F=e.codeEditor;F&&(F.scrollToLine(I-1,!0,!0,()=>{}),F.gotoLine(I,0,!0),window.history.replaceState(null,"",window.location.pathname+window.location.search+"#L"+I),window.dispatchEvent(new HashChangeEvent("hashchange")))},e.gotoLine=function(){e.codeEditor&&(e.moreOpen=!1,e.gotoError="",e.gotoValue=String(e.codeEditor.getCursorPosition().row+1),e.gotoOpen=!0,setTimeout(()=>{let I=window.document.getElementById("goto-input");I&&(I.focus(),I.select())},0))},e.closeGoto=function(){e.gotoOpen=!1,e.gotoError="",e.codeEditor?.focus()},e.submitGoto=function(){let I=e.codeEditor;if(!I)return;let F=/^\s*:?\s*(\d+)\s*(?:[:,]\s*(\d+))?\s*$/.exec(e.gotoValue||""),E=I.session.getLength();if(!F||+F[1]<1||+F[1]>E){e.gotoError="Enter a line from 1 to "+E;return}I.gotoLine(+F[1],F[2]?Math.max(0,+F[2]-1):0,!0),e.gotoOpen=!1,e.gotoError="",I.focus()},e.rootEntries=function(){return[...e.files||[]].sort((I,F)=>{let E=I.size==null,q=F.size==null;return E!==q?E?-1:1:I.name.localeCompare(F.name)})},e.formatSize=function(I){if(I==null)return"";if(I<1024)return I+" B";let F=I/1024,E=q=>q.toFixed(1).replace(/\.0$/,"");return F<1024?E(F)+" KB":F<1024*1024?E(F/1024)+" MB":E(F/1024/1024)+" GB"},e.fileSize=function(I){if(!I)return null;let F=I.replace(/^\/+/,""),E=(e.files||[]).find(q=>(q.path?q.path+"/":"")+q.name===F);return E&&E.size!=null?E.size:null},e.revealFolder=function(I){e.sidebarHidden=!1,e.sidebarCollapsed=!1,ze(()=>{let F=window.document.querySelector('.files a[data-path="/'+(window.CSS?.escape?window.CSS.escape(I):I)+'"]');F&&(F.closest("li")?.classList.contains("open")||F.click(),F.scrollIntoView({block:"nearest"}),F.focus())})};let S={content:null,n:0},N=I=>{if(S.content===I)return S.n;let F=I;if(typeof F=="string")try{F=JSON.parse(F)}catch{F=null}let E=[],q=j=>{Array.isArray(j)?E.push(j.join("")):typeof j=="string"&&E.push(j)};(F&&(F.cells||(F.worksheets||[]).flatMap(j=>j.cells||[]))||[]).forEach(j=>{q(j?.source??j?.input),(j?.outputs||[]).forEach(Y=>{q(Y?.text),Y?.data&&(q(Y.data["text/plain"]),q(Y.data["text/markdown"]),q(Y.data["text/html"])),q(Y?.traceback)})});let W=E.reduce((j,Y)=>j+(Y.match(s)||[]).length,0);return S={content:I,n:W},W};e.redactionCount=function(){return e.type==="IPython"?N(e.content):typeof e.content!="string"?0:((e.type==="html"?e.content.replace(/<[^>]*>/g," "):e.content).match(s)||[]).length},e.renderRedacted=Bs;let b=I=>I.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").slice(0,60)||"section";e.renderReadme=function(I){let F=e.renderRedacted(I);if(!F||typeof window.DOMParser!="function")return F;let E=new window.DOMParser().parseFromString("<div>"+F+"</div>","text/html"),q={};return E.querySelectorAll("h1, h2, h3").forEach(W=>{let j=W.id||b(W.textContent);q[j]?j+="-"+ ++q[j]:q[j]=1,W.id=j}),E.body.firstChild.innerHTML};let T={content:null,list:[]};e.readmeToc=function(){if(e.type!=="html"||typeof e.content!="string")return[];if(T.content===e.content)return T.list;let F=[...new window.DOMParser().parseFromString("<div>"+e.renderReadme(e.sanitize?e.sanitize(e.content):e.content)+"</div>","text/html").querySelectorAll("h2, h3")].map(E=>({id:E.id,text:E.textContent.trim(),level:E.tagName==="H3"?3:2})).slice(0,40);return T={content:e.content,list:F},F},e.activeHeading=null,o(window,"scroll",()=>{let I=e.readmeToc?e.readmeToc():[];if(!I.length)return;let F=150,E="",q="";for(let W of I){let j=window.document.getElementById(W.id);if(!j)continue;let Y=j.getBoundingClientRect().top;Y<F?E=W.id:!q&&Y<window.innerHeight-80&&(q=W.id)}q&&(E=q),e.activeHeading!==E&&(e.activeHeading=E)},{capture:!0,passive:!0}),e.scrollToHeading=function(I){if(!I){(window.document.querySelector(".explorer-content, .file-card-body, .main-pane")||window).scrollTo({top:0,behavior:"smooth"}),e.activeHeading="";return}let F=window.document.getElementById(I);F&&F.scrollIntoView({behavior:"smooth",block:"start"}),e.activeHeading=I},e.csvView="table";let M={content:null,rows:[]},_=(I,F)=>{let E=[],q=[],W="",j=!1;for(let Y=0;Y<I.length;Y++){let te=I[Y];j?te==='"'?I[Y+1]==='"'?(W+='"',Y++):j=!1:W+=te:te==='"'&&W===""?j=!0:te===F?(q.push(W),W=""):te===`
|
||||
`||te==="\r"?(te==="\r"&&I[Y+1]===`
|
||||
`&&Y++,q.push(W),E.push(q),q=[],W=""):W+=te}return(W!==""||q.length)&&(q.push(W),E.push(q)),E.filter(Y=>Y.length>1||Y[0]!=="")};e.isCsv=()=>typeof e.content=="string"&&e.type!=="html"&&/\.(csv|tsv)$/i.test(e.filePath||"")&&e.content.length<=1024*1024,e.csvRows=()=>{if(M.content!==e.content){let I=/\.tsv$/i.test(e.filePath||"")?" ":",";M={content:e.content,rows:_(e.content,I)}}return M.rows},e.csvNumCol=I=>{let F=e.csvRows().slice(1).map(E=>E[I]).filter(E=>E!=null&&String(E).trim()!=="");return F.length>0&&F.every(E=>e.csvNumeric(E))},e.csvNumeric=I=>/^\s*[-+]?(\d[\d,]*)?(\.\d+)?(e[-+]?\d+)?%?\s*$/i.test(I)&&/\d/.test(I),e.redactParts=function(I){let F=[],E=0,q,W=/\bXXXX-(\d+)\b/g;for(I=String(I||"");q=W.exec(I);)q.index>E&&F.push({t:I.slice(E,q.index)}),F.push({n:q[1]}),E=q.index+q[0].length;return E<I.length&&F.push({t:I.slice(E)}),F},e.pathCopied=!1,e.copyPath=async function(){window.navigator.clipboard?.writeText&&(await window.navigator.clipboard.writeText(e.filePath||""),e.pathCopied=!0,setTimeout(()=>{e.pathCopied=!1},1600))},e.contentCopied=!1,e.copyContent=async function(){if(typeof e.content!="string"||!window.navigator.clipboard?.writeText)return;let I=e.content;if(e.type==="html"&&e.url)if(e.preview)I=e.sourceContent;else try{I=await(await window.fetch(e.url,{credentials:"same-origin"})).text()}catch{return}await window.navigator.clipboard.writeText(I),e.contentCopied=!0,setTimeout(()=>{e.contentCopied=!1},1600)};function H(I){return r[I]?r[I]:I}function oe(I){return I=="pdf"?"pdf":I=="html"||I=="htm"?"html-doc":["md","markdown","mdown","mkdn","mdx"].includes(I)?"md":I=="org"?"org":I=="ipynb"?"IPython":u.indexOf(I)>-1?"text":f.indexOf(I)>-1?"image":v.indexOf(I)>-1?"media":c.indexOf(I)>-1?"audio":"code"}e.downloadUrl=()=>e.preview?e.url:e.url+"&download=true",e.prepareFile=function(I){e.showSource=!1,e.allowScripts=!1,e.imageSize="",e.filePath=I,e.paths=I.split("/").filter(Boolean);let F=e.filePath.toLowerCase(),E=F.lastIndexOf(".");E>-1&&(F=F.substring(E+1));let q={javascript:"JavaScript",typescript:"TypeScript",tsx:"TSX",jsx:"JSX",python:"Python",java:"Java",c_cpp:"C/C++",csharp:"C#",golang:"Go",rust:"Rust",ruby:"Ruby",php:"PHP",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",yaml:"YAML",markdown:"Markdown",sh:"Shell",dockerfile:"Dockerfile",xml:"XML",sql:"SQL",kotlin:"Kotlin",swift:"Swift",scala:"Scala",r:"R",julia:"Julia",latex:"LaTeX",toml:"TOML",csv:"CSV",tsv:"TSV",text:""},W=H(F);e.languageName=q[W]??(W?W.charAt(0).toUpperCase()+W.slice(1):""),e.aceOption={readOnly:!0,useWrapMode:!0,showGutter:!0,theme:"chrome",useSoftTab:!0,tabSize:2,fontSize:window.matchMedia?.("(max-width: 767px)").matches?12:13,keyBinding:"vscode",fullLineSelection:!0,highlightActiveLine:!1,highlightGutterLine:!1,cursor:"hide",showInvisibles:!1,showIndentGuides:!1,showPrintMargin:!1,highlightSelectedWord:!1,enableBehaviours:!0,fadeFoldWidgets:!1,mode:H(F),onLoad:function(j){e.codeEditor=mn(j);{let Ne=j.session,_e=Ne.getTokens.bind(Ne),X=/\bXXXX-\d+\b/g;if(Ne.getTokens=function(pe){let se=_e(pe);if(!se.some(be=>be.value.indexOf("XXXX-")!==-1))return se;let me=[];for(let be of se){if(be.value.indexOf("XXXX-")===-1){me.push(be);continue}let Ie=0;X.lastIndex=0;let D;for(;D=X.exec(be.value);)D.index>Ie&&me.push({type:be.type,value:be.value.slice(Ie,D.index)}),me.push({type:"redacted.n"+D[0].slice(5),value:D[0]}),Ie=D.index+D[0].length;Ie<be.value.length&&me.push({type:be.type,value:be.value.slice(Ie)})}return me},!window.document.getElementById("redact-index-rules")){let pe=window.document.createElement("style");pe.id="redact-index-rules",pe.textContent=Array.from({length:99},(se,me)=>`.ace_redacted.ace_n${me+1}::after{content:"${me+1}"}`).join(""),window.document.head.appendChild(pe)}j.renderer.updateFull(!0)}j.session.setUseWrapMode(e.wrapLines!==!1);let Y=j.container.closest?.(".file-card"),te=()=>{if(!Y)return;let Ne=j.renderer,_e=(Ne.layerConfig?.width||0)-(Ne.$size?.scrollerWidth||0);Y.classList.toggle("at-right-edge",_e<=2||Ne.getScrollLeft()>=_e-2)};j.session.on("changeScrollLeft",te),j.renderer.on("afterRender",te),window.matchMedia?.("(max-width: 767px)").matches&&j.setOption("hScrollBarAlwaysVisible",!0);let ee=ace.require("ace/range").Range,fe=null;function ge(Ne,_e){fe!==null&&(j.session.removeMarker(fe),fe=null),Ne!=null&&(fe=j.session.addMarker(new ee(Ne,0,_e,1),"highlighted-line","fullLine"))}function Fe(Ne){let _e=!e.preview&&window.location.hash.match(/^#L(\d+)(?:-L(\d+))?/);if(!_e){ge(null);return}let X=parseInt(_e[1])-1,pe=_e[2]?parseInt(_e[2])-1:X;ge(X,pe),Ne&&i.timeout(()=>{j.scrollToLine(X,!0,!0,function(){})},100)}Fe(!0);let He=null;j.on("guttermousedown",function(Ne){let _e=Ne.getDocumentPosition().row,X=Ne.domEvent&&Ne.domEvent.shiftKey,pe=_e,se=_e;X&&He!==null?(pe=Math.min(He,_e),se=Math.max(He,_e)):He=_e;let me=pe===se?`#L${pe+1}`:`#L${pe+1}-L${se+1}`,be=window.location.pathname+window.location.search+me;e.preview||window.history.replaceState(null,"",be),ge(pe,se),Ne.stop()});let Ke=o(window,"hashc
Line truncated
|
||||
`);for(let y=0;y<h.length;y++){let g=h[y];if(g.startsWith("diff --git")){v(),c();continue}if(g.startsWith("--- ")){r&&r.lines.length&&v(),c().oldPath=g.replace(/^--- (a\/)?/,"").trim();continue}if(g.startsWith("+++ ")){c().newPath=g.replace(/^\+\+\+ (b\/)?/,"").trim();continue}if(!(g.startsWith("index ")||g.startsWith("similarity index")||g.startsWith("rename ")||g.startsWith("new file mode")||g.startsWith("deleted file mode")||g.startsWith("Binary files"))){if(g.startsWith("@@")){let C=g.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);C&&(u=parseInt(C[1],10),f=parseInt(C[2],10)),c().lines.push({kind:"hunk",oldNo:"",newNo:"",text:g});continue}r&&(g.startsWith("+")?(r.lines.push({kind:"add",oldNo:"",newNo:f,text:g.slice(1)}),f++):g.startsWith("-")?(r.lines.push({kind:"remove",oldNo:u,newNo:"",text:g.slice(1)}),u++):(r.lines.push({kind:"ctx",oldNo:u,newNo:f,text:g.startsWith(" ")?g.slice(1):g}),u++,f++))}}return s(o,r),o.join("")}})({trustAsHtml:e=>e});function Ma(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function Ig(e,t="EUR"){let s=Number(e)||0;return new Intl.NumberFormat(void 0,{style:"currency",currency:t,minimumFractionDigits:s%1?2:0,maximumFractionDigits:2}).format(s)}function Og(e){return String(e??"").toUpperCase()}function Mg(e,t,s=0){return(e||[]).slice(s,s+t)}function Vg(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function Lg(e,t){if(!t)return e||[];let s=Array.isArray(t)?t:[t];return[...e||[]].sort((i,o)=>{for(let r of s){let u=r[0]==="-"?-1:1;r=r.replace(/^[+-]/,"");let f=r.split(".").reduce((v,h)=>v?.[h],i),c=r.split(".").reduce((v,h)=>v?.[h],o);if(typeof f=="string"&&(f=f.toLowerCase()),typeof c=="string"&&(c=c.toLowerCase()),f!==c)return(f==null?-1:c==null?1:f<c?-1:1)*u}return 0})}function sr(e,t){if(!e)return"";let s=new Date(e);if(isNaN(s))return String(e);if(!t||t==="mediumDate")return s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});let i={yyyy:s.getFullYear(),MMM:s.toLocaleDateString(void 0,{month:"short"}),MM:String(s.getMonth()+1).padStart(2,"0"),dd:String(s.getDate()).padStart(2,"0"),d:s.getDate(),HH:String(s.getHours()).padStart(2,"0"),mm:String(s.getMinutes()).padStart(2,"0"),ss:String(s.getSeconds()).padStart(2,"0")};return t.replace(/yyyy|MMM|MM|dd|HH|mm|ss|d/g,o=>i[o])}function qg(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}function ir(e){if(!e)return"";let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(e)),s=t?new Date(+t[1],+t[2]-1,+t[3]):new Date(e);if(isNaN(s))return"";let i=s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),o=new Date;o.setHours(0,0,0,0);let r=Math.round((s-o)/864e5),u;if(r===0)u="today";else if(r===1)u="tomorrow";else if(r===-1)u="yesterday";else{let f=Math.abs(r),c=Math.round(f/30.44),v=f<14?[f,"day"]:f<60?[Math.round(f/7),"week"]:c<18?[c,"month"]:[Math.round(f/365.25),"year"],h=v[0]+" "+v[1]+(v[0]===1?"":"s");u=r>0?"in "+h:h+" ago"}return i+" \xB7 "+u}function _n(e){if(e==null||e===""||isNaN(e))return"";e=Number(e);let t="\u202F";if(e<1e3)return+(e<10?e.toFixed(2):e<100?e.toFixed(1):Math.round(e))+t+"ms";let s=e/1e3;if(s<60)return+(s<10?s.toFixed(2):s.toFixed(1))+t+"s";let i=r=>String(r).padStart(2,"0"),o=Math.round(s);return o<3600?Math.floor(o/60)+"m "+i(o%60)+"s":Math.floor(o/3600)+"h "+i(Math.floor(o%3600/60))+"m"}function rr(e){if(!e)return"";let t=new Date(e);if(isNaN(t))return"";let s={day:"numeric",month:"short"};return t.getFullYear()!==new Date().getFullYear()&&(s.year="numeric"),t.toLocaleDateString(void 0,s)}function Go(e){e.listLoading=!0,e.listLoaded===void 0&&(e.listLoaded=!1)}function La(e){e.listLoading=!1,e.listLoaded=!0}var lr=e=>["preparing","download","downloading","downloaded","queue","anonymizing"].includes(e)?"preparing":e==="expiring"?"expired":e==="removing"?"removed":e;function dr(e,{flags:t,keys:s,count:i,onChange:o=()=>{}}){if(e.segView=()=>{let r=t()||{};if(s.every(f=>!!r[f]))return"all";let u=s.filter(f=>!!r[f]);return u.length===1?u[0]:"custom"},e.setSegView=r=>{let u=t();if(u){for(let f of s)u[f]=r==="all"?!0:f===r;o()}},e.segCount=r=>r==="all"?s.reduce((u,f)=>u+i(f),0):i(r),t()&&e.segView()==="custom")for(let r of s)t()[r]=!0}var ec=function(e,t,s){let i=yt(),o=zt();ac(i,o),e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),e.repositories=[],e.total=-1,e.listLoaded=!1,e.listLoading=!0,e.totalPage=0,e.statusCounts=[],e.totalSize=0,e.selected={},e.allSelected=!1;let r=S=>{if(S.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){S.preventDefault();let N=document.querySelector('.admin-filter-toolbar input[type="search"]');N&&N.focus()}};o(document,"keydown",r),e.on("dispose",()=>document.removeEventListener("keydown",r)),e.clearFilter=S=>{S==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[S]="",e.query.page=1},e.chips=[];let u=()=>{let S=[];e.query.owner&&S.push({key:"
Line truncated
|
||||
`+S.join(`
|
||||
`)],{type:"text/csv"}),b=document.createElement("a");b.href=URL.createObjectURL(N),b.download=i.username+"-repositories.csv",b.click()},e.showStatusMessage=g=>{let C=g.statusMessage||"(no message)";window.prompt(`Status message for ${g.repoId} (${g.status}):`,C)},e.fetchGithubInfo=g=>{let C=window.open("","_blank");C&&C.document.write("<pre>Loading GitHub info for "+g.repoId+"...</pre>"),t.get("/api/admin/repos/"+g.repoId+"/github").then(w=>{C&&(C.document.open(),C.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(w.data,null,2).replace(/[<>]/g,S=>S==="<"?"<":">")+"</pre>"),C.document.close())},w=>{let S=w&&w.data?JSON.stringify(w.data,null,2):String(w);C&&(C.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+S+"</pre>")})};function c(g){t.get("/api/admin/users/"+g+"/repos",{}).then(C=>{e.repositories=C.data},C=>{console.error(C)})}function v(g){t.get("/api/admin/users/"+g,{}).then(C=>{e.userInfo=C.data},C=>{console.error(C)})}v(i.username),c(i.username),e.banUser=()=>{confirm(`Ban user ${i.username}?`)&&t.post(`/api/admin/users/${i.username}/ban`).then(()=>v(i.username),g=>console.error(g))},e.activateUser=()=>{t.post(`/api/admin/users/${i.username}/activate`).then(()=>v(i.username),g=>console.error(g))},e.promoteUser=()=>{confirm(`Promote ${i.username} to admin?`)&&t.post(`/api/admin/users/${i.username}/promote`).then(()=>v(i.username),g=>console.error(g))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${i.username}?`)&&t.post(`/api/admin/users/${i.username}/demote`).then(()=>v(i.username),g=>console.error(g))},e.tokens=[],e.tokenForm={name:"",plaintext:null};function h(){t.get("/api/admin/tokens").then(g=>{e.tokens=g.data||[]},g=>{g.status!==401&&g.status!==403&&console.error(g)})}h(),e.createToken=()=>{e.tokenForm.name&&t.post("/api/admin/tokens",{name:e.tokenForm.name}).then(g=>{e.tokenForm.plaintext=g.data.token,e.tokenForm.name="",h()},g=>console.error(g))},e.revokeToken=g=>{confirm(`Revoke token "${g.name}"?`)&&t.delete("/api/admin/tokens/"+g.id).then(()=>h(),C=>console.error(C))},e.removeCache=g=>{confirm("Remove cached files for "+g.repoId+"?")&&t.delete("/api/admin/repos/"+g.repoId).then(()=>c(i.username),C=>console.error(C))},e.removeRepository=g=>{confirm("Remove repository "+g.repoId+"?")&&t.delete("/api/repo/"+g.repoId+"/").then(()=>c(i.username),C=>console.error(C))},e.updateRepository=g=>{let C=rt({title:`Refreshing ${g.repoId}...`,date:new Date,body:`The repository ${g.repoId} is going to be refreshed.`});e.toasts.push(C),t.post(`/api/repo/${g.repoId}/refresh`).then(w=>{w.data.status=="ready"?C.title=`${g.repoId} is refreshed.`:C.title=`Refreshing of ${g.repoId}.`},w=>{C.title=`Error during the refresh of ${g.repoId}.`,C.body=w.body})},e.getGitHubRepositories=g=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(C=>{e.userInfo.repositories=C.data})};let y=null;e.watch("query",()=>{o.timeout.cancel(y),y=o.timeout(()=>{c(i.username)},500)},!0)},oc=function(e,t,s){let i=yt(),o=zt();e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),e.conferences=[],e.total=-1,e.listLoaded=!1,e.listLoading=!0,e.totalPage=0,e.statusCounts=[];let r=w=>{if(w.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){w.preventDefault();let S=document.querySelector('.admin-filter-toolbar input[type="search"]');S&&S.focus()}};o(document,"keydown",r),e.on("dispose",()=>document.removeEventListener("keydown",r)),e.clearFilter=w=>{w==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[w]="",e.query.page=1},e.chips=[];let u=()=>{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 S=(e.statusCounts||[]).find(N=>N._id===w);return S?S.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 f="admin.conferences.filterPrefs",c={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!0,expired:!0,removed:!0,error:!0,preparing:!0},v=loadFilterPrefs(f)||{};e.query=Object.assign({},c,v,{page:1,search:""});let h=s.search();h.search&&(e.query.search=h.search);let y="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(y)||"[]"),e.savePreset=()=>{let w=window.prompt("Preset name:");if(!w)return;let S=Object.assign({},e.query);delete S.page,e.presets=(e.presets||[]).filter(N=>N.name!==w),e.presets.push({name:w,query:S}),localStorage.setItem(y,JSON.stringify(e.presets))},e.applyPreset=w=>{Object.assign(e.query,w.query,{page:1})},e.deletePreset=w=>{e.presets=(e.presets||[]).filter(S=>S.name!==
Line truncated
|
||||
`):typeof z.stack=="string"?z.stack:null;for(var I=[z.cause,z.err].filter(Boolean),F=0;!q&&F<I.length;F++)for(var E=I[F];!q&&E&&typeof E=="object";)typeof E.stack=="string"&&(q=E.stack),E=E.cause;L._stack=q}else L.displayMessage=L.message,L._status=null,L._url=null,L._stack=null;return L._bucket=g(z,L.level),L._detailJson=w(L,z),L}function w(L,z){let I=[],F=(j,Y)=>{Y==null||Y===""||I.push([j,Y])};for(let j of["service","event","severity","requestId","jobId"])F(j,z&&z[j]);F("name",z&&z.name),F("code",L.displayMessage||z&&z.message),L._bucket&&F("kind",L._bucket),F("httpStatus",z&&z.httpStatus),z&&z.status&&!z.httpStatus&&F("status",z.status),F("module",L.module);let E=z&&z.detail;if(typeof E=="string"){let j=E.trim();if(j[0]==="{"||j[0]==="[")try{E=JSON.parse(E)}catch{}}if(F("detail",E),F("repoId",z&&z.repoId),F("filePath",z&&z.filePath),F("upstreamStatus",z&&z.upstreamStatus),F("upstreamBody",z&&z.upstreamBody),F("url",L._url),F("err",z&&z.err),F("cause",z&&!z.err&&z.cause),F("ts",L.ts),!I.length)return JSON.stringify(L,null,2);let q=I.reduce((j,Y)=>Math.max(j,Y[0].length),0),W=["{"];return I.forEach(([j,Y],te)=>{let fe=` ${`"${j}":`.padEnd(q+3," ")} `,ge=te<I.length-1?",":"",Fe;if(Y&&typeof Y=="object"){let He=" ".repeat(fe.length);Fe=JSON.stringify(Y,null,2).split(`
|
||||
`).map((Ke,Be)=>Be===0?Ke:He+Ke).join(`
|
||||
`)}else typeof Y=="number"||typeof Y=="boolean"?Fe=String(Y):Fe=JSON.stringify(Y);W.push(`${fe}${Fe}${ge}`)}),W.push("}"),W.join(`
|
||||
`)}function S(L){let z=[],I="",F=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,E=0,q;for(;q=F.exec(L);)I+=L.slice(E,q.index),E=F.lastIndex,z.push({key:q[1],op:q[2]||"=",val:q[3]});return I+=L.slice(E),{filters:z,free:I.trim().toLowerCase()}}function N(L,z){for(let I of z.filters){let F=(q,W,j)=>{let Y=parseFloat(q),te=parseFloat(W);return j==="="?String(q)===String(W):j==="!="?String(q)!==String(W):j===">="?Y>=te:j==="<="?Y<=te:j===">"?Y>te:j==="<"?Y<te:!0},E;if(I.key==="code")E=L.displayMessage;else if(I.key==="module")E=L.module;else if(I.key==="status")E=L._status;else if(I.key==="url")E=L._url;else if(I.key==="repo")E=L._repoId;else if(I.key==="level")E=L.level;else continue;if(E==null||!F(E,I.val,I.op))return!1}return!(z.free&&((L.displayMessage||"")+" "+(L.module||"")+" "+(L._url||"")+" "+JSON.stringify(L.raw||[])).toLowerCase().indexOf(z.free)===-1)}function b(){let L=S(e.query.search||"");e.parsedFilterCount=L.filters.length;let z=e.query.bucket,I=e.entries.filter(j=>z&&j._bucket!==z?!1:N(j,L)),F=e.query.group;if(F){let j=ee=>JSON.stringify(F==="module"?[ee.module,ee._bucket]:[ee.raw?.[0]?.service||"unknown",ee.module,ee.displayMessage||ee.message||"_",ee._bucket,ee._status]),Y=new Map;for(let ee of I){let fe=j(ee);if(Y.has(fe)){let ge=Y.get(fe);ge.count++,ge._related.push(ee),new Date(ee.ts)>new Date(ge.ts)&&(ge.ts=ee.ts,ge._url=ee._url,ge._status=ee._status),new Date(ee.ts)<new Date(ge._firstSeen)&&(ge._firstSeen=ee.ts)}else{let ge=Object.assign({},ee);ge._key=`${F}:${fe}`,ge._related=[ee],ge._firstSeen=ee.ts,ge._lastHourCount=0,ge.count=1,Y.set(fe,ge)}}let te=Date.now()-3600*1e3;for(let ee of Y.values())ee._lastHourCount=ee._related.filter(fe=>new Date(fe.ts).getTime()>=te).length;I=Array.from(Y.values())}else I=I.map((j,Y)=>(j._key="row:"+Y+":"+j.ts,j._related=[j],j._firstSeen=j.ts,j._lastHourCount=0,j.count=1,j));let E=j=>({error:0,warn:1,info:2})[j._bucket]??1;e.query.sort==="count"?I.sort((j,Y)=>E(j)-E(Y)||Y.count-j.count||new Date(Y.ts)-new Date(j.ts)):I.sort((j,Y)=>E(j)-E(Y)||new Date(Y.ts)-new Date(j.ts)),e.visible=I;let q=!!(e.query.bucket||(e.query.search||"").trim()),W=!q&&(e.stats?.severity?.error||0)>0&&!I.some(j=>j._bucket==="error")&&e.entries.length<1500;(q&&!I.length||W)&&e.canLoadMore?.()&&!e._autoLoading&&e.entries.length<2500&&(e._autoLoading=!0,T(!0))}function T(L){if(L&&e.redisLoading)return;let z=++o;e.redisLoading=!0;let I=L?e.redisNextOffset||e.entries.length:0,F=L?e.pageSize:Math.max(e.pageSize,e.redisNextOffset||e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:I,limit:F}}).then(E=>{if(f||z!==o)return;e.redisLoading=!1;let q=(E.data.entries||[]).map(C);e.entries=L?e.entries.concat(q):q,e.redisRedacted=(L&&e.redisRedacted||0)+(E.data.redactedEntries||0),e.redisNextOffset=E.data.nextOffset??I+(E.data.entries||[]).length,e.available=!!E.data.available,e.redisCollecting=E.data.redisCollecting!==!1,e.cap=E.data.max||e.cap,e.total=E.data.total||e.entries.length,e._autoLoading=!1,b()},()=>{f||z!==o||(e.redisLoading=!1,e._autoLoading=!1,e.available=!1)})}e.loadMore=()=>T(!0),e.canLoadMore=()=>(e.redisNextOffset||e.entries.length)<e.total;function M(L=!1){if(L&&u)return;let z=++r;u=!0,t.get("/api/admin/errors/stats").then(I=>{if(f||z!==r)return;u=!1;let F=I.data||{};e.redisStatsState=F.available===!1?"unavailable":"ready";let E=F.prev24h?Math.round((F.last24h-F.prev24h)/F.prev24h*100):0;e.stats={last24h:F.last24h||0,prev24h:F.prev24h||0,delta:E,severity:F.severity||{error:0,warn:0,info:0},unique:F.unique||{error:0,warn:0,info:0},buckets:F.buckets||[],dropped:F.dropped||0},b()},()=>{!f&&z===r&&(u=!1,e.redisStatsState="unavailable")})}function _(L=!1){(!L||!e.redisLoading)&&T(),M(L)}e.barPx=(L,z)=>{let I=e.stats.buckets||[],F=0,E=0;for(let Y of I)F=Math.max(F,(Y.error||0)+(Y.warn||0)),E=Math.max(E,Y.info||0);let q=L[z]||0;if(!q)return 0;if(z==="info")return E?Math.max(2,Math.round(q/E*(F?16:60))):0;let W=(L.error||0)+(L.warn||0),j=Math.round(W/F*44);return Math.max(4,Math.round(q/W*j))},e.bucketTitle=L=>`${new Date(L.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${L.error||0} err \xB7 ${L.warn||0} warn \xB7 ${L.info||0} info`,e.toggle=async(L,z)=>{v=z||document.activeElement,h=e.captureErrorScroll(v),e.historySelected=L,e.historyView="overview",e.expanded={[L._key]:!0},await ze(),document.getElementById("history-inspector-title")?.focus({preventScroll:!0}),document.getElementById("history-inspector-title")?.scrollIntoView?.({block:"nearest"})},e.showHistoryTimeline=L=>{if(e.historyView="timeline",e.traceSelection)return;let z=["requestId","jobId"].find(I=>e.logTraceId(e.historySelected,I));z&&e.lookupTrace(z,e.logTraceId(e.historySelected,z),L,e.historySelected)},e.closeHistory=async()=>{let L=e.historySelected?._key;e.historySelected=null,e.expanded={},e.traceSelection&&await e.closeTrace(),await ze(),(v?.isConnected?v:[...document.querySelectorAll("[data-history-key]")].find(I=>I.dataset.historyKey===L))?.focus({preventScroll:!0}),e.restoreError
Line truncated
|
||||
`)],{type:"text/csv;charset=utf-8"}),F=URL.createObjectURL(I),E=document.createElement("a");E.href=F,E.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(E),E.click(),document.body.removeChild(E),URL.revokeObjectURL(F)};function H(L){e.copyHint=`${L} copied`,c.timeout(()=>{e.copyHint=""},1500)}e.copyJson=L=>{navigator.clipboard.writeText(L._rawJson).then(()=>H("JSON"))},e.copyCurl=L=>{if(!L._url)return;let I=`curl -X ${L._method||"GET"} '${window.location.origin}${L._url}'`;navigator.clipboard.writeText(I).then(()=>H("curl"))},_();let oe=i(()=>{e.query.autoRefresh&&_(!0)},15e3);e.on("dispose",()=>{f=!0,o++,r++,i.cancel(oe)}),e.watch("query.search",b),e.watch("query.bucket",b),e.watch("query.sort",b),e.watch("query.group",b)},rc=function(e,t,s,i){if(e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null){s.url("/");return}e.data=null,e.loading=!0,e.error=null,e.performance=null,e.performanceMinutes=15,e.performanceTab="routes",e.cacheReport=null,e.cacheError=null,e.cacheMinutes=60,e.cacheTraffic="all",e.ovView=["performance","cache"].includes((window.location.hash||"").slice(1))?window.location.hash.slice(1):"summary",e.setOvView=function(b){e.ovView=b;try{window.history.replaceState(null,"",b==="summary"?window.location.pathname:"#"+b)}catch{}};var o=!1;e.loadCache=function(){if(!o){o=!0;var b=e.cacheMinutes;t.get("/api/admin/cache",{params:{minutes:b}}).then(function(T){b===e.cacheMinutes&&(e.cacheReport=T.data,e.cacheError=T.data.available?null:T.data.reason||"Cache monitoring is unavailable.")},function(){e.cacheError="Could not refresh cache monitoring. Displayed values may be stale."}).finally(function(){o=!1,b!==e.cacheMinutes&&e.loadCache()})}},e.cacheRows=function(){return(e.cacheReport?.rows||[]).filter(function(b){return e.cacheTraffic==="all"||b.traffic===e.cacheTraffic})},e.cacheRate=function(b,T){var M=e.cacheRows(),_=function(L){return M.filter(function(z){return z.name===L}).reduce(function(z,I){return z+I[T]},0)},H=_(b+"_hit"),oe=_(b+"_miss");return H+oe?(100*H/(H+oe)).toFixed(1)+"%":"No samples"},e.cacheEventName=function(b){return b.replaceAll("_"," ")},e.cacheP95=function(b){var T=0,M=e.cacheReport?.latencyBucketsMs||[];if(!b.count)return"No samples";if(!b.ms)return"Not timed";for(var _=0;_<=M.length;_++)if(T+=b["b"+_]||0,T>=Math.ceil(b.count*.95))return _<M.length?"\u2264 "+_n(M[_]):"> 10\u202Fs";return"No samples"},e.healthAlert=function(){let b=e.data&&e.data.system||{},T=[["Memory",b.memPercent],["Disk",b.diskPercent]].filter(([,_])=>_>90);return T.length?T.map(([_,H])=>_+" is at "+H+"%").join(" and ")+". New anonymizations may fail until "+(T.length>1?"they drop.":"it drops."):""},e.performanceError=null,e.formatMs=function(b){return b==null?"":_n(b)},e.latencyBound=function(b,T){return b.count?b[T]==null?"> 60\u202Fs":"\u2264 "+e.formatMs(b[T]):"No samples"},e.firstByteBound=function(b){return e.latencyBound({count:b.firstByteCount,p95UpperMs:b.firstByteP95UpperMs},"p95UpperMs")},e.sampleAge=function(b){return Math.max(0,Math.round((Date.now()-b.sampledAt)/1e3))},e.peakRss=function(b){return(e.performance.runtimeSeries||[]).filter(function(T){return T.instance===b.instance}).reduce(function(T,M){return Math.max(T,M.rss)},b.memory.rss)},e.performanceWarning=function(b){return e.sampleAge(b)>45||b.droppedBatches||b.droppedMetrics||b.sockets?.closeWait>0||b.eventLoop?.p95Ms>100||b.memoryLimitBytes&&b.memory.rss>b.memoryLimitBytes*.8};var r=!1;e.loadPerformance=function(){var b=e.performanceMinutes;e.performance?.windowMinutes&&e.performance.windowMinutes!==b&&(e.performance=null),!r&&(r=!0,t.get("/api/admin/performance",{params:{minutes:b}}).then(function(T){b===e.performanceMinutes&&(e.performance=T.data,e.performanceError=T.data.available?null:"Performance monitoring is unavailable. Request history may be incomplete.")},function(){b===e.performanceMinutes&&(e.performanceError="Could not refresh performance monitoring. Displayed samples may be stale.")}).finally(function(){r=!1,b!==e.performanceMinutes&&e.loadPerformance()}))};function u(b){if(b==null)return"\u2014";for(var T=["B","KB","MB","GB","TB"],M=0,_=b;_>=1024&&M<T.length-1;)_/=1024,M++;return _.toFixed(M>0?1:0).replace(/\.0$/,"")+" "+T[M]}e.humanBytes=u;function f(b){if(!b)return"\u2014";var T=Math.floor(b/86400),M=Math.floor(b%86400/3600),_=Math.floor(b%3600/60);return T>0?T+"d "+(M<10?"0":"")+M+"h":M>0?M+"h "+(_<10?"0":"")+_+"m":_+"m"}e.humanDuration=f;function c(b){return b==null?"\u2014":b>=1e6?(b/1e6).toFixed(1)+"M":b>=1e3?(b/1e3).toFixed(1)+"K":String(b)}e.humanNum=c,e.queueTotal=function(b){return b?(b.waiting||0)+(b.active||0)+(b.delayed||0)+(b.failed||0):0},e.statusCount=function(b){if(!e.data||!e.data.repos)return 0;for(var T=e.data.repos.statusBreakdown||[],M=0;M<T.length;M++)if(T[M]._id===b)return T[M].count;return 0},e.barPct=function(b){var T=e.data&&e.data.repos?e.data.repos.total:0;if(!T)return 0;var M=[b];b==="expired"&&M.push("expiring"),b==="remov
Line truncated
|
||||
`)},e.tipSide=w=>{let S=(e.summary?.series||[]).length;return S<3?"":w<S/4?"tip-start":w>=S*3/4?"tip-end":""},e.bucketName=()=>({day:"day",week:"week",month:"month"})[e.summary?.bucket]||"day",e.seriesSales=()=>(e.summary?.series||[]).reduce((w,S)=>w+e.bucketTotal(S),0),e.plansWithActivity=()=>(e.summary?.plans||[]).filter(w=>w.active||w.allTimeSales||w.sales),e.familyLabel=w=>(ar.find(S=>S.id===w)||{}).label||"",e.familyPlans=w=>(e.summary?.plans||[]).filter(S=>S.family===w),e.familySum=(w,S)=>e.familyPlans(w).reduce((N,b)=>N+(b[S]||0),0),e.familyMoney=(w,S,N)=>{if(!e.revenueOn())return"\u2014";let b=e.familyPlans(w);return b.some(T=>T[N]===!1)?"Incomplete":e.moneyText(b.reduce((T,M)=>r(T,M[S]),{}))},e.planTotals=()=>{let w=S=>(e.summary?.plans||[]).reduce((N,b)=>N+(b[S]||0),0);return{active:w("active"),sales:w("sales"),allTimeSales:w("allTimeSales")}},e.webhookState=()=>{let w=e.summary?.webhooks;return w?w.failed||w.reconciliationFailed?"bad":w.oldestPendingSeconds>900||w.unreviewedRevocations?"warn":"ok":"ok"},e.age=w=>w?_n(w*1e3):"\u2014";let u=0;e.loadSummary=()=>{let w=++u;e.summaryLoading=!0,e.summaryError=null,t.get("/api/admin/billing/summary",{params:{period:e.period}}).then(S=>{if(w!==u)return;e.summaryLoading=!1;let N=S.data;if(!N||!N.subscriptions||!N.sales||!Array.isArray(N.plans)){e.summaryError="The billing summary had an unexpected format.";return}e.summary=N},S=>{w===u&&(e.summaryLoading=!1,e.summaryError=S&&S.data&&S.data.error||"Could not load billing figures.")})},e.setPeriod=w=>{if(e.period!==w){e.period=w;try{localStorage.setItem("admin.billing.period",w)}catch{}e.loadSummary()}},e.grants=[],e.total=-1,e.totalPage=0,e.stateCounts={},e.statuses=[],e.grantsError=null,e.filtersOpen=!1,e.query={page:1,limit:25,search:"",plan:"",status:"",state:"",period:"",sort:"purchasedAt",direction:"desc"};let f=s.search();f.search&&(e.query.search=f.search),e.stateView=()=>e.query.state||"all",e.setStateView=w=>{e.query.state=w==="all"?"":w,e.query.page=1},e.stateCount=w=>w==="all"?["active","expired","revoked"].reduce((S,N)=>S+(e.stateCounts[N]||0),0):e.stateCounts[w]||0,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":"",e.chips=[];let c=()=>{let w=[];e.query.plan&&w.push({key:"plan",label:"Plan",value:e.planName(e.query.plan)}),e.query.status&&w.push({key:"status",label:"Stripe status",value:e.query.status.replace(/_/g," ")}),e.query.period&&w.push({key:"period",label:"Started",value:"last "+((e.periods.find(S=>S.id===e.query.period)||{}).label||e.query.period)}),e.chips=w};e.clearFilter=w=>{e.query[w]="",e.query.page=1},e.filterPlan=w=>{Object.assign(e.query,{plan:w,page:1});let S=document.getElementById("bl-grants");S&&S.scrollIntoView&&S.scrollIntoView({behavior:"smooth",block:"start"})},e.clearFilters=()=>Object.assign(e.query,{search:"",plan:"",status:"",state:"",period:"",page:1}),e.hasFilters=()=>!!(e.query.search||e.query.plan||e.query.status||e.query.state||e.query.period),e.filterCount=()=>["plan","status","period"].filter(w=>e.query[w]).length,e.amountText=w=>{if(!w.amount)return"\u2014";let S=fo({[w.amount.currency]:w.amount.value})[0]||"\u2014";if(!w.amount.interval)return S;let N=w.amount.intervalCount>1?w.amount.intervalCount+" "+w.amount.interval+"s":w.amount.interval;return S+" / "+N},e.amountTitle=w=>w.amount?"Stripe list price"+(w.pack?" of the whole pack":""):{stripe_not_configured:"Revenue unavailable: Stripe is not configured on this server.",unresolved:"Revenue unavailable: this Stripe price could not be looked up.",unrecorded:"Revenue unavailable: no sale price was recorded for this subscription."}[w.amountMissing]||"Revenue unavailable.",e.endText=w=>{if(w.never)return"Never ends";if(!w.until)return"\u2014";let S=sr(w.until);return w.state!=="active"?(new Date(w.until)<new Date?"Ended ":"Ends ")+S:w.subscription?(w.cancelAtPeriodEnd?"Ends ":"Renews ")+S:"Until "+S},e.packNote=w=>{let S=(w.parts||[]).find(N=>N.planId==="author_pass");return!w.pack||!S||!S.until?"":(new Date(S.until)<new Date?"Updates ended ":"Updates until ")+sr(S.until)};let v={repo_slot:"repository",author_pass:"updates",repo_extend:"+1 year"};e.packParts=w=>(w.parts||[]).map(S=>v[S.planId]||e.planName(S.planId)).join(", ").replace(/^./,S=>S.toUpperCase()),e.packPartsTitle=w=>"Paper pack: "+(w.parts||[]).map(S=>e.planName(S.planId)).join(", "),e.statusText=w=>(w.status||"unknown").replace(/_/g," "),e.revocationText=w=>w==="dispute"?"Disputed":w==="full_refund"?"Refunded":"Revoked",e.scopeHref=w=>w?.kind==="repo"?"/admin/repositories?search="+encodeURIComponent(w.id):w?.kind==="conference"?"/conference/"+encodeURIComponent(w.id):null;let h=0;function y(){let w=++h;e.grantsError=null;let S=Object.fromEntries(Object.entries(e.query).filter(([,N])=>N!==""&&N!=null));t.get("/api/admin/billing/grants",{params:S}).then(N=>{w===h&&(
Line truncated
|
||||
`)},Ha=class{constructor(t){tt(this,"gen");tt(this,"threads",[]);tt(this,"match",!1);tt(this,"runs",[]);tt(this,"ids",[]);this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},Ec=(e,t)=>e.ids.length!==t.ids.length||e.runs.length!==t.runs.length||e.ids.some((s,i)=>s!==t.ids[i])?!1:e.runs.every(s=>t.runs.some(i=>i.neg===s.neg&&Ec(i.state,s.state))),vc=e=>({has:new Float64Array(e),seen:new Float64Array(e),gen:0}),ho,Gn,ja,Ga,Gs=class{constructor(t,s,i){Le(this,Gn);tt(this,"dots");tt(this,"dotStart");Le(this,ho);this.dots=t,this.dotStart=s,Ue(this,ho,i)}state(){return new Ha(++ae(this,ho).gen)}done(t){return t.ids=t.threads.map(s=>s.id).sort((s,i)=>s-i),t.match&&t.ids.unshift(za.id),t}restricted(t,s){return s&&(this.dots||this.dotStart&&t===0)}add(t,s,i,o){switch(s.t){case"split":if(!qe(this,Gn,ja).call(this,t,s))return;for(let u of s.out)this.add(t,u,i,o);return;case"neg":if(!qe(this,Gn,ja).call(this,t,s))return;let r=this.state();return this.add(r,s.sub,i,!1),this.done(r),this.addRun(t,{t:"run",neg:s,state:r},i,o);case"star":if(this.restricted(i,o))return;qe(this,Gn,Ga).call(this,t,s)&&this.add(t,s.next,i,o);return;case"match":t.match=!0;return;default:qe(this,Gn,Ga).call(this,t,s)}}addRun(t,s,i,o){for(let r of t.runs)if(r.neg===s.neg&&Ec(r.state,s.state))return;t.runs.push(s),s.state.match||this.add(t,s.neg.next,i,o)}step(t,s,i,o){let r=this.state();for(let u of t.threads)switch(u.t){case"lit":Ya(u,s)&&this.add(r,u.next,i+1,o);break;case"any":this.restricted(i,o)||this.add(r,u.next,i+1,o);break;case"class":!this.restricted(i,o)&&u.re.test(s)&&this.add(r,u.next,i+1,o);break;case"star":this.restricted(i,o)||this.add(r,u,i+1,o)}if(!this.restricted(i,o))for(let u of t.runs){if(u.state.dead){this.addRun(r,u,i+1,o);continue}let f=this.step(u.state,s,i,!1);this.addRun(r,{t:"run",neg:u.neg,state:f},i+1,o)}return this.done(r)}};ho=new WeakMap,Gn=new WeakSet,ja=function(t,s){let{seen:i}=ae(this,ho);return i[s.id]===t.gen?!1:(i[s.id]=t.gen,!0)},Ga=function(t,s){let{has:i}=ae(this,ho);return i[s.id]===t.gen?!1:(i[s.id]=t.gen,t.threads.push(s),!0)};var Nc=e=>{let t=e.ids.join();if(!e.runs.length)return t;let s=e.runs.map(i=>`${i.neg.id}(${Nc(i.state)})`);return`${t}|${s.sort().join("|")}`},vv=1<<18,Wo,Ko,Un,go,Bn,zn,Hn,an,Ka,pr,Rc,Wa=class{constructor(t,s){Le(this,an);Le(this,Wo);Le(this,Ko,new Map);Le(this,Un,0);Le(this,go);Le(this,Bn);Le(this,zn);Le(this,Hn);Ue(this,Wo,t),Ue(this,zn,new Gs(!1,!1,s)),Ue(this,Hn,new Gs(!1,!0,s))}start(t){if(t){if(ae(this,Bn))return ae(this,Bn);let i=ae(this,Hn).state();return ae(this,Hn).add(i,ae(this,Wo),0,!0),Ue(this,Bn,qe(this,an,Ka).call(this,ae(this,Hn).done(i)))}if(ae(this,go))return ae(this,go);let s=ae(this,zn).state();return ae(this,zn).add(s,ae(this,Wo),0,!0),Ue(this,go,qe(this,an,pr).call(this,ae(this,zn).done(s)))}next(t,s){let i=s.charCodeAt(0),o=i<128?void 0:t.next.get(s);if(o)return o;let r=t===ae(this,Bn)?qe(this,an,pr).call(this,ae(this,Hn).step(t.state,s,0,!0)):qe(this,an,pr).call(this,ae(this,zn).step(t.state,s,1,!0));return i<128?(t.ascii||(t.ascii=new Array(128),Ue(this,Un,ae(this,Un)+128)),t.ascii[i]=r):t.next.set(s,r),bl(this,Un)._++,r}};Wo=new WeakMap,Ko=new WeakMap,Un=new WeakMap,go=new WeakMap,Bn=new WeakMap,zn=new WeakMap,Hn=new WeakMap,an=new WeakSet,Ka=function(t){return{state:t,match:t.match,dead:t.dead,next:new Map}},pr=function(t){let s=Nc(t),i=ae(this,Ko).get(s);if(i)return i;ae(this,Un)>vv&&qe(this,an,Rc).call(this);let o=qe(this,an,Ka).call(this,t);return ae(this,Ko).set(s,o),Ue(this,Un,ae(this,Un)+(s.length+1)),o},Rc=function(){ae(this,Ko).clear(),Ue(this,Un,0),Ue(this,go,void 0),Ue(this,Bn,void 0)};var yv=e=>{let t=[];for(let s=e;s.t!=="match";s=s.next){if(s.t==="split"||s.t==="neg")return;t.push(s)}return t},bv=(e,t,s,i)=>{let o=0,r=s,u=-1,f=0;for(;r<i;){let c=e[o];if(c?.t==="star"){u=o++,f=r;continue}let v=t[r];if(c&&(c.t==="any"||c.t==="lit"&&Ya(c,v)||c.t==="class"&&c.re.test(v))){o++,r++;continue}if(u===-1)return!1;o=u+1,r=++f}for(;e[o]?.t==="star";)o++;return o===e.length},Tc=e=>{let t=0,s=0;for(let i of e){let[o,r]=wv(i);t+=o,s+=r}return[t,s]},wv=e=>{if(e.t==="star")return[0,1/0];if(e.t!=="ext")return[1,1];if(e.type==="!")return[0,1/0];let t=e.alts.map(Tc),s=Math.min(...t.map(r=>r[0])),i=Math.max(...t.map(r=>r[1])),o=i===0?0:1/0;return e.type==="@"?[s,i]:e.type==="?"?[0,i]:e.type==="*"?[0,o]:[s,o]},yc=(e,t,s)=>{for(let i=0;i<e.length;i++)if(!Ya(e[i],t[s+i]))return!1;return!0},kv=/[/\ud800-\udfff]/,Cv=/[\ud800-\udfff]/,cr=e=>Cv.test(e)?[...e]:e,bc=e=>{if(e.includes("/"))throw new Error("can only match a single path portion, got: "+e)},jn,Yo,vo,fr,yo,Ks,mr,bo,Ys,Js,Xs,Mn,kn,Jo,Xo,Qs,hr,rn,wo,js,Ws=class{constructor(t,s={}){Le(this,wo);tt(this,"pattern");tt(this,"options");Le(this,jn);Le(this,Yo);Le(this,vo);Le(this,fr);Le(this,yo);Le(this,Ks,!1);Le(this,mr);Le(this,bo);Le(this,Ys,!1);Le(this,Js,0);Le(this,Xs,1/0);Le(this,Mn,[]);Le(this,kn,[]);Le(this,Jo);Le(this,Xo);Le(this,Qs,!1);Le(this,hr);Le(this,rn);if(t.includes
Line truncated
|
||||
`).forEach((s,i)=>{let{term:o}=rl(s.trim());if(!o)return;let r=[];for(let u=0;u<o.length;u++){if(o[u]==="\\"){u++;continue}jc.has(o[u])&&!r.includes(o[u])&&r.push(o[u])}r.length&&t.push({line:i,term:o,symbols:r})}),t}function Wc(e,t){let s=String(e||"").split(`
|
||||
`),i=s[t];if(i===void 0)return e;let{term:o}=rl(i.trim());if(!o)return e;let r="";for(let f=0;f<o.length;f++){if(o[f]==="\\"){r+=o.slice(f,f+2),f++;continue}r+=jc.has(o[f])||o[f]==="."?"\\"+o[f]:o[f]}let u=i.indexOf(o);return s[t]=i.slice(0,u)+r+i.slice(u+o.length),s.join(`
|
||||
`)}var Qn={VIEWER_ERRORS:{title:"Content could not be loaded",access_title:"GitHub access needs attention",reader_help:"Reading this repository? You do not need to sign in. Try again after the owner restores access, or let them know this anonymous link is unavailable.",owner_help:"Own this repository? If your GitHub account was suspended or recently recovered, sign in to Anonymous GitHub again and check the GitHub connection and repository permissions in your dashboard. Then retry this page. Keep the existing anonymous URL; do not delete the repository to restore access.",retry:"Try again",dashboard:"Open owner dashboard"},ERRORS:{cache_busy:"Downloads are busy. Please try again shortly.",cache_miss:"This file is not cached yet. Please try again.",invalid_sort:"The selected sort order is invalid.",invalid_cursor:"This project page is no longer valid. Reload the list.",repository_changed:"The repository changed while processing. Please retry.",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:"We could not load this content. Try again. If it still fails, contact support with the anonymous URL and the time of the error.",unreachable:"The service could not complete this request. Wait a moment and try again.",request_error:"The connection was interrupted. Check your internet connection and try again.",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:"Anonymous GitHub cannot access the source repository on GitHub. It may be private, unavailable, or require the owner to reconnect GitHub.",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 temporarily blocked the request because we hit its API rate limit. Wait a few minutes and try again. If the problem persists and you contact GitHub Support, include the request ID and timestamp shown in GitHub's response (the 'X-GitHub-Request-Id' header).",rate_limited:"GitHub API rate limit reached. The repository will be available shortly \u2014 please wait a moment and refresh.",repoId_already_used:"The repository ID is already used.",invalid_repoId:"The format of the repository ID is invalid.",unsupported_source:"The repository source type is not supported.",branch_not_specified:"The branch is not specified.",branch_not_found:"The branch of the repository cannot be found.",commit_not_specified:"A commit must be specified.",commit_not_found:"The configured commit no longer exists in the source repository. It may have been force-pushed, rebased, or removed.",repo_renamed:"The source repository appears to have been renamed or moved on GitHub. Please refresh and try again \u2014 the cached name has been updated.",invalid_commit_format:"The commit hash format is invalid. It must be a hexadecimal string.",pull_request_not_found:"The requested pull request could not be found.",pull_request_expired:"This pull request has expired and is no longer available.",pull_request_no
Line truncated
|
||||
`)),e.options=Object.assign({},e.options,y.options),f.restore()})}c();let v=null;e.saveDefault=h=>{if(h&&h.preventDefault&&h.preventDefault(),e.saving)return;let y=f.checkpoint(),g={terms:e.terms.split(`
|
||||
`).map(C=>C.trim()).filter(C=>C.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",g).then(()=>{f.accept(y),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",v&&i.cancel(v),v=i(()=>{e.message=null},2500)},C=>{e.saving=!1;let w=C&&C.data&&C.data.error,S="Unable to save your defaults. Please try again.";Promise.all([s("ERRORS."+w),s("ERRORS.unknown_error")]).then(([N,b])=>{e.error=w&&N!==b?N:S},()=>{e.error=S})})},e.deleteAccount=()=>{e.deletingAccount||!e.confirmDeleteAccount||e.deleteUsername!==e.user?.username||(e.deletingAccount=!0,t.delete("/api/user").then(()=>{window.location.href="/"},()=>{e.deletingAccount=!1,e.deleteError="Unable to delete the account. Please try again."}))}},xc=function(e,t,s){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(i=>{s.url("/dashboard")},i=>{e.error=i.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},ep=function(e,t,s,i,o){e.user&&!e.user.status&&s.url("/dashboard"),e.watch("user.status",()=>{e.user&&!e.user.status&&s.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(f){e.feature=f},e.featureHref=function(f){return f.needsUser&&!e.user?"/signin":f.href},e.featureTarget=function(f){return f.needsUser&&!e.user?"_self":f.target||void 0},e.featureKeydown=function(f,c){let v={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[f.key];if(v===void 0)return;f.preventDefault();let h=e.features.length,y=v==="first"?0:v==="last"?h-1:(c+v+h)%h;e.feature=e.features[y].key,o(()=>{let g=i.document.getElementById("feature-tab-"+e.feature);g&&g.focus()})},e.demoText=`# DeepLearnUtils
|
||||
`+JSON.stringify(t):""}`},[ut.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${pg(t)}" via a navigation guard.`},[ut.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[ut.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[ut.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function ds(e,t){return Je(new Error,{type:e,[qu]:!0},t)}function wn(e,t){return e instanceof Error&&qu in e&&(t==null||!!(e.type&t))}var cg=["params","query","hash"];function pg(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let s of cg)s in e&&(t[s]=e[s]);return JSON.stringify(t,null,2)}function Lu(e){let t={};if(e===""||e==="?")return t;let s=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<s.length;++r){let i=s[r].replace(Cu," "),o=i.indexOf("="),u=_s(o<0?i:i.slice(0,o)),p=o<0?null:_s(i.slice(o+1));if(u in t){let c=t[u];Qt(c)||(c=t[u]=[c]),c.push(p)}else t[u]=p}return t}function Da(e){let t="";for(let s in e){let r=e[s];if(s=ng(s),r==null){r!==void 0&&(t+=(t.length?"&":"")+s);continue}(Qt(r)?r.map(i=>i&&wa(i)):[r&&wa(r)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+s,i!=null&&(t+="="+i))})}return t}function Fu(e){let t={};for(let s in e){let r=e[s];r!==void 0&&(t[s]=Qt(r)?r.map(i=>i==null?null:""+i):r==null?r:""+r)}return t}var $u=Symbol(""),Ta=Symbol(""),Xi=Symbol(""),Qi=Symbol(""),Ji=Symbol("");function zs(){let e=[];function t(r){return e.push(r),()=>{let i=e.indexOf(r);i>-1&&e.splice(i,1)}}function s(){e=[]}return{add:t,list:()=>e.slice(),reset:s}}function An(e,t,s,r,i,o=u=>u()){let u=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((p,c)=>{let v=g=>{g===!1?c(ds(ut.NAVIGATION_ABORTED,{from:s,to:t})):g instanceof Error?c(g):ug(g)?c(ds(ut.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(u&&r.enterCallbacks[i]===u&&typeof g=="function"&&u.push(g),p())},h=o(()=>e.call(r&&r.instances[i],t,s,v)),y=Promise.resolve(h);e.length<3&&(y=y.then(v)),y.catch(g=>c(g))})}function Zi(e,t,s,r,i=o=>o()){let o=[];for(let u of e)for(let p in u.components){let c=u.components[p];if(!(t!=="beforeRouteEnter"&&!u.instances[p]))if(wu(c)){let v=(c.__vccOpts||c)[t];v&&o.push(An(v,s,r,u,p,i))}else{let v=c();o.push(()=>v.then(h=>{if(!h)throw new Error(`Couldn't resolve component "${p}" at "${u.path}"`);let y=Wh(h)?h.default:h;u.mods[p]=h,u.components[p]=y;let g=(y.__vccOpts||y)[t];return g&&An(g,s,r,u,p,i)()}))}}return o}function Uu(e,t){let s=[],r=[],i=[],o=Math.max(t.matched.length,e.matched.length);for(let u=0;u<o;u++){let p=t.matched[u];p&&(e.matched.find(v=>ls(v,p))?r.push(p):s.push(p));let c=e.matched[u];c&&(t.matched.find(v=>ls(v,c))||i.push(c))}return[s,r,i]}var fg=()=>location.protocol+"//"+location.host;function Qu(e,t){let{pathname:s,search:r,hash:i}=t,o=e.indexOf("#");if(o>-1){let u=i.includes(e.slice(o))?e.slice(o).length:1,p=i.slice(u);return p[0]!=="/"&&(p="/"+p),Sa(p,"")}return Sa(s,e)+r+i}function mg(e,t,s,r){let i=[],o=[],u=null,p=({state:g})=>{let E=Qu(e,location),k=s.value,C=t.value,N=0;if(g){if(s.value=E,t.value=g,u&&u===k){u=null;return}N=C?g.position-C.position:0}else r(E);i.forEach(b=>{b(s.value,k,{delta:N,type:Ki.pop,direction:N?N>0?Yi.forward:Yi.back:Yi.unknown})})};function c(){u=s.value}function v(g){i.push(g);let E=()=>{let k=i.indexOf(g);k>-1&&i.splice(k,1)};return o.push(E),E}function h(){if(document.visibilityState==="hidden"){let{history:g}=window;if(!g.state)return;g.replaceState(Je({},g.state,{scroll:Uo()}),"")}}function y(){for(let g of o)g();o=[],window.removeEventListener("popstate",p),window.removeEventListener("pagehide",h),document.removeEventListener("visibilitychange",h)}return window.addEventListener("popstate",p),window.addEventListener("pagehide",h),document.addEventListener("visibilitychange",h),{pauseListeners:c,listen:v,destroy:y}}function Bu(e,t,s,r=!1,i=!1){return{back:e,current:t,forward:s,replaced:r,position:window.history.length,scroll:i?Uo():null}}function hg(e){let{history:t,location:s}=window,r={value:Qu(e,s)},i={value:t.state};i.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(c,v,h){let y=e.indexOf("#"),g=y>-1?(s.host&&document.querySelector("base")?e:e.slice(y))+c:fg()+e+c;try{t[h?"replaceState":"pushState"](v,"",g),i.value=v}catch(E){console.error(E),s[h?"replace":"assign"](g)}}function u(c,v){o(c,Je({},t.state,Bu(i.value.back,c,i.value.forward,!0),v,{position:i.value.position}),!0),r.value=c}function p(c,v){let h=Je({},i.value,t.state,{forward:c,scroll:Uo()});o(h.current,h,!0),o(c,Je({},Bu(r.value,c,null),{position:h.position+1},v),!1),r.value=c}return{location:r,state:i,push:p,replace:u}}function Ju(e){e=Iu(e);let t=hg(e),s=mg(e,t.state,t.location,t.replace);function r(o,u=!0){u||s.pauseListeners(),history.go(o)}let i=Je({locatLine truncated
|
||||
`).forEach((q,S)=>{for(let[L,H]of E){let W=L.exec(q);if(W&&!/^(if|for|while|switch|return|catch)$/.test(W[1])){P.push({name:W[1],kind:H,line:S+1});break}}}),k={content:e.content,list:P.slice(0,300)},k.list},e.goToSymbol=function(P){e.symbolsOpen=!1;let q=e.codeEditor;q&&(q.scrollToLine(P-1,!0,!0,()=>{}),q.gotoLine(P,0,!0),window.history.replaceState(null,"",window.location.pathname+window.location.search+"#L"+P),window.dispatchEvent(new HashChangeEvent("hashchange")))},e.gotoLine=function(){e.codeEditor&&(e.moreOpen=!1,e.gotoError="",e.gotoValue=String(e.codeEditor.getCursorPosition().row+1),e.gotoOpen=!0,setTimeout(()=>{let P=window.document.getElementById("goto-input");P&&(P.focus(),P.select())},0))},e.closeGoto=function(){e.gotoOpen=!1,e.gotoError="",e.codeEditor?.focus()},e.submitGoto=function(){let P=e.codeEditor;if(!P)return;let q=/^\s*:?\s*(\d+)\s*(?:[:,]\s*(\d+))?\s*$/.exec(e.gotoValue||""),S=P.session.getLength();if(!q||+q[1]<1||+q[1]>S){e.gotoError="Enter a line from 1 to "+S;return}P.gotoLine(+q[1],q[2]?Math.max(0,+q[2]-1):0,!0),e.gotoOpen=!1,e.gotoError="",P.focus()},e.rootEntries=function(){return[...e.files||[]].sort((P,q)=>{let S=P.size==null,L=q.size==null;return S!==L?S?-1:1:P.name.localeCompare(q.name)})},e.formatSize=function(P){if(P==null)return"";if(P<1024)return P+" B";let q=P/1024,S=L=>L.toFixed(1).replace(/\.0$/,"");return q<1024?S(q)+" KB":q<1024*1024?S(q/1024)+" MB":S(q/1024/1024)+" GB"},e.fileSize=function(P){if(!P)return null;let q=P.replace(/^\/+/,""),S=(e.files||[]).find(L=>(L.path?L.path+"/":"")+L.name===q);return S&&S.size!=null?S.size:null},e.revealFolder=function(P){e.sidebarHidden=!1,e.sidebarCollapsed=!1,Xe(()=>{let q=window.document.querySelector('.files a[data-path="/'+(window.CSS?.escape?window.CSS.escape(P):P)+'"]');q&&(q.closest("li")?.classList.contains("open")||q.click(),q.scrollIntoView({block:"nearest"}),q.focus())})};let C={content:null,n:0},N=P=>{if(C.content===P)return C.n;let q=P;if(typeof q=="string")try{q=JSON.parse(q)}catch{q=null}let S=[],L=W=>{Array.isArray(W)?S.push(W.join("")):typeof W=="string"&&S.push(W)};(q&&(q.cells||(q.worksheets||[]).flatMap(W=>W.cells||[]))||[]).forEach(W=>{L(W?.source??W?.input),(W?.outputs||[]).forEach(oe=>{L(oe?.text),oe?.data&&(L(oe.data["text/plain"]),L(oe.data["text/markdown"]),L(oe.data["text/html"])),L(oe?.traceback)})});let H=S.reduce((W,oe)=>W+(oe.match(s)||[]).length,0);return C={content:P,n:H},H};e.redactionCount=function(){return e.type==="IPython"?N(e.content):typeof e.content!="string"?0:((e.type==="html"?e.content.replace(/<[^>]*>/g," "):e.content).match(s)||[]).length},e.renderRedacted=_o;let b=P=>P.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").slice(0,60)||"section";e.renderReadme=function(P){let q=e.renderRedacted(P);if(!q||typeof window.DOMParser!="function")return q;let S=new window.DOMParser().parseFromString("<div>"+q+"</div>","text/html"),L={};return S.querySelectorAll("h1, h2, h3").forEach(H=>{let W=H.id||b(H.textContent);L[W]?W+="-"+ ++L[W]:L[W]=1,H.id=W}),S.body.firstChild.innerHTML};let D={content:null,list:[]};e.readmeToc=function(){if(e.type!=="html"||typeof e.content!="string")return[];if(D.content===e.content)return D.list;let q=[...new window.DOMParser().parseFromString("<div>"+e.renderReadme(e.sanitize?e.sanitize(e.content):e.content)+"</div>","text/html").querySelectorAll("h2, h3")].map(S=>({id:S.id,text:S.textContent.trim(),level:S.tagName==="H3"?3:2})).slice(0,40);return D={content:e.content,list:q},q},e.activeHeading=null,i(window,"scroll",()=>{let P=e.readmeToc?e.readmeToc():[];if(!P.length)return;let q=150,S="",L="";for(let H of P){let W=window.document.getElementById(H.id);if(!W)continue;let oe=W.getBoundingClientRect().top;oe<q?S=H.id:!L&&oe<window.innerHeight-80&&(L=H.id)}L&&(S=L),e.activeHeading!==S&&(e.activeHeading=S)},{capture:!0,passive:!0}),e.scrollToHeading=function(P){if(!P){(window.document.querySelector(".explorer-content, .file-card-body, .main-pane")||window).scrollTo({top:0,behavior:"smooth"}),e.activeHeading="";return}let q=window.document.getElementById(P);q&&q.scrollIntoView({behavior:"smooth",block:"start"}),e.activeHeading=P},e.csvView="table";let V={content:null,rows:[]},F=(P,q)=>{let S=[],L=[],H="",W=!1;for(let oe=0;oe<P.length;oe++){let ee=P[oe];W?ee==='"'?P[oe+1]==='"'?(H+='"',oe++):W=!1:H+=ee:ee==='"'&&H===""?W=!0:ee===q?(L.push(H),H=""):ee===`
|
||||
`||ee==="\r"?(ee==="\r"&&P[oe+1]===`
|
||||
`&&oe++,L.push(H),S.push(L),L=[],H=""):H+=ee}return(H!==""||L.length)&&(L.push(H),S.push(L)),S.filter(oe=>oe.length>1||oe[0]!=="")};e.isCsv=()=>typeof e.content=="string"&&e.type!=="html"&&/\.(csv|tsv)$/i.test(e.filePath||"")&&e.content.length<=1024*1024,e.csvRows=()=>{if(V.content!==e.content){let P=/\.tsv$/i.test(e.filePath||"")?" ":",";V={content:e.content,rows:F(e.content,P)}}return V.rows},e.csvNumCol=P=>{let q=e.csvRows().slice(1).map(S=>S[P]).filter(S=>S!=null&&String(S).trim()!=="");return q.length>0&&q.every(S=>e.csvNumeric(S))},e.csvNumeric=P=>/^\s*[-+]?(\d[\d,]*)?(\.\d+)?(e[-+]?\d+)?%?\s*$/i.test(P)&&/\d/.test(P),e.redactParts=function(P){let q=[],S=0,L,H=/\bXXXX-(\d+)\b/g;for(P=String(P||"");L=H.exec(P);)L.index>S&&q.push({t:P.slice(S,L.index)}),q.push({n:L[1]}),S=L.index+L[0].length;return S<P.length&&q.push({t:P.slice(S)}),q},e.pathCopied=!1,e.copyPath=async function(){window.navigator.clipboard?.writeText&&(await window.navigator.clipboard.writeText(e.filePath||""),e.pathCopied=!0,setTimeout(()=>{e.pathCopied=!1},1600))},e.contentCopied=!1,e.copyContent=async function(){if(typeof e.content!="string"||!window.navigator.clipboard?.writeText)return;let P=e.content;if(e.type==="html"&&e.url)if(e.preview)P=e.sourceContent;else try{P=await(await window.fetch(e.url,{credentials:"same-origin"})).text()}catch{return}await window.navigator.clipboard.writeText(P),e.contentCopied=!0,setTimeout(()=>{e.contentCopied=!1},1600)};function _(P){return o[P]?o[P]:P}function x(P){return P=="pdf"?"pdf":P=="html"||P=="htm"?"html-doc":["md","markdown","mdown","mkdn","mdx"].includes(P)?"md":P=="org"?"org":P=="ipynb"?"IPython":u.indexOf(P)>-1?"text":p.indexOf(P)>-1?"image":v.indexOf(P)>-1?"media":c.indexOf(P)>-1?"audio":"code"}e.downloadUrl=()=>e.preview?e.url:e.url+"&download=true",e.prepareFile=function(P){e.showSource=!1,e.allowScripts=!1,e.imageSize="",e.filePath=P,e.paths=P.split("/").filter(Boolean);let q=e.filePath.toLowerCase(),S=q.lastIndexOf(".");S>-1&&(q=q.substring(S+1));let L={javascript:"JavaScript",typescript:"TypeScript",tsx:"TSX",jsx:"JSX",python:"Python",java:"Java",c_cpp:"C/C++",csharp:"C#",golang:"Go",rust:"Rust",ruby:"Ruby",php:"PHP",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",yaml:"YAML",markdown:"Markdown",sh:"Shell",dockerfile:"Dockerfile",xml:"XML",sql:"SQL",kotlin:"Kotlin",swift:"Swift",scala:"Scala",r:"R",julia:"Julia",latex:"LaTeX",toml:"TOML",csv:"CSV",tsv:"TSV",text:""},H=_(q);e.languageName=L[H]??(H?H.charAt(0).toUpperCase()+H.slice(1):""),e.aceOption={readOnly:!0,useWrapMode:!0,showGutter:!0,theme:"chrome",useSoftTab:!0,tabSize:2,fontSize:window.matchMedia?.("(max-width: 767px)").matches?12:13,keyBinding:"vscode",fullLineSelection:!0,highlightActiveLine:!1,highlightGutterLine:!1,cursor:"hide",showInvisibles:!1,showIndentGuides:!1,showPrintMargin:!1,highlightSelectedWord:!1,enableBehaviours:!0,fadeFoldWidgets:!1,mode:_(q),onLoad:function(W){e.codeEditor=mn(W);{let Ne=W.session,$e=Ne.getTokens.bind(Ne),K=/\bXXXX-\d+\b/g;if(Ne.getTokens=function(pe){let te=$e(pe);if(!te.some(ye=>ye.value.indexOf("XXXX-")!==-1))return te;let fe=[];for(let ye of te){if(ye.value.indexOf("XXXX-")===-1){fe.push(ye);continue}let Oe=0;K.lastIndex=0;let T;for(;T=K.exec(ye.value);)T.index>Oe&&fe.push({type:ye.type,value:ye.value.slice(Oe,T.index)}),fe.push({type:"redacted.n"+T[0].slice(5),value:T[0]}),Oe=T.index+T[0].length;Oe<ye.value.length&&fe.push({type:ye.type,value:ye.value.slice(Oe)})}return fe},!window.document.getElementById("redact-index-rules")){let pe=window.document.createElement("style");pe.id="redact-index-rules",pe.textContent=Array.from({length:99},(te,fe)=>`.ace_redacted.ace_n${fe+1}::after{content:"${fe+1}"}`).join(""),window.document.head.appendChild(pe)}W.renderer.updateFull(!0)}W.session.setUseWrapMode(e.wrapLines!==!1);let oe=W.container.closest?.(".file-card"),ee=()=>{if(!oe)return;let Ne=W.renderer,$e=(Ne.layerConfig?.width||0)-(Ne.$size?.scrollerWidth||0);oe.classList.toggle("at-right-edge",$e<=2||Ne.getScrollLeft()>=$e-2)};W.session.on("changeScrollLeft",ee),W.renderer.on("afterRender",ee),window.matchMedia?.("(max-width: 767px)").matches&&W.setOption("hScrollBarAlwaysVisible",!0);let ie=ace.require("ace/range").Range,he=null;function Ee(Ne,$e){he!==null&&(W.session.removeMarker(he),he=null),Ne!=null&&(he=W.session.addMarker(new ie(Ne,0,$e,1),"highlighted-line","fullLine"))}function _e(Ne){let $e=!e.preview&&window.location.hash.match(/^#L(\d+)(?:-L(\d+))?/);if(!$e){Ee(null);return}let K=parseInt($e[1])-1,pe=$e[2]?parseInt($e[2])-1:K;Ee(K,pe),Ne&&r.timeout(()=>{W.scrollToLine(K,!0,!0,function(){})},100)}_e(!0);let Ge=null;W.on("guttermousedown",function(Ne){let $e=Ne.getDocumentPosition().row,K=Ne.domEvent&&Ne.domEvent.shiftKey,pe=$e,te=$e;K&&Ge!==null?(pe=Math.min(Ge,$e),te=Math.max(Ge,$e)):Ge=$e;let fe=pe===te?`#L${pe+1}`:`#L${pe+1}-L${te+1}`,ye=window.location.pathname+window.location.search+fe;e.preview||window.history.replaceState(null,"",ye),Ee(pe,te),Ne.stop()});let Ze=i(window,
Line truncated
|
||||
`)],{type:"text/csv;charset=utf-8"})),H=document.createElement("a");H.href=L,H.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(H),H.click(),H.remove(),URL.revokeObjectURL(L),e.copyStatus="Redis history exported."}catch{e.copyStatus="Could not export the Redis history."}},g().then(()=>{e.errView!=="list"&&D()});let ue=r(()=>{e.errView==="list"&&!e.issueLoading&&document.visibilityState!=="hidden"&&g({quiet:!0})},6e4);e.on("dispose",()=>{p=!0,window.clearTimeout(C),i++,o++,u++,r.cancel(ue)})};var $a={};Vf($a,{bigNum:()=>Kg,date:()=>ir,dateEcho:()=>rr,diff:()=>Qg,duration:()=>Un,filter:()=>ev,humanFileSize:()=>Wg,humanTime:()=>La,limitTo:()=>xg,money:()=>Jg,number:()=>Fa,orderBy:()=>tv,plural:()=>nv,shortDate:()=>ar,statusLabel:()=>Xg,statusMsg:()=>or,title:()=>Yg,uppercase:()=>Zg});var Wg=e=>String(window.humanFileSize(e)).replace(/([KMGTPEZY])iB$/,"$1B").replace(/\.0 ([KMGTPEZY]?B)$/," $1"),Kg=(function(){return function(t){let s=Number(t)||0,r=Math.abs(s);return r<1e3?String(s):r<1e4?(s/1e3).toFixed(1).replace(/\.0$/,"")+"k":r<1e6?Math.round(s/1e3)+"k":r<1e7?(s/1e6).toFixed(1).replace(/\.0$/,"")+"M":Math.round(s/1e6)+"M"}})(),La=(function(){return function(t){if(!t)return"never";var s=null;t instanceof Date&&(s=t,t=Math.round((Date.now()-t)/1e3)),(typeof t=="string"||typeof t=="number")&&(s=new Date(t),t=Math.round((Date.now()-s)/1e3));var r=t<0?"from now":"ago";if(Math.abs(t)>7200*24)return(s&&!isNaN(s)?s:new Date(Date.now()-t*1e3)).toLocaleDateString(void 0,{day:"numeric",month:"short",year:"numeric"});t=Math.abs(t);for(var i=[t/60/60/24/365,t/60/60/24/30,t/60/60/24/7,t/60/60/24,t/60/60,t/60,t],o=["year","month","week","day","hour","minute","second"],u=0;u<o.length;u++){var p=Math.floor(i[u]),c=o[u];if(p>1&&(c+="s"),p>=1)return p+" "+c+" "+r}return"0 seconds "+r}})(),Yg=(function(){return function(e){if(!e)return e;e=e.toLowerCase();var t=e.split(" "),s=t.map(function(r){return r.charAt(0).toUpperCase()+r.substring(1,r.length)});return s.join(" ")}})(),Xg=(function(){var e={ready:"Ready",error:"Error",expired:"Expired",expiring:"Expiring",removed:"Removed",removing:"Removing",queue:"Queued",download:"Downloading",downloaded:"Downloaded",preparing:"Preparing",anonymizing:"Anonymizing"};return function(t){if(!t)return"";if(e[t])return e[t];var s=String(t).replace(/[_-]+/g," ").toLowerCase();return s.charAt(0).toUpperCase()+s.slice(1)}})(),or=(function(){var e={branch_not_found:"Branch not found on GitHub",repo_not_found:"Repository not found on GitHub",repository_not_found:"Repository not found on GitHub",repo_not_accessible:"Repository is not accessible with your token",pr_not_found:"Pull request not found on GitHub",gist_not_found:"Gist not found on GitHub",commit_not_found:"Commit not found on GitHub",repo_too_big:"Repository exceeds the size limit",repository_too_big:"Repository exceeds the size limit",quota_exceeded:"Hosting allowance exceeded",quota_repository_limit:"Repository limit reached",quota_storage_limit:"Storage allowance exceeded",incomplete_record:"Incomplete record: missing identifier"};return function(t){if(!t)return t;var s=t.match(/^rate_limited:(\d+)$/);if(s){var r=Math.max(0,Math.ceil((parseInt(s[1],10)-Date.now())/1e3));if(r<=0)return"Rate limited \u2014 resuming soon";var i=Math.floor(r/60),o=r%60;return"Rate limited \u2014 retrying in "+(i>0?i+"m "+o+"s":o+"s")}if(e[t])return e[t];var u=/^([a-z0-9]+(?:_[a-z0-9]+)+):\s*\S/.exec(t);if(u){if(e[u[1]])return e[u[1]];var p=u[1].replace(/_/g," ");return p.charAt(0).toUpperCase()+p.slice(1)}if(/^[a-z0-9]+(_[a-z0-9]+)+$/.test(t)){var c=t.replace(/_/g," ");return c.charAt(0).toUpperCase()+c.slice(1)}return t}})(),Qg=(function(e){let t=r=>r.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">");function s(r,i){if(!i)return;let o=i.newPath&&i.newPath!=="/dev/null"?i.newPath:i.oldPath||"",u=i.oldPath==="/dev/null"?"added":i.newPath==="/dev/null"?"deleted":i.oldPath&&i.newPath&&i.oldPath!==i.newPath?"renamed":"modified";if(r.push('<div class="diff-file-block">'),r.push('<div class="diff-file-header"><span class="diff-file-icon"><i class="far fa-file-code"></i></span><span class="diff-file-name">'+t(o)+'</span><span class="diff-file-status diff-file-status-'+u+'">'+u+"</span></div>"),i.lines.length){r.push('<table class="diff-file-table"><tbody>');for(let p of i.lines)r.push('<tr class="diff-row diff-row-'+p.kind+'"><td class="diff-gutter diff-gutter-old">'+(p.oldNo||"")+'</td><td class="diff-gutter diff-gutter-new">'+(p.newNo||"")+'</td><td class="diff-sign">'+(p.kind==="add"?"+":p.kind==="remove"?"-":"")+'</td><td class="diff-code" style="--hang:'+Math.min(((p.text||"").match(/^[ \t]*/)[0]||"").replace(/\t/g," ").length+4,24)+'ch">'+t(p.text)+"</td></tr>");r.push("</tbody></table>")}r.push("</div>")}return function(r){if(!r)return r;let i=[],o=null,u=0,p=0,c=()=>(o||(o={oldPath:"",newPath:"",lines:[]}),o),v=()=>{o&&(o.lines.length||o.oldPath||o.newPath)&&(s(i,o),o=null)},h=r.split(`
|
||||
`);for(let y=0;y<h.length;y++){let g=h[y];if(g.startsWith("diff --git")){v(),c();continue}if(g.startsWith("--- ")){o&&o.lines.length&&v(),c().oldPath=g.replace(/^--- (a\/)?/,"").trim();continue}if(g.startsWith("+++ ")){c().newPath=g.replace(/^\+\+\+ (b\/)?/,"").trim();continue}if(!(g.startsWith("index ")||g.startsWith("similarity index")||g.startsWith("rename ")||g.startsWith("new file mode")||g.startsWith("deleted file mode")||g.startsWith("Binary files"))){if(g.startsWith("@@")){let E=g.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);E&&(u=parseInt(E[1],10),p=parseInt(E[2],10)),c().lines.push({kind:"hunk",oldNo:"",newNo:"",text:g});continue}o&&(g.startsWith("+")?(o.lines.push({kind:"add",oldNo:"",newNo:p,text:g.slice(1)}),p++):g.startsWith("-")?(o.lines.push({kind:"remove",oldNo:u,newNo:"",text:g.slice(1)}),u++):(o.lines.push({kind:"ctx",oldNo:u,newNo:p,text:g.startsWith(" ")?g.slice(1):g}),u++,p++))}}return s(i,o),i.join("")}})({trustAsHtml:e=>e});function Fa(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function Jg(e,t="EUR"){let s=Number(e)||0;return new Intl.NumberFormat(void 0,{style:"currency",currency:t,minimumFractionDigits:s%1?2:0,maximumFractionDigits:2}).format(s)}function Zg(e){return String(e??"").toUpperCase()}function xg(e,t,s=0){return(e||[]).slice(s,s+t)}function ev(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function tv(e,t){if(!t)return e||[];let s=Array.isArray(t)?t:[t];return[...e||[]].sort((r,i)=>{for(let o of s){let u=o[0]==="-"?-1:1;o=o.replace(/^[+-]/,"");let p=o.split(".").reduce((v,h)=>v?.[h],r),c=o.split(".").reduce((v,h)=>v?.[h],i);if(typeof p=="string"&&(p=p.toLowerCase()),typeof c=="string"&&(c=c.toLowerCase()),p!==c)return(p==null?-1:c==null?1:p<c?-1:1)*u}return 0})}function ir(e,t){if(!e)return"";let s=new Date(e);if(isNaN(s))return String(e);if(!t||t==="mediumDate")return s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});let r={yyyy:s.getFullYear(),MMM:s.toLocaleDateString(void 0,{month:"short"}),MM:String(s.getMonth()+1).padStart(2,"0"),dd:String(s.getDate()).padStart(2,"0"),d:s.getDate(),HH:String(s.getHours()).padStart(2,"0"),mm:String(s.getMinutes()).padStart(2,"0"),ss:String(s.getSeconds()).padStart(2,"0")};return t.replace(/yyyy|MMM|MM|dd|HH|mm|ss|d/g,i=>r[i])}function nv(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}function rr(e){if(!e)return"";let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(e)),s=t?new Date(+t[1],+t[2]-1,+t[3]):new Date(e);if(isNaN(s))return"";let r=s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),i=new Date;i.setHours(0,0,0,0);let o=Math.round((s-i)/864e5),u;if(o===0)u="today";else if(o===1)u="tomorrow";else if(o===-1)u="yesterday";else{let p=Math.abs(o),c=Math.round(p/30.44),v=p<14?[p,"day"]:p<60?[Math.round(p/7),"week"]:c<18?[c,"month"]:[Math.round(p/365.25),"year"],h=v[0]+" "+v[1]+(v[0]===1?"":"s");u=o>0?"in "+h:h+" ago"}return r+" \xB7 "+u}function Un(e){if(e==null||e===""||isNaN(e))return"";e=Number(e);let t="\u202F";if(e<1e3)return+(e<10?e.toFixed(2):e<100?e.toFixed(1):Math.round(e))+t+"ms";let s=e/1e3;if(s<60)return+(s<10?s.toFixed(2):s.toFixed(1))+t+"s";let r=o=>String(o).padStart(2,"0"),i=Math.round(s);return i<3600?Math.floor(i/60)+"m "+r(i%60)+"s":Math.floor(i/3600)+"h "+r(Math.floor(i%3600/60))+"m"}function ar(e){if(!e)return"";let t=new Date(e);if(isNaN(t))return"";let s={day:"numeric",month:"short"};return t.getFullYear()!==new Date().getFullYear()&&(s.year="numeric"),t.toLocaleDateString(void 0,s)}function js(e){e.listLoading=!0,e.listLoaded===void 0&&(e.listLoaded=!1)}function Ua(e){e.listLoading=!1,e.listLoaded=!0}var dr=e=>["preparing","download","downloading","downloaded","queue","anonymizing"].includes(e)?"preparing":e==="expiring"?"expired":e==="removing"?"removed":e;function ur(e,{flags:t,keys:s,count:r,onChange:i=()=>{}}){if(e.segView=()=>{let o=t()||{};if(s.every(p=>!!o[p]))return"all";let u=s.filter(p=>!!o[p]);return u.length===1?u[0]:"custom"},e.setSegView=o=>{let u=t();if(u){for(let p of s)u[p]=o==="all"?!0:p===o;i()}},e.segCount=o=>o==="all"?s.reduce((u,p)=>u+r(p),0):r(o),t()&&e.segView()==="custom")for(let o of s)t()[o]=!0}var uc=function(e,t,s){let r=wt(),i=Ht();gc(r,i),e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),e.repositories=[],e.total=-1,e.listLoaded=!1,e.listLoading=!0,e.totalPage=0,e.statusCounts=[],e.totalSize=0,e.selected={},e.allSelected=!1;let o=C=>{if(C.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){C.preventDefault();let N=document.querySelector('.admin-filter-toolbar input[type="search"]');N&&N.focus()}};i(document,"keydown",o),e.on("dispose",()=>document.removeEventListener("keydown",o)),e.clearFilter=C=>{C==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[C]="",e.query.page=1},e.chips=[];let u=()=>{let C=[];e.query.owner&&C.push({key:"
Line truncated
|
||||
`+C.join(`
|
||||
`)],{type:"text/csv"}),b=document.createElement("a");b.href=URL.createObjectURL(N),b.download=r.username+"-repositories.csv",b.click()},e.showStatusMessage=g=>{let E=g.statusMessage||"(no message)";window.prompt(`Status message for ${g.repoId} (${g.status}):`,E)},e.fetchGithubInfo=g=>{let E=window.open("","_blank");E&&E.document.write("<pre>Loading GitHub info for "+g.repoId+"...</pre>"),t.get("/api/admin/repos/"+g.repoId+"/github").then(k=>{E&&(E.document.open(),E.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(k.data,null,2).replace(/[<>]/g,C=>C==="<"?"<":">")+"</pre>"),E.document.close())},k=>{let C=k&&k.data?JSON.stringify(k.data,null,2):String(k);E&&(E.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+C+"</pre>")})};function c(g){t.get("/api/admin/users/"+g+"/repos",{}).then(E=>{e.repositories=E.data},E=>{console.error(E)})}function v(g){t.get("/api/admin/users/"+g,{}).then(E=>{e.userInfo=E.data,e.loadEntityErrors()},E=>{console.error(E)})}Va(e,t,()=>/^[a-f0-9]{24}$/.test(e.userInfo?._id||"")?{userId:e.userInfo._id}:null),v(r.username),c(r.username),e.banUser=()=>{confirm(`Ban user ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/ban`).then(()=>v(r.username),g=>console.error(g))},e.activateUser=()=>{t.post(`/api/admin/users/${r.username}/activate`).then(()=>v(r.username),g=>console.error(g))},e.promoteUser=()=>{confirm(`Promote ${r.username} to admin?`)&&t.post(`/api/admin/users/${r.username}/promote`).then(()=>v(r.username),g=>console.error(g))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/demote`).then(()=>v(r.username),g=>console.error(g))},e.tokens=[],e.tokenForm={name:"",plaintext:null};function h(){t.get("/api/admin/tokens").then(g=>{e.tokens=g.data||[]},g=>{g.status!==401&&g.status!==403&&console.error(g)})}h(),e.createToken=()=>{e.tokenForm.name&&t.post("/api/admin/tokens",{name:e.tokenForm.name}).then(g=>{e.tokenForm.plaintext=g.data.token,e.tokenForm.name="",h()},g=>console.error(g))},e.revokeToken=g=>{confirm(`Revoke token "${g.name}"?`)&&t.delete("/api/admin/tokens/"+g.id).then(()=>h(),E=>console.error(E))},e.removeCache=g=>{confirm("Remove cached files for "+g.repoId+"?")&&t.delete("/api/admin/repos/"+g.repoId).then(()=>c(r.username),E=>console.error(E))},e.removeRepository=g=>{confirm("Remove repository "+g.repoId+"?")&&t.delete("/api/repo/"+g.repoId+"/").then(()=>c(r.username),E=>console.error(E))},e.updateRepository=g=>{let E=rt({title:`Refreshing ${g.repoId}...`,date:new Date,body:`The repository ${g.repoId} is going to be refreshed.`});e.toasts.push(E),t.post(`/api/repo/${g.repoId}/refresh`).then(k=>{k.data.status=="ready"?E.title=`${g.repoId} is refreshed.`:E.title=`Refreshing of ${g.repoId}.`},k=>{E.title=`Error during the refresh of ${g.repoId}.`,E.body=k.body})},e.getGitHubRepositories=g=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(E=>{e.userInfo.repositories=E.data})};let y=null;e.watch("query",()=>{i.timeout.cancel(y),y=i.timeout(()=>{c(r.username)},500)},!0)},fc=function(e,t,s){let r=wt(),i=Ht();e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),e.conferences=[],e.total=-1,e.listLoaded=!1,e.listLoading=!0,e.totalPage=0,e.statusCounts=[];let o=k=>{if(k.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){k.preventDefault();let C=document.querySelector('.admin-filter-toolbar input[type="search"]');C&&C.focus()}};i(document,"keydown",o),e.on("dispose",()=>document.removeEventListener("keydown",o)),e.clearFilter=k=>{k==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[k]="",e.query.page=1},e.chips=[];let u=()=>{let k=[];(e.query.dateFrom||e.query.dateTo)&&k.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=k};e.statusCountFor=k=>{let C=(e.statusCounts||[]).find(N=>N._id===k);return C?C.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=k=>{e.query.sort===k?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=k,e.query.direction="desc"),e.query.page=1},e.sortIcon=k=>e.query.sort===k?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let p="admin.conferences.filterPrefs",c={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!0,expired:!0,removed:!0,error:!0,preparing:!0},v=loadFilterPrefs(p)||{};e.query=Object.assign({},c,v,{page:1,search:""});let h=s.search();h.search&&(e.query.search=h.search);let y="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(y)||"[]"),e.savePreset=()=>{let k=window.prompt("Preset name:");if(!k)return;let C=Object.assign({},e.query);delete C.page,e.presets=(e.presets||[]).filter(N=>N.name!==k),e.presets.push({name:k,query:C}),localStorage.setItem(y,JSON.stringify(e.presets))},e.applyPreset=k=>{
Line truncated
|
||||
`)},e.tipSide=k=>{let C=(e.summary?.series||[]).length;return C<3?"":k<C/4?"tip-start":k>=C*3/4?"tip-end":""},e.bucketName=()=>({day:"day",week:"week",month:"month"})[e.summary?.bucket]||"day",e.seriesSales=()=>(e.summary?.series||[]).reduce((k,C)=>k+e.bucketTotal(C),0),e.plansWithActivity=()=>(e.summary?.plans||[]).filter(k=>k.active||k.allTimeSales||k.sales),e.familyLabel=k=>(lr.find(C=>C.id===k)||{}).label||"",e.familyPlans=k=>(e.summary?.plans||[]).filter(C=>C.family===k),e.familySum=(k,C)=>e.familyPlans(k).reduce((N,b)=>N+(b[C]||0),0),e.familyMoney=(k,C,N)=>{if(!e.revenueOn())return"\u2014";let b=e.familyPlans(k);return b.some(D=>D[N]===!1)?"Incomplete":e.moneyText(b.reduce((D,V)=>o(D,V[C]),{}))},e.planTotals=()=>{let k=C=>(e.summary?.plans||[]).reduce((N,b)=>N+(b[C]||0),0);return{active:k("active"),sales:k("sales"),allTimeSales:k("allTimeSales")}},e.webhookState=()=>{let k=e.summary?.webhooks;return k?k.failed||k.reconciliationFailed?"bad":k.oldestPendingSeconds>900||k.unreviewedRevocations?"warn":"ok":"ok"},e.age=k=>k?Un(k*1e3):"\u2014";let u=0;e.loadSummary=()=>{let k=++u;e.summaryLoading=!0,e.summaryError=null,t.get("/api/admin/billing/summary",{params:{period:e.period}}).then(C=>{if(k!==u)return;e.summaryLoading=!1;let N=C.data;if(!N||!N.subscriptions||!N.sales||!Array.isArray(N.plans)){e.summaryError="The billing summary had an unexpected format.";return}e.summary=N},C=>{k===u&&(e.summaryLoading=!1,e.summaryError=C&&C.data&&C.data.error||"Could not load billing figures.")})},e.setPeriod=k=>{if(e.period!==k){e.period=k;try{localStorage.setItem("admin.billing.period",k)}catch{}e.loadSummary()}},e.grants=[],e.total=-1,e.totalPage=0,e.stateCounts={},e.statuses=[],e.grantsError=null,e.filtersOpen=!1,e.query={page:1,limit:25,search:"",plan:"",status:"",state:"",period:"",sort:"purchasedAt",direction:"desc"};let p=s.search();p.search&&(e.query.search=p.search),e.stateView=()=>e.query.state||"all",e.setStateView=k=>{e.query.state=k==="all"?"":k,e.query.page=1},e.stateCount=k=>k==="all"?["active","expired","revoked"].reduce((C,N)=>C+(e.stateCounts[N]||0),0):e.stateCounts[k]||0,e.sortBy=k=>{e.query.sort===k?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=k,e.query.direction="desc"),e.query.page=1},e.sortIcon=k=>e.query.sort===k?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"",e.chips=[];let c=()=>{let k=[];e.query.plan&&k.push({key:"plan",label:"Plan",value:e.planName(e.query.plan)}),e.query.status&&k.push({key:"status",label:"Stripe status",value:e.query.status.replace(/_/g," ")}),e.query.period&&k.push({key:"period",label:"Started",value:"last "+((e.periods.find(C=>C.id===e.query.period)||{}).label||e.query.period)}),e.chips=k};e.clearFilter=k=>{e.query[k]="",e.query.page=1},e.filterPlan=k=>{Object.assign(e.query,{plan:k,page:1});let C=document.getElementById("bl-grants");C&&C.scrollIntoView&&C.scrollIntoView({behavior:"smooth",block:"start"})},e.clearFilters=()=>Object.assign(e.query,{search:"",plan:"",status:"",state:"",period:"",page:1}),e.hasFilters=()=>!!(e.query.search||e.query.plan||e.query.status||e.query.state||e.query.period),e.filterCount=()=>["plan","status","period"].filter(k=>e.query[k]).length,e.amountText=k=>{if(!k.amount)return"\u2014";let C=ps({[k.amount.currency]:k.amount.value})[0]||"\u2014";if(!k.amount.interval)return C;let N=k.amount.intervalCount>1?k.amount.intervalCount+" "+k.amount.interval+"s":k.amount.interval;return C+" / "+N},e.amountTitle=k=>k.amount?"Stripe list price"+(k.pack?" of the whole pack":""):{stripe_not_configured:"Revenue unavailable: Stripe is not configured on this server.",unresolved:"Revenue unavailable: this Stripe price could not be looked up.",unrecorded:"Revenue unavailable: no sale price was recorded for this subscription."}[k.amountMissing]||"Revenue unavailable.",e.endText=k=>{if(k.never)return"Never ends";if(!k.until)return"\u2014";let C=ir(k.until);return k.state!=="active"?(new Date(k.until)<new Date?"Ended ":"Ends ")+C:k.subscription?(k.cancelAtPeriodEnd?"Ends ":"Renews ")+C:"Until "+C},e.packNote=k=>{let C=(k.parts||[]).find(N=>N.planId==="author_pass");return!k.pack||!C||!C.until?"":(new Date(C.until)<new Date?"Updates ended ":"Updates until ")+ir(C.until)};let v={repo_slot:"repository",author_pass:"updates",repo_extend:"+1 year"};e.packParts=k=>(k.parts||[]).map(C=>v[C.planId]||e.planName(C.planId)).join(", ").replace(/^./,C=>C.toUpperCase()),e.packPartsTitle=k=>"Paper pack: "+(k.parts||[]).map(C=>e.planName(C.planId)).join(", "),e.statusText=k=>(k.status||"unknown").replace(/_/g," "),e.revocationText=k=>k==="dispute"?"Disputed":k==="full_refund"?"Refunded":"Revoked",e.scopeHref=k=>k?.kind==="repo"?"/admin/repositories?search="+encodeURIComponent(k.id):k?.kind==="conference"?"/conference/"+encodeURIComponent(k.id):null;let h=0;function y(){let k=++h;e.grantsError=null;let C=Object.fromEntries(Object.entries(e.query).filter(([,N])=>N!==""&&N!=null));t.get("/api/admin/billing/grants",{params:C}).then(N=>{k===h&&(
Line truncated
|
||||
`)},Ka=class{constructor(t){tt(this,"gen");tt(this,"threads",[]);tt(this,"match",!1);tt(this,"runs",[]);tt(this,"ids",[]);this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},Mc=(e,t)=>e.ids.length!==t.ids.length||e.runs.length!==t.runs.length||e.ids.some((s,r)=>s!==t.ids[r])?!1:e.runs.every(s=>t.runs.some(r=>r.neg===s.neg&&Mc(r.state,s.state))),Rc=e=>({has:new Float64Array(e),seen:new Float64Array(e),gen:0}),ms,Gn,Ya,Xa,Go=class{constructor(t,s,r){qe(this,Gn);tt(this,"dots");tt(this,"dotStart");qe(this,ms);this.dots=t,this.dotStart=s,Ue(this,ms,r)}state(){return new Ka(++re(this,ms).gen)}done(t){return t.ids=t.threads.map(s=>s.id).sort((s,r)=>s-r),t.match&&t.ids.unshift(Wa.id),t}restricted(t,s){return s&&(this.dots||this.dotStart&&t===0)}add(t,s,r,i){switch(s.t){case"split":if(!Le(this,Gn,Ya).call(this,t,s))return;for(let u of s.out)this.add(t,u,r,i);return;case"neg":if(!Le(this,Gn,Ya).call(this,t,s))return;let o=this.state();return this.add(o,s.sub,r,!1),this.done(o),this.addRun(t,{t:"run",neg:s,state:o},r,i);case"star":if(this.restricted(r,i))return;Le(this,Gn,Xa).call(this,t,s)&&this.add(t,s.next,r,i);return;case"match":t.match=!0;return;default:Le(this,Gn,Xa).call(this,t,s)}}addRun(t,s,r,i){for(let o of t.runs)if(o.neg===s.neg&&Mc(o.state,s.state))return;t.runs.push(s),s.state.match||this.add(t,s.neg.next,r,i)}step(t,s,r,i){let o=this.state();for(let u of t.threads)switch(u.t){case"lit":Za(u,s)&&this.add(o,u.next,r+1,i);break;case"any":this.restricted(r,i)||this.add(o,u.next,r+1,i);break;case"class":!this.restricted(r,i)&&u.re.test(s)&&this.add(o,u.next,r+1,i);break;case"star":this.restricted(r,i)||this.add(o,u,r+1,i)}if(!this.restricted(r,i))for(let u of t.runs){if(u.state.dead){this.addRun(o,u,r+1,i);continue}let p=this.step(u.state,s,r,!1);this.addRun(o,{t:"run",neg:u.neg,state:p},r+1,i)}return this.done(o)}};ms=new WeakMap,Gn=new WeakSet,Ya=function(t,s){let{seen:r}=re(this,ms);return r[s.id]===t.gen?!1:(r[s.id]=t.gen,!0)},Xa=function(t,s){let{has:r}=re(this,ms);return r[s.id]===t.gen?!1:(r[s.id]=t.gen,t.threads.push(s),!0)};var Vc=e=>{let t=e.ids.join();if(!e.runs.length)return t;let s=e.runs.map(r=>`${r.neg.id}(${Vc(r.state)})`);return`${t}|${s.sort().join("|")}`},Fv=1<<18,Gs,Ws,Bn,hs,_n,Hn,zn,an,Ja,fr,qc,Qa=class{constructor(t,s){qe(this,an);qe(this,Gs);qe(this,Ws,new Map);qe(this,Bn,0);qe(this,hs);qe(this,_n);qe(this,Hn);qe(this,zn);Ue(this,Gs,t),Ue(this,Hn,new Go(!1,!1,s)),Ue(this,zn,new Go(!1,!0,s))}start(t){if(t){if(re(this,_n))return re(this,_n);let r=re(this,zn).state();return re(this,zn).add(r,re(this,Gs),0,!0),Ue(this,_n,Le(this,an,Ja).call(this,re(this,zn).done(r)))}if(re(this,hs))return re(this,hs);let s=re(this,Hn).state();return re(this,Hn).add(s,re(this,Gs),0,!0),Ue(this,hs,Le(this,an,fr).call(this,re(this,Hn).done(s)))}next(t,s){let r=s.charCodeAt(0),i=r<128?void 0:t.next.get(s);if(i)return i;let o=t===re(this,_n)?Le(this,an,fr).call(this,re(this,zn).step(t.state,s,0,!0)):Le(this,an,fr).call(this,re(this,Hn).step(t.state,s,1,!0));return r<128?(t.ascii||(t.ascii=new Array(128),Ue(this,Bn,re(this,Bn)+128)),t.ascii[r]=o):t.next.set(s,o),El(this,Bn)._++,o}};Gs=new WeakMap,Ws=new WeakMap,Bn=new WeakMap,hs=new WeakMap,_n=new WeakMap,Hn=new WeakMap,zn=new WeakMap,an=new WeakSet,Ja=function(t){return{state:t,match:t.match,dead:t.dead,next:new Map}},fr=function(t){let s=Vc(t),r=re(this,Ws).get(s);if(r)return r;re(this,Bn)>Fv&&Le(this,an,qc).call(this);let i=Le(this,an,Ja).call(this,t);return re(this,Ws).set(s,i),Ue(this,Bn,re(this,Bn)+(s.length+1)),i},qc=function(){re(this,Ws).clear(),Ue(this,Bn,0),Ue(this,hs,void 0),Ue(this,_n,void 0)};var $v=e=>{let t=[];for(let s=e;s.t!=="match";s=s.next){if(s.t==="split"||s.t==="neg")return;t.push(s)}return t},Uv=(e,t,s,r)=>{let i=0,o=s,u=-1,p=0;for(;o<r;){let c=e[i];if(c?.t==="star"){u=i++,p=o;continue}let v=t[o];if(c&&(c.t==="any"||c.t==="lit"&&Za(c,v)||c.t==="class"&&c.re.test(v))){i++,o++;continue}if(u===-1)return!1;i=u+1,o=++p}for(;e[i]?.t==="star";)i++;return i===e.length},Lc=e=>{let t=0,s=0;for(let r of e){let[i,o]=Bv(r);t+=i,s+=o}return[t,s]},Bv=e=>{if(e.t==="star")return[0,1/0];if(e.t!=="ext")return[1,1];if(e.type==="!")return[0,1/0];let t=e.alts.map(Lc),s=Math.min(...t.map(o=>o[0])),r=Math.max(...t.map(o=>o[1])),i=r===0?0:1/0;return e.type==="@"?[s,r]:e.type==="?"?[0,r]:e.type==="*"?[0,i]:[s,i]},Pc=(e,t,s)=>{for(let r=0;r<e.length;r++)if(!Za(e[r],t[s+r]))return!1;return!0},_v=/[/\ud800-\udfff]/,Hv=/[\ud800-\udfff]/,pr=e=>Hv.test(e)?[...e]:e,Dc=e=>{if(e.includes("/"))throw new Error("can only match a single path portion, got: "+e)},jn,Ks,gs,mr,vs,Ko,hr,ys,Yo,Xo,Qo,Mn,kn,Ys,Xs,Jo,gr,rn,bs,jo,Wo=class{constructor(t,s={}){qe(this,bs);tt(this,"pattern");tt(this,"options");qe(this,jn);qe(this,Ks);qe(this,gs);qe(this,mr);qe(this,vs);qe(this,Ko,!1);qe(this,hr);qe(this,ys);qe(this,Yo,!1);qe(this,Xo,0);qe(this,Qo,1/0);qe(this,Mn,[]);qe(this,kn,[]);qe(this,Ys);qe(this,Xs);qe(this,Jo,!1);qe(this,gr);qe(this,rn);if(t.includes
Line truncated
|
||||
`).forEach((s,r)=>{let{term:i}=ul(s.trim());if(!i)return;let o=[];for(let u=0;u<i.length;u++){if(i[u]==="\\"){u++;continue}xc.has(i[u])&&!o.includes(i[u])&&o.push(i[u])}o.length&&t.push({line:r,term:i,symbols:o})}),t}function tp(e,t){let s=String(e||"").split(`
|
||||
`),r=s[t];if(r===void 0)return e;let{term:i}=ul(r.trim());if(!i)return e;let o="";for(let p=0;p<i.length;p++){if(i[p]==="\\"){o+=i.slice(p,p+2),p++;continue}o+=xc.has(i[p])||i[p]==="."?"\\"+i[p]:i[p]}let u=r.indexOf(i);return s[t]=r.slice(0,u)+o+r.slice(u+i.length),s.join(`
|
||||
`)}var Jn={VIEWER_ERRORS:{title:"Content could not be loaded",access_title:"GitHub access needs attention",reader_help:"Reading this repository? You do not need to sign in. Try again after the owner restores access, or let them know this anonymous link is unavailable.",owner_help:"Own this repository? If your GitHub account was suspended or recently recovered, sign in to Anonymous GitHub again and check the GitHub connection and repository permissions in your dashboard. Then retry this page. Keep the existing anonymous URL; do not delete the repository to restore access.",retry:"Try again",dashboard:"Open owner dashboard"},ERRORS:{cache_busy:"Downloads are busy. Please try again shortly.",cache_miss:"This file is not cached yet. Please try again.",invalid_sort:"The selected sort order is invalid.",invalid_cursor:"This project page is no longer valid. Reload the list.",repository_changed:"The repository changed while processing. Please retry.",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:"We could not load this content. Try again. If it still fails, contact support with the anonymous URL and the time of the error.",unreachable:"The service could not complete this request. Wait a moment and try again.",request_error:"The connection was interrupted. Check your internet connection and try again.",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:"Anonymous GitHub cannot access the source repository on GitHub. It may be private, unavailable, or require the owner to reconnect GitHub.",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 temporarily blocked the request because we hit its API rate limit. Wait a few minutes and try again. If the problem persists and you contact GitHub Support, include the request ID and timestamp shown in GitHub's response (the 'X-GitHub-Request-Id' header).",rate_limited:"GitHub API rate limit reached. The repository will be available shortly \u2014 please wait a moment and refresh.",repoId_already_used:"The repository ID is already used.",invalid_repoId:"The format of the repository ID is invalid.",unsupported_source:"The repository source type is not supported.",branch_not_specified:"The branch is not specified.",branch_not_found:"The branch of the repository cannot be found.",commit_not_specified:"A commit must be specified.",commit_not_found:"The configured commit no longer exists in the source repository. It may have been force-pushed, rebased, or removed.",repo_renamed:"The source repository appears to have been renamed or moved on GitHub. Please refresh and try again \u2014 the cached name has been updated.",invalid_commit_format:"The commit hash format is invalid. It must be a hexadecimal string.",pull_request_not_found:"The requested pull request could not be found.",pull_request_expired:"This pull request has expired and is no longer available.",pull_request_no
Line truncated
|
||||
`)),e.options=Object.assign({},e.options,y.options),p.restore()})}c();let v=null;e.saveDefault=h=>{if(h&&h.preventDefault&&h.preventDefault(),e.saving)return;let y=p.checkpoint(),g={terms:e.terms.split(`
|
||||
`).map(E=>E.trim()).filter(E=>E.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",g).then(()=>{p.accept(y),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",v&&r.cancel(v),v=r(()=>{e.message=null},2500)},E=>{e.saving=!1;let k=E&&E.data&&E.data.error,C="Unable to save your defaults. Please try again.";Promise.all([s("ERRORS."+k),s("ERRORS.unknown_error")]).then(([N,b])=>{e.error=k&&N!==b?N:C},()=>{e.error=C})})},e.deleteAccount=()=>{e.deletingAccount||!e.confirmDeleteAccount||e.deleteUsername!==e.user?.username||(e.deletingAccount=!0,t.delete("/api/user").then(()=>{window.location.href="/"},()=>{e.deletingAccount=!1,e.deleteError="Unable to delete the account. Please try again."}))}},lp=function(e,t,s){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(r=>{s.url("/dashboard")},r=>{e.error=r.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},dp=function(e,t,s,r,i){e.user&&!e.user.status&&s.url("/dashboard"),e.watch("user.status",()=>{e.user&&!e.user.status&&s.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(p){e.feature=p},e.featureHref=function(p){return p.needsUser&&!e.user?"/signin":p.href},e.featureTarget=function(p){return p.needsUser&&!e.user?"_self":p.target||void 0},e.featureKeydown=function(p,c){let v={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[p.key];if(v===void 0)return;p.preventDefault();let h=e.features.length,y=v==="first"?0:v==="last"?h-1:(c+v+h)%h;e.feature=e.features[y].key,i(()=>{let g=r.document.getElementById("feature-tab-"+e.feature);g&&g.focus()})},e.demoText=`# DeepLearnUtils
|
||||
Developed by Jane Smith at MIT CSAIL.
|
||||
See Smith et al., "Attention That Works," 2026.
|
||||
Contact: jane.smith@mit.edu`,e.demoTerms="Jane Smith, Smith, MIT CSAIL, jane.smith@mit.edu",e.demoParts=function(){let f=(e.demoTerms||"").split(/[,\n]/).map(g=>g.trim()).filter(Boolean).sort((g,C)=>C.length-g.length),c=g=>g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!f.length)return[{text:e.demoText}];let v=new RegExp("("+f.map(c).join("|")+")","gi"),h={},y=0;return(e.demoText||"").split(v).filter(g=>g!=="").map(g=>{let C=f.find(w=>w.toLowerCase()===g.toLowerCase());return C?(h[C.toLowerCase()]||(h[C.toLowerCase()]=++y),{text:String(h[C.toLowerCase()]),redacted:!0,original:g}):{text:g}})},e.demoCount=()=>e.demoParts().filter(f=>f.redacted).length,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"}],e.statsEmpty=()=>!!e.stat&&e.cards.every(f=>!f.total);function r(){t.get("/api/stat/").then(f=>{e.stat=f.data,e.cards[0].total=f.data.nbRepositories,e.cards[1].total=f.data.nbUsers,e.cards[2].total=f.data.nbPageViews,e.cards[3].total=f.data.nbPullRequests}).catch(()=>{})}r();function u(f){let c={series:f,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!f||f.length<2)return c;let v=new Array(f.length-1);for(let S=1;S<f.length;S++)v[S-1]=f[S]-f[S-1];let h=v.length,y=Math.max.apply(null,v),g=Math.min.apply(null,v),C=Math.min(0,g),w=y-C||1;c.viewW=h*2,c.bars=new Array(h);for(let S=0;S<h;S++){let N=(v[S]-C)/w,b=Math.max(1.5,N*34);c.bars[S]={x:(S*2+.25).toFixed(2),y:(36-b).toFixed(2),w:"1.5",h:b.toFixed(2)}}if(c.deltaToday=v[h-1],h>=2){let S=v[h-2];S&&(c.pctChange=(c.deltaToday-S)/S*100)}return c.pctAbs=Math.round(Math.abs(c.pctChange)),c.isUp=c.pctChange>=0,c}e.history={repositories:u([]),users:u([]),pageViews:u([]),pullRequests:u([])},t.get("/api/stat/history?days=60").then(f=>{let c=f.data||[];e.history={repositories:u(c.map(v=>v.nbRepositories||0)),users:u(c.map(v=>v.nbUsers||0)),pageViews:u(c.map(v=>v.nbPageViews||0)),pullRequests:u(c.map(v=>v.nbPullRequests||0))}}).catch(()=>{})},tp=function(e,t,s,i,o,r){let u=yt();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),u.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,ze(()=>document.querySelector(".dashboard-quota > summary")?.focus())},zt()(document,"click",E=>{e.quotaExpanded&&!E.target.closest?.(".dashboard-quota")&&(e.quotaExpanded=!1)}),e.filtersExpanded=!1,e.projectView="all",e.selectedProject=null,e.projectName="",e.nameSaving=!1,e.nameError="",e.nameMessage="",e.needsAttention=E=>E.status==="error"||E._broken||c(E.status)==="progress"&&E._stale,e.attentionCount=()=>e.dashboardTotals?.attention??e.items.filter(e.needsAttention).length,e.hasProjects=()=>(e.dashboardTotals?.total??e.items.length)>0,e.setProjectView=E=>{e.projectView=E,E==="attention"&&(e.filters.status.error=!0,e.filters.status.progress=!0)},e.idleText=E=>{let q=Oa(E?.anonymizeDate||E?.lastView)||"";return/ ago$/.test(q)?"No activity for "+q.replace(/ ago$/,""):"No activity since "+q.replace(", "+new Date().getFullYear(),"")},e.projectDetailsId=E=>"project-details-"+encodeURIComponent(E._type+":"+(E._id||E._source||"unknown")),e.showProjectDetails=async E=>{e.selectedProject=E,e.projectName=E.projectName||"",e.nameError="",e.nameMessage="",await ze();let q=document.getElementById(e.projectDetailsId(E));q?.focus(),q?.scrollIntoView?.({block:"nearest"})},e.closeProjectDetails=E=>{e.selectedProject=null,ze(()=>document.querySelector(`[data-project-actions="${encodeURIComponent(E._type+":"+E._id)}"]`)?.focus())},e.saveProjectName=async E=>{if(e.nameSaving||!E._id)return;let q=e.projectName.trim();if(q.length>100){e.nameError="Use 100 characters or fewer.";return}e.nameSaving=!0,e.nameError="",e.nameMessage="";try{let W=await t.post("/api/user/project-name",{type:E._type,id:E._id,name:q});E.projectName=W.data.name,E._label=E.projectName||E._fallbackLabel,e.selectedProject===E&&(e.nameMessage=q?"Project name saved.":"Default project name restored."),T||(e.dashboardCursor=null,await _(),e.selectedProject===E&&(e.selectedProject=e.items.find(j=>j._type===E._type&&j._id===E._id)||null))}catch{e.selectedProject===E&&(e.nameError="The project name could not be saved. Try again.")}finally{e.nameSaving=!1}},e.copyingId=null,e.copyLink=async E=>{if(!E._viewUrl||e.copyingId)return;let q=new URL(E._viewUrl,o.location.origin).href;e.copyingId=E._type+":"+E._id;try{await al(q),e.addToast({title:"Link copied",body:"The anonymous link is ready to share."})}catch{e.addToast({title:"Copy this anonymous link",body:q})}finally{e.copyingId=null}},e.items=[],e.search="",e.loading=!0,e.statusKeyLabels={ready:"Ready",progress:"Preparing",error:"Error",expired:"Expiring / expired",removed:"Removing / removed"};let f=["queue","download","downloaded","preparing","anonymizing"];function
Line truncated
|
||||
`)),e.options=Object.assign({},e.options,U.options),e.options.expirationDate=U.options&&U.options.expirationDate?new Date(U.options.expirationDate):L(),!i.repoId&&!i.pullRequestId&&!i.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),k&&k()})}function se(k,O,U){e.anonymize&&e.anonymize[k]&&e.anonymize[k].setValidity(O,U)}function me(k){try{let O=parseGithubUrl(k);if(O&&O.owner&&O.repo)return O.owner+"/"+O.repo}catch{}return null}e.accessRepairAllowed=!1,e.repairingGitHubAccess=!1,e.accessRepairMessage="",e.repairGitHubAccess=async()=>{if(!e.accessRepairAllowed||e.repairingGitHubAccess||!e.githubConnections?.appEnabled||!i.repoId||e.role!=="owner"||e.githubConnection!=="github-app"||me(e.sourceUrl)!==e._originalFullName)return;e.repairingGitHubAccess=!0,e.accessRepairMessage="";let k=g();try{let O=await t.get("/github/connections");if(e.githubConnections=O.data,!O.data.appEnabled)return;let U=await t.post("/github/connections/migrate",{type:"repository",id:i.repoId,connection:"github-app"},{headers:{"X-CSRF-Token":O.data.csrf}});if(!y(k))return;e.error=null,U.data.fullName&&(e._originalFullName=U.data.fullName,e.source.fullName=U.data.fullName,e.sourceUrl="https://github.com/"+U.data.fullName),e.accessRepairMessage="GitHub access repaired. Your anonymous URL and published commit are unchanged.",await e.urlSelected(!0)}catch{y(k)&&(e.accessRepairMessage="Unable to repair GitHub access. Check the App's repository permissions in Manage access, then retry. Your published snapshot has not been replaced.")}finally{e.repairingGitHubAccess=!1,C(k)}},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.details=null,e.source.commit="",e.source.branch="",e.readme="",e.branches=[],jt.cancel(),Cn.cancel(),Sn.cancel(),e.previewStatus="idle",e.anonymize_readme="",pl();try{await A()}catch{}}};function be(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:me(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function Ie(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function D(){let k=new URLSearchParams(window.location.search).get("billingDraft");if(k){N.restore();try{let U=(await t.get("/api/billing/draft/"+encodeURIComponent(k))).data;if(U.path!==o.path())throw new Error("Wrong task");b=U.values.conference||null;for(let G of["sourceUrl","terms","repoId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(U.values,G)&&(e[G]=U.values[G]);return e.options?.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),T=U.id,M=JSON.stringify(N.checkpoint()),e.draftRestored=!0,e.hostingReview=!0,e.sourceUrl&&await Ie(),o.replace?.(o.path()),!0}catch{e.billingError="The checkout draft could not be restored. Retry by reloading this page; any local draft is still available."}}let O;try{O=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!O||O.path!==o.path()||Date.now()-O.savedAt>=30*6e4)return N.restore()?(e.sourceUrl&&await Ie(),!0):!1;N.restore();for(let U of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(O.draft,U)&&(e[U]=O.draft[U]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await Ie(),sessionStorage.removeItem("github-access-draft"),!0}pe(()=>{!i.repoId&&!i.pullRequestId&&!i.gistId&&u(D,0),i.repoId&&i.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=i.repoId,t.get("/api/repo/"+e.repoId).then(async k=>{e.accessRepairAllowed=!["removed","archived","preparing","queue","download","removing","expiring"].includes(k.data.status),e.githubConnection=k.data.connection||"oauth",e.sourceUrl="https://github.com/"+k.data.source.fullName,e._originalFullName=k.data.source.fullName,e.terms=k.data.options.terms.filter(O=>O).join(`
|
||||
`),e.source=k.data.source,e.role=k.data.role||"owner",e._existingNever=k.data.options.expirationMode==="never",e._savedExpirationDate=k.data.options.expirationDate?new Date(k.data.options.expirationDate):null,e.coauthors=k.data.coauthors||[],e._originalBranch=k.data.source.branch,e.options=Object.assign({},e.options,k.data.options),e.conference=k.data.conference,e._originalConference=k.data.conference,e.repositoryID=k.data.source.repositoryID,e._originalRepositoryID=k.data.source.repositoryID,k.data.options.expirationDate&&(e.options.expirationDate=new Date(k.data.options.expirationDate)),w=S(parseGithubUrl(e.sourceUrl)),!await D()&&(await Promise.all([A(),B()]),No())},()=>{o.url("/404")})),i.pullRequestId&&i.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=i.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async k=>{if(e.githubConnection=k.data.connection||"oauth",e.sourceUrl="https://github.com/"+k.data.source.repositoryFullName+"/pull/"+k.data.source.pullRequestId,e.terms=k.data.options.terms.filter(O=>O).join(`
|
||||
`),e.source=k.data.source,e.options=Object.assign({},e.options,k.data.options),e.conference=k.data.conference,e._originalConference=k.data.conference,k.data.options.expirationDate&&(e.options.expirationDate=new Date(k.data.options.expirationDate)),w=S(parseGithubUrl(e.sourceUrl)),!await D())try{await hl()}catch{}},()=>{o.url("/404")})),i.gistId&&i.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=i.gistId,t.get("/api/gist/"+e.gistId).then(async k=>{e.sourceUrl="https://gist.github.com/"+k.data.source.gistId,e.terms=k.data.options.terms.filter(O=>O).join(`
|
||||
`),e.source=k.data.source,e.options=Object.assign({},e.options,k.data.options),e.conference=k.data.conference,e._originalConference=k.data.conference,k.data.options.expirationDate&&(e.options.expirationDate=new Date(k.data.options.expirationDate)),w=S(parseGithubUrl(e.sourceUrl)),!await D()&&await gl()},()=>{o.url("/404")}))}),t.get("/github/connections").then(k=>{e.githubConnections=k.data,!i.repoId&&!i.pullRequestId&&!i.gistId&&e.githubConnection===void 0&&k.data.appEnabled&&k.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&Ie())}).catch(()=>{}).finally(()=>{!v&&!i.repoId&&!i.pullRequestId&&!i.gistId&&e.userReposStatus==="idle"&&e.loadUserRepos()}),e.urlSelected=async(k=!1)=>{let O=++c;e.previousConfigurations=[],e.previousConfigurationId="";let U;try{U=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,e.details=null,st(),jt.cancel(),Cn.cancel(),Sn.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",se("sourceUrl","github",!1);return}let G=S(U),le=k||w===G;w=G,e.sourceUrlError="",se("sourceUrl","github",!0),st();let he=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,setTimeout(()=>{let je=window.document.getElementById("sourceUrl");if(je){try{je.setSelectionRange(0,0)}catch{}je.scrollLeft=0}},50),he&&u(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!le&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],le||(e.source={type:"GitHubStream",branch:"",commit:""}),jt.cancel(),Cn.cancel(),Sn.cancel(),Ro.clear(),To.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",pl(),e.detectedType=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1,e._preservingDraft=le;try{U.gistId&&!U.repo?(e.detectedType="gist",e.source={gistId:U.gistId},await gl()):U.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:U.owner+"/"+U.repo,pullRequestId:U.pullRequestId},await hl()):(e.detectedType="repo",He(),await Promise.all([A(),B()]),No())}catch{}finally{O===c&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let k=e.branches.filter(U=>U.name==e.source.branch)[0];if(!k)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=k.commit),e.readme=k.readme,await B(),No()}),e.getBranches=async k=>{let O=parseGithubUrl(e.sourceUrl),U=g();try{if(!e.details){await A(k);return}let G=await t.get(`/api/repo/${O.owner}/${O.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&me(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:k===!0||e.reconnectingSource?"1":"0",repositoryID:be()}});if(!y(U))return;e.branches=G.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let le=e.branches.filter(he=>he.name==e.source.branch);le.length>0&&(!(!e.reconnectingSource&&!k&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=le[0].commit),e.readme=le[0].readme,await B(k))}catch(G){if(!y(U))return;e.branches=[],e.sourceUnreachable=G&&(G.status===404||G.data&&G.data.error==="repo_not_found"),e.details=null,Be(G)}finally{C(U)}};async function A(k=!1){let O=parseGithubUrl(e.sourceUrl),U=g();try{Po(),st();let G=await t.get(`/api/repo/${O.owner}/${O.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&me(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,repositoryID:be(),force:"1"}});if(!y(U))return;e.details=G.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(k||e.reconnectingSource)}catch(G){if(!y(U))return;throw Be(G),G}finally{C(U)}}async function B(k){if(e.readme&&!k)return e.readme;let O=parseGithubUrl(e.sourceUrl),U=g();try{let G=await t.get(`/api/repo/${O.owner}/${O.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&me(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:k===!0?"1":"0",branch:e.source.branch,repositoryID:be()}});y(U,!0)&&(e.readme=G.data)}catch{y(U,!0)&&(e.readme="")}finally{C(U)}}let Z={magicalBraces:!0},K=k=>k.startsWith("/")&&!k.endsWith("/")&&Wn(ko(k.slice(1),Z),Z)===k.slice(1),ne=()=>Object.keys(e.preserve.picked).filter(k=>e.preserve.picked[k]).sort().map(k=>"/"+Wn(k,Z)),ue=k=>"/"+Wn(k,Z)+"/**",re=k=>"!/"+Wn(k,Z)+"/",ie=()=>String(e.preserve.patterns||"").split(`
|
||||
`).map(k=>k.trim()).filter(Boolean),Q=null,we=null,ce=new Set,Se=0,Re=null,Me=()=>!1;function Ye(){let k=Se+"\0"+e.preserve.patterns;if(k!==Re){Re=k;try{Me=il(sl([...ne(),...ie()]))}catch{Me=()=>!1}}return Me}function Ge(k){let O=new Map([["",{dirs:[],files:[]}]]);for(let U of k){let G=U.split("/"),le="";for(let he=0;he<G.length-1;he++){let je=G.slice(0,he+1).join("/");O.has(je)||(O.set(je,{dirs:[],files:[]}),O.get(le).dirs.push(je)),le=je}O.get(le).files.push(U)}for(let U of O.values())U.dirs.sort();return{files:k,dirs:O,descendants:new Map}}function ke(k){return Q.descendants.has(k)||Q.descendants.set(k,Q.files.filter(O=>O.startsWith(k+"/"))),Q.descendants.get(k)}let Ve=k=>Ye()(k);function it(k){let O=ke(k),U=0;for(let G of O)Ve(G)&&U++;return U===0?"none":U===O.length?"all":"some"}e.preserve={open:!1,loading:!1,error:"",truncated:!1,commit:"",search:"",expanded:{},picked:{},patterns:"",patternsOpen:!1},e.preserveSummary=()=>{let k=(e.options?.preserveFiles||[]).map(O=>String(O).trim()).filter(Boolean).map(O=>K(O)?ko(O.slice(1),Z):O);return k.length?k.slice(0,2).join(", ")+(k.length>2?` and ${k.length-2} more`:""):"None. Every file is redacted."};async function ct(){let k=e.source?.commit;if(!(Q&&e.preserve.commit===k)){e.preserve.loading=!0,e.preserve.error="",Q=null,we=null;try{let O=parseGithubUrl(e.sourceUrl),U=await t.get(`/api/repo/${O.owner}/${O.repo}/tree`,{params:{commit:k,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&i.repoId&&me(e.sourceUrl)===e._originalFullName?i.repoId:void 0,repositoryID:be()}});if(e.source?.commit!==k)return;let G=Array.isArray(U.data.binaryFiles)?U.data.binaryFiles:[];Q=mn(Ge(U.data.files||[])),we=G.length?mn(Ge([...U.data.files||[],...G])):Q,ce=mn(new Set(G)),e.preserve.commit=k,e.preserve.truncated=!!U.data.truncated,e.previewFile||jt()}catch{e.preserve.error="The file list could not be loaded from GitHub. You can still use patterns.",e.preserve.patternsOpen=!0}finally{e.preserve.loading=!1}}}e.watch("source.commit",k=>{e.previewFile&&e.openPreviewFile(""),e.detectedType==="repo"&&k&&e.sourceUrl&&ct().catch(()=>{})}),e.openPreserveFiles=()=>{let k={},O=[];for(let G of e.options?.preserveFiles||[]){let le=String(G).trim();le&&(!O.length&&K(le)?k[ko(le.slice(1),Z)]=!0:O.push(le))}let U={};for(let G of Object.keys(k)){let le=G.split("/");for(let he=1;he<le.length;he++)U[le.slice(0,he).join("/")]=!0}Object.assign(e.preserve,{open:!0,search:"",picked:k,expanded:U,patterns:O.join(`
|
||||
`),patternsOpen:O.length>0}),e.mobileWorkspace&&(e.mobilePane="settings"),Se++,u(()=>{let G=document.getElementById("preserve-files-dialog");G?.showModal&&!G.open&&G.showModal(),document.getElementById("preserve-files-search")?.focus()},0),ct()},e.closePreserveFiles=()=>{document.getElementById("preserve-files-dialog")?.close?.(),e.preserve.open=!1},e.savePreserveFiles=()=>{e.options.preserveFiles=sl([...ne(),...ie()]),e.closePreserveFiles()},e.preserveRows=()=>{if(!Q)return[];let k=Ye(),O=(he,je,Ot)=>{let mt=!!e.preserve.picked[he],Rt=k(he);return{kind:"file",path:he,label:Ot,depth:je,state:Rt?"all":"none",locked:!mt&&Rt,note:!mt&&Rt?"matched by a pattern":mt&&!Rt?"excluded by a pattern":""}},U=String(e.preserve.search||"").trim().toLowerCase();if(U)return Q.files.filter(he=>he.toLowerCase().includes(U)).slice(0,300).map(he=>O(he,0,he));let G=[],le=(he,je)=>{let Ot=Q.dirs.get(he);for(let mt of Ot.dirs){let Rt=!!e.preserve.expanded[mt],Gt=ie().includes(ue(mt));G.push({kind:"dir",path:mt,label:mt.slice(he?he.length+1:0)+"/",depth:je,open:Rt,state:it(mt),locked:!1,note:Gt?"whole folder":""}),Rt&&le(mt,je+1)}for(let mt of Ot.files)G.push(O(mt,je,mt.slice(he?he.length+1:0)))};return le("",0),G},e.preserveCount=()=>Q?Q.files.filter(Ve).length:0,e.togglePreserveDir=k=>{e.preserve.expanded[k]=!e.preserve.expanded[k]},e.togglePreserveFile=k=>{e.preserve.picked[k]=!e.preserve.picked[k],Se++},e.togglePreserveFolder=k=>{let O=ue(k),U=re(k),G=ie().filter(he=>he!==O&&he!==U),le=it(k)==="all"||ie().includes(O);for(let he of ke(k))e.preserve.picked[he]=!1;Se++,e.preserve.patterns=(le?G:[...G,O]).join(`
|
||||
`),le&&ke(k).some(Ve)&&(e.preserve.patterns=[...G,U].join(`
|
||||
`))};let It=/^readme(\.[^/]*)?$/i,Tt=[".md",".markdown",".mdown",".mkdn",".rst",".txt",""],lt=["README.md","README","README.markdown","README.rst","README.txt","readme.md"],ft=k=>{let O=_e(k),U=O.indexOf("."),G=Tt.indexOf(U===-1?"":O.slice(U).toLowerCase());return G===-1?Tt.length:G},Qt=()=>!!Q&&!!e.preserve.commit&&e.preserve.commit===e.source?.commit;e.readmePath=()=>{if(!Qt())return"";for(let k of[".github","","docs"]){let O=(Q.dirs.get(k)?.files||[]).filter(U=>It.test(_e(U)));if(O.length)return O.sort((U,G)=>ft(U)-ft(G)||Ne(U,G))[0]}return""},e.readmeName=()=>_e(e.readmePath())||"README.md";let So={key:null,fn:()=>!1},cl=()=>{let k=(e.options?.preserveFiles||[]).map(U=>String(U).trim()).filter(Boolean),O=k.join(`
|
||||
`);if(O!==So.key){let U=()=>!1;try{k.length&&(U=il(k))}catch{}So={key:O,fn:U}}return So.fn};e.pathPreserved=k=>!!k&&cl()(k),e.readmePreserved=()=>{if(e.detectedType!=="repo")return!1;let k=cl();if(Qt()){let O=e.readmePath();return!!O&&k(O)}return lt.some(O=>k(O))},e.previewPreserved=()=>e.detectedType==="repo"&&(e.previewFile?e.pathPreserved(e.previewFile):e.readmePreserved());function si(){let k={terms:e.terms?e.terms.split(`
|
||||
`):[],filePath:e.previewOpenPath()||"README.md",preserveFiles:e.options.preserveFiles||[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(k.branchName=e.source.branch);try{let O=parseGithubUrl(e.sourceUrl);k.repoName=`${O.owner}/${O.repo}`}catch{}return k}function Er(k,O,U){let G=null,le=0,he=()=>{if(e.detectedType!==k)return;G&&u.cancel(G);let je=++le;e.previewStatus="loading",G=u(()=>{G=null;let Ot=O();if(!Ot){e.previewStatus="idle";return}t.post("/api/anonymize-preview",Ot).then(mt=>{je===le&&(U(mt.data,Ot),e.previewStatus="ready")}).catch(()=>{je===le&&(e.previewStatus="error")})},200)};return he.cancel=()=>{le++,G&&u.cancel(G),G=null},e.on("dispose",he.cancel),he}e.retryPreview=()=>{e.detectedType==="repo"&&(e.previewFile&&typeof ln!="string"?fl(e.previewFile):jt()),e.detectedType==="pr"&&Cn(),e.detectedType==="gist"&&Sn()};let et=mn(Us(e));Object.defineProperty(e,"previewViewer",{get:()=>et}),Aa(et,e),Object.assign(et,{options:{},files:[],paths:[],content:null,type:"loading",sidebarHidden:!1,sidebarCollapsed:!0,moreOpen:!1,tocOpen:!1,gotoOpen:!1,mdFindOpen:!1,mdFindQuery:"",mdFindTotal:0,mdFindIndex:0}),et.preview=!0,et.fileSize=k=>k===et.filePath&&typeof ln=="string"?new Blob([ln]).size:!e.previewFile&&e.readme?new Blob([e.readme]).size:null,et.openPreserveFiles=()=>e.openPreserveFiles(),et.previewPreserved=()=>e.previewPreserved(),et.retryContent=()=>e.retryPreview();let gf=k=>ce.has(k)||/\.(pdf|png|jpe?g|gif|svg|ico|bmp|tiff?|webp|avif|heic|heif|mp4|webm|mp3|wav|zip|bin)$/i.test(k),Nr=(k="")=>({path:k,loading:!1,note:"",loadError:""});e.previewFile="",e.previewDoc=Nr();let os=0,ln=null;e.previewOpenPath=()=>e.previewFile||e.readmePath(),e.openPreviewFile=k=>{if(k=k||"",k&&k===e.readmePath()&&(k=""),os++,ln=null,ri(),jt.cancel(),e.previewFile=k,e.previewDoc=Nr(k),et.sidebarCollapsed=!0,et.content=null,!k){e.readme?jt():e.previewStatus="idle";return}if(gf(k)){Rr("binary"),e.previewStatus="ready";return}fl(k)};function pl(){os++,ln=null,e.previewFile="",e.previewDoc=Nr(),et.sidebarCollapsed=!0,et.content=null}function fl(k){let O=++os;ln=null,Object.assign(e.previewDoc,{loading:!0,loadError:""}),e.previewStatus="loading";let U;try{U=parseGithubUrl(e.sourceUrl)}catch{U=null}if(!U||!e.source?.commit){Object.assign(e.previewDoc,{loading:!1,loadError:"The repository is still loading. Try again in a moment."}),e.previewStatus="error";return}t.get(`/api/repo/${U.owner}/${U.repo}/file`,{params:{commit:e.source.commit,path:k,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&i.repoId&&me(e.sourceUrl)===e._originalFullName?i.repoId:void 0,repositoryID:be()},transformResponse:G=>G}).then(G=>{if(O!==os)return;e.previewDoc.loading=!1;let le=typeof G.headers=="function"&&G.headers("content-type")||"";if(/json/i.test(le)){let he=null;try{he=JSON.parse(G.data)}catch{}if(he&&he.binary===!0){Rr("binary"),e.previewStatus="ready";return}}ln=typeof G.data=="string"?G.data:"",jt()},G=>{if(O!==os)return;e.previewDoc.loading=!1;let le=wr(G);if(le==="file_too_big"){Rr("too_big"),e.previewStatus="ready";return}e.previewDoc.loadError=Qn.ERRORS[le]||"GitHub did not return this file.",e.previewStatus="error"})}let ii;function ri(){ii&&window.URL.revokeObjectURL(ii),ii=void 0,et.url=void 0}e.on("dispose",ri);function Rr(k){ri(),e.previewDoc.note=k,et.prepareFile(e.previewPathName(e.previewOpenPath()||e.readmeName())),et.type=k==="too_big"?"error":"binary",et.content=k==="too_big"?"file_too_big":"binary"}function vf(k){try{let O=parseGithubUrl(e.sourceUrl),U=e.source.branch||e.details&&e.details.defaultBranch||"main",G=k&&k.includes("/")?k.slice(0,k.lastIndexOf("/")+1):"";return`https://github.com/${O.owner}/${O.repo}/raw/${U}/${G}`}catch{return""}}let ml=Er("repo",()=>e.previewFile?typeof ln!="string"?null:{content:ln,options:si()}:e.readme?{content:e.readme,options:si()}:null,k=>{if(typeof k?.content!="string")throw Error("Invalid preview response");ri(),window.URL?.createObjectURL&&(et.url=ii=window.URL.createObjectURL(new Blob([k.content],{type:"text/plain"})));let O=e.previewOpenPath()||e.readmeName();et.prepareFile(e.previewPathName(O)),et.fileBaseUrl=vf(O),et.renderFileContent(k.content,et.type,et.fileBaseUrl,"text/plain"),e.previewFile||(e.anonymize_readme=k.content)}),jt=()=>{e.previewFile&&typeof ln!="string"||ml()};jt.cancel=ml.cancel;let Eo=rt(new Map),Tr=new Set,Pr=new Set,ss="",is=null,ai=()=>String(e.terms||"").split(`
|
||||
`).filter(k=>k.trim());function yf(){is=null;let k=ai(),O=k.join(`
|
||||
`);O!==ss&&(Eo.clear(),Pr.clear(),ss=O);let U=[...Tr].filter(G=>!Eo.has(G));if(Tr.clear(),!(!U.length||!k.length))for(let G=0;G<U.length;G+=400){let le=U.slice(G,G+400);t.post("/api/anonymize-preview",{contents:le,options:{terms:k,image:!0,link:!0}}).then(he=>{if(ss!==O||ai().join(`
|
||||
`)!==O)return;let je=he.data?.contents;if(!Array.isArray(je)||je.length!==le.length)throw Error("Invalid preview response");le.forEach((Ot,mt)=>Eo.set(Ot,typeof je[mt]=="string"?je[mt]:Ot))}).catch(()=>{ss===O&&le.forEach(he=>Pr.add(he))})}}e.previewName=k=>{if(!k||!ai().length)return k;if(ss===ai().join(`
|
||||
`)){if(Eo.has(k))return Eo.get(k);if(Pr.has(k))return k}return Tr.add(k),is||(is=u(yf,120)),k},e.previewPathName=k=>{k=String(k||"");let O=k.lastIndexOf("/");return O<0?e.previewName(k):e.previewName(k.slice(0,O))+"/"+e.previewName(k.slice(O+1))},e.watch(()=>[e.repoId,e.previewPathName(e.previewOpenPath()||e.readmeName()),e.previewTreeFiles()],()=>{et.repoId=e.repoId||"repository",et.filePath=e.previewPathName(e.previewOpenPath()||e.readmeName()),et.paths=et.filePath.split("/"),et.files=e.previewTreeFiles(),et.loadedFolders=Object.fromEntries([...we?.dirs.keys()||[]].map(k=>[e.previewName(k),!0]))},!0),e.on("dispose",()=>{is&&u.cancel(is)});function No(){!e.anonymize||!e.anonymize.terms||jt()}async function hl(){let k=parseGithubUrl(e.sourceUrl),O=g();try{Po(),st();let U=await t.get(`/api/pr/${k.owner}/${k.repo}/${k.pullRequestId}`,{params:{connection:e.githubConnection}});if(!y(O))return;e.details=U.data,e.pullRequestId||(e.pullRequestId=k.repo+"-PR"+k.pullRequestId+"-"+generateRandomId(4))}catch(U){if(!y(O))return;throw Be(U),U}finally{C(O)}}let Ro=rt(new Map);function bf(){let k=new Set,O=e.details&&e.details.pullRequest;if(!O)return k;typeof O.title=="string"&&k.add(O.title),typeof O.body=="string"&&k.add(O.body),typeof O.diff=="string"&&k.add(O.diff);let U=O.comments||[];for(let G of U)typeof G.author=="string"&&k.add(G.author),typeof G.body=="string"&&k.add(G.body);return k}let Cn=Er("pr",()=>{let k=bf(),O=Array.from(k);return O.length===0?null:{contents:O,options:si()}},(k,O)=>{if(!Array.isArray(k?.contents)||k.contents.length!==O.contents.length||k.contents.some(le=>typeof le!="string"))throw Error("Invalid preview response");let U=O.contents,G=new Map;for(let le=0;le<U.length&&le<k.contents.length;le++)G.set(U[le],k.contents[le]);Ro.clear(),G.forEach((le,he)=>Ro.set(he,le))});e.anonymizePrContent=function(k){return k&&(Ro.has(k)?Ro.get(k):"")};async function gl(){let k=parseGithubUrl(e.sourceUrl),O=g();try{Po(),st(),e.gistOAuthRequired=!1,e.gistAppRequired=!1;let U=await t.get(`/api/gist/source/${k.gistId}`);if(!y(O))return;e.details=U.data,e.gistId||(e.gistId="gist-"+k.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(U){if(!y(O))return;if(U.data?.error==="github_app_reconnect_required"){e.gistAppRequired=!0,se("sourceUrl","missing",!1);return}if(U.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,se("sourceUrl","missing",!1);return}throw Be(U),U}finally{C(O)}}let To=rt(new Map);function wf(){let k=new Set,O=e.details&&e.details.gist;if(!O)return k;typeof O.description=="string"&&k.add(O.description),typeof O.ownerLogin=="string"&&k.add(O.ownerLogin);let U=O.files||[];for(let le of U)typeof le.filename=="string"&&k.add(le.filename),typeof le.content=="string"&&k.add(le.content);let G=O.comments||[];for(let le of G)typeof le.author=="string"&&k.add(le.author),typeof le.body=="string"&&k.add(le.body);return k}let Sn=Er("gist",()=>{let k=wf(),O=Array.from(k);return O.length===0?null:{contents:O,options:si()}},(k,O)=>{if(!Array.isArray(k?.contents)||k.contents.length!==O.contents.length||k.contents.some(le=>typeof le!="string"))throw Error("Invalid preview response");let U=O.contents,G=new Map;for(let le=0;le<U.length&&le<k.contents.length;le++)G.set(U[le],k.contents[le]);To.clear(),G.forEach((le,he)=>To.set(he,le)),Dr()});e.anonymizeGistContent=function(k){return k&&(To.has(k)?To.get(k):"")},e.previewGistFiles=[];function Dr(){let k=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=k.map(O=>({filename:e.anonymizeGistContent(O.filename),content:e.anonymizeGistContent(O.content),language:O.language}))}e.watch("details.gist.files",Dr,!0),e.watch("terms",Dr);function kf(){let k=e.conference;if(e.conference_data=null,!k)return;let O=k===b||e.isUpdate&&k===e._originalConference;k!==b&&(b=null),t.get("/api/conferences/"+k).then(U=>{e.conference===k&&(e.conference_data=U.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!O&&(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===k&&(e.conference_data=null)})}function Po(){se("repoId","used",!0),se("repoId","format",!0),se("pullRequestId","used",!0),se("pullRequestId","format",!0),se("gistId","used",!0),se("gistId","format",!0),se("sourceUrl","used",!0),se("sourceUrl","missing",!0),se("sourceUrl","access",!0),se("sourceUrl","github",!0),se("commit","exists",!0),se("conference","activated",!0),se("terms","format",!0),e.termHints=[]}function li(){if(e.detectedType==="repo"&&e.options.expirationMode==="never")return!1;let k=e.anonymize&&e.anonymize.expirationDate;return!e.options.expirationDate||k&&k.invalid?(k&&k.setDirty&&k.setDirty(),e.error=
Line truncated
|
||||
`).filter(he=>he),connection:e.githubConnection,fullName:`${U.owner}/${U.repo}`,repository:e.sourceUrl,reconnectRepositoryId:e.reconnectRepositoryId,options:e.options,source:e.source,conference:e.conference};e.details&&(G.options.pageSource=e.details.pageSource),Po();let le=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(le,G,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/status/"+e.repoId},he=>{if(he.data){let je=["quota_exceeded","quota_repository_limit","quota_storage_limit","subscription_required_for_never_expiration"].includes(he.data.error);je||r("ERRORS."+he.data.error).then(Ot=>{e.error=Ot},console.error),di(he.data.error),je&&(he.data.error==="subscription_required_for_never_expiration"&&(e._existingNever=!1),e.hostingQuotaBlocked=!0,e.hostingReview=!0,ze(()=>document.getElementById("repository-hosting")?.scrollIntoView({block:"center"})))}}).finally(()=>{O.disabled=!1})},e.anonymizeGist=k=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(li())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let O=k.currentTarget||k.target.closest?.("button")||k.target;O.disabled=!0;let U=parseGithubUrl(e.sourceUrl),G={gistId:e.gistId,terms:e.terms.trim().split(`
|
||||
`).filter(he=>he),source:{gistId:U.gistId},options:e.options,conference:e.conference};Po();let le=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(le,G,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/gist/"+e.gistId},he=>{he.data&&(r("ERRORS."+he.data.error).then(je=>{e.error=je},console.error),di(he.data.error))}).finally(()=>{O.disabled=!1})},e.anonymizePullRequest=k=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(li())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let O=k.currentTarget||k.target.closest?.("button")||k.target;O.disabled=!0;let U=parseGithubUrl(e.sourceUrl),G={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
|
||||
`).filter(he=>he),source:{repositoryFullName:`${U.owner}/${U.repo}`,pullRequestId:U.pullRequestId},options:e.options,conference:e.conference};Po();let le=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(le,G,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/pr/"+e.pullRequestId},he=>{he.data&&(r("ERRORS."+he.data.error).then(je=>{e.error=je},console.error),di(he.data.error))}).finally(()=>{O.disabled=!1})},e.watch("conference",()=>{kf()}),e.termHints=[],e.matchTermAsWritten=k=>{e.terms=Wc(e.terms,k)},e.watch("options.preserveFiles",()=>{e.detectedType==="repo"&&jt()}),e.watch("terms",()=>{e.termHints=Gc(e.terms),e.detectedType==="repo"&&No(),e.detectedType==="pr"&&Cn(),e.detectedType==="gist"&&Sn()}),e.watch("options.image",()=>{e.detectedType==="repo"&&No(),e.detectedType==="pr"&&Cn(),e.detectedType==="gist"&&Sn()}),e.watch("options.link",()=>{e.detectedType==="repo"&&No(),e.detectedType==="pr"&&Cn(),e.detectedType==="gist"&&Sn()}),e.watch("details",()=>{e.detectedType==="pr"&&Cn(),e.detectedType==="gist"&&Sn()},!0)},ll=function(e,t,s,i,o,r){Aa(e);let u=yt();Yc();let f=zt(),c=0,v=null,h=null;e.fileLoadingSlow=!1,e.fileReceivedBytes=0;function y(){v&&(v.resolve(),v=null),h&&(u.timeout.cancel(h),h=null)}let g=!1;e.on("dispose",()=>{g=!0,c++,y(),C&&C.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,f(document,"click",I=>{e.symbolsOpen&&!I.target.closest?.(".symbols")&&(e.symbolsOpen=!1),e.moreOpen&&!I.target.closest?.(".tb-more")&&(e.moreOpen=!1),e.tocOpen&&!I.target.closest?.(".tb-toc-m")&&(e.tocOpen=!1),e.gotoOpen&&I.target.isConnected&&!I.target.closest?.(".goto-pop, .btn-goto, .tb-more")&&(e.gotoOpen=!1),e.accountOpen&&!I.target.closest?.(".acct")&&(e.accountOpen=!1),e.helpOpen&&!I.target.closest?.(".vb-help")&&(e.helpOpen=!1)}),f(document,"keydown",I=>{I.key==="Escape"&&(e.symbolsOpen=!1,e.moreOpen=!1,e.tocOpen=!1,e.gotoOpen=!1,e.accountOpen=!1,e.helpOpen=!1),(I.ctrlKey||I.metaKey)&&!I.altKey&&I.key&&I.key.toLowerCase()==="f"&&e.type==="html"&&window.document.querySelector(".reading-layout")&&(I.preventDefault(),e.toggleMdFind(!0))}),f(document,"keydown",function(I){if((I.metaKey||I.ctrlKey)&&I.key==="k"){I.preventDefault();var F=document.querySelector(".tree-search-input");F&&(F.focus(),F.select())}});var C=null;e.onFileSearchChange=function(){C&&(C.resolve(),C=null);let I=e.fileSearchQuery;if(!I||I.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let F=r.defer();C=F,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(I)}`,{timeout:F.promise}).then(function(E){if(!(g||C!==F)){C=null,e.fileSearchLoading=!1;var q={};e.files.forEach(function(_e){q[(_e.path||"")+"/"+_e.name]=!0});for(var W=[],j={},Y=0;Y<E.data.length;Y++){var te=E.data[Y];if(te.path)for(var ee=te.path.split("/"),fe="",ge=0;ge<ee.length;ge++){var Fe=fe;fe=fe?fe+"/"+ee[ge]:ee[ge];var He=Fe+"/"+ee[ge];!q[He]&&!j[He]&&(j[He]=!0,W.push({name:ee[ge],path:Fe}))}}W.sort(function(_e,X){return(_e.path||"").split("/").length-(X.path||"").split("/").length}),W.length>0&&e.files.push.apply(e.files,W);for(var Ke=[],Be=0;Be<E.data.length;Be++){var st=E.data[Be],Ne=(st.path||"")+"/"+st.name;!q[Ne]&&st.size!=null&&(Ke.push(st),q[Ne]=!0)}Ke.length>0&&e.files.push.apply(e.files,Ke),e.fileSearchResults=E.data}},function(){!g&&C===F&&(C=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})},e.on("routeUpdate",function(I,F){if(e.repoId!=i.repoId)return z();if((i.path||"")!=e.filePath){window.matchMedia?.("(max-width: 767px)").matches&&(e.sidebarCollapsed=!0),e.filePath=i.path||"",e.paths=e.filePath.split("/").filter(E=>E&&E.trim().length>0),L();for(let E=0;E<e.paths.length-1;E++){let q=E>0?e.paths.slice(0,E).join("/"):"";e.files.some(j=>j.path===q)||e.getFiles(q)}}});function w(){if(e.paths[0]!="")return;let I=["readme.md","readme.txt","readme.org","readme.1st","readme"],F={};for(let q of e.files)q.name.toLowerCase().indexOf("readme")>-1&&(F[q.name.toLowerCase()]=q.name);let E=null;for(let q of I)if(F[q]){E=q;break}if(!E&&Object.keys(F).length>0&&(E=Object.keys(F)[0]),E){let q=s.url();q[q.length-1]!="/"&&(q+="/"),s.url(q+encodePathForUrl(F[E]))}}e.fileCounts=null;let S=0,N=new Set,b=!1;e.getFiles=function(I,F=!1){let E=e.repoId,q=S;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(I)}&v=${e.options.lastUpdateDate}`).then(function(W){if(g||E!==e.repoId||q!==S)return[];let j=I||"";return e.files=e.files.filter(Y=>Y.path!==j),e.files.push(...W.data),e.loadedFolders={...e.loadedFolders,[j]:!0},T(j,q),W.data},function(W){if(g||E!==e.repoId||q!==S)return[];F||(e.type="error",e.content=wr(W),e.files=[])})};function T(I,F){if(b||N.has(I))return;N.add(I);let E=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts?path=${encodeURIComponent(I)}`).then(function(q){g||E!==e.repoId||F!==S||(e.fileCounts={...e.fileCounts,...q.data})},function(){
Line truncated
|
||||
Contact: jane.smith@mit.edu`,e.demoTerms="Jane Smith, Smith, MIT CSAIL, jane.smith@mit.edu",e.demoParts=function(){let p=(e.demoTerms||"").split(/[,\n]/).map(g=>g.trim()).filter(Boolean).sort((g,E)=>E.length-g.length),c=g=>g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!p.length)return[{text:e.demoText}];let v=new RegExp("("+p.map(c).join("|")+")","gi"),h={},y=0;return(e.demoText||"").split(v).filter(g=>g!=="").map(g=>{let E=p.find(k=>k.toLowerCase()===g.toLowerCase());return E?(h[E.toLowerCase()]||(h[E.toLowerCase()]=++y),{text:String(h[E.toLowerCase()]),redacted:!0,original:g}):{text:g}})},e.demoCount=()=>e.demoParts().filter(p=>p.redacted).length,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"}],e.statsEmpty=()=>!!e.stat&&e.cards.every(p=>!p.total);function o(){t.get("/api/stat/").then(p=>{e.stat=p.data,e.cards[0].total=p.data.nbRepositories,e.cards[1].total=p.data.nbUsers,e.cards[2].total=p.data.nbPageViews,e.cards[3].total=p.data.nbPullRequests}).catch(()=>{})}o();function u(p){let c={series:p,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!p||p.length<2)return c;let v=new Array(p.length-1);for(let C=1;C<p.length;C++)v[C-1]=p[C]-p[C-1];let h=v.length,y=Math.max.apply(null,v),g=Math.min.apply(null,v),E=Math.min(0,g),k=y-E||1;c.viewW=h*2,c.bars=new Array(h);for(let C=0;C<h;C++){let N=(v[C]-E)/k,b=Math.max(1.5,N*34);c.bars[C]={x:(C*2+.25).toFixed(2),y:(36-b).toFixed(2),w:"1.5",h:b.toFixed(2)}}if(c.deltaToday=v[h-1],h>=2){let C=v[h-2];C&&(c.pctChange=(c.deltaToday-C)/C*100)}return c.pctAbs=Math.round(Math.abs(c.pctChange)),c.isUp=c.pctChange>=0,c}e.history={repositories:u([]),users:u([]),pageViews:u([]),pullRequests:u([])},t.get("/api/stat/history?days=60").then(p=>{let c=p.data||[];e.history={repositories:u(c.map(v=>v.nbRepositories||0)),users:u(c.map(v=>v.nbUsers||0)),pageViews:u(c.map(v=>v.nbPageViews||0)),pullRequests:u(c.map(v=>v.nbPullRequests||0))}}).catch(()=>{})},up=function(e,t,s,r,i,o){let u=wt();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),u.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,Xe(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Ht()(document,"click",S=>{e.quotaExpanded&&!S.target.closest?.(".dashboard-quota")&&(e.quotaExpanded=!1)}),e.filtersExpanded=!1,e.projectView="all",e.selectedProject=null,e.projectName="",e.nameSaving=!1,e.nameError="",e.nameMessage="",e.needsAttention=S=>S.status==="error"||S._broken||c(S.status)==="progress"&&S._stale,e.attentionCount=()=>e.dashboardTotals?.attention??e.items.filter(e.needsAttention).length,e.hasProjects=()=>(e.dashboardTotals?.total??e.items.length)>0,e.setProjectView=S=>{e.projectView=S,S==="attention"&&(e.filters.status.error=!0,e.filters.status.progress=!0)},e.idleText=S=>{let L=La(S?.anonymizeDate||S?.lastView)||"";return/ ago$/.test(L)?"No activity for "+L.replace(/ ago$/,""):"No activity since "+L.replace(", "+new Date().getFullYear(),"")},e.projectDetailsId=S=>"project-details-"+encodeURIComponent(S._type+":"+(S._id||S._source||"unknown")),e.showProjectDetails=async S=>{e.selectedProject=S,e.projectName=S.projectName||"",e.nameError="",e.nameMessage="",await Xe();let L=document.getElementById(e.projectDetailsId(S));L?.focus(),L?.scrollIntoView?.({block:"nearest"})},e.closeProjectDetails=S=>{e.selectedProject=null,Xe(()=>document.querySelector(`[data-project-actions="${encodeURIComponent(S._type+":"+S._id)}"]`)?.focus())},e.saveProjectName=async S=>{if(e.nameSaving||!S._id)return;let L=e.projectName.trim();if(L.length>100){e.nameError="Use 100 characters or fewer.";return}e.nameSaving=!0,e.nameError="",e.nameMessage="";try{let H=await t.post("/api/user/project-name",{type:S._type,id:S._id,name:L});S.projectName=H.data.name,S._label=S.projectName||S._fallbackLabel,e.selectedProject===S&&(e.nameMessage=L?"Project name saved.":"Default project name restored."),D||(e.dashboardCursor=null,await F(),e.selectedProject===S&&(e.selectedProject=e.items.find(W=>W._type===S._type&&W._id===S._id)||null))}catch{e.selectedProject===S&&(e.nameError="The project name could not be saved. Try again.")}finally{e.nameSaving=!1}},e.copyingId=null,e.copyLink=async S=>{if(!S._viewUrl||e.copyingId)return;let L=new URL(S._viewUrl,i.location.origin).href;e.copyingId=S._type+":"+S._id;try{await cl(L),e.addToast({title:"Link copied",body:"The anonymous link is ready to share."})}catch{e.addToast({title:"Copy this anonymous link",body:L})}finally{e.copyingId=null}},e.items=[],e.search="",e.loading=!0,e.statusKeyLabels={ready:"Ready",progress:"Preparing",error:"Error",expired:"Expiring / expired",removed:"Removing / removed"};let p=["queue","download","downloaded","preparing","anonymizing"];function
Line truncated
|
||||
`)),e.options=Object.assign({},e.options,U.options),e.options.expirationDate=U.options&&U.options.expirationDate?new Date(U.options.expirationDate):Z(),!r.repoId&&!r.pullRequestId&&!r.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),w&&w()})}function te(w,M,U){e.anonymize&&e.anonymize[w]&&e.anonymize[w].setValidity(M,U)}function fe(w){try{let M=parseGithubUrl(w);if(M&&M.owner&&M.repo)return M.owner+"/"+M.repo}catch{}return null}e.accessRepairAllowed=!1,e.repairingGitHubAccess=!1,e.accessRepairMessage="",e.repairGitHubAccess=async()=>{if(!e.accessRepairAllowed||e.repairingGitHubAccess||!e.githubConnections?.appEnabled||!r.repoId||e.role!=="owner"||e.githubConnection!=="github-app"||fe(e.sourceUrl)!==e._originalFullName)return;e.repairingGitHubAccess=!0,e.accessRepairMessage="";let w=g();try{let M=await t.get("/github/connections");if(e.githubConnections=M.data,!M.data.appEnabled)return;let U=await t.post("/github/connections/migrate",{type:"repository",id:r.repoId,connection:"github-app"},{headers:{"X-CSRF-Token":M.data.csrf}});if(!y(w))return;e.error=null,U.data.fullName&&(e._originalFullName=U.data.fullName,e.source.fullName=U.data.fullName,e.sourceUrl="https://github.com/"+U.data.fullName),e.accessRepairMessage="GitHub access repaired. Your anonymous URL and published commit are unchanged.",await e.urlSelected(!0)}catch{y(w)&&(e.accessRepairMessage="Unable to repair GitHub access. Check the App's repository permissions in Manage access, then retry. Your published snapshot has not been replaced.")}finally{e.repairingGitHubAccess=!1,E(w)}},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.details=null,e.source.commit="",e.source.branch="",e.readme="",e.branches=[],jt.cancel(),Cn.cancel(),En.cancel(),e.previewStatus="idle",e.anonymize_readme="",gl();try{await A()}catch{}}};function ye(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:fe(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function Oe(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function T(){let w=new URLSearchParams(window.location.search).get("billingDraft");if(w){N.restore();try{let U=(await t.get("/api/billing/draft/"+encodeURIComponent(w))).data;if(U.path!==i.path())throw new Error("Wrong task");b=U.values.conference||null;for(let z of["sourceUrl","terms","repoId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(U.values,z)&&(e[z]=U.values[z]);return e.options?.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),D=U.id,V=JSON.stringify(N.checkpoint()),e.draftRestored=!0,e.hostingReview=!0,e.sourceUrl&&await Oe(),i.replace?.(i.path()),!0}catch{e.billingError="The checkout draft could not be restored. Retry by reloading this page; any local draft is still available."}}let M;try{M=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!M||M.path!==i.path()||Date.now()-M.savedAt>=30*6e4)return N.restore()?(e.sourceUrl&&await Oe(),!0):!1;N.restore();for(let U of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(M.draft,U)&&(e[U]=M.draft[U]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await Oe(),sessionStorage.removeItem("github-access-draft"),!0}pe(()=>{!r.repoId&&!r.pullRequestId&&!r.gistId&&u(T,0),r.repoId&&r.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=r.repoId,t.get("/api/repo/"+e.repoId).then(async w=>{e.accessRepairAllowed=!["removed","archived","preparing","queue","download","removing","expiring"].includes(w.data.status),e.githubConnection=w.data.connection||"oauth",e.sourceUrl="https://github.com/"+w.data.source.fullName,e._originalFullName=w.data.source.fullName,e.terms=w.data.options.terms.filter(M=>M).join(`
|
||||
`),e.source=w.data.source,e.role=w.data.role||"owner",e._existingNever=w.data.options.expirationMode==="never",e._savedExpirationDate=w.data.options.expirationDate?new Date(w.data.options.expirationDate):null,e.coauthors=w.data.coauthors||[],e._originalBranch=w.data.source.branch,e.options=Object.assign({},e.options,w.data.options),e.conference=w.data.conference,e._originalConference=w.data.conference,e.repositoryID=w.data.source.repositoryID,e._originalRepositoryID=w.data.source.repositoryID,w.data.options.expirationDate&&(e.options.expirationDate=new Date(w.data.options.expirationDate)),k=C(parseGithubUrl(e.sourceUrl)),!await T()&&(await Promise.all([A(),B()]),Ss())},()=>{i.url("/404")})),r.pullRequestId&&r.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=r.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async w=>{if(e.githubConnection=w.data.connection||"oauth",e.sourceUrl="https://github.com/"+w.data.source.repositoryFullName+"/pull/"+w.data.source.pullRequestId,e.terms=w.data.options.terms.filter(M=>M).join(`
|
||||
`),e.source=w.data.source,e.options=Object.assign({},e.options,w.data.options),e.conference=w.data.conference,e._originalConference=w.data.conference,w.data.options.expirationDate&&(e.options.expirationDate=new Date(w.data.options.expirationDate)),k=C(parseGithubUrl(e.sourceUrl)),!await T())try{await bl()}catch{}},()=>{i.url("/404")})),r.gistId&&r.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=r.gistId,t.get("/api/gist/"+e.gistId).then(async w=>{e.sourceUrl="https://gist.github.com/"+w.data.source.gistId,e.terms=w.data.options.terms.filter(M=>M).join(`
|
||||
`),e.source=w.data.source,e.options=Object.assign({},e.options,w.data.options),e.conference=w.data.conference,e._originalConference=w.data.conference,w.data.options.expirationDate&&(e.options.expirationDate=new Date(w.data.options.expirationDate)),k=C(parseGithubUrl(e.sourceUrl)),!await T()&&await wl()},()=>{i.url("/404")}))}),t.get("/github/connections").then(w=>{e.githubConnections=w.data,!r.repoId&&!r.pullRequestId&&!r.gistId&&e.githubConnection===void 0&&w.data.appEnabled&&w.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&Oe())}).catch(()=>{}).finally(()=>{!v&&!r.repoId&&!r.pullRequestId&&!r.gistId&&e.userReposStatus==="idle"&&e.loadUserRepos()}),e.urlSelected=async(w=!1)=>{let M=++c;e.previousConfigurations=[],e.previousConfigurationId="";let U;try{U=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,e.details=null,ot(),jt.cancel(),Cn.cancel(),En.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",te("sourceUrl","github",!1);return}let z=C(U),ae=w||k===z;k=z,e.sourceUrlError="",te("sourceUrl","github",!0),ot();let me=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,setTimeout(()=>{let Be=window.document.getElementById("sourceUrl");if(Be){try{Be.setSelectionRange(0,0)}catch{}Be.scrollLeft=0}},50),me&&u(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!ae&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],ae||(e.source={type:"GitHubStream",branch:"",commit:""}),jt.cancel(),Cn.cancel(),En.cancel(),Ns.clear(),Rs.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",gl(),e.detectedType=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1,e._preservingDraft=ae;try{U.gistId&&!U.repo?(e.detectedType="gist",e.source={gistId:U.gistId},await wl()):U.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:U.owner+"/"+U.repo,pullRequestId:U.pullRequestId},await bl()):(e.detectedType="repo",Ge(),await Promise.all([A(),B()]),Ss())}catch{}finally{M===c&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let w=e.branches.filter(U=>U.name==e.source.branch)[0];if(!w)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=w.commit),e.readme=w.readme,await B(),Ss()}),e.getBranches=async w=>{let M=parseGithubUrl(e.sourceUrl),U=g();try{if(!e.details){await A(w);return}let z=await t.get(`/api/repo/${M.owner}/${M.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&fe(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:w===!0||e.reconnectingSource?"1":"0",repositoryID:ye()}});if(!y(U))return;e.branches=z.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let ae=e.branches.filter(me=>me.name==e.source.branch);ae.length>0&&(!(!e.reconnectingSource&&!w&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=ae[0].commit),e.readme=ae[0].readme,await B(w))}catch(z){if(!y(U))return;e.branches=[],e.sourceUnreachable=z&&(z.status===404||z.data&&z.data.error==="repo_not_found"),e.details=null,He(z)}finally{E(U)}};async function A(w=!1){let M=parseGithubUrl(e.sourceUrl),U=g();try{Ps(),ot();let z=await t.get(`/api/repo/${M.owner}/${M.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&fe(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,repositoryID:ye(),force:"1"}});if(!y(U))return;e.details=z.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(w||e.reconnectingSource)}catch(z){if(!y(U))return;throw He(z),z}finally{E(U)}}async function B(w){if(e.readme&&!w)return e.readme;let M=parseGithubUrl(e.sourceUrl),U=g();try{let z=await t.get(`/api/repo/${M.owner}/${M.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&fe(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:w===!0?"1":"0",branch:e.source.branch,repositoryID:ye()}});y(U,!0)&&(e.readme=z.data)}catch{y(U,!0)&&(e.readme="")}finally{E(U)}}let X={magicalBraces:!0},j=w=>w.startsWith("/")&&!w.endsWith("/")&&Wn(ws(w.slice(1),X),X)===w.slice(1),J=()=>Object.keys(e.preserve.picked).filter(w=>e.preserve.picked[w]).sort().map(w=>"/"+Wn(w,X)),de=w=>"/"+Wn(w,X)+"/**",se=w=>"!/"+Wn(w,X)+"/",ne=()=>String(e.preserve.patterns||"").split(`
|
||||
`).map(w=>w.trim()).filter(Boolean),Y=null,be=null,ce=new Set,ke=0,Re=null,Me=()=>!1;function Ke(){let w=ke+"\0"+e.preserve.patterns;if(w!==Re){Re=w;try{Me=dl(ll([...J(),...ne()]))}catch{Me=()=>!1}}return Me}function ze(w){let M=new Map([["",{dirs:[],files:[]}]]);for(let U of w){let z=U.split("/"),ae="";for(let me=0;me<z.length-1;me++){let Be=z.slice(0,me+1).join("/");M.has(Be)||(M.set(Be,{dirs:[],files:[]}),M.get(ae).dirs.push(Be)),ae=Be}M.get(ae).files.push(U)}for(let U of M.values())U.dirs.sort();return{files:w,dirs:M,descendants:new Map}}function we(w){return Y.descendants.has(w)||Y.descendants.set(w,Y.files.filter(M=>M.startsWith(w+"/"))),Y.descendants.get(w)}let Ve=w=>Ke()(w);function it(w){let M=we(w),U=0;for(let z of M)Ve(z)&&U++;return U===0?"none":U===M.length?"all":"some"}e.preserve={open:!1,loading:!1,error:"",truncated:!1,commit:"",search:"",expanded:{},picked:{},patterns:"",patternsOpen:!1},e.preserveSummary=()=>{let w=(e.options?.preserveFiles||[]).map(M=>String(M).trim()).filter(Boolean).map(M=>j(M)?ws(M.slice(1),X):M);return w.length?w.slice(0,2).join(", ")+(w.length>2?` and ${w.length-2} more`:""):"None. Every file is redacted."};async function ct(){let w=e.source?.commit;if(!(Y&&e.preserve.commit===w)){e.preserve.loading=!0,e.preserve.error="",Y=null,be=null;try{let M=parseGithubUrl(e.sourceUrl),U=await t.get(`/api/repo/${M.owner}/${M.repo}/tree`,{params:{commit:w,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&r.repoId&&fe(e.sourceUrl)===e._originalFullName?r.repoId:void 0,repositoryID:ye()}});if(e.source?.commit!==w)return;let z=Array.isArray(U.data.binaryFiles)?U.data.binaryFiles:[];Y=mn(ze(U.data.files||[])),be=z.length?mn(ze([...U.data.files||[],...z])):Y,ce=mn(new Set(z)),e.preserve.commit=w,e.preserve.truncated=!!U.data.truncated,e.previewFile||jt()}catch{e.preserve.error="The file list could not be loaded from GitHub. You can still use patterns.",e.preserve.patternsOpen=!0}finally{e.preserve.loading=!1}}}e.watch("source.commit",w=>{e.previewFile&&e.openPreviewFile(""),e.detectedType==="repo"&&w&&e.sourceUrl&&ct().catch(()=>{})}),e.openPreserveFiles=()=>{let w={},M=[];for(let z of e.options?.preserveFiles||[]){let ae=String(z).trim();ae&&(!M.length&&j(ae)?w[ws(ae.slice(1),X)]=!0:M.push(ae))}let U={};for(let z of Object.keys(w)){let ae=z.split("/");for(let me=1;me<ae.length;me++)U[ae.slice(0,me).join("/")]=!0}Object.assign(e.preserve,{open:!0,search:"",picked:w,expanded:U,patterns:M.join(`
|
||||
`),patternsOpen:M.length>0}),e.mobileWorkspace&&(e.mobilePane="settings"),ke++,u(()=>{let z=document.getElementById("preserve-files-dialog");z?.showModal&&!z.open&&z.showModal(),document.getElementById("preserve-files-search")?.focus()},0),ct()},e.closePreserveFiles=()=>{document.getElementById("preserve-files-dialog")?.close?.(),e.preserve.open=!1},e.savePreserveFiles=()=>{e.options.preserveFiles=ll([...J(),...ne()]),e.closePreserveFiles()},e.preserveRows=()=>{if(!Y)return[];let w=Ke(),M=(me,Be,Ot)=>{let mt=!!e.preserve.picked[me],Nt=w(me);return{kind:"file",path:me,label:Ot,depth:Be,state:Nt?"all":"none",locked:!mt&&Nt,note:!mt&&Nt?"matched by a pattern":mt&&!Nt?"excluded by a pattern":""}},U=String(e.preserve.search||"").trim().toLowerCase();if(U)return Y.files.filter(me=>me.toLowerCase().includes(U)).slice(0,300).map(me=>M(me,0,me));let z=[],ae=(me,Be)=>{let Ot=Y.dirs.get(me);for(let mt of Ot.dirs){let Nt=!!e.preserve.expanded[mt],Gt=ne().includes(de(mt));z.push({kind:"dir",path:mt,label:mt.slice(me?me.length+1:0)+"/",depth:Be,open:Nt,state:it(mt),locked:!1,note:Gt?"whole folder":""}),Nt&&ae(mt,Be+1)}for(let mt of Ot.files)z.push(M(mt,Be,mt.slice(me?me.length+1:0)))};return ae("",0),z},e.preserveCount=()=>Y?Y.files.filter(Ve).length:0,e.togglePreserveDir=w=>{e.preserve.expanded[w]=!e.preserve.expanded[w]},e.togglePreserveFile=w=>{e.preserve.picked[w]=!e.preserve.picked[w],ke++},e.togglePreserveFolder=w=>{let M=de(w),U=se(w),z=ne().filter(me=>me!==M&&me!==U),ae=it(w)==="all"||ne().includes(M);for(let me of we(w))e.preserve.picked[me]=!1;ke++,e.preserve.patterns=(ae?z:[...z,M]).join(`
|
||||
`),ae&&we(w).some(Ve)&&(e.preserve.patterns=[...z,U].join(`
|
||||
`))};let At=/^readme(\.[^/]*)?$/i,Rt=[".md",".markdown",".mdown",".mkdn",".rst",".txt",""],lt=["README.md","README","README.markdown","README.rst","README.txt","readme.md"],ft=w=>{let M=$e(w),U=M.indexOf("."),z=Rt.indexOf(U===-1?"":M.slice(U).toLowerCase());return z===-1?Rt.length:z},Jt=()=>!!Y&&!!e.preserve.commit&&e.preserve.commit===e.source?.commit;e.readmePath=()=>{if(!Jt())return"";for(let w of[".github","","docs"]){let M=(Y.dirs.get(w)?.files||[]).filter(U=>At.test($e(U)));if(M.length)return M.sort((U,z)=>ft(U)-ft(z)||Ne(U,z))[0]}return""},e.readmeName=()=>$e(e.readmePath())||"README.md";let Cs={key:null,fn:()=>!1},hl=()=>{let w=(e.options?.preserveFiles||[]).map(U=>String(U).trim()).filter(Boolean),M=w.join(`
|
||||
`);if(M!==Cs.key){let U=()=>!1;try{w.length&&(U=dl(w))}catch{}Cs={key:M,fn:U}}return Cs.fn};e.pathPreserved=w=>!!w&&hl()(w),e.readmePreserved=()=>{if(e.detectedType!=="repo")return!1;let w=hl();if(Jt()){let M=e.readmePath();return!!M&&w(M)}return lt.some(M=>w(M))},e.previewPreserved=()=>e.detectedType==="repo"&&(e.previewFile?e.pathPreserved(e.previewFile):e.readmePreserved());function oi(){let w={terms:e.terms?e.terms.split(`
|
||||
`):[],filePath:e.previewOpenPath()||"README.md",preserveFiles:e.options.preserveFiles||[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(w.branchName=e.source.branch);try{let M=parseGithubUrl(e.sourceUrl);w.repoName=`${M.owner}/${M.repo}`}catch{}return w}function Nr(w,M,U){let z=null,ae=0,me=()=>{if(e.detectedType!==w)return;z&&u.cancel(z);let Be=++ae;e.previewStatus="loading",z=u(()=>{z=null;let Ot=M();if(!Ot){e.previewStatus="idle";return}t.post("/api/anonymize-preview",Ot).then(mt=>{Be===ae&&(U(mt.data,Ot),e.previewStatus="ready")}).catch(()=>{Be===ae&&(e.previewStatus="error")})},200)};return me.cancel=()=>{ae++,z&&u.cancel(z),z=null},e.on("dispose",me.cancel),me}e.retryPreview=()=>{e.detectedType==="repo"&&(e.previewFile&&typeof ln!="string"?vl(e.previewFile):jt()),e.detectedType==="pr"&&Cn(),e.detectedType==="gist"&&En()};let et=mn(Bo(e));Object.defineProperty(e,"previewViewer",{get:()=>et}),Aa(et,e),Object.assign(et,{options:{},files:[],paths:[],content:null,type:"loading",sidebarHidden:!1,sidebarCollapsed:!0,moreOpen:!1,tocOpen:!1,gotoOpen:!1,mdFindOpen:!1,mdFindQuery:"",mdFindTotal:0,mdFindIndex:0}),et.preview=!0,et.fileSize=w=>w===et.filePath&&typeof ln=="string"?new Blob([ln]).size:!e.previewFile&&e.readme?new Blob([e.readme]).size:null,et.openPreserveFiles=()=>e.openPreserveFiles(),et.previewPreserved=()=>e.previewPreserved(),et.retryContent=()=>e.retryPreview();let Rf=w=>ce.has(w)||/\.(pdf|png|jpe?g|gif|svg|ico|bmp|tiff?|webp|avif|heic|heif|mp4|webm|mp3|wav|zip|bin)$/i.test(w),Rr=(w="")=>({path:w,loading:!1,note:"",loadError:""});e.previewFile="",e.previewDoc=Rr();let no=0,ln=null;e.previewOpenPath=()=>e.previewFile||e.readmePath(),e.openPreviewFile=w=>{if(w=w||"",w&&w===e.readmePath()&&(w=""),no++,ln=null,ri(),jt.cancel(),e.previewFile=w,e.previewDoc=Rr(w),et.sidebarCollapsed=!0,et.content=null,!w){e.readme?jt():e.previewStatus="idle";return}if(Rf(w)){Pr("binary"),e.previewStatus="ready";return}vl(w)};function gl(){no++,ln=null,e.previewFile="",e.previewDoc=Rr(),et.sidebarCollapsed=!0,et.content=null}function vl(w){let M=++no;ln=null,Object.assign(e.previewDoc,{loading:!0,loadError:""}),e.previewStatus="loading";let U;try{U=parseGithubUrl(e.sourceUrl)}catch{U=null}if(!U||!e.source?.commit){Object.assign(e.previewDoc,{loading:!1,loadError:"The repository is still loading. Try again in a moment."}),e.previewStatus="error";return}t.get(`/api/repo/${U.owner}/${U.repo}/file`,{params:{commit:e.source.commit,path:w,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&r.repoId&&fe(e.sourceUrl)===e._originalFullName?r.repoId:void 0,repositoryID:ye()},transformResponse:z=>z}).then(z=>{if(M!==no)return;e.previewDoc.loading=!1;let ae=typeof z.headers=="function"&&z.headers("content-type")||"";if(/json/i.test(ae)){let me=null;try{me=JSON.parse(z.data)}catch{}if(me&&me.binary===!0){Pr("binary"),e.previewStatus="ready";return}}ln=typeof z.data=="string"?z.data:"",jt()},z=>{if(M!==no)return;e.previewDoc.loading=!1;let ae=kr(z);if(ae==="file_too_big"){Pr("too_big"),e.previewStatus="ready";return}e.previewDoc.loadError=Jn.ERRORS[ae]||"GitHub did not return this file.",e.previewStatus="error"})}let ii;function ri(){ii&&window.URL.revokeObjectURL(ii),ii=void 0,et.url=void 0}e.on("dispose",ri);function Pr(w){ri(),e.previewDoc.note=w,et.prepareFile(e.previewPathName(e.previewOpenPath()||e.readmeName())),et.type=w==="too_big"?"error":"binary",et.content=w==="too_big"?"file_too_big":"binary"}function Pf(w){try{let M=parseGithubUrl(e.sourceUrl),U=e.source.branch||e.details&&e.details.defaultBranch||"main",z=w&&w.includes("/")?w.slice(0,w.lastIndexOf("/")+1):"";return`https://github.com/${M.owner}/${M.repo}/raw/${U}/${z}`}catch{return""}}let yl=Nr("repo",()=>e.previewFile?typeof ln!="string"?null:{content:ln,options:oi()}:e.readme?{content:e.readme,options:oi()}:null,w=>{if(typeof w?.content!="string")throw Error("Invalid preview response");ri(),window.URL?.createObjectURL&&(et.url=ii=window.URL.createObjectURL(new Blob([w.content],{type:"text/plain"})));let M=e.previewOpenPath()||e.readmeName();et.prepareFile(e.previewPathName(M)),et.fileBaseUrl=Pf(M),et.renderFileContent(w.content,et.type,et.fileBaseUrl,"text/plain"),e.previewFile||(e.anonymize_readme=w.content)}),jt=()=>{e.previewFile&&typeof ln!="string"||yl()};jt.cancel=yl.cancel;let Es=rt(new Map),Dr=new Set,Tr=new Set,so="",oo=null,ai=()=>String(e.terms||"").split(`
|
||||
`).filter(w=>w.trim());function Df(){oo=null;let w=ai(),M=w.join(`
|
||||
`);M!==so&&(Es.clear(),Tr.clear(),so=M);let U=[...Dr].filter(z=>!Es.has(z));if(Dr.clear(),!(!U.length||!w.length))for(let z=0;z<U.length;z+=400){let ae=U.slice(z,z+400);t.post("/api/anonymize-preview",{contents:ae,options:{terms:w,image:!0,link:!0}}).then(me=>{if(so!==M||ai().join(`
|
||||
`)!==M)return;let Be=me.data?.contents;if(!Array.isArray(Be)||Be.length!==ae.length)throw Error("Invalid preview response");ae.forEach((Ot,mt)=>Es.set(Ot,typeof Be[mt]=="string"?Be[mt]:Ot))}).catch(()=>{so===M&&ae.forEach(me=>Tr.add(me))})}}e.previewName=w=>{if(!w||!ai().length)return w;if(so===ai().join(`
|
||||
`)){if(Es.has(w))return Es.get(w);if(Tr.has(w))return w}return Dr.add(w),oo||(oo=u(Df,120)),w},e.previewPathName=w=>{w=String(w||"");let M=w.lastIndexOf("/");return M<0?e.previewName(w):e.previewName(w.slice(0,M))+"/"+e.previewName(w.slice(M+1))},e.watch(()=>[e.repoId,e.previewPathName(e.previewOpenPath()||e.readmeName()),e.previewTreeFiles()],()=>{et.repoId=e.repoId||"repository",et.filePath=e.previewPathName(e.previewOpenPath()||e.readmeName()),et.paths=et.filePath.split("/"),et.files=e.previewTreeFiles(),et.loadedFolders=Object.fromEntries([...be?.dirs.keys()||[]].map(w=>[e.previewName(w),!0]))},!0),e.on("dispose",()=>{oo&&u.cancel(oo)});function Ss(){!e.anonymize||!e.anonymize.terms||jt()}async function bl(){let w=parseGithubUrl(e.sourceUrl),M=g();try{Ps(),ot();let U=await t.get(`/api/pr/${w.owner}/${w.repo}/${w.pullRequestId}`,{params:{connection:e.githubConnection}});if(!y(M))return;e.details=U.data,e.pullRequestId||(e.pullRequestId=w.repo+"-PR"+w.pullRequestId+"-"+generateRandomId(4))}catch(U){if(!y(M))return;throw He(U),U}finally{E(M)}}let Ns=rt(new Map);function Tf(){let w=new Set,M=e.details&&e.details.pullRequest;if(!M)return w;typeof M.title=="string"&&w.add(M.title),typeof M.body=="string"&&w.add(M.body),typeof M.diff=="string"&&w.add(M.diff);let U=M.comments||[];for(let z of U)typeof z.author=="string"&&w.add(z.author),typeof z.body=="string"&&w.add(z.body);return w}let Cn=Nr("pr",()=>{let w=Tf(),M=Array.from(w);return M.length===0?null:{contents:M,options:oi()}},(w,M)=>{if(!Array.isArray(w?.contents)||w.contents.length!==M.contents.length||w.contents.some(ae=>typeof ae!="string"))throw Error("Invalid preview response");let U=M.contents,z=new Map;for(let ae=0;ae<U.length&&ae<w.contents.length;ae++)z.set(U[ae],w.contents[ae]);Ns.clear(),z.forEach((ae,me)=>Ns.set(me,ae))});e.anonymizePrContent=function(w){return w&&(Ns.has(w)?Ns.get(w):"")};async function wl(){let w=parseGithubUrl(e.sourceUrl),M=g();try{Ps(),ot(),e.gistOAuthRequired=!1,e.gistAppRequired=!1;let U=await t.get(`/api/gist/source/${w.gistId}`);if(!y(M))return;e.details=U.data,e.gistId||(e.gistId="gist-"+w.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(U){if(!y(M))return;if(U.data?.error==="github_app_reconnect_required"){e.gistAppRequired=!0,te("sourceUrl","missing",!1);return}if(U.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,te("sourceUrl","missing",!1);return}throw He(U),U}finally{E(M)}}let Rs=rt(new Map);function If(){let w=new Set,M=e.details&&e.details.gist;if(!M)return w;typeof M.description=="string"&&w.add(M.description),typeof M.ownerLogin=="string"&&w.add(M.ownerLogin);let U=M.files||[];for(let ae of U)typeof ae.filename=="string"&&w.add(ae.filename),typeof ae.content=="string"&&w.add(ae.content);let z=M.comments||[];for(let ae of z)typeof ae.author=="string"&&w.add(ae.author),typeof ae.body=="string"&&w.add(ae.body);return w}let En=Nr("gist",()=>{let w=If(),M=Array.from(w);return M.length===0?null:{contents:M,options:oi()}},(w,M)=>{if(!Array.isArray(w?.contents)||w.contents.length!==M.contents.length||w.contents.some(ae=>typeof ae!="string"))throw Error("Invalid preview response");let U=M.contents,z=new Map;for(let ae=0;ae<U.length&&ae<w.contents.length;ae++)z.set(U[ae],w.contents[ae]);Rs.clear(),z.forEach((ae,me)=>Rs.set(me,ae)),Ir()});e.anonymizeGistContent=function(w){return w&&(Rs.has(w)?Rs.get(w):"")},e.previewGistFiles=[];function Ir(){let w=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=w.map(M=>({filename:e.anonymizeGistContent(M.filename),content:e.anonymizeGistContent(M.content),language:M.language}))}e.watch("details.gist.files",Ir,!0),e.watch("terms",Ir);function Af(){let w=e.conference;if(e.conference_data=null,!w)return;let M=w===b||e.isUpdate&&w===e._originalConference;w!==b&&(b=null),t.get("/api/conferences/"+w).then(U=>{e.conference===w&&(e.conference_data=U.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!M&&(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===w&&(e.conference_data=null)})}function Ps(){te("repoId","used",!0),te("repoId","format",!0),te("pullRequestId","used",!0),te("pullRequestId","format",!0),te("gistId","used",!0),te("gistId","format",!0),te("sourceUrl","used",!0),te("sourceUrl","missing",!0),te("sourceUrl","access",!0),te("sourceUrl","github",!0),te("commit","exists",!0),te("conference","activated",!0),te("terms","format",!0),e.termHints=[]}function li(){if(e.detectedType==="repo"&&e.options.expirationMode==="never")return!1;let w=e.anonymize&&e.anonymize.expirationDate;return!e.options.expirationDate||w&&w.invalid?(w&&w.setDirty&&w.setDirty(),e.error=
Line truncated
|
||||
`).filter(me=>me),connection:e.githubConnection,fullName:`${U.owner}/${U.repo}`,repository:e.sourceUrl,reconnectRepositoryId:e.reconnectRepositoryId,options:e.options,source:e.source,conference:e.conference};e.details&&(z.options.pageSource=e.details.pageSource),Ps();let ae=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(ae,z,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/status/"+e.repoId},me=>{if(me.data){let Be=["quota_exceeded","quota_repository_limit","quota_storage_limit","subscription_required_for_never_expiration"].includes(me.data.error);Be||o("ERRORS."+me.data.error).then(Ot=>{e.error=Ot},console.error),di(me.data.error),Be&&(me.data.error==="subscription_required_for_never_expiration"&&(e._existingNever=!1),e.hostingQuotaBlocked=!0,e.hostingReview=!0,Xe(()=>document.getElementById("repository-hosting")?.scrollIntoView({block:"center"})))}}).finally(()=>{M.disabled=!1})},e.anonymizeGist=w=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(li())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let M=w.currentTarget||w.target.closest?.("button")||w.target;M.disabled=!0;let U=parseGithubUrl(e.sourceUrl),z={gistId:e.gistId,terms:e.terms.trim().split(`
|
||||
`).filter(me=>me),source:{gistId:U.gistId},options:e.options,conference:e.conference};Ps();let ae=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(ae,z,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/gist/"+e.gistId},me=>{me.data&&(o("ERRORS."+me.data.error).then(Be=>{e.error=Be},console.error),di(me.data.error))}).finally(()=>{M.disabled=!1})},e.anonymizePullRequest=w=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(li())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let M=w.currentTarget||w.target.closest?.("button")||w.target;M.disabled=!0;let U=parseGithubUrl(e.sourceUrl),z={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
|
||||
`).filter(me=>me),source:{repositoryFullName:`${U.owner}/${U.repo}`,pullRequestId:U.pullRequestId},options:e.options,conference:e.conference};Ps();let ae=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(ae,z,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/pr/"+e.pullRequestId},me=>{me.data&&(o("ERRORS."+me.data.error).then(Be=>{e.error=Be},console.error),di(me.data.error))}).finally(()=>{M.disabled=!1})},e.watch("conference",()=>{Af()}),e.termHints=[],e.matchTermAsWritten=w=>{e.terms=tp(e.terms,w)},e.watch("options.preserveFiles",()=>{e.detectedType==="repo"&&jt()}),e.watch("terms",()=>{e.termHints=ep(e.terms),e.detectedType==="repo"&&Ss(),e.detectedType==="pr"&&Cn(),e.detectedType==="gist"&&En()}),e.watch("options.image",()=>{e.detectedType==="repo"&&Ss(),e.detectedType==="pr"&&Cn(),e.detectedType==="gist"&&En()}),e.watch("options.link",()=>{e.detectedType==="repo"&&Ss(),e.detectedType==="pr"&&Cn(),e.detectedType==="gist"&&En()}),e.watch("details",()=>{e.detectedType==="pr"&&Cn(),e.detectedType==="gist"&&En()},!0)},pl=function(e,t,s,r,i,o){Aa(e);let u=wt();sp();let p=Ht(),c=0,v=null,h=null;e.fileLoadingSlow=!1,e.fileReceivedBytes=0;function y(){v&&(v.resolve(),v=null),h&&(u.timeout.cancel(h),h=null)}let g=!1;e.on("dispose",()=>{g=!0,c++,y(),E&&E.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,p(document,"click",P=>{e.symbolsOpen&&!P.target.closest?.(".symbols")&&(e.symbolsOpen=!1),e.moreOpen&&!P.target.closest?.(".tb-more")&&(e.moreOpen=!1),e.tocOpen&&!P.target.closest?.(".tb-toc-m")&&(e.tocOpen=!1),e.gotoOpen&&P.target.isConnected&&!P.target.closest?.(".goto-pop, .btn-goto, .tb-more")&&(e.gotoOpen=!1),e.accountOpen&&!P.target.closest?.(".acct")&&(e.accountOpen=!1),e.helpOpen&&!P.target.closest?.(".vb-help")&&(e.helpOpen=!1)}),p(document,"keydown",P=>{P.key==="Escape"&&(e.symbolsOpen=!1,e.moreOpen=!1,e.tocOpen=!1,e.gotoOpen=!1,e.accountOpen=!1,e.helpOpen=!1),(P.ctrlKey||P.metaKey)&&!P.altKey&&P.key&&P.key.toLowerCase()==="f"&&e.type==="html"&&window.document.querySelector(".reading-layout")&&(P.preventDefault(),e.toggleMdFind(!0))}),p(document,"keydown",function(P){if((P.metaKey||P.ctrlKey)&&P.key==="k"){P.preventDefault();var q=document.querySelector(".tree-search-input");q&&(q.focus(),q.select())}});var E=null;e.onFileSearchChange=function(){E&&(E.resolve(),E=null);let P=e.fileSearchQuery;if(!P||P.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let q=o.defer();E=q,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(P)}`,{timeout:q.promise}).then(function(S){if(!(g||E!==q)){E=null,e.fileSearchLoading=!1;var L={};e.files.forEach(function($e){L[($e.path||"")+"/"+$e.name]=!0});for(var H=[],W={},oe=0;oe<S.data.length;oe++){var ee=S.data[oe];if(ee.path)for(var ie=ee.path.split("/"),he="",Ee=0;Ee<ie.length;Ee++){var _e=he;he=he?he+"/"+ie[Ee]:ie[Ee];var Ge=_e+"/"+ie[Ee];!L[Ge]&&!W[Ge]&&(W[Ge]=!0,H.push({name:ie[Ee],path:_e}))}}H.sort(function($e,K){return($e.path||"").split("/").length-(K.path||"").split("/").length}),H.length>0&&e.files.push.apply(e.files,H);for(var Ze=[],He=0;He<S.data.length;He++){var ot=S.data[He],Ne=(ot.path||"")+"/"+ot.name;!L[Ne]&&ot.size!=null&&(Ze.push(ot),L[Ne]=!0)}Ze.length>0&&e.files.push.apply(e.files,Ze),e.fileSearchResults=S.data}},function(){!g&&E===q&&(E=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})},e.on("routeUpdate",function(P,q){if(e.repoId!=r.repoId)return ue();if((r.path||"")!=e.filePath){window.matchMedia?.("(max-width: 767px)").matches&&(e.sidebarCollapsed=!0),e.filePath=r.path||"",e.paths=e.filePath.split("/").filter(S=>S&&S.trim().length>0),Z();for(let S=0;S<e.paths.length-1;S++){let L=S>0?e.paths.slice(0,S).join("/"):"";e.files.some(W=>W.path===L)||e.getFiles(L)}}});function k(){if(e.paths[0]!="")return;let P=["readme.md","readme.txt","readme.org","readme.1st","readme"],q={};for(let L of e.files)L.name.toLowerCase().indexOf("readme")>-1&&(q[L.name.toLowerCase()]=L.name);let S=null;for(let L of P)if(q[L]){S=L;break}if(!S&&Object.keys(q).length>0&&(S=Object.keys(q)[0]),S){let L=s.url();L[L.length-1]!="/"&&(L+="/"),s.url(L+encodePathForUrl(q[S]))}}e.fileCounts=null;let C=0,N=new Set,b=!1;e.getFiles=function(P,q=!1){let S=e.repoId,L=C;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(P)}&v=${e.options.lastUpdateDate}`).then(function(H){if(g||S!==e.repoId||L!==C)return[];let W=P||"";return e.files=e.files.filter(oe=>oe.path!==W),e.files.push(...H.data),e.loadedFolders={...e.loadedFolders,[W]:!0},D(W,L),H.data},function(H){if(g||S!==e.repoId||L!==C)return[];q||(e.type="error",e.content=kr(H),e.files=[])})};function D(P,q){if(b||N.has(P))return;N.add(P);let S=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts?path=${encodeURIComponent(P)}`).then(function(L){g||S!==e.repoId||q!==C||(e.fileCounts={...e.fileCounts,...L.data})},func
Line truncated
|
||||
`+d(s.event.errorStack),1),s.event.causeType?(a(),l(O,{key:0},[m(`
|
||||
Caused by `+d(s.event.causeType)+`
|
||||
`+d(s.event.causeStack||""),1)],64)):f("v-if",!0)])):f("v-if",!0),n("pre",null,d(e.recordJson(s.event)),1)],8,_2)):f("v-if",!0)],2))),128))]),e.trace?.events?.length?(a(),l("p",z2,[m(d(e.errPlural(e.trace.events.length,"record"))+" with this "+d(e.traceKind())+" ID",1),e.trace.state==="partial"?(a(),l(O,{key:0},[m(" (partial)")],64)):f("v-if",!0),t[92]||(t[92]=m(". External calls come from ",-1)),t[93]||(t[93]=n("code",null,"external_request",-1)),t[94]||(t[94]=m(" records; no URLs or tokens are stored. ",-1)),e.trace.grafanaUrl?(a(),l("a",{key:1,href:e.safeUrl(e.trace.grafanaUrl),target:"_blank",rel:"noopener noreferrer"},"Open in Grafana",8,j2)):f("v-if",!0)])):(a(),l("p",G2,[t[95]||(t[95]=n("strong",null,"Timeline not recorded.",-1)),t[96]||(t[96]=m()),e.traceKind()?e.issueData.source!=="central"?(a(),l(O,{key:1},[m("The application history keeps single records; the timeline needs central logs.")],64)):e.trace?.state==="unreachable"?(a(),l(O,{key:2},[m("Central logs did not answer. Retry later.")],64)):(a(),l(O,{key:3},[m("Central logs returned no other record for this "+d(e.traceKind())+".",1)],64)):(a(),l(O,{key:0},[m("This record has no request or job ID, so its other records cannot be found.")],64)),t[97]||(t[97]=m(" Only this record is shown.",-1))]))],64))])):f("v-if",!0),e.requestTab==="request"?(a(),l("div",W2,[n("dl",K2,[n("div",null,[t[98]||(t[98]=n("dt",null,"Method \xB7 route",-1)),n("dd",null,[e.currentOccurrence().route||e.selectedIssue.route?(a(),l("code",Y2,d(e.currentOccurrence().method||e.selectedIssue.method)+" "+d(e.currentOccurrence().route||e.selectedIssue.route),1)):(a(),l("span",X2,"not recorded"))])]),n("div",null,[t[99]||(t[99]=n("dt",null,"Path",-1)),n("dd",null,[e.currentOccurrence().requestPath?(a(),l("code",Q2,d(e.currentOccurrence().requestPath),1)):(a(),l("span",J2,"not recorded"))])]),t[106]||(t[106]=n("div",null,[n("dt",null,"Query"),n("dd",null,[n("span",{class:"errs-placeholder"},"excluded: query strings are never logged")])],-1)),n("div",null,[t[100]||(t[100]=n("dt",null,"Body",-1)),n("dd",null,[n("span",Z2,d(["GET","HEAD"].includes(e.currentOccurrence().method||e.selectedIssue.method)?"none ("+(e.currentOccurrence().method||e.selectedIssue.method)+")":"not recorded"),1)])]),n("div",null,[t[101]||(t[101]=n("dt",null,"Viewer",-1)),n("dd",null,[e.currentOccurrence().viewer?(a(),l(O,{key:0},[m(d(e.viewerLabel(e.currentOccurrence().viewer)),1),e.currentOccurrence().viewer==="visitor"||e.currentOccurrence().viewer==="anonymous"?(a(),l("span",x2," \xB7 reviewers are never identified")):f("v-if",!0)],64)):(a(),l("span",eC,"not recorded"))])]),n("div",null,[t[102]||(t[102]=n("dt",null,"Repository",-1)),n("dd",null,[e.currentOccurrence().repoId?(a(),l("a",{key:0,class:"errs-mono",href:e.errRepoHref(e.currentOccurrence().repoId)},d(e.currentOccurrence().repoId),9,tC)):(a(),l("span",nC,"not recorded")),e.ownerOf(e.currentOccurrence().repoId)?.source?(a(),l("span",sC," \xB7 "+d(e.ownerOf(e.currentOccurrence().repoId).source),1)):f("v-if",!0)])]),n("div",null,[t[103]||(t[103]=n("dt",null,"User",-1)),n("dd",null,[e.currentOccurrence().userId?(a(),l("a",{key:0,href:e.errUserHref(e.currentOccurrence().userId)},d(e.userName(e.currentOccurrence().userId)?"@"+e.userName(e.currentOccurrence().userId):e.currentOccurrence().userId),9,oC)):(a(),l("span",iC,"not recorded"))])]),n("div",null,[t[104]||(t[104]=n("dt",null,"Service \xB7 release",-1)),n("dd",null,[m(d(e.currentOccurrence().service||e.selectedIssue.service||"unknown")+" \xB7 ",1),e.currentOccurrence().release&&e.currentOccurrence().release!=="unknown"?(a(),l("code",rC,d(e.currentOccurrence().release.slice(0,7)),1)):(a(),l("span",aC,"release not recorded"))])]),(a(),l(O,null,G(["requestId","jobId"],s=>n("div",{key:s},[n("dt",null,d(s==="requestId"?"Request ID":"Job ID"),1),n("dd",null,[e.currentOccurrence()[s]?(a(),l(O,{key:0},[n("code",lC,d(e.currentOccurrence()[s]),1),t[105]||(t[105]=m()),n("button",{type:"button",class:"errs-link-button",onClick:r=>e.copyValue(e.currentOccurrence()[s],s==="requestId"?"Request ID":"Job ID")},"Copy",8,dC)],64)):(a(),l("span",uC,"not recorded"))])])),64))])])):f("v-if",!0),e.requestTab==="exception"?(a(),l("div",cC,[e.exceptionRecord().record?(a(),l(O,{key:0},[e.exceptionRecord().fromSample?(a(),l("p",pC,"This occurrence has no stack of its own; showing the latest occurrence's.")):f("v-if",!0),n("dl",fC,[n("div",null,[t[107]||(t[107]=n("dt",null,"Type",-1)),n("dd",null,[n("code",null,d(e.exceptionRecord().record.errorType||"not recorded"),1)])]),n("div",null,[t[108]||(t[108]=n("dt",null,"Code",-1)),n("dd",null,[e.exceptionRecord().record.errorCode?(a(),l("code",mC,d(e.exceptionRecord().record.errorCode),1)):(a(),l("span",hC,"not recorded"))])]),n("div",null,[t[109]||(t[109]=n("dt",null,"Cause",-1)),n("dd",null,[e.exceptionRecord().record.causeType?(a(),l("code",gC,d(e.exceptionRecord().record.causeType),1)):(a(),l("span",vC,"not recorded"))])])]),t[111]||(t[111]=n("h3",{class:"errs-subhead"},"Stac
Line truncated
|
||||
`).length+1)),placeholder:`Jane Smith
|
||||
MIT CSAIL
|
||||
jane.smith@example.org`},null,10,v8),[[u,{state:e.viewState,set:c=>{e.terms=c},value:e.terms,form:"anonymize",options:{debounce:250}}]]),t[132]||(t[132]=n("small",{class:"form-text text-muted"},"One term per line.",-1)),n("details",y8,[t[127]||(t[127]=n("summary",null,"Regex & replacement syntax",-1)),t[128]||(t[128]=m()),n("small",b8,[t[121]||(t[121]=m("Regex is supported. Replaced by ",-1)),n("code",null,d(e.site_options?.ANONYMIZATION_MASK)+"-[N]",1),t[122]||(t[122]=m(", or use ",-1)),t[123]||(t[123]=n("code",null,"term=>replacement",-1)),t[124]||(t[124]=m(" to pick your own (e.g. ",-1)),t[125]||(t[125]=n("code",null,"Anonymous=>ABC",-1)),t[126]||(t[126]=m(").",-1))])]),(a(!0),l(V,null,J((e.termHints||[]).slice(0,3),c=>(a(),l("div",{class:"term-hint",key:c.line},[n("span",null,[t[129]||(t[129]=m("In ",-1)),n("code",null,d(c.term),1),t[130]||(t[130]=m(", ",-1)),n("code",null,d(c.symbols.join(" ")),1),m(" "+d(c.symbols.length>1?"are regex symbols":"is a regex symbol")+", so it may not match the text as written.",1)]),n("button",{type:"button",class:"btn btn-outline-ink btn-sm",onClick:v=>e.matchTermAsWritten(c.line)},"Match as written",8,w8)]))),128)),(e.termHints||[]).length>3?(a(),l("div",k8,d(e.termHints.length-3)+" more "+d(e.termHints.length-3===1?"term uses":"terms use")+" regex symbols.",1)):p("v-if",!0),P(n("div",C8,"Terms are in an invalid format.",512),[[x,e.anonymize?.terms?.errors?.format]])]),P(n("div",S8,[n("div",E8,[t[133]||(t[133]=n("span",{class:"paper-field-label",id:"preserve-files-label"},"Unredacted files",-1)),n("span",N8,d(e.preserveSummary()),1)]),n("button",{type:"button",class:"btn btn-outline-ink btn-sm","aria-describedby":"preserve-files-label",disabled:!e.source?.commit,onClick:t[26]||(t[26]=c=>e.openPreserveFiles())},d((e.options?.preserveFiles||[]).length?"Edit":"Choose files"),9,R8)],512),[[x,e.detectedType==="repo"]]),e.preserve?.open?(a(),l("dialog",{key:0,id:"preserve-files-dialog",class:"preserve-dialog","aria-labelledby":"preserve-files-title",onCancel:t[31]||(t[31]=de(c=>e.closePreserveFiles(),["prevent"]))},[n("form",{onSubmit:t[30]||(t[30]=de(c=>e.savePreserveFiles(),["prevent"]))},[t[137]||(t[137]=n("h2",{id:"preserve-files-title"},"Leave files unredacted",-1)),t[138]||(t[138]=n("p",{class:"preserve-intro"},"Checked files are shown exactly as written, for example a bibliography where redacted self-citations would reveal you. File names are still redacted.",-1)),P(n("input",{type:"search",id:"preserve-files-search",class:"form-control",placeholder:"Search files","aria-label":"Search files",autocomplete:"off","onUpdate:modelValue":t[27]||(t[27]=c=>e.preserve.search=c)},null,512),[[nt,e.preserve.search]]),n("div",T8,[e.preserve.loading?(a(),l("p",P8,"Loading files from GitHub\u2026")):e.preserve.error?(a(),l("p",D8,d(e.preserve.error),1)):(a(),l(V,{key:2},[(a(!0),l(V,null,J(e.preserveRows(),(c,v)=>(a(),l("div",{class:"preserve-item",key:c.kind+":"+c.path,style:De({paddingLeft:c.depth*18+6+"px"})},[c.kind==="dir"?(a(),l("button",{key:0,type:"button",class:"preserve-caret","aria-expanded":c.open?"true":"false","aria-label":(c.open?"Collapse ":"Expand ")+c.label,onClick:h=>e.togglePreserveDir(c.path)},d(c.open?"\u25BE":"\u25B8"),9,A8)):(a(),l("span",I8)),n("input",{type:"checkbox",id:"pf-"+v,"aria-label":c.kind==="dir"?"Leave folder "+c.path+" unredacted":null,checked:c.state==="all",".indeterminate":c.state==="some",disabled:c.locked,onChange:h=>c.kind==="dir"?e.togglePreserveFolder(c.path):e.togglePreserveFile(c.path)},null,40,O8),n("label",{for:c.kind==="file"?"pf-"+v:null,class:"preserve-name",onClick:h=>c.kind==="dir"&&e.togglePreserveDir(c.path)},d(c.label),9,M8),c.note?(a(),l("span",V8,d(c.note),1)):p("v-if",!0)],4))),128)),!e.preserve.loading&&!e.preserveRows().length?(a(),l("p",L8,d(e.preserve.search?"No file matches your search.":"No text files in this commit."),1)):p("v-if",!0)],64))]),e.preserve.truncated?(a(),l("p",q8,"This repository has too many files to list them all. Use a pattern for files you cannot find.")):p("v-if",!0),n("details",{class:"preserve-patterns",open:e.preserve.patternsOpen},[t[134]||(t[134]=n("summary",null,"Patterns",-1)),P(n("textarea",{class:"form-control",rows:"3","aria-label":"Patterns",placeholder:`*.bib
|
||||
paper/appendix/**`,"onUpdate:modelValue":t[28]||(t[28]=c=>e.preserve.patterns=c)},null,512),[[nt,e.preserve.patterns]]),t[135]||(t[135]=n("small",{class:"form-text text-muted"},[m("One per line, as in .gitignore: "),n("code",null,"*.bib"),m(" matches in any folder; "),n("code",null,"/refs.bib"),m(" and "),n("code",null,"paper/refs.bib"),m(" match from the repository root; a folder name such as "),n("code",null,"drafts/"),m(" covers everything inside it; "),n("code",null,"!private.bib"),m(" excludes again.")],-1))],8,$8),n("div",F8,[n("span",_8,d(e.preserve.loading||e.preserve.error?"":e.preserveCount()+(e.preserveCount()===1?" file":" files")+" will be shown as written"),1),n("span",U8,[n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[29]||(t[29]=c=>e.closePreserveFiles())},"Cancel"),t[136]||(t[136]=n("button",{type:"submit",class:"btn btn-ink"},"Save",-1))])])],32)],32)):p("v-if",!0)],512),[[x,e.detectedType&&e.sourceReady()]]),P(n("section",B8,[t[159]||(t[159]=n("h2",{class:"paper-section-eyebrow"},"Display",-1)),P(n("div",null,[n("div",z8,[P(n("input",H8,null,512),[[u,{state:e.viewState,set:c=>{e.options.link=c},value:e.options?.link,form:"anonymize",options:{}}]]),t[140]||(t[140]=n("label",{class:"form-check-label",for:"link"},"Keep links",-1))]),n("div",j8,[P(n("input",G8,null,512),[[u,{state:e.viewState,set:c=>{e.options.image=c},value:e.options?.image,form:"anonymize",options:{}}]]),t[141]||(t[141]=n("label",{class:"form-check-label",for:"image"},"Display images",-1))]),n("div",W8,[P(n("input",K8,null,512),[[u,{state:e.viewState,set:c=>{e.options.pdf=c},value:e.options?.pdf,form:"anonymize",options:{}}]]),t[142]||(t[142]=n("label",{class:"form-check-label",for:"pdf"},"Display PDFs",-1))]),n("div",Y8,[P(n("input",J8,null,512),[[u,{state:e.viewState,set:c=>{e.options.notebook=c},value:e.options?.notebook,form:"anonymize",options:{}}]]),t[143]||(t[143]=n("label",{class:"form-check-label",for:"notebook"},"Display notebooks",-1))]),n("div",X8,[P(n("input",{class:"form-check-input",type:"checkbox",id:"page",name:"page",disabled:!e.details?.hasPage||e.details?.pageSource&&e.details?.pageSource?.branch!==e.source?.branch},null,8,Q8),[[u,{state:e.viewState,set:c=>{e.options.page=c},value:e.options?.page,form:"anonymize",options:{}}]]),t[144]||(t[144]=n("label",{class:"form-check-label",for:"page"},"GitHub Pages",-1)),e.details?.hasPage?p("v-if",!0):(a(),l("small",Z8,d(e.fmt?.translate("WARNINGS.page_not_enabled_on_repo")),1)),e.details?.hasPage&&e.details?.pageSource?.branch&&e.source?.branch&&e.details.pageSource.branch!==e.source.branch?(a(),l("small",x8,d(e.fmt?.translate("WARNINGS.page_branch_mismatch",{pageBranch:e.details?.pageSource?.branch,selectedBranch:e.source?.branch})),1)):p("v-if",!0)])],512),[[x,e.detectedType==="repo"]]),e.detectedType==="repo"&&(e.options.image||e.options.pdf)?(a(),l("p",e6,[...t[145]||(t[145]=[m("Images and PDFs are served unchanged. Review their contents and metadata before sharing. ",-1),n("a",{href:"/faq#formats"},"Supported formats",-1)])])):p("v-if",!0),P(n("div",null,[n("div",t6,[P(n("input",n6,null,512),[[u,{state:e.viewState,set:c=>{e.options.title=c},value:e.options?.title,form:"anonymize",options:{}}]]),t[146]||(t[146]=n("label",{class:"form-check-label",for:"title-gist"},"Gist description",-1))]),n("div",o6,[P(n("input",s6,null,512),[[u,{state:e.viewState,set:c=>{e.options.content=c},value:e.options?.content,form:"anonymize",options:{}}]]),t[147]||(t[147]=n("label",{class:"form-check-label",for:"content-gist"},"File contents",-1))]),n("div",i6,[P(n("input",r6,null,512),[[u,{state:e.viewState,set:c=>{e.options.comments=c},value:e.options?.comments,form:"anonymize",options:{}}]]),t[148]||(t[148]=n("label",{class:"form-check-label",for:"comments-gist"},"Comments",-1))]),n("div",a6,[P(n("input",l6,null,512),[[u,{state:e.viewState,set:c=>{e.options.username=c},value:e.options?.username,form:"anonymize",options:{}}]]),t[149]||(t[149]=n("label",{class:"form-check-label",for:"username-gist"},"Usernames",-1))]),n("div",d6,[P(n("input",u6,null,512),[[u,{state:e.viewState,set:c=>{e.options.date=c},value:e.options?.date,form:"anonymize",options:{}}]]),t[150]||(t[150]=n("label",{class:"form-check-label",for:"date-gist"},"Dates",-1))]),n("div",c6,[P(n("input",p6,null,512),[[u,{state:e.viewState,set:c=>{e.options.origin=c},value:e.options?.origin,form:"anonymize",options:{}}]]),t[151]||(t[151]=n("label",{class:"form-check-label",for:"origin-gist"},"Source gist ID",-1))])],512),[[x,e.detectedType==="gist"]]),P(n("div",null,[n("div",f6,[P(n("input",m6,null,512),[[u,{state:e.viewState,set:c=>{e.options.title=c},value:e.options?.title,form:"anonymize",options:{}}]]),t[152]||(t[152]=n("label",{class:"form-check-label",for:"title"},"PR title",-1))]),n("div",h6,[P(n("input",g6,null,512),[[u,{state:e.viewState,set:c=>{e.options.body=c},value:e.options?.body,form:"anonymize",options:{}}]]),t[153]||(t[153]=n("label",{class:"form-check-label",for:"body"},"PR body",-1))]),n(
Line truncated
|
||||
for the rows when a reload (tab, search, filter) has none of the new rows yet `),(a(),l(V,null,J([1,2,3,4],(r,u)=>(a(),l(V,null,[e.loading||e.refreshing&&e.filteredItems?.length==0?(a(),l("div",U7,[...t[63]||(t[63]=[n("div",{class:"cell-anon",role:"cell"},[n("span",{class:"skeleton skeleton-badge"}),n("div",{class:"anon-text"},[n("span",{class:"skeleton skeleton-line",style:{width:"38%"}}),n("span",{class:"skeleton skeleton-line skeleton-line-sm",style:{width:"56%"}})])],-1),n("div",{class:"cell-status",role:"cell"},[n("span",{class:"skeleton skeleton-line",style:{width:"60%"}})],-1),n("div",{class:"cell-views num",role:"cell"},[n("span",{class:"skeleton skeleton-line",style:{width:"40%"}})],-1),n("div",{class:"cell-expires",role:"cell"},[n("span",{class:"skeleton skeleton-line",style:{width:"55%"}})],-1),n("div",{class:"cell-actions",role:"cell"},null,-1)])])):p("v-if",!0)],64))),64)),(a(!0),l(V,null,J(e.filteredItems,(r,u)=>(a(),l(V,{key:r?._type+":"+(r?._id||u)},[e.loading?p("v-if",!0):(a(),l("div",{key:0,class:R(["paper-table-row",{"repo-inactive":r?._statusKey=="expired"||r?._statusKey=="removed","repo-error":r?.status=="error","row-clickable":!!r?._viewUrl}]),role:"row",onClick:f=>e.openItem(r,f)},[n("div",z7,[n("span",{class:"project-type-icon",role:"img","aria-label":r?._type==="repo"?"Repository":r?._type==="pr"?"Pull request":"Gist",title:r?._type==="repo"?"Repository":r?._type==="pr"?"Pull request":"Gist"},[(a(),l("svg",j7,[n("use",{href:"#project-type-"+r._type},null,8,G7)]))],8,H7),n("div",W7,[n("div",K7,[r?._viewUrl?(a(),l("a",{key:0,class:"repo-name",title:r._label,href:e.safeUrl(r?._viewUrl)},[(r?._label||"").indexOf("/")>0?(a(),l(V,{key:0},[n("span",J7,d(r._label.slice(0,r._label.indexOf("/")+1)),1),t[64]||(t[64]=n("wbr",null,null,-1)),n("span",X7,d(r._label.slice(r._label.indexOf("/")+1)),1)],64)):(a(),l(V,{key:1},[m(d(r?._label),1)],64))],8,Y7)):p("v-if",!0),r?._viewUrl?p("v-if",!0):(a(),l("span",Q7,[(r?._label||"").indexOf("/")>0?(a(),l(V,{key:0},[n("span",Z7,d(r._label.slice(0,r._label.indexOf("/")+1)),1),t[65]||(t[65]=n("wbr",null,null,-1)),n("span",x7,d(r._label.slice(r._label.indexOf("/")+1)),1)],64)):(a(),l(V,{key:1},[m(d(r?._label),1)],64))])),r?.role==="coauthor"?(a(),l("span",eU,"Co-author")):p("v-if",!0)]),r?._id||r?._type==="repo"&&r?.source?.commit||r?.conference?(a(),l("div",tU,[r?._id?(a(),l("code",{key:0,class:"anonymous-id",title:r._id},[r._id.length>14?(a(),l(V,{key:0},[n("span",oU,d(r._id.slice(0,-6)),1),n("span",sU,d(r._id.slice(-6)),1)],64)):(a(),l(V,{key:1},[m(d(r._id),1)],64))],8,nU)):p("v-if",!0),r?._type==="repo"&&r?.source?.commit?(a(),l("span",{key:1,class:"commit-hash",title:r.source.commit},d(r.source.commit.substring(0,7)),9,iU)):p("v-if",!0),r?.conference?(a(),l("span",{key:2,class:"cell-conf conf-tag",title:"Conference: "+r.conference},[t[66]||(t[66]=n("svg",{class:"project-type-svg","aria-hidden":"true"},[n("use",{href:"#project-icon-conference"})],-1)),n("span",{class:"conf-name",textContent:d(r?.conference)},null,8,aU)],8,rU)):p("v-if",!0)])):p("v-if",!0)])]),n("div",lU,[n("div",dU,[n("div",uU,[n("span",{class:R(["status-dot","status-"+r?._statusKey]),"aria-hidden":"true"},null,2),n("span",{class:"status-word",textContent:d(e.fmt?.statusLabel(r?.status))},null,8,cU),r?.status=="removed"?(a(),l(V,{key:0},[t[67]||(t[67]=n("span",{class:"seg-sep status-removed-sep","aria-hidden":"true"},"\xB7",-1)),n("button",{type:"button",class:"project-attention-action status-enable",onClick:de(f=>e.refreshItem(r),["stop"]),title:"Reviewers can no longer open this link"},"Enable again",8,pU)],64)):p("v-if",!0)]),r?.status=="error"&&r?.statusMessage?(a(),l("div",{key:0,class:"status-sub status-sub-error",textContent:d(e.fmt?.statusMsg(r?.statusMessage)),title:r?.statusMessage},null,8,fU)):p("v-if",!0),r?._stale?(a(),l("div",{key:1,class:"status-sub status-sub-warn",title:"Last activity "+e.fmt?.humanTime(r?.anonymizeDate||r?.lastView)},d(e.idleText(r)),9,mU)):p("v-if",!0),r.status==="error"&&r._editUrl?(a(),l("a",{key:2,class:"project-attention-action",href:e.safeUrl(r._editUrl)},"Fix source",8,hU)):p("v-if",!0),r._stale||r._broken?(a(),l("div",gU,[r._stale&&!r._broken?(a(),l("span",vU,[...t[68]||(t[68]=[m("May be stuck",-1),n("span",{"aria-hidden":"true"}," \xB7 ",-1)])])):p("v-if",!0),r._stale||r._broken?(a(),l("button",{key:1,type:"button",class:"project-attention-action",onClick:de(f=>e.showProjectDetails(r),["stop"]),"data-project-actions":r._broken?encodeURIComponent(r._type+":"+r._id):null,"aria-controls":r._broken?e.projectDetailsId(r):null,"aria-expanded":r._broken?e.selectedProject===r:null},d(r._broken?"Review details":"Check progress"),9,yU)):p("v-if",!0)])):p("v-if",!0),r?.status=="expired"?(a(),l("button",{key:4,type:"button",class:"project-attention-action",onClick:de(f=>e.extendItem(r),["stop"]),title:"Reviewers can no longer open this link"},"Extend 6 months",8,bU)):p("v-if",!0),r?.status=="removed"&&r?.anonymizeDate?(a(),l("div",wU,"anonymized
Line truncated
|
||||
anonymous_github`)])])])])]),p(" Limitations "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-warning"})]),m("Limitations ")]),n("div",{class:"panel-group",id:"faq-limitations",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingLimitation"},[n("h3",{class:"panel-title"},[n("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? ")])]),n("div",{id:"limitation",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingLimitation"},[n("div",{class:"panel-body p-3"},[n("ul",null,[n("li",null," Anonymous GitHub only anonymizes text-based files. Binary files (compiled executables, archives, etc.) are served as-is without anonymization. "),n("li",null," Files larger than 8 MB are not supported. "),n("li",null," Static site generators (such as Jekyll) used with GitHub Pages are not fully supported, although Markdown files are converted to HTML. "),n("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 and security "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-shield"})]),m("Privacy and security ")]),n("div",{class:"panel-group",id:"faq-privacy",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingData"},[n("h3",{class:"panel-title"},[n("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? ")])]),n("div",{id:"data",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingData"},[n("div",{class:"panel-body p-3"},[n("p",null," Repository data is used to provide the anonymization service. If you purchase a plan, Stripe processes payment and billing information. When a repository is removed or expires, only its configuration is retained. This makes it easy to restore the repository if needed and ensures that no future repository reuses the same ID. ")])])]),n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingPermissions"},[n("h3",{class:"panel-title"},[n("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? ")])]),n("div",{id:"permissions",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingPermissions"},[n("div",{class:"panel-body p-3"},[n("p",null,[m("The GitHub App has read-only access to the repositories you choose. You can change repository access on your "),n("a",{href:"/connections"},"GitHub connections"),m(" page.")]),n("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."),n("p",null,"Anonymous GitHub reads repository content. It never pushes, modifies, or deletes files on GitHub.")])])]),n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingViewer"},[n("h3",{class:"panel-title"},[n("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? ")])]),n("div",{id:"viewer",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingViewer"},[n("div",{class:"panel-body p-3"},[n("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 "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#project-icon-storage"})]),m("Self"),n("span",{class:"serif-hy"},"-"),m("hosting ")]),n("div",{class:"panel-group",id:"faq-hosting",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingDeploy"},[n("h3",{class:"panel-title"},[n("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? ")])]),n("div",{id:"deploy",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingDeploy"},[n("div",{cla
Line truncated
|
||||
jane.smith@example.org`},null,10,j5),[[u,{state:e.viewState,set:c=>{e.terms=c},value:e.terms,form:"anonymize",options:{debounce:250}}]]),t[132]||(t[132]=n("small",{class:"form-text text-muted"},"One term per line.",-1)),n("details",G5,[t[127]||(t[127]=n("summary",null,"Regex & replacement syntax",-1)),t[128]||(t[128]=m()),n("small",W5,[t[121]||(t[121]=m("Regex is supported. Replaced by ",-1)),n("code",null,d(e.site_options?.ANONYMIZATION_MASK)+"-[N]",1),t[122]||(t[122]=m(", or use ",-1)),t[123]||(t[123]=n("code",null,"term=>replacement",-1)),t[124]||(t[124]=m(" to pick your own (e.g. ",-1)),t[125]||(t[125]=n("code",null,"Anonymous=>ABC",-1)),t[126]||(t[126]=m(").",-1))])]),(a(!0),l(O,null,G((e.termHints||[]).slice(0,3),c=>(a(),l("div",{class:"term-hint",key:c.line},[n("span",null,[t[129]||(t[129]=m("In ",-1)),n("code",null,d(c.term),1),t[130]||(t[130]=m(", ",-1)),n("code",null,d(c.symbols.join(" ")),1),m(" "+d(c.symbols.length>1?"are regex symbols":"is a regex symbol")+", so it may not match the text as written.",1)]),n("button",{type:"button",class:"btn btn-outline-ink btn-sm",onClick:v=>e.matchTermAsWritten(c.line)},"Match as written",8,K5)]))),128)),(e.termHints||[]).length>3?(a(),l("div",Y5,d(e.termHints.length-3)+" more "+d(e.termHints.length-3===1?"term uses":"terms use")+" regex symbols.",1)):f("v-if",!0),I(n("div",X5,"Terms are in an invalid format.",512),[[Q,e.anonymize?.terms?.errors?.format]])]),I(n("div",Q5,[n("div",J5,[t[133]||(t[133]=n("span",{class:"paper-field-label",id:"preserve-files-label"},"Unredacted files",-1)),n("span",Z5,d(e.preserveSummary()),1)]),n("button",{type:"button",class:"btn btn-outline-ink btn-sm","aria-describedby":"preserve-files-label",disabled:!e.source?.commit,onClick:t[26]||(t[26]=c=>e.openPreserveFiles())},d((e.options?.preserveFiles||[]).length?"Edit":"Choose files"),9,x5)],512),[[Q,e.detectedType==="repo"]]),e.preserve?.open?(a(),l("dialog",{key:0,id:"preserve-files-dialog",class:"preserve-dialog","aria-labelledby":"preserve-files-title",onCancel:t[31]||(t[31]=le(c=>e.closePreserveFiles(),["prevent"]))},[n("form",{onSubmit:t[30]||(t[30]=le(c=>e.savePreserveFiles(),["prevent"]))},[t[137]||(t[137]=n("h2",{id:"preserve-files-title"},"Leave files unredacted",-1)),t[138]||(t[138]=n("p",{class:"preserve-intro"},"Checked files are shown exactly as written, for example a bibliography where redacted self-citations would reveal you. File names are still redacted.",-1)),I(n("input",{type:"search",id:"preserve-files-search",class:"form-control",placeholder:"Search files","aria-label":"Search files",autocomplete:"off","onUpdate:modelValue":t[27]||(t[27]=c=>e.preserve.search=c)},null,512),[[st,e.preserve.search]]),n("div",e8,[e.preserve.loading?(a(),l("p",t8,"Loading files from GitHub\u2026")):e.preserve.error?(a(),l("p",n8,d(e.preserve.error),1)):(a(),l(O,{key:2},[(a(!0),l(O,null,G(e.preserveRows(),(c,v)=>(a(),l("div",{class:"preserve-item",key:c.kind+":"+c.path,style:Pe({paddingLeft:c.depth*18+6+"px"})},[c.kind==="dir"?(a(),l("button",{key:0,type:"button",class:"preserve-caret","aria-expanded":c.open?"true":"false","aria-label":(c.open?"Collapse ":"Expand ")+c.label,onClick:h=>e.togglePreserveDir(c.path)},d(c.open?"\u25BE":"\u25B8"),9,s8)):(a(),l("span",o8)),n("input",{type:"checkbox",id:"pf-"+v,"aria-label":c.kind==="dir"?"Leave folder "+c.path+" unredacted":null,checked:c.state==="all",".indeterminate":c.state==="some",disabled:c.locked,onChange:h=>c.kind==="dir"?e.togglePreserveFolder(c.path):e.togglePreserveFile(c.path)},null,40,i8),n("label",{for:c.kind==="file"?"pf-"+v:null,class:"preserve-name",onClick:h=>c.kind==="dir"&&e.togglePreserveDir(c.path)},d(c.label),9,r8),c.note?(a(),l("span",a8,d(c.note),1)):f("v-if",!0)],4))),128)),!e.preserve.loading&&!e.preserveRows().length?(a(),l("p",l8,d(e.preserve.search?"No file matches your search.":"No text files in this commit."),1)):f("v-if",!0)],64))]),e.preserve.truncated?(a(),l("p",d8,"This repository has too many files to list them all. Use a pattern for files you cannot find.")):f("v-if",!0),n("details",{class:"preserve-patterns",open:e.preserve.patternsOpen},[t[134]||(t[134]=n("summary",null,"Patterns",-1)),I(n("textarea",{class:"form-control",rows:"3","aria-label":"Patterns",placeholder:`*.bib
|
||||
paper/appendix/**`,"onUpdate:modelValue":t[28]||(t[28]=c=>e.preserve.patterns=c)},null,512),[[st,e.preserve.patterns]]),t[135]||(t[135]=n("small",{class:"form-text text-muted"},[m("One per line, as in .gitignore: "),n("code",null,"*.bib"),m(" matches in any folder; "),n("code",null,"/refs.bib"),m(" and "),n("code",null,"paper/refs.bib"),m(" match from the repository root; a folder name such as "),n("code",null,"drafts/"),m(" covers everything inside it; "),n("code",null,"!private.bib"),m(" excludes again.")],-1))],8,u8),n("div",c8,[n("span",p8,d(e.preserve.loading||e.preserve.error?"":e.preserveCount()+(e.preserveCount()===1?" file":" files")+" will be shown as written"),1),n("span",f8,[n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[29]||(t[29]=c=>e.closePreserveFiles())},"Cancel"),t[136]||(t[136]=n("button",{type:"submit",class:"btn btn-ink"},"Save",-1))])])],32)],32)):f("v-if",!0)],512),[[Q,e.detectedType&&e.sourceReady()]]),I(n("section",m8,[t[159]||(t[159]=n("h2",{class:"paper-section-eyebrow"},"Display",-1)),I(n("div",null,[n("div",h8,[I(n("input",g8,null,512),[[u,{state:e.viewState,set:c=>{e.options.link=c},value:e.options?.link,form:"anonymize",options:{}}]]),t[140]||(t[140]=n("label",{class:"form-check-label",for:"link"},"Keep links",-1))]),n("div",v8,[I(n("input",y8,null,512),[[u,{state:e.viewState,set:c=>{e.options.image=c},value:e.options?.image,form:"anonymize",options:{}}]]),t[141]||(t[141]=n("label",{class:"form-check-label",for:"image"},"Display images",-1))]),n("div",b8,[I(n("input",w8,null,512),[[u,{state:e.viewState,set:c=>{e.options.pdf=c},value:e.options?.pdf,form:"anonymize",options:{}}]]),t[142]||(t[142]=n("label",{class:"form-check-label",for:"pdf"},"Display PDFs",-1))]),n("div",k8,[I(n("input",C8,null,512),[[u,{state:e.viewState,set:c=>{e.options.notebook=c},value:e.options?.notebook,form:"anonymize",options:{}}]]),t[143]||(t[143]=n("label",{class:"form-check-label",for:"notebook"},"Display notebooks",-1))]),n("div",E8,[I(n("input",{class:"form-check-input",type:"checkbox",id:"page",name:"page",disabled:!e.details?.hasPage||e.details?.pageSource&&e.details?.pageSource?.branch!==e.source?.branch},null,8,S8),[[u,{state:e.viewState,set:c=>{e.options.page=c},value:e.options?.page,form:"anonymize",options:{}}]]),t[144]||(t[144]=n("label",{class:"form-check-label",for:"page"},"GitHub Pages",-1)),e.details?.hasPage?f("v-if",!0):(a(),l("small",N8,d(e.fmt?.translate("WARNINGS.page_not_enabled_on_repo")),1)),e.details?.hasPage&&e.details?.pageSource?.branch&&e.source?.branch&&e.details.pageSource.branch!==e.source.branch?(a(),l("small",R8,d(e.fmt?.translate("WARNINGS.page_branch_mismatch",{pageBranch:e.details?.pageSource?.branch,selectedBranch:e.source?.branch})),1)):f("v-if",!0)])],512),[[Q,e.detectedType==="repo"]]),e.detectedType==="repo"&&(e.options.image||e.options.pdf)?(a(),l("p",P8,[...t[145]||(t[145]=[m("Images and PDFs are served unchanged. Review their contents and metadata before sharing. ",-1),n("a",{href:"/faq#formats"},"Supported formats",-1)])])):f("v-if",!0),I(n("div",null,[n("div",D8,[I(n("input",T8,null,512),[[u,{state:e.viewState,set:c=>{e.options.title=c},value:e.options?.title,form:"anonymize",options:{}}]]),t[146]||(t[146]=n("label",{class:"form-check-label",for:"title-gist"},"Gist description",-1))]),n("div",I8,[I(n("input",A8,null,512),[[u,{state:e.viewState,set:c=>{e.options.content=c},value:e.options?.content,form:"anonymize",options:{}}]]),t[147]||(t[147]=n("label",{class:"form-check-label",for:"content-gist"},"File contents",-1))]),n("div",O8,[I(n("input",M8,null,512),[[u,{state:e.viewState,set:c=>{e.options.comments=c},value:e.options?.comments,form:"anonymize",options:{}}]]),t[148]||(t[148]=n("label",{class:"form-check-label",for:"comments-gist"},"Comments",-1))]),n("div",V8,[I(n("input",q8,null,512),[[u,{state:e.viewState,set:c=>{e.options.username=c},value:e.options?.username,form:"anonymize",options:{}}]]),t[149]||(t[149]=n("label",{class:"form-check-label",for:"username-gist"},"Usernames",-1))]),n("div",L8,[I(n("input",F8,null,512),[[u,{state:e.viewState,set:c=>{e.options.date=c},value:e.options?.date,form:"anonymize",options:{}}]]),t[150]||(t[150]=n("label",{class:"form-check-label",for:"date-gist"},"Dates",-1))]),n("div",$8,[I(n("input",U8,null,512),[[u,{state:e.viewState,set:c=>{e.options.origin=c},value:e.options?.origin,form:"anonymize",options:{}}]]),t[151]||(t[151]=n("label",{class:"form-check-label",for:"origin-gist"},"Source gist ID",-1))])],512),[[Q,e.detectedType==="gist"]]),I(n("div",null,[n("div",B8,[I(n("input",_8,null,512),[[u,{state:e.viewState,set:c=>{e.options.title=c},value:e.options?.title,form:"anonymize",options:{}}]]),t[152]||(t[152]=n("label",{class:"form-check-label",for:"title"},"PR title",-1))]),n("div",H8,[I(n("input",z8,null,512),[[u,{state:e.viewState,set:c=>{e.options.body=c},value:e.options?.body,form:"anonymize",options:{}}]]),t[153]||(t[153]=n("label",{class:"form-check-label",for:"body"},"PR body",-1))]),n(
Line truncated
|
||||
for the rows when a reload (tab, search, filter) has none of the new rows yet `),(a(),l(O,null,G([1,2,3,4],(o,u)=>(a(),l(O,null,[e.loading||e.refreshing&&e.filteredItems?.length==0?(a(),l("div",f7,[...t[63]||(t[63]=[n("div",{class:"cell-anon",role:"cell"},[n("span",{class:"skeleton skeleton-badge"}),n("div",{class:"anon-text"},[n("span",{class:"skeleton skeleton-line",style:{width:"38%"}}),n("span",{class:"skeleton skeleton-line skeleton-line-sm",style:{width:"56%"}})])],-1),n("div",{class:"cell-status",role:"cell"},[n("span",{class:"skeleton skeleton-line",style:{width:"60%"}})],-1),n("div",{class:"cell-views num",role:"cell"},[n("span",{class:"skeleton skeleton-line",style:{width:"40%"}})],-1),n("div",{class:"cell-expires",role:"cell"},[n("span",{class:"skeleton skeleton-line",style:{width:"55%"}})],-1),n("div",{class:"cell-actions",role:"cell"},null,-1)])])):f("v-if",!0)],64))),64)),(a(!0),l(O,null,G(e.filteredItems,(o,u)=>(a(),l(O,{key:o?._type+":"+(o?._id||u)},[e.loading?f("v-if",!0):(a(),l("div",{key:0,class:R(["paper-table-row",{"repo-inactive":o?._statusKey=="expired"||o?._statusKey=="removed","repo-error":o?.status=="error","row-clickable":!!o?._viewUrl}]),role:"row",onClick:p=>e.openItem(o,p)},[n("div",h7,[n("span",{class:"project-type-icon",role:"img","aria-label":o?._type==="repo"?"Repository":o?._type==="pr"?"Pull request":"Gist",title:o?._type==="repo"?"Repository":o?._type==="pr"?"Pull request":"Gist"},[(a(),l("svg",v7,[n("use",{href:"#project-type-"+o._type},null,8,y7)]))],8,g7),n("div",b7,[n("div",w7,[o?._viewUrl?(a(),l("a",{key:0,class:"repo-name",title:o._label,href:e.safeUrl(o?._viewUrl)},[(o?._label||"").indexOf("/")>0?(a(),l(O,{key:0},[n("span",C7,d(o._label.slice(0,o._label.indexOf("/")+1)),1),t[64]||(t[64]=n("wbr",null,null,-1)),n("span",E7,d(o._label.slice(o._label.indexOf("/")+1)),1)],64)):(a(),l(O,{key:1},[m(d(o?._label),1)],64))],8,k7)):f("v-if",!0),o?._viewUrl?f("v-if",!0):(a(),l("span",S7,[(o?._label||"").indexOf("/")>0?(a(),l(O,{key:0},[n("span",N7,d(o._label.slice(0,o._label.indexOf("/")+1)),1),t[65]||(t[65]=n("wbr",null,null,-1)),n("span",R7,d(o._label.slice(o._label.indexOf("/")+1)),1)],64)):(a(),l(O,{key:1},[m(d(o?._label),1)],64))])),o?.role==="coauthor"?(a(),l("span",P7,"Co-author")):f("v-if",!0)]),o?._id||o?._type==="repo"&&o?.source?.commit||o?.conference?(a(),l("div",D7,[o?._id?(a(),l("code",{key:0,class:"anonymous-id",title:o._id},[o._id.length>14?(a(),l(O,{key:0},[n("span",I7,d(o._id.slice(0,-6)),1),n("span",A7,d(o._id.slice(-6)),1)],64)):(a(),l(O,{key:1},[m(d(o._id),1)],64))],8,T7)):f("v-if",!0),o?._type==="repo"&&o?.source?.commit?(a(),l("span",{key:1,class:"commit-hash",title:o.source.commit},d(o.source.commit.substring(0,7)),9,O7)):f("v-if",!0),o?.conference?(a(),l("span",{key:2,class:"cell-conf conf-tag",title:"Conference: "+o.conference},[t[66]||(t[66]=n("svg",{class:"project-type-svg","aria-hidden":"true"},[n("use",{href:"#project-icon-conference"})],-1)),n("span",{class:"conf-name",textContent:d(o?.conference)},null,8,V7)],8,M7)):f("v-if",!0)])):f("v-if",!0)])]),n("div",q7,[n("div",L7,[n("div",F7,[n("span",{class:R(["status-dot","status-"+o?._statusKey]),"aria-hidden":"true"},null,2),n("span",{class:"status-word",textContent:d(e.fmt?.statusLabel(o?.status))},null,8,$7),o?.status=="removed"?(a(),l(O,{key:0},[t[67]||(t[67]=n("span",{class:"seg-sep status-removed-sep","aria-hidden":"true"},"\xB7",-1)),n("button",{type:"button",class:"project-attention-action status-enable",onClick:le(p=>e.refreshItem(o),["stop"]),title:"Reviewers can no longer open this link"},"Enable again",8,U7)],64)):f("v-if",!0)]),o?.status=="error"&&o?.statusMessage?(a(),l("div",{key:0,class:"status-sub status-sub-error",textContent:d(e.fmt?.statusMsg(o?.statusMessage)),title:o?.statusMessage},null,8,B7)):f("v-if",!0),o?._stale?(a(),l("div",{key:1,class:"status-sub status-sub-warn",title:"Last activity "+e.fmt?.humanTime(o?.anonymizeDate||o?.lastView)},d(e.idleText(o)),9,_7)):f("v-if",!0),o.status==="error"&&o._editUrl?(a(),l("a",{key:2,class:"project-attention-action",href:e.safeUrl(o._editUrl)},"Fix source",8,H7)):f("v-if",!0),o._stale||o._broken?(a(),l("div",z7,[o._stale&&!o._broken?(a(),l("span",j7,[...t[68]||(t[68]=[m("May be stuck",-1),n("span",{"aria-hidden":"true"}," \xB7 ",-1)])])):f("v-if",!0),o._stale||o._broken?(a(),l("button",{key:1,type:"button",class:"project-attention-action",onClick:le(p=>e.showProjectDetails(o),["stop"]),"data-project-actions":o._broken?encodeURIComponent(o._type+":"+o._id):null,"aria-controls":o._broken?e.projectDetailsId(o):null,"aria-expanded":o._broken?e.selectedProject===o:null},d(o._broken?"Review details":"Check progress"),9,G7)):f("v-if",!0)])):f("v-if",!0),o?.status=="expired"?(a(),l("button",{key:4,type:"button",class:"project-attention-action",onClick:le(p=>e.extendItem(o),["stop"]),title:"Reviewers can no longer open this link"},"Extend 6 months",8,W7)):f("v-if",!0),o?.status=="removed"&&o?.anonymizeDate?(a(),l("div",K7,"anonymized
Line truncated
|
||||
anonymous_github`)])])])])]),f(" Limitations "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-warning"})]),m("Limitations ")]),n("div",{class:"panel-group",id:"faq-limitations",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingLimitation"},[n("h3",{class:"panel-title"},[n("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? ")])]),n("div",{id:"limitation",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingLimitation"},[n("div",{class:"panel-body p-3"},[n("ul",null,[n("li",null," Anonymous GitHub only anonymizes text-based files. Binary files (compiled executables, archives, etc.) are served as-is without anonymization. "),n("li",null," Files larger than 8 MB are not supported. "),n("li",null," Static site generators (such as Jekyll) used with GitHub Pages are not fully supported, although Markdown files are converted to HTML. "),n("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 and security "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-shield"})]),m("Privacy and security ")]),n("div",{class:"panel-group",id:"faq-privacy",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingData"},[n("h3",{class:"panel-title"},[n("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? ")])]),n("div",{id:"data",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingData"},[n("div",{class:"panel-body p-3"},[n("p",null," Repository data is used to provide the anonymization service. If you purchase a plan, Stripe processes payment and billing information. When a repository is removed or expires, only its configuration is retained. This makes it easy to restore the repository if needed and ensures that no future repository reuses the same ID. ")])])]),n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingPermissions"},[n("h3",{class:"panel-title"},[n("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? ")])]),n("div",{id:"permissions",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingPermissions"},[n("div",{class:"panel-body p-3"},[n("p",null,[m("The GitHub App has read-only access to the repositories you choose. You can change repository access on your "),n("a",{href:"/connections"},"GitHub connections"),m(" page.")]),n("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."),n("p",null,"Anonymous GitHub reads repository content. It never pushes, modifies, or deletes files on GitHub.")])])]),n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingViewer"},[n("h3",{class:"panel-title"},[n("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? ")])]),n("div",{id:"viewer",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingViewer"},[n("div",{class:"panel-body p-3"},[n("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 "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#project-icon-storage"})]),m("Self"),n("span",{class:"serif-hy"},"-"),m("hosting ")]),n("div",{class:"panel-group",id:"faq-hosting",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingDeploy"},[n("h3",{class:"panel-title"},[n("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? ")])]),n("div",{id:"deploy",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingDeploy"},[n("div",{cla
Line truncated
|
||||
anonymized repository often think it is about the paper, so the
|
||||
label names the service and the tooltip says who to contact. `),n("li",{class:R(["nav-item nav-extra-item d-none d-lg-block",{"in-user-menu":!!e.user?.username}])},[...t[19]||(t[19]=[n("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"},[n("svg",{class:"ui-icon d-lg-none mr-1","aria-hidden":"true"},[n("use",{href:"#ui-icon-bug"})]),m("Report a bug ")],-1)])],2),n("li",{class:R(["nav-item nav-support-item nav-extra-item d-none d-lg-block",{"in-user-menu":!!e.user?.username}])},[...t[20]||(t[20]=[n("a",{class:"nav-link nav-support-inline",href:"https://ko-fi.com/tdurieux",target:"_blank",rel:"noopener",title:"Donate on Ko-fi to help cover hosting costs"},[n("svg",{class:"ui-icon nav-heart","aria-hidden":"true"},[n("use",{href:"#ui-icon-heart"})]),m("Support ")],-1)])],2),e.isDarkMode?p("v-if",!0):(a(),l("li",Vz,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to dark mode","aria-label":"Switch to dark mode",onClick:t[1]||(t[1]=s=>{e.darkMode(!0)})},[...t[21]||(t[21]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(a(),l("li",Lz,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to light mode","aria-label":"Switch to light mode",onClick:t[2]||(t[2]=s=>{e.darkMode(!1)})},[...t[22]||(t[22]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sun"})],-1)])])])):p("v-if",!0),!e.user&&!e.isReviewerRoute?(a(),l("li",qz,[...t[23]||(t[23]=[n("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[n("i",{class:"fab fa-github mr-1"}),m(" Sign in ")],-1)])])):p("v-if",!0),e.user?.username&&e.headerCanUpgrade&&!e.headerBillingPending?(a(),l("li",$z,[n("a",{class:"nav-link nav-upgrade",href:"/profile?upgrade=1",onClick:t[3]||(t[3]=de(s=>e.openHeaderUpgrade(),["prevent"]))},"Upgrade")])):p("v-if",!0),e.user?(a(),l("li",Fz,[n("a",_z,[e.user?.photo?(a(),l("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,Uz)):p("v-if",!0),n("span",Bz,d(e.user?.username),1)]),n("div",zz,[n("h6",Hz,"Signed in as @"+d(e.user?.username),1),t[25]||(t[25]=Ce('<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 um-extra" 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>',6)),e.headerShowSupport?(a(),l("a",jz,[...t[24]||(t[24]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-heart"})],-1),n("span",null,"Support the project",-1)])])):p("v-if",!0),t[26]||(t[26]=n("div",{class:"dropdown-divider"},null,-1)),t[27]||(t[27]=n("a",{class:"dropdown-item",href:"/api/user/logout",target:"_self"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-logout"})]),n("span",null,"Sign out")],-1))])])):p("v-if",!0)])])],2),e.generalMessage?(a(),l("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,Gz)):p("v-if",!0),e.emailPromptOpen?(a(),l("dialog",{key:1,id:"email-prompt",class:"email-prompt","aria-labelledby":"email-prompt-title","aria-describedby":"email-prompt-reason",onCancel:t[8]||(t[8]=de(s=>e.respondToEmailPrompt("later"),["prevent"]))},[n("form",{onSubmit:t[7]||(t[7]=de(s=>e.respondToEmailPrompt("save"),["prevent"]))},[t[30]||(t[30]=n("h2",{id:"email-prompt-title"},"Stay informed about access problems",-1)),t[31]||(t[31]=n("p",{id:"email-prompt-reason"},"Get email alerts when your GitHub token or repository access fails.",-1)),t[32]||(t[32]=n("label",{for:"email-prompt-address"},"Email address",-1)),P(n("input",{id:"email-prompt-address",class:"form-control",type:"email",autocomplete:"email",maxlength:"254",required:"","onUpdate:modelValue":t[4]||(t[4]=s=>e.emailPromptAddress=s),disabled:e.emailPromptBusy},null,8,Wz),[[nt,e.emailPromptAddress]]),e.emailPromptError?(a(),l("p
Line truncated
|
||||
python experiments/run.py`),n("p",null,[m("Contact: "),n("span",{class:"redact",role:"img","aria-label":"Redacted term 3"},[n("i",null,"3")])])])])])])],-1))]),p(" Live stats "),n("section",{class:R(["paper-stats paper-wrap",{"is-empty":e.statsEmpty()}]),id:"metrics","aria-label":"Usage over the last 60 days"},[n("div",sH,[e.statsEmpty()?p("v-if",!0):(a(),l("div",iH,[...t[11]||(t[11]=[n("span",{class:"paper-stats-dot","aria-hidden":"true"},null,-1),m(),n("span",null,[m("Live \xB7 last 60 days"),n("span",{class:"paper-stats-daily"}," \xB7 updated daily")],-1)])])),t[12]||(t[12]=n("div",{class:"paper-stats-meta-right"},"Used by authors at ICSE \xB7 FSE \xB7 OOPSLA",-1))]),e.statsEmpty()?p("v-if",!0):(a(),l("div",rH,[(a(!0),l(V,null,J(e.cards,(i,o)=>(a(),l("div",{class:"paper-stat-card",key:i?.key},[n("div",{class:R(["paper-stat-value",{"is-pending":!e.stat}])},d(e.stat?e.fmt?.bigNum(i?.total):"\u2014"),3),n("div",aH,d(i?.label),1),e.history[i?.key].bars?.length>1&&e.history[i?.key].deltaToday>0?(a(),l("div",lH," +"+d(e.fmt?.number(e.history[i?.key].deltaToday))+" today ",1)):p("v-if",!0)]))),128))]))],2),p(" Before / after "),t[22]||(t[22]=n("section",{class:"paper-section-head paper-wrap"},[n("div",null,[n("div",{class:"paper-eyebrow"},"Try it"),n("h2",null,[m("The same repository, "),n("em",null,"minus you.")])]),n("p",null," Names, affiliations, emails, and any term you list are replaced across the README, source files, notebooks, and PDF links. Reviewers browse the real thing, not a zip. ")],-1)),n("div",dH,[n("div",uH,[t[13]||(t[13]=n("label",{for:"demo-terms"},[m("Terms to redact "),n("span",null,[m("comma-separated"),n("span",{class:"dt-try"},", try adding your own")])],-1)),P(n("textarea",{id:"demo-terms",class:"demo-terms-input",rows:"1","onUpdate:modelValue":t[0]||(t[0]=i=>e.demoTerms=i),spellcheck:"false",autocomplete:"off",onKeydown:t[1]||(t[1]=$t(de(()=>{},["prevent"]),["enter"]))},null,544),[[nt,e.demoTerms]])]),n("div",cH,[n("div",pH,[t[15]||(t[15]=n("div",{class:"pane-header"},[n("span",{class:"pane-label"},[m("Your repository "),n("span",{class:"pane-edit-hint"},"\xB7 editable")]),n("span",{class:"pane-url"},"github.com/jane-smith/DeepLearnUtils")],-1)),n("div",fH,[n("div",mH,[(a(!0),l(V,null,J(e.demoParts(),(i,o)=>(a(),l(V,{key:o},[i.redacted?(a(),l("mark",hH,d(i.original),1)):(a(),l(V,{key:1},[m(d(i.text),1)],64))],64))),128)),t[14]||(t[14]=m("\u200B",-1))]),P(n("textarea",{class:"pane-body demo-input","onUpdate:modelValue":t[2]||(t[2]=i=>e.demoText=i),spellcheck:"false","aria-label":"Sample README to anonymize"},null,512),[[nt,e.demoText]])])]),n("div",gH,[n("div",vH,[t[16]||(t[16]=n("span",{class:"pane-label"},"What reviewers see",-1)),n("span",yH,[n("span",bH,d(e.demoCount())+" redacted",1)])]),n("div",wH,[(a(!0),l(V,null,J(e.demoParts(),(i,o)=>(a(),l(V,{key:o},[i.redacted?(a(),l("span",{key:0,class:"redact-chip",title:"Replaces \u201C"+i.original+"\u201D"},d(i.text),9,kH)):(a(),l(V,{key:1},[m(d(i.text),1)],64))],64))),128))])])])]),p(" What you get: one screenshot, three tabs "),t[23]||(t[23]=n("section",{class:"paper-section-head paper-wrap",id:"about"},[n("div",null,[n("div",{class:"paper-eyebrow"},"What you get"),n("h2",null,"Anonymize, review, manage.")]),n("p",null," Terms are redacted in text files. Enabled images and PDFs are served unchanged, so review them for identifying content before sharing. Monitor your mirror, update it, or remove it when the review is over. ")],-1)),n("section",CH,[n("div",SH,[(a(!0),l(V,null,J(e.features,(i,o)=>(a(),l("div",{class:R(["paper-feature",{"is-on":e.feature===i?.key}]),key:i?.key},[n("button",{type:"button",class:"paper-feature-tab",role:"tab",onClick:r=>e.selectFeature(i.key),onKeydown:r=>e.featureKeydown(r,o),id:"feature-tab-"+i?.key,"aria-controls":"feature-panel-"+i?.key,"aria-selected":e.feature===i?.key,tabindex:e.feature===i?.key?0:-1},[n("span",NH,[n("span",RH,d(i?.num),1),t[17]||(t[17]=n("span",{class:"pf-sep"}," \xB7 ",-1)),n("span",TH,d(i?.eyebrow),1)]),n("span",PH,[m(d(i?.title.split("-")[0]),1),i?.title.includes("-")?(a(),l("span",DH,"-")):p("v-if",!0),m(d(i?.title.split("-").slice(1).join("-"))+" "+d(i?.accent),1)])],40,EH),n("div",AH,[n("span",IH,[m(d(i?.title.split("-")[0]),1),i?.title.includes("-")?(a(),l("span",OH,"-")):p("v-if",!0),m(d(i?.title.split("-").slice(1).join("-"))+" "+d(i?.accent),1)]),n("p",null,d(i?.text),1),n("a",{class:"paper-link-arrow",href:e.safeUrl(e.featureHref(i)),target:e.featureTarget(i)},d(i?.cta)+" \u2192",9,MH)])],2))),128))]),n("div",VH,[(a(!0),l(V,null,J(e.features,(i,o)=>P((a(),l("div",{class:"paper-feature-panel",role:"tabpanel",key:i?.key,id:"feature-panel-"+i?.key,"aria-labelledby":"feature-tab-"+i?.key},[n("div",qH,[n("div",$H,[t[18]||(t[18]=n("span",{class:"dots"},[n("i"),n("i"),n("i")],-1)),n("span",FH,d(i?.url),1)]),n("div",{class:R(["feat-mock","is-"+i?.key]),role:"img","aria-label":i?.alt},[i?.key==="anonymize"?(a(),l("div",UH,[...t[19]||(t[19]=[Ce('<div class="fm-label">GitHub reposit
Line truncated
|
||||
label names the service and the tooltip says who to contact. `),n("li",{class:R(["nav-item nav-extra-item d-none d-lg-block",{"in-user-menu":!!e.user?.username}])},[...t[19]||(t[19]=[n("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"},[n("svg",{class:"ui-icon d-lg-none mr-1","aria-hidden":"true"},[n("use",{href:"#ui-icon-bug"})]),m("Report a bug ")],-1)])],2),n("li",{class:R(["nav-item nav-support-item nav-extra-item d-none d-lg-block",{"in-user-menu":!!e.user?.username}])},[...t[20]||(t[20]=[n("a",{class:"nav-link nav-support-inline",href:"https://ko-fi.com/tdurieux",target:"_blank",rel:"noopener",title:"Donate on Ko-fi to help cover hosting costs"},[n("svg",{class:"ui-icon nav-heart","aria-hidden":"true"},[n("use",{href:"#ui-icon-heart"})]),m("Support ")],-1)])],2),e.isDarkMode?f("v-if",!0):(a(),l("li",aH,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to dark mode","aria-label":"Switch to dark mode",onClick:t[1]||(t[1]=s=>{e.darkMode(!0)})},[...t[21]||(t[21]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(a(),l("li",lH,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to light mode","aria-label":"Switch to light mode",onClick:t[2]||(t[2]=s=>{e.darkMode(!1)})},[...t[22]||(t[22]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sun"})],-1)])])])):f("v-if",!0),!e.user&&!e.isReviewerRoute?(a(),l("li",dH,[...t[23]||(t[23]=[n("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[n("i",{class:"fab fa-github mr-1"}),m(" Sign in ")],-1)])])):f("v-if",!0),e.user?.username&&e.headerCanUpgrade&&!e.headerBillingPending?(a(),l("li",uH,[n("a",{class:"nav-link nav-upgrade",href:"/profile?upgrade=1",onClick:t[3]||(t[3]=le(s=>e.openHeaderUpgrade(),["prevent"]))},"Upgrade")])):f("v-if",!0),e.user?(a(),l("li",cH,[n("a",pH,[e.user?.photo?(a(),l("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,fH)):f("v-if",!0),n("span",mH,d(e.user?.username),1)]),n("div",hH,[n("h6",gH,"Signed in as @"+d(e.user?.username),1),t[25]||(t[25]=Ce('<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 um-extra" 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>',6)),e.headerShowSupport?(a(),l("a",vH,[...t[24]||(t[24]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-heart"})],-1),n("span",null,"Support the project",-1)])])):f("v-if",!0),t[26]||(t[26]=n("div",{class:"dropdown-divider"},null,-1)),t[27]||(t[27]=n("a",{class:"dropdown-item",href:"/api/user/logout",target:"_self"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-logout"})]),n("span",null,"Sign out")],-1))])])):f("v-if",!0)])])],2),e.generalMessage?(a(),l("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,yH)):f("v-if",!0),e.emailPromptOpen?(a(),l("dialog",{key:1,id:"email-prompt",class:"email-prompt","aria-labelledby":"email-prompt-title","aria-describedby":"email-prompt-reason",onCancel:t[8]||(t[8]=le(s=>e.respondToEmailPrompt("later"),["prevent"]))},[n("form",{onSubmit:t[7]||(t[7]=le(s=>e.respondToEmailPrompt("save"),["prevent"]))},[t[30]||(t[30]=n("h2",{id:"email-prompt-title"},"Stay informed about access problems",-1)),t[31]||(t[31]=n("p",{id:"email-prompt-reason"},"Get email alerts when your GitHub token or repository access fails.",-1)),t[32]||(t[32]=n("label",{for:"email-prompt-address"},"Email address",-1)),I(n("input",{id:"email-prompt-address",class:"form-control",type:"email",autocomplete:"email",maxlength:"254",required:"","onUpdate:modelValue":t[4]||(t[4]=s=>e.emailPromptAddress=s),disabled:e.emailPromptBusy},null,8,bH),[[st,e.emailPromptAddress]]),e.emailPromptError?(a(),l("p
Line truncated
|
||||
python experiments/run.py`),n("p",null,[m("Contact: "),n("span",{class:"redact",role:"img","aria-label":"Redacted term 3"},[n("i",null,"3")])])])])])])],-1))]),f(" Live stats "),n("section",{class:R(["paper-stats paper-wrap",{"is-empty":e.statsEmpty()}]),id:"metrics","aria-label":"Usage over the last 60 days"},[n("div",AH,[e.statsEmpty()?f("v-if",!0):(a(),l("div",OH,[...t[11]||(t[11]=[n("span",{class:"paper-stats-dot","aria-hidden":"true"},null,-1),m(),n("span",null,[m("Live \xB7 last 60 days"),n("span",{class:"paper-stats-daily"}," \xB7 updated daily")],-1)])])),t[12]||(t[12]=n("div",{class:"paper-stats-meta-right"},"Used by authors at ICSE \xB7 FSE \xB7 OOPSLA",-1))]),e.statsEmpty()?f("v-if",!0):(a(),l("div",MH,[(a(!0),l(O,null,G(e.cards,(r,i)=>(a(),l("div",{class:"paper-stat-card",key:r?.key},[n("div",{class:R(["paper-stat-value",{"is-pending":!e.stat}])},d(e.stat?e.fmt?.bigNum(r?.total):"\u2014"),3),n("div",VH,d(r?.label),1),e.history[r?.key].bars?.length>1&&e.history[r?.key].deltaToday>0?(a(),l("div",qH," +"+d(e.fmt?.number(e.history[r?.key].deltaToday))+" today ",1)):f("v-if",!0)]))),128))]))],2),f(" Before / after "),t[22]||(t[22]=n("section",{class:"paper-section-head paper-wrap"},[n("div",null,[n("div",{class:"paper-eyebrow"},"Try it"),n("h2",null,[m("The same repository, "),n("em",null,"minus you.")])]),n("p",null," Names, affiliations, emails, and any term you list are replaced across the README, source files, notebooks, and PDF links. Reviewers browse the real thing, not a zip. ")],-1)),n("div",LH,[n("div",FH,[t[13]||(t[13]=n("label",{for:"demo-terms"},[m("Terms to redact "),n("span",null,[m("comma-separated"),n("span",{class:"dt-try"},", try adding your own")])],-1)),I(n("textarea",{id:"demo-terms",class:"demo-terms-input",rows:"1","onUpdate:modelValue":t[0]||(t[0]=r=>e.demoTerms=r),spellcheck:"false",autocomplete:"off",onKeydown:t[1]||(t[1]=Ft(le(()=>{},["prevent"]),["enter"]))},null,544),[[st,e.demoTerms]])]),n("div",$H,[n("div",UH,[t[15]||(t[15]=n("div",{class:"pane-header"},[n("span",{class:"pane-label"},[m("Your repository "),n("span",{class:"pane-edit-hint"},"\xB7 editable")]),n("span",{class:"pane-url"},"github.com/jane-smith/DeepLearnUtils")],-1)),n("div",BH,[n("div",_H,[(a(!0),l(O,null,G(e.demoParts(),(r,i)=>(a(),l(O,{key:i},[r.redacted?(a(),l("mark",HH,d(r.original),1)):(a(),l(O,{key:1},[m(d(r.text),1)],64))],64))),128)),t[14]||(t[14]=m("\u200B",-1))]),I(n("textarea",{class:"pane-body demo-input","onUpdate:modelValue":t[2]||(t[2]=r=>e.demoText=r),spellcheck:"false","aria-label":"Sample README to anonymize"},null,512),[[st,e.demoText]])])]),n("div",zH,[n("div",jH,[t[16]||(t[16]=n("span",{class:"pane-label"},"What reviewers see",-1)),n("span",GH,[n("span",WH,d(e.demoCount())+" redacted",1)])]),n("div",KH,[(a(!0),l(O,null,G(e.demoParts(),(r,i)=>(a(),l(O,{key:i},[r.redacted?(a(),l("span",{key:0,class:"redact-chip",title:"Replaces \u201C"+r.original+"\u201D"},d(r.text),9,YH)):(a(),l(O,{key:1},[m(d(r.text),1)],64))],64))),128))])])])]),f(" What you get: one screenshot, three tabs "),t[23]||(t[23]=n("section",{class:"paper-section-head paper-wrap",id:"about"},[n("div",null,[n("div",{class:"paper-eyebrow"},"What you get"),n("h2",null,"Anonymize, review, manage.")]),n("p",null," Terms are redacted in text files. Enabled images and PDFs are served unchanged, so review them for identifying content before sharing. Monitor your mirror, update it, or remove it when the review is over. ")],-1)),n("section",XH,[n("div",QH,[(a(!0),l(O,null,G(e.features,(r,i)=>(a(),l("div",{class:R(["paper-feature",{"is-on":e.feature===r?.key}]),key:r?.key},[n("button",{type:"button",class:"paper-feature-tab",role:"tab",onClick:o=>e.selectFeature(r.key),onKeydown:o=>e.featureKeydown(o,i),id:"feature-tab-"+r?.key,"aria-controls":"feature-panel-"+r?.key,"aria-selected":e.feature===r?.key,tabindex:e.feature===r?.key?0:-1},[n("span",ZH,[n("span",xH,d(r?.num),1),t[17]||(t[17]=n("span",{class:"pf-sep"}," \xB7 ",-1)),n("span",ez,d(r?.eyebrow),1)]),n("span",tz,[m(d(r?.title.split("-")[0]),1),r?.title.includes("-")?(a(),l("span",nz,"-")):f("v-if",!0),m(d(r?.title.split("-").slice(1).join("-"))+" "+d(r?.accent),1)])],40,JH),n("div",sz,[n("span",oz,[m(d(r?.title.split("-")[0]),1),r?.title.includes("-")?(a(),l("span",iz,"-")):f("v-if",!0),m(d(r?.title.split("-").slice(1).join("-"))+" "+d(r?.accent),1)]),n("p",null,d(r?.text),1),n("a",{class:"paper-link-arrow",href:e.safeUrl(e.featureHref(r)),target:e.featureTarget(r)},d(r?.cta)+" \u2192",9,rz)])],2))),128))]),n("div",az,[(a(!0),l(O,null,G(e.features,(r,i)=>I((a(),l("div",{class:"paper-feature-panel",role:"tabpanel",key:r?.key,id:"feature-panel-"+r?.key,"aria-labelledby":"feature-tab-"+r?.key},[n("div",dz,[n("div",uz,[t[18]||(t[18]=n("span",{class:"dots"},[n("i"),n("i"),n("i")],-1)),n("span",cz,d(r?.url),1)]),n("div",{class:R(["feat-mock","is-"+r?.key]),role:"img","aria-label":r?.alt},[r?.key==="anonymize"?(a(),l("div",fz,[...t[19]||(t[19]=[Ce('<div class="fm-label">GitHub reposit
Line truncated
|
||||
<span class="ln">2</span><span class="c"># Author: <span class="redact">XXXX-1</span>, <span class="redact">XXXX-2</span></span>
|
||||
<span class="ln">3</span><span class="k">import</span> torch
|
||||
<span class="ln">4</span><span class="k">from</span> utils <span class="k">import</span> load_config
|
||||
@@ -58,18 +57,18 @@ python experiments/run.py`),n("p",null,[m("Contact: "),n("span",{class:"redact",
|
||||
<span class="ln">7</span> model = build_model(config)
|
||||
<span class="ln">8</span> <span class="k">for</span> epoch <span class="k">in</span> range(config.epochs):
|
||||
<span class="ln">9</span> loss = step(model)
|
||||
<span class="ln">10</span> log(<span class="s">"epoch %d: %.3f"</span>, epoch, loss)</pre></div>`,2)])])):(a(),l("div",zH,[...t[21]||(t[21]=[Ce('<div class="fm-dash-head"><span>Project</span><span>Status</span><span>Views</span><span>Expires</span></div><div class="fm-dash-row"><span><b>DeepLearnUtils</b><i>paper-7f2a \xB7 ICSE 2027</i></span><span class="st is-ready">Ready</span><span>41</span><span>Mar 31, 2027</span></div><div class="fm-dash-row"><span><b>vision-bench#212</b><i>pull request \xB7 FSE 2027</i></span><span class="st is-ready">Ready</span><span>12</span><span>Never</span></div><div class="fm-dash-row"><span><b>graph-repair</b><i>gr-91ab</i></span><span class="st is-progress">Updating</span><span>5</span><span>Jan 5, 2027</span></div><div class="fm-dash-row is-muted"><span><b>JarSift</b><i>OOPSLA 2025</i></span><span class="st is-expired">Expired</span><span>72</span><span>Sep 28, 2026</span></div>',5)])]))],10,_H)])],8,LH)),[[x,e.feature===i?.key]])),128))])]),p(" FAQ teaser "),t[24]||(t[24]=Ce('<section class="paper-qa paper-qa-r3 paper-wrap" aria-labelledby="qa-heading"><div class="qa-head"><div><div class="paper-eyebrow">Before you sign in</div><h2 id="qa-heading">The questions that come up most.</h2></div><a class="paper-link-arrow" href="/faq">Read the full FAQ \u2192</a></div><div class="qa-grid"><div class="q"><a href="/faq#permissions">What access does GitHub sign-in require?</a><p> The GitHub App has read-only access to gists and the repositories you choose. Legacy OAuth uses broader permissions. Anonymous GitHub never writes to your repositories. </p></div><div class="q"><a href="/faq#formats">Which file formats are supported?</a><p> Source code with syntax highlighting, Markdown, Jupyter notebooks, PDFs, images, and GitHub Pages sites. Text files are anonymized; enabled images and PDFs are served unchanged. </p></div><div class="q"><a href="/faq#expiration">What happens when an anonymized repository expires?</a><p> You choose: the mirror is removed, or visitors are redirected to the original GitHub repository once the review is over. </p></div></div></section><section class="paper-cta paper-wrap" aria-labelledby="cta-heading"><div><h2 id="cta-heading">Ready for review?</h2><p>Create an anonymous mirror in a couple of minutes. Reviewers just open the link.</p></div><div class="paper-cta-actions"><a class="btn-hero" href="/signin" target="_self"><i class="fab fa-github" aria-hidden="true"></i> Sign in with GitHub</a><a class="paper-link-arrow" target="_self" href="https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/">See an anonymized repository \u2192</a></div></section>',2)),Oe(s,{name:"partials/footer.htm",state:e.viewState},null,8,["state"])])}var HH={class:"paper-empty"},jH={class:"paper-empty-inner"},GH={key:0,class:"paper-eyebrow"},WH={key:1,class:"paper-eyebrow"},KH={key:2,class:"paper-empty-title"},YH=["textContent"];function Vp(e,t){return a(),l("div",HH,[n("div",jH,[e.error?p("v-if",!0):(a(),l("div",GH,"Working")),e.error?(a(),l("div",WH,"Error")):p("v-if",!0),e.error?p("v-if",!0):(a(),l("h1",KH,[...t[0]||(t[0]=[m(" Loading",-1),n("span",{class:"dot-anim"},"\u2026",-1)])])),e.error?(a(),l("h1",{key:3,class:"paper-empty-title",textContent:d(e.fmt.translate(e.error))},null,8,YH)):p("v-if",!0)])])}var JH={class:"container paper-page paper-settings"},XH={class:"paper-crumbs"},QH={class:"here"},ZH={class:"paper-page-title"},xH={class:"paper-settings-body"},ej={class:"paper-settings-toc"},tj={href:"#conf-billing"},nj={class:"form needs-validation paper-settings-main",name:"conference",novalidate:""},oj={id:"conf-basics",class:"paper-settings-section"},sj={class:"form-group"},ij={class:"invalid-feedback"},rj={class:"invalid-feedback"},aj={class:"form-group"},lj={class:"invalid-feedback"},dj={class:"form-group"},uj={class:"invalid-feedback"},cj={class:"invalid-feedback"},pj={id:"conf-window",class:"paper-settings-section"},fj={class:"form-grid-2"},mj={class:"form-group"},hj={class:"invalid-feedback"},gj={class:"invalid-feedback"},vj={class:"form-group"},yj={class:"invalid-feedback"},bj={class:"invalid-feedback"},wj={id:"conf-rendering",class:"paper-settings-section"},kj={class:"form-check"},Cj={class:"form-check-input",type:"checkbox",id:"link",name:"link"},Sj={class:"form-check"},Ej={class:"form-check-input",type:"checkbox",id:"image",name:"image"},Nj={class:"form-check"},Rj={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},Tj={class:"form-check"},Pj={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},Dj={id:"conf-features",class:"paper-settings-section"},Aj={class:"form-check"},Ij={class:"form-check-input",type:"checkbox",id:"update",name:"update"},Oj={class:"form-check"},Mj={class:"form-check-input",type:"checkbox",id:"page",name:"page"},Vj={id:"conf-plan",class:"paper-settings-section"},Lj={key:0,class:"paper-section-copy"},qj={class:"conference-tiers",role:"radiogroup","aria-label":"Review package size"},Line truncated
|
||||
`).length))+" lines",1)):p("v-if",!0)]),P(n("button",{type:"button",class:"btn btn-sm btn-icon-only btn-ghost copy-path-btn","aria-label":e.pathCopied?"Path copied":"Copy file path",title:e.pathCopied?"Path copied":"Copy file path",onClick:t[2]||(t[2]=u=>e.copyPath())},[(a(),l("svg",DG,[n("use",{href:e.pathCopied?"#ui-icon-check":"#ui-icon-link"},null,8,AG)]))],8,PG),[[x,e.filePath]])]),e.type!="html"&&typeof e.content=="string"?(a(),l("span",IG,[e.redactionCount()?(a(),l(V,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[m(d(e.redactionCount()),1),t[49]||(t[49]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,OG),t[50]||(t[50]=n("span",{class:"sep"},"\xB7",-1))],64)):p("v-if",!0),m(d(e.languageName||"Text"),1),n("span",MG,[t[51]||(t[51]=n("span",{class:"sep"},"\xB7",-1)),m(d(e.content.length<1024?e.content.length+" B":(e.content.length/1024).toFixed(1)+" KB"),1)]),t[52]||(t[52]=n("span",{class:"sep"},"\xB7",-1)),m(d(e.fmt?.number(e.content.split(`
|
||||
`).length))+" lines",1)])):p("v-if",!0),e.type=="html"?(a(),l("span",VG,[e.redactionCount()?(a(),l(V,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[m(d(e.redactionCount()),1),t[53]||(t[53]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,LG),t[54]||(t[54]=n("span",{class:"sep"},"\xB7",-1))],64)):p("v-if",!0),t[56]||(t[56]=m("Markdown",-1)),e.fileSize(e.filePath)!=null?(a(),l(V,{key:1},[t[55]||(t[55]=n("span",{class:"sep"},"\xB7",-1)),m(d(e.formatSize(e.fileSize(e.filePath))),1)],64)):p("v-if",!0)])):p("v-if",!0),e.preview&&e.previewPreserved()?(a(),l("button",{key:2,type:"button",class:"rp-preserved-tag",onClick:t[3]||(t[3]=u=>e.openPreserveFiles())},"Left unredacted")):p("v-if",!0),n("div",qG,[e.isCsv()?(a(),l("div",$G,[n("button",{type:"button",role:"radio",class:R(["seg-chip",{active:e.csvView==="table"}]),"aria-checked":e.csvView==="table",onClick:t[4]||(t[4]=u=>e.csvView="table")},"Table",10,FG),n("button",{type:"button",role:"radio",class:R(["seg-chip",{active:e.csvView==="raw"}]),"aria-checked":e.csvView==="raw",onClick:t[5]||(t[5]=u=>e.csvView="raw"),title:"Show the file as text with line numbers"},"Text",10,_G)])):p("v-if",!0),e.type!="html"&&e.symbols().length>1?(a(),l("div",UG,[n("button",{type:"button",class:R(["btn btn-sm btn-ghost btn-symbols",{"is-on":e.symbolsOpen}]),"aria-expanded":e.symbolsOpen?"true":"false","aria-haspopup":"true",title:"Symbols in this file",onClick:t[6]||(t[6]=u=>e.symbolsOpen=!e.symbolsOpen)},[...t[57]||(t[57]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-list"})],-1),n("span",{class:"btn-find-label"},"Symbols",-1)])],10,BG),e.symbolsOpen?(a(),l("div",zG,[n("div",HG,d(e.symbols().length)+" "+d(e.symbols().length===1?"symbol":"symbols"),1),(a(!0),l(V,null,J(e.symbols(),u=>(a(),l("button",{type:"button",class:"symbols-item",role:"menuitem",key:u.line+u.name,onClick:f=>e.goToSymbol(u.line)},[n("span",{class:R(["symbols-kind","is-"+u.kind])},d(u.kind==="class"?"C":u.kind==="function"?"\u0192":"v"),3),n("span",GG,d(u.name),1),n("span",WG,d(u.line),1)],8,jG))),128))])):p("v-if",!0)])):p("v-if",!0),e.type=="html"?(a(),l("button",{key:2,type:"button",class:R(["btn btn-sm btn-ghost btn-icon-only btn-find btn-md-find",{"is-on":e.mdFindOpen}]),"aria-label":"Find on this page",title:"Find on this page ("+(e.isMac?"\u2318":"Ctrl+")+"F)",onClick:t[7]||(t[7]=u=>e.toggleMdFind())},[...t[58]||(t[58]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],10,KG)):p("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?(a(),l("div",YG,[e.type!="html"?(a(),l("button",{key:0,type:"button",class:"btn btn-sm btn-ghost btn-icon-only btn-goto","aria-label":"Go to line",title:"Go to line ("+(e.isMac?"\u2318":"Ctrl+")+"G)",onClick:t[8]||(t[8]=u=>e.gotoLine())},[...t[59]||(t[59]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1)])],8,JG)):p("v-if",!0),e.type!="html"?(a(),l("button",{key:1,type:"button",class:R(["btn btn-sm btn-icon-only btn-ghost btn-toggle",{"is-on":e.wrapLines}]),"aria-pressed":e.wrapLines?"true":"false","aria-label":"Wrap lines",title:"Wrap lines (Alt+Z)",onClick:t[9]||(t[9]=u=>e.toggleWrap())},[...t[60]||(t[60]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)])],10,XG)):p("v-if",!0),e.type!="html"?(a(),l("button",{key:2,type:"button",class:"btn btn-sm btn-ghost btn-icon-only btn-find","aria-label":"Find in file",title:"Find in file ("+(e.isMac?"\u2318":"Ctrl+")+"F)",onClick:t[10]||(t[10]=u=>e.findInFile())},[...t[61]||(t[61]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],8,QG)):p("v-if",!0)])):p("v-if",!0),!e.preview||e.url?(a(),l("div",ZG,[n("a",{target:e.preview?"_blank":"_self",class:"tb-seg-btn",title:e.type=="html"?"Open the Markdown source":"Open the raw file",href:e.safeUrl(e.url)},"Raw",8,xG),typeof e.content=="string"?(a(),l("button",{key:0,type:"button",class:"tb-seg-btn tb-seg-icon","aria-label":e.contentCopied?"Copied":"Copy file contents",title:e.contentCopied?"Copied":"Copy file contents",onClick:t[11]||(t[11]=u=>e.copyContent())},[(a(),l("svg",tW,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,nW)]))],8,eW)):p("v-if",!0),n("a",{target:e.preview?"_blank":"_self",class:"tb-seg-btn tb-seg-icon","aria-label":"Download file",title:"Download file",href:e.safeUrl(e.downloadUrl()),download:e.preview?e.paths[e.paths.length-1]:null},[...t[62]||(t[62]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1)])],8,oW)])):p("v-if",!0),typeof e.content=="string"?(a(),l("button",{key:5,type:"button",class:"btn btn-sm btn-icon-only btn-ghost tb-copy-m","aria-label":e.contentCopied?"Copied":"Copy file contents",onClick:t[12]||(t[12]=u=>e.copyContent())},[(a(),l("svg",iW,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,rW)]))],8,sW)):p("v-if",!0),e.type=="html"&&e.r
Line truncated
|
||||
`).length))+" lines",1)],64)):p("v-if",!0)])):p("v-if",!0),e.options?.publishedAt||e.options?.sourceCommitDate||e.options?.anonymizedAt||e.options?.lastUpdateDate?(a(),l("div",hW)):p("v-if",!0),e.type=="html"?(a(),l("button",{key:3,type:"button",role:"menuitem",onClick:t[17]||(t[17]=u=>e.toggleMdFind())},[...t[67]||(t[67]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),m("Find in file",-1)])])):p("v-if",!0),e.type=="html"?(a(),l("div",gW)):p("v-if",!0),e.type!="html"?(a(),l("button",{key:5,type:"button",role:"menuitem",onClick:t[18]||(t[18]=u=>e.findInFile())},[...t[68]||(t[68]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),m("Find in file",-1)])])):p("v-if",!0),e.type!="html"?(a(),l("button",{key:6,type:"button",role:"menuitem",onClick:t[19]||(t[19]=u=>e.gotoLine())},[...t[69]||(t[69]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1),m("Go to line",-1)])])):p("v-if",!0),e.type!="html"?(a(),l("button",{key:7,type:"button",role:"menuitemcheckbox","aria-checked":e.wrapLines?"true":"false",onClick:t[20]||(t[20]=u=>e.toggleWrap())},[t[70]||(t[70]=n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)),t[71]||(t[71]=m("Wrap lines",-1)),e.wrapLines?(a(),l("span",yW,"\u2713")):p("v-if",!0)],8,vW)):p("v-if",!0),e.isCsv()?(a(),l("button",{key:8,type:"button",role:"menuitem",class:"tb-csv-view",onClick:t[21]||(t[21]=u=>{e.csvView=e.csvView==="table"?"raw":"table",e.moreOpen=!1})},[(a(),l("svg",bW,[n("use",{href:e.csvView==="table"?"#ui-icon-code":"#ui-icon-list"},null,8,wW)])),m(d(e.csvView==="table"?"Show as text":"Show as table"),1)])):p("v-if",!0),e.type!="html"?(a(),l("div",kW)):p("v-if",!0),e.type=="html"&&(!e.preview||e.url)?(a(),l("a",{key:10,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.url)},[...t[72]||(t[72]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),m("View raw",-1)])],8,CW)):p("v-if",!0),e.type!="html"&&(!e.preview||e.url)?(a(),l("a",{key:11,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.url)},[...t[73]||(t[73]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),m("View raw",-1)])],8,SW)):p("v-if",!0),!e.preview||e.url?(a(),l("a",{key:12,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.downloadUrl()),download:e.preview?e.paths[e.paths.length-1]:null},[...t[74]||(t[74]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1),m("Download file",-1)])],8,EW)):p("v-if",!0),e.options?.hasWebsite?(a(),l("a",{key:13,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl("/w/"+e.repoId+"/")},[...t[75]||(t[75]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-globe"})],-1),m("Open website",-1)])],8,NW)):p("v-if",!0),e.options?.isAdmin||e.options?.isOwner?(a(),l("a",{key:14,role:"menuitem",href:e.safeUrl("/anonymize/"+e.repoId)},[...t[76]||(t[76]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-edit"})],-1),m("Edit anonymization",-1)])],8,RW)):p("v-if",!0),e.options?.download?(a(),l("a",{key:15,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl("/api/repo/"+e.repoId+"/zip")},[...t[77]||(t[77]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-archive"})],-1),m("Download ZIP",-1)])],8,TW)):p("v-if",!0),n("button",{type:"button",role:"menuitem",onClick:t[22]||(t[22]=u=>e.copyPath())},[...t[78]||(t[78]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-link"})],-1),m("Copy file path",-1)])]),t[79]||(t[79]=n("div",{class:"tb-menu-sep"},null,-1)),t[80]||(t[80]=n("a",{role:"menuitem",href:"/faq"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-help"})]),m("FAQ")],-1)),t[81]||(t[81]=n("a",{role:"menuitem",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",target:"_blank",rel:"noopener"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-bug"})]),m("Report a bug")],-1))])):p("v-if",!0)])]),e.gotoOpen&&e.type!="html"?(a(),l("form",{key:3,class:"goto-pop",role:"dialog","aria-label":"Go to line",onSubmit:t[26]||(t[26]=de(u=>e.submitGoto(),["prevent"]))},[t[82]||(t[82]=n("label",{class:"goto-label",for:"goto-input"},"Go to line",-1)),P(n("input",{id:"goto-input",class:"goto-input",type:"text",inputmode:"numeric",autocomplete:"off",spellcheck:"false",placeholder:"1\u2013"+e.fmt?.number(typeof e.content=="string"?e.content.split(`
|
||||
`).length:1),"aria-invalid":e.gotoError?"true":"false","onUpdate:modelValue":t[24]||(t[24]=u=>e.gotoValue=u),onKeydown:t[25]||(t[25]=$t(de(u=>e.closeGoto(),["prevent","stop"]),["esc"]))},null,40,PW),[[nt,e.gotoValue]]),n("span",{class:R(["goto-hint",{"is-error":e.gotoError}])},d(e.gotoError||"Line, or line:column"),3)],32)):p("v-if",!0)]),e.isCsv()&&e.csvView==="table"?(a(),l("div",{key:0,class:"csv-table-wrap",tabindex:"0",role:"region","aria-label":"Table view of "+(e.paths?.[e.paths.length-1]||"file")},[n("table",AW,[n("thead",null,[n("tr",null,[t[83]||(t[83]=n("th",{class:"csv-rownum",scope:"col"},[n("span",{class:"sr-only"},"Row")],-1)),(a(!0),l(V,null,J(e.csvRows()[0]||[],(u,f)=>(a(),l("th",{scope:"col",key:f,class:R({"is-num":e.csvNumCol(f)})},[(a(!0),l(V,null,J(e.redactParts(u),(c,v)=>(a(),l(V,{key:v},[c.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+c.n},[n("i",null,d(c.n),1)],8,IW)):(a(),l(V,{key:1},[m(d(c.t),1)],64))],64))),128))],2))),128))])]),n("tbody",null,[(a(!0),l(V,null,J(e.csvRows().slice(1),(u,f)=>(a(),l("tr",{key:f},[n("td",OW,d(f+1),1),(a(!0),l(V,null,J(u,(c,v)=>(a(),l("td",{key:v,class:R({"is-num":e.csvNumCol(v)})},[(a(!0),l(V,null,J(e.redactParts(c),(h,y)=>(a(),l(V,{key:y},[h.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+h.n},[n("i",null,d(h.n),1)],8,MW)):(a(),l(V,{key:1},[m(d(h.t),1)],64))],64))),128))],2))),128))]))),128))])])],8,DW)):p("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?P((a(),l("div",VW,null,512)),[[r,{content:e.content,options:e.aceOption}]]):p("v-if",!0),e.type=="html"&&e.mdFindOpen?(a(),l("div",LW,[n("input",{type:"search",class:"md-find-input",placeholder:"Find on this page","aria-label":"Find on this page",value:e.mdFindQuery,onInput:t[27]||(t[27]=u=>{e.mdFindQuery=u.target.value,e.runMdFind()}),onKeydown:[t[28]||(t[28]=$t(de(u=>u.shiftKey?e.stepMdFind(-1):e.stepMdFind(1),["prevent"]),["enter"])),t[29]||(t[29]=$t(de(u=>e.toggleMdFind(!1),["prevent"]),["esc"]))]},null,40,qW),n("span",$W,[n("button",{type:"button","aria-label":"Previous match",onClick:t[30]||(t[30]=u=>e.stepMdFind(-1)),disabled:!e.mdFindTotal},[...t[84]||(t[84]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-left"})],-1)])],8,FW),n("button",{type:"button","aria-label":"Next match",onClick:t[31]||(t[31]=u=>e.stepMdFind(1)),disabled:!e.mdFindTotal},[...t[85]||(t[85]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-right"})],-1)])],8,_W)]),n("span",UW,d(e.mdFindQuery?e.mdFindTotal?e.mdFindIndex+1+" of "+e.mdFindTotal:"No results":""),1),n("button",{type:"button",class:R(["md-find-opt",{"is-on":e.mdFindCase}]),"aria-pressed":e.mdFindCase?"true":"false",title:"Match case","aria-label":"Match case",onClick:t[32]||(t[32]=u=>{e.mdFindCase=!e.mdFindCase,e.runMdFind()})},"Aa",10,BW),n("button",{type:"button",class:"md-find-close","aria-label":"Close find",onClick:t[33]||(t[33]=u=>e.toggleMdFind(!1))},"\xD7")])):p("v-if",!0),e.type=="html"?(a(),l("div",zW,[n("div",{class:"file-content markdown-body",innerHTML:e.renderReadme(e.sanitize(e.content))},null,8,HW),e.readmeToc().length>=3?(a(),l("aside",jW,[t[86]||(t[86]=n("div",{class:"readme-toc-head"},"On this page",-1)),n("nav",GW,[n("a",{href:"#",class:R(["lvl-2 toc-top",{"is-active":!e.activeHeading}]),onClick:t[34]||(t[34]=de(u=>e.scrollToHeading(null),["prevent"]))},"Introduction",2),(a(!0),l(V,null,J(e.readmeToc(),(u,f)=>(a(),l("a",{key:u.id,href:"#"+u.id,class:R(["lvl-"+u.level,{"is-active":e.activeHeading===u.id}]),onClick:de(c=>e.scrollToHeading(u.id),["prevent"])},d(u.text),11,WW))),128))])])):p("v-if",!0)])):p("v-if",!0)],2)):p("v-if",!0),e.type=="html-doc"&&!e.showSource&&e.content!=null?(a(),Jt(s,{key:2,content:e.content,"base-url":e.fileBaseUrl,"allow-scripts":e.allowScripts},null,8,["content","base-url","allow-scripts"])):p("v-if",!0),e.fileFrame()?(a(),l("section",{key:3,class:R(["file-card file-card-media","view-"+e.type])},[n("header",KW,[n("div",YW,[n("button",{type:"button",class:R(["btn btn-sm btn-icon-only btn-ghost card-files-btn",{"is-needed":e.sidebarHidden}]),title:"Show file tree",onClick:t[35]||(t[35]=u=>e.sidebarHidden?e.sidebarHidden=!1:e.sidebarCollapsed=!1)},[...t[87]||(t[87]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sidebar"})],-1),n("span",{class:"card-files-label"},"Files",-1)])],2),n("ol",JW,[n("li",XW,[n("a",{href:e.safeUrl("/r/"+e.repoId+"/"),title:e.repoId,textContent:d(/^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(e.repoId||"")?"repository":e.repoId)},null,8,QW)]),(a(!0),l(V,null,J(e.paths,(u,f)=>(a(),l("li",{class:"breadcrumb-item","aria-current":f===e.paths.length-1?"page":null},[(a(!0),l(V,null,J(e.redactParts(u),(c,v)=>(a(),l(V,{key:v},[c.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+c.n},[n("i",null,d(c.n),1)],8,xW)):(a(),l(V,{key:1},[m(d(c.t),1)],64))],64))),128))],8,ZW))),256))]),n("span",eK,[e.type=="IPython
Line truncated
|
||||
<span class="ln">10</span> log(<span class="s">"epoch %d: %.3f"</span>, epoch, loss)</pre></div>`,2)])])):(a(),l("div",hz,[...t[21]||(t[21]=[Ce('<div class="fm-dash-head"><span>Project</span><span>Status</span><span>Views</span><span>Expires</span></div><div class="fm-dash-row"><span><b>DeepLearnUtils</b><i>paper-7f2a \xB7 ICSE 2027</i></span><span class="st is-ready">Ready</span><span>41</span><span>Mar 31, 2027</span></div><div class="fm-dash-row"><span><b>vision-bench#212</b><i>pull request \xB7 FSE 2027</i></span><span class="st is-ready">Ready</span><span>12</span><span>Never</span></div><div class="fm-dash-row"><span><b>graph-repair</b><i>gr-91ab</i></span><span class="st is-progress">Updating</span><span>5</span><span>Jan 5, 2027</span></div><div class="fm-dash-row is-muted"><span><b>JarSift</b><i>OOPSLA 2025</i></span><span class="st is-expired">Expired</span><span>72</span><span>Sep 28, 2026</span></div>',5)])]))],10,pz)])],8,lz)),[[Q,e.feature===r?.key]])),128))])]),f(" FAQ teaser "),t[24]||(t[24]=Ce('<section class="paper-qa paper-qa-r3 paper-wrap" aria-labelledby="qa-heading"><div class="qa-head"><div><div class="paper-eyebrow">Before you sign in</div><h2 id="qa-heading">The questions that come up most.</h2></div><a class="paper-link-arrow" href="/faq">Read the full FAQ \u2192</a></div><div class="qa-grid"><div class="q"><a href="/faq#permissions">What access does GitHub sign-in require?</a><p> The GitHub App has read-only access to gists and the repositories you choose. Legacy OAuth uses broader permissions. Anonymous GitHub never writes to your repositories. </p></div><div class="q"><a href="/faq#formats">Which file formats are supported?</a><p> Source code with syntax highlighting, Markdown, Jupyter notebooks, PDFs, images, and GitHub Pages sites. Text files are anonymized; enabled images and PDFs are served unchanged. </p></div><div class="q"><a href="/faq#expiration">What happens when an anonymized repository expires?</a><p> You choose: the mirror is removed, or visitors are redirected to the original GitHub repository once the review is over. </p></div></div></section><section class="paper-cta paper-wrap" aria-labelledby="cta-heading"><div><h2 id="cta-heading">Ready for review?</h2><p>Create an anonymous mirror in a couple of minutes. Reviewers just open the link.</p></div><div class="paper-cta-actions"><a class="btn-hero" href="/signin" target="_self"><i class="fab fa-github" aria-hidden="true"></i> Sign in with GitHub</a><a class="paper-link-arrow" target="_self" href="https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/">See an anonymized repository \u2192</a></div></section>',2)),Ie(s,{name:"partials/footer.htm",state:e.viewState},null,8,["state"])])}var gz={class:"paper-empty"},vz={class:"paper-empty-inner"},yz={key:0,class:"paper-eyebrow"},bz={key:1,class:"paper-eyebrow"},wz={key:2,class:"paper-empty-title"},kz=["textContent"];function jp(e,t){return a(),l("div",gz,[n("div",vz,[e.error?f("v-if",!0):(a(),l("div",yz,"Working")),e.error?(a(),l("div",bz,"Error")):f("v-if",!0),e.error?f("v-if",!0):(a(),l("h1",wz,[...t[0]||(t[0]=[m(" Loading",-1),n("span",{class:"dot-anim"},"\u2026",-1)])])),e.error?(a(),l("h1",{key:3,class:"paper-empty-title",textContent:d(e.fmt.translate(e.error))},null,8,kz)):f("v-if",!0)])])}var Cz={class:"container paper-page paper-settings"},Ez={class:"paper-crumbs"},Sz={class:"here"},Nz={class:"paper-page-title"},Rz={class:"paper-settings-body"},Pz={class:"paper-settings-toc"},Dz={href:"#conf-billing"},Tz={class:"form needs-validation paper-settings-main",name:"conference",novalidate:""},Iz={id:"conf-basics",class:"paper-settings-section"},Az={class:"form-group"},Oz={class:"invalid-feedback"},Mz={class:"invalid-feedback"},Vz={class:"form-group"},qz={class:"invalid-feedback"},Lz={class:"form-group"},Fz={class:"invalid-feedback"},$z={class:"invalid-feedback"},Uz={id:"conf-window",class:"paper-settings-section"},Bz={class:"form-grid-2"},_z={class:"form-group"},Hz={class:"invalid-feedback"},zz={class:"invalid-feedback"},jz={class:"form-group"},Gz={class:"invalid-feedback"},Wz={class:"invalid-feedback"},Kz={id:"conf-rendering",class:"paper-settings-section"},Yz={class:"form-check"},Xz={class:"form-check-input",type:"checkbox",id:"link",name:"link"},Qz={class:"form-check"},Jz={class:"form-check-input",type:"checkbox",id:"image",name:"image"},Zz={class:"form-check"},xz={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},ej={class:"form-check"},tj={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},nj={id:"conf-features",class:"paper-settings-section"},sj={class:"form-check"},oj={class:"form-check-input",type:"checkbox",id:"update",name:"update"},ij={class:"form-check"},rj={class:"form-check-input",type:"checkbox",id:"page",name:"page"},aj={id:"conf-plan",class:"paper-settings-section"},lj={key:0,class:"paper-section-copy"},dj={class:"conference-tiers",role:"radiogroup","aria-label":"Review package size"},Line truncated
|
||||
`).length))+" lines",1)):f("v-if",!0)]),I(n("button",{type:"button",class:"btn btn-sm btn-icon-only btn-ghost copy-path-btn","aria-label":e.pathCopied?"Path copied":"Copy file path",title:e.pathCopied?"Path copied":"Copy file path",onClick:t[2]||(t[2]=u=>e.copyPath())},[(a(),l("svg",nG,[n("use",{href:e.pathCopied?"#ui-icon-check":"#ui-icon-link"},null,8,sG)]))],8,tG),[[Q,e.filePath]])]),e.type!="html"&&typeof e.content=="string"?(a(),l("span",oG,[e.redactionCount()?(a(),l(O,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[m(d(e.redactionCount()),1),t[49]||(t[49]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,iG),t[50]||(t[50]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),m(d(e.languageName||"Text"),1),n("span",rG,[t[51]||(t[51]=n("span",{class:"sep"},"\xB7",-1)),m(d(e.content.length<1024?e.content.length+" B":(e.content.length/1024).toFixed(1)+" KB"),1)]),t[52]||(t[52]=n("span",{class:"sep"},"\xB7",-1)),m(d(e.fmt?.number(e.content.split(`
|
||||
`).length))+" lines",1)])):f("v-if",!0),e.type=="html"?(a(),l("span",aG,[e.redactionCount()?(a(),l(O,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[m(d(e.redactionCount()),1),t[53]||(t[53]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,lG),t[54]||(t[54]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),t[56]||(t[56]=m("Markdown",-1)),e.fileSize(e.filePath)!=null?(a(),l(O,{key:1},[t[55]||(t[55]=n("span",{class:"sep"},"\xB7",-1)),m(d(e.formatSize(e.fileSize(e.filePath))),1)],64)):f("v-if",!0)])):f("v-if",!0),e.preview&&e.previewPreserved()?(a(),l("button",{key:2,type:"button",class:"rp-preserved-tag",onClick:t[3]||(t[3]=u=>e.openPreserveFiles())},"Left unredacted")):f("v-if",!0),n("div",dG,[e.isCsv()?(a(),l("div",uG,[n("button",{type:"button",role:"radio",class:R(["seg-chip",{active:e.csvView==="table"}]),"aria-checked":e.csvView==="table",onClick:t[4]||(t[4]=u=>e.csvView="table")},"Table",10,cG),n("button",{type:"button",role:"radio",class:R(["seg-chip",{active:e.csvView==="raw"}]),"aria-checked":e.csvView==="raw",onClick:t[5]||(t[5]=u=>e.csvView="raw"),title:"Show the file as text with line numbers"},"Text",10,pG)])):f("v-if",!0),e.type!="html"&&e.symbols().length>1?(a(),l("div",fG,[n("button",{type:"button",class:R(["btn btn-sm btn-ghost btn-symbols",{"is-on":e.symbolsOpen}]),"aria-expanded":e.symbolsOpen?"true":"false","aria-haspopup":"true",title:"Symbols in this file",onClick:t[6]||(t[6]=u=>e.symbolsOpen=!e.symbolsOpen)},[...t[57]||(t[57]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-list"})],-1),n("span",{class:"btn-find-label"},"Symbols",-1)])],10,mG),e.symbolsOpen?(a(),l("div",hG,[n("div",gG,d(e.symbols().length)+" "+d(e.symbols().length===1?"symbol":"symbols"),1),(a(!0),l(O,null,G(e.symbols(),u=>(a(),l("button",{type:"button",class:"symbols-item",role:"menuitem",key:u.line+u.name,onClick:p=>e.goToSymbol(u.line)},[n("span",{class:R(["symbols-kind","is-"+u.kind])},d(u.kind==="class"?"C":u.kind==="function"?"\u0192":"v"),3),n("span",yG,d(u.name),1),n("span",bG,d(u.line),1)],8,vG))),128))])):f("v-if",!0)])):f("v-if",!0),e.type=="html"?(a(),l("button",{key:2,type:"button",class:R(["btn btn-sm btn-ghost btn-icon-only btn-find btn-md-find",{"is-on":e.mdFindOpen}]),"aria-label":"Find on this page",title:"Find on this page ("+(e.isMac?"\u2318":"Ctrl+")+"F)",onClick:t[7]||(t[7]=u=>e.toggleMdFind())},[...t[58]||(t[58]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],10,wG)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?(a(),l("div",kG,[e.type!="html"?(a(),l("button",{key:0,type:"button",class:"btn btn-sm btn-ghost btn-icon-only btn-goto","aria-label":"Go to line",title:"Go to line ("+(e.isMac?"\u2318":"Ctrl+")+"G)",onClick:t[8]||(t[8]=u=>e.gotoLine())},[...t[59]||(t[59]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1)])],8,CG)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:1,type:"button",class:R(["btn btn-sm btn-icon-only btn-ghost btn-toggle",{"is-on":e.wrapLines}]),"aria-pressed":e.wrapLines?"true":"false","aria-label":"Wrap lines",title:"Wrap lines (Alt+Z)",onClick:t[9]||(t[9]=u=>e.toggleWrap())},[...t[60]||(t[60]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)])],10,EG)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:2,type:"button",class:"btn btn-sm btn-ghost btn-icon-only btn-find","aria-label":"Find in file",title:"Find in file ("+(e.isMac?"\u2318":"Ctrl+")+"F)",onClick:t[10]||(t[10]=u=>e.findInFile())},[...t[61]||(t[61]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],8,SG)):f("v-if",!0)])):f("v-if",!0),!e.preview||e.url?(a(),l("div",NG,[n("a",{target:e.preview?"_blank":"_self",class:"tb-seg-btn",title:e.type=="html"?"Open the Markdown source":"Open the raw file",href:e.safeUrl(e.url)},"Raw",8,RG),typeof e.content=="string"?(a(),l("button",{key:0,type:"button",class:"tb-seg-btn tb-seg-icon","aria-label":e.contentCopied?"Copied":"Copy file contents",title:e.contentCopied?"Copied":"Copy file contents",onClick:t[11]||(t[11]=u=>e.copyContent())},[(a(),l("svg",DG,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,TG)]))],8,PG)):f("v-if",!0),n("a",{target:e.preview?"_blank":"_self",class:"tb-seg-btn tb-seg-icon","aria-label":"Download file",title:"Download file",href:e.safeUrl(e.downloadUrl()),download:e.preview?e.paths[e.paths.length-1]:null},[...t[62]||(t[62]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1)])],8,IG)])):f("v-if",!0),typeof e.content=="string"?(a(),l("button",{key:5,type:"button",class:"btn btn-sm btn-icon-only btn-ghost tb-copy-m","aria-label":e.contentCopied?"Copied":"Copy file contents",onClick:t[12]||(t[12]=u=>e.copyContent())},[(a(),l("svg",OG,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,MG)]))],8,AG)):f("v-if",!0),e.type=="html"&&e.r
Line truncated
|
||||
`).length))+" lines",1)],64)):f("v-if",!0)])):f("v-if",!0),e.options?.publishedAt||e.options?.sourceCommitDate||e.options?.anonymizedAt||e.options?.lastUpdateDate?(a(),l("div",HG)):f("v-if",!0),e.type=="html"?(a(),l("button",{key:3,type:"button",role:"menuitem",onClick:t[17]||(t[17]=u=>e.toggleMdFind())},[...t[67]||(t[67]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),m("Find in file",-1)])])):f("v-if",!0),e.type=="html"?(a(),l("div",zG)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:5,type:"button",role:"menuitem",onClick:t[18]||(t[18]=u=>e.findInFile())},[...t[68]||(t[68]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),m("Find in file",-1)])])):f("v-if",!0),e.type!="html"?(a(),l("button",{key:6,type:"button",role:"menuitem",onClick:t[19]||(t[19]=u=>e.gotoLine())},[...t[69]||(t[69]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1),m("Go to line",-1)])])):f("v-if",!0),e.type!="html"?(a(),l("button",{key:7,type:"button",role:"menuitemcheckbox","aria-checked":e.wrapLines?"true":"false",onClick:t[20]||(t[20]=u=>e.toggleWrap())},[t[70]||(t[70]=n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)),t[71]||(t[71]=m("Wrap lines",-1)),e.wrapLines?(a(),l("span",GG,"\u2713")):f("v-if",!0)],8,jG)):f("v-if",!0),e.isCsv()?(a(),l("button",{key:8,type:"button",role:"menuitem",class:"tb-csv-view",onClick:t[21]||(t[21]=u=>{e.csvView=e.csvView==="table"?"raw":"table",e.moreOpen=!1})},[(a(),l("svg",WG,[n("use",{href:e.csvView==="table"?"#ui-icon-code":"#ui-icon-list"},null,8,KG)])),m(d(e.csvView==="table"?"Show as text":"Show as table"),1)])):f("v-if",!0),e.type!="html"?(a(),l("div",YG)):f("v-if",!0),e.type=="html"&&(!e.preview||e.url)?(a(),l("a",{key:10,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.url)},[...t[72]||(t[72]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),m("View raw",-1)])],8,XG)):f("v-if",!0),e.type!="html"&&(!e.preview||e.url)?(a(),l("a",{key:11,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.url)},[...t[73]||(t[73]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),m("View raw",-1)])],8,QG)):f("v-if",!0),!e.preview||e.url?(a(),l("a",{key:12,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.downloadUrl()),download:e.preview?e.paths[e.paths.length-1]:null},[...t[74]||(t[74]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1),m("Download file",-1)])],8,JG)):f("v-if",!0),e.options?.hasWebsite?(a(),l("a",{key:13,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl("/w/"+e.repoId+"/")},[...t[75]||(t[75]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-globe"})],-1),m("Open website",-1)])],8,ZG)):f("v-if",!0),e.options?.isAdmin||e.options?.isOwner?(a(),l("a",{key:14,role:"menuitem",href:e.safeUrl("/anonymize/"+e.repoId)},[...t[76]||(t[76]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-edit"})],-1),m("Edit anonymization",-1)])],8,xG)):f("v-if",!0),e.options?.download?(a(),l("a",{key:15,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl("/api/repo/"+e.repoId+"/zip")},[...t[77]||(t[77]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-archive"})],-1),m("Download ZIP",-1)])],8,eW)):f("v-if",!0),n("button",{type:"button",role:"menuitem",onClick:t[22]||(t[22]=u=>e.copyPath())},[...t[78]||(t[78]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-link"})],-1),m("Copy file path",-1)])]),t[79]||(t[79]=n("div",{class:"tb-menu-sep"},null,-1)),t[80]||(t[80]=n("a",{role:"menuitem",href:"/faq"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-help"})]),m("FAQ")],-1)),t[81]||(t[81]=n("a",{role:"menuitem",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",target:"_blank",rel:"noopener"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-bug"})]),m("Report a bug")],-1))])):f("v-if",!0)])]),e.gotoOpen&&e.type!="html"?(a(),l("form",{key:3,class:"goto-pop",role:"dialog","aria-label":"Go to line",onSubmit:t[26]||(t[26]=le(u=>e.submitGoto(),["prevent"]))},[t[82]||(t[82]=n("label",{class:"goto-label",for:"goto-input"},"Go to line",-1)),I(n("input",{id:"goto-input",class:"goto-input",type:"text",inputmode:"numeric",autocomplete:"off",spellcheck:"false",placeholder:"1\u2013"+e.fmt?.number(typeof e.content=="string"?e.content.split(`
|
||||
`).length:1),"aria-invalid":e.gotoError?"true":"false","onUpdate:modelValue":t[24]||(t[24]=u=>e.gotoValue=u),onKeydown:t[25]||(t[25]=Ft(le(u=>e.closeGoto(),["prevent","stop"]),["esc"]))},null,40,tW),[[st,e.gotoValue]]),n("span",{class:R(["goto-hint",{"is-error":e.gotoError}])},d(e.gotoError||"Line, or line:column"),3)],32)):f("v-if",!0)]),e.isCsv()&&e.csvView==="table"?(a(),l("div",{key:0,class:"csv-table-wrap",tabindex:"0",role:"region","aria-label":"Table view of "+(e.paths?.[e.paths.length-1]||"file")},[n("table",sW,[n("thead",null,[n("tr",null,[t[83]||(t[83]=n("th",{class:"csv-rownum",scope:"col"},[n("span",{class:"sr-only"},"Row")],-1)),(a(!0),l(O,null,G(e.csvRows()[0]||[],(u,p)=>(a(),l("th",{scope:"col",key:p,class:R({"is-num":e.csvNumCol(p)})},[(a(!0),l(O,null,G(e.redactParts(u),(c,v)=>(a(),l(O,{key:v},[c.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+c.n},[n("i",null,d(c.n),1)],8,oW)):(a(),l(O,{key:1},[m(d(c.t),1)],64))],64))),128))],2))),128))])]),n("tbody",null,[(a(!0),l(O,null,G(e.csvRows().slice(1),(u,p)=>(a(),l("tr",{key:p},[n("td",iW,d(p+1),1),(a(!0),l(O,null,G(u,(c,v)=>(a(),l("td",{key:v,class:R({"is-num":e.csvNumCol(v)})},[(a(!0),l(O,null,G(e.redactParts(c),(h,y)=>(a(),l(O,{key:y},[h.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+h.n},[n("i",null,d(h.n),1)],8,rW)):(a(),l(O,{key:1},[m(d(h.t),1)],64))],64))),128))],2))),128))]))),128))])])],8,nW)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?I((a(),l("div",aW,null,512)),[[o,{content:e.content,options:e.aceOption}]]):f("v-if",!0),e.type=="html"&&e.mdFindOpen?(a(),l("div",lW,[n("input",{type:"search",class:"md-find-input",placeholder:"Find on this page","aria-label":"Find on this page",value:e.mdFindQuery,onInput:t[27]||(t[27]=u=>{e.mdFindQuery=u.target.value,e.runMdFind()}),onKeydown:[t[28]||(t[28]=Ft(le(u=>u.shiftKey?e.stepMdFind(-1):e.stepMdFind(1),["prevent"]),["enter"])),t[29]||(t[29]=Ft(le(u=>e.toggleMdFind(!1),["prevent"]),["esc"]))]},null,40,dW),n("span",uW,[n("button",{type:"button","aria-label":"Previous match",onClick:t[30]||(t[30]=u=>e.stepMdFind(-1)),disabled:!e.mdFindTotal},[...t[84]||(t[84]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-left"})],-1)])],8,cW),n("button",{type:"button","aria-label":"Next match",onClick:t[31]||(t[31]=u=>e.stepMdFind(1)),disabled:!e.mdFindTotal},[...t[85]||(t[85]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-right"})],-1)])],8,pW)]),n("span",fW,d(e.mdFindQuery?e.mdFindTotal?e.mdFindIndex+1+" of "+e.mdFindTotal:"No results":""),1),n("button",{type:"button",class:R(["md-find-opt",{"is-on":e.mdFindCase}]),"aria-pressed":e.mdFindCase?"true":"false",title:"Match case","aria-label":"Match case",onClick:t[32]||(t[32]=u=>{e.mdFindCase=!e.mdFindCase,e.runMdFind()})},"Aa",10,mW),n("button",{type:"button",class:"md-find-close","aria-label":"Close find",onClick:t[33]||(t[33]=u=>e.toggleMdFind(!1))},"\xD7")])):f("v-if",!0),e.type=="html"?(a(),l("div",hW,[n("div",{class:"file-content markdown-body",innerHTML:e.renderReadme(e.sanitize(e.content))},null,8,gW),e.readmeToc().length>=3?(a(),l("aside",vW,[t[86]||(t[86]=n("div",{class:"readme-toc-head"},"On this page",-1)),n("nav",yW,[n("a",{href:"#",class:R(["lvl-2 toc-top",{"is-active":!e.activeHeading}]),onClick:t[34]||(t[34]=le(u=>e.scrollToHeading(null),["prevent"]))},"Introduction",2),(a(!0),l(O,null,G(e.readmeToc(),(u,p)=>(a(),l("a",{key:u.id,href:"#"+u.id,class:R(["lvl-"+u.level,{"is-active":e.activeHeading===u.id}]),onClick:le(c=>e.scrollToHeading(u.id),["prevent"])},d(u.text),11,bW))),128))])])):f("v-if",!0)])):f("v-if",!0)],2)):f("v-if",!0),e.type=="html-doc"&&!e.showSource&&e.content!=null?(a(),Xt(s,{key:2,content:e.content,"base-url":e.fileBaseUrl,"allow-scripts":e.allowScripts},null,8,["content","base-url","allow-scripts"])):f("v-if",!0),e.fileFrame()?(a(),l("section",{key:3,class:R(["file-card file-card-media","view-"+e.type])},[n("header",wW,[n("div",kW,[n("button",{type:"button",class:R(["btn btn-sm btn-icon-only btn-ghost card-files-btn",{"is-needed":e.sidebarHidden}]),title:"Show file tree",onClick:t[35]||(t[35]=u=>e.sidebarHidden?e.sidebarHidden=!1:e.sidebarCollapsed=!1)},[...t[87]||(t[87]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sidebar"})],-1),n("span",{class:"card-files-label"},"Files",-1)])],2),n("ol",CW,[n("li",EW,[n("a",{href:e.safeUrl("/r/"+e.repoId+"/"),title:e.repoId,textContent:d(/^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(e.repoId||"")?"repository":e.repoId)},null,8,SW)]),(a(!0),l(O,null,G(e.paths,(u,p)=>(a(),l("li",{class:"breadcrumb-item","aria-current":p===e.paths.length-1?"page":null},[(a(!0),l(O,null,G(e.redactParts(u),(c,v)=>(a(),l(O,{key:v},[c.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+c.n},[n("i",null,d(c.n),1)],8,RW)):(a(),l(O,{key:1},[m(d(c.t),1)],64))],64))),128))],8,NW))),256))]),n("span",PW,[e.type=="IPython
Line truncated
|
||||
`).length+1)),placeholder:`Jane Smith
|
||||
MIT CSAIL
|
||||
jane.smith@example.org`},null,8,uJ),[[i,{state:e.viewState,set:r=>{e.terms=r},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),n("details",cJ,[t[25]||(t[25]=n("summary",null,"Regex & replacement syntax",-1)),n("p",null,[t[21]||(t[21]=m("Matches become ",-1)),n("code",null,d(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[22]||(t[22]=m(". Use ",-1)),t[23]||(t[23]=n("code",null,"term=>replacement",-1)),t[24]||(t[24]=m(" for a custom replacement. Regex is supported.",-1))])]),P(n("div",pJ,"Terms are in an invalid format.",512),[[x,e.defaultsForm?.terms?.errors?.format]])])]),n("section",fJ,[t[35]||(t[35]=n("h2",null,"Reviewer display",-1)),n("div",null,[n("div",mJ,[n("label",hJ,[P(n("input",gJ,null,512),[[i,{state:e.viewState,set:r=>{e.options.link=r},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[27]||(t[27]=m("Keep links",-1))]),n("label",vJ,[P(n("input",yJ,null,512),[[i,{state:e.viewState,set:r=>{e.options.image=r},value:e.options?.image,form:"defaultsForm",options:{}}]]),t[28]||(t[28]=m("Display images",-1))]),n("label",bJ,[P(n("input",wJ,null,512),[[i,{state:e.viewState,set:r=>{e.options.pdf=r},value:e.options?.pdf,form:"defaultsForm",options:{}}]]),t[29]||(t[29]=m("Display PDFs",-1))]),n("label",kJ,[P(n("input",CJ,null,512),[[i,{state:e.viewState,set:r=>{e.options.notebook=r},value:e.options?.notebook,form:"defaultsForm",options:{}}]]),t[30]||(t[30]=m("Display notebooks",-1))]),n("label",SJ,[P(n("input",EJ,null,512),[[i,{state:e.viewState,set:r=>{e.options.loc=r},value:e.options?.loc,form:"defaultsForm",options:{}}]]),t[31]||(t[31]=m("Show line counts",-1))]),n("label",NJ,[P(n("input",RJ,null,512),[[i,{state:e.viewState,set:r=>{e.options.page=r},value:e.options?.page,form:"defaultsForm",options:{}}]]),t[32]||(t[32]=m("GitHub Pages",-1))])]),t[33]||(t[33]=n("p",{class:"settings-help"},"Images and PDFs are not anonymized.",-1)),t[34]||(t[34]=n("p",{class:"settings-help"},"GitHub Pages must use the anonymized branch.",-1))])]),n("section",TJ,[t[38]||(t[38]=n("h2",null,"Source updates",-1)),n("div",null,[n("label",PJ,[P(n("input",DJ,null,512),[[i,{state:e.viewState,set:r=>{e.options.update=r},value:e.options?.update,form:"defaultsForm",options:{}}]]),t[36]||(t[36]=m("Auto-update from GitHub",-1))]),t[37]||(t[37]=n("p",{class:"settings-help"},"Latest commit, at most once an hour.",-1))])]),n("section",AJ,[t[40]||(t[40]=n("label",{class:"settings-label",for:"expiration"},"On expiration",-1)),n("div",null,[P((a(),l("select",IJ,[...t[39]||(t[39]=[n("option",{value:"redirect"},"Redirect visitors to the GitHub repository",-1),n("option",{value:"remove",selected:""},"Remove the anonymized repository",-1)])])),[[i,{state:e.viewState,set:r=>{e.options.expirationMode=r},value:e.options?.expirationMode,form:"defaultsForm",options:{}}]]),n("p",OJ,d(e.options.expirationMode==="redirect"?"Redirecting reveals the original repository. Choose the date per anonymization.":"Set the expiration date for each repository."),1)])]),n("footer",MJ,[n("div",VJ,[e.draftRestored?(a(),l("span",LJ,"Your unsaved draft was restored.")):e.unsavedChanges?(a(),l("span",qJ,"Unsaved changes"+d(e.draftSaved?" \xB7 Draft saved in this tab":""),1)):(a(),l("span",$J,d(e.message?"Defaults saved":"No unsaved changes"),1))]),e.draftRestored||e.unsavedChanges?(a(),l("button",{key:0,type:"button",class:"draft-discard",onClick:t[0]||(t[0]=r=>e.discardDraft())},"Discard changes")):p("v-if",!0),n("button",{id:"save",type:"submit",class:R(["btn btn-ink",{"is-saving":e.saving}]),disabled:e.saving||!(e.unsavedChanges||e.draftRestored)},d(e.saving?"Saving\u2026":"Save defaults"),11,FJ),e.error?(a(),l("div",_J,d(e.error),1)):p("v-if",!0)])],32)),[[o,e.viewState]])],512),[[x,e.settingsTab==="defaults"]]),P(n("section",{id:"settings-billing","aria-busy":e.billingLoading||e.billingBusy},[t[95]||(t[95]=n("p",{class:"settings-scope"},"Your plan and usage. Reviewer access is always free.",-1)),e.billingLoading?(a(),l("p",BJ,"Loading billing\u2026")):p("v-if",!0),e.billingError?(a(),l("div",zJ,[m(d(e.billingError)+" ",1),n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[3]||(t[3]=r=>e.loadBilling()),disabled:e.billingBusy},"Try again",8,HJ)])):p("v-if",!0),e.billingNotice?(a(),l("p",jJ,d(e.billingNotice),1)):p("v-if",!0),e.billingPending?(a(),l("div",GJ,[t[42]||(t[42]=n("strong",null,"Confirming your payment",-1)),t[43]||(t[43]=n("p",null,"Your allowance will update after confirmation. Please do not pay again.",-1)),n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[4]||(t[4]=r=>e.refreshBilling()),disabled:e.billingBusy},"Check payment status",8,WJ)])):p("v-if",!0),n("section",KJ,[n("div",YJ,[n("div",null,[t[44]||(t[44]=n("p",{class:"billing-eyebrow"},"Current plan",-1)),n("h2",JJ,d(e.profileAuthorGrant()?e.profileGrantName(e.profileAuthorGrant()):e.billing?.enabled?"Free":"Account allowance"),1),e.profileAuthorGrant()?(a(),l("p",XJ,[m(d(e.profileAuthorGrant().cancelAtPeriodEnd?"Renewal cancelled \xB7 access u
Line truncated
|
||||
`);t.innerHTML=s.map(i=>{let o=i.replace(/^(<[^>]+>)+/,"").charAt(0),r=i.startsWith("@@")?"hunk":o==="+"?"add":o==="-"?"remove":"";return`<span class="md-diff-line${r?" is-"+r:""}">${i||" "}</span>`}).join(`
|
||||
`)}),Qp=(e,t=0)=>{let s=(String(e).slice(t).match(/^[ \t]*/)[0]||"").replace(/\t/g," ").length;return Math.min(t+s+4,24)},ef=e=>{e?.closest?.(".reviewer-preview")&&e.querySelectorAll("pre code").forEach(t=>{let s=t.querySelectorAll(".md-diff-line");if(s.length){s.forEach(o=>{o.classList.contains("is-hunk")||o.style.setProperty("--hang",Qp(o.textContent,1)+"ch")});return}if(t.querySelector(".code-line"))return;let i=[];t.innerHTML=t.innerHTML.replace(/\n$/,"").split(`
|
||||
`).map(o=>{let r=i.join("");o.replace(/<\/?span\b[^>]*>/g,f=>(f.startsWith("</")?i.pop():i.push(f),f));let u=o.replace(/<[^>]+>/g,"");return`<span class="code-line" style="--hang:${Qp(u)}ch">${r}${o||" "}${"</span>".repeat(i.length)}</span>`}).join(`
|
||||
`)})},tf={props:["content","terms","options"],setup(e){let t=Ct(null),s=()=>{t.value.innerHTML=renderMD(e.content||"",window.location.pathname+"/../"),xp(t.value),ef(t.value)};return yn(()=>{s(),dt(()=>[e.content,e.terms,e.options],s,{deep:!0})}),()=>Pe("markdown",{ref:t})}},$te={props:["file","terms","options"],setup(e){let t=Ct(null),s=()=>ze(()=>{t.value?.querySelectorAll("pre code").forEach(i=>window.Prism?.highlightElement(i)),xp(t.value),ef(t.value)});return yn(s),dt(()=>[e.file?.content,e.terms,e.options],s,{deep:!0}),()=>{let i=e.file||{},o=(i.filename||"").split(".").pop().toLowerCase();if(["md","markdown"].includes(o)||i.language==="Markdown")return Pe("gist-file",{ref:t},Pe(tf,{content:i.content,terms:e.terms,options:e.options}));let r={js:"javascript",jsx:"javascript",ts:"javascript",typescript:"javascript",py:"python",html:"markup",xml:"markup",svg:"markup",sh:"bash"},u=(i.language||o||"none").toLowerCase();return Pe("gist-file",{ref:t},Pe("pre",{class:"line-numbers"},Pe("code",{class:"language-"+(r[u]||u),key:i.content},i.content||"")))}}},Fte=e=>e?.querySelectorAll(".nb-input pre").forEach(t=>{if(t.parentElement?.classList.contains("nb-code-scroll"))return;let s=document.createElement("div");s.className="nb-code-scroll",t.replaceWith(s),s.appendChild(t);let i=()=>{let o=t.scrollWidth-t.clientWidth>1;if(s.classList.toggle("is-overflowing",o),s.classList.toggle("is-at-end",o&&t.scrollLeft+t.clientWidth>=t.scrollWidth-2),!o)return;let r=t.clientWidth-16,u=Math.max(24,r*t.clientWidth/t.scrollWidth);s.style.setProperty("--thumb-w",u+"px"),s.style.setProperty("--thumb-x",(r-u)*t.scrollLeft/(t.scrollWidth-t.clientWidth)+"px")};t.addEventListener("scroll",i,{passive:!0}),window.ResizeObserver?new ResizeObserver(i).observe(t):i(),i()}),_te={props:["file","content"],setup(e){let t=Ct(null),s=0,i,o=async()=>{let r=++s;i?.abort(),i=new AbortController;try{let u=e.content?JSON.parse(e.content):await fetch(e.file?.download_url||e.file,{signal:i.signal}).then(f=>{if(!f.ok)throw Error("Notebook request failed");return f.json()});if(await Zn("notebook"),r!==s)return;t.value.innerHTML=Bs(DOMPurify.sanitize(nb.parse(u).render())),t.value.querySelectorAll("pre code").forEach(f=>window.Prism?.highlightElement(f)),Fte(t.value)}catch(u){r===s&&u.name!=="AbortError"&&(t.value.textContent="Unable to render the notebook.")}};return yn(()=>{o(),dt(()=>[e.file,e.content],o)}),ao(()=>{s++,i?.abort()}),()=>Pe("notebook",{ref:t})}},Ute={props:["stats"],setup(e){return()=>{let t=Object.entries(e.stats||{}).filter(([,i])=>i.code),s=t.reduce((i,[,o])=>i+o.code,0);return Pe("loc",t.map(([i,o])=>Pe("div",{class:"lang",title:`${i}: ${o.code.toLocaleString()} lines`,style:{width:o.code*100/s+"%",background:langColors[i]}})))}}},nf={Markdown:tf,GistFile:$te,Notebook:_te,Loc:Ute,HtmlDoc:Yp,QuotaUsage:Lte,Pdfviewer:Cd(async()=>(await Zn("pdf"),pdfjsLib.GlobalWorkerOptions.workerSrc="/script/external/pdf.worker.js",Jp))},of={async mounted(e,{value:t}){e._editorValue=t;try{if(await ci(),e._editorDisposed)return;let s=e._editorValue,i=ace.edit(e);e._editor=i,i.setValue(String(s.content??""),-1),Zp(e,s.options),e._editorCleanup=s.options?.onLoad?.(i)}catch(s){e._editorDisposed||(e.textContent=s.message)}},updated(e,{value:t}){e._editorValue=t,e._editor&&(e._editor.getValue()!==String(t.content??"")&&e._editor.setValue(String(t.content??""),-1),Zp(e,t.options))},beforeUnmount(e){e._editorDisposed=!0,e._editorCleanup?.(),e._editor?.destroy()}};function Zp(e,t={}){let s=qte.has(t.mode)?t.mode:"text";e._editor.session.setMode("ace/mode/"+s),t.theme&&e._editor.setTheme("ace/theme/"+t.theme),e._editor.setReadOnly(t.readOnly!==!1)}var sf={mounted(e){if(!window.IntersectionObserver)return;let t=[...e.querySelectorAll('a[href^="#"]')],s=new Set,i=new IntersectionObserver(o=>{o.forEach(u=>u.isIntersecting?s.add(u.target.id):s.delete(u.target.id));let r=t.find(u=>s.has(u.hash.slice(1)));r&&t.forEach(u=>u.classList.toggle("active",u===r))},{rootMargin:"-20% 0px -60% 0px",threshold:0});ze(()=>{t.forEach(o=>{let r=document.getElementById(o.hash.slice(1));r&&i.observe(r)}),t[0]&&!t.some(o=>o.classList.contains("active"))&&t[0].classList.add("active")}),e._observer=i},beforeUnmount(e){e._observer?.disconnect()}};function rf(e){let t=[],s=0,i=/\bXXXX-(\d+)\b/g,o;for(;o=i.exec(e);)o.index>s&&t.push(e.slice(s,o.index)),t.push(Pe("span",{class:"redact-slot",role:"img","aria-label":"Redacted term "+o[1]},[Pe("i",null,o[1])])),s=o.index+o[0].length;return t.length?(s<e.length&&t.push(e.slice(s)),t):e}function Bte(e){let t=rf(e),s=[];for(let i of Array.isArray(t)?t:[t]){if(typeof i!="string"){s.push(i);continue}let o=i.split(/(?<=[._-])/);o.forEach((r,u)=>{s.push(r),u<o.length-1&&s.push(Pe("wbr"))})}return s}function zte(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB"],s=e/1024,i=0;for(;s>=1024&&i<t.length-1;)s/=1024,i++;return`${s.toFixed(1)} ${t[i]}`}function Hte(e){let t={children:[]},s=new Map([["",t]]);function i(o){if(s.has(o))return s.get(o);let r=o
Line truncated
|
||||
jane.smith@example.org`},null,8,FY),[[r,{state:e.viewState,set:o=>{e.terms=o},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),n("details",$Y,[t[25]||(t[25]=n("summary",null,"Regex & replacement syntax",-1)),n("p",null,[t[21]||(t[21]=m("Matches become ",-1)),n("code",null,d(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[22]||(t[22]=m(". Use ",-1)),t[23]||(t[23]=n("code",null,"term=>replacement",-1)),t[24]||(t[24]=m(" for a custom replacement. Regex is supported.",-1))])]),I(n("div",UY,"Terms are in an invalid format.",512),[[Q,e.defaultsForm?.terms?.errors?.format]])])]),n("section",BY,[t[35]||(t[35]=n("h2",null,"Reviewer display",-1)),n("div",null,[n("div",_Y,[n("label",HY,[I(n("input",zY,null,512),[[r,{state:e.viewState,set:o=>{e.options.link=o},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[27]||(t[27]=m("Keep links",-1))]),n("label",jY,[I(n("input",GY,null,512),[[r,{state:e.viewState,set:o=>{e.options.image=o},value:e.options?.image,form:"defaultsForm",options:{}}]]),t[28]||(t[28]=m("Display images",-1))]),n("label",WY,[I(n("input",KY,null,512),[[r,{state:e.viewState,set:o=>{e.options.pdf=o},value:e.options?.pdf,form:"defaultsForm",options:{}}]]),t[29]||(t[29]=m("Display PDFs",-1))]),n("label",YY,[I(n("input",XY,null,512),[[r,{state:e.viewState,set:o=>{e.options.notebook=o},value:e.options?.notebook,form:"defaultsForm",options:{}}]]),t[30]||(t[30]=m("Display notebooks",-1))]),n("label",QY,[I(n("input",JY,null,512),[[r,{state:e.viewState,set:o=>{e.options.loc=o},value:e.options?.loc,form:"defaultsForm",options:{}}]]),t[31]||(t[31]=m("Show line counts",-1))]),n("label",ZY,[I(n("input",xY,null,512),[[r,{state:e.viewState,set:o=>{e.options.page=o},value:e.options?.page,form:"defaultsForm",options:{}}]]),t[32]||(t[32]=m("GitHub Pages",-1))])]),t[33]||(t[33]=n("p",{class:"settings-help"},"Images and PDFs are not anonymized.",-1)),t[34]||(t[34]=n("p",{class:"settings-help"},"GitHub Pages must use the anonymized branch.",-1))])]),n("section",eX,[t[38]||(t[38]=n("h2",null,"Source updates",-1)),n("div",null,[n("label",tX,[I(n("input",nX,null,512),[[r,{state:e.viewState,set:o=>{e.options.update=o},value:e.options?.update,form:"defaultsForm",options:{}}]]),t[36]||(t[36]=m("Auto-update from GitHub",-1))]),t[37]||(t[37]=n("p",{class:"settings-help"},"Latest commit, at most once an hour.",-1))])]),n("section",sX,[t[40]||(t[40]=n("label",{class:"settings-label",for:"expiration"},"On expiration",-1)),n("div",null,[I((a(),l("select",oX,[...t[39]||(t[39]=[n("option",{value:"redirect"},"Redirect visitors to the GitHub repository",-1),n("option",{value:"remove",selected:""},"Remove the anonymized repository",-1)])])),[[r,{state:e.viewState,set:o=>{e.options.expirationMode=o},value:e.options?.expirationMode,form:"defaultsForm",options:{}}]]),n("p",iX,d(e.options.expirationMode==="redirect"?"Redirecting reveals the original repository. Choose the date per anonymization.":"Set the expiration date for each repository."),1)])]),n("footer",rX,[n("div",aX,[e.draftRestored?(a(),l("span",lX,"Your unsaved draft was restored.")):e.unsavedChanges?(a(),l("span",dX,"Unsaved changes"+d(e.draftSaved?" \xB7 Draft saved in this tab":""),1)):(a(),l("span",uX,d(e.message?"Defaults saved":"No unsaved changes"),1))]),e.draftRestored||e.unsavedChanges?(a(),l("button",{key:0,type:"button",class:"draft-discard",onClick:t[0]||(t[0]=o=>e.discardDraft())},"Discard changes")):f("v-if",!0),n("button",{id:"save",type:"submit",class:R(["btn btn-ink",{"is-saving":e.saving}]),disabled:e.saving||!(e.unsavedChanges||e.draftRestored)},d(e.saving?"Saving\u2026":"Save defaults"),11,cX),e.error?(a(),l("div",pX,d(e.error),1)):f("v-if",!0)])],32)),[[i,e.viewState]])],512),[[Q,e.settingsTab==="defaults"]]),I(n("section",{id:"settings-billing","aria-busy":e.billingLoading||e.billingBusy},[t[95]||(t[95]=n("p",{class:"settings-scope"},"Your plan and usage. Reviewer access is always free.",-1)),e.billingLoading?(a(),l("p",mX,"Loading billing\u2026")):f("v-if",!0),e.billingError?(a(),l("div",hX,[m(d(e.billingError)+" ",1),n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[3]||(t[3]=o=>e.loadBilling()),disabled:e.billingBusy},"Try again",8,gX)])):f("v-if",!0),e.billingNotice?(a(),l("p",vX,d(e.billingNotice),1)):f("v-if",!0),e.billingPending?(a(),l("div",yX,[t[42]||(t[42]=n("strong",null,"Confirming your payment",-1)),t[43]||(t[43]=n("p",null,"Your allowance will update after confirmation. Please do not pay again.",-1)),n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[4]||(t[4]=o=>e.refreshBilling()),disabled:e.billingBusy},"Check payment status",8,bX)])):f("v-if",!0),n("section",wX,[n("div",kX,[n("div",null,[t[44]||(t[44]=n("p",{class:"billing-eyebrow"},"Current plan",-1)),n("h2",CX,d(e.profileAuthorGrant()?e.profileGrantName(e.profileAuthorGrant()):e.billing?.enabled?"Free":"Account allowance"),1),e.profileAuthorGrant()?(a(),l("p",EX,[m(d(e.profileAuthorGrant().cancelAtPeriodEnd?"Renewal cancelled \xB7 access u
Line truncated
|
||||
`);t.innerHTML=s.map(r=>{let i=r.replace(/^(<[^>]+>)+/,"").charAt(0),o=r.startsWith("@@")?"hunk":i==="+"?"add":i==="-"?"remove":"";return`<span class="md-diff-line${o?" is-"+o:""}">${r||" "}</span>`}).join(`
|
||||
`)}),lf=(e,t=0)=>{let s=(String(e).slice(t).match(/^[ \t]*/)[0]||"").replace(/\t/g," ").length;return Math.min(t+s+4,24)},cf=e=>{e?.closest?.(".reviewer-preview")&&e.querySelectorAll("pre code").forEach(t=>{let s=t.querySelectorAll(".md-diff-line");if(s.length){s.forEach(i=>{i.classList.contains("is-hunk")||i.style.setProperty("--hang",lf(i.textContent,1)+"ch")});return}if(t.querySelector(".code-line"))return;let r=[];t.innerHTML=t.innerHTML.replace(/\n$/,"").split(`
|
||||
`).map(i=>{let o=r.join("");i.replace(/<\/?span\b[^>]*>/g,p=>(p.startsWith("</")?r.pop():r.push(p),p));let u=i.replace(/<[^>]+>/g,"");return`<span class="code-line" style="--hang:${lf(u)}ch">${o}${i||" "}${"</span>".repeat(r.length)}</span>`}).join(`
|
||||
`)})},pf={props:["content","terms","options"],setup(e){let t=Ct(null),s=()=>{t.value.innerHTML=renderMD(e.content||"",window.location.pathname+"/../"),uf(t.value),cf(t.value)};return yn(()=>{s(),dt(()=>[e.content,e.terms,e.options],s,{deep:!0})}),()=>Te("markdown",{ref:t})}},ute={props:["file","terms","options"],setup(e){let t=Ct(null),s=()=>Xe(()=>{t.value?.querySelectorAll("pre code").forEach(r=>window.Prism?.highlightElement(r)),uf(t.value),cf(t.value)});return yn(s),dt(()=>[e.file?.content,e.terms,e.options],s,{deep:!0}),()=>{let r=e.file||{},i=(r.filename||"").split(".").pop().toLowerCase();if(["md","markdown"].includes(i)||r.language==="Markdown")return Te("gist-file",{ref:t},Te(pf,{content:r.content,terms:e.terms,options:e.options}));let o={js:"javascript",jsx:"javascript",ts:"javascript",typescript:"javascript",py:"python",html:"markup",xml:"markup",svg:"markup",sh:"bash"},u=(r.language||i||"none").toLowerCase();return Te("gist-file",{ref:t},Te("pre",{class:"line-numbers"},Te("code",{class:"language-"+(o[u]||u),key:r.content},r.content||"")))}}},cte=e=>e?.querySelectorAll(".nb-input pre").forEach(t=>{if(t.parentElement?.classList.contains("nb-code-scroll"))return;let s=document.createElement("div");s.className="nb-code-scroll",t.replaceWith(s),s.appendChild(t);let r=()=>{let i=t.scrollWidth-t.clientWidth>1;if(s.classList.toggle("is-overflowing",i),s.classList.toggle("is-at-end",i&&t.scrollLeft+t.clientWidth>=t.scrollWidth-2),!i)return;let o=t.clientWidth-16,u=Math.max(24,o*t.clientWidth/t.scrollWidth);s.style.setProperty("--thumb-w",u+"px"),s.style.setProperty("--thumb-x",(o-u)*t.scrollLeft/(t.scrollWidth-t.clientWidth)+"px")};t.addEventListener("scroll",r,{passive:!0}),window.ResizeObserver?new ResizeObserver(r).observe(t):r(),r()}),pte={props:["file","content"],setup(e){let t=Ct(null),s=0,r,i=async()=>{let o=++s;r?.abort(),r=new AbortController;try{let u=e.content?JSON.parse(e.content):await fetch(e.file?.download_url||e.file,{signal:r.signal}).then(p=>{if(!p.ok)throw Error("Notebook request failed");return p.json()});if(await Zn("notebook"),o!==s)return;t.value.innerHTML=_o(DOMPurify.sanitize(nb.parse(u).render())),t.value.querySelectorAll("pre code").forEach(p=>window.Prism?.highlightElement(p)),cte(t.value)}catch(u){o===s&&u.name!=="AbortError"&&(t.value.textContent="Unable to render the notebook.")}};return yn(()=>{i(),dt(()=>[e.file,e.content],i)}),as(()=>{s++,r?.abort()}),()=>Te("notebook",{ref:t})}},fte={props:["stats"],setup(e){return()=>{let t=Object.entries(e.stats||{}).filter(([,r])=>r.code),s=t.reduce((r,[,i])=>r+i.code,0);return Te("loc",t.map(([r,i])=>Te("div",{class:"lang",title:`${r}: ${i.code.toLocaleString()} lines`,style:{width:i.code*100/s+"%",background:langColors[r]}})))}}},ff={Markdown:pf,GistFile:ute,Notebook:pte,Loc:fte,HtmlDoc:of,QuotaUsage:lte,Pdfviewer:Rd(async()=>(await Zn("pdf"),pdfjsLib.GlobalWorkerOptions.workerSrc="/script/external/pdf.worker.js",rf))},mf={async mounted(e,{value:t}){e._editorValue=t;try{if(await ci(),e._editorDisposed)return;let s=e._editorValue,r=ace.edit(e);e._editor=r,r.setValue(String(s.content??""),-1),df(e,s.options),e._editorCleanup=s.options?.onLoad?.(r)}catch(s){e._editorDisposed||(e.textContent=s.message)}},updated(e,{value:t}){e._editorValue=t,e._editor&&(e._editor.getValue()!==String(t.content??"")&&e._editor.setValue(String(t.content??""),-1),df(e,t.options))},beforeUnmount(e){e._editorDisposed=!0,e._editorCleanup?.(),e._editor?.destroy()}};function df(e,t={}){let s=dte.has(t.mode)?t.mode:"text";e._editor.session.setMode("ace/mode/"+s),t.theme&&e._editor.setTheme("ace/theme/"+t.theme),e._editor.setReadOnly(t.readOnly!==!1)}var hf={mounted(e){if(!window.IntersectionObserver)return;let t=[...e.querySelectorAll('a[href^="#"]')],s=new Set,r=new IntersectionObserver(i=>{i.forEach(u=>u.isIntersecting?s.add(u.target.id):s.delete(u.target.id));let o=t.find(u=>s.has(u.hash.slice(1)));o&&t.forEach(u=>u.classList.toggle("active",u===o))},{rootMargin:"-20% 0px -60% 0px",threshold:0});Xe(()=>{t.forEach(i=>{let o=document.getElementById(i.hash.slice(1));o&&r.observe(o)}),t[0]&&!t.some(i=>i.classList.contains("active"))&&t[0].classList.add("active")}),e._observer=r},beforeUnmount(e){e._observer?.disconnect()}};function gf(e){let t=[],s=0,r=/\bXXXX-(\d+)\b/g,i;for(;i=r.exec(e);)i.index>s&&t.push(e.slice(s,i.index)),t.push(Te("span",{class:"redact-slot",role:"img","aria-label":"Redacted term "+i[1]},[Te("i",null,i[1])])),s=i.index+i[0].length;return t.length?(s<e.length&&t.push(e.slice(s)),t):e}function mte(e){let t=gf(e),s=[];for(let r of Array.isArray(t)?t:[t]){if(typeof r!="string"){s.push(r);continue}let i=r.split(/(?<=[._-])/);i.forEach((o,u)=>{s.push(o),u<i.length-1&&s.push(Te("wbr"))})}return s}function hte(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB"],s=e/1024,r=0;for(;s>=1024&&r<t.length-1;)s/=1024,r++;return`${s.toFixed(1)} ${t[r]}`}function gte(e){let t={children:[]},s=new Map([["",t]]);function r(i){if(s.has(i))return s.get(i);let o=i
Line truncated
|
||||
/*! Bundled license information:
|
||||
|
||||
@vue/shared/dist/shared.esm-bundler.js:
|
||||
|
||||
Reference in new issue
Block a user