mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-11-14 00:07:00 +01:00
feat: add paid author and conference hosting with Stripe
This commit is contained in:
1 parent
b09ef0e5b0
commit
410863d253
54 files changed
+3263
-369
No files matched your search
+142
-9
@@ -1,3 +1,4 @@
|
||||
import { setupBilling, readBilling } from "./billing.js";
|
||||
import { reactive, nextTick } from "vue";
|
||||
import { createTimers, createListeners } from "./state.js";
|
||||
import { formDraft } from "./drafts.js";
|
||||
@@ -16,6 +17,19 @@ function previewTabKeydown(event) {
|
||||
// Page setup functions run inside Vue effect scopes.
|
||||
export const mainController = function (state, http, location, timeout) {
|
||||
state.previewTabKeydown = previewTabKeydown;
|
||||
state.headerCanUpgrade = false;
|
||||
state.headerBillingPending = ["success", "portal"].includes(new URLSearchParams(window.location.search).get("billing"));
|
||||
const updateHeaderBilling = billing => {
|
||||
const subscribed = (billing?.grants || []).some(g => ["author_monthly", "author_annual"].includes(g.planId) && ["active", "paid", "past_due"].includes(g.status) && new Date(g.until).getTime() > Date.now());
|
||||
state.headerCanUpgrade = !!billing?.enabled && billing.checkoutEnabled !== false && !subscribed && (billing.plans || []).some(p => ["author_monthly", "author_annual"].includes(p.id));
|
||||
};
|
||||
state.on("billing:updated", (_, billing) => updateHeaderBilling(billing));
|
||||
state.on("billing:pending", (_, pending) => { state.headerBillingPending = pending; });
|
||||
state.openHeaderUpgrade = () => {
|
||||
if (location.path() === "/profile") state.emit("settings:upgrade");
|
||||
else location.url("/profile?upgrade=1");
|
||||
};
|
||||
|
||||
state.title = "Main";
|
||||
state.user = { status: "connection" };
|
||||
state.site_options;
|
||||
@@ -78,6 +92,7 @@ export const mainController = function (state, http, location, timeout) {
|
||||
http.get("/api/user").then(
|
||||
(res) => {
|
||||
if (res) state.user = res.data;
|
||||
if (state.user?.username) readBilling(http).then(res => updateHeaderBilling(res.data)).catch(() => {});
|
||||
},
|
||||
() => {
|
||||
state.user = null;
|
||||
@@ -142,6 +157,26 @@ export const faqController = function (state, http) {
|
||||
};
|
||||
|
||||
export const profileController = function (state, http, translate, timeout, quotaService) {
|
||||
state.settingsTab = /(?:billing|upgrade)=/.test(window.location.search) ? "billing" : "defaults";
|
||||
state.confirmDeleteAccount = false;
|
||||
state.deleteUsername = "";
|
||||
state.profilePastSubscription = () => !state.profileAuthorGrant() && (state.billing?.grants || []).some(g => ["author_monthly", "author_annual"].includes(g.planId));
|
||||
state.showAuthorPlans = new URLSearchParams(window.location.search).get("upgrade") === "1";
|
||||
state.showRepositoryPass = false;
|
||||
state.profilePlan = "author_monthly";
|
||||
state.openProfileUpgrade = () => {
|
||||
state.settingsTab = "billing";
|
||||
state.showAuthorPlans = true;
|
||||
nextTick(() => document.getElementById("settings-plan-comparison")?.focus());
|
||||
};
|
||||
state.on("settings:upgrade", () => state.openProfileUpgrade());
|
||||
state.profileAuthorPlans = () => (state.billing?.plans || []).filter(p => ["author_monthly", "author_annual"].includes(p.id));
|
||||
state.profileSelectedPlan = () => state.profileAuthorPlans().find(p => p.id === state.profilePlan) || state.profileAuthorPlans()[0];
|
||||
state.profilePassPlan = () => (state.billing?.plans || []).find(p => p.id === "author_pass");
|
||||
state.profileAuthorGrant = () => (state.billing?.grants || []).find(g => ["author_monthly", "author_annual"].includes(g.planId) && ["active", "paid", "past_due"].includes(g.status) && new Date(g.until).getTime() > Date.now());
|
||||
state.profileGrantName = grant => ({ author_monthly: "Author monthly", author_annual: "Author annual", author_pass: "Repository pass", conference: "Conference hosting" }[grant.planId] || grant.planId);
|
||||
|
||||
setupBilling(state, http, () => quotaService.load().then(quota => { state.quota = quota; }, console.error));
|
||||
state.terms = "";
|
||||
state.options = {
|
||||
expirationMode: "remove",
|
||||
@@ -212,12 +247,7 @@ export const profileController = function (state, http, translate, timeout, quot
|
||||
};
|
||||
|
||||
state.deleteAccount = () => {
|
||||
if (
|
||||
!confirm(
|
||||
"Delete your account? All your anonymized repositories, gists, and pull requests will be removed, and your personal data will be erased. This cannot be undone."
|
||||
)
|
||||
)
|
||||
return;
|
||||
if (state.deletingAccount || !state.confirmDeleteAccount || state.deleteUsername !== state.user?.username) return;
|
||||
state.deletingAccount = true;
|
||||
http.delete("/api/user").then(
|
||||
() => {
|
||||
@@ -999,6 +1029,7 @@ export const prDashboardController = function (state, location) {
|
||||
export const statusController = function (state, http, params) {
|
||||
const timers = createTimers();
|
||||
state.repoId = params.repoId;
|
||||
state.reviewUrl = window.location.origin + "/r/" + encodeURIComponent(params.repoId) + "/";
|
||||
state.repo = null;
|
||||
state.progress = 0;
|
||||
state.rateLimitResetAt = 0;
|
||||
@@ -1127,6 +1158,72 @@ export const anonymizeController = function (state, http, html, params, location
|
||||
? "gist:" + parsed.gistId.toLowerCase()
|
||||
: (parsed.owner + "/" + parsed.repo).toLowerCase() + (parsed.pullRequestId ? "/pull/" + parsed.pullRequestId : "");
|
||||
const draft = formDraft(state, ["sourceUrl", "terms", "repoId", "pullRequestId", "gistId", "source", "options", "conference", "githubConnection"], "anonymize:" + (location.path?.() || ""));
|
||||
let checkoutDraftId = null;
|
||||
let checkoutDraftSnapshot = null;
|
||||
state.hostingReview = false;
|
||||
state.previewExpanded = false;
|
||||
state.taskValidationError = "";
|
||||
state.editRepository = () => {
|
||||
state.mobilePane = "settings";
|
||||
state.previewExpanded = false;
|
||||
nextTick(() => document.querySelector(".anonymize-fields .is-invalid")?.focus());
|
||||
};
|
||||
state.submitRepository = (event) => {
|
||||
state.taskValidationError = "";
|
||||
if (state.sourceLoading || state.billingBusy || state.hostingSaving || state.billingPending) return;
|
||||
if (expirationDateInvalid() || state.anonymize?.invalid || state.sourceUrlError) {
|
||||
state.taskValidationError = "Check the highlighted fields before continuing.";
|
||||
state.editRepository();
|
||||
return;
|
||||
}
|
||||
if (state.hostingNeedsPayment()) return state.checkoutRepository();
|
||||
return state.anonymizeRepo(event);
|
||||
};
|
||||
state.hostingPayment = false;
|
||||
state.hostingAlternatives = false;
|
||||
state.hostingPrice = plan => {
|
||||
if (plan.amount == null) return "Price shown at checkout";
|
||||
const amount = new Intl.NumberFormat(undefined, { style: "currency", currency: plan.currency, minimumFractionDigits: 0, maximumFractionDigits: 2 }).format(plan.amount / 100);
|
||||
return amount + (plan.interval === "year" ? " billed annually" : " billed monthly");
|
||||
};
|
||||
state.hostingPlan = "author_monthly";
|
||||
state.hostingSaving = false;
|
||||
state.selectedHostingPlan = () => state.authorPlans().find(p => p.id === state.hostingPlan) || state.authorPlans()[0];
|
||||
const loadHostingQuota = () => http.get("/api/user/quota").then(res => { state.hostingQuota = res.data; });
|
||||
setupBilling(state, http, async () => {
|
||||
await loadHostingQuota();
|
||||
state.hostingQuotaBlocked = false;
|
||||
}, { confirmedMessage: "Hosting status refreshed. Your draft is ready to continue." });
|
||||
loadHostingQuota().catch(() => {});
|
||||
state.authorPlans = () => (state.billing?.plans || []).filter(p => ["author_monthly", "author_annual"].includes(p.id));
|
||||
state.hasAuthorHosting = () => ["author_monthly", "author_annual"].includes(state.billing?.allowance?.plan);
|
||||
state.hostingNeedsPayment = () => {
|
||||
if (!state.billing?.enabled || state.detectedType !== "repo" || state.hasAuthorHosting() ||
|
||||
(state.isUpdate && state.role !== "owner")) return false;
|
||||
const needsLifetime = state.options?.expirationMode === "never" && !state._existingNever;
|
||||
const quota = state.hostingQuota?.repository;
|
||||
const full = !state.isUpdate && !state.conference && quota && quota.used >= quota.total;
|
||||
return !!(needsLifetime || (!state.conference && (full || state.hostingQuotaBlocked)));
|
||||
};
|
||||
state.checkoutRepository = async (pass = false) => {
|
||||
if (state.hostingSaving || state.billingBusy || !state.billing?.csrf || state.sourceLoading) return;
|
||||
state.hostingSaving = true;
|
||||
state.billingError = "";
|
||||
try {
|
||||
const values = draft.checkpoint();
|
||||
const serialized = JSON.stringify(values);
|
||||
if (!checkoutDraftId || serialized !== checkoutDraftSnapshot) {
|
||||
const saved = await http.post("/api/billing/draft", { path: location.path(), values }, { headers: { "x-csrf-token": state.billing.csrf } });
|
||||
checkoutDraftId = saved.data.id;
|
||||
checkoutDraftSnapshot = serialized;
|
||||
}
|
||||
const plan = state.authorPlans().find(p => p.id === state.hostingPlan) || state.authorPlans()[0];
|
||||
if (!pass && !plan) throw new Error("No author plan available");
|
||||
await state.checkout(pass ? "author_pass" : plan.id, pass ? state.repoId : "", { draftId: checkoutDraftId });
|
||||
} catch { state.billingError = "Your draft could not be saved for checkout. Your form is unchanged. Please try again."; }
|
||||
finally { state.hostingSaving = false; }
|
||||
};
|
||||
state.useDatedHosting = () => { state.options.expirationMode = "remove"; };
|
||||
state.discardDraft = async () => {
|
||||
draft.discard();
|
||||
state.workspaceOpen = !!state.sourceUrl;
|
||||
@@ -1292,6 +1389,26 @@ export const anonymizeController = function (state, http, html, params, location
|
||||
}
|
||||
|
||||
async function restoreGitHubDraft() {
|
||||
const billingDraft = new URLSearchParams(window.location.search).get("billingDraft");
|
||||
if (billingDraft) {
|
||||
draft.restore();
|
||||
try {
|
||||
const saved = (await http.get("/api/billing/draft/" + encodeURIComponent(billingDraft))).data;
|
||||
if (saved.path !== location.path()) throw new Error("Wrong task");
|
||||
for (const key of ["sourceUrl", "terms", "repoId", "source", "options", "conference", "githubConnection"]) {
|
||||
if (Object.prototype.hasOwnProperty.call(saved.values, key)) state[key] = saved.values[key];
|
||||
}
|
||||
if (state.options?.expirationDate) state.options.expirationDate = new Date(state.options.expirationDate);
|
||||
checkoutDraftId = saved.id;
|
||||
checkoutDraftSnapshot = JSON.stringify(draft.checkpoint());
|
||||
state.draftRestored = true;
|
||||
state.hostingReview = true;
|
||||
if (state.sourceUrl) await refreshGitHubAccess();
|
||||
// Consume the return token so revisiting the form cannot overwrite newer edits.
|
||||
location.replace?.(location.path());
|
||||
return true;
|
||||
} catch { state.billingError = "The checkout draft could not be restored. Retry by reloading this page; any local draft is still available."; }
|
||||
}
|
||||
let saved;
|
||||
try { saved = JSON.parse(sessionStorage.getItem("github-access-draft") || "null"); }
|
||||
catch (_) { return false; }
|
||||
@@ -1325,6 +1442,7 @@ export const anonymizeController = function (state, http, html, params, location
|
||||
state.terms = res.data.options.terms.filter((f) => f).join("\n");
|
||||
state.source = res.data.source;
|
||||
state.role = res.data.role || "owner";
|
||||
state._existingNever = res.data.options.expirationMode === "never";
|
||||
state.coauthors = res.data.coauthors || [];
|
||||
// Remember the saved branch so the source.branch watcher knows
|
||||
// not to bump source.commit to GitHub HEAD on edit-page load
|
||||
@@ -1925,6 +2043,7 @@ export const anonymizeController = function (state, http, html, params, location
|
||||
// When the picked date fails min/max validation AngularJS sets the model
|
||||
// to undefined, so we check both the field validity and the model value.
|
||||
function expirationDateInvalid() {
|
||||
if (state.detectedType === "repo" && state.options.expirationMode === "never") return false;
|
||||
const field = state.anonymize && state.anonymize.expirationDate;
|
||||
if (!state.options.expirationDate || (field && field.invalid)) {
|
||||
if (field && field.setDirty) field.setDirty();
|
||||
@@ -2023,11 +2142,18 @@ export const anonymizeController = function (state, http, html, params, location
|
||||
state.anonymizeRepo = (event) => {
|
||||
if (state.sourceLoading) { state.error = "Wait for the source to finish loading before saving."; return; }
|
||||
if (state.reconnectingSource && !state.reconnectRepositoryId) return;
|
||||
if (expirationDateInvalid()) return;
|
||||
if (expirationDateInvalid()) { state.editRepository(); return; }
|
||||
if (state.anonymize?.invalid || state.sourceUrlError) {
|
||||
state.editRepository();
|
||||
state.error = "Please correct the highlighted fields before saving.";
|
||||
return;
|
||||
}
|
||||
// Capacity is enforced on the server, which can release removed reservations.
|
||||
if (state.hostingNeedsPayment() && state.options.expirationMode === "never") {
|
||||
state.hostingReview = true;
|
||||
nextTick(() => document.getElementById("repository-hosting")?.scrollIntoView({ block: "center" }));
|
||||
return;
|
||||
}
|
||||
const button = event.currentTarget || event.target.closest?.("button") || event.target;
|
||||
button.disabled = true;
|
||||
const o = parseGithubUrl(state.sourceUrl);
|
||||
@@ -2051,6 +2177,12 @@ export const anonymizeController = function (state, http, html, params, location
|
||||
if (error.data) {
|
||||
translate("ERRORS." + error.data.error).then((t) => { state.error = t; }, console.error);
|
||||
displayErrorMessage(error.data.error);
|
||||
if (["quota_exceeded", "subscription_required_for_never_expiration"].includes(error.data.error)) {
|
||||
if (error.data.error === "subscription_required_for_never_expiration") state._existingNever = false;
|
||||
state.hostingQuotaBlocked = true;
|
||||
state.hostingReview = true;
|
||||
nextTick(() => document.getElementById("repository-hosting")?.scrollIntoView({ block: "center" }));
|
||||
}
|
||||
}
|
||||
}
|
||||
).finally(() => { button.disabled = false; });
|
||||
@@ -3003,7 +3135,7 @@ export const newConferenceController = function (state, http, location, params)
|
||||
state.error = "";
|
||||
|
||||
function getConference() {
|
||||
http
|
||||
return http
|
||||
.get("/api/conferences/" + params.conferenceId)
|
||||
.then((res) => {
|
||||
state.options = { ...state.options, ...res.data, billing: res.data.billing || {} };
|
||||
@@ -3030,7 +3162,7 @@ export const newConferenceController = function (state, http, location, params)
|
||||
start.setDate(1);
|
||||
start.setMonth(start.getMonth() + 1);
|
||||
const end = new Date(start);
|
||||
end.setMonth(start.getMonth() + 7, 0);
|
||||
end.setTime(start.getTime() + 179 * 86400000);
|
||||
state.options = {
|
||||
billing: {},
|
||||
startDate: start,
|
||||
@@ -3142,6 +3274,7 @@ export const newConferenceController = function (state, http, location, params)
|
||||
};
|
||||
|
||||
export const conferenceController = function (state, http, location, params) {
|
||||
setupBilling(state, http, () => getConference(), { confirmedMessage: "Payment status checked. Your conference is ready for submissions once payment is confirmed." });
|
||||
state.watch("user.status", () => {
|
||||
if (state.user == null) {
|
||||
location.url("/");
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
// Share concurrent catalog reads between the app header and the current page.
|
||||
const billingReads = new WeakMap();
|
||||
export function readBilling(http) {
|
||||
if (!billingReads.has(http)) {
|
||||
const request = http.get("/api/billing/").finally(() => billingReads.delete(http));
|
||||
billingReads.set(http, request);
|
||||
}
|
||||
return billingReads.get(http);
|
||||
}
|
||||
export function setupBilling(state, http, onRefresh = () => {}, context = {}) {
|
||||
const outcome = new URLSearchParams(window.location.search).get("billing");
|
||||
state.billing = null;
|
||||
state.billingLoading = true;
|
||||
state.billingBusy = false;
|
||||
state.billingError = "";
|
||||
state.billingNotice = "";
|
||||
state.billingPending = outcome === "success" || outcome === "portal";
|
||||
state.billingRepository = "";
|
||||
const messages = {
|
||||
billing_invalid_draft: "This draft could not be saved. Your form is unchanged. Try again.",
|
||||
billing_draft_not_found: "This checkout draft is unavailable or expired. Your local form is unchanged.",
|
||||
billing_recovery_required: "Your earlier payment needs verification. Please contact support before paying again.",
|
||||
billing_checkout_disabled: "New purchases are temporarily unavailable. You can still manage existing billing.",
|
||||
billing_unavailable: "Payments are not available yet. Please try again later.",
|
||||
billing_subscription_exists: "You already have a subscription. Use Manage billing to change or cancel it.",
|
||||
billing_checkout_in_progress: "You have another checkout open. Complete it or wait for it to expire before choosing a different plan.",
|
||||
billing_busy: "Another billing request is processing. Please try again shortly.",
|
||||
billing_already_paid: "This repository or conference already has an active paid package.",
|
||||
billing_invalid_review_window: "Conference packages cover up to 180 days. Check the review dates.",
|
||||
billing_invalid_conference: "Only a conference owner can pay for a conference awaiting payment.",
|
||||
repo_not_found: "Enter the ID of an existing repository that you own.",
|
||||
};
|
||||
state.billingPrice = plan => {
|
||||
if (plan.amount == null) return "Price shown at checkout";
|
||||
const amount = new Intl.NumberFormat(undefined, { style: "currency", currency: plan.currency }).format(plan.amount / 100);
|
||||
return amount + (plan.interval ? ` / ${plan.intervalCount > 1 ? plan.intervalCount + " " : ""}${plan.interval}` : " once");
|
||||
};
|
||||
state.billingBytes = value => {
|
||||
const bytes = Number(value) || 0;
|
||||
if (bytes < 1024) return `${bytes} B`;
|
||||
const exponent = Math.min(4, Math.floor(Math.log2(bytes) / 10));
|
||||
return `${new Intl.NumberFormat(undefined, { maximumFractionDigits: 1 }).format(bytes / 1024 ** exponent)} ${["B", "KiB", "MiB", "GiB", "TiB"][exponent]}`;
|
||||
};
|
||||
state.billingDate = value => value ? new Date(value).toLocaleDateString() : "";
|
||||
state.loadBilling = () => { state.billingError = ""; state.billingLoading = true; return readBilling(http).then(res => { state.billing = res.data; state.emit?.("billing:updated", res.data); })
|
||||
.catch(() => { state.billingError = "Billing could not be loaded. Try again."; })
|
||||
.finally(() => { state.billingLoading = false; }); };
|
||||
async function action(path, body, redirect = true) {
|
||||
if (state.billingBusy || !state.billing?.csrf) return;
|
||||
state.billingBusy = true;
|
||||
state.billingError = "";
|
||||
try {
|
||||
const response = await http.post(`/api/billing/${path}`, body, { headers: { "x-csrf-token": state.billing.csrf } });
|
||||
if (redirect) window.location.assign(response.data.url);
|
||||
else {
|
||||
await state.loadBilling();
|
||||
await onRefresh();
|
||||
state.billingPending = !!response.data.pending;
|
||||
state.emit?.("billing:pending", state.billingPending);
|
||||
state.billingNotice = response.data.pending ? "Your payment is still pending. Please do not pay again." : (context.confirmedMessage || "Billing status refreshed. Your confirmed access appears below.");
|
||||
return response.data;
|
||||
}
|
||||
} catch (error) { state.billingError = messages[error.data?.error] || "The billing request failed. Please try again."; }
|
||||
finally { state.billingBusy = false; }
|
||||
}
|
||||
state.checkout = (planId, target = "", extra = {}) => action("checkout", { planId, target, ...extra });
|
||||
state.billingPortal = () => action("portal", {});
|
||||
state.refreshBilling = () => action("refresh", {}, false);
|
||||
async function confirmPayment() {
|
||||
for (let attempt = 0; attempt < 5; attempt++) {
|
||||
const result = await state.refreshBilling();
|
||||
if (!result || !result.pending) return;
|
||||
await new Promise(resolve => window.setTimeout(resolve, 3000));
|
||||
}
|
||||
state.billingNotice = "Confirmation is taking longer than usual. You can refresh payment status later. Please do not pay again.";
|
||||
}
|
||||
state.loadBilling().then(() => {
|
||||
if (outcome === "success" || outcome === "portal") {
|
||||
state.billingNotice = "Checking your payment. Paid access starts after confirmation.";
|
||||
confirmPayment();
|
||||
} else if (outcome === "cancelled") state.billingNotice = "Checkout was closed. No new paid access has been activated.";
|
||||
});
|
||||
}
|
||||
@@ -8,7 +8,7 @@ const QuotaUsage = {
|
||||
props: ["quota", "fmt"],
|
||||
setup(props) {
|
||||
return { formatAmount: (value, kind) => kind === "bytes"
|
||||
? props.fmt.humanFileSize(value).replace(/([a-zA-Z]+)$/, " $1") : props.fmt.number(value) };
|
||||
? props.fmt.humanFileSize(props.quota?.storage?.unit === "bytes" ? value * 8 : value).replace(/([a-zA-Z]+)$/, " $1") : props.fmt.number(value) };
|
||||
},
|
||||
render: quotaUsageTemplate,
|
||||
};
|
||||
|
||||
@@ -49,7 +49,12 @@ export function formDraft(state, fields, key) {
|
||||
state.unsavedChanges = serialize() !== baseline;
|
||||
return !!restored;
|
||||
},
|
||||
checkpoint() { return JSON.parse(serialize()); },
|
||||
checkpoint() {
|
||||
document.querySelectorAll("input, select, textarea").forEach(el => {
|
||||
if (el._field?.binding.state === state && el._field.timer) el._field.commit();
|
||||
});
|
||||
return JSON.parse(serialize());
|
||||
},
|
||||
accept(saved) {
|
||||
baseline = JSON.stringify(saved);
|
||||
state.draftRestored = false;
|
||||
|
||||
@@ -92,7 +92,7 @@ export function submitForm(event, callback) {
|
||||
if (el._field) validate(el);
|
||||
});
|
||||
if (form && !form.checkValidity()) {
|
||||
const invalid = form.querySelector(":invalid");
|
||||
const invalid = form.querySelector("input:invalid, select:invalid, textarea:invalid");
|
||||
invalid?.scrollIntoView?.({ block: "center" });
|
||||
invalid?.focus();
|
||||
form.reportValidity();
|
||||
|
||||
@@ -44,6 +44,7 @@ export function mountApplication(target = "#app", options = {}) {
|
||||
const timers = createTimers();
|
||||
const location = {
|
||||
url(value) { if (value === undefined) return router.currentRoute.value.fullPath; router.push(value); return location; },
|
||||
replace(value) { return router.replace(value); },
|
||||
path() { return router.currentRoute.value.path; },
|
||||
search() { return router.currentRoute.value.query; },
|
||||
};
|
||||
|
||||
Vendored
+23
-23
@@ -1,30 +1,30 @@
|
||||
"use strict";(()=>{var nd=Object.defineProperty;var rd=(e,t)=>{for(var n in t)nd(e,n,{get:t[n],enumerable:!0})};var he=["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={notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",markdown:"/script/markdown.44f2e93820.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",editor:"/script/editor.4f142d3adc.min.js"};var cs=new Map,ld=ve;function xt(e){if(!cs.has(e)){let t=document.createElement("script");t.src=ld[e];let n=new Promise((r,s)=>{t.onload=r,t.onerror=()=>{cs.delete(e),t.remove(),s(new Error(`Unable to load ${e}. Please retry.`))}});cs.set(e,n),document.head.appendChild(t)}return cs.get(e)}async function ur(){await xt("editor"),ace.config.set("basePath","/script/external/ace/")}function ho(e){let t=Object.create(null);for(let n of e.split(","))t[n]=1;return n=>n in t}var Ve={},Xt=[],at=()=>{},rn=()=>!1,vo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),go=e=>e.startsWith("onUpdate:"),Ge=Object.assign,Po=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},dd=Object.prototype.hasOwnProperty,De=(e,t)=>dd.call(e,t),ye=Array.isArray,Ut=e=>Vo(e)==="[object Map]",Ft=e=>Vo(e)==="[object Set]",cr=e=>Vo(e)==="[object Date]";var we=e=>typeof e=="function",ze=e=>typeof e=="string",mt=e=>typeof e=="symbol",Te=e=>e!==null&&typeof e=="object",an=e=>(Te(e)||we(e))&&we(e.then)&&we(e.catch),hr=Object.prototype.toString,Vo=e=>hr.call(e),ln=e=>Vo(e).slice(8,-1),ps=e=>Vo(e)==="[object Object]",fs=e=>ze(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,yo=ho(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var ms=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},ud=/-\w/g,Je=ms(e=>e.replace(ud,t=>t.slice(1).toUpperCase())),cd=/\B([A-Z])/g,St=ms(e=>e.replace(cd,"-$1").toLowerCase()),eo=ms(e=>e.charAt(0).toUpperCase()+e.slice(1)),qo=ms(e=>e?`on${eo(e)}`:""),yt=(e,t)=>!Object.is(e,t),bo=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},hs=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},wo=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var pr,Mo=()=>pr||(pr=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Me(e){if(ye(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],s=ze(r)?hd(r):Me(r);if(s)for(let i in s)t[i]=s[i]}return t}else if(ze(e)||Te(e))return e}var pd=/;(?![^(]*\))/g,fd=/:([^]+)/,md=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function hd(e){let t={};return e.replace(md,n=>n.startsWith("/*")?"":n).split(pd).forEach(n=>{if(n){let r=n.split(fd);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function T(e){let t="";if(ze(e))t=e;else if(ye(e))for(let n=0;n<e.length;n++){let r=T(e[n]);r&&(t+=r+" ")}else if(Te(e))for(let n in e)e[n]&&(t+=n+" ");return t.trim()}var vr="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",gr=ho(vr),vd=ho(vr+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function vs(e){return!!e||e===""}function gd(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let s=0;r&&s<e.length;s++)r=Nt(e[s],t[s],n);return r}function fr(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),s=new Uint8Array(r.length);for(let i of e){let a=-1;for(let u=0;u<r.length;u++)if(!s[u]&&Nt(i,r[u],n)){a=u;break}if(a<0)return!1;s[a]=1Line truncated
|
||||
`))),e[uo]=Ws(s);let i=r||s.props&&s.props.type==="number";lo(e,t?"change":"input",a=>{a.target.composing||e[uo](Hn(e.value,n,i))}),(n||i)&&lo(e,"change",()=>{e.value=Hn(e.value,n,i)}),t||(lo(e,"compositionstart",lc),lo(e,"compositionend",Yi),lo(e,"change",Yi))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let s=t??"",i=e[js];delete e[js],i!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==i?e[uo](Hn(e.value,n,r)):e.value=s},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:s,number:i}},a){if(e[uo]=Ws(a),e.composing)return;let u=(i||e.type==="number")&&!/^0\d/.test(e.value)?wo(e.value):e.value,f=t??"";if(u===f)return;let h=e.getRootNode();(h instanceof Document||h instanceof ShadowRoot)&&h.activeElement===e&&e.type!=="range"&&(r&&t===n||s&&e.value.trim()===f)||(e.value=f)}};var ea={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,lo(e,"change",()=>{let s=Array.prototype.filter.call(e.options,f=>f.selected).map(f=>n?wo(Ks(f)):Ks(f)),i=e.multiple,a=i?Ft(e._modelValue)?new Set(s):s:s[0],u=e._pendingValue=[i,i?ye(a)?s.slice():s:a];try{e[uo](a)}finally{st(()=>{e._pendingValue===u&&(e._pendingValue=void 0)})}}),e[uo]=Ws(r)},mounted(e,{value:t}){Ji(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[uo]=Ws(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!dc(t,n[1],n[0]))&&Ji(e,t)}};function dc(e,t,n){if(!n)return Nt(e,t);if(ye(e))return Nt(e,t);if(Ft(e)){if(e.size!==t.length)return!1;for(let r of t)if(!e.has(r))return!1;return!0}return!1}function Ji(e,t){let n=e.multiple,r=ye(t);if(!(n&&!r&&!Ft(t))){for(let s=0,i=e.options.length;s<i;s++){let a=e.options[s],u=Ks(a);if(n)if(r){let f=typeof u;f==="string"||f==="number"?a.selected=t.some(h=>String(h)===String(u)):a.selected=yr(t,u)>-1}else a.selected=t.has(u);else if(Nt(Ks(a),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ks(e){return"_value"in e?e._value:e.value}var uc=["ctrl","shift","alt","meta"],cc={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)=>uc.some(n=>e[`${n}Key`]&&!t.includes(n))},me=(e,t)=>{if(!e)return e;let n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((s,...i)=>{for(let a=0;a<t.length;a++){let u=cc[t[a]];if(u&&u(s,t))return}return e(s,...i)}))},pc={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Ro=(e,t)=>{let n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;let i=St(s.key);if(t.some(a=>a===i||pc[a]===i))return e(s)}))},fc=Ge({patchProp:rc},Bu),Qi;function mc(){return Qi||(Qi=Ai(fc))}var ta=((...e)=>{let t=mc().createApp(...e),{mount:n}=t;return t.mount=r=>{let s=vc(r);if(!s)return;let i=t._component;!we(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");let a=n(s,!1,hc(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),a},t});function hc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function vc(e){return ze(e)?document.querySelector(e):e}var fo=typeof document<"u";function sa(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function gc(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&sa(e.default)}var Oe=Object.assign;function Ys(e,t){let n={};for(let r in t){let s=t[r];n[r]=kt(s)?s.map(e):e(s)}return n}var Ao=()=>{},kt=Array.isArray;function Wn(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var na=/#/g,yc=/&/g,bc=/\//g,wc=/=/g,kc=/\?/g,ra=/\+/g,Ec=/%5B/g,Cc=/%5D/g,ia=/%5E/g,_c=/%60/g,aa=/%7B/g,Sc=/%7C/g,la=/%7D/g,Nc=/%20/g;function Kn(e){return e==null?"":encodeURI(""+e).replace(Sc,"|").replace(Ec,"[").replace(Cc,"]")}function da(e){return Kn(e).replace(aa,"{").replace(la,"}").replace(ia,"^")}function jn(e){return Kn(e).replace(ra,"%2B").replace(Nc,"+").replace(na,"%23").replace(yc,"%26").replace(_c,"`").replace(aa,"{").replace(la,"}").replace(ia,"^")}function Dc(e){return jn(e).replace(wc,"%3D")}function Rc(e){return Kn(e).replace(na,"%23").replace(kc,"%3F")}function ua(e){return Rc(e).replace(bc,"%2F")}function To(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}var Tc=/\/$/,Ac=e=>e.replace(Tc,"");function Js(e,t,n="/"){let r,s={},i="",a="",u=t.indexOf("#"),f=t.indexOf("?");return f=u>=0&&f>u?-1:f,f>=0&&(r=t.slice(0,f),i=t.slice(f,u>0?u:t.length),s=e(i.slice(1))),u>=0&&(r=r||t.slice(0,u),a=t.slice(u,t.length)),r=Ic(r??t,n),{fullPath:r+i+a,path:r,query:s,hash:To(a)}}function ca(e,t){let n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Yn(e,t){return!t||!e.toLowerCase().sLine truncated
|
||||
"use strict";(()=>{var ad=Object.defineProperty;var ld=(e,t)=>{for(var s in t)ad(e,s,{get:t[s],enumerable:!0})};var fe=["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 he={notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",markdown:"/script/markdown.44f2e93820.min.js",editor:"/script/editor.4f142d3adc.min.js"};var fo=new Map,cd=he;function xt(e){if(!fo.has(e)){let t=document.createElement("script");t.src=cd[e];let s=new Promise((i,o)=>{t.onload=i,t.onerror=()=>{fo.delete(e),t.remove(),o(new Error(`Unable to load ${e}. Please retry.`))}});fo.set(e,s),document.head.appendChild(t)}return fo.get(e)}async function mi(){await xt("editor"),ace.config.set("basePath","/script/external/ace/")}function mn(e){let t=Object.create(null);for(let s of e.split(","))t[s]=1;return s=>s in t}var Pe={},Xt=[],at=()=>{},us=()=>!1,vn=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),gn=e=>e.startsWith("onUpdate:"),Ge=Object.assign,In=(e,t)=>{let s=e.indexOf(t);s>-1&&e.splice(s,1)},pd=Object.prototype.hasOwnProperty,Re=(e,t)=>pd.call(e,t),ve=Array.isArray,Ut=e=>Vn(e)==="[object Map]",Ft=e=>Vn(e)==="[object Set]",vi=e=>Vn(e)==="[object Date]";var be=e=>typeof e=="function",Be=e=>typeof e=="string",ht=e=>typeof e=="symbol",Ae=e=>e!==null&&typeof e=="object",cs=e=>(Ae(e)||be(e))&&be(e.then)&&be(e.catch),wi=Object.prototype.toString,Vn=e=>wi.call(e),ps=e=>Vn(e).slice(8,-1),ho=e=>Vn(e)==="[object Object]",mo=e=>Be(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,yn=mn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted");var vo=e=>{let t=Object.create(null);return(s=>t[s]||(t[s]=e(s)))},fd=/-\w/g,Je=vo(e=>e.replace(fd,t=>t.slice(1).toUpperCase())),hd=/\B([A-Z])/g,St=vo(e=>e.replace(hd,"-$1").toLowerCase()),en=vo(e=>e.charAt(0).toUpperCase()+e.slice(1)),qn=vo(e=>e?`on${en(e)}`:""),yt=(e,t)=>!Object.is(e,t),bn=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},go=(e,t,s,i=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:s})},wn=e=>{let t=parseFloat(e);return isNaN(t)?e:t};var gi,Mn=()=>gi||(gi=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ve(e){if(ve(e)){let t={};for(let s=0;s<e.length;s++){let i=e[s],o=Be(i)?yd(i):Ve(i);if(o)for(let r in o)t[r]=o[r]}return t}else if(Be(e)||Ae(e))return e}var md=/;(?![^(]*\))/g,vd=/:([^]+)/,gd=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function yd(e){let t={};return e.replace(gd,s=>s.startsWith("/*")?"":s).split(md).forEach(s=>{if(s){let i=s.split(vd);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function A(e){let t="";if(Be(e))t=e;else if(ve(e))for(let s=0;s<e.length;s++){let i=A(e[s]);i&&(t+=i+" ")}else if(Ae(e))for(let s in e)e[s]&&(t+=s+" ");return t.trim()}var ki="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ei=mn(ki),bd=mn(ki+",async,autofocus,autoplay,controls,default,defer,disabled,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function yo(e){return!!e||e===""}function wd(e,t,s){if(e.length!==t.length)return!1;let i=!0;for(let o=0;i&&o<e.length;o++)i=Nt(e[o],t[o],s);return i}function yi(e,t,s){if(e.size!==t.size)return!1;let i=Array.from(t),o=new Uint8Array(i.length);for(let r of e){let a=-1;for(let c=0;c<i.length;c++)if(!o[c]&&Nt(r,i[c],s)){a=c;break}if(a<0)return!1;o[a]=1Line truncated
|
||||
`))),e[un]=Yo(o);let r=i||o.props&&o.props.type==="number";dn(e,t?"change":"input",a=>{a.target.composing||e[un](Ws(e.value,s,r))}),(s||r)&&dn(e,"change",()=>{e.value=Ws(e.value,s,r)}),t||(dn(e,"compositionstart",cc),dn(e,"compositionend",xr),dn(e,"change",xr))},mounted(e,{value:t,modifiers:{trim:s,number:i}}){let o=t??"",r=e[Wo];delete e[Wo],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[un](Ws(e.value,s,i)):e.value=o},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:i,trim:o,number:r}},a){if(e[un]=Yo(a),e.composing)return;let c=(r||e.type==="number")&&!/^0\d/.test(e.value)?wn(e.value):e.value,f=t??"";if(c===f)return;let v=e.getRootNode();(v instanceof Document||v instanceof ShadowRoot)&&v.activeElement===e&&e.type!=="range"&&(i&&t===s||o&&e.value.trim()===f)||(e.value=f)}};var Jo={deep:!0,created(e,{value:t,modifiers:{number:s}},i){e._modelValue=t,dn(e,"change",()=>{let o=Array.prototype.filter.call(e.options,f=>f.selected).map(f=>s?wn(Qo(f)):Qo(f)),r=e.multiple,a=r?Ft(e._modelValue)?new Set(o):o:o[0],c=e._pendingValue=[r,r?ve(a)?o.slice():o:a];try{e[un](a)}finally{Ye(()=>{e._pendingValue===c&&(e._pendingValue=void 0)})}}),e[un]=Yo(i)},mounted(e,{value:t}){ea(e,t)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[un]=Yo(s)},updated(e,{value:t}){let s=e._pendingValue;e._pendingValue=void 0,(!s||s[0]!==e.multiple||!pc(t,s[1],s[0]))&&ea(e,t)}};function pc(e,t,s){if(!s)return Nt(e,t);if(ve(e))return Nt(e,t);if(Ft(e)){if(e.size!==t.length)return!1;for(let i of t)if(!e.has(i))return!1;return!0}return!1}function ea(e,t){let s=e.multiple,i=ve(t);if(!(s&&!i&&!Ft(t))){for(let o=0,r=e.options.length;o<r;o++){let a=e.options[o],c=Qo(a);if(s)if(i){let f=typeof c;f==="string"||f==="number"?a.selected=t.some(v=>String(v)===String(c)):a.selected=Ci(t,c)>-1}else a.selected=t.has(c);else if(Nt(Qo(a),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Qo(e){return"_value"in e?e._value:e.value}var fc=["ctrl","shift","alt","meta"],hc={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)=>fc.some(s=>e[`${s}Key`]&&!t.includes(s))},ue=(e,t)=>{if(!e)return e;let s=e._withMods||(e._withMods={}),i=t.join(".");return s[i]||(s[i]=((o,...r)=>{for(let a=0;a<t.length;a++){let c=hc[t[a]];if(c&&c(o,t))return}return e(o,...r)}))},mc={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Rn=(e,t)=>{let s=e._withKeys||(e._withKeys={}),i=t.join(".");return s[i]||(s[i]=(o=>{if(!("key"in o))return;let r=St(o.key);if(t.some(a=>a===r||mc[a]===r))return e(o)}))},vc=Ge({patchProp:lc},Wu),ta;function gc(){return ta||(ta=qr(vc))}var sa=((...e)=>{let t=gc().createApp(...e),{mount:s}=t;return t.mount=i=>{let o=bc(i);if(!o)return;let r=t._component;!be(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");let a=s(o,!1,yc(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),a},t});function yc(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function bc(e){return Be(e)?document.querySelector(e):e}var fn=typeof document<"u";function ra(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function wc(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&ra(e.default)}var Oe=Object.assign;function Xo(e,t){let s={};for(let i in t){let o=t[i];s[i]=kt(o)?o.map(e):e(o)}return s}var An=()=>{},kt=Array.isArray;function Js(e,t){let s={};for(let i in e)s[i]=i in t?t[i]:e[i];return s}var aa=/#/g,kc=/&/g,Ec=/\//g,Cc=/=/g,_c=/\?/g,la=/\+/g,Sc=/%5B/g,Nc=/%5D/g,da=/%5E/g,Dc=/%60/g,ua=/%7B/g,Rc=/%7C/g,ca=/%7D/g,Tc=/%20/g;function Xs(e){return e==null?"":encodeURI(""+e).replace(Rc,"|").replace(Sc,"[").replace(Nc,"]")}function pa(e){return Xs(e).replace(ua,"{").replace(ca,"}").replace(da,"^")}function Ys(e){return Xs(e).replace(la,"%2B").replace(Tc,"+").replace(aa,"%23").replace(kc,"%26").replace(Dc,"`").replace(ua,"{").replace(ca,"}").replace(da,"^")}function Ac(e){return Ys(e).replace(Cc,"%3D")}function Oc(e){return Xs(e).replace(aa,"%23").replace(_c,"%3F")}function fa(e){return Oc(e).replace(Ec,"%2F")}function Tn(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}var Pc=/\/$/,Ic=e=>e.replace(Pc,"");function Zo(e,t,s="/"){let i,o={},r="",a="",c=t.indexOf("#"),f=t.indexOf("?");return f=c>=0&&f>c?-1:f,f>=0&&(i=t.slice(0,f),r=t.slice(f,c>0?c:t.length),o=e(r.slice(1))),c>=0&&(i=i||t.slice(0,c),a=t.slice(c,t.length)),i=qc(i??t,s),{fullPath:i+r+a,path:i,query:o,hash:Tn(a)}}function ha(e,t){let s=t.query?e(t.query):"";return t.path+(s&&"?")+s+(t.hash||"")}function Zs(e,t){return!t||!e.toLowerCase().sLine truncated
|
||||
${JSON.stringify(e)}${t?`
|
||||
while being at
|
||||
`+JSON.stringify(t):""}`},[je.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${Lc(t)}" via a navigation guard.`},[je.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[je.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[je.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function po(e,t){return Oe(new Error,{type:e,[ya]:!0},t)}function $t(e,t){return e instanceof Error&&ya in e&&(t==null||!!(e.type&t))}var Mc=["params","query","hash"];function Lc(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let n of Mc)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function ba(e){let t={};if(e===""||e==="?")return t;let n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;r<n.length;++r){let s=n[r].replace(ra," "),i=s.indexOf("="),a=To(i<0?s:s.slice(0,i)),u=i<0?null:To(s.slice(i+1));if(a in t){let f=t[a];kt(f)||(f=t[a]=[f]),f.push(u)}else t[a]=u}return t}function Zn(e){let t="";for(let n in e){let r=e[n];if(n=Dc(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(kt(r)?r.map(s=>s&&jn(s)):[r&&jn(r)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+n,s!=null&&(t+="="+s))})}return t}function wa(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=kt(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return t}var ka=Symbol(""),xn=Symbol(""),Zs=Symbol(""),xs=Symbol(""),en=Symbol("");function Oo(){let e=[];function t(r){return e.push(r),()=>{let s=e.indexOf(r);s>-1&&e.splice(s,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Yt(e,t,n,r,s,i=a=>a()){let a=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((u,f)=>{let h=m=>{m===!1?f(po(je.NAVIGATION_ABORTED,{from:n,to:t})):m instanceof Error?f(m):qc(m)?f(po(je.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(a&&r.enterCallbacks[s]===a&&typeof m=="function"&&a.push(m),u())},g=i(()=>e.call(r&&r.instances[s],t,n,h)),k=Promise.resolve(g);e.length<3&&(k=k.then(h)),k.catch(m=>f(m))})}function tn(e,t,n,r,s=i=>i()){let i=[];for(let a of e)for(let u in a.components){let f=a.components[u];if(!(t!=="beforeRouteEnter"&&!a.instances[u]))if(sa(f)){let h=(f.__vccOpts||f)[t];h&&i.push(Yt(h,n,r,a,u,s))}else{let h=f();i.push(()=>h.then(g=>{if(!g)throw new Error(`Couldn't resolve component "${u}" at "${a.path}"`);let k=gc(g)?g.default:g;a.mods[u]=g,a.components[u]=k;let m=(k.__vccOpts||k)[t];return m&&Yt(m,n,r,a,u,s)()}))}}return i}function Ea(e,t){let n=[],r=[],s=[],i=Math.max(t.matched.length,e.matched.length);for(let a=0;a<i;a++){let u=t.matched[a];u&&(e.matched.find(h=>co(h,u))?r.push(u):n.push(u));let f=e.matched[a];f&&(t.matched.find(h=>co(h,f))||s.push(f))}return[n,r,s]}var $c=()=>location.protocol+"//"+location.host;function Pa(e,t){let{pathname:n,search:r,hash:s}=t,i=e.indexOf("#");if(i>-1){let a=s.includes(e.slice(i))?e.slice(i).length:1,u=s.slice(a);return u[0]!=="/"&&(u="/"+u),Yn(u,"")}return Yn(n,e)+r+s}function Uc(e,t,n,r){let s=[],i=[],a=null,u=({state:m})=>{let y=Pa(e,location),E=n.value,w=t.value,R=0;if(m){if(n.value=y,t.value=m,a&&a===E){a=null;return}R=w?m.position-w.position:0}else r(y);s.forEach(D=>{D(n.value,E,{delta:R,type:Qs.pop,direction:R?R>0?Xs.forward:Xs.back:Xs.unknown})})};function f(){a=n.value}function h(m){s.push(m);let y=()=>{let E=s.indexOf(m);E>-1&&s.splice(E,1)};return i.push(y),y}function g(){if(document.visibilityState==="hidden"){let{history:m}=window;if(!m.state)return;m.replaceState(Oe({},m.state,{scroll:us()}),"")}}function k(){for(let m of i)m();i=[],window.removeEventListener("popstate",u),window.removeEventListener("pagehide",g),document.removeEventListener("visibilitychange",g)}return window.addEventListener("popstate",u),window.addEventListener("pagehide",g),document.addEventListener("visibilitychange",g),{pauseListeners:f,listen:h,destroy:k}}function Ca(e,t,n,r=!1,s=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:s?us():null}}function Fc(e){let{history:t,location:n}=window,r={value:Pa(e,n)},s={value:t.state};s.value||i(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function i(f,h,g){let k=e.indexOf("#"),m=k>-1?(n.host&&document.querySelector("base")?e:e.slice(k))+f:$c()+e+f;try{t[g?"replaceState":"pushState"](h,"",m),s.value=h}catch(y){console.error(y),n[g?"replace":"assign"](m)}}function a(f,h){i(f,Oe({},t.state,Ca(s.value.back,f,s.value.forward,!0),h,{position:s.value.position}),!0),r.value=f}function u(f,h){let g=Oe({},s.value,t.state,{forward:f,scroll:us()});i(g.current,g,!0),i(f,Oe({},Ca(r.value,f,null),{position:g.position+1},h),!1),r.value=f}return{location:r,state:s,push:u,replace:a}}function Va(e){e=fa(e);let t=Fc(e),n=Uc(e,t.state,t.location,t.replace);function r(i,a=!0){a||n.pauseListeners(),history.go(i)}let s=Oe({locatLine truncated
|
||||
`)),e.options=Object.assign({},e.options,h.options),i.restore()})}a();let u=null;e.saveDefault=f=>{if(f&&f.preventDefault&&f.preventDefault(),e.saving)return;let h=i.checkpoint(),g={terms:e.terms.split(`
|
||||
`).map(k=>k.trim()).filter(k=>k.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",g).then(()=>{i.accept(h),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",u&&r.cancel(u),u=r(()=>{e.message=null},2500)},k=>{e.saving=!1;let y="ERRORS."+(k&&k.data&&k.data.error);n(y).then(E=>{e.error=E&&E!==y?E:"Unable to save your defaults. Please try again."},()=>{e.error="Unable to save your defaults. Please try again."})})},e.deleteAccount=()=>{confirm("Delete your account? All your anonymized repositories, gists, and pull requests will be removed, and your personal data will be erased. This cannot be undone.")&&(e.deletingAccount=!0,t.delete("/api/user").then(()=>{window.location.href="/"},()=>{e.deletingAccount=!1,e.deleteError="Unable to delete the account. Please try again."}))}},Ba=function(e,t,n){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(r=>{n.url("/dashboard")},r=>{e.error=r.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},ja=function(e,t,n,r,s){e.user&&!e.user.status&&n.url("/dashboard"),e.watch("user.status",()=>{e.user&&!e.user.status&&n.url("/dashboard")}),e.features=[{key:"anonymize",num:"01",eyebrow:"Anonymize",title:"Double-anonymous,",accent:"your rules.",text:"Choose what reviewers may see: links, images, PDFs, notebooks, GitHub Pages. Add your own terms, with regex if you need it, and pick the expiration date.",cta:"Start an anonymization",href:"/anonymize",url:"anonymous.4open.science/anonymize",img:"/imgs/anonymize.png",alt:"The anonymize form: source repository, terms to redact, options and a live README preview"},{key:"review",num:"02",eyebrow:"Review",title:"Reviewers browse",accent:"the real thing.",text:"Highlighted source code, rendered PDFs, images, and notebooks, in a familiar file explorer. GitHub Pages is also supported.",cta:"Open the example",href:"https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/",target:"_self",url:"anonymous.4open.science/r/840c8c57-\u2026",img:"/imgs/explorer.png",alt:"The repository explorer with a file tree and a rendered README"},{key:"manage",num:"03",eyebrow:"Manage",title:"One dashboard,",accent:"until the decision.",text:"Monitor views, edit configuration, remove or update your repository. Program chairs can group submissions under a conference with one shared expiry.",cta:"Open the dashboard",href:"/dashboard",needsUser:!0,url:"anonymous.4open.science/dashboard",img:"/imgs/dashboard.png",alt:"The dashboard listing anonymized repositories with status, views and expiry"}],e.feature=e.features[0].key,e.selectFeature=function(u){e.feature=u},e.featureHref=function(u){return u.needsUser&&!e.user?"/signin":u.href},e.featureTarget=function(u){return u.needsUser&&!e.user?"_self":u.target||void 0},e.featureKeydown=function(u,f){let h={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[u.key];if(h===void 0)return;u.preventDefault();let g=e.features.length,k=h==="first"?0:h==="last"?g-1:(f+h+g)%g;e.feature=e.features[k].key,s(()=>{let m=r.document.getElementById("feature-tab-"+e.feature);m&&m.focus()})},e.cards=[{key:"repositories",total:0,label:"repositories anonymized"},{key:"users",total:0,label:"researchers"},{key:"pageViews",total:0,label:"page views"},{key:"pullRequests",total:0,label:"pull requests"}];function i(){t.get("/api/stat/").then(u=>{e.stat=u.data,e.cards[0].total=u.data.nbRepositories,e.cards[1].total=u.data.nbUsers,e.cards[2].total=u.data.nbPageViews,e.cards[3].total=u.data.nbPullRequests})}i();function a(u){let f={series:u,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!u||u.length<2)return f;let h=new Array(u.length-1);for(let w=1;w<u.length;w++)h[w-1]=u[w]-u[w-1];let g=h.length,k=Math.max.apply(null,h),m=Math.min.apply(null,h),y=Math.min(0,m),E=k-y||1;f.viewW=g*2,f.bars=new Array(g);for(let w=0;w<g;w++){let R=(h[w]-y)/E,D=Math.max(1.5,R*34);f.bars[w]={x:(w*2+.25).toFixed(2),y:(36-D).toFixed(2),w:"1.5",h:D.toFixed(2)}}if(f.deltaToday=h[g-1],g>=2){let w=h[g-2];w&&(f.pctChange=(f.deltaToday-w)/w*100)}return f.pctAbs=Math.round(Math.abs(f.pctChange)),f.isUp=f.pctChange>=0,f}e.history={repositories:a([]),users:a([]),pageViews:a([]),pullRequests:a([])},t.get("/api/stat/history?days=60").then(u=>{let f=u.data||[];e.history={repositories:a(f.map(h=>h.nbRepositories||0)),users:a(f.map(h=>h.nbUsers||0)),pageViews:a(f.map(h=>h.nbPageViews||0)),pullRequests:a(f.map(h=>h.nbPullRequests||0))}})},Ga=function(e,t,n,r,s,i){let a=ct();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&n.url("/")}),e.user==null&&n.url("/"),a.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,st(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Qt()(document,"click",_=>{e.quotaExpanded&&!_.target.closest?.(".dashboard-quota")&&
Line truncated
|
||||
`)),e.options=Object.assign({},e.options,j.options),e.options.expirationDate=j.options&&j.options.expirationDate?new Date(j.options.expirationDate):A(),!r.repoId&&!r.pullRequestId&&!r.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),S&&S()})}function U(S,I,j){e.anonymize&&e.anonymize[S]&&e.anonymize[S].setValidity(I,j)}function ae(S){try{let I=parseGithubUrl(S);if(I&&I.owner&&I.repo)return I.owner+"/"+I.repo}catch{}return null}e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,e.reconnectSource=async()=>{if(confirm("Reconnect to the repository currently at this GitHub URL? Review its branch and commit before saving. Saving will replace the published snapshot.")){e.reconnectingSource=!0,e.reconnectRepositoryId=void 0,e.source.commit="",e.source.branch="",e.readme="",e.branches=[];try{await G()}catch{}}};function ie(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:ae(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function _(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function O(){let S;try{S=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!S||S.path!==s.path()||Date.now()-S.savedAt>=30*6e4)return R.restore()?(e.sourceUrl&&await _(),!0):!1;R.restore();for(let I of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(S.draft,I)&&(e[I]=S.draft[I]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await _(),sessionStorage.removeItem("github-access-draft"),!0}q(()=>{!r.repoId&&!r.pullRequestId&&!r.gistId&&a(O,0),r.repoId&&r.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=r.repoId,t.get("/api/repo/"+e.repoId).then(async S=>{e.githubConnection=S.data.connection||"oauth",e.sourceUrl="https://github.com/"+S.data.source.fullName,e._originalFullName=S.data.source.fullName,e.terms=S.data.options.terms.filter(I=>I).join(`
|
||||
`),e.source=S.data.source,e.role=S.data.role||"owner",e.coauthors=S.data.coauthors||[],e._originalBranch=S.data.source.branch,e.options=Object.assign({},e.options,S.data.options),e.conference=S.data.conference,e._originalConference=S.data.conference,e.repositoryID=S.data.source.repositoryID,e._originalRepositoryID=S.data.source.repositoryID,S.data.options.expirationDate&&(e.options.expirationDate=new Date(S.data.options.expirationDate)),E=w(parseGithubUrl(e.sourceUrl)),!await O()&&(await Promise.all([G(),J()]),ue())},()=>{s.url("/404")})),r.pullRequestId&&r.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=r.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async S=>{if(e.githubConnection=S.data.connection||"oauth",e.sourceUrl="https://github.com/"+S.data.source.repositoryFullName+"/pull/"+S.data.source.pullRequestId,e.terms=S.data.options.terms.filter(I=>I).join(`
|
||||
`),e.source=S.data.source,e.options=Object.assign({},e.options,S.data.options),e.conference=S.data.conference,e._originalConference=S.data.conference,S.data.options.expirationDate&&(e.options.expirationDate=new Date(S.data.options.expirationDate)),E=w(parseGithubUrl(e.sourceUrl)),!await O())try{await pe()}catch{}},()=>{s.url("/404")})),r.gistId&&r.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=r.gistId,t.get("/api/gist/"+e.gistId).then(async S=>{e.sourceUrl="https://gist.github.com/"+S.data.source.gistId,e.terms=S.data.options.terms.filter(I=>I).join(`
|
||||
`),e.source=S.data.source,e.options=Object.assign({},e.options,S.data.options),e.conference=S.data.conference,e._originalConference=S.data.conference,S.data.options.expirationDate&&(e.options.expirationDate=new Date(S.data.options.expirationDate)),E=w(parseGithubUrl(e.sourceUrl)),!await O()&&await Ae()},()=>{s.url("/404")}))}),t.get("/github/connections").then(S=>{e.githubConnections=S.data,!r.repoId&&!r.pullRequestId&&!r.gistId&&e.githubConnection===void 0&&S.data.appEnabled&&S.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&_())}).catch(()=>{}),e.urlSelected=async(S=!1)=>{let I=++f,j;try{j=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,oe.cancel(),_e.cancel(),Se.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",U("sourceUrl","github",!1);return}let M=w(j),v=S||E===M;E=M,e.sourceUrlError="",U("sourceUrl","github",!0);let C=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,C&&a(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!v&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],v||(e.source={type:"GitHubStream",branch:"",commit:""}),oe.cancel(),_e.cancel(),Se.cancel(),le.clear(),Ee.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",e.html_readme="",e.detectedType=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1,e._preservingDraft=v;try{j.gistId&&!j.repo?(e.detectedType="gist",e.source={gistId:j.gistId},await Ae()):j.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:j.owner+"/"+j.repo,pullRequestId:j.pullRequestId},await pe()):(e.detectedType="repo",await Promise.all([G(),J()]),ue())}catch{}finally{I===f&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let S=e.branches.filter(j=>j.name==e.source.branch)[0];if(!S)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=S.commit),e.readme=S.readme,await J(),ue()}),e.getBranches=async S=>{let I=parseGithubUrl(e.sourceUrl),j=m();try{let M=await t.get(`/api/repo/${I.owner}/${I.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&ae(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:S===!0||e.reconnectingSource?"1":"0",repositoryID:ie()}});if(!k(j))return;e.branches=M.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let v=e.branches.filter(C=>C.name==e.source.branch);v.length>0&&(!(!e.reconnectingSource&&!S&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=v[0].commit),e.readme=v[0].readme,await J(S))}catch(M){if(!k(j))return;e.branches=[],e.sourceUnreachable=M&&(M.status===404||M.data&&M.data.error==="repo_not_found");let v=M&&M.data&&M.data.error||(M&&M.status===404?"repo_not_found":"unknown_error");i("ERRORS."+v).then(C=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:C}),e.error=C},console.error),typeof U=="function"&&U("sourceUrl","missing",!1)}finally{y(j)}};async function G(){let S=parseGithubUrl(e.sourceUrl),I=m();try{z();let j=await t.get(`/api/repo/${S.owner}/${S.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&ae(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,repositoryID:ie(),force:"1"}});if(!k(I))return;e.details=j.data,e.reconnectingSource&&(e.reconnectRepositoryId=e.details.externalId),e.details&&e.details.id&&(e.repositoryID=e.details.id),e.repoId||(e.repoId=e.details.repo+"-"+generateRandomId(4)),await e.getBranches(e.reconnectingSource)}catch(j){if(!k(I))return;throw j.data&&(i("ERRORS."+j.data.error).then(M=>{e.addToast({title:"Error",date:new Date,body:M}),e.error=M},console.error),te(j.data.error)),U("sourceUrl","missing",!1),j}finally{y(I)}}async function J(S){if(e.readme&&!S)return e.readme;let I=parseGithubUrl(e.sourceUrl),j=m();try{let M=await t.get(`/api/repo/${I.owner}/${I.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&r.repoId&&ae(e.sourceUrl)===e._originalFullName?r.repoId:void 0,connection:e.githubConnection,force:S===!0?"1":"0",branch:e.source.branch,repositoryID:ie()}});k(j,!0)&&(e.readme=M.data)}catch{k(j,!0)&&(e.readme="")}finally{y(j)}}function ee(){let S={terms:e.terms?e.terms.split(`
|
||||
`):[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(S.branchName=e.source.branch);try{let I=parseGithubUrl(e.sourceUrl);S.repoName=`${I.owner}/${I.repo}`}catch{}return S}function Q(S,I,j){let M=null,v=0,C=()=>{if(e.detectedType!==S)return;M&&a.cancel(M);let P=++v;e.previewStatus="loading",M=a(()=>{M=null;let F=I();if(!F){e.previewStatus="idle";return}t.post("/api/anonymize-preview",F).then(B=>{P===v&&(j(B.data,F),e.previewStatus="ready")}).catch(()=>{P===v&&(e.previewStatus="error")})},200)};return C.cancel=()=>{v++,M&&a.cancel(M),M=null},e.on("dispose",C.cancel),C}e.retryPreview=()=>{e.detectedType==="repo"&&oe(),e.detectedType==="pr"&&_e(),e.detectedType==="gist"&&Se()};let oe=Q("repo",()=>e.readme?{content:e.readme,options:ee()}:null,S=>{if(typeof S?.content!="string")throw Error("Invalid preview response");e.anonymize_readme=S.content;let I="";try{let M=parseGithubUrl(e.sourceUrl),v=e.source.branch||e.details&&e.details.defaultBranch||"main";I=`https://github.com/${M.owner}/${M.repo}/raw/${v}/`}catch{}let j=renderMD(e.anonymize_readme,I);e.html_readme=j,a(Prism.highlightAll,150)});function ue(){!e.anonymize||!e.anonymize.terms||(e.termsRegexWarning=!!e.terms&&!!e.terms.match(/[-[\]{}()*+?.,\\^$|#]/g),oe())}async function pe(){let S=parseGithubUrl(e.sourceUrl),I=m();try{z();let j=await t.get(`/api/pr/${S.owner}/${S.repo}/${S.pullRequestId}`,{params:{connection:e.githubConnection}});if(!k(I))return;e.details=j.data,e.pullRequestId||(e.pullRequestId=S.repo+"-PR"+S.pullRequestId+"-"+generateRandomId(4))}catch(j){if(!k(I))return;throw j.data&&(i("ERRORS."+j.data.error).then(M=>{e.addToast({title:"Error",date:new Date,body:M}),e.error=M},console.error),te(j.data.error)),U("sourceUrl","missing",!1),j}finally{y(I)}}let le=He(new Map);function Ie(){let S=new Set,I=e.details&&e.details.pullRequest;if(!I)return S;typeof I.title=="string"&&S.add(I.title),typeof I.body=="string"&&S.add(I.body),typeof I.diff=="string"&&S.add(I.diff);let j=I.comments||[];for(let M of j)typeof M.author=="string"&&S.add(M.author),typeof M.body=="string"&&S.add(M.body);return S}let _e=Q("pr",()=>{let S=Ie(),I=Array.from(S);return I.length===0?null:{contents:I,options:ee()}},(S,I)=>{if(!Array.isArray(S?.contents)||S.contents.length!==I.contents.length||S.contents.some(v=>typeof v!="string"))throw Error("Invalid preview response");let j=I.contents,M=new Map;for(let v=0;v<j.length&&v<S.contents.length;v++)M.set(j[v],S.contents[v]);le.clear(),M.forEach((v,C)=>le.set(C,v))});e.anonymizePrContent=function(S){return S&&(le.has(S)?le.get(S):"")};async function Ae(){let S=parseGithubUrl(e.sourceUrl),I=m();try{z(),e.gistOAuthRequired=!1,e.gistAppRequired=!1;let j=await t.get(`/api/gist/source/${S.gistId}`);if(!k(I))return;e.details=j.data,e.gistId||(e.gistId="gist-"+S.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(j){if(!k(I))return;if(j.data?.error==="github_app_reconnect_required"){e.gistAppRequired=!0,U("sourceUrl","missing",!1);return}if(j.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,U("sourceUrl","missing",!1);return}throw j.data&&(i("ERRORS."+j.data.error).then(M=>{e.addToast({title:"Error",date:new Date,body:M}),e.error=M},console.error),te(j.data.error)),U("sourceUrl","missing",!1),j}finally{y(I)}}let Ee=He(new Map);function Pe(){let S=new Set,I=e.details&&e.details.gist;if(!I)return S;typeof I.description=="string"&&S.add(I.description),typeof I.ownerLogin=="string"&&S.add(I.ownerLogin);let j=I.files||[];for(let v of j)typeof v.filename=="string"&&S.add(v.filename),typeof v.content=="string"&&S.add(v.content);let M=I.comments||[];for(let v of M)typeof v.author=="string"&&S.add(v.author),typeof v.body=="string"&&S.add(v.body);return S}let Se=Q("gist",()=>{let S=Pe(),I=Array.from(S);return I.length===0?null:{contents:I,options:ee()}},(S,I)=>{if(!Array.isArray(S?.contents)||S.contents.length!==I.contents.length||S.contents.some(v=>typeof v!="string"))throw Error("Invalid preview response");let j=I.contents,M=new Map;for(let v=0;v<j.length&&v<S.contents.length;v++)M.set(j[v],S.contents[v]);Ee.clear(),M.forEach((v,C)=>Ee.set(C,v)),$e()});e.anonymizeGistContent=function(S){return S&&(Ee.has(S)?Ee.get(S):"")},e.previewGistFiles=[];function $e(){let S=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=S.map(I=>({filename:e.anonymizeGistContent(I.filename),content:e.anonymizeGistContent(I.content),language:I.language}))}e.watch("details.gist.files",$e,!0),e.watch("terms",$e);function Ue(){let S=e.conference;if(e.conference_data=null,!S)return;let I=e.isUpdate&&S===e._originalConference;t.get("/api/conferences/"+S).then(j=>{e.conference===S&&(e.conference_data=j.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!I&&(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.con
Line truncated
|
||||
`).filter(C=>C),connection:e.githubConnection,fullName:`${j.owner}/${j.repo}`,repository:e.sourceUrl,reconnectRepositoryId:e.reconnectRepositoryId,options:e.options,source:e.source,conference:e.conference};e.details&&(M.options.pageSource=e.details.pageSource),z();let v=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(v,M,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/status/"+e.repoId},C=>{C.data&&(i("ERRORS."+C.data.error).then(P=>{e.error=P},console.error),te(C.data.error))}).finally(()=>{I.disabled=!1})},e.anonymizeGist=S=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(ne())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let I=S.currentTarget||S.target.closest?.("button")||S.target;I.disabled=!0;let j=parseGithubUrl(e.sourceUrl),M={gistId:e.gistId,terms:e.terms.trim().split(`
|
||||
`).filter(C=>C),source:{gistId:j.gistId},options:e.options,conference:e.conference};z();let v=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(v,M,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/gist/"+e.gistId},C=>{C.data&&(i("ERRORS."+C.data.error).then(P=>{e.error=P},console.error),te(C.data.error))}).finally(()=>{I.disabled=!1})},e.anonymizePullRequest=S=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(ne())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let I=S.currentTarget||S.target.closest?.("button")||S.target;I.disabled=!0;let j=parseGithubUrl(e.sourceUrl),M={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
|
||||
`).filter(C=>C),source:{repositoryFullName:`${j.owner}/${j.repo}`,pullRequestId:j.pullRequestId},options:e.options,conference:e.conference};z();let v=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(v,M,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/pr/"+e.pullRequestId},C=>{C.data&&(i("ERRORS."+C.data.error).then(P=>{e.error=P},console.error),te(C.data.error))}).finally(()=>{I.disabled=!1})},e.watch("conference",()=>{Ue()}),e.watch("terms",()=>{e.detectedType==="repo"&&ue(),e.detectedType==="pr"&&_e(),e.detectedType==="gist"&&Se()}),e.watch("options.image",()=>{e.detectedType==="repo"&&ue(),e.detectedType==="pr"&&_e(),e.detectedType==="gist"&&Se()}),e.watch("options.link",()=>{e.detectedType==="repo"&&ue(),e.detectedType==="pr"&&_e(),e.detectedType==="gist"&&Se()}),e.watch("details",()=>{e.detectedType==="pr"&&_e(),e.detectedType==="gist"&&Se()},!0)},sr=function(e,t,n,r,s,i){let a=ct(),u=Qt();e.on("dark-mode",(O,G)=>{e.aceOption&&(G?e.aceOption.theme="nord_dark":e.aceOption.theme="chrome")});let f=0,h=!1;e.on("dispose",()=>{h=!0,f++,g&&g.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,u(document,"keydown",function(O){if((O.metaKey||O.ctrlKey)&&O.key==="k"){O.preventDefault();var G=document.querySelector(".tree-search-input");G&&(G.focus(),G.select())}});var g=null;e.onFileSearchChange=function(){g&&(g.resolve(),g=null);let O=e.fileSearchQuery;if(!O||O.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let G=i.defer();g=G,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(O)}`,{timeout:G.promise}).then(function(J){if(!(h||g!==G)){g=null,e.fileSearchLoading=!1;var ee={};e.files.forEach(function(z){ee[(z.path||"")+"/"+z.name]=!0});for(var Q=[],oe={},ue=0;ue<J.data.length;ue++){var pe=J.data[ue];if(pe.path)for(var le=pe.path.split("/"),Ie="",_e=0;_e<le.length;_e++){var Ae=Ie;Ie=Ie?Ie+"/"+le[_e]:le[_e];var Ee=Ae+"/"+le[_e];!ee[Ee]&&!oe[Ee]&&(oe[Ee]=!0,Q.push({name:le[_e],path:Ae}))}}Q.sort(function(z,ne){return(z.path||"").split("/").length-(ne.path||"").split("/").length}),Q.length>0&&e.files.push.apply(e.files,Q);for(var Pe=[],Se=0;Se<J.data.length;Se++){var $e=J.data[Se],Ue=($e.path||"")+"/"+$e.name;!ee[Ue]&&$e.size!=null&&(Pe.push($e),ee[Ue]=!0)}Pe.length>0&&e.files.push.apply(e.files,Pe),e.fileSearchResults=J.data}},function(){!h&&g===G&&(g=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})};let k={yml:"yaml",txt:"text",py:"python",js:"javascript",ts:"typescript"},m=["license","txt"],y=["png","jpg","jpeg","gif","svg","ico","bmp","tiff","tif","webp","avif","heif","heic"],E=["wav","mp3","ogg","wma","flac","aac","m4a"],w=["mp4","avi","webm","mov","mpg","mpeg","mkv","flv","wmv","3gp","3g2","m4v","f4v","f4p","f4a","f4b"];e.on("routeUpdate",function(O,G){if(e.repoId!=r.repoId)return _();if((r.path||"")!=e.filePath){e.filePath=r.path||"",e.paths=e.filePath.split("/").filter(J=>J&&J.trim().length>0),ie();for(let J=0;J<e.paths.length-1;J++){let ee=J>0?e.paths.slice(0,J).join("/"):"";e.files.some(oe=>oe.path===ee)||e.getFiles(ee)}}});function R(){if(e.paths[0]!="")return;let O=["readme.md","readme.txt","readme.org","readme.1st","readme"],G={};for(let ee of e.files)ee.name.toLowerCase().indexOf("readme")>-1&&(G[ee.name.toLowerCase()]=ee.name);let J=null;for(let ee of O)if(G[ee]){J=ee;break}if(!J&&Object.keys(G).length>0&&(J=Object.keys(G)[0]),J){let ee=n.url();ee[ee.length-1]!="/"&&(ee+="/"),n.url(ee+encodePathForUrl(G[J]))}}e.fileCounts=null,e.getFiles=function(O){let G=e.repoId;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(O)}&v=${e.options.lastUpdateDate}`).then(function(J){if(h||G!==e.repoId)return[];let ee=O||"";return e.files=e.files.filter(Q=>Q.path!==ee),e.files.push(...J.data),J.data},function(J){if(h||G!==e.repoId)return[];e.type="error",e.content=J&&J.data&&J.data.error||"unknown_error",e.files=[]})};function D(){let O=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts`).then(function(G){h||O!==e.repoId||(e.fileCounts=G.data)},function(){e.fileCounts={}})}function A(){return e.files.filter(O=>O.name==e.paths[e.paths.length-1]&&O.path==e.paths.slice(0,e.paths.length-1).join("/"))[0]}var V=null;e.on("dispose",function(){V&&a.interval.cancel(V)});function H(O){if(h)return;let G=e.repoId;t.get(`/api/repo/${e.repoId}/options`).then(J=>{if(!(h||G!==e.repoId)){if(e.options=J.data,e.options.url){window.location=e.options.url;return}O&&O(J.data)}},J=>{if(!(h||G!==e.repoId)){var ee=J.data||{};if(ee.error==="rate_limited"&&ee.resetAt){let oe=function(){var ue=Math.max(0,Math.ceil((e.rateLimitResetAt-Date.now())/1e3));if(ue<=0)e.rateLimitCountdown="",e.rateLimitResetAt=0,V&&(a.interval.cancel(V),V=null),H(O);else{var pe=Math.floor(ue/60),le=ue%60;e.rateLimitCountdown=pe>0?pe+"m "+le+"s":le+"s"}};var Q=oe;e.type="rate_limited",e.rateLimitResetAt=ee.resetAt,V&&a.interval.canc
Line truncated
|
||||
`+w.join(`
|
||||
`)],{type:"text/csv"}),D=document.createElement("a");D.href=URL.createObjectURL(R),D.download=r.username+"-repositories.csv",D.click()},e.showStatusMessage=m=>{let y=m.statusMessage||"(no message)";window.prompt(`Status message for ${m.repoId} (${m.status}):`,y)},e.fetchGithubInfo=m=>{let y=window.open("","_blank");y&&y.document.write("<pre>Loading GitHub info for "+m.repoId+"...</pre>"),t.get("/api/admin/repos/"+m.repoId+"/github").then(E=>{y&&(y.document.open(),y.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(E.data,null,2).replace(/[<>]/g,w=>w==="<"?"<":">")+"</pre>"),y.document.close())},E=>{let w=E&&E.data?JSON.stringify(E.data,null,2):String(E);y&&(y.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+w+"</pre>")})};function f(m){t.get("/api/admin/users/"+m+"/repos",{}).then(y=>{e.repositories=y.data},y=>{console.error(y)})}function h(m){t.get("/api/admin/users/"+m,{}).then(y=>{e.userInfo=y.data},y=>{console.error(y)})}h(r.username),f(r.username),e.banUser=()=>{confirm(`Ban user ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/ban`).then(()=>h(r.username),m=>console.error(m))},e.activateUser=()=>{t.post(`/api/admin/users/${r.username}/activate`).then(()=>h(r.username),m=>console.error(m))},e.promoteUser=()=>{confirm(`Promote ${r.username} to admin?`)&&t.post(`/api/admin/users/${r.username}/promote`).then(()=>h(r.username),m=>console.error(m))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${r.username}?`)&&t.post(`/api/admin/users/${r.username}/demote`).then(()=>h(r.username),m=>console.error(m))},e.tokens=[],e.tokenForm={name:"",plaintext:null};function g(){t.get("/api/admin/tokens").then(m=>{e.tokens=m.data||[]},m=>{m.status!==401&&m.status!==403&&console.error(m)})}g(),e.createToken=()=>{e.tokenForm.name&&t.post("/api/admin/tokens",{name:e.tokenForm.name}).then(m=>{e.tokenForm.plaintext=m.data.token,e.tokenForm.name="",g()},m=>console.error(m))},e.revokeToken=m=>{confirm(`Revoke token "${m.name}"?`)&&t.delete("/api/admin/tokens/"+m.id).then(()=>g(),y=>console.error(y))},e.removeCache=m=>{confirm("Remove cached files for "+m.repoId+"?")&&t.delete("/api/admin/repos/"+m.repoId).then(()=>f(r.username),y=>console.error(y))},e.removeRepository=m=>{confirm("Remove repository "+m.repoId+"?")&&t.delete("/api/repo/"+m.repoId+"/").then(()=>f(r.username),y=>console.error(y))},e.updateRepository=m=>{let y=He({title:`Refreshing ${m.repoId}...`,date:new Date,body:`The repository ${m.repoId} is going to be refreshed.`});e.toasts.push(y),t.post(`/api/repo/${m.repoId}/refresh`).then(E=>{E.data.status=="ready"?y.title=`${m.repoId} is refreshed.`:y.title=`Refreshing of ${m.repoId}.`},E=>{y.title=`Error during the refresh of ${m.repoId}.`,y.body=E.body})},e.getGitHubRepositories=m=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(y=>{e.userInfo.repositories=y.data})};let k=null;e.watch("query",()=>{s.timeout.cancel(k),k=s.timeout(()=>{f(r.username)},500)},!0)},ol=function(e,t,n){let r=ct(),s=Qt();e.Math=Math,e.watch("user.status",()=>{e.user==null&&n.url("/")}),e.user==null&&n.url("/"),e.conferences=[],e.total=-1,e.totalPage=0,e.statusCounts=[];let i=E=>{if(E.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){E.preventDefault();let w=document.querySelector('.admin-filter-toolbar input[type="search"]');w&&w.focus()}};s(document,"keydown",i),e.on("dispose",()=>document.removeEventListener("keydown",i)),e.clearFilter=E=>{E==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[E]="",e.query.page=1},e.chips=[];let a=()=>{let E=[];(e.query.dateFrom||e.query.dateTo)&&E.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=E};e.statusCountFor=E=>{let w=(e.statusCounts||[]).find(R=>R._id===E);return w?w.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=E=>{e.query.sort===E?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=E,e.query.direction="desc"),e.query.page=1},e.sortIcon=E=>e.query.sort===E?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let u="admin.conferences.filterPrefs",f={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!1,expired:!1,removed:!1,error:!0,preparing:!0},h=loadFilterPrefs(u)||{};e.query=Object.assign({},f,h,{page:1,search:""});let g=n.search();g.search&&(e.query.search=g.search);let k="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(k)||"[]"),e.savePreset=()=>{let E=window.prompt("Preset name:");if(!E)return;let w=Object.assign({},e.query);delete w.page,e.presets=(e.presets||[]).filter(R=>R.name!==E),e.presets.push({name:E,query:w}),localStorage.setItem(k,JSON.stringify(e.presets))},e.applyPreset=E=>{Object.assign(e.query,E.query,{page:1})},e.deletePreset=E=>{e.presets=(e.presets||[]).filter(w=>w.name!==E.name),localStorage.setItem(k,JS
Line truncated
|
||||
`).map((ue,pe)=>pe===0?ue:oe+ue).join(`
|
||||
`)}else typeof _=="number"||typeof _=="boolean"?Q=String(_):Q=JSON.stringify(_);ae.push(`${J}${Q}${ee}`)}),ae.push("}"),ae.join(`
|
||||
`)}function h(D){let A=[],V="",H=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,q=0,U;for(;U=H.exec(D);)V+=D.slice(q,U.index),q=H.lastIndex,A.push({key:U[1],op:U[2]||"=",val:U[3]});return V+=D.slice(q),{filters:A,free:V.trim().toLowerCase()}}function g(D,A){for(let V of A.filters){let H=(U,ae,ie)=>{let _=parseFloat(U),O=parseFloat(ae);return ie==="="?String(U)===String(ae):ie==="!="?String(U)!==String(ae):ie===">="?_>=O:ie==="<="?_<=O:ie===">"?_>O:ie==="<"?_<O:!0},q;if(V.key==="code")q=D.displayMessage;else if(V.key==="module")q=D.module;else if(V.key==="status")q=D._status;else if(V.key==="url")q=D._url;else if(V.key==="repo")q=D._repoId;else if(V.key==="level")q=D.level;else continue;if(q==null||!H(q,V.val,V.op))return!1}return!(A.free&&((D.displayMessage||"")+" "+(D.module||"")+" "+(D._url||"")+" "+JSON.stringify(D.raw||[])).toLowerCase().indexOf(A.free)===-1)}function k(){let D=h(e.query.search||"");e.parsedFilterCount=D.filters.length;let A=e.query.bucket,V=e.entries.filter(q=>A&&q._bucket!==A?!1:g(q,D)),H=e.query.group;if(H){let q=ie=>H==="module"?ie.module:ie.displayMessage||ie.message||"_",U=new Map;for(let ie of V){let _=q(ie);if(U.has(_)){let O=U.get(_);O.count++,O._related.push(ie),new Date(ie.ts)>new Date(O.ts)&&(O.ts=ie.ts,O._url=ie._url,O._status=ie._status),new Date(ie.ts)<new Date(O._firstSeen)&&(O._firstSeen=ie.ts)}else{let O=Object.assign({},ie);O._key=`${H}:${_}`,O._related=[ie],O._firstSeen=ie.ts,O._lastHourCount=0,O.count=1,U.set(_,O)}}let ae=Date.now()-3600*1e3;for(let ie of U.values())ie._lastHourCount=ie._related.filter(_=>new Date(_.ts).getTime()>=ae).length;V=Array.from(U.values())}else V=V.map((q,U)=>(q._key="row:"+U+":"+q.ts,q._related=[q],q._firstSeen=q.ts,q._lastHourCount=0,q.count=1,q));e.query.sort==="count"?V.sort((q,U)=>U.count-q.count||new Date(U.ts)-new Date(q.ts)):V.sort((q,U)=>new Date(U.ts)-new Date(q.ts)),e.visible=V}function m(D){let A=D?e.entries.length:0,V=D?e.pageSize:Math.max(e.pageSize,e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:A,limit:V}}).then(H=>{let q=(H.data.entries||[]).map(u);e.entries=D?e.entries.concat(q):q,e.available=!!H.data.available,e.cap=H.data.max||e.cap,e.total=H.data.total||e.entries.length,k()},H=>console.error(H))}e.loadMore=()=>m(!0),e.canLoadMore=()=>e.entries.length<e.total;function y(){t.get("/api/admin/errors/stats").then(D=>{let A=D.data||{},V=A.prev24h?Math.round((A.last24h-A.prev24h)/A.prev24h*100):0;e.stats={last24h:A.last24h||0,prev24h:A.prev24h||0,delta:V,severity:A.severity||{error:0,warn:0,info:0},unique:A.unique||{error:0,warn:0,info:0},buckets:A.buckets||[],dropped:A.dropped||0}},D=>console.error(D))}function E(){m(),y()}e.barPx=(D,A)=>{let V=e.stats.buckets||[],H=0;for(let ie of V)H=Math.max(H,(ie.error||0)+(ie.warn||0)+(ie.info||0));if(!H)return 0;let q=(D.error||0)+(D.warn||0)+(D.info||0);if(!q)return 0;let U=Math.round(q/H*60),ae=D[A]||0;return Math.round(ae/q*U)},e.bucketTitle=D=>`${new Date(D.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${D.error||0} err \xB7 ${D.warn||0} warn \xB7 ${D.info||0} info`,e.toggle=D=>{e.expanded[D._key]=!e.expanded[D._key]},e.setBucket=D=>{e.query.bucket=D},e.refreshNow=E,e.clearAll=()=>{confirm("Clear all captured errors?")&&t.delete("/api/admin/errors").then(E,D=>console.error(D))},e.exportCsv=()=>{let D=["ts","level","module","displayMessage","_status","_url","_repoId"],A=[D.join(",")];for(let U of e.visible)A.push(D.map(ae=>{let ie=U[ae]==null?"":String(U[ae]);return/[",\n]/.test(ie)?`"${ie.replace(/"/g,'""')}"`:ie}).join(","));let V=new Blob([A.join(`
|
||||
`)],{type:"text/csv;charset=utf-8"}),H=URL.createObjectURL(V),q=document.createElement("a");q.href=H,q.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(q),q.click(),document.body.removeChild(q),URL.revokeObjectURL(H)};function w(D){e.copyHint=`${D} copied`,s.timeout(()=>{e.copyHint=""},1500)}e.copyJson=D=>{navigator.clipboard.writeText(D._detailJson).then(()=>w("JSON"))},e.copyCurl=D=>{if(!D._url)return;let V=`curl -X ${D._method||"GET"} '${window.location.origin}${D._url}'`;navigator.clipboard.writeText(V).then(()=>w("curl"))},E();let R=r(()=>{e.query.autoRefresh&&E()},15e3);e.on("dispose",()=>r.cancel(R)),e.watch("query.search",k),e.watch("query.bucket",k),e.watch("query.sort",k),e.watch("query.group",k)},rl=function(e,t,n,r){if(e.Math=Math,e.watch("user.status",()=>{e.user==null&&n.url("/")}),e.user==null){n.url("/");return}e.data=null,e.loading=!0,e.error=null,e.performance=null,e.performanceMinutes=15,e.performanceTab="routes",e.performanceError=null,e.latencyBound=function(y,E){return y.count?y[E]==null?"> 60 s":"\u2264 "+y[E]+" ms":"No samples"},e.firstByteBound=function(y){return e.latencyBound({count:y.firstByteCount,p95UpperMs:y.firstByteP95UpperMs},"p95UpperMs")},e.sampleAge=function(y){return Math.max(0,Math.round((Date.now()-y.sampledAt)/1e3))},e.peakRss=function(y){return(e.performance.runtimeSeries||[]).filter(function(E){return E.instance===y.instance}).reduce(function(E,w){return Math.max(E,w.rss)},y.memory.rss)},e.performanceWarning=function(y){return e.sampleAge(y)>45||y.droppedBatches||y.droppedMetrics||y.sockets?.closeWait>0||y.eventLoop.p95Ms>100||y.memoryLimitBytes&&y.memory.rss>y.memoryLimitBytes*.8};var s=!1;e.loadPerformance=function(){var y=e.performanceMinutes;e.performance?.windowMinutes&&e.performance.windowMinutes!==y&&(e.performance=null),!s&&(s=!0,t.get("/api/admin/performance",{params:{minutes:y}}).then(function(E){y===e.performanceMinutes&&(e.performance=E.data,e.performanceError=E.data.available?null:"Performance monitoring is unavailable. Request history may be incomplete.")},function(){y===e.performanceMinutes&&(e.performanceError="Could not refresh performance monitoring. Displayed samples may be stale.")}).finally(function(){s=!1,y!==e.performanceMinutes&&e.loadPerformance()}))};function i(y){if(y==null)return"\u2014";for(var E=["B","KB","MB","GB","TB"],w=0,R=y;R>=1024&&w<E.length-1;)R/=1024,w++;return R.toFixed(w>0?1:0)+" "+E[w]}e.humanBytes=i;function a(y){if(!y)return"\u2014";var E=Math.floor(y/86400),w=Math.floor(y%86400/3600),R=Math.floor(y%3600/60);return E>0?E+"d "+(w<10?"0":"")+w+"h":w>0?w+"h "+(R<10?"0":"")+R+"m":R+"m"}e.humanDuration=a;function u(y){return y==null?"\u2014":y>=1e6?(y/1e6).toFixed(1)+"M":y>=1e3?(y/1e3).toFixed(1)+"K":String(y)}e.humanNum=u,e.queueTotal=function(y){return y?(y.waiting||0)+(y.active||0)+(y.delayed||0)+(y.failed||0):0},e.statusCount=function(y){if(!e.data||!e.data.repos)return 0;for(var E=e.data.repos.statusBreakdown||[],w=0;w<E.length;w++)if(E[w]._id===y)return E[w].count;return 0},e.barPct=function(y){var E=e.data&&e.data.repos?e.data.repos.total:0;if(!E)return 0;var w=[y];y==="expired"&&w.push("expiring"),y==="removed"&&w.push("removing"),y==="preparing"&&w.push("download");var R=0;return w.forEach(function(D){R+=e.statusCount(D)}),Math.max(.4,R/E*100)},e.errPct=function(y){if(!e.data||!e.data.errors)return 0;var E=Math.max(e.data.errors.severity.error,e.data.errors.severity.warn,e.data.errors.severity.info,1);return e.data.errors.severity[y]/E*100};function f(y){var E=y||[];return E.map(function(w,R){var D=E[R-1]||{},A=Object.assign({},w);return A.dailyRepositories=R?Math.max(0,(w.nbRepositories||0)-(D.nbRepositories||0)):0,A.dailyUsers=R?Math.max(0,(w.nbUsers||0)-(D.nbUsers||0)):0,A.dailyPageViews=R?Math.max(0,(w.nbPageViews||0)-(D.nbPageViews||0)):0,A})}function h(y){var E=y&&y.length?y[y.length-1]:{};return{repositories:E.dailyRepositories||0,users:E.dailyUsers||0,pageViews:E.dailyPageViews||0}}var g={};e.historyBarH=function(y,E){return!y||!g[E]?0:Math.max(1,Math.round(y[E]/g[E]*140))},e.historyLabel=function(y){if(!y||!y.date)return"";var E=new Date(y.date);return E.getUTCMonth()+1+"/"+E.getUTCDate()};function k(){e.loadPerformance(),t.get("/api/admin/overview").then(function(y){y.data.history=f(y.data.history),y.data.daily={today:h(y.data.history)},e.data=y.data,e.loading=!1,e.error=null,g={},(y.data.history||[]).forEach(function(E){["dailyPageViews","dailyRepositories","dailyUsers","nbUsers"].forEach(function(w){(!g[w]||E[w]>g[w])&&(g[w]=E[w])})})},function(y){e.loading=!1,e.error=y.data&&y.data.error||"Failed to load overview"})}k();var m=r(k,3e4);e.on("dispose",function(){r.cancel(m)})};var il=[{path:"/connections",template:"partials/connections.htm",title:"GitHub connections \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Xa(e,t.http)},{path:"/signin",template:"partials/signin.htm",title:"Sign in \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>Za(e,t.http)}
Line truncated
|
||||
anonymous_github`)])])])])]),p(" Limitations "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#ui-icon-warning"})]),b("Limitations ")]),o("div",{class:"panel-group",id:"faq-limitations",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingLimitation"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-limitations",href:"#limitation","aria-expanded":"false","aria-controls":"limitation"}," What are the limitations of Anonymous GitHub? ")])]),o("div",{id:"limitation",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingLimitation"},[o("div",{class:"panel-body p-3"},[o("ul",null,[o("li",null," Anonymous GitHub only anonymizes text-based files. Binary files (compiled executables, archives, etc.) are served as-is without anonymization. "),o("li",null," Files larger than 8 MB are not supported. "),o("li",null," Static site generators (such as Jekyll) used with GitHub Pages are not fully supported, although Markdown files are converted to HTML. "),o("li",null," The anonymization of terms within source code may change the behavior of the program (e.g., if a replaced term appears in a string literal or identifier). ")])])])])]),p(" Privacy & Security "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#ui-icon-shield"})]),b("Privacy & Security ")]),o("div",{class:"panel-group",id:"faq-privacy",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingData"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#data","aria-expanded":"false","aria-controls":"data"}," How is my data handled? ")])]),o("div",{id:"data",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingData"},[o("div",{class:"panel-body p-3"},[o("p",null," Data stored on Anonymous GitHub is never shared or used for any purpose beyond providing the anonymization service. When a repository is removed or expires, only its configuration is retained \u2014 this makes it easy to restore the repository if needed and ensures that no future repository reuses the same ID. ")])])]),o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingPermissions"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#permissions","aria-expanded":"false","aria-controls":"permissions"}," Why does GitHub say Anonymous GitHub asks for write access? ")])]),o("div",{id:"permissions",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingPermissions"},[o("div",{class:"panel-body p-3"},[o("p",null,[b("The GitHub App has read-only access to the repositories you choose. You can change repository access on your "),o("a",{href:"/connections"},"GitHub connections"),b(" page.")]),o("p",null,"Legacy GitHub OAuth includes write access to private repositories because GitHub's OAuth scopes do not offer a read-only option for them. Existing OAuth anonymizations and gists can still use this connection."),o("p",null,"Anonymous GitHub reads repository content. It never pushes, modifies, or deletes files on GitHub.")])])]),o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingViewer"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#viewer","aria-expanded":"false","aria-controls":"viewer"}," Can repository owners see who viewed their anonymized repository? ")])]),o("div",{id:"viewer",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingViewer"},[o("div",{class:"panel-body p-3"},[o("p",null," No. Only the total number of views is tracked as an incremental counter. It is not possible for the repository owner or for Anonymous GitHub to identify individual viewers. Reviewer anonymity is fully preserved. ")])])])]),p(" Self-Hosting "),o("h4",{class:"faq-cat"},[o("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[o("use",{href:"#project-icon-storage"})]),b("Self-Hosting ")]),o("div",{class:"panel-group",id:"faq-hosting",role:"tablist","aria-multiselectable":"true"},[o("div",{class:"panel panel-default mb-3"},[o("div",{class:"panel-heading p-3",role:"tab",id:"headingDeploy"},[o("h3",{class:"panel-title"},[o("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-hosting",href:"#deploy","aria-expanded":"false","aria-controls":"deploy"}," Can I deploy my own instance? ")])]),o("div",{id:"deploy",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingDeploy"},[o("div",{class:"panel-body p-3"},[o("p",null,[b(" Yes. Anonymous Git
Line truncated
|
||||
`+JSON.stringify(t):""}`},[je.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${Fc(t)}" via a navigation guard.`},[je.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[je.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[je.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function pn(e,t){return Oe(new Error,{type:e,[ka]:!0},t)}function Lt(e,t){return e instanceof Error&&ka in e&&(t==null||!!(e.type&t))}var Uc=["params","query","hash"];function Fc(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let s of Uc)s in e&&(t[s]=e[s]);return JSON.stringify(t,null,2)}function Ea(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(la," "),r=o.indexOf("="),a=Tn(r<0?o:o.slice(0,r)),c=r<0?null:Tn(o.slice(r+1));if(a in t){let f=t[a];kt(f)||(f=t[a]=[f]),f.push(c)}else t[a]=c}return t}function ni(e){let t="";for(let s in e){let i=e[s];if(s=Ac(s),i==null){i!==void 0&&(t+=(t.length?"&":"")+s);continue}(kt(i)?i.map(o=>o&&Ys(o)):[i&&Ys(i)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+s,o!=null&&(t+="="+o))})}return t}function Ca(e){let t={};for(let s in e){let i=e[s];i!==void 0&&(t[s]=kt(i)?i.map(o=>o==null?null:""+o):i==null?i:""+i)}return t}var _a=Symbol(""),oi=Symbol(""),ts=Symbol(""),ns=Symbol(""),os=Symbol("");function On(){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 Yt(e,t,s,i,o,r=a=>a()){let a=i&&(i.enterCallbacks[o]=i.enterCallbacks[o]||[]);return()=>new Promise((c,f)=>{let v=m=>{m===!1?f(pn(je.NAVIGATION_ABORTED,{from:s,to:t})):m instanceof Error?f(m):Lc(m)?f(pn(je.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(a&&i.enterCallbacks[o]===a&&typeof m=="function"&&a.push(m),c())},g=r(()=>e.call(i&&i.instances[o],t,s,v)),k=Promise.resolve(g);e.length<3&&(k=k.then(v)),k.catch(m=>f(m))})}function ss(e,t,s,i,o=r=>r()){let r=[];for(let a of e)for(let c in a.components){let f=a.components[c];if(!(t!=="beforeRouteEnter"&&!a.instances[c]))if(ra(f)){let v=(f.__vccOpts||f)[t];v&&r.push(Yt(v,s,i,a,c,o))}else{let v=f();r.push(()=>v.then(g=>{if(!g)throw new Error(`Couldn't resolve component "${c}" at "${a.path}"`);let k=wc(g)?g.default:g;a.mods[c]=g,a.components[c]=k;let m=(k.__vccOpts||k)[t];return m&&Yt(m,s,i,a,c,o)()}))}}return r}function Sa(e,t){let s=[],i=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let a=0;a<r;a++){let c=t.matched[a];c&&(e.matched.find(v=>cn(v,c))?i.push(c):s.push(c));let f=e.matched[a];f&&(t.matched.find(v=>cn(v,f))||o.push(f))}return[s,i,o]}var Bc=()=>location.protocol+"//"+location.host;function Ma(e,t){let{pathname:s,search:i,hash:o}=t,r=e.indexOf("#");if(r>-1){let a=o.includes(e.slice(r))?e.slice(r).length:1,c=o.slice(a);return c[0]!=="/"&&(c="/"+c),Zs(c,"")}return Zs(s,e)+i+o}function zc(e,t,s,i){let o=[],r=[],a=null,c=({state:m})=>{let b=Ma(e,location),C=s.value,E=t.value,T=0;if(m){if(s.value=b,t.value=m,a&&a===C){a=null;return}T=E?m.position-E.position:0}else i(b);o.forEach(D=>{D(s.value,C,{delta:T,type:xo.pop,direction:T?T>0?es.forward:es.back:es.unknown})})};function f(){a=s.value}function v(m){o.push(m);let b=()=>{let C=o.indexOf(m);C>-1&&o.splice(C,1)};return r.push(b),b}function g(){if(document.visibilityState==="hidden"){let{history:m}=window;if(!m.state)return;m.replaceState(Oe({},m.state,{scroll:po()}),"")}}function k(){for(let m of r)m();r=[],window.removeEventListener("popstate",c),window.removeEventListener("pagehide",g),document.removeEventListener("visibilitychange",g)}return window.addEventListener("popstate",c),window.addEventListener("pagehide",g),document.addEventListener("visibilitychange",g),{pauseListeners:f,listen:v,destroy:k}}function Na(e,t,s,i=!1,o=!1){return{back:e,current:t,forward:s,replaced:i,position:window.history.length,scroll:o?po():null}}function Hc(e){let{history:t,location:s}=window,i={value:Ma(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(f,v,g){let k=e.indexOf("#"),m=k>-1?(s.host&&document.querySelector("base")?e:e.slice(k))+f:Bc()+e+f;try{t[g?"replaceState":"pushState"](v,"",m),o.value=v}catch(b){console.error(b),s[g?"replace":"assign"](m)}}function a(f,v){r(f,Oe({},t.state,Na(o.value.back,f,o.value.forward,!0),v,{position:o.value.position}),!0),i.value=f}function c(f,v){let g=Oe({},o.value,t.state,{forward:f,scroll:po()});r(g.current,g,!0),r(f,Oe({},Na(i.value,f,null),{position:g.position+1},v),!1),i.value=f}return{location:i,state:o,push:c,replace:a}}function $a(e){e=va(e);let t=Hc(e),s=zc(e,t.state,t.location,t.replace);function i(r,a=!0){a||s.pauseListeners(),history.go(r)}let o=Oe({locatLine truncated
|
||||
`)),e.options=Object.assign({},e.options,v.options),r.restore()})}a();let c=null;e.saveDefault=f=>{if(f&&f.preventDefault&&f.preventDefault(),e.saving)return;let v=r.checkpoint(),g={terms:e.terms.split(`
|
||||
`).map(k=>k.trim()).filter(k=>k.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",g).then(()=>{r.accept(v),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",c&&i.cancel(c),c=i(()=>{e.message=null},2500)},k=>{e.saving=!1;let b="ERRORS."+(k&&k.data&&k.data.error);s(b).then(C=>{e.error=C&&C!==b?C:"Unable to save your defaults. Please try again."},()=>{e.error="Unable to save your defaults. Please try again."})})},e.deleteAccount=()=>{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."}))}},Wa=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)})}},Ka=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(c){e.feature=c},e.featureHref=function(c){return c.needsUser&&!e.user?"/signin":c.href},e.featureTarget=function(c){return c.needsUser&&!e.user?"_self":c.target||void 0},e.featureKeydown=function(c,f){let v={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[c.key];if(v===void 0)return;c.preventDefault();let g=e.features.length,k=v==="first"?0:v==="last"?g-1:(f+v+g)%g;e.feature=e.features[k].key,o(()=>{let m=i.document.getElementById("feature-tab-"+e.feature);m&&m.focus()})},e.cards=[{key:"repositories",total:0,label:"repositories anonymized"},{key:"users",total:0,label:"researchers"},{key:"pageViews",total:0,label:"page views"},{key:"pullRequests",total:0,label:"pull requests"}];function r(){t.get("/api/stat/").then(c=>{e.stat=c.data,e.cards[0].total=c.data.nbRepositories,e.cards[1].total=c.data.nbUsers,e.cards[2].total=c.data.nbPageViews,e.cards[3].total=c.data.nbPullRequests})}r();function a(c){let f={series:c,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!c||c.length<2)return f;let v=new Array(c.length-1);for(let E=1;E<c.length;E++)v[E-1]=c[E]-c[E-1];let g=v.length,k=Math.max.apply(null,v),m=Math.min.apply(null,v),b=Math.min(0,m),C=k-b||1;f.viewW=g*2,f.bars=new Array(g);for(let E=0;E<g;E++){let T=(v[E]-b)/C,D=Math.max(1.5,T*34);f.bars[E]={x:(E*2+.25).toFixed(2),y:(36-D).toFixed(2),w:"1.5",h:D.toFixed(2)}}if(f.deltaToday=v[g-1],g>=2){let E=v[g-2];E&&(f.pctChange=(f.deltaToday-E)/E*100)}return f.pctAbs=Math.round(Math.abs(f.pctChange)),f.isUp=f.pctChange>=0,f}e.history={repositories:a([]),users:a([]),pageViews:a([]),pullRequests:a([])},t.get("/api/stat/history?days=60").then(c=>{let f=c.data||[];e.history={repositories:a(f.map(v=>v.nbRepositories||0)),users:a(f.map(v=>v.nbUsers||0)),pageViews:a(f.map(v=>v.nbPageViews||0)),pullRequests:a(f.map(v=>v.nbPullRequests||0))}})},Ya=function(e,t,s,i,o,r){let a=ct();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),a.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,Ye(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Jt()(document,"click",S=>{e.quotaExpanded&&!S.target.closest?.(".dashboard-quota")&&(e.quotaExpanded=!1)}),e.filtersExpanded=!1,e.projectView="all",e.selectedProject=null,e.p
Line truncated
|
||||
`)),e.options=Object.assign({},e.options,w.options),e.options.expirationDate=w.options&&w.options.expirationDate?new Date(w.options.expirationDate):M(),!i.repoId&&!i.pullRequestId&&!i.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),_&&_()})}function S(_,h,w){e.anonymize&&e.anonymize[_]&&e.anonymize[_].setValidity(h,w)}function I(_){try{let h=parseGithubUrl(_);if(h&&h.owner&&h.repo)return h.owner+"/"+h.repo}catch{}return null}e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,e.reconnectSource=async()=>{if(confirm("Reconnect to the repository currently at this GitHub URL? Review its branch and commit before saving. Saving will replace the published snapshot.")){e.reconnectingSource=!0,e.reconnectRepositoryId=void 0,e.source.commit="",e.source.branch="",e.readme="",e.branches=[];try{await Y()}catch{}}};function H(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:I(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function K(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function X(){let _=new URLSearchParams(window.location.search).get("billingDraft");if(_){T.restore();try{let w=(await t.get("/api/billing/draft/"+encodeURIComponent(_))).data;if(w.path!==o.path())throw new Error("Wrong task");for(let R of["sourceUrl","terms","repoId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(w.values,R)&&(e[R]=w.values[R]);return e.options?.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),D=w.id,O=JSON.stringify(T.checkpoint()),e.draftRestored=!0,e.hostingReview=!0,e.sourceUrl&&await K(),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 h;try{h=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!h||h.path!==o.path()||Date.now()-h.savedAt>=30*6e4)return T.restore()?(e.sourceUrl&&await K(),!0):!1;T.restore();for(let w of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(h.draft,w)&&(e[w]=h.draft[w]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await K(),sessionStorage.removeItem("github-access-draft"),!0}oe(()=>{!i.repoId&&!i.pullRequestId&&!i.gistId&&a(X,0),i.repoId&&i.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=i.repoId,t.get("/api/repo/"+e.repoId).then(async _=>{e.githubConnection=_.data.connection||"oauth",e.sourceUrl="https://github.com/"+_.data.source.fullName,e._originalFullName=_.data.source.fullName,e.terms=_.data.options.terms.filter(h=>h).join(`
|
||||
`),e.source=_.data.source,e.role=_.data.role||"owner",e._existingNever=_.data.options.expirationMode==="never",e.coauthors=_.data.coauthors||[],e._originalBranch=_.data.source.branch,e.options=Object.assign({},e.options,_.data.options),e.conference=_.data.conference,e._originalConference=_.data.conference,e.repositoryID=_.data.source.repositoryID,e._originalRepositoryID=_.data.source.repositoryID,_.data.options.expirationDate&&(e.options.expirationDate=new Date(_.data.options.expirationDate)),C=E(parseGithubUrl(e.sourceUrl)),!await X()&&(await Promise.all([Y(),ee()]),Se())},()=>{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 _=>{if(e.githubConnection=_.data.connection||"oauth",e.sourceUrl="https://github.com/"+_.data.source.repositoryFullName+"/pull/"+_.data.source.pullRequestId,e.terms=_.data.options.terms.filter(h=>h).join(`
|
||||
`),e.source=_.data.source,e.options=Object.assign({},e.options,_.data.options),e.conference=_.data.conference,e._originalConference=_.data.conference,_.data.options.expirationDate&&(e.options.expirationDate=new Date(_.data.options.expirationDate)),C=E(parseGithubUrl(e.sourceUrl)),!await X())try{await $e()}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 _=>{e.sourceUrl="https://gist.github.com/"+_.data.source.gistId,e.terms=_.data.options.terms.filter(h=>h).join(`
|
||||
`),e.source=_.data.source,e.options=Object.assign({},e.options,_.data.options),e.conference=_.data.conference,e._originalConference=_.data.conference,_.data.options.expirationDate&&(e.options.expirationDate=new Date(_.data.options.expirationDate)),C=E(parseGithubUrl(e.sourceUrl)),!await X()&&await Le()},()=>{o.url("/404")}))}),t.get("/github/connections").then(_=>{e.githubConnections=_.data,!i.repoId&&!i.pullRequestId&&!i.gistId&&e.githubConnection===void 0&&_.data.appEnabled&&_.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&K())}).catch(()=>{}),e.urlSelected=async(_=!1)=>{let h=++f,w;try{w=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,re.cancel(),Ee.cancel(),U.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",S("sourceUrl","github",!1);return}let R=E(w),P=_||C===R;C=R,e.sourceUrlError="",S("sourceUrl","github",!0);let L=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,L&&a(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!P&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],P||(e.source={type:"GitHubStream",branch:"",commit:""}),re.cancel(),Ee.cancel(),U.cancel(),Ne.clear(),qe.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",e.html_readme="",e.detectedType=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1,e._preservingDraft=P;try{w.gistId&&!w.repo?(e.detectedType="gist",e.source={gistId:w.gistId},await Le()):w.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:w.owner+"/"+w.repo,pullRequestId:w.pullRequestId},await $e()):(e.detectedType="repo",await Promise.all([Y(),ee()]),Se())}catch{}finally{h===f&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let _=e.branches.filter(w=>w.name==e.source.branch)[0];if(!_)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=_.commit),e.readme=_.readme,await ee(),Se()}),e.getBranches=async _=>{let h=parseGithubUrl(e.sourceUrl),w=m();try{let R=await t.get(`/api/repo/${h.owner}/${h.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&I(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:_===!0||e.reconnectingSource?"1":"0",repositoryID:H()}});if(!k(w))return;e.branches=R.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let P=e.branches.filter(L=>L.name==e.source.branch);P.length>0&&(!(!e.reconnectingSource&&!_&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=P[0].commit),e.readme=P[0].readme,await ee(_))}catch(R){if(!k(w))return;e.branches=[],e.sourceUnreachable=R&&(R.status===404||R.data&&R.data.error==="repo_not_found");let P=R&&R.data&&R.data.error||(R&&R.status===404?"repo_not_found":"unknown_error");r("ERRORS."+P).then(L=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:L}),e.error=L},console.error),typeof S=="function"&&S("sourceUrl","missing",!1)}finally{b(w)}};async function Y(){let _=parseGithubUrl(e.sourceUrl),h=m();try{ie();let w=await t.get(`/api/repo/${_.owner}/${_.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&I(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,repositoryID:H(),force:"1"}});if(!k(h))return;e.details=w.data,e.reconnectingSource&&(e.reconnectRepositoryId=e.details.externalId),e.details&&e.details.id&&(e.repositoryID=e.details.id),e.repoId||(e.repoId=e.details.repo+"-"+generateRandomId(4)),await e.getBranches(e.reconnectingSource)}catch(w){if(!k(h))return;throw w.data&&(r("ERRORS."+w.data.error).then(R=>{e.addToast({title:"Error",date:new Date,body:R}),e.error=R},console.error),Ce(w.data.error)),S("sourceUrl","missing",!1),w}finally{b(h)}}async function ee(_){if(e.readme&&!_)return e.readme;let h=parseGithubUrl(e.sourceUrl),w=m();try{let R=await t.get(`/api/repo/${h.owner}/${h.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&I(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:_===!0?"1":"0",branch:e.source.branch,repositoryID:H()}});k(w,!0)&&(e.readme=R.data)}catch{k(w,!0)&&(e.readme="")}finally{b(w)}}function ce(){let _={terms:e.terms?e.terms.split(`
|
||||
`):[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(_.branchName=e.source.branch);try{let h=parseGithubUrl(e.sourceUrl);_.repoName=`${h.owner}/${h.repo}`}catch{}return _}function le(_,h,w){let R=null,P=0,L=()=>{if(e.detectedType!==_)return;R&&a.cancel(R);let V=++P;e.previewStatus="loading",R=a(()=>{R=null;let B=h();if(!B){e.previewStatus="idle";return}t.post("/api/anonymize-preview",B).then(Q=>{V===P&&(w(Q.data,B),e.previewStatus="ready")}).catch(()=>{V===P&&(e.previewStatus="error")})},200)};return L.cancel=()=>{P++,R&&a.cancel(R),R=null},e.on("dispose",L.cancel),L}e.retryPreview=()=>{e.detectedType==="repo"&&re(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&U()};let re=le("repo",()=>e.readme?{content:e.readme,options:ce()}:null,_=>{if(typeof _?.content!="string")throw Error("Invalid preview response");e.anonymize_readme=_.content;let h="";try{let R=parseGithubUrl(e.sourceUrl),P=e.source.branch||e.details&&e.details.defaultBranch||"main";h=`https://github.com/${R.owner}/${R.repo}/raw/${P}/`}catch{}let w=renderMD(e.anonymize_readme,h);e.html_readme=w,a(Prism.highlightAll,150)});function Se(){!e.anonymize||!e.anonymize.terms||(e.termsRegexWarning=!!e.terms&&!!e.terms.match(/[-[\]{}()*+?.,\\^$|#]/g),re())}async function $e(){let _=parseGithubUrl(e.sourceUrl),h=m();try{ie();let w=await t.get(`/api/pr/${_.owner}/${_.repo}/${_.pullRequestId}`,{params:{connection:e.githubConnection}});if(!k(h))return;e.details=w.data,e.pullRequestId||(e.pullRequestId=_.repo+"-PR"+_.pullRequestId+"-"+generateRandomId(4))}catch(w){if(!k(h))return;throw w.data&&(r("ERRORS."+w.data.error).then(R=>{e.addToast({title:"Error",date:new Date,body:R}),e.error=R},console.error),Ce(w.data.error)),S("sourceUrl","missing",!1),w}finally{b(h)}}let Ne=ze(new Map);function ke(){let _=new Set,h=e.details&&e.details.pullRequest;if(!h)return _;typeof h.title=="string"&&_.add(h.title),typeof h.body=="string"&&_.add(h.body),typeof h.diff=="string"&&_.add(h.diff);let w=h.comments||[];for(let R of w)typeof R.author=="string"&&_.add(R.author),typeof R.body=="string"&&_.add(R.body);return _}let Ee=le("pr",()=>{let _=ke(),h=Array.from(_);return h.length===0?null:{contents:h,options:ce()}},(_,h)=>{if(!Array.isArray(_?.contents)||_.contents.length!==h.contents.length||_.contents.some(P=>typeof P!="string"))throw Error("Invalid preview response");let w=h.contents,R=new Map;for(let P=0;P<w.length&&P<_.contents.length;P++)R.set(w[P],_.contents[P]);Ne.clear(),R.forEach((P,L)=>Ne.set(L,P))});e.anonymizePrContent=function(_){return _&&(Ne.has(_)?Ne.get(_):"")};async function Le(){let _=parseGithubUrl(e.sourceUrl),h=m();try{ie(),e.gistOAuthRequired=!1,e.gistAppRequired=!1;let w=await t.get(`/api/gist/source/${_.gistId}`);if(!k(h))return;e.details=w.data,e.gistId||(e.gistId="gist-"+_.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(w){if(!k(h))return;if(w.data?.error==="github_app_reconnect_required"){e.gistAppRequired=!0,S("sourceUrl","missing",!1);return}if(w.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,S("sourceUrl","missing",!1);return}throw w.data&&(r("ERRORS."+w.data.error).then(R=>{e.addToast({title:"Error",date:new Date,body:R}),e.error=R},console.error),Ce(w.data.error)),S("sourceUrl","missing",!1),w}finally{b(h)}}let qe=ze(new Map);function Ue(){let _=new Set,h=e.details&&e.details.gist;if(!h)return _;typeof h.description=="string"&&_.add(h.description),typeof h.ownerLogin=="string"&&_.add(h.ownerLogin);let w=h.files||[];for(let P of w)typeof P.filename=="string"&&_.add(P.filename),typeof P.content=="string"&&_.add(P.content);let R=h.comments||[];for(let P of R)typeof P.author=="string"&&_.add(P.author),typeof P.body=="string"&&_.add(P.body);return _}let U=le("gist",()=>{let _=Ue(),h=Array.from(_);return h.length===0?null:{contents:h,options:ce()}},(_,h)=>{if(!Array.isArray(_?.contents)||_.contents.length!==h.contents.length||_.contents.some(P=>typeof P!="string"))throw Error("Invalid preview response");let w=h.contents,R=new Map;for(let P=0;P<w.length&&P<_.contents.length;P++)R.set(w[P],_.contents[P]);qe.clear(),R.forEach((P,L)=>qe.set(L,P)),ne()});e.anonymizeGistContent=function(_){return _&&(qe.has(_)?qe.get(_):"")},e.previewGistFiles=[];function ne(){let _=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=_.map(h=>({filename:e.anonymizeGistContent(h.filename),content:e.anonymizeGistContent(h.content),language:h.language}))}e.watch("details.gist.files",ne,!0),e.watch("terms",ne);function x(){let _=e.conference;if(e.conference_data=null,!_)return;let h=e.isUpdate&&_===e._originalConference;t.get("/api/conferences/"+_).then(w=>{e.conference===_&&(e.conference_data=w.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!h&&(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.
Line truncated
|
||||
`).filter(L=>L),connection:e.githubConnection,fullName:`${w.owner}/${w.repo}`,repository:e.sourceUrl,reconnectRepositoryId:e.reconnectRepositoryId,options:e.options,source:e.source,conference:e.conference};e.details&&(R.options.pageSource=e.details.pageSource),ie();let P=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(P,R,{headers:{"Content-Type":"application/json"}}).then(()=>{T.clear(),window.location.href="/status/"+e.repoId},L=>{L.data&&(r("ERRORS."+L.data.error).then(V=>{e.error=V},console.error),Ce(L.data.error),["quota_exceeded","subscription_required_for_never_expiration"].includes(L.data.error)&&(L.data.error==="subscription_required_for_never_expiration"&&(e._existingNever=!1),e.hostingQuotaBlocked=!0,e.hostingReview=!0,Ye(()=>document.getElementById("repository-hosting")?.scrollIntoView({block:"center"}))))}).finally(()=>{h.disabled=!1})},e.anonymizeGist=_=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(ge())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let h=_.currentTarget||_.target.closest?.("button")||_.target;h.disabled=!0;let w=parseGithubUrl(e.sourceUrl),R={gistId:e.gistId,terms:e.terms.trim().split(`
|
||||
`).filter(L=>L),source:{gistId:w.gistId},options:e.options,conference:e.conference};ie();let P=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(P,R,{headers:{"Content-Type":"application/json"}}).then(()=>{T.clear(),window.location.href="/gist/"+e.gistId},L=>{L.data&&(r("ERRORS."+L.data.error).then(V=>{e.error=V},console.error),Ce(L.data.error))}).finally(()=>{h.disabled=!1})},e.anonymizePullRequest=_=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(ge())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let h=_.currentTarget||_.target.closest?.("button")||_.target;h.disabled=!0;let w=parseGithubUrl(e.sourceUrl),R={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
|
||||
`).filter(L=>L),source:{repositoryFullName:`${w.owner}/${w.repo}`,pullRequestId:w.pullRequestId},options:e.options,conference:e.conference};ie();let P=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(P,R,{headers:{"Content-Type":"application/json"}}).then(()=>{T.clear(),window.location.href="/pr/"+e.pullRequestId},L=>{L.data&&(r("ERRORS."+L.data.error).then(V=>{e.error=V},console.error),Ce(L.data.error))}).finally(()=>{h.disabled=!1})},e.watch("conference",()=>{x()}),e.watch("terms",()=>{e.detectedType==="repo"&&Se(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&U()}),e.watch("options.image",()=>{e.detectedType==="repo"&&Se(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&U()}),e.watch("options.link",()=>{e.detectedType==="repo"&&Se(),e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&U()}),e.watch("details",()=>{e.detectedType==="pr"&&Ee(),e.detectedType==="gist"&&U()},!0)},li=function(e,t,s,i,o,r){let a=ct(),c=Jt();e.on("dark-mode",(I,H)=>{e.aceOption&&(H?e.aceOption.theme="nord_dark":e.aceOption.theme="chrome")});let f=0,v=!1;e.on("dispose",()=>{v=!0,f++,g&&g.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,c(document,"keydown",function(I){if((I.metaKey||I.ctrlKey)&&I.key==="k"){I.preventDefault();var H=document.querySelector(".tree-search-input");H&&(H.focus(),H.select())}});var g=null;e.onFileSearchChange=function(){g&&(g.resolve(),g=null);let I=e.fileSearchQuery;if(!I||I.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let H=r.defer();g=H,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(I)}`,{timeout:H.promise}).then(function(K){if(!(v||g!==H)){g=null,e.fileSearchLoading=!1;var X={};e.files.forEach(function(U){X[(U.path||"")+"/"+U.name]=!0});for(var Y=[],ee={},ce=0;ce<K.data.length;ce++){var le=K.data[ce];if(le.path)for(var re=le.path.split("/"),Se="",$e=0;$e<re.length;$e++){var Ne=Se;Se=Se?Se+"/"+re[$e]:re[$e];var ke=Ne+"/"+re[$e];!X[ke]&&!ee[ke]&&(ee[ke]=!0,Y.push({name:re[$e],path:Ne}))}}Y.sort(function(U,ne){return(U.path||"").split("/").length-(ne.path||"").split("/").length}),Y.length>0&&e.files.push.apply(e.files,Y);for(var Ee=[],Le=0;Le<K.data.length;Le++){var qe=K.data[Le],Ue=(qe.path||"")+"/"+qe.name;!X[Ue]&&qe.size!=null&&(Ee.push(qe),X[Ue]=!0)}Ee.length>0&&e.files.push.apply(e.files,Ee),e.fileSearchResults=K.data}},function(){!v&&g===H&&(g=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})};let k={yml:"yaml",txt:"text",py:"python",js:"javascript",ts:"typescript"},m=["license","txt"],b=["png","jpg","jpeg","gif","svg","ico","bmp","tiff","tif","webp","avif","heif","heic"],C=["wav","mp3","ogg","wma","flac","aac","m4a"],E=["mp4","avi","webm","mov","mpg","mpeg","mkv","flv","wmv","3gp","3g2","m4v","f4v","f4p","f4a","f4b"];e.on("routeUpdate",function(I,H){if(e.repoId!=i.repoId)return S();if((i.path||"")!=e.filePath){e.filePath=i.path||"",e.paths=e.filePath.split("/").filter(K=>K&&K.trim().length>0),oe();for(let K=0;K<e.paths.length-1;K++){let X=K>0?e.paths.slice(0,K).join("/"):"";e.files.some(ee=>ee.path===X)||e.getFiles(X)}}});function T(){if(e.paths[0]!="")return;let I=["readme.md","readme.txt","readme.org","readme.1st","readme"],H={};for(let X of e.files)X.name.toLowerCase().indexOf("readme")>-1&&(H[X.name.toLowerCase()]=X.name);let K=null;for(let X of I)if(H[X]){K=X;break}if(!K&&Object.keys(H).length>0&&(K=Object.keys(H)[0]),K){let X=s.url();X[X.length-1]!="/"&&(X+="/"),s.url(X+encodePathForUrl(H[K]))}}e.fileCounts=null,e.getFiles=function(I){let H=e.repoId;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(I)}&v=${e.options.lastUpdateDate}`).then(function(K){if(v||H!==e.repoId)return[];let X=I||"";return e.files=e.files.filter(Y=>Y.path!==X),e.files.push(...K.data),K.data},function(K){if(v||H!==e.repoId)return[];e.type="error",e.content=K&&K.data&&K.data.error||"unknown_error",e.files=[]})};function D(){let I=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts`).then(function(H){v||I!==e.repoId||(e.fileCounts=H.data)},function(){e.fileCounts={}})}function O(){return e.files.filter(I=>I.name==e.paths[e.paths.length-1]&&I.path==e.paths.slice(0,e.paths.length-1).join("/"))[0]}var q=null;e.on("dispose",function(){q&&a.interval.cancel(q)});function F(I){if(v)return;let H=e.repoId;t.get(`/api/repo/${e.repoId}/options`).then(K=>{if(!(v||H!==e.repoId)){if(e.options=K.data,e.options.url){window.location=e.options.url;return}I&&I(K.data)}},K=>{if(!(v||H!==e.repoId)){var X=K.data||{};if(X.error==="rate_limited"&&X.resetAt){let ee=function(){var ce=Math.max(0,Math.ceil((e.rateLimitResetAt-Date.now())/1e3));if(ce<=0)e.rateLimitCountdown="",e.rateLimitResetAt=0,q&&(a.interval.cancel(q),q=null),F(I);else{var le=Math.floor(ce/60),re=ce%60;e.rateLimitCountdown=le>0?le+"m "+re+"s":re+"s"}};var Y=ee;e.type="rate_limited",e.rateLimitResetAt=X.resetAt,q&&a.interval.cancel(q),ee(),q=a.interval(ee,1e3
Line truncated
|
||||
`+E.join(`
|
||||
`)],{type:"text/csv"}),D=document.createElement("a");D.href=URL.createObjectURL(T),D.download=i.username+"-repositories.csv",D.click()},e.showStatusMessage=m=>{let b=m.statusMessage||"(no message)";window.prompt(`Status message for ${m.repoId} (${m.status}):`,b)},e.fetchGithubInfo=m=>{let b=window.open("","_blank");b&&b.document.write("<pre>Loading GitHub info for "+m.repoId+"...</pre>"),t.get("/api/admin/repos/"+m.repoId+"/github").then(C=>{b&&(b.document.open(),b.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(C.data,null,2).replace(/[<>]/g,E=>E==="<"?"<":">")+"</pre>"),b.document.close())},C=>{let E=C&&C.data?JSON.stringify(C.data,null,2):String(C);b&&(b.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+E+"</pre>")})};function f(m){t.get("/api/admin/users/"+m+"/repos",{}).then(b=>{e.repositories=b.data},b=>{console.error(b)})}function v(m){t.get("/api/admin/users/"+m,{}).then(b=>{e.userInfo=b.data},b=>{console.error(b)})}v(i.username),f(i.username),e.banUser=()=>{confirm(`Ban user ${i.username}?`)&&t.post(`/api/admin/users/${i.username}/ban`).then(()=>v(i.username),m=>console.error(m))},e.activateUser=()=>{t.post(`/api/admin/users/${i.username}/activate`).then(()=>v(i.username),m=>console.error(m))},e.promoteUser=()=>{confirm(`Promote ${i.username} to admin?`)&&t.post(`/api/admin/users/${i.username}/promote`).then(()=>v(i.username),m=>console.error(m))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${i.username}?`)&&t.post(`/api/admin/users/${i.username}/demote`).then(()=>v(i.username),m=>console.error(m))},e.tokens=[],e.tokenForm={name:"",plaintext:null};function g(){t.get("/api/admin/tokens").then(m=>{e.tokens=m.data||[]},m=>{m.status!==401&&m.status!==403&&console.error(m)})}g(),e.createToken=()=>{e.tokenForm.name&&t.post("/api/admin/tokens",{name:e.tokenForm.name}).then(m=>{e.tokenForm.plaintext=m.data.token,e.tokenForm.name="",g()},m=>console.error(m))},e.revokeToken=m=>{confirm(`Revoke token "${m.name}"?`)&&t.delete("/api/admin/tokens/"+m.id).then(()=>g(),b=>console.error(b))},e.removeCache=m=>{confirm("Remove cached files for "+m.repoId+"?")&&t.delete("/api/admin/repos/"+m.repoId).then(()=>f(i.username),b=>console.error(b))},e.removeRepository=m=>{confirm("Remove repository "+m.repoId+"?")&&t.delete("/api/repo/"+m.repoId+"/").then(()=>f(i.username),b=>console.error(b))},e.updateRepository=m=>{let b=ze({title:`Refreshing ${m.repoId}...`,date:new Date,body:`The repository ${m.repoId} is going to be refreshed.`});e.toasts.push(b),t.post(`/api/repo/${m.repoId}/refresh`).then(C=>{C.data.status=="ready"?b.title=`${m.repoId} is refreshed.`:b.title=`Refreshing of ${m.repoId}.`},C=>{b.title=`Error during the refresh of ${m.repoId}.`,b.body=C.body})},e.getGitHubRepositories=m=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(b=>{e.userInfo.repositories=b.data})};let k=null;e.watch("query",()=>{o.timeout.cancel(k),k=o.timeout(()=>{f(i.username)},500)},!0)},il=function(e,t,s){let i=ct(),o=Jt();e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),e.conferences=[],e.total=-1,e.totalPage=0,e.statusCounts=[];let r=C=>{if(C.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){C.preventDefault();let E=document.querySelector('.admin-filter-toolbar input[type="search"]');E&&E.focus()}};o(document,"keydown",r),e.on("dispose",()=>document.removeEventListener("keydown",r)),e.clearFilter=C=>{C==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[C]="",e.query.page=1},e.chips=[];let a=()=>{let C=[];(e.query.dateFrom||e.query.dateTo)&&C.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=C};e.statusCountFor=C=>{let E=(e.statusCounts||[]).find(T=>T._id===C);return E?E.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=C=>{e.query.sort===C?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=C,e.query.direction="desc"),e.query.page=1},e.sortIcon=C=>e.query.sort===C?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let c="admin.conferences.filterPrefs",f={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!1,expired:!1,removed:!1,error:!0,preparing:!0},v=loadFilterPrefs(c)||{};e.query=Object.assign({},f,v,{page:1,search:""});let g=s.search();g.search&&(e.query.search=g.search);let k="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(k)||"[]"),e.savePreset=()=>{let C=window.prompt("Preset name:");if(!C)return;let E=Object.assign({},e.query);delete E.page,e.presets=(e.presets||[]).filter(T=>T.name!==C),e.presets.push({name:C,query:E}),localStorage.setItem(k,JSON.stringify(e.presets))},e.applyPreset=C=>{Object.assign(e.query,C.query,{page:1})},e.deletePreset=C=>{e.presets=(e.presets||[]).filter(E=>E.name!==C.name),localStorage.setItem(k,JS
Line truncated
|
||||
`).map((ce,le)=>le===0?ce:ee+ce).join(`
|
||||
`)}else typeof S=="number"||typeof S=="boolean"?Y=String(S):Y=JSON.stringify(S);se.push(`${K}${Y}${X}`)}),se.push("}"),se.join(`
|
||||
`)}function v(D){let O=[],q="",F=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,M=0,z;for(;z=F.exec(D);)q+=D.slice(M,z.index),M=F.lastIndex,O.push({key:z[1],op:z[2]||"=",val:z[3]});return q+=D.slice(M),{filters:O,free:q.trim().toLowerCase()}}function g(D,O){for(let q of O.filters){let F=(z,se,oe)=>{let S=parseFloat(z),I=parseFloat(se);return oe==="="?String(z)===String(se):oe==="!="?String(z)!==String(se):oe===">="?S>=I:oe==="<="?S<=I:oe===">"?S>I:oe==="<"?S<I:!0},M;if(q.key==="code")M=D.displayMessage;else if(q.key==="module")M=D.module;else if(q.key==="status")M=D._status;else if(q.key==="url")M=D._url;else if(q.key==="repo")M=D._repoId;else if(q.key==="level")M=D.level;else continue;if(M==null||!F(M,q.val,q.op))return!1}return!(O.free&&((D.displayMessage||"")+" "+(D.module||"")+" "+(D._url||"")+" "+JSON.stringify(D.raw||[])).toLowerCase().indexOf(O.free)===-1)}function k(){let D=v(e.query.search||"");e.parsedFilterCount=D.filters.length;let O=e.query.bucket,q=e.entries.filter(M=>O&&M._bucket!==O?!1:g(M,D)),F=e.query.group;if(F){let M=oe=>F==="module"?oe.module:oe.displayMessage||oe.message||"_",z=new Map;for(let oe of q){let S=M(oe);if(z.has(S)){let I=z.get(S);I.count++,I._related.push(oe),new Date(oe.ts)>new Date(I.ts)&&(I.ts=oe.ts,I._url=oe._url,I._status=oe._status),new Date(oe.ts)<new Date(I._firstSeen)&&(I._firstSeen=oe.ts)}else{let I=Object.assign({},oe);I._key=`${F}:${S}`,I._related=[oe],I._firstSeen=oe.ts,I._lastHourCount=0,I.count=1,z.set(S,I)}}let se=Date.now()-3600*1e3;for(let oe of z.values())oe._lastHourCount=oe._related.filter(S=>new Date(S.ts).getTime()>=se).length;q=Array.from(z.values())}else q=q.map((M,z)=>(M._key="row:"+z+":"+M.ts,M._related=[M],M._firstSeen=M.ts,M._lastHourCount=0,M.count=1,M));e.query.sort==="count"?q.sort((M,z)=>z.count-M.count||new Date(z.ts)-new Date(M.ts)):q.sort((M,z)=>new Date(z.ts)-new Date(M.ts)),e.visible=q}function m(D){let O=D?e.entries.length:0,q=D?e.pageSize:Math.max(e.pageSize,e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:O,limit:q}}).then(F=>{let M=(F.data.entries||[]).map(c);e.entries=D?e.entries.concat(M):M,e.available=!!F.data.available,e.cap=F.data.max||e.cap,e.total=F.data.total||e.entries.length,k()},F=>console.error(F))}e.loadMore=()=>m(!0),e.canLoadMore=()=>e.entries.length<e.total;function b(){t.get("/api/admin/errors/stats").then(D=>{let O=D.data||{},q=O.prev24h?Math.round((O.last24h-O.prev24h)/O.prev24h*100):0;e.stats={last24h:O.last24h||0,prev24h:O.prev24h||0,delta:q,severity:O.severity||{error:0,warn:0,info:0},unique:O.unique||{error:0,warn:0,info:0},buckets:O.buckets||[],dropped:O.dropped||0}},D=>console.error(D))}function C(){m(),b()}e.barPx=(D,O)=>{let q=e.stats.buckets||[],F=0;for(let oe of q)F=Math.max(F,(oe.error||0)+(oe.warn||0)+(oe.info||0));if(!F)return 0;let M=(D.error||0)+(D.warn||0)+(D.info||0);if(!M)return 0;let z=Math.round(M/F*60),se=D[O]||0;return Math.round(se/M*z)},e.bucketTitle=D=>`${new Date(D.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${D.error||0} err \xB7 ${D.warn||0} warn \xB7 ${D.info||0} info`,e.toggle=D=>{e.expanded[D._key]=!e.expanded[D._key]},e.setBucket=D=>{e.query.bucket=D},e.refreshNow=C,e.clearAll=()=>{confirm("Clear all captured errors?")&&t.delete("/api/admin/errors").then(C,D=>console.error(D))},e.exportCsv=()=>{let D=["ts","level","module","displayMessage","_status","_url","_repoId"],O=[D.join(",")];for(let z of e.visible)O.push(D.map(se=>{let oe=z[se]==null?"":String(z[se]);return/[",\n]/.test(oe)?`"${oe.replace(/"/g,'""')}"`:oe}).join(","));let q=new Blob([O.join(`
|
||||
`)],{type:"text/csv;charset=utf-8"}),F=URL.createObjectURL(q),M=document.createElement("a");M.href=F,M.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(M),M.click(),document.body.removeChild(M),URL.revokeObjectURL(F)};function E(D){e.copyHint=`${D} copied`,o.timeout(()=>{e.copyHint=""},1500)}e.copyJson=D=>{navigator.clipboard.writeText(D._detailJson).then(()=>E("JSON"))},e.copyCurl=D=>{if(!D._url)return;let q=`curl -X ${D._method||"GET"} '${window.location.origin}${D._url}'`;navigator.clipboard.writeText(q).then(()=>E("curl"))},C();let T=i(()=>{e.query.autoRefresh&&C()},15e3);e.on("dispose",()=>i.cancel(T)),e.watch("query.search",k),e.watch("query.bucket",k),e.watch("query.sort",k),e.watch("query.group",k)},ll=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.performanceError=null,e.latencyBound=function(b,C){return b.count?b[C]==null?"> 60 s":"\u2264 "+b[C]+" ms":"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(C){return C.instance===b.instance}).reduce(function(C,E){return Math.max(C,E.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 o=!1;e.loadPerformance=function(){var b=e.performanceMinutes;e.performance?.windowMinutes&&e.performance.windowMinutes!==b&&(e.performance=null),!o&&(o=!0,t.get("/api/admin/performance",{params:{minutes:b}}).then(function(C){b===e.performanceMinutes&&(e.performance=C.data,e.performanceError=C.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(){o=!1,b!==e.performanceMinutes&&e.loadPerformance()}))};function r(b){if(b==null)return"\u2014";for(var C=["B","KB","MB","GB","TB"],E=0,T=b;T>=1024&&E<C.length-1;)T/=1024,E++;return T.toFixed(E>0?1:0)+" "+C[E]}e.humanBytes=r;function a(b){if(!b)return"\u2014";var C=Math.floor(b/86400),E=Math.floor(b%86400/3600),T=Math.floor(b%3600/60);return C>0?C+"d "+(E<10?"0":"")+E+"h":E>0?E+"h "+(T<10?"0":"")+T+"m":T+"m"}e.humanDuration=a;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 C=e.data.repos.statusBreakdown||[],E=0;E<C.length;E++)if(C[E]._id===b)return C[E].count;return 0},e.barPct=function(b){var C=e.data&&e.data.repos?e.data.repos.total:0;if(!C)return 0;var E=[b];b==="expired"&&E.push("expiring"),b==="removed"&&E.push("removing"),b==="preparing"&&E.push("download");var T=0;return E.forEach(function(D){T+=e.statusCount(D)}),Math.max(.4,T/C*100)},e.errPct=function(b){if(!e.data||!e.data.errors)return 0;var C=Math.max(e.data.errors.severity.error,e.data.errors.severity.warn,e.data.errors.severity.info,1);return e.data.errors.severity[b]/C*100};function f(b){var C=b||[];return C.map(function(E,T){var D=C[T-1]||{},O=Object.assign({},E);return O.dailyRepositories=T?Math.max(0,(E.nbRepositories||0)-(D.nbRepositories||0)):0,O.dailyUsers=T?Math.max(0,(E.nbUsers||0)-(D.nbUsers||0)):0,O.dailyPageViews=T?Math.max(0,(E.nbPageViews||0)-(D.nbPageViews||0)):0,O})}function v(b){var C=b&&b.length?b[b.length-1]:{};return{repositories:C.dailyRepositories||0,users:C.dailyUsers||0,pageViews:C.dailyPageViews||0}}var g={};e.historyBarH=function(b,C){return!b||!g[C]?0:Math.max(1,Math.round(b[C]/g[C]*140))},e.historyLabel=function(b){if(!b||!b.date)return"";var C=new Date(b.date);return C.getUTCMonth()+1+"/"+C.getUTCDate()};function k(){e.loadPerformance(),t.get("/api/admin/overview").then(function(b){b.data.history=f(b.data.history),b.data.daily={today:v(b.data.history)},e.data=b.data,e.loading=!1,e.error=null,g={},(b.data.history||[]).forEach(function(C){["dailyPageViews","dailyRepositories","dailyUsers","nbUsers"].forEach(function(E){(!g[E]||C[E]>g[E])&&(g[E]=C[E])})})},function(b){e.loading=!1,e.error=b.data&&b.data.error||"Failed to load overview"})}k();var m=i(k,3e4);e.on("dispose",function(){i.cancel(m)})};var dl=[{path:"/connections",template:"partials/connections.htm",title:"GitHub connections \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>el(e,t.http)},{path:"/signin",template:"partials/signin.htm",title:"Sign in \u2013 Anonymous GitHub",preserveExplorer:!1,setup:(e,t)=>tl(e,t.http)}
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"})]),y("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 & Security "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-shield"})]),y("Privacy & 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 \u2014 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,[y("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"),y(" 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"})]),y("Self-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",{class:"panel-body p-3"},[n("p",null,[y(
Line truncated
|
||||
anonymized repository often think it is about the paper, so the
|
||||
label names the service and the tooltip says who to contact. `),t[12]||(t[12]=o("li",{class:"nav-item d-none d-lg-block"},[o("a",{class:"nav-link",target:"_blank",rel:"noopener",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",title:"Report a problem with the Anonymous GitHub service. Questions about an anonymized repository or paper go to its authors.","data-offset":"30"},[o("svg",{class:"ui-icon d-lg-none mr-1","aria-hidden":"true"},[o("use",{href:"#ui-icon-bug"})]),b("Report a bug ")])],-1)),e.isDarkMode?p("v-if",!0):(l(),d("li",Y4,[o("a",{class:"nav-link nav-icon",href:"#",title:"Switch to dark mode","aria-label":"Switch to dark mode",role:"button",onClick:t[0]||(t[0]=me(n=>{e.darkMode(!0)},["prevent"]))},[...t[7]||(t[7]=[o("svg",{class:"ui-icon","aria-hidden":"true"},[o("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(l(),d("li",J4,[o("a",{class:"nav-link nav-icon",href:"#",title:"Switch to light mode","aria-label":"Switch to light mode",role:"button",onClick:t[1]||(t[1]=me(n=>{e.darkMode(!1)},["prevent"]))},[...t[8]||(t[8]=[o("svg",{class:"ui-icon","aria-hidden":"true"},[o("use",{href:"#ui-icon-sun"})],-1)])])])):p("v-if",!0),e.user?p("v-if",!0):(l(),d("li",Q4,[...t[9]||(t[9]=[o("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[o("i",{class:"fab fa-github mr-1"}),b(" Sign in ")],-1)])])),e.user?(l(),d("li",X4,[o("a",Z4,[e.user?.photo?(l(),d("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,x4)):p("v-if",!0),o("span",e3,c(e.user?.username),1)]),o("div",t3,[o("h6",o3,"Signed in as @"+c(e.user?.username),1),t[10]||(t[10]=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" href="https://github.com/tdurieux/anonymous_github/" target="_blank" rel="noopener"><i class="fab fa-github" aria-hidden="true"></i><span>Source code</span></a><a class="dropdown-item" href="https://ko-fi.com/tdurieux" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-heart"></use></svg><span>Support the project</span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="/api/user/logout" target="_self"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-logout"></use></svg><span>Sign out</span></a>',9))])])):p("v-if",!0)])])],2),e.generalMessage?(l(),d("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,s3)):p("v-if",!0)],64)}var n3={class:"paper-landing"},r3={class:"paper-hero"},i3={class:"paper-hero-copy"},a3={class:"paper-cta-row"},l3={key:0,href:"/signin",target:"_self",class:"btn-hero"},d3={key:1,href:"/anonymize",class:"btn-hero"},u3={class:"paper-stats paper-wrap",id:"metrics","aria-label":"Usage over the last 60 days"},c3={class:"paper-stats-grid"},p3={class:"paper-stat-value"},f3={class:"paper-stat-label"},m3=["viewBox"],h3=["x","y","width","height"],v3={key:1,class:"paper-stat-delta"},g3={class:"paper-features paper-wrap","aria-label":"Product features"},y3={class:"paper-features-list",role:"tablist","aria-label":"Features","aria-orientation":"vertical"},b3=["onClick","onKeydown","id","aria-controls","aria-selected","tabindex"],w3={class:"paper-eyebrow"},k3={class:"paper-feature-title"},E3={class:"paper-feature-more"},C3={class:"paper-feature-title paper-feature-title-m","aria-hidden":"true"},_3=["href","target"],S3={class:"paper-features-stage"},N3=["id","aria-labelledby"],D3={class:"paper-frame"},R3={class:"paper-frame-bar","aria-hidden":"true"},T3={class:"url"},A3=["src","alt"],O3={class:"paper-footer"},I3={class:"paper-footer-inner"},P3={class:"paper-footer-col"},V3={key:0,href:"/dashboard"},q3={key:1,href:"/conferences"},M3={class:"paper-footer-foot"};function Dl(e,t){return l(),d("div",n3,[p(" Hero: copy on the left, the product on the right "),o("section",r3,[o("div",i3,[t[2]||(t[2]=o("div",{class:"paper-eyebrow"},"For double-blind peer review",-1)),t[3]||(t[3]=o("h1",{class:"hero-title"},[b(" Share the code,"),o("br"),o("span",{class:"accent"},"not the author.")],-1)),t[4]||(t[4]=o("p",{class:"hero-subtitle
Line truncated
|
||||
label names the service and the tooltip says who to contact. `),t[13]||(t[13]=n("li",{class:"nav-item d-none d-lg-block"},[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"})]),y("Report a bug ")])],-1)),e.isDarkMode?p("v-if",!0):(l(),d("li",SI,[n("a",{class:"nav-link nav-icon",href:"#",title:"Switch to dark mode","aria-label":"Switch to dark mode",role:"button",onClick:t[0]||(t[0]=ue(s=>{e.darkMode(!0)},["prevent"]))},[...t[8]||(t[8]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(l(),d("li",NI,[n("a",{class:"nav-link nav-icon",href:"#",title:"Switch to light mode","aria-label":"Switch to light mode",role:"button",onClick:t[1]||(t[1]=ue(s=>{e.darkMode(!1)},["prevent"]))},[...t[9]||(t[9]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sun"})],-1)])])])):p("v-if",!0),e.user?p("v-if",!0):(l(),d("li",DI,[...t[10]||(t[10]=[n("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[n("i",{class:"fab fa-github mr-1"}),y(" Sign in ")],-1)])])),e.user?.username&&e.headerCanUpgrade&&!e.headerBillingPending?(l(),d("li",RI,[n("a",{class:"nav-link nav-upgrade",href:"/profile?upgrade=1",onClick:t[2]||(t[2]=ue(s=>e.openHeaderUpgrade(),["prevent"]))},"Upgrade")])):p("v-if",!0),e.user?(l(),d("li",TI,[n("a",AI,[e.user?.photo?(l(),d("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,OI)):p("v-if",!0),n("span",PI,u(e.user?.username),1)]),n("div",II,[n("h6",VI,"Signed in as @"+u(e.user?.username),1),t[11]||(t[11]=pe('<a class="dropdown-item" href="/profile"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-filter"></use></svg><span>Settings<small>Defaults, quotas, account</small></span></a><a class="dropdown-item" href="/connections"><i class="fab fa-github" aria-hidden="true"></i><span>GitHub connections<small>Repository access and OAuth</small></span></a><a class="dropdown-item" href="/claim"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-link"></use></svg><span>Claim an anonymization<small>Attach an existing mirror to your account</small></span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-bug"></use></svg><span>Report a bug<small>About this service, not a paper</small></span></a><a class="dropdown-item" href="https://github.com/tdurieux/anonymous_github/" target="_blank" rel="noopener"><i class="fab fa-github" aria-hidden="true"></i><span>Source code</span></a><a class="dropdown-item" href="https://ko-fi.com/tdurieux" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-heart"></use></svg><span>Support the project</span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="/api/user/logout" target="_self"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-logout"></use></svg><span>Sign out</span></a>',9))])])):p("v-if",!0)])])],2),e.generalMessage?(l(),d("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,qI)):p("v-if",!0)],64)}var MI={class:"paper-landing"},$I={class:"paper-hero"},LI={class:"paper-hero-copy"},UI={class:"paper-cta-row"},FI={key:0,href:"/signin",target:"_self",class:"btn-hero"},BI={key:1,href:"/anonymize",class:"btn-hero"},zI={class:"paper-stats paper-wrap",id:"metrics","aria-label":"Usage over the last 60 days"},HI={class:"paper-stats-grid"},jI={class:"paper-stat-value"},GI={class:"paper-stat-label"},WI=["viewBox"],KI=["x","y","width","height"],YI={key:1,class:"paper-stat-delta"},QI={class:"paper-features paper-wrap","aria-label":"Product features"},JI={class:"paper-features-list",role:"tablist","aria-label":"Features","aria-orientation":"vertical"},XI=["onClick","onKeydown","id","aria-controls","aria-selected","tabindex"],ZI={class:"paper-eyebrow"},xI={class:"paper-feature-title"},e4={class:"paper-feature-more"},t4={class:"paper-feature-title paper-feature-title-m","aria-hidden":"true"},n4=["href","target"],o4={class:"paper-features-stage"},s4=["id","aria-labelledby"],i4={class:"paper-frame"},r4={class:"paper-frame-bar","aria-hidden":"true"},a4={class:"url"},l4=["src","alt"],d4={class:"paper-footer"},u4={class:"paper-footer-inner"},c4={class:"paper-footer-col"},p4={key:0,href:"/dashboard"},f4={key:1,href:"/conferences"},h4={class:"paper-footer-foot"};function Al(e,t){return l(),d("div",MI,[p(" Hero: copy on the left, the product on the right "),n("section",$I,[n("div",LI,[t[2]||(t[
Line truncated
|
||||
MIT CSAIL
|
||||
jane.smith@example.org`},N5={id:"termsHelp",class:"form-text text-muted"},D5={class:"invalid-feedback"},R5={id:"settings-display",class:"paper-settings-section"},T5={class:"form-group paper-check-list"},A5={class:"form-check"},O5={class:"form-check-input",type:"checkbox",id:"link",name:"link"},I5={class:"form-check"},P5={class:"form-check-input",type:"checkbox",id:"image",name:"image"},V5={class:"form-check"},q5={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},M5={class:"form-check"},L5={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},$5={id:"settings-features",class:"paper-settings-section"},U5={class:"form-group paper-check-list"},F5={class:"form-check"},z5={class:"form-check-input",type:"checkbox",id:"page",name:"page"},H5={class:"form-check"},B5={class:"form-check-input",type:"checkbox",id:"loc",name:"loc"},j5={class:"form-check"},G5={class:"form-check-input",type:"checkbox",id:"update",name:"update"},W5={class:"form-group"},K5={class:"form-control",id:"mode",name:"mode"},Y5={class:"form-text text-muted"},J5={id:"settings-expiration",class:"paper-settings-section"},Q5={class:"form-group"},X5={class:"form-control",id:"expiration",name:"expiration"},Z5={key:0,class:"draft-status",role:"status"},x5={key:1,class:"draft-status"},eq={class:"paper-settings-footer"},tq={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},oq=["textContent"],sq={class:"paper-settings-actions"},nq=["disabled"],rq={key:0,class:"ui-icon mr-1","aria-hidden":"true"},iq={id:"settings-account",class:"paper-settings-section"},aq={class:"paper-account-card"},lq=["src"],dq={class:"paper-account-identity"},uq={class:"paper-account-name"},cq={class:"paper-danger-zone"},pq={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},fq=["textContent"],mq=["disabled"];function Il(e,t){let n=We("quota-usage"),r=be("paper-scrollspy"),s=be("field"),i=be("form");return l(),d("div",v5,[t[52]||(t[52]=ce('<div class="paper-crumbs"><a href="/dashboard">My work</a> \xA0/\xA0 <span class="here">Settings</span></div><h1 class="paper-page-title">Your <em>settings</em></h1><p class="paper-page-lede">Defaults applied to every new anonymization, your quotas, and your account.</p>',3)),o("div",g5,[N((l(),d("aside",y5,[...t[4]||(t[4]=[ce('<div class="paper-settings-toc-head">On this page</div><nav><a href="#settings-quota">Quota</a><a href="#settings-terms">Terms to redact</a><a href="#settings-display">Display</a><a href="#settings-features">Features</a><a href="#settings-expiration">Expiration</a><a href="#settings-account">Account</a></nav>',2)])])),[[r]]),o("div",b5,[p(" Account usage shares the dashboard component. "),o("section",w5,[t[6]||(t[6]=o("div",{class:"paper-section-eyebrow"},"Quota",-1)),t[7]||(t[7]=o("p",{class:"paper-section-copy"},"What you are using across all your anonymizations. Conferences can lift these limits during a review window.",-1)),e.quota?(l(),Lt(n,{key:0,quota:e.quota,fmt:e.fmt},null,8,["quota","fmt"])):p("v-if",!0),e.quota?p("v-if",!0):(l(),d("div",k5,[(l(),d(X,null,re([1,2,3],(a,u)=>o("div",E5,[...t[5]||(t[5]=[o("div",{class:"quota-header"},[o("span",{class:"skeleton skeleton-line",style:{width:"40%"}}),o("span",{class:"skeleton skeleton-line",style:{width:"25%"}})],-1),o("div",{class:"quota-track"},null,-1)])])),64))]))]),N((l(),d("form",{class:"form needs-validation",name:"defaultsForm",novalidate:"",onSubmit:t[2]||(t[2]=me(a=>e.submitForm(a,()=>{e.saveDefault(a)}),["prevent"]))},[o("section",C5,[t[13]||(t[13]=o("div",{class:"paper-section-eyebrow"},"Terms to redact",-1)),t[14]||(t[14]=o("p",{class:"paper-section-copy"},"Pre-filled in every new anonymization. You can still edit the list per anonymization.",-1)),o("div",_5,[t[12]||(t[12]=o("label",{class:"paper-field-label",for:"terms"},"Default terms",-1)),N(o("textarea",S5,null,512),[[s,{state:e.viewState,set:a=>{e.terms=a},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),o("small",N5,[t[8]||(t[8]=b(" One term per line (regex allowed). Each match is replaced by ",-1)),o("code",null,c(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[9]||(t[9]=b(", or use ",-1)),t[10]||(t[10]=o("code",null,"term=>replacement",-1)),t[11]||(t[11]=b(" to pick your own. ",-1))]),N(o("div",D5," Terms are in an invalid format ",512),[[Y,e.defaultsForm?.terms?.errors?.format]])])]),o("section",R5,[t[23]||(t[23]=o("div",{class:"paper-section-eyebrow"},"Display",-1)),t[24]||(t[24]=o("p",{class:"paper-section-copy"},"What reviewers can see inside an anonymized repository.",-1)),o("div",T5,[o("div",A5,[N(o("input",O5,null,512),[[s,{state:e.viewState,set:a=>{e.options.link=a},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[15]||(t[15]=o("label",{class:"form-check-label",for:"link"},"Keep links",-1)),t[16]||(t[16]=o("small",{class:"form-text text-muted"},"Unchecked, every link in text files is removed.",-1))]),o("div",I5,[N(o("input",P5,null,512),[[s,{state:e.viewState,set:a=>{e.options.image=a},value:e.op
Line truncated
|
||||
`);for(let k=0;k<g.length;k++){let m=g[k];if(m.startsWith("diff --git")){h(),f();continue}if(m.startsWith("--- ")){i&&i.lines.length&&h(),f().oldPath=m.replace(/^--- (a\/)?/,"").trim();continue}if(m.startsWith("+++ ")){f().newPath=m.replace(/^\+\+\+ (b\/)?/,"").trim();continue}if(!(m.startsWith("index ")||m.startsWith("similarity index")||m.startsWith("rename ")||m.startsWith("new file mode")||m.startsWith("deleted file mode")||m.startsWith("Binary files"))){if(m.startsWith("@@")){let y=m.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);y&&(a=parseInt(y[1],10),u=parseInt(y[2],10)),f().lines.push({kind:"hunk",oldNo:"",newNo:"",text:m});continue}i&&(m.startsWith("+")?(i.lines.push({kind:"add",oldNo:"",newNo:u,text:m.slice(1)}),u++):m.startsWith("-")?(i.lines.push({kind:"remove",oldNo:a,newNo:"",text:m.slice(1)}),a++):(i.lines.push({kind:"ctx",oldNo:a,newNo:u,text:m.startsWith(" ")?m.slice(1):m}),a++,u++))}}return n(s,i),s.join("")}})({trustAsHtml:e=>e});function TM(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function AM(e){return String(e??"").toUpperCase()}function OM(e,t,n=0){return(e||[]).slice(n,n+t)}function IM(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function PM(e,t){if(!t)return e||[];let n=Array.isArray(t)?t:[t];return[...e||[]].sort((r,s)=>{for(let i of n){let a=i[0]==="-"?-1:1;i=i.replace(/^[+-]/,"");let u=i.split(".").reduce((h,g)=>h?.[g],r),f=i.split(".").reduce((h,g)=>h?.[g],s);if(typeof u=="string"&&(u=u.toLowerCase()),typeof f=="string"&&(f=f.toLowerCase()),u!==f)return(u==null?-1:f==null?1:u<f?-1:1)*a}return 0})}function VM(e,t){if(!e)return"";let n=new Date(e);if(isNaN(n))return String(e);if(!t||t==="mediumDate")return n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});let r={yyyy:n.getFullYear(),MMM:n.toLocaleDateString(void 0,{month:"short"}),MM:String(n.getMonth()+1).padStart(2,"0"),dd:String(n.getDate()).padStart(2,"0"),d:n.getDate(),HH:String(n.getHours()).padStart(2,"0"),mm:String(n.getMinutes()).padStart(2,"0"),ss:String(n.getSeconds()).padStart(2,"0")};return t.replace(/yyyy|MMM|MM|dd|HH|mm|ss|d/g,s=>r[s])}function qM(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}var Fl={ERRORS:{cache_busy:"Downloads are busy. Please try again shortly.",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:"Unknown error, contact the admin.",unreachable:"Anonymous GitHub is unreachable, contact the admin.",request_error:"Unable to download the file, check your connection or contact the admin.",not_found:"The requested resource could not be found.",not_connected:"You must be logged in to perform this action.",not_authorized:"You do not have permission to perform this action.",unable_to_connect_user:"Unable to connect your account. Please try again later.",user_not_found:"The requested user could not be found.",user_banned:"Your account has been banned. Contact the admin for more information.",repo_access_limited:"GitHub blocked access because the repository's organization restricts third-party OAuth apps. Ask an org owner to approve Anonymous GitHub under Settings \u2192 Third-party Access \u2192 OAuth app policy, or anonymize a personal fork instead.",repo_saml_enforcement:"The repository's organization enforces SAML single sign-on. Authorize your token for that organization (GitHub \u2192 Settings \u2192 Applications, or re-run the org's SSO sign-in), then retry. Alternatively, anonymize a personal fork.",repo_not_found:"The repository was not found on GitHub. Check the URL and spelling, make sure you are signed in to the account that can see it, and confirm the repo isn't hidden under an org that restricts third-party app access.",repo_empty:"The selected branch has no commits on GitHub. Push at least one commit, or pick a different branch, then retry.",repo_not_accessible:"Anonymous GitHub cannot access this repository. Verify the repository exists and that Anonymous GitHub has been authorized for the owning organization.",repository_archived:"This repository has been archived and its files are no longer available.",repository_expired:"The repository is expired.",invalid_status:"This action cannot be performed while the resource is in its current state.",repository_not_ready:"Anonymous GitHub is still processing the repository, it can take several minutes.",repository_not_accessible:"This repository is currently not accessible.",repo_is_updating:"Anonymous GitHub is still processing the repository, it can take several minutes.",invalid_repo:"The provided repository is not valid.",invalid_source_repository:"The repository source name
Line truncated
|
||||
jane.smith@example.org`},nq={class:"settings-syntax"},oq={class:"invalid-feedback"},sq={class:"settings-row"},iq={class:"settings-checks"},rq={class:"settings-check"},aq={class:"form-check-input",type:"checkbox",id:"link",name:"link"},lq={class:"settings-check"},dq={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},uq={class:"settings-check"},cq={class:"form-check-input",type:"checkbox",id:"image",name:"image"},pq={class:"settings-check"},fq={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},hq={class:"settings-check"},mq={class:"form-check-input",type:"checkbox",id:"loc",name:"loc"},vq={class:"settings-check"},gq={class:"form-check-input",type:"checkbox",id:"page",name:"page"},yq={class:"settings-row"},bq={class:"settings-check"},wq={class:"form-check-input",type:"checkbox",id:"update",name:"update"},kq={class:"settings-row"},Eq={class:"form-control",id:"expiration",name:"expiration"},Cq={class:"settings-help"},_q={class:"settings-save"},Sq={class:"settings-save-status draft-status",role:"status"},Nq={key:0},Dq={key:1},Rq={key:2},Tq=["disabled"],Aq={key:1,class:"settings-save-error",role:"alert"},Oq=["aria-busy"],Pq={key:0,role:"status"},Iq={key:1,class:"settings-notice",role:"alert"},Vq=["disabled"],qq={key:2,class:"settings-notice",role:"status"},Mq={key:3,class:"settings-notice",role:"status"},$q=["disabled"],Lq={class:"settings-row"},Uq={class:"settings-inline"},Fq={key:0,class:"settings-help"},Bq={key:0,class:"settings-help"},zq={id:"settings-quota"},Hq={key:1,role:"status"},jq={key:1,class:"settings-notice"},Gq={key:2,class:"settings-notice"},Wq={key:3,class:"settings-notice"},Kq={key:4,class:"settings-help"},Yq={key:5,class:"settings-plan billing-plan"},Qq={class:"settings-comparison"},Jq={class:"settings-cycles"},Xq=["checked","onChange"],Zq={class:"settings-help"},xq={class:"settings-actions"},e8=["disabled"],t8={key:6,class:"settings-help"},n8={class:"settings-row"},o8={key:0,class:"settings-inline"},s8=["disabled"],i8={key:1,class:"settings-help"},r8=["disabled"],a8={key:4,class:"settings-row"},l8={class:"settings-inline"},d8=["disabled"],u8={key:0,class:"settings-pass"},c8={class:"settings-help"},p8=["disabled"],f8={key:5,class:"settings-row"},h8={class:"settings-help"},m8={id:"settings-account",class:"settings-account-panel"},v8={class:"paper-account-card"},g8=["src"],y8={class:"paper-account-identity"},b8={class:"paper-account-name"},w8={class:"paper-danger-zone"},k8={key:0,class:"paper-inline-alert paper-inline-alert-error",role:"alert"},E8=["textContent"],C8=["disabled"],_8={key:1,class:"settings-delete-confirm"},S8={for:"delete-username"},N8={class:"settings-actions"},D8=["disabled"],R8=["disabled"];function ql(e,t){let s=We("quota-usage"),i=ye("field"),o=ye("form");return l(),d("div",Q5,[n("header",J5,[t[16]||(t[16]=n("h1",null,"Settings",-1)),n("div",X5,[n("span",null,"@"+u(e.user?.username),1)])]),n("nav",Z5,[(l(),d(W,null,Z([{id:"defaults",label:"Anonymization defaults"},{id:"billing",label:"Hosting & billing"},{id:"account",label:"Account"}],r=>n("button",{type:"button","aria-current":e.settingsTab===r.id?"page":null,onClick:a=>e.settingsTab=r.id},u(r.label),9,x5)),64))]),N(n("div",null,[t[37]||(t[37]=n("p",{class:"settings-scope"},"For new anonymizations only. Existing repositories keep their settings.",-1)),N((l(),d("form",{class:"form needs-validation",name:"defaultsForm",novalidate:"",onSubmit:t[1]||(t[1]=ue(r=>e.submitForm(r,()=>{e.saveDefault(r)}),["prevent"]))},[n("section",eq,[t[22]||(t[22]=n("div",null,[n("label",{class:"settings-label",for:"terms"},"Terms to redact"),n("p",{class:"settings-help"},"One term per line.")],-1)),n("div",null,[N(n("textarea",tq,null,512),[[i,{state:e.viewState,set:r=>{e.terms=r},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),n("details",nq,[t[21]||(t[21]=n("summary",null,"Regex & replacement syntax",-1)),n("p",null,[t[17]||(t[17]=y("Matches become ",-1)),n("code",null,u(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[18]||(t[18]=y(". Use ",-1)),t[19]||(t[19]=n("code",null,"term=>replacement",-1)),t[20]||(t[20]=y(" for a custom replacement. Regex is supported.",-1))])]),N(n("div",oq,"Terms are in an invalid format.",512),[[G,e.defaultsForm?.terms?.errors?.format]])])]),n("section",sq,[t[31]||(t[31]=n("h2",null,"Reviewer display",-1)),n("div",null,[n("div",iq,[n("label",rq,[N(n("input",aq,null,512),[[i,{state:e.viewState,set:r=>{e.options.link=r},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[23]||(t[23]=y("Keep links",-1))]),n("label",lq,[N(n("input",dq,null,512),[[i,{state:e.viewState,set:r=>{e.options.notebook=r},value:e.options?.notebook,form:"defaultsForm",options:{}}]]),t[24]||(t[24]=y("Render notebooks",-1))]),n("label",uq,[N(n("input",cq,null,512),[[i,{state:e.viewState,set:r=>{e.options.image=r},value:e.options?.image,form:"defaultsForm",options:{}}]]),t[25]||(t[25]=y("Show images",-1))]),n("label",pq,[N(n("input",fq,null,512),[[i,{state:e.viewState,set:r=>{e.options.pdf=r}
Line truncated
|
||||
`);for(let k=0;k<g.length;k++){let m=g[k];if(m.startsWith("diff --git")){v(),f();continue}if(m.startsWith("--- ")){r&&r.lines.length&&v(),f().oldPath=m.replace(/^--- (a\/)?/,"").trim();continue}if(m.startsWith("+++ ")){f().newPath=m.replace(/^\+\+\+ (b\/)?/,"").trim();continue}if(!(m.startsWith("index ")||m.startsWith("similarity index")||m.startsWith("rename ")||m.startsWith("new file mode")||m.startsWith("deleted file mode")||m.startsWith("Binary files"))){if(m.startsWith("@@")){let b=m.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);b&&(a=parseInt(b[1],10),c=parseInt(b[2],10)),f().lines.push({kind:"hunk",oldNo:"",newNo:"",text:m});continue}r&&(m.startsWith("+")?(r.lines.push({kind:"add",oldNo:"",newNo:c,text:m.slice(1)}),c++):m.startsWith("-")?(r.lines.push({kind:"remove",oldNo:a,newNo:"",text:m.slice(1)}),a++):(r.lines.push({kind:"ctx",oldNo:a,newNo:c,text:m.startsWith(" ")?m.slice(1):m}),a++,c++))}}return s(o,r),o.join("")}})({trustAsHtml:e=>e});function QM(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function JM(e){return String(e??"").toUpperCase()}function XM(e,t,s=0){return(e||[]).slice(s,s+t)}function ZM(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function xM(e,t){if(!t)return e||[];let s=Array.isArray(t)?t:[t];return[...e||[]].sort((i,o)=>{for(let r of s){let a=r[0]==="-"?-1:1;r=r.replace(/^[+-]/,"");let c=r.split(".").reduce((v,g)=>v?.[g],i),f=r.split(".").reduce((v,g)=>v?.[g],o);if(typeof c=="string"&&(c=c.toLowerCase()),typeof f=="string"&&(f=f.toLowerCase()),c!==f)return(c==null?-1:f==null?1:c<f?-1:1)*a}return 0})}function e6(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 t6(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}var Hl={ERRORS:{cache_busy:"Downloads are busy. Please try again shortly.",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:"Unknown error, contact the admin.",unreachable:"Anonymous GitHub is unreachable, contact the admin.",request_error:"Unable to download the file, check your connection or contact the admin.",not_found:"The requested resource could not be found.",not_connected:"You must be logged in to perform this action.",not_authorized:"You do not have permission to perform this action.",unable_to_connect_user:"Unable to connect your account. Please try again later.",user_not_found:"The requested user could not be found.",user_banned:"Your account has been banned. Contact the admin for more information.",repo_access_limited:"GitHub blocked access because the repository's organization restricts third-party OAuth apps. Ask an org owner to approve Anonymous GitHub under Settings \u2192 Third-party Access \u2192 OAuth app policy, or anonymize a personal fork instead.",repo_saml_enforcement:"The repository's organization enforces SAML single sign-on. Authorize your token for that organization (GitHub \u2192 Settings \u2192 Applications, or re-run the org's SSO sign-in), then retry. Alternatively, anonymize a personal fork.",repo_not_found:"The repository was not found on GitHub. Check the URL and spelling, make sure you are signed in to the account that can see it, and confirm the repo isn't hidden under an org that restricts third-party app access.",repo_empty:"The selected branch has no commits on GitHub. Push at least one commit, or pick a different branch, then retry.",repo_not_accessible:"Anonymous GitHub cannot access this repository. Verify the repository exists and that Anonymous GitHub has been authorized for the owning organization.",repository_archived:"This repository has been archived and its files are no longer available.",repository_expired:"The repository is expired.",invalid_status:"This action cannot be performed while the resource is in its current state.",repository_not_ready:"Anonymous GitHub is still processing the repository, it can take several minutes.",repository_not_accessible:"This repository is currently not accessible.",repo_is_updating:"Anonymous GitHub is still processing the repository, it can take several minutes.",invalid_repo:"The provided repository is not valid.",invalid_source_repository:"The repository source name
Line truncated
|
||||
/*! Bundled license information:
|
||||
|
||||
@vue/shared/dist/shared.esm-bundler.js:
|
||||
|
||||
Reference in new issue
Block a user