Merge branch 'integrate/source-errors' into fix/source-failure-classification

# Conflicts:
#	public/asset-manifest.json
#	public/script/vendor.min.js
This commit is contained in:
Thomas Durieux committed 2026-11-14 23:24:11 +00:00
commit 233bb7eae6
24 files changed
+3370 -73

No files matched your search

+22
View File
@@ -334,6 +334,28 @@ cold concurrent statistics, recent/grouped-history reads, overload rejection and
subsequent transaction integrity, unavailable fallback, and restart recovery.
The fixture uses only synthetic counters and removes its container on exit.
## Safe exception diagnostics
New application errors retain the normalized route template, HTTP method/status,
a finite error type/code, and up to eight recognized application frames (1 KiB maximum per stack) for the
exception and the deepest inspected cause (at most three levels, cycles stopped). Raw messages,
Upstream URLs, query strings, external frames and absolute filesystem roots are
not stored. Repository/file parameters are excluded except for the explicitly
scoped failed-request reproduction context below. Unknown error types use `UnknownError`; unknown
function names become `<anonymous>`. Source locations are build-relative for
compiled code and source-relative in development; line numbers refer to that
release, not an inferred source map.
`scripts/generate-log-diagnostics.js` derives the finite project file/function
allowlist from checked-in TypeScript and writes both application and collector
validation. Regenerate it when adding diagnostic code locations. The admin API
revalidates every field for both Redis and central logs. Deploy matching app and
collector versions to preserve new fields; older collectors deliberately drop
unknown fields. Existing discarded exception details cannot be recovered.
### Admin reproduction context
Failed application file requests now retain their public anonymous repository ID and encoded request pathname, up to 2 KiB, under the existing admin log access controls. This is an explicit exception to template-only diagnostics: repository-relative filenames are retained for reproduction. Query strings, headers, bodies and upstream owner/repository URLs are still excluded. Filenames are operator-visible data under this policy; no generic filter can guarantee that a user has not put sensitive text in a filename. Successful requests and metrics keep only the normalized route. Only `/api/repo/:repoId/file/:path` is supported; other endpoints and unsafe, oversized, malformed or traversal paths omit reproduction context. Historical records cannot be backfilled. The UI copies the exact captured pathname without a host or query.
For the focused restricted-file/rotation regression, run
`LOGGING_ACCESS_ONLY=1 python3 scripts/test-logging.py`. This uses synthetic
`0640` logs in an isolated Docker project and preserves capability restrictions.
+29
View File
@@ -59,5 +59,34 @@ for_each(["status", "httpStatus", "ms", "firstByteMs", "responseMs", "bytes", "b
if includes(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "OTHER"], record.method) { out.method = record.method }
if includes(["/", "other", "/dashboard", "/anonymize", "/healthcheck", "/api/healthcheck", "/api", "/api/download", "/api/stat", "/api/stat/history", "/api/options", "/api/message", "/api/user", "/api/user/quota", "/api/user/dashboard", "/api/repo", "/api/anonymize-preview", "/api/admin/overview", "/api/admin/performance", "/api/admin/errors", "/api/admin/errors/stats", "/api/admin/queues", "/api/admin/queues/metrics", "/github/app/webhook", "/api/repo/:repoId", "/api/repo/:repoId/file/:path", "/api/repo/:repoId/files", "/api/repo/:repoId/files/counts", "/api/repo/:repoId/files/search", "/api/repo/:repoId/zip", "/api/repo/:repoId/options", "/api/repo/:repoId/refresh", "/api/repo/:repoId/coauthors", "/api/repo/:repoId/extend", "/api/repo/:owner/:repo/readme", "/api/repo/:owner/:repo/branches", "/w/:repoId/:path", "/r/:repoId/:path", "/api/pr/:id/:path", "/api/gist/:id/:path", "/assets/:path", "/github/:action", "/api/admin/:action", "/api/user/:action", "/api/repo/:id/file/:path", "/api/repo/:id/files/counts", "/api/repo/:id/files/search", "/api/repo/:id/files", "/api/repo/:id/zip", "/api/repo/:id", "/viewer/:id/:path"], record.route) { out.route = record.route }
# VictoriaLogs consumes its message field; keep event independently searchable.
# Explicit reproduction context for failed application file requests, never query strings.
if includes(["error", "fatal"], out.severity) || to_int(out.status) >= 400 || to_int(out.httpStatus) >= 400 {
path = to_string(record.requestPath) ?? ""
parsed, path_error = parse_regex(path, r'^/api/repo/(?P<repo>[A-Za-z0-9_-]{3,200})/file/(?P<file>[A-Za-z0-9._~!$&\'()+,;=@%/-]+)$')
decoded = decode_percent(to_string(parsed.file))
if path_error == null && length(path) <= 2048 && !match(path, r'%(?:[^a-fA-F0-9]|[a-fA-F0-9][^a-fA-F0-9]|[a-fA-F0-9]?$)') && !match(decoded, r'[\x00-\x1f\x7f-\x9f\x{2028}-\x{202e}\x{2066}-\x{2069}\x{fffd}\\:?#%]|^/|(^|/)\.\.?(/|$)') {
out.requestPath = path
out.repoId = parsed.repo
}
}
# BEGIN GENERATED DIAGNOSTICS
source_functions = {"src/cli/index.ts":["<anonymous>","generateRandomFileName","main"],"build/cli/index.js":["<anonymous>","generateRandomFileName","main"],"src/config.ts":["<anonymous>"],"build/config.js":["<anonymous>"],"src/core/AnonymizedFile.ts":["<anonymous>","anonymizedContent","assertContentFile","cancel","content","defaultMaskCandidateRegex","escapeRegex","extension","forwardHeaders","getFileInfo","handleStreamError","isFileSupported","isImage","originalPath","probe","recoverTruncatedFile","send","sha","size","streamerErrorToAnonymous","visibleFile"],"build/core/AnonymizedFile.js":["<anonymous>","anonymizedContent","assertContentFile","cancel","content","defaultMaskCandidateRegex","escapeRegex","extension","forwardHeaders","getFileInfo","handleStreamError","isFileSupported","isImage","originalPath","probe","recoverTruncatedFile","send","sha","size","streamerErrorToAnonymous","visibleFile"],"src/core/AnonymousError.ts":["<anonymous>","detail","toString","url"],"build/core/AnonymousError.js":["<anonymous>","detail","toString","url"],"src/core/Conference.ts":["<anonymous>","expire","isExpired","remove","repositories","toJSON","updateStatus"],"build/core/Conference.js":["<anonymous>","expire","isExpired","remove","repositories","toJSON","updateStatus"],"src/core/Gist.ts":["<anonymous>","anonymize","check","conference","content","countView","download","downloadContent","downloadWithAccess","expire","getAccess","getToken","markExpired","remove","resetSate","toJSON","updateIfNeeded","updateStatus"],"build/core/Gist.js":["<anonymous>","anonymize","check","conference","content","countView","download","downloadContent","downloadWithAccess","expire","getAccess","getToken","markExpired","remove","resetSate","toJSON","updateIfNeeded","updateStatus"],"src/core/GitHubUtils.ts":["<anonymous>","abortableGateLookup","cancelled","checkToken","ensureRedisGateClient","getRedisGateResetAt","getToken","getTokenGateResetAt","octokit","rateLimitDetail","resolveRepositoryToken","run","setRedisGate","setRedisGateFromWorker","setTokenGate","waitForTokenGate"],"build/core/GitHubUtils.js":["<anonymous>","abortableGateLookup","cancelled","checkToken","ensureRedisGateClient","getRedisGateResetAt","getToken","getTokenGateResetAt","octokit","rateLimitDetail","resolveRepositoryToken","run","setRedisGate","setRedisGateFromWorker","setTokenGate","waitForTokenGate"],"src/core/PullRequest.ts":["<anonymous>","anonymize","check","conference","content","countView","download","downloadContent","expire","getToken","markExpired","remove","resetSate","toJSON","updateIfNeeded","updateStatus"],"build/core/PullRequest.js":["<anonymous>","anonymize","check","conference","content","countView","download","downloadContent","expire","getToken","markExpired","remove","resetSate","toJSON","updateIfNeeded","updateStatus"],"src/core/Repository.ts":["<anonymous>","anonymize","anonymizeTreeRecursive","anonymizedFiles","assertNotArchived","buildPathIndex","check","checkRefreshWrite","cleanupRetiredFileTrees","cleanupStagedFileTree","clearRows","completeRecoveredFileMetadata","computeSize","conference","countView","current","ensureFileTree","expire","fileSnapshotFilter","files","findAnonymizedPath","generateAnonymizeTransformer","getToken","hasEmptyTree","indexPaths","insertBatch","invalidateFileMetadata","isReady","markCachePresent","markExpired","pathKey","readFiles","refresh","refreshFilter","refreshIfNeeded","remove","removeCache","resetSate","searchFiles","snapshotValue","submoduleMounts","toJSON","updateIfNeeded","updateProgressMessage","updateRetiringPathIndex","updateStatus","zip"],"build/core/Repository.js":["<anonymous>","anonymize","anonymizeTreeRecursive","anonymizedFiles","assertNotArchived","buildPathIndex","check","checkRefreshWrite","cleanupRetiredFileTrees","cleanupStagedFileTree","clearRows","completeRecoveredFileMetadata","computeSize","conference","countView","current","ensureFileTree","expire","fileSnapshotFilter","files","findAnonymizedPath","generateAnonymizeTransformer","getToken","hasEmptyTree","indexPaths","insertBatch","invalidateFileMetadata","isReady","markCachePresent","markExpired","pathKey","readFiles","refresh","refreshFilter","refreshIfNeeded","remove","removeCache","resetSate","searchFiles","snapshotValue","submoduleMounts","toJSON","updateIfNeeded","updateProgressMessage","updateRetiringPathIndex","updateStatus","zip"],"src/core/User.ts":["<anonymous>","getAccessToken","getGists","getGitHubRepositories","getPullRequests","getRepositories","markListExpired","quotaRepositories","repositoryMembership","toJSON"],"build/core/User.js":["<anonymous>","getAccessToken","getGists","getGitHubRepositories","getPullRequests","getRepositories","markListExpired","quotaRepositories","repositoryMembership","toJSON"],"src/core/anonymization-pool.ts":["<anonymous>","anonymizeOnWorker","cancel","exited","failed","finish","getAnonymizationPoolStats","message","pump","release","releaseSpool","reserveSpool"],"build/core/anonymization-pool.js":["Line truncated
for_each(["errorType", "causeType"]) -> |_index, key| {
value = get(record, [key]) ?? null
if includes(["Error","TypeError","RangeError","ReferenceError","SyntaxError","URIError","EvalError","AggregateError","AnonymousError","HTTPError","RequestError","MongoServerError","MongoNetworkError","MongoServerSelectionError","ValidationError","TimeoutError","AbortError","UnknownError"], value) { out = set!(out, [key], value) }
}
for_each(["errorStack", "causeStack"]) -> |_index, key| {
value = get(record, [key]) ?? null
if is_string(value) && length(string!(value)) <= 1024 {
frames = []
for_each(split(string!(value), "\n", limit: 9)) -> |index, frame| {
parts, err = parse_regex(frame, r'^at (?P<function>[A-Za-z_$][A-Za-z0-9_$]*|<anonymous>) \((?P<file>(?:src|build)/[A-Za-z0-9_./-]+\.(?:ts|js)):(?P<line>[1-9][0-9]{0,5}):(?P<column>[1-9][0-9]{0,4})\)$')
allowed = array(get(source_functions, [to_string(parts.file)]) ?? null) ?? []
if index < 8 && err == null && includes(array!(allowed), parts.function) { frames = push(frames, frame) }
}
if length(frames) > 0 { out = set!(out, [key], join!(frames, "\n")) }
}
}
# END GENERATED DIAGNOSTICS
out._msg = out.event
. = out
+2 -2
View File
@@ -1,8 +1,8 @@
{
"core.min.js": "core.d23af1c652.min.js",
"vendor.min.js": "vendor.79e3cf5055.min.js",
"vendor.min.js": "vendor.209c192af6.min.js",
"mermaid.min.js": "mermaid.a7356d5ed1.min.js",
"all.min.css": "all.85caa625dd.min.css",
"all.min.css": "all.e8df2ae9d6.min.css",
"markdown.min.js": "markdown.6c8dfb7b1d.min.js",
"pdf.min.js": "pdf.4d9cc6ff49.min.js",
"notebook.min.js": "notebook.c3144c18ae.min.js",
+1 -1
View File
@@ -10,4 +10,4 @@
@container explorer-file (max-width: 700px) {
.reviewer-preview .file-card-head .file-card-meta, .reviewer-preview .file-card-head .symbols { display: none !important; }
}
.reviewer-preview .rp-main{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.reviewer-preview .rp-document{flex:1 1 auto;min-height:0;min-width:0;overflow:auto;scrollbar-width:thin;position:relative}.reviewer-preview button.rp-count{background:0 0;border:0;padding:0;font:inherit;cursor:pointer;text-decoration:underline;text-decoration-color:transparent;text-underline-offset:3px}.reviewer-preview button.rp-count:hover{text-decoration-color:currentColor}@media (max-width:767px){.reviewer-preview .file-card-head .rp-preserved-tag{display:none}}.billing-page{--bl-subscription:#008C7E;--bl-repository:#D0652A;--bl-conference:#6250D6}.dark-mode .billing-page{--bl-subscription:#16A091;--bl-repository:#D95926;--bl-conference:#9085E9}.billing-page .bl-subscription{background:var(--bl-subscription)!important}.billing-page .bl-repository{background:var(--bl-repository)!important}.billing-page .bl-conference{background:var(--bl-conference)!important}.billing-page .bl-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;margin:4px 0 0}.billing-page .bl-basis{margin:0;font-size:12px;color:var(--ink-muted)}.billing-page .bl-message{display:flex;align-items:center;gap:8px;margin:14px 0 0;padding:10px 14px;border:1px solid var(--border-color);border-radius:var(--radius-control,8px);font-size:13px;color:var(--color);background:var(--paper-card)}.billing-page .bl-message .ui-icon{width:16px;height:16px;flex:none;color:var(--ink-muted)}.billing-page .bl-message.ov-performance-warning{border-color:color-mix(in srgb,var(--status-progress) 45%,var(--border-color));background:color-mix(in srgb,var(--status-progress) 8%,var(--paper-card))}.billing-page .bl-message.ov-performance-warning .ui-icon{color:var(--status-progress)}.billing-page .bl-message .btn{margin-left:auto}.overview-page .bl-kpi-row{grid-template-columns:repeat(6,minmax(0,1fr));margin:16px 0 16px}.overview-page .bl-kpi-row .ov-kpi-card{min-width:0;padding:16px 18px}.overview-page .bl-kpi-row .ov-kpi-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-page .bl-kpi-row .ov-kpi-sub{white-space:normal;overflow-wrap:anywhere;line-height:1.4}.overview-page .bl-kpi-row .ov-kpi-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-page .bl-kpi-row .bl-muted-value{color:var(--ink-muted);font-size:20px;line-height:28px}.overview-page .bl-kpi-row.is-loading .ov-kpi-card{opacity:.6}.billing-page .bl-skeleton-value{display:block;width:50%;height:28px;margin:4px 0;border-radius:6px}@media (max-width:1279px){.overview-page .bl-kpi-row{grid-template-columns:repeat(3,minmax(0,1fr))!important}}@media (max-width:767px){.overview-page .bl-kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))!important}}.billing-page .bl-health{display:flex;align-items:center;flex-wrap:wrap;gap:6px 20px;padding:10px 16px;margin:0 0 16px;border:1px solid var(--border-color);border-radius:var(--radius-control,8px);background:var(--paper-card);font-size:13px;font-variant-numeric:tabular-nums}.billing-page .bl-health-title{display:inline-flex;align-items:center;gap:8px;font-weight:600}.billing-page .bl-health-title .ov-svc-dot{width:8px;height:8px;margin:0;border-radius:50%}.billing-page .bl-dot-bad{background:var(--st-bad,#b42318)}.billing-page .bl-health-item .k{color:var(--ink-muted);margin-right:2px}.billing-page .bl-health-item.is-bad{color:var(--st-bad,#b42318);font-weight:600}.billing-page .bl-health-item.is-warn{color:#946519;font-weight:600}.dark-mode .billing-page .bl-health-item.is-warn{color:var(--status-progress)}.dark-mode .billing-page .bl-health-item.is-bad{color:#f08a82}.billing-page .bl-health-error{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.billing-page .bl-health-error code{font-size:12px;color:inherit;background:var(--paper-bg-alt);padding:1px 5px;border-radius:4px}.billing-page .bl-chart-card{margin-bottom:16px}.billing-page .bl-swatch{display:inline-block;width:8px;height:8px;border-radius:2px;flex:none}.billing-page .bl-bars{position:relative;gap:3px}.billing-page .bl-bars.is-dense{gap:1px}.billing-page .bl-col{min-width:0}.billing-page .bl-stack{display:flex;flex-direction:column-reverse;width:100%;gap:1px;border-radius:2px 2px 0 0;overflow:hidden}.billing-page .bl-stack>i{display:block;min-height:2px;flex-basis:0}.billing-page .bl-col:hover .bl-stack{filter:brightness(1.08)}.billing-page .bl-col.is-zero .bl-stack{height:1px!important;background:var(--border-color)}.billing-page .bl-empty{margin:8px 0 4px;padding:32px 0;text-align:center;color:var(--ink-muted)}.billing-page .bl-plans{margin-bottom:24px}.billing-page .ov-metrics-table thead th.bl-group{text-align:center;border-bottom:1px solid var(--border-color)}.billing-page .ov-metrics-table tfoot td,.billing-page .ov-metrics-table tfoot th{border-top:1px solid var(--border-color);border-bottom:0;font-weight:600;background:var(--paper-bg-alt)}.billing-page .ov-metrics-table tboLine truncated
.reviewer-preview .rp-main{min-width:0;min-height:0;display:flex;flex-direction:column;overflow:hidden}.reviewer-preview .rp-document{flex:1 1 auto;min-height:0;min-width:0;overflow:auto;scrollbar-width:thin;position:relative}.reviewer-preview button.rp-count{background:0 0;border:0;padding:0;font:inherit;cursor:pointer;text-decoration:underline;text-decoration-color:transparent;text-underline-offset:3px}.reviewer-preview button.rp-count:hover{text-decoration-color:currentColor}@media (max-width:767px){.reviewer-preview .file-card-head .rp-preserved-tag{display:none}}.billing-page{--bl-subscription:#008C7E;--bl-repository:#D0652A;--bl-conference:#6250D6}.dark-mode .billing-page{--bl-subscription:#16A091;--bl-repository:#D95926;--bl-conference:#9085E9}.billing-page .bl-subscription{background:var(--bl-subscription)!important}.billing-page .bl-repository{background:var(--bl-repository)!important}.billing-page .bl-conference{background:var(--bl-conference)!important}.billing-page .bl-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px 16px;margin:4px 0 0}.billing-page .bl-basis{margin:0;font-size:12px;color:var(--ink-muted)}.billing-page .bl-message{display:flex;align-items:center;gap:8px;margin:14px 0 0;padding:10px 14px;border:1px solid var(--border-color);border-radius:var(--radius-control,8px);font-size:13px;color:var(--color);background:var(--paper-card)}.billing-page .bl-message .ui-icon{width:16px;height:16px;flex:none;color:var(--ink-muted)}.billing-page .bl-message.ov-performance-warning{border-color:color-mix(in srgb,var(--status-progress) 45%,var(--border-color));background:color-mix(in srgb,var(--status-progress) 8%,var(--paper-card))}.billing-page .bl-message.ov-performance-warning .ui-icon{color:var(--status-progress)}.billing-page .bl-message .btn{margin-left:auto}.overview-page .bl-kpi-row{grid-template-columns:repeat(6,minmax(0,1fr));margin:16px 0 16px}.overview-page .bl-kpi-row .ov-kpi-card{min-width:0;padding:16px 18px}.overview-page .bl-kpi-row .ov-kpi-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-page .bl-kpi-row .ov-kpi-sub{white-space:normal;overflow-wrap:anywhere;line-height:1.4}.overview-page .bl-kpi-row .ov-kpi-value{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.overview-page .bl-kpi-row .bl-muted-value{color:var(--ink-muted);font-size:20px;line-height:28px}.overview-page .bl-kpi-row.is-loading .ov-kpi-card{opacity:.6}.billing-page .bl-skeleton-value{display:block;width:50%;height:28px;margin:4px 0;border-radius:6px}@media (max-width:1279px){.overview-page .bl-kpi-row{grid-template-columns:repeat(3,minmax(0,1fr))!important}}@media (max-width:767px){.overview-page .bl-kpi-row{grid-template-columns:repeat(2,minmax(0,1fr))!important}}.billing-page .bl-health{display:flex;align-items:center;flex-wrap:wrap;gap:6px 20px;padding:10px 16px;margin:0 0 16px;border:1px solid var(--border-color);border-radius:var(--radius-control,8px);background:var(--paper-card);font-size:13px;font-variant-numeric:tabular-nums}.billing-page .bl-health-title{display:inline-flex;align-items:center;gap:8px;font-weight:600}.billing-page .bl-health-title .ov-svc-dot{width:8px;height:8px;margin:0;border-radius:50%}.billing-page .bl-dot-bad{background:var(--st-bad,#b42318)}.billing-page .bl-health-item .k{color:var(--ink-muted);margin-right:2px}.billing-page .bl-health-item.is-bad{color:var(--st-bad,#b42318);font-weight:600}.billing-page .bl-health-item.is-warn{color:#946519;font-weight:600}.dark-mode .billing-page .bl-health-item.is-warn{color:var(--status-progress)}.dark-mode .billing-page .bl-health-item.is-bad{color:#f08a82}.billing-page .bl-health-error{min-width:0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.billing-page .bl-health-error code{font-size:12px;color:inherit;background:var(--paper-bg-alt);padding:1px 5px;border-radius:4px}.billing-page .bl-chart-card{margin-bottom:16px}.billing-page .bl-swatch{display:inline-block;width:8px;height:8px;border-radius:2px;flex:none}.billing-page .bl-bars{position:relative;gap:3px}.billing-page .bl-bars.is-dense{gap:1px}.billing-page .bl-col{min-width:0}.billing-page .bl-stack{display:flex;flex-direction:column-reverse;width:100%;gap:1px;border-radius:2px 2px 0 0;overflow:hidden}.billing-page .bl-stack>i{display:block;min-height:2px;flex-basis:0}.billing-page .bl-col:hover .bl-stack{filter:brightness(1.08)}.billing-page .bl-col.is-zero .bl-stack{height:1px!important;background:var(--border-color)}.billing-page .bl-empty{margin:8px 0 4px;padding:32px 0;text-align:center;color:var(--ink-muted)}.billing-page .bl-plans{margin-bottom:24px}.billing-page .ov-metrics-table thead th.bl-group{text-align:center;border-bottom:1px solid var(--border-color)}.billing-page .ov-metrics-table tfoot td,.billing-page .ov-metrics-table tfoot th{border-top:1px solid var(--border-color);border-bottom:0;font-weight:600;background:var(--paper-bg-alt)}.billing-page .ov-metrics-table tboLine truncated
+24
View File
@@ -14752,6 +14752,30 @@ body.dark-mode .reviewer-preview .rp-preserved-tag { background: rgba(251, 191,
/* "Don't see your repository?" sits under the picker list as a quiet link. */
.repo-picker-access { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin: 0; padding: 12px 16px 0; font-size: 13px; color: var(--ink-muted); }
.errors-page .log-request-route code { font-size:12px; white-space:normal; overflow-wrap:anywhere; }
.errors-page .log-error-stack summary { min-height:44px; display:list-item; box-sizing:border-box; padding:12px 0; cursor:pointer; font-size:12px; }
.errors-page .log-error-stack pre { white-space:pre-wrap; overflow-wrap:anywhere; font-size:11px; padding:12px; background:var(--paper-bg-alt); border:1px solid var(--border-color); border-radius:4px; }
/* History occurrences retain evidence instead of repeating status badges. */
.errors-page .history-occurrence-list { list-style:none; padding:0; margin:16px 0 0; }
.errors-page .history-occurrence-list > li { padding:0; border-top:1px solid var(--border-color); }
.errors-page .history-occurrence-heading { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; margin-bottom:8px; font-size:12px; color:var(--ink-muted); font-variant-numeric:tabular-nums; }
.errors-page .history-occurrence-list strong { font-size:14px; overflow-wrap:anywhere; }
.errors-page .history-occurrence-context { display:block; margin:4px 0 0; overflow-wrap:anywhere; color:var(--ink-soft); font-size:12px; }
.errors-page .history-occurrence-record summary { min-height:44px; padding:12px 0; box-sizing:border-box; cursor:pointer; color:var(--ink-soft); }
.errors-page .history-occurrence-record pre { max-height:320px; overflow:auto; white-space:pre-wrap; overflow-wrap:anywhere; }
.errors-page .history-occurrence > summary { display:block; cursor:pointer; padding:16px 20px 16px 0; min-height:44px; position:relative; }
.errors-page .history-occurrence > summary::after { content:"+"; position:absolute; right:0; top:16px; color:var(--ink-muted); }
.errors-page .history-occurrence[open] > summary::after { content:"−"; }
.errors-page .history-occurrence > pre { white-space:pre-wrap; overflow-wrap:anywhere; }
.errors-page .log-reproduction { margin:16px 0; padding:16px 0; border-block:1px solid var(--border-color); }
.errors-page .log-reproduction dl { margin:12px 0; }
.errors-page .log-reproduction dt { font-size:12px; color:var(--ink-muted); font-weight:400; margin:12px 0 4px; }
.errors-page .log-reproduction dd { margin:0; overflow-wrap:anywhere; }
.errors-page .log-reproduction .btn { min-height:44px; }
.errors-page .log-reproduction code { white-space:normal; overflow-wrap:anywhere; word-break:break-word; }
.repo-picker-pagination { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-color); }
@media (max-width: 480px) {
.repo-picker-head { flex-wrap: wrap; }
+24 -15
View File
@@ -26,7 +26,7 @@
<div class="volume-head"><h2 class="sr-only" id="central-logs-title">Central logs</h2><a v-if="logData?.grafanaUrl" :href="safeUrl(logData.grafanaUrl)" target="_blank" rel="noopener noreferrer">Open in Grafana</a></div>
<section class="log-inspector" v-if="selectedLog" aria-labelledby="log-detail-title">
<button type="button" class="log-back" @click="closeLogDetail()"><span aria-hidden="true">←</span> Back to events</button>
<div class="log-inspector-heading"><div><p class="log-inspector-eyebrow">{{ selectedLog.sample.service }} / {{ selectedLog.sample.module }} · Event sample</p><h2 id="log-detail-title" tabindex="-1">{{ selectedLog.sample.errorCode || selectedLog.sample.event }}</h2></div><span class="log-severity" :class="'log-severity-'+logSeverity(selectedLog.sample)">{{ logSeverity(selectedLog.sample)==='error' ? 'Failure' : logSeverity(selectedLog.sample)==='warn' ? 'Warning' : 'Info' }}<span v-if="selectedLog.sample.status || selectedLog.sample.httpStatus"> · HTTP {{ selectedLog.sample.status || selectedLog.sample.httpStatus }}</span></span></div>
<div class="log-inspector-heading"><div><p class="log-inspector-eyebrow">{{ selectedLog.sample.service }} / {{ selectedLog.sample.module }} · Event sample</p><h2 id="log-detail-title" tabindex="-1">{{ selectedLog.sample.errorCode || selectedLog.sample.errorType || selectedLog.sample.event }}</h2></div><span class="log-severity" :class="'log-severity-'+logSeverity(selectedLog.sample)">{{ logSeverity(selectedLog.sample)==='error' ? 'Failure' : logSeverity(selectedLog.sample)==='warn' ? 'Warning' : 'Info' }}<span v-if="selectedLog.sample.status || selectedLog.sample.httpStatus"> · HTTP {{ selectedLog.sample.status || selectedLog.sample.httpStatus }}</span></span></div>
<div class="log-facts-strip"><span><strong>{{ selectedLog.count }}</strong> returned occurrences</span><span>First <time :datetime="selectedLog.first">{{ absTimeShort(selectedLog.first) }}</time></span><span>Last <time :datetime="selectedLog.last">{{ absTimeShort(selectedLog.last) }}</time></span></div>
<div class="log-detail log-investigation-body" id="log-detail">
<div class="log-related-main"><div class="log-correlation-selector" role="group" aria-label="Related events correlation"><span>Follow</span><button type="button" class="log-trace-button" v-for="kind in ['requestId','jobId'].filter(key=>logTraceId(selectedLog,key))" :key="kind" :id="'trace-selector-'+kind" :aria-label="'Follow '+(kind==='requestId' ? 'request ' : 'job ')+selectedLog.sample[kind]" :aria-pressed="traceSelection?.kind===kind" @click="lookupTrace(kind,selectedLog.sample[kind],$event.currentTarget,selectedLog.sample)">{{ kind==='requestId' ? 'Request' : 'Job' }} <span class="log-selector-mark" aria-hidden="true">{{ traceSelection?.kind===kind ? '✓' : '→' }}</span></button><span class="log-meta" v-if="!logTraceId(selectedLog,'requestId') &amp;&amp; !logTraceId(selectedLog,'jobId')">No correlation ID recorded</span><span class="log-correlation-window">{{ logData?.window || logAppliedFilters.window }} window</span></div>
@@ -34,15 +34,15 @@
<div class="volume-head"><h3 id="log-timeline-title" tabindex="-1">Related events</h3><button type="button" class="btn btn-sm" @click="closeTrace()">Hide events</button></div>
<p role="status" v-if="traceLoading || trace?.state !== 'ready'">{{ traceLoading ? 'Loading related events…' : trace?.state === 'empty' ? 'No related events returned in this window.' : logStateText(trace?.state) }}</p>
<p class="log-coverage" v-if="trace &amp;&amp; !traceLoading">{{ trace.events?.length || 0 }} events returned · {{ absTime(trace.start) }} – {{ absTime(trace.end) }} · 200-event cap. All services and releases.</p>
<ol class="log-events" v-if="trace?.events?.length"><li v-for="(event,index) in trace.events" :key="index"><time :datetime="event.timestamp" :title="event.timestamp">{{ absTimeShort(event.timestamp) }}</time><div class="log-timeline-event"><div class="log-timeline-event-title"><strong>{{ event.errorCode || event.event }}</strong><span class="log-severity" :class="'log-severity-'+logSeverity(event)">{{ event.status ? 'HTTP '+event.status : event.severity || 'Event' }}</span></div><p>{{ event.service }}<span v-if="event.module"> / {{ event.module }}</span><span v-if="event.ms !== undefined"> · {{ event.ms }} ms</span><span v-if="event.attempt !== undefined"> · attempt {{ event.attempt }}</span></p><details class="log-event-fields"><summary>Event fields</summary><pre>{{ JSON.stringify(event,null,2) }}</pre><button type="button" class="btn btn-sm" @click="copyLogValue(JSON.stringify(event,null,2))">Copy JSON</button></details></div></li></ol>
<ol class="log-events" v-if="trace?.events?.length"><li v-for="(event,index) in trace.events" :key="index"><time :datetime="event.timestamp" :title="event.timestamp">{{ absTimeShort(event.timestamp) }}</time><div class="log-timeline-event"><div class="log-timeline-event-title"><strong>{{ event.errorCode || event.errorType || event.event }}</strong><span class="log-severity" :class="'log-severity-'+logSeverity(event)">{{ (event.status || event.httpStatus) ? 'HTTP '+(event.status || event.httpStatus) : event.severity || 'Event' }}</span></div><p>{{ event.service }}<span v-if="event.module"> / {{ event.module }}</span><span v-if="event.ms !== undefined"> · {{ event.ms }} ms</span><span v-if="event.attempt !== undefined"> · attempt {{ event.attempt }}</span></p><p class="log-request-route" v-if="event.route"><code>{{ event.method }} {{ event.requestPath || event.route }}</code></p><details class="log-error-stack" v-if="event.errorStack || event.causeStack"><summary>Exception frames<span v-if="event.errorType"> · {{ event.errorType }}</span></summary><pre v-if="event.errorStack">{{ event.errorStack }}</pre><p v-if="event.causeType">Caused by {{ event.causeType }}</p><pre v-if="event.causeStack">{{ event.causeStack }}</pre></details><details class="log-event-fields"><summary>Event fields</summary><pre>{{ JSON.stringify(event,null,2) }}</pre><button type="button" class="btn btn-sm" @click="copyLogValue(JSON.stringify(event,null,2))">Copy JSON</button></details></div></li></ol>
<details class="log-timeline-scope"><summary>Query scope</summary><p>Earliest matching events for the selected {{ traceSelection.kind==='jobId' ? 'job' : 'request' }} ID. Service and release filters do not narrow this timeline.</p></details>
<a v-if="trace?.grafanaUrl" :href="safeUrl(trace.grafanaUrl)" target="_blank" rel="noopener noreferrer">Open in Grafana</a>
</section>
<div class="log-no-trace" v-if="!traceSelection"><h3>{{ logTraceId(selectedLog,'requestId') || logTraceId(selectedLog,'jobId') ? 'Related events hidden' : 'This sample has no correlation ID' }}</h3><p>{{ logExplanation(selectedLog.sample) }}</p><p class="log-evidence">{{ logEvidence(selectedLog.sample) }}</p><p class="log-coverage">{{ logTraceId(selectedLog,'requestId') || logTraceId(selectedLog,'jobId') ? 'Choose Request or Job above to load related events.' : 'The recorded fields are available in the sample panel. Related events cannot be looked up for this record.' }}</p></div>
</div>
<aside class="log-sample-panel"><h3>Event sample</h3><p class="log-coverage">One of {{ selectedLog.count }} returned occurrences. IDs can differ across the group.</p><dl class="log-sample-facts"><div><dt>Service</dt><dd>{{ selectedLog.sample.service }}</dd></div><div><dt>Module</dt><dd>{{ selectedLog.sample.module || 'Not recorded' }}</dd></div><div><dt>Event</dt><dd>{{ selectedLog.sample.event }}</dd></div><div v-if="selectedLog.sample.release"><dt>Release</dt><dd>{{ selectedLog.sample.release }}</dd></div></dl>
<aside class="log-sample-panel"><h3>Event sample</h3><p class="log-coverage">One of {{ selectedLog.count }} returned occurrences. IDs can differ across the group.</p><p class="log-request-route" v-if="selectedLog.sample.route"><code>{{ selectedLog.sample.method }} {{ selectedLog.sample.route }}</code></p><section class="log-reproduction" v-if="selectedLog.sample.requestPath"><h3>Reproduce this request</h3><dl><div><dt>Anonymous repository ID</dt><dd><code>{{ selectedLog.sample.repoId }}</code></dd></div><div><dt>Request path · query excluded</dt><dd><code>{{ selectedLog.sample.requestPath }}</code></dd></div></dl><button type="button" class="btn btn-sm" @click="copyLogValue(selectedLog.sample.requestPath)">Copy request path</button></section><details class="log-error-stack" v-if="selectedLog.sample.errorStack || selectedLog.sample.causeStack"><summary>Exception frames · {{ selectedLog.sample.errorType }}</summary><pre v-if="selectedLog.sample.errorStack">{{ selectedLog.sample.errorStack }}</pre><p v-if="selectedLog.sample.causeType">Caused by {{ selectedLog.sample.causeType }}</p><pre v-if="selectedLog.sample.causeStack">{{ selectedLog.sample.causeStack }}</pre></details><dl class="log-sample-facts"><div><dt>Service</dt><dd>{{ selectedLog.sample.service }}</dd></div><div><dt>Module</dt><dd>{{ selectedLog.sample.module || 'Not recorded' }}</dd></div><div><dt>Event</dt><dd>{{ selectedLog.sample.event }}</dd></div><div v-if="selectedLog.sample.release"><dt>Release</dt><dd>{{ selectedLog.sample.release }}</dd></div></dl>
<dl class="log-detail-identifiers"><template v-for="kind in ['requestId','jobId']" :key="kind"><div v-if="logTraceId(selectedLog,kind)"><dt>{{ kind==='requestId' ? 'Request ID' : 'Job ID' }}</dt><dd><details class="log-value-reveal"><summary>{{ compactLogValue(selectedLog.sample[kind]) }}</summary><span>{{ selectedLog.sample[kind] }}</span></details><button type="button" class="log-copy-value" @click="copyLogValue(selectedLog.sample[kind])">Copy full ID</button></dd></div></template></dl>
<details class="log-all-fields"><summary>All sample fields <span>{{ Object.keys(selectedLog.sample).length }}</span></summary><p class="log-coverage">Safe API fields only; request paths and stack traces are not included.</p><dl><div v-for="(value,key) in selectedLog.sample" :key="key" v-show="!['requestId','jobId'].includes(key)"><dt>{{ key }}</dt><dd>{{ value }}</dd></div></dl><details class="log-raw-sample"><summary>Raw sample</summary><pre>{{ JSON.stringify(selectedLog.sample,null,2) }}</pre><button class="btn btn-sm" type="button" @click="copyLogValue(JSON.stringify(selectedLog.sample,null,2))">Copy JSON</button></details></details></aside>
<details class="log-all-fields"><summary>All sample fields <span>{{ Object.keys(selectedLog.sample).length }}</span></summary><p class="log-coverage">Admin API fields only. Failed file requests may include their anonymous repository ID and pathname. Query strings are excluded; exception frames include recognized application code only.</p><dl><div v-for="(value,key) in selectedLog.sample" :key="key" v-show="!['requestId','jobId'].includes(key)"><dt>{{ key }}</dt><dd>{{ value }}</dd></div></dl><details class="log-raw-sample"><summary>Raw sample</summary><pre>{{ JSON.stringify(selectedLog.sample,null,2) }}</pre><button class="btn btn-sm" type="button" @click="copyLogValue(JSON.stringify(selectedLog.sample,null,2))">Copy JSON</button></details></details></aside>
</div>
</section>
<div class="log-list-view" v-show="!selectedLog">
@@ -77,7 +77,7 @@
<caption class="sr-only">Returned events grouped by service, module, code, severity and status. Select an event for sample details.</caption>
<thead><tr><th scope="col">Event</th><th scope="col">Severity</th><th scope="col">Count</th><th scope="col">Last seen</th></tr></thead>
<tbody><template v-for="group in filteredLogGroups()" :key="group.fingerprint"><tr :class="{'log-selected':selectedLog?.fingerprint===group.fingerprint}">
<td><button class="log-event-button" type="button" :aria-label="'Inspect ' + (group.sample.errorCode || group.sample.event)" @click="selectLog(group, $event.currentTarget)" :aria-expanded="selectedLog?.fingerprint===group.fingerprint" aria-controls="log-detail"><span class="log-event-title"><strong>{{ group.sample.errorCode || group.sample.event }}</strong><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-arrow-right"></use></svg></span><span class="log-meta"><span class="log-service">{{ group.sample.service }}</span><span class="log-module"> / {{ group.sample.module }}</span></span></button></td>
<td><button class="log-event-button" type="button" :aria-label="'Inspect ' + (group.sample.errorCode || group.sample.errorType || group.sample.event)" @click="selectLog(group, $event.currentTarget)" :aria-expanded="selectedLog?.fingerprint===group.fingerprint" aria-controls="log-detail"><span class="log-event-title"><strong>{{ group.sample.errorCode || group.sample.errorType || group.sample.event }}</strong><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-arrow-right"></use></svg></span><span class="log-meta"><span class="log-service">{{ group.sample.service }}</span><span class="log-module"> / {{ group.sample.module }}</span></span></button></td>
<td class="log-level"><span class="log-severity" :class="'log-severity-'+logSeverity(group.sample)">{{ logSeverity(group.sample)==='error' ? 'Failure' : logSeverity(group.sample)==='warn' ? 'Warning' : 'Info' }}</span><span class="log-http" v-if="group.sample.status || group.sample.httpStatus">HTTP {{ group.sample.status || group.sample.httpStatus }}</span></td>
<td class="log-count"><span class="sr-only">Count </span>{{ group.count }}</td>
<td><time :datetime="group.last" :title="absTime(group.last)">{{ relTime(group.last) }}</time></td>
@@ -109,7 +109,7 @@
<h2 class="sr-only">Application history</h2>
<p class="history-warning" role="status" v-if="redisCollecting !== true">{{ redisCollecting === false ? 'Collection is off; retained history is not receiving new events.' : 'Collection status is unknown.' }}</p>
<div class="log-inspector" v-if="historySelected"><button type="button" class="log-back" @click="closeHistory()">← Back to history</button><div class="log-inspector-heading"><div><p class="log-inspector-eyebrow">{{ historySelected.module }} · Application history</p><h2 id="history-inspector-title" tabindex="-1">{{ historySelected.displayMessage }}</h2></div><span class="log-severity" :class="'log-severity-'+historySelected._bucket">{{ historySelected._bucket }}<span v-if="historySelected._status"> · HTTP {{ historySelected._status }}</span></span></div><div class="log-inspector-tabs detail-tabs" role="group" aria-label="History event view"><button type="button" :aria-pressed="historyView==='overview' &amp;&amp; (!detailTab[historySelected._key] || detailTab[historySelected._key]==='summary')" :class="{active:historyView==='overview' &amp;&amp; (!detailTab[historySelected._key] || detailTab[historySelected._key]==='summary')}" @click="historyView='overview';detailTab[historySelected._key]='summary'">Overview</button><button type="button" :aria-pressed="historyView==='timeline'" :class="{active:historyView==='timeline'}" @click="showHistoryTimeline($event.currentTarget)">Timeline</button><button type="button" :aria-pressed="historyView==='overview' &amp;&amp; detailTab[historySelected._key]==='raw'" :class="{active:historyView==='overview' &amp;&amp; detailTab[historySelected._key]==='raw'}" @click="historyView='overview';detailTab[historySelected._key]='raw'">Raw</button><button type="button" v-if="historySelected._stack" @click="historyView='overview';detailTab[historySelected._key]='stack'">Stack</button><button type="button" v-if="historySelected.count>1" @click="historyView='overview';detailTab[historySelected._key]='related'">Related ({{ historySelected.count }})</button></div></div>
<div class="log-inspector" v-if="historySelected"><button type="button" class="log-back" @click="closeHistory()">← Back to history</button><div class="log-inspector-heading"><div><p class="log-inspector-eyebrow">{{ historySelected.module }} · Application history</p><h2 id="history-inspector-title" tabindex="-1">{{ historySelected.displayMessage }}</h2></div><span class="log-severity" :class="'log-severity-'+historySelected._bucket">{{ historySelected._bucket }}<span v-if="historySelected._status"> · HTTP {{ historySelected._status }}</span></span></div><div class="log-inspector-tabs detail-tabs" role="group" aria-label="History event view"><button type="button" :aria-pressed="historyView==='overview' &amp;&amp; (!detailTab[historySelected._key] || detailTab[historySelected._key]==='summary')" :class="{active:historyView==='overview' &amp;&amp; (!detailTab[historySelected._key] || detailTab[historySelected._key]==='summary')}" @click="historyView='overview';detailTab[historySelected._key]='summary'">Overview</button><button type="button" :aria-pressed="historyView==='timeline'" :class="{active:historyView==='timeline'}" @click="showHistoryTimeline($event.currentTarget)">Timeline</button><button type="button" :aria-pressed="historyView==='overview' &amp;&amp; detailTab[historySelected._key]==='raw'" :class="{active:historyView==='overview' &amp;&amp; detailTab[historySelected._key]==='raw'}" @click="historyView='overview';detailTab[historySelected._key]='raw'">Raw</button><button type="button" v-if="historySelected._stack" :aria-pressed="historyView==='overview' &amp;&amp; detailTab[historySelected._key]==='stack'" :class="{active:historyView==='overview' &amp;&amp; detailTab[historySelected._key]==='stack'}" @click="historyView='overview';detailTab[historySelected._key]='stack'">Stack</button><button type="button" v-if="historySelected.count>1" :aria-pressed="historyView==='overview' &amp;&amp; detailTab[historySelected._key]==='related'" :class="{active:historyView==='overview' &amp;&amp; detailTab[historySelected._key]==='related'}" @click="historyView='overview';detailTab[historySelected._key]='related'">Occurrences ({{ historySelected.count }})</button></div></div>
<div v-show="!historySelected">
<form class="errors-toolbar" aria-label="Error filters" v-form="viewState">
<div class="seg-filter" role="group" aria-label="Filter by severity">
@@ -198,16 +198,25 @@
<div class="errors-row-detail" :id="'history-detail-' + index" v-if="expanded[row?._key]">
<div class="detail-body">
<div class="detail-main">
<div v-if="!detailTab[row?._key] || detailTab[row?._key] === 'summary'"><h3>What happened</h3><p class="log-explanation-lead">{{ logExplanation(row.raw?.[0] || {}) }}</p><p class="log-evidence">{{ logEvidence(row.raw?.[0] || {}) }}</p><details class="history-technical"><summary>Technical fields</summary> <dl class="history-fields" v-if="!detailTab[row?._key] || detailTab[row?._key] === 'summary'"><div v-for="[key,value] in historyDetailFields(row)" :key="key"><dt>{{ key }}</dt><dd><template v-if="isLogIdentifier(key,value)"><details class="log-value-reveal"><summary>{{ compactLogValue(value) }}</summary><span>{{ value }}</span></details><button type="button" class="log-copy-value" @click="copyLogValue(value)">Copy full {{ key }}</button></template><template v-else>{{ logFieldText(value) }}</template></dd></div></dl></details></div>
<div v-if="!detailTab[row?._key] || detailTab[row?._key] === 'summary'"><h3>What happened</h3><p class="log-request-route" v-if="row.raw?.[0]?.route"><code>{{ row.raw[0].method }} {{ row.raw[0].route }}</code></p><section class="log-reproduction" v-if="row.raw?.[0]?.requestPath"><h3>Reproduce this request</h3><dl><div><dt>Anonymous repository ID</dt><dd><code>{{ row.raw[0].repoId }}</code></dd></div><div><dt>Request path · query excluded</dt><dd><code>{{ row.raw[0].requestPath }}</code></dd></div></dl><button type="button" class="btn btn-sm" @click="copyLogValue(row.raw[0].requestPath)">Copy request path</button></section><p v-if="row.raw?.[0]?.errorType">{{ row.raw[0].errorType }}<span v-if="row.raw[0].causeType"> · caused by {{ row.raw[0].causeType }}</span></p><p class="log-explanation-lead">{{ logExplanation(row.raw?.[0] || {}) }}</p><p class="log-evidence">{{ logEvidence(row.raw?.[0] || {}) }}</p><details class="history-technical"><summary>Technical fields</summary> <dl class="history-fields" v-if="!detailTab[row?._key] || detailTab[row?._key] === 'summary'"><div v-for="[key,value] in historyDetailFields(row)" :key="key"><dt>{{ key }}</dt><dd><template v-if="isLogIdentifier(key,value)"><details class="log-value-reveal"><summary>{{ compactLogValue(value) }}</summary><span>{{ value }}</span></details><button type="button" class="log-copy-value" @click="copyLogValue(value)">Copy full {{ key }}</button></template><template v-else>{{ logFieldText(value) }}</template></dd></div></dl></details></div>
<pre v-if="detailTab[row?._key] === &#x27;raw&#x27;">{{ row?._rawJson }}</pre>
<pre class="stack-pre" v-if="detailTab[row?._key] === &#x27;stack&#x27;">{{ row?._stack }}</pre>
<div class="related-list" v-if="detailTab[row?._key] === &#x27;related&#x27;">
<div class="related-row" v-for="(r, index) in row?._related" :key="index">
<span class="when-abs">{{ absTimeShort(r?.ts) }}</span>
<span class="msg-url">{{ r?._url }}</span>
<span class="status-pill" v-if="r?._status" :class="&#x27;status-&#x27; + r?._bucket">{{ r?._status }}</span>
</div>
</div>
<section class="history-occurrences" v-if="detailTab[row?._key] === 'related'" aria-label="Stored occurrences">
<h3>Stored occurrences</h3>
<p class="log-evidence">{{ row._related.length }} matching records in the loaded Redis snapshot. Most recent first.</p>
<ol class="history-occurrence-list">
<li v-for="(r, index) in historyOccurrences(row)" :key="index">
<details class="history-occurrence">
<summary><span class="history-occurrence-heading"><time :datetime="r.ts">{{ occurrenceTime(r.ts) }}</time><span class="log-severity" :class="'log-severity-'+r._bucket">{{ r._status ? 'HTTP '+r._status : r._bucket }}</span></span><span class="history-occurrence-context">{{ r.raw?.[0]?.service || 'Application' }} · {{ r.module || 'Unknown module' }}<span v-if="r.raw?.[0]?.route"> · {{ r.raw[0].method }} <code>{{ r.raw[0].requestPath || r.raw[0].route }}</code></span><span v-else> · Route not captured</span></span></summary>
<p v-if="r.raw?.[0]?.errorType">{{ r.raw[0].errorType }}</p>
<pre v-if="r._stack">{{ r._stack }}</pre>
<p class="log-evidence" v-else>Exception frames were not captured.</p>
<p class="log-evidence" v-if="!r.raw?.[0]?.route">Request route was not captured.</p>
<details class="history-occurrence-record"><summary>Stored record</summary><pre>{{ r._rawJson }}</pre></details>
</details>
</li>
</ol>
</section>
<div class="detail-actions">
<button class="btn btn-sm" type="button" v-if="logTraceId(row, 'requestId')" @click="lookupTrace('requestId', logTraceId(row, 'requestId'), $event.currentTarget, row)">Request timeline →</button>
<button class="btn btn-sm" type="button" v-if="logTraceId(row, 'jobId')" @click="lookupTrace('jobId', logTraceId(row, 'jobId'), $event.currentTarget, row)">Job timeline →</button>
@@ -312,7 +321,7 @@
<p class="log-origin" v-if="traceSelection.context">{{ traceSelection.context.event }} · {{ traceSelection.context.service }}</p>
<p role="status" v-if="traceLoading || trace?.state !== 'ready'">{{ traceLoading ? 'Loading related events…' : trace?.state === 'empty' ? 'No related events returned in this window.' : logStateText(trace?.state) }}</p>
<p class="log-coverage" v-if="trace &amp;&amp; !traceLoading">{{ trace.events?.length || 0 }} events returned · {{ absTime(trace.start) }} – {{ absTime(trace.end) }} · 200-event cap. All services and releases.</p>
<ol class="log-events" v-if="trace?.events?.length"><li v-for="(event,index) in trace.events" :key="index"><time :datetime="event.timestamp" :title="event.timestamp">{{ absTimeShort(event.timestamp) }}</time><div class="log-timeline-event"><div class="log-timeline-event-title"><strong>{{ event.errorCode || event.event }}</strong><span class="log-severity" :class="'log-severity-'+logSeverity(event)">{{ event.status ? 'HTTP '+event.status : event.severity || 'Event' }}</span></div><p>{{ event.service }}<span v-if="event.module"> / {{ event.module }}</span><span v-if="event.ms !== undefined"> · {{ event.ms }} ms</span><span v-if="event.attempt !== undefined"> · attempt {{ event.attempt }}</span></p><details class="log-event-fields"><summary>Event fields</summary><pre>{{ JSON.stringify(event,null,2) }}</pre><button type="button" class="btn btn-sm" @click="copyLogValue(JSON.stringify(event,null,2))">Copy JSON</button></details></div></li></ol>
<ol class="log-events" v-if="trace?.events?.length"><li v-for="(event,index) in trace.events" :key="index"><time :datetime="event.timestamp" :title="event.timestamp">{{ absTimeShort(event.timestamp) }}</time><div class="log-timeline-event"><div class="log-timeline-event-title"><strong>{{ event.errorCode || event.errorType || event.event }}</strong><span class="log-severity" :class="'log-severity-'+logSeverity(event)">{{ (event.status || event.httpStatus) ? 'HTTP '+(event.status || event.httpStatus) : event.severity || 'Event' }}</span></div><p>{{ event.service }}<span v-if="event.module"> / {{ event.module }}</span><span v-if="event.ms !== undefined"> · {{ event.ms }} ms</span><span v-if="event.attempt !== undefined"> · attempt {{ event.attempt }}</span></p><p class="log-request-route" v-if="event.route"><code>{{ event.method }} {{ event.requestPath || event.route }}</code></p><details class="log-error-stack" v-if="event.errorStack || event.causeStack"><summary>Exception frames<span v-if="event.errorType"> · {{ event.errorType }}</span></summary><pre v-if="event.errorStack">{{ event.errorStack }}</pre><p v-if="event.causeType">Caused by {{ event.causeType }}</p><pre v-if="event.causeStack">{{ event.causeStack }}</pre></details><details class="log-event-fields"><summary>Event fields</summary><pre>{{ JSON.stringify(event,null,2) }}</pre><button type="button" class="btn btn-sm" @click="copyLogValue(JSON.stringify(event,null,2))">Copy JSON</button></details></div></li></ol>
<details class="log-timeline-scope"><summary>Correlation ID and query scope</summary><code>{{ traceSelection.id }}</code><button type="button" class="log-copy-value" @click="copyLogValue(traceSelection.id)">Copy full ID</button><p>Earliest matching events in the selected window. Service and release filters do not narrow this timeline.</p></details>
<a v-if="trace?.grafanaUrl" :href="safeUrl(trace.grafanaUrl)" target="_blank" rel="noopener noreferrer">Open in Grafana</a>
</section></div>
+2
View File
@@ -35,6 +35,8 @@ export function installLogInvestigation(state, http) {
sample.attempt !== undefined ? "Recorded attempt: " + sample.attempt + "." : "",
sample.queue ? "Queue: " + sample.queue + "." : "",
].filter(Boolean).join(" ");
state.occurrenceTime = value => Number.isFinite(Date.parse(value)) ? new Date(value).toLocaleString(undefined, {dateStyle:"medium",timeStyle:"medium"}) : "Time not captured";
state.historyOccurrences = row => (row?._related || []).slice().sort((a,b) => Date.parse(b.ts)-Date.parse(a.ts));
state.historyDetailFields = row => {
try { const value = JSON.parse(row?._detailJson || "{}"); return value && typeof value === "object" ? Object.entries(value) : [["value", value]]; }
catch { return [["record", row?._detailJson || ""]]; }
+1 -1
View File
@@ -1517,7 +1517,7 @@ export const errorsAdminController = function (state, http, location, interval)
e._detail = detail.detail && detail.detail !== e._repoId ? detail.detail : null;
// Walk into `cause` (and `err` for streamer-style entries) to
// surface the deepest stack.
let s = typeof detail.stack === "string" ? detail.stack : null;
let s = detail.errorStack || detail.causeStack ? [detail.errorType, detail.errorStack, detail.causeType ? "Caused by " + detail.causeType : null, detail.causeStack].filter(Boolean).join("\n") : (typeof detail.stack === "string" ? detail.stack : null);
var roots = [detail.cause, detail.err].filter(Boolean);
for (var ri = 0; !s && ri < roots.length; ri++) {
var c = roots[ri];
+42 -41
View File
@@ -1,52 +1,53 @@
"use strict";(()=>{var il=Object.defineProperty;var rl=e=>{throw TypeError(e)};var pf=(e,t,s)=>t in e?il(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ff=(e,t)=>{for(var s in t)il(e,s,{get:t[s],enumerable:!0})};var nt=(e,t,s)=>pf(e,typeof t!="symbol"?t+"":t,s),wr=(e,t,s)=>t.has(e)||rl("Cannot "+s);var re=(e,t,s)=>(wr(e,t,"read from private field"),s?s.call(e):t.get(e)),_e=(e,t,s)=>t.has(e)?rl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ze=(e,t,s,i)=>(wr(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Fe=(e,t,s)=>(wr(e,t,"access private method"),s);var al=(e,t,s,i)=>({set _(o){ze(e,t,o,s)},get _(){return re(e,t,i)}});var ge=["abap","abc","actionscript","ada","alda","apache_conf","apex","applescript","aql","asciidoc","asl","assembly_x86","autohotkey","batchfile","c9search","c_cpp","cirru","clojure","cobol","coffee","coldfusion","crystal","csharp","csound_document","csound_orchestra","csound_score","csp","css","curly","d","dart","diff","django","dockerfile","dot","drools","edifact","eiffel","ejs","elixir","elm","erlang","forth","fortran","fsharp","fsl","ftl","gcode","gherkin","gitignore","glsl","gobstones","golang","graphqlschema","groovy","haml","handlebars","haskell","haskell_cabal","haxe","hjson","html","html_elixir","html_ruby","ini","io","jack","jade","java","javascript","json","json5","jsoniq","jsp","jssm","jsx","julia","kotlin","latex","less","liquid","lisp","livescript","logiql","logtalk","lsl","lua","luapage","lucene","makefile","markdown","mask","matlab","maze","mediawiki","mel","mixal","mushcode","mysql","nginx","nim","nix","nsis","nunjucks","objectivec","ocaml","pascal","perl","perl6","pgsql","php","php_laravel_blade","pig","plain_text","powershell","praat","prisma","prolog","properties","protobuf","puppet","python","qml","r","razor","rdoc","red","redshift","rhtml","rst","ruby","rust","sass","scad","scala","scheme","scss","sh","sjs","slim","smarty","snippets","soy_template","space","sparql","sql","sqlserver","stylus","svg","swift","tcl","terraform","tex","text","textile","toml","tsx","turtle","twig","typescript","vala","vbscript","velocity","verilog","vhdl","visualforce","wollok","xml","xquery","yaml","zeek"];var ve={markdown:"/script/markdown.6c8dfb7b1d.min.js",notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",editor:"/script/editor.4f142d3adc.min.js"};function ll(e){let t=e.location.hash.slice(1);if(e.history.replaceState(null,"","/review-link"),t.length>2048)return null;let s=new URLSearchParams(t);if([...s.keys()].length!==3||[...s.keys()].some(d=>!["clientId","intentId","token"].includes(d)))return null;let i=s.get("clientId"),o=s.get("intentId"),r=s.get("token");return!/^[a-f0-9]{32}$/.test(i||"")||!/^[a-f0-9]{32}$/.test(o||"")||!/^[a-f0-9]{64}$/.test(r||"")?null:{contract:"4open.artifacts/1",clientId:i,intentId:o,token:r}}function dl(e,t){let{http:s,promises:i,window:o}=t,r=t.takeReviewHandoff(),d=r?{clientId:r.clientId,intentId:r.intentId}:null,p,c,v,h,y,m=!0,b,S=i.defer(),E=()=>[...o.crypto.getRandomValues(new Uint8Array(16))].map(F=>F.toString(16).padStart(2,"0")).join("");Object.assign(e,{repositoryId:"",handoffEnabled:!1,busy:!1,preview:null,acceptAccess:!1,acceptRetention:!1,uncertain:!1,saved:!1,expired:!1,error:r?"":"Open a new artifact link from your submission. This link is missing or invalid."});let N=()=>m&&e.user?.username===y;function w(){m=!1,r=p=c=void 0,S.resolve(),o.clearTimeout(b)}e.on("dispose",w),e.on("routeLeave",w),e.watch(()=>e.user?.username,F=>{!y&&F?y=F:y&&F!==y&&(w(),e.preview=null,e.repositoryId="",e.busy=!1,e.saved=!1,e.handoffEnabled=!1,e.error="Your account changed. Open a new artifact link from your submission.")});let T=()=>({timeout:S.promise,headers:{"Content-Type":"application/json","X-Review-CSRF":c}}),M=F=>F?.status===404?"Artifact linking is not available on this server.":F?.status===401?"Sign in, then open a new artifact link from your submission.":F?.status===403?"This account cannot approve this repository or this link.":"The request could not be completed. You can retry from this page.";e.loadPreview=async()=>{if(!m||!r||e.busy||e.uncertain||e.saved||!e.user?.username)return;y=e.user.username;let F=e.repositoryId.trim();if(!/^[A-Za-z0-9_-]{3,128}$/.test(F)){e.error="Enter the anonymous repository ID from its URL.";return}e.busy=!0,e.error="",e.preview=null,p=void 0,e.acceptAccess=e.acceptRetention=!1,e.expired=!1,o.clearTimeout(b),h||(h=E());try{let j=(await s.get("/api/review-consent/csrf",{timeout:S.promise})).data;if(!N())return;if(c=j.csrf,e.handoffEnabled=j.handoffEnabled===!0,!/^[a-f0-9]{64}$/.test(c||""))throw new Error("invalid_csrf");let oe=(await s.post("/api/review-consent/preview",{repositoryId:F,intent:{...r,requestId:h}},T())).data;if(!N())return;if(!oe||typeof oe.ticket!="string"||!oe.ticket||oe.ticket.length>8192||typeof oe.repositoryName!="string"||!["restricted-review","anonymous-liLine truncated
`))),e[vn]=_o(o);let r=i||o.props&&o.props.type==="number";Ln(e,t?"change":"input",d=>{d.target.composing||e[vn](ra(e.value,s,r))}),(s||r)&&Ln(e,"change",()=>{e.value=ra(e.value,s,r)}),t||(Ln(e,"compositionstart",gh),Ln(e,"compositionend",Jd),Ln(e,"change",Jd))},mounted(e,{value:t,modifiers:{trim:s,number:i}}){let o=t??"",r=e[Fi];delete e[Fi],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[vn](ra(e.value,s,i)):e.value=o},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:i,trim:o,number:r}},d){if(e[vn]=_o(d),e.composing)return;let p=(r||e.type==="number")&&!/^0\d/.test(e.value)?Io(e.value):e.value,c=t??"";if(p===c)return;let v=e.getRootNode();(v instanceof Document||v instanceof ShadowRoot)&&v.activeElement===e&&e.type!=="range"&&(i&&t===s||o&&e.value.trim()===c)||(e.value=c)}},la={deep:!0,created(e,t,s){e[vn]=_o(s),Ln(e,"change",()=>{let i=e._modelValue,o=Vs(e),r=e.checked,d=e[vn];if(Re(i)){let p=fi(i,o),c=p!==-1;if(r&&!c)d(i.concat(o));else if(!r&&c){let v=[...i];v.splice(p,1),d(v)}}else if(Jt(i)){let p=new Set(i);r?p.add(o):p.delete(o),d(p)}else d(tu(e,r))})},mounted:Xd,beforeUpdate(e,t,s){e[vn]=_o(s),Xd(e,t,s)}};function Xd(e,{value:t,oldValue:s},i){e._modelValue=t;let o;if(Re(t))o=fi(t,i.props.value)>-1;else if(Jt(t))o=t.has(i.props.value);else{if(t===s)return;o=Xt(t,tu(e,!0))}e.checked!==o&&(e.checked=o)}var Rt={deep:!0,created(e,{value:t,modifiers:{number:s}},i){e._modelValue=t,Ln(e,"change",()=>{let o=Array.prototype.filter.call(e.options,c=>c.selected).map(c=>s?Io(Vs(c)):Vs(c)),r=e.multiple,d=r?Jt(e._modelValue)?new Set(o):o:o[0],p=e._pendingValue=[r,r?Re(d)?o.slice():o:d];try{e[vn](d)}finally{We(()=>{e._pendingValue===p&&(e._pendingValue=void 0)})}}),e[vn]=_o(i)},mounted(e,{value:t}){Qd(e,t)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[vn]=_o(s)},updated(e,{value:t}){let s=e._pendingValue;e._pendingValue=void 0,(!s||s[0]!==e.multiple||!vh(t,s[1],s[0]))&&Qd(e,t)}};function vh(e,t,s){if(!s)return Xt(e,t);if(Re(e))return Xt(e,t);if(Jt(e)){if(e.size!==t.length)return!1;for(let i of t)if(!e.has(i))return!1;return!0}return!1}function Qd(e,t){let s=e.multiple,i=Re(t);if(!(s&&!i&&!Jt(t))){for(let o=0,r=e.options.length;o<r;o++){let d=e.options[o],p=Vs(d);if(s)if(i){let c=typeof p;c==="string"||c==="number"?d.selected=t.some(v=>String(v)===String(p)):d.selected=fi(t,p)>-1}else d.selected=t.has(p);else if(Xt(Vs(d),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Vs(e){return"_value"in e?e._value:e.value}function tu(e,t){let s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}var yh=["ctrl","shift","alt","meta"],bh={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>yh.some(s=>e[`${s}Key`]&&!t.includes(s))},de=(e,t)=>{if(!e)return e;let s=e._withMods||(e._withMods={}),i=t.join(".");return s[i]||(s[i]=((o,...r)=>{for(let d=0;d<t.length;d++){let p=bh[t[d]];if(p&&p(o,t))return}return e(o,...r)}))},wh={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Lt=(e,t)=>{let s=e._withKeys||(e._withKeys={}),i=t.join(".");return s[i]||(s[i]=(o=>{if(!("key"in o))return;let r=an(o.key);if(t.some(d=>d===r||wh[d]===r))return e(o)}))},kh=ft({patchProp:fh},Qm),Zd;function Ch(){return Zd||(Zd=Id(kh))}var nu=((...e)=>{let t=Ch().createApp(...e),{mount:s}=t;return t.mount=i=>{let o=Sh(i);if(!o)return;let r=t._component;!Oe(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");let d=s(o,!1,Eh(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),d},t});function Eh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Sh(e){return dt(e)?document.querySelector(e):e}var lo=typeof document<"u";function su(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Nh(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&su(e.default)}var xe=Object.assign;function Bi(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 Uo=()=>{},Kt=Array.isArray;function ca(e,t){let s={};for(let i in e)s[i]=i in t?t[i]:e[i];return s}var iu=/#/g,Rh=/&/g,Th=/\//g,Ph=/=/g,Dh=/\?/g,ru=/\+/g,Ah=/%5B/g,Ih=/%5D/g,au=/%5E/g,Oh=/%60/g,lu=/%7B/g,Mh=/%7C/g,du=/%7D/g,Vh=/%20/g;function pa(e){return e==null?"":encodeURI(""+e).replace(Mh,"|").replace(Ah,"[").replace(Ih,"]")}function uu(e){return pa(e).replace(lu,"{").replace(du,"}").replace(au,"^")}function da(e){return pa(e).replace(ru,"%2B").replace(Vh,"+").replace(iu,"%23").replace(Rh,"%26").replace(Oh,"`").replace(lu,"{").replace(du,"}").replace(au,"^")}function qh(e){return da(e).replace(Ph,"%3D")}function Lh(e){return pLine truncated
"use strict";(()=>{var il=Object.defineProperty;var rl=e=>{throw TypeError(e)};var pf=(e,t,s)=>t in e?il(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var ff=(e,t)=>{for(var s in t)il(e,s,{get:t[s],enumerable:!0})};var nt=(e,t,s)=>pf(e,typeof t!="symbol"?t+"":t,s),wr=(e,t,s)=>t.has(e)||rl("Cannot "+s);var re=(e,t,s)=>(wr(e,t,"read from private field"),s?s.call(e):t.get(e)),_e=(e,t,s)=>t.has(e)?rl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ze=(e,t,s,i)=>(wr(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Fe=(e,t,s)=>(wr(e,t,"access private method"),s);var al=(e,t,s,i)=>({set _(o){ze(e,t,o,s)},get _(){return re(e,t,i)}});var ge=["abap","abc","actionscript","ada","alda","apache_conf","apex","applescript","aql","asciidoc","asl","assembly_x86","autohotkey","batchfile","c9search","c_cpp","cirru","clojure","cobol","coffee","coldfusion","crystal","csharp","csound_document","csound_orchestra","csound_score","csp","css","curly","d","dart","diff","django","dockerfile","dot","drools","edifact","eiffel","ejs","elixir","elm","erlang","forth","fortran","fsharp","fsl","ftl","gcode","gherkin","gitignore","glsl","gobstones","golang","graphqlschema","groovy","haml","handlebars","haskell","haskell_cabal","haxe","hjson","html","html_elixir","html_ruby","ini","io","jack","jade","java","javascript","json","json5","jsoniq","jsp","jssm","jsx","julia","kotlin","latex","less","liquid","lisp","livescript","logiql","logtalk","lsl","lua","luapage","lucene","makefile","markdown","mask","matlab","maze","mediawiki","mel","mixal","mushcode","mysql","nginx","nim","nix","nsis","nunjucks","objectivec","ocaml","pascal","perl","perl6","pgsql","php","php_laravel_blade","pig","plain_text","powershell","praat","prisma","prolog","properties","protobuf","puppet","python","qml","r","razor","rdoc","red","redshift","rhtml","rst","ruby","rust","sass","scad","scala","scheme","scss","sh","sjs","slim","smarty","snippets","soy_template","space","sparql","sql","sqlserver","stylus","svg","swift","tcl","terraform","tex","text","textile","toml","tsx","turtle","twig","typescript","vala","vbscript","velocity","verilog","vhdl","visualforce","wollok","xml","xquery","yaml","zeek"];var ve={markdown:"/script/markdown.6c8dfb7b1d.min.js",notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",editor:"/script/editor.4f142d3adc.min.js"};function ll(e){let t=e.location.hash.slice(1);if(e.history.replaceState(null,"","/review-link"),t.length>2048)return null;let s=new URLSearchParams(t);if([...s.keys()].length!==3||[...s.keys()].some(u=>!["clientId","intentId","token"].includes(u)))return null;let i=s.get("clientId"),o=s.get("intentId"),r=s.get("token");return!/^[a-f0-9]{32}$/.test(i||"")||!/^[a-f0-9]{32}$/.test(o||"")||!/^[a-f0-9]{64}$/.test(r||"")?null:{contract:"4open.artifacts/1",clientId:i,intentId:o,token:r}}function dl(e,t){let{http:s,promises:i,window:o}=t,r=t.takeReviewHandoff(),u=r?{clientId:r.clientId,intentId:r.intentId}:null,p,c,v,g,y,m=!0,b,E=i.defer(),S=()=>[...o.crypto.getRandomValues(new Uint8Array(16))].map(F=>F.toString(16).padStart(2,"0")).join("");Object.assign(e,{repositoryId:"",handoffEnabled:!1,busy:!1,preview:null,acceptAccess:!1,acceptRetention:!1,uncertain:!1,saved:!1,expired:!1,error:r?"":"Open a new artifact link from your submission. This link is missing or invalid."});let N=()=>m&&e.user?.username===y;function w(){m=!1,r=p=c=void 0,E.resolve(),o.clearTimeout(b)}e.on("dispose",w),e.on("routeLeave",w),e.watch(()=>e.user?.username,F=>{!y&&F?y=F:y&&F!==y&&(w(),e.preview=null,e.repositoryId="",e.busy=!1,e.saved=!1,e.handoffEnabled=!1,e.error="Your account changed. Open a new artifact link from your submission.")});let T=()=>({timeout:E.promise,headers:{"Content-Type":"application/json","X-Review-CSRF":c}}),M=F=>F?.status===404?"Artifact linking is not available on this server.":F?.status===401?"Sign in, then open a new artifact link from your submission.":F?.status===403?"This account cannot approve this repository or this link.":"The request could not be completed. You can retry from this page.";e.loadPreview=async()=>{if(!m||!r||e.busy||e.uncertain||e.saved||!e.user?.username)return;y=e.user.username;let F=e.repositoryId.trim();if(!/^[A-Za-z0-9_-]{3,128}$/.test(F)){e.error="Enter the anonymous repository ID from its URL.";return}e.busy=!0,e.error="",e.preview=null,p=void 0,e.acceptAccess=e.acceptRetention=!1,e.expired=!1,o.clearTimeout(b),g||(g=S());try{let j=(await s.get("/api/review-consent/csrf",{timeout:E.promise})).data;if(!N())return;if(c=j.csrf,e.handoffEnabled=j.handoffEnabled===!0,!/^[a-f0-9]{64}$/.test(c||""))throw new Error("invalid_csrf");let oe=(await s.post("/api/review-consent/preview",{repositoryId:F,intent:{...r,requestId:g}},T())).data;if(!N())return;if(!oe||typeof oe.ticket!="string"||!oe.ticket||oe.ticket.length>8192||typeof oe.repositoryName!="string"||!["restricted-review","anonymous-liLine truncated
`))),e[vn]=_o(o);let r=i||o.props&&o.props.type==="number";Ln(e,t?"change":"input",u=>{u.target.composing||e[vn](ra(e.value,s,r))}),(s||r)&&Ln(e,"change",()=>{e.value=ra(e.value,s,r)}),t||(Ln(e,"compositionstart",gh),Ln(e,"compositionend",Jd),Ln(e,"change",Jd))},mounted(e,{value:t,modifiers:{trim:s,number:i}}){let o=t??"",r=e[Fi];delete e[Fi],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[vn](ra(e.value,s,i)):e.value=o},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:i,trim:o,number:r}},u){if(e[vn]=_o(u),e.composing)return;let p=(r||e.type==="number")&&!/^0\d/.test(e.value)?Io(e.value):e.value,c=t??"";if(p===c)return;let v=e.getRootNode();(v instanceof Document||v instanceof ShadowRoot)&&v.activeElement===e&&e.type!=="range"&&(i&&t===s||o&&e.value.trim()===c)||(e.value=c)}},la={deep:!0,created(e,t,s){e[vn]=_o(s),Ln(e,"change",()=>{let i=e._modelValue,o=Vs(e),r=e.checked,u=e[vn];if(Re(i)){let p=fi(i,o),c=p!==-1;if(r&&!c)u(i.concat(o));else if(!r&&c){let v=[...i];v.splice(p,1),u(v)}}else if(Jt(i)){let p=new Set(i);r?p.add(o):p.delete(o),u(p)}else u(tu(e,r))})},mounted:Xd,beforeUpdate(e,t,s){e[vn]=_o(s),Xd(e,t,s)}};function Xd(e,{value:t,oldValue:s},i){e._modelValue=t;let o;if(Re(t))o=fi(t,i.props.value)>-1;else if(Jt(t))o=t.has(i.props.value);else{if(t===s)return;o=Xt(t,tu(e,!0))}e.checked!==o&&(e.checked=o)}var Rt={deep:!0,created(e,{value:t,modifiers:{number:s}},i){e._modelValue=t,Ln(e,"change",()=>{let o=Array.prototype.filter.call(e.options,c=>c.selected).map(c=>s?Io(Vs(c)):Vs(c)),r=e.multiple,u=r?Jt(e._modelValue)?new Set(o):o:o[0],p=e._pendingValue=[r,r?Re(u)?o.slice():o:u];try{e[vn](u)}finally{We(()=>{e._pendingValue===p&&(e._pendingValue=void 0)})}}),e[vn]=_o(i)},mounted(e,{value:t}){Qd(e,t)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[vn]=_o(s)},updated(e,{value:t}){let s=e._pendingValue;e._pendingValue=void 0,(!s||s[0]!==e.multiple||!vh(t,s[1],s[0]))&&Qd(e,t)}};function vh(e,t,s){if(!s)return Xt(e,t);if(Re(e))return Xt(e,t);if(Jt(e)){if(e.size!==t.length)return!1;for(let i of t)if(!e.has(i))return!1;return!0}return!1}function Qd(e,t){let s=e.multiple,i=Re(t);if(!(s&&!i&&!Jt(t))){for(let o=0,r=e.options.length;o<r;o++){let u=e.options[o],p=Vs(u);if(s)if(i){let c=typeof p;c==="string"||c==="number"?u.selected=t.some(v=>String(v)===String(p)):u.selected=fi(t,p)>-1}else u.selected=t.has(p);else if(Xt(Vs(u),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!s&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Vs(e){return"_value"in e?e._value:e.value}function tu(e,t){let s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}var yh=["ctrl","shift","alt","meta"],bh={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>yh.some(s=>e[`${s}Key`]&&!t.includes(s))},de=(e,t)=>{if(!e)return e;let s=e._withMods||(e._withMods={}),i=t.join(".");return s[i]||(s[i]=((o,...r)=>{for(let u=0;u<t.length;u++){let p=bh[t[u]];if(p&&p(o,t))return}return e(o,...r)}))},wh={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Lt=(e,t)=>{let s=e._withKeys||(e._withKeys={}),i=t.join(".");return s[i]||(s[i]=(o=>{if(!("key"in o))return;let r=an(o.key);if(t.some(u=>u===r||wh[u]===r))return e(o)}))},kh=ft({patchProp:fh},Qm),Zd;function Ch(){return Zd||(Zd=Id(kh))}var nu=((...e)=>{let t=Ch().createApp(...e),{mount:s}=t;return t.mount=i=>{let o=Eh(i);if(!o)return;let r=t._component;!Oe(r)&&!r.render&&!r.template&&(r.template=o.innerHTML),o.nodeType===1&&(o.textContent="");let u=s(o,!1,Sh(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),u},t});function Sh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Eh(e){return dt(e)?document.querySelector(e):e}var lo=typeof document<"u";function su(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Nh(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&su(e.default)}var xe=Object.assign;function Bi(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 Uo=()=>{},Kt=Array.isArray;function ca(e,t){let s={};for(let i in e)s[i]=i in t?t[i]:e[i];return s}var iu=/#/g,Rh=/&/g,Th=/\//g,Ph=/=/g,Dh=/\?/g,ru=/\+/g,Ah=/%5B/g,Ih=/%5D/g,au=/%5E/g,Oh=/%60/g,lu=/%7B/g,Mh=/%7C/g,du=/%7D/g,Vh=/%20/g;function pa(e){return e==null?"":encodeURI(""+e).replace(Mh,"|").replace(Ah,"[").replace(Ih,"]")}function uu(e){return pa(e).replace(lu,"{").replace(du,"}").replace(au,"^")}function da(e){return pa(e).replace(ru,"%2B").replace(Vh,"+").replace(iu,"%23").replace(Rh,"%26").replace(Oh,"`").replace(lu,"{").replace(du,"}").replace(au,"^")}function qh(e){return da(e).replace(Ph,"%3D")}function Lh(e){return pLine truncated
${JSON.stringify(e)}${t?`
while being at
`+JSON.stringify(t):""}`},[pt.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${Gh(t)}" via a navigation guard.`},[pt.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[pt.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[pt.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function ao(e,t){return xe(new Error,{type:e,[bu]:!0},t)}function yn(e,t){return e instanceof Error&&bu in e&&(t==null||!!(e.type&t))}var jh=["params","query","hash"];function Gh(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let s of jh)s in e&&(t[s]=e[s]);return JSON.stringify(t,null,2)}function wu(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(ru," "),r=o.indexOf("="),d=Fo(r<0?o:o.slice(0,r)),p=r<0?null:Fo(o.slice(r+1));if(d in t){let c=t[d];Kt(c)||(c=t[d]=[c]),c.push(p)}else t[d]=p}return t}function va(e){let t="";for(let s in e){let i=e[s];if(s=qh(s),i==null){i!==void 0&&(t+=(t.length?"&":"")+s);continue}(Kt(i)?i.map(o=>o&&da(o)):[i&&da(i)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+s,o!=null&&(t+="="+o))})}return t}function ku(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 Cu=Symbol(""),ya=Symbol(""),Gi=Symbol(""),Wi=Symbol(""),Ki=Symbol("");function Bo(){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 Tn(e,t,s,i,o,r=d=>d()){let d=i&&(i.enterCallbacks[o]=i.enterCallbacks[o]||[]);return()=>new Promise((p,c)=>{let v=m=>{m===!1?c(ao(pt.NAVIGATION_ABORTED,{from:s,to:t})):m instanceof Error?c(m):Hh(m)?c(ao(pt.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(d&&i.enterCallbacks[o]===d&&typeof m=="function"&&d.push(m),p())},h=r(()=>e.call(i&&i.instances[o],t,s,v)),y=Promise.resolve(h);e.length<3&&(y=y.then(v)),y.catch(m=>c(m))})}function Yi(e,t,s,i,o=r=>r()){let r=[];for(let d of e)for(let p in d.components){let c=d.components[p];if(!(t!=="beforeRouteEnter"&&!d.instances[p]))if(su(c)){let v=(c.__vccOpts||c)[t];v&&r.push(Tn(v,s,i,d,p,o))}else{let v=c();r.push(()=>v.then(h=>{if(!h)throw new Error(`Couldn't resolve component "${p}" at "${d.path}"`);let y=Nh(h)?h.default:h;d.mods[p]=h,d.components[p]=y;let m=(y.__vccOpts||y)[t];return m&&Tn(m,s,i,d,p,o)()}))}}return r}function Eu(e,t){let s=[],i=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let d=0;d<r;d++){let p=t.matched[d];p&&(e.matched.find(v=>ro(v,p))?i.push(p):s.push(p));let c=e.matched[d];c&&(t.matched.find(v=>ro(v,c))||o.push(c))}return[s,i,o]}var Wh=()=>location.protocol+"//"+location.host;function Vu(e,t){let{pathname:s,search:i,hash:o}=t,r=e.indexOf("#");if(r>-1){let d=o.includes(e.slice(r))?e.slice(r).length:1,p=o.slice(d);return p[0]!=="/"&&(p="/"+p),fa(p,"")}return fa(s,e)+i+o}function Kh(e,t,s,i){let o=[],r=[],d=null,p=({state:m})=>{let b=Vu(e,location),S=s.value,E=t.value,N=0;if(m){if(s.value=b,t.value=m,d&&d===S){d=null;return}N=E?m.position-E.position:0}else i(b);o.forEach(w=>{w(s.value,S,{delta:N,type:Hi.pop,direction:N?N>0?ji.forward:ji.back:ji.unknown})})};function c(){d=s.value}function v(m){o.push(m);let b=()=>{let S=o.indexOf(m);S>-1&&o.splice(S,1)};return r.push(b),b}function h(){if(document.visibilityState==="hidden"){let{history:m}=window;if(!m.state)return;m.replaceState(xe({},m.state,{scroll:qs()}),"")}}function y(){for(let m of r)m();r=[],window.removeEventListener("popstate",p),window.removeEventListener("pagehide",h),document.removeEventListener("visibilitychange",h)}return window.addEventListener("popstate",p),window.addEventListener("pagehide",h),document.addEventListener("visibilitychange",h),{pauseListeners:c,listen:v,destroy:y}}function Su(e,t,s,i=!1,o=!1){return{back:e,current:t,forward:s,replaced:i,position:window.history.length,scroll:o?qs():null}}function Yh(e){let{history:t,location:s}=window,i={value:Vu(e,s)},o={value:t.state};o.value||r(i.value,{back:null,current:i.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(c,v,h){let y=e.indexOf("#"),m=y>-1?(s.host&&document.querySelector("base")?e:e.slice(y))+c:Wh()+e+c;try{t[h?"replaceState":"pushState"](v,"",m),o.value=v}catch(b){console.error(b),s[h?"replace":"assign"](m)}}function d(c,v){r(c,xe({},t.state,Su(o.value.back,c,o.value.forward,!0),v,{position:o.value.position}),!0),i.value=c}function p(c,v){let h=xe({},o.value,t.state,{forward:c,scroll:qs()});r(h.current,h,!0),r(c,xe({},Su(i.value,c,null),{position:h.position+1},v),!1),i.value=c}return{location:i,state:o,push:p,replace:d}}function qu(e){e=mu(e);let t=Yh(e),s=Kh(e,t.state,t.location,t.replace);function i(r,d=!0){d||s.pauseListeners(),history.go(r)}let o=xe({locatLine truncated
`).forEach((L,k)=>{for(let[q,G]of b){let H=q.exec(L);if(H&&!/^(if|for|while|switch|return|catch)$/.test(H[1])){I.push({name:H[1],kind:G,line:k+1});break}}}),S={content:e.content,list:I.slice(0,300)},S.list},e.goToSymbol=function(I){e.symbolsOpen=!1;let L=e.codeEditor;L&&(L.scrollToLine(I-1,!0,!0,()=>{}),L.gotoLine(I,0,!0),window.history.replaceState(null,"",window.location.pathname+window.location.search+"#L"+I),window.dispatchEvent(new HashChangeEvent("hashchange")))},e.gotoLine=function(){e.codeEditor&&(e.moreOpen=!1,e.gotoError="",e.gotoValue=String(e.codeEditor.getCursorPosition().row+1),e.gotoOpen=!0,setTimeout(()=>{let I=window.document.getElementById("goto-input");I&&(I.focus(),I.select())},0))},e.closeGoto=function(){e.gotoOpen=!1,e.gotoError="",e.codeEditor?.focus()},e.submitGoto=function(){let I=e.codeEditor;if(!I)return;let L=/^\s*:?\s*(\d+)\s*(?:[:,]\s*(\d+))?\s*$/.exec(e.gotoValue||""),k=I.session.getLength();if(!L||+L[1]<1||+L[1]>k){e.gotoError="Enter a line from 1 to "+k;return}I.gotoLine(+L[1],L[2]?Math.max(0,+L[2]-1):0,!0),e.gotoOpen=!1,e.gotoError="",I.focus()},e.rootEntries=function(){return[...e.files||[]].sort((I,L)=>{let k=I.size==null,q=L.size==null;return k!==q?k?-1:1:I.name.localeCompare(L.name)})},e.formatSize=function(I){if(I==null)return"";if(I<1024)return I+" B";let L=I/1024,k=q=>q.toFixed(1).replace(/\.0$/,"");return L<1024?k(L)+" KB":L<1024*1024?k(L/1024)+" MB":k(L/1024/1024)+" GB"},e.fileSize=function(I){if(!I)return null;let L=I.replace(/^\/+/,""),k=(e.files||[]).find(q=>(q.path?q.path+"/":"")+q.name===L);return k&&k.size!=null?k.size:null},e.revealFolder=function(I){e.sidebarHidden=!1,e.sidebarCollapsed=!1,We(()=>{let L=window.document.querySelector('.files a[data-path="/'+(window.CSS?.escape?window.CSS.escape(I):I)+'"]');L&&(L.closest("li")?.classList.contains("open")||L.click(),L.scrollIntoView({block:"nearest"}),L.focus())})};let E={content:null,n:0},N=I=>{if(E.content===I)return E.n;let L=I;if(typeof L=="string")try{L=JSON.parse(L)}catch{L=null}let k=[],q=H=>{Array.isArray(H)?k.push(H.join("")):typeof H=="string"&&k.push(H)};(L&&(L.cells||(L.worksheets||[]).flatMap(H=>H.cells||[]))||[]).forEach(H=>{q(H?.source??H?.input),(H?.outputs||[]).forEach(Y=>{q(Y?.text),Y?.data&&(q(Y.data["text/plain"]),q(Y.data["text/markdown"]),q(Y.data["text/html"])),q(Y?.traceback)})});let G=k.reduce((H,Y)=>H+(Y.match(s)||[]).length,0);return E={content:I,n:G},G};e.redactionCount=function(){return e.type==="IPython"?N(e.content):typeof e.content!="string"?0:((e.type==="html"?e.content.replace(/<[^>]*>/g," "):e.content).match(s)||[]).length},e.renderRedacted=$s;let w=I=>I.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").slice(0,60)||"section";e.renderReadme=function(I){let L=e.renderRedacted(I);if(!L||typeof window.DOMParser!="function")return L;let k=new window.DOMParser().parseFromString("<div>"+L+"</div>","text/html"),q={};return k.querySelectorAll("h1, h2, h3").forEach(G=>{let H=G.id||w(G.textContent);q[H]?H+="-"+ ++q[H]:q[H]=1,G.id=H}),k.body.firstChild.innerHTML};let T={content:null,list:[]};e.readmeToc=function(){if(e.type!=="html"||typeof e.content!="string")return[];if(T.content===e.content)return T.list;let L=[...new window.DOMParser().parseFromString("<div>"+e.renderReadme(e.sanitize?e.sanitize(e.content):e.content)+"</div>","text/html").querySelectorAll("h2, h3")].map(k=>({id:k.id,text:k.textContent.trim(),level:k.tagName==="H3"?3:2})).slice(0,40);return T={content:e.content,list:L},L},e.activeHeading=null,o(window,"scroll",()=>{let I=e.readmeToc?e.readmeToc():[];if(!I.length)return;let L=150,k="",q="";for(let G of I){let H=window.document.getElementById(G.id);if(!H)continue;let Y=H.getBoundingClientRect().top;Y<L?k=G.id:!q&&Y<window.innerHeight-80&&(q=G.id)}q&&(k=q),e.activeHeading!==k&&(e.activeHeading=k)},{capture:!0,passive:!0}),e.scrollToHeading=function(I){if(!I){(window.document.querySelector(".explorer-content, .file-card-body, .main-pane")||window).scrollTo({top:0,behavior:"smooth"}),e.activeHeading="";return}let L=window.document.getElementById(I);L&&L.scrollIntoView({behavior:"smooth",block:"start"}),e.activeHeading=I},e.csvView="table";let M={content:null,rows:[]},F=(I,L)=>{let k=[],q=[],G="",H=!1;for(let Y=0;Y<I.length;Y++){let ee=I[Y];H?ee==='"'?I[Y+1]==='"'?(G+='"',Y++):H=!1:G+=ee:ee==='"'&&G===""?H=!0:ee===L?(q.push(G),G=""):ee===`
`+JSON.stringify(t):""}`},[pt.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${Gh(t)}" via a navigation guard.`},[pt.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[pt.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[pt.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function ao(e,t){return xe(new Error,{type:e,[bu]:!0},t)}function yn(e,t){return e instanceof Error&&bu in e&&(t==null||!!(e.type&t))}var jh=["params","query","hash"];function Gh(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let s of jh)s in e&&(t[s]=e[s]);return JSON.stringify(t,null,2)}function wu(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(ru," "),r=o.indexOf("="),u=Fo(r<0?o:o.slice(0,r)),p=r<0?null:Fo(o.slice(r+1));if(u in t){let c=t[u];Kt(c)||(c=t[u]=[c]),c.push(p)}else t[u]=p}return t}function va(e){let t="";for(let s in e){let i=e[s];if(s=qh(s),i==null){i!==void 0&&(t+=(t.length?"&":"")+s);continue}(Kt(i)?i.map(o=>o&&da(o)):[i&&da(i)]).forEach(o=>{o!==void 0&&(t+=(t.length?"&":"")+s,o!=null&&(t+="="+o))})}return t}function ku(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 Cu=Symbol(""),ya=Symbol(""),Gi=Symbol(""),Wi=Symbol(""),Ki=Symbol("");function Bo(){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 Tn(e,t,s,i,o,r=u=>u()){let u=i&&(i.enterCallbacks[o]=i.enterCallbacks[o]||[]);return()=>new Promise((p,c)=>{let v=m=>{m===!1?c(ao(pt.NAVIGATION_ABORTED,{from:s,to:t})):m instanceof Error?c(m):Hh(m)?c(ao(pt.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(u&&i.enterCallbacks[o]===u&&typeof m=="function"&&u.push(m),p())},g=r(()=>e.call(i&&i.instances[o],t,s,v)),y=Promise.resolve(g);e.length<3&&(y=y.then(v)),y.catch(m=>c(m))})}function Yi(e,t,s,i,o=r=>r()){let r=[];for(let u of e)for(let p in u.components){let c=u.components[p];if(!(t!=="beforeRouteEnter"&&!u.instances[p]))if(su(c)){let v=(c.__vccOpts||c)[t];v&&r.push(Tn(v,s,i,u,p,o))}else{let v=c();r.push(()=>v.then(g=>{if(!g)throw new Error(`Couldn't resolve component "${p}" at "${u.path}"`);let y=Nh(g)?g.default:g;u.mods[p]=g,u.components[p]=y;let m=(y.__vccOpts||y)[t];return m&&Tn(m,s,i,u,p,o)()}))}}return r}function Su(e,t){let s=[],i=[],o=[],r=Math.max(t.matched.length,e.matched.length);for(let u=0;u<r;u++){let p=t.matched[u];p&&(e.matched.find(v=>ro(v,p))?i.push(p):s.push(p));let c=e.matched[u];c&&(t.matched.find(v=>ro(v,c))||o.push(c))}return[s,i,o]}var Wh=()=>location.protocol+"//"+location.host;function Vu(e,t){let{pathname:s,search:i,hash:o}=t,r=e.indexOf("#");if(r>-1){let u=o.includes(e.slice(r))?e.slice(r).length:1,p=o.slice(u);return p[0]!=="/"&&(p="/"+p),fa(p,"")}return fa(s,e)+i+o}function Kh(e,t,s,i){let o=[],r=[],u=null,p=({state:m})=>{let b=Vu(e,location),E=s.value,S=t.value,N=0;if(m){if(s.value=b,t.value=m,u&&u===E){u=null;return}N=S?m.position-S.position:0}else i(b);o.forEach(w=>{w(s.value,E,{delta:N,type:Hi.pop,direction:N?N>0?ji.forward:ji.back:ji.unknown})})};function c(){u=s.value}function v(m){o.push(m);let b=()=>{let E=o.indexOf(m);E>-1&&o.splice(E,1)};return r.push(b),b}function g(){if(document.visibilityState==="hidden"){let{history:m}=window;if(!m.state)return;m.replaceState(xe({},m.state,{scroll:qs()}),"")}}function y(){for(let m of r)m();r=[],window.removeEventListener("popstate",p),window.removeEventListener("pagehide",g),document.removeEventListener("visibilitychange",g)}return window.addEventListener("popstate",p),window.addEventListener("pagehide",g),document.addEventListener("visibilitychange",g),{pauseListeners:c,listen:v,destroy:y}}function Eu(e,t,s,i=!1,o=!1){return{back:e,current:t,forward:s,replaced:i,position:window.history.length,scroll:o?qs():null}}function Yh(e){let{history:t,location:s}=window,i={value:Vu(e,s)},o={value:t.state};o.value||r(i.value,{back:null,current:i.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(c,v,g){let y=e.indexOf("#"),m=y>-1?(s.host&&document.querySelector("base")?e:e.slice(y))+c:Wh()+e+c;try{t[g?"replaceState":"pushState"](v,"",m),o.value=v}catch(b){console.error(b),s[g?"replace":"assign"](m)}}function u(c,v){r(c,xe({},t.state,Eu(o.value.back,c,o.value.forward,!0),v,{position:o.value.position}),!0),i.value=c}function p(c,v){let g=xe({},o.value,t.state,{forward:c,scroll:qs()});r(g.current,g,!0),r(c,xe({},Eu(i.value,c,null),{position:g.position+1},v),!1),i.value=c}return{location:i,state:o,push:p,replace:u}}function qu(e){e=mu(e);let t=Yh(e),s=Kh(e,t.state,t.location,t.replace);function i(r,u=!0){u||s.pauseListeners(),history.go(r)}let o=xe({locatLine truncated
`).forEach((L,k)=>{for(let[q,G]of b){let H=q.exec(L);if(H&&!/^(if|for|while|switch|return|catch)$/.test(H[1])){I.push({name:H[1],kind:G,line:k+1});break}}}),E={content:e.content,list:I.slice(0,300)},E.list},e.goToSymbol=function(I){e.symbolsOpen=!1;let L=e.codeEditor;L&&(L.scrollToLine(I-1,!0,!0,()=>{}),L.gotoLine(I,0,!0),window.history.replaceState(null,"",window.location.pathname+window.location.search+"#L"+I),window.dispatchEvent(new HashChangeEvent("hashchange")))},e.gotoLine=function(){e.codeEditor&&(e.moreOpen=!1,e.gotoError="",e.gotoValue=String(e.codeEditor.getCursorPosition().row+1),e.gotoOpen=!0,setTimeout(()=>{let I=window.document.getElementById("goto-input");I&&(I.focus(),I.select())},0))},e.closeGoto=function(){e.gotoOpen=!1,e.gotoError="",e.codeEditor?.focus()},e.submitGoto=function(){let I=e.codeEditor;if(!I)return;let L=/^\s*:?\s*(\d+)\s*(?:[:,]\s*(\d+))?\s*$/.exec(e.gotoValue||""),k=I.session.getLength();if(!L||+L[1]<1||+L[1]>k){e.gotoError="Enter a line from 1 to "+k;return}I.gotoLine(+L[1],L[2]?Math.max(0,+L[2]-1):0,!0),e.gotoOpen=!1,e.gotoError="",I.focus()},e.rootEntries=function(){return[...e.files||[]].sort((I,L)=>{let k=I.size==null,q=L.size==null;return k!==q?k?-1:1:I.name.localeCompare(L.name)})},e.formatSize=function(I){if(I==null)return"";if(I<1024)return I+" B";let L=I/1024,k=q=>q.toFixed(1).replace(/\.0$/,"");return L<1024?k(L)+" KB":L<1024*1024?k(L/1024)+" MB":k(L/1024/1024)+" GB"},e.fileSize=function(I){if(!I)return null;let L=I.replace(/^\/+/,""),k=(e.files||[]).find(q=>(q.path?q.path+"/":"")+q.name===L);return k&&k.size!=null?k.size:null},e.revealFolder=function(I){e.sidebarHidden=!1,e.sidebarCollapsed=!1,We(()=>{let L=window.document.querySelector('.files a[data-path="/'+(window.CSS?.escape?window.CSS.escape(I):I)+'"]');L&&(L.closest("li")?.classList.contains("open")||L.click(),L.scrollIntoView({block:"nearest"}),L.focus())})};let S={content:null,n:0},N=I=>{if(S.content===I)return S.n;let L=I;if(typeof L=="string")try{L=JSON.parse(L)}catch{L=null}let k=[],q=H=>{Array.isArray(H)?k.push(H.join("")):typeof H=="string"&&k.push(H)};(L&&(L.cells||(L.worksheets||[]).flatMap(H=>H.cells||[]))||[]).forEach(H=>{q(H?.source??H?.input),(H?.outputs||[]).forEach(Y=>{q(Y?.text),Y?.data&&(q(Y.data["text/plain"]),q(Y.data["text/markdown"]),q(Y.data["text/html"])),q(Y?.traceback)})});let G=k.reduce((H,Y)=>H+(Y.match(s)||[]).length,0);return S={content:I,n:G},G};e.redactionCount=function(){return e.type==="IPython"?N(e.content):typeof e.content!="string"?0:((e.type==="html"?e.content.replace(/<[^>]*>/g," "):e.content).match(s)||[]).length},e.renderRedacted=$s;let w=I=>I.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").slice(0,60)||"section";e.renderReadme=function(I){let L=e.renderRedacted(I);if(!L||typeof window.DOMParser!="function")return L;let k=new window.DOMParser().parseFromString("<div>"+L+"</div>","text/html"),q={};return k.querySelectorAll("h1, h2, h3").forEach(G=>{let H=G.id||w(G.textContent);q[H]?H+="-"+ ++q[H]:q[H]=1,G.id=H}),k.body.firstChild.innerHTML};let T={content:null,list:[]};e.readmeToc=function(){if(e.type!=="html"||typeof e.content!="string")return[];if(T.content===e.content)return T.list;let L=[...new window.DOMParser().parseFromString("<div>"+e.renderReadme(e.sanitize?e.sanitize(e.content):e.content)+"</div>","text/html").querySelectorAll("h2, h3")].map(k=>({id:k.id,text:k.textContent.trim(),level:k.tagName==="H3"?3:2})).slice(0,40);return T={content:e.content,list:L},L},e.activeHeading=null,o(window,"scroll",()=>{let I=e.readmeToc?e.readmeToc():[];if(!I.length)return;let L=150,k="",q="";for(let G of I){let H=window.document.getElementById(G.id);if(!H)continue;let Y=H.getBoundingClientRect().top;Y<L?k=G.id:!q&&Y<window.innerHeight-80&&(q=G.id)}q&&(k=q),e.activeHeading!==k&&(e.activeHeading=k)},{capture:!0,passive:!0}),e.scrollToHeading=function(I){if(!I){(window.document.querySelector(".explorer-content, .file-card-body, .main-pane")||window).scrollTo({top:0,behavior:"smooth"}),e.activeHeading="";return}let L=window.document.getElementById(I);L&&L.scrollIntoView({behavior:"smooth",block:"start"}),e.activeHeading=I},e.csvView="table";let M={content:null,rows:[]},F=(I,L)=>{let k=[],q=[],G="",H=!1;for(let Y=0;Y<I.length;Y++){let ee=I[Y];H?ee==='"'?I[Y+1]==='"'?(G+='"',Y++):H=!1:G+=ee:ee==='"'&&G===""?H=!0:ee===L?(q.push(G),G=""):ee===`
`||ee==="\r"?(ee==="\r"&&I[Y+1]===`
`&&Y++,q.push(G),k.push(q),q=[],G=""):G+=ee}return(G!==""||q.length)&&(q.push(G),k.push(q)),k.filter(Y=>Y.length>1||Y[0]!=="")};e.isCsv=()=>typeof e.content=="string"&&e.type!=="html"&&/\.(csv|tsv)$/i.test(e.filePath||"")&&e.content.length<=1024*1024,e.csvRows=()=>{if(M.content!==e.content){let I=/\.tsv$/i.test(e.filePath||"")?" ":",";M={content:e.content,rows:F(e.content,I)}}return M.rows},e.csvNumCol=I=>{let L=e.csvRows().slice(1).map(k=>k[I]).filter(k=>k!=null&&String(k).trim()!=="");return L.length>0&&L.every(k=>e.csvNumeric(k))},e.csvNumeric=I=>/^\s*[-+]?(\d[\d,]*)?(\.\d+)?(e[-+]?\d+)?%?\s*$/i.test(I)&&/\d/.test(I),e.redactParts=function(I){let L=[],k=0,q,G=/\bXXXX-(\d+)\b/g;for(I=String(I||"");q=G.exec(I);)q.index>k&&L.push({t:I.slice(k,q.index)}),L.push({n:q[1]}),k=q.index+q[0].length;return k<I.length&&L.push({t:I.slice(k)}),L},e.pathCopied=!1,e.copyPath=async function(){window.navigator.clipboard?.writeText&&(await window.navigator.clipboard.writeText(e.filePath||""),e.pathCopied=!0,setTimeout(()=>{e.pathCopied=!1},1600))},e.contentCopied=!1,e.copyContent=async function(){if(typeof e.content!="string"||!window.navigator.clipboard?.writeText)return;let I=e.content;if(e.type==="html"&&e.url)if(e.preview)I=e.sourceContent;else try{I=await(await window.fetch(e.url,{credentials:"same-origin"})).text()}catch{return}await window.navigator.clipboard.writeText(I),e.contentCopied=!0,setTimeout(()=>{e.contentCopied=!1},1600)};function j(I){return r[I]?r[I]:I}function oe(I){return I=="pdf"?"pdf":I=="html"||I=="htm"?"html-doc":["md","markdown","mdown","mkdn","mdx"].includes(I)?"md":I=="org"?"org":I=="ipynb"?"IPython":d.indexOf(I)>-1?"text":p.indexOf(I)>-1?"image":v.indexOf(I)>-1?"media":c.indexOf(I)>-1?"audio":"code"}e.downloadUrl=()=>e.preview?e.url:e.url+"&download=true",e.prepareFile=function(I){e.showSource=!1,e.allowScripts=!1,e.imageSize="",e.filePath=I,e.paths=I.split("/").filter(Boolean);let L=e.filePath.toLowerCase(),k=L.lastIndexOf(".");k>-1&&(L=L.substring(k+1));let q={javascript:"JavaScript",typescript:"TypeScript",tsx:"TSX",jsx:"JSX",python:"Python",java:"Java",c_cpp:"C/C++",csharp:"C#",golang:"Go",rust:"Rust",ruby:"Ruby",php:"PHP",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",yaml:"YAML",markdown:"Markdown",sh:"Shell",dockerfile:"Dockerfile",xml:"XML",sql:"SQL",kotlin:"Kotlin",swift:"Swift",scala:"Scala",r:"R",julia:"Julia",latex:"LaTeX",toml:"TOML",csv:"CSV",tsv:"TSV",text:""},G=j(L);e.languageName=q[G]??(G?G.charAt(0).toUpperCase()+G.slice(1):""),e.aceOption={readOnly:!0,useWrapMode:!0,showGutter:!0,theme:"chrome",useSoftTab:!0,tabSize:2,fontSize:window.matchMedia?.("(max-width: 767px)").matches?12:13,keyBinding:"vscode",fullLineSelection:!0,highlightActiveLine:!1,highlightGutterLine:!1,cursor:"hide",showInvisibles:!1,showIndentGuides:!1,showPrintMargin:!1,highlightSelectedWord:!1,enableBehaviours:!0,fadeFoldWidgets:!1,mode:j(L),onLoad:function(H){e.codeEditor=pn(H);{let Ne=H.session,qe=Ne.getTokens.bind(Ne),X=/\bXXXX-\d+\b/g;if(Ne.getTokens=function(pe){let ue=qe(pe);if(!ue.some(be=>be.value.indexOf("XXXX-")!==-1))return ue;let me=[];for(let be of ue){if(be.value.indexOf("XXXX-")===-1){me.push(be);continue}let Ve=0;X.lastIndex=0;let D;for(;D=X.exec(be.value);)D.index>Ve&&me.push({type:be.type,value:be.value.slice(Ve,D.index)}),me.push({type:"redacted.n"+D[0].slice(5),value:D[0]}),Ve=D.index+D[0].length;Ve<be.value.length&&me.push({type:be.type,value:be.value.slice(Ve)})}return me},!window.document.getElementById("redact-index-rules")){let pe=window.document.createElement("style");pe.id="redact-index-rules",pe.textContent=Array.from({length:99},(ue,me)=>`.ace_redacted.ace_n${me+1}::after{content:"${me+1}"}`).join(""),window.document.head.appendChild(pe)}H.renderer.updateFull(!0)}H.session.setUseWrapMode(e.wrapLines!==!1);let Y=H.container.closest?.(".file-card"),ee=()=>{if(!Y)return;let Ne=H.renderer,qe=(Ne.layerConfig?.width||0)-(Ne.$size?.scrollerWidth||0);Y.classList.toggle("at-right-edge",qe<=2||Ne.getScrollLeft()>=qe-2)};H.session.on("changeScrollLeft",ee),H.renderer.on("afterRender",ee),window.matchMedia?.("(max-width: 767px)").matches&&H.setOption("hScrollBarAlwaysVisible",!0);let x=ace.require("ace/range").Range,fe=null;function he(Ne,qe){fe!==null&&(H.session.removeMarker(fe),fe=null),Ne!=null&&(fe=H.session.addMarker(new x(Ne,0,qe,1),"highlighted-line","fullLine"))}function Be(Ne){let qe=!e.preview&&window.location.hash.match(/^#L(\d+)(?:-L(\d+))?/);if(!qe){he(null);return}let X=parseInt(qe[1])-1,pe=qe[2]?parseInt(qe[2])-1:X;he(X,pe),Ne&&i.timeout(()=>{H.scrollToLine(X,!0,!0,function(){})},100)}Be(!0);let He=null;H.on("guttermousedown",function(Ne){let qe=Ne.getDocumentPosition().row,X=Ne.domEvent&&Ne.domEvent.shiftKey,pe=qe,ue=qe;X&&He!==null?(pe=Math.min(He,qe),ue=Math.max(He,qe)):He=qe;let me=pe===ue?`#L${pe+1}`:`#L${pe+1}-L${ue+1}`,be=window.location.pathname+window.location.search+me;e.preview||window.history.replaceState(null,"",be),he(pe,ue),Ne.stop()});let Qe=o(window,"hashcha Line truncated
`);for(let y=0;y<h.length;y++){let m=h[y];if(m.startsWith("diff --git")){v(),c();continue}if(m.startsWith("--- ")){r&&r.lines.length&&v(),c().oldPath=m.replace(/^--- (a\/)?/,"").trim();continue}if(m.startsWith("+++ ")){c().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&&(d=parseInt(b[1],10),p=parseInt(b[2],10)),c().lines.push({kind:"hunk",oldNo:"",newNo:"",text:m});continue}r&&(m.startsWith("+")?(r.lines.push({kind:"add",oldNo:"",newNo:p,text:m.slice(1)}),p++):m.startsWith("-")?(r.lines.push({kind:"remove",oldNo:d,newNo:"",text:m.slice(1)}),d++):(r.lines.push({kind:"ctx",oldNo:d,newNo:p,text:m.startsWith(" ")?m.slice(1):m}),d++,p++))}}return s(o,r),o.join("")}})({trustAsHtml:e=>e});function wg(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function kg(e,t="EUR"){let s=Number(e)||0;return new Intl.NumberFormat(void 0,{style:"currency",currency:t,minimumFractionDigits:s%1?2:0,maximumFractionDigits:2}).format(s)}function Cg(e){return String(e??"").toUpperCase()}function Eg(e,t,s=0){return(e||[]).slice(s,s+t)}function Sg(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function Ng(e,t){if(!t)return e||[];let s=Array.isArray(t)?t:[t];return[...e||[]].sort((i,o)=>{for(let r of s){let d=r[0]==="-"?-1:1;r=r.replace(/^[+-]/,"");let p=r.split(".").reduce((v,h)=>v?.[h],i),c=r.split(".").reduce((v,h)=>v?.[h],o);if(typeof p=="string"&&(p=p.toLowerCase()),typeof c=="string"&&(c=c.toLowerCase()),p!==c)return(p==null?-1:c==null?1:p<c?-1:1)*d}return 0})}function Rg(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 Tg(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}function Ea(e){if(!e)return"";let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(e)),s=t?new Date(+t[1],+t[2]-1,+t[3]):new Date(e);if(isNaN(s))return"";let i=s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),o=new Date;o.setHours(0,0,0,0);let r=Math.round((s-o)/864e5),d;if(r===0)d="today";else if(r===1)d="tomorrow";else if(r===-1)d="yesterday";else{let p=Math.abs(r),c=Math.round(p/30.44),v=p<14?[p,"day"]:p<60?[Math.round(p/7),"week"]:c<18?[c,"month"]:[Math.round(p/365.25),"year"],h=v[0]+" "+v[1]+(v[0]===1?"":"s");d=r>0?"in "+h:h+" ago"}return i+" \xB7 "+d}function $n(e){if(e==null||e===""||isNaN(e))return"";e=Number(e);let t="\u202F";if(e<1e3)return+(e<10?e.toFixed(2):e<100?e.toFixed(1):Math.round(e))+t+"ms";let s=e/1e3;if(s<60)return+(s<10?s.toFixed(2):s.toFixed(1))+t+"s";let i=r=>String(r).padStart(2,"0"),o=Math.round(s);return o<3600?Math.floor(o/60)+"m "+i(o%60)+"s":Math.floor(o/3600)+"h "+i(Math.floor(o%3600/60))+"m"}function Sa(e){if(!e)return"";let t=new Date(e);if(isNaN(t))return"";let s={day:"numeric",month:"short"};return t.getFullYear()!==new Date().getFullYear()&&(s.year="numeric"),t.toLocaleDateString(void 0,s)}var er=e=>["preparing","download","downloading","downloaded","queue","anonymizing"].includes(e)?"preparing":e==="expiring"?"expired":e==="removing"?"removed":e;function tr(e,{flags:t,keys:s,count:i,onChange:o=()=>{}}){if(e.segView=()=>{let r=t()||{};if(s.every(p=>!!r[p]))return"all";let d=s.filter(p=>!!r[p]);return d.length===1?d[0]:"custom"},e.setSegView=r=>{let d=t();if(d){for(let p of s)d[p]=r==="all"?!0:p===r;o()}},e.segCount=r=>r==="all"?s.reduce((d,p)=>d+i(p),0):i(r),t()&&e.segView()==="custom")for(let r of s)t()[r]=!0}var ju=function(e,t,s){let i=bt(),o=Bt();Qu(i,o),e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),e.repositories=[],e.total=-1,e.totalPage=0,e.statusCounts=[],e.totalSize=0,e.selected={},e.allSelected=!1;let r=E=>{if(E.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){E.preventDefault();let N=document.querySelector('.admin-filter-toolbar input[type="search"]');N&&N.focus()}};o(document,"keydown",r),e.on("dispose",()=>document.removeEventListener("keydown",r)),e.clearFilter=E=>{E==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[E]="",e.query.page=1},e.chips=[];let d=()=>{let E=[];e.query.owner&&E.push({key:"owner",label:"Owner",value:e.query.owner}),e.query.conference&&E.push({key:"conference",label:"Conference",value:e.query.conference}),e.chips=E};e.showSta Line truncated
`+E.join(`
`)],{type:"text/csv"}),w=document.createElement("a");w.href=URL.createObjectURL(N),w.download=i.username+"-repositories.csv",w.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(S=>{b&&(b.document.open(),b.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(S.data,null,2).replace(/[<>]/g,E=>E==="<"?"&lt;":"&gt;")+"</pre>"),b.document.close())},S=>{let E=S&&S.data?JSON.stringify(S.data,null,2):String(S);b&&(b.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+E+"</pre>")})};function c(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),c(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 h(){t.get("/api/admin/tokens").then(m=>{e.tokens=m.data||[]},m=>{m.status!==401&&m.status!==403&&console.error(m)})}h(),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="",h()},m=>console.error(m))},e.revokeToken=m=>{confirm(`Revoke token "${m.name}"?`)&&t.delete("/api/admin/tokens/"+m.id).then(()=>h(),b=>console.error(b))},e.removeCache=m=>{confirm("Remove cached files for "+m.repoId+"?")&&t.delete("/api/admin/repos/"+m.repoId).then(()=>c(i.username),b=>console.error(b))},e.removeRepository=m=>{confirm("Remove repository "+m.repoId+"?")&&t.delete("/api/repo/"+m.repoId+"/").then(()=>c(i.username),b=>console.error(b))},e.updateRepository=m=>{let b=lt({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(S=>{S.data.status=="ready"?b.title=`${m.repoId} is refreshed.`:b.title=`Refreshing of ${m.repoId}.`},S=>{b.title=`Error during the refresh of ${m.repoId}.`,b.body=S.body})},e.getGitHubRepositories=m=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(b=>{e.userInfo.repositories=b.data})};let y=null;e.watch("query",()=>{o.timeout.cancel(y),y=o.timeout(()=>{c(i.username)},500)},!0)},Ku=function(e,t,s){let i=bt(),o=Bt();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=S=>{if(S.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){S.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=S=>{S==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[S]="",e.query.page=1},e.chips=[];let d=()=>{let S=[];(e.query.dateFrom||e.query.dateTo)&&S.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=S};e.statusCountFor=S=>{let E=(e.statusCounts||[]).find(N=>N._id===S);return E?E.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=S=>{e.query.sort===S?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=S,e.query.direction="desc"),e.query.page=1},e.sortIcon=S=>e.query.sort===S?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let p="admin.conferences.filterPrefs",c={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!0,expired:!0,removed:!0,error:!0,preparing:!0},v=loadFilterPrefs(p)||{};e.query=Object.assign({},c,v,{page:1,search:""});let h=s.search();h.search&&(e.query.search=h.search);let y="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(y)||"[]"),e.savePreset=()=>{let S=window.prompt("Preset name:");if(!S)return;let E=Object.assign({},e.query);delete E.page,e.presets=(e.presets||[]).filter(N=>N.name!==S),e.presets.push({name:S,query:E}),localStorage.setItem(y,JSON.stringify(e.presets))},e.applyPreset=S=>{Object.assign(e.query,S.query,{page:1})},e.deletePreset=S=>{e.presets=(e.presets||[]).filter(E=>E.name!==S.name),localStorage.setItem(y,JS Line truncated
`).map((Qe,Se)=>Se===0?Qe:He+Qe).join(`
`&&Y++,q.push(G),k.push(q),q=[],G=""):G+=ee}return(G!==""||q.length)&&(q.push(G),k.push(q)),k.filter(Y=>Y.length>1||Y[0]!=="")};e.isCsv=()=>typeof e.content=="string"&&e.type!=="html"&&/\.(csv|tsv)$/i.test(e.filePath||"")&&e.content.length<=1024*1024,e.csvRows=()=>{if(M.content!==e.content){let I=/\.tsv$/i.test(e.filePath||"")?" ":",";M={content:e.content,rows:F(e.content,I)}}return M.rows},e.csvNumCol=I=>{let L=e.csvRows().slice(1).map(k=>k[I]).filter(k=>k!=null&&String(k).trim()!=="");return L.length>0&&L.every(k=>e.csvNumeric(k))},e.csvNumeric=I=>/^\s*[-+]?(\d[\d,]*)?(\.\d+)?(e[-+]?\d+)?%?\s*$/i.test(I)&&/\d/.test(I),e.redactParts=function(I){let L=[],k=0,q,G=/\bXXXX-(\d+)\b/g;for(I=String(I||"");q=G.exec(I);)q.index>k&&L.push({t:I.slice(k,q.index)}),L.push({n:q[1]}),k=q.index+q[0].length;return k<I.length&&L.push({t:I.slice(k)}),L},e.pathCopied=!1,e.copyPath=async function(){window.navigator.clipboard?.writeText&&(await window.navigator.clipboard.writeText(e.filePath||""),e.pathCopied=!0,setTimeout(()=>{e.pathCopied=!1},1600))},e.contentCopied=!1,e.copyContent=async function(){if(typeof e.content!="string"||!window.navigator.clipboard?.writeText)return;let I=e.content;if(e.type==="html"&&e.url)if(e.preview)I=e.sourceContent;else try{I=await(await window.fetch(e.url,{credentials:"same-origin"})).text()}catch{return}await window.navigator.clipboard.writeText(I),e.contentCopied=!0,setTimeout(()=>{e.contentCopied=!1},1600)};function j(I){return r[I]?r[I]:I}function oe(I){return I=="pdf"?"pdf":I=="html"||I=="htm"?"html-doc":["md","markdown","mdown","mkdn","mdx"].includes(I)?"md":I=="org"?"org":I=="ipynb"?"IPython":u.indexOf(I)>-1?"text":p.indexOf(I)>-1?"image":v.indexOf(I)>-1?"media":c.indexOf(I)>-1?"audio":"code"}e.downloadUrl=()=>e.preview?e.url:e.url+"&download=true",e.prepareFile=function(I){e.showSource=!1,e.allowScripts=!1,e.imageSize="",e.filePath=I,e.paths=I.split("/").filter(Boolean);let L=e.filePath.toLowerCase(),k=L.lastIndexOf(".");k>-1&&(L=L.substring(k+1));let q={javascript:"JavaScript",typescript:"TypeScript",tsx:"TSX",jsx:"JSX",python:"Python",java:"Java",c_cpp:"C/C++",csharp:"C#",golang:"Go",rust:"Rust",ruby:"Ruby",php:"PHP",html:"HTML",css:"CSS",scss:"SCSS",json:"JSON",yaml:"YAML",markdown:"Markdown",sh:"Shell",dockerfile:"Dockerfile",xml:"XML",sql:"SQL",kotlin:"Kotlin",swift:"Swift",scala:"Scala",r:"R",julia:"Julia",latex:"LaTeX",toml:"TOML",csv:"CSV",tsv:"TSV",text:""},G=j(L);e.languageName=q[G]??(G?G.charAt(0).toUpperCase()+G.slice(1):""),e.aceOption={readOnly:!0,useWrapMode:!0,showGutter:!0,theme:"chrome",useSoftTab:!0,tabSize:2,fontSize:window.matchMedia?.("(max-width: 767px)").matches?12:13,keyBinding:"vscode",fullLineSelection:!0,highlightActiveLine:!1,highlightGutterLine:!1,cursor:"hide",showInvisibles:!1,showIndentGuides:!1,showPrintMargin:!1,highlightSelectedWord:!1,enableBehaviours:!0,fadeFoldWidgets:!1,mode:j(L),onLoad:function(H){e.codeEditor=pn(H);{let Ne=H.session,qe=Ne.getTokens.bind(Ne),X=/\bXXXX-\d+\b/g;if(Ne.getTokens=function(pe){let ue=qe(pe);if(!ue.some(be=>be.value.indexOf("XXXX-")!==-1))return ue;let me=[];for(let be of ue){if(be.value.indexOf("XXXX-")===-1){me.push(be);continue}let Ve=0;X.lastIndex=0;let D;for(;D=X.exec(be.value);)D.index>Ve&&me.push({type:be.type,value:be.value.slice(Ve,D.index)}),me.push({type:"redacted.n"+D[0].slice(5),value:D[0]}),Ve=D.index+D[0].length;Ve<be.value.length&&me.push({type:be.type,value:be.value.slice(Ve)})}return me},!window.document.getElementById("redact-index-rules")){let pe=window.document.createElement("style");pe.id="redact-index-rules",pe.textContent=Array.from({length:99},(ue,me)=>`.ace_redacted.ace_n${me+1}::after{content:"${me+1}"}`).join(""),window.document.head.appendChild(pe)}H.renderer.updateFull(!0)}H.session.setUseWrapMode(e.wrapLines!==!1);let Y=H.container.closest?.(".file-card"),ee=()=>{if(!Y)return;let Ne=H.renderer,qe=(Ne.layerConfig?.width||0)-(Ne.$size?.scrollerWidth||0);Y.classList.toggle("at-right-edge",qe<=2||Ne.getScrollLeft()>=qe-2)};H.session.on("changeScrollLeft",ee),H.renderer.on("afterRender",ee),window.matchMedia?.("(max-width: 767px)").matches&&H.setOption("hScrollBarAlwaysVisible",!0);let x=ace.require("ace/range").Range,fe=null;function he(Ne,qe){fe!==null&&(H.session.removeMarker(fe),fe=null),Ne!=null&&(fe=H.session.addMarker(new x(Ne,0,qe,1),"highlighted-line","fullLine"))}function Be(Ne){let qe=!e.preview&&window.location.hash.match(/^#L(\d+)(?:-L(\d+))?/);if(!qe){he(null);return}let X=parseInt(qe[1])-1,pe=qe[2]?parseInt(qe[2])-1:X;he(X,pe),Ne&&i.timeout(()=>{H.scrollToLine(X,!0,!0,function(){})},100)}Be(!0);let He=null;H.on("guttermousedown",function(Ne){let qe=Ne.getDocumentPosition().row,X=Ne.domEvent&&Ne.domEvent.shiftKey,pe=qe,ue=qe;X&&He!==null?(pe=Math.min(He,qe),ue=Math.max(He,qe)):He=qe;let me=pe===ue?`#L${pe+1}`:`#L${pe+1}-L${ue+1}`,be=window.location.pathname+window.location.search+me;e.preview||window.history.replaceState(null,"",be),he(pe,ue),Ne.stop()});let Qe=o(window,"hashcha Line truncated
`);for(let y=0;y<g.length;y++){let m=g[y];if(m.startsWith("diff --git")){v(),c();continue}if(m.startsWith("--- ")){r&&r.lines.length&&v(),c().oldPath=m.replace(/^--- (a\/)?/,"").trim();continue}if(m.startsWith("+++ ")){c().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&&(u=parseInt(b[1],10),p=parseInt(b[2],10)),c().lines.push({kind:"hunk",oldNo:"",newNo:"",text:m});continue}r&&(m.startsWith("+")?(r.lines.push({kind:"add",oldNo:"",newNo:p,text:m.slice(1)}),p++):m.startsWith("-")?(r.lines.push({kind:"remove",oldNo:u,newNo:"",text:m.slice(1)}),u++):(r.lines.push({kind:"ctx",oldNo:u,newNo:p,text:m.startsWith(" ")?m.slice(1):m}),u++,p++))}}return s(o,r),o.join("")}})({trustAsHtml:e=>e});function wg(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function kg(e,t="EUR"){let s=Number(e)||0;return new Intl.NumberFormat(void 0,{style:"currency",currency:t,minimumFractionDigits:s%1?2:0,maximumFractionDigits:2}).format(s)}function Cg(e){return String(e??"").toUpperCase()}function Sg(e,t,s=0){return(e||[]).slice(s,s+t)}function Eg(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function Ng(e,t){if(!t)return e||[];let s=Array.isArray(t)?t:[t];return[...e||[]].sort((i,o)=>{for(let r of s){let u=r[0]==="-"?-1:1;r=r.replace(/^[+-]/,"");let p=r.split(".").reduce((v,g)=>v?.[g],i),c=r.split(".").reduce((v,g)=>v?.[g],o);if(typeof p=="string"&&(p=p.toLowerCase()),typeof c=="string"&&(c=c.toLowerCase()),p!==c)return(p==null?-1:c==null?1:p<c?-1:1)*u}return 0})}function Rg(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 Tg(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}function Sa(e){if(!e)return"";let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(e)),s=t?new Date(+t[1],+t[2]-1,+t[3]):new Date(e);if(isNaN(s))return"";let i=s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),o=new Date;o.setHours(0,0,0,0);let r=Math.round((s-o)/864e5),u;if(r===0)u="today";else if(r===1)u="tomorrow";else if(r===-1)u="yesterday";else{let p=Math.abs(r),c=Math.round(p/30.44),v=p<14?[p,"day"]:p<60?[Math.round(p/7),"week"]:c<18?[c,"month"]:[Math.round(p/365.25),"year"],g=v[0]+" "+v[1]+(v[0]===1?"":"s");u=r>0?"in "+g:g+" ago"}return i+" \xB7 "+u}function $n(e){if(e==null||e===""||isNaN(e))return"";e=Number(e);let t="\u202F";if(e<1e3)return+(e<10?e.toFixed(2):e<100?e.toFixed(1):Math.round(e))+t+"ms";let s=e/1e3;if(s<60)return+(s<10?s.toFixed(2):s.toFixed(1))+t+"s";let i=r=>String(r).padStart(2,"0"),o=Math.round(s);return o<3600?Math.floor(o/60)+"m "+i(o%60)+"s":Math.floor(o/3600)+"h "+i(Math.floor(o%3600/60))+"m"}function Ea(e){if(!e)return"";let t=new Date(e);if(isNaN(t))return"";let s={day:"numeric",month:"short"};return t.getFullYear()!==new Date().getFullYear()&&(s.year="numeric"),t.toLocaleDateString(void 0,s)}var er=e=>["preparing","download","downloading","downloaded","queue","anonymizing"].includes(e)?"preparing":e==="expiring"?"expired":e==="removing"?"removed":e;function tr(e,{flags:t,keys:s,count:i,onChange:o=()=>{}}){if(e.segView=()=>{let r=t()||{};if(s.every(p=>!!r[p]))return"all";let u=s.filter(p=>!!r[p]);return u.length===1?u[0]:"custom"},e.setSegView=r=>{let u=t();if(u){for(let p of s)u[p]=r==="all"?!0:p===r;o()}},e.segCount=r=>r==="all"?s.reduce((u,p)=>u+i(p),0):i(r),t()&&e.segView()==="custom")for(let r of s)t()[r]=!0}var ju=function(e,t,s){let i=bt(),o=Bt();Qu(i,o),e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),e.repositories=[],e.total=-1,e.totalPage=0,e.statusCounts=[],e.totalSize=0,e.selected={},e.allSelected=!1;let r=S=>{if(S.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){S.preventDefault();let N=document.querySelector('.admin-filter-toolbar input[type="search"]');N&&N.focus()}};o(document,"keydown",r),e.on("dispose",()=>document.removeEventListener("keydown",r)),e.clearFilter=S=>{S==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[S]="",e.query.page=1},e.chips=[];let u=()=>{let S=[];e.query.owner&&S.push({key:"owner",label:"Owner",value:e.query.owner}),e.query.conference&&S.push({key:"conference",label:"Conference",value:e.query.conference}),e.chips=S};e.showSta Line truncated
`+S.join(`
`)],{type:"text/csv"}),w=document.createElement("a");w.href=URL.createObjectURL(N),w.download=i.username+"-repositories.csv",w.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(E=>{b&&(b.document.open(),b.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(E.data,null,2).replace(/[<>]/g,S=>S==="<"?"&lt;":"&gt;")+"</pre>"),b.document.close())},E=>{let S=E&&E.data?JSON.stringify(E.data,null,2):String(E);b&&(b.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+S+"</pre>")})};function c(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),c(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(()=>c(i.username),b=>console.error(b))},e.removeRepository=m=>{confirm("Remove repository "+m.repoId+"?")&&t.delete("/api/repo/"+m.repoId+"/").then(()=>c(i.username),b=>console.error(b))},e.updateRepository=m=>{let b=lt({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(E=>{E.data.status=="ready"?b.title=`${m.repoId} is refreshed.`:b.title=`Refreshing of ${m.repoId}.`},E=>{b.title=`Error during the refresh of ${m.repoId}.`,b.body=E.body})},e.getGitHubRepositories=m=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(b=>{e.userInfo.repositories=b.data})};let y=null;e.watch("query",()=>{o.timeout.cancel(y),y=o.timeout(()=>{c(i.username)},500)},!0)},Ku=function(e,t,s){let i=bt(),o=Bt();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=E=>{if(E.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){E.preventDefault();let S=document.querySelector('.admin-filter-toolbar input[type="search"]');S&&S.focus()}};o(document,"keydown",r),e.on("dispose",()=>document.removeEventListener("keydown",r)),e.clearFilter=E=>{E==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[E]="",e.query.page=1},e.chips=[];let u=()=>{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 S=(e.statusCounts||[]).find(N=>N._id===E);return S?S.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 p="admin.conferences.filterPrefs",c={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!0,expired:!0,removed:!0,error:!0,preparing:!0},v=loadFilterPrefs(p)||{};e.query=Object.assign({},c,v,{page:1,search:""});let g=s.search();g.search&&(e.query.search=g.search);let y="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(y)||"[]"),e.savePreset=()=>{let E=window.prompt("Preset name:");if(!E)return;let S=Object.assign({},e.query);delete S.page,e.presets=(e.presets||[]).filter(N=>N.name!==E),e.presets.push({name:E,query:S}),localStorage.setItem(y,JSON.stringify(e.presets))},e.applyPreset=E=>{Object.assign(e.query,E.query,{page:1})},e.deletePreset=E=>{e.presets=(e.presets||[]).filter(S=>S.name!==E.name),localStorage.setItem(y,JS Line truncated
`):typeof z.stack=="string"?z.stack:null;for(var I=[z.cause,z.err].filter(Boolean),L=0;!q&&L<I.length;L++)for(var k=I[L];!q&&k&&typeof k=="object";)typeof k.stack=="string"&&(q=k.stack),k=k.cause;_._stack=q}else _.displayMessage=_.message,_._status=null,_._url=null,_._stack=null;return _._bucket=m(z,_.level),_._detailJson=E(_,z),_}function E(_,z){let I=[],L=(H,Y)=>{Y==null||Y===""||I.push([H,Y])};for(let H of["service","event","severity","requestId","jobId"])L(H,z&&z[H]);L("name",z&&z.name),L("code",_.displayMessage||z&&z.message),_._bucket&&L("kind",_._bucket),L("httpStatus",z&&z.httpStatus),z&&z.status&&!z.httpStatus&&L("status",z.status),L("module",_.module);let k=z&&z.detail;if(typeof k=="string"){let H=k.trim();if(H[0]==="{"||H[0]==="[")try{k=JSON.parse(k)}catch{}}if(L("detail",k),L("repoId",z&&z.repoId),L("filePath",z&&z.filePath),L("upstreamStatus",z&&z.upstreamStatus),L("upstreamBody",z&&z.upstreamBody),L("url",_._url),L("err",z&&z.err),L("cause",z&&!z.err&&z.cause),L("ts",_.ts),!I.length)return JSON.stringify(_,null,2);let q=I.reduce((H,Y)=>Math.max(H,Y[0].length),0),G=["{"];return I.forEach(([H,Y],ee)=>{let fe=` ${`"${H}":`.padEnd(q+3," ")} `,he=ee<I.length-1?",":"",Be;if(Y&&typeof Y=="object"){let He=" ".repeat(fe.length);Be=JSON.stringify(Y,null,2).split(`
`).map((Qe,Ee)=>Ee===0?Qe:He+Qe).join(`
`)}else typeof Y=="number"||typeof Y=="boolean"?Be=String(Y):Be=JSON.stringify(Y);G.push(`${fe}${Be}${he}`)}),G.push("}"),G.join(`
`)}function E(_){let z=[],I="",L=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,k=0,q;for(;q=L.exec(_);)I+=_.slice(k,q.index),k=L.lastIndex,z.push({key:q[1],op:q[2]||"=",val:q[3]});return I+=_.slice(k),{filters:z,free:I.trim().toLowerCase()}}function N(_,z){for(let I of z.filters){let L=(q,G,H)=>{let Y=parseFloat(q),ee=parseFloat(G);return H==="="?String(q)===String(G):H==="!="?String(q)!==String(G):H===">="?Y>=ee:H==="<="?Y<=ee:H===">"?Y>ee:H==="<"?Y<ee:!0},k;if(I.key==="code")k=_.displayMessage;else if(I.key==="module")k=_.module;else if(I.key==="status")k=_._status;else if(I.key==="url")k=_._url;else if(I.key==="repo")k=_._repoId;else if(I.key==="level")k=_.level;else continue;if(k==null||!L(k,I.val,I.op))return!1}return!(z.free&&((_.displayMessage||"")+" "+(_.module||"")+" "+(_._url||"")+" "+JSON.stringify(_.raw||[])).toLowerCase().indexOf(z.free)===-1)}function w(){let _=E(e.query.search||"");e.parsedFilterCount=_.filters.length;let z=e.query.bucket,I=e.entries.filter(H=>z&&H._bucket!==z?!1:N(H,_)),L=e.query.group;if(L){let H=x=>JSON.stringify(L==="module"?[x.module,x._bucket]:[x.raw?.[0]?.service||"unknown",x.module,x.displayMessage||x.message||"_",x._bucket,x._status]),Y=new Map;for(let x of I){let fe=H(x);if(Y.has(fe)){let he=Y.get(fe);he.count++,he._related.push(x),new Date(x.ts)>new Date(he.ts)&&(he.ts=x.ts,he._url=x._url,he._status=x._status),new Date(x.ts)<new Date(he._firstSeen)&&(he._firstSeen=x.ts)}else{let he=Object.assign({},x);he._key=`${L}:${fe}`,he._related=[x],he._firstSeen=x.ts,he._lastHourCount=0,he.count=1,Y.set(fe,he)}}let ee=Date.now()-3600*1e3;for(let x of Y.values())x._lastHourCount=x._related.filter(fe=>new Date(fe.ts).getTime()>=ee).length;I=Array.from(Y.values())}else I=I.map((H,Y)=>(H._key="row:"+Y+":"+H.ts,H._related=[H],H._firstSeen=H.ts,H._lastHourCount=0,H.count=1,H));let k=H=>({error:0,warn:1,info:2})[H._bucket]??1;e.query.sort==="count"?I.sort((H,Y)=>k(H)-k(Y)||Y.count-H.count||new Date(Y.ts)-new Date(H.ts)):I.sort((H,Y)=>k(H)-k(Y)||new Date(Y.ts)-new Date(H.ts)),e.visible=I;let q=!!(e.query.bucket||(e.query.search||"").trim()),G=!q&&(e.stats?.severity?.error||0)>0&&!I.some(H=>H._bucket==="error")&&e.entries.length<1500;(q&&!I.length||G)&&e.canLoadMore?.()&&!e._autoLoading&&e.entries.length<2500&&(e._autoLoading=!0,T(!0))}function T(_){if(_&&e.redisLoading)return;let z=++o;e.redisLoading=!0;let I=_?e.redisNextOffset||e.entries.length:0,L=_?e.pageSize:Math.max(e.pageSize,e.redisNextOffset||e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:I,limit:L}}).then(k=>{if(p||z!==o)return;e.redisLoading=!1;let q=(k.data.entries||[]).map(b);e.entries=_?e.entries.concat(q):q,e.redisRedacted=(_&&e.redisRedacted||0)+(k.data.redactedEntries||0),e.redisNextOffset=k.data.nextOffset??I+(k.data.entries||[]).length,e.available=!!k.data.available,e.redisCollecting=k.data.redisCollecting!==!1,e.cap=k.data.max||e.cap,e.total=k.data.total||e.entries.length,e._autoLoading=!1,w()},()=>{p||z!==o||(e.redisLoading=!1,e._autoLoading=!1,e.available=!1)})}e.loadMore=()=>T(!0),e.canLoadMore=()=>(e.redisNextOffset||e.entries.length)<e.total;function M(_=!1){if(_&&d)return;let z=++r;d=!0,t.get("/api/admin/errors/stats").then(I=>{if(p||z!==r)return;d=!1;let L=I.data||{};e.redisStatsState=L.available===!1?"unavailable":"ready";let k=L.prev24h?Math.round((L.last24h-L.prev24h)/L.prev24h*100):0;e.stats={last24h:L.last24h||0,prev24h:L.prev24h||0,delta:k,severity:L.severity||{error:0,warn:0,info:0},unique:L.unique||{error:0,warn:0,info:0},buckets:L.buckets||[],dropped:L.dropped||0},w()},()=>{!p&&z===r&&(d=!1,e.redisStatsState="unavailable")})}function F(_=!1){(!_||!e.redisLoading)&&T(),M(_)}e.barPx=(_,z)=>{let I=e.stats.buckets||[],L=0,k=0;for(let Y of I)L=Math.max(L,(Y.error||0)+(Y.warn||0)),k=Math.max(k,Y.info||0);let q=_[z]||0;if(!q)return 0;if(z==="info")return k?Math.max(2,Math.round(q/k*(L?16:60))):0;let G=(_.error||0)+(_.warn||0),H=Math.round(G/L*44);return Math.max(4,Math.round(q/G*H))},e.bucketTitle=_=>`${new Date(_.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${_.error||0} err \xB7 ${_.warn||0} warn \xB7 ${_.info||0} info`,e.toggle=async(_,z)=>{v=z||document.activeElement,h=e.captureErrorScroll(v),e.historySelected=_,e.historyView="overview",e.expanded={[_._key]:!0},await We(),document.getElementById("history-inspector-title")?.focus({preventScroll:!0}),document.getElementById("history-inspector-title")?.scrollIntoView?.({block:"nearest"})},e.showHistoryTimeline=_=>{if(e.historyView="timeline",e.traceSelection)return;let z=["requestId","jobId"].find(I=>e.logTraceId(e.historySelected,I));z&&e.lookupTrace(z,e.logTraceId(e.historySelected,z),_,e.historySelected)},e.closeHistory=async()=>{let _=e.historySelected?._key;e.historySelected=null,e.expanded={},e.traceSelection&&await e.closeTrace(),await We(),(v?.isConnected?v:[...document.querySelectorAll("[data-history-key]")].find(I=>I.dataset.historyKey===_))?.focus({preventScroll:!0}),e.restoreErrorScroll(h)},e.setBucket=_ Line truncated
`)],{type:"text/csv;charset=utf-8"}),L=URL.createObjectURL(I),k=document.createElement("a");k.href=L,k.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(L)};function j(_){e.copyHint=`${_} copied`,c.timeout(()=>{e.copyHint=""},1500)}e.copyJson=_=>{navigator.clipboard.writeText(_._rawJson).then(()=>j("JSON"))},e.copyCurl=_=>{if(!_._url)return;let I=`curl -X ${_._method||"GET"} '${window.location.origin}${_._url}'`;navigator.clipboard.writeText(I).then(()=>j("curl"))},F();let oe=i(()=>{e.query.autoRefresh&&F(!0)},15e3);e.on("dispose",()=>{p=!0,o++,r++,i.cancel(oe)}),e.watch("query.search",w),e.watch("query.bucket",w),e.watch("query.sort",w),e.watch("query.group",w)},Xu=function(e,t,s,i){if(e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null){s.url("/");return}e.data=null,e.loading=!0,e.error=null,e.performance=null,e.performanceMinutes=15,e.performanceTab="routes",e.cacheReport=null,e.cacheError=null,e.cacheMinutes=60,e.cacheTraffic="all",e.ovView=["performance","cache"].includes((window.location.hash||"").slice(1))?window.location.hash.slice(1):"summary",e.setOvView=function(w){e.ovView=w;try{window.history.replaceState(null,"",w==="summary"?window.location.pathname:"#"+w)}catch{}};var o=!1;e.loadCache=function(){if(!o){o=!0;var w=e.cacheMinutes;t.get("/api/admin/cache",{params:{minutes:w}}).then(function(T){w===e.cacheMinutes&&(e.cacheReport=T.data,e.cacheError=T.data.available?null:T.data.reason||"Cache monitoring is unavailable.")},function(){e.cacheError="Could not refresh cache monitoring. Displayed values may be stale."}).finally(function(){o=!1,w!==e.cacheMinutes&&e.loadCache()})}},e.cacheRows=function(){return(e.cacheReport?.rows||[]).filter(function(w){return e.cacheTraffic==="all"||w.traffic===e.cacheTraffic})},e.cacheRate=function(w,T){var M=e.cacheRows(),F=function(_){return M.filter(function(z){return z.name===_}).reduce(function(z,I){return z+I[T]},0)},j=F(w+"_hit"),oe=F(w+"_miss");return j+oe?(100*j/(j+oe)).toFixed(1)+"%":"No samples"},e.cacheEventName=function(w){return w.replaceAll("_"," ")},e.cacheP95=function(w){var T=0,M=e.cacheReport?.latencyBucketsMs||[];if(!w.count)return"No samples";if(!w.ms)return"Not timed";for(var F=0;F<=M.length;F++)if(T+=w["b"+F]||0,T>=Math.ceil(w.count*.95))return F<M.length?"\u2264 "+$n(M[F]):"> 10\u202Fs";return"No samples"},e.healthAlert=function(){let w=e.data&&e.data.system||{},T=[["Memory",w.memPercent],["Disk",w.diskPercent]].filter(([,F])=>F>90);return T.length?T.map(([F,j])=>F+" is at "+j+"%").join(" and ")+". New anonymizations may fail until "+(T.length>1?"they drop.":"it drops."):""},e.performanceError=null,e.formatMs=function(w){return w==null?"":$n(w)},e.latencyBound=function(w,T){return w.count?w[T]==null?"> 60\u202Fs":"\u2264 "+e.formatMs(w[T]):"No samples"},e.firstByteBound=function(w){return e.latencyBound({count:w.firstByteCount,p95UpperMs:w.firstByteP95UpperMs},"p95UpperMs")},e.sampleAge=function(w){return Math.max(0,Math.round((Date.now()-w.sampledAt)/1e3))},e.peakRss=function(w){return(e.performance.runtimeSeries||[]).filter(function(T){return T.instance===w.instance}).reduce(function(T,M){return Math.max(T,M.rss)},w.memory.rss)},e.performanceWarning=function(w){return e.sampleAge(w)>45||w.droppedBatches||w.droppedMetrics||w.sockets?.closeWait>0||w.eventLoop?.p95Ms>100||w.memoryLimitBytes&&w.memory.rss>w.memoryLimitBytes*.8};var r=!1;e.loadPerformance=function(){var w=e.performanceMinutes;e.performance?.windowMinutes&&e.performance.windowMinutes!==w&&(e.performance=null),!r&&(r=!0,t.get("/api/admin/performance",{params:{minutes:w}}).then(function(T){w===e.performanceMinutes&&(e.performance=T.data,e.performanceError=T.data.available?null:"Performance monitoring is unavailable. Request history may be incomplete.")},function(){w===e.performanceMinutes&&(e.performanceError="Could not refresh performance monitoring. Displayed samples may be stale.")}).finally(function(){r=!1,w!==e.performanceMinutes&&e.loadPerformance()}))};function d(w){if(w==null)return"\u2014";for(var T=["B","KB","MB","GB","TB"],M=0,F=w;F>=1024&&M<T.length-1;)F/=1024,M++;return F.toFixed(M>0?1:0).replace(/\.0$/,"")+" "+T[M]}e.humanBytes=d;function p(w){if(!w)return"\u2014";var T=Math.floor(w/86400),M=Math.floor(w%86400/3600),F=Math.floor(w%3600/60);return T>0?T+"d "+(M<10?"0":"")+M+"h":M>0?M+"h "+(F<10?"0":"")+F+"m":F+"m"}e.humanDuration=p;function c(w){return w==null?"\u2014":w>=1e6?(w/1e6).toFixed(1)+"M":w>=1e3?(w/1e3).toFixed(1)+"K":String(w)}e.humanNum=c,e.queueTotal=function(w){return w?(w.waiting||0)+(w.active||0)+(w.delayed||0)+(w.failed||0):0},e.statusCount=function(w){if(!e.data||!e.data.repos)return 0;for(var T=e.data.repos.statusBreakdown||[],M=0;M<T.length;M++)if(T[M]._id===w)return T[M].count;return 0},e.barPct=function(w){var T=e.data&&e.data.repos?e.data.repos.total:0;if(!T)return 0;var M=[w];w==="expired"&&M.push("expiring"),w==="remov Line truncated
`)},Ma=class{constructor(t){nt(this,"gen");nt(this,"threads",[]);nt(this,"match",!1);nt(this,"runs",[]);nt(this,"ids",[]);this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},mc=(e,t)=>e.ids.length!==t.ids.length||e.runs.length!==t.runs.length||e.ids.some((s,i)=>s!==t.ids[i])?!1:e.runs.every(s=>t.runs.some(i=>i.neg===s.neg&&mc(i.state,s.state))),ac=e=>({has:new Float64Array(e),seen:new Float64Array(e),gen:0}),po,Hn,Va,qa,Bs=class{constructor(t,s,i){_e(this,Hn);nt(this,"dots");nt(this,"dotStart");_e(this,po);this.dots=t,this.dotStart=s,ze(this,po,i)}state(){return new Ma(++re(this,po).gen)}done(t){return t.ids=t.threads.map(s=>s.id).sort((s,i)=>s-i),t.match&&t.ids.unshift(Oa.id),t}restricted(t,s){return s&&(this.dots||this.dotStart&&t===0)}add(t,s,i,o){switch(s.t){case"split":if(!Fe(this,Hn,Va).call(this,t,s))return;for(let d of s.out)this.add(t,d,i,o);return;case"neg":if(!Fe(this,Hn,Va).call(this,t,s))return;let r=this.state();return this.add(r,s.sub,i,!1),this.done(r),this.addRun(t,{t:"run",neg:s,state:r},i,o);case"star":if(this.restricted(i,o))return;Fe(this,Hn,qa).call(this,t,s)&&this.add(t,s.next,i,o);return;case"match":t.match=!0;return;default:Fe(this,Hn,qa).call(this,t,s)}}addRun(t,s,i,o){for(let r of t.runs)if(r.neg===s.neg&&mc(r.state,s.state))return;t.runs.push(s),s.state.match||this.add(t,s.neg.next,i,o)}step(t,s,i,o){let r=this.state();for(let d of t.threads)switch(d.t){case"lit":_a(d,s)&&this.add(r,d.next,i+1,o);break;case"any":this.restricted(i,o)||this.add(r,d.next,i+1,o);break;case"class":!this.restricted(i,o)&&d.re.test(s)&&this.add(r,d.next,i+1,o);break;case"star":this.restricted(i,o)||this.add(r,d,i+1,o)}if(!this.restricted(i,o))for(let d of t.runs){if(d.state.dead){this.addRun(r,d,i+1,o);continue}let p=this.step(d.state,s,i,!1);this.addRun(r,{t:"run",neg:d.neg,state:p},i+1,o)}return this.done(r)}};po=new WeakMap,Hn=new WeakSet,Va=function(t,s){let{seen:i}=re(this,po);return i[s.id]===t.gen?!1:(i[s.id]=t.gen,!0)},qa=function(t,s){let{has:i}=re(this,po);return i[s.id]===t.gen?!1:(i[s.id]=t.gen,t.threads.push(s),!0)};var hc=e=>{let t=e.ids.join();if(!e.runs.length)return t;let s=e.runs.map(i=>`${i.neg.id}(${hc(i.state)})`);return`${t}|${s.sort().join("|")}`},lv=1<<18,zo,Ho,_n,fo,Fn,Un,Bn,on,$a,sr,gc,La=class{constructor(t,s){_e(this,on);_e(this,zo);_e(this,Ho,new Map);_e(this,_n,0);_e(this,fo);_e(this,Fn);_e(this,Un);_e(this,Bn);ze(this,zo,t),ze(this,Un,new Bs(!1,!1,s)),ze(this,Bn,new Bs(!1,!0,s))}start(t){if(t){if(re(this,Fn))return re(this,Fn);let i=re(this,Bn).state();return re(this,Bn).add(i,re(this,zo),0,!0),ze(this,Fn,Fe(this,on,$a).call(this,re(this,Bn).done(i)))}if(re(this,fo))return re(this,fo);let s=re(this,Un).state();return re(this,Un).add(s,re(this,zo),0,!0),ze(this,fo,Fe(this,on,sr).call(this,re(this,Un).done(s)))}next(t,s){let i=s.charCodeAt(0),o=i<128?void 0:t.next.get(s);if(o)return o;let r=t===re(this,Fn)?Fe(this,on,sr).call(this,re(this,Bn).step(t.state,s,0,!0)):Fe(this,on,sr).call(this,re(this,Un).step(t.state,s,1,!0));return i<128?(t.ascii||(t.ascii=new Array(128),ze(this,_n,re(this,_n)+128)),t.ascii[i]=r):t.next.set(s,r),al(this,_n)._++,r}};zo=new WeakMap,Ho=new WeakMap,_n=new WeakMap,fo=new WeakMap,Fn=new WeakMap,Un=new WeakMap,Bn=new WeakMap,on=new WeakSet,$a=function(t){return{state:t,match:t.match,dead:t.dead,next:new Map}},sr=function(t){let s=hc(t),i=re(this,Ho).get(s);if(i)return i;re(this,_n)>lv&&Fe(this,on,gc).call(this);let o=Fe(this,on,$a).call(this,t);return re(this,Ho).set(s,o),ze(this,_n,re(this,_n)+(s.length+1)),o},gc=function(){re(this,Ho).clear(),ze(this,_n,0),ze(this,fo,void 0),ze(this,Fn,void 0)};var dv=e=>{let t=[];for(let s=e;s.t!=="match";s=s.next){if(s.t==="split"||s.t==="neg")return;t.push(s)}return t},uv=(e,t,s,i)=>{let o=0,r=s,d=-1,p=0;for(;r<i;){let c=e[o];if(c?.t==="star"){d=o++,p=r;continue}let v=t[r];if(c&&(c.t==="any"||c.t==="lit"&&_a(c,v)||c.t==="class"&&c.re.test(v))){o++,r++;continue}if(d===-1)return!1;o=d+1,r=++p}for(;e[o]?.t==="star";)o++;return o===e.length},vc=e=>{let t=0,s=0;for(let i of e){let[o,r]=cv(i);t+=o,s+=r}return[t,s]},cv=e=>{if(e.t==="star")return[0,1/0];if(e.t!=="ext")return[1,1];if(e.type==="!")return[0,1/0];let t=e.alts.map(vc),s=Math.min(...t.map(r=>r[0])),i=Math.max(...t.map(r=>r[1])),o=i===0?0:1/0;return e.type==="@"?[s,i]:e.type==="?"?[0,i]:e.type==="*"?[0,o]:[s,o]},lc=(e,t,s)=>{for(let i=0;i<e.length;i++)if(!_a(e[i],t[s+i]))return!1;return!0},pv=/[/\ud800-\udfff]/,fv=/[\ud800-\udfff]/,or=e=>fv.test(e)?[...e]:e,dc=e=>{if(e.includes("/"))throw new Error("can only match a single path portion, got: "+e)},zn,jo,mo,ir,ho,Hs,rr,go,js,Gs,Ws,Dn,bn,Go,Wo,Ks,ar,nn,vo,Us,zs=class{constructor(t,s={}){_e(this,vo);nt(this,"pattern");nt(this,"options");_e(this,zn);_e(this,jo);_e(this,mo);_e(this,ir);_e(this,ho);_e(this,Hs,!1);_e(this,rr);_e(this,go);_e(this,js,!1);_e(this,Gs,0);_e(this,Ws,1/0);_e(this,Dn,[]);_e(this,bn,[]);_e(this,Go);_e(this,Wo);_e(this,Ks,!1);_e(this,ar);_e(this,nn);if(t.includes Line truncated
`).forEach((s,i)=>{let{term:o}=Xa(s.trim());if(!o)return;let r=[];for(let d=0;d<o.length;d++){if(o[d]==="\\"){d++;continue}Vc.has(o[d])&&!r.includes(o[d])&&r.push(o[d])}r.length&&t.push({line:i,term:o,symbols:r})}),t}function Lc(e,t){let s=String(e||"").split(`
`),i=s[t];if(i===void 0)return e;let{term:o}=Xa(i.trim());if(!o)return e;let r="";for(let p=0;p<o.length;p++){if(o[p]==="\\"){r+=o.slice(p,p+2),p++;continue}r+=Vc.has(o[p])||o[p]==="."?"\\"+o[p]:o[p]}let d=i.indexOf(o);return s[t]=i.slice(0,d)+r+i.slice(d+o.length),s.join(`
`)}var Jn={VIEWER_ERRORS:{title:"Content could not be loaded",access_title:"GitHub access needs attention",reader_help:"Reading this repository? You do not need to sign in. Try again after the owner restores access, or let them know this anonymous link is unavailable.",owner_help:"Own this repository? If your GitHub account was suspended or recently recovered, sign in to Anonymous GitHub again and check the GitHub connection and repository permissions in your dashboard. Then retry this page. Keep the existing anonymous URL; do not delete the repository to restore access.",retry:"Try again",dashboard:"Open owner dashboard"},ERRORS:{cache_busy:"Downloads are busy. Please try again shortly.",invalid_sort:"The selected sort order is invalid.",invalid_cursor:"This project page is no longer valid. Reload the list.",repository_changed:"The repository changed while processing. Please retry.",repository_job_cancelled:"The repository changed or was removed while processing.",storage_delete_failed:"Unable to remove cached files. Please try again later.",unknown_error:"We could not load this content. Try again. If it still fails, contact support with the anonymous URL and the time of the error.",unreachable:"The service could not complete this request. Wait a moment and try again.",request_error:"The connection was interrupted. Check your internet connection and try again.",not_found:"The requested resource could not be found.",not_connected:"You must be logged in to perform this action.",not_authorized:"You do not have permission to perform this action.",unable_to_connect_user:"Unable to connect your account. Please try again later.",user_not_found:"The requested user could not be found.",user_banned:"Your account has been banned. Contact the admin for more information.",repo_access_limited:"GitHub blocked access because the repository's organization restricts third-party OAuth apps. Ask an org owner to approve Anonymous GitHub under Settings \u2192 Third-party Access \u2192 OAuth app policy, or anonymize a personal fork instead.",repo_saml_enforcement:"The repository's organization enforces SAML single sign-on. Authorize your token for that organization (GitHub \u2192 Settings \u2192 Applications, or re-run the org's SSO sign-in), then retry. Alternatively, anonymize a personal fork.",repo_not_found:"Anonymous GitHub cannot access the source repository on GitHub. It may be private, unavailable, or require the owner to reconnect GitHub.",repo_empty:"The selected branch has no commits on GitHub. Push at least one commit, or pick a different branch, then retry.",repo_not_accessible:"Anonymous GitHub cannot access this repository. Verify the repository exists and that Anonymous GitHub has been authorized for the owning organization.",repository_archived:"This repository has been archived and its files are no longer available.",repository_expired:"The repository is expired.",invalid_status:"This action cannot be performed while the resource is in its current state.",repository_not_ready:"Anonymous GitHub is still processing the repository, it can take several minutes.",repository_not_accessible:"This repository is currently not accessible.",repo_is_updating:"Anonymous GitHub is still processing the repository, it can take several minutes.",invalid_repo:"The provided repository is not valid.",invalid_source_repository:"The repository source name is invalid; expected the form 'owner/name'.",repoId_not_defined:"A repository ID must be provided.",repoUrl_not_defined:"The repository URL needs to be defined.",source_not_provided:"A repository source must be provided.",github_rate_limit_exceeded:"GitHub temporarily blocked the request because we hit its API rate limit. Wait a few minutes and try again. If the problem persists and you contact GitHub Support, include the request ID and timestamp shown in GitHub's response (the 'X-GitHub-Request-Id' header).",rate_limited:"GitHub API rate limit reached. The repository will be available shortly \u2014 please wait a moment and refresh.",repoId_already_used:"The repository ID is already used.",invalid_repoId:"The format of the repository ID is invalid.",unsupported_source:"The repository source type is not supported.",branch_not_specified:"The branch is not specified.",branch_not_found:"The branch of the repository cannot be found.",commit_not_specified:"A commit must be specified.",commit_not_found:"The configured commit no longer exists in the source repository. It may have been force-pushed, rebased, or removed.",repo_renamed:"The source repository appears to have been renamed or moved on GitHub. Please refresh and try again \u2014 the cached name has been updated.",invalid_commit_format:"The commit hash format is invalid. It must be a hexadecimal string.",pull_request_not_found:"The requested pull request could not be found.",pull_request_expired:"This pull request has expired and is no longer available.",pull_request_not_ready:"This pull request is still being prepared. Please t Line truncated
`)),e.options=Object.assign({},e.options,y.options),p.restore()})}c();let v=null;e.saveDefault=h=>{if(h&&h.preventDefault&&h.preventDefault(),e.saving)return;let y=p.checkpoint(),m={terms:e.terms.split(`
`).map(b=>b.trim()).filter(b=>b.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",m).then(()=>{p.accept(y),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",v&&i.cancel(v),v=i(()=>{e.message=null},2500)},b=>{e.saving=!1;let S=b&&b.data&&b.data.error,E="Unable to save your defaults. Please try again.";Promise.all([s("ERRORS."+S),s("ERRORS.unknown_error")]).then(([N,w])=>{e.error=S&&N!==w?N:E},()=>{e.error=E})})},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."}))}},Hc=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)})}},jc=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(p){e.feature=p},e.featureHref=function(p){return p.needsUser&&!e.user?"/signin":p.href},e.featureTarget=function(p){return p.needsUser&&!e.user?"_self":p.target||void 0},e.featureKeydown=function(p,c){let v={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[p.key];if(v===void 0)return;p.preventDefault();let h=e.features.length,y=v==="first"?0:v==="last"?h-1:(c+v+h)%h;e.feature=e.features[y].key,o(()=>{let m=i.document.getElementById("feature-tab-"+e.feature);m&&m.focus()})},e.demoText=`# DeepLearnUtils
`)}function S(_){let z=[],I="",L=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,k=0,q;for(;q=L.exec(_);)I+=_.slice(k,q.index),k=L.lastIndex,z.push({key:q[1],op:q[2]||"=",val:q[3]});return I+=_.slice(k),{filters:z,free:I.trim().toLowerCase()}}function N(_,z){for(let I of z.filters){let L=(q,G,H)=>{let Y=parseFloat(q),ee=parseFloat(G);return H==="="?String(q)===String(G):H==="!="?String(q)!==String(G):H===">="?Y>=ee:H==="<="?Y<=ee:H===">"?Y>ee:H==="<"?Y<ee:!0},k;if(I.key==="code")k=_.displayMessage;else if(I.key==="module")k=_.module;else if(I.key==="status")k=_._status;else if(I.key==="url")k=_._url;else if(I.key==="repo")k=_._repoId;else if(I.key==="level")k=_.level;else continue;if(k==null||!L(k,I.val,I.op))return!1}return!(z.free&&((_.displayMessage||"")+" "+(_.module||"")+" "+(_._url||"")+" "+JSON.stringify(_.raw||[])).toLowerCase().indexOf(z.free)===-1)}function w(){let _=S(e.query.search||"");e.parsedFilterCount=_.filters.length;let z=e.query.bucket,I=e.entries.filter(H=>z&&H._bucket!==z?!1:N(H,_)),L=e.query.group;if(L){let H=x=>JSON.stringify(L==="module"?[x.module,x._bucket]:[x.raw?.[0]?.service||"unknown",x.module,x.displayMessage||x.message||"_",x._bucket,x._status]),Y=new Map;for(let x of I){let fe=H(x);if(Y.has(fe)){let he=Y.get(fe);he.count++,he._related.push(x),new Date(x.ts)>new Date(he.ts)&&(he.ts=x.ts,he._url=x._url,he._status=x._status),new Date(x.ts)<new Date(he._firstSeen)&&(he._firstSeen=x.ts)}else{let he=Object.assign({},x);he._key=`${L}:${fe}`,he._related=[x],he._firstSeen=x.ts,he._lastHourCount=0,he.count=1,Y.set(fe,he)}}let ee=Date.now()-3600*1e3;for(let x of Y.values())x._lastHourCount=x._related.filter(fe=>new Date(fe.ts).getTime()>=ee).length;I=Array.from(Y.values())}else I=I.map((H,Y)=>(H._key="row:"+Y+":"+H.ts,H._related=[H],H._firstSeen=H.ts,H._lastHourCount=0,H.count=1,H));let k=H=>({error:0,warn:1,info:2})[H._bucket]??1;e.query.sort==="count"?I.sort((H,Y)=>k(H)-k(Y)||Y.count-H.count||new Date(Y.ts)-new Date(H.ts)):I.sort((H,Y)=>k(H)-k(Y)||new Date(Y.ts)-new Date(H.ts)),e.visible=I;let q=!!(e.query.bucket||(e.query.search||"").trim()),G=!q&&(e.stats?.severity?.error||0)>0&&!I.some(H=>H._bucket==="error")&&e.entries.length<1500;(q&&!I.length||G)&&e.canLoadMore?.()&&!e._autoLoading&&e.entries.length<2500&&(e._autoLoading=!0,T(!0))}function T(_){if(_&&e.redisLoading)return;let z=++o;e.redisLoading=!0;let I=_?e.redisNextOffset||e.entries.length:0,L=_?e.pageSize:Math.max(e.pageSize,e.redisNextOffset||e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:I,limit:L}}).then(k=>{if(p||z!==o)return;e.redisLoading=!1;let q=(k.data.entries||[]).map(b);e.entries=_?e.entries.concat(q):q,e.redisRedacted=(_&&e.redisRedacted||0)+(k.data.redactedEntries||0),e.redisNextOffset=k.data.nextOffset??I+(k.data.entries||[]).length,e.available=!!k.data.available,e.redisCollecting=k.data.redisCollecting!==!1,e.cap=k.data.max||e.cap,e.total=k.data.total||e.entries.length,e._autoLoading=!1,w()},()=>{p||z!==o||(e.redisLoading=!1,e._autoLoading=!1,e.available=!1)})}e.loadMore=()=>T(!0),e.canLoadMore=()=>(e.redisNextOffset||e.entries.length)<e.total;function M(_=!1){if(_&&u)return;let z=++r;u=!0,t.get("/api/admin/errors/stats").then(I=>{if(p||z!==r)return;u=!1;let L=I.data||{};e.redisStatsState=L.available===!1?"unavailable":"ready";let k=L.prev24h?Math.round((L.last24h-L.prev24h)/L.prev24h*100):0;e.stats={last24h:L.last24h||0,prev24h:L.prev24h||0,delta:k,severity:L.severity||{error:0,warn:0,info:0},unique:L.unique||{error:0,warn:0,info:0},buckets:L.buckets||[],dropped:L.dropped||0},w()},()=>{!p&&z===r&&(u=!1,e.redisStatsState="unavailable")})}function F(_=!1){(!_||!e.redisLoading)&&T(),M(_)}e.barPx=(_,z)=>{let I=e.stats.buckets||[],L=0,k=0;for(let Y of I)L=Math.max(L,(Y.error||0)+(Y.warn||0)),k=Math.max(k,Y.info||0);let q=_[z]||0;if(!q)return 0;if(z==="info")return k?Math.max(2,Math.round(q/k*(L?16:60))):0;let G=(_.error||0)+(_.warn||0),H=Math.round(G/L*44);return Math.max(4,Math.round(q/G*H))},e.bucketTitle=_=>`${new Date(_.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${_.error||0} err \xB7 ${_.warn||0} warn \xB7 ${_.info||0} info`,e.toggle=async(_,z)=>{v=z||document.activeElement,g=e.captureErrorScroll(v),e.historySelected=_,e.historyView="overview",e.expanded={[_._key]:!0},await We(),document.getElementById("history-inspector-title")?.focus({preventScroll:!0}),document.getElementById("history-inspector-title")?.scrollIntoView?.({block:"nearest"})},e.showHistoryTimeline=_=>{if(e.historyView="timeline",e.traceSelection)return;let z=["requestId","jobId"].find(I=>e.logTraceId(e.historySelected,I));z&&e.lookupTrace(z,e.logTraceId(e.historySelected,z),_,e.historySelected)},e.closeHistory=async()=>{let _=e.historySelected?._key;e.historySelected=null,e.expanded={},e.traceSelection&&await e.closeTrace(),await We(),(v?.isConnected?v:[...document.querySelectorAll("[data-history-key]")].find(I=>I.dataset.historyKey===_))?.focus({preventScroll:!0}),e.restoreErrorScroll(g)},e.setBucket=_ Line truncated
`)],{type:"text/csv;charset=utf-8"}),L=URL.createObjectURL(I),k=document.createElement("a");k.href=L,k.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(L)};function j(_){e.copyHint=`${_} copied`,c.timeout(()=>{e.copyHint=""},1500)}e.copyJson=_=>{navigator.clipboard.writeText(_._rawJson).then(()=>j("JSON"))},e.copyCurl=_=>{if(!_._url)return;let I=`curl -X ${_._method||"GET"} '${window.location.origin}${_._url}'`;navigator.clipboard.writeText(I).then(()=>j("curl"))},F();let oe=i(()=>{e.query.autoRefresh&&F(!0)},15e3);e.on("dispose",()=>{p=!0,o++,r++,i.cancel(oe)}),e.watch("query.search",w),e.watch("query.bucket",w),e.watch("query.sort",w),e.watch("query.group",w)},Xu=function(e,t,s,i){if(e.Math=Math,e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null){s.url("/");return}e.data=null,e.loading=!0,e.error=null,e.performance=null,e.performanceMinutes=15,e.performanceTab="routes",e.cacheReport=null,e.cacheError=null,e.cacheMinutes=60,e.cacheTraffic="all",e.ovView=["performance","cache"].includes((window.location.hash||"").slice(1))?window.location.hash.slice(1):"summary",e.setOvView=function(w){e.ovView=w;try{window.history.replaceState(null,"",w==="summary"?window.location.pathname:"#"+w)}catch{}};var o=!1;e.loadCache=function(){if(!o){o=!0;var w=e.cacheMinutes;t.get("/api/admin/cache",{params:{minutes:w}}).then(function(T){w===e.cacheMinutes&&(e.cacheReport=T.data,e.cacheError=T.data.available?null:T.data.reason||"Cache monitoring is unavailable.")},function(){e.cacheError="Could not refresh cache monitoring. Displayed values may be stale."}).finally(function(){o=!1,w!==e.cacheMinutes&&e.loadCache()})}},e.cacheRows=function(){return(e.cacheReport?.rows||[]).filter(function(w){return e.cacheTraffic==="all"||w.traffic===e.cacheTraffic})},e.cacheRate=function(w,T){var M=e.cacheRows(),F=function(_){return M.filter(function(z){return z.name===_}).reduce(function(z,I){return z+I[T]},0)},j=F(w+"_hit"),oe=F(w+"_miss");return j+oe?(100*j/(j+oe)).toFixed(1)+"%":"No samples"},e.cacheEventName=function(w){return w.replaceAll("_"," ")},e.cacheP95=function(w){var T=0,M=e.cacheReport?.latencyBucketsMs||[];if(!w.count)return"No samples";if(!w.ms)return"Not timed";for(var F=0;F<=M.length;F++)if(T+=w["b"+F]||0,T>=Math.ceil(w.count*.95))return F<M.length?"\u2264 "+$n(M[F]):"> 10\u202Fs";return"No samples"},e.healthAlert=function(){let w=e.data&&e.data.system||{},T=[["Memory",w.memPercent],["Disk",w.diskPercent]].filter(([,F])=>F>90);return T.length?T.map(([F,j])=>F+" is at "+j+"%").join(" and ")+". New anonymizations may fail until "+(T.length>1?"they drop.":"it drops."):""},e.performanceError=null,e.formatMs=function(w){return w==null?"":$n(w)},e.latencyBound=function(w,T){return w.count?w[T]==null?"> 60\u202Fs":"\u2264 "+e.formatMs(w[T]):"No samples"},e.firstByteBound=function(w){return e.latencyBound({count:w.firstByteCount,p95UpperMs:w.firstByteP95UpperMs},"p95UpperMs")},e.sampleAge=function(w){return Math.max(0,Math.round((Date.now()-w.sampledAt)/1e3))},e.peakRss=function(w){return(e.performance.runtimeSeries||[]).filter(function(T){return T.instance===w.instance}).reduce(function(T,M){return Math.max(T,M.rss)},w.memory.rss)},e.performanceWarning=function(w){return e.sampleAge(w)>45||w.droppedBatches||w.droppedMetrics||w.sockets?.closeWait>0||w.eventLoop?.p95Ms>100||w.memoryLimitBytes&&w.memory.rss>w.memoryLimitBytes*.8};var r=!1;e.loadPerformance=function(){var w=e.performanceMinutes;e.performance?.windowMinutes&&e.performance.windowMinutes!==w&&(e.performance=null),!r&&(r=!0,t.get("/api/admin/performance",{params:{minutes:w}}).then(function(T){w===e.performanceMinutes&&(e.performance=T.data,e.performanceError=T.data.available?null:"Performance monitoring is unavailable. Request history may be incomplete.")},function(){w===e.performanceMinutes&&(e.performanceError="Could not refresh performance monitoring. Displayed samples may be stale.")}).finally(function(){r=!1,w!==e.performanceMinutes&&e.loadPerformance()}))};function u(w){if(w==null)return"\u2014";for(var T=["B","KB","MB","GB","TB"],M=0,F=w;F>=1024&&M<T.length-1;)F/=1024,M++;return F.toFixed(M>0?1:0).replace(/\.0$/,"")+" "+T[M]}e.humanBytes=u;function p(w){if(!w)return"\u2014";var T=Math.floor(w/86400),M=Math.floor(w%86400/3600),F=Math.floor(w%3600/60);return T>0?T+"d "+(M<10?"0":"")+M+"h":M>0?M+"h "+(F<10?"0":"")+F+"m":F+"m"}e.humanDuration=p;function c(w){return w==null?"\u2014":w>=1e6?(w/1e6).toFixed(1)+"M":w>=1e3?(w/1e3).toFixed(1)+"K":String(w)}e.humanNum=c,e.queueTotal=function(w){return w?(w.waiting||0)+(w.active||0)+(w.delayed||0)+(w.failed||0):0},e.statusCount=function(w){if(!e.data||!e.data.repos)return 0;for(var T=e.data.repos.statusBreakdown||[],M=0;M<T.length;M++)if(T[M]._id===w)return T[M].count;return 0},e.barPct=function(w){var T=e.data&&e.data.repos?e.data.repos.total:0;if(!T)return 0;var M=[w];w==="expired"&&M.push("expiring"),w==="remov Line truncated
`)},Ma=class{constructor(t){nt(this,"gen");nt(this,"threads",[]);nt(this,"match",!1);nt(this,"runs",[]);nt(this,"ids",[]);this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},mc=(e,t)=>e.ids.length!==t.ids.length||e.runs.length!==t.runs.length||e.ids.some((s,i)=>s!==t.ids[i])?!1:e.runs.every(s=>t.runs.some(i=>i.neg===s.neg&&mc(i.state,s.state))),ac=e=>({has:new Float64Array(e),seen:new Float64Array(e),gen:0}),po,Hn,Va,qa,Bs=class{constructor(t,s,i){_e(this,Hn);nt(this,"dots");nt(this,"dotStart");_e(this,po);this.dots=t,this.dotStart=s,ze(this,po,i)}state(){return new Ma(++re(this,po).gen)}done(t){return t.ids=t.threads.map(s=>s.id).sort((s,i)=>s-i),t.match&&t.ids.unshift(Oa.id),t}restricted(t,s){return s&&(this.dots||this.dotStart&&t===0)}add(t,s,i,o){switch(s.t){case"split":if(!Fe(this,Hn,Va).call(this,t,s))return;for(let u of s.out)this.add(t,u,i,o);return;case"neg":if(!Fe(this,Hn,Va).call(this,t,s))return;let r=this.state();return this.add(r,s.sub,i,!1),this.done(r),this.addRun(t,{t:"run",neg:s,state:r},i,o);case"star":if(this.restricted(i,o))return;Fe(this,Hn,qa).call(this,t,s)&&this.add(t,s.next,i,o);return;case"match":t.match=!0;return;default:Fe(this,Hn,qa).call(this,t,s)}}addRun(t,s,i,o){for(let r of t.runs)if(r.neg===s.neg&&mc(r.state,s.state))return;t.runs.push(s),s.state.match||this.add(t,s.neg.next,i,o)}step(t,s,i,o){let r=this.state();for(let u of t.threads)switch(u.t){case"lit":_a(u,s)&&this.add(r,u.next,i+1,o);break;case"any":this.restricted(i,o)||this.add(r,u.next,i+1,o);break;case"class":!this.restricted(i,o)&&u.re.test(s)&&this.add(r,u.next,i+1,o);break;case"star":this.restricted(i,o)||this.add(r,u,i+1,o)}if(!this.restricted(i,o))for(let u of t.runs){if(u.state.dead){this.addRun(r,u,i+1,o);continue}let p=this.step(u.state,s,i,!1);this.addRun(r,{t:"run",neg:u.neg,state:p},i+1,o)}return this.done(r)}};po=new WeakMap,Hn=new WeakSet,Va=function(t,s){let{seen:i}=re(this,po);return i[s.id]===t.gen?!1:(i[s.id]=t.gen,!0)},qa=function(t,s){let{has:i}=re(this,po);return i[s.id]===t.gen?!1:(i[s.id]=t.gen,t.threads.push(s),!0)};var hc=e=>{let t=e.ids.join();if(!e.runs.length)return t;let s=e.runs.map(i=>`${i.neg.id}(${hc(i.state)})`);return`${t}|${s.sort().join("|")}`},lv=1<<18,zo,Ho,_n,fo,Fn,Un,Bn,on,$a,sr,gc,La=class{constructor(t,s){_e(this,on);_e(this,zo);_e(this,Ho,new Map);_e(this,_n,0);_e(this,fo);_e(this,Fn);_e(this,Un);_e(this,Bn);ze(this,zo,t),ze(this,Un,new Bs(!1,!1,s)),ze(this,Bn,new Bs(!1,!0,s))}start(t){if(t){if(re(this,Fn))return re(this,Fn);let i=re(this,Bn).state();return re(this,Bn).add(i,re(this,zo),0,!0),ze(this,Fn,Fe(this,on,$a).call(this,re(this,Bn).done(i)))}if(re(this,fo))return re(this,fo);let s=re(this,Un).state();return re(this,Un).add(s,re(this,zo),0,!0),ze(this,fo,Fe(this,on,sr).call(this,re(this,Un).done(s)))}next(t,s){let i=s.charCodeAt(0),o=i<128?void 0:t.next.get(s);if(o)return o;let r=t===re(this,Fn)?Fe(this,on,sr).call(this,re(this,Bn).step(t.state,s,0,!0)):Fe(this,on,sr).call(this,re(this,Un).step(t.state,s,1,!0));return i<128?(t.ascii||(t.ascii=new Array(128),ze(this,_n,re(this,_n)+128)),t.ascii[i]=r):t.next.set(s,r),al(this,_n)._++,r}};zo=new WeakMap,Ho=new WeakMap,_n=new WeakMap,fo=new WeakMap,Fn=new WeakMap,Un=new WeakMap,Bn=new WeakMap,on=new WeakSet,$a=function(t){return{state:t,match:t.match,dead:t.dead,next:new Map}},sr=function(t){let s=hc(t),i=re(this,Ho).get(s);if(i)return i;re(this,_n)>lv&&Fe(this,on,gc).call(this);let o=Fe(this,on,$a).call(this,t);return re(this,Ho).set(s,o),ze(this,_n,re(this,_n)+(s.length+1)),o},gc=function(){re(this,Ho).clear(),ze(this,_n,0),ze(this,fo,void 0),ze(this,Fn,void 0)};var dv=e=>{let t=[];for(let s=e;s.t!=="match";s=s.next){if(s.t==="split"||s.t==="neg")return;t.push(s)}return t},uv=(e,t,s,i)=>{let o=0,r=s,u=-1,p=0;for(;r<i;){let c=e[o];if(c?.t==="star"){u=o++,p=r;continue}let v=t[r];if(c&&(c.t==="any"||c.t==="lit"&&_a(c,v)||c.t==="class"&&c.re.test(v))){o++,r++;continue}if(u===-1)return!1;o=u+1,r=++p}for(;e[o]?.t==="star";)o++;return o===e.length},vc=e=>{let t=0,s=0;for(let i of e){let[o,r]=cv(i);t+=o,s+=r}return[t,s]},cv=e=>{if(e.t==="star")return[0,1/0];if(e.t!=="ext")return[1,1];if(e.type==="!")return[0,1/0];let t=e.alts.map(vc),s=Math.min(...t.map(r=>r[0])),i=Math.max(...t.map(r=>r[1])),o=i===0?0:1/0;return e.type==="@"?[s,i]:e.type==="?"?[0,i]:e.type==="*"?[0,o]:[s,o]},lc=(e,t,s)=>{for(let i=0;i<e.length;i++)if(!_a(e[i],t[s+i]))return!1;return!0},pv=/[/\ud800-\udfff]/,fv=/[\ud800-\udfff]/,or=e=>fv.test(e)?[...e]:e,dc=e=>{if(e.includes("/"))throw new Error("can only match a single path portion, got: "+e)},zn,jo,mo,ir,ho,Hs,rr,go,js,Gs,Ws,Dn,bn,Go,Wo,Ks,ar,nn,vo,Us,zs=class{constructor(t,s={}){_e(this,vo);nt(this,"pattern");nt(this,"options");_e(this,zn);_e(this,jo);_e(this,mo);_e(this,ir);_e(this,ho);_e(this,Hs,!1);_e(this,rr);_e(this,go);_e(this,js,!1);_e(this,Gs,0);_e(this,Ws,1/0);_e(this,Dn,[]);_e(this,bn,[]);_e(this,Go);_e(this,Wo);_e(this,Ks,!1);_e(this,ar);_e(this,nn);if(t.includes Line truncated
`).forEach((s,i)=>{let{term:o}=Xa(s.trim());if(!o)return;let r=[];for(let u=0;u<o.length;u++){if(o[u]==="\\"){u++;continue}Vc.has(o[u])&&!r.includes(o[u])&&r.push(o[u])}r.length&&t.push({line:i,term:o,symbols:r})}),t}function Lc(e,t){let s=String(e||"").split(`
`),i=s[t];if(i===void 0)return e;let{term:o}=Xa(i.trim());if(!o)return e;let r="";for(let p=0;p<o.length;p++){if(o[p]==="\\"){r+=o.slice(p,p+2),p++;continue}r+=Vc.has(o[p])||o[p]==="."?"\\"+o[p]:o[p]}let u=i.indexOf(o);return s[t]=i.slice(0,u)+r+i.slice(u+o.length),s.join(`
`)}var Jn={VIEWER_ERRORS:{title:"Content could not be loaded",access_title:"GitHub access needs attention",reader_help:"Reading this repository? You do not need to sign in. Try again after the owner restores access, or let them know this anonymous link is unavailable.",owner_help:"Own this repository? If your GitHub account was suspended or recently recovered, sign in to Anonymous GitHub again and check the GitHub connection and repository permissions in your dashboard. Then retry this page. Keep the existing anonymous URL; do not delete the repository to restore access.",retry:"Try again",dashboard:"Open owner dashboard"},ERRORS:{cache_busy:"Downloads are busy. Please try again shortly.",invalid_sort:"The selected sort order is invalid.",invalid_cursor:"This project page is no longer valid. Reload the list.",repository_changed:"The repository changed while processing. Please retry.",repository_job_cancelled:"The repository changed or was removed while processing.",storage_delete_failed:"Unable to remove cached files. Please try again later.",unknown_error:"We could not load this content. Try again. If it still fails, contact support with the anonymous URL and the time of the error.",unreachable:"The service could not complete this request. Wait a moment and try again.",request_error:"The connection was interrupted. Check your internet connection and try again.",not_found:"The requested resource could not be found.",not_connected:"You must be logged in to perform this action.",not_authorized:"You do not have permission to perform this action.",unable_to_connect_user:"Unable to connect your account. Please try again later.",user_not_found:"The requested user could not be found.",user_banned:"Your account has been banned. Contact the admin for more information.",repo_access_limited:"GitHub blocked access because the repository's organization restricts third-party OAuth apps. Ask an org owner to approve Anonymous GitHub under Settings \u2192 Third-party Access \u2192 OAuth app policy, or anonymize a personal fork instead.",repo_saml_enforcement:"The repository's organization enforces SAML single sign-on. Authorize your token for that organization (GitHub \u2192 Settings \u2192 Applications, or re-run the org's SSO sign-in), then retry. Alternatively, anonymize a personal fork.",repo_not_found:"Anonymous GitHub cannot access the source repository on GitHub. It may be private, unavailable, or require the owner to reconnect GitHub.",repo_empty:"The selected branch has no commits on GitHub. Push at least one commit, or pick a different branch, then retry.",repo_not_accessible:"Anonymous GitHub cannot access this repository. Verify the repository exists and that Anonymous GitHub has been authorized for the owning organization.",repository_archived:"This repository has been archived and its files are no longer available.",repository_expired:"The repository is expired.",invalid_status:"This action cannot be performed while the resource is in its current state.",repository_not_ready:"Anonymous GitHub is still processing the repository, it can take several minutes.",repository_not_accessible:"This repository is currently not accessible.",repo_is_updating:"Anonymous GitHub is still processing the repository, it can take several minutes.",invalid_repo:"The provided repository is not valid.",invalid_source_repository:"The repository source name is invalid; expected the form 'owner/name'.",repoId_not_defined:"A repository ID must be provided.",repoUrl_not_defined:"The repository URL needs to be defined.",source_not_provided:"A repository source must be provided.",github_rate_limit_exceeded:"GitHub temporarily blocked the request because we hit its API rate limit. Wait a few minutes and try again. If the problem persists and you contact GitHub Support, include the request ID and timestamp shown in GitHub's response (the 'X-GitHub-Request-Id' header).",rate_limited:"GitHub API rate limit reached. The repository will be available shortly \u2014 please wait a moment and refresh.",repoId_already_used:"The repository ID is already used.",invalid_repoId:"The format of the repository ID is invalid.",unsupported_source:"The repository source type is not supported.",branch_not_specified:"The branch is not specified.",branch_not_found:"The branch of the repository cannot be found.",commit_not_specified:"A commit must be specified.",commit_not_found:"The configured commit no longer exists in the source repository. It may have been force-pushed, rebased, or removed.",repo_renamed:"The source repository appears to have been renamed or moved on GitHub. Please refresh and try again \u2014 the cached name has been updated.",invalid_commit_format:"The commit hash format is invalid. It must be a hexadecimal string.",pull_request_not_found:"The requested pull request could not be found.",pull_request_expired:"This pull request has expired and is no longer available.",pull_request_not_ready:"This pull request is still being prepared. Please t Line truncated
`)),e.options=Object.assign({},e.options,y.options),p.restore()})}c();let v=null;e.saveDefault=g=>{if(g&&g.preventDefault&&g.preventDefault(),e.saving)return;let y=p.checkpoint(),m={terms:e.terms.split(`
`).map(b=>b.trim()).filter(b=>b.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",m).then(()=>{p.accept(y),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",v&&i.cancel(v),v=i(()=>{e.message=null},2500)},b=>{e.saving=!1;let E=b&&b.data&&b.data.error,S="Unable to save your defaults. Please try again.";Promise.all([s("ERRORS."+E),s("ERRORS.unknown_error")]).then(([N,w])=>{e.error=E&&N!==w?N:S},()=>{e.error=S})})},e.deleteAccount=()=>{e.deletingAccount||!e.confirmDeleteAccount||e.deleteUsername!==e.user?.username||(e.deletingAccount=!0,t.delete("/api/user").then(()=>{window.location.href="/"},()=>{e.deletingAccount=!1,e.deleteError="Unable to delete the account. Please try again."}))}},Hc=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)})}},jc=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(p){e.feature=p},e.featureHref=function(p){return p.needsUser&&!e.user?"/signin":p.href},e.featureTarget=function(p){return p.needsUser&&!e.user?"_self":p.target||void 0},e.featureKeydown=function(p,c){let v={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[p.key];if(v===void 0)return;p.preventDefault();let g=e.features.length,y=v==="first"?0:v==="last"?g-1:(c+v+g)%g;e.feature=e.features[y].key,o(()=>{let m=i.document.getElementById("feature-tab-"+e.feature);m&&m.focus()})},e.demoText=`# DeepLearnUtils
Developed by Jane Smith at MIT CSAIL.
See Smith et al., "Attention That Works," 2026.
Contact: jane.smith@mit.edu`,e.demoTerms="Jane Smith, Smith, MIT CSAIL, jane.smith@mit.edu",e.demoParts=function(){let p=(e.demoTerms||"").split(/[,\n]/).map(m=>m.trim()).filter(Boolean).sort((m,b)=>b.length-m.length),c=m=>m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!p.length)return[{text:e.demoText}];let v=new RegExp("("+p.map(c).join("|")+")","gi"),h={},y=0;return(e.demoText||"").split(v).filter(m=>m!=="").map(m=>{let b=p.find(S=>S.toLowerCase()===m.toLowerCase());return b?(h[b.toLowerCase()]||(h[b.toLowerCase()]=++y),{text:String(h[b.toLowerCase()]),redacted:!0,original:m}):{text:m}})},e.demoCount=()=>e.demoParts().filter(p=>p.redacted).length,e.cards=[{key:"repositories",total:0,label:"repositories anonymized"},{key:"users",total:0,label:"researchers"},{key:"pageViews",total:0,label:"page views"},{key:"pullRequests",total:0,label:"pull requests"}],e.statsEmpty=()=>!!e.stat&&e.cards.every(p=>!p.total);function r(){t.get("/api/stat/").then(p=>{e.stat=p.data,e.cards[0].total=p.data.nbRepositories,e.cards[1].total=p.data.nbUsers,e.cards[2].total=p.data.nbPageViews,e.cards[3].total=p.data.nbPullRequests}).catch(()=>{})}r();function d(p){let c={series:p,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!p||p.length<2)return c;let v=new Array(p.length-1);for(let E=1;E<p.length;E++)v[E-1]=p[E]-p[E-1];let h=v.length,y=Math.max.apply(null,v),m=Math.min.apply(null,v),b=Math.min(0,m),S=y-b||1;c.viewW=h*2,c.bars=new Array(h);for(let E=0;E<h;E++){let N=(v[E]-b)/S,w=Math.max(1.5,N*34);c.bars[E]={x:(E*2+.25).toFixed(2),y:(36-w).toFixed(2),w:"1.5",h:w.toFixed(2)}}if(c.deltaToday=v[h-1],h>=2){let E=v[h-2];E&&(c.pctChange=(c.deltaToday-E)/E*100)}return c.pctAbs=Math.round(Math.abs(c.pctChange)),c.isUp=c.pctChange>=0,c}e.history={repositories:d([]),users:d([]),pageViews:d([]),pullRequests:d([])},t.get("/api/stat/history?days=60").then(p=>{let c=p.data||[];e.history={repositories:d(c.map(v=>v.nbRepositories||0)),users:d(c.map(v=>v.nbUsers||0)),pageViews:d(c.map(v=>v.nbPageViews||0)),pullRequests:d(c.map(v=>v.nbPullRequests||0))}}).catch(()=>{})},Gc=function(e,t,s,i,o,r){let d=bt();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),d.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,We(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Bt()(document,"click",k=>{e.quotaExpanded&&!k.target.closest?.(".dashboard-quota")&&(e.quotaExpanded=!1)}),e.filtersExpanded=!1,e.projectView="all",e.selectedProject=null,e.projectName="",e.nameSaving=!1,e.nameError="",e.nameMessage="",e.needsAttention=k=>k.status==="error"||k._broken||c(k.status)==="progress"&&k._stale,e.attentionCount=()=>e.dashboardTotals?.attention??e.items.filter(e.needsAttention).length,e.hasProjects=()=>(e.dashboardTotals?.total??e.items.length)>0,e.setProjectView=k=>{e.projectView=k,k==="attention"&&(e.filters.status.error=!0,e.filters.status.progress=!0)},e.idleText=k=>{let q=Ca(k?.anonymizeDate||k?.lastView)||"";return/ ago$/.test(q)?"No activity for "+q.replace(/ ago$/,""):"No activity since "+q.replace(", "+new Date().getFullYear(),"")},e.projectDetailsId=k=>"project-details-"+encodeURIComponent(k._type+":"+(k._id||k._source||"unknown")),e.showProjectDetails=async k=>{e.selectedProject=k,e.projectName=k.projectName||"",e.nameError="",e.nameMessage="",await We();let q=document.getElementById(e.projectDetailsId(k));q?.focus(),q?.scrollIntoView?.({block:"nearest"})},e.closeProjectDetails=k=>{e.selectedProject=null,We(()=>document.querySelector(`[data-project-actions="${encodeURIComponent(k._type+":"+k._id)}"]`)?.focus())},e.saveProjectName=async k=>{if(e.nameSaving||!k._id)return;let q=e.projectName.trim();if(q.length>100){e.nameError="Use 100 characters or fewer.";return}e.nameSaving=!0,e.nameError="",e.nameMessage="";try{let G=await t.post("/api/user/project-name",{type:k._type,id:k._id,name:q});k.projectName=G.data.name,k._label=k.projectName||k._fallbackLabel,e.selectedProject===k&&(e.nameMessage=q?"Project name saved.":"Default project name restored."),T||(e.dashboardCursor=null,await F(),e.selectedProject===k&&(e.selectedProject=e.items.find(H=>H._type===k._type&&H._id===k._id)||null))}catch{e.selectedProject===k&&(e.nameError="The project name could not be saved. Try again.")}finally{e.nameSaving=!1}},e.copyingId=null,e.copyLink=async k=>{if(!k._viewUrl||e.copyingId)return;let q=new URL(k._viewUrl,o.location.origin).href;e.copyingId=k._type+":"+k._id;try{await Qa(q),e.addToast({title:"Link copied",body:"The anonymous link is ready to share."})}catch{e.addToast({title:"Copy this anonymous link",body:q})}finally{e.copyingId=null}},e.items=[],e.search="",e.loading=!0,e.statusKeyLabels={ready:"Ready",progress:"Preparing",error:"Error",expired:"Expiring / expired",removed:"Removing / removed"};let p=["queue","download","downloaded","preparing","anonymizing"];function Line truncated
`)),e.options=Object.assign({},e.options,B.options),e.options.expirationDate=B.options&&B.options.expirationDate?new Date(B.options.expirationDate):_(),!i.repoId&&!i.pullRequestId&&!i.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),C&&C()})}function Se(C,O,B){e.anonymize&&e.anonymize[C]&&e.anonymize[C].setValidity(O,B)}function tt(C){try{let O=parseGithubUrl(C);if(O&&O.owner&&O.repo)return O.owner+"/"+O.repo}catch{}return null}e.accessRepairAllowed=!1,e.repairingGitHubAccess=!1,e.accessRepairMessage="",e.repairGitHubAccess=async()=>{if(!e.accessRepairAllowed||e.repairingGitHubAccess||!e.githubConnections?.appEnabled||!i.repoId||e.role!=="owner"||e.githubConnection!=="github-app"||tt(e.sourceUrl)!==e._originalFullName)return;e.repairingGitHubAccess=!0,e.accessRepairMessage="";let C=m();try{let O=await t.get("/github/connections");if(e.githubConnections=O.data,!O.data.appEnabled)return;let B=await t.post("/github/connections/migrate",{type:"repository",id:i.repoId,connection:"github-app"},{headers:{"X-CSRF-Token":O.data.csrf}});if(!y(C))return;e.error=null,B.data.fullName&&(e._originalFullName=B.data.fullName,e.source.fullName=B.data.fullName,e.sourceUrl="https://github.com/"+B.data.fullName),e.accessRepairMessage="GitHub access repaired. Your anonymous URL and published commit are unchanged.",await e.urlSelected(!0)}catch{y(C)&&(e.accessRepairMessage="Unable to repair GitHub access. Check the App's repository permissions in Manage access, then retry. Your published snapshot has not been replaced.")}finally{e.repairingGitHubAccess=!1,b(C)}},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 pe()}catch{}}};function Ne(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:tt(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function qe(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function X(){let C=new URLSearchParams(window.location.search).get("billingDraft");if(C){N.restore();try{let B=(await t.get("/api/billing/draft/"+encodeURIComponent(C))).data;if(B.path!==o.path())throw new Error("Wrong task");w=B.values.conference||null;for(let K of["sourceUrl","terms","repoId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(B.values,K)&&(e[K]=B.values[K]);return e.options?.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),T=B.id,M=JSON.stringify(N.checkpoint()),e.draftRestored=!0,e.hostingReview=!0,e.sourceUrl&&await qe(),o.replace?.(o.path()),!0}catch{e.billingError="The checkout draft could not be restored. Retry by reloading this page; any local draft is still available."}}let O;try{O=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!O||O.path!==o.path()||Date.now()-O.savedAt>=30*6e4)return N.restore()?(e.sourceUrl&&await qe(),!0):!1;N.restore();for(let B of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(O.draft,B)&&(e[B]=O.draft[B]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await qe(),sessionStorage.removeItem("github-access-draft"),!0}Qe(()=>{!i.repoId&&!i.pullRequestId&&!i.gistId&&d(X,0),i.repoId&&i.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=i.repoId,t.get("/api/repo/"+e.repoId).then(async C=>{e.accessRepairAllowed=!["removed","archived","preparing","queue","download","removing","expiring"].includes(C.data.status),e.githubConnection=C.data.connection||"oauth",e.sourceUrl="https://github.com/"+C.data.source.fullName,e._originalFullName=C.data.source.fullName,e.terms=C.data.options.terms.filter(O=>O).join(`
`),e.source=C.data.source,e.role=C.data.role||"owner",e._existingNever=C.data.options.expirationMode==="never",e._savedExpirationDate=C.data.options.expirationDate?new Date(C.data.options.expirationDate):null,e.coauthors=C.data.coauthors||[],e._originalBranch=C.data.source.branch,e.options=Object.assign({},e.options,C.data.options),e.conference=C.data.conference,e._originalConference=C.data.conference,e.repositoryID=C.data.source.repositoryID,e._originalRepositoryID=C.data.source.repositoryID,C.data.options.expirationDate&&(e.options.expirationDate=new Date(C.data.options.expirationDate)),S=E(parseGithubUrl(e.sourceUrl)),!await X()&&(await Promise.all([pe(),ue()]),Co())},()=>{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 C=>{if(e.githubConnection=C.data.connection||"oauth",e.sourceUrl="https://github.com/"+C.data.source.repositoryFullName+"/pull/"+C.data.source.pullRequestId,e.terms=C.data.options.terms.filter(O=>O).join(`
`),e.source=C.data.source,e.options=Object.assign({},e.options,C.data.options),e.conference=C.data.conference,e._originalConference=C.data.conference,C.data.options.expirationDate&&(e.options.expirationDate=new Date(C.data.options.expirationDate)),S=E(parseGithubUrl(e.sourceUrl)),!await X())try{await ol()}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 C=>{e.sourceUrl="https://gist.github.com/"+C.data.source.gistId,e.terms=C.data.options.terms.filter(O=>O).join(`
`),e.source=C.data.source,e.options=Object.assign({},e.options,C.data.options),e.conference=C.data.conference,e._originalConference=C.data.conference,C.data.options.expirationDate&&(e.options.expirationDate=new Date(C.data.options.expirationDate)),S=E(parseGithubUrl(e.sourceUrl)),!await X()&&await sl()},()=>{o.url("/404")}))}),t.get("/github/connections").then(C=>{e.githubConnections=C.data,!i.repoId&&!i.pullRequestId&&!i.gistId&&e.githubConnection===void 0&&C.data.appEnabled&&C.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&qe())}).catch(()=>{}).finally(()=>{!v&&!i.repoId&&!i.pullRequestId&&!i.gistId&&e.userReposStatus==="idle"&&e.loadUserRepos()}),e.urlSelected=async(C=!1)=>{let O=++c;e.previousConfigurations=[],e.previousConfigurationId="";let B;try{B=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,e.details=null,fe(),Yt.cancel(),On.cancel(),Mn.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",Se("sourceUrl","github",!1);return}let K=E(B),ae=C||S===K;S=K,e.sourceUrlError="",Se("sourceUrl","github",!0),fe();let ye=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,setTimeout(()=>{let Ge=window.document.getElementById("sourceUrl");if(Ge){try{Ge.setSelectionRange(0,0)}catch{}Ge.scrollLeft=0}},50),ye&&d(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!ae&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],ae||(e.source={type:"GitHubStream",branch:"",commit:""}),Yt.cancel(),On.cancel(),Mn.cancel(),Eo.clear(),So.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",rf(),e.detectedType=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1,e._preservingDraft=ae;try{B.gistId&&!B.repo?(e.detectedType="gist",e.source={gistId:B.gistId},await sl()):B.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:B.owner+"/"+B.repo,pullRequestId:B.pullRequestId},await ol()):(e.detectedType="repo",Y(),await Promise.all([pe(),ue()]),Co())}catch{}finally{O===c&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let C=e.branches.filter(B=>B.name==e.source.branch)[0];if(!C)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=C.commit),e.readme=C.readme,await ue(),Co()}),e.getBranches=async C=>{let O=parseGithubUrl(e.sourceUrl),B=m();try{let K=await t.get(`/api/repo/${O.owner}/${O.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&tt(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:C===!0||e.reconnectingSource?"1":"0",repositoryID:Ne()}});if(!y(B))return;e.branches=K.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let ae=e.branches.filter(ye=>ye.name==e.source.branch);ae.length>0&&(!(!e.reconnectingSource&&!C&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=ae[0].commit),e.readme=ae[0].readme,await ue(C))}catch(K){if(!y(B))return;e.branches=[],e.sourceUnreachable=K&&(K.status===404||K.data&&K.data.error==="repo_not_found"),e.details=null,x(K)}finally{b(B)}};async function pe(){let C=parseGithubUrl(e.sourceUrl),O=m();try{No(),fe();let B=await t.get(`/api/repo/${C.owner}/${C.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&tt(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,repositoryID:Ne(),force:"1"}});if(!y(O))return;e.details=B.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(B){if(!y(O))return;throw x(B),B}finally{b(O)}}async function ue(C){if(e.readme&&!C)return e.readme;let O=parseGithubUrl(e.sourceUrl),B=m();try{let K=await t.get(`/api/repo/${O.owner}/${O.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&tt(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:C===!0?"1":"0",branch:e.source.branch,repositoryID:Ne()}});y(B,!0)&&(e.readme=K.data)}catch{y(B,!0)&&(e.readme="")}finally{b(B)}}let me={magicalBraces:!0},be=C=>C.startsWith("/")&&!C.endsWith("/")&&jn(yo(C.slice(1),me),me)===C.slice(1),Ve=()=>Object.keys(e.preserve.picked).filter(C=>e.preserve.picked[C]).sort().map(C=>"/"+jn(C,me)),D=C=>"/"+jn(C,me)+"/**",A=C=>"!/"+jn(C,me)+"/",U=()=>String(e.preserve.patterns||"").split(`
`).map(C=>C.trim()).filter(Boolean),J=null,W=null,te=new Set,le=0,se=null,ie=()=>!1;function ne(){let C=le+"\0"+e.preserve.patterns;if(C!==se){se=C;try{ie=Ja(Ya([...Ve(),...U()]))}catch{ie=()=>!1}}return ie}function we(C){let O=new Map([["",{dirs:[],files:[]}]]);for(let B of C){let K=B.split("/"),ae="";for(let ye=0;ye<K.length-1;ye++){let Ge=K.slice(0,ye+1).join("/");O.has(Ge)||(O.set(Ge,{dirs:[],files:[]}),O.get(ae).dirs.push(Ge)),ae=Ge}O.get(ae).files.push(B)}for(let B of O.values())B.dirs.sort();return{files:C,dirs:O,descendants:new Map}}function ce(C){return J.descendants.has(C)||J.descendants.set(C,J.files.filter(O=>O.startsWith(C+"/"))),J.descendants.get(C)}let Ee=C=>ne()(C);function Te(C){let O=ce(C),B=0;for(let K of O)Ee(K)&&B++;return B===0?"none":B===O.length?"all":"some"}e.preserve={open:!1,loading:!1,error:"",truncated:!1,commit:"",search:"",expanded:{},picked:{},patterns:"",patternsOpen:!1},e.preserveSummary=()=>{let C=(e.options?.preserveFiles||[]).map(O=>String(O).trim()).filter(Boolean).map(O=>be(O)?yo(O.slice(1),me):O);return C.length?C.slice(0,2).join(", ")+(C.length>2?` and ${C.length-2} more`:""):"None. Every file is redacted."};async function Le(){let C=e.source?.commit;if(!(J&&e.preserve.commit===C)){e.preserve.loading=!0,e.preserve.error="",J=null,W=null;try{let O=parseGithubUrl(e.sourceUrl),B=await t.get(`/api/repo/${O.owner}/${O.repo}/tree`,{params:{commit:C,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&i.repoId&&tt(e.sourceUrl)===e._originalFullName?i.repoId:void 0,repositoryID:Ne()}});if(e.source?.commit!==C)return;let K=Array.isArray(B.data.binaryFiles)?B.data.binaryFiles:[];J=pn(we(B.data.files||[])),W=K.length?pn(we([...B.data.files||[],...K])):J,te=pn(new Set(K)),e.preserve.commit=C,e.preserve.truncated=!!B.data.truncated,e.previewFile||Yt()}catch{e.preserve.error="The file list could not be loaded from GitHub. You can still use patterns.",e.preserve.patternsOpen=!0}finally{e.preserve.loading=!1}}}e.watch("source.commit",C=>{e.previewFile&&e.openPreviewFile(""),e.detectedType==="repo"&&C&&e.sourceUrl&&Le().catch(()=>{})}),e.openPreserveFiles=()=>{let C={},O=[];for(let K of e.options?.preserveFiles||[]){let ae=String(K).trim();ae&&(!O.length&&be(ae)?C[yo(ae.slice(1),me)]=!0:O.push(ae))}let B={};for(let K of Object.keys(C)){let ae=K.split("/");for(let ye=1;ye<ae.length;ye++)B[ae.slice(0,ye).join("/")]=!0}Object.assign(e.preserve,{open:!0,search:"",picked:C,expanded:B,patterns:O.join(`
`),patternsOpen:O.length>0}),e.mobileWorkspace&&(e.mobilePane="settings"),le++,d(()=>{let K=document.getElementById("preserve-files-dialog");K?.showModal&&!K.open&&K.showModal(),document.getElementById("preserve-files-search")?.focus()},0),Le()},e.closePreserveFiles=()=>{document.getElementById("preserve-files-dialog")?.close?.(),e.preserve.open=!1},e.savePreserveFiles=()=>{e.options.preserveFiles=Ya([...Ve(),...U()]),e.closePreserveFiles()},e.preserveRows=()=>{if(!J)return[];let C=ne(),O=(ye,Ge,Tt)=>{let st=!!e.preserve.picked[ye],kt=C(ye);return{kind:"file",path:ye,label:Tt,depth:Ge,state:kt?"all":"none",locked:!st&&kt,note:!st&&kt?"matched by a pattern":st&&!kt?"excluded by a pattern":""}},B=String(e.preserve.search||"").trim().toLowerCase();if(B)return J.files.filter(ye=>ye.toLowerCase().includes(B)).slice(0,300).map(ye=>O(ye,0,ye));let K=[],ae=(ye,Ge)=>{let Tt=J.dirs.get(ye);for(let st of Tt.dirs){let kt=!!e.preserve.expanded[st],ii=U().includes(D(st));K.push({kind:"dir",path:st,label:st.slice(ye?ye.length+1:0)+"/",depth:Ge,open:kt,state:Te(st),locked:!1,note:ii?"whole folder":""}),kt&&ae(st,Ge+1)}for(let st of Tt.files)K.push(O(st,Ge,st.slice(ye?ye.length+1:0)))};return ae("",0),K},e.preserveCount=()=>J?J.files.filter(Ee).length:0,e.togglePreserveDir=C=>{e.preserve.expanded[C]=!e.preserve.expanded[C]},e.togglePreserveFile=C=>{e.preserve.picked[C]=!e.preserve.picked[C],le++},e.togglePreserveFolder=C=>{let O=D(C),B=A(C),K=U().filter(ye=>ye!==O&&ye!==B),ae=Te(C)==="all"||U().includes(O);for(let ye of ce(C))e.preserve.picked[ye]=!1;le++,e.preserve.patterns=(ae?K:[...K,O]).join(`
`),ae&&ce(C).some(Ee)&&(e.preserve.patterns=[...K,B].join(`
Contact: jane.smith@mit.edu`,e.demoTerms="Jane Smith, Smith, MIT CSAIL, jane.smith@mit.edu",e.demoParts=function(){let p=(e.demoTerms||"").split(/[,\n]/).map(m=>m.trim()).filter(Boolean).sort((m,b)=>b.length-m.length),c=m=>m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!p.length)return[{text:e.demoText}];let v=new RegExp("("+p.map(c).join("|")+")","gi"),g={},y=0;return(e.demoText||"").split(v).filter(m=>m!=="").map(m=>{let b=p.find(E=>E.toLowerCase()===m.toLowerCase());return b?(g[b.toLowerCase()]||(g[b.toLowerCase()]=++y),{text:String(g[b.toLowerCase()]),redacted:!0,original:m}):{text:m}})},e.demoCount=()=>e.demoParts().filter(p=>p.redacted).length,e.cards=[{key:"repositories",total:0,label:"repositories anonymized"},{key:"users",total:0,label:"researchers"},{key:"pageViews",total:0,label:"page views"},{key:"pullRequests",total:0,label:"pull requests"}],e.statsEmpty=()=>!!e.stat&&e.cards.every(p=>!p.total);function r(){t.get("/api/stat/").then(p=>{e.stat=p.data,e.cards[0].total=p.data.nbRepositories,e.cards[1].total=p.data.nbUsers,e.cards[2].total=p.data.nbPageViews,e.cards[3].total=p.data.nbPullRequests}).catch(()=>{})}r();function u(p){let c={series:p,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!p||p.length<2)return c;let v=new Array(p.length-1);for(let S=1;S<p.length;S++)v[S-1]=p[S]-p[S-1];let g=v.length,y=Math.max.apply(null,v),m=Math.min.apply(null,v),b=Math.min(0,m),E=y-b||1;c.viewW=g*2,c.bars=new Array(g);for(let S=0;S<g;S++){let N=(v[S]-b)/E,w=Math.max(1.5,N*34);c.bars[S]={x:(S*2+.25).toFixed(2),y:(36-w).toFixed(2),w:"1.5",h:w.toFixed(2)}}if(c.deltaToday=v[g-1],g>=2){let S=v[g-2];S&&(c.pctChange=(c.deltaToday-S)/S*100)}return c.pctAbs=Math.round(Math.abs(c.pctChange)),c.isUp=c.pctChange>=0,c}e.history={repositories:u([]),users:u([]),pageViews:u([]),pullRequests:u([])},t.get("/api/stat/history?days=60").then(p=>{let c=p.data||[];e.history={repositories:u(c.map(v=>v.nbRepositories||0)),users:u(c.map(v=>v.nbUsers||0)),pageViews:u(c.map(v=>v.nbPageViews||0)),pullRequests:u(c.map(v=>v.nbPullRequests||0))}}).catch(()=>{})},Gc=function(e,t,s,i,o,r){let u=bt();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&s.url("/")}),e.user==null&&s.url("/"),u.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,We(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Bt()(document,"click",k=>{e.quotaExpanded&&!k.target.closest?.(".dashboard-quota")&&(e.quotaExpanded=!1)}),e.filtersExpanded=!1,e.projectView="all",e.selectedProject=null,e.projectName="",e.nameSaving=!1,e.nameError="",e.nameMessage="",e.needsAttention=k=>k.status==="error"||k._broken||c(k.status)==="progress"&&k._stale,e.attentionCount=()=>e.dashboardTotals?.attention??e.items.filter(e.needsAttention).length,e.hasProjects=()=>(e.dashboardTotals?.total??e.items.length)>0,e.setProjectView=k=>{e.projectView=k,k==="attention"&&(e.filters.status.error=!0,e.filters.status.progress=!0)},e.idleText=k=>{let q=Ca(k?.anonymizeDate||k?.lastView)||"";return/ ago$/.test(q)?"No activity for "+q.replace(/ ago$/,""):"No activity since "+q.replace(", "+new Date().getFullYear(),"")},e.projectDetailsId=k=>"project-details-"+encodeURIComponent(k._type+":"+(k._id||k._source||"unknown")),e.showProjectDetails=async k=>{e.selectedProject=k,e.projectName=k.projectName||"",e.nameError="",e.nameMessage="",await We();let q=document.getElementById(e.projectDetailsId(k));q?.focus(),q?.scrollIntoView?.({block:"nearest"})},e.closeProjectDetails=k=>{e.selectedProject=null,We(()=>document.querySelector(`[data-project-actions="${encodeURIComponent(k._type+":"+k._id)}"]`)?.focus())},e.saveProjectName=async k=>{if(e.nameSaving||!k._id)return;let q=e.projectName.trim();if(q.length>100){e.nameError="Use 100 characters or fewer.";return}e.nameSaving=!0,e.nameError="",e.nameMessage="";try{let G=await t.post("/api/user/project-name",{type:k._type,id:k._id,name:q});k.projectName=G.data.name,k._label=k.projectName||k._fallbackLabel,e.selectedProject===k&&(e.nameMessage=q?"Project name saved.":"Default project name restored."),T||(e.dashboardCursor=null,await F(),e.selectedProject===k&&(e.selectedProject=e.items.find(H=>H._type===k._type&&H._id===k._id)||null))}catch{e.selectedProject===k&&(e.nameError="The project name could not be saved. Try again.")}finally{e.nameSaving=!1}},e.copyingId=null,e.copyLink=async k=>{if(!k._viewUrl||e.copyingId)return;let q=new URL(k._viewUrl,o.location.origin).href;e.copyingId=k._type+":"+k._id;try{await Qa(q),e.addToast({title:"Link copied",body:"The anonymous link is ready to share."})}catch{e.addToast({title:"Copy this anonymous link",body:q})}finally{e.copyingId=null}},e.items=[],e.search="",e.loading=!0,e.statusKeyLabels={ready:"Ready",progress:"Preparing",error:"Error",expired:"Expiring / expired",removed:"Removing / removed"};let p=["queue","download","downloaded","preparing","anonymizing"];function Line truncated
`)),e.options=Object.assign({},e.options,B.options),e.options.expirationDate=B.options&&B.options.expirationDate?new Date(B.options.expirationDate):_(),!i.repoId&&!i.pullRequestId&&!i.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),C&&C()})}function Ee(C,O,B){e.anonymize&&e.anonymize[C]&&e.anonymize[C].setValidity(O,B)}function tt(C){try{let O=parseGithubUrl(C);if(O&&O.owner&&O.repo)return O.owner+"/"+O.repo}catch{}return null}e.accessRepairAllowed=!1,e.repairingGitHubAccess=!1,e.accessRepairMessage="",e.repairGitHubAccess=async()=>{if(!e.accessRepairAllowed||e.repairingGitHubAccess||!e.githubConnections?.appEnabled||!i.repoId||e.role!=="owner"||e.githubConnection!=="github-app"||tt(e.sourceUrl)!==e._originalFullName)return;e.repairingGitHubAccess=!0,e.accessRepairMessage="";let C=m();try{let O=await t.get("/github/connections");if(e.githubConnections=O.data,!O.data.appEnabled)return;let B=await t.post("/github/connections/migrate",{type:"repository",id:i.repoId,connection:"github-app"},{headers:{"X-CSRF-Token":O.data.csrf}});if(!y(C))return;e.error=null,B.data.fullName&&(e._originalFullName=B.data.fullName,e.source.fullName=B.data.fullName,e.sourceUrl="https://github.com/"+B.data.fullName),e.accessRepairMessage="GitHub access repaired. Your anonymous URL and published commit are unchanged.",await e.urlSelected(!0)}catch{y(C)&&(e.accessRepairMessage="Unable to repair GitHub access. Check the App's repository permissions in Manage access, then retry. Your published snapshot has not been replaced.")}finally{e.repairingGitHubAccess=!1,b(C)}},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 pe()}catch{}}};function Ne(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:tt(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function qe(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function X(){let C=new URLSearchParams(window.location.search).get("billingDraft");if(C){N.restore();try{let B=(await t.get("/api/billing/draft/"+encodeURIComponent(C))).data;if(B.path!==o.path())throw new Error("Wrong task");w=B.values.conference||null;for(let K of["sourceUrl","terms","repoId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(B.values,K)&&(e[K]=B.values[K]);return e.options?.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),T=B.id,M=JSON.stringify(N.checkpoint()),e.draftRestored=!0,e.hostingReview=!0,e.sourceUrl&&await qe(),o.replace?.(o.path()),!0}catch{e.billingError="The checkout draft could not be restored. Retry by reloading this page; any local draft is still available."}}let O;try{O=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!O||O.path!==o.path()||Date.now()-O.savedAt>=30*6e4)return N.restore()?(e.sourceUrl&&await qe(),!0):!1;N.restore();for(let B of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(O.draft,B)&&(e[B]=O.draft[B]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await qe(),sessionStorage.removeItem("github-access-draft"),!0}Qe(()=>{!i.repoId&&!i.pullRequestId&&!i.gistId&&u(X,0),i.repoId&&i.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=i.repoId,t.get("/api/repo/"+e.repoId).then(async C=>{e.accessRepairAllowed=!["removed","archived","preparing","queue","download","removing","expiring"].includes(C.data.status),e.githubConnection=C.data.connection||"oauth",e.sourceUrl="https://github.com/"+C.data.source.fullName,e._originalFullName=C.data.source.fullName,e.terms=C.data.options.terms.filter(O=>O).join(`
`),e.source=C.data.source,e.role=C.data.role||"owner",e._existingNever=C.data.options.expirationMode==="never",e._savedExpirationDate=C.data.options.expirationDate?new Date(C.data.options.expirationDate):null,e.coauthors=C.data.coauthors||[],e._originalBranch=C.data.source.branch,e.options=Object.assign({},e.options,C.data.options),e.conference=C.data.conference,e._originalConference=C.data.conference,e.repositoryID=C.data.source.repositoryID,e._originalRepositoryID=C.data.source.repositoryID,C.data.options.expirationDate&&(e.options.expirationDate=new Date(C.data.options.expirationDate)),E=S(parseGithubUrl(e.sourceUrl)),!await X()&&(await Promise.all([pe(),ue()]),Co())},()=>{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 C=>{if(e.githubConnection=C.data.connection||"oauth",e.sourceUrl="https://github.com/"+C.data.source.repositoryFullName+"/pull/"+C.data.source.pullRequestId,e.terms=C.data.options.terms.filter(O=>O).join(`
`),e.source=C.data.source,e.options=Object.assign({},e.options,C.data.options),e.conference=C.data.conference,e._originalConference=C.data.conference,C.data.options.expirationDate&&(e.options.expirationDate=new Date(C.data.options.expirationDate)),E=S(parseGithubUrl(e.sourceUrl)),!await X())try{await ol()}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 C=>{e.sourceUrl="https://gist.github.com/"+C.data.source.gistId,e.terms=C.data.options.terms.filter(O=>O).join(`
`),e.source=C.data.source,e.options=Object.assign({},e.options,C.data.options),e.conference=C.data.conference,e._originalConference=C.data.conference,C.data.options.expirationDate&&(e.options.expirationDate=new Date(C.data.options.expirationDate)),E=S(parseGithubUrl(e.sourceUrl)),!await X()&&await sl()},()=>{o.url("/404")}))}),t.get("/github/connections").then(C=>{e.githubConnections=C.data,!i.repoId&&!i.pullRequestId&&!i.gistId&&e.githubConnection===void 0&&C.data.appEnabled&&C.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&qe())}).catch(()=>{}).finally(()=>{!v&&!i.repoId&&!i.pullRequestId&&!i.gistId&&e.userReposStatus==="idle"&&e.loadUserRepos()}),e.urlSelected=async(C=!1)=>{let O=++c;e.previousConfigurations=[],e.previousConfigurationId="";let B;try{B=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,e.details=null,fe(),Yt.cancel(),On.cancel(),Mn.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",Ee("sourceUrl","github",!1);return}let K=S(B),ae=C||E===K;E=K,e.sourceUrlError="",Ee("sourceUrl","github",!0),fe();let ye=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,setTimeout(()=>{let Ge=window.document.getElementById("sourceUrl");if(Ge){try{Ge.setSelectionRange(0,0)}catch{}Ge.scrollLeft=0}},50),ye&&u(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!ae&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],ae||(e.source={type:"GitHubStream",branch:"",commit:""}),Yt.cancel(),On.cancel(),Mn.cancel(),So.clear(),Eo.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",rf(),e.detectedType=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1,e._preservingDraft=ae;try{B.gistId&&!B.repo?(e.detectedType="gist",e.source={gistId:B.gistId},await sl()):B.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:B.owner+"/"+B.repo,pullRequestId:B.pullRequestId},await ol()):(e.detectedType="repo",Y(),await Promise.all([pe(),ue()]),Co())}catch{}finally{O===c&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let C=e.branches.filter(B=>B.name==e.source.branch)[0];if(!C)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=C.commit),e.readme=C.readme,await ue(),Co()}),e.getBranches=async C=>{let O=parseGithubUrl(e.sourceUrl),B=m();try{let K=await t.get(`/api/repo/${O.owner}/${O.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&tt(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:C===!0||e.reconnectingSource?"1":"0",repositoryID:Ne()}});if(!y(B))return;e.branches=K.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let ae=e.branches.filter(ye=>ye.name==e.source.branch);ae.length>0&&(!(!e.reconnectingSource&&!C&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=ae[0].commit),e.readme=ae[0].readme,await ue(C))}catch(K){if(!y(B))return;e.branches=[],e.sourceUnreachable=K&&(K.status===404||K.data&&K.data.error==="repo_not_found"),e.details=null,x(K)}finally{b(B)}};async function pe(){let C=parseGithubUrl(e.sourceUrl),O=m();try{No(),fe();let B=await t.get(`/api/repo/${C.owner}/${C.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&tt(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,repositoryID:Ne(),force:"1"}});if(!y(O))return;e.details=B.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(B){if(!y(O))return;throw x(B),B}finally{b(O)}}async function ue(C){if(e.readme&&!C)return e.readme;let O=parseGithubUrl(e.sourceUrl),B=m();try{let K=await t.get(`/api/repo/${O.owner}/${O.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&tt(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:C===!0?"1":"0",branch:e.source.branch,repositoryID:Ne()}});y(B,!0)&&(e.readme=K.data)}catch{y(B,!0)&&(e.readme="")}finally{b(B)}}let me={magicalBraces:!0},be=C=>C.startsWith("/")&&!C.endsWith("/")&&jn(yo(C.slice(1),me),me)===C.slice(1),Ve=()=>Object.keys(e.preserve.picked).filter(C=>e.preserve.picked[C]).sort().map(C=>"/"+jn(C,me)),D=C=>"/"+jn(C,me)+"/**",A=C=>"!/"+jn(C,me)+"/",U=()=>String(e.preserve.patterns||"").split(`
`).map(C=>C.trim()).filter(Boolean),J=null,W=null,te=new Set,le=0,se=null,ie=()=>!1;function ne(){let C=le+"\0"+e.preserve.patterns;if(C!==se){se=C;try{ie=Ja(Ya([...Ve(),...U()]))}catch{ie=()=>!1}}return ie}function we(C){let O=new Map([["",{dirs:[],files:[]}]]);for(let B of C){let K=B.split("/"),ae="";for(let ye=0;ye<K.length-1;ye++){let Ge=K.slice(0,ye+1).join("/");O.has(Ge)||(O.set(Ge,{dirs:[],files:[]}),O.get(ae).dirs.push(Ge)),ae=Ge}O.get(ae).files.push(B)}for(let B of O.values())B.dirs.sort();return{files:C,dirs:O,descendants:new Map}}function ce(C){return J.descendants.has(C)||J.descendants.set(C,J.files.filter(O=>O.startsWith(C+"/"))),J.descendants.get(C)}let Se=C=>ne()(C);function Te(C){let O=ce(C),B=0;for(let K of O)Se(K)&&B++;return B===0?"none":B===O.length?"all":"some"}e.preserve={open:!1,loading:!1,error:"",truncated:!1,commit:"",search:"",expanded:{},picked:{},patterns:"",patternsOpen:!1},e.preserveSummary=()=>{let C=(e.options?.preserveFiles||[]).map(O=>String(O).trim()).filter(Boolean).map(O=>be(O)?yo(O.slice(1),me):O);return C.length?C.slice(0,2).join(", ")+(C.length>2?` and ${C.length-2} more`:""):"None. Every file is redacted."};async function Le(){let C=e.source?.commit;if(!(J&&e.preserve.commit===C)){e.preserve.loading=!0,e.preserve.error="",J=null,W=null;try{let O=parseGithubUrl(e.sourceUrl),B=await t.get(`/api/repo/${O.owner}/${O.repo}/tree`,{params:{commit:C,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&i.repoId&&tt(e.sourceUrl)===e._originalFullName?i.repoId:void 0,repositoryID:Ne()}});if(e.source?.commit!==C)return;let K=Array.isArray(B.data.binaryFiles)?B.data.binaryFiles:[];J=pn(we(B.data.files||[])),W=K.length?pn(we([...B.data.files||[],...K])):J,te=pn(new Set(K)),e.preserve.commit=C,e.preserve.truncated=!!B.data.truncated,e.previewFile||Yt()}catch{e.preserve.error="The file list could not be loaded from GitHub. You can still use patterns.",e.preserve.patternsOpen=!0}finally{e.preserve.loading=!1}}}e.watch("source.commit",C=>{e.previewFile&&e.openPreviewFile(""),e.detectedType==="repo"&&C&&e.sourceUrl&&Le().catch(()=>{})}),e.openPreserveFiles=()=>{let C={},O=[];for(let K of e.options?.preserveFiles||[]){let ae=String(K).trim();ae&&(!O.length&&be(ae)?C[yo(ae.slice(1),me)]=!0:O.push(ae))}let B={};for(let K of Object.keys(C)){let ae=K.split("/");for(let ye=1;ye<ae.length;ye++)B[ae.slice(0,ye).join("/")]=!0}Object.assign(e.preserve,{open:!0,search:"",picked:C,expanded:B,patterns:O.join(`
`),patternsOpen:O.length>0}),e.mobileWorkspace&&(e.mobilePane="settings"),le++,u(()=>{let K=document.getElementById("preserve-files-dialog");K?.showModal&&!K.open&&K.showModal(),document.getElementById("preserve-files-search")?.focus()},0),Le()},e.closePreserveFiles=()=>{document.getElementById("preserve-files-dialog")?.close?.(),e.preserve.open=!1},e.savePreserveFiles=()=>{e.options.preserveFiles=Ya([...Ve(),...U()]),e.closePreserveFiles()},e.preserveRows=()=>{if(!J)return[];let C=ne(),O=(ye,Ge,Tt)=>{let st=!!e.preserve.picked[ye],kt=C(ye);return{kind:"file",path:ye,label:Tt,depth:Ge,state:kt?"all":"none",locked:!st&&kt,note:!st&&kt?"matched by a pattern":st&&!kt?"excluded by a pattern":""}},B=String(e.preserve.search||"").trim().toLowerCase();if(B)return J.files.filter(ye=>ye.toLowerCase().includes(B)).slice(0,300).map(ye=>O(ye,0,ye));let K=[],ae=(ye,Ge)=>{let Tt=J.dirs.get(ye);for(let st of Tt.dirs){let kt=!!e.preserve.expanded[st],ii=U().includes(D(st));K.push({kind:"dir",path:st,label:st.slice(ye?ye.length+1:0)+"/",depth:Ge,open:kt,state:Te(st),locked:!1,note:ii?"whole folder":""}),kt&&ae(st,Ge+1)}for(let st of Tt.files)K.push(O(st,Ge,st.slice(ye?ye.length+1:0)))};return ae("",0),K},e.preserveCount=()=>J?J.files.filter(Se).length:0,e.togglePreserveDir=C=>{e.preserve.expanded[C]=!e.preserve.expanded[C]},e.togglePreserveFile=C=>{e.preserve.picked[C]=!e.preserve.picked[C],le++},e.togglePreserveFolder=C=>{let O=D(C),B=A(C),K=U().filter(ye=>ye!==O&&ye!==B),ae=Te(C)==="all"||U().includes(O);for(let ye of ce(C))e.preserve.picked[ye]=!1;le++,e.preserve.patterns=(ae?K:[...K,O]).join(`
`),ae&&ce(C).some(Se)&&(e.preserve.patterns=[...K,B].join(`
`))};let Je=/^readme(\.[^/]*)?$/i,je=[".md",".markdown",".mdown",".mkdn",".rst",".txt",""],Ce=["README.md","README","README.markdown","README.rst","README.txt","readme.md"],$e=C=>{let O=Be(C),B=O.indexOf("."),K=je.indexOf(B===-1?"":O.slice(B).toLowerCase());return K===-1?je.length:K},rt=()=>!!J&&!!e.preserve.commit&&e.preserve.commit===e.source?.commit;e.readmePath=()=>{if(!rt())return"";for(let C of[".github","","docs"]){let O=(J.dirs.get(C)?.files||[]).filter(B=>Je.test(Be(B)));if(O.length)return O.sort((B,K)=>$e(B)-$e(K)||he(B,K))[0]}return""},e.readmeName=()=>Be(e.readmePath())||"README.md";let ut={key:null,fn:()=>!1},Pt=()=>{let C=(e.options?.preserveFiles||[]).map(B=>String(B).trim()).filter(Boolean),O=C.join(`
`);if(O!==ut.key){let B=()=>!1;try{C.length&&(B=Ja(C))}catch{}ut={key:O,fn:B}}return ut.fn};e.pathPreserved=C=>!!C&&Pt()(C),e.readmePreserved=()=>{if(e.detectedType!=="repo")return!1;let C=Pt();if(rt()){let O=e.readmePath();return!!O&&C(O)}return Ce.some(O=>C(O))},e.previewPreserved=()=>e.detectedType==="repo"&&(e.previewFile?e.pathPreserved(e.previewFile):e.readmePreserved());function wt(){let C={terms:e.terms?e.terms.split(`
`):[],filePath:e.previewOpenPath()||"README.md",preserveFiles:e.options.preserveFiles||[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(C.branchName=e.source.branch);try{let O=parseGithubUrl(e.sourceUrl);C.repoName=`${O.owner}/${O.repo}`}catch{}return C}function at(C,O,B){let K=null,ae=0,ye=()=>{if(e.detectedType!==C)return;K&&d.cancel(K);let Ge=++ae;e.previewStatus="loading",K=d(()=>{K=null;let Tt=O();if(!Tt){e.previewStatus="idle";return}t.post("/api/anonymize-preview",Tt).then(st=>{Ge===ae&&(B(st.data,Tt),e.previewStatus="ready")}).catch(()=>{Ge===ae&&(e.previewStatus="error")})},200)};return ye.cancel=()=>{ae++,K&&d.cancel(K),K=null},e.on("dispose",ye.cancel),ye}e.retryPreview=()=>{e.detectedType==="repo"&&(e.previewFile&&typeof rn!="string"?tl(e.previewFile):Yt()),e.detectedType==="pr"&&On(),e.detectedType==="gist"&&Mn()};let Ie=pn(Ls(e));Object.defineProperty(e,"previewViewer",{get:()=>Ie}),wa(Ie,e),Object.assign(Ie,{options:{},files:[],paths:[],content:null,type:"loading",sidebarHidden:!1,sidebarCollapsed:!0,moreOpen:!1,tocOpen:!1,gotoOpen:!1,mdFindOpen:!1,mdFindQuery:"",mdFindTotal:0,mdFindIndex:0}),Ie.preview=!0,Ie.fileSize=C=>C===Ie.filePath&&typeof rn=="string"?new Blob([rn]).size:!e.previewFile&&e.readme?new Blob([e.readme]).size:null,Ie.openPreserveFiles=()=>e.openPreserveFiles(),Ie.previewPreserved=()=>e.previewPreserved(),Ie.retryContent=()=>e.retryPreview();let sn=C=>te.has(C)||/\.(pdf|png|jpe?g|gif|svg|ico|bmp|tiff?|webp|avif|heic|heif|mp4|webm|mp3|wav|zip|bin)$/i.test(C),wo=(C="")=>({path:C,loading:!1,note:"",loadError:""});e.previewFile="",e.previewDoc=wo();let xo=0,rn=null;e.previewOpenPath=()=>e.previewFile||e.readmePath(),e.openPreviewFile=C=>{if(C=C||"",C&&C===e.readmePath()&&(C=""),xo++,rn=null,ti(),Yt.cancel(),e.previewFile=C,e.previewDoc=wo(C),Ie.sidebarCollapsed=!0,Ie.content=null,!C){e.readme?Yt():e.previewStatus="idle";return}if(sn(C)){gr("binary"),e.previewStatus="ready";return}tl(C)};function rf(){xo++,rn=null,e.previewFile="",e.previewDoc=wo(),Ie.sidebarCollapsed=!0,Ie.content=null}function tl(C){let O=++xo;rn=null,Object.assign(e.previewDoc,{loading:!0,loadError:""}),e.previewStatus="loading";let B;try{B=parseGithubUrl(e.sourceUrl)}catch{B=null}if(!B||!e.source?.commit){Object.assign(e.previewDoc,{loading:!1,loadError:"The repository is still loading. Try again in a moment."}),e.previewStatus="error";return}t.get(`/api/repo/${B.owner}/${B.repo}/file`,{params:{commit:e.source.commit,path:C,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&i.repoId&&tt(e.sourceUrl)===e._originalFullName?i.repoId:void 0,repositoryID:Ne()},transformResponse:K=>K}).then(K=>{if(O!==xo)return;e.previewDoc.loading=!1;let ae=typeof K.headers=="function"&&K.headers("content-type")||"";if(/json/i.test(ae)){let ye=null;try{ye=JSON.parse(K.data)}catch{}if(ye&&ye.binary===!0){gr("binary"),e.previewStatus="ready";return}}rn=typeof K.data=="string"?K.data:"",Yt()},K=>{if(O!==xo)return;e.previewDoc.loading=!1;let ae=pr(K);if(ae==="file_too_big"){gr("too_big"),e.previewStatus="ready";return}e.previewDoc.loadError=Jn.ERRORS[ae]||"GitHub did not return this file.",e.previewStatus="error"})}let ei;function ti(){ei&&window.URL.revokeObjectURL(ei),ei=void 0,Ie.url=void 0}e.on("dispose",ti);function gr(C){ti(),e.previewDoc.note=C,Ie.prepareFile(e.previewPathName(e.previewOpenPath()||e.readmeName())),Ie.type=C==="too_big"?"error":"binary",Ie.content=C==="too_big"?"file_too_big":"binary"}function af(C){try{let O=parseGithubUrl(e.sourceUrl),B=e.source.branch||e.details&&e.details.defaultBranch||"main",K=C&&C.includes("/")?C.slice(0,C.lastIndexOf("/")+1):"";return`https://github.com/${O.owner}/${O.repo}/raw/${B}/${K}`}catch{return""}}let nl=at("repo",()=>e.previewFile?typeof rn!="string"?null:{content:rn,options:wt()}:e.readme?{content:e.readme,options:wt()}:null,C=>{if(typeof C?.content!="string")throw Error("Invalid preview response");ti(),window.URL?.createObjectURL&&(Ie.url=ei=window.URL.createObjectURL(new Blob([C.content],{type:"text/plain"})));let O=e.previewOpenPath()||e.readmeName();Ie.prepareFile(e.previewPathName(O)),Ie.fileBaseUrl=af(O),Ie.renderFileContent(C.content,Ie.type,Ie.fileBaseUrl,"text/plain"),e.previewFile||(e.anonymize_readme=C.content)}),Yt=()=>{e.previewFile&&typeof rn!="string"||nl()};Yt.cancel=nl.cancel;let ko=lt(new Map),vr=new Set,yr=new Set,es="",ts=null,ni=()=>String(e.terms||"").split(`
`):[],filePath:e.previewOpenPath()||"README.md",preserveFiles:e.options.preserveFiles||[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(C.branchName=e.source.branch);try{let O=parseGithubUrl(e.sourceUrl);C.repoName=`${O.owner}/${O.repo}`}catch{}return C}function at(C,O,B){let K=null,ae=0,ye=()=>{if(e.detectedType!==C)return;K&&u.cancel(K);let Ge=++ae;e.previewStatus="loading",K=u(()=>{K=null;let Tt=O();if(!Tt){e.previewStatus="idle";return}t.post("/api/anonymize-preview",Tt).then(st=>{Ge===ae&&(B(st.data,Tt),e.previewStatus="ready")}).catch(()=>{Ge===ae&&(e.previewStatus="error")})},200)};return ye.cancel=()=>{ae++,K&&u.cancel(K),K=null},e.on("dispose",ye.cancel),ye}e.retryPreview=()=>{e.detectedType==="repo"&&(e.previewFile&&typeof rn!="string"?tl(e.previewFile):Yt()),e.detectedType==="pr"&&On(),e.detectedType==="gist"&&Mn()};let Ie=pn(Ls(e));Object.defineProperty(e,"previewViewer",{get:()=>Ie}),wa(Ie,e),Object.assign(Ie,{options:{},files:[],paths:[],content:null,type:"loading",sidebarHidden:!1,sidebarCollapsed:!0,moreOpen:!1,tocOpen:!1,gotoOpen:!1,mdFindOpen:!1,mdFindQuery:"",mdFindTotal:0,mdFindIndex:0}),Ie.preview=!0,Ie.fileSize=C=>C===Ie.filePath&&typeof rn=="string"?new Blob([rn]).size:!e.previewFile&&e.readme?new Blob([e.readme]).size:null,Ie.openPreserveFiles=()=>e.openPreserveFiles(),Ie.previewPreserved=()=>e.previewPreserved(),Ie.retryContent=()=>e.retryPreview();let sn=C=>te.has(C)||/\.(pdf|png|jpe?g|gif|svg|ico|bmp|tiff?|webp|avif|heic|heif|mp4|webm|mp3|wav|zip|bin)$/i.test(C),wo=(C="")=>({path:C,loading:!1,note:"",loadError:""});e.previewFile="",e.previewDoc=wo();let xo=0,rn=null;e.previewOpenPath=()=>e.previewFile||e.readmePath(),e.openPreviewFile=C=>{if(C=C||"",C&&C===e.readmePath()&&(C=""),xo++,rn=null,ti(),Yt.cancel(),e.previewFile=C,e.previewDoc=wo(C),Ie.sidebarCollapsed=!0,Ie.content=null,!C){e.readme?Yt():e.previewStatus="idle";return}if(sn(C)){gr("binary"),e.previewStatus="ready";return}tl(C)};function rf(){xo++,rn=null,e.previewFile="",e.previewDoc=wo(),Ie.sidebarCollapsed=!0,Ie.content=null}function tl(C){let O=++xo;rn=null,Object.assign(e.previewDoc,{loading:!0,loadError:""}),e.previewStatus="loading";let B;try{B=parseGithubUrl(e.sourceUrl)}catch{B=null}if(!B||!e.source?.commit){Object.assign(e.previewDoc,{loading:!1,loadError:"The repository is still loading. Try again in a moment."}),e.previewStatus="error";return}t.get(`/api/repo/${B.owner}/${B.repo}/file`,{params:{commit:e.source.commit,path:C,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&i.repoId&&tt(e.sourceUrl)===e._originalFullName?i.repoId:void 0,repositoryID:Ne()},transformResponse:K=>K}).then(K=>{if(O!==xo)return;e.previewDoc.loading=!1;let ae=typeof K.headers=="function"&&K.headers("content-type")||"";if(/json/i.test(ae)){let ye=null;try{ye=JSON.parse(K.data)}catch{}if(ye&&ye.binary===!0){gr("binary"),e.previewStatus="ready";return}}rn=typeof K.data=="string"?K.data:"",Yt()},K=>{if(O!==xo)return;e.previewDoc.loading=!1;let ae=pr(K);if(ae==="file_too_big"){gr("too_big"),e.previewStatus="ready";return}e.previewDoc.loadError=Jn.ERRORS[ae]||"GitHub did not return this file.",e.previewStatus="error"})}let ei;function ti(){ei&&window.URL.revokeObjectURL(ei),ei=void 0,Ie.url=void 0}e.on("dispose",ti);function gr(C){ti(),e.previewDoc.note=C,Ie.prepareFile(e.previewPathName(e.previewOpenPath()||e.readmeName())),Ie.type=C==="too_big"?"error":"binary",Ie.content=C==="too_big"?"file_too_big":"binary"}function af(C){try{let O=parseGithubUrl(e.sourceUrl),B=e.source.branch||e.details&&e.details.defaultBranch||"main",K=C&&C.includes("/")?C.slice(0,C.lastIndexOf("/")+1):"";return`https://github.com/${O.owner}/${O.repo}/raw/${B}/${K}`}catch{return""}}let nl=at("repo",()=>e.previewFile?typeof rn!="string"?null:{content:rn,options:wt()}:e.readme?{content:e.readme,options:wt()}:null,C=>{if(typeof C?.content!="string")throw Error("Invalid preview response");ti(),window.URL?.createObjectURL&&(Ie.url=ei=window.URL.createObjectURL(new Blob([C.content],{type:"text/plain"})));let O=e.previewOpenPath()||e.readmeName();Ie.prepareFile(e.previewPathName(O)),Ie.fileBaseUrl=af(O),Ie.renderFileContent(C.content,Ie.type,Ie.fileBaseUrl,"text/plain"),e.previewFile||(e.anonymize_readme=C.content)}),Yt=()=>{e.previewFile&&typeof rn!="string"||nl()};Yt.cancel=nl.cancel;let ko=lt(new Map),vr=new Set,yr=new Set,es="",ts=null,ni=()=>String(e.terms||"").split(`
`).filter(C=>C.trim());function lf(){ts=null;let C=ni(),O=C.join(`
`);O!==es&&(ko.clear(),yr.clear(),es=O);let B=[...vr].filter(K=>!ko.has(K));if(vr.clear(),!(!B.length||!C.length))for(let K=0;K<B.length;K+=400){let ae=B.slice(K,K+400);t.post("/api/anonymize-preview",{contents:ae,options:{terms:C,image:!0,link:!0}}).then(ye=>{if(es!==O||ni().join(`
`)!==O)return;let Ge=ye.data?.contents;if(!Array.isArray(Ge)||Ge.length!==ae.length)throw Error("Invalid preview response");ae.forEach((Tt,st)=>ko.set(Tt,typeof Ge[st]=="string"?Ge[st]:Tt))}).catch(()=>{es===O&&ae.forEach(ye=>yr.add(ye))})}}e.previewName=C=>{if(!C||!ni().length)return C;if(es===ni().join(`
`)){if(ko.has(C))return ko.get(C);if(yr.has(C))return C}return vr.add(C),ts||(ts=d(lf,120)),C},e.previewPathName=C=>{C=String(C||"");let O=C.lastIndexOf("/");return O<0?e.previewName(C):e.previewName(C.slice(0,O))+"/"+e.previewName(C.slice(O+1))},e.watch(()=>[e.repoId,e.previewPathName(e.previewOpenPath()||e.readmeName()),e.previewTreeFiles()],()=>{Ie.repoId=e.repoId||"repository",Ie.filePath=e.previewPathName(e.previewOpenPath()||e.readmeName()),Ie.paths=Ie.filePath.split("/"),Ie.files=e.previewTreeFiles(),Ie.loadedFolders=Object.fromEntries([...W?.dirs.keys()||[]].map(C=>[e.previewName(C),!0]))},!0),e.on("dispose",()=>{ts&&d.cancel(ts)});function Co(){!e.anonymize||!e.anonymize.terms||Yt()}async function ol(){let C=parseGithubUrl(e.sourceUrl),O=m();try{No(),fe();let B=await t.get(`/api/pr/${C.owner}/${C.repo}/${C.pullRequestId}`,{params:{connection:e.githubConnection}});if(!y(O))return;e.details=B.data,e.pullRequestId||(e.pullRequestId=C.repo+"-PR"+C.pullRequestId+"-"+generateRandomId(4))}catch(B){if(!y(O))return;throw x(B),B}finally{b(O)}}let Eo=lt(new Map);function df(){let C=new Set,O=e.details&&e.details.pullRequest;if(!O)return C;typeof O.title=="string"&&C.add(O.title),typeof O.body=="string"&&C.add(O.body),typeof O.diff=="string"&&C.add(O.diff);let B=O.comments||[];for(let K of B)typeof K.author=="string"&&C.add(K.author),typeof K.body=="string"&&C.add(K.body);return C}let On=at("pr",()=>{let C=df(),O=Array.from(C);return O.length===0?null:{contents:O,options:wt()}},(C,O)=>{if(!Array.isArray(C?.contents)||C.contents.length!==O.contents.length||C.contents.some(ae=>typeof ae!="string"))throw Error("Invalid preview response");let B=O.contents,K=new Map;for(let ae=0;ae<B.length&&ae<C.contents.length;ae++)K.set(B[ae],C.contents[ae]);Eo.clear(),K.forEach((ae,ye)=>Eo.set(ye,ae))});e.anonymizePrContent=function(C){return C&&(Eo.has(C)?Eo.get(C):"")};async function sl(){let C=parseGithubUrl(e.sourceUrl),O=m();try{No(),fe(),e.gistOAuthRequired=!1,e.gistAppRequired=!1;let B=await t.get(`/api/gist/source/${C.gistId}`);if(!y(O))return;e.details=B.data,e.gistId||(e.gistId="gist-"+C.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(B){if(!y(O))return;if(B.data?.error==="github_app_reconnect_required"){e.gistAppRequired=!0,Se("sourceUrl","missing",!1);return}if(B.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,Se("sourceUrl","missing",!1);return}throw x(B),B}finally{b(O)}}let So=lt(new Map);function uf(){let C=new Set,O=e.details&&e.details.gist;if(!O)return C;typeof O.description=="string"&&C.add(O.description),typeof O.ownerLogin=="string"&&C.add(O.ownerLogin);let B=O.files||[];for(let ae of B)typeof ae.filename=="string"&&C.add(ae.filename),typeof ae.content=="string"&&C.add(ae.content);let K=O.comments||[];for(let ae of K)typeof ae.author=="string"&&C.add(ae.author),typeof ae.body=="string"&&C.add(ae.body);return C}let Mn=at("gist",()=>{let C=uf(),O=Array.from(C);return O.length===0?null:{contents:O,options:wt()}},(C,O)=>{if(!Array.isArray(C?.contents)||C.contents.length!==O.contents.length||C.contents.some(ae=>typeof ae!="string"))throw Error("Invalid preview response");let B=O.contents,K=new Map;for(let ae=0;ae<B.length&&ae<C.contents.length;ae++)K.set(B[ae],C.contents[ae]);So.clear(),K.forEach((ae,ye)=>So.set(ye,ae)),br()});e.anonymizeGistContent=function(C){return C&&(So.has(C)?So.get(C):"")},e.previewGistFiles=[];function br(){let C=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=C.map(O=>({filename:e.anonymizeGistContent(O.filename),content:e.anonymizeGistContent(O.content),language:O.language}))}e.watch("details.gist.files",br,!0),e.watch("terms",br);function cf(){let C=e.conference;if(e.conference_data=null,!C)return;let O=C===w||e.isUpdate&&C===e._originalConference;C!==w&&(w=null),t.get("/api/conferences/"+C).then(B=>{e.conference===C&&(e.conference_data=B.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!O&&(e.options.expirationDate=new Date(e.conference_data.endDate),e.options.expirationMode="remove",e.options.update=e.conference_data.options.update,e.options.image=e.conference_data.options.image,e.options.pdf=e.conference_data.options.pdf,e.options.notebook=e.conference_data.options.notebook,e.options.link=e.conference_data.options.link))},()=>{e.conference===C&&(e.conference_data=null)})}function No(){Se("repoId","used",!0),Se("repoId","format",!0),Se("pullRequestId","used",!0),Se("pullRequestId","format",!0),Se("gistId","used",!0),Se("gistId","format",!0),Se("sourceUrl","used",!0),Se("sourceUrl","missing",!0),Se("sourceUrl","access",!0),Se("sourceUrl","github",!0),Se("commit","exists",!0),Se("conference","activated",!0),Se("terms","format",!0),e.termHints=[]}function oi(){if(e.detectedType==="repo"&&e.options.expirationMode==="never")return!1;let C=e.anonymize&&e.anonymize.expirationDate;return!e.options.expirationDate||C&&C.invalid?(C&&C.setDirty&&C.setDirty(),e.error="Pl Line truncated
`)){if(ko.has(C))return ko.get(C);if(yr.has(C))return C}return vr.add(C),ts||(ts=u(lf,120)),C},e.previewPathName=C=>{C=String(C||"");let O=C.lastIndexOf("/");return O<0?e.previewName(C):e.previewName(C.slice(0,O))+"/"+e.previewName(C.slice(O+1))},e.watch(()=>[e.repoId,e.previewPathName(e.previewOpenPath()||e.readmeName()),e.previewTreeFiles()],()=>{Ie.repoId=e.repoId||"repository",Ie.filePath=e.previewPathName(e.previewOpenPath()||e.readmeName()),Ie.paths=Ie.filePath.split("/"),Ie.files=e.previewTreeFiles(),Ie.loadedFolders=Object.fromEntries([...W?.dirs.keys()||[]].map(C=>[e.previewName(C),!0]))},!0),e.on("dispose",()=>{ts&&u.cancel(ts)});function Co(){!e.anonymize||!e.anonymize.terms||Yt()}async function ol(){let C=parseGithubUrl(e.sourceUrl),O=m();try{No(),fe();let B=await t.get(`/api/pr/${C.owner}/${C.repo}/${C.pullRequestId}`,{params:{connection:e.githubConnection}});if(!y(O))return;e.details=B.data,e.pullRequestId||(e.pullRequestId=C.repo+"-PR"+C.pullRequestId+"-"+generateRandomId(4))}catch(B){if(!y(O))return;throw x(B),B}finally{b(O)}}let So=lt(new Map);function df(){let C=new Set,O=e.details&&e.details.pullRequest;if(!O)return C;typeof O.title=="string"&&C.add(O.title),typeof O.body=="string"&&C.add(O.body),typeof O.diff=="string"&&C.add(O.diff);let B=O.comments||[];for(let K of B)typeof K.author=="string"&&C.add(K.author),typeof K.body=="string"&&C.add(K.body);return C}let On=at("pr",()=>{let C=df(),O=Array.from(C);return O.length===0?null:{contents:O,options:wt()}},(C,O)=>{if(!Array.isArray(C?.contents)||C.contents.length!==O.contents.length||C.contents.some(ae=>typeof ae!="string"))throw Error("Invalid preview response");let B=O.contents,K=new Map;for(let ae=0;ae<B.length&&ae<C.contents.length;ae++)K.set(B[ae],C.contents[ae]);So.clear(),K.forEach((ae,ye)=>So.set(ye,ae))});e.anonymizePrContent=function(C){return C&&(So.has(C)?So.get(C):"")};async function sl(){let C=parseGithubUrl(e.sourceUrl),O=m();try{No(),fe(),e.gistOAuthRequired=!1,e.gistAppRequired=!1;let B=await t.get(`/api/gist/source/${C.gistId}`);if(!y(O))return;e.details=B.data,e.gistId||(e.gistId="gist-"+C.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(B){if(!y(O))return;if(B.data?.error==="github_app_reconnect_required"){e.gistAppRequired=!0,Ee("sourceUrl","missing",!1);return}if(B.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,Ee("sourceUrl","missing",!1);return}throw x(B),B}finally{b(O)}}let Eo=lt(new Map);function uf(){let C=new Set,O=e.details&&e.details.gist;if(!O)return C;typeof O.description=="string"&&C.add(O.description),typeof O.ownerLogin=="string"&&C.add(O.ownerLogin);let B=O.files||[];for(let ae of B)typeof ae.filename=="string"&&C.add(ae.filename),typeof ae.content=="string"&&C.add(ae.content);let K=O.comments||[];for(let ae of K)typeof ae.author=="string"&&C.add(ae.author),typeof ae.body=="string"&&C.add(ae.body);return C}let Mn=at("gist",()=>{let C=uf(),O=Array.from(C);return O.length===0?null:{contents:O,options:wt()}},(C,O)=>{if(!Array.isArray(C?.contents)||C.contents.length!==O.contents.length||C.contents.some(ae=>typeof ae!="string"))throw Error("Invalid preview response");let B=O.contents,K=new Map;for(let ae=0;ae<B.length&&ae<C.contents.length;ae++)K.set(B[ae],C.contents[ae]);Eo.clear(),K.forEach((ae,ye)=>Eo.set(ye,ae)),br()});e.anonymizeGistContent=function(C){return C&&(Eo.has(C)?Eo.get(C):"")},e.previewGistFiles=[];function br(){let C=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=C.map(O=>({filename:e.anonymizeGistContent(O.filename),content:e.anonymizeGistContent(O.content),language:O.language}))}e.watch("details.gist.files",br,!0),e.watch("terms",br);function cf(){let C=e.conference;if(e.conference_data=null,!C)return;let O=C===w||e.isUpdate&&C===e._originalConference;C!==w&&(w=null),t.get("/api/conferences/"+C).then(B=>{e.conference===C&&(e.conference_data=B.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!O&&(e.options.expirationDate=new Date(e.conference_data.endDate),e.options.expirationMode="remove",e.options.update=e.conference_data.options.update,e.options.image=e.conference_data.options.image,e.options.pdf=e.conference_data.options.pdf,e.options.notebook=e.conference_data.options.notebook,e.options.link=e.conference_data.options.link))},()=>{e.conference===C&&(e.conference_data=null)})}function No(){Ee("repoId","used",!0),Ee("repoId","format",!0),Ee("pullRequestId","used",!0),Ee("pullRequestId","format",!0),Ee("gistId","used",!0),Ee("gistId","format",!0),Ee("sourceUrl","used",!0),Ee("sourceUrl","missing",!0),Ee("sourceUrl","access",!0),Ee("sourceUrl","github",!0),Ee("commit","exists",!0),Ee("conference","activated",!0),Ee("terms","format",!0),e.termHints=[]}function oi(){if(e.detectedType==="repo"&&e.options.expirationMode==="never")return!1;let C=e.anonymize&&e.anonymize.expirationDate;return!e.options.expirationDate||C&&C.invalid?(C&&C.setDirty&&C.setDirty(),e.error="Pl Line truncated
`).filter(ye=>ye),connection:e.githubConnection,fullName:`${B.owner}/${B.repo}`,repository:e.sourceUrl,reconnectRepositoryId:e.reconnectRepositoryId,options:e.options,source:e.source,conference:e.conference};e.details&&(K.options.pageSource=e.details.pageSource),No();let ae=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(ae,K,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/status/"+e.repoId},ye=>{if(ye.data){let Ge=["quota_exceeded","subscription_required_for_never_expiration"].includes(ye.data.error);Ge||r("ERRORS."+ye.data.error).then(Tt=>{e.error=Tt},console.error),si(ye.data.error),Ge&&(ye.data.error==="subscription_required_for_never_expiration"&&(e._existingNever=!1),e.hostingQuotaBlocked=!0,e.hostingReview=!0,We(()=>document.getElementById("repository-hosting")?.scrollIntoView({block:"center"})))}}).finally(()=>{O.disabled=!1})},e.anonymizeGist=C=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(oi())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let O=C.currentTarget||C.target.closest?.("button")||C.target;O.disabled=!0;let B=parseGithubUrl(e.sourceUrl),K={gistId:e.gistId,terms:e.terms.trim().split(`
`).filter(ye=>ye),source:{gistId:B.gistId},options:e.options,conference:e.conference};No();let ae=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(ae,K,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/gist/"+e.gistId},ye=>{ye.data&&(r("ERRORS."+ye.data.error).then(Ge=>{e.error=Ge},console.error),si(ye.data.error))}).finally(()=>{O.disabled=!1})},e.anonymizePullRequest=C=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(oi())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let O=C.currentTarget||C.target.closest?.("button")||C.target;O.disabled=!0;let B=parseGithubUrl(e.sourceUrl),K={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
`).filter(ye=>ye),source:{repositoryFullName:`${B.owner}/${B.repo}`,pullRequestId:B.pullRequestId},options:e.options,conference:e.conference};No();let ae=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(ae,K,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/pr/"+e.pullRequestId},ye=>{ye.data&&(r("ERRORS."+ye.data.error).then(Ge=>{e.error=Ge},console.error),si(ye.data.error))}).finally(()=>{O.disabled=!1})},e.watch("conference",()=>{cf()}),e.termHints=[],e.matchTermAsWritten=C=>{e.terms=Lc(e.terms,C)},e.watch("options.preserveFiles",()=>{e.detectedType==="repo"&&Yt()}),e.watch("terms",()=>{e.termHints=qc(e.terms),e.detectedType==="repo"&&Co(),e.detectedType==="pr"&&On(),e.detectedType==="gist"&&Mn()}),e.watch("options.image",()=>{e.detectedType==="repo"&&Co(),e.detectedType==="pr"&&On(),e.detectedType==="gist"&&Mn()}),e.watch("options.link",()=>{e.detectedType==="repo"&&Co(),e.detectedType==="pr"&&On(),e.detectedType==="gist"&&Mn()}),e.watch("details",()=>{e.detectedType==="pr"&&On(),e.detectedType==="gist"&&Mn()},!0)},Za=function(e,t,s,i,o,r){wa(e);let d=bt();_c();let p=Bt(),c=0,v=null,h=null;e.fileLoadingSlow=!1,e.fileReceivedBytes=0;function y(){v&&(v.resolve(),v=null),h&&(d.timeout.cancel(h),h=null)}let m=!1;e.on("dispose",()=>{m=!0,c++,y(),b&&b.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,p(document,"click",I=>{e.symbolsOpen&&!I.target.closest?.(".symbols")&&(e.symbolsOpen=!1),e.moreOpen&&!I.target.closest?.(".tb-more")&&(e.moreOpen=!1),e.tocOpen&&!I.target.closest?.(".tb-toc-m")&&(e.tocOpen=!1),e.gotoOpen&&I.target.isConnected&&!I.target.closest?.(".goto-pop, .btn-goto, .tb-more")&&(e.gotoOpen=!1),e.accountOpen&&!I.target.closest?.(".acct")&&(e.accountOpen=!1),e.helpOpen&&!I.target.closest?.(".vb-help")&&(e.helpOpen=!1)}),p(document,"keydown",I=>{I.key==="Escape"&&(e.symbolsOpen=!1,e.moreOpen=!1,e.tocOpen=!1,e.gotoOpen=!1,e.accountOpen=!1,e.helpOpen=!1),(I.ctrlKey||I.metaKey)&&!I.altKey&&I.key&&I.key.toLowerCase()==="f"&&e.type==="html"&&window.document.querySelector(".reading-layout")&&(I.preventDefault(),e.toggleMdFind(!0))}),p(document,"keydown",function(I){if((I.metaKey||I.ctrlKey)&&I.key==="k"){I.preventDefault();var L=document.querySelector(".tree-search-input");L&&(L.focus(),L.select())}});var b=null;e.onFileSearchChange=function(){b&&(b.resolve(),b=null);let I=e.fileSearchQuery;if(!I||I.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let L=r.defer();b=L,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(I)}`,{timeout:L.promise}).then(function(k){if(!(m||b!==L)){b=null,e.fileSearchLoading=!1;var q={};e.files.forEach(function(qe){q[(qe.path||"")+"/"+qe.name]=!0});for(var G=[],H={},Y=0;Y<k.data.length;Y++){var ee=k.data[Y];if(ee.path)for(var x=ee.path.split("/"),fe="",he=0;he<x.length;he++){var Be=fe;fe=fe?fe+"/"+x[he]:x[he];var He=Be+"/"+x[he];!q[He]&&!H[He]&&(H[He]=!0,G.push({name:x[he],path:Be}))}}G.sort(function(qe,X){return(qe.path||"").split("/").length-(X.path||"").split("/").length}),G.length>0&&e.files.push.apply(e.files,G);for(var Qe=[],Se=0;Se<k.data.length;Se++){var tt=k.data[Se],Ne=(tt.path||"")+"/"+tt.name;!q[Ne]&&tt.size!=null&&(Qe.push(tt),q[Ne]=!0)}Qe.length>0&&e.files.push.apply(e.files,Qe),e.fileSearchResults=k.data}},function(){!m&&b===L&&(b=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})},e.on("routeUpdate",function(I,L){if(e.repoId!=i.repoId)return z();if((i.path||"")!=e.filePath){window.matchMedia?.("(max-width: 767px)").matches&&(e.sidebarCollapsed=!0),e.filePath=i.path||"",e.paths=e.filePath.split("/").filter(k=>k&&k.trim().length>0),_();for(let k=0;k<e.paths.length-1;k++){let q=k>0?e.paths.slice(0,k).join("/"):"";e.files.some(H=>H.path===q)||e.getFiles(q)}}});function S(){if(e.paths[0]!="")return;let I=["readme.md","readme.txt","readme.org","readme.1st","readme"],L={};for(let q of e.files)q.name.toLowerCase().indexOf("readme")>-1&&(L[q.name.toLowerCase()]=q.name);let k=null;for(let q of I)if(L[q]){k=q;break}if(!k&&Object.keys(L).length>0&&(k=Object.keys(L)[0]),k){let q=s.url();q[q.length-1]!="/"&&(q+="/"),s.url(q+encodePathForUrl(L[k]))}}e.fileCounts=null;let E=0,N=new Set,w=!1;e.getFiles=function(I,L=!1){let k=e.repoId,q=E;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(I)}&v=${e.options.lastUpdateDate}`).then(function(G){if(m||k!==e.repoId||q!==E)return[];let H=I||"";return e.files=e.files.filter(Y=>Y.path!==H),e.files.push(...G.data),e.loadedFolders={...e.loadedFolders,[H]:!0},T(H,q),G.data},function(G){if(m||k!==e.repoId||q!==E)return[];L||(e.type="error",e.content=pr(G),e.files=[])})};function T(I,L){if(w||N.has(I))return;N.add(I);let k=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts?path=${encodeURIComponent(I)}`).then(function(q){m||k!==e.repoId||L!==E||(e.fileCounts={...e.fileCounts,...q.data})},function(){m||k!= Line truncated
`).filter(ye=>ye),source:{repositoryFullName:`${B.owner}/${B.repo}`,pullRequestId:B.pullRequestId},options:e.options,conference:e.conference};No();let ae=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(ae,K,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/pr/"+e.pullRequestId},ye=>{ye.data&&(r("ERRORS."+ye.data.error).then(Ge=>{e.error=Ge},console.error),si(ye.data.error))}).finally(()=>{O.disabled=!1})},e.watch("conference",()=>{cf()}),e.termHints=[],e.matchTermAsWritten=C=>{e.terms=Lc(e.terms,C)},e.watch("options.preserveFiles",()=>{e.detectedType==="repo"&&Yt()}),e.watch("terms",()=>{e.termHints=qc(e.terms),e.detectedType==="repo"&&Co(),e.detectedType==="pr"&&On(),e.detectedType==="gist"&&Mn()}),e.watch("options.image",()=>{e.detectedType==="repo"&&Co(),e.detectedType==="pr"&&On(),e.detectedType==="gist"&&Mn()}),e.watch("options.link",()=>{e.detectedType==="repo"&&Co(),e.detectedType==="pr"&&On(),e.detectedType==="gist"&&Mn()}),e.watch("details",()=>{e.detectedType==="pr"&&On(),e.detectedType==="gist"&&Mn()},!0)},Za=function(e,t,s,i,o,r){wa(e);let u=bt();_c();let p=Bt(),c=0,v=null,g=null;e.fileLoadingSlow=!1,e.fileReceivedBytes=0;function y(){v&&(v.resolve(),v=null),g&&(u.timeout.cancel(g),g=null)}let m=!1;e.on("dispose",()=>{m=!0,c++,y(),b&&b.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,p(document,"click",I=>{e.symbolsOpen&&!I.target.closest?.(".symbols")&&(e.symbolsOpen=!1),e.moreOpen&&!I.target.closest?.(".tb-more")&&(e.moreOpen=!1),e.tocOpen&&!I.target.closest?.(".tb-toc-m")&&(e.tocOpen=!1),e.gotoOpen&&I.target.isConnected&&!I.target.closest?.(".goto-pop, .btn-goto, .tb-more")&&(e.gotoOpen=!1),e.accountOpen&&!I.target.closest?.(".acct")&&(e.accountOpen=!1),e.helpOpen&&!I.target.closest?.(".vb-help")&&(e.helpOpen=!1)}),p(document,"keydown",I=>{I.key==="Escape"&&(e.symbolsOpen=!1,e.moreOpen=!1,e.tocOpen=!1,e.gotoOpen=!1,e.accountOpen=!1,e.helpOpen=!1),(I.ctrlKey||I.metaKey)&&!I.altKey&&I.key&&I.key.toLowerCase()==="f"&&e.type==="html"&&window.document.querySelector(".reading-layout")&&(I.preventDefault(),e.toggleMdFind(!0))}),p(document,"keydown",function(I){if((I.metaKey||I.ctrlKey)&&I.key==="k"){I.preventDefault();var L=document.querySelector(".tree-search-input");L&&(L.focus(),L.select())}});var b=null;e.onFileSearchChange=function(){b&&(b.resolve(),b=null);let I=e.fileSearchQuery;if(!I||I.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let L=r.defer();b=L,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(I)}`,{timeout:L.promise}).then(function(k){if(!(m||b!==L)){b=null,e.fileSearchLoading=!1;var q={};e.files.forEach(function(qe){q[(qe.path||"")+"/"+qe.name]=!0});for(var G=[],H={},Y=0;Y<k.data.length;Y++){var ee=k.data[Y];if(ee.path)for(var x=ee.path.split("/"),fe="",he=0;he<x.length;he++){var Be=fe;fe=fe?fe+"/"+x[he]:x[he];var He=Be+"/"+x[he];!q[He]&&!H[He]&&(H[He]=!0,G.push({name:x[he],path:Be}))}}G.sort(function(qe,X){return(qe.path||"").split("/").length-(X.path||"").split("/").length}),G.length>0&&e.files.push.apply(e.files,G);for(var Qe=[],Ee=0;Ee<k.data.length;Ee++){var tt=k.data[Ee],Ne=(tt.path||"")+"/"+tt.name;!q[Ne]&&tt.size!=null&&(Qe.push(tt),q[Ne]=!0)}Qe.length>0&&e.files.push.apply(e.files,Qe),e.fileSearchResults=k.data}},function(){!m&&b===L&&(b=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})},e.on("routeUpdate",function(I,L){if(e.repoId!=i.repoId)return z();if((i.path||"")!=e.filePath){window.matchMedia?.("(max-width: 767px)").matches&&(e.sidebarCollapsed=!0),e.filePath=i.path||"",e.paths=e.filePath.split("/").filter(k=>k&&k.trim().length>0),_();for(let k=0;k<e.paths.length-1;k++){let q=k>0?e.paths.slice(0,k).join("/"):"";e.files.some(H=>H.path===q)||e.getFiles(q)}}});function E(){if(e.paths[0]!="")return;let I=["readme.md","readme.txt","readme.org","readme.1st","readme"],L={};for(let q of e.files)q.name.toLowerCase().indexOf("readme")>-1&&(L[q.name.toLowerCase()]=q.name);let k=null;for(let q of I)if(L[q]){k=q;break}if(!k&&Object.keys(L).length>0&&(k=Object.keys(L)[0]),k){let q=s.url();q[q.length-1]!="/"&&(q+="/"),s.url(q+encodePathForUrl(L[k]))}}e.fileCounts=null;let S=0,N=new Set,w=!1;e.getFiles=function(I,L=!1){let k=e.repoId,q=S;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(I)}&v=${e.options.lastUpdateDate}`).then(function(G){if(m||k!==e.repoId||q!==S)return[];let H=I||"";return e.files=e.files.filter(Y=>Y.path!==H),e.files.push(...G.data),e.loadedFolders={...e.loadedFolders,[H]:!0},T(H,q),G.data},function(G){if(m||k!==e.repoId||q!==S)return[];L||(e.type="error",e.content=pr(G),e.files=[])})};function T(I,L){if(w||N.has(I))return;N.add(I);let k=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts?path=${encodeURIComponent(I)}`).then(function(q){m||k!==e.repoId||L!==S||(e.fileCounts={...e.fileCounts,...q.data})},function(){m||k!= Line truncated
`).length+1)),placeholder:`Jane Smith
MIT CSAIL
jane.smith@example.org`},null,10,i5),[[d,{state:e.viewState,set:c=>{e.terms=c},value:e.terms,form:"anonymize",options:{debounce:250}}]]),t[125]||(t[125]=n("small",{class:"form-text text-muted"},"One term per line.",-1)),n("details",r5,[t[120]||(t[120]=n("summary",null,"Regex & replacement syntax",-1)),t[121]||(t[121]=g()),n("small",a5,[t[114]||(t[114]=g("Regex is supported. Replaced by ",-1)),n("code",null,u(e.site_options?.ANONYMIZATION_MASK)+"-[N]",1),t[115]||(t[115]=g(", or use ",-1)),t[116]||(t[116]=n("code",null,"term=>replacement",-1)),t[117]||(t[117]=g(" to pick your own (e.g. ",-1)),t[118]||(t[118]=n("code",null,"Anonymous=>ABC",-1)),t[119]||(t[119]=g(").",-1))])]),(a(!0),l(V,null,Q((e.termHints||[]).slice(0,3),c=>(a(),l("div",{class:"term-hint",key:c.line},[n("span",null,[t[122]||(t[122]=g("In ",-1)),n("code",null,u(c.term),1),t[123]||(t[123]=g(", ",-1)),n("code",null,u(c.symbols.join(" ")),1),g(" "+u(c.symbols.length>1?"are regex symbols":"is a regex symbol")+", so it may not match the text as written.",1)]),n("button",{type:"button",class:"btn btn-outline-ink btn-sm",onClick:v=>e.matchTermAsWritten(c.line)},"Match as written",8,l5)]))),128)),(e.termHints||[]).length>3?(a(),l("div",d5,u(e.termHints.length-3)+" more "+u(e.termHints.length-3===1?"term uses":"terms use")+" regex symbols.",1)):f("v-if",!0),P(n("div",u5,"Terms are in an invalid format.",512),[[Z,e.anonymize?.terms?.errors?.format]])]),P(n("div",c5,[n("div",p5,[t[126]||(t[126]=n("span",{class:"paper-field-label",id:"preserve-files-label"},"Unredacted files",-1)),n("span",f5,u(e.preserveSummary()),1)]),n("button",{type:"button",class:"btn btn-outline-ink btn-sm","aria-describedby":"preserve-files-label",disabled:!e.source?.commit,onClick:t[25]||(t[25]=c=>e.openPreserveFiles())},u((e.options?.preserveFiles||[]).length?"Edit":"Choose files"),9,m5)],512),[[Z,e.detectedType==="repo"]]),e.preserve?.open?(a(),l("dialog",{key:0,id:"preserve-files-dialog",class:"preserve-dialog","aria-labelledby":"preserve-files-title",onCancel:t[30]||(t[30]=de(c=>e.closePreserveFiles(),["prevent"]))},[n("form",{onSubmit:t[29]||(t[29]=de(c=>e.savePreserveFiles(),["prevent"]))},[t[130]||(t[130]=n("h2",{id:"preserve-files-title"},"Leave files unredacted",-1)),t[131]||(t[131]=n("p",{class:"preserve-intro"},"Checked files are shown exactly as written, for example a bibliography where redacted self-citations would reveal you. File names are still redacted.",-1)),P(n("input",{type:"search",id:"preserve-files-search",class:"form-control",placeholder:"Search files","aria-label":"Search files",autocomplete:"off","onUpdate:modelValue":t[26]||(t[26]=c=>e.preserve.search=c)},null,512),[[ot,e.preserve.search]]),n("div",h5,[e.preserve.loading?(a(),l("p",g5,"Loading files from GitHub\u2026")):e.preserve.error?(a(),l("p",v5,u(e.preserve.error),1)):(a(),l(V,{key:2},[(a(!0),l(V,null,Q(e.preserveRows(),(c,v)=>(a(),l("div",{class:"preserve-item",key:c.kind+":"+c.path,style:Ae({paddingLeft:c.depth*18+6+"px"})},[c.kind==="dir"?(a(),l("button",{key:0,type:"button",class:"preserve-caret","aria-expanded":c.open?"true":"false","aria-label":(c.open?"Collapse ":"Expand ")+c.label,onClick:h=>e.togglePreserveDir(c.path)},u(c.open?"\u25BE":"\u25B8"),9,y5)):(a(),l("span",b5)),n("input",{type:"checkbox",id:"pf-"+v,"aria-label":c.kind==="dir"?"Leave folder "+c.path+" unredacted":null,checked:c.state==="all",".indeterminate":c.state==="some",disabled:c.locked,onChange:h=>c.kind==="dir"?e.togglePreserveFolder(c.path):e.togglePreserveFile(c.path)},null,40,w5),n("label",{for:c.kind==="file"?"pf-"+v:null,class:"preserve-name",onClick:h=>c.kind==="dir"&&e.togglePreserveDir(c.path)},u(c.label),9,k5),c.note?(a(),l("span",C5,u(c.note),1)):f("v-if",!0)],4))),128)),!e.preserve.loading&&!e.preserveRows().length?(a(),l("p",E5,u(e.preserve.search?"No file matches your search.":"No text files in this commit."),1)):f("v-if",!0)],64))]),e.preserve.truncated?(a(),l("p",S5,"This repository has too many files to list them all. Use a pattern for files you cannot find.")):f("v-if",!0),n("details",{class:"preserve-patterns",open:e.preserve.patternsOpen},[t[127]||(t[127]=n("summary",null,"Patterns",-1)),P(n("textarea",{class:"form-control",rows:"3","aria-label":"Patterns",placeholder:`*.bib
paper/appendix/**`,"onUpdate:modelValue":t[27]||(t[27]=c=>e.preserve.patterns=c)},null,512),[[ot,e.preserve.patterns]]),t[128]||(t[128]=n("small",{class:"form-text text-muted"},[g("One per line, as in .gitignore: "),n("code",null,"*.bib"),g(" matches in any folder; "),n("code",null,"/refs.bib"),g(" and "),n("code",null,"paper/refs.bib"),g(" match from the repository root; a folder name such as "),n("code",null,"drafts/"),g(" covers everything inside it; "),n("code",null,"!private.bib"),g(" excludes again.")],-1))],8,N5),n("div",R5,[n("span",T5,u(e.preserve.loading||e.preserve.error?"":e.preserveCount()+(e.preserveCount()===1?" file":" files")+" will be shown as written"),1),n("span",P5,[n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[28]||(t[28]=c=>e.closePreserveFiles())},"Cancel"),t[129]||(t[129]=n("button",{type:"submit",class:"btn btn-ink"},"Save",-1))])])],32)],32)):f("v-if",!0)],512),[[Z,e.detectedType&&e.sourceReady()]]),P(n("section",D5,[t[152]||(t[152]=n("h2",{class:"paper-section-eyebrow"},"Display",-1)),P(n("div",null,[n("div",A5,[P(n("input",I5,null,512),[[d,{state:e.viewState,set:c=>{e.options.link=c},value:e.options?.link,form:"anonymize",options:{}}]]),t[133]||(t[133]=n("label",{class:"form-check-label",for:"link"},"Keep links",-1))]),n("div",O5,[P(n("input",M5,null,512),[[d,{state:e.viewState,set:c=>{e.options.image=c},value:e.options?.image,form:"anonymize",options:{}}]]),t[134]||(t[134]=n("label",{class:"form-check-label",for:"image"},"Display images",-1))]),n("div",V5,[P(n("input",q5,null,512),[[d,{state:e.viewState,set:c=>{e.options.pdf=c},value:e.options?.pdf,form:"anonymize",options:{}}]]),t[135]||(t[135]=n("label",{class:"form-check-label",for:"pdf"},"Display PDFs",-1))]),n("div",L5,[P(n("input",$5,null,512),[[d,{state:e.viewState,set:c=>{e.options.notebook=c},value:e.options?.notebook,form:"anonymize",options:{}}]]),t[136]||(t[136]=n("label",{class:"form-check-label",for:"notebook"},"Display notebooks",-1))]),n("div",_5,[P(n("input",{class:"form-check-input",type:"checkbox",id:"page",name:"page",disabled:!e.details?.hasPage||e.details?.pageSource&&e.details?.pageSource?.branch!==e.source?.branch},null,8,F5),[[d,{state:e.viewState,set:c=>{e.options.page=c},value:e.options?.page,form:"anonymize",options:{}}]]),t[137]||(t[137]=n("label",{class:"form-check-label",for:"page"},"GitHub Pages",-1)),e.details?.hasPage?f("v-if",!0):(a(),l("small",U5,u(e.fmt?.translate("WARNINGS.page_not_enabled_on_repo")),1)),e.details?.hasPage&&e.details?.pageSource?.branch&&e.source?.branch&&e.details.pageSource.branch!==e.source.branch?(a(),l("small",B5,u(e.fmt?.translate("WARNINGS.page_branch_mismatch",{pageBranch:e.details?.pageSource?.branch,selectedBranch:e.source?.branch})),1)):f("v-if",!0)])],512),[[Z,e.detectedType==="repo"]]),e.detectedType==="repo"&&(e.options.image||e.options.pdf)?(a(),l("p",z5,[...t[138]||(t[138]=[g("Images and PDFs are served unchanged. Review their contents and metadata before sharing. ",-1),n("a",{href:"/faq#formats"},"Supported formats",-1)])])):f("v-if",!0),P(n("div",null,[n("div",H5,[P(n("input",j5,null,512),[[d,{state:e.viewState,set:c=>{e.options.title=c},value:e.options?.title,form:"anonymize",options:{}}]]),t[139]||(t[139]=n("label",{class:"form-check-label",for:"title-gist"},"Gist description",-1))]),n("div",G5,[P(n("input",W5,null,512),[[d,{state:e.viewState,set:c=>{e.options.content=c},value:e.options?.content,form:"anonymize",options:{}}]]),t[140]||(t[140]=n("label",{class:"form-check-label",for:"content-gist"},"File contents",-1))]),n("div",K5,[P(n("input",Y5,null,512),[[d,{state:e.viewState,set:c=>{e.options.comments=c},value:e.options?.comments,form:"anonymize",options:{}}]]),t[141]||(t[141]=n("label",{class:"form-check-label",for:"comments-gist"},"Comments",-1))]),n("div",J5,[P(n("input",X5,null,512),[[d,{state:e.viewState,set:c=>{e.options.username=c},value:e.options?.username,form:"anonymize",options:{}}]]),t[142]||(t[142]=n("label",{class:"form-check-label",for:"username-gist"},"Usernames",-1))]),n("div",Q5,[P(n("input",Z5,null,512),[[d,{state:e.viewState,set:c=>{e.options.date=c},value:e.options?.date,form:"anonymize",options:{}}]]),t[143]||(t[143]=n("label",{class:"form-check-label",for:"date-gist"},"Dates",-1))]),n("div",x5,[P(n("input",e8,null,512),[[d,{state:e.viewState,set:c=>{e.options.origin=c},value:e.options?.origin,form:"anonymize",options:{}}]]),t[144]||(t[144]=n("label",{class:"form-check-label",for:"origin-gist"},"Source gist ID",-1))])],512),[[Z,e.detectedType==="gist"]]),P(n("div",null,[n("div",t8,[P(n("input",n8,null,512),[[d,{state:e.viewState,set:c=>{e.options.title=c},value:e.options?.title,form:"anonymize",options:{}}]]),t[145]||(t[145]=n("label",{class:"form-check-label",for:"title"},"PR title",-1))]),n("div",o8,[P(n("input",s8,null,512),[[d,{state:e.viewState,set:c=>{e.options.body=c},value:e.options?.body,form:"anonymize",options:{}}]]),t[146]||(t[146]=n("label",{class:"form-check-label",for:"body"},"PR body",-1))]),n( Line truncated
anonymous_github`)])])])])]),f(" Limitations "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-warning"})]),g("Limitations ")]),n("div",{class:"panel-group",id:"faq-limitations",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingLimitation"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-limitations",href:"#limitation","aria-expanded":"false","aria-controls":"limitation"}," What are the limitations of Anonymous GitHub? ")])]),n("div",{id:"limitation",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingLimitation"},[n("div",{class:"panel-body p-3"},[n("ul",null,[n("li",null," Anonymous GitHub only anonymizes text-based files. Binary files (compiled executables, archives, etc.) are served as-is without anonymization. "),n("li",null," Files larger than 8 MB are not supported. "),n("li",null," Static site generators (such as Jekyll) used with GitHub Pages are not fully supported, although Markdown files are converted to HTML. "),n("li",null," The anonymization of terms within source code may change the behavior of the program (e.g., if a replaced term appears in a string literal or identifier). ")])])])])]),f(" Privacy and security "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-shield"})]),g("Privacy and security ")]),n("div",{class:"panel-group",id:"faq-privacy",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingData"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#data","aria-expanded":"false","aria-controls":"data"}," How is my data handled? ")])]),n("div",{id:"data",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingData"},[n("div",{class:"panel-body p-3"},[n("p",null," Repository data is used to provide the anonymization service. If you purchase a plan, Stripe processes payment and billing information. When a repository is removed or expires, only its configuration is retained. This makes it easy to restore the repository if needed and ensures that no future repository reuses the same ID. ")])])]),n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingPermissions"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#permissions","aria-expanded":"false","aria-controls":"permissions"}," Why does GitHub say Anonymous GitHub asks for write access? ")])]),n("div",{id:"permissions",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingPermissions"},[n("div",{class:"panel-body p-3"},[n("p",null,[g("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"),g(" page.")]),n("p",null,"Legacy GitHub OAuth includes write access to private repositories because GitHub's OAuth scopes do not offer a read-only option for them. Existing OAuth anonymizations and gists can still use this connection."),n("p",null,"Anonymous GitHub reads repository content. It never pushes, modifies, or deletes files on GitHub.")])])]),n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingViewer"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#viewer","aria-expanded":"false","aria-controls":"viewer"}," Can repository owners see who viewed their anonymized repository? ")])]),n("div",{id:"viewer",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingViewer"},[n("div",{class:"panel-body p-3"},[n("p",null," No. Only the total number of views is tracked as an incremental counter. It is not possible for the repository owner or for Anonymous GitHub to identify individual viewers. Reviewer anonymity is fully preserved. ")])])])]),f(" Self-hosting "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#project-icon-storage"})]),g("Self"),n("span",{class:"serif-hy"},"-"),g("hosting ")]),n("div",{class:"panel-group",id:"faq-hosting",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingDeploy"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-hosting",href:"#deploy","aria-expanded":"false","aria-controls":"deploy"}," Can I deploy my own instance? ")])]),n("div",{id:"deploy",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingDeploy"},[n("div",{cla Line truncated
jane.smith@example.org`},null,10,B5),[[u,{state:e.viewState,set:c=>{e.terms=c},value:e.terms,form:"anonymize",options:{debounce:250}}]]),t[125]||(t[125]=n("small",{class:"form-text text-muted"},"One term per line.",-1)),n("details",z5,[t[120]||(t[120]=n("summary",null,"Regex & replacement syntax",-1)),t[121]||(t[121]=h()),n("small",H5,[t[114]||(t[114]=h("Regex is supported. Replaced by ",-1)),n("code",null,d(e.site_options?.ANONYMIZATION_MASK)+"-[N]",1),t[115]||(t[115]=h(", or use ",-1)),t[116]||(t[116]=n("code",null,"term=>replacement",-1)),t[117]||(t[117]=h(" to pick your own (e.g. ",-1)),t[118]||(t[118]=n("code",null,"Anonymous=>ABC",-1)),t[119]||(t[119]=h(").",-1))])]),(a(!0),l(V,null,Q((e.termHints||[]).slice(0,3),c=>(a(),l("div",{class:"term-hint",key:c.line},[n("span",null,[t[122]||(t[122]=h("In ",-1)),n("code",null,d(c.term),1),t[123]||(t[123]=h(", ",-1)),n("code",null,d(c.symbols.join(" ")),1),h(" "+d(c.symbols.length>1?"are regex symbols":"is a regex symbol")+", so it may not match the text as written.",1)]),n("button",{type:"button",class:"btn btn-outline-ink btn-sm",onClick:v=>e.matchTermAsWritten(c.line)},"Match as written",8,j5)]))),128)),(e.termHints||[]).length>3?(a(),l("div",G5,d(e.termHints.length-3)+" more "+d(e.termHints.length-3===1?"term uses":"terms use")+" regex symbols.",1)):f("v-if",!0),P(n("div",W5,"Terms are in an invalid format.",512),[[Z,e.anonymize?.terms?.errors?.format]])]),P(n("div",K5,[n("div",Y5,[t[126]||(t[126]=n("span",{class:"paper-field-label",id:"preserve-files-label"},"Unredacted files",-1)),n("span",J5,d(e.preserveSummary()),1)]),n("button",{type:"button",class:"btn btn-outline-ink btn-sm","aria-describedby":"preserve-files-label",disabled:!e.source?.commit,onClick:t[25]||(t[25]=c=>e.openPreserveFiles())},d((e.options?.preserveFiles||[]).length?"Edit":"Choose files"),9,X5)],512),[[Z,e.detectedType==="repo"]]),e.preserve?.open?(a(),l("dialog",{key:0,id:"preserve-files-dialog",class:"preserve-dialog","aria-labelledby":"preserve-files-title",onCancel:t[30]||(t[30]=de(c=>e.closePreserveFiles(),["prevent"]))},[n("form",{onSubmit:t[29]||(t[29]=de(c=>e.savePreserveFiles(),["prevent"]))},[t[130]||(t[130]=n("h2",{id:"preserve-files-title"},"Leave files unredacted",-1)),t[131]||(t[131]=n("p",{class:"preserve-intro"},"Checked files are shown exactly as written, for example a bibliography where redacted self-citations would reveal you. File names are still redacted.",-1)),P(n("input",{type:"search",id:"preserve-files-search",class:"form-control",placeholder:"Search files","aria-label":"Search files",autocomplete:"off","onUpdate:modelValue":t[26]||(t[26]=c=>e.preserve.search=c)},null,512),[[ot,e.preserve.search]]),n("div",Q5,[e.preserve.loading?(a(),l("p",Z5,"Loading files from GitHub\u2026")):e.preserve.error?(a(),l("p",x5,d(e.preserve.error),1)):(a(),l(V,{key:2},[(a(!0),l(V,null,Q(e.preserveRows(),(c,v)=>(a(),l("div",{class:"preserve-item",key:c.kind+":"+c.path,style:Ae({paddingLeft:c.depth*18+6+"px"})},[c.kind==="dir"?(a(),l("button",{key:0,type:"button",class:"preserve-caret","aria-expanded":c.open?"true":"false","aria-label":(c.open?"Collapse ":"Expand ")+c.label,onClick:g=>e.togglePreserveDir(c.path)},d(c.open?"\u25BE":"\u25B8"),9,e8)):(a(),l("span",t8)),n("input",{type:"checkbox",id:"pf-"+v,"aria-label":c.kind==="dir"?"Leave folder "+c.path+" unredacted":null,checked:c.state==="all",".indeterminate":c.state==="some",disabled:c.locked,onChange:g=>c.kind==="dir"?e.togglePreserveFolder(c.path):e.togglePreserveFile(c.path)},null,40,n8),n("label",{for:c.kind==="file"?"pf-"+v:null,class:"preserve-name",onClick:g=>c.kind==="dir"&&e.togglePreserveDir(c.path)},d(c.label),9,o8),c.note?(a(),l("span",s8,d(c.note),1)):f("v-if",!0)],4))),128)),!e.preserve.loading&&!e.preserveRows().length?(a(),l("p",i8,d(e.preserve.search?"No file matches your search.":"No text files in this commit."),1)):f("v-if",!0)],64))]),e.preserve.truncated?(a(),l("p",r8,"This repository has too many files to list them all. Use a pattern for files you cannot find.")):f("v-if",!0),n("details",{class:"preserve-patterns",open:e.preserve.patternsOpen},[t[127]||(t[127]=n("summary",null,"Patterns",-1)),P(n("textarea",{class:"form-control",rows:"3","aria-label":"Patterns",placeholder:`*.bib
paper/appendix/**`,"onUpdate:modelValue":t[27]||(t[27]=c=>e.preserve.patterns=c)},null,512),[[ot,e.preserve.patterns]]),t[128]||(t[128]=n("small",{class:"form-text text-muted"},[h("One per line, as in .gitignore: "),n("code",null,"*.bib"),h(" matches in any folder; "),n("code",null,"/refs.bib"),h(" and "),n("code",null,"paper/refs.bib"),h(" match from the repository root; a folder name such as "),n("code",null,"drafts/"),h(" covers everything inside it; "),n("code",null,"!private.bib"),h(" excludes again.")],-1))],8,a8),n("div",l8,[n("span",d8,d(e.preserve.loading||e.preserve.error?"":e.preserveCount()+(e.preserveCount()===1?" file":" files")+" will be shown as written"),1),n("span",u8,[n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[28]||(t[28]=c=>e.closePreserveFiles())},"Cancel"),t[129]||(t[129]=n("button",{type:"submit",class:"btn btn-ink"},"Save",-1))])])],32)],32)):f("v-if",!0)],512),[[Z,e.detectedType&&e.sourceReady()]]),P(n("section",c8,[t[152]||(t[152]=n("h2",{class:"paper-section-eyebrow"},"Display",-1)),P(n("div",null,[n("div",p8,[P(n("input",f8,null,512),[[u,{state:e.viewState,set:c=>{e.options.link=c},value:e.options?.link,form:"anonymize",options:{}}]]),t[133]||(t[133]=n("label",{class:"form-check-label",for:"link"},"Keep links",-1))]),n("div",m8,[P(n("input",h8,null,512),[[u,{state:e.viewState,set:c=>{e.options.image=c},value:e.options?.image,form:"anonymize",options:{}}]]),t[134]||(t[134]=n("label",{class:"form-check-label",for:"image"},"Display images",-1))]),n("div",g8,[P(n("input",v8,null,512),[[u,{state:e.viewState,set:c=>{e.options.pdf=c},value:e.options?.pdf,form:"anonymize",options:{}}]]),t[135]||(t[135]=n("label",{class:"form-check-label",for:"pdf"},"Display PDFs",-1))]),n("div",y8,[P(n("input",b8,null,512),[[u,{state:e.viewState,set:c=>{e.options.notebook=c},value:e.options?.notebook,form:"anonymize",options:{}}]]),t[136]||(t[136]=n("label",{class:"form-check-label",for:"notebook"},"Display notebooks",-1))]),n("div",w8,[P(n("input",{class:"form-check-input",type:"checkbox",id:"page",name:"page",disabled:!e.details?.hasPage||e.details?.pageSource&&e.details?.pageSource?.branch!==e.source?.branch},null,8,k8),[[u,{state:e.viewState,set:c=>{e.options.page=c},value:e.options?.page,form:"anonymize",options:{}}]]),t[137]||(t[137]=n("label",{class:"form-check-label",for:"page"},"GitHub Pages",-1)),e.details?.hasPage?f("v-if",!0):(a(),l("small",C8,d(e.fmt?.translate("WARNINGS.page_not_enabled_on_repo")),1)),e.details?.hasPage&&e.details?.pageSource?.branch&&e.source?.branch&&e.details.pageSource.branch!==e.source.branch?(a(),l("small",S8,d(e.fmt?.translate("WARNINGS.page_branch_mismatch",{pageBranch:e.details?.pageSource?.branch,selectedBranch:e.source?.branch})),1)):f("v-if",!0)])],512),[[Z,e.detectedType==="repo"]]),e.detectedType==="repo"&&(e.options.image||e.options.pdf)?(a(),l("p",E8,[...t[138]||(t[138]=[h("Images and PDFs are served unchanged. Review their contents and metadata before sharing. ",-1),n("a",{href:"/faq#formats"},"Supported formats",-1)])])):f("v-if",!0),P(n("div",null,[n("div",N8,[P(n("input",R8,null,512),[[u,{state:e.viewState,set:c=>{e.options.title=c},value:e.options?.title,form:"anonymize",options:{}}]]),t[139]||(t[139]=n("label",{class:"form-check-label",for:"title-gist"},"Gist description",-1))]),n("div",T8,[P(n("input",P8,null,512),[[u,{state:e.viewState,set:c=>{e.options.content=c},value:e.options?.content,form:"anonymize",options:{}}]]),t[140]||(t[140]=n("label",{class:"form-check-label",for:"content-gist"},"File contents",-1))]),n("div",D8,[P(n("input",A8,null,512),[[u,{state:e.viewState,set:c=>{e.options.comments=c},value:e.options?.comments,form:"anonymize",options:{}}]]),t[141]||(t[141]=n("label",{class:"form-check-label",for:"comments-gist"},"Comments",-1))]),n("div",I8,[P(n("input",O8,null,512),[[u,{state:e.viewState,set:c=>{e.options.username=c},value:e.options?.username,form:"anonymize",options:{}}]]),t[142]||(t[142]=n("label",{class:"form-check-label",for:"username-gist"},"Usernames",-1))]),n("div",M8,[P(n("input",V8,null,512),[[u,{state:e.viewState,set:c=>{e.options.date=c},value:e.options?.date,form:"anonymize",options:{}}]]),t[143]||(t[143]=n("label",{class:"form-check-label",for:"date-gist"},"Dates",-1))]),n("div",q8,[P(n("input",L8,null,512),[[u,{state:e.viewState,set:c=>{e.options.origin=c},value:e.options?.origin,form:"anonymize",options:{}}]]),t[144]||(t[144]=n("label",{class:"form-check-label",for:"origin-gist"},"Source gist ID",-1))])],512),[[Z,e.detectedType==="gist"]]),P(n("div",null,[n("div",$8,[P(n("input",_8,null,512),[[u,{state:e.viewState,set:c=>{e.options.title=c},value:e.options?.title,form:"anonymize",options:{}}]]),t[145]||(t[145]=n("label",{class:"form-check-label",for:"title"},"PR title",-1))]),n("div",F8,[P(n("input",U8,null,512),[[u,{state:e.viewState,set:c=>{e.options.body=c},value:e.options?.body,form:"anonymize",options:{}}]]),t[146]||(t[146]=n("label",{class:"form-check-label",for:"body"},"PR body",-1))]),n( Line truncated
anonymous_github`)])])])])]),f(" Limitations "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-warning"})]),h("Limitations ")]),n("div",{class:"panel-group",id:"faq-limitations",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingLimitation"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-limitations",href:"#limitation","aria-expanded":"false","aria-controls":"limitation"}," What are the limitations of Anonymous GitHub? ")])]),n("div",{id:"limitation",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingLimitation"},[n("div",{class:"panel-body p-3"},[n("ul",null,[n("li",null," Anonymous GitHub only anonymizes text-based files. Binary files (compiled executables, archives, etc.) are served as-is without anonymization. "),n("li",null," Files larger than 8 MB are not supported. "),n("li",null," Static site generators (such as Jekyll) used with GitHub Pages are not fully supported, although Markdown files are converted to HTML. "),n("li",null," The anonymization of terms within source code may change the behavior of the program (e.g., if a replaced term appears in a string literal or identifier). ")])])])])]),f(" Privacy and security "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#ui-icon-shield"})]),h("Privacy and security ")]),n("div",{class:"panel-group",id:"faq-privacy",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingData"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#data","aria-expanded":"false","aria-controls":"data"}," How is my data handled? ")])]),n("div",{id:"data",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingData"},[n("div",{class:"panel-body p-3"},[n("p",null," Repository data is used to provide the anonymization service. If you purchase a plan, Stripe processes payment and billing information. When a repository is removed or expires, only its configuration is retained. This makes it easy to restore the repository if needed and ensures that no future repository reuses the same ID. ")])])]),n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingPermissions"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#permissions","aria-expanded":"false","aria-controls":"permissions"}," Why does GitHub say Anonymous GitHub asks for write access? ")])]),n("div",{id:"permissions",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingPermissions"},[n("div",{class:"panel-body p-3"},[n("p",null,[h("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"),h(" page.")]),n("p",null,"Legacy GitHub OAuth includes write access to private repositories because GitHub's OAuth scopes do not offer a read-only option for them. Existing OAuth anonymizations and gists can still use this connection."),n("p",null,"Anonymous GitHub reads repository content. It never pushes, modifies, or deletes files on GitHub.")])])]),n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingViewer"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-privacy",href:"#viewer","aria-expanded":"false","aria-controls":"viewer"}," Can repository owners see who viewed their anonymized repository? ")])]),n("div",{id:"viewer",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingViewer"},[n("div",{class:"panel-body p-3"},[n("p",null," No. Only the total number of views is tracked as an incremental counter. It is not possible for the repository owner or for Anonymous GitHub to identify individual viewers. Reviewer anonymity is fully preserved. ")])])])]),f(" Self-hosting "),n("h4",{class:"faq-cat"},[n("svg",{class:"ui-icon mr-2","aria-hidden":"true"},[n("use",{href:"#project-icon-storage"})]),h("Self"),n("span",{class:"serif-hy"},"-"),h("hosting ")]),n("div",{class:"panel-group",id:"faq-hosting",role:"tablist","aria-multiselectable":"true"},[n("div",{class:"panel panel-default mb-3"},[n("div",{class:"panel-heading p-3",role:"tab",id:"headingDeploy"},[n("h3",{class:"panel-title"},[n("a",{class:"collapsed",role:"button","data-toggle":"collapse","data-parent":"#faq-hosting",href:"#deploy","aria-expanded":"false","aria-controls":"deploy"}," Can I deploy my own instance? ")])]),n("div",{id:"deploy",class:"panel-collapse collapse",role:"tabpanel","aria-labelledby":"headingDeploy"},[n("div",{cla Line truncated
anonymized repository often think it is about the paper, so the
label names the service and the tooltip says who to contact. `),n("li",{class:R(["nav-item nav-extra-item d-none d-lg-block",{"in-user-menu":!!e.user?.username}])},[...t[19]||(t[19]=[n("a",{class:"nav-link",target:"_blank",rel:"noopener",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",title:"Report a problem with the Anonymous GitHub service. Questions about an anonymized repository or paper go to its authors.","data-offset":"30"},[n("svg",{class:"ui-icon d-lg-none mr-1","aria-hidden":"true"},[n("use",{href:"#ui-icon-bug"})]),g("Report a bug ")],-1)])],2),n("li",{class:R(["nav-item nav-support-item nav-extra-item d-none d-lg-block",{"in-user-menu":!!e.user?.username}])},[...t[20]||(t[20]=[n("a",{class:"nav-link nav-support-inline",href:"https://ko-fi.com/tdurieux",target:"_blank",rel:"noopener",title:"Donate on Ko-fi to help cover hosting costs"},[n("svg",{class:"ui-icon nav-heart","aria-hidden":"true"},[n("use",{href:"#ui-icon-heart"})]),g("Support ")],-1)])],2),e.isDarkMode?f("v-if",!0):(a(),l("li",gB,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to dark mode","aria-label":"Switch to dark mode",onClick:t[1]||(t[1]=s=>{e.darkMode(!0)})},[...t[21]||(t[21]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(a(),l("li",vB,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to light mode","aria-label":"Switch to light mode",onClick:t[2]||(t[2]=s=>{e.darkMode(!1)})},[...t[22]||(t[22]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sun"})],-1)])])])):f("v-if",!0),!e.user&&!e.isReviewerRoute?(a(),l("li",yB,[...t[23]||(t[23]=[n("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[n("i",{class:"fab fa-github mr-1"}),g(" Sign in ")],-1)])])):f("v-if",!0),e.user?.username&&e.headerCanUpgrade&&!e.headerBillingPending?(a(),l("li",bB,[n("a",{class:"nav-link nav-upgrade",href:"/profile?upgrade=1",onClick:t[3]||(t[3]=de(s=>e.openHeaderUpgrade(),["prevent"]))},"Upgrade")])):f("v-if",!0),e.user?(a(),l("li",wB,[n("a",kB,[e.user?.photo?(a(),l("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,CB)):f("v-if",!0),n("span",EB,u(e.user?.username),1)]),n("div",SB,[n("h6",NB,"Signed in as @"+u(e.user?.username),1),t[25]||(t[25]=ke('<a class="dropdown-item" href="/profile"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-filter"></use></svg><span>Settings<small>Defaults, quotas, account</small></span></a><a class="dropdown-item" href="/connections"><i class="fab fa-github" aria-hidden="true"></i><span>GitHub connections<small>Repository access and OAuth</small></span></a><a class="dropdown-item" href="/claim"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-link"></use></svg><span>Claim an anonymization<small>Attach an existing mirror to your account</small></span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-bug"></use></svg><span>Report a bug<small>About this service, not a paper</small></span></a><a class="dropdown-item um-extra" href="https://github.com/tdurieux/anonymous_github/" target="_blank" rel="noopener"><i class="fab fa-github" aria-hidden="true"></i><span>Source code</span></a>',6)),e.headerShowSupport?(a(),l("a",RB,[...t[24]||(t[24]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-heart"})],-1),n("span",null,"Support the project",-1)])])):f("v-if",!0),t[26]||(t[26]=n("div",{class:"dropdown-divider"},null,-1)),t[27]||(t[27]=n("a",{class:"dropdown-item",href:"/api/user/logout",target:"_self"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-logout"})]),n("span",null,"Sign out")],-1))])])):f("v-if",!0)])])],2),e.generalMessage?(a(),l("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,TB)):f("v-if",!0),e.emailPromptOpen?(a(),l("dialog",{key:1,id:"email-prompt",class:"email-prompt","aria-labelledby":"email-prompt-title","aria-describedby":"email-prompt-reason",onCancel:t[8]||(t[8]=de(s=>e.respondToEmailPrompt("later"),["prevent"]))},[n("form",{onSubmit:t[7]||(t[7]=de(s=>e.respondToEmailPrompt("save"),["prevent"]))},[t[30]||(t[30]=n("h2",{id:"email-prompt-title"},"Stay informed about access problems",-1)),t[31]||(t[31]=n("p",{id:"email-prompt-reason"},"Get email alerts when your GitHub token or repository access fails.",-1)),t[32]||(t[32]=n("label",{for:"email-prompt-address"},"Email address",-1)),P(n("input",{id:"email-prompt-address",class:"form-control",type:"email",autocomplete:"email",maxlength:"254",required:"","onUpdate:modelValue":t[4]||(t[4]=s=>e.emailPromptAddress=s),disabled:e.emailPromptBusy},null,8,PB),[[ot,e.emailPromptAddress]]),e.emailPromptError?(a(),l("p Line truncated
python experiments/run.py`),n("p",null,[g("Contact: "),n("span",{class:"redact",role:"img","aria-label":"Redacted term 3"},[n("i",null,"3")])])])])])])],-1))]),f(" Live stats "),n("section",{class:R(["paper-stats paper-wrap",{"is-empty":e.statsEmpty()}]),id:"metrics","aria-label":"Usage over the last 60 days"},[n("div",UB,[e.statsEmpty()?f("v-if",!0):(a(),l("div",BB,[...t[11]||(t[11]=[n("span",{class:"paper-stats-dot","aria-hidden":"true"},null,-1),g(),n("span",null,[g("Live \xB7 last 60 days"),n("span",{class:"paper-stats-daily"}," \xB7 updated daily")],-1)])])),t[12]||(t[12]=n("div",{class:"paper-stats-meta-right"},"Used by authors at ICSE \xB7 FSE \xB7 OOPSLA",-1))]),e.statsEmpty()?f("v-if",!0):(a(),l("div",zB,[(a(!0),l(V,null,Q(e.cards,(i,o)=>(a(),l("div",{class:"paper-stat-card",key:i?.key},[n("div",{class:R(["paper-stat-value",{"is-pending":!e.stat}])},u(e.stat?e.fmt?.bigNum(i?.total):"\u2014"),3),n("div",HB,u(i?.label),1),e.history[i?.key].bars?.length>1&&e.history[i?.key].deltaToday>0?(a(),l("div",jB," +"+u(e.fmt?.number(e.history[i?.key].deltaToday))+" today ",1)):f("v-if",!0)]))),128))]))],2),f(" Before / after "),t[22]||(t[22]=n("section",{class:"paper-section-head paper-wrap"},[n("div",null,[n("div",{class:"paper-eyebrow"},"Try it"),n("h2",null,[g("The same repository, "),n("em",null,"minus you.")])]),n("p",null," Names, affiliations, emails, and any term you list are replaced across the README, source files, notebooks, and PDF links. Reviewers browse the real thing, not a zip. ")],-1)),n("div",GB,[n("div",WB,[t[13]||(t[13]=n("label",{for:"demo-terms"},[g("Terms to redact "),n("span",null,[g("comma-separated"),n("span",{class:"dt-try"},", try adding your own")])],-1)),P(n("textarea",{id:"demo-terms",class:"demo-terms-input",rows:"1","onUpdate:modelValue":t[0]||(t[0]=i=>e.demoTerms=i),spellcheck:"false",autocomplete:"off",onKeydown:t[1]||(t[1]=Lt(de(()=>{},["prevent"]),["enter"]))},null,544),[[ot,e.demoTerms]])]),n("div",KB,[n("div",YB,[t[15]||(t[15]=n("div",{class:"pane-header"},[n("span",{class:"pane-label"},[g("Your repository "),n("span",{class:"pane-edit-hint"},"\xB7 editable")]),n("span",{class:"pane-url"},"github.com/jane-smith/DeepLearnUtils")],-1)),n("div",JB,[n("div",XB,[(a(!0),l(V,null,Q(e.demoParts(),(i,o)=>(a(),l(V,{key:o},[i.redacted?(a(),l("mark",QB,u(i.original),1)):(a(),l(V,{key:1},[g(u(i.text),1)],64))],64))),128)),t[14]||(t[14]=g("\u200B",-1))]),P(n("textarea",{class:"pane-body demo-input","onUpdate:modelValue":t[2]||(t[2]=i=>e.demoText=i),spellcheck:"false","aria-label":"Sample README to anonymize"},null,512),[[ot,e.demoText]])])]),n("div",ZB,[n("div",xB,[t[16]||(t[16]=n("span",{class:"pane-label"},"What reviewers see",-1)),n("span",ez,[n("span",tz,u(e.demoCount())+" redacted",1)])]),n("div",nz,[(a(!0),l(V,null,Q(e.demoParts(),(i,o)=>(a(),l(V,{key:o},[i.redacted?(a(),l("span",{key:0,class:"redact-chip",title:"Replaces \u201C"+i.original+"\u201D"},u(i.text),9,oz)):(a(),l(V,{key:1},[g(u(i.text),1)],64))],64))),128))])])])]),f(" What you get: one screenshot, three tabs "),t[23]||(t[23]=n("section",{class:"paper-section-head paper-wrap",id:"about"},[n("div",null,[n("div",{class:"paper-eyebrow"},"What you get"),n("h2",null,"Anonymize, review, manage.")]),n("p",null," Terms are redacted in text files. Enabled images and PDFs are served unchanged, so review them for identifying content before sharing. Monitor your mirror, update it, or remove it when the review is over. ")],-1)),n("section",sz,[n("div",iz,[(a(!0),l(V,null,Q(e.features,(i,o)=>(a(),l("div",{class:R(["paper-feature",{"is-on":e.feature===i?.key}]),key:i?.key},[n("button",{type:"button",class:"paper-feature-tab",role:"tab",onClick:r=>e.selectFeature(i.key),onKeydown:r=>e.featureKeydown(r,o),id:"feature-tab-"+i?.key,"aria-controls":"feature-panel-"+i?.key,"aria-selected":e.feature===i?.key,tabindex:e.feature===i?.key?0:-1},[n("span",az,[n("span",lz,u(i?.num),1),t[17]||(t[17]=n("span",{class:"pf-sep"}," \xB7 ",-1)),n("span",dz,u(i?.eyebrow),1)]),n("span",uz,[g(u(i?.title.split("-")[0]),1),i?.title.includes("-")?(a(),l("span",cz,"-")):f("v-if",!0),g(u(i?.title.split("-").slice(1).join("-"))+" "+u(i?.accent),1)])],40,rz),n("div",pz,[n("span",fz,[g(u(i?.title.split("-")[0]),1),i?.title.includes("-")?(a(),l("span",mz,"-")):f("v-if",!0),g(u(i?.title.split("-").slice(1).join("-"))+" "+u(i?.accent),1)]),n("p",null,u(i?.text),1),n("a",{class:"paper-link-arrow",href:e.safeUrl(e.featureHref(i)),target:e.featureTarget(i)},u(i?.cta)+" \u2192",9,hz)])],2))),128))]),n("div",gz,[(a(!0),l(V,null,Q(e.features,(i,o)=>P((a(),l("div",{class:"paper-feature-panel",role:"tabpanel",key:i?.key,id:"feature-panel-"+i?.key,"aria-labelledby":"feature-tab-"+i?.key},[n("div",yz,[n("div",bz,[t[18]||(t[18]=n("span",{class:"dots"},[n("i"),n("i"),n("i")],-1)),n("span",wz,u(i?.url),1)]),n("div",{class:R(["feat-mock","is-"+i?.key]),role:"img","aria-label":i?.alt},[i?.key==="anonymize"?(a(),l("div",Cz,[...t[19]||(t[19]=[ke('<div class="fm-label">GitHub reposit Line truncated
label names the service and the tooltip says who to contact. `),n("li",{class:R(["nav-item nav-extra-item d-none d-lg-block",{"in-user-menu":!!e.user?.username}])},[...t[19]||(t[19]=[n("a",{class:"nav-link",target:"_blank",rel:"noopener",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",title:"Report a problem with the Anonymous GitHub service. Questions about an anonymized repository or paper go to its authors.","data-offset":"30"},[n("svg",{class:"ui-icon d-lg-none mr-1","aria-hidden":"true"},[n("use",{href:"#ui-icon-bug"})]),h("Report a bug ")],-1)])],2),n("li",{class:R(["nav-item nav-support-item nav-extra-item d-none d-lg-block",{"in-user-menu":!!e.user?.username}])},[...t[20]||(t[20]=[n("a",{class:"nav-link nav-support-inline",href:"https://ko-fi.com/tdurieux",target:"_blank",rel:"noopener",title:"Donate on Ko-fi to help cover hosting costs"},[n("svg",{class:"ui-icon nav-heart","aria-hidden":"true"},[n("use",{href:"#ui-icon-heart"})]),h("Support ")],-1)])],2),e.isDarkMode?f("v-if",!0):(a(),l("li",ZB,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to dark mode","aria-label":"Switch to dark mode",onClick:t[1]||(t[1]=s=>{e.darkMode(!0)})},[...t[21]||(t[21]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(a(),l("li",xB,[n("button",{type:"button",class:"nav-link nav-icon",title:"Switch to light mode","aria-label":"Switch to light mode",onClick:t[2]||(t[2]=s=>{e.darkMode(!1)})},[...t[22]||(t[22]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sun"})],-1)])])])):f("v-if",!0),!e.user&&!e.isReviewerRoute?(a(),l("li",ez,[...t[23]||(t[23]=[n("a",{class:"nav-link btn-signin",target:"_self",href:"/signin","data-offset":"30"},[n("i",{class:"fab fa-github mr-1"}),h(" Sign in ")],-1)])])):f("v-if",!0),e.user?.username&&e.headerCanUpgrade&&!e.headerBillingPending?(a(),l("li",tz,[n("a",{class:"nav-link nav-upgrade",href:"/profile?upgrade=1",onClick:t[3]||(t[3]=de(s=>e.openHeaderUpgrade(),["prevent"]))},"Upgrade")])):f("v-if",!0),e.user?(a(),l("li",nz,[n("a",oz,[e.user?.photo?(a(),l("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,sz)):f("v-if",!0),n("span",iz,d(e.user?.username),1)]),n("div",rz,[n("h6",az,"Signed in as @"+d(e.user?.username),1),t[25]||(t[25]=ke('<a class="dropdown-item" href="/profile"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-filter"></use></svg><span>Settings<small>Defaults, quotas, account</small></span></a><a class="dropdown-item" href="/connections"><i class="fab fa-github" aria-hidden="true"></i><span>GitHub connections<small>Repository access and OAuth</small></span></a><a class="dropdown-item" href="/claim"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-link"></use></svg><span>Claim an anonymization<small>Attach an existing mirror to your account</small></span></a><div class="dropdown-divider"></div><a class="dropdown-item" href="https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml" target="_blank" rel="noopener"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-bug"></use></svg><span>Report a bug<small>About this service, not a paper</small></span></a><a class="dropdown-item um-extra" href="https://github.com/tdurieux/anonymous_github/" target="_blank" rel="noopener"><i class="fab fa-github" aria-hidden="true"></i><span>Source code</span></a>',6)),e.headerShowSupport?(a(),l("a",lz,[...t[24]||(t[24]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-heart"})],-1),n("span",null,"Support the project",-1)])])):f("v-if",!0),t[26]||(t[26]=n("div",{class:"dropdown-divider"},null,-1)),t[27]||(t[27]=n("a",{class:"dropdown-item",href:"/api/user/logout",target:"_self"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-logout"})]),n("span",null,"Sign out")],-1))])])):f("v-if",!0)])])],2),e.generalMessage?(a(),l("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,dz)):f("v-if",!0),e.emailPromptOpen?(a(),l("dialog",{key:1,id:"email-prompt",class:"email-prompt","aria-labelledby":"email-prompt-title","aria-describedby":"email-prompt-reason",onCancel:t[8]||(t[8]=de(s=>e.respondToEmailPrompt("later"),["prevent"]))},[n("form",{onSubmit:t[7]||(t[7]=de(s=>e.respondToEmailPrompt("save"),["prevent"]))},[t[30]||(t[30]=n("h2",{id:"email-prompt-title"},"Stay informed about access problems",-1)),t[31]||(t[31]=n("p",{id:"email-prompt-reason"},"Get email alerts when your GitHub token or repository access fails.",-1)),t[32]||(t[32]=n("label",{for:"email-prompt-address"},"Email address",-1)),P(n("input",{id:"email-prompt-address",class:"form-control",type:"email",autocomplete:"email",maxlength:"254",required:"","onUpdate:modelValue":t[4]||(t[4]=s=>e.emailPromptAddress=s),disabled:e.emailPromptBusy},null,8,uz),[[ot,e.emailPromptAddress]]),e.emailPromptError?(a(),l("p Line truncated
python experiments/run.py`),n("p",null,[h("Contact: "),n("span",{class:"redact",role:"img","aria-label":"Redacted term 3"},[n("i",null,"3")])])])])])])],-1))]),f(" Live stats "),n("section",{class:R(["paper-stats paper-wrap",{"is-empty":e.statsEmpty()}]),id:"metrics","aria-label":"Usage over the last 60 days"},[n("div",Cz,[e.statsEmpty()?f("v-if",!0):(a(),l("div",Sz,[...t[11]||(t[11]=[n("span",{class:"paper-stats-dot","aria-hidden":"true"},null,-1),h(),n("span",null,[h("Live \xB7 last 60 days"),n("span",{class:"paper-stats-daily"}," \xB7 updated daily")],-1)])])),t[12]||(t[12]=n("div",{class:"paper-stats-meta-right"},"Used by authors at ICSE \xB7 FSE \xB7 OOPSLA",-1))]),e.statsEmpty()?f("v-if",!0):(a(),l("div",Ez,[(a(!0),l(V,null,Q(e.cards,(i,o)=>(a(),l("div",{class:"paper-stat-card",key:i?.key},[n("div",{class:R(["paper-stat-value",{"is-pending":!e.stat}])},d(e.stat?e.fmt?.bigNum(i?.total):"\u2014"),3),n("div",Nz,d(i?.label),1),e.history[i?.key].bars?.length>1&&e.history[i?.key].deltaToday>0?(a(),l("div",Rz," +"+d(e.fmt?.number(e.history[i?.key].deltaToday))+" today ",1)):f("v-if",!0)]))),128))]))],2),f(" Before / after "),t[22]||(t[22]=n("section",{class:"paper-section-head paper-wrap"},[n("div",null,[n("div",{class:"paper-eyebrow"},"Try it"),n("h2",null,[h("The same repository, "),n("em",null,"minus you.")])]),n("p",null," Names, affiliations, emails, and any term you list are replaced across the README, source files, notebooks, and PDF links. Reviewers browse the real thing, not a zip. ")],-1)),n("div",Tz,[n("div",Pz,[t[13]||(t[13]=n("label",{for:"demo-terms"},[h("Terms to redact "),n("span",null,[h("comma-separated"),n("span",{class:"dt-try"},", try adding your own")])],-1)),P(n("textarea",{id:"demo-terms",class:"demo-terms-input",rows:"1","onUpdate:modelValue":t[0]||(t[0]=i=>e.demoTerms=i),spellcheck:"false",autocomplete:"off",onKeydown:t[1]||(t[1]=Lt(de(()=>{},["prevent"]),["enter"]))},null,544),[[ot,e.demoTerms]])]),n("div",Dz,[n("div",Az,[t[15]||(t[15]=n("div",{class:"pane-header"},[n("span",{class:"pane-label"},[h("Your repository "),n("span",{class:"pane-edit-hint"},"\xB7 editable")]),n("span",{class:"pane-url"},"github.com/jane-smith/DeepLearnUtils")],-1)),n("div",Iz,[n("div",Oz,[(a(!0),l(V,null,Q(e.demoParts(),(i,o)=>(a(),l(V,{key:o},[i.redacted?(a(),l("mark",Mz,d(i.original),1)):(a(),l(V,{key:1},[h(d(i.text),1)],64))],64))),128)),t[14]||(t[14]=h("\u200B",-1))]),P(n("textarea",{class:"pane-body demo-input","onUpdate:modelValue":t[2]||(t[2]=i=>e.demoText=i),spellcheck:"false","aria-label":"Sample README to anonymize"},null,512),[[ot,e.demoText]])])]),n("div",Vz,[n("div",qz,[t[16]||(t[16]=n("span",{class:"pane-label"},"What reviewers see",-1)),n("span",Lz,[n("span",$z,d(e.demoCount())+" redacted",1)])]),n("div",_z,[(a(!0),l(V,null,Q(e.demoParts(),(i,o)=>(a(),l(V,{key:o},[i.redacted?(a(),l("span",{key:0,class:"redact-chip",title:"Replaces \u201C"+i.original+"\u201D"},d(i.text),9,Fz)):(a(),l(V,{key:1},[h(d(i.text),1)],64))],64))),128))])])])]),f(" What you get: one screenshot, three tabs "),t[23]||(t[23]=n("section",{class:"paper-section-head paper-wrap",id:"about"},[n("div",null,[n("div",{class:"paper-eyebrow"},"What you get"),n("h2",null,"Anonymize, review, manage.")]),n("p",null," Terms are redacted in text files. Enabled images and PDFs are served unchanged, so review them for identifying content before sharing. Monitor your mirror, update it, or remove it when the review is over. ")],-1)),n("section",Uz,[n("div",Bz,[(a(!0),l(V,null,Q(e.features,(i,o)=>(a(),l("div",{class:R(["paper-feature",{"is-on":e.feature===i?.key}]),key:i?.key},[n("button",{type:"button",class:"paper-feature-tab",role:"tab",onClick:r=>e.selectFeature(i.key),onKeydown:r=>e.featureKeydown(r,o),id:"feature-tab-"+i?.key,"aria-controls":"feature-panel-"+i?.key,"aria-selected":e.feature===i?.key,tabindex:e.feature===i?.key?0:-1},[n("span",Hz,[n("span",jz,d(i?.num),1),t[17]||(t[17]=n("span",{class:"pf-sep"}," \xB7 ",-1)),n("span",Gz,d(i?.eyebrow),1)]),n("span",Wz,[h(d(i?.title.split("-")[0]),1),i?.title.includes("-")?(a(),l("span",Kz,"-")):f("v-if",!0),h(d(i?.title.split("-").slice(1).join("-"))+" "+d(i?.accent),1)])],40,zz),n("div",Yz,[n("span",Jz,[h(d(i?.title.split("-")[0]),1),i?.title.includes("-")?(a(),l("span",Xz,"-")):f("v-if",!0),h(d(i?.title.split("-").slice(1).join("-"))+" "+d(i?.accent),1)]),n("p",null,d(i?.text),1),n("a",{class:"paper-link-arrow",href:e.safeUrl(e.featureHref(i)),target:e.featureTarget(i)},d(i?.cta)+" \u2192",9,Qz)])],2))),128))]),n("div",Zz,[(a(!0),l(V,null,Q(e.features,(i,o)=>P((a(),l("div",{class:"paper-feature-panel",role:"tabpanel",key:i?.key,id:"feature-panel-"+i?.key,"aria-labelledby":"feature-tab-"+i?.key},[n("div",eH,[n("div",tH,[t[18]||(t[18]=n("span",{class:"dots"},[n("i"),n("i"),n("i")],-1)),n("span",nH,d(i?.url),1)]),n("div",{class:R(["feat-mock","is-"+i?.key]),role:"img","aria-label":i?.alt},[i?.key==="anonymize"?(a(),l("div",sH,[...t[19]||(t[19]=[ke('<div class="fm-label">GitHub reposit Line truncated
<span class="ln">2</span><span class="c"># Author: <span class="redact">XXXX-1</span>, <span class="redact">XXXX-2</span></span>
<span class="ln">3</span><span class="k">import</span> torch
<span class="ln">4</span><span class="k">from</span> utils <span class="k">import</span> load_config
@@ -55,18 +56,18 @@ python experiments/run.py`),n("p",null,[g("Contact: "),n("span",{class:"redact",
<span class="ln">7</span> model = build_model(config)
<span class="ln">8</span> <span class="k">for</span> epoch <span class="k">in</span> range(config.epochs):
<span class="ln">9</span> loss = step(model)
<span class="ln">10</span> log(<span class="s">&quot;epoch %d: %.3f&quot;</span>, epoch, loss)</pre></div>`,2)])])):(a(),l("div",Sz,[...t[21]||(t[21]=[ke('<div class="fm-dash-head"><span>Project</span><span>Status</span><span>Views</span><span>Expires</span></div><div class="fm-dash-row"><span><b>DeepLearnUtils</b><i>paper-7f2a \xB7 ICSE 2027</i></span><span class="st is-ready">Ready</span><span>41</span><span>Mar 31, 2027</span></div><div class="fm-dash-row"><span><b>vision-bench#212</b><i>pull request \xB7 FSE 2027</i></span><span class="st is-ready">Ready</span><span>12</span><span>Never</span></div><div class="fm-dash-row"><span><b>graph-repair</b><i>gr-91ab</i></span><span class="st is-progress">Updating</span><span>5</span><span>Jan 5, 2027</span></div><div class="fm-dash-row is-muted"><span><b>JarSift</b><i>OOPSLA 2025</i></span><span class="st is-expired">Expired</span><span>72</span><span>Sep 28, 2026</span></div>',5)])]))],10,kz)])],8,vz)),[[Z,e.feature===i?.key]])),128))])]),f(" FAQ teaser "),t[24]||(t[24]=ke('<section class="paper-qa paper-qa-r3 paper-wrap" aria-labelledby="qa-heading"><div class="qa-head"><div><div class="paper-eyebrow">Before you sign in</div><h2 id="qa-heading">The questions that come up most.</h2></div><a class="paper-link-arrow" href="/faq">Read the full FAQ \u2192</a></div><div class="qa-grid"><div class="q"><a href="/faq#permissions">What access does GitHub sign-in require?</a><p> The GitHub App has read-only access to gists and the repositories you choose. Legacy OAuth uses broader permissions. Anonymous GitHub never writes to your repositories. </p></div><div class="q"><a href="/faq#formats">Which file formats are supported?</a><p> Source code with syntax highlighting, Markdown, Jupyter notebooks, PDFs, images, and GitHub Pages sites. Text files are anonymized; enabled images and PDFs are served unchanged. </p></div><div class="q"><a href="/faq#expiration">What happens when an anonymized repository expires?</a><p> You choose: the mirror is removed, or visitors are redirected to the original GitHub repository once the review is over. </p></div></div></section><section class="paper-cta paper-wrap" aria-labelledby="cta-heading"><div><h2 id="cta-heading">Ready for review?</h2><p>Create an anonymous mirror in a couple of minutes. Reviewers just open the link.</p></div><div class="paper-cta-actions"><a class="btn-hero" href="/signin" target="_self"><i class="fab fa-github" aria-hidden="true"></i> Sign in with GitHub</a><a class="paper-link-arrow" target="_self" href="https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/">See an anonymized repository \u2192</a></div></section>',2)),Me(s,{name:"partials/footer.htm",state:e.viewState},null,8,["state"])])}var Nz={class:"paper-empty"},Rz={class:"paper-empty-inner"},Tz={key:0,class:"paper-eyebrow"},Pz={key:1,class:"paper-eyebrow"},Dz={key:2,class:"paper-empty-title"},Az=["textContent"];function Sp(e,t){return a(),l("div",Nz,[n("div",Rz,[e.error?f("v-if",!0):(a(),l("div",Tz,"Working")),e.error?(a(),l("div",Pz,"Error")):f("v-if",!0),e.error?f("v-if",!0):(a(),l("h1",Dz,[...t[0]||(t[0]=[g(" Loading",-1),n("span",{class:"dot-anim"},"\u2026",-1)])])),e.error?(a(),l("h1",{key:3,class:"paper-empty-title",textContent:u(e.fmt.translate(e.error))},null,8,Az)):f("v-if",!0)])])}var Iz={class:"container paper-page paper-settings"},Oz={class:"paper-crumbs"},Mz={class:"here"},Vz={class:"paper-page-title"},qz={class:"paper-settings-body"},Lz={class:"paper-settings-toc"},$z={href:"#conf-billing"},_z={class:"form needs-validation paper-settings-main",name:"conference",novalidate:""},Fz={id:"conf-basics",class:"paper-settings-section"},Uz={class:"form-group"},Bz={class:"invalid-feedback"},zz={class:"invalid-feedback"},Hz={class:"form-group"},jz={class:"invalid-feedback"},Gz={class:"form-group"},Wz={class:"invalid-feedback"},Kz={class:"invalid-feedback"},Yz={id:"conf-window",class:"paper-settings-section"},Jz={class:"form-grid-2"},Xz={class:"form-group"},Qz={class:"invalid-feedback"},Zz={class:"invalid-feedback"},xz={class:"form-group"},eH={class:"invalid-feedback"},tH={class:"invalid-feedback"},nH={id:"conf-rendering",class:"paper-settings-section"},oH={class:"form-check"},sH={class:"form-check-input",type:"checkbox",id:"link",name:"link"},iH={class:"form-check"},rH={class:"form-check-input",type:"checkbox",id:"image",name:"image"},aH={class:"form-check"},lH={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},dH={class:"form-check"},uH={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},cH={id:"conf-features",class:"paper-settings-section"},pH={class:"form-check"},fH={class:"form-check-input",type:"checkbox",id:"update",name:"update"},mH={class:"form-check"},hH={class:"form-check-input",type:"checkbox",id:"page",name:"page"},gH={id:"conf-plan",class:"paper-settings-section"},vH={key:0,class:"paper-section-copy"},yH={class:"conference-tiers",role:"radiogroup","aria-label":"Review package size"},Line truncated
`).length))+" lines",1)):f("v-if",!0)]),P(n("button",{type:"button",class:"btn btn-sm btn-icon-only btn-ghost copy-path-btn","aria-label":e.pathCopied?"Path copied":"Copy file path",title:e.pathCopied?"Path copied":"Copy file path",onClick:t[2]||(t[2]=d=>e.copyPath())},[(a(),l("svg",cj,[n("use",{href:e.pathCopied?"#ui-icon-check":"#ui-icon-link"},null,8,pj)]))],8,uj),[[Z,e.filePath]])]),e.type!="html"&&typeof e.content=="string"?(a(),l("span",fj,[e.redactionCount()?(a(),l(V,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[g(u(e.redactionCount()),1),t[49]||(t[49]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,mj),t[50]||(t[50]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),g(u(e.languageName||"Text"),1),n("span",hj,[t[51]||(t[51]=n("span",{class:"sep"},"\xB7",-1)),g(u(e.content.length<1024?e.content.length+" B":(e.content.length/1024).toFixed(1)+" KB"),1)]),t[52]||(t[52]=n("span",{class:"sep"},"\xB7",-1)),g(u(e.fmt?.number(e.content.split(`
`).length))+" lines",1)])):f("v-if",!0),e.type=="html"?(a(),l("span",gj,[e.redactionCount()?(a(),l(V,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[g(u(e.redactionCount()),1),t[53]||(t[53]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,vj),t[54]||(t[54]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),t[56]||(t[56]=g("Markdown",-1)),e.fileSize(e.filePath)!=null?(a(),l(V,{key:1},[t[55]||(t[55]=n("span",{class:"sep"},"\xB7",-1)),g(u(e.formatSize(e.fileSize(e.filePath))),1)],64)):f("v-if",!0)])):f("v-if",!0),e.preview&&e.previewPreserved()?(a(),l("button",{key:2,type:"button",class:"rp-preserved-tag",onClick:t[3]||(t[3]=d=>e.openPreserveFiles())},"Left unredacted")):f("v-if",!0),n("div",yj,[e.isCsv()?(a(),l("div",bj,[n("button",{type:"button",role:"radio",class:R(["seg-chip",{active:e.csvView==="table"}]),"aria-checked":e.csvView==="table",onClick:t[4]||(t[4]=d=>e.csvView="table")},"Table",10,wj),n("button",{type:"button",role:"radio",class:R(["seg-chip",{active:e.csvView==="raw"}]),"aria-checked":e.csvView==="raw",onClick:t[5]||(t[5]=d=>e.csvView="raw"),title:"Show the file as text with line numbers"},"Text",10,kj)])):f("v-if",!0),e.type!="html"&&e.symbols().length>1?(a(),l("div",Cj,[n("button",{type:"button",class:R(["btn btn-sm btn-ghost btn-symbols",{"is-on":e.symbolsOpen}]),"aria-expanded":e.symbolsOpen?"true":"false","aria-haspopup":"true",title:"Symbols in this file",onClick:t[6]||(t[6]=d=>e.symbolsOpen=!e.symbolsOpen)},[...t[57]||(t[57]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-list"})],-1),n("span",{class:"btn-find-label"},"Symbols",-1)])],10,Ej),e.symbolsOpen?(a(),l("div",Sj,[n("div",Nj,u(e.symbols().length)+" "+u(e.symbols().length===1?"symbol":"symbols"),1),(a(!0),l(V,null,Q(e.symbols(),d=>(a(),l("button",{type:"button",class:"symbols-item",role:"menuitem",key:d.line+d.name,onClick:p=>e.goToSymbol(d.line)},[n("span",{class:R(["symbols-kind","is-"+d.kind])},u(d.kind==="class"?"C":d.kind==="function"?"\u0192":"v"),3),n("span",Tj,u(d.name),1),n("span",Pj,u(d.line),1)],8,Rj))),128))])):f("v-if",!0)])):f("v-if",!0),e.type=="html"?(a(),l("button",{key:2,type:"button",class:R(["btn btn-sm btn-ghost btn-icon-only btn-find btn-md-find",{"is-on":e.mdFindOpen}]),"aria-label":"Find on this page",title:"Find on this page ("+(e.isMac?"\u2318":"Ctrl+")+"F)",onClick:t[7]||(t[7]=d=>e.toggleMdFind())},[...t[58]||(t[58]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],10,Dj)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?(a(),l("div",Aj,[e.type!="html"?(a(),l("button",{key:0,type:"button",class:"btn btn-sm btn-ghost btn-icon-only btn-goto","aria-label":"Go to line",title:"Go to line ("+(e.isMac?"\u2318":"Ctrl+")+"G)",onClick:t[8]||(t[8]=d=>e.gotoLine())},[...t[59]||(t[59]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1)])],8,Ij)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:1,type:"button",class:R(["btn btn-sm btn-icon-only btn-ghost btn-toggle",{"is-on":e.wrapLines}]),"aria-pressed":e.wrapLines?"true":"false","aria-label":"Wrap lines",title:"Wrap lines (Alt+Z)",onClick:t[9]||(t[9]=d=>e.toggleWrap())},[...t[60]||(t[60]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)])],10,Oj)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:2,type:"button",class:"btn btn-sm btn-ghost btn-icon-only btn-find","aria-label":"Find in file",title:"Find in file ("+(e.isMac?"\u2318":"Ctrl+")+"F)",onClick:t[10]||(t[10]=d=>e.findInFile())},[...t[61]||(t[61]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],8,Mj)):f("v-if",!0)])):f("v-if",!0),!e.preview||e.url?(a(),l("div",Vj,[n("a",{target:e.preview?"_blank":"_self",class:"tb-seg-btn",title:e.type=="html"?"Open the Markdown source":"Open the raw file",href:e.safeUrl(e.url)},"Raw",8,qj),typeof e.content=="string"?(a(),l("button",{key:0,type:"button",class:"tb-seg-btn tb-seg-icon","aria-label":e.contentCopied?"Copied":"Copy file contents",title:e.contentCopied?"Copied":"Copy file contents",onClick:t[11]||(t[11]=d=>e.copyContent())},[(a(),l("svg",$j,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,_j)]))],8,Lj)):f("v-if",!0),n("a",{target:e.preview?"_blank":"_self",class:"tb-seg-btn tb-seg-icon","aria-label":"Download file",title:"Download file",href:e.safeUrl(e.downloadUrl()),download:e.preview?e.paths[e.paths.length-1]:null},[...t[62]||(t[62]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1)])],8,Fj)])):f("v-if",!0),typeof e.content=="string"?(a(),l("button",{key:5,type:"button",class:"btn btn-sm btn-icon-only btn-ghost tb-copy-m","aria-label":e.contentCopied?"Copied":"Copy file contents",onClick:t[12]||(t[12]=d=>e.copyContent())},[(a(),l("svg",Bj,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,zj)]))],8,Uj)):f("v-if",!0),e.type=="html"&&e.r Line truncated
`).length))+" lines",1)],64)):f("v-if",!0)])):f("v-if",!0),e.options?.publishedAt||e.options?.sourceCommitDate||e.options?.anonymizedAt||e.options?.lastUpdateDate?(a(),l("div",Qj)):f("v-if",!0),e.type=="html"?(a(),l("button",{key:3,type:"button",role:"menuitem",onClick:t[17]||(t[17]=d=>e.toggleMdFind())},[...t[67]||(t[67]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),g("Find in file",-1)])])):f("v-if",!0),e.type=="html"?(a(),l("div",Zj)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:5,type:"button",role:"menuitem",onClick:t[18]||(t[18]=d=>e.findInFile())},[...t[68]||(t[68]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),g("Find in file",-1)])])):f("v-if",!0),e.type!="html"?(a(),l("button",{key:6,type:"button",role:"menuitem",onClick:t[19]||(t[19]=d=>e.gotoLine())},[...t[69]||(t[69]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1),g("Go to line",-1)])])):f("v-if",!0),e.type!="html"?(a(),l("button",{key:7,type:"button",role:"menuitemcheckbox","aria-checked":e.wrapLines?"true":"false",onClick:t[20]||(t[20]=d=>e.toggleWrap())},[t[70]||(t[70]=n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)),t[71]||(t[71]=g("Wrap lines",-1)),e.wrapLines?(a(),l("span",eG,"\u2713")):f("v-if",!0)],8,xj)):f("v-if",!0),e.isCsv()?(a(),l("button",{key:8,type:"button",role:"menuitem",class:"tb-csv-view",onClick:t[21]||(t[21]=d=>{e.csvView=e.csvView==="table"?"raw":"table",e.moreOpen=!1})},[(a(),l("svg",tG,[n("use",{href:e.csvView==="table"?"#ui-icon-code":"#ui-icon-list"},null,8,nG)])),g(u(e.csvView==="table"?"Show as text":"Show as table"),1)])):f("v-if",!0),e.type!="html"?(a(),l("div",oG)):f("v-if",!0),e.type=="html"&&(!e.preview||e.url)?(a(),l("a",{key:10,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.url)},[...t[72]||(t[72]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),g("View raw",-1)])],8,sG)):f("v-if",!0),e.type!="html"&&(!e.preview||e.url)?(a(),l("a",{key:11,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.url)},[...t[73]||(t[73]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),g("View raw",-1)])],8,iG)):f("v-if",!0),!e.preview||e.url?(a(),l("a",{key:12,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.downloadUrl()),download:e.preview?e.paths[e.paths.length-1]:null},[...t[74]||(t[74]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1),g("Download file",-1)])],8,rG)):f("v-if",!0),e.options?.hasWebsite?(a(),l("a",{key:13,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl("/w/"+e.repoId+"/")},[...t[75]||(t[75]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-globe"})],-1),g("Open website",-1)])],8,aG)):f("v-if",!0),e.options?.isAdmin||e.options?.isOwner?(a(),l("a",{key:14,role:"menuitem",href:e.safeUrl("/anonymize/"+e.repoId)},[...t[76]||(t[76]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-edit"})],-1),g("Edit anonymization",-1)])],8,lG)):f("v-if",!0),e.options?.download?(a(),l("a",{key:15,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl("/api/repo/"+e.repoId+"/zip")},[...t[77]||(t[77]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-archive"})],-1),g("Download ZIP",-1)])],8,dG)):f("v-if",!0),n("button",{type:"button",role:"menuitem",onClick:t[22]||(t[22]=d=>e.copyPath())},[...t[78]||(t[78]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-link"})],-1),g("Copy file path",-1)])]),t[79]||(t[79]=n("div",{class:"tb-menu-sep"},null,-1)),t[80]||(t[80]=n("a",{role:"menuitem",href:"/faq"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-help"})]),g("FAQ")],-1)),t[81]||(t[81]=n("a",{role:"menuitem",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",target:"_blank",rel:"noopener"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-bug"})]),g("Report a bug")],-1))])):f("v-if",!0)])]),e.gotoOpen&&e.type!="html"?(a(),l("form",{key:3,class:"goto-pop",role:"dialog","aria-label":"Go to line",onSubmit:t[26]||(t[26]=de(d=>e.submitGoto(),["prevent"]))},[t[82]||(t[82]=n("label",{class:"goto-label",for:"goto-input"},"Go to line",-1)),P(n("input",{id:"goto-input",class:"goto-input",type:"text",inputmode:"numeric",autocomplete:"off",spellcheck:"false",placeholder:"1\u2013"+e.fmt?.number(typeof e.content=="string"?e.content.split(`
`).length:1),"aria-invalid":e.gotoError?"true":"false","onUpdate:modelValue":t[24]||(t[24]=d=>e.gotoValue=d),onKeydown:t[25]||(t[25]=Lt(de(d=>e.closeGoto(),["prevent","stop"]),["esc"]))},null,40,uG),[[ot,e.gotoValue]]),n("span",{class:R(["goto-hint",{"is-error":e.gotoError}])},u(e.gotoError||"Line, or line:column"),3)],32)):f("v-if",!0)]),e.isCsv()&&e.csvView==="table"?(a(),l("div",{key:0,class:"csv-table-wrap",tabindex:"0",role:"region","aria-label":"Table view of "+(e.paths?.[e.paths.length-1]||"file")},[n("table",pG,[n("thead",null,[n("tr",null,[t[83]||(t[83]=n("th",{class:"csv-rownum",scope:"col"},[n("span",{class:"sr-only"},"Row")],-1)),(a(!0),l(V,null,Q(e.csvRows()[0]||[],(d,p)=>(a(),l("th",{scope:"col",key:p,class:R({"is-num":e.csvNumCol(p)})},[(a(!0),l(V,null,Q(e.redactParts(d),(c,v)=>(a(),l(V,{key:v},[c.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+c.n},[n("i",null,u(c.n),1)],8,fG)):(a(),l(V,{key:1},[g(u(c.t),1)],64))],64))),128))],2))),128))])]),n("tbody",null,[(a(!0),l(V,null,Q(e.csvRows().slice(1),(d,p)=>(a(),l("tr",{key:p},[n("td",mG,u(p+1),1),(a(!0),l(V,null,Q(d,(c,v)=>(a(),l("td",{key:v,class:R({"is-num":e.csvNumCol(v)})},[(a(!0),l(V,null,Q(e.redactParts(c),(h,y)=>(a(),l(V,{key:y},[h.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+h.n},[n("i",null,u(h.n),1)],8,hG)):(a(),l(V,{key:1},[g(u(h.t),1)],64))],64))),128))],2))),128))]))),128))])])],8,cG)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?P((a(),l("div",gG,null,512)),[[r,{content:e.content,options:e.aceOption}]]):f("v-if",!0),e.type=="html"&&e.mdFindOpen?(a(),l("div",vG,[n("input",{type:"search",class:"md-find-input",placeholder:"Find on this page","aria-label":"Find on this page",value:e.mdFindQuery,onInput:t[27]||(t[27]=d=>{e.mdFindQuery=d.target.value,e.runMdFind()}),onKeydown:[t[28]||(t[28]=Lt(de(d=>d.shiftKey?e.stepMdFind(-1):e.stepMdFind(1),["prevent"]),["enter"])),t[29]||(t[29]=Lt(de(d=>e.toggleMdFind(!1),["prevent"]),["esc"]))]},null,40,yG),n("span",bG,[n("button",{type:"button","aria-label":"Previous match",onClick:t[30]||(t[30]=d=>e.stepMdFind(-1)),disabled:!e.mdFindTotal},[...t[84]||(t[84]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-left"})],-1)])],8,wG),n("button",{type:"button","aria-label":"Next match",onClick:t[31]||(t[31]=d=>e.stepMdFind(1)),disabled:!e.mdFindTotal},[...t[85]||(t[85]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-right"})],-1)])],8,kG)]),n("span",CG,u(e.mdFindQuery?e.mdFindTotal?e.mdFindIndex+1+" of "+e.mdFindTotal:"No results":""),1),n("button",{type:"button",class:R(["md-find-opt",{"is-on":e.mdFindCase}]),"aria-pressed":e.mdFindCase?"true":"false",title:"Match case","aria-label":"Match case",onClick:t[32]||(t[32]=d=>{e.mdFindCase=!e.mdFindCase,e.runMdFind()})},"Aa",10,EG),n("button",{type:"button",class:"md-find-close","aria-label":"Close find",onClick:t[33]||(t[33]=d=>e.toggleMdFind(!1))},"\xD7")])):f("v-if",!0),e.type=="html"?(a(),l("div",SG,[n("div",{class:"file-content markdown-body",innerHTML:e.renderReadme(e.sanitize(e.content))},null,8,NG),e.readmeToc().length>=3?(a(),l("aside",RG,[t[86]||(t[86]=n("div",{class:"readme-toc-head"},"On this page",-1)),n("nav",TG,[n("a",{href:"#",class:R(["lvl-2 toc-top",{"is-active":!e.activeHeading}]),onClick:t[34]||(t[34]=de(d=>e.scrollToHeading(null),["prevent"]))},"Introduction",2),(a(!0),l(V,null,Q(e.readmeToc(),(d,p)=>(a(),l("a",{key:d.id,href:"#"+d.id,class:R(["lvl-"+d.level,{"is-active":e.activeHeading===d.id}]),onClick:de(c=>e.scrollToHeading(d.id),["prevent"])},u(d.text),11,PG))),128))])])):f("v-if",!0)])):f("v-if",!0)],2)):f("v-if",!0),e.type=="html-doc"&&!e.showSource&&e.content!=null?(a(),Wt(s,{key:2,content:e.content,"base-url":e.fileBaseUrl,"allow-scripts":e.allowScripts},null,8,["content","base-url","allow-scripts"])):f("v-if",!0),e.fileFrame()?(a(),l("section",{key:3,class:R(["file-card file-card-media","view-"+e.type])},[n("header",DG,[n("div",AG,[n("button",{type:"button",class:R(["btn btn-sm btn-icon-only btn-ghost card-files-btn",{"is-needed":e.sidebarHidden}]),title:"Show file tree",onClick:t[35]||(t[35]=d=>e.sidebarHidden?e.sidebarHidden=!1:e.sidebarCollapsed=!1)},[...t[87]||(t[87]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sidebar"})],-1),n("span",{class:"card-files-label"},"Files",-1)])],2),n("ol",IG,[n("li",OG,[n("a",{href:e.safeUrl("/r/"+e.repoId+"/"),title:e.repoId,textContent:u(/^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(e.repoId||"")?"repository":e.repoId)},null,8,MG)]),(a(!0),l(V,null,Q(e.paths,(d,p)=>(a(),l("li",{class:"breadcrumb-item","aria-current":p===e.paths.length-1?"page":null},[(a(!0),l(V,null,Q(e.redactParts(d),(c,v)=>(a(),l(V,{key:v},[c.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+c.n},[n("i",null,u(c.n),1)],8,qG)):(a(),l(V,{key:1},[g(u(c.t),1)],64))],64))),128))],8,VG))),256))]),n("span",LG,[e.type=="IPython Line truncated
<span class="ln">10</span> log(<span class="s">&quot;epoch %d: %.3f&quot;</span>, epoch, loss)</pre></div>`,2)])])):(a(),l("div",rH,[...t[21]||(t[21]=[ke('<div class="fm-dash-head"><span>Project</span><span>Status</span><span>Views</span><span>Expires</span></div><div class="fm-dash-row"><span><b>DeepLearnUtils</b><i>paper-7f2a \xB7 ICSE 2027</i></span><span class="st is-ready">Ready</span><span>41</span><span>Mar 31, 2027</span></div><div class="fm-dash-row"><span><b>vision-bench#212</b><i>pull request \xB7 FSE 2027</i></span><span class="st is-ready">Ready</span><span>12</span><span>Never</span></div><div class="fm-dash-row"><span><b>graph-repair</b><i>gr-91ab</i></span><span class="st is-progress">Updating</span><span>5</span><span>Jan 5, 2027</span></div><div class="fm-dash-row is-muted"><span><b>JarSift</b><i>OOPSLA 2025</i></span><span class="st is-expired">Expired</span><span>72</span><span>Sep 28, 2026</span></div>',5)])]))],10,oH)])],8,xz)),[[Z,e.feature===i?.key]])),128))])]),f(" FAQ teaser "),t[24]||(t[24]=ke('<section class="paper-qa paper-qa-r3 paper-wrap" aria-labelledby="qa-heading"><div class="qa-head"><div><div class="paper-eyebrow">Before you sign in</div><h2 id="qa-heading">The questions that come up most.</h2></div><a class="paper-link-arrow" href="/faq">Read the full FAQ \u2192</a></div><div class="qa-grid"><div class="q"><a href="/faq#permissions">What access does GitHub sign-in require?</a><p> The GitHub App has read-only access to gists and the repositories you choose. Legacy OAuth uses broader permissions. Anonymous GitHub never writes to your repositories. </p></div><div class="q"><a href="/faq#formats">Which file formats are supported?</a><p> Source code with syntax highlighting, Markdown, Jupyter notebooks, PDFs, images, and GitHub Pages sites. Text files are anonymized; enabled images and PDFs are served unchanged. </p></div><div class="q"><a href="/faq#expiration">What happens when an anonymized repository expires?</a><p> You choose: the mirror is removed, or visitors are redirected to the original GitHub repository once the review is over. </p></div></div></section><section class="paper-cta paper-wrap" aria-labelledby="cta-heading"><div><h2 id="cta-heading">Ready for review?</h2><p>Create an anonymous mirror in a couple of minutes. Reviewers just open the link.</p></div><div class="paper-cta-actions"><a class="btn-hero" href="/signin" target="_self"><i class="fab fa-github" aria-hidden="true"></i> Sign in with GitHub</a><a class="paper-link-arrow" target="_self" href="https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/">See an anonymized repository \u2192</a></div></section>',2)),Me(s,{name:"partials/footer.htm",state:e.viewState},null,8,["state"])])}var aH={class:"paper-empty"},lH={class:"paper-empty-inner"},dH={key:0,class:"paper-eyebrow"},uH={key:1,class:"paper-eyebrow"},cH={key:2,class:"paper-empty-title"},pH=["textContent"];function Ep(e,t){return a(),l("div",aH,[n("div",lH,[e.error?f("v-if",!0):(a(),l("div",dH,"Working")),e.error?(a(),l("div",uH,"Error")):f("v-if",!0),e.error?f("v-if",!0):(a(),l("h1",cH,[...t[0]||(t[0]=[h(" Loading",-1),n("span",{class:"dot-anim"},"\u2026",-1)])])),e.error?(a(),l("h1",{key:3,class:"paper-empty-title",textContent:d(e.fmt.translate(e.error))},null,8,pH)):f("v-if",!0)])])}var fH={class:"container paper-page paper-settings"},mH={class:"paper-crumbs"},hH={class:"here"},gH={class:"paper-page-title"},vH={class:"paper-settings-body"},yH={class:"paper-settings-toc"},bH={href:"#conf-billing"},wH={class:"form needs-validation paper-settings-main",name:"conference",novalidate:""},kH={id:"conf-basics",class:"paper-settings-section"},CH={class:"form-group"},SH={class:"invalid-feedback"},EH={class:"invalid-feedback"},NH={class:"form-group"},RH={class:"invalid-feedback"},TH={class:"form-group"},PH={class:"invalid-feedback"},DH={class:"invalid-feedback"},AH={id:"conf-window",class:"paper-settings-section"},IH={class:"form-grid-2"},OH={class:"form-group"},MH={class:"invalid-feedback"},VH={class:"invalid-feedback"},qH={class:"form-group"},LH={class:"invalid-feedback"},$H={class:"invalid-feedback"},_H={id:"conf-rendering",class:"paper-settings-section"},FH={class:"form-check"},UH={class:"form-check-input",type:"checkbox",id:"link",name:"link"},BH={class:"form-check"},zH={class:"form-check-input",type:"checkbox",id:"image",name:"image"},HH={class:"form-check"},jH={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},GH={class:"form-check"},WH={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},KH={id:"conf-features",class:"paper-settings-section"},YH={class:"form-check"},JH={class:"form-check-input",type:"checkbox",id:"update",name:"update"},XH={class:"form-check"},QH={class:"form-check-input",type:"checkbox",id:"page",name:"page"},ZH={id:"conf-plan",class:"paper-settings-section"},xH={key:0,class:"paper-section-copy"},ej={class:"conference-tiers",role:"radiogroup","aria-label":"Review package size"},Line truncated
`).length))+" lines",1)):f("v-if",!0)]),P(n("button",{type:"button",class:"btn btn-sm btn-icon-only btn-ghost copy-path-btn","aria-label":e.pathCopied?"Path copied":"Copy file path",title:e.pathCopied?"Path copied":"Copy file path",onClick:t[2]||(t[2]=u=>e.copyPath())},[(a(),l("svg",Kj,[n("use",{href:e.pathCopied?"#ui-icon-check":"#ui-icon-link"},null,8,Yj)]))],8,Wj),[[Z,e.filePath]])]),e.type!="html"&&typeof e.content=="string"?(a(),l("span",Jj,[e.redactionCount()?(a(),l(V,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[h(d(e.redactionCount()),1),t[49]||(t[49]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,Xj),t[50]||(t[50]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),h(d(e.languageName||"Text"),1),n("span",Qj,[t[51]||(t[51]=n("span",{class:"sep"},"\xB7",-1)),h(d(e.content.length<1024?e.content.length+" B":(e.content.length/1024).toFixed(1)+" KB"),1)]),t[52]||(t[52]=n("span",{class:"sep"},"\xB7",-1)),h(d(e.fmt?.number(e.content.split(`
`).length))+" lines",1)])):f("v-if",!0),e.type=="html"?(a(),l("span",Zj,[e.redactionCount()?(a(),l(V,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[h(d(e.redactionCount()),1),t[53]||(t[53]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,xj),t[54]||(t[54]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),t[56]||(t[56]=h("Markdown",-1)),e.fileSize(e.filePath)!=null?(a(),l(V,{key:1},[t[55]||(t[55]=n("span",{class:"sep"},"\xB7",-1)),h(d(e.formatSize(e.fileSize(e.filePath))),1)],64)):f("v-if",!0)])):f("v-if",!0),e.preview&&e.previewPreserved()?(a(),l("button",{key:2,type:"button",class:"rp-preserved-tag",onClick:t[3]||(t[3]=u=>e.openPreserveFiles())},"Left unredacted")):f("v-if",!0),n("div",eG,[e.isCsv()?(a(),l("div",tG,[n("button",{type:"button",role:"radio",class:R(["seg-chip",{active:e.csvView==="table"}]),"aria-checked":e.csvView==="table",onClick:t[4]||(t[4]=u=>e.csvView="table")},"Table",10,nG),n("button",{type:"button",role:"radio",class:R(["seg-chip",{active:e.csvView==="raw"}]),"aria-checked":e.csvView==="raw",onClick:t[5]||(t[5]=u=>e.csvView="raw"),title:"Show the file as text with line numbers"},"Text",10,oG)])):f("v-if",!0),e.type!="html"&&e.symbols().length>1?(a(),l("div",sG,[n("button",{type:"button",class:R(["btn btn-sm btn-ghost btn-symbols",{"is-on":e.symbolsOpen}]),"aria-expanded":e.symbolsOpen?"true":"false","aria-haspopup":"true",title:"Symbols in this file",onClick:t[6]||(t[6]=u=>e.symbolsOpen=!e.symbolsOpen)},[...t[57]||(t[57]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-list"})],-1),n("span",{class:"btn-find-label"},"Symbols",-1)])],10,iG),e.symbolsOpen?(a(),l("div",rG,[n("div",aG,d(e.symbols().length)+" "+d(e.symbols().length===1?"symbol":"symbols"),1),(a(!0),l(V,null,Q(e.symbols(),u=>(a(),l("button",{type:"button",class:"symbols-item",role:"menuitem",key:u.line+u.name,onClick:p=>e.goToSymbol(u.line)},[n("span",{class:R(["symbols-kind","is-"+u.kind])},d(u.kind==="class"?"C":u.kind==="function"?"\u0192":"v"),3),n("span",dG,d(u.name),1),n("span",uG,d(u.line),1)],8,lG))),128))])):f("v-if",!0)])):f("v-if",!0),e.type=="html"?(a(),l("button",{key:2,type:"button",class:R(["btn btn-sm btn-ghost btn-icon-only btn-find btn-md-find",{"is-on":e.mdFindOpen}]),"aria-label":"Find on this page",title:"Find on this page ("+(e.isMac?"\u2318":"Ctrl+")+"F)",onClick:t[7]||(t[7]=u=>e.toggleMdFind())},[...t[58]||(t[58]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],10,cG)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?(a(),l("div",pG,[e.type!="html"?(a(),l("button",{key:0,type:"button",class:"btn btn-sm btn-ghost btn-icon-only btn-goto","aria-label":"Go to line",title:"Go to line ("+(e.isMac?"\u2318":"Ctrl+")+"G)",onClick:t[8]||(t[8]=u=>e.gotoLine())},[...t[59]||(t[59]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1)])],8,fG)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:1,type:"button",class:R(["btn btn-sm btn-icon-only btn-ghost btn-toggle",{"is-on":e.wrapLines}]),"aria-pressed":e.wrapLines?"true":"false","aria-label":"Wrap lines",title:"Wrap lines (Alt+Z)",onClick:t[9]||(t[9]=u=>e.toggleWrap())},[...t[60]||(t[60]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)])],10,mG)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:2,type:"button",class:"btn btn-sm btn-ghost btn-icon-only btn-find","aria-label":"Find in file",title:"Find in file ("+(e.isMac?"\u2318":"Ctrl+")+"F)",onClick:t[10]||(t[10]=u=>e.findInFile())},[...t[61]||(t[61]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],8,hG)):f("v-if",!0)])):f("v-if",!0),!e.preview||e.url?(a(),l("div",gG,[n("a",{target:e.preview?"_blank":"_self",class:"tb-seg-btn",title:e.type=="html"?"Open the Markdown source":"Open the raw file",href:e.safeUrl(e.url)},"Raw",8,vG),typeof e.content=="string"?(a(),l("button",{key:0,type:"button",class:"tb-seg-btn tb-seg-icon","aria-label":e.contentCopied?"Copied":"Copy file contents",title:e.contentCopied?"Copied":"Copy file contents",onClick:t[11]||(t[11]=u=>e.copyContent())},[(a(),l("svg",bG,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,wG)]))],8,yG)):f("v-if",!0),n("a",{target:e.preview?"_blank":"_self",class:"tb-seg-btn tb-seg-icon","aria-label":"Download file",title:"Download file",href:e.safeUrl(e.downloadUrl()),download:e.preview?e.paths[e.paths.length-1]:null},[...t[62]||(t[62]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1)])],8,kG)])):f("v-if",!0),typeof e.content=="string"?(a(),l("button",{key:5,type:"button",class:"btn btn-sm btn-icon-only btn-ghost tb-copy-m","aria-label":e.contentCopied?"Copied":"Copy file contents",onClick:t[12]||(t[12]=u=>e.copyContent())},[(a(),l("svg",SG,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,EG)]))],8,CG)):f("v-if",!0),e.type=="html"&&e.r Line truncated
`).length))+" lines",1)],64)):f("v-if",!0)])):f("v-if",!0),e.options?.publishedAt||e.options?.sourceCommitDate||e.options?.anonymizedAt||e.options?.lastUpdateDate?(a(),l("div",MG)):f("v-if",!0),e.type=="html"?(a(),l("button",{key:3,type:"button",role:"menuitem",onClick:t[17]||(t[17]=u=>e.toggleMdFind())},[...t[67]||(t[67]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),h("Find in file",-1)])])):f("v-if",!0),e.type=="html"?(a(),l("div",VG)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:5,type:"button",role:"menuitem",onClick:t[18]||(t[18]=u=>e.findInFile())},[...t[68]||(t[68]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),h("Find in file",-1)])])):f("v-if",!0),e.type!="html"?(a(),l("button",{key:6,type:"button",role:"menuitem",onClick:t[19]||(t[19]=u=>e.gotoLine())},[...t[69]||(t[69]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1),h("Go to line",-1)])])):f("v-if",!0),e.type!="html"?(a(),l("button",{key:7,type:"button",role:"menuitemcheckbox","aria-checked":e.wrapLines?"true":"false",onClick:t[20]||(t[20]=u=>e.toggleWrap())},[t[70]||(t[70]=n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)),t[71]||(t[71]=h("Wrap lines",-1)),e.wrapLines?(a(),l("span",LG,"\u2713")):f("v-if",!0)],8,qG)):f("v-if",!0),e.isCsv()?(a(),l("button",{key:8,type:"button",role:"menuitem",class:"tb-csv-view",onClick:t[21]||(t[21]=u=>{e.csvView=e.csvView==="table"?"raw":"table",e.moreOpen=!1})},[(a(),l("svg",$G,[n("use",{href:e.csvView==="table"?"#ui-icon-code":"#ui-icon-list"},null,8,_G)])),h(d(e.csvView==="table"?"Show as text":"Show as table"),1)])):f("v-if",!0),e.type!="html"?(a(),l("div",FG)):f("v-if",!0),e.type=="html"&&(!e.preview||e.url)?(a(),l("a",{key:10,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.url)},[...t[72]||(t[72]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),h("View raw",-1)])],8,UG)):f("v-if",!0),e.type!="html"&&(!e.preview||e.url)?(a(),l("a",{key:11,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.url)},[...t[73]||(t[73]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),h("View raw",-1)])],8,BG)):f("v-if",!0),!e.preview||e.url?(a(),l("a",{key:12,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl(e.downloadUrl()),download:e.preview?e.paths[e.paths.length-1]:null},[...t[74]||(t[74]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1),h("Download file",-1)])],8,zG)):f("v-if",!0),e.options?.hasWebsite?(a(),l("a",{key:13,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl("/w/"+e.repoId+"/")},[...t[75]||(t[75]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-globe"})],-1),h("Open website",-1)])],8,HG)):f("v-if",!0),e.options?.isAdmin||e.options?.isOwner?(a(),l("a",{key:14,role:"menuitem",href:e.safeUrl("/anonymize/"+e.repoId)},[...t[76]||(t[76]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-edit"})],-1),h("Edit anonymization",-1)])],8,jG)):f("v-if",!0),e.options?.download?(a(),l("a",{key:15,role:"menuitem",target:e.preview?"_blank":"_self",href:e.safeUrl("/api/repo/"+e.repoId+"/zip")},[...t[77]||(t[77]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-archive"})],-1),h("Download ZIP",-1)])],8,GG)):f("v-if",!0),n("button",{type:"button",role:"menuitem",onClick:t[22]||(t[22]=u=>e.copyPath())},[...t[78]||(t[78]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-link"})],-1),h("Copy file path",-1)])]),t[79]||(t[79]=n("div",{class:"tb-menu-sep"},null,-1)),t[80]||(t[80]=n("a",{role:"menuitem",href:"/faq"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-help"})]),h("FAQ")],-1)),t[81]||(t[81]=n("a",{role:"menuitem",href:"https://github.com/tdurieux/anonymous_github/issues/new?template=issue_report.yml",target:"_blank",rel:"noopener"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-bug"})]),h("Report a bug")],-1))])):f("v-if",!0)])]),e.gotoOpen&&e.type!="html"?(a(),l("form",{key:3,class:"goto-pop",role:"dialog","aria-label":"Go to line",onSubmit:t[26]||(t[26]=de(u=>e.submitGoto(),["prevent"]))},[t[82]||(t[82]=n("label",{class:"goto-label",for:"goto-input"},"Go to line",-1)),P(n("input",{id:"goto-input",class:"goto-input",type:"text",inputmode:"numeric",autocomplete:"off",spellcheck:"false",placeholder:"1\u2013"+e.fmt?.number(typeof e.content=="string"?e.content.split(`
`).length:1),"aria-invalid":e.gotoError?"true":"false","onUpdate:modelValue":t[24]||(t[24]=u=>e.gotoValue=u),onKeydown:t[25]||(t[25]=Lt(de(u=>e.closeGoto(),["prevent","stop"]),["esc"]))},null,40,WG),[[ot,e.gotoValue]]),n("span",{class:R(["goto-hint",{"is-error":e.gotoError}])},d(e.gotoError||"Line, or line:column"),3)],32)):f("v-if",!0)]),e.isCsv()&&e.csvView==="table"?(a(),l("div",{key:0,class:"csv-table-wrap",tabindex:"0",role:"region","aria-label":"Table view of "+(e.paths?.[e.paths.length-1]||"file")},[n("table",YG,[n("thead",null,[n("tr",null,[t[83]||(t[83]=n("th",{class:"csv-rownum",scope:"col"},[n("span",{class:"sr-only"},"Row")],-1)),(a(!0),l(V,null,Q(e.csvRows()[0]||[],(u,p)=>(a(),l("th",{scope:"col",key:p,class:R({"is-num":e.csvNumCol(p)})},[(a(!0),l(V,null,Q(e.redactParts(u),(c,v)=>(a(),l(V,{key:v},[c.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+c.n},[n("i",null,d(c.n),1)],8,JG)):(a(),l(V,{key:1},[h(d(c.t),1)],64))],64))),128))],2))),128))])]),n("tbody",null,[(a(!0),l(V,null,Q(e.csvRows().slice(1),(u,p)=>(a(),l("tr",{key:p},[n("td",XG,d(p+1),1),(a(!0),l(V,null,Q(u,(c,v)=>(a(),l("td",{key:v,class:R({"is-num":e.csvNumCol(v)})},[(a(!0),l(V,null,Q(e.redactParts(c),(g,y)=>(a(),l(V,{key:y},[g.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+g.n},[n("i",null,d(g.n),1)],8,QG)):(a(),l(V,{key:1},[h(d(g.t),1)],64))],64))),128))],2))),128))]))),128))])])],8,KG)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?P((a(),l("div",ZG,null,512)),[[r,{content:e.content,options:e.aceOption}]]):f("v-if",!0),e.type=="html"&&e.mdFindOpen?(a(),l("div",xG,[n("input",{type:"search",class:"md-find-input",placeholder:"Find on this page","aria-label":"Find on this page",value:e.mdFindQuery,onInput:t[27]||(t[27]=u=>{e.mdFindQuery=u.target.value,e.runMdFind()}),onKeydown:[t[28]||(t[28]=Lt(de(u=>u.shiftKey?e.stepMdFind(-1):e.stepMdFind(1),["prevent"]),["enter"])),t[29]||(t[29]=Lt(de(u=>e.toggleMdFind(!1),["prevent"]),["esc"]))]},null,40,eW),n("span",tW,[n("button",{type:"button","aria-label":"Previous match",onClick:t[30]||(t[30]=u=>e.stepMdFind(-1)),disabled:!e.mdFindTotal},[...t[84]||(t[84]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-left"})],-1)])],8,nW),n("button",{type:"button","aria-label":"Next match",onClick:t[31]||(t[31]=u=>e.stepMdFind(1)),disabled:!e.mdFindTotal},[...t[85]||(t[85]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-right"})],-1)])],8,oW)]),n("span",sW,d(e.mdFindQuery?e.mdFindTotal?e.mdFindIndex+1+" of "+e.mdFindTotal:"No results":""),1),n("button",{type:"button",class:R(["md-find-opt",{"is-on":e.mdFindCase}]),"aria-pressed":e.mdFindCase?"true":"false",title:"Match case","aria-label":"Match case",onClick:t[32]||(t[32]=u=>{e.mdFindCase=!e.mdFindCase,e.runMdFind()})},"Aa",10,iW),n("button",{type:"button",class:"md-find-close","aria-label":"Close find",onClick:t[33]||(t[33]=u=>e.toggleMdFind(!1))},"\xD7")])):f("v-if",!0),e.type=="html"?(a(),l("div",rW,[n("div",{class:"file-content markdown-body",innerHTML:e.renderReadme(e.sanitize(e.content))},null,8,aW),e.readmeToc().length>=3?(a(),l("aside",lW,[t[86]||(t[86]=n("div",{class:"readme-toc-head"},"On this page",-1)),n("nav",dW,[n("a",{href:"#",class:R(["lvl-2 toc-top",{"is-active":!e.activeHeading}]),onClick:t[34]||(t[34]=de(u=>e.scrollToHeading(null),["prevent"]))},"Introduction",2),(a(!0),l(V,null,Q(e.readmeToc(),(u,p)=>(a(),l("a",{key:u.id,href:"#"+u.id,class:R(["lvl-"+u.level,{"is-active":e.activeHeading===u.id}]),onClick:de(c=>e.scrollToHeading(u.id),["prevent"])},d(u.text),11,uW))),128))])])):f("v-if",!0)])):f("v-if",!0)],2)):f("v-if",!0),e.type=="html-doc"&&!e.showSource&&e.content!=null?(a(),Wt(s,{key:2,content:e.content,"base-url":e.fileBaseUrl,"allow-scripts":e.allowScripts},null,8,["content","base-url","allow-scripts"])):f("v-if",!0),e.fileFrame()?(a(),l("section",{key:3,class:R(["file-card file-card-media","view-"+e.type])},[n("header",cW,[n("div",pW,[n("button",{type:"button",class:R(["btn btn-sm btn-icon-only btn-ghost card-files-btn",{"is-needed":e.sidebarHidden}]),title:"Show file tree",onClick:t[35]||(t[35]=u=>e.sidebarHidden?e.sidebarHidden=!1:e.sidebarCollapsed=!1)},[...t[87]||(t[87]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-sidebar"})],-1),n("span",{class:"card-files-label"},"Files",-1)])],2),n("ol",fW,[n("li",mW,[n("a",{href:e.safeUrl("/r/"+e.repoId+"/"),title:e.repoId,textContent:d(/^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(e.repoId||"")?"repository":e.repoId)},null,8,hW)]),(a(!0),l(V,null,Q(e.paths,(u,p)=>(a(),l("li",{class:"breadcrumb-item","aria-current":p===e.paths.length-1?"page":null},[(a(!0),l(V,null,Q(e.redactParts(u),(c,v)=>(a(),l(V,{key:v},[c.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+c.n},[n("i",null,d(c.n),1)],8,vW)):(a(),l(V,{key:1},[h(d(c.t),1)],64))],64))),128))],8,gW))),256))]),n("span",yW,[e.type=="IPython Line truncated
`).length+1)),placeholder:`Jane Smith
MIT CSAIL
jane.smith@example.org`},null,8,WK),[[i,{state:e.viewState,set:r=>{e.terms=r},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),n("details",KK,[t[25]||(t[25]=n("summary",null,"Regex & replacement syntax",-1)),n("p",null,[t[21]||(t[21]=g("Matches become ",-1)),n("code",null,u(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[22]||(t[22]=g(". Use ",-1)),t[23]||(t[23]=n("code",null,"term=>replacement",-1)),t[24]||(t[24]=g(" for a custom replacement. Regex is supported.",-1))])]),P(n("div",YK,"Terms are in an invalid format.",512),[[Z,e.defaultsForm?.terms?.errors?.format]])])]),n("section",JK,[t[35]||(t[35]=n("h2",null,"Reviewer display",-1)),n("div",null,[n("div",XK,[n("label",QK,[P(n("input",ZK,null,512),[[i,{state:e.viewState,set:r=>{e.options.link=r},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[27]||(t[27]=g("Keep links",-1))]),n("label",xK,[P(n("input",eY,null,512),[[i,{state:e.viewState,set:r=>{e.options.image=r},value:e.options?.image,form:"defaultsForm",options:{}}]]),t[28]||(t[28]=g("Display images",-1))]),n("label",tY,[P(n("input",nY,null,512),[[i,{state:e.viewState,set:r=>{e.options.pdf=r},value:e.options?.pdf,form:"defaultsForm",options:{}}]]),t[29]||(t[29]=g("Display PDFs",-1))]),n("label",oY,[P(n("input",sY,null,512),[[i,{state:e.viewState,set:r=>{e.options.notebook=r},value:e.options?.notebook,form:"defaultsForm",options:{}}]]),t[30]||(t[30]=g("Display notebooks",-1))]),n("label",iY,[P(n("input",rY,null,512),[[i,{state:e.viewState,set:r=>{e.options.loc=r},value:e.options?.loc,form:"defaultsForm",options:{}}]]),t[31]||(t[31]=g("Show line counts",-1))]),n("label",aY,[P(n("input",lY,null,512),[[i,{state:e.viewState,set:r=>{e.options.page=r},value:e.options?.page,form:"defaultsForm",options:{}}]]),t[32]||(t[32]=g("GitHub Pages",-1))])]),t[33]||(t[33]=n("p",{class:"settings-help"},"Images and PDFs are not anonymized.",-1)),t[34]||(t[34]=n("p",{class:"settings-help"},"GitHub Pages must use the anonymized branch.",-1))])]),n("section",dY,[t[38]||(t[38]=n("h2",null,"Source updates",-1)),n("div",null,[n("label",uY,[P(n("input",cY,null,512),[[i,{state:e.viewState,set:r=>{e.options.update=r},value:e.options?.update,form:"defaultsForm",options:{}}]]),t[36]||(t[36]=g("Auto-update from GitHub",-1))]),t[37]||(t[37]=n("p",{class:"settings-help"},"Latest commit, at most once an hour.",-1))])]),n("section",pY,[t[40]||(t[40]=n("label",{class:"settings-label",for:"expiration"},"On expiration",-1)),n("div",null,[P((a(),l("select",fY,[...t[39]||(t[39]=[n("option",{value:"redirect"},"Redirect visitors to the GitHub repository",-1),n("option",{value:"remove",selected:""},"Remove the anonymized repository",-1)])])),[[i,{state:e.viewState,set:r=>{e.options.expirationMode=r},value:e.options?.expirationMode,form:"defaultsForm",options:{}}]]),n("p",mY,u(e.options.expirationMode==="redirect"?"Redirecting reveals the original repository. Choose the date per anonymization.":"Set the expiration date for each repository."),1)])]),n("footer",hY,[n("div",gY,[e.draftRestored?(a(),l("span",vY,"Your unsaved draft was restored.")):e.unsavedChanges?(a(),l("span",yY,"Unsaved changes"+u(e.draftSaved?" \xB7 Draft saved in this tab":""),1)):(a(),l("span",bY,u(e.message?"Defaults saved":"No unsaved changes"),1))]),e.draftRestored||e.unsavedChanges?(a(),l("button",{key:0,type:"button",class:"draft-discard",onClick:t[0]||(t[0]=r=>e.discardDraft())},"Discard changes")):f("v-if",!0),n("button",{id:"save",type:"submit",class:R(["btn btn-ink",{"is-saving":e.saving}]),disabled:e.saving||!(e.unsavedChanges||e.draftRestored)},u(e.saving?"Saving\u2026":"Save defaults"),11,wY),e.error?(a(),l("div",kY,u(e.error),1)):f("v-if",!0)])],32)),[[o,e.viewState]])],512),[[Z,e.settingsTab==="defaults"]]),P(n("section",{id:"settings-billing","aria-busy":e.billingLoading||e.billingBusy},[t[95]||(t[95]=n("p",{class:"settings-scope"},"Your plan and usage. Reviewer access is always free.",-1)),e.billingLoading?(a(),l("p",EY,"Loading billing\u2026")):f("v-if",!0),e.billingError?(a(),l("div",SY,[g(u(e.billingError)+" ",1),n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[3]||(t[3]=r=>e.loadBilling()),disabled:e.billingBusy},"Try again",8,NY)])):f("v-if",!0),e.billingNotice?(a(),l("p",RY,u(e.billingNotice),1)):f("v-if",!0),e.billingPending?(a(),l("div",TY,[t[42]||(t[42]=n("strong",null,"Confirming your payment",-1)),t[43]||(t[43]=n("p",null,"Your allowance will update after confirmation. Please do not pay again.",-1)),n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[4]||(t[4]=r=>e.refreshBilling()),disabled:e.billingBusy},"Check payment status",8,PY)])):f("v-if",!0),n("section",DY,[n("div",AY,[n("div",null,[t[44]||(t[44]=n("p",{class:"billing-eyebrow"},"Current plan",-1)),n("h2",IY,u(e.profileAuthorGrant()?e.profileGrantName(e.profileAuthorGrant()):e.billing?.enabled?"Free":"Account allowance"),1),e.profileAuthorGrant()?(a(),l("p",OY,[g(u(e.profileAuthorGrant().cancelAtPeriodEnd?"Renewal cancelled \xB7 access u Line truncated
jane.smith@example.org`},null,8,PY),[[i,{state:e.viewState,set:r=>{e.terms=r},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),n("details",DY,[t[25]||(t[25]=n("summary",null,"Regex & replacement syntax",-1)),n("p",null,[t[21]||(t[21]=h("Matches become ",-1)),n("code",null,d(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[22]||(t[22]=h(". Use ",-1)),t[23]||(t[23]=n("code",null,"term=>replacement",-1)),t[24]||(t[24]=h(" for a custom replacement. Regex is supported.",-1))])]),P(n("div",AY,"Terms are in an invalid format.",512),[[Z,e.defaultsForm?.terms?.errors?.format]])])]),n("section",IY,[t[35]||(t[35]=n("h2",null,"Reviewer display",-1)),n("div",null,[n("div",OY,[n("label",MY,[P(n("input",VY,null,512),[[i,{state:e.viewState,set:r=>{e.options.link=r},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[27]||(t[27]=h("Keep links",-1))]),n("label",qY,[P(n("input",LY,null,512),[[i,{state:e.viewState,set:r=>{e.options.image=r},value:e.options?.image,form:"defaultsForm",options:{}}]]),t[28]||(t[28]=h("Display images",-1))]),n("label",$Y,[P(n("input",_Y,null,512),[[i,{state:e.viewState,set:r=>{e.options.pdf=r},value:e.options?.pdf,form:"defaultsForm",options:{}}]]),t[29]||(t[29]=h("Display PDFs",-1))]),n("label",FY,[P(n("input",UY,null,512),[[i,{state:e.viewState,set:r=>{e.options.notebook=r},value:e.options?.notebook,form:"defaultsForm",options:{}}]]),t[30]||(t[30]=h("Display notebooks",-1))]),n("label",BY,[P(n("input",zY,null,512),[[i,{state:e.viewState,set:r=>{e.options.loc=r},value:e.options?.loc,form:"defaultsForm",options:{}}]]),t[31]||(t[31]=h("Show line counts",-1))]),n("label",HY,[P(n("input",jY,null,512),[[i,{state:e.viewState,set:r=>{e.options.page=r},value:e.options?.page,form:"defaultsForm",options:{}}]]),t[32]||(t[32]=h("GitHub Pages",-1))])]),t[33]||(t[33]=n("p",{class:"settings-help"},"Images and PDFs are not anonymized.",-1)),t[34]||(t[34]=n("p",{class:"settings-help"},"GitHub Pages must use the anonymized branch.",-1))])]),n("section",GY,[t[38]||(t[38]=n("h2",null,"Source updates",-1)),n("div",null,[n("label",WY,[P(n("input",KY,null,512),[[i,{state:e.viewState,set:r=>{e.options.update=r},value:e.options?.update,form:"defaultsForm",options:{}}]]),t[36]||(t[36]=h("Auto-update from GitHub",-1))]),t[37]||(t[37]=n("p",{class:"settings-help"},"Latest commit, at most once an hour.",-1))])]),n("section",YY,[t[40]||(t[40]=n("label",{class:"settings-label",for:"expiration"},"On expiration",-1)),n("div",null,[P((a(),l("select",JY,[...t[39]||(t[39]=[n("option",{value:"redirect"},"Redirect visitors to the GitHub repository",-1),n("option",{value:"remove",selected:""},"Remove the anonymized repository",-1)])])),[[i,{state:e.viewState,set:r=>{e.options.expirationMode=r},value:e.options?.expirationMode,form:"defaultsForm",options:{}}]]),n("p",XY,d(e.options.expirationMode==="redirect"?"Redirecting reveals the original repository. Choose the date per anonymization.":"Set the expiration date for each repository."),1)])]),n("footer",QY,[n("div",ZY,[e.draftRestored?(a(),l("span",xY,"Your unsaved draft was restored.")):e.unsavedChanges?(a(),l("span",eJ,"Unsaved changes"+d(e.draftSaved?" \xB7 Draft saved in this tab":""),1)):(a(),l("span",tJ,d(e.message?"Defaults saved":"No unsaved changes"),1))]),e.draftRestored||e.unsavedChanges?(a(),l("button",{key:0,type:"button",class:"draft-discard",onClick:t[0]||(t[0]=r=>e.discardDraft())},"Discard changes")):f("v-if",!0),n("button",{id:"save",type:"submit",class:R(["btn btn-ink",{"is-saving":e.saving}]),disabled:e.saving||!(e.unsavedChanges||e.draftRestored)},d(e.saving?"Saving\u2026":"Save defaults"),11,nJ),e.error?(a(),l("div",oJ,d(e.error),1)):f("v-if",!0)])],32)),[[o,e.viewState]])],512),[[Z,e.settingsTab==="defaults"]]),P(n("section",{id:"settings-billing","aria-busy":e.billingLoading||e.billingBusy},[t[95]||(t[95]=n("p",{class:"settings-scope"},"Your plan and usage. Reviewer access is always free.",-1)),e.billingLoading?(a(),l("p",iJ,"Loading billing\u2026")):f("v-if",!0),e.billingError?(a(),l("div",rJ,[h(d(e.billingError)+" ",1),n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[3]||(t[3]=r=>e.loadBilling()),disabled:e.billingBusy},"Try again",8,aJ)])):f("v-if",!0),e.billingNotice?(a(),l("p",lJ,d(e.billingNotice),1)):f("v-if",!0),e.billingPending?(a(),l("div",dJ,[t[42]||(t[42]=n("strong",null,"Confirming your payment",-1)),t[43]||(t[43]=n("p",null,"Your allowance will update after confirmation. Please do not pay again.",-1)),n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[4]||(t[4]=r=>e.refreshBilling()),disabled:e.billingBusy},"Check payment status",8,uJ)])):f("v-if",!0),n("section",cJ,[n("div",pJ,[n("div",null,[t[44]||(t[44]=n("p",{class:"billing-eyebrow"},"Current plan",-1)),n("h2",fJ,d(e.profileAuthorGrant()?e.profileGrantName(e.profileAuthorGrant()):e.billing?.enabled?"Free":"Account allowance"),1),e.profileAuthorGrant()?(a(),l("p",mJ,[h(d(e.profileAuthorGrant().cancelAtPeriodEnd?"Renewal cancelled \xB7 access u Line truncated
`);t.innerHTML=s.map(i=>{let o=i.replace(/^(<[^>]+>)+/,"").charAt(0),r=i.startsWith("@@")?"hunk":o==="+"?"add":o==="-"?"remove":"";return`<span class="md-diff-line${r?" is-"+r:""}">${i||" "}</span>`}).join(`
`)}),Bp=(e,t=0)=>{let s=(String(e).slice(t).match(/^[ \t]*/)[0]||"").replace(/\t/g," ").length;return Math.min(t+s+4,24)},jp=e=>{e?.closest?.(".reviewer-preview")&&e.querySelectorAll("pre code").forEach(t=>{let s=t.querySelectorAll(".md-diff-line");if(s.length){s.forEach(o=>{o.classList.contains("is-hunk")||o.style.setProperty("--hang",Bp(o.textContent,1)+"ch")});return}if(t.querySelector(".code-line"))return;let i=[];t.innerHTML=t.innerHTML.replace(/\n$/,"").split(`
`).map(o=>{let r=i.join("");o.replace(/<\/?span\b[^>]*>/g,p=>(p.startsWith("</")?i.pop():i.push(p),p));let d=o.replace(/<[^>]+>/g,"");return`<span class="code-line" style="--hang:${Bp(d)}ch">${r}${o||" "}${"</span>".repeat(i.length)}</span>`}).join(`
`)})},Gp={props:["content","terms","options"],setup(e){let t=Et(null),s=()=>{t.value.innerHTML=renderMD(e.content||"",window.location.pathname+"/../"),Hp(t.value),jp(t.value)};return gn(()=>{s(),ct(()=>[e.content,e.terms,e.options],s,{deep:!0})}),()=>De("markdown",{ref:t})}},dee={props:["file","terms","options"],setup(e){let t=Et(null),s=()=>We(()=>{t.value?.querySelectorAll("pre code").forEach(i=>window.Prism?.highlightElement(i)),Hp(t.value),jp(t.value)});return gn(s),ct(()=>[e.file?.content,e.terms,e.options],s,{deep:!0}),()=>{let i=e.file||{},o=(i.filename||"").split(".").pop().toLowerCase();if(["md","markdown"].includes(o)||i.language==="Markdown")return De("gist-file",{ref:t},De(Gp,{content:i.content,terms:e.terms,options:e.options}));let r={js:"javascript",jsx:"javascript",ts:"javascript",typescript:"javascript",py:"python",html:"markup",xml:"markup",svg:"markup",sh:"bash"},d=(i.language||o||"none").toLowerCase();return De("gist-file",{ref:t},De("pre",{class:"line-numbers"},De("code",{class:"language-"+(r[d]||d),key:i.content},i.content||"")))}}},uee=e=>e?.querySelectorAll(".nb-input pre").forEach(t=>{if(t.parentElement?.classList.contains("nb-code-scroll"))return;let s=document.createElement("div");s.className="nb-code-scroll",t.replaceWith(s),s.appendChild(t);let i=()=>{let o=t.scrollWidth-t.clientWidth>1;if(s.classList.toggle("is-overflowing",o),s.classList.toggle("is-at-end",o&&t.scrollLeft+t.clientWidth>=t.scrollWidth-2),!o)return;let r=t.clientWidth-16,d=Math.max(24,r*t.clientWidth/t.scrollWidth);s.style.setProperty("--thumb-w",d+"px"),s.style.setProperty("--thumb-x",(r-d)*t.scrollLeft/(t.scrollWidth-t.clientWidth)+"px")};t.addEventListener("scroll",i,{passive:!0}),window.ResizeObserver?new ResizeObserver(i).observe(t):i(),i()}),cee={props:["file","content"],setup(e){let t=Et(null),s=0,i,o=async()=>{let r=++s;i?.abort(),i=new AbortController;try{let d=e.content?JSON.parse(e.content):await fetch(e.file?.download_url||e.file,{signal:i.signal}).then(p=>{if(!p.ok)throw Error("Notebook request failed");return p.json()});if(await Xn("notebook"),r!==s)return;t.value.innerHTML=$s(DOMPurify.sanitize(nb.parse(d).render())),t.value.querySelectorAll("pre code").forEach(p=>window.Prism?.highlightElement(p)),uee(t.value)}catch(d){r===s&&d.name!=="AbortError"&&(t.value.textContent="Unable to render the notebook.")}};return gn(()=>{o(),ct(()=>[e.file,e.content],o)}),io(()=>{s++,i?.abort()}),()=>De("notebook",{ref:t})}},pee={props:["stats"],setup(e){return()=>{let t=Object.entries(e.stats||{}).filter(([,i])=>i.code),s=t.reduce((i,[,o])=>i+o.code,0);return De("loc",t.map(([i,o])=>De("div",{class:"lang",title:`${i}: ${o.code.toLocaleString()} lines`,style:{width:o.code*100/s+"%",background:langColors[i]}})))}}},Wp={Markdown:Gp,GistFile:dee,Notebook:cee,Loc:pee,HtmlDoc:_p,QuotaUsage:aee,Pdfviewer:ud(async()=>(await Xn("pdf"),pdfjsLib.GlobalWorkerOptions.workerSrc="/script/external/pdf.worker.js",Fp))},Kp={async mounted(e,{value:t}){e._editorValue=t;try{if(await ai(),e._editorDisposed)return;let s=e._editorValue,i=ace.edit(e);e._editor=i,i.setValue(String(s.content??""),-1),zp(e,s.options),e._editorCleanup=s.options?.onLoad?.(i)}catch(s){e._editorDisposed||(e.textContent=s.message)}},updated(e,{value:t}){e._editorValue=t,e._editor&&(e._editor.getValue()!==String(t.content??"")&&e._editor.setValue(String(t.content??""),-1),zp(e,t.options))},beforeUnmount(e){e._editorDisposed=!0,e._editorCleanup?.(),e._editor?.destroy()}};function zp(e,t={}){let s=lee.has(t.mode)?t.mode:"text";e._editor.session.setMode("ace/mode/"+s),t.theme&&e._editor.setTheme("ace/theme/"+t.theme),e._editor.setReadOnly(t.readOnly!==!1)}var Yp={mounted(e){if(!window.IntersectionObserver)return;let t=[...e.querySelectorAll('a[href^="#"]')],s=new Set,i=new IntersectionObserver(o=>{o.forEach(d=>d.isIntersecting?s.add(d.target.id):s.delete(d.target.id));let r=t.find(d=>s.has(d.hash.slice(1)));r&&t.forEach(d=>d.classList.toggle("active",d===r))},{rootMargin:"-20% 0px -60% 0px",threshold:0});We(()=>{t.forEach(o=>{let r=document.getElementById(o.hash.slice(1));r&&i.observe(r)}),t[0]&&!t.some(o=>o.classList.contains("active"))&&t[0].classList.add("active")}),e._observer=i},beforeUnmount(e){e._observer?.disconnect()}};function Jp(e){let t=[],s=0,i=/\bXXXX-(\d+)\b/g,o;for(;o=i.exec(e);)o.index>s&&t.push(e.slice(s,o.index)),t.push(De("span",{class:"redact-slot",role:"img","aria-label":"Redacted term "+o[1]},[De("i",null,o[1])])),s=o.index+o[0].length;return t.length?(s<e.length&&t.push(e.slice(s)),t):e}function fee(e){let t=Jp(e),s=[];for(let i of Array.isArray(t)?t:[t]){if(typeof i!="string"){s.push(i);continue}let o=i.split(/(?<=[._-])/);o.forEach((r,d)=>{s.push(r),d<o.length-1&&s.push(De("wbr"))})}return s}function mee(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB"],s=e/1024,i=0;for(;s>=1024&&i<t.length-1;)s/=1024,i++;return`${s.toFixed(1)} ${t[i]}`}function hee(e){let t={children:[]},s=new Map([["",t]]);function i(o){if(s.has(o))return s.get(o);let r=o Line truncated
`).map(o=>{let r=i.join("");o.replace(/<\/?span\b[^>]*>/g,p=>(p.startsWith("</")?i.pop():i.push(p),p));let u=o.replace(/<[^>]+>/g,"");return`<span class="code-line" style="--hang:${Bp(u)}ch">${r}${o||" "}${"</span>".repeat(i.length)}</span>`}).join(`
`)})},Gp={props:["content","terms","options"],setup(e){let t=St(null),s=()=>{t.value.innerHTML=renderMD(e.content||"",window.location.pathname+"/../"),Hp(t.value),jp(t.value)};return gn(()=>{s(),ct(()=>[e.content,e.terms,e.options],s,{deep:!0})}),()=>De("markdown",{ref:t})}},Gee={props:["file","terms","options"],setup(e){let t=St(null),s=()=>We(()=>{t.value?.querySelectorAll("pre code").forEach(i=>window.Prism?.highlightElement(i)),Hp(t.value),jp(t.value)});return gn(s),ct(()=>[e.file?.content,e.terms,e.options],s,{deep:!0}),()=>{let i=e.file||{},o=(i.filename||"").split(".").pop().toLowerCase();if(["md","markdown"].includes(o)||i.language==="Markdown")return De("gist-file",{ref:t},De(Gp,{content:i.content,terms:e.terms,options:e.options}));let r={js:"javascript",jsx:"javascript",ts:"javascript",typescript:"javascript",py:"python",html:"markup",xml:"markup",svg:"markup",sh:"bash"},u=(i.language||o||"none").toLowerCase();return De("gist-file",{ref:t},De("pre",{class:"line-numbers"},De("code",{class:"language-"+(r[u]||u),key:i.content},i.content||"")))}}},Wee=e=>e?.querySelectorAll(".nb-input pre").forEach(t=>{if(t.parentElement?.classList.contains("nb-code-scroll"))return;let s=document.createElement("div");s.className="nb-code-scroll",t.replaceWith(s),s.appendChild(t);let i=()=>{let o=t.scrollWidth-t.clientWidth>1;if(s.classList.toggle("is-overflowing",o),s.classList.toggle("is-at-end",o&&t.scrollLeft+t.clientWidth>=t.scrollWidth-2),!o)return;let r=t.clientWidth-16,u=Math.max(24,r*t.clientWidth/t.scrollWidth);s.style.setProperty("--thumb-w",u+"px"),s.style.setProperty("--thumb-x",(r-u)*t.scrollLeft/(t.scrollWidth-t.clientWidth)+"px")};t.addEventListener("scroll",i,{passive:!0}),window.ResizeObserver?new ResizeObserver(i).observe(t):i(),i()}),Kee={props:["file","content"],setup(e){let t=St(null),s=0,i,o=async()=>{let r=++s;i?.abort(),i=new AbortController;try{let u=e.content?JSON.parse(e.content):await fetch(e.file?.download_url||e.file,{signal:i.signal}).then(p=>{if(!p.ok)throw Error("Notebook request failed");return p.json()});if(await Xn("notebook"),r!==s)return;t.value.innerHTML=$s(DOMPurify.sanitize(nb.parse(u).render())),t.value.querySelectorAll("pre code").forEach(p=>window.Prism?.highlightElement(p)),Wee(t.value)}catch(u){r===s&&u.name!=="AbortError"&&(t.value.textContent="Unable to render the notebook.")}};return gn(()=>{o(),ct(()=>[e.file,e.content],o)}),io(()=>{s++,i?.abort()}),()=>De("notebook",{ref:t})}},Yee={props:["stats"],setup(e){return()=>{let t=Object.entries(e.stats||{}).filter(([,i])=>i.code),s=t.reduce((i,[,o])=>i+o.code,0);return De("loc",t.map(([i,o])=>De("div",{class:"lang",title:`${i}: ${o.code.toLocaleString()} lines`,style:{width:o.code*100/s+"%",background:langColors[i]}})))}}},Wp={Markdown:Gp,GistFile:Gee,Notebook:Kee,Loc:Yee,HtmlDoc:_p,QuotaUsage:Hee,Pdfviewer:ud(async()=>(await Xn("pdf"),pdfjsLib.GlobalWorkerOptions.workerSrc="/script/external/pdf.worker.js",Fp))},Kp={async mounted(e,{value:t}){e._editorValue=t;try{if(await ai(),e._editorDisposed)return;let s=e._editorValue,i=ace.edit(e);e._editor=i,i.setValue(String(s.content??""),-1),zp(e,s.options),e._editorCleanup=s.options?.onLoad?.(i)}catch(s){e._editorDisposed||(e.textContent=s.message)}},updated(e,{value:t}){e._editorValue=t,e._editor&&(e._editor.getValue()!==String(t.content??"")&&e._editor.setValue(String(t.content??""),-1),zp(e,t.options))},beforeUnmount(e){e._editorDisposed=!0,e._editorCleanup?.(),e._editor?.destroy()}};function zp(e,t={}){let s=jee.has(t.mode)?t.mode:"text";e._editor.session.setMode("ace/mode/"+s),t.theme&&e._editor.setTheme("ace/theme/"+t.theme),e._editor.setReadOnly(t.readOnly!==!1)}var Yp={mounted(e){if(!window.IntersectionObserver)return;let t=[...e.querySelectorAll('a[href^="#"]')],s=new Set,i=new IntersectionObserver(o=>{o.forEach(u=>u.isIntersecting?s.add(u.target.id):s.delete(u.target.id));let r=t.find(u=>s.has(u.hash.slice(1)));r&&t.forEach(u=>u.classList.toggle("active",u===r))},{rootMargin:"-20% 0px -60% 0px",threshold:0});We(()=>{t.forEach(o=>{let r=document.getElementById(o.hash.slice(1));r&&i.observe(r)}),t[0]&&!t.some(o=>o.classList.contains("active"))&&t[0].classList.add("active")}),e._observer=i},beforeUnmount(e){e._observer?.disconnect()}};function Jp(e){let t=[],s=0,i=/\bXXXX-(\d+)\b/g,o;for(;o=i.exec(e);)o.index>s&&t.push(e.slice(s,o.index)),t.push(De("span",{class:"redact-slot",role:"img","aria-label":"Redacted term "+o[1]},[De("i",null,o[1])])),s=o.index+o[0].length;return t.length?(s<e.length&&t.push(e.slice(s)),t):e}function Jee(e){let t=Jp(e),s=[];for(let i of Array.isArray(t)?t:[t]){if(typeof i!="string"){s.push(i);continue}let o=i.split(/(?<=[._-])/);o.forEach((r,u)=>{s.push(r),u<o.length-1&&s.push(De("wbr"))})}return s}function Xee(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB"],s=e/1024,i=0;for(;s>=1024&&i<t.length-1;)s/=1024,i++;return`${s.toFixed(1)} ${t[i]}`}function Qee(e){let t={children:[]},s=new Map([["",t]]);function i(o){if(s.has(o))return s.get(o);let r=o Line truncated
/*! Bundled license information:
@vue/shared/dist/shared.esm-bundler.js:
+47
View File
@@ -0,0 +1,47 @@
// Generate finite diagnostic allowlists from repository code, never runtime input.
const fs = require('fs'), path = require('path'), ts = require('typescript');
const files = {};
function scan(dir) {
for (const entry of fs.readdirSync(dir, {withFileTypes:true})) {
const file = path.join(dir,entry.name);
if(entry.isDirectory()) scan(file);
else if(file.endsWith('.ts') && !file.endsWith('.d.ts') && !file.endsWith('log-diagnostic-schema.ts')) {
const source=ts.createSourceFile(file,fs.readFileSync(file,'utf8'),ts.ScriptTarget.Latest,true);
const names=new Set(['<anonymous>']);
function visit(node) {
if ((ts.isFunctionDeclaration(node)||ts.isMethodDeclaration(node)||ts.isFunctionExpression(node)) && node.name && ts.isIdentifier(node.name)) names.add(node.name.text);
if(ts.isVariableDeclaration(node)&&ts.isIdentifier(node.name)&&node.initializer&&(ts.isArrowFunction(node.initializer)||ts.isFunctionExpression(node.initializer))) names.add(node.name.text);
ts.forEachChild(node,visit);
}
visit(source);
files[file]=[...names].sort();
files[file.replace(/^src\//,'build/').replace(/\.ts$/,'.js')]=files[file];
}
}
}
scan('src');
const types=['Error','TypeError','RangeError','ReferenceError','SyntaxError','URIError','EvalError','AggregateError','AnonymousError','HTTPError','RequestError','MongoServerError','MongoNetworkError','MongoServerSelectionError','ValidationError','TimeoutError','AbortError','UnknownError'];
const vrl=fs.readFileSync('deploy/logging/sanitize.vrl','utf8');
const routes=JSON.parse(vrl.match(/if includes\((\[.*?\]), record.route\)/)[1]);
fs.writeFileSync('src/core/log-diagnostic-schema.ts','// Generated by scripts/generate-log-diagnostics.js; do not edit.\nexport const LOG_SOURCE_FUNCTIONS: Record<string, readonly string[]> = '+JSON.stringify(files,null,2)+';\nexport const LOG_ERROR_TYPES = '+JSON.stringify(types)+';\nexport const LOG_ROUTES = '+JSON.stringify(routes)+';\n');
const block=`# BEGIN GENERATED DIAGNOSTICS
source_functions = ${JSON.stringify(files)}
for_each(["errorType", "causeType"]) -> |_index, key| {
value = get(record, [key]) ?? null
if includes(${JSON.stringify(types)}, value) { out = set!(out, [key], value) }
}
for_each(["errorStack", "causeStack"]) -> |_index, key| {
value = get(record, [key]) ?? null
if is_string(value) && length(string!(value)) <= 1024 {
frames = []
for_each(split(string!(value), "\\n", limit: 9)) -> |index, frame| {
parts, err = parse_regex(frame, r'^at (?P<function>[A-Za-z_$][A-Za-z0-9_$]*|<anonymous>) \\((?P<file>(?:src|build)/[A-Za-z0-9_./-]+\\.(?:ts|js)):(?P<line>[1-9][0-9]{0,5}):(?P<column>[1-9][0-9]{0,4})\\)$')
allowed = array(get(source_functions, [to_string(parts.file)]) ?? null) ?? []
if index < 8 && err == null && includes(array!(allowed), parts.function) { frames = push(frames, frame) }
}
if length(frames) > 0 { out = set!(out, [key], join!(frames, "\\n")) }
}
}
# END GENERATED DIAGNOSTICS`;
const clean=vrl.replace(/# BEGIN GENERATED DIAGNOSTICS[\s\S]*?# END GENERATED DIAGNOSTICS\n?/,'');
fs.writeFileSync('deploy/logging/sanitize.vrl',clean.replace('out._msg = out.event',()=>block+'\nout._msg = out.event'));
+3 -1
View File
@@ -25,12 +25,14 @@ app.use('/api', async (req, res) => {
{service:'streamer',module:'download',event:'request_aborted',severity:'warn',requestId:id},
{service:'api',module:'route',event:'request_failed',errorCode:'repository_unavailable',severity:'error',status:503,requestId:id},
];
if (scenario === 'diagnostics') samples = [{service:'api',module:'route',event:'application_log',severity:'error',httpStatus:500,requestId:id,method:'GET',route:'/api/repo/:repoId/file/:path',repoId:'demo-123',requestPath:'/api/repo/demo-123/file/docs/reproduce%20issue.md',errorType:'TypeError',errorStack:'at printError (build/server/routes/route-utils.js:200:7)\nat <anonymous> (build/server/routes/repository-public.js:312:11)',causeType:'RangeError',causeStack:'at <anonymous> (build/core/repository.js:410:9)'},{service:'api',module:'requests',event:'request_completed',severity:'info',status:500,requestId:id,method:'GET',route:'/api/repo/:repoId/file/:path',ms:283}];
if (scenario === 'occurrences') samples = Array.from({length:50}, (_,i) => ({service:'api',module:'route',event:'application_log',severity:'error',httpStatus:500,requestId:id,...(i%2?{method:'GET',route:'/api/repo/:repoId/file/:path'}:{})}));
if (scenario === 'many') samples = Array.from({length:50}, (_,i) => ({...samples[i%4],errorCode:'synthetic_event_'+(i+1)}));
if (req.path === '/admin/errors/investigation') return res.json({state:scenario === 'unreachable' ? 'unreachable' : scenario === 'disabled' ? 'disabled' : scenario === 'empty' ? 'empty':'ready',window:req.query.window||'1h',start,end:scenario==='stale'?start:now,captured:['disabled','unreachable','empty'].includes(scenario)?0:samples.reduce((sum,_,i)=>sum+[18,9,5,2][i%4],0),groups:['disabled','unreachable','empty'].includes(scenario)?[]:samples.map((sample,i)=>({fingerprint:String(i),sample:{...sample,release:'abcdef1234567'},count:[18,9,5,2][i%4],first:start,last:now})),telemetry:{missing:[],instances:[{service:'api',instance:'synthetic-api',last:now,dropped:0}],collector:{state:'reachable',dropped:0}}});
if (req.path === '/admin/errors/correlation') return res.json({state:'ready',start,end:now,events:samples.map(sample=>({...sample,timestamp:now}))});
if (req.path === '/admin/errors/stats') return res.json({available:true,last24h:34,prev24h:20,severity:{error:29,warn:5,info:0},unique:{error:3,warn:1,info:0},buckets:[],dropped:0});
if (req.path === '/admin/errors' && req.method === 'DELETE') historyCleared = true;
if (req.path === '/admin/errors') return res.json({available:true,redisCollecting:true,total:historyCleared?0:samples.length,max:1000,entries:historyCleared?[]:samples.map((sample,i)=>({ts:now,level:sample.severity,module:sample.module,message:sample.errorCode||sample.event,count:i+1,raw:[sample]}))});
if (req.path === '/admin/errors') return res.json({available:true,redisCollecting:true,total:historyCleared?0:samples.length,max:1000,entries:historyCleared?[]:samples.map((sample,i)=>({ts:scenario==='occurrences'?new Date(Date.now()-i*11000).toISOString():now,level:sample.severity,module:sample.module,message:sample.errorCode||sample.errorType||sample.event,count:i+1,raw:[sample]}))});
return res.json([]);
});
app.use((req,res,next)=>{ req.url=req.url.replace(/\.[a-f0-9]{10}\.min\./,'.min.'); next(); });
+30
View File
@@ -61,6 +61,36 @@ const sleep = ms => new Promise(resolve=>setTimeout(resolve,ms));
assert.equal(trace.events.length,1); assert.equal(trace.events[0].status,[200,429,502,504][i]);
}
console.log('PASS actual collector output: missing/unknown release compatibility, edge-only 502/504, excluded 200/429 with retained timelines');
const {logRecord}=require('../src/core/log-record');
const {serializeError}=require('../src/core/logger');
const {safeRedisLog}=require('../src/server/admin-log-investigation');
const {logContext}=require('../src/core/log-context');
const {requestRoute}=require('../src/core/request-monitoring');
const diagnosticId=randomUUID(), secret='SECRET_private_owner_token';
let error;
try { requestRoute(null,'api'); } catch (failure) { error=failure; } // real synthetic TypeError in application code
assert(error instanceof TypeError);
error.message='https://user:'+secret+'@example.test/private?token='+secret;
error.stack+='\n at async '+require('node:path').resolve('src/server/routes/repository-public.ts')+':224:23';
error.cause=new RangeError(secret);error.cause.stack='RangeError: '+secret+'\n at '+require('node:path').resolve('src/core/model/owner-alert-lifecycle.schema.ts')+':12:3';
const diagnostic=logContext.run({requestId:diagnosticId,requestPath:'/api/repo/demo-123/file/docs/reproduce%20issue.md',route:'/api/repo/:repoId/file/:path',method:'GET'},()=>logRecord('error','route',['', {...serializeError(error),httpStatus:500}]));
const rawSource={file:'/host/docker/fixture/log.json',message:JSON.stringify({attrs:{tag:'api'},log:JSON.stringify({...diagnostic,url:secret,stack:secret,errorStack:diagnostic.errorStack+'\n at '+secret+' (/private/'+secret+':1:2)'})})};
const projected=execFileSync('docker',['run','--rm','-i','--network','none','--memory','256m',vectorImage,'vrl','-i','/dev/stdin',fs.readFileSync('deploy/logging/sanitize.vrl','utf8')+'\nencode_json(.)'],{encoding:'utf8',input:JSON.stringify(rawSource)+'\n'}).trim().split('\n').map(line=>JSON.parse(JSON.parse(line)))[0];
assert.equal(projected.requestPath,diagnostic.requestPath);assert.equal(projected.repoId,'demo-123');assert.equal(projected.errorType,'TypeError');assert.equal(projected.causeType,'RangeError');
assert.equal(projected.causeStack,'at <anonymous> (src/core/model/owner-alert-lifecycle.schema.ts:12:3)');
assert(projected.errorStack.includes('at <anonymous> (src/server/routes/repository-public.ts:224:23)'));
assert.match(projected.errorStack,/at requestRoute \(src\/core\/request-monitoring.ts:\d+:\d+\)/);
assert(!JSON.stringify(projected).includes(secret));
const invalidPaths=['/api/repo/demo-123/file/a?token='+secret,'/api/repo/demo-123/file/%0a'+secret,'/api/repo/demo-123/file/../'+secret,'/api/repo/demo-123/file/%252e%252e/'+secret,'https://user:'+secret+'@example.test/file'];
const invalidSources=invalidPaths.map(requestPath=>({...rawSource,message:JSON.stringify({attrs:{tag:'api'},log:JSON.stringify({...diagnostic,requestPath,errorStack:'at <anonymous> (src/core/model/private.schema.ts:1:2)'})})}));
const rejected=execFileSync('docker',['run','--rm','-i','--network','none','--memory','256m',vectorImage,'vrl','-i','/dev/stdin',fs.readFileSync('deploy/logging/sanitize.vrl','utf8')+'\nencode_json(.)'],{encoding:'utf8',input:invalidSources.map(JSON.stringify).join('\n')+'\n'}).trim().split('\n').map(line=>JSON.parse(JSON.parse(line)));
assert(rejected.every(row=>!row.requestPath && !row.repoId && !row.errorStack));
assert(!JSON.stringify(rejected).includes(secret));
const ingested=await fetch(process.env.ADMIN_LOG_URL+'/insert/jsonline?_time_field=timestamp',{method:'POST',body:JSON.stringify(projected),headers:{'Content-Type':'application/stream+json'}});assert(ingested.ok);await sleep(2000);
const traced=await investigateLogs(logOptions({kind:'requestId',id:diagnosticId},true),true);
const redis=safeRedisLog({ts:diagnostic.timestamp,level:'error',module:'route',raw:[diagnostic]});
for(const row of [traced.events[0],redis.raw[0]]) {assert.equal(row.requestPath,diagnostic.requestPath);assert.equal(row.repoId,'demo-123');assert.equal(row.route,diagnostic.route);assert.equal(row.method,'GET');assert.equal(row.errorStack,projected.errorStack);assert.equal(row.causeType,'RangeError');assert(!JSON.stringify(row).includes(secret));}
console.log('PASS synthetic exception logger → pinned collector → VictoriaLogs/Redis safe API with normalized route and bounded frames');
docker('stop',name);
const unavailable=await investigateLogs(logOptions({})); assert.equal(unavailable.state,'unreachable');
delete process.env.ADMIN_LOG_URL;
+1 -1
View File
@@ -1,7 +1,7 @@
import { AsyncLocalStorage } from "async_hooks";
import { randomUUID } from "crypto";
export interface LogContext { requestId?: string; jobId?: string; attempt?: number; service?: string }
export interface LogContext { requestId?: string; jobId?: string; attempt?: number; service?: string; route?: string; method?: string; requestPath?: string }
export const logContext = new AsyncLocalStorage<LogContext>();
export const validTraceId = (value: unknown): value is string => typeof value === "string" &&
/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/.test(value);
File diff suppressed because it is too large. Load diff
+74
View File
@@ -0,0 +1,74 @@
import { resolve, relative, sep } from "path";
import { LOG_ERROR_TYPES, LOG_SOURCE_FUNCTIONS } from "./log-diagnostic-schema";
// Node 24 exposes Error.stack through a shared native accessor; never call user getters.
const nativeStackGetter = Object.getOwnPropertyDescriptor(new Error(), "stack")?.get;
const root = resolve(__dirname, "..");
function data(value: unknown, key: string, inherited = false): unknown {
try {
let object = value;
for (let depth = 0; object && typeof object === "object" && depth < (inherited ? 4 : 1); depth++) {
const descriptor = Object.getOwnPropertyDescriptor(object, key);
if (descriptor) {
if ("value" in descriptor) return descriptor.value;
if (key === "stack" && nativeStackGetter && descriptor.get === nativeStackGetter) return nativeStackGetter.call(object);
return undefined;
}
object = Object.getPrototypeOf(object);
}
} catch { /* Logging must not invoke hostile getters or fail with a Proxy. */ }
}
function frame(file: string, fn: string, line: string, column: string): string | null {
if (!LOG_SOURCE_FUNCTIONS[file]?.includes(fn) || !/^[1-9]\d{0,5}$/.test(line) || !/^[1-9]\d{0,4}$/.test(column)) return null;
return `at ${fn} (${file}:${line}:${column})`;
}
/** Validate already-projected diagnostics again at every storage/API boundary. */
export function safeDiagnosticFields(value: unknown): Record<string, string> {
const out: Record<string,string> = {};
for (const key of ["errorType", "causeType"]) {
const type = data(value,key);
if (typeof type === "string" && LOG_ERROR_TYPES.includes(type)) out[key] = type;
}
for (const key of ["errorStack", "causeStack"]) {
const stack = data(value,key);
if (typeof stack !== "string" || stack.length > 1024) continue;
const frames = stack.split("\n").slice(0,8).flatMap(line => {
const match = /^at ([A-Za-z_$][A-Za-z0-9_$]*|<anonymous>) \(((?:src|build)\/[A-Za-z0-9_./-]+\.(?:ts|js)):([1-9]\d{0,5}):([1-9]\d{0,4})\)$/.exec(line);
const safe = match && frame(match[2],match[1],match[3],match[4]);
return safe ? [safe] : [];
});
if (frames.length) out[key] = frames.join("\n");
}
return out;
}
/** Discard exception messages, absolute roots, external frames and unknown function names. */
export function errorDiagnostics(error: unknown): Record<string,string> {
if (!error || typeof error !== "object") return {};
const out: Record<string,string> = {};
const seen = new Set<unknown>();
let current: unknown = error;
for(let depth=0; current && typeof current === "object" && depth<3 && !seen.has(current); depth++) {
seen.add(current);
const name = data(current,"name",true);
const type = typeof name === "string" && LOG_ERROR_TYPES.includes(name) ? name : "UnknownError";
const stack = data(current,"stack");
const frames: string[] = [];
if(typeof stack === "string") for(const line of stack.slice(0,16384).split("\n").slice(1,33)) {
const match = /^\s*at (?:async )?(?:([^()]+) \()?([^()\s]+):(\d+):(\d+)\)?$/.exec(line);
if(!match) continue;
const local = relative(root,match[2]).split(sep).join("/");
if(local.startsWith("../") || local.includes(":")) continue;
const file = (root.endsWith(sep+"build") ? "build/" : "src/")+local;
const candidate = (match[1] || "").trim().split(".").at(-1) || "<anonymous>";
const fn = LOG_SOURCE_FUNCTIONS[file]?.includes(candidate) ? candidate : "<anonymous>";
const safe = frame(file,fn,match[3],match[4]);
if(safe && frames.join("\n").length + safe.length + 1 <= 1024) frames.push(safe);
if(frames.length===8) break;
}
if (depth) delete out.causeStack;
out[depth ? "causeType" : "errorType"] = type;
if(frames.length) out[depth ? "causeStack" : "errorStack"] = frames.join("\n");
current = data(current,"cause");
}
return out;
}
+17 -3
View File
@@ -1,3 +1,6 @@
import { requestReproduction, safeReproductionPath } from "./log-reproduction";
import { safeDiagnosticFields, errorDiagnostics } from "./log-diagnostics";
import { LOG_ROUTES } from "./log-diagnostic-schema";
import { LOG_MODULES, ERROR_CODES, LOG_EVENTS } from "./log-schema";
import { randomUUID } from "crypto";
import { logContext, validTraceId } from "./log-context";
@@ -28,7 +31,7 @@ export function logRecord(level: string, module: string, args: unknown[]) {
const context = logContext.getStore() || {};
const details: Record<string, unknown> = {};
const keys = [...numbers, "requestId", "jobId", "code", "message", "outcome", "method", "route", "queue",
"stages", "reason", "phase", "event", "deliveryId", "hostname", "service"];
"errorType", "errorStack", "causeType", "causeStack", "requestPath", "stages", "reason", "phase", "event", "deliveryId", "hostname", "service"];
// Do not traverse arbitrary objects or invoke error getters while logging.
for (const arg of args.slice(0, 8)) if (arg && typeof arg === "object") {
for (const key of keys) {
@@ -38,6 +41,9 @@ export function logRecord(level: string, module: string, args: unknown[]) {
} catch { /* A hostile Proxy must not make logging throw. */ }
}
}
for (const arg of args.slice(0,8)) {
try { if (arg instanceof Error) Object.assign(details, errorDiagnostics(arg)); } catch { /* hostile Proxy */ }
}
const first = typeof args[0] === "string" && args[0].length < 256 ? args[0] : "";
const event = (Object.hasOwn(events, first) ? events[first] : undefined) || (module.includes("webhook") ? "webhook_log" : "application_log");
const record: Record<string, unknown> = { timestamp: new Date().toISOString(), severity: level,
@@ -60,8 +66,16 @@ export function logRecord(level: string, module: string, args: unknown[]) {
else if (details.hostname) record.upstreamHost = "other";
if (allowed(["completed", "interrupted"], details.outcome)) record.outcome = details.outcome;
if (allowed(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "OTHER"], details.method)) record.method = details.method;
// Route labels are generated by request-monitoring, never from URLs in arbitrary errors.
if (module === "requests" && typeof details.route === "string") record.route = details.route;
// Only fixed route labels survive; never raw URLs or request parameters.
const route = context.route || details.route;
if (typeof route === "string" && LOG_ROUTES.includes(route)) record.route = route;
if (context.method && allowed(["GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS", "OTHER"], context.method)) record.method = context.method;
Object.assign(record, safeDiagnosticFields(details));
// Reproduction data is restricted to failures, not successful traffic/metrics.
if (["error", "fatal"].includes(level) || Number(details.status || details.httpStatus) >= 400) {
const requestPath = safeReproductionPath(context.requestPath || details.requestPath);
if (requestPath) Object.assign(record, requestReproduction(requestPath));
}
if (allowed(["download", "remove", "cache"], details.queue)) record.queue = details.queue;
if (details.stages && typeof details.stages === "object") for (const key of stages) {
let value: unknown;
+19
View File
@@ -0,0 +1,19 @@
// Explicit admin diagnostics: public anonymous repository ID and request pathname only.
// Never collect upstream owner/repository URLs, headers, query strings or bodies.
const fileRequest = /^\/api\/repo\/([A-Za-z0-9_-]{3,200})\/file\/([A-Za-z0-9._~!$&'()+,;=@%/-]+)$/;
export function safeReproductionPath(value: unknown): string | undefined {
if (typeof value !== "string" || value.length > 2048) return undefined;
const match = fileRequest.exec(value);
if (!match || /%(?![a-fA-F0-9]{2})/.test(value)) return undefined;
try {
const path = decodeURIComponent(match[2]);
// Reject controls, traversal, URL syntax, encoded delimiters and double encoding.
// eslint-disable-next-line no-control-regex -- reject control characters from stored paths
if (/[\x00-\x1f\x7f-\x9f\u2028-\u202e\u2066-\u2069\ufffd\\:?#%]/.test(path) || path.startsWith("/") || path.split("/").some(part => part === "." || part === "..")) return undefined;
} catch { return undefined; }
return value;
}
export function requestReproduction(url: string) {
const requestPath = safeReproductionPath(url.split("?", 1)[0]);
return requestPath ? { requestPath, repoId: fileRequest.exec(requestPath)![1] } : {};
}
+17 -1
View File
@@ -1,3 +1,4 @@
import { errorDiagnostics } from "./log-diagnostics";
import { logRecord } from "./log-record";
import { redactSecrets } from "./redact-secrets";
import { createClient, RedisClientType } from "redis";
@@ -148,6 +149,21 @@ function clampPayload(entry: {
s = JSON.stringify(entry);
if (s.length <= MAX_PAYLOAD_BYTES) return s;
}
// Keep reproduction/correlation when bounded paths plus diagnostic stacks exceed
// the mirror limit. Reduce frame depth and drop secondary measurements first.
if (first && typeof first === "object" && !Array.isArray(first)) {
const diagnostic = first as Record<string, unknown>;
const compact: Record<string, unknown> = {};
for (const key of ["timestamp", "severity", "service", "event", "module", "release", "requestId", "jobId", "method", "route", "requestPath", "repoId", "httpStatus", "status", "errorCode", "errorType", "causeType", "code", "message"]) {
if (diagnostic[key] !== undefined) compact[key] = diagnostic[key];
}
for (const key of ["errorStack", "causeStack"]) {
if (typeof diagnostic[key] === "string") compact[key] = diagnostic[key].split("\n")[0];
}
entry.raw = [compact];
s = JSON.stringify(entry);
if (s.length <= MAX_PAYLOAD_BYTES) return s;
}
// Step 3: nothing left to trim — replace with a placeholder so the entry
// still shows up in the list.
entry.raw = [{ truncated: true, originalBytes: s.length }];
@@ -307,7 +323,7 @@ export function serializeError(err: unknown, seen = new WeakSet<object>(), depth
if (seen.has(err) || depth >= 4) return { message: "error_details_truncated" };
seen.add(err);
const e = err as ErrorLike;
const out: Record<string, unknown> = {};
const out: Record<string, unknown> = errorDiagnostics(err);
if (e.name) out.name = e.name;
if (e.message) out.message = e.message;
+4 -2
View File
@@ -1,3 +1,4 @@
import { requestReproduction } from "./log-reproduction";
import { logContext } from "./log-context";
import { AsyncLocalStorage } from "async_hooks";
import { randomUUID } from "crypto";
@@ -116,6 +117,7 @@ export function monitorRequests(service: Service, metrics = requestMetrics,
: req.originalUrl.startsWith("/w/") ? "website" : "file";
const trace = { id, service, traffic, stages: {} };
const route = requestRoute(req.originalUrl, service);
const reproduction = service === "api" ? requestReproduction(req.originalUrl) : {};
const method = methods.has(req.method) ? req.method : "OTHER";
const started = performance.now();
let firstByteMs: number | undefined;
@@ -156,7 +158,7 @@ export function monitorRequests(service: Service, metrics = requestMetrics,
metrics.observe("request", route, method, ms, { bytes, aborted, error: res.statusCode >= 500, slow });
if (firstByteMs != null) metrics.observe("first_byte", route, method, firstByteMs);
const responseMs = firstByteMs == null ? null : Math.max(0, ms - firstByteMs);
const detail = { requestId: id, service, method, route, status: res.statusCode,
const detail = { ...(res.statusCode >= 400 ? reproduction : {}), requestId: id, service, method, route, status: res.statusCode,
outcome: aborted ? "interrupted" : "completed", ms: Math.round(ms), firstByteMs: firstByteMs == null ? null : Math.round(firstByteMs),
responseMs: responseMs == null ? null : Math.round(responseMs),
bytesPerSecond: responseMs != null && responseMs >= 1 && bytes > 0 ? Math.round(bytes * 1000 / responseMs) : null,
@@ -165,6 +167,6 @@ export function monitorRequests(service: Service, metrics = requestMetrics,
else if (!route.includes("healthcheck")) log.info("request", detail);
};
res.once("finish", done); res.once("close", done);
context.run(trace, () => logContext.run({ requestId: id, service }, next));
context.run(trace, () => logContext.run({ ...reproduction, requestId: id, service, route, method }, next));
};
}
+5 -5
View File
@@ -53,10 +53,10 @@ function safeRow(input: Record<string, unknown>): Row | null {
const numeric = ["status", "httpStatus", "ms", "firstByteMs", "responseMs", "attempt", "rss", "memoryRatio", "droppedLogs", "oldestWaitingMs", "waiting"];
const data: Record<string, unknown> = { ...input, code: input.errorCode };
for (const key of numeric) if (typeof input[key] === "string" && /^-?\d+(?:\.\d+)?$/.test(input[key] as string)) data[key] = Number(input[key]);
// Routes and arbitrary module text never pass through this projection.
const projected = logContext.run({}, () => logRecord(["error", "warn", "info", "debug"].includes(String(input.severity)) ? String(input.severity) : "info", String(input.module || "application"), ["", { ...data, route: undefined }]));
// Revalidate finite route and diagnostic allowlists; never pass raw strings.
const projected = logContext.run({}, () => logRecord(["error", "warn", "info", "debug"].includes(String(input.severity)) ? String(input.severity) : "info", String(input.module || "application"), ["", data]));
const result: Row = { timestamp: /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?Z$/.test(time) ? time : new Date(time).toISOString(), severity: String(projected.severity), service: services.includes(String(input.service)) ? String(input.service) : "unknown", event: events.has(String(input.event)) ? String(input.event) : "application_log", module: String(projected.module), release: /^(?:[a-f0-9]{7,40}|unknown)$/.test(String(input.release)) ? String(input.release) : "unknown" };
for (const key of [...numeric, "errorCode", "requestId", "jobId", "queue"]) if (typeof projected[key] === "string" || typeof projected[key] === "number") result[key] = projected[key] as string | number;
for (const key of [...numeric, "errorCode", "requestId", "jobId", "queue", "route", "method", "errorType", "errorStack", "causeType", "causeStack", "repoId", "requestPath"]) if (typeof projected[key] === "string" || typeof projected[key] === "number") result[key] = projected[key] as string | number;
if (validTraceId(input.instance)) result.instance = input.instance;
return result;
}
@@ -64,7 +64,7 @@ export function safeRedisLog(entry: Record<string, unknown>) {
const detail = Array.isArray(entry.raw) ? entry.raw.find(value => value && typeof value === "object" && !Array.isArray(value)) || {} : {};
const row = safeRow({ ...detail, _time: entry.ts, severity: entry.level, module: entry.module,
errorCode: detail.errorCode || detail.code || detail.message, event: detail.event || entry.message });
return row ? { ts: row.timestamp, level: row.severity, module: row.module, message: row.errorCode || row.event, raw: [row] } : null;
return row ? { ts: row.timestamp, level: row.severity, module: row.module, message: row.errorCode || row.errorType || row.event, raw: [row] } : null;
}
async function rows(base: string, query: string, limit: number, signal: AbortSignal) {
const text = await read(base + "/select/logsql/query", signal, new URLSearchParams({ query, limit: String(limit) }));
@@ -97,7 +97,7 @@ function timestampKey(value: string | number) {
function group(records: Row[]) {
const groups = new Map<string, { fingerprint: string; count: number; first: string; last: string; sample: Row }>();
for (const row of records) {
const key = JSON.stringify([row.service, row.module, row.event, row.errorCode || "", row.severity, row.status || row.httpStatus || ""]);
const key = JSON.stringify([row.service, row.module, row.event, row.errorCode || "", row.severity, row.status || row.httpStatus || "", row.errorType || "", String(row.errorStack || "").split("\n")[0]]);
const fingerprint = createHash("sha256").update(key).digest("hex").slice(0, 24);
const existing = groups.get(fingerprint);
if (existing) { existing.count++; existing.first = timestampKey(existing.first) < timestampKey(row.timestamp) ? existing.first : String(row.timestamp); existing.last = timestampKey(existing.last) > timestampKey(row.timestamp) ? existing.last : String(row.timestamp); }
+73
View File
@@ -0,0 +1,73 @@
const {expect}=require('chai');
const path=require('path');
const {Response}=globalThis;
require('ts-node/register/transpile-only');
const {errorDiagnostics,safeDiagnosticFields}=require('../src/core/log-diagnostics');
const {serializeError}=require('../src/core/logger');
const {logRecord}=require('../src/core/log-record');
const {logContext}=require('../src/core/log-context');
const {requestReproduction,safeReproductionPath}=require('../src/core/log-reproduction');
const {requestRoute}=require('../src/core/request-monitoring');
const {safeRedisLog,investigateLogs,logOptions}=require('../src/server/admin-log-investigation');
const secret='PRIVATE_TOKEN_owner_filename';
const frame='at printError (src/server/routes/route-utils.ts:200:7)';
function failure(){ const error=new TypeError('https://user:'+secret+'@github.com/private/repo?token='+secret); error.stack=error.message+'\n at printError ('+path.resolve('src/server/routes/route-utils.ts')+':200:7)\n at '+secret+' ('+path.resolve('src/server/routes/route-utils.ts')+':201:9)\n at secret (/home/private/'+secret+':1:2)\n at fn (https://private/'+secret+':1:2)';return error; }
describe('safe actionable exception diagnostics',()=>{
it('keeps bounded anonymous file request context for failures without queries or unsafe paths',()=>{
const requestPath='/api/repo/demo-123/file/docs/reproduce%20issue.md';
expect(requestReproduction(requestPath+'?token=SECRET')).deep.equal({requestPath,repoId:'demo-123'});
for(const value of ['/api/repo/owner/name/readme','https://example.test'+requestPath,requestPath+'?token=SECRET','/api/repo/demo-123/file/%0aSECRET','/api/repo/demo-123/file/../secret','/api/repo/demo-123/file/%252e%252e/secret','/api/repo/demo-123/file/https%3a%2f%2fuser:token@example.test','/api/repo/demo-123/file/'+ 'x'.repeat(2048)]) expect(safeReproductionPath(value),value).equal(undefined);
expect(logContext.run({requestPath},()=>logRecord('info','route',['request',{status:200}]))).not.have.property('requestPath');
const record=logContext.run({requestPath},()=>logRecord('error','route',['failure',{httpStatus:500}]));
expect(record).include({requestPath,repoId:'demo-123'});
expect(safeRedisLog({ts:record.timestamp,level:'error',module:'route',raw:[record]}).raw[0]).include({requestPath,repoId:'demo-123'});
});
it('preserves dotted allowlisted source files and anonymous/named async frames',()=>{
const error=new Error(secret);
error.stack='Error: '+secret+'\n at async '+path.resolve('src/server/routes/repository-public.ts')+':224:23\n at async printError ('+path.resolve('src/server/routes/route-utils.ts')+':200:7)\n at '+path.resolve('src/core/model/owner-alert-lifecycle.schema.ts')+':12:3\n at async https://'+secret+':1:2';
const record=logRecord('error','route',['',serializeError(error)]);
expect(record.errorStack).include('at <anonymous> (src/server/routes/repository-public.ts:224:23)').and.include(frame).and.include('at <anonymous> (src/core/model/owner-alert-lifecycle.schema.ts:12:3)');
const redis=safeRedisLog({ts:record.timestamp,level:'error',module:'route',raw:[record]});expect(redis.raw[0].errorStack).equal(record.errorStack);
expect(safeDiagnosticFields({errorStack:'at <anonymous> (src/core/model/not-allowlisted.schema.ts:12:3)'})).deep.equal({});
expect(JSON.stringify(record)).not.include(secret);
error.stack='Error: '+secret+'\n at external ('+path.resolve('node_modules/dependency/index.js')+':1:2)\n at async '+path.resolve('src/server/routes/repository-public.ts')+':224:23';
expect(errorDiagnostics(error).errorStack).equal('at <anonymous> (src/server/routes/repository-public.ts:224:23)');
});
it('retains only recognized source frames and types, never messages, URLs or roots',()=>{
const result=errorDiagnostics(failure());
expect(result.errorType).equal('TypeError'); expect(result.errorStack).include(frame).and.include('at <anonymous>');
expect(JSON.stringify(result)).not.include(secret).and.not.include(process.cwd()).and.not.include('https:');
const payload=serializeError(failure()); expect(logRecord('error','route',['failure',payload]).errorStack).include(frame);
});
it('bounds nested causes and frames, tolerates cycles/getters and rejects forged diagnostics',()=>{
const error=failure();error.cause=failure();error.cause.cause=error;
const result=errorDiagnostics(error);expect(result.causeType).equal('TypeError');expect(result.causeStack).include(frame);
error.cause.cause={name:secret,cause:error};
expect(errorDiagnostics(error)).include({causeType:'UnknownError'}).and.not.have.property('causeStack');
error.stack='Error\n'+Array(40).fill(' at printError ('+path.resolve('src/server/routes/route-utils.ts')+':200:7)').join('\n');
expect(errorDiagnostics(error).errorStack.split('\n')).length(8);
const hostile={};Object.defineProperty(hostile,'stack',{get(){throw Error('must not run')}});
expect(errorDiagnostics(hostile)).deep.equal({errorType:'UnknownError'});
expect(safeDiagnosticFields({errorType:secret,errorStack:frame+'\n'+secret+'\r\n at unknown (src/private.ts:1:2)',causeStack:'x'.repeat(5000)})).deep.equal({errorStack:frame});
});
it('carries normalized method/route through route errors and safe Redis projection',()=>{
const route=requestRoute('/api/repo/'+secret+'/file/private.txt?token='+secret,'api');
expect(route).equal('/api/repo/:repoId/file/:path');
const record=logContext.run({method:'GET',route},()=>logRecord('error','route',['failure',{...serializeError(failure()),httpStatus:500}]));
expect(record).include({route,method:'GET',httpStatus:500,errorType:'TypeError'});
const row=safeRedisLog({ts:new Date().toISOString(),level:'error',module:'route',raw:[record]});
expect(row.raw[0]).include({route,method:'GET',httpStatus:500,errorType:'TypeError',errorStack:record.errorStack});
expect(JSON.stringify(row)).not.include(secret);
expect(logRecord('error','route',['',{route:'/private/'+secret,method:'GET\n'+secret}])).not.have.property('route');
});
it('preserves the same diagnostics in correlated central events and rejects unsafe fields',async()=>{
const oldFetch=global.fetch, oldUrl=process.env.ADMIN_LOG_URL;
try{
process.env.ADMIN_LOG_URL='http://logs.test:9428';
global.fetch=async()=>new Response(JSON.stringify({_time:new Date().toISOString(),service:'api',event:'application_log',module:'route',severity:'error',route:'/api/repo/:repoId',method:'GET',errorType:'TypeError',errorStack:frame,causeType:secret,stack:secret,url:secret,httpStatus:500}));
const result=await investigateLogs(logOptions({kind:'requestId',id:'aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa'},true),true);
expect(result.events[0]).include({route:'/api/repo/:repoId',method:'GET',errorType:'TypeError',errorStack:frame,httpStatus:500});
expect(JSON.stringify(result)).not.include(secret);
}finally{global.fetch=oldFetch;if(oldUrl===undefined)delete process.env.ADMIN_LOG_URL;else process.env.ADMIN_LOG_URL=oldUrl;}
});
});
+12
View File
@@ -35,6 +35,18 @@ describe("bounded request monitoring", function () {
});
async function listen() { server = await new Promise(resolve => { const s = app.listen(0, "127.0.0.1", () => resolve(s)); }); }
it("captures failed file reproduction context without changing metric labels or retaining queries", async function () {
const {logRecord}=require('../src/core/log-record');
const records=[];
app.get('/api/repo/:repoId/file/*path',(req,res)=>{
records.push(logRecord('error','route',['failure',{httpStatus:500}]));res.status(500).end();
});
await listen(); await fetch(server,'/api/repo/demo-123/file/docs/reproduce%20issue.md?token=NEVER_CAPTURE');
expect(records[0]).include({repoId:'demo-123',requestPath:'/api/repo/demo-123/file/docs/reproduce%20issue.md',route:'/api/repo/:repoId/file/:path'});
expect(JSON.stringify(records)).not.include('NEVER_CAPTURE');
expect(metrics.drain().every(row=>!JSON.stringify(row).includes('demo-123'))).equal(true);
});
it("keeps labels bounded and removes source identities and query values", function () {
expect(requestRoute("/api/repo/private-name/file/secret.txt?token=abc", "api")).to.equal("/api/repo/:repoId/file/:path");
expect(requestRoute("/api/repo/secret-owner/secret-repo/readme?branch=secret", "api")).to.equal("/api/repo/:owner/:repo/readme");
+13
View File
@@ -98,6 +98,19 @@ describe('structured logging privacy and context', function () {
`], {env: {...process.env, LOG_REDIS_MIRROR: 'on'}, encoding: 'utf8', timeout: 10000});
expect(child.status, child.stderr).to.equal(0);
});
it('keeps exact reproduction and a frame when Redis payload clamping reduces diagnostics', () => {
const child = spawnSync(process.execPath, ['-r','ts-node/register/transpile-only','-e', `
const assert=require('node:assert/strict'),redis=require('redis');let payload;
const tx={lPush(key,value){payload=value;return tx;},lTrim(){return tx;},hIncrBy(){return tx;},expire(){return tx;},exec(){return Promise.resolve([]);}};
redis.createClient=()=>({isReady:true,isOpen:true,on(){},connect(){return Promise.resolve();},multi(){return tx;}});
const requestPath='/api/repo/demo-123/file/'+ 'a'.repeat(1950);
const frame='at <anonymous> (src/core/model/owner-alert-lifecycle.schema.ts:123456:12345)';
const stack=Array(8).fill(frame).join('\\n');
require('./src/core/logger').createLogger('route').error('failure',{...Object.fromEntries(['ms','firstByteMs','responseMs','bytes','bytesPerSecond','attempt','rss','memoryLimitBytes','memoryRatio','uptime','activeRequests','waiting','active','delayed','failed','oldestWaitingMs','droppedLogs','loopP95Ms','upstreamStatus'].map(key=>[key,Number.MAX_VALUE])),requestPath,errorType:'TypeError',errorStack:stack,causeType:'Error',causeStack:stack,httpStatus:500});
assert(payload.length<=4096);const row=JSON.parse(payload).raw[0];assert.equal(row.requestPath,requestPath);assert.equal(row.repoId,'demo-123');assert.equal(row.errorStack,frame);
`],{env:{...process.env,LOG_REDIS_MIRROR:'on'},encoding:'utf8',timeout:10000});
expect(child.status,child.stderr).equal(0);
});
it('writes JSON without Redis and bounds a blocked stdout pipe', () => {
const child = spawnSync(process.execPath, ['-r', 'ts-node/register/transpile-only', '-e', `
const { createLogger, getDroppedOutput } = require('./src/core/logger');
+45
View File
@@ -81,6 +81,51 @@ describe("Vue 3 UI", function () {
let ui;
afterEach(() => ui?.close());
it("renders useful history occurrences with visible times and selected tabs", async () => {
const entries=[0,2,1].map(n=>({ts:new Date(Date.UTC(2026,10,14,12,n)).toISOString(),level:'error',module:'route',message:'application_log',raw:[{event:'application_log',service:'api',httpStatus:500,...(n===2?{method:'GET',route:'/api/repo/:repoId/file/:path'}:{})}]}));
ui=await browser('/',{'/api/user':{username:'admin',isAdmin:true,status:'ready'},'/api/admin/errors':{available:true,total:3,entries},'/api/admin/errors/investigation':{state:'disabled',groups:[]}});
await ui.go('/admin/errors'); const doc=ui.window.document;
doc.querySelector('#error-source-history').click();await delay(20);
doc.querySelector('button.errors-row-main').click();await delay(20);
const tab=[...doc.querySelectorAll('.history-source .detail-tabs button')].find(b=>b.textContent.startsWith('Occurrences'));
tab.click();await delay(20);
expect(tab.getAttribute('aria-pressed')).equal('true');expect(tab.classList.contains('active')).equal(true);
const items=[...doc.querySelectorAll('.history-occurrence-list li')];expect(items).length(3);
expect(items.map(item=>item.querySelector('time').getAttribute('datetime'))).deep.equal([entries[1].ts,entries[2].ts,entries[0].ts]);
expect(items[0].textContent).include('GET /api/repo/:repoId/file/:path');
expect(items[1].textContent).include('Request route was not captured.').and.include('Exception frames were not captured.');
expect(items[0].querySelector('time').classList.contains('when-abs')).equal(false);
const record=items[0].querySelector('details');record.querySelector('summary').click();expect(record.open).equal(true);
expect(record.querySelector('.history-occurrence-record pre').textContent).include('application_log');expect(ui.errors).deep.equal([]);
});
it("shows normalized request routes and exception frames in both admin sources", async () => {
const now=new Date().toISOString(), requestId='aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa';
const sample={event:'application_log',service:'api',module:'route',severity:'error',httpStatus:500,method:'GET',route:'/api/repo/:repoId/file/:path',repoId:'demo-123',requestPath:'/api/repo/demo-123/file/docs/reproduce%20issue.md',errorType:'TypeError',errorStack:'at printError (build/server/routes/route-utils.js:200:7)',causeType:'RangeError',causeStack:'at <anonymous> (build/core/repository.js:410:9)',requestId};
ui=await browser('/',{
'/api/user':{username:'admin',isAdmin:true,status:'ready'},
'/api/admin/errors/investigation':{state:'ready',window:'1h',groups:[{fingerprint:'diagnostic',count:1,sample,first:now,last:now}]},
'/api/admin/errors/correlation':{state:'ready',events:[{...sample,timestamp:now}]},
'/api/admin/errors':{available:true,total:1,entries:[{ts:now,level:'error',module:'route',message:'TypeError',raw:[sample]}]},
});
await ui.go('/admin/errors');const doc=ui.window.document;
doc.querySelector('.log-event-button').click();await delay(30);
expect(doc.querySelector('#log-detail-title').textContent).equal('TypeError');
expect(doc.querySelector('.log-timeline .log-request-route').textContent).include('GET '+sample.requestPath);
expect(doc.querySelector('.log-reproduction').textContent).include('demo-123').and.include(sample.requestPath);
let copiedPath;Object.defineProperty(ui.window.navigator,'clipboard',{configurable:true,value:{writeText:async value=>{copiedPath=value;}}});
doc.querySelector('.log-reproduction button').click();await delay(10);expect(copiedPath).equal(sample.requestPath);
const frames=doc.querySelector('.log-timeline .log-error-stack');expect(frames.open).equal(false);
frames.querySelector('summary').click();expect(frames.open).equal(true);
expect(frames.textContent).include(sample.errorStack).and.include('RangeError').and.include(sample.causeStack);
doc.querySelector('#error-source-history').click();await delay(20);
doc.querySelector('button.errors-row-main').click();await delay(20);
expect(doc.querySelector('.history-source .log-request-route').textContent).include(sample.route);
[...doc.querySelectorAll('.history-source .detail-tabs button')].find(b=>b.textContent==='Stack').click();await delay(20);
expect(doc.querySelector('.stack-pre').textContent).include(sample.errorStack).and.include(sample.causeStack);
expect(ui.errors).deep.equal([]);
});
it("investigates grouped admin logs with bounded filters and a safe correlated timeline", async () => {
const requestId = "aaaaaaaa-aaaa-4aaa-8aaa-aaaaaaaaaaaa";
const now = new Date().toISOString();