feat(ui): browse and check every file in the anonymize preview (#950)

* feat(ui): browse and check every file in the anonymize preview

The "What reviewers will see" window now redacts the README GitHub actually
shows and lets authors open any file of the commit.

- README: resolved from the file list like GitHub (.github/, root, docs/,
  any case, Markdown first) and only that path is tested against the
  "Leave files unredacted" rules. Before the list loads, only root names are
  assumed, so leaving docs/ unredacted no longer unredacts the root README.
  The file bar shows the README's real name.
- New GET /api/repo/:owner/:repo/file?commit=&path= (same access checks as
  /tree): raw text, no-store, path traversal rejected, 1 MB cap
  (file_too_big, 413), binary files reported as { binary: true }.
  /tree also lists binary files (binaryFiles) for the preview's tree.
- Tree rows open files (keyboard accessible, explorer active rail). Text is
  redacted through /api/anonymize-preview by the same batcher as the README;
  files left unredacted are sent without terms and tagged "Left unredacted"
  (opens the dialog). Markdown renders like the README, code is highlighted
  with Prism, images/PDF/binary/too-large files get a short note. Loading
  and error (Retry) states reuse rp-state.
- File and folder names are redacted through /api/anonymize-preview.
- Caption counts the open file; "<name> left unredacted" when preserved.
- Phones: the Files button opens the tree as a sheet.
- dev-mock: a jsmith/robust-repair source with tree, file and
  anonymize-preview endpoints and fixtures carrying the mock's terms.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* refactor(ui): reuse the explorer in the anonymize preview

Share the explorer file renderer and tree with the author preview. Apply
preserved-file rules on the server and keep the reviewer rendering and
redaction slots consistent across both views.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(ui): keep the reviewer page unchanged by the preview reuse

The preview reuses tree.js and the shared file viewer; its differences now
apply only inside the anonymize preview.

- The narrow-pane rule that hid the file meta and Symbols applied to the
  reviewer page too (visible with a widened sidebar); it is scoped to
  .reviewer-preview. The token capture moves from body to the page that
  holds the preview.
- tree.js: aria-expanded/aria-current and tree-only scrolling apply only
  when the tree is embedded (selectedPath set); the reviewer page keeps
  scrollIntoView and its original markup.
- file-viewer: the extra menu-closing click listener, the #L hash writes and
  the Ctrl+F/G and Alt+Z shortcuts are limited to the preview (shortcuts
  only while its code has focus), so the form keeps the browser's Find.
- Preview: the tree's file list is cached between renders, name batches are
  chunked under the JSON body limit, /api/anonymize-preview accepts up to
  3 MB so files up to the 1 MB preview limit can be redacted, and on phones
  the caption's "<name> left unredacted" opens the dialog (the header tag
  squeezed the path out).
- dev-mock: long and nested names for the tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(ui): restore the redaction number on the right and level the slots

The redesign centered the term number in every redaction slot; it sits on
the right edge again, in code, Markdown, the tree and the breadcrumb. Tree,
breadcrumb and paragraph slots also sat about 2px below the text; they now
center on the line's letters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix: address preview navigation and path review findings

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Thomas DurieuxandClaude Opus 5.5 authored and GitHub committed 2026-11-13 14:27:13 +01:00
1 parent d508ab1754
commit 476f25e264
20 files changed
+1794 -941

No files matched your search

+2 -2
View File
@@ -1,8 +1,8 @@
{
"core.min.js": "core.d23af1c652.min.js",
"vendor.min.js": "vendor.64141223b7.min.js",
"vendor.min.js": "vendor.f7ae54550a.min.js",
"mermaid.min.js": "mermaid.a7356d5ed1.min.js",
"all.min.css": "all.53fcd1a96b.min.css",
"all.min.css": "all.f1b027597b.min.css",
"markdown.min.js": "markdown.6c8dfb7b1d.min.js",
"pdf.min.js": "pdf.4d9cc6ff49.min.js",
"notebook.min.js": "notebook.c3144c18ae.min.js",
+5 -1
View File
@@ -6,4 +6,8 @@
*/:root{--blue:#007bff;--indigo:#6610f2;--purple:#6f42c1;--pink:#e83e8c;--red:#dc3545;--orange:#fd7e14;--yellow:#ffc107;--green:#28a745;--teal:#20c997;--cyan:#17a2b8;--white:#fff;--gray:#6c757d;--gray-dark:#343a40;--primary:#007bff;--secondary:#6c757d;--success:#28a745;--info:#17a2b8;--warning:#ffc107;--danger:#dc3545;--light:#f8f9fa;--dark:#343a40;--breakpoint-xs:0;--breakpoint-sm:576px;--breakpoint-md:768px;--breakpoint-lg:992px;--breakpoint-xl:1200px;--font-family-sans-serif:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-family-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace}*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus:not(:focus-visible){outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]){color:inherit;text-decoration:none}a:not([href]):hover{color:inherit;text-decoration:none}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-weight:500;line-height:1.2}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unsLine truncated
* Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/.fa,.fab,.fad,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:solid .08em #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);transform:scale(1,-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{contentLine truncated
*/.fa,.fab,.fad,.fal,.far,.fas{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1}.fa-lg{font-size:1.33333em;line-height:.75em;vertical-align:-.0667em}.fa-xs{font-size:.75em}.fa-sm{font-size:.875em}.fa-1x{font-size:1em}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-6x{font-size:6em}.fa-7x{font-size:7em}.fa-8x{font-size:8em}.fa-9x{font-size:9em}.fa-10x{font-size:10em}.fa-fw{text-align:center;width:1.25em}.fa-ul{list-style-type:none;margin-left:2.5em;padding-left:0}.fa-ul>li{position:relative}.fa-li{left:-2em;position:absolute;text-align:center;width:2em;line-height:inherit}.fa-border{border:solid .08em #eee;border-radius:.1em;padding:.2em .25em .15em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left,.fab.fa-pull-left,.fal.fa-pull-left,.far.fa-pull-left,.fas.fa-pull-left{margin-right:.3em}.fa.fa-pull-right,.fab.fa-pull-right,.fal.fa-pull-right,.far.fa-pull-right,.fas.fa-pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.fa-rotate-90{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-webkit-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{-webkit-transform:scale(1,-1);transform:scale(1,-1)}.fa-flip-both,.fa-flip-horizontal.fa-flip-vertical{-webkit-transform:scale(-1,-1);transform:scale(-1,-1)}:root .fa-flip-both,:root .fa-flip-horizontal,:root .fa-flip-vertical,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-rotate-90{-webkit-filter:none;filter:none}.fa-stack{display:inline-block;height:2em;line-height:2em;position:relative;vertical-align:middle;width:2.5em}.fa-stack-1x,.fa-stack-2x{left:0;position:absolute;text-align:center;width:100%}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-500px:before{content:"\f26e"}.fa-accessible-icon:before{content:"\f368"}.fa-accusoft:before{content:"\f369"}.fa-acquisitions-incorporated:before{content:"\f6af"}.fa-ad:before{content:"\f641"}.fa-address-book:before{content:"\f2b9"}.fa-address-card:before{content:"\f2bb"}.fa-adjust:before{content:"\f042"}.fa-adn:before{content:"\f170"}.fa-adversal:before{content:"\f36a"}.fa-affiliatetheme:before{content:"\f36b"}.fa-air-freshener:before{content:"\f5d0"}.fa-airbnb:before{content:"\f834"}.fa-algolia:before{content:"\f36c"}.fa-align-center:before{content:"\f037"}.fa-align-justify:before{content:"\f039"}.fa-align-left:before{content:"\f036"}.fa-align-right:before{content:"\f038"}.fa-alipay:before{content:"\f642"}.fa-allergies:before{content:"\f461"}.fa-amazon:before{content:"\f270"}.fa-amazon-pay:before{content:"\f42c"}.fa-ambulance:before{content:"\f0f9"}.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-amilia:before{content:"\f36d"}.fa-anchor:before{content:"\f13d"}.fa-android:before{content:"\f17b"}.fa-angellist:before{content:"\f209"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-down:before{content:"\f107"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angry:before{content:"\f556"}.fa-angrycreative:before{content:"\f36e"}.fa-angular:before{content:"\f420"}.fa-ankh:before{content:"\f644"}.fa-app-store:before{content:"\f36f"}.fa-app-store-ios:before{content:"\f370"}.fa-apper:before{content:"\f371"}.fa-apple:before{content:"\f179"}.fa-apple-alt:before{content:"\f5d1"}.fa-apple-pay:before{content:"\f415"}.fa-archive:before{content:"\f187"}.fa-archway:before{content:"\f557"}.fa-arrow-alt-circle-down:before{content:"\f358"}.fa-arrow-alt-circle-left:before{content:"\f359"}.fa-arrow-alt-circle-right:before{content:"\f35a"}.fa-arrow-alt-circle-up:before{content:"\f35b"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-down:before{content:"\f063"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrows-alt:before{content:"\f0b2"}.fa-arrows-alt-h:before{content:"\f337"}.fa-arrows-alt-v:before{content:"\f338"}.fa-artstation:before{content:"\f77a"}.fa-assistive-listening-systems:before{contentLine truncated
@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}}.breadcrumb .redact-slot,.files .tree-name .redact-slot{position:relative;top:-.15em}.dark-mode .markdown-body :is(p,li,td,th,blockquote,dd) mark.redact-chip,.markdown-body :is(p,li,td,th,blockquote,dd) mark.redact-chip{vertical-align:.04em!important}
+60 -62
View File
@@ -8322,7 +8322,7 @@ body.dark-mode .preserve-dialog { background: #242320; color: #faf9f6; }
--rp-line: var(--border-color);
--rp-skel: var(--paper-card);
}
.anonymize-page .reviewer-preview .anonymize-preview-body.markdown-body h1 { font-size: 24px; }
.anonymize-page .reviewer-preview .rp-document .anonymize-preview-body.markdown-body h1 { font-size: 24px; }
@media (prefers-reduced-motion: no-preference) { .reviewer-preview .rp-loading .rp-skel, .reviewer-preview .rp-skel-row .rp-skel { animation: rp-pulse 1.4s ease-in-out infinite; }
}
@media (min-width: 1200px) {
@@ -8353,15 +8353,15 @@ body.dark-mode .preserve-dialog { background: #242320; color: #faf9f6; }
background: linear-gradient(to bottom, rgba(250,249,246,0), #FAF9F6) !important;
}
}
.reviewer-preview pre, .reviewer-preview .markdown-body pre, .reviewer-preview .pr-diff pre, .reviewer-preview .pr-diff table { max-width: 100%; }
.reviewer-preview pre { overflow-x: hidden !important; white-space: pre-wrap !important; overflow-wrap: anywhere !important; word-break: normal !important; }
.reviewer-preview pre code, .reviewer-preview pre code span { white-space: pre-wrap !important; overflow-wrap: anywhere !important; word-break: normal !important; }
.reviewer-preview pre code .code-line { display: inline-block; width: 100%; box-sizing: border-box; padding-left: var(--hang, 4ch); text-indent: calc(-1 * var(--hang, 4ch)); vertical-align: top; }
.reviewer-preview pre code .md-diff-line { padding-left: calc(var(--diff-pad) + var(--hang, 4ch)); text-indent: calc(-1 * var(--hang, 4ch)); vertical-align: top; }
.reviewer-preview pre, .reviewer-preview pre code { font-family: var(--font-mono) !important; font-size: 12px !important; line-height: 20px !important; }
.reviewer-preview pre code { display: block; }
.dark-mode .reviewer-preview pre code .md-diff-line.is-add { background: #1E2A20; }
.dark-mode .reviewer-preview pre code .md-diff-line.is-remove { background: #33201D; }
.reviewer-preview .rp-document pre, .reviewer-preview .rp-document .markdown-body pre, .reviewer-preview .rp-document .pr-diff pre, .reviewer-preview .rp-document .pr-diff table { max-width: 100%; }
.reviewer-preview .rp-document pre { overflow-x: hidden !important; white-space: pre-wrap !important; overflow-wrap: anywhere !important; word-break: normal !important; }
.reviewer-preview .rp-document pre code, .reviewer-preview .rp-document pre code span { white-space: pre-wrap !important; overflow-wrap: anywhere !important; word-break: normal !important; }
.reviewer-preview .rp-document pre code .code-line { display: inline-block; width: 100%; box-sizing: border-box; padding-left: var(--hang, 4ch); text-indent: calc(-1 * var(--hang, 4ch)); vertical-align: top; }
.reviewer-preview .rp-document pre code .md-diff-line { padding-left: calc(var(--diff-pad) + var(--hang, 4ch)); text-indent: calc(-1 * var(--hang, 4ch)); vertical-align: top; }
.reviewer-preview .rp-document pre, .reviewer-preview .rp-document pre code { font-family: var(--font-mono) !important; font-size: 12px !important; line-height: 20px !important; }
.reviewer-preview .rp-document pre code { display: block; }
.dark-mode .reviewer-preview .rp-document pre code .md-diff-line.is-add { background: #1E2A20; }
.dark-mode .reviewer-preview .rp-document pre code .md-diff-line.is-remove { background: #33201D; }
.reviewer-preview .rp-open:hover { text-decoration-thickness: 2px; }
pre code .md-diff-line { display: inline-block; box-sizing: border-box; margin: 0 calc(-1 * var(--diff-pad)); padding: 0 var(--diff-pad); width: calc(100% + 2 * var(--diff-pad)); }
pre code .md-diff-line.is-add { background: rgba(47,107,62,0.10); color: #1F4A2A; }
@@ -8705,10 +8705,10 @@ input[type="date"].form-control:hover::-webkit-calendar-picker-indicator { backg
top: 50%;
font: 700 9.5px/1 var(--font-sans, Inter, sans-serif);
color: var(--slot-num);
text-align: center !important;
left: 50% !important;
right: auto !important;
transform: translate(-50%, -50%) !important;
text-align: right !important;
left: auto !important;
right: 0 !important;
transform: translateY(-50%) !important;
padding: 1px 5px !important;
border-radius: 3px;
background: var(--slot-bg);
@@ -8826,7 +8826,7 @@ pre code mark.redact-chip {
vertical-align: -.24em !important;
font-size: inherit !important;
line-height: 1.2em !important;
text-align: center !important;
text-align: right !important;
padding: 0 !important;
}
.markdown-body pre code mark.redact-chip i, pre code mark.redact-chip i {
@@ -12495,16 +12495,14 @@ body.dark-mode .hosting-limit { background: rgba(251, 191, 36, .1); border-color
.paper-feature.is-on .paper-feature-tab { border-bottom-color: var(--accent) !important; }
.page-head + .admin-nav { margin-top: 0 !important; }
/* Redaction masks: the index sits centered in the slot; in headings the slot hugs its number. */
/* Redaction masks: in headings the slot hugs its number. */
/* ----- File viewer ----- */
.redact-slot, .markdown-body mark.redact-chip, .dark-mode .markdown-body mark.redact-chip, .demo-output .redact-chip, .dark-mode .demo-output .redact-chip, span.redact, .dark-mode span.redact { justify-content: center !important; }
.markdown-body :is(h1, h2, h3, h4) mark.redact-chip, .dark-mode .markdown-body :is(h1, h2, h3, h4) mark.redact-chip { min-width: 1.2em !important; padding: 0 .3em !important; justify-content: center !important; }
.markdown-body :is(h1, h2) mark.redact-chip i { font-size: .55em !important; }
/* Home: the phone hero mock shows whole, with its full border, instead of fading out. */
/* Home "Before you sign in": the heading column stays in view while the answers scroll. */
.files .redact-slot, .breadcrumb .redact-slot { justify-content: center !important; }
/* Status: one ready message, the link right under it, and a sidebar card like every other card. */
.repository-task .page-head { margin-bottom: 20px !important; }
@@ -13619,7 +13617,7 @@ input[type="date"].form-control { font-family: var(--font-sans) !important; font
.conference-page .dashboard-filter-row { border-bottom: 0 !important; padding-bottom: 0 !important; }
.conference-page .paper-meta-rule { border-top: 0 !important; padding-top: 4px !important; margin-top: 20px !important; }
.ov-metric-bad, .overview-page .ov-metric-bad { color: var(--st-bad) !important; font-weight: 600; }
.markdown-body :is(p, li, td, th, blockquote, dd) mark.redact-chip, .dark-mode .markdown-body :is(p, li, td, th, blockquote, dd) mark.redact-chip { min-width: 2em !important; width: auto !important; padding: 0 .45em !important; text-align: center !important; }
.markdown-body :is(p, li, td, th, blockquote, dd) mark.redact-chip, .dark-mode .markdown-body :is(p, li, td, th, blockquote, dd) mark.redact-chip { min-width: 2.5em !important; width: auto !important; padding: 0 .34em !important; text-align: right !important; }
/* ----- Anonymize workspace ----- */
.anonymize-page .anonymize-preview-col.reviewer-preview { display: flex; flex-direction: column; min-height: 0; overflow: hidden !important; padding: 0 !important; background: var(--rp-stage) !important; border-left: 1px solid var(--rp-line); }
@@ -13640,11 +13638,7 @@ input[type="date"].form-control { font-family: var(--font-sans) !important; font
.reviewer-preview .rp-bar-id { padding-left: 12px; border-left: 1px solid var(--rp-line); font: 500 12px/1 var(--font-mono, ui-monospace, monospace); color: var(--color); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reviewer-preview .rp-bar-kind { margin-left: auto; font-size: 12px; color: var(--ink-muted); }
.reviewer-preview .rp-body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0,1fr); }
.reviewer-preview .rp-doc { min-height: 0; min-width: 0; overflow: auto; scrollbar-width: thin; position: relative; }
.reviewer-preview .rp-file-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; gap: 10px; padding: 10px 24px; background: var(--rp-window); border-bottom: 1px solid var(--rp-line); font-size: 13px; }
.reviewer-preview .rp-file-name { font-weight: 600; color: var(--color); }
.reviewer-preview .rp-file-meta { color: var(--ink-muted); }
.anonymize-page .reviewer-preview .anonymize-preview-body { background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; min-height: 0 !important; padding: 24px 32px 40px !important; max-width: 860px; }
.anonymize-page .reviewer-preview .rp-document .anonymize-preview-body { background: transparent !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; min-height: 0 !important; padding: 24px 32px 40px !important; max-width: 860px; }
/* States inside the window */
.reviewer-preview .rp-state { padding: 28px 32px; max-width: 560px; }
.reviewer-preview .rp-state strong { display: block; font-size: 15px; font-weight: 600; color: var(--color); margin: 0 0 6px; }
@@ -13677,8 +13671,7 @@ input[type="date"].form-control { font-family: var(--font-sans) !important; font
.reviewer-preview .rp-window { margin: 0; border: 1px solid var(--rp-line); border-radius: 10px; min-height: 64vh; }
.reviewer-preview .rp-chrome { height: 30px; }
.reviewer-preview .rp-url { font-size: 11px; margin-left: 6px; }
.reviewer-preview .rp-file-head { padding: 9px 16px; }
.anonymize-page .reviewer-preview .anonymize-preview-body { padding: 18px 16px 28px !important; }
.anonymize-page .reviewer-preview .rp-document .anonymize-preview-body { padding: 18px 16px 28px !important; }
.reviewer-preview .rp-state { padding: 20px 16px; }
.reviewer-preview .rp-error, .reviewer-preview .rp-empty { margin: 16px; }
}
@@ -13934,7 +13927,7 @@ pre code mark.redact-chip,
.anonymize-page .anonymize-workspace .anonymize-form-col .paper-settings-section { background: transparent !important; box-shadow: none !important; }
.dark-mode .anonymize-page .anonymize-workspace { background: var(--canvas-bg-color) !important; }
.dark-mode .reviewer-preview .rp-url { background: var(--canvas-bg-color); }
.reviewer-preview .anonymize-preview-body > .d-flex:first-child { align-items: baseline !important; }
.reviewer-preview .rp-document .anonymize-preview-body > .d-flex:first-child { align-items: baseline !important; }
.dark-mode .csv-table-wrap .csv-table { background: var(--canvas-bg-color); }
@media (max-width: 767px) {
.anonymize-workspace .hosting-settings > .expiration-choices:last-child { margin-bottom: 0 !important; }
@@ -14030,7 +14023,7 @@ pre code mark.redact-chip,
@media (max-width: 767px) {
.anonymize-page .source-url-label-row .repo-access-switch.repo-access-switch { padding: 3px !important; border-radius: 8px !important; height: 36px; box-sizing: border-box; }
}
.reviewer-preview pre code :is(.md-diff-line, .code-line) { line-height: 20px !important; vertical-align: top; margin-top: 0; margin-bottom: 0; border: 0; box-shadow: none; outline: 0; }
.reviewer-preview .rp-document pre code :is(.md-diff-line, .code-line) { line-height: 20px !important; vertical-align: top; margin-top: 0; margin-bottom: 0; border: 0; box-shadow: none; outline: 0; }
.status-dot.status-dot:is(.st-expiring, .st-removing, .status-expiring, .status-removing) { background: linear-gradient(90deg, var(--st-off) 50%, transparent 50%) !important; box-shadow: inset 0 0 0 1.5px var(--st-off) !important; }
.errors-page .errors-group-count { margin-left: 6px; }
.dark-mode .errors-page .errors-group-count { background: rgba(255,255,255,.07); }
@@ -14202,40 +14195,45 @@ body.dark-mode .auto-update-check .paid-tag { background: rgba(251, 191, 36, .12
.auto-update-check .auto-update-paid a { white-space: nowrap; }
.hosting-limit.auto-update-note { font-weight: 400; line-height: 1.5; }
/* F8. Reviewer preview: a vertical file tree, a miniature of the explorer.
The sidebar is tinted like the explorer's .leftCol (#F3F1EC / #1F1D1A; the
workspace overrides --paper-bg-alt, so the values are spelled out) and runs the full
height of the window; the tree and the document scroll on their own. Rows
reuse the explorer's .files tree styles; nesting is drawn per row (--depth)
with the explorer's 16px step and guide line. Phones hide the sidebar and
show the explorer's "Files" button in the file bar instead. */
.reviewer-preview .rp-body.has-side { display: grid; grid-template-columns: clamp(180px, 24%, 240px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); overflow: hidden; }
.reviewer-preview .rp-body.has-side > .rp-doc { min-height: 0; overflow: auto; }
.reviewer-preview .rp-side { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; background: #F3F1EC; border-right: 1px solid var(--border-color); }
.dark-mode .reviewer-preview .rp-side { background: #1F1D1A; }
.reviewer-preview .rp-side .files.rp-files { height: auto; overflow: visible; margin: 0; padding: 8px 6px; list-style: none; }
.reviewer-preview .rp-files > li { padding-left: calc(var(--depth, 0) * 16px); background-image: repeating-linear-gradient(to right, transparent 0 7px, var(--border-color) 7px 8px, transparent 8px 16px); background-size: calc(var(--depth, 0) * 16px) 100%; background-repeat: no-repeat; word-break: normal; }
.reviewer-preview .rp-files a { min-height: 26px; cursor: default; user-select: none; }
.reviewer-preview .rp-files .file:not(.folder) > a:hover { background: transparent; }
.reviewer-preview .rp-files .file.active:not(.folder) > a:hover { background: #E8E5DD; }
.dark-mode .reviewer-preview .rp-files .file.active:not(.folder) > a:hover { background: rgba(255,255,255,.1); }
.reviewer-preview .rp-files .folder > a { cursor: pointer; }
.reviewer-preview .rp-files .folder > a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.reviewer-preview .rp-files-skel { list-style: none; margin: 0; padding: 8px 6px; }
.reviewer-preview .rp-files-skel li { display: flex; align-items: center; height: 26px; padding: 0 8px 0 21px; }
.reviewer-preview .rp-files-skel .rp-skel { height: 9px; }
@media (prefers-reduced-motion: no-preference) { .reviewer-preview .rp-files-skel .rp-skel { animation: rp-pulse 1.4s ease-in-out infinite; } }
.reviewer-preview .rp-side-note { margin: 4px 14px 12px; font-size: 12px; line-height: 1.5; color: var(--ink-muted); }
.reviewer-preview .rp-files-btn { display: none; }
@media (min-width: 768px) {
.reviewer-preview .rp-body.has-side .rp-file-head { padding-left: 32px; padding-right: 32px; }
/* The reviewer window hosts the explorer tree and pageView, with its own viewport. */
.reviewer-preview .reviewer-explorer { --sidebar-w: 200px; position: relative; display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); overflow: hidden; isolation: isolate; }
.reviewer-explorer > .leftCol { position: relative; width: var(--sidebar-w); min-height: 0; height: auto; grid-column: 1; grid-row: 1; }
.reviewer-explorer > .explorer-main { grid-column: 2; grid-row: 1; min-height: 0; }
.reviewer-explorer > .leftCol-backdrop { display: none; }
@media (max-width: 991px) {
.reviewer-preview .reviewer-explorer { grid-template-columns: minmax(0, 1fr); }
.reviewer-explorer > .explorer-main { grid-column: 1; }
.reviewer-explorer > .leftCol { position: absolute; inset: 0 auto 0 0; width: min(86%, 340px); z-index: 4; }
.reviewer-explorer > .leftCol-backdrop { display: block; position: absolute; inset: 0; z-index: 3; }
}
.reviewer-preview .rp-preserved-tag { flex: none; margin-left: auto; display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border: 0; border-radius: 10px; background: rgba(217, 119, 6, .1); box-shadow: inset 0 0 0 1px rgba(217, 119, 6, .3); color: #8A4B0A; font: 600 11.5px/1 var(--font-sans); white-space: nowrap; cursor: pointer; }
.reviewer-preview .rp-preserved-tag:hover { background: rgba(217, 119, 6, .16); }
.reviewer-preview .rp-preserved-tag:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.dark-mode .reviewer-preview .rp-preserved-tag { background: rgba(251, 191, 36, .12); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .32); color: #F2C66D; }
/* Capture the reviewer tokens before the workspace applies its form palette. */
.app-view:has(.reviewer-preview) { --viewer-paper-card: var(--paper-card); --viewer-canvas: var(--canvas-bg-color); --viewer-paper-alt: var(--paper-bg-alt); --viewer-border: var(--border-color); --viewer-color: var(--color); --viewer-muted: var(--ink-muted); }
.reviewer-preview .reviewer-explorer { --paper-card: var(--viewer-paper-card); --canvas-bg-color: var(--viewer-canvas); --paper-bg-alt: var(--viewer-paper-alt); --border-color: var(--viewer-border); --color: var(--viewer-color); --ink-muted: var(--viewer-muted); color: var(--color); background: var(--canvas-bg-color); }
/* The preview's narrow file pane drops the secondary file tools. Scoped to the
preview: the reviewer page keeps its own header at every width. */
.reviewer-preview .explorer-content { container: explorer-file / inline-size; }
/* clean-css ignore:start */
@container explorer-file (max-width: 700px) {
.reviewer-preview .file-card-head .file-card-meta, .reviewer-preview .file-card-head .symbols { display: none !important; }
}
/* clean-css ignore:end */
/* PR and gist previews retain their existing document surface. */
.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; }
/* Phones: the explorer's header has no room for the tag next to the path, so
the caption's "<name> left unredacted" opens the dialog instead. */
.reviewer-preview button.rp-count { background: none; 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 .rp-body.has-side { display: block; overflow: visible; }
.reviewer-preview .rp-side { display: none; }
.reviewer-preview .rp-body.has-side .rp-file-head { align-items: center; padding: 6px 16px 6px 8px; }
.reviewer-preview .rp-files-btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--border-color); border-radius: 6px; background: #F3F1EC; font-size: 13px; font-weight: 500; color: var(--color); white-space: nowrap; }
.dark-mode .reviewer-preview .rp-files-btn { background: #1F1D1A; }
.reviewer-preview .rp-files-btn .ui-icon { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.reviewer-preview .rp-files-count { font-weight: 400; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.reviewer-preview .file-card-head .rp-preserved-tag { display: none; }
}
/* Tree and breadcrumb: the slot centers on the name's capitals, not below the baseline. */
.files .tree-name .redact-slot, .breadcrumb .redact-slot { position: relative; top: -.15em; }
/* Text: the slot centers on the line's letters, level with parentheses and punctuation. */
.markdown-body :is(p, li, td, th, blockquote, dd) mark.redact-chip, .dark-mode .markdown-body :is(p, li, td, th, blockquote, dd) mark.redact-chip { vertical-align: .04em !important; }
+23 -22
View File
@@ -532,9 +532,10 @@
<div id="workspace-preview" :role="mobileWorkspace ? 'tabpanel' : null" :aria-labelledby="mobileWorkspace ? 'workspace-preview-tab' : null" class="anonymize-preview-col reviewer-preview" v-if="detectedType">
<div class="rp-caption">
<span class="rp-title">What reviewers will see</span>
<button type="button" class="rp-open" v-if="detectedType === 'repo'" @click="previewViewer.sidebarCollapsed = !previewViewer.sidebarCollapsed" :aria-expanded="!previewViewer.sidebarCollapsed" aria-controls="preview-file-tree">Files</button>
<span class="rp-count" v-if="previewStatus === 'ready' &amp;&amp; previewRedactions() &gt; 0" :title="previewRedactions() + ' redacted terms in this preview'"><span class="redact-slot" aria-hidden="true"><i>{{ previewRedactions() }}</i></span> redacted</span>
<span class="rp-count rp-count-none" v-else-if="previewStatus === 'ready' &amp;&amp; !String(terms || '').trim()">No terms yet</span>
<span class="rp-count rp-count-none" v-else-if="previewStatus === 'ready' &amp;&amp; readmePreserved()">README left unredacted</span>
<button type="button" class="rp-count rp-count-none" v-else-if="previewStatus === 'ready' &amp;&amp; previewPreserved()" @click="openPreserveFiles()" title="Change it in Leave files unredacted">{{ previewName(previewFile ? previewFile.slice(previewFile.lastIndexOf('/') + 1) : readmeName()) }} left unredacted</button>
<span class="rp-spacer"></span>
<a class="rp-open is-external" v-if="isUpdate &amp;&amp; previewUrl()" :href="safeUrl(previewPath())" target="_blank" rel="noopener">Open reviewer page <span aria-hidden="true">↗</span></a>
<button type="button" class="rp-open is-toggle" v-else @click="previewExpanded = !previewExpanded" :aria-pressed="!!previewExpanded"><svg class="rp-open-icon" viewBox="0 0 16 16" aria-hidden="true"><path v-if="!previewExpanded" d="M9.5 2.5h4v4M13.5 2.5 9 7M6.5 13.5h-4v-4M2.5 13.5 7 9"/><path v-else d="M13.5 6.5h-4v-4M9.5 6.5 14 2M2.5 9.5h4v4M6.5 9.5 2 14"/></svg>{{ previewExpanded ? 'Back to settings' : 'Expand preview' }}</button>
@@ -542,26 +543,19 @@
<div class="rp-window">
<div class="rp-chrome" aria-hidden="true"><i></i><i></i><i></i><span class="rp-url">{{ previewUrl() || 'anonymous.4open.science' }}</span></div>
<div class="rp-bar" aria-hidden="true"><span class="vb-logo">Anonymous <em>GitHub</em></span><span class="rp-bar-id" v-if="previewId()">{{ previewId() }}</span><span class="rp-bar-kind" v-if="detectedType !== 'repo'">{{ detectedType === 'pr' ? 'Pull request' : 'Gist' }}</span></div>
<div class="rp-body" :class="{ 'has-side': detectedType === 'repo' }">
<!-- Sidebar: a miniature of the explorer's file tree -->
<nav class="rp-side" v-if="detectedType === 'repo'" aria-label="Files reviewers will see">
<ul class="files rp-files" v-if="previewTree().length">
<li v-for="entry in previewTree()" :key="entry.path" class="file" :class="{ folder: entry.dir, open: entry.open, active: entry.readme }" :style="{ '--depth': entry.depth }">
<a v-if="entry.dir" role="button" tabindex="0" :aria-expanded="entry.open ? 'true' : 'false'" :title="entry.path" @click="togglePreviewFolder(entry.path)" @keydown.enter.prevent="togglePreviewFolder(entry.path)" @keydown.space.prevent="togglePreviewFolder(entry.path)"><span class="tree-toggle"></span><span class="tree-icon-folder" aria-hidden="true"><svg viewBox="0 0 14 12" focusable="false"><path d="M1.5 10.5v-9h4l1.5 2h5.5v7z"/></svg></span><span class="tree-name">{{ entry.name }}</span></a>
<a v-else :title="entry.path" :aria-current="entry.readme ? 'page' : null"><span class="tree-spacer"></span><span class="far fa-file tree-icon-file" aria-hidden="true"></span><span class="tree-name">{{ entry.name }}</span></a>
</li>
</ul>
<ul class="rp-files-skel" v-else-if="preserve.loading || (sourceLoading &amp;&amp; !preserve.error)" aria-label="Loading the file list"><li v-for="w in [58, 72, 46, 64, 52, 38, 68, 44]" :key="w"><i class="rp-skel" :style="{ width: w + '%' }"></i></li></ul>
<template v-else>
<ul class="files rp-files" v-if="readme || previewStatus === 'ready'"><li class="file active"><a title="README.md" aria-current="page"><span class="tree-spacer"></span><span class="far fa-file tree-icon-file" aria-hidden="true"></span><span class="tree-name">README.md</span></a></li></ul>
<p class="rp-side-note">Every other file at this commit appears here, with the same redactions.</p>
</template>
</nav>
<div class="rp-doc">
<div class="rp-file-head" v-if="detectedType === 'repo' &amp;&amp; (previewStatus === 'ready' || readme)"><span class="rp-files-btn" aria-hidden="true"><svg class="ui-icon"><use href="#ui-icon-folder"></use></svg>Files<span class="rp-files-count" v-if="previewTreeCount()">{{ previewTreeCount() }}</span></span><span class="rp-file-name">README.md</span><span class="rp-file-meta">Markdown</span></div>
<div class="rp-body" :class="{ 'reviewer-explorer': detectedType === 'repo' }">
<aside id="preview-file-tree" class="leftCol" :class="{ collapsed: previewViewer.sidebarCollapsed }" v-if="detectedType === 'repo'" aria-label="Files reviewers will see">
<div class="leftCol-head"><span class="leftCol-eyebrow">Files</span><button type="button" class="leftCol-close" aria-label="Close files" @click="previewViewer.sidebarCollapsed = true"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-close"></use></svg></button></div>
<div class="leftCol-body">
<tree class="files" :file="previewTreeFiles()" :page="previewViewer" :selected-path="'/' + previewPathName(previewOpenPath())" @select="selectPreviewPath($event)"></tree>
</div>
</aside>
<div class="leftCol-backdrop" v-if="detectedType === 'repo'" v-show="!previewViewer.sidebarCollapsed" @click="previewViewer.sidebarCollapsed = true"></div>
<div :class="detectedType === 'repo' ? 'explorer-main' : 'rp-main'">
<div :class="detectedType === 'repo' ? 'explorer-content' : 'rp-document'">
<!-- Loading: skeleton inside the window -->
<div class="rp-state rp-loading" role="status" v-if="previewStatus === 'loading' || (sourceLoading &amp;&amp; previewStatus !== 'ready' &amp;&amp; previewStatus !== 'error')">
<span class="rp-state-text">{{ previewStatus === 'loading' ? 'Updating the anonymized preview…' : (detectedType === 'pr' ? 'Loading the pull request from GitHub…' : detectedType === 'gist' ? 'Loading the gist from GitHub…' : 'Loading the repository from GitHub…') }}</span>
<span class="rp-state-text">{{ previewDoc.loading ? 'Loading ' + previewName(previewFile.slice(previewFile.lastIndexOf('/') + 1)) + ' from GitHub…' : previewStatus === 'loading' ? 'Updating the anonymized preview…' : (detectedType === 'pr' ? 'Loading the pull request from GitHub…' : detectedType === 'gist' ? 'Loading the gist from GitHub…' : 'Loading the repository from GitHub…') }}</span>
<i class="rp-skel rp-skel-title"></i><i class="rp-skel" style="width:92%"></i><i class="rp-skel" style="width:86%"></i><i class="rp-skel" style="width:58%"></i>
<i class="rp-skel rp-skel-block"></i><i class="rp-skel" style="width:80%"></i><i class="rp-skel" style="width:66%"></i>
</div>
@@ -576,17 +570,23 @@
<p>{{ error }}</p>
<div class="rp-state-actions"><button type="button" class="btn btn-ink btn-sm" @click="urlSelected(true)">Retry</button><button type="button" class="btn btn-outline-ink btn-sm" v-if="githubConnection !== 'oauth'" @click="grantGitHubAccess()">Manage GitHub access <svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-external-link"></use></svg></button></div>
</div>
<!-- The open file could not be read from GitHub -->
<div class="rp-state rp-error" role="alert" v-else-if="previewStatus === 'error' &amp;&amp; previewDoc.loadError">
<strong>Couldn't load {{ previewName(previewFile.slice(previewFile.lastIndexOf('/') + 1)) }}</strong>
<p>{{ previewDoc.loadError }}</p>
<div class="rp-state-actions"><button class="btn btn-ink btn-sm" type="button" @click="retryPreview()">Retry</button><button class="btn btn-outline-ink btn-sm" type="button" @click="openPreviewFile('')">Back to the README</button></div>
</div>
<!-- The anonymized preview failed -->
<div class="rp-state rp-error" role="alert" v-else-if="previewStatus === 'error'">
<strong>Couldn't apply the redactions</strong>
<p>Unable to generate the anonymized preview. The latest redactions have not been verified.</p>
<div class="rp-state-actions"><button class="btn btn-ink btn-sm" type="button" @click="retryPreview()">Retry preview</button></div>
</div>
<div class="rp-state rp-empty" v-else-if="detectedType === 'repo' &amp;&amp; !readme &amp;&amp; previewStatus === 'idle'">
<div class="rp-state rp-empty" v-else-if="detectedType === 'repo' &amp;&amp; !previewFile &amp;&amp; !readme &amp;&amp; previewStatus === 'idle'">
<strong>No README</strong>
<p>Reviewers land on the file list. Open the files you will share and check them before sending the link.</p>
</div>
<div class="anonymize-preview-body markdown-body body" v-else-if="detectedType === 'repo' &amp;&amp; previewStatus === 'ready'" v-html="renderRedacted(sanitize(html_readme))"></div>
<partial-view v-else-if="detectedType === 'repo' &amp;&amp; previewStatus === 'ready'" name="partials/pageView.htm" :state="previewViewer"></partial-view>
<div class="anonymize-preview-body" v-else-if="detectedType === 'gist' &amp;&amp; previewStatus === 'ready'">
<div class="d-flex w-100 justify-content-between align-items-center flex-wrap">
@@ -674,13 +674,14 @@
</div>
</div>
<!-- More below: a fade with a way to keep reading (hidden by CSS once the window is scrolled to the end) -->
<div class="rp-more" v-if="previewStatus === 'ready'">
<div class="rp-more" v-if="previewStatus === 'ready' &amp;&amp; !(detectedType === 'repo' &amp;&amp; previewFile &amp;&amp; previewDoc.note)">
<a class="rp-more-btn" v-if="isUpdate &amp;&amp; previewUrl()" :href="safeUrl(previewPath())" target="_blank" rel="noopener">Continue reading on the reviewer page <span aria-hidden="true">↗</span></a>
<button type="button" class="rp-more-btn" v-else-if="!previewExpanded" @click="previewExpanded = true">Continue reading in the expanded preview</button>
<span class="rp-more-btn is-hint" v-else aria-hidden="true">Scroll for more</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
+20 -18
View File
@@ -32,6 +32,7 @@
</div>
<span class="file-card-meta" v-if="type != 'html' &amp;&amp; typeof content === 'string'"><template v-if="redactionCount()"><span class="meta-redact" :title="redactionCount() + ' redacted terms'">{{ redactionCount() }}<span class="meta-redact-word"> redacted</span></span><span class="sep">·</span></template>{{ languageName || 'Text' }}<span class="meta-extra"><span class="sep">·</span>{{ content.length &lt; 1024 ? content.length + ' B' : (content.length / 1024).toFixed(1) + ' KB' }}</span><span class="sep">·</span>{{ fmt?.number(content.split('\n').length) }} lines</span>
<span class="file-card-meta" v-if="type == 'html'"><template v-if="redactionCount()"><span class="meta-redact" :title="redactionCount() + ' redacted terms'">{{ redactionCount() }}<span class="meta-redact-word"> redacted</span></span><span class="sep">·</span></template>Markdown<template v-if="fileSize(filePath) != null"><span class="sep">·</span>{{ formatSize(fileSize(filePath)) }}</template></span>
<button type="button" class="rp-preserved-tag" v-if="preview &amp;&amp; previewPreserved()" @click="openPreserveFiles()">Left unredacted</button>
<div class="file-card-actions">
<div class="csv-toggle seg-filter" role="radiogroup" aria-label="CSV view" v-if="isCsv()"><button type="button" role="radio" class="seg-chip" :class="{ active: csvView === 'table' }" :aria-checked="csvView === 'table'" @click="csvView = 'table'">Table</button><button type="button" role="radio" class="seg-chip" :class="{ active: csvView === 'raw' }" :aria-checked="csvView === 'raw'" @click="csvView = 'raw'" title="Show the file as text with line numbers">Text</button></div>
<div class="symbols" v-if="type != 'html' &amp;&amp; symbols().length &gt; 1">
@@ -47,10 +48,10 @@
<button type="button" class="btn btn-sm btn-icon-only btn-ghost btn-toggle" v-if="type != 'html'" :class="{ 'is-on': wrapLines }" :aria-pressed="wrapLines ? 'true' : 'false'" aria-label="Wrap lines" :title="'Wrap lines (Alt+Z)'" @click="toggleWrap()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-wrap"></use></svg></button>
<button type="button" class="btn btn-sm btn-ghost btn-icon-only btn-find" v-if="type != 'html'" aria-label="Find in file" :title="'Find in file (' + (isMac ? '⌘' : 'Ctrl+') + 'F)'" @click="findInFile()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-search"></use></svg></button>
</div>
<div class="tb-file" role="group" aria-label="File actions">
<a target="_self" class="tb-seg-btn" :title="type == 'html' ? 'Open the Markdown source' : 'Open the raw file'" :href="safeUrl((url))">Raw</a>
<div class="tb-file" role="group" aria-label="File actions" v-if="!preview || url">
<a :target="preview ? '_blank' : '_self'" class="tb-seg-btn" :title="type == 'html' ? 'Open the Markdown source' : 'Open the raw file'" :href="safeUrl((url))">Raw</a>
<button type="button" class="tb-seg-btn tb-seg-icon" v-if="typeof content === 'string'" :aria-label="contentCopied ? 'Copied' : 'Copy file contents'" :title="contentCopied ? 'Copied' : 'Copy file contents'" @click="copyContent()"><svg class="ui-icon" aria-hidden="true"><use :href="contentCopied ? '#ui-icon-check' : '#project-icon-copy'"></use></svg></button>
<a target="_self" class="tb-seg-btn tb-seg-icon" aria-label="Download file" title="Download file" :href="safeUrl((url) + &quot;&amp;download=true&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg></a>
<a :target="preview ? '_blank' : '_self'" class="tb-seg-btn tb-seg-icon" aria-label="Download file" title="Download file" :href="safeUrl(downloadUrl())" :download="preview ? paths[paths.length - 1] : null"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg></a>
</div>
<button type="button" class="btn btn-sm btn-icon-only btn-ghost tb-copy-m" v-if="typeof content === 'string'" :aria-label="contentCopied ? 'Copied' : 'Copy file contents'" @click="copyContent()"><svg class="ui-icon" aria-hidden="true"><use :href="contentCopied ? '#ui-icon-check' : '#project-icon-copy'"></use></svg></button>
<div class="tb-toc-m" v-if="type == 'html' &amp;&amp; readmeToc().length &gt;= 3">
@@ -74,12 +75,12 @@
<button type="button" role="menuitemcheckbox" v-if="type != 'html'" :aria-checked="wrapLines ? 'true' : 'false'" @click="toggleWrap()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-wrap"></use></svg>Wrap lines<span class="tb-menu-check" v-if="wrapLines">✓</span></button>
<button type="button" role="menuitem" class="tb-csv-view" v-if="isCsv()" @click="csvView = csvView === 'table' ? 'raw' : 'table'; moreOpen = false"><svg class="ui-icon" aria-hidden="true"><use :href="csvView === 'table' ? '#ui-icon-code' : '#ui-icon-list'"></use></svg>{{ csvView === 'table' ? 'Show as text' : 'Show as table' }}</button>
<div class="tb-menu-sep" v-if="type != 'html'"></div>
<a role="menuitem" target="_self" v-if="type == 'html'" :href="safeUrl((url))"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-code"></use></svg>View raw</a>
<a role="menuitem" target="_self" v-if="type != 'html'" :href="safeUrl((url))"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-code"></use></svg>View raw</a>
<a role="menuitem" target="_self" :href="safeUrl((url) + &quot;&amp;download=true&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg>Download file</a>
<a role="menuitem" target="_self" v-if="options?.hasWebsite" :href="safeUrl(&quot;/w/&quot; + (repoId) + &quot;/&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-globe"></use></svg>Open website</a>
<a role="menuitem" :target="preview ? '_blank' : '_self'" v-if="type == 'html' &amp;&amp; (!preview || url)" :href="safeUrl((url))"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-code"></use></svg>View raw</a>
<a role="menuitem" :target="preview ? '_blank' : '_self'" v-if="type != 'html' &amp;&amp; (!preview || url)" :href="safeUrl((url))"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-code"></use></svg>View raw</a>
<a role="menuitem" :target="preview ? '_blank' : '_self'" v-if="!preview || url" :href="safeUrl(downloadUrl())" :download="preview ? paths[paths.length - 1] : null"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg>Download file</a>
<a role="menuitem" :target="preview ? '_blank' : '_self'" v-if="options?.hasWebsite" :href="safeUrl(&quot;/w/&quot; + (repoId) + &quot;/&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-globe"></use></svg>Open website</a>
<a role="menuitem" v-if="options?.isAdmin || options?.isOwner" :href="safeUrl(&quot;/anonymize/&quot; + (repoId))"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-edit"></use></svg>Edit anonymization</a>
<a role="menuitem" target="_self" v-if="options?.download" :href="safeUrl(&quot;/api/repo/&quot; + (repoId) + &quot;/zip&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-archive"></use></svg>Download ZIP</a>
<a role="menuitem" :target="preview ? '_blank' : '_self'" v-if="options?.download" :href="safeUrl(&quot;/api/repo/&quot; + (repoId) + &quot;/zip&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-archive"></use></svg>Download ZIP</a>
<button type="button" role="menuitem" @click="copyPath()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-link"></use></svg>Copy file path</button>
<div class="tb-menu-sep"></div>
<a role="menuitem" href="/faq"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-help"></use></svg>FAQ</a>
@@ -128,20 +129,21 @@
<button type="button" class="btn btn-sm btn-icon-only btn-ghost copy-path-btn" v-show="filePath" :aria-label="pathCopied ? 'Path copied' : 'Copy file path'" :title="pathCopied ? 'Path copied' : 'Copy file path'" @click="copyPath()"><svg class="ui-icon" aria-hidden="true"><use :href="pathCopied ? '#ui-icon-check' : '#ui-icon-link'"></use></svg></button>
</div>
<span class="file-card-meta"><template v-if="type == 'IPython' &amp;&amp; redactionCount()"><span class="meta-redact" :title="redactionCount() + ' redacted terms'">{{ redactionCount() }}<span class="meta-redact-word"> redacted</span></span><span class="sep">·</span></template>{{ fileKind() }}<template v-if="imageSize"><span class="sep">·</span>{{ imageSize }}</template><template v-if="fileSize(filePath) != null"><span class="sep">·</span>{{ formatSize(fileSize(filePath)) }}</template></span>
<button type="button" class="rp-preserved-tag" v-if="preview &amp;&amp; previewPreserved()" @click="openPreserveFiles()">Left unredacted</button>
<div class="file-card-actions">
<span class="file-card-state" v-if="type == 'error' &amp;&amp; content === 'file_too_big'" title="Files over the size limit can't be previewed or downloaded from this link"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-info"></use></svg>Over the size limit</span>
<div class="tb-file" role="group" aria-label="File actions" v-if="type != 'error'">
<a target="_self" class="tb-seg-btn" :title="type == 'IPython' ? 'Open the notebook JSON' : 'Open the raw file'" :href="safeUrl((url))">Raw</a>
<a target="_self" class="tb-seg-btn tb-seg-icon" aria-label="Download file" title="Download file" :href="safeUrl((url) + &quot;&amp;download=true&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg></a>
<div class="tb-file" role="group" aria-label="File actions" v-if="type != 'error' &amp;&amp; (!preview || url)">
<a :target="preview ? '_blank' : '_self'" class="tb-seg-btn" :title="type == 'IPython' ? 'Open the notebook JSON' : 'Open the raw file'" :href="safeUrl((url))">Raw</a>
<a :target="preview ? '_blank' : '_self'" class="tb-seg-btn tb-seg-icon" aria-label="Download file" title="Download file" :href="safeUrl(downloadUrl())" :download="preview ? paths[paths.length - 1] : null"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg></a>
</div>
<div class="tb-more">
<button type="button" class="btn btn-sm btn-icon-only btn-ghost tb-more-btn" :class="{ 'is-on': moreOpen }" aria-label="More actions" aria-haspopup="true" :aria-expanded="moreOpen ? 'true' : 'false'" @click.stop="moreOpen = !moreOpen"><svg viewBox="0 0 24 24" class="ui-icon" aria-hidden="true" style="fill:currentColor;stroke:none"><circle cx="5" cy="12" r="1.8"/><circle cx="12" cy="12" r="1.8"/><circle cx="19" cy="12" r="1.8"/></svg></button>
<div class="tb-menu" v-if="moreOpen" role="menu" @click="moreOpen = false">
<div class="tb-menu-note" v-if="options?.publishedAt || options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate"><svg class="ui-icon" aria-hidden="true"><use href="#project-icon-clock"></use></svg>Snapshot · {{ fmt?.date(options?.publishedAt || options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate) }}</div>
<div class="tb-menu-sep" v-if="options?.publishedAt || options?.sourceCommitDate || options?.anonymizedAt || options?.lastUpdateDate"></div>
<a role="menuitem" target="_self" v-if="type != 'error'" :href="safeUrl((url))"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-code"></use></svg>{{ type == 'IPython' ? 'View notebook JSON' : 'View raw' }}</a>
<a role="menuitem" target="_self" v-if="type != 'error'" :href="safeUrl((url) + &quot;&amp;download=true&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg>Download file</a>
<a role="menuitem" target="_self" v-if="options?.download" :href="safeUrl(&quot;/api/repo/&quot; + (repoId) + &quot;/zip&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-archive"></use></svg>Download ZIP</a>
<a role="menuitem" :target="preview ? '_blank' : '_self'" v-if="type != 'error' &amp;&amp; (!preview || url)" :href="safeUrl((url))"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-code"></use></svg>{{ type == 'IPython' ? 'View notebook JSON' : 'View raw' }}</a>
<a role="menuitem" :target="preview ? '_blank' : '_self'" v-if="type != 'error' &amp;&amp; (!preview || url)" :href="safeUrl(downloadUrl())" :download="preview ? paths[paths.length - 1] : null"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg>Download file</a>
<a role="menuitem" :target="preview ? '_blank' : '_self'" v-if="options?.download" :href="safeUrl(&quot;/api/repo/&quot; + (repoId) + &quot;/zip&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-archive"></use></svg>Download ZIP</a>
<button type="button" role="menuitem" @click="copyPath()"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-link"></use></svg>Copy file path</button>
<div class="tb-menu-sep"></div>
<a role="menuitem" href="/faq"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-help"></use></svg>FAQ</a>
@@ -158,15 +160,15 @@
<div class="file-state" v-if="type == 'binary'">
<svg class="ui-icon file-state-icon" aria-hidden="true"><use href="#project-icon-file"></use></svg>
<h2 class="file-state-title">No preview for this file</h2>
<p class="file-state-msg">This is a binary file. Download it to open it on your computer.</p>
<div class="file-state-actions"><a target="_self" class="btn btn-primary" :href="safeUrl((url) + &quot;&amp;download=true&quot;)"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg>Download file</a></div>
<p class="file-state-msg">{{ preview ? 'Reviewers can open this file; it is not previewed here.' : 'This is a binary file. Download it to open it on your computer.' }}</p>
<div class="file-state-actions" v-if="!preview"><a :target="preview ? '_blank' : '_self'" class="btn btn-primary" :href="safeUrl(downloadUrl())" :download="preview ? paths[paths.length - 1] : null"><svg class="ui-icon" aria-hidden="true"><use href="#ui-icon-download"></use></svg>Download file</a></div>
</div>
<div class="file-state" v-if="type == 'error'" role="alert">
<svg class="ui-icon file-state-icon" aria-hidden="true"><use href="#ui-icon-warning"></use></svg>
<h2 class="file-state-title">{{ content === 'file_too_big' ? 'This file is too large to preview' : 'This file can\'t be shown' }}</h2>
<p class="file-state-msg" v-if="content === 'file_too_big'">It is over the size limit for anonymized files, so it can't be previewed or downloaded from this link.</p>
<p class="file-state-msg" v-if="content === 'file_too_big'">{{ preview ? 'Reviewers can open this file; it is not previewed here. Files over 1 MB are only shown on the reviewer page.' : &quot;It is over the size limit for anonymized files, so it can't be previewed or downloaded from this link.&quot; }}</p>
<p class="file-state-msg" v-else>{{ fmt.translate('ERRORS.' + content) }}</p>
<div class="file-state-actions"><a class="btn btn-primary" :href="safeUrl('/r/' + repoId + '/')">Back to the repository</a><a class="btn btn-outline-ink" href="/faq#formats">Supported files</a></div>
<div class="file-state-actions" v-if="!preview"><a class="btn btn-primary" :href="safeUrl('/r/' + repoId + '/')">Back to the repository</a><a class="btn btn-outline-ink" href="/faq#formats">Supported files</a></div>
</div>
<div class="file-state" v-if="content == null &amp;&amp; type != 'error'">
<svg class="ui-icon file-state-icon" aria-hidden="true"><use href="#project-icon-file"></use></svg>
+305 -761
View File
File diff suppressed because it is too large. Load diff
+712
View File
@@ -0,0 +1,712 @@
import { nextTick, markRaw } from "vue";
import { createTimers, createListeners } from "./state.js";
import { slotRedactions } from "./app.js";
// Used by the reviewer page and the author's preview with pageView.htm.
export const setupFileViewer = function (state, events = state) {
const REDACTION_RE = /\bXXXX-\d+\b/g;
events.on("dark-mode", (event, on) => {
if (state.aceOption) state.aceOption.theme = on ? "nord_dark" : "chrome";
});
const timers = createTimers();
const listen = createListeners();
state.isMac = /Mac|iPhone|iPad|iPod/.test(navigator.platform || navigator.userAgent);
const extensionModes = {
yml: "yaml",
txt: "text",
py: "python",
js: "javascript",
ts: "typescript",
};
const textFiles = ["license", "txt"];
const imageFiles = [
"png",
"jpg",
"jpeg",
"gif",
"svg",
"ico",
"bmp",
"tiff",
"tif",
"webp",
"avif",
"heif",
"heic",
];
const audioFiles = ["wav", "mp3", "ogg", "wma", "flac", "aac", "m4a"];
const mediaFiles = [
"mp4",
"avi",
"webm",
"mov",
"mpg",
"mpeg",
"mkv",
"flv",
"wmv",
"3gp",
"3g2",
"m4v",
"f4v",
"f4p",
"f4a",
"f4b",
];
// Defined as methods rather than inline `showSource = !showSource` in the
// template: the toolbar and the file view sit in different child scopes,
// so an inline assignment would shadow the value on one of them instead
// of updating the controller's.
state.toggleSource = function () {
state.showSource = !state.showSource;
};
state.toggleAllowScripts = function () {
state.allowScripts = !state.allowScripts;
};
// Wrap on wide screens; on phones code scrolls sideways so tokens stay intact.
const storedWrap = (() => { try { return window.localStorage?.getItem("wrapLines"); } catch { return null; } })();
state.wrapLines = (storedWrap ?? (window.matchMedia?.("(max-width: 767px)").matches ? "false" : "true")) !== "false";
state.toggleWrap = function () {
state.wrapLines = !state.wrapLines;
try { window.localStorage?.setItem("wrapLines", String(state.wrapLines)); } catch { /* storage unavailable */ }
state.codeEditor?.session.setUseWrapMode(state.wrapLines);
};
// Find opens as an overlay at the top right of the code, like an editor.
// Find on rendered Markdown pages: highlight matches inside the reading column.
function mdFindRoot() { return window.document.querySelector(".reading-layout .markdown-body"); }
function clearMdFind() {
const root = mdFindRoot();
if (!root) return;
root.querySelectorAll("mark.md-find").forEach((m) => { m.replaceWith(window.document.createTextNode(m.textContent)); });
root.normalize();
}
state.runMdFind = function () {
clearMdFind();
state.mdFindTotal = 0;
state.mdFindIndex = 0;
const q = (state.mdFindQuery || "").trim();
const root = mdFindRoot();
if (!q || !root) return;
const cs = !!state.mdFindCase;
const needle = cs ? q : q.toLowerCase();
const walker = window.document.createTreeWalker(root, 4);
const nodes = [];
while (walker.nextNode()) if ((cs ? walker.currentNode.nodeValue : walker.currentNode.nodeValue.toLowerCase()).includes(needle)) nodes.push(walker.currentNode);
let total = 0;
for (const node of nodes) {
const text = node.nodeValue, lower = cs ? text : text.toLowerCase();
const frag = window.document.createDocumentFragment();
let last = 0, i;
while ((i = lower.indexOf(needle, last)) !== -1) {
frag.appendChild(window.document.createTextNode(text.slice(last, i)));
const m = window.document.createElement("mark");
m.className = "md-find";
m.textContent = text.slice(i, i + q.length);
frag.appendChild(m);
total++;
last = i + q.length;
}
frag.appendChild(window.document.createTextNode(text.slice(last)));
node.parentNode.replaceChild(frag, node);
}
state.mdFindTotal = total;
if (total) state.stepMdFind(0);
};
state.stepMdFind = function (delta) {
const root = mdFindRoot();
if (!root || !state.mdFindTotal) return;
const marks = root.querySelectorAll("mark.md-find");
state.mdFindIndex = (state.mdFindIndex + delta + marks.length) % marks.length;
marks.forEach((m, i) => m.classList.toggle("is-current", i === state.mdFindIndex));
marks[state.mdFindIndex]?.scrollIntoView({ block: "center", behavior: "smooth" });
};
state.toggleMdFind = function (open) {
state.mdFindOpen = open === undefined ? !state.mdFindOpen : open;
if (!state.mdFindOpen) { clearMdFind(); state.mdFindTotal = 0; return; }
nextTick(() => window.document.querySelector(".md-find-input")?.focus());
};
state.findInFile = function () {
const editor = state.codeEditor;
if (!editor) return;
editor.focus();
editor.execCommand("find");
// Docked under the toolbar: push the code down while the find bar is open.
const dock = () => {
const box = editor.searchBox?.element;
if (!box) return;
editor.renderer.setScrollMargin(52, 12, 0, 0);
if (box._dockObserver) return;
box._dockObserver = new MutationObserver(() => {
editor.renderer.setScrollMargin(box.style.display !== "none" ? 52 : 12, 12, 0, 0);
});
box._dockObserver.observe(box, { attributes: true, attributeFilter: ["style"] });
};
dock();
setTimeout(dock, 150);
};
// Lightweight outline: top-level classes, functions and exported constants.
const symbolPatterns = [
[/^\s*(?:export\s+)?(?:default\s+)?(?:abstract\s+)?class\s+([A-Za-z_$][\w$]*)/, "class"],
[/^\s*(?:export\s+)?(?:default\s+)?(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)/, "function"],
[/^\s*(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*=\s*(?:async\s*)?(?:function|\([^)]*\)\s*=>|[A-Za-z_$][\w$]*\s*=>)/, "function"],
[/^\s*(?:async\s+)?def\s+([A-Za-z_]\w*)/, "function"],
[/^\s*class\s+([A-Za-z_]\w*)/, "class"],
[/^\s*func\s+(?:\([^)]*\)\s*)?([A-Za-z_]\w*)/, "function"],
[/^\s*(?:pub\s+)?fn\s+([A-Za-z_]\w*)/, "function"],
[/^\s*(?:public|private|protected|static|\s)+[\w<>\[\],\s]+\s+([A-Za-z_]\w*)\s*\([^;]*\)\s*\{?\s*$/, "function"],
];
let symbolCache = { content: null, list: [] };
state.symbolsOpen = false;
state.symbols = function () {
if (typeof state.content !== "string" || state.content.length > 2_000_000) return [];
if (symbolCache.content === state.content) return symbolCache.list;
const list = [];
state.content.split("\n").forEach((text, index) => {
for (const [re, kind] of symbolPatterns) {
const m = re.exec(text);
if (m && !/^(if|for|while|switch|return|catch)$/.test(m[1])) { list.push({ name: m[1], kind, line: index + 1 }); break; }
}
});
symbolCache = { content: state.content, list: list.slice(0, 300) };
return symbolCache.list;
};
state.goToSymbol = function (line) {
state.symbolsOpen = false;
const editor = state.codeEditor;
if (!editor) return;
editor.scrollToLine(line - 1, true, true, () => {});
editor.gotoLine(line, 0, true);
window.history.replaceState(null, "", window.location.pathname + window.location.search + "#L" + line);
window.dispatchEvent(new HashChangeEvent("hashchange"));
};
// Go to line: a small popover in the file header (Ace's own prompt ignores the site theme).
state.gotoLine = function () {
if (!state.codeEditor) return;
state.moreOpen = false;
state.gotoError = "";
state.gotoValue = String(state.codeEditor.getCursorPosition().row + 1);
state.gotoOpen = true;
setTimeout(() => { const el = window.document.getElementById("goto-input"); if (el) { el.focus(); el.select(); } }, 0);
};
state.closeGoto = function () {
state.gotoOpen = false;
state.gotoError = "";
state.codeEditor?.focus();
};
state.submitGoto = function () {
const editor = state.codeEditor;
if (!editor) return;
const m = /^\s*:?\s*(\d+)\s*(?:[:,]\s*(\d+))?\s*$/.exec(state.gotoValue || "");
const lines = editor.session.getLength();
if (!m || +m[1] < 1 || +m[1] > lines) { state.gotoError = "Enter a line from 1 to " + lines; return; }
editor.gotoLine(+m[1], m[2] ? Math.max(0, +m[2] - 1) : 0, true);
state.gotoOpen = false;
state.gotoError = "";
editor.focus();
};
// Root listing above the README: folders first, then files.
state.rootEntries = function () {
return [...(state.files || [])].sort((a, b) => {
const af = a.size == null, bf = b.size == null;
if (af !== bf) return af ? -1 : 1;
return a.name.localeCompare(b.name);
});
};
state.formatSize = function (bytes) {
if (bytes == null) return "";
if (bytes < 1024) return bytes + " B";
const kb = bytes / 1024;
const one = (n) => n.toFixed(1).replace(/\.0$/, "");
return kb < 1024 ? one(kb) + " KB" : kb < 1024 * 1024 ? one(kb / 1024) + " MB" : one(kb / 1024 / 1024) + " GB";
};
state.fileSize = function (path) {
if (!path) return null;
const clean = path.replace(/^\/+/, "");
const entry = (state.files || []).find((f) => (f.path ? f.path + "/" : "") + f.name === clean);
return entry && entry.size != null ? entry.size : null;
};
state.revealFolder = function (name) {
state.sidebarHidden = false;
state.sidebarCollapsed = false;
nextTick(() => {
const link = window.document.querySelector('.files a[data-path="/' + (window.CSS?.escape ? window.CSS.escape(name) : name) + '"]');
if (!link) return;
if (!link.closest("li")?.classList.contains("open")) link.click();
link.scrollIntoView({ block: "nearest" });
link.focus();
});
};
// Notebooks: count the same markers in cell sources and text outputs (not in the JSON keys or image data).
let nbCount = { content: null, n: 0 };
const notebookRedactions = (content) => {
if (nbCount.content === content) return nbCount.n;
let nb = content;
if (typeof nb === "string") { try { nb = JSON.parse(nb); } catch { nb = null; } }
const texts = [];
const add = (v) => { if (Array.isArray(v)) texts.push(v.join("")); else if (typeof v === "string") texts.push(v); };
((nb && (nb.cells || (nb.worksheets || []).flatMap((w) => w.cells || []))) || []).forEach((cell) => {
add(cell?.source ?? cell?.input);
(cell?.outputs || []).forEach((o) => {
add(o?.text);
if (o?.data) { add(o.data["text/plain"]); add(o.data["text/markdown"]); add(o.data["text/html"]); }
add(o?.traceback);
});
});
const n = texts.reduce((sum, t) => sum + (t.match(REDACTION_RE) || []).length, 0);
nbCount = { content, n };
return n;
};
state.redactionCount = function () {
if (state.type === "IPython") return notebookRedactions(state.content);
if (typeof state.content !== "string") return 0;
const text = state.type === "html" ? state.content.replace(/<[^>]*>/g, " ") : state.content;
return (text.match(REDACTION_RE) || []).length;
};
state.renderRedacted = slotRedactions;
// Reading mode: slugged heading ids + an "On this page" outline (like Mintlify/Stripe docs).
const slug = (t) => t.toLowerCase().trim().replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").slice(0, 60) || "section";
state.renderReadme = function (html) {
const out = state.renderRedacted(html);
if (!out || typeof window.DOMParser !== "function") return out;
const doc = new window.DOMParser().parseFromString("<div>" + out + "</div>", "text/html");
const seen = {};
doc.querySelectorAll("h1, h2, h3").forEach((h) => {
let id = h.id || slug(h.textContent);
if (seen[id]) id += "-" + (++seen[id]); else seen[id] = 1;
h.id = id;
});
return doc.body.firstChild.innerHTML;
};
let tocCache = { content: null, list: [] };
state.readmeToc = function () {
if (state.type !== "html" || typeof state.content !== "string") return [];
if (tocCache.content === state.content) return tocCache.list;
const doc = new window.DOMParser().parseFromString("<div>" + state.renderReadme(state.sanitize ? state.sanitize(state.content) : state.content) + "</div>", "text/html");
const list = [...doc.querySelectorAll("h2, h3")].map((h) => ({ id: h.id, text: h.textContent.trim(), level: h.tagName === "H3" ? 3 : 2 })).slice(0, 40);
tocCache = { content: state.content, list };
return list;
};
state.activeHeading = null;
listen(window, "scroll", () => {
const toc = state.readmeToc ? state.readmeToc() : [];
if (!toc.length) return;
// Active = the first heading visible below the sticky chrome; if none is on screen,
// the last heading already scrolled past (the reader is inside that section).
const chrome = 150;
let current = "", firstVisible = "";
for (const h of toc) {
const el = window.document.getElementById(h.id);
if (!el) continue;
const top = el.getBoundingClientRect().top;
if (top < chrome) current = h.id;
else if (!firstVisible && top < window.innerHeight - 80) firstVisible = h.id;
}
if (firstVisible) current = firstVisible;
if (state.activeHeading !== current) state.activeHeading = current;
}, { capture: true, passive: true });
state.scrollToHeading = function (id) {
if (!id) {
const sc = window.document.querySelector(".explorer-content, .file-card-body, .main-pane");
(sc || window).scrollTo({ top: 0, behavior: "smooth" });
state.activeHeading = "";
return;
}
const el = window.document.getElementById(id);
if (el) el.scrollIntoView({ behavior: "smooth", block: "start" });
state.activeHeading = id;
};
// CSV/TSV files up to 1 MB render as a table (sticky header, rules, tabular
// figures) with a Raw toggle back to the code view.
state.csvView = "table";
let csvCache = { content: null, rows: [] };
const parseDelimited = (text, sep) => {
const rows = [];
let row = [], cell = "", quoted = false;
for (let i = 0; i < text.length; i++) {
const ch = text[i];
if (quoted) {
if (ch === '"') { if (text[i + 1] === '"') { cell += '"'; i++; } else quoted = false; }
else cell += ch;
} else if (ch === '"' && cell === "") quoted = true;
else if (ch === sep) { row.push(cell); cell = ""; }
else if (ch === "\n" || ch === "\r") {
if (ch === "\r" && text[i + 1] === "\n") i++;
row.push(cell); rows.push(row); row = []; cell = "";
} else cell += ch;
}
if (cell !== "" || row.length) { row.push(cell); rows.push(row); }
return rows.filter((r) => r.length > 1 || r[0] !== "");
};
state.isCsv = () => typeof state.content === "string" && state.type !== "html"
&& /\.(csv|tsv)$/i.test(state.filePath || "") && state.content.length <= 1024 * 1024;
state.csvRows = () => {
if (csvCache.content !== state.content) {
const sep = /\.tsv$/i.test(state.filePath || "") ? "\t" : ",";
csvCache = { content: state.content, rows: parseDelimited(state.content, sep) };
}
return csvCache.rows;
};
state.csvNumCol = (ci) => {
const rows = state.csvRows().slice(1).map((r) => r[ci]).filter((v) => v != null && String(v).trim() !== "");
return rows.length > 0 && rows.every((v) => state.csvNumeric(v));
};
state.csvNumeric = (value) => /^\s*[-+]?(\d[\d,]*)?(\.\d+)?(e[-+]?\d+)?%?\s*$/i.test(value) && /\d/.test(value);
state.redactParts = function (text) {
const out = []; let last = 0; let m; const re = /\bXXXX-(\d+)\b/g;
text = String(text || "");
while ((m = re.exec(text))) { if (m.index > last) out.push({ t: text.slice(last, m.index) }); out.push({ n: m[1] }); last = m.index + m[0].length; }
if (last < text.length) out.push({ t: text.slice(last) });
return out;
};
state.pathCopied = false;
state.copyPath = async function () {
if (!window.navigator.clipboard?.writeText) return;
await window.navigator.clipboard.writeText(state.filePath || "");
state.pathCopied = true;
setTimeout(() => { state.pathCopied = false; }, 1600);
};
state.contentCopied = false;
state.copyContent = async function () {
if (typeof state.content !== "string" || !window.navigator.clipboard?.writeText) return;
// Rendered Markdown: copy the source, not the HTML.
let text = state.content;
if (state.type === "html" && state.url) {
if (state.preview) text = state.sourceContent;
else try { text = await (await window.fetch(state.url, { credentials: "same-origin" })).text(); } catch (_) { return; }
}
await window.navigator.clipboard.writeText(text);
state.contentCopied = true;
setTimeout(() => { state.contentCopied = false; }, 1600);
};
function getMode(extension) {
if (extensionModes[extension]) {
return extensionModes[extension];
}
return extension;
}
function getType(extension) {
if (extension == "pdf") {
return "pdf";
}
// Rendered as a document in a sandboxed frame rather than as source —
// see html-doc.js. "html" is reserved for markup we generated
// ourselves (rendered markdown/org) and inject directly.
if (extension == "html" || extension == "htm") {
return "html-doc";
}
if (["md", "markdown", "mdown", "mkdn", "mdx"].includes(extension)) {
return "md";
}
if (extension == "org") {
return "org";
}
if (extension == "ipynb") {
return "IPython";
}
if (textFiles.indexOf(extension) > -1) {
return "text";
}
if (imageFiles.indexOf(extension) > -1) {
return "image";
}
if (mediaFiles.indexOf(extension) > -1) {
return "media";
}
if (audioFiles.indexOf(extension) > -1) {
return "audio";
}
return "code";
}
state.downloadUrl = () => state.preview ? state.url : state.url + "&download=true";
state.prepareFile = function (path) {
state.showSource = false;
state.allowScripts = false;
state.imageSize = "";
state.filePath = path;
state.paths = path.split("/").filter(Boolean);
let extension = state.filePath.toLowerCase();
const extensionIndex = extension.lastIndexOf(".");
if (extensionIndex > -1) {
extension = extension.substring(extensionIndex + 1);
}
const languageNames = { 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: "" };
const detectedMode = getMode(extension);
state.languageName = languageNames[detectedMode] ?? (detectedMode ? detectedMode.charAt(0).toUpperCase() + detectedMode.slice(1) : "");
state.aceOption = {
readOnly: true,
useWrapMode: true,
showGutter: true,
theme: "chrome",
useSoftTab: true,
tabSize: 2,
fontSize: window.matchMedia?.("(max-width: 767px)").matches ? 12 : 13,
keyBinding: "vscode",
fullLineSelection: true,
highlightActiveLine: false,
highlightGutterLine: false,
cursor: "hide",
showInvisibles: false,
showIndentGuides: false,
showPrintMargin: false,
highlightSelectedWord: false,
enableBehaviours: true,
fadeFoldWidgets: false,
mode: getMode(extension),
onLoad: function (_editor) {
state.codeEditor = markRaw(_editor);
{
// Render each XXXX-n as its own "redacted" token so the text layer
// draws it exactly like the Markdown chip (teal text on a teal tint).
const session = _editor.session;
const origGetTokens = session.getTokens.bind(session);
const re = /\bXXXX-\d+\b/g;
session.getTokens = function (row) {
const tokens = origGetTokens(row);
if (!tokens.some((t) => t.value.indexOf("XXXX-") !== -1)) return tokens;
const out = [];
for (const t of tokens) {
if (t.value.indexOf("XXXX-") === -1) { out.push(t); continue; }
let last = 0;
re.lastIndex = 0;
let m;
while ((m = re.exec(t.value))) {
if (m.index > last) out.push({ type: t.type, value: t.value.slice(last, m.index) });
out.push({ type: "redacted.n" + m[0].slice(5), value: m[0] });
last = m.index + m[0].length;
}
if (last < t.value.length) out.push({ type: t.type, value: t.value.slice(last) });
}
return out;
};
// Each redacted token shows its term number inside the slot.
if (!window.document.getElementById("redact-index-rules")) {
const st = window.document.createElement("style");
st.id = "redact-index-rules";
st.textContent = Array.from({ length: 99 }, (_, i) => `.ace_redacted.ace_n${i + 1}::after{content:"${i + 1}"}`).join("");
window.document.head.appendChild(st);
}
_editor.renderer.updateFull(true);
}
_editor.session.setUseWrapMode(state.wrapLines !== false);
// The right-edge fade is a cue only while there is more code to the right.
const card = _editor.container.closest?.(".file-card");
const syncEdge = () => {
if (!card) return;
const r = _editor.renderer;
const max = (r.layerConfig?.width || 0) - (r.$size?.scrollerWidth || 0);
card.classList.toggle("at-right-edge", max <= 2 || r.getScrollLeft() >= max - 2);
};
_editor.session.on("changeScrollLeft", syncEdge);
_editor.renderer.on("afterRender", syncEdge);
// On phones code scrolls sideways; keep the scrollbar visible as a cue.
if (window.matchMedia?.("(max-width: 767px)").matches) _editor.setOption("hScrollBarAlwaysVisible", true);
const Range = ace.require("ace/range").Range;
let activeLineMarker = null;
function highlightLines(from, to) {
if (activeLineMarker !== null) {
_editor.session.removeMarker(activeLineMarker);
activeLineMarker = null;
}
if (from === null || from === undefined) return;
activeLineMarker = _editor.session.addMarker(
new Range(from, 0, to, 1),
"highlighted-line",
"fullLine"
);
}
function applyHashFromUrl(scroll) {
const m = !state.preview && window.location.hash.match(/^#L(\d+)(?:-L(\d+))?/);
if (!m) {
highlightLines(null);
return;
}
const from = parseInt(m[1]) - 1;
const to = m[2] ? parseInt(m[2]) - 1 : from;
highlightLines(from, to);
if (scroll) {
timers.timeout(() => {
_editor.scrollToLine(from, true, true, function () {});
}, 100);
}
}
applyHashFromUrl(true);
// #392 — clicking a gutter line updates the URL to #L<n> and
// shift-clicking extends to #L<from>-L<to> so the user can copy
// a stable link to a specific line. Use replaceState to avoid
// polluting history with every click.
let anchorRow = null;
_editor.on("guttermousedown", function (e) {
const row = e.getDocumentPosition().row;
const shift = e.domEvent && e.domEvent.shiftKey;
let from = row;
let to = row;
if (shift && anchorRow !== null) {
from = Math.min(anchorRow, row);
to = Math.max(anchorRow, row);
} else {
anchorRow = row;
}
const hash =
from === to
? `#L${from + 1}`
: `#L${from + 1}-L${to + 1}`;
const url =
window.location.pathname + window.location.search + hash;
// The preview highlights lines without touching the form's URL.
if (!state.preview) window.history.replaceState(null, "", url);
highlightLines(from, to);
e.stop();
});
const removeHashListener = listen(window, "hashchange", () => applyHashFromUrl(false));
_editor.setFontSize(state.aceOption.fontSize);
_editor.setOptions({
fontFamily: "'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace",
});
_editor.container.style.lineHeight = "20px";
_editor.renderer.setPadding(16);
_editor.renderer.setScrollMargin(12, 12, 0, 0);
_editor.renderer.updateFontSize();
_editor.setReadOnly(state.aceOption.readOnly);
_editor.setKeyboardHandler(state.aceOption.keyBinding);
_editor.setSelectionStyle(
state.aceOption.fullLineSelection ? "line" : "text"
);
_editor.setOption("displayIndentGuides", false);
_editor.setHighlightActiveLine(
state.aceOption.highlightActiveLine
);
if (state.aceOption.cursor == "hide") {
_editor.renderer.$cursorLayer.element.style.display = "none";
}
_editor.setHighlightGutterLine(
state.aceOption.highlightGutterLine
);
_editor.setShowInvisibles(state.aceOption.showInvisibles);
_editor.setDisplayIndentGuides(state.aceOption.showIndentGuides);
_editor.renderer.setShowPrintMargin(
state.aceOption.showPrintMargin
);
_editor.setHighlightSelectedWord(
state.aceOption.highlightSelectedWord
);
_editor.session.setUseSoftTabs(state.aceOption.useSoftTab);
_editor.session.setTabSize(state.aceOption.tabSize);
_editor.setBehavioursEnabled(state.aceOption.enableBehaviours);
_editor.setFadeFoldWidgets(state.aceOption.fadeFoldWidgets);
// Ctrl/Cmd+F searches inside the file (Ace searchbox), like GitHub's blob view.
// In the preview the shortcuts apply only while the code has focus, so
// the form keeps the browser's own Find.
const ownsShortcuts = () => !state.preview || _editor.isFocused();
const removeFindListener = listen(window, "keydown", (event) => {
if ((event.ctrlKey || event.metaKey) && !event.altKey && event.key.toLowerCase() === "g" && document.body.contains(_editor.container) && ownsShortcuts()) {
event.preventDefault();
state.gotoLine();
return;
}
if (event.altKey && !event.ctrlKey && !event.metaKey && event.key.toLowerCase() === "z" && document.body.contains(_editor.container) && ownsShortcuts()) {
event.preventDefault();
state.toggleWrap();
return;
}
if ((event.ctrlKey || event.metaKey) && !event.altKey && event.key.toLowerCase() === "f" && document.body.contains(_editor.container) && ownsShortcuts()) {
event.preventDefault();
state.findInFile();
}
});
return () => { removeHashListener(); removeFindListener(); };
},
};
if (state.isDarkMode) {
state.aceOption.theme = "nord_dark";
}
state.type = getType(extension);
};
state.renderFileContent = function (content, type, baseUrl, contentType) {
state.type = type;
state.content = content;
state.sourceContent = content;
if (state.content == "") {
state.content = null;
}
if (state.type == "md") {
state.content = renderMD(content, baseUrl);
state.type = "html";
}
if (state.type == "org") {
const orgSource = contentAbs2Relative(content);
const orgParser = new Org.Parser();
const orgDocument = orgParser.parse(orgSource);
var orgHTMLDocument = orgDocument.convert(Org.ConverterHTML, {
headerOffset: 1,
exportFromLineNumber: false,
suppressSubScriptHandling: true,
suppressAutoLink: false,
});
state.content = DOMPurify.sanitize(orgHTMLDocument.toString());
state.type = "html";
}
if (
state.type == "code" &&
contentType == "application/octet-stream"
) {
state.type = "binary";
state.content = "binary";
}
timers.timeout(() => { Prism.highlightAll(); }, 50);
};
// Files without a text body (media, notebooks, binaries, empty files and
// per-file errors) share the code view's framed card and header.
const FRAMED_TYPES = ["image", "media", "audio", "pdf", "IPython", "binary"];
const FILE_ERRORS = ["file_too_big", "file_not_found", "file_not_accessible", "file_not_supported", "folder_not_supported"];
state.fileFrame = () => {
if (!state.filePath) return false;
if (FRAMED_TYPES.includes(state.type)) return state.content != null;
if (state.type === "error") return FILE_ERRORS.includes(state.content);
return state.content == null && ["code", "text"].includes(state.type);
};
state.fileKind = () => {
const name = (state.paths || [])[(state.paths || []).length - 1] || "";
const dot = name.lastIndexOf(".");
const ext = dot > 0 ? name.slice(dot + 1).toUpperCase() : "";
if (state.type === "image") return (ext === "JPG" ? "JPEG" : ext) + " image";
const MEDIA_NAMES = { WEBM: "WebM", OGG: "Ogg", OGV: "Ogg", MOV: "QuickTime", M4V: "M4V", MKV: "Matroska" };
if (state.type === "media") return (MEDIA_NAMES[ext] || ext) + " video";
if (state.type === "audio") return ext + " audio";
if (state.type === "pdf") return "PDF";
if (state.type === "IPython") return "Jupyter notebook";
if (state.type === "binary") return "Binary file";
return state.languageName || (ext ? ext + " file" : "File");
};
state.imageSize = "";
state.onImageLoad = (event) => {
const img = event.target;
if (img?.naturalWidth) state.imageSize = `${img.naturalWidth} × ${img.naturalHeight}`;
};
// The reviewer page closes its menus in exploreController; this is the preview's.
listen(document, "click", e => {
if (!state.preview) return;
if (!e.target.closest?.(".symbols")) state.symbolsOpen = false;
if (!e.target.closest?.(".tb-more")) state.moreOpen = false;
if (!e.target.closest?.(".tb-toc-m")) state.tocOpen = false;
if (e.target.isConnected && !e.target.closest?.(".goto-pop, .btn-goto, .tb-more")) state.gotoOpen = false;
});
};
+1 -1
View File
@@ -143,7 +143,7 @@ export function mountApplication(target = "#app", options = {}) {
if (/^\/(r|repository|anonymize|pull-request-anonymize|gist-anonymize|pr|gist)(\/|$)/.test(to.path)) {
await loadLibrary("markdown");
}
if (/^\/(r|repository)\//.test(to.path)) await loadLibrary("org");
if (/^\/(r|repository|anonymize|pull-request-anonymize|gist-anonymize|pr|gist)(\/|$)/.test(to.path)) await loadLibrary("org");
});
router.afterEach(to => {
if (!root) return;
+25 -7
View File
@@ -59,15 +59,16 @@ export function fileHierarchy(files) {
export default {
name: "FileTree",
props: ["file", "parent", "searchQuery", "searchResults", "page"],
setup(props) {
props: ["file", "parent", "searchQuery", "searchResults", "page", "selectedPath"],
emits: ["select"],
setup(props, { emit }) {
const route = useRoute();
const host = ref(null);
const opens = reactive(Object.create(null));
let focusedPath = null;
const hierarchy = computed(() => fileHierarchy(props.file));
const selectedPath = () => "/" + (Array.isArray(route.params.path) ? route.params.path.join("/") : route.params.path || "");
watch(() => [route.params.repoId, route.params.path], () => {
const selectedPath = () => props.selectedPath ?? "/" + (Array.isArray(route.params.path) ? route.params.path.join("/") : route.params.path || "");
watch(() => [route.params.repoId, route.params.path, props.selectedPath], () => {
let path = "";
selectedPath().split("/").filter(Boolean).forEach(part => { path += "/" + part; opens[path] = true; });
}, { immediate: true });
@@ -87,8 +88,19 @@ export default {
if (!link) return;
focusedPath = link.dataset.path;
link.classList.add("tree-focused");
link.scrollIntoView?.({ block: "nearest" });
host.value.focus();
if (props.selectedPath === undefined) {
link.scrollIntoView?.({ block: "nearest" });
host.value.focus();
return;
}
// Embedded (the anonymize preview): scroll only the tree, never the page.
const scroller = host.value.scrollHeight > host.value.clientHeight ? host.value : host.value.closest(".leftCol-body");
if (scroller) {
const row = link.getBoundingClientRect(), bounds = scroller.getBoundingClientRect();
if (row.top < bounds.top) scroller.scrollTop -= bounds.top - row.top;
else if (row.bottom > bounds.bottom) scroller.scrollTop += row.bottom - bounds.bottom;
}
host.value.focus({ preventScroll: true });
};
function keyboard(event) {
const links = visibleLinks();
@@ -151,7 +163,10 @@ export default {
splitName ? [h("span", { class: { "tree-name-head": true, "is-cut": !!middle } }, redactedNodes(head)), middle ? h("span", { class: "tree-name-middle" }, middle) : null, h("span", { class: "tree-name-tail" }, tail)] : breakableNodes(name));
const onClick = event => {
focus(event.currentTarget);
if (!folder) return;
if (!folder) {
if (props.selectedPath !== undefined) { event.preventDefault(); emit("select", path); }
return;
}
event.preventDefault();
opens[path] = !open;
if (opens[path] && !node.children.length) props.page.getFiles(path.slice(1));
@@ -159,6 +174,9 @@ export default {
};
const link = h("a", {
"data-path": path,
// Embedded only: the reviewer page's markup stays as it was.
"aria-expanded": props.selectedPath !== undefined && folder ? String(open) : undefined,
"aria-current": props.selectedPath !== undefined && !folder && selectedPath() === path ? "page" : undefined,
href: folder ? undefined : `/r/${encodeURIComponent(route.params.repoId)}${encodePathForUrl(path)}`,
class: { "tree-focused": focusedPath === path },
onClick,
+51 -46
View File
@@ -1,51 +1,52 @@
"use strict";(()=>{var Oa=Object.defineProperty;var Ia=e=>{throw TypeError(e)};var Ep=(e,t,o)=>t in e?Oa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var Sp=(e,t)=>{for(var o in t)Oa(e,o,{get:t[o],enumerable:!0})};var Je=(e,t,o)=>Ep(e,typeof t!="symbol"?t+"":t,o),Yi=(e,t,o)=>t.has(e)||Ia("Cannot "+o);var ae=(e,t,o)=>(Yi(e,t,"read from private field"),o?o.call(e):t.get(e)),qe=(e,t,o)=>t.has(e)?Ia("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),Ue=(e,t,o,i)=>(Yi(e,t,"write to private field"),i?i.call(e,o):t.set(e,o),o),$e=(e,t,o)=>(Yi(e,t,"access private method"),o);var Ma=(e,t,o,i)=>({set _(s){Ue(e,t,s,o)},get _(){return ae(e,t,i)}});var ve=["abap","abc","actionscript","ada","alda","apache_conf","apex","applescript","aql","asciidoc","asl","assembly_x86","autohotkey","batchfile","c9search","c_cpp","cirru","clojure","cobol","coffee","coldfusion","crystal","csharp","csound_document","csound_orchestra","csound_score","csp","css","curly","d","dart","diff","django","dockerfile","dot","drools","edifact","eiffel","ejs","elixir","elm","erlang","forth","fortran","fsharp","fsl","ftl","gcode","gherkin","gitignore","glsl","gobstones","golang","graphqlschema","groovy","haml","handlebars","haskell","haskell_cabal","haxe","hjson","html","html_elixir","html_ruby","ini","io","jack","jade","java","javascript","json","json5","jsoniq","jsp","jssm","jsx","julia","kotlin","latex","less","liquid","lisp","livescript","logiql","logtalk","lsl","lua","luapage","lucene","makefile","markdown","mask","matlab","maze","mediawiki","mel","mixal","mushcode","mysql","nginx","nim","nix","nsis","nunjucks","objectivec","ocaml","pascal","perl","perl6","pgsql","php","php_laravel_blade","pig","plain_text","powershell","praat","prisma","prolog","properties","protobuf","puppet","python","qml","r","razor","rdoc","red","redshift","rhtml","rst","ruby","rust","sass","scad","scala","scheme","scss","sh","sjs","slim","smarty","snippets","soy_template","space","sparql","sql","sqlserver","stylus","svg","swift","tcl","terraform","tex","text","textile","toml","tsx","turtle","twig","typescript","vala","vbscript","velocity","verilog","vhdl","visualforce","wollok","xml","xquery","yaml","zeek"];var ye={markdown:"/script/markdown.6c8dfb7b1d.min.js",notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",editor:"/script/editor.4f142d3adc.min.js"};function _a(e){let t=e.location.hash.slice(1);if(e.history.replaceState(null,"","/review-link"),t.length>2048)return null;let o=new URLSearchParams(t);if([...o.keys()].length!==3||[...o.keys()].some(a=>!["clientId","intentId","token"].includes(a)))return null;let i=o.get("clientId"),s=o.get("intentId"),r=o.get("token");return!/^[a-f0-9]{32}$/.test(i||"")||!/^[a-f0-9]{32}$/.test(s||"")||!/^[a-f0-9]{64}$/.test(r||"")?null:{contract:"4open.artifacts/1",clientId:i,intentId:s,token:r}}function Va(e,t){let{http:o,promises:i,window:s}=t,r=t.takeReviewHandoff(),a=r?{clientId:r.clientId,intentId:r.intentId}:null,u,p,y,h,b,m=!0,w,A=i.defer(),S=()=>[...s.crypto.getRandomValues(new Uint8Array(16))].map(V=>V.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 R=()=>m&&e.user?.username===b;function g(){m=!1,r=u=p=void 0,A.resolve(),s.clearTimeout(w)}e.on("dispose",g),e.on("routeLeave",g),e.watch(()=>e.user?.username,V=>{!b&&V?b=V:b&&V!==b&&(g(),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 C=()=>({timeout:A.promise,headers:{"Content-Type":"application/json","X-Review-CSRF":p}}),M=V=>V?.status===404?"Artifact linking is not available on this server.":V?.status===401?"Sign in, then open a new artifact link from your submission.":V?.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;b=e.user.username;let V=e.repositoryId.trim();if(!/^[A-Za-z0-9_-]{3,128}$/.test(V)){e.error="Enter the anonymous repository ID from its URL.";return}e.busy=!0,e.error="",e.preview=null,u=void 0,e.acceptAccess=e.acceptRetention=!1,e.expired=!1,s.clearTimeout(w),h||(h=S());try{let q=(await o.get("/api/review-consent/csrf",{timeout:A.promise})).data;if(!R())return;if(p=q.csrf,e.handoffEnabled=q.handoffEnabled===!0,!/^[a-f0-9]{64}$/.test(p||""))throw new Error("invalid_csrf");let j=(await o.post("/api/review-consent/preview",{repositoryId:V,intent:{...r,requestId:h}},C())).data;if(!R())return;if(!j||typeof j.ticket!="string"||!j.ticket||j.ticket.length>8192||typeof j.repositoryName!="string"||!["restricted-review","anonymous-link"].iLine truncated
`))),e[un]=Do(s);let r=i||s.props&&s.props.type==="number";An(e,t?"change":"input",a=>{a.target.composing||e[un](_r(e.value,o,r))}),(o||r)&&An(e,"change",()=>{e.value=_r(e.value,o,r)}),t||(An(e,"compositionstart",Ah),An(e,"compositionend",kd),An(e,"change",kd))},mounted(e,{value:t,modifiers:{trim:o,number:i}}){let s=t??"",r=e[vi];delete e[vi],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[un](_r(e.value,o,i)):e.value=s},beforeUpdate(e,{value:t,oldValue:o,modifiers:{lazy:i,trim:s,number:r}},a){if(e[un]=Do(a),e.composing)return;let u=(r||e.type==="number")&&!/^0\d/.test(e.value)?bo(e.value):e.value,p=t??"";if(u===p)return;let y=e.getRootNode();(y instanceof Document||y instanceof ShadowRoot)&&y.activeElement===e&&e.type!=="range"&&(i&&t===o||s&&e.value.trim()===p)||(e.value=p)}},qr={deep:!0,created(e,t,o){e[un]=Do(o),An(e,"change",()=>{let i=e._modelValue,s=ws(e),r=e.checked,a=e[un];if(Re(i)){let u=Gs(i,s),p=u!==-1;if(r&&!p)a(i.concat(s));else if(!r&&p){let y=[...i];y.splice(u,1),a(y)}}else if(Ht(i)){let u=new Set(i);r?u.add(s):u.delete(s),a(u)}else a(Dd(e,r))})},mounted:Cd,beforeUpdate(e,t,o){e[un]=Do(o),Cd(e,t,o)}};function Cd(e,{value:t,oldValue:o},i){e._modelValue=t;let s;if(Re(t))s=Gs(t,i.props.value)>-1;else if(Ht(t))s=t.has(i.props.value);else{if(t===o)return;s=jt(t,Dd(e,!0))}e.checked!==s&&(e.checked=s)}var cn={deep:!0,created(e,{value:t,modifiers:{number:o}},i){e._modelValue=t,An(e,"change",()=>{let s=Array.prototype.filter.call(e.options,p=>p.selected).map(p=>o?bo(ws(p)):ws(p)),r=e.multiple,a=r?Ht(e._modelValue)?new Set(s):s:s[0],u=e._pendingValue=[r,r?Re(a)?s.slice():s:a];try{e[un](a)}finally{xe(()=>{e._pendingValue===u&&(e._pendingValue=void 0)})}}),e[un]=Do(i)},mounted(e,{value:t}){Ed(e,t)},beforeUpdate(e,{value:t},o){e._modelValue=t,e[un]=Do(o)},updated(e,{value:t}){let o=e._pendingValue;e._pendingValue=void 0,(!o||o[0]!==e.multiple||!Th(t,o[1],o[0]))&&Ed(e,t)}};function Th(e,t,o){if(!o)return jt(e,t);if(Re(e))return jt(e,t);if(Ht(e)){if(e.size!==t.length)return!1;for(let i of t)if(!e.has(i))return!1;return!0}return!1}function Ed(e,t){let o=e.multiple,i=Re(t);if(!(o&&!i&&!Ht(t))){for(let s=0,r=e.options.length;s<r;s++){let a=e.options[s],u=ws(a);if(o)if(i){let p=typeof u;p==="string"||p==="number"?a.selected=t.some(y=>String(y)===String(u)):a.selected=Gs(t,u)>-1}else a.selected=t.has(u);else if(jt(ws(a),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!o&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ws(e){return"_value"in e?e._value:e.value}function Dd(e,t){let o=t?"_trueValue":"_falseValue";return o in e?e[o]:t}var Ph=["ctrl","shift","alt","meta"],Oh={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)=>Ph.some(o=>e[`${o}Key`]&&!t.includes(o))},de=(e,t)=>{if(!e)return e;let o=e._withMods||(e._withMods={}),i=t.join(".");return o[i]||(o[i]=((s,...r)=>{for(let a=0;a<t.length;a++){let u=Oh[t[a]];if(u&&u(s,t))return}return e(s,...r)}))},Ih={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},ut=(e,t)=>{let o=e._withKeys||(e._withKeys={}),i=t.join(".");return o[i]||(o[i]=(s=>{if(!("key"in s))return;let r=xt(s.key);if(t.some(a=>a===r||Ih[a]===r))return e(s)}))},Mh=at({patchProp:Nh},dh),Sd;function _h(){return Sd||(Sd=od(Mh))}var Ad=((...e)=>{let t=_h().createApp(...e),{mount:o}=t;return t.mount=i=>{let s=qh(i);if(!s)return;let r=t._component;!Ie(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");let a=o(s,!1,Vh(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),a},t});function Vh(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function qh(e){return nt(e)?document.querySelector(e):e}var xn=typeof document<"u";function Pd(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function $h(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Pd(e.default)}var We=Object.assign;function bi(e,t){let o={};for(let i in t){let s=t[i];o[i]=zt(s)?s.map(e):e(s)}return o}var To=()=>{},zt=Array.isArray;function Ur(e,t){let o={};for(let i in e)o[i]=i in t?t[i]:e[i];return o}var Od=/#/g,Lh=/&/g,Uh=/\//g,Fh=/=/g,Bh=/\?/g,Id=/\+/g,zh=/%5B/g,Hh=/%5D/g,Md=/%5E/g,jh=/%60/g,_d=/%7B/g,Gh=/%7C/g,Vd=/%7D/g,Wh=/%20/g;function Fr(e){return e==null?"":encodeURI(""+e).replace(Gh,"|").replace(zh,"[").replace(Hh,"]")}function qd(e){return Fr(e).replace(_d,"{").replace(Vd,"}").replace(Md,"^")}function $r(e){return Fr(e).replace(Id,"%2B").replace(Wh,"+").replace(Od,"%23").replace(Lh,"%26").replace(jh,"`").replace(_d,"{").replace(Vd,"}").replace(Md,"^")}function Kh(e){return $r(e).replace(Fh,"%3D")}function Yh(e){return FLine truncated
"use strict";(()=>{var el=Object.defineProperty;var tl=e=>{throw TypeError(e)};var Zp=(e,t,o)=>t in e?el(e,t,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[t]=o;var xp=(e,t)=>{for(var o in t)el(e,o,{get:t[o],enumerable:!0})};var xe=(e,t,o)=>Zp(e,typeof t!="symbol"?t+"":t,o),mr=(e,t,o)=>t.has(e)||tl("Cannot "+o);var re=(e,t,o)=>(mr(e,t,"read from private field"),o?o.call(e):t.get(e)),_e=(e,t,o)=>t.has(e)?tl("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,o),Le=(e,t,o,i)=>(mr(e,t,"write to private field"),i?i.call(e,o):t.set(e,o),o),Ve=(e,t,o)=>(mr(e,t,"access private method"),o);var nl=(e,t,o,i)=>({set _(s){Le(e,t,s,o)},get _(){return re(e,t,i)}});var ve=["abap","abc","actionscript","ada","alda","apache_conf","apex","applescript","aql","asciidoc","asl","assembly_x86","autohotkey","batchfile","c9search","c_cpp","cirru","clojure","cobol","coffee","coldfusion","crystal","csharp","csound_document","csound_orchestra","csound_score","csp","css","curly","d","dart","diff","django","dockerfile","dot","drools","edifact","eiffel","ejs","elixir","elm","erlang","forth","fortran","fsharp","fsl","ftl","gcode","gherkin","gitignore","glsl","gobstones","golang","graphqlschema","groovy","haml","handlebars","haskell","haskell_cabal","haxe","hjson","html","html_elixir","html_ruby","ini","io","jack","jade","java","javascript","json","json5","jsoniq","jsp","jssm","jsx","julia","kotlin","latex","less","liquid","lisp","livescript","logiql","logtalk","lsl","lua","luapage","lucene","makefile","markdown","mask","matlab","maze","mediawiki","mel","mixal","mushcode","mysql","nginx","nim","nix","nsis","nunjucks","objectivec","ocaml","pascal","perl","perl6","pgsql","php","php_laravel_blade","pig","plain_text","powershell","praat","prisma","prolog","properties","protobuf","puppet","python","qml","r","razor","rdoc","red","redshift","rhtml","rst","ruby","rust","sass","scad","scala","scheme","scss","sh","sjs","slim","smarty","snippets","soy_template","space","sparql","sql","sqlserver","stylus","svg","swift","tcl","terraform","tex","text","textile","toml","tsx","turtle","twig","typescript","vala","vbscript","velocity","verilog","vhdl","visualforce","wollok","xml","xquery","yaml","zeek"];var ye={markdown:"/script/markdown.6c8dfb7b1d.min.js",notebook:"/script/notebook.c3144c18ae.min.js",org:"/script/org.f61f262915.min.js",pdf:"/script/pdf.4d9cc6ff49.min.js",editor:"/script/editor.4f142d3adc.min.js"};function ol(e){let t=e.location.hash.slice(1);if(e.history.replaceState(null,"","/review-link"),t.length>2048)return null;let o=new URLSearchParams(t);if([...o.keys()].length!==3||[...o.keys()].some(d=>!["clientId","intentId","token"].includes(d)))return null;let i=o.get("clientId"),s=o.get("intentId"),r=o.get("token");return!/^[a-f0-9]{32}$/.test(i||"")||!/^[a-f0-9]{32}$/.test(s||"")||!/^[a-f0-9]{64}$/.test(r||"")?null:{contract:"4open.artifacts/1",clientId:i,intentId:s,token:r}}function sl(e,t){let{http:o,promises:i,window:s}=t,r=t.takeReviewHandoff(),d=r?{clientId:r.clientId,intentId:r.intentId}:null,c,u,y,h,b,g=!0,k,R=i.defer(),S=()=>[...s.crypto.getRandomValues(new Uint8Array(16))].map(_=>_.toString(16).padStart(2,"0")).join("");Object.assign(e,{repositoryId:"",handoffEnabled:!1,busy:!1,preview:null,acceptAccess:!1,acceptRetention:!1,uncertain:!1,saved:!1,expired:!1,error:r?"":"Open a new artifact link from your submission. This link is missing or invalid."});let N=()=>g&&e.user?.username===b;function m(){g=!1,r=c=u=void 0,R.resolve(),s.clearTimeout(k)}e.on("dispose",m),e.on("routeLeave",m),e.watch(()=>e.user?.username,_=>{!b&&_?b=_:b&&_!==b&&(m(),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 E=()=>({timeout:R.promise,headers:{"Content-Type":"application/json","X-Review-CSRF":u}}),M=_=>_?.status===404?"Artifact linking is not available on this server.":_?.status===401?"Sign in, then open a new artifact link from your submission.":_?.status===403?"This account cannot approve this repository or this link.":"The request could not be completed. You can retry from this page.";e.loadPreview=async()=>{if(!g||!r||e.busy||e.uncertain||e.saved||!e.user?.username)return;b=e.user.username;let _=e.repositoryId.trim();if(!/^[A-Za-z0-9_-]{3,128}$/.test(_)){e.error="Enter the anonymous repository ID from its URL.";return}e.busy=!0,e.error="",e.preview=null,c=void 0,e.acceptAccess=e.acceptRetention=!1,e.expired=!1,s.clearTimeout(k),h||(h=S());try{let V=(await o.get("/api/review-consent/csrf",{timeout:R.promise})).data;if(!N())return;if(u=V.csrf,e.handoffEnabled=V.handoffEnabled===!0,!/^[a-f0-9]{64}$/.test(u||""))throw new Error("invalid_csrf");let G=(await o.post("/api/review-consent/preview",{repositoryId:_,intent:{...r,requestId:h}},E())).data;if(!N())return;if(!G||typeof G.ticket!="string"||!G.ticket||G.ticket.length>8192||typeof G.repositoryName!="string"||!["restricted-review","anonymous-link"].iLine truncated
`))),e[hn]=Lo(s);let r=i||s.props&&s.props.type==="number";_n(e,t?"change":"input",d=>{d.target.composing||e[hn](ta(e.value,o,r))}),(o||r)&&_n(e,"change",()=>{e.value=ta(e.value,o,r)}),t||(_n(e,"compositionstart",om),_n(e,"compositionend",jd),_n(e,"change",jd))},mounted(e,{value:t,modifiers:{trim:o,number:i}}){let s=t??"",r=e[_i];delete e[_i],r!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==r?e[hn](ta(e.value,o,i)):e.value=s},beforeUpdate(e,{value:t,oldValue:o,modifiers:{lazy:i,trim:s,number:r}},d){if(e[hn]=Lo(d),e.composing)return;let c=(r||e.type==="number")&&!/^0\d/.test(e.value)?Oo(e.value):e.value,u=t??"";if(c===u)return;let y=e.getRootNode();(y instanceof Document||y instanceof ShadowRoot)&&y.activeElement===e&&e.type!=="range"&&(i&&t===o||s&&e.value.trim()===u)||(e.value=u)}},oa={deep:!0,created(e,t,o){e[hn]=Lo(o),_n(e,"change",()=>{let i=e._modelValue,s=Ms(e),r=e.checked,d=e[hn];if(Ne(i)){let c=li(i,s),u=c!==-1;if(r&&!u)d(i.concat(s));else if(!r&&u){let y=[...i];y.splice(c,1),d(y)}}else if(Yt(i)){let c=new Set(i);r?c.add(s):c.delete(s),d(c)}else d(Qd(e,r))})},mounted:Gd,beforeUpdate(e,t,o){e[hn]=Lo(o),Gd(e,t,o)}};function Gd(e,{value:t,oldValue:o},i){e._modelValue=t;let s;if(Ne(t))s=li(t,i.props.value)>-1;else if(Yt(t))s=t.has(i.props.value);else{if(t===o)return;s=Xt(t,Qd(e,!0))}e.checked!==s&&(e.checked=s)}var mn={deep:!0,created(e,{value:t,modifiers:{number:o}},i){e._modelValue=t,_n(e,"change",()=>{let s=Array.prototype.filter.call(e.options,u=>u.selected).map(u=>o?Oo(Ms(u)):Ms(u)),r=e.multiple,d=r?Yt(e._modelValue)?new Set(s):s:s[0],c=e._pendingValue=[r,r?Ne(d)?s.slice():s:d];try{e[hn](d)}finally{tt(()=>{e._pendingValue===c&&(e._pendingValue=void 0)})}}),e[hn]=Lo(i)},mounted(e,{value:t}){Wd(e,t)},beforeUpdate(e,{value:t},o){e._modelValue=t,e[hn]=Lo(o)},updated(e,{value:t}){let o=e._pendingValue;e._pendingValue=void 0,(!o||o[0]!==e.multiple||!sm(t,o[1],o[0]))&&Wd(e,t)}};function sm(e,t,o){if(!o)return Xt(e,t);if(Ne(e))return Xt(e,t);if(Yt(e)){if(e.size!==t.length)return!1;for(let i of t)if(!e.has(i))return!1;return!0}return!1}function Wd(e,t){let o=e.multiple,i=Ne(t);if(!(o&&!i&&!Yt(t))){for(let s=0,r=e.options.length;s<r;s++){let d=e.options[s],c=Ms(d);if(o)if(i){let u=typeof c;u==="string"||u==="number"?d.selected=t.some(y=>String(y)===String(c)):d.selected=li(t,c)>-1}else d.selected=t.has(c);else if(Xt(Ms(d),t)){e.selectedIndex!==s&&(e.selectedIndex=s);return}}!o&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Ms(e){return"_value"in e?e._value:e.value}function Qd(e,t){let o=t?"_trueValue":"_falseValue";return o in e?e[o]:t}var im=["ctrl","shift","alt","meta"],rm={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)=>im.some(o=>e[`${o}Key`]&&!t.includes(o))},le=(e,t)=>{if(!e)return e;let o=e._withMods||(e._withMods={}),i=t.join(".");return o[i]||(o[i]=((s,...r)=>{for(let d=0;d<t.length;d++){let c=rm[t[d]];if(c&&c(s,t))return}return e(s,...r)}))},am={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},kt=(e,t)=>{let o=e._withKeys||(e._withKeys={}),i=t.join(".");return o[i]||(o[i]=(s=>{if(!("key"in s))return;let r=on(s.key);if(t.some(d=>d===r||am[d]===r))return e(s)}))},lm=ct({patchProp:em},Lh),Kd;function dm(){return Kd||(Kd=Rd(lm))}var Jd=((...e)=>{let t=dm().createApp(...e),{mount:o}=t;return t.mount=i=>{let s=cm(i);if(!s)return;let r=t._component;!Te(r)&&!r.render&&!r.template&&(r.template=s.innerHTML),s.nodeType===1&&(s.textContent="");let d=o(s,!1,um(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),d},t});function um(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function cm(e){return it(e)?document.querySelector(e):e}var ao=typeof document<"u";function xd(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function pm(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&xd(e.default)}var Qe=Object.assign;function qi(e,t){let o={};for(let i in t){let s=t[i];o[i]=Wt(s)?s.map(e):e(s)}return o}var Uo=()=>{},Wt=Array.isArray;function ra(e,t){let o={};for(let i in e)o[i]=i in t?t[i]:e[i];return o}var eu=/#/g,fm=/&/g,hm=/\//g,mm=/=/g,gm=/\?/g,tu=/\+/g,vm=/%5B/g,ym=/%5D/g,nu=/%5E/g,bm=/%60/g,ou=/%7B/g,wm=/%7C/g,su=/%7D/g,km=/%20/g;function aa(e){return e==null?"":encodeURI(""+e).replace(wm,"|").replace(vm,"[").replace(ym,"]")}function iu(e){return aa(e).replace(ou,"{").replace(su,"}").replace(nu,"^")}function sa(e){return aa(e).replace(tu,"%2B").replace(km,"+").replace(eu,"%23").replace(fm,"%26").replace(bm,"`").replace(ou,"{").replace(su,"}").replace(nu,"^")}function Cm(e){return sa(e).replace(mm,"%3D")}function Em(e){return aLine truncated
${JSON.stringify(e)}${t?`
while being at
`+JSON.stringify(t):""}`},[rt.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${om(t)}" via a navigation guard.`},[rt.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[rt.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[rt.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function Zn(e,t){return We(new Error,{type:e,[Gd]:!0},t)}function pn(e,t){return e instanceof Error&&Gd in e&&(t==null||!!(e.type&t))}var nm=["params","query","hash"];function om(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let o of nm)o in e&&(t[o]=e[o]);return JSON.stringify(t,null,2)}function Wd(e){let t={};if(e===""||e==="?")return t;let o=(e[0]==="?"?e.slice(1):e).split("&");for(let i=0;i<o.length;++i){let s=o[i].replace(Id," "),r=s.indexOf("="),a=Ao(r<0?s:s.slice(0,r)),u=r<0?null:Ao(s.slice(r+1));if(a in t){let p=t[a];zt(p)||(p=t[a]=[p]),p.push(u)}else t[a]=u}return t}function Gr(e){let t="";for(let o in e){let i=e[o];if(o=Kh(o),i==null){i!==void 0&&(t+=(t.length?"&":"")+o);continue}(zt(i)?i.map(s=>s&&$r(s)):[i&&$r(i)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+o,s!=null&&(t+="="+s))})}return t}function Kd(e){let t={};for(let o in e){let i=e[o];i!==void 0&&(t[o]=zt(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return t}var Yd=Symbol(""),Wr=Symbol(""),Ei=Symbol(""),Si=Symbol(""),Ni=Symbol("");function Po(){let e=[];function t(i){return e.push(i),()=>{let s=e.indexOf(i);s>-1&&e.splice(s,1)}}function o(){e=[]}return{add:t,list:()=>e.slice(),reset:o}}function kn(e,t,o,i,s,r=a=>a()){let a=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((u,p)=>{let y=m=>{m===!1?p(Zn(rt.NAVIGATION_ABORTED,{from:o,to:t})):m instanceof Error?p(m):tm(m)?p(Zn(rt.NAVIGATION_GUARD_REDIRECT,{from:t,to:m})):(a&&i.enterCallbacks[s]===a&&typeof m=="function"&&a.push(m),u())},h=r(()=>e.call(i&&i.instances[s],t,o,y)),b=Promise.resolve(h);e.length<3&&(b=b.then(y)),b.catch(m=>p(m))})}function Ri(e,t,o,i,s=r=>r()){let r=[];for(let a of e)for(let u in a.components){let p=a.components[u];if(!(t!=="beforeRouteEnter"&&!a.instances[u]))if(Pd(p)){let y=(p.__vccOpts||p)[t];y&&r.push(kn(y,o,i,a,u,s))}else{let y=p();r.push(()=>y.then(h=>{if(!h)throw new Error(`Couldn't resolve component "${u}" at "${a.path}"`);let b=$h(h)?h.default:h;a.mods[u]=h,a.components[u]=b;let m=(b.__vccOpts||b)[t];return m&&kn(m,o,i,a,u,s)()}))}}return r}function Xd(e,t){let o=[],i=[],s=[],r=Math.max(t.matched.length,e.matched.length);for(let a=0;a<r;a++){let u=t.matched[a];u&&(e.matched.find(y=>Jn(y,u))?i.push(u):o.push(u));let p=e.matched[a];p&&(t.matched.find(y=>Jn(y,p))||s.push(p))}return[o,i,s]}var sm=()=>location.protocol+"//"+location.host;function ru(e,t){let{pathname:o,search:i,hash:s}=t,r=e.indexOf("#");if(r>-1){let a=s.includes(e.slice(r))?e.slice(r).length:1,u=s.slice(a);return u[0]!=="/"&&(u="/"+u),Br(u,"")}return Br(o,e)+i+s}function im(e,t,o,i){let s=[],r=[],a=null,u=({state:m})=>{let w=ru(e,location),A=o.value,S=t.value,R=0;if(m){if(o.value=w,t.value=m,a&&a===A){a=null;return}R=S?m.position-S.position:0}else i(w);s.forEach(g=>{g(o.value,A,{delta:R,type:ki.pop,direction:R?R>0?Ci.forward:Ci.back:Ci.unknown})})};function p(){a=o.value}function y(m){s.push(m);let w=()=>{let A=s.indexOf(m);A>-1&&s.splice(A,1)};return r.push(w),w}function h(){if(document.visibilityState==="hidden"){let{history:m}=window;if(!m.state)return;m.replaceState(We({},m.state,{scroll:ks()}),"")}}function b(){for(let m of r)m();r=[],window.removeEventListener("popstate",u),window.removeEventListener("pagehide",h),document.removeEventListener("visibilitychange",h)}return window.addEventListener("popstate",u),window.addEventListener("pagehide",h),document.addEventListener("visibilitychange",h),{pauseListeners:p,listen:y,destroy:b}}function Qd(e,t,o,i=!1,s=!1){return{back:e,current:t,forward:o,replaced:i,position:window.history.length,scroll:s?ks():null}}function rm(e){let{history:t,location:o}=window,i={value:ru(e,o)},s={value:t.state};s.value||r(i.value,{back:null,current:i.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(p,y,h){let b=e.indexOf("#"),m=b>-1?(o.host&&document.querySelector("base")?e:e.slice(b))+p:sm()+e+p;try{t[h?"replaceState":"pushState"](y,"",m),s.value=y}catch(w){console.error(w),o[h?"replace":"assign"](m)}}function a(p,y){r(p,We({},t.state,Qd(s.value.back,p,s.value.forward,!0),y,{position:s.value.position}),!0),i.value=p}function u(p,y){let h=We({},s.value,t.state,{forward:p,scroll:ks()});r(h.current,h,!0),r(p,We({},Qd(i.value,p,null),{position:h.position+1},y),!1),i.value=p}return{location:i,state:s,push:u,replace:a}}function au(e){e=Fd(e);let t=rm(e),o=im(e,t.state,t.location,t.replace);function i(r,a=!0){a||o.pauseListeners(),history.go(r)}let s=We({locatLine truncated
`);for(let b=0;b<h.length;b++){let m=h[b];if(m.startsWith("diff --git")){y(),p();continue}if(m.startsWith("--- ")){r&&r.lines.length&&y(),p().oldPath=m.replace(/^--- (a\/)?/,"").trim();continue}if(m.startsWith("+++ ")){p().newPath=m.replace(/^\+\+\+ (b\/)?/,"").trim();continue}if(!(m.startsWith("index ")||m.startsWith("similarity index")||m.startsWith("rename ")||m.startsWith("new file mode")||m.startsWith("deleted file mode")||m.startsWith("Binary files"))){if(m.startsWith("@@")){let w=m.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);w&&(a=parseInt(w[1],10),u=parseInt(w[2],10)),p().lines.push({kind:"hunk",oldNo:"",newNo:"",text:m});continue}r&&(m.startsWith("+")?(r.lines.push({kind:"add",oldNo:"",newNo:u,text:m.slice(1)}),u++):m.startsWith("-")?(r.lines.push({kind:"remove",oldNo:a,newNo:"",text:m.slice(1)}),a++):(r.lines.push({kind:"ctx",oldNo:a,newNo:u,text:m.startsWith(" ")?m.slice(1):m}),a++,u++))}}return o(s,r),s.join("")}})({trustAsHtml:e=>e});function Im(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function Mm(e,t="EUR"){let o=Number(e)||0;return new Intl.NumberFormat(void 0,{style:"currency",currency:t,minimumFractionDigits:o%1?2:0,maximumFractionDigits:2}).format(o)}function _m(e){return String(e??"").toUpperCase()}function Vm(e,t,o=0){return(e||[]).slice(o,o+t)}function qm(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function $m(e,t){if(!t)return e||[];let o=Array.isArray(t)?t:[t];return[...e||[]].sort((i,s)=>{for(let r of o){let a=r[0]==="-"?-1:1;r=r.replace(/^[+-]/,"");let u=r.split(".").reduce((y,h)=>y?.[h],i),p=r.split(".").reduce((y,h)=>y?.[h],s);if(typeof u=="string"&&(u=u.toLowerCase()),typeof p=="string"&&(p=p.toLowerCase()),u!==p)return(u==null?-1:p==null?1:u<p?-1:1)*a}return 0})}function Lm(e,t){if(!e)return"";let o=new Date(e);if(isNaN(o))return String(e);if(!t||t==="mediumDate")return o.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});let i={yyyy:o.getFullYear(),MMM:o.toLocaleDateString(void 0,{month:"short"}),MM:String(o.getMonth()+1).padStart(2,"0"),dd:String(o.getDate()).padStart(2,"0"),d:o.getDate(),HH:String(o.getHours()).padStart(2,"0"),mm:String(o.getMinutes()).padStart(2,"0"),ss:String(o.getSeconds()).padStart(2,"0")};return t.replace(/yyyy|MMM|MM|dd|HH|mm|ss|d/g,s=>i[s])}function Um(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}function Jr(e){if(!e)return"";let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(e)),o=t?new Date(+t[1],+t[2]-1,+t[3]):new Date(e);if(isNaN(o))return"";let i=o.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),s=new Date;s.setHours(0,0,0,0);let r=Math.round((o-s)/864e5),a;if(r===0)a="today";else if(r===1)a="tomorrow";else if(r===-1)a="yesterday";else{let u=Math.abs(r),p=Math.round(u/30.44),y=u<14?[u,"day"]:u<60?[Math.round(u/7),"week"]:p<18?[p,"month"]:[Math.round(u/365.25),"year"],h=y[0]+" "+y[1]+(y[0]===1?"":"s");a=r>0?"in "+h:h+" ago"}return i+" \xB7 "+a}function to(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 o=e/1e3;if(o<60)return+(o<10?o.toFixed(2):o.toFixed(1))+t+"s";let i=r=>String(r).padStart(2,"0"),s=Math.round(o);return s<3600?Math.floor(s/60)+"m "+i(s%60)+"s":Math.floor(s/3600)+"h "+i(Math.floor(s%3600/60))+"m"}function Zr(e){if(!e)return"";let t=new Date(e);if(isNaN(t))return"";let o={day:"numeric",month:"short"};return t.getFullYear()!==new Date().getFullYear()&&(o.year="numeric"),t.toLocaleDateString(void 0,o)}var Ii=e=>["preparing","download","downloading","downloaded","queue","anonymizing"].includes(e)?"preparing":e==="expiring"?"expired":e==="removing"?"removed":e;function Mi(e,{flags:t,keys:o,count:i,onChange:s=()=>{}}){if(e.segView=()=>{let r=t()||{};if(o.every(u=>!!r[u]))return"all";let a=o.filter(u=>!!r[u]);return a.length===1?a[0]:"custom"},e.setSegView=r=>{let a=t();if(a){for(let u of o)a[u]=r==="all"?!0:u===r;s()}},e.segCount=r=>r==="all"?o.reduce((a,u)=>a+i(u),0):i(r),t()&&e.segView()==="custom")for(let r of o)t()[r]=!0}var fu=function(e,t,o){let i=Tt(),s=Qt();wu(i,s),e.Math=Math,e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null&&o.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 R=document.querySelector('.admin-filter-toolbar input[type="search"]');R&&R.focus()}};s(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 a=()=>{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
`+JSON.stringify(t):""}`},[ut.NAVIGATION_GUARD_REDIRECT]({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${Im(t)}" via a navigation guard.`},[ut.NAVIGATION_ABORTED]({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},[ut.NAVIGATION_CANCELLED]({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},[ut.NAVIGATION_DUPLICATED]({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function ro(e,t){return Qe(new Error,{type:e,[hu]:!0},t)}function gn(e,t){return e instanceof Error&&hu in e&&(t==null||!!(e.type&t))}var Om=["params","query","hash"];function Im(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;let t={};for(let o of Om)o in e&&(t[o]=e[o]);return JSON.stringify(t,null,2)}function mu(e){let t={};if(e===""||e==="?")return t;let o=(e[0]==="?"?e.slice(1):e).split("&");for(let i=0;i<o.length;++i){let s=o[i].replace(tu," "),r=s.indexOf("="),d=Fo(r<0?s:s.slice(0,r)),c=r<0?null:Fo(s.slice(r+1));if(d in t){let u=t[d];Wt(u)||(u=t[d]=[u]),u.push(c)}else t[d]=c}return t}function pa(e){let t="";for(let o in e){let i=e[o];if(o=Cm(o),i==null){i!==void 0&&(t+=(t.length?"&":"")+o);continue}(Wt(i)?i.map(s=>s&&sa(s)):[i&&sa(i)]).forEach(s=>{s!==void 0&&(t+=(t.length?"&":"")+o,s!=null&&(t+="="+s))})}return t}function gu(e){let t={};for(let o in e){let i=e[o];i!==void 0&&(t[o]=Wt(i)?i.map(s=>s==null?null:""+s):i==null?i:""+i)}return t}var vu=Symbol(""),fa=Symbol(""),Ui=Symbol(""),Bi=Symbol(""),zi=Symbol("");function Bo(){let e=[];function t(i){return e.push(i),()=>{let s=e.indexOf(i);s>-1&&e.splice(s,1)}}function o(){e=[]}return{add:t,list:()=>e.slice(),reset:o}}function Nn(e,t,o,i,s,r=d=>d()){let d=i&&(i.enterCallbacks[s]=i.enterCallbacks[s]||[]);return()=>new Promise((c,u)=>{let y=g=>{g===!1?u(ro(ut.NAVIGATION_ABORTED,{from:o,to:t})):g instanceof Error?u(g):Tm(g)?u(ro(ut.NAVIGATION_GUARD_REDIRECT,{from:t,to:g})):(d&&i.enterCallbacks[s]===d&&typeof g=="function"&&d.push(g),c())},h=r(()=>e.call(i&&i.instances[s],t,o,y)),b=Promise.resolve(h);e.length<3&&(b=b.then(y)),b.catch(g=>u(g))})}function Hi(e,t,o,i,s=r=>r()){let r=[];for(let d of e)for(let c in d.components){let u=d.components[c];if(!(t!=="beforeRouteEnter"&&!d.instances[c]))if(xd(u)){let y=(u.__vccOpts||u)[t];y&&r.push(Nn(y,o,i,d,c,s))}else{let y=u();r.push(()=>y.then(h=>{if(!h)throw new Error(`Couldn't resolve component "${c}" at "${d.path}"`);let b=pm(h)?h.default:h;d.mods[c]=h,d.components[c]=b;let g=(b.__vccOpts||b)[t];return g&&Nn(g,o,i,d,c,s)()}))}}return r}function yu(e,t){let o=[],i=[],s=[],r=Math.max(t.matched.length,e.matched.length);for(let d=0;d<r;d++){let c=t.matched[d];c&&(e.matched.find(y=>io(y,c))?i.push(c):o.push(c));let u=e.matched[d];u&&(t.matched.find(y=>io(y,u))||s.push(u))}return[o,i,s]}var Mm=()=>location.protocol+"//"+location.host;function Au(e,t){let{pathname:o,search:i,hash:s}=t,r=e.indexOf("#");if(r>-1){let d=s.includes(e.slice(r))?e.slice(r).length:1,c=s.slice(d);return c[0]!=="/"&&(c="/"+c),la(c,"")}return la(o,e)+i+s}function _m(e,t,o,i){let s=[],r=[],d=null,c=({state:g})=>{let k=Au(e,location),R=o.value,S=t.value,N=0;if(g){if(o.value=k,t.value=g,d&&d===R){d=null;return}N=S?g.position-S.position:0}else i(k);s.forEach(m=>{m(o.value,R,{delta:N,type:Li.pop,direction:N?N>0?Fi.forward:Fi.back:Fi.unknown})})};function u(){d=o.value}function y(g){s.push(g);let k=()=>{let R=s.indexOf(g);R>-1&&s.splice(R,1)};return r.push(k),k}function h(){if(document.visibilityState==="hidden"){let{history:g}=window;if(!g.state)return;g.replaceState(Qe({},g.state,{scroll:_s()}),"")}}function b(){for(let g of r)g();r=[],window.removeEventListener("popstate",c),window.removeEventListener("pagehide",h),document.removeEventListener("visibilitychange",h)}return window.addEventListener("popstate",c),window.addEventListener("pagehide",h),document.addEventListener("visibilitychange",h),{pauseListeners:u,listen:y,destroy:b}}function bu(e,t,o,i=!1,s=!1){return{back:e,current:t,forward:o,replaced:i,position:window.history.length,scroll:s?_s():null}}function Vm(e){let{history:t,location:o}=window,i={value:Au(e,o)},s={value:t.state};s.value||r(i.value,{back:null,current:i.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function r(u,y,h){let b=e.indexOf("#"),g=b>-1?(o.host&&document.querySelector("base")?e:e.slice(b))+u:Mm()+e+u;try{t[h?"replaceState":"pushState"](y,"",g),s.value=y}catch(k){console.error(k),o[h?"replace":"assign"](g)}}function d(u,y){r(u,Qe({},t.state,bu(s.value.back,u,s.value.forward,!0),y,{position:s.value.position}),!0),i.value=u}function c(u,y){let h=Qe({},s.value,t.state,{forward:u,scroll:_s()});r(h.current,h,!0),r(u,Qe({},bu(i.value,u,null),{position:h.position+1},y),!1),i.value=u}return{location:i,state:s,push:c,replace:d}}function Tu(e){e=du(e);let t=Vm(e),o=_m(e,t.state,t.location,t.replace);function i(r,d=!0){d||o.pauseListeners(),history.go(r)}let s=Qe({locatLine truncated
`).forEach((U,C)=>{for(let[q,z]of k){let K=q.exec(U);if(K&&!/^(if|for|while|switch|return|catch)$/.test(K[1])){O.push({name:K[1],kind:z,line:C+1});break}}}),R={content:e.content,list:O.slice(0,300)},R.list},e.goToSymbol=function(O){e.symbolsOpen=!1;let U=e.codeEditor;U&&(U.scrollToLine(O-1,!0,!0,()=>{}),U.gotoLine(O,0,!0),window.history.replaceState(null,"",window.location.pathname+window.location.search+"#L"+O),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 O=window.document.getElementById("goto-input");O&&(O.focus(),O.select())},0))},e.closeGoto=function(){e.gotoOpen=!1,e.gotoError="",e.codeEditor?.focus()},e.submitGoto=function(){let O=e.codeEditor;if(!O)return;let U=/^\s*:?\s*(\d+)\s*(?:[:,]\s*(\d+))?\s*$/.exec(e.gotoValue||""),C=O.session.getLength();if(!U||+U[1]<1||+U[1]>C){e.gotoError="Enter a line from 1 to "+C;return}O.gotoLine(+U[1],U[2]?Math.max(0,+U[2]-1):0,!0),e.gotoOpen=!1,e.gotoError="",O.focus()},e.rootEntries=function(){return[...e.files||[]].sort((O,U)=>{let C=O.size==null,q=U.size==null;return C!==q?C?-1:1:O.name.localeCompare(U.name)})},e.formatSize=function(O){if(O==null)return"";if(O<1024)return O+" B";let U=O/1024,C=q=>q.toFixed(1).replace(/\.0$/,"");return U<1024?C(U)+" KB":U<1024*1024?C(U/1024)+" MB":C(U/1024/1024)+" GB"},e.fileSize=function(O){if(!O)return null;let U=O.replace(/^\/+/,""),C=(e.files||[]).find(q=>(q.path?q.path+"/":"")+q.name===U);return C&&C.size!=null?C.size:null},e.revealFolder=function(O){e.sidebarHidden=!1,e.sidebarCollapsed=!1,tt(()=>{let U=window.document.querySelector('.files a[data-path="/'+(window.CSS?.escape?window.CSS.escape(O):O)+'"]');U&&(U.closest("li")?.classList.contains("open")||U.click(),U.scrollIntoView({block:"nearest"}),U.focus())})};let S={content:null,n:0},N=O=>{if(S.content===O)return S.n;let U=O;if(typeof U=="string")try{U=JSON.parse(U)}catch{U=null}let C=[],q=K=>{Array.isArray(K)?C.push(K.join("")):typeof K=="string"&&C.push(K)};(U&&(U.cells||(U.worksheets||[]).flatMap(K=>K.cells||[]))||[]).forEach(K=>{q(K?.source??K?.input),(K?.outputs||[]).forEach(ie=>{q(ie?.text),ie?.data&&(q(ie.data["text/plain"]),q(ie.data["text/markdown"]),q(ie.data["text/html"])),q(ie?.traceback)})});let z=C.reduce((K,ie)=>K+(ie.match(o)||[]).length,0);return S={content:O,n:z},z};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(o)||[]).length},e.renderRedacted=qs;let m=O=>O.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").slice(0,60)||"section";e.renderReadme=function(O){let U=e.renderRedacted(O);if(!U||typeof window.DOMParser!="function")return U;let C=new window.DOMParser().parseFromString("<div>"+U+"</div>","text/html"),q={};return C.querySelectorAll("h1, h2, h3").forEach(z=>{let K=z.id||m(z.textContent);q[K]?K+="-"+ ++q[K]:q[K]=1,z.id=K}),C.body.firstChild.innerHTML};let E={content:null,list:[]};e.readmeToc=function(){if(e.type!=="html"||typeof e.content!="string")return[];if(E.content===e.content)return E.list;let U=[...new window.DOMParser().parseFromString("<div>"+e.renderReadme(e.sanitize?e.sanitize(e.content):e.content)+"</div>","text/html").querySelectorAll("h2, h3")].map(C=>({id:C.id,text:C.textContent.trim(),level:C.tagName==="H3"?3:2})).slice(0,40);return E={content:e.content,list:U},U},e.activeHeading=null,s(window,"scroll",()=>{let O=e.readmeToc?e.readmeToc():[];if(!O.length)return;let U=150,C="",q="";for(let z of O){let K=window.document.getElementById(z.id);if(!K)continue;let ie=K.getBoundingClientRect().top;ie<U?C=z.id:!q&&ie<window.innerHeight-80&&(q=z.id)}q&&(C=q),e.activeHeading!==C&&(e.activeHeading=C)},{capture:!0,passive:!0}),e.scrollToHeading=function(O){if(!O){(window.document.querySelector(".explorer-content, .file-card-body, .main-pane")||window).scrollTo({top:0,behavior:"smooth"}),e.activeHeading="";return}let U=window.document.getElementById(O);U&&U.scrollIntoView({behavior:"smooth",block:"start"}),e.activeHeading=O},e.csvView="table";let M={content:null,rows:[]},_=(O,U)=>{let C=[],q=[],z="",K=!1;for(let ie=0;ie<O.length;ie++){let ne=O[ie];K?ne==='"'?O[ie+1]==='"'?(z+='"',ie++):K=!1:z+=ne:ne==='"'&&z===""?K=!0:ne===U?(q.push(z),z=""):ne===`
`||ne==="\r"?(ne==="\r"&&O[ie+1]===`
`&&ie++,q.push(z),C.push(q),q=[],z=""):z+=ne}return(z!==""||q.length)&&(q.push(z),C.push(q)),C.filter(ie=>ie.length>1||ie[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 O=/\.tsv$/i.test(e.filePath||"")?" ":",";M={content:e.content,rows:_(e.content,O)}}return M.rows},e.csvNumCol=O=>{let U=e.csvRows().slice(1).map(C=>C[O]).filter(C=>C!=null&&String(C).trim()!=="");return U.length>0&&U.every(C=>e.csvNumeric(C))},e.csvNumeric=O=>/^\s*[-+]?(\d[\d,]*)?(\.\d+)?(e[-+]?\d+)?%?\s*$/i.test(O)&&/\d/.test(O),e.redactParts=function(O){let U=[],C=0,q,z=/\bXXXX-(\d+)\b/g;for(O=String(O||"");q=z.exec(O);)q.index>C&&U.push({t:O.slice(C,q.index)}),U.push({n:q[1]}),C=q.index+q[0].length;return C<O.length&&U.push({t:O.slice(C)}),U},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 O=e.content;if(e.type==="html"&&e.url)if(e.preview)O=e.sourceContent;else try{O=await(await window.fetch(e.url,{credentials:"same-origin"})).text()}catch{return}await window.navigator.clipboard.writeText(O),e.contentCopied=!0,setTimeout(()=>{e.contentCopied=!1},1600)};function V(O){return r[O]?r[O]:O}function G(O){return O=="pdf"?"pdf":O=="html"||O=="htm"?"html-doc":["md","markdown","mdown","mkdn","mdx"].includes(O)?"md":O=="org"?"org":O=="ipynb"?"IPython":d.indexOf(O)>-1?"text":c.indexOf(O)>-1?"image":y.indexOf(O)>-1?"media":u.indexOf(O)>-1?"audio":"code"}e.downloadUrl=()=>e.preview?e.url:e.url+"&download=true",e.prepareFile=function(O){e.showSource=!1,e.allowScripts=!1,e.imageSize="",e.filePath=O,e.paths=O.split("/").filter(Boolean);let U=e.filePath.toLowerCase(),C=U.lastIndexOf(".");C>-1&&(U=U.substring(C+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:""},z=V(U);e.languageName=q[z]??(z?z.charAt(0).toUpperCase()+z.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:V(U),onLoad:function(K){e.codeEditor=dn(K);{let Re=K.session,Fe=Re.getTokens.bind(Re),W=/\bXXXX-\d+\b/g;if(Re.getTokens=function(fe){let de=Fe(fe);if(!de.some(me=>me.value.indexOf("XXXX-")!==-1))return de;let ce=[];for(let me of de){if(me.value.indexOf("XXXX-")===-1){ce.push(me);continue}let Ie=0;W.lastIndex=0;let D;for(;D=W.exec(me.value);)D.index>Ie&&ce.push({type:me.type,value:me.value.slice(Ie,D.index)}),ce.push({type:"redacted.n"+D[0].slice(5),value:D[0]}),Ie=D.index+D[0].length;Ie<me.value.length&&ce.push({type:me.type,value:me.value.slice(Ie)})}return ce},!window.document.getElementById("redact-index-rules")){let fe=window.document.createElement("style");fe.id="redact-index-rules",fe.textContent=Array.from({length:99},(de,ce)=>`.ace_redacted.ace_n${ce+1}::after{content:"${ce+1}"}`).join(""),window.document.head.appendChild(fe)}K.renderer.updateFull(!0)}K.session.setUseWrapMode(e.wrapLines!==!1);let ie=K.container.closest?.(".file-card"),ne=()=>{if(!ie)return;let Re=K.renderer,Fe=(Re.layerConfig?.width||0)-(Re.$size?.scrollerWidth||0);ie.classList.toggle("at-right-edge",Fe<=2||Re.getScrollLeft()>=Fe-2)};K.session.on("changeScrollLeft",ne),K.renderer.on("afterRender",ne),window.matchMedia?.("(max-width: 767px)").matches&&K.setOption("hScrollBarAlwaysVisible",!0);let Y=ace.require("ace/range").Range,he=null;function Ee(Re,Fe){he!==null&&(K.session.removeMarker(he),he=null),Re!=null&&(he=K.session.addMarker(new Y(Re,0,Fe,1),"highlighted-line","fullLine"))}function Ue(Re){let Fe=!e.preview&&window.location.hash.match(/^#L(\d+)(?:-L(\d+))?/);if(!Fe){Ee(null);return}let W=parseInt(Fe[1])-1,fe=Fe[2]?parseInt(Fe[2])-1:W;Ee(W,fe),Re&&i.timeout(()=>{K.scrollToLine(W,!0,!0,function(){})},100)}Ue(!0);let Be=null;K.on("guttermousedown",function(Re){let Fe=Re.getDocumentPosition().row,W=Re.domEvent&&Re.domEvent.shiftKey,fe=Fe,de=Fe;W&&Be!==null?(fe=Math.min(Be,Fe),de=Math.max(Be,Fe)):Be=Fe;let ce=fe===de?`#L${fe+1}`:`#L${fe+1}-L${de+1}`,me=window.location.pathname+window.location.search+ce;e.preview||window.history.replaceState(null,"",me),Ee(fe,de),Re.stop()});let Je=s(window,"h Line truncated
`);for(let b=0;b<h.length;b++){let g=h[b];if(g.startsWith("diff --git")){y(),u();continue}if(g.startsWith("--- ")){r&&r.lines.length&&y(),u().oldPath=g.replace(/^--- (a\/)?/,"").trim();continue}if(g.startsWith("+++ ")){u().newPath=g.replace(/^\+\+\+ (b\/)?/,"").trim();continue}if(!(g.startsWith("index ")||g.startsWith("similarity index")||g.startsWith("rename ")||g.startsWith("new file mode")||g.startsWith("deleted file mode")||g.startsWith("Binary files"))){if(g.startsWith("@@")){let k=g.match(/@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?\s+@@/);k&&(d=parseInt(k[1],10),c=parseInt(k[2],10)),u().lines.push({kind:"hunk",oldNo:"",newNo:"",text:g});continue}r&&(g.startsWith("+")?(r.lines.push({kind:"add",oldNo:"",newNo:c,text:g.slice(1)}),c++):g.startsWith("-")?(r.lines.push({kind:"remove",oldNo:d,newNo:"",text:g.slice(1)}),d++):(r.lines.push({kind:"ctx",oldNo:d,newNo:c,text:g.startsWith(" ")?g.slice(1):g}),d++,c++))}}return o(s,r),s.join("")}})({trustAsHtml:e=>e});function ag(e,t){return e==null?"":Number(e).toLocaleString(void 0,t==null?{}:{minimumFractionDigits:t,maximumFractionDigits:t})}function lg(e,t="EUR"){let o=Number(e)||0;return new Intl.NumberFormat(void 0,{style:"currency",currency:t,minimumFractionDigits:o%1?2:0,maximumFractionDigits:2}).format(o)}function dg(e){return String(e??"").toUpperCase()}function ug(e,t,o=0){return(e||[]).slice(o,o+t)}function cg(e,t){return Array.isArray(e)?typeof t=="function"?e.filter(t):e:[]}function pg(e,t){if(!t)return e||[];let o=Array.isArray(t)?t:[t];return[...e||[]].sort((i,s)=>{for(let r of o){let d=r[0]==="-"?-1:1;r=r.replace(/^[+-]/,"");let c=r.split(".").reduce((y,h)=>y?.[h],i),u=r.split(".").reduce((y,h)=>y?.[h],s);if(typeof c=="string"&&(c=c.toLowerCase()),typeof u=="string"&&(u=u.toLowerCase()),c!==u)return(c==null?-1:u==null?1:c<u?-1:1)*d}return 0})}function fg(e,t){if(!e)return"";let o=new Date(e);if(isNaN(o))return String(e);if(!t||t==="mediumDate")return o.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"});let i={yyyy:o.getFullYear(),MMM:o.toLocaleDateString(void 0,{month:"short"}),MM:String(o.getMonth()+1).padStart(2,"0"),dd:String(o.getDate()).padStart(2,"0"),d:o.getDate(),HH:String(o.getHours()).padStart(2,"0"),mm:String(o.getMinutes()).padStart(2,"0"),ss:String(o.getSeconds()).padStart(2,"0")};return t.replace(/yyyy|MMM|MM|dd|HH|mm|ss|d/g,s=>i[s])}function hg(e,t){return(t?.[e]??t?.[e===1?"one":"other"]??"").replace(/\{\}/g,e??0)}function ya(e){if(!e)return"";let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(String(e)),o=t?new Date(+t[1],+t[2]-1,+t[3]):new Date(e);if(isNaN(o))return"";let i=o.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}),s=new Date;s.setHours(0,0,0,0);let r=Math.round((o-s)/864e5),d;if(r===0)d="today";else if(r===1)d="tomorrow";else if(r===-1)d="yesterday";else{let c=Math.abs(r),u=Math.round(c/30.44),y=c<14?[c,"day"]:c<60?[Math.round(c/7),"week"]:u<18?[u,"month"]:[Math.round(c/365.25),"year"],h=y[0]+" "+y[1]+(y[0]===1?"":"s");d=r>0?"in "+h:h+" ago"}return i+" \xB7 "+d}function uo(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 o=e/1e3;if(o<60)return+(o<10?o.toFixed(2):o.toFixed(1))+t+"s";let i=r=>String(r).padStart(2,"0"),s=Math.round(o);return s<3600?Math.floor(s/60)+"m "+i(s%60)+"s":Math.floor(s/3600)+"h "+i(Math.floor(s%3600/60))+"m"}function ba(e){if(!e)return"";let t=new Date(e);if(isNaN(t))return"";let o={day:"numeric",month:"short"};return t.getFullYear()!==new Date().getFullYear()&&(o.year="numeric"),t.toLocaleDateString(void 0,o)}var Xi=e=>["preparing","download","downloading","downloaded","queue","anonymizing"].includes(e)?"preparing":e==="expiring"?"expired":e==="removing"?"removed":e;function Qi(e,{flags:t,keys:o,count:i,onChange:s=()=>{}}){if(e.segView=()=>{let r=t()||{};if(o.every(c=>!!r[c]))return"all";let d=o.filter(c=>!!r[c]);return d.length===1?d[0]:"custom"},e.setSegView=r=>{let d=t();if(d){for(let c of o)d[c]=r==="all"?!0:c===r;s()}},e.segCount=r=>r==="all"?o.reduce((d,c)=>d+i(c),0):i(r),t()&&e.segView()==="custom")for(let r of o)t()[r]=!0}var qu=function(e,t,o){let i=Rt(),s=Ut();Hu(i,s),e.Math=Math,e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null&&o.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()}};s(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.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"}),g=document.createElement("a");g.href=URL.createObjectURL(R),g.download=i.username+"-repositories.csv",g.click()},e.showStatusMessage=m=>{let w=m.statusMessage||"(no message)";window.prompt(`Status message for ${m.repoId} (${m.status}):`,w)},e.fetchGithubInfo=m=>{let w=window.open("","_blank");w&&w.document.write("<pre>Loading GitHub info for "+m.repoId+"...</pre>"),t.get("/api/admin/repos/"+m.repoId+"/github").then(A=>{w&&(w.document.open(),w.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(A.data,null,2).replace(/[<>]/g,S=>S==="<"?"&lt;":"&gt;")+"</pre>"),w.document.close())},A=>{let S=A&&A.data?JSON.stringify(A.data,null,2):String(A);w&&(w.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+S+"</pre>")})};function p(m){t.get("/api/admin/users/"+m+"/repos",{}).then(w=>{e.repositories=w.data},w=>{console.error(w)})}function y(m){t.get("/api/admin/users/"+m,{}).then(w=>{e.userInfo=w.data},w=>{console.error(w)})}y(i.username),p(i.username),e.banUser=()=>{confirm(`Ban user ${i.username}?`)&&t.post(`/api/admin/users/${i.username}/ban`).then(()=>y(i.username),m=>console.error(m))},e.activateUser=()=>{t.post(`/api/admin/users/${i.username}/activate`).then(()=>y(i.username),m=>console.error(m))},e.promoteUser=()=>{confirm(`Promote ${i.username} to admin?`)&&t.post(`/api/admin/users/${i.username}/promote`).then(()=>y(i.username),m=>console.error(m))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${i.username}?`)&&t.post(`/api/admin/users/${i.username}/demote`).then(()=>y(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(),w=>console.error(w))},e.removeCache=m=>{confirm("Remove cached files for "+m.repoId+"?")&&t.delete("/api/admin/repos/"+m.repoId).then(()=>p(i.username),w=>console.error(w))},e.removeRepository=m=>{confirm("Remove repository "+m.repoId+"?")&&t.delete("/api/repo/"+m.repoId+"/").then(()=>p(i.username),w=>console.error(w))},e.updateRepository=m=>{let w=ot({title:`Refreshing ${m.repoId}...`,date:new Date,body:`The repository ${m.repoId} is going to be refreshed.`});e.toasts.push(w),t.post(`/api/repo/${m.repoId}/refresh`).then(A=>{A.data.status=="ready"?w.title=`${m.repoId} is refreshed.`:w.title=`Refreshing of ${m.repoId}.`},A=>{w.title=`Error during the refresh of ${m.repoId}.`,w.body=A.body})},e.getGitHubRepositories=m=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(w=>{e.userInfo.repositories=w.data})};let b=null;e.watch("query",()=>{s.timeout.cancel(b),b=s.timeout(()=>{p(i.username)},500)},!0)},gu=function(e,t,o){let i=Tt(),s=Qt();e.Math=Math,e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null&&o.url("/"),e.conferences=[],e.total=-1,e.totalPage=0,e.statusCounts=[];let r=A=>{if(A.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){A.preventDefault();let S=document.querySelector('.admin-filter-toolbar input[type="search"]');S&&S.focus()}};s(document,"keydown",r),e.on("dispose",()=>document.removeEventListener("keydown",r)),e.clearFilter=A=>{A==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[A]="",e.query.page=1},e.chips=[];let a=()=>{let A=[];(e.query.dateFrom||e.query.dateTo)&&A.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=A};e.statusCountFor=A=>{let S=(e.statusCounts||[]).find(R=>R._id===A);return S?S.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=A=>{e.query.sort===A?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=A,e.query.direction="desc"),e.query.page=1},e.sortIcon=A=>e.query.sort===A?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let u="admin.conferences.filterPrefs",p={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!0,expired:!0,removed:!0,error:!0,preparing:!0},y=loadFilterPrefs(u)||{};e.query=Object.assign({},p,y,{page:1,search:""});let h=o.search();h.search&&(e.query.search=h.search);let b="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(b)||"[]"),e.savePreset=()=>{let A=window.prompt("Preset name:");if(!A)return;let S=Object.assign({},e.query);delete S.page,e.presets=(e.presets||[]).filter(R=>R.name!==A),e.presets.push({name:A,query:S}),localStorage.setItem(b,JSON.stringify(e.presets))},e.applyPreset=A=>{Object.assign(e.query,A.query,{page:1})},e.deletePreset=A=>{e.presets=(e.presets||[]).filter(S=>S.name!==A.name),localStorage.setItem(b,JS Line truncated
`).map((J,ce)=>ce===0?J:we+J).join(`
`)}else typeof oe=="number"||typeof oe=="boolean"?Pe=String(oe):Pe=JSON.stringify(oe);ne.push(`${te}${Pe}${ue}`)}),ne.push("}"),ne.join(`
`)}function y(g){let C=[],M="",V=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,q=0,j;for(;j=V.exec(g);)M+=g.slice(q,j.index),q=V.lastIndex,C.push({key:j[1],op:j[2]||"=",val:j[3]});return M+=g.slice(q),{filters:C,free:M.trim().toLowerCase()}}function h(g,C){for(let M of C.filters){let V=(j,ne,Y)=>{let oe=parseFloat(j),Ce=parseFloat(ne);return Y==="="?String(j)===String(ne):Y==="!="?String(j)!==String(ne):Y===">="?oe>=Ce:Y==="<="?oe<=Ce:Y===">"?oe>Ce:Y==="<"?oe<Ce:!0},q;if(M.key==="code")q=g.displayMessage;else if(M.key==="module")q=g.module;else if(M.key==="status")q=g._status;else if(M.key==="url")q=g._url;else if(M.key==="repo")q=g._repoId;else if(M.key==="level")q=g.level;else continue;if(q==null||!V(q,M.val,M.op))return!1}return!(C.free&&((g.displayMessage||"")+" "+(g.module||"")+" "+(g._url||"")+" "+JSON.stringify(g.raw||[])).toLowerCase().indexOf(C.free)===-1)}function b(){let g=y(e.query.search||"");e.parsedFilterCount=g.filters.length;let C=e.query.bucket,M=e.entries.filter(Y=>C&&Y._bucket!==C?!1:h(Y,g)),V=e.query.group;if(V){let Y=D=>V==="module"?D.module:D.displayMessage||D.message||"_",oe=new Map;for(let D of M){let te=Y(D);if(oe.has(te)){let ue=oe.get(te);ue.count++,ue._related.push(D),new Date(D.ts)>new Date(ue.ts)&&(ue.ts=D.ts,ue._url=D._url,ue._status=D._status),new Date(D.ts)<new Date(ue._firstSeen)&&(ue._firstSeen=D.ts)}else{let ue=Object.assign({},D);ue._key=`${V}:${te}`,ue._related=[D],ue._firstSeen=D.ts,ue._lastHourCount=0,ue.count=1,oe.set(te,ue)}}let Ce=Date.now()-3600*1e3;for(let D of oe.values())D._lastHourCount=D._related.filter(te=>new Date(te.ts).getTime()>=Ce).length;M=Array.from(oe.values())}else M=M.map((Y,oe)=>(Y._key="row:"+oe+":"+Y.ts,Y._related=[Y],Y._firstSeen=Y.ts,Y._lastHourCount=0,Y.count=1,Y));let q=Y=>({error:0,warn:1,info:2})[Y._bucket]??1;e.query.sort==="count"?M.sort((Y,oe)=>q(Y)-q(oe)||oe.count-Y.count||new Date(oe.ts)-new Date(Y.ts)):M.sort((Y,oe)=>q(Y)-q(oe)||new Date(oe.ts)-new Date(Y.ts)),e.visible=M;let j=!!(e.query.bucket||(e.query.search||"").trim()),ne=!j&&(e.stats?.severity?.error||0)>0&&!M.some(Y=>Y._bucket==="error")&&e.entries.length<1500;(j&&!M.length||ne)&&e.canLoadMore?.()&&!e._autoLoading&&e.entries.length<2500&&(e._autoLoading=!0,m(!0))}function m(g){let C=g?e.entries.length:0,M=g?e.pageSize:Math.max(e.pageSize,e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:C,limit:M}}).then(V=>{let q=(V.data.entries||[]).map(u);e.entries=g?e.entries.concat(q):q,e.available=!!V.data.available,e.cap=V.data.max||e.cap,e.total=V.data.total||e.entries.length,e._autoLoading=!1,b()},V=>{e._autoLoading=!1,console.error(V)})}e.loadMore=()=>m(!0),e.canLoadMore=()=>e.entries.length<e.total;function w(){t.get("/api/admin/errors/stats").then(g=>{let C=g.data||{},M=C.prev24h?Math.round((C.last24h-C.prev24h)/C.prev24h*100):0;e.stats={last24h:C.last24h||0,prev24h:C.prev24h||0,delta:M,severity:C.severity||{error:0,warn:0,info:0},unique:C.unique||{error:0,warn:0,info:0},buckets:C.buckets||[],dropped:C.dropped||0},b()},g=>console.error(g))}function A(){m(),w()}e.barPx=(g,C)=>{let M=e.stats.buckets||[],V=0,q=0;for(let oe of M)V=Math.max(V,(oe.error||0)+(oe.warn||0)),q=Math.max(q,oe.info||0);let j=g[C]||0;if(!j)return 0;if(C==="info")return q?Math.max(2,Math.round(j/q*(V?16:60))):0;let ne=(g.error||0)+(g.warn||0),Y=Math.round(ne/V*44);return Math.max(4,Math.round(j/ne*Y))},e.bucketTitle=g=>`${new Date(g.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${g.error||0} err \xB7 ${g.warn||0} warn \xB7 ${g.info||0} info`,e.toggle=g=>{e.expanded[g._key]=!e.expanded[g._key]},e.setBucket=g=>{e.query.bucket=g},e.refreshNow=A,e.clearAll=()=>{confirm("Clear all captured errors?")&&t.delete("/api/admin/errors").then(A,g=>console.error(g))},e.exportCsv=()=>{let g=["ts","level","module","displayMessage","_status","_url","_repoId"],C=[g.join(",")];for(let j of e.visible)C.push(g.map(ne=>{let Y=j[ne]==null?"":String(j[ne]);return/[",\n]/.test(Y)?`"${Y.replace(/"/g,'""')}"`:Y}).join(","));let M=new Blob([C.join(`
`)],{type:"text/csv;charset=utf-8"}),V=URL.createObjectURL(M),q=document.createElement("a");q.href=V,q.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(q),q.click(),document.body.removeChild(q),URL.revokeObjectURL(V)};function S(g){e.copyHint=`${g} copied`,s.timeout(()=>{e.copyHint=""},1500)}e.copyJson=g=>{navigator.clipboard.writeText(g._detailJson).then(()=>S("JSON"))},e.copyCurl=g=>{if(!g._url)return;let M=`curl -X ${g._method||"GET"} '${window.location.origin}${g._url}'`;navigator.clipboard.writeText(M).then(()=>S("curl"))},A();let R=i(()=>{e.query.autoRefresh&&A()},15e3);e.on("dispose",()=>i.cancel(R)),e.watch("query.search",b),e.watch("query.bucket",b),e.watch("query.sort",b),e.watch("query.group",b)},bu=function(e,t,o,i){if(e.Math=Math,e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null){o.url("/");return}e.data=null,e.loading=!0,e.error=null,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(g){e.ovView=g;try{window.history.replaceState(null,"",g==="summary"?window.location.pathname:"#"+g)}catch{}};var s=!1;e.loadCache=function(){if(!s){s=!0;var g=e.cacheMinutes;t.get("/api/admin/cache",{params:{minutes:g}}).then(function(C){g===e.cacheMinutes&&(e.cacheReport=C.data,e.cacheError=C.data.available?null:C.data.reason||"Cache monitoring is unavailable.")},function(){e.cacheError="Could not refresh cache monitoring. Displayed values may be stale."}).finally(function(){s=!1,g!==e.cacheMinutes&&e.loadCache()})}},e.cacheRows=function(){return(e.cacheReport?.rows||[]).filter(function(g){return e.cacheTraffic==="all"||g.traffic===e.cacheTraffic})},e.cacheRate=function(g,C){var M=e.cacheRows(),V=function(ne){return M.filter(function(Y){return Y.name===ne}).reduce(function(Y,oe){return Y+oe[C]},0)},q=V(g+"_hit"),j=V(g+"_miss");return q+j?(100*q/(q+j)).toFixed(1)+"%":"No samples"},e.cacheEventName=function(g){return g.replaceAll("_"," ")},e.cacheP95=function(g){var C=0,M=e.cacheReport?.latencyBucketsMs||[];if(!g.count)return"No samples";if(!g.ms)return"Not timed";for(var V=0;V<=M.length;V++)if(C+=g["b"+V]||0,C>=Math.ceil(g.count*.95))return V<M.length?"\u2264 "+to(M[V]):"> 10\u202Fs";return"No samples"},e.healthAlert=function(){let g=e.data&&e.data.system||{},C=[["Memory",g.memPercent],["Disk",g.diskPercent]].filter(([,V])=>V>90);return C.length?C.map(([V,q])=>V+" is at "+q+"%").join(" and ")+". New anonymizations may fail until "+(C.length>1?"they drop.":"it drops."):""},e.performanceError=null,e.formatMs=function(g){return g==null?"":to(g)},e.latencyBound=function(g,C){return g.count?g[C]==null?"> 60\u202Fs":"\u2264 "+e.formatMs(g[C]):"No samples"},e.firstByteBound=function(g){return e.latencyBound({count:g.firstByteCount,p95UpperMs:g.firstByteP95UpperMs},"p95UpperMs")},e.sampleAge=function(g){return Math.max(0,Math.round((Date.now()-g.sampledAt)/1e3))},e.peakRss=function(g){return(e.performance.runtimeSeries||[]).filter(function(C){return C.instance===g.instance}).reduce(function(C,M){return Math.max(C,M.rss)},g.memory.rss)},e.performanceWarning=function(g){return e.sampleAge(g)>45||g.droppedBatches||g.droppedMetrics||g.sockets?.closeWait>0||g.eventLoop?.p95Ms>100||g.memoryLimitBytes&&g.memory.rss>g.memoryLimitBytes*.8};var r=!1;e.loadPerformance=function(){var g=e.performanceMinutes;e.performance?.windowMinutes&&e.performance.windowMinutes!==g&&(e.performance=null),!r&&(r=!0,t.get("/api/admin/performance",{params:{minutes:g}}).then(function(C){g===e.performanceMinutes&&(e.performance=C.data,e.performanceError=C.data.available?null:"Performance monitoring is unavailable. Request history may be incomplete.")},function(){g===e.performanceMinutes&&(e.performanceError="Could not refresh performance monitoring. Displayed samples may be stale.")}).finally(function(){r=!1,g!==e.performanceMinutes&&e.loadPerformance()}))};function a(g){if(g==null)return"\u2014";for(var C=["B","KB","MB","GB","TB"],M=0,V=g;V>=1024&&M<C.length-1;)V/=1024,M++;return V.toFixed(M>0?1:0).replace(/\.0$/,"")+" "+C[M]}e.humanBytes=a;function u(g){if(!g)return"\u2014";var C=Math.floor(g/86400),M=Math.floor(g%86400/3600),V=Math.floor(g%3600/60);return C>0?C+"d "+(M<10?"0":"")+M+"h":M>0?M+"h "+(V<10?"0":"")+V+"m":V+"m"}e.humanDuration=u;function p(g){return g==null?"\u2014":g>=1e6?(g/1e6).toFixed(1)+"M":g>=1e3?(g/1e3).toFixed(1)+"K":String(g)}e.humanNum=p,e.queueTotal=function(g){return g?(g.waiting||0)+(g.active||0)+(g.delayed||0)+(g.failed||0):0},e.statusCount=function(g){if(!e.data||!e.data.repos)return 0;for(var C=e.data.repos.statusBreakdown||[],M=0;M<C.length;M++)if(C[M]._id===g)return C[M].count;return 0},e.barPct=function(g){var C=e.data&&e.data.repos?e.data.repos.total:0;if(!C)return 0;var M=[g];g==="expired"&&M.push("expiring"),g==="removed"&&M.push("re Line truncated
`);t.innerHTML=o.map(i=>{let s=i.replace(/^(<[^>]+>)+/,"").charAt(0),r=i.startsWith("@@")?"hunk":s==="+"?"add":s==="-"?"remove":"";return`<span class="md-diff-line${r?" is-"+r:""}">${i||" "}</span>`}).join(`
`)}),Su=(e,t=0)=>{let o=(String(e).slice(t).match(/^[ \t]*/)[0]||"").replace(/\t/g," ").length;return Math.min(t+o+4,24)},Cs=e=>{e?.closest?.(".reviewer-preview")&&e.querySelectorAll("pre code").forEach(t=>{let o=t.querySelectorAll(".md-diff-line");if(o.length){o.forEach(s=>{s.classList.contains("is-hunk")||s.style.setProperty("--hang",Su(s.textContent,1)+"ch")});return}if(t.querySelector(".code-line"))return;let i=[];t.innerHTML=t.innerHTML.replace(/\n$/,"").split(`
`).map(s=>{let r=i.join("");s.replace(/<\/?span\b[^>]*>/g,u=>(u.startsWith("</")?i.pop():i.push(u),u));let a=s.replace(/<[^>]+>/g,"");return`<span class="code-line" style="--hang:${Su(a)}ch">${r}${s||" "}${"</span>".repeat(i.length)}</span>`}).join(`
`)})},Du={props:["content","terms","options"],setup(e){let t=Et(null),o=()=>{t.value.innerHTML=renderMD(e.content||"",window.location.pathname+"/../"),Ru(t.value),Cs(t.value)};return ln(()=>{o(),it(()=>[e.content,e.terms,e.options],o,{deep:!0})}),()=>Te("markdown",{ref:t})}},ng={props:["file","terms","options"],setup(e){let t=Et(null),o=()=>xe(()=>{t.value?.querySelectorAll("pre code").forEach(i=>window.Prism?.highlightElement(i)),Ru(t.value),Cs(t.value)});return ln(o),it(()=>[e.file?.content,e.terms,e.options],o,{deep:!0}),()=>{let i=e.file||{},s=(i.filename||"").split(".").pop().toLowerCase();if(["md","markdown"].includes(s)||i.language==="Markdown")return Te("gist-file",{ref:t},Te(Du,{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"},a=(i.language||s||"none").toLowerCase();return Te("gist-file",{ref:t},Te("pre",{class:"line-numbers"},Te("code",{class:"language-"+(r[a]||a),key:i.content},i.content||"")))}}},og=e=>e?.querySelectorAll(".nb-input pre").forEach(t=>{if(t.parentElement?.classList.contains("nb-code-scroll"))return;let o=document.createElement("div");o.className="nb-code-scroll",t.replaceWith(o),o.appendChild(t);let i=()=>{let s=t.scrollWidth-t.clientWidth>1;if(o.classList.toggle("is-overflowing",s),o.classList.toggle("is-at-end",s&&t.scrollLeft+t.clientWidth>=t.scrollWidth-2),!s)return;let r=t.clientWidth-16,a=Math.max(24,r*t.clientWidth/t.scrollWidth);o.style.setProperty("--thumb-w",a+"px"),o.style.setProperty("--thumb-x",(r-a)*t.scrollLeft/(t.scrollWidth-t.clientWidth)+"px")};t.addEventListener("scroll",i,{passive:!0}),window.ResizeObserver?new ResizeObserver(i).observe(t):i(),i()}),sg={props:["file","content"],setup(e){let t=Et(null),o=0,i,s=async()=>{let r=++o;i?.abort(),i=new AbortController;try{let a=e.content?JSON.parse(e.content):await fetch(e.file?.download_url||e.file,{signal:i.signal}).then(u=>{if(!u.ok)throw Error("Notebook request failed");return u.json()});if(await Bn("notebook"),r!==o)return;t.value.innerHTML=_i(DOMPurify.sanitize(nb.parse(a).render())),t.value.querySelectorAll("pre code").forEach(u=>window.Prism?.highlightElement(u)),og(t.value)}catch(a){r===o&&a.name!=="AbortError"&&(t.value.textContent="Unable to render the notebook.")}};return ln(()=>{s(),it(()=>[e.file,e.content],s)}),Qn(()=>{o++,i?.abort()}),()=>Te("notebook",{ref:t})}},ig={props:["stats"],setup(e){return()=>{let t=Object.entries(e.stats||{}).filter(([,i])=>i.code),o=t.reduce((i,[,s])=>i+s.code,0);return Te("loc",t.map(([i,s])=>Te("div",{class:"lang",title:`${i}: ${s.code.toLocaleString()} lines`,style:{width:s.code*100/o+"%",background:langColors[i]}})))}}},Au={Markdown:Du,GistFile:ng,Notebook:sg,Loc:ig,HtmlDoc:ku,QuotaUsage:eg,Pdfviewer:ql(async()=>(await Bn("pdf"),pdfjsLib.GlobalWorkerOptions.workerSrc="/script/external/pdf.worker.js",Cu))},Tu={async mounted(e,{value:t}){e._editorValue=t;try{if(await Us(),e._editorDisposed)return;let o=e._editorValue,i=ace.edit(e);e._editor=i,i.setValue(String(o.content??""),-1),Nu(e,o.options),e._editorCleanup=o.options?.onLoad?.(i)}catch(o){e._editorDisposed||(e.textContent=o.message)}},updated(e,{value:t}){e._editorValue=t,e._editor&&(e._editor.getValue()!==String(t.content??"")&&e._editor.setValue(String(t.content??""),-1),Nu(e,t.options))},beforeUnmount(e){e._editorDisposed=!0,e._editorCleanup?.(),e._editor?.destroy()}};function Nu(e,t={}){let o=tg.has(t.mode)?t.mode:"text";e._editor.session.setMode("ace/mode/"+o),t.theme&&e._editor.setTheme("ace/theme/"+t.theme),e._editor.setReadOnly(t.readOnly!==!1)}var Pu={mounted(e){if(!window.IntersectionObserver)return;let t=[...e.querySelectorAll('a[href^="#"]')],o=new Set,i=new IntersectionObserver(s=>{s.forEach(a=>a.isIntersecting?o.add(a.target.id):o.delete(a.target.id));let r=t.find(a=>o.has(a.hash.slice(1)));r&&t.forEach(a=>a.classList.toggle("active",a===r))},{rootMargin:"-20% 0px -60% 0px",threshold:0});xe(()=>{t.forEach(s=>{let r=document.getElementById(s.hash.slice(1));r&&i.observe(r)}),t[0]&&!t.some(s=>s.classList.contains("active"))&&t[0].classList.add("active")}),e._observer=i},beforeUnmount(e){e._observer?.disconnect()}};var ea=(e,t,o)=>{let i=e instanceof RegExp?Ou(e,o):e,s=t instanceof RegExp?Ou(t,o):t,r=i!==null&&s!=null&&rg(i,s,o);return r&&{start:r[0],end:r[1],pre:o.slice(0,r[0]),body:o.slice(r[0]+i.length,r[1]),post:o.slice(r[1]+s.length)}},Ou=(e,t)=>{let o=t.match(e);return o?o[0]:null},rg=(e,t,o)=>{let i,s,r,a,u,p=o.indexOf(e),y=o.indexOf(t,p+1),h=p;if(p>=0&&y>0){if(e===t)return[p,y];for(i=[],r=o.length;h>=0&&!u;){if(h===p)i.push(h),p=o.indexOf(e,h+1);else if(i.length===1){let b=i.pop();b!==void 0&&(u=[b,y])}else s=i.pop(),s!==void 0&&s<r&&(r=s,a=y),y=o.indexOf(t,h+1);h=p<y&&p>=0?p:y}i.length&&a!==void 0&&(u=[r,a])}return u};var Iu="\0SLASH"+Math.random()+"\0",Mu="\0OPEN"+Math.random()+"\0",sa="\0CLOSE"+Math.random()+"\0",_u="\0COMMA"+Math.random()+"\0",Vu="\0PE Line truncated
`)},aa=class{constructor(t){Je(this,"gen");Je(this,"threads",[]);Je(this,"match",!1);Je(this,"runs",[]);Je(this,"ids",[]);this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},Gu=(e,t)=>e.ids.length!==t.ids.length||e.runs.length!==t.runs.length||e.ids.some((o,i)=>o!==t.ids[i])?!1:e.runs.every(o=>t.runs.some(i=>i.neg===o.neg&&Gu(i.state,o.state))),Lu=e=>({has:new Float64Array(e),seen:new Float64Array(e),gen:0}),oo,_n,la,da,Rs=class{constructor(t,o,i){qe(this,_n);Je(this,"dots");Je(this,"dotStart");qe(this,oo);this.dots=t,this.dotStart=o,Ue(this,oo,i)}state(){return new aa(++ae(this,oo).gen)}done(t){return t.ids=t.threads.map(o=>o.id).sort((o,i)=>o-i),t.match&&t.ids.unshift(ra.id),t}restricted(t,o){return o&&(this.dots||this.dotStart&&t===0)}add(t,o,i,s){switch(o.t){case"split":if(!$e(this,_n,la).call(this,t,o))return;for(let a of o.out)this.add(t,a,i,s);return;case"neg":if(!$e(this,_n,la).call(this,t,o))return;let r=this.state();return this.add(r,o.sub,i,!1),this.done(r),this.addRun(t,{t:"run",neg:o,state:r},i,s);case"star":if(this.restricted(i,s))return;$e(this,_n,da).call(this,t,o)&&this.add(t,o.next,i,s);return;case"match":t.match=!0;return;default:$e(this,_n,da).call(this,t,o)}}addRun(t,o,i,s){for(let r of t.runs)if(r.neg===o.neg&&Gu(r.state,o.state))return;t.runs.push(o),o.state.match||this.add(t,o.neg.next,i,s)}step(t,o,i,s){let r=this.state();for(let a of t.threads)switch(a.t){case"lit":pa(a,o)&&this.add(r,a.next,i+1,s);break;case"any":this.restricted(i,s)||this.add(r,a.next,i+1,s);break;case"class":!this.restricted(i,s)&&a.re.test(o)&&this.add(r,a.next,i+1,s);break;case"star":this.restricted(i,s)||this.add(r,a,i+1,s)}if(!this.restricted(i,s))for(let a of t.runs){if(a.state.dead){this.addRun(r,a,i+1,s);continue}let u=this.step(a.state,o,i,!1);this.addRun(r,{t:"run",neg:a.neg,state:u},i+1,s)}return this.done(r)}};oo=new WeakMap,_n=new WeakSet,la=function(t,o){let{seen:i}=ae(this,oo);return i[o.id]===t.gen?!1:(i[o.id]=t.gen,!0)},da=function(t,o){let{has:i}=ae(this,oo);return i[o.id]===t.gen?!1:(i[o.id]=t.gen,t.threads.push(o),!0)};var Wu=e=>{let t=e.ids.join();if(!e.runs.length)return t;let o=e.runs.map(i=>`${i.neg.id}(${Wu(i.state)})`);return`${t}|${o.sort().join("|")}`},qg=1<<18,Oo,Io,Tn,so,Pn,On,In,Zt,ca,$i,Ku,ua=class{constructor(t,o){qe(this,Zt);qe(this,Oo);qe(this,Io,new Map);qe(this,Tn,0);qe(this,so);qe(this,Pn);qe(this,On);qe(this,In);Ue(this,Oo,t),Ue(this,On,new Rs(!1,!1,o)),Ue(this,In,new Rs(!1,!0,o))}start(t){if(t){if(ae(this,Pn))return ae(this,Pn);let i=ae(this,In).state();return ae(this,In).add(i,ae(this,Oo),0,!0),Ue(this,Pn,$e(this,Zt,ca).call(this,ae(this,In).done(i)))}if(ae(this,so))return ae(this,so);let o=ae(this,On).state();return ae(this,On).add(o,ae(this,Oo),0,!0),Ue(this,so,$e(this,Zt,$i).call(this,ae(this,On).done(o)))}next(t,o){let i=o.charCodeAt(0),s=i<128?void 0:t.next.get(o);if(s)return s;let r=t===ae(this,Pn)?$e(this,Zt,$i).call(this,ae(this,In).step(t.state,o,0,!0)):$e(this,Zt,$i).call(this,ae(this,On).step(t.state,o,1,!0));return i<128?(t.ascii||(t.ascii=new Array(128),Ue(this,Tn,ae(this,Tn)+128)),t.ascii[i]=r):t.next.set(o,r),Ma(this,Tn)._++,r}};Oo=new WeakMap,Io=new WeakMap,Tn=new WeakMap,so=new WeakMap,Pn=new WeakMap,On=new WeakMap,In=new WeakMap,Zt=new WeakSet,ca=function(t){return{state:t,match:t.match,dead:t.dead,next:new Map}},$i=function(t){let o=Wu(t),i=ae(this,Io).get(o);if(i)return i;ae(this,Tn)>qg&&$e(this,Zt,Ku).call(this);let s=$e(this,Zt,ca).call(this,t);return ae(this,Io).set(o,s),Ue(this,Tn,ae(this,Tn)+(o.length+1)),s},Ku=function(){ae(this,Io).clear(),Ue(this,Tn,0),Ue(this,so,void 0),Ue(this,Pn,void 0)};var $g=e=>{let t=[];for(let o=e;o.t!=="match";o=o.next){if(o.t==="split"||o.t==="neg")return;t.push(o)}return t},Lg=(e,t,o,i)=>{let s=0,r=o,a=-1,u=0;for(;r<i;){let p=e[s];if(p?.t==="star"){a=s++,u=r;continue}let y=t[r];if(p&&(p.t==="any"||p.t==="lit"&&pa(p,y)||p.t==="class"&&p.re.test(y))){s++,r++;continue}if(a===-1)return!1;s=a+1,r=++u}for(;e[s]?.t==="star";)s++;return s===e.length},Yu=e=>{let t=0,o=0;for(let i of e){let[s,r]=Ug(i);t+=s,o+=r}return[t,o]},Ug=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(Yu),o=Math.min(...t.map(r=>r[0])),i=Math.max(...t.map(r=>r[1])),s=i===0?0:1/0;return e.type==="@"?[o,i]:e.type==="?"?[0,i]:e.type==="*"?[0,s]:[o,s]},Uu=(e,t,o)=>{for(let i=0;i<e.length;i++)if(!pa(e[i],t[o+i]))return!1;return!0},Fg=/[/\ud800-\udfff]/,Bg=/[\ud800-\udfff]/,qi=e=>Bg.test(e)?[...e]:e,Fu=e=>{if(e.includes("/"))throw new Error("can only match a single path portion, got: "+e)},Mn,Mo,io,Li,ro,As,Ui,ao,Ts,Ps,Os,En,fn,_o,Vo,Is,Fi,Jt,lo,Ns,Ds=class{constructor(t,o={}){qe(this,lo);Je(this,"pattern");Je(this,"options");qe(this,Mn);qe(this,Mo);qe(this,io);qe(this,Li);qe(this,ro);qe(this,As,!1);qe(this,Ui);qe(this,ao);qe(this,Ts,!1);qe(this,Ps,0);qe(this,Os,1/0);qe(this,En,[]);qe(this,fn,[]);qe(this,_o);qe(this,Vo);qe(this,Is,!1);qe(this,Fi);qe(this,Jt);if(t.includes Line truncated
`).forEach((o,i)=>{let{term:s}=Sa(o.trim());if(!s)return;let r=[];for(let a=0;a<s.length;a++){if(s[a]==="\\"){a++;continue}cc.has(s[a])&&!r.includes(s[a])&&r.push(s[a])}r.length&&t.push({line:i,term:s,symbols:r})}),t}function fc(e,t){let o=String(e||"").split(`
`),i=o[t];if(i===void 0)return e;let{term:s}=Sa(i.trim());if(!s)return e;let r="";for(let u=0;u<s.length;u++){if(s[u]==="\\"){r+=s.slice(u,u+2),u++;continue}r+=cc.has(s[u])||s[u]==="."?"\\"+s[u]:s[u]}let a=i.indexOf(s);return o[t]=i.slice(0,a)+r+i.slice(a+s.length),o.join(`
`)}var po={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,b.options),u.restore()})}p();let y=null;e.saveDefault=h=>{if(h&&h.preventDefault&&h.preventDefault(),e.saving)return;let b=u.checkpoint(),m={terms:e.terms.split(`
`).map(w=>w.trim()).filter(w=>w.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",m).then(()=>{u.accept(b),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",y&&i.cancel(y),y=i(()=>{e.message=null},2500)},w=>{e.saving=!1;let A=w&&w.data&&w.data.error,S="Unable to save your defaults. Please try again.";Promise.all([o("ERRORS."+A),o("ERRORS.unknown_error")]).then(([R,g])=>{e.error=A&&R!==g?R: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."}))}},wc=function(e,t,o){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(i=>{o.url("/dashboard")},i=>{e.error=i.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},kc=function(e,t,o,i,s){e.user&&!e.user.status&&o.url("/dashboard"),e.watch("user.status",()=>{e.user&&!e.user.status&&o.url("/dashboard")}),e.features=[{key:"anonymize",num:"01",eyebrow:"Anonymize",title:"Double-anonymous,",accent:"your rules.",text:"Choose what reviewers may see: links, images, PDFs, notebooks, GitHub Pages. Add your own terms, with regex if you need it, and pick the expiration date.",cta:"Start an anonymization",href:"/anonymize",url:"anonymous.4open.science/anonymize",img:"/imgs/anonymize.png",alt:"The anonymize form: source repository, terms to redact, options and a live README preview"},{key:"review",num:"02",eyebrow:"Review",title:"Reviewers browse",accent:"the real thing.",text:"Highlighted source code, rendered PDFs, images, and notebooks, in a familiar file explorer. GitHub Pages is also supported.",cta:"Open the example",href:"https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/",target:"_self",url:"anonymous.4open.science/r/840c8c57-\u2026",img:"/imgs/explorer.png",alt:"The repository explorer with a file tree and a rendered README"},{key:"manage",num:"03",eyebrow:"Manage",title:"One dashboard,",accent:"until the decision.",text:"Monitor views, edit configuration, remove or update your repository. Program chairs can group submissions under a conference with one shared expiry.",cta:"Open the dashboard",href:"/dashboard",needsUser:!0,url:"anonymous.4open.science/dashboard",img:"/imgs/dashboard.png",alt:"The dashboard listing anonymized repositories with status, views and expiry"}],e.feature=e.features[0].key,e.selectFeature=function(u){e.feature=u},e.featureHref=function(u){return u.needsUser&&!e.user?"/signin":u.href},e.featureTarget=function(u){return u.needsUser&&!e.user?"_self":u.target||void 0},e.featureKeydown=function(u,p){let y={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[u.key];if(y===void 0)return;u.preventDefault();let h=e.features.length,b=y==="first"?0:y==="last"?h-1:(p+y+h)%h;e.feature=e.features[b].key,s(()=>{let m=i.document.getElementById("feature-tab-"+e.feature);m&&m.focus()})},e.demoText=`# DeepLearnUtils
`)],{type:"text/csv"}),m=document.createElement("a");m.href=URL.createObjectURL(N),m.download=i.username+"-repositories.csv",m.click()},e.showStatusMessage=g=>{let k=g.statusMessage||"(no message)";window.prompt(`Status message for ${g.repoId} (${g.status}):`,k)},e.fetchGithubInfo=g=>{let k=window.open("","_blank");k&&k.document.write("<pre>Loading GitHub info for "+g.repoId+"...</pre>"),t.get("/api/admin/repos/"+g.repoId+"/github").then(R=>{k&&(k.document.open(),k.document.write('<pre style="font:13px monospace;padding:16px;white-space:pre-wrap">'+JSON.stringify(R.data,null,2).replace(/[<>]/g,S=>S==="<"?"&lt;":"&gt;")+"</pre>"),k.document.close())},R=>{let S=R&&R.data?JSON.stringify(R.data,null,2):String(R);k&&(k.document.body.innerHTML='<pre style="color:#B42318;padding:16px">'+S+"</pre>")})};function u(g){t.get("/api/admin/users/"+g+"/repos",{}).then(k=>{e.repositories=k.data},k=>{console.error(k)})}function y(g){t.get("/api/admin/users/"+g,{}).then(k=>{e.userInfo=k.data},k=>{console.error(k)})}y(i.username),u(i.username),e.banUser=()=>{confirm(`Ban user ${i.username}?`)&&t.post(`/api/admin/users/${i.username}/ban`).then(()=>y(i.username),g=>console.error(g))},e.activateUser=()=>{t.post(`/api/admin/users/${i.username}/activate`).then(()=>y(i.username),g=>console.error(g))},e.promoteUser=()=>{confirm(`Promote ${i.username} to admin?`)&&t.post(`/api/admin/users/${i.username}/promote`).then(()=>y(i.username),g=>console.error(g))},e.demoteUser=()=>{confirm(`Remove admin privileges from ${i.username}?`)&&t.post(`/api/admin/users/${i.username}/demote`).then(()=>y(i.username),g=>console.error(g))},e.tokens=[],e.tokenForm={name:"",plaintext:null};function h(){t.get("/api/admin/tokens").then(g=>{e.tokens=g.data||[]},g=>{g.status!==401&&g.status!==403&&console.error(g)})}h(),e.createToken=()=>{e.tokenForm.name&&t.post("/api/admin/tokens",{name:e.tokenForm.name}).then(g=>{e.tokenForm.plaintext=g.data.token,e.tokenForm.name="",h()},g=>console.error(g))},e.revokeToken=g=>{confirm(`Revoke token "${g.name}"?`)&&t.delete("/api/admin/tokens/"+g.id).then(()=>h(),k=>console.error(k))},e.removeCache=g=>{confirm("Remove cached files for "+g.repoId+"?")&&t.delete("/api/admin/repos/"+g.repoId).then(()=>u(i.username),k=>console.error(k))},e.removeRepository=g=>{confirm("Remove repository "+g.repoId+"?")&&t.delete("/api/repo/"+g.repoId+"/").then(()=>u(i.username),k=>console.error(k))},e.updateRepository=g=>{let k=ot({title:`Refreshing ${g.repoId}...`,date:new Date,body:`The repository ${g.repoId} is going to be refreshed.`});e.toasts.push(k),t.post(`/api/repo/${g.repoId}/refresh`).then(R=>{R.data.status=="ready"?k.title=`${g.repoId} is refreshed.`:k.title=`Refreshing of ${g.repoId}.`},R=>{k.title=`Error during the refresh of ${g.repoId}.`,k.body=R.body})},e.getGitHubRepositories=g=>{t.get(`/api/user/${e.userInfo.username}/all_repositories`,{params:{force:"1"}}).then(k=>{e.userInfo.repositories=k.data})};let b=null;e.watch("query",()=>{s.timeout.cancel(b),b=s.timeout(()=>{u(i.username)},500)},!0)},Fu=function(e,t,o){let i=Rt(),s=Ut();e.Math=Math,e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null&&o.url("/"),e.conferences=[],e.total=-1,e.totalPage=0,e.statusCounts=[];let r=R=>{if(R.key==="/"&&!["INPUT","TEXTAREA","SELECT"].includes(document.activeElement?.tagName)){R.preventDefault();let S=document.querySelector('.admin-filter-toolbar input[type="search"]');S&&S.focus()}};s(document,"keydown",r),e.on("dispose",()=>document.removeEventListener("keydown",r)),e.clearFilter=R=>{R==="dateRange"?(e.query.dateFrom="",e.query.dateTo=""):e.query[R]="",e.query.page=1},e.chips=[];let d=()=>{let R=[];(e.query.dateFrom||e.query.dateTo)&&R.push({key:"dateRange",label:"Date",value:(e.query.dateFrom||"\u2026")+" \u2013 "+(e.query.dateTo||"\u2026")}),e.chips=R};e.statusCountFor=R=>{let S=(e.statusCounts||[]).find(N=>N._id===R);return S?S.count:0},e.toggleSortDirection=()=>{e.query.direction=e.query.direction==="asc"?"desc":"asc"},e.sortBy=R=>{e.query.sort===R?e.query.direction=e.query.direction==="asc"?"desc":"asc":(e.query.sort=R,e.query.direction="desc"),e.query.page=1},e.sortIcon=R=>e.query.sort===R?e.query.direction==="asc"?"fa-arrow-up":"fa-arrow-down":"";let c="admin.conferences.filterPrefs",u={page:1,limit:25,sort:"name",direction:"asc",search:"",dateFrom:"",dateTo:"",ready:!0,expired:!0,removed:!0,error:!0,preparing:!0},y=loadFilterPrefs(c)||{};e.query=Object.assign({},u,y,{page:1,search:""});let h=o.search();h.search&&(e.query.search=h.search);let b="admin.conferences.presets";e.presets=JSON.parse(localStorage.getItem(b)||"[]"),e.savePreset=()=>{let R=window.prompt("Preset name:");if(!R)return;let S=Object.assign({},e.query);delete S.page,e.presets=(e.presets||[]).filter(N=>N.name!==R),e.presets.push({name:R,query:S}),localStorage.setItem(b,JSON.stringify(e.presets))},e.applyPreset=R=>{Object.assign(e.query,R.query,{page:1})},e.deletePreset=R=>{e.presets=(e.presets||[]).filter(S=>S.name!==R.name),localStorage.setItem(b,JS Line truncated
`).map((ne,Y)=>Y===0?ne:ie+ne).join(`
`)}else typeof O=="number"||typeof O=="boolean"?K=String(O):K=JSON.stringify(O);ee.push(`${q}${K}${z}`)}),ee.push("}"),ee.join(`
`)}function y(m){let E=[],M="",_=/(\w+):(>=|<=|!=|>|<|=)?([^\s]+)/g,V=0,G;for(;G=_.exec(m);)M+=m.slice(V,G.index),V=_.lastIndex,E.push({key:G[1],op:G[2]||"=",val:G[3]});return M+=m.slice(V),{filters:E,free:M.trim().toLowerCase()}}function h(m,E){for(let M of E.filters){let _=(G,ee,X)=>{let O=parseFloat(G),U=parseFloat(ee);return X==="="?String(G)===String(ee):X==="!="?String(G)!==String(ee):X===">="?O>=U:X==="<="?O<=U:X===">"?O>U:X==="<"?O<U:!0},V;if(M.key==="code")V=m.displayMessage;else if(M.key==="module")V=m.module;else if(M.key==="status")V=m._status;else if(M.key==="url")V=m._url;else if(M.key==="repo")V=m._repoId;else if(M.key==="level")V=m.level;else continue;if(V==null||!_(V,M.val,M.op))return!1}return!(E.free&&((m.displayMessage||"")+" "+(m.module||"")+" "+(m._url||"")+" "+JSON.stringify(m.raw||[])).toLowerCase().indexOf(E.free)===-1)}function b(){let m=y(e.query.search||"");e.parsedFilterCount=m.filters.length;let E=e.query.bucket,M=e.entries.filter(X=>E&&X._bucket!==E?!1:h(X,m)),_=e.query.group;if(_){let X=C=>_==="module"?C.module:C.displayMessage||C.message||"_",O=new Map;for(let C of M){let q=X(C);if(O.has(q)){let z=O.get(q);z.count++,z._related.push(C),new Date(C.ts)>new Date(z.ts)&&(z.ts=C.ts,z._url=C._url,z._status=C._status),new Date(C.ts)<new Date(z._firstSeen)&&(z._firstSeen=C.ts)}else{let z=Object.assign({},C);z._key=`${_}:${q}`,z._related=[C],z._firstSeen=C.ts,z._lastHourCount=0,z.count=1,O.set(q,z)}}let U=Date.now()-3600*1e3;for(let C of O.values())C._lastHourCount=C._related.filter(q=>new Date(q.ts).getTime()>=U).length;M=Array.from(O.values())}else M=M.map((X,O)=>(X._key="row:"+O+":"+X.ts,X._related=[X],X._firstSeen=X.ts,X._lastHourCount=0,X.count=1,X));let V=X=>({error:0,warn:1,info:2})[X._bucket]??1;e.query.sort==="count"?M.sort((X,O)=>V(X)-V(O)||O.count-X.count||new Date(O.ts)-new Date(X.ts)):M.sort((X,O)=>V(X)-V(O)||new Date(O.ts)-new Date(X.ts)),e.visible=M;let G=!!(e.query.bucket||(e.query.search||"").trim()),ee=!G&&(e.stats?.severity?.error||0)>0&&!M.some(X=>X._bucket==="error")&&e.entries.length<1500;(G&&!M.length||ee)&&e.canLoadMore?.()&&!e._autoLoading&&e.entries.length<2500&&(e._autoLoading=!0,g(!0))}function g(m){let E=m?e.entries.length:0,M=m?e.pageSize:Math.max(e.pageSize,e.entries.length||e.pageSize);t.get("/api/admin/errors",{params:{offset:E,limit:M}}).then(_=>{let V=(_.data.entries||[]).map(c);e.entries=m?e.entries.concat(V):V,e.available=!!_.data.available,e.cap=_.data.max||e.cap,e.total=_.data.total||e.entries.length,e._autoLoading=!1,b()},_=>{e._autoLoading=!1,console.error(_)})}e.loadMore=()=>g(!0),e.canLoadMore=()=>e.entries.length<e.total;function k(){t.get("/api/admin/errors/stats").then(m=>{let E=m.data||{},M=E.prev24h?Math.round((E.last24h-E.prev24h)/E.prev24h*100):0;e.stats={last24h:E.last24h||0,prev24h:E.prev24h||0,delta:M,severity:E.severity||{error:0,warn:0,info:0},unique:E.unique||{error:0,warn:0,info:0},buckets:E.buckets||[],dropped:E.dropped||0},b()},m=>console.error(m))}function R(){g(),k()}e.barPx=(m,E)=>{let M=e.stats.buckets||[],_=0,V=0;for(let O of M)_=Math.max(_,(O.error||0)+(O.warn||0)),V=Math.max(V,O.info||0);let G=m[E]||0;if(!G)return 0;if(E==="info")return V?Math.max(2,Math.round(G/V*(_?16:60))):0;let ee=(m.error||0)+(m.warn||0),X=Math.round(ee/_*44);return Math.max(4,Math.round(G/ee*X))},e.bucketTitle=m=>`${new Date(m.hour).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})} \xB7 ${m.error||0} err \xB7 ${m.warn||0} warn \xB7 ${m.info||0} info`,e.toggle=m=>{e.expanded[m._key]=!e.expanded[m._key]},e.setBucket=m=>{e.query.bucket=m},e.refreshNow=R,e.clearAll=()=>{confirm("Clear all captured errors?")&&t.delete("/api/admin/errors").then(R,m=>console.error(m))},e.exportCsv=()=>{let m=["ts","level","module","displayMessage","_status","_url","_repoId"],E=[m.join(",")];for(let G of e.visible)E.push(m.map(ee=>{let X=G[ee]==null?"":String(G[ee]);return/[",\n]/.test(X)?`"${X.replace(/"/g,'""')}"`:X}).join(","));let M=new Blob([E.join(`
`)],{type:"text/csv;charset=utf-8"}),_=URL.createObjectURL(M),V=document.createElement("a");V.href=_,V.download=`errors-${new Date().toISOString().slice(0,19)}.csv`,document.body.appendChild(V),V.click(),document.body.removeChild(V),URL.revokeObjectURL(_)};function S(m){e.copyHint=`${m} copied`,s.timeout(()=>{e.copyHint=""},1500)}e.copyJson=m=>{navigator.clipboard.writeText(m._detailJson).then(()=>S("JSON"))},e.copyCurl=m=>{if(!m._url)return;let M=`curl -X ${m._method||"GET"} '${window.location.origin}${m._url}'`;navigator.clipboard.writeText(M).then(()=>S("curl"))},R();let N=i(()=>{e.query.autoRefresh&&R()},15e3);e.on("dispose",()=>i.cancel(N)),e.watch("query.search",b),e.watch("query.bucket",b),e.watch("query.sort",b),e.watch("query.group",b)},zu=function(e,t,o,i){if(e.Math=Math,e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null){o.url("/");return}e.data=null,e.loading=!0,e.error=null,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(m){e.ovView=m;try{window.history.replaceState(null,"",m==="summary"?window.location.pathname:"#"+m)}catch{}};var s=!1;e.loadCache=function(){if(!s){s=!0;var m=e.cacheMinutes;t.get("/api/admin/cache",{params:{minutes:m}}).then(function(E){m===e.cacheMinutes&&(e.cacheReport=E.data,e.cacheError=E.data.available?null:E.data.reason||"Cache monitoring is unavailable.")},function(){e.cacheError="Could not refresh cache monitoring. Displayed values may be stale."}).finally(function(){s=!1,m!==e.cacheMinutes&&e.loadCache()})}},e.cacheRows=function(){return(e.cacheReport?.rows||[]).filter(function(m){return e.cacheTraffic==="all"||m.traffic===e.cacheTraffic})},e.cacheRate=function(m,E){var M=e.cacheRows(),_=function(ee){return M.filter(function(X){return X.name===ee}).reduce(function(X,O){return X+O[E]},0)},V=_(m+"_hit"),G=_(m+"_miss");return V+G?(100*V/(V+G)).toFixed(1)+"%":"No samples"},e.cacheEventName=function(m){return m.replaceAll("_"," ")},e.cacheP95=function(m){var E=0,M=e.cacheReport?.latencyBucketsMs||[];if(!m.count)return"No samples";if(!m.ms)return"Not timed";for(var _=0;_<=M.length;_++)if(E+=m["b"+_]||0,E>=Math.ceil(m.count*.95))return _<M.length?"\u2264 "+uo(M[_]):"> 10\u202Fs";return"No samples"},e.healthAlert=function(){let m=e.data&&e.data.system||{},E=[["Memory",m.memPercent],["Disk",m.diskPercent]].filter(([,_])=>_>90);return E.length?E.map(([_,V])=>_+" is at "+V+"%").join(" and ")+". New anonymizations may fail until "+(E.length>1?"they drop.":"it drops."):""},e.performanceError=null,e.formatMs=function(m){return m==null?"":uo(m)},e.latencyBound=function(m,E){return m.count?m[E]==null?"> 60\u202Fs":"\u2264 "+e.formatMs(m[E]):"No samples"},e.firstByteBound=function(m){return e.latencyBound({count:m.firstByteCount,p95UpperMs:m.firstByteP95UpperMs},"p95UpperMs")},e.sampleAge=function(m){return Math.max(0,Math.round((Date.now()-m.sampledAt)/1e3))},e.peakRss=function(m){return(e.performance.runtimeSeries||[]).filter(function(E){return E.instance===m.instance}).reduce(function(E,M){return Math.max(E,M.rss)},m.memory.rss)},e.performanceWarning=function(m){return e.sampleAge(m)>45||m.droppedBatches||m.droppedMetrics||m.sockets?.closeWait>0||m.eventLoop?.p95Ms>100||m.memoryLimitBytes&&m.memory.rss>m.memoryLimitBytes*.8};var r=!1;e.loadPerformance=function(){var m=e.performanceMinutes;e.performance?.windowMinutes&&e.performance.windowMinutes!==m&&(e.performance=null),!r&&(r=!0,t.get("/api/admin/performance",{params:{minutes:m}}).then(function(E){m===e.performanceMinutes&&(e.performance=E.data,e.performanceError=E.data.available?null:"Performance monitoring is unavailable. Request history may be incomplete.")},function(){m===e.performanceMinutes&&(e.performanceError="Could not refresh performance monitoring. Displayed samples may be stale.")}).finally(function(){r=!1,m!==e.performanceMinutes&&e.loadPerformance()}))};function d(m){if(m==null)return"\u2014";for(var E=["B","KB","MB","GB","TB"],M=0,_=m;_>=1024&&M<E.length-1;)_/=1024,M++;return _.toFixed(M>0?1:0).replace(/\.0$/,"")+" "+E[M]}e.humanBytes=d;function c(m){if(!m)return"\u2014";var E=Math.floor(m/86400),M=Math.floor(m%86400/3600),_=Math.floor(m%3600/60);return E>0?E+"d "+(M<10?"0":"")+M+"h":M>0?M+"h "+(_<10?"0":"")+_+"m":_+"m"}e.humanDuration=c;function u(m){return m==null?"\u2014":m>=1e6?(m/1e6).toFixed(1)+"M":m>=1e3?(m/1e3).toFixed(1)+"K":String(m)}e.humanNum=u,e.queueTotal=function(m){return m?(m.waiting||0)+(m.active||0)+(m.delayed||0)+(m.failed||0):0},e.statusCount=function(m){if(!e.data||!e.data.repos)return 0;for(var E=e.data.repos.statusBreakdown||[],M=0;M<E.length;M++)if(E[M]._id===m)return E[M].count;return 0},e.barPct=function(m){var E=e.data&&e.data.repos?e.data.repos.total:0;if(!E)return 0;var M=[m];m==="expired"&&M.push("expiring"),m==="removed"&&M.push("remo Line truncated
`)},Pa=class{constructor(t){xe(this,"gen");xe(this,"threads",[]);xe(this,"match",!1);xe(this,"runs",[]);xe(this,"ids",[]);this.gen=t}get dead(){return!this.threads.length&&!this.match&&!this.runs.length}},sc=(e,t)=>e.ids.length!==t.ids.length||e.runs.length!==t.runs.length||e.ids.some((o,i)=>o!==t.ids[i])?!1:e.runs.every(o=>t.runs.some(i=>i.neg===o.neg&&sc(i.state,o.state))),Ju=e=>({has:new Float64Array(e),seen:new Float64Array(e),gen:0}),po,Un,Aa,Ta,Us=class{constructor(t,o,i){_e(this,Un);xe(this,"dots");xe(this,"dotStart");_e(this,po);this.dots=t,this.dotStart=o,Le(this,po,i)}state(){return new Pa(++re(this,po).gen)}done(t){return t.ids=t.threads.map(o=>o.id).sort((o,i)=>o-i),t.match&&t.ids.unshift(Da.id),t}restricted(t,o){return o&&(this.dots||this.dotStart&&t===0)}add(t,o,i,s){switch(o.t){case"split":if(!Ve(this,Un,Aa).call(this,t,o))return;for(let d of o.out)this.add(t,d,i,s);return;case"neg":if(!Ve(this,Un,Aa).call(this,t,o))return;let r=this.state();return this.add(r,o.sub,i,!1),this.done(r),this.addRun(t,{t:"run",neg:o,state:r},i,s);case"star":if(this.restricted(i,s))return;Ve(this,Un,Ta).call(this,t,o)&&this.add(t,o.next,i,s);return;case"match":t.match=!0;return;default:Ve(this,Un,Ta).call(this,t,o)}}addRun(t,o,i,s){for(let r of t.runs)if(r.neg===o.neg&&sc(r.state,o.state))return;t.runs.push(o),o.state.match||this.add(t,o.neg.next,i,s)}step(t,o,i,s){let r=this.state();for(let d of t.threads)switch(d.t){case"lit":Ma(d,o)&&this.add(r,d.next,i+1,s);break;case"any":this.restricted(i,s)||this.add(r,d.next,i+1,s);break;case"class":!this.restricted(i,s)&&d.re.test(o)&&this.add(r,d.next,i+1,s);break;case"star":this.restricted(i,s)||this.add(r,d,i+1,s)}if(!this.restricted(i,s))for(let d of t.runs){if(d.state.dead){this.addRun(r,d,i+1,s);continue}let c=this.step(d.state,o,i,!1);this.addRun(r,{t:"run",neg:d.neg,state:c},i+1,s)}return this.done(r)}};po=new WeakMap,Un=new WeakSet,Aa=function(t,o){let{seen:i}=re(this,po);return i[o.id]===t.gen?!1:(i[o.id]=t.gen,!0)},Ta=function(t,o){let{has:i}=re(this,po);return i[o.id]===t.gen?!1:(i[o.id]=t.gen,t.threads.push(o),!0)};var ic=e=>{let t=e.ids.join();if(!e.runs.length)return t;let o=e.runs.map(i=>`${i.neg.id}(${ic(i.state)})`);return`${t}|${o.sort().join("|")}`},Kg=1<<18,zo,Ho,Vn,fo,qn,$n,Ln,nn,Ia,xi,rc,Oa=class{constructor(t,o){_e(this,nn);_e(this,zo);_e(this,Ho,new Map);_e(this,Vn,0);_e(this,fo);_e(this,qn);_e(this,$n);_e(this,Ln);Le(this,zo,t),Le(this,$n,new Us(!1,!1,o)),Le(this,Ln,new Us(!1,!0,o))}start(t){if(t){if(re(this,qn))return re(this,qn);let i=re(this,Ln).state();return re(this,Ln).add(i,re(this,zo),0,!0),Le(this,qn,Ve(this,nn,Ia).call(this,re(this,Ln).done(i)))}if(re(this,fo))return re(this,fo);let o=re(this,$n).state();return re(this,$n).add(o,re(this,zo),0,!0),Le(this,fo,Ve(this,nn,xi).call(this,re(this,$n).done(o)))}next(t,o){let i=o.charCodeAt(0),s=i<128?void 0:t.next.get(o);if(s)return s;let r=t===re(this,qn)?Ve(this,nn,xi).call(this,re(this,Ln).step(t.state,o,0,!0)):Ve(this,nn,xi).call(this,re(this,$n).step(t.state,o,1,!0));return i<128?(t.ascii||(t.ascii=new Array(128),Le(this,Vn,re(this,Vn)+128)),t.ascii[i]=r):t.next.set(o,r),nl(this,Vn)._++,r}};zo=new WeakMap,Ho=new WeakMap,Vn=new WeakMap,fo=new WeakMap,qn=new WeakMap,$n=new WeakMap,Ln=new WeakMap,nn=new WeakSet,Ia=function(t){return{state:t,match:t.match,dead:t.dead,next:new Map}},xi=function(t){let o=ic(t),i=re(this,Ho).get(o);if(i)return i;re(this,Vn)>Kg&&Ve(this,nn,rc).call(this);let s=Ve(this,nn,Ia).call(this,t);return re(this,Ho).set(o,s),Le(this,Vn,re(this,Vn)+(o.length+1)),s},rc=function(){re(this,Ho).clear(),Le(this,Vn,0),Le(this,fo,void 0),Le(this,qn,void 0)};var Yg=e=>{let t=[];for(let o=e;o.t!=="match";o=o.next){if(o.t==="split"||o.t==="neg")return;t.push(o)}return t},Xg=(e,t,o,i)=>{let s=0,r=o,d=-1,c=0;for(;r<i;){let u=e[s];if(u?.t==="star"){d=s++,c=r;continue}let y=t[r];if(u&&(u.t==="any"||u.t==="lit"&&Ma(u,y)||u.t==="class"&&u.re.test(y))){s++,r++;continue}if(d===-1)return!1;s=d+1,r=++c}for(;e[s]?.t==="star";)s++;return s===e.length},ac=e=>{let t=0,o=0;for(let i of e){let[s,r]=Qg(i);t+=s,o+=r}return[t,o]},Qg=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(ac),o=Math.min(...t.map(r=>r[0])),i=Math.max(...t.map(r=>r[1])),s=i===0?0:1/0;return e.type==="@"?[o,i]:e.type==="?"?[0,i]:e.type==="*"?[0,s]:[o,s]},Zu=(e,t,o)=>{for(let i=0;i<e.length;i++)if(!Ma(e[i],t[o+i]))return!1;return!0},Jg=/[/\ud800-\udfff]/,Zg=/[\ud800-\udfff]/,Zi=e=>Zg.test(e)?[...e]:e,xu=e=>{if(e.includes("/"))throw new Error("can only match a single path portion, got: "+e)},Fn,jo,ho,er,mo,zs,tr,go,Hs,js,Gs,Dn,vn,Go,Wo,Ws,nr,tn,vo,Fs,Bs=class{constructor(t,o={}){_e(this,vo);xe(this,"pattern");xe(this,"options");_e(this,Fn);_e(this,jo);_e(this,ho);_e(this,er);_e(this,mo);_e(this,zs,!1);_e(this,tr);_e(this,go);_e(this,Hs,!1);_e(this,js,0);_e(this,Gs,1/0);_e(this,Dn,[]);_e(this,vn,[]);_e(this,Go);_e(this,Wo);_e(this,Ws,!1);_e(this,nr);_e(this,tn);if(t.includes Line truncated
`).forEach((o,i)=>{let{term:s}=Ga(o.trim());if(!s)return;let r=[];for(let d=0;d<s.length;d++){if(s[d]==="\\"){d++;continue}Sc.has(s[d])&&!r.includes(s[d])&&r.push(s[d])}r.length&&t.push({line:i,term:s,symbols:r})}),t}function Rc(e,t){let o=String(e||"").split(`
`),i=o[t];if(i===void 0)return e;let{term:s}=Ga(i.trim());if(!s)return e;let r="";for(let c=0;c<s.length;c++){if(s[c]==="\\"){r+=s.slice(c,c+2),c++;continue}r+=Sc.has(s[c])||s[c]==="."?"\\"+s[c]:s[c]}let d=i.indexOf(s);return o[t]=i.slice(0,d)+r+i.slice(d+s.length),o.join(`
`)}var Wn={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,b.options),c.restore()})}u();let y=null;e.saveDefault=h=>{if(h&&h.preventDefault&&h.preventDefault(),e.saving)return;let b=c.checkpoint(),g={terms:e.terms.split(`
`).map(k=>k.trim()).filter(k=>k.length>0),options:e.options};e.saving=!0,e.error=null,t.post("/api/user/default",g).then(()=>{c.accept(b),e.saving=!1,e.message=e.unsavedChanges?null:"Saved",y&&i.cancel(y),y=i(()=>{e.message=null},2500)},k=>{e.saving=!1;let R=k&&k.data&&k.data.error,S="Unable to save your defaults. Please try again.";Promise.all([o("ERRORS."+R),o("ERRORS.unknown_error")]).then(([N,m])=>{e.error=R&&N!==m?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."}))}},Mc=function(e,t,o){e.repoId=null,e.repoUrl=null,e.claim=()=>{t.post("/api/repo/claim",{repoId:e.repoId,repoUrl:e.repoUrl}).then(i=>{o.url("/dashboard")},i=>{e.error=i.data,e.claimForm.repoUrl.setValidity("not_found",!1),e.claimForm.repoId.setValidity("not_found",!1)})}},_c=function(e,t,o,i,s){e.user&&!e.user.status&&o.url("/dashboard"),e.watch("user.status",()=>{e.user&&!e.user.status&&o.url("/dashboard")}),e.features=[{key:"anonymize",num:"01",eyebrow:"Anonymize",title:"Double-anonymous,",accent:"your rules.",text:"Choose what reviewers may see: links, images, PDFs, notebooks, GitHub Pages. Add your own terms, with regex if you need it, and pick the expiration date.",cta:"Start an anonymization",href:"/anonymize",url:"anonymous.4open.science/anonymize",img:"/imgs/anonymize.png",alt:"The anonymize form: source repository, terms to redact, options and a live README preview"},{key:"review",num:"02",eyebrow:"Review",title:"Reviewers browse",accent:"the real thing.",text:"Highlighted source code, rendered PDFs, images, and notebooks, in a familiar file explorer. GitHub Pages is also supported.",cta:"Open the example",href:"https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/",target:"_self",url:"anonymous.4open.science/r/840c8c57-\u2026",img:"/imgs/explorer.png",alt:"The repository explorer with a file tree and a rendered README"},{key:"manage",num:"03",eyebrow:"Manage",title:"One dashboard,",accent:"until the decision.",text:"Monitor views, edit configuration, remove or update your repository. Program chairs can group submissions under a conference with one shared expiry.",cta:"Open the dashboard",href:"/dashboard",needsUser:!0,url:"anonymous.4open.science/dashboard",img:"/imgs/dashboard.png",alt:"The dashboard listing anonymized repositories with status, views and expiry"}],e.feature=e.features[0].key,e.selectFeature=function(c){e.feature=c},e.featureHref=function(c){return c.needsUser&&!e.user?"/signin":c.href},e.featureTarget=function(c){return c.needsUser&&!e.user?"_self":c.target||void 0},e.featureKeydown=function(c,u){let y={ArrowDown:1,ArrowRight:1,ArrowUp:-1,ArrowLeft:-1,Home:"first",End:"last"}[c.key];if(y===void 0)return;c.preventDefault();let h=e.features.length,b=y==="first"?0:y==="last"?h-1:(u+y+h)%h;e.feature=e.features[b].key,s(()=>{let g=i.document.getElementById("feature-tab-"+e.feature);g&&g.focus()})},e.demoText=`# DeepLearnUtils
Developed by Jane Smith at MIT CSAIL.
See Smith et al., "Attention That Works," 2026.
Contact: jane.smith@mit.edu`,e.demoTerms="Jane Smith, Smith, MIT CSAIL, jane.smith@mit.edu",e.demoParts=function(){let u=(e.demoTerms||"").split(/[,\n]/).map(m=>m.trim()).filter(Boolean).sort((m,w)=>w.length-m.length),p=m=>m.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!u.length)return[{text:e.demoText}];let y=new RegExp("("+u.map(p).join("|")+")","gi"),h={},b=0;return(e.demoText||"").split(y).filter(m=>m!=="").map(m=>{let w=u.find(A=>A.toLowerCase()===m.toLowerCase());return w?(h[w.toLowerCase()]||(h[w.toLowerCase()]=++b),{text:String(h[w.toLowerCase()]),redacted:!0,original:m}):{text:m}})},e.demoCount=()=>e.demoParts().filter(u=>u.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(u=>!u.total);function r(){t.get("/api/stat/").then(u=>{e.stat=u.data,e.cards[0].total=u.data.nbRepositories,e.cards[1].total=u.data.nbUsers,e.cards[2].total=u.data.nbPageViews,e.cards[3].total=u.data.nbPullRequests}).catch(()=>{})}r();function a(u){let p={series:u,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!u||u.length<2)return p;let y=new Array(u.length-1);for(let S=1;S<u.length;S++)y[S-1]=u[S]-u[S-1];let h=y.length,b=Math.max.apply(null,y),m=Math.min.apply(null,y),w=Math.min(0,m),A=b-w||1;p.viewW=h*2,p.bars=new Array(h);for(let S=0;S<h;S++){let R=(y[S]-w)/A,g=Math.max(1.5,R*34);p.bars[S]={x:(S*2+.25).toFixed(2),y:(36-g).toFixed(2),w:"1.5",h:g.toFixed(2)}}if(p.deltaToday=y[h-1],h>=2){let S=y[h-2];S&&(p.pctChange=(p.deltaToday-S)/S*100)}return p.pctAbs=Math.round(Math.abs(p.pctChange)),p.isUp=p.pctChange>=0,p}e.history={repositories:a([]),users:a([]),pageViews:a([]),pullRequests:a([])},t.get("/api/stat/history?days=60").then(u=>{let p=u.data||[];e.history={repositories:a(p.map(y=>y.nbRepositories||0)),users:a(p.map(y=>y.nbUsers||0)),pageViews:a(p.map(y=>y.nbPageViews||0)),pullRequests:a(p.map(y=>y.nbPullRequests||0))}}).catch(()=>{})},Cc=function(e,t,o,i,s,r){let a=Tt();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null&&o.url("/"),a.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,xe(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Qt()(document,"click",D=>{e.quotaExpanded&&!D.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=D=>D.status==="error"||D._broken||p(D.status)==="progress"&&D._stale,e.attentionCount=()=>e.dashboardTotals?.attention??e.items.filter(e.needsAttention).length,e.hasProjects=()=>(e.dashboardTotals?.total??e.items.length)>0,e.setProjectView=D=>{e.projectView=D,D==="attention"&&(e.filters.status.error=!0,e.filters.status.progress=!0)},e.idleText=D=>{let te=Qr(D?.anonymizeDate||D?.lastView)||"";return/ ago$/.test(te)?"No activity for "+te.replace(/ ago$/,""):"No activity since "+te.replace(", "+new Date().getFullYear(),"")},e.projectDetailsId=D=>"project-details-"+encodeURIComponent(D._type+":"+(D._id||D._source||"unknown")),e.showProjectDetails=async D=>{e.selectedProject=D,e.projectName=D.projectName||"",e.nameError="",e.nameMessage="",await xe();let te=document.getElementById(e.projectDetailsId(D));te?.focus(),te?.scrollIntoView?.({block:"nearest"})},e.closeProjectDetails=D=>{e.selectedProject=null,xe(()=>document.querySelector(`[data-project-actions="${encodeURIComponent(D._type+":"+D._id)}"]`)?.focus())},e.saveProjectName=async D=>{if(e.nameSaving||!D._id)return;let te=e.projectName.trim();if(te.length>100){e.nameError="Use 100 characters or fewer.";return}e.nameSaving=!0,e.nameError="",e.nameMessage="";try{let ue=await t.post("/api/user/project-name",{type:D._type,id:D._id,name:te});D.projectName=ue.data.name,D._label=D.projectName||D._fallbackLabel,e.selectedProject===D&&(e.nameMessage=te?"Project name saved.":"Default project name restored."),C||(e.dashboardCursor=null,await V(),e.selectedProject===D&&(e.selectedProject=e.items.find(Pe=>Pe._type===D._type&&Pe._id===D._id)||null))}catch{e.selectedProject===D&&(e.nameError="The project name could not be saved. Try again.")}finally{e.nameSaving=!1}},e.copyingId=null,e.copyLink=async D=>{if(!D._viewUrl||e.copyingId)return;let te=new URL(D._viewUrl,s.location.origin).href;e.copyingId=D._type+":"+D._id;try{await Ra(te),e.addToast({title:"Link copied",body:"The anonymous link is ready to share."})}catch{e.addToast({title:"Copy this anonymous link",body:te})}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 u=["queue","download","downloaded","preparing","anon Line truncated
`)),e.options=Object.assign({},e.options,z.options),e.options.expirationDate=z.options&&z.options.expirationDate?new Date(z.options.expirationDate):ne(),!i.repoId&&!i.pullRequestId&&!i.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),k&&k()})}function J(k,_,z){e.anonymize&&e.anonymize[k]&&e.anonymize[k].setValidity(_,z)}function ce(k){try{let _=parseGithubUrl(k);if(_&&_.owner&&_.repo)return _.owner+"/"+_.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"||ce(e.sourceUrl)!==e._originalFullName)return;e.repairingGitHubAccess=!0,e.accessRepairMessage="";let k=m();try{let _=await t.get("/github/connections");if(e.githubConnections=_.data,!_.data.appEnabled)return;let z=await t.post("/github/connections/migrate",{type:"repository",id:i.repoId,connection:"github-app"},{headers:{"X-CSRF-Token":_.data.csrf}});if(!b(k))return;e.error=null,z.data.fullName&&(e._originalFullName=z.data.fullName,e.source.fullName=z.data.fullName,e.sourceUrl="https://github.com/"+z.data.fullName),e.accessRepairMessage="GitHub access repaired. Your anonymous URL and published commit are unchanged.",await e.urlSelected(!0)}catch{b(k)&&(e.accessRepairMessage="Unable to repair GitHub access. Check the App's repository permissions in Manage access, then retry. Your published snapshot has not been replaced.")}finally{e.repairingGitHubAccess=!1,w(k)}},e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,e.reconnectSource=async()=>{if(confirm("Reconnect to the repository currently at this GitHub URL? Review its branch and commit before saving. Saving will replace the published snapshot.")){e.reconnectingSource=!0,e.reconnectRepositoryId=void 0,e.source.commit="",e.source.branch="",e.readme="",e.branches=[];try{await st()}catch{}}};function ke(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:ce(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function De(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function et(){let k=new URLSearchParams(window.location.search).get("billingDraft");if(k){R.restore();try{let z=(await t.get("/api/billing/draft/"+encodeURIComponent(k))).data;if(z.path!==s.path())throw new Error("Wrong task");g=z.values.conference||null;for(let x of["sourceUrl","terms","repoId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(z.values,x)&&(e[x]=z.values[x]);return e.options?.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),C=z.id,M=JSON.stringify(R.checkpoint()),e.draftRestored=!0,e.hostingReview=!0,e.sourceUrl&&await De(),s.replace?.(s.path()),!0}catch{e.billingError="The checkout draft could not be restored. Retry by reloading this page; any local draft is still available."}}let _;try{_=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!_||_.path!==s.path()||Date.now()-_.savedAt>=30*6e4)return R.restore()?(e.sourceUrl&&await De(),!0):!1;R.restore();for(let z of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(_.draft,z)&&(e[z]=_.draft[z]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await De(),sessionStorage.removeItem("github-access-draft"),!0}we(()=>{!i.repoId&&!i.pullRequestId&&!i.gistId&&a(et,0),i.repoId&&i.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=i.repoId,t.get("/api/repo/"+e.repoId).then(async k=>{e.accessRepairAllowed=!["removed","archived","preparing","queue","download","removing","expiring"].includes(k.data.status),e.githubConnection=k.data.connection||"oauth",e.sourceUrl="https://github.com/"+k.data.source.fullName,e._originalFullName=k.data.source.fullName,e.terms=k.data.options.terms.filter(_=>_).join(`
`),e.source=k.data.source,e.role=k.data.role||"owner",e._existingNever=k.data.options.expirationMode==="never",e._savedExpirationDate=k.data.options.expirationDate?new Date(k.data.options.expirationDate):null,e.coauthors=k.data.coauthors||[],e._originalBranch=k.data.source.branch,e.options=Object.assign({},e.options,k.data.options),e.conference=k.data.conference,e._originalConference=k.data.conference,e.repositoryID=k.data.source.repositoryID,e._originalRepositoryID=k.data.source.repositoryID,k.data.options.expirationDate&&(e.options.expirationDate=new Date(k.data.options.expirationDate)),A=S(parseGithubUrl(e.sourceUrl)),!await et()&&(await Promise.all([st(),tt()]),me())},()=>{s.url("/404")})),i.pullRequestId&&i.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=i.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async k=>{if(e.githubConnection=k.data.connection||"oauth",e.sourceUrl="https://github.com/"+k.data.source.repositoryFullName+"/pull/"+k.data.source.pullRequestId,e.terms=k.data.options.terms.filter(_=>_).join(`
`),e.source=k.data.source,e.options=Object.assign({},e.options,k.data.options),e.conference=k.data.conference,e._originalConference=k.data.conference,k.data.options.expirationDate&&(e.options.expirationDate=new Date(k.data.options.expirationDate)),A=S(parseGithubUrl(e.sourceUrl)),!await et())try{await le()}catch{}},()=>{s.url("/404")})),i.gistId&&i.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=i.gistId,t.get("/api/gist/"+e.gistId).then(async k=>{e.sourceUrl="https://gist.github.com/"+k.data.source.gistId,e.terms=k.data.options.terms.filter(_=>_).join(`
`),e.source=k.data.source,e.options=Object.assign({},e.options,k.data.options),e.conference=k.data.conference,e._originalConference=k.data.conference,k.data.options.expirationDate&&(e.options.expirationDate=new Date(k.data.options.expirationDate)),A=S(parseGithubUrl(e.sourceUrl)),!await et()&&await Me()},()=>{s.url("/404")}))}),t.get("/github/connections").then(k=>{e.githubConnections=k.data,!i.repoId&&!i.pullRequestId&&!i.gistId&&e.githubConnection===void 0&&k.data.appEnabled&&k.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&De())}).catch(()=>{}),e.urlSelected=async(k=!1)=>{let _=++p;e.previousConfigurations=[],e.previousConfigurationId="";let z;try{z=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,G.cancel(),Ne.cancel(),Ee.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",J("sourceUrl","github",!1);return}let x=S(z),pe=k||A===x;A=x,e.sourceUrlError="",J("sourceUrl","github",!0);let be=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,setTimeout(()=>{let Fe=window.document.getElementById("sourceUrl");if(Fe){try{Fe.setSelectionRange(0,0)}catch{}Fe.scrollLeft=0}},50),be&&a(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!pe&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],pe||(e.source={type:"GitHubStream",branch:"",commit:""}),G.cancel(),Ne.cancel(),Ee.cancel(),re.clear(),Oe.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",e.html_readme="",e.detectedType=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1,e._preservingDraft=pe;try{z.gistId&&!z.repo?(e.detectedType="gist",e.source={gistId:z.gistId},await Me()):z.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:z.owner+"/"+z.repo,pullRequestId:z.pullRequestId},await le()):(e.detectedType="repo",te(),await Promise.all([st(),tt()]),me())}catch{}finally{_===p&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let k=e.branches.filter(z=>z.name==e.source.branch)[0];if(!k)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=k.commit),e.readme=k.readme,await tt(),me()}),e.getBranches=async k=>{let _=parseGithubUrl(e.sourceUrl),z=m();try{let x=await t.get(`/api/repo/${_.owner}/${_.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&ce(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:k===!0||e.reconnectingSource?"1":"0",repositoryID:ke()}});if(!b(z))return;e.branches=x.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let pe=e.branches.filter(be=>be.name==e.source.branch);pe.length>0&&(!(!e.reconnectingSource&&!k&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=pe[0].commit),e.readme=pe[0].readme,await tt(k))}catch(x){if(!b(z))return;e.branches=[],e.sourceUnreachable=x&&(x.status===404||x.data&&x.data.error==="repo_not_found");let pe=x&&x.data&&x.data.error||(x&&x.status===404?"repo_not_found":"unknown_error");r("ERRORS."+pe).then(be=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:be}),e.error=be},console.error),typeof J=="function"&&J("sourceUrl","missing",!1)}finally{w(z)}};async function st(){let k=parseGithubUrl(e.sourceUrl),_=m();try{ct();let z=await t.get(`/api/repo/${k.owner}/${k.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&ce(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,repositoryID:ke(),force:"1"}});if(!b(_))return;e.details=z.data,e.reconnectingSource&&(e.reconnectRepositoryId=e.details.externalId),e.details&&e.details.id&&(e.repositoryID=e.details.id),e.repoId||(e.repoId=e.details.repo+"-"+generateRandomId(4)),await e.getBranches(e.reconnectingSource)}catch(z){if(!b(_))return;throw z.data&&(r("ERRORS."+z.data.error).then(x=>{e.addToast({title:"Error",date:new Date,body:x}),e.error=x},console.error),Qe(z.data.error)),J("sourceUrl","missing",!1),z}finally{w(_)}}async function tt(k){if(e.readme&&!k)return e.readme;let _=parseGithubUrl(e.sourceUrl),z=m();try{let x=await t.get(`/api/repo/${_.owner}/${_.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&ce(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:k===!0?"1":"0",branch:e.source.branch,repositoryID:ke()}});b(z,!0)&&(e.readme=x.data)}catch{b(z,!0)&&(e.readme="")}finally{w(z)}}let He={magicalBraces:!0},bt=k=>k.startsWith("/")&&!k.endsWith("/")&&Vn(uo(k.slice(1),He),He)===k.slice(1),dt=()=>Object.keys(e.preserve.picked).filter(k=>e.pr Line truncated
`).map(k=>k.trim()).filter(Boolean),I=null,U=0,F=null,W=()=>!1;function E(){let k=U+"\0"+e.preserve.patterns;if(k!==F){F=k;try{W=Ea(Ca([...dt(),...fe()]))}catch{W=()=>!1}}return W}function N(k){let _=new Map([["",{dirs:[],files:[]}]]);for(let z of k){let x=z.split("/"),pe="";for(let be=0;be<x.length-1;be++){let Fe=x.slice(0,be+1).join("/");_.has(Fe)||(_.set(Fe,{dirs:[],files:[]}),_.get(pe).dirs.push(Fe)),pe=Fe}_.get(pe).files.push(z)}for(let z of _.values())z.dirs.sort();return{files:k,dirs:_,descendants:new Map}}function P(k){return I.descendants.has(k)||I.descendants.set(k,I.files.filter(_=>_.startsWith(k+"/"))),I.descendants.get(k)}let H=k=>E()(k);function B(k){let _=P(k),z=0;for(let x of _)H(x)&&z++;return z===0?"none":z===_.length?"all":"some"}e.preserve={open:!1,loading:!1,error:"",truncated:!1,commit:"",search:"",expanded:{},picked:{},patterns:"",patternsOpen:!1},e.preserveSummary=()=>{let k=(e.options?.preserveFiles||[]).map(_=>String(_).trim()).filter(Boolean).map(_=>bt(_)?uo(_.slice(1),He):_);return k.length?k.slice(0,2).join(", ")+(k.length>2?` and ${k.length-2} more`:""):"None. Every file is redacted."};async function K(){let k=e.source?.commit;if(!(I&&e.preserve.commit===k)){e.preserve.loading=!0,e.preserve.error="",I=null;try{let _=parseGithubUrl(e.sourceUrl),z=await t.get(`/api/repo/${_.owner}/${_.repo}/tree`,{params:{commit:k,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&i.repoId&&ce(e.sourceUrl)===e._originalFullName?i.repoId:void 0,repositoryID:ke()}});if(e.source?.commit!==k)return;I=Co(N(z.data.files||[])),e.preserve.commit=k,e.preserve.truncated=!!z.data.truncated,e.previewTreeOpen={}}catch{e.preserve.error="The file list could not be loaded from GitHub. You can still use patterns.",e.preserve.patternsOpen=!0}finally{e.preserve.loading=!1}}}e.watch("source.commit",k=>{e.detectedType==="repo"&&k&&e.sourceUrl&&K().catch(()=>{})}),e.openPreserveFiles=()=>{let k={},_=[];for(let x of e.options?.preserveFiles||[]){let pe=String(x).trim();pe&&(!_.length&&bt(pe)?k[uo(pe.slice(1),He)]=!0:_.push(pe))}let z={};for(let x of Object.keys(k)){let pe=x.split("/");for(let be=1;be<pe.length;be++)z[pe.slice(0,be).join("/")]=!0}Object.assign(e.preserve,{open:!0,search:"",picked:k,expanded:z,patterns:_.join(`
`),patternsOpen:_.length>0}),U++,a(()=>{let x=document.getElementById("preserve-files-dialog");x?.showModal&&!x.open&&x.showModal(),document.getElementById("preserve-files-search")?.focus()},0),K()},e.closePreserveFiles=()=>{document.getElementById("preserve-files-dialog")?.close?.(),e.preserve.open=!1},e.savePreserveFiles=()=>{e.options.preserveFiles=Ca([...dt(),...fe()]),e.closePreserveFiles()},e.preserveRows=()=>{if(!I)return[];let k=E(),_=(be,Fe,kt)=>{let pt=!!e.preserve.picked[be],Fn=k(be);return{kind:"file",path:be,label:kt,depth:Fe,state:Fn?"all":"none",locked:!pt&&Fn,note:!pt&&Fn?"matched by a pattern":pt&&!Fn?"excluded by a pattern":""}},z=String(e.preserve.search||"").trim().toLowerCase();if(z)return I.files.filter(be=>be.toLowerCase().includes(z)).slice(0,300).map(be=>_(be,0,be));let x=[],pe=(be,Fe)=>{let kt=I.dirs.get(be);for(let pt of kt.dirs){let Fn=!!e.preserve.expanded[pt],Pa=fe().includes(vt(pt));x.push({kind:"dir",path:pt,label:pt.slice(be?be.length+1:0)+"/",depth:Fe,open:Fn,state:B(pt),locked:!1,note:Pa?"whole folder":""}),Fn&&pe(pt,Fe+1)}for(let pt of kt.files)x.push(_(pt,Fe,pt.slice(be?be.length+1:0)))};return pe("",0),x},e.preserveCount=()=>I?I.files.filter(H).length:0,e.togglePreserveDir=k=>{e.preserve.expanded[k]=!e.preserve.expanded[k]},e.togglePreserveFile=k=>{e.preserve.picked[k]=!e.preserve.picked[k],U++},e.togglePreserveFolder=k=>{let _=vt(k),z=X(k),x=fe().filter(be=>be!==_&&be!==z),pe=B(k)==="all"||fe().includes(_);for(let be of P(k))e.preserve.picked[be]=!1;U++,e.preserve.patterns=(pe?x:[...x,_]).join(`
`),pe&&P(k).some(H)&&(e.preserve.patterns=[...x,z].join(`
`))};let se=[".github","","docs"].flatMap(k=>["README.md","README","README.markdown","README.rst","README.txt","readme.md"].map(_=>(k?k+"/":"")+_));e.readmePreserved=()=>{if(e.detectedType!=="repo")return!1;let k=(e.options?.preserveFiles||[]).map(_=>String(_).trim()).filter(Boolean);if(!k.length)return!1;try{let _=Ea(k);return se.some(z=>_(z))}catch{return!1}};function Q(){let k={terms:e.terms&&!e.readmePreserved()?e.terms.split(`
`):[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(k.branchName=e.source.branch);try{let _=parseGithubUrl(e.sourceUrl);k.repoName=`${_.owner}/${_.repo}`}catch{}return k}function Z(k,_,z){let x=null,pe=0,be=()=>{if(e.detectedType!==k)return;x&&a.cancel(x);let Fe=++pe;e.previewStatus="loading",x=a(()=>{x=null;let kt=_();if(!kt){e.previewStatus="idle";return}t.post("/api/anonymize-preview",kt).then(pt=>{Fe===pe&&(z(pt.data,kt),e.previewStatus="ready")}).catch(()=>{Fe===pe&&(e.previewStatus="error")})},200)};return be.cancel=()=>{pe++,x&&a.cancel(x),x=null},e.on("dispose",be.cancel),be}e.retryPreview=()=>{e.detectedType==="repo"&&G(),e.detectedType==="pr"&&Ne(),e.detectedType==="gist"&&Ee()};let G=Z("repo",()=>e.readme?{content:e.readme,options:Q()}:null,k=>{if(typeof k?.content!="string")throw Error("Invalid preview response");e.anonymize_readme=k.content;let _="";try{let x=parseGithubUrl(e.sourceUrl),pe=e.source.branch||e.details&&e.details.defaultBranch||"main";_=`https://github.com/${x.owner}/${x.repo}/raw/${pe}/`}catch{}let z=renderMD(e.anonymize_readme,_);e.html_readme=z,a(()=>{Prism.highlightAll(),typeof Cs=="function"&&document.querySelectorAll(".reviewer-preview .anonymize-preview-body").forEach(Cs)},150)});function me(){!e.anonymize||!e.anonymize.terms||G()}async function le(){let k=parseGithubUrl(e.sourceUrl),_=m();try{ct();let z=await t.get(`/api/pr/${k.owner}/${k.repo}/${k.pullRequestId}`,{params:{connection:e.githubConnection}});if(!b(_))return;e.details=z.data,e.pullRequestId||(e.pullRequestId=k.repo+"-PR"+k.pullRequestId+"-"+generateRandomId(4))}catch(z){if(!b(_))return;throw z.data&&(r("ERRORS."+z.data.error).then(x=>{e.addToast({title:"Error",date:new Date,body:x}),e.error=x},console.error),Qe(z.data.error)),J("sourceUrl","missing",!1),z}finally{w(_)}}let re=ot(new Map);function he(){let k=new Set,_=e.details&&e.details.pullRequest;if(!_)return k;typeof _.title=="string"&&k.add(_.title),typeof _.body=="string"&&k.add(_.body),typeof _.diff=="string"&&k.add(_.diff);let z=_.comments||[];for(let x of z)typeof x.author=="string"&&k.add(x.author),typeof x.body=="string"&&k.add(x.body);return k}let Ne=Z("pr",()=>{let k=he(),_=Array.from(k);return _.length===0?null:{contents:_,options:Q()}},(k,_)=>{if(!Array.isArray(k?.contents)||k.contents.length!==_.contents.length||k.contents.some(pe=>typeof pe!="string"))throw Error("Invalid preview response");let z=_.contents,x=new Map;for(let pe=0;pe<z.length&&pe<k.contents.length;pe++)x.set(z[pe],k.contents[pe]);re.clear(),x.forEach((pe,be)=>re.set(be,pe))});e.anonymizePrContent=function(k){return k&&(re.has(k)?re.get(k):"")};async function Me(){let k=parseGithubUrl(e.sourceUrl),_=m();try{ct(),e.gistOAuthRequired=!1,e.gistAppRequired=!1;let z=await t.get(`/api/gist/source/${k.gistId}`);if(!b(_))return;e.details=z.data,e.gistId||(e.gistId="gist-"+k.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(z){if(!b(_))return;if(z.data?.error==="github_app_reconnect_required"){e.gistAppRequired=!0,J("sourceUrl","missing",!1);return}if(z.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,J("sourceUrl","missing",!1);return}throw z.data&&(r("ERRORS."+z.data.error).then(x=>{e.addToast({title:"Error",date:new Date,body:x}),e.error=x},console.error),Qe(z.data.error)),J("sourceUrl","missing",!1),z}finally{w(_)}}let Oe=ot(new Map);function ge(){let k=new Set,_=e.details&&e.details.gist;if(!_)return k;typeof _.description=="string"&&k.add(_.description),typeof _.ownerLogin=="string"&&k.add(_.ownerLogin);let z=_.files||[];for(let pe of z)typeof pe.filename=="string"&&k.add(pe.filename),typeof pe.content=="string"&&k.add(pe.content);let x=_.comments||[];for(let pe of x)typeof pe.author=="string"&&k.add(pe.author),typeof pe.body=="string"&&k.add(pe.body);return k}let Ee=Z("gist",()=>{let k=ge(),_=Array.from(k);return _.length===0?null:{contents:_,options:Q()}},(k,_)=>{if(!Array.isArray(k?.contents)||k.contents.length!==_.contents.length||k.contents.some(pe=>typeof pe!="string"))throw Error("Invalid preview response");let z=_.contents,x=new Map;for(let pe=0;pe<z.length&&pe<k.contents.length;pe++)x.set(z[pe],k.contents[pe]);Oe.clear(),x.forEach((pe,be)=>Oe.set(be,pe)),je()});e.anonymizeGistContent=function(k){return k&&(Oe.has(k)?Oe.get(k):"")},e.previewGistFiles=[];function je(){let k=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=k.map(_=>({filename:e.anonymizeGistContent(_.filename),content:e.anonymizeGistContent(_.content),language:_.language}))}e.watch("details.gist.files",je,!0),e.watch("terms",je);function Ye(){let k=e.conference;if(e.conference_data=null,!k)return;let _=k===g||e.isUpdate&&k===e._originalConference;k!==g&&(g=null),t.get("/api/conferences/"+k).then(z=>{e.conference===k&&(e.conference_data=z.data,e.conference_data.startDate=new Date(e.conference_data.startDate),e.conference_data.endDate=new Date(e.conference_data.endDate),!_&&(e.options.expirationDate=new Date(e.conference_data.en Line truncated
`).filter(be=>be),connection:e.githubConnection,fullName:`${z.owner}/${z.repo}`,repository:e.sourceUrl,reconnectRepositoryId:e.reconnectRepositoryId,options:e.options,source:e.source,conference:e.conference};e.details&&(x.options.pageSource=e.details.pageSource),ct();let pe=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(pe,x,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/status/"+e.repoId},be=>{if(be.data){let Fe=["quota_exceeded","subscription_required_for_never_expiration"].includes(be.data.error);Fe||r("ERRORS."+be.data.error).then(kt=>{e.error=kt},console.error),Qe(be.data.error),Fe&&(be.data.error==="subscription_required_for_never_expiration"&&(e._existingNever=!1),e.hostingQuotaBlocked=!0,e.hostingReview=!0,xe(()=>document.getElementById("repository-hosting")?.scrollIntoView({block:"center"})))}}).finally(()=>{_.disabled=!1})},e.anonymizeGist=k=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(wt())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let _=k.currentTarget||k.target.closest?.("button")||k.target;_.disabled=!0;let z=parseGithubUrl(e.sourceUrl),x={gistId:e.gistId,terms:e.terms.trim().split(`
`).filter(be=>be),source:{gistId:z.gistId},options:e.options,conference:e.conference};ct();let pe=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(pe,x,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/gist/"+e.gistId},be=>{be.data&&(r("ERRORS."+be.data.error).then(Fe=>{e.error=Fe},console.error),Qe(be.data.error))}).finally(()=>{_.disabled=!1})},e.anonymizePullRequest=k=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(wt())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let _=k.currentTarget||k.target.closest?.("button")||k.target;_.disabled=!0;let z=parseGithubUrl(e.sourceUrl),x={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
`).filter(be=>be),source:{repositoryFullName:`${z.owner}/${z.repo}`,pullRequestId:z.pullRequestId},options:e.options,conference:e.conference};ct();let pe=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(pe,x,{headers:{"Content-Type":"application/json"}}).then(()=>{R.clear(),window.location.href="/pr/"+e.pullRequestId},be=>{be.data&&(r("ERRORS."+be.data.error).then(Fe=>{e.error=Fe},console.error),Qe(be.data.error))}).finally(()=>{_.disabled=!1})},e.watch("conference",()=>{Ye()}),e.termHints=[],e.matchTermAsWritten=k=>{e.terms=fc(e.terms,k)},e.watch("options.preserveFiles",()=>{e.detectedType==="repo"&&G()}),e.watch("terms",()=>{e.termHints=pc(e.terms),e.detectedType==="repo"&&me(),e.detectedType==="pr"&&Ne(),e.detectedType==="gist"&&Ee()}),e.watch("options.image",()=>{e.detectedType==="repo"&&me(),e.detectedType==="pr"&&Ne(),e.detectedType==="gist"&&Ee()}),e.watch("options.link",()=>{e.detectedType==="repo"&&me(),e.detectedType==="pr"&&Ne(),e.detectedType==="gist"&&Ee()}),e.watch("details",()=>{e.detectedType==="pr"&&Ne(),e.detectedType==="gist"&&Ee()},!0)},Da=function(e,t,o,i,s,r){let a=Tt();mc();let u=Qt();e.on("dark-mode",(I,U)=>{e.aceOption&&(U?e.aceOption.theme="nord_dark":e.aceOption.theme="chrome")});let p=0,y=null,h=null;e.fileLoadingSlow=!1,e.fileReceivedBytes=0;function b(){y&&(y.resolve(),y=null),h&&(a.timeout.cancel(h),h=null)}let m=!1;e.on("dispose",()=>{m=!0,p++,b(),w&&w.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,u(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)}),u(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))}),u(document,"keydown",function(I){if((I.metaKey||I.ctrlKey)&&I.key==="k"){I.preventDefault();var U=document.querySelector(".tree-search-input");U&&(U.focus(),U.select())}});var w=null;e.onFileSearchChange=function(){w&&(w.resolve(),w=null);let I=e.fileSearchQuery;if(!I||I.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let U=r.defer();w=U,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(I)}`,{timeout:U.promise}).then(function(F){if(!(m||w!==U)){w=null,e.fileSearchLoading=!1;var W={};e.files.forEach(function(he){W[(he.path||"")+"/"+he.name]=!0});for(var E=[],N={},P=0;P<F.data.length;P++){var H=F.data[P];if(H.path)for(var B=H.path.split("/"),K="",se=0;se<B.length;se++){var Q=K;K=K?K+"/"+B[se]:B[se];var Z=Q+"/"+B[se];!W[Z]&&!N[Z]&&(N[Z]=!0,E.push({name:B[se],path:Q}))}}E.sort(function(he,Ne){return(he.path||"").split("/").length-(Ne.path||"").split("/").length}),E.length>0&&e.files.push.apply(e.files,E);for(var G=[],me=0;me<F.data.length;me++){var le=F.data[me],re=(le.path||"")+"/"+le.name;!W[re]&&le.size!=null&&(G.push(le),W[re]=!0)}G.length>0&&e.files.push.apply(e.files,G),e.fileSearchResults=F.data}},function(){!m&&w===U&&(w=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})};let A={yml:"yaml",txt:"text",py:"python",js:"javascript",ts:"typescript"},S=["license","txt"],R=["png","jpg","jpeg","gif","svg","ico","bmp","tiff","tif","webp","avif","heif","heic"],g=["wav","mp3","ogg","wma","flac","aac","m4a"],C=["mp4","avi","webm","mov","mpg","mpeg","mkv","flv","wmv","3gp","3g2","m4v","f4v","f4p","f4a","f4b"];e.on("routeUpdate",function(I,U){if(e.repoId!=i.repoId)return fe();if((i.path||"")!=e.filePath){window.matchMedia?.("(max-width: 767px)").matches&&(e.sidebarCollapsed=!0),e.filePath=i.path||"",e.paths=e.filePath.split("/").filter(F=>F&&F.trim().length>0),dt();for(let F=0;F<e.paths.length-1;F++){let W=F>0?e.paths.slice(0,F).join("/"):"";e.files.some(N=>N.path===W)||e.getFiles(W)}}});function M(){if(e.paths[0]!="")return;let I=["readme.md","readme.txt","readme.org","readme.1st","readme"],U={};for(let W of e.files)W.name.toLowerCase().indexOf("readme")>-1&&(U[W.name.toLowerCase()]=W.name);let F=null;for(let W of I)if(U[W]){F=W;break}if(!F&&Object.keys(U).length>0&&(F=Object.keys(U)[0]),F){let W=o.url();W[W.length-1]!="/"&&(W+="/"),o.url(W+encodePathForUrl(U[F]))}}e.fileCounts=null;let V=0,q=new Set,j=!1;e.getFiles=function(I,U=!1){let F=e.repoId,W=V;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(I)}&v=${e.options.lastUpdateDate}`).then(function(E){if(m||F!==e.repoId||W!==V)return[];let N=I||"";return e.files=e.files.filter(P=>P.path!==N),e.fi Line truncated
`).forEach((U,F)=>{for(let[W,E]of Pe){let N=W.exec(U);if(N&&!/^(if|for|while|switch|return|catch)$/.test(N[1])){I.push({name:N[1],kind:E,line:F+1});break}}}),we={content:e.content,list:I.slice(0,300)},we.list},e.goToSymbol=function(I){e.symbolsOpen=!1;let U=e.codeEditor;U&&(U.scrollToLine(I-1,!0,!0,()=>{}),U.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 U=/^\s*:?\s*(\d+)\s*(?:[:,]\s*(\d+))?\s*$/.exec(e.gotoValue||""),F=I.session.getLength();if(!U||+U[1]<1||+U[1]>F){e.gotoError="Enter a line from 1 to "+F;return}I.gotoLine(+U[1],U[2]?Math.max(0,+U[2]-1):0,!0),e.gotoOpen=!1,e.gotoError="",I.focus()},e.rootEntries=function(){return[...e.files||[]].sort((I,U)=>{let F=I.size==null,W=U.size==null;return F!==W?F?-1:1:I.name.localeCompare(U.name)})},e.formatSize=function(I){if(I==null)return"";if(I<1024)return I+" B";let U=I/1024,F=W=>W.toFixed(1).replace(/\.0$/,"");return U<1024?F(U)+" KB":U<1024*1024?F(U/1024)+" MB":F(U/1024/1024)+" GB"},e.fileSize=function(I){if(!I)return null;let U=I.replace(/^\/+/,""),F=(e.files||[]).find(W=>(W.path?W.path+"/":"")+W.name===U);return F&&F.size!=null?F.size:null},e.revealFolder=function(I){e.sidebarHidden=!1,e.sidebarCollapsed=!1,xe(()=>{let U=window.document.querySelector('.files a[data-path="/'+(window.CSS?.escape?window.CSS.escape(I):I)+'"]');U&&(U.closest("li")?.classList.contains("open")||U.click(),U.scrollIntoView({block:"nearest"}),U.focus())})};let J={content:null,n:0},ce=I=>{if(J.content===I)return J.n;let U=I;if(typeof U=="string")try{U=JSON.parse(U)}catch{U=null}let F=[],W=N=>{Array.isArray(N)?F.push(N.join("")):typeof N=="string"&&F.push(N)};(U&&(U.cells||(U.worksheets||[]).flatMap(N=>N.cells||[]))||[]).forEach(N=>{W(N?.source??N?.input),(N?.outputs||[]).forEach(P=>{W(P?.text),P?.data&&(W(P.data["text/plain"]),W(P.data["text/markdown"]),W(P.data["text/html"])),W(P?.traceback)})});let E=F.reduce((N,P)=>N+(P.match(fo)||[]).length,0);return J={content:I,n:E},E};e.redactionCount=function(){return e.type==="IPython"?ce(e.content):typeof e.content!="string"?0:((e.type==="html"?e.content.replace(/<[^>]*>/g," "):e.content).match(fo)||[]).length},e.renderRedacted=_i;let ke=I=>I.toLowerCase().trim().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").slice(0,60)||"section";e.renderReadme=function(I){let U=e.renderRedacted(I);if(!U||typeof window.DOMParser!="function")return U;let F=new window.DOMParser().parseFromString("<div>"+U+"</div>","text/html"),W={};return F.querySelectorAll("h1, h2, h3").forEach(E=>{let N=E.id||ke(E.textContent);W[N]?N+="-"+ ++W[N]:W[N]=1,E.id=N}),F.body.firstChild.innerHTML};let De={content:null,list:[]};e.readmeToc=function(){if(e.type!=="html"||typeof e.content!="string")return[];if(De.content===e.content)return De.list;let U=[...new window.DOMParser().parseFromString("<div>"+e.renderReadme(e.sanitize?e.sanitize(e.content):e.content)+"</div>","text/html").querySelectorAll("h2, h3")].map(F=>({id:F.id,text:F.textContent.trim(),level:F.tagName==="H3"?3:2})).slice(0,40);return De={content:e.content,list:U},U},e.activeHeading=null,u(window,"scroll",()=>{let I=e.readmeToc?e.readmeToc():[];if(!I.length)return;let U=150,F="",W="";for(let E of I){let N=window.document.getElementById(E.id);if(!N)continue;let P=N.getBoundingClientRect().top;P<U?F=E.id:!W&&P<window.innerHeight-80&&(W=E.id)}W&&(F=W),e.activeHeading!==F&&(e.activeHeading=F)},{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 U=window.document.getElementById(I);U&&U.scrollIntoView({behavior:"smooth",block:"start"}),e.activeHeading=I},e.csvView="table";let et={content:null,rows:[]},st=(I,U)=>{let F=[],W=[],E="",N=!1;for(let P=0;P<I.length;P++){let H=I[P];N?H==='"'?I[P+1]==='"'?(E+='"',P++):N=!1:E+=H:H==='"'&&E===""?N=!0:H===U?(W.push(E),E=""):H===`
`||H==="\r"?(H==="\r"&&I[P+1]===`
`&&P++,W.push(E),F.push(W),W=[],E=""):E+=H}return(E!==""||W.length)&&(W.push(E),F.push(W)),F.filter(P=>P.length>1||P[0]!=="")};e.isCsv=()=>typeof e.content=="string"&&e.type!=="html"&&/\.(csv|tsv)$/i.test(e.filePath||"")&&e.content.length<=1024*1024,e.csvRows=()=>{if(et.content!==e.content){let I=/\.tsv$/i.test(e.filePath||"")?" ":",";et={content:e.content,rows:st(e.content,I)}}return et.rows},e.csvNumCol=I=>{let U=e.csvRows().slice(1).map(F=>F[I]).filter(F=>F!=null&&String(F).trim()!=="");return U.length>0&&U.every(F=>e.csvNumeric(F))},e.csvNumeric=I=>/^\s*[-+]?(\d[\d,]*)?(\.\d+)?(e[-+]?\d+)?%?\s*$/i.test(I)&&/\d/.test(I),e.redactParts=function(I){let U=[],F=0,W,E=/\bXXXX-(\d+)\b/g;for(I=String(I||"");W=E.exec(I);)W.index>F&&U.push({t:I.slice(F,W.index)}),U.push({n:W[1]}),F=W.index+W[0].length;return F<I.length&&U.push({t:I.slice(F)}),U},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)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 tt(I){return A[I]?A[I]:I}function He(I){return I=="pdf"?"pdf":I=="html"||I=="htm"?"html-doc":I=="md"?"md":I=="org"?"org":I=="ipynb"?"IPython":S.indexOf(I)>-1?"text":R.indexOf(I)>-1?"image":C.indexOf(I)>-1?"media":g.indexOf(I)>-1?"audio":"code"}function bt(I,U){let F=p;if(!I){e.type="error",e.content="no_file_selected";return}let W=e.type;(W==="code"||W==="text")&&Us().catch(()=>{}),e.type="loading",e.content="loading",e.fileLoadingSlow=!1,e.fileReceivedBytes=0;let E=r.defer();y=E,h=a.timeout(()=>{!m&&F===p&&e.type==="loading"&&(e.fileLoadingSlow=!0)},1500);let N=U&&U.sha||"0";t.get(`/api/repo/${e.repoId}/file/${encodePathForUrl(I)}?v=`+N,{timeout:E.promise,onDownloadProgress:P=>{!m&&F===p&&(e.fileReceivedBytes=P)},transformResponse:P=>P}).then(P=>{if(!(m||F!==p)){if(b(),e.type=W,e.content=P.data,e.content==""&&(e.content=null),e.type=="md"&&(e.content=renderMD(P.data,o.url()+"/../"),e.type="html"),e.type=="org"){let B=contentAbs2Relative(P.data);var H=new Org.Parser().parse(B).convert(Org.ConverterHTML,{headerOffset:1,exportFromLineNumber:!1,suppressSubScriptHandling:!0,suppressAutoLink:!1});e.content=DOMPurify.sanitize(H.toString()),e.type="html"}e.type=="code"&&P.headers("content-type")=="application/octet-stream"&&(e.type="binary",e.content="binary"),a.timeout(()=>{Prism.highlightAll()},50)}},P=>{m||F!==p||(b(),e.type="error",e.content=Na(P))})}function dt(){p++,b(),e.content="",e.file=Y();let I="0";e.file&&e.file.sha&&(I=e.file.sha),e.url=`/api/repo/${e.repoId}/file/${encodePathForUrl(e.filePath)}?v=${I}`;let U=e.filePath.substring(0,e.filePath.lastIndexOf("/")+1);e.fileBaseUrl=`/api/repo/${e.repoId}/file/${U?encodePathForUrl(U):""}`,e.showSource=!1,e.imageSize="",e.allowScripts=!1;let F=e.filePath.toLowerCase(),W=F.lastIndexOf(".");W>-1&&(F=F.substring(W+1));let E={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:""},N=tt(F);if(e.languageName=E[N]??(N?N.charAt(0).toUpperCase()+N.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:tt(F),onLoad:function(P){e.codeEditor=Co(P);{let re=P.session,he=re.getTokens.bind(re),Ne=/\bXXXX-\d+\b/g;if(re.getTokens=function(Me){let Oe=he(Me);if(!Oe.some(Ee=>Ee.value.indexOf("XXXX-")!==-1))return Oe;let ge=[];for(let Ee of Oe){if(Ee.value.indexOf("XXXX-")===-1){ge.push(Ee);continue}let je=0;Ne.lastIndex=0;let Ye;for(;Ye=Ne.exec(Ee.value);)Ye.index>je&&ge.push({type:Ee.type,value:Ee.value.slice(je,Ye.index)}),ge.push({type:"redacted.n"+Ye[0].slice(5),value:Ye[0]}),je=Ye.index+Ye[0].length;je<Ee.value.length&&ge.push({type:Ee.type,value:Ee.value.slice(je)})}return ge},!window.document.getElementById("redact-index-rules")){let Me=window.document.createElement("style");Me.id="redact-index-rules",Me.textContent=Array.from({length:99},(Oe,ge)=>`.ace_redacted.ace_n${ge+1}::after{content:"${ge+1}"}`).join(""),window.document.head.appendChild(Me)}P.renderer.updateFull(!0)}P.session Line truncated
Contact: jane.smith@mit.edu`,e.demoTerms="Jane Smith, Smith, MIT CSAIL, jane.smith@mit.edu",e.demoParts=function(){let c=(e.demoTerms||"").split(/[,\n]/).map(g=>g.trim()).filter(Boolean).sort((g,k)=>k.length-g.length),u=g=>g.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(!c.length)return[{text:e.demoText}];let y=new RegExp("("+c.map(u).join("|")+")","gi"),h={},b=0;return(e.demoText||"").split(y).filter(g=>g!=="").map(g=>{let k=c.find(R=>R.toLowerCase()===g.toLowerCase());return k?(h[k.toLowerCase()]||(h[k.toLowerCase()]=++b),{text:String(h[k.toLowerCase()]),redacted:!0,original:g}):{text:g}})},e.demoCount=()=>e.demoParts().filter(c=>c.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(c=>!c.total);function r(){t.get("/api/stat/").then(c=>{e.stat=c.data,e.cards[0].total=c.data.nbRepositories,e.cards[1].total=c.data.nbUsers,e.cards[2].total=c.data.nbPageViews,e.cards[3].total=c.data.nbPullRequests}).catch(()=>{})}r();function d(c){let u={series:c,bars:[],viewW:100,deltaToday:0,pctChange:0,pctAbs:0,isUp:!0};if(!c||c.length<2)return u;let y=new Array(c.length-1);for(let S=1;S<c.length;S++)y[S-1]=c[S]-c[S-1];let h=y.length,b=Math.max.apply(null,y),g=Math.min.apply(null,y),k=Math.min(0,g),R=b-k||1;u.viewW=h*2,u.bars=new Array(h);for(let S=0;S<h;S++){let N=(y[S]-k)/R,m=Math.max(1.5,N*34);u.bars[S]={x:(S*2+.25).toFixed(2),y:(36-m).toFixed(2),w:"1.5",h:m.toFixed(2)}}if(u.deltaToday=y[h-1],h>=2){let S=y[h-2];S&&(u.pctChange=(u.deltaToday-S)/S*100)}return u.pctAbs=Math.round(Math.abs(u.pctChange)),u.isUp=u.pctChange>=0,u}e.history={repositories:d([]),users:d([]),pageViews:d([]),pullRequests:d([])},t.get("/api/stat/history?days=60").then(c=>{let u=c.data||[];e.history={repositories:d(u.map(y=>y.nbRepositories||0)),users:d(u.map(y=>y.nbUsers||0)),pageViews:d(u.map(y=>y.nbPageViews||0)),pullRequests:d(u.map(y=>y.nbPullRequests||0))}}).catch(()=>{})},Vc=function(e,t,o,i,s,r){let d=Rt();e.on("routeLeave",function(){$('[data-toggle="tooltip"]').tooltip("dispose")}),e.watch("user.status",()=>{e.user==null&&o.url("/")}),e.user==null&&o.url("/"),d.timeout(()=>{$('[data-toggle="tooltip"]').tooltip()},250),e.quotaExpanded=!1,e.closeQuota=()=>{e.quotaExpanded=!1,tt(()=>document.querySelector(".dashboard-quota > summary")?.focus())},Ut()(document,"click",C=>{e.quotaExpanded&&!C.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=C=>C.status==="error"||C._broken||u(C.status)==="progress"&&C._stale,e.attentionCount=()=>e.dashboardTotals?.attention??e.items.filter(e.needsAttention).length,e.hasProjects=()=>(e.dashboardTotals?.total??e.items.length)>0,e.setProjectView=C=>{e.projectView=C,C==="attention"&&(e.filters.status.error=!0,e.filters.status.progress=!0)},e.idleText=C=>{let q=va(C?.anonymizeDate||C?.lastView)||"";return/ ago$/.test(q)?"No activity for "+q.replace(/ ago$/,""):"No activity since "+q.replace(", "+new Date().getFullYear(),"")},e.projectDetailsId=C=>"project-details-"+encodeURIComponent(C._type+":"+(C._id||C._source||"unknown")),e.showProjectDetails=async C=>{e.selectedProject=C,e.projectName=C.projectName||"",e.nameError="",e.nameMessage="",await tt();let q=document.getElementById(e.projectDetailsId(C));q?.focus(),q?.scrollIntoView?.({block:"nearest"})},e.closeProjectDetails=C=>{e.selectedProject=null,tt(()=>document.querySelector(`[data-project-actions="${encodeURIComponent(C._type+":"+C._id)}"]`)?.focus())},e.saveProjectName=async C=>{if(e.nameSaving||!C._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 z=await t.post("/api/user/project-name",{type:C._type,id:C._id,name:q});C.projectName=z.data.name,C._label=C.projectName||C._fallbackLabel,e.selectedProject===C&&(e.nameMessage=q?"Project name saved.":"Default project name restored."),E||(e.dashboardCursor=null,await _(),e.selectedProject===C&&(e.selectedProject=e.items.find(K=>K._type===C._type&&K._id===C._id)||null))}catch{e.selectedProject===C&&(e.nameError="The project name could not be saved. Try again.")}finally{e.nameSaving=!1}},e.copyingId=null,e.copyLink=async C=>{if(!C._viewUrl||e.copyingId)return;let q=new URL(C._viewUrl,s.location.origin).href;e.copyingId=C._type+":"+C._id;try{await Wa(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 c=["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):ee(),!i.repoId&&!i.pullRequestId&&!i.gistId&&!e.anonymize?.terms?.dirty&&(e.terms=e.defaultTerms),w&&w()})}function Y(w,I,B){e.anonymize&&e.anonymize[w]&&e.anonymize[w].setValidity(I,B)}function he(w){try{let I=parseGithubUrl(w);if(I&&I.owner&&I.repo)return I.owner+"/"+I.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"||he(e.sourceUrl)!==e._originalFullName)return;e.repairingGitHubAccess=!0,e.accessRepairMessage="";let w=g();try{let I=await t.get("/github/connections");if(e.githubConnections=I.data,!I.data.appEnabled)return;let B=await t.post("/github/connections/migrate",{type:"repository",id:i.repoId,connection:"github-app"},{headers:{"X-CSRF-Token":I.data.csrf}});if(!b(w))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{b(w)&&(e.accessRepairMessage="Unable to repair GitHub access. Check the App's repository permissions in Manage access, then retry. Your published snapshot has not been replaced.")}finally{e.repairingGitHubAccess=!1,k(w)}},e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,e.reconnectSource=async()=>{if(confirm("Reconnect to the repository currently at this GitHub URL? Review its branch and commit before saving. Saving will replace the published snapshot.")){e.reconnectingSource=!0,e.reconnectRepositoryId=void 0,e.source.commit="",e.source.branch="",e.readme="",e.branches=[];try{await Je()}catch{}}};function Ee(){return e.reconnectingSource||!e.isUpdate||!e._originalRepositoryID?void 0:he(e.sourceUrl)===e._originalFullName?e._originalRepositoryID:void 0}async function Ue(){e._preservingDraft=!0;try{await e.urlSelected(!0)}finally{e._preservingDraft=!1}}async function Be(){let w=new URLSearchParams(window.location.search).get("billingDraft");if(w){N.restore();try{let B=(await t.get("/api/billing/draft/"+encodeURIComponent(w))).data;if(B.path!==s.path())throw new Error("Wrong task");m=B.values.conference||null;for(let j of["sourceUrl","terms","repoId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(B.values,j)&&(e[j]=B.values[j]);return e.options?.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),E=B.id,M=JSON.stringify(N.checkpoint()),e.draftRestored=!0,e.hostingReview=!0,e.sourceUrl&&await Ue(),s.replace?.(s.path()),!0}catch{e.billingError="The checkout draft could not be restored. Retry by reloading this page; any local draft is still available."}}let I;try{I=JSON.parse(sessionStorage.getItem("github-access-draft")||"null")}catch{return!1}if(!I||I.path!==s.path()||Date.now()-I.savedAt>=30*6e4)return N.restore()?(e.sourceUrl&&await Ue(),!0):!1;N.restore();for(let B of["sourceUrl","terms","repoId","pullRequestId","gistId","source","options","conference","githubConnection"])Object.prototype.hasOwnProperty.call(I.draft,B)&&(e[B]=I.draft[B]);return e.options.expirationDate&&(e.options.expirationDate=new Date(e.options.expirationDate)),await Ue(),sessionStorage.removeItem("github-access-draft"),!0}ne(()=>{!i.repoId&&!i.pullRequestId&&!i.gistId&&d(Be,0),i.repoId&&i.repoId!=""&&(e.isUpdate=!0,e.detectedType="repo",e.repoId=i.repoId,t.get("/api/repo/"+e.repoId).then(async w=>{e.accessRepairAllowed=!["removed","archived","preparing","queue","download","removing","expiring"].includes(w.data.status),e.githubConnection=w.data.connection||"oauth",e.sourceUrl="https://github.com/"+w.data.source.fullName,e._originalFullName=w.data.source.fullName,e.terms=w.data.options.terms.filter(I=>I).join(`
`),e.source=w.data.source,e.role=w.data.role||"owner",e._existingNever=w.data.options.expirationMode==="never",e._savedExpirationDate=w.data.options.expirationDate?new Date(w.data.options.expirationDate):null,e.coauthors=w.data.coauthors||[],e._originalBranch=w.data.source.branch,e.options=Object.assign({},e.options,w.data.options),e.conference=w.data.conference,e._originalConference=w.data.conference,e.repositoryID=w.data.source.repositoryID,e._originalRepositoryID=w.data.source.repositoryID,w.data.options.expirationDate&&(e.options.expirationDate=new Date(w.data.options.expirationDate)),R=S(parseGithubUrl(e.sourceUrl)),!await Be()&&(await Promise.all([Je(),He()]),ko())},()=>{s.url("/404")})),i.pullRequestId&&i.pullRequestId!=""&&(e.isUpdate=!0,e.detectedType="pr",e.pullRequestId=i.pullRequestId,t.get("/api/pr/"+e.pullRequestId).then(async w=>{if(e.githubConnection=w.data.connection||"oauth",e.sourceUrl="https://github.com/"+w.data.source.repositoryFullName+"/pull/"+w.data.source.pullRequestId,e.terms=w.data.options.terms.filter(I=>I).join(`
`),e.source=w.data.source,e.options=Object.assign({},e.options,w.data.options),e.conference=w.data.conference,e._originalConference=w.data.conference,w.data.options.expirationDate&&(e.options.expirationDate=new Date(w.data.options.expirationDate)),R=S(parseGithubUrl(e.sourceUrl)),!await Be())try{await Ja()}catch{}},()=>{s.url("/404")})),i.gistId&&i.gistId!=""&&(e.isUpdate=!0,e.detectedType="gist",e.gistId=i.gistId,t.get("/api/gist/"+e.gistId).then(async w=>{e.sourceUrl="https://gist.github.com/"+w.data.source.gistId,e.terms=w.data.options.terms.filter(I=>I).join(`
`),e.source=w.data.source,e.options=Object.assign({},e.options,w.data.options),e.conference=w.data.conference,e._originalConference=w.data.conference,w.data.options.expirationDate&&(e.options.expirationDate=new Date(w.data.options.expirationDate)),R=S(parseGithubUrl(e.sourceUrl)),!await Be()&&await Za()},()=>{s.url("/404")}))}),t.get("/github/connections").then(w=>{e.githubConnections=w.data,!i.repoId&&!i.pullRequestId&&!i.gistId&&e.githubConnection===void 0&&w.data.appEnabled&&w.data.appConnected&&(e.githubConnection="github-app",e.sourceUrl&&e.workspaceOpen&&Ue())}).catch(()=>{}),e.urlSelected=async(w=!1)=>{let I=++u;e.previousConfigurations=[],e.previousConfigurationId="";let B;try{B=parseGithubUrl(e.sourceUrl.trim())}catch{e.sourceLoading=!1,Kt.cancel(),Tn.cancel(),On.cancel(),e.previewStatus="idle",e.sourceUrlError=e.sourceUrl?"Please provide a valid GitHub URL.":"",Y("sourceUrl","github",!1);return}let j=S(B),ue=w||R===j;R=j,e.sourceUrlError="",Y("sourceUrl","github",!0);let ge=document.activeElement?.id==="sourceUrl-landing";e.workspaceOpen=!0,setTimeout(()=>{let Ke=window.document.getElementById("sourceUrl");if(Ke){try{Ke.setSelectionRange(0,0)}catch{}Ke.scrollLeft=0}},50),ge&&d(()=>document.getElementById("sourceUrl")?.focus(),0),e.reconnectingSource=!1,e.reconnectRepositoryId=void 0,!ue&&!e.isUpdate&&(e.repoId="",e.pullRequestId="",e.gistId=""),e.details=null,e.branches=[],ue||(e.source={type:"GitHubStream",branch:"",commit:""}),Kt.cancel(),Tn.cancel(),On.cancel(),Co.clear(),Eo.clear(),e.previewStatus="idle",e.anonymize_readme="",e.readme="",lt(),e.detectedType=null,e.gistOAuthRequired=!1,e.gistAppRequired=!1,e._preservingDraft=ue;try{B.gistId&&!B.repo?(e.detectedType="gist",e.source={gistId:B.gistId},await Za()):B.pullRequestId?(e.detectedType="pr",e.source={repositoryFullName:B.owner+"/"+B.repo,pullRequestId:B.pullRequestId},await Ja()):(e.detectedType="repo",q(),await Promise.all([Je(),He()]),ko())}catch{}finally{I===u&&(e._preservingDraft=!1)}$('[data-toggle="tooltip"]').tooltip()},$('[data-toggle="tooltip"]').tooltip(),e.watch("source.branch",async()=>{if(e.detectedType!=="repo")return;let w=e.branches.filter(B=>B.name==e.source.branch)[0];if(!w)return;!(!e.reconnectingSource&&e.isUpdate&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=w.commit),e.readme=w.readme,await He(),ko()}),e.getBranches=async w=>{let I=parseGithubUrl(e.sourceUrl),B=g();try{let j=await t.get(`/api/repo/${I.owner}/${I.repo}/branches`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&he(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:w===!0||e.reconnectingSource?"1":"0",repositoryID:Ee()}});if(!b(B))return;e.branches=j.data,e.sourceUnreachable=!1,e.source.branch||(e.source.branch=e.details.defaultBranch);let ue=e.branches.filter(ge=>ge.name==e.source.branch);ue.length>0&&(!(!e.reconnectingSource&&!w&&e.isUpdate&&!e.options.update&&e._originalBranch===e.source.branch&&e.source.commit)&&!(e._preservingDraft&&e.source.commit)&&(e.source.commit=ue[0].commit),e.readme=ue[0].readme,await He(w))}catch(j){if(!b(B))return;e.branches=[],e.sourceUnreachable=j&&(j.status===404||j.data&&j.data.error==="repo_not_found");let ue=j&&j.data&&j.data.error||(j&&j.status===404?"repo_not_found":"unknown_error");r("ERRORS."+ue).then(ge=>{e.toasts=e.toasts||[],e.addToast({title:"Error",date:new Date,body:ge}),e.error=ge},console.error),typeof Y=="function"&&Y("sourceUrl","missing",!1)}finally{k(B)}};async function Je(){let w=parseGithubUrl(e.sourceUrl),I=g();try{So();let B=await t.get(`/api/repo/${w.owner}/${w.repo}/`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&he(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,repositoryID:Ee(),force:"1"}});if(!b(I))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(!b(I))return;throw B.data&&(r("ERRORS."+B.data.error).then(j=>{e.addToast({title:"Error",date:new Date,body:j}),e.error=j},console.error),No(B.data.error)),Y("sourceUrl","missing",!1),B}finally{k(I)}}async function He(w){if(e.readme&&!w)return e.readme;let I=parseGithubUrl(e.sourceUrl),B=g();try{let j=await t.get(`/api/repo/${I.owner}/${I.repo}/readme`,{params:{reconnect:e.reconnectingSource?"1":void 0,anonymizedRepoId:e.isUpdate&&i.repoId&&he(e.sourceUrl)===e._originalFullName?i.repoId:void 0,connection:e.githubConnection,force:w===!0?"1":"0",branch:e.source.branch,repositoryID:Ee()}});b(B,!0)&&(e.readme=j.data)}catch{b(B,!0)&&(e.readme="")}finally{k(B)}}let et={magicalBraces:!0},Re=w=>w.startsWith("/")&&!w.endsWith("/")&&Bn(yo(w.slice(1),et),et)===w.slice(1),Fe=()=>Object.keys(e.preserve.picked).filter(w=>e.preserve.pick Line truncated
`).map(w=>w.trim()).filter(Boolean),ce=null,me=null,Ie=new Set,D=0,A=null,L=()=>!1;function Q(){let w=D+"\0"+e.preserve.patterns;if(w!==A){A=w;try{L=ja(Ha([...Fe(),...de()]))}catch{L=()=>!1}}return L}function H(w){let I=new Map([["",{dirs:[],files:[]}]]);for(let B of w){let j=B.split("/"),ue="";for(let ge=0;ge<j.length-1;ge++){let Ke=j.slice(0,ge+1).join("/");I.has(Ke)||(I.set(Ke,{dirs:[],files:[]}),I.get(ue).dirs.push(Ke)),ue=Ke}I.get(ue).files.push(B)}for(let B of I.values())B.dirs.sort();return{files:w,dirs:I,descendants:new Map}}function J(w){return ce.descendants.has(w)||ce.descendants.set(w,ce.files.filter(I=>I.startsWith(w+"/"))),ce.descendants.get(w)}let ae=w=>Q()(w);function te(w){let I=J(w),B=0;for(let j of I)ae(j)&&B++;return B===0?"none":B===I.length?"all":"some"}e.preserve={open:!1,loading:!1,error:"",truncated:!1,commit:"",search:"",expanded:{},picked:{},patterns:"",patternsOpen:!1},e.preserveSummary=()=>{let w=(e.options?.preserveFiles||[]).map(I=>String(I).trim()).filter(Boolean).map(I=>Re(I)?yo(I.slice(1),et):I);return w.length?w.slice(0,2).join(", ")+(w.length>2?` and ${w.length-2} more`:""):"None. Every file is redacted."};async function oe(){let w=e.source?.commit;if(!(ce&&e.preserve.commit===w)){e.preserve.loading=!0,e.preserve.error="",ce=null,me=null;try{let I=parseGithubUrl(e.sourceUrl),B=await t.get(`/api/repo/${I.owner}/${I.repo}/tree`,{params:{commit:w,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&i.repoId&&he(e.sourceUrl)===e._originalFullName?i.repoId:void 0,repositoryID:Ee()}});if(e.source?.commit!==w)return;let j=Array.isArray(B.data.binaryFiles)?B.data.binaryFiles:[];ce=dn(H(B.data.files||[])),me=j.length?dn(H([...B.data.files||[],...j])):ce,Ie=dn(new Set(j)),e.preserve.commit=w,e.preserve.truncated=!!B.data.truncated,e.previewFile||Kt()}catch{e.preserve.error="The file list could not be loaded from GitHub. You can still use patterns.",e.preserve.patternsOpen=!0}finally{e.preserve.loading=!1}}}e.watch("source.commit",w=>{e.previewFile&&e.openPreviewFile(""),e.detectedType==="repo"&&w&&e.sourceUrl&&oe().catch(()=>{})}),e.openPreserveFiles=()=>{let w={},I=[];for(let j of e.options?.preserveFiles||[]){let ue=String(j).trim();ue&&(!I.length&&Re(ue)?w[yo(ue.slice(1),et)]=!0:I.push(ue))}let B={};for(let j of Object.keys(w)){let ue=j.split("/");for(let ge=1;ge<ue.length;ge++)B[ue.slice(0,ge).join("/")]=!0}Object.assign(e.preserve,{open:!0,search:"",picked:w,expanded:B,patterns:I.join(`
`),patternsOpen:I.length>0}),e.mobileWorkspace&&(e.mobilePane="settings"),D++,d(()=>{let j=document.getElementById("preserve-files-dialog");j?.showModal&&!j.open&&j.showModal(),document.getElementById("preserve-files-search")?.focus()},0),oe()},e.closePreserveFiles=()=>{document.getElementById("preserve-files-dialog")?.close?.(),e.preserve.open=!1},e.savePreserveFiles=()=>{e.options.preserveFiles=Ha([...Fe(),...de()]),e.closePreserveFiles()},e.preserveRows=()=>{if(!ce)return[];let w=Q(),I=(ge,Ke,Vt)=>{let bt=!!e.preserve.picked[ge],Yn=w(ge);return{kind:"file",path:ge,label:Vt,depth:Ke,state:Yn?"all":"none",locked:!bt&&Yn,note:!bt&&Yn?"matched by a pattern":bt&&!Yn?"excluded by a pattern":""}},B=String(e.preserve.search||"").trim().toLowerCase();if(B)return ce.files.filter(ge=>ge.toLowerCase().includes(B)).slice(0,300).map(ge=>I(ge,0,ge));let j=[],ue=(ge,Ke)=>{let Vt=ce.dirs.get(ge);for(let bt of Vt.dirs){let Yn=!!e.preserve.expanded[bt],xa=de().includes(W(bt));j.push({kind:"dir",path:bt,label:bt.slice(ge?ge.length+1:0)+"/",depth:Ke,open:Yn,state:te(bt),locked:!1,note:xa?"whole folder":""}),Yn&&ue(bt,Ke+1)}for(let bt of Vt.files)j.push(I(bt,Ke,bt.slice(ge?ge.length+1:0)))};return ue("",0),j},e.preserveCount=()=>ce?ce.files.filter(ae).length:0,e.togglePreserveDir=w=>{e.preserve.expanded[w]=!e.preserve.expanded[w]},e.togglePreserveFile=w=>{e.preserve.picked[w]=!e.preserve.picked[w],D++},e.togglePreserveFolder=w=>{let I=W(w),B=fe(w),j=de().filter(ge=>ge!==I&&ge!==B),ue=te(w)==="all"||de().includes(I);for(let ge of J(w))e.preserve.picked[ge]=!1;D++,e.preserve.patterns=(ue?j:[...j,I]).join(`
`),ue&&J(w).some(ae)&&(e.preserve.patterns=[...j,B].join(`
`))};let x=/^readme(\.[^/]*)?$/i,ke=[".md",".markdown",".mdown",".mkdn",".rst",".txt",""],pe=["README.md","README","README.markdown","README.rst","README.txt","readme.md"],Ce=w=>{let I=K(w),B=I.indexOf("."),j=ke.indexOf(B===-1?"":I.slice(B).toLowerCase());return j===-1?ke.length:j},De=()=>!!ce&&!!e.preserve.commit&&e.preserve.commit===e.source?.commit;e.readmePath=()=>{if(!De())return"";for(let w of[".github","","docs"]){let I=(ce.dirs.get(w)?.files||[]).filter(B=>x.test(K(B)));if(I.length)return I.sort((B,j)=>Ce(B)-Ce(j)||z(B,j))[0]}return""},e.readmeName=()=>K(e.readmePath())||"README.md";let Me={key:null,fn:()=>!1},Ge=()=>{let w=(e.options?.preserveFiles||[]).map(B=>String(B).trim()).filter(Boolean),I=w.join(`
`);if(I!==Me.key){let B=()=>!1;try{w.length&&(B=ja(w))}catch{}Me={key:I,fn:B}}return Me.fn};e.pathPreserved=w=>!!w&&Ge()(w),e.readmePreserved=()=>{if(e.detectedType!=="repo")return!1;let w=Ge();if(De()){let I=e.readmePath();return!!I&&w(I)}return pe.some(I=>w(I))},e.previewPreserved=()=>e.detectedType==="repo"&&(e.previewFile?e.pathPreserved(e.previewFile):e.readmePreserved());function ze(){let w={terms:e.terms?e.terms.split(`
`):[],filePath:e.previewOpenPath()||"README.md",preserveFiles:e.options.preserveFiles||[],image:!!e.options.image,link:!!e.options.link,repoId:e.repoId};e.source&&e.source.branch&&(w.branchName=e.source.branch);try{let I=parseGithubUrl(e.sourceUrl);w.repoName=`${I.owner}/${I.repo}`}catch{}return w}function we(w,I,B){let j=null,ue=0,ge=()=>{if(e.detectedType!==w)return;j&&d.cancel(j);let Ke=++ue;e.previewStatus="loading",j=d(()=>{j=null;let Vt=I();if(!Vt){e.previewStatus="idle";return}t.post("/api/anonymize-preview",Vt).then(bt=>{Ke===ue&&(B(bt.data,Vt),e.previewStatus="ready")}).catch(()=>{Ke===ue&&(e.previewStatus="error")})},200)};return ge.cancel=()=>{ue++,j&&d.cancel(j),j=null},e.on("dispose",ge.cancel),ge}e.retryPreview=()=>{e.detectedType==="repo"&&(e.previewFile&&typeof at!="string"?ft(e.previewFile):Kt()),e.detectedType==="pr"&&Tn(),e.detectedType==="gist"&&On()};let be=dn(Vs(e));Object.defineProperty(e,"previewViewer",{get:()=>be}),ma(be,e),Object.assign(be,{options:{},files:[],paths:[],content:null,type:"loading",sidebarHidden:!1,sidebarCollapsed:!0,moreOpen:!1,tocOpen:!1,gotoOpen:!1,mdFindOpen:!1,mdFindQuery:"",mdFindTotal:0,mdFindIndex:0}),be.preview=!0,be.fileSize=w=>w===be.filePath&&typeof at=="string"?new Blob([at]).size:!e.previewFile&&e.readme?new Blob([e.readme]).size:null,be.openPreserveFiles=()=>e.openPreserveFiles(),be.previewPreserved=()=>e.previewPreserved(),be.retryContent=()=>e.retryPreview();let st=w=>Ie.has(w)||/\.(pdf|png|jpe?g|gif|svg|ico|bmp|tiff?|webp|avif|heic|heif|mp4|webm|mp3|wav|zip|bin)$/i.test(w),rt=(w="")=>({path:w,loading:!1,note:"",loadError:""});e.previewFile="",e.previewDoc=rt();let yt=0,at=null;e.previewOpenPath=()=>e.previewFile||e.readmePath(),e.openPreviewFile=w=>{if(w=w||"",w&&w===e.readmePath()&&(w=""),yt++,at=null,Kn(),Kt.cancel(),e.previewFile=w,e.previewDoc=rt(w),be.sidebarCollapsed=!0,be.content=null,!w){e.readme?Kt():e.previewStatus="idle";return}if(st(w)){cr("binary"),e.previewStatus="ready";return}ft(w)};function lt(){yt++,at=null,e.previewFile="",e.previewDoc=rt(),be.sidebarCollapsed=!0,be.content=null}function ft(w){let I=++yt;at=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:w,connection:e.githubConnection,anonymizedRepoId:e.isUpdate&&i.repoId&&he(e.sourceUrl)===e._originalFullName?i.repoId:void 0,repositoryID:Ee()},transformResponse:j=>j}).then(j=>{if(I!==yt)return;e.previewDoc.loading=!1;let ue=typeof j.headers=="function"&&j.headers("content-type")||"";if(/json/i.test(ue)){let ge=null;try{ge=JSON.parse(j.data)}catch{}if(ge&&ge.binary===!0){cr("binary"),e.previewStatus="ready";return}}at=typeof j.data=="string"?j.data:"",Kt()},j=>{if(I!==yt)return;e.previewDoc.loading=!1;let ue=ar(j);if(ue==="file_too_big"){cr("too_big"),e.previewStatus="ready";return}e.previewDoc.loadError=Wn.ERRORS[ue]||"GitHub did not return this file.",e.previewStatus="error"})}let _t;function Kn(){_t&&window.URL.revokeObjectURL(_t),_t=void 0,be.url=void 0}e.on("dispose",Kn);function cr(w){Kn(),e.previewDoc.note=w,be.prepareFile(e.previewPathName(e.previewOpenPath()||e.readmeName())),be.type=w==="too_big"?"error":"binary",be.content=w==="too_big"?"file_too_big":"binary"}function Kp(w){try{let I=parseGithubUrl(e.sourceUrl),B=e.source.branch||e.details&&e.details.defaultBranch||"main",j=w&&w.includes("/")?w.slice(0,w.lastIndexOf("/")+1):"";return`https://github.com/${I.owner}/${I.repo}/raw/${B}/${j}`}catch{return""}}let Qa=we("repo",()=>e.previewFile?typeof at!="string"?null:{content:at,options:ze()}:e.readme?{content:e.readme,options:ze()}:null,w=>{if(typeof w?.content!="string")throw Error("Invalid preview response");Kn(),window.URL?.createObjectURL&&(be.url=_t=window.URL.createObjectURL(new Blob([w.content],{type:"text/plain"})));let I=e.previewOpenPath()||e.readmeName();be.prepareFile(e.previewPathName(I)),be.fileBaseUrl=Kp(I),be.renderFileContent(w.content,be.type,be.fileBaseUrl,"text/plain"),e.previewFile||(e.anonymize_readme=w.content)}),Kt=()=>{e.previewFile&&typeof at!="string"||Qa()};Kt.cancel=Qa.cancel;let wo=ot(new Map),pr=new Set,fr=new Set,xo="",es=null,xs=()=>String(e.terms||"").split(`
`).filter(w=>w.trim());function Yp(){es=null;let w=xs(),I=w.join(`
`);I!==xo&&(wo.clear(),fr.clear(),xo=I);let B=[...pr].filter(j=>!wo.has(j));if(pr.clear(),!(!B.length||!w.length))for(let j=0;j<B.length;j+=400){let ue=B.slice(j,j+400);t.post("/api/anonymize-preview",{contents:ue,options:{terms:w,image:!0,link:!0}}).then(ge=>{if(xo!==I||xs().join(`
`)!==I)return;let Ke=ge.data?.contents;if(!Array.isArray(Ke)||Ke.length!==ue.length)throw Error("Invalid preview response");ue.forEach((Vt,bt)=>wo.set(Vt,typeof Ke[bt]=="string"?Ke[bt]:Vt))}).catch(()=>{xo===I&&ue.forEach(ge=>fr.add(ge))})}}e.previewName=w=>{if(!w||!xs().length)return w;if(xo===xs().join(`
`)){if(wo.has(w))return wo.get(w);if(fr.has(w))return w}return pr.add(w),es||(es=d(Yp,120)),w},e.previewPathName=w=>{w=String(w||"");let I=w.lastIndexOf("/");return I<0?e.previewName(w):e.previewName(w.slice(0,I))+"/"+e.previewName(w.slice(I+1))},e.watch(()=>[e.repoId,e.previewPathName(e.previewOpenPath()||e.readmeName()),e.previewTreeFiles()],()=>{be.repoId=e.repoId||"repository",be.filePath=e.previewPathName(e.previewOpenPath()||e.readmeName()),be.paths=be.filePath.split("/"),be.files=e.previewTreeFiles(),be.loadedFolders=Object.fromEntries([...me?.dirs.keys()||[]].map(w=>[e.previewName(w),!0]))},!0),e.on("dispose",()=>{es&&d.cancel(es)});function ko(){!e.anonymize||!e.anonymize.terms||Kt()}async function Ja(){let w=parseGithubUrl(e.sourceUrl),I=g();try{So();let B=await t.get(`/api/pr/${w.owner}/${w.repo}/${w.pullRequestId}`,{params:{connection:e.githubConnection}});if(!b(I))return;e.details=B.data,e.pullRequestId||(e.pullRequestId=w.repo+"-PR"+w.pullRequestId+"-"+generateRandomId(4))}catch(B){if(!b(I))return;throw B.data&&(r("ERRORS."+B.data.error).then(j=>{e.addToast({title:"Error",date:new Date,body:j}),e.error=j},console.error),No(B.data.error)),Y("sourceUrl","missing",!1),B}finally{k(I)}}let Co=ot(new Map);function Xp(){let w=new Set,I=e.details&&e.details.pullRequest;if(!I)return w;typeof I.title=="string"&&w.add(I.title),typeof I.body=="string"&&w.add(I.body),typeof I.diff=="string"&&w.add(I.diff);let B=I.comments||[];for(let j of B)typeof j.author=="string"&&w.add(j.author),typeof j.body=="string"&&w.add(j.body);return w}let Tn=we("pr",()=>{let w=Xp(),I=Array.from(w);return I.length===0?null:{contents:I,options:ze()}},(w,I)=>{if(!Array.isArray(w?.contents)||w.contents.length!==I.contents.length||w.contents.some(ue=>typeof ue!="string"))throw Error("Invalid preview response");let B=I.contents,j=new Map;for(let ue=0;ue<B.length&&ue<w.contents.length;ue++)j.set(B[ue],w.contents[ue]);Co.clear(),j.forEach((ue,ge)=>Co.set(ge,ue))});e.anonymizePrContent=function(w){return w&&(Co.has(w)?Co.get(w):"")};async function Za(){let w=parseGithubUrl(e.sourceUrl),I=g();try{So(),e.gistOAuthRequired=!1,e.gistAppRequired=!1;let B=await t.get(`/api/gist/source/${w.gistId}`);if(!b(I))return;e.details=B.data,e.gistId||(e.gistId="gist-"+w.gistId.substring(0,6)+"-"+generateRandomId(4))}catch(B){if(!b(I))return;if(B.data?.error==="github_app_reconnect_required"){e.gistAppRequired=!0,Y("sourceUrl","missing",!1);return}if(B.data?.error==="github_oauth_required"){e.gistOAuthRequired=!0,Y("sourceUrl","missing",!1);return}throw B.data&&(r("ERRORS."+B.data.error).then(j=>{e.addToast({title:"Error",date:new Date,body:j}),e.error=j},console.error),No(B.data.error)),Y("sourceUrl","missing",!1),B}finally{k(I)}}let Eo=ot(new Map);function Qp(){let w=new Set,I=e.details&&e.details.gist;if(!I)return w;typeof I.description=="string"&&w.add(I.description),typeof I.ownerLogin=="string"&&w.add(I.ownerLogin);let B=I.files||[];for(let ue of B)typeof ue.filename=="string"&&w.add(ue.filename),typeof ue.content=="string"&&w.add(ue.content);let j=I.comments||[];for(let ue of j)typeof ue.author=="string"&&w.add(ue.author),typeof ue.body=="string"&&w.add(ue.body);return w}let On=we("gist",()=>{let w=Qp(),I=Array.from(w);return I.length===0?null:{contents:I,options:ze()}},(w,I)=>{if(!Array.isArray(w?.contents)||w.contents.length!==I.contents.length||w.contents.some(ue=>typeof ue!="string"))throw Error("Invalid preview response");let B=I.contents,j=new Map;for(let ue=0;ue<B.length&&ue<w.contents.length;ue++)j.set(B[ue],w.contents[ue]);Eo.clear(),j.forEach((ue,ge)=>Eo.set(ge,ue)),hr()});e.anonymizeGistContent=function(w){return w&&(Eo.has(w)?Eo.get(w):"")},e.previewGistFiles=[];function hr(){let w=e.details&&e.details.gist&&e.details.gist.files||[];e.previewGistFiles=w.map(I=>({filename:e.anonymizeGistContent(I.filename),content:e.anonymizeGistContent(I.content),language:I.language}))}e.watch("details.gist.files",hr,!0),e.watch("terms",hr);function Jp(){let w=e.conference;if(e.conference_data=null,!w)return;let I=w===m||e.isUpdate&&w===e._originalConference;w!==m&&(m=null),t.get("/api/conferences/"+w).then(B=>{e.conference===w&&(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),!I&&(e.options.expirationDate=new Date(e.conference_data.endDate),e.options.expirationMode="remove",e.options.update=e.conference_data.options.update,e.options.image=e.conference_data.options.image,e.options.pdf=e.conference_data.options.pdf,e.options.notebook=e.conference_data.options.notebook,e.options.link=e.conference_data.options.link))},()=>{e.conference===w&&(e.conference_data=null)})}function So(){Y("repoId","used",!0),Y("repoId","format",!0),Y("pullRequestId","used",!0),Y("pullRequestId","format",!0),Y("gistId","used",!0),Y("gistId","format",!0),Y("sourceUrl","used",!0),Y("sourceUrl","missing",!0),Y("sourceUrl","access",!0),Y("sourceUrl","github",!0),Y("commit","exi Line truncated
`).filter(ge=>ge),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&&(j.options.pageSource=e.details.pageSource),So();let ue=e.isUpdate?"/api/repo/"+e.repoId:"/api/repo/";t.post(ue,j,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/status/"+e.repoId},ge=>{if(ge.data){let Ke=["quota_exceeded","subscription_required_for_never_expiration"].includes(ge.data.error);Ke||r("ERRORS."+ge.data.error).then(Vt=>{e.error=Vt},console.error),No(ge.data.error),Ke&&(ge.data.error==="subscription_required_for_never_expiration"&&(e._existingNever=!1),e.hostingQuotaBlocked=!0,e.hostingReview=!0,tt(()=>document.getElementById("repository-hosting")?.scrollIntoView({block:"center"})))}}).finally(()=>{I.disabled=!1})},e.anonymizeGist=w=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(ei())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let I=w.currentTarget||w.target.closest?.("button")||w.target;I.disabled=!0;let B=parseGithubUrl(e.sourceUrl),j={gistId:e.gistId,terms:e.terms.trim().split(`
`).filter(ge=>ge),source:{gistId:B.gistId},options:e.options,conference:e.conference};So();let ue=e.isUpdate?"/api/gist/"+e.gistId:"/api/gist/";t.post(ue,j,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/gist/"+e.gistId},ge=>{ge.data&&(r("ERRORS."+ge.data.error).then(Ke=>{e.error=Ke},console.error),No(ge.data.error))}).finally(()=>{I.disabled=!1})},e.anonymizePullRequest=w=>{if(e.sourceLoading){e.error="Wait for the source to finish loading before saving.";return}if(ei())return;if(e.anonymize?.invalid||e.sourceUrlError){e.error="Please correct the highlighted fields before saving.";return}let I=w.currentTarget||w.target.closest?.("button")||w.target;I.disabled=!0;let B=parseGithubUrl(e.sourceUrl),j={pullRequestId:e.pullRequestId,connection:e.githubConnection,terms:e.terms.trim().split(`
`).filter(ge=>ge),source:{repositoryFullName:`${B.owner}/${B.repo}`,pullRequestId:B.pullRequestId},options:e.options,conference:e.conference};So();let ue=e.isUpdate?"/api/pr/"+e.pullRequestId:"/api/pr/";t.post(ue,j,{headers:{"Content-Type":"application/json"}}).then(()=>{N.clear(),window.location.href="/pr/"+e.pullRequestId},ge=>{ge.data&&(r("ERRORS."+ge.data.error).then(Ke=>{e.error=Ke},console.error),No(ge.data.error))}).finally(()=>{I.disabled=!1})},e.watch("conference",()=>{Jp()}),e.termHints=[],e.matchTermAsWritten=w=>{e.terms=Rc(e.terms,w)},e.watch("options.preserveFiles",()=>{e.detectedType==="repo"&&Kt()}),e.watch("terms",()=>{e.termHints=Nc(e.terms),e.detectedType==="repo"&&ko(),e.detectedType==="pr"&&Tn(),e.detectedType==="gist"&&On()}),e.watch("options.image",()=>{e.detectedType==="repo"&&ko(),e.detectedType==="pr"&&Tn(),e.detectedType==="gist"&&On()}),e.watch("options.link",()=>{e.detectedType==="repo"&&ko(),e.detectedType==="pr"&&Tn(),e.detectedType==="gist"&&On()}),e.watch("details",()=>{e.detectedType==="pr"&&Tn(),e.detectedType==="gist"&&On()},!0)},Ka=function(e,t,o,i,s,r){ma(e);let d=Rt();Pc();let c=Ut(),u=0,y=null,h=null;e.fileLoadingSlow=!1,e.fileReceivedBytes=0;function b(){y&&(y.resolve(),y=null),h&&(d.timeout.cancel(h),h=null)}let g=!1;e.on("dispose",()=>{g=!0,u++,b(),k&&k.resolve()}),e.files=[],e.isMac=/Mac|iPhone|iPad|iPod/.test(navigator.platform||navigator.userAgent),e.fileSearchQuery="",e.fileSearchResults=null,e.fileSearchLoading=!1,c(document,"click",O=>{e.symbolsOpen&&!O.target.closest?.(".symbols")&&(e.symbolsOpen=!1),e.moreOpen&&!O.target.closest?.(".tb-more")&&(e.moreOpen=!1),e.tocOpen&&!O.target.closest?.(".tb-toc-m")&&(e.tocOpen=!1),e.gotoOpen&&O.target.isConnected&&!O.target.closest?.(".goto-pop, .btn-goto, .tb-more")&&(e.gotoOpen=!1),e.accountOpen&&!O.target.closest?.(".acct")&&(e.accountOpen=!1),e.helpOpen&&!O.target.closest?.(".vb-help")&&(e.helpOpen=!1)}),c(document,"keydown",O=>{O.key==="Escape"&&(e.symbolsOpen=!1,e.moreOpen=!1,e.tocOpen=!1,e.gotoOpen=!1,e.accountOpen=!1,e.helpOpen=!1),(O.ctrlKey||O.metaKey)&&!O.altKey&&O.key&&O.key.toLowerCase()==="f"&&e.type==="html"&&window.document.querySelector(".reading-layout")&&(O.preventDefault(),e.toggleMdFind(!0))}),c(document,"keydown",function(O){if((O.metaKey||O.ctrlKey)&&O.key==="k"){O.preventDefault();var U=document.querySelector(".tree-search-input");U&&(U.focus(),U.select())}});var k=null;e.onFileSearchChange=function(){k&&(k.resolve(),k=null);let O=e.fileSearchQuery;if(!O||O.length<2){e.fileSearchResults=null,e.fileSearchLoading=!1;return}e.fileSearchLoading=!0;let U=r.defer();k=U,t.get(`/api/repo/${e.repoId}/files/search?q=${encodeURIComponent(O)}`,{timeout:U.promise}).then(function(C){if(!(g||k!==U)){k=null,e.fileSearchLoading=!1;var q={};e.files.forEach(function(Fe){q[(Fe.path||"")+"/"+Fe.name]=!0});for(var z=[],K={},ie=0;ie<C.data.length;ie++){var ne=C.data[ie];if(ne.path)for(var Y=ne.path.split("/"),he="",Ee=0;Ee<Y.length;Ee++){var Ue=he;he=he?he+"/"+Y[Ee]:Y[Ee];var Be=Ue+"/"+Y[Ee];!q[Be]&&!K[Be]&&(K[Be]=!0,z.push({name:Y[Ee],path:Ue}))}}z.sort(function(Fe,W){return(Fe.path||"").split("/").length-(W.path||"").split("/").length}),z.length>0&&e.files.push.apply(e.files,z);for(var Je=[],He=0;He<C.data.length;He++){var et=C.data[He],Re=(et.path||"")+"/"+et.name;!q[Re]&&et.size!=null&&(Je.push(et),q[Re]=!0)}Je.length>0&&e.files.push.apply(e.files,Je),e.fileSearchResults=C.data}},function(){!g&&k===U&&(k=null,e.fileSearchLoading=!1,e.fileSearchResults=[])})},e.on("routeUpdate",function(O,U){if(e.repoId!=i.repoId)return X();if((i.path||"")!=e.filePath){window.matchMedia?.("(max-width: 767px)").matches&&(e.sidebarCollapsed=!0),e.filePath=i.path||"",e.paths=e.filePath.split("/").filter(C=>C&&C.trim().length>0),ee();for(let C=0;C<e.paths.length-1;C++){let q=C>0?e.paths.slice(0,C).join("/"):"";e.files.some(K=>K.path===q)||e.getFiles(q)}}});function R(){if(e.paths[0]!="")return;let O=["readme.md","readme.txt","readme.org","readme.1st","readme"],U={};for(let q of e.files)q.name.toLowerCase().indexOf("readme")>-1&&(U[q.name.toLowerCase()]=q.name);let C=null;for(let q of O)if(U[q]){C=q;break}if(!C&&Object.keys(U).length>0&&(C=Object.keys(U)[0]),C){let q=o.url();q[q.length-1]!="/"&&(q+="/"),o.url(q+encodePathForUrl(U[C]))}}e.fileCounts=null;let S=0,N=new Set,m=!1;e.getFiles=function(O,U=!1){let C=e.repoId,q=S;return t.get(`/api/repo/${e.repoId}/files/?path=${encodeURIComponent(O)}&v=${e.options.lastUpdateDate}`).then(function(z){if(g||C!==e.repoId||q!==S)return[];let K=O||"";return e.files=e.files.filter(ie=>ie.path!==K),e.files.push(...z.data),e.loadedFolders={...e.loadedFolders,[K]:!0},E(K,q),z.data},function(z){if(g||C!==e.repoId||q!==S)return[];U||(e.type="error",e.content=ar(z),e.files=[])})};function E(O,U){if(m||N.has(O))return;N.add(O);let C=e.repoId;t.get(`/api/repo/${e.repoId}/files/counts?path=${encodeURIComponent(O)}`).then(function(q){g||C!==e.repoId||U!==S||(e.fileCounts={...e.fileCounts,...q.data})},function() Line truncated
`).length+1)),placeholder:`Jane Smith
MIT CSAIL
jane.smith@example.org`},null,10,oP),[[s,{state:e.viewState,set:a=>{e.terms=a},value:e.terms,form:"anonymize",options:{debounce:250}}]]),t[119]||(t[119]=n("small",{class:"form-text text-muted"},"One term per line.",-1)),n("details",sP,[t[114]||(t[114]=n("summary",null,"Regex & replacement syntax",-1)),t[115]||(t[115]=v()),n("small",iP,[t[108]||(t[108]=v("Regex is supported. Replaced by ",-1)),n("code",null,c(e.site_options?.ANONYMIZATION_MASK)+"-[N]",1),t[109]||(t[109]=v(", or use ",-1)),t[110]||(t[110]=n("code",null,"term=>replacement",-1)),t[111]||(t[111]=v(" to pick your own (e.g. ",-1)),t[112]||(t[112]=n("code",null,"Anonymous=>ABC",-1)),t[113]||(t[113]=v(").",-1))])]),(l(!0),d(L,null,ie((e.termHints||[]).slice(0,3),a=>(l(),d("div",{class:"term-hint",key:a.line},[n("span",null,[t[116]||(t[116]=v("In ",-1)),n("code",null,c(a.term),1),t[117]||(t[117]=v(", ",-1)),n("code",null,c(a.symbols.join(" ")),1),v(" "+c(a.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:u=>e.matchTermAsWritten(a.line)},"Match as written",8,rP)]))),128)),(e.termHints||[]).length>3?(l(),d("div",aP,c(e.termHints.length-3)+" more "+c(e.termHints.length-3===1?"term uses":"terms use")+" regex symbols.",1)):f("v-if",!0),O(n("div",lP,"Terms are in an invalid format.",512),[[ee,e.anonymize?.terms?.errors?.format]])]),O(n("div",dP,[n("div",uP,[t[120]||(t[120]=n("span",{class:"paper-field-label",id:"preserve-files-label"},"Unredacted files",-1)),n("span",cP,c(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[22]||(t[22]=a=>e.openPreserveFiles())},c((e.options?.preserveFiles||[]).length?"Edit":"Choose files"),9,pP)],512),[[ee,e.detectedType==="repo"]]),e.preserve?.open?(l(),d("dialog",{key:0,id:"preserve-files-dialog",class:"preserve-dialog","aria-labelledby":"preserve-files-title",onCancel:t[27]||(t[27]=de(a=>e.closePreserveFiles(),["prevent"]))},[n("form",{onSubmit:t[26]||(t[26]=de(a=>e.savePreserveFiles(),["prevent"]))},[t[124]||(t[124]=n("h2",{id:"preserve-files-title"},"Leave files unredacted",-1)),t[125]||(t[125]=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)),O(n("input",{type:"search",id:"preserve-files-search",class:"form-control",placeholder:"Search files","aria-label":"Search files",autocomplete:"off","onUpdate:modelValue":t[23]||(t[23]=a=>e.preserve.search=a)},null,512),[[lt,e.preserve.search]]),n("div",fP,[e.preserve.loading?(l(),d("p",hP,"Loading files from GitHub\u2026")):e.preserve.error?(l(),d("p",mP,c(e.preserve.error),1)):(l(),d(L,{key:2},[(l(!0),d(L,null,ie(e.preserveRows(),(a,u)=>(l(),d("div",{class:"preserve-item",key:a.kind+":"+a.path,style:Ve({paddingLeft:a.depth*18+6+"px"})},[a.kind==="dir"?(l(),d("button",{key:0,type:"button",class:"preserve-caret","aria-expanded":a.open?"true":"false","aria-label":(a.open?"Collapse ":"Expand ")+a.label,onClick:p=>e.togglePreserveDir(a.path)},c(a.open?"\u25BE":"\u25B8"),9,gP)):(l(),d("span",vP)),n("input",{type:"checkbox",id:"pf-"+u,"aria-label":a.kind==="dir"?"Leave folder "+a.path+" unredacted":null,checked:a.state==="all",".indeterminate":a.state==="some",disabled:a.locked,onChange:p=>a.kind==="dir"?e.togglePreserveFolder(a.path):e.togglePreserveFile(a.path)},null,40,yP),n("label",{for:a.kind==="file"?"pf-"+u:null,class:"preserve-name",onClick:p=>a.kind==="dir"&&e.togglePreserveDir(a.path)},c(a.label),9,bP),a.note?(l(),d("span",wP,c(a.note),1)):f("v-if",!0)],4))),128)),!e.preserve.loading&&!e.preserveRows().length?(l(),d("p",kP,c(e.preserve.search?"No file matches your search.":"No text files in this commit."),1)):f("v-if",!0)],64))]),e.preserve.truncated?(l(),d("p",CP,"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[121]||(t[121]=n("summary",null,"Patterns",-1)),O(n("textarea",{class:"form-control",rows:"3","aria-label":"Patterns",placeholder:`*.bib
paper/appendix/**`,"onUpdate:modelValue":t[24]||(t[24]=a=>e.preserve.patterns=a)},null,512),[[lt,e.preserve.patterns]]),t[122]||(t[122]=n("small",{class:"form-text text-muted"},[v("One per line, as in .gitignore: "),n("code",null,"*.bib"),v(" matches in any folder; "),n("code",null,"/refs.bib"),v(" and "),n("code",null,"paper/refs.bib"),v(" match from the repository root; a folder name such as "),n("code",null,"drafts/"),v(" covers everything inside it; "),n("code",null,"!private.bib"),v(" excludes again.")],-1))],8,EP),n("div",SP,[n("span",NP,c(e.preserve.loading||e.preserve.error?"":e.preserveCount()+(e.preserveCount()===1?" file":" files")+" will be shown as written"),1),n("span",RP,[n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[25]||(t[25]=a=>e.closePreserveFiles())},"Cancel"),t[123]||(t[123]=n("button",{type:"submit",class:"btn btn-ink"},"Save",-1))])])],32)],32)):f("v-if",!0)],512),[[ee,e.detectedType]]),O(n("section",DP,[t[146]||(t[146]=n("h2",{class:"paper-section-eyebrow"},"Display",-1)),O(n("div",null,[n("div",AP,[O(n("input",TP,null,512),[[s,{state:e.viewState,set:a=>{e.options.link=a},value:e.options?.link,form:"anonymize",options:{}}]]),t[127]||(t[127]=n("label",{class:"form-check-label",for:"link"},"Keep links",-1))]),n("div",PP,[O(n("input",OP,null,512),[[s,{state:e.viewState,set:a=>{e.options.image=a},value:e.options?.image,form:"anonymize",options:{}}]]),t[128]||(t[128]=n("label",{class:"form-check-label",for:"image"},"Display images",-1))]),n("div",IP,[O(n("input",MP,null,512),[[s,{state:e.viewState,set:a=>{e.options.pdf=a},value:e.options?.pdf,form:"anonymize",options:{}}]]),t[129]||(t[129]=n("label",{class:"form-check-label",for:"pdf"},"Display PDFs",-1))]),n("div",_P,[O(n("input",VP,null,512),[[s,{state:e.viewState,set:a=>{e.options.notebook=a},value:e.options?.notebook,form:"anonymize",options:{}}]]),t[130]||(t[130]=n("label",{class:"form-check-label",for:"notebook"},"Display notebooks",-1))]),n("div",qP,[O(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,$P),[[s,{state:e.viewState,set:a=>{e.options.page=a},value:e.options?.page,form:"anonymize",options:{}}]]),t[131]||(t[131]=n("label",{class:"form-check-label",for:"page"},"GitHub Pages",-1)),e.details?.hasPage?f("v-if",!0):(l(),d("small",LP,c(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?(l(),d("small",UP,c(e.fmt?.translate("WARNINGS.page_branch_mismatch",{pageBranch:e.details?.pageSource?.branch,selectedBranch:e.source?.branch})),1)):f("v-if",!0)])],512),[[ee,e.detectedType==="repo"]]),e.detectedType==="repo"&&(e.options.image||e.options.pdf)?(l(),d("p",FP,[...t[132]||(t[132]=[v("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),O(n("div",null,[n("div",BP,[O(n("input",zP,null,512),[[s,{state:e.viewState,set:a=>{e.options.title=a},value:e.options?.title,form:"anonymize",options:{}}]]),t[133]||(t[133]=n("label",{class:"form-check-label",for:"title-gist"},"Gist description",-1))]),n("div",HP,[O(n("input",jP,null,512),[[s,{state:e.viewState,set:a=>{e.options.content=a},value:e.options?.content,form:"anonymize",options:{}}]]),t[134]||(t[134]=n("label",{class:"form-check-label",for:"content-gist"},"File contents",-1))]),n("div",GP,[O(n("input",WP,null,512),[[s,{state:e.viewState,set:a=>{e.options.comments=a},value:e.options?.comments,form:"anonymize",options:{}}]]),t[135]||(t[135]=n("label",{class:"form-check-label",for:"comments-gist"},"Comments",-1))]),n("div",KP,[O(n("input",YP,null,512),[[s,{state:e.viewState,set:a=>{e.options.username=a},value:e.options?.username,form:"anonymize",options:{}}]]),t[136]||(t[136]=n("label",{class:"form-check-label",for:"username-gist"},"Usernames",-1))]),n("div",XP,[O(n("input",QP,null,512),[[s,{state:e.viewState,set:a=>{e.options.date=a},value:e.options?.date,form:"anonymize",options:{}}]]),t[137]||(t[137]=n("label",{class:"form-check-label",for:"date-gist"},"Dates",-1))]),n("div",JP,[O(n("input",ZP,null,512),[[s,{state:e.viewState,set:a=>{e.options.origin=a},value:e.options?.origin,form:"anonymize",options:{}}]]),t[138]||(t[138]=n("label",{class:"form-check-label",for:"origin-gist"},"Source gist ID",-1))])],512),[[ee,e.detectedType==="gist"]]),O(n("div",null,[n("div",xP,[O(n("input",e3,null,512),[[s,{state:e.viewState,set:a=>{e.options.title=a},value:e.options?.title,form:"anonymize",options:{}}]]),t[139]||(t[139]=n("label",{class:"form-check-label",for:"title"},"PR title",-1))]),n("div",t3,[O(n("input",n3,null,512),[[s,{state:e.viewState,set:a=>{e.options.body=a},value:e.options?.body,form:"anonymize",options:{}}]]),t[140]||(t[140]=n("label",{class:"form-check-label",for:"body"},"PR body",-1))]),n("div",o3,[O(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"})]),v("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"})]),v("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,[v("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"),v(" 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"})]),v("Self"),n("span",{class:"serif-hy"},"-"),v("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,hT),[[d,{state:e.viewState,set:u=>{e.terms=u},value:e.terms,form:"anonymize",options:{debounce:250}}]]),t[126]||(t[126]=n("small",{class:"form-text text-muted"},"One term per line.",-1)),n("details",mT,[t[121]||(t[121]=n("summary",null,"Regex & replacement syntax",-1)),t[122]||(t[122]=v()),n("small",gT,[t[115]||(t[115]=v("Regex is supported. Replaced by ",-1)),n("code",null,p(e.site_options?.ANONYMIZATION_MASK)+"-[N]",1),t[116]||(t[116]=v(", or use ",-1)),t[117]||(t[117]=n("code",null,"term=>replacement",-1)),t[118]||(t[118]=v(" to pick your own (e.g. ",-1)),t[119]||(t[119]=n("code",null,"Anonymous=>ABC",-1)),t[120]||(t[120]=v(").",-1))])]),(a(!0),l(F,null,se((e.termHints||[]).slice(0,3),u=>(a(),l("div",{class:"term-hint",key:u.line},[n("span",null,[t[123]||(t[123]=v("In ",-1)),n("code",null,p(u.term),1),t[124]||(t[124]=v(", ",-1)),n("code",null,p(u.symbols.join(" ")),1),v(" "+p(u.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:y=>e.matchTermAsWritten(u.line)},"Match as written",8,vT)]))),128)),(e.termHints||[]).length>3?(a(),l("div",yT,p(e.termHints.length-3)+" more "+p(e.termHints.length-3===1?"term uses":"terms use")+" regex symbols.",1)):f("v-if",!0),T(n("div",bT,"Terms are in an invalid format.",512),[[Z,e.anonymize?.terms?.errors?.format]])]),T(n("div",wT,[n("div",kT,[t[127]||(t[127]=n("span",{class:"paper-field-label",id:"preserve-files-label"},"Unredacted files",-1)),n("span",CT,p(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[22]||(t[22]=u=>e.openPreserveFiles())},p((e.options?.preserveFiles||[]).length?"Edit":"Choose files"),9,ET)],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[27]||(t[27]=le(u=>e.closePreserveFiles(),["prevent"]))},[n("form",{onSubmit:t[26]||(t[26]=le(u=>e.savePreserveFiles(),["prevent"]))},[t[131]||(t[131]=n("h2",{id:"preserve-files-title"},"Leave files unredacted",-1)),t[132]||(t[132]=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)),T(n("input",{type:"search",id:"preserve-files-search",class:"form-control",placeholder:"Search files","aria-label":"Search files",autocomplete:"off","onUpdate:modelValue":t[23]||(t[23]=u=>e.preserve.search=u)},null,512),[[pt,e.preserve.search]]),n("div",ST,[e.preserve.loading?(a(),l("p",NT,"Loading files from GitHub\u2026")):e.preserve.error?(a(),l("p",RT,p(e.preserve.error),1)):(a(),l(F,{key:2},[(a(!0),l(F,null,se(e.preserveRows(),(u,y)=>(a(),l("div",{class:"preserve-item",key:u.kind+":"+u.path,style:$e({paddingLeft:u.depth*18+6+"px"})},[u.kind==="dir"?(a(),l("button",{key:0,type:"button",class:"preserve-caret","aria-expanded":u.open?"true":"false","aria-label":(u.open?"Collapse ":"Expand ")+u.label,onClick:h=>e.togglePreserveDir(u.path)},p(u.open?"\u25BE":"\u25B8"),9,DT)):(a(),l("span",PT)),n("input",{type:"checkbox",id:"pf-"+y,"aria-label":u.kind==="dir"?"Leave folder "+u.path+" unredacted":null,checked:u.state==="all",".indeterminate":u.state==="some",disabled:u.locked,onChange:h=>u.kind==="dir"?e.togglePreserveFolder(u.path):e.togglePreserveFile(u.path)},null,40,AT),n("label",{for:u.kind==="file"?"pf-"+y:null,class:"preserve-name",onClick:h=>u.kind==="dir"&&e.togglePreserveDir(u.path)},p(u.label),9,TT),u.note?(a(),l("span",OT,p(u.note),1)):f("v-if",!0)],4))),128)),!e.preserve.loading&&!e.preserveRows().length?(a(),l("p",IT,p(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",MT,"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[128]||(t[128]=n("summary",null,"Patterns",-1)),T(n("textarea",{class:"form-control",rows:"3","aria-label":"Patterns",placeholder:`*.bib
paper/appendix/**`,"onUpdate:modelValue":t[24]||(t[24]=u=>e.preserve.patterns=u)},null,512),[[pt,e.preserve.patterns]]),t[129]||(t[129]=n("small",{class:"form-text text-muted"},[v("One per line, as in .gitignore: "),n("code",null,"*.bib"),v(" matches in any folder; "),n("code",null,"/refs.bib"),v(" and "),n("code",null,"paper/refs.bib"),v(" match from the repository root; a folder name such as "),n("code",null,"drafts/"),v(" covers everything inside it; "),n("code",null,"!private.bib"),v(" excludes again.")],-1))],8,_T),n("div",VT,[n("span",qT,p(e.preserve.loading||e.preserve.error?"":e.preserveCount()+(e.preserveCount()===1?" file":" files")+" will be shown as written"),1),n("span",$T,[n("button",{type:"button",class:"btn btn-outline-ink",onClick:t[25]||(t[25]=u=>e.closePreserveFiles())},"Cancel"),t[130]||(t[130]=n("button",{type:"submit",class:"btn btn-ink"},"Save",-1))])])],32)],32)):f("v-if",!0)],512),[[Z,e.detectedType]]),T(n("section",LT,[t[153]||(t[153]=n("h2",{class:"paper-section-eyebrow"},"Display",-1)),T(n("div",null,[n("div",FT,[T(n("input",UT,null,512),[[d,{state:e.viewState,set:u=>{e.options.link=u},value:e.options?.link,form:"anonymize",options:{}}]]),t[134]||(t[134]=n("label",{class:"form-check-label",for:"link"},"Keep links",-1))]),n("div",BT,[T(n("input",zT,null,512),[[d,{state:e.viewState,set:u=>{e.options.image=u},value:e.options?.image,form:"anonymize",options:{}}]]),t[135]||(t[135]=n("label",{class:"form-check-label",for:"image"},"Display images",-1))]),n("div",HT,[T(n("input",jT,null,512),[[d,{state:e.viewState,set:u=>{e.options.pdf=u},value:e.options?.pdf,form:"anonymize",options:{}}]]),t[136]||(t[136]=n("label",{class:"form-check-label",for:"pdf"},"Display PDFs",-1))]),n("div",GT,[T(n("input",WT,null,512),[[d,{state:e.viewState,set:u=>{e.options.notebook=u},value:e.options?.notebook,form:"anonymize",options:{}}]]),t[137]||(t[137]=n("label",{class:"form-check-label",for:"notebook"},"Display notebooks",-1))]),n("div",KT,[T(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,YT),[[d,{state:e.viewState,set:u=>{e.options.page=u},value:e.options?.page,form:"anonymize",options:{}}]]),t[138]||(t[138]=n("label",{class:"form-check-label",for:"page"},"GitHub Pages",-1)),e.details?.hasPage?f("v-if",!0):(a(),l("small",XT,p(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",QT,p(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",JT,[...t[139]||(t[139]=[v("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),T(n("div",null,[n("div",ZT,[T(n("input",xT,null,512),[[d,{state:e.viewState,set:u=>{e.options.title=u},value:e.options?.title,form:"anonymize",options:{}}]]),t[140]||(t[140]=n("label",{class:"form-check-label",for:"title-gist"},"Gist description",-1))]),n("div",e3,[T(n("input",t3,null,512),[[d,{state:e.viewState,set:u=>{e.options.content=u},value:e.options?.content,form:"anonymize",options:{}}]]),t[141]||(t[141]=n("label",{class:"form-check-label",for:"content-gist"},"File contents",-1))]),n("div",n3,[T(n("input",o3,null,512),[[d,{state:e.viewState,set:u=>{e.options.comments=u},value:e.options?.comments,form:"anonymize",options:{}}]]),t[142]||(t[142]=n("label",{class:"form-check-label",for:"comments-gist"},"Comments",-1))]),n("div",s3,[T(n("input",i3,null,512),[[d,{state:e.viewState,set:u=>{e.options.username=u},value:e.options?.username,form:"anonymize",options:{}}]]),t[143]||(t[143]=n("label",{class:"form-check-label",for:"username-gist"},"Usernames",-1))]),n("div",r3,[T(n("input",a3,null,512),[[d,{state:e.viewState,set:u=>{e.options.date=u},value:e.options?.date,form:"anonymize",options:{}}]]),t[144]||(t[144]=n("label",{class:"form-check-label",for:"date-gist"},"Dates",-1))]),n("div",l3,[T(n("input",d3,null,512),[[d,{state:e.viewState,set:u=>{e.options.origin=u},value:e.options?.origin,form:"anonymize",options:{}}]]),t[145]||(t[145]=n("label",{class:"form-check-label",for:"origin-gist"},"Source gist ID",-1))])],512),[[Z,e.detectedType==="gist"]]),T(n("div",null,[n("div",u3,[T(n("input",c3,null,512),[[d,{state:e.viewState,set:u=>{e.options.title=u},value:e.options?.title,form:"anonymize",options:{}}]]),t[146]||(t[146]=n("label",{class:"form-check-label",for:"title"},"PR title",-1))]),n("div",p3,[T(n("input",f3,null,512),[[d,{state:e.viewState,set:u=>{e.options.body=u},value:e.options?.body,form:"anonymize",options:{}}]]),t[147]||(t[147]=n("label",{class:"form-check-label",for:"body"},"PR body",-1))]),n("div",h3,[T(n("in 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"})]),v("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"})]),v("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,[v("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"),v(" 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"})]),v("Self"),n("span",{class:"serif-hy"},"-"),v("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:T(["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"})]),v("Report a bug ")],-1)])],2),n("li",{class:T(["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"})]),v("Support ")],-1)])],2),e.isDarkMode?f("v-if",!0):(l(),d("li",NU,[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]=o=>{e.darkMode(!0)})},[...t[21]||(t[21]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-moon"})],-1)])])])),e.isDarkMode?(l(),d("li",RU,[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]=o=>{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?(l(),d("li",DU,[...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"}),v(" Sign in ")],-1)])])):f("v-if",!0),e.user?.username&&e.headerCanUpgrade&&!e.headerBillingPending?(l(),d("li",AU,[n("a",{class:"nav-link nav-upgrade",href:"/profile?upgrade=1",onClick:t[3]||(t[3]=de(o=>e.openHeaderUpgrade(),["prevent"]))},"Upgrade")])):f("v-if",!0),e.user?(l(),d("li",TU,[n("a",PU,[e.user?.photo?(l(),d("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,OU)):f("v-if",!0),n("span",IU,c(e.user?.username),1)]),n("div",MU,[n("h6",_U,"Signed in as @"+c(e.user?.username),1),t[25]||(t[25]=Se('<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?(l(),d("a",VU,[...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?(l(),d("div",{key:0,class:"navbar shadow generalMessage",innerHTML:e.sanitize(e.generalMessage)},null,8,qU)):f("v-if",!0),e.emailPromptOpen?(l(),d("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(o=>e.respondToEmailPrompt("later"),["prevent"]))},[n("form",{onSubmit:t[7]||(t[7]=de(o=>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)),O(n("input",{id:"email-prompt-address",class:"form-control",type:"email",autocomplete:"email",maxlength:"254",required:"","onUpdate:modelValue":t[4]||(t[4]=o=>e.emailPromptAddress=o),disabled:e.emailPromptBusy},null,8,$U),[[lt,e.emailPromptAddress]]),e.emailPromptError?(l(),d("p Line truncated
python experiments/run.py`),n("p",null,[v("Contact: "),n("span",{class:"redact",role:"img","aria-label":"Redacted term 3"},[n("i",null,"3")])])])])])])],-1))]),f(" Live stats "),n("section",{class:T(["paper-stats paper-wrap",{"is-empty":e.statsEmpty()}]),id:"metrics","aria-label":"Usage over the last 60 days"},[n("div",XU,[e.statsEmpty()?f("v-if",!0):(l(),d("div",QU,[...t[11]||(t[11]=[n("span",{class:"paper-stats-dot","aria-hidden":"true"},null,-1),v(),n("span",null,[v("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):(l(),d("div",JU,[(l(!0),d(L,null,ie(e.cards,(i,s)=>(l(),d("div",{class:"paper-stat-card",key:i?.key},[n("div",{class:T(["paper-stat-value",{"is-pending":!e.stat}])},c(e.stat?e.fmt?.bigNum(i?.total):"\u2014"),3),n("div",ZU,c(i?.label),1),e.history[i?.key].bars?.length>1&&e.history[i?.key].deltaToday>0?(l(),d("div",xU," +"+c(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,[v("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",eF,[n("div",tF,[t[13]||(t[13]=n("label",{for:"demo-terms"},[v("Terms to redact "),n("span",null,[v("comma-separated"),n("span",{class:"dt-try"},", try adding your own")])],-1)),O(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]=ut(de(()=>{},["prevent"]),["enter"]))},null,544),[[lt,e.demoTerms]])]),n("div",nF,[n("div",oF,[t[15]||(t[15]=n("div",{class:"pane-header"},[n("span",{class:"pane-label"},[v("Your repository "),n("span",{class:"pane-edit-hint"},"\xB7 editable")]),n("span",{class:"pane-url"},"github.com/jane-smith/DeepLearnUtils")],-1)),n("div",sF,[n("div",iF,[(l(!0),d(L,null,ie(e.demoParts(),(i,s)=>(l(),d(L,{key:s},[i.redacted?(l(),d("mark",rF,c(i.original),1)):(l(),d(L,{key:1},[v(c(i.text),1)],64))],64))),128)),t[14]||(t[14]=v("\u200B",-1))]),O(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),[[lt,e.demoText]])])]),n("div",aF,[n("div",lF,[t[16]||(t[16]=n("span",{class:"pane-label"},"What reviewers see",-1)),n("span",dF,[n("span",uF,c(e.demoCount())+" redacted",1)])]),n("div",cF,[(l(!0),d(L,null,ie(e.demoParts(),(i,s)=>(l(),d(L,{key:s},[i.redacted?(l(),d("span",{key:0,class:"redact-chip",title:"Replaces \u201C"+i.original+"\u201D"},c(i.text),9,pF)):(l(),d(L,{key:1},[v(c(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",fF,[n("div",hF,[(l(!0),d(L,null,ie(e.features,(i,s)=>(l(),d("div",{class:T(["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,s),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",gF,[n("span",vF,c(i?.num),1),t[17]||(t[17]=n("span",{class:"pf-sep"}," \xB7 ",-1)),n("span",yF,c(i?.eyebrow),1)]),n("span",bF,[v(c(i?.title.split("-")[0]),1),i?.title.includes("-")?(l(),d("span",wF,"-")):f("v-if",!0),v(c(i?.title.split("-").slice(1).join("-"))+" "+c(i?.accent),1)])],40,mF),n("div",kF,[n("span",CF,[v(c(i?.title.split("-")[0]),1),i?.title.includes("-")?(l(),d("span",EF,"-")):f("v-if",!0),v(c(i?.title.split("-").slice(1).join("-"))+" "+c(i?.accent),1)]),n("p",null,c(i?.text),1),n("a",{class:"paper-link-arrow",href:e.safeUrl(e.featureHref(i)),target:e.featureTarget(i)},c(i?.cta)+" \u2192",9,SF)])],2))),128))]),n("div",NF,[(l(!0),d(L,null,ie(e.features,(i,s)=>O((l(),d("div",{class:"paper-feature-panel",role:"tabpanel",key:i?.key,id:"feature-panel-"+i?.key,"aria-labelledby":"feature-tab-"+i?.key},[n("div",DF,[n("div",AF,[t[18]||(t[18]=n("span",{class:"dots"},[n("i"),n("i"),n("i")],-1)),n("span",TF,c(i?.url),1)]),n("div",{class:T(["feat-mock","is-"+i?.key]),role:"img","aria-label":i?.alt},[i?.key==="anonymize"?(l(),d("div",OF,[...t[19]||(t[19]=[Se('<div class="fm-label">GitHub re Line truncated
label names the service and the tooltip says who to contact. `),n("li",{class:P(["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"})]),v("Report a bug ")],-1)])],2),n("li",{class:P(["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"})]),v("Support ")],-1)])],2),e.isDarkMode?f("v-if",!0):(a(),l("li",DF,[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]=o=>{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",PF,[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]=o=>{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",AF,[...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"}),v(" Sign in ")],-1)])])):f("v-if",!0),e.user?.username&&e.headerCanUpgrade&&!e.headerBillingPending?(a(),l("li",TF,[n("a",{class:"nav-link nav-upgrade",href:"/profile?upgrade=1",onClick:t[3]||(t[3]=le(o=>e.openHeaderUpgrade(),["prevent"]))},"Upgrade")])):f("v-if",!0),e.user?(a(),l("li",OF,[n("a",IF,[e.user?.photo?(a(),l("img",{key:0,width:"22",height:"22",class:"rounded-circle",src:e.safeUrl(e.user?.photo)},null,8,MF)):f("v-if",!0),n("span",_F,p(e.user?.username),1)]),n("div",VF,[n("h6",qF,"Signed in as @"+p(e.user?.username),1),t[25]||(t[25]=Se('<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",$F,[...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,LF)):f("v-if",!0),e.emailPromptOpen?(a(),l("dialog",{key:1,id:"email-prompt",class:"email-prompt","aria-labelledby":"email-prompt-title","aria-describedby":"email-prompt-reason",onCancel:t[8]||(t[8]=le(o=>e.respondToEmailPrompt("later"),["prevent"]))},[n("form",{onSubmit:t[7]||(t[7]=le(o=>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)),T(n("input",{id:"email-prompt-address",class:"form-control",type:"email",autocomplete:"email",maxlength:"254",required:"","onUpdate:modelValue":t[4]||(t[4]=o=>e.emailPromptAddress=o),disabled:e.emailPromptBusy},null,8,FF),[[pt,e.emailPromptAddress]]),e.emailPromptError?(a(),l("p Line truncated
python experiments/run.py`),n("p",null,[v("Contact: "),n("span",{class:"redact",role:"img","aria-label":"Redacted term 3"},[n("i",null,"3")])])])])])])],-1))]),f(" Live stats "),n("section",{class:P(["paper-stats paper-wrap",{"is-empty":e.statsEmpty()}]),id:"metrics","aria-label":"Usage over the last 60 days"},[n("div",JF,[e.statsEmpty()?f("v-if",!0):(a(),l("div",ZF,[...t[11]||(t[11]=[n("span",{class:"paper-stats-dot","aria-hidden":"true"},null,-1),v(),n("span",null,[v("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",xF,[(a(!0),l(F,null,se(e.cards,(i,s)=>(a(),l("div",{class:"paper-stat-card",key:i?.key},[n("div",{class:P(["paper-stat-value",{"is-pending":!e.stat}])},p(e.stat?e.fmt?.bigNum(i?.total):"\u2014"),3),n("div",eU,p(i?.label),1),e.history[i?.key].bars?.length>1&&e.history[i?.key].deltaToday>0?(a(),l("div",tU," +"+p(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,[v("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",nU,[n("div",oU,[t[13]||(t[13]=n("label",{for:"demo-terms"},[v("Terms to redact "),n("span",null,[v("comma-separated"),n("span",{class:"dt-try"},", try adding your own")])],-1)),T(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]=kt(le(()=>{},["prevent"]),["enter"]))},null,544),[[pt,e.demoTerms]])]),n("div",sU,[n("div",iU,[t[15]||(t[15]=n("div",{class:"pane-header"},[n("span",{class:"pane-label"},[v("Your repository "),n("span",{class:"pane-edit-hint"},"\xB7 editable")]),n("span",{class:"pane-url"},"github.com/jane-smith/DeepLearnUtils")],-1)),n("div",rU,[n("div",aU,[(a(!0),l(F,null,se(e.demoParts(),(i,s)=>(a(),l(F,{key:s},[i.redacted?(a(),l("mark",lU,p(i.original),1)):(a(),l(F,{key:1},[v(p(i.text),1)],64))],64))),128)),t[14]||(t[14]=v("\u200B",-1))]),T(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),[[pt,e.demoText]])])]),n("div",dU,[n("div",uU,[t[16]||(t[16]=n("span",{class:"pane-label"},"What reviewers see",-1)),n("span",cU,[n("span",pU,p(e.demoCount())+" redacted",1)])]),n("div",fU,[(a(!0),l(F,null,se(e.demoParts(),(i,s)=>(a(),l(F,{key:s},[i.redacted?(a(),l("span",{key:0,class:"redact-chip",title:"Replaces \u201C"+i.original+"\u201D"},p(i.text),9,hU)):(a(),l(F,{key:1},[v(p(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",mU,[n("div",gU,[(a(!0),l(F,null,se(e.features,(i,s)=>(a(),l("div",{class:P(["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,s),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",yU,[n("span",bU,p(i?.num),1),t[17]||(t[17]=n("span",{class:"pf-sep"}," \xB7 ",-1)),n("span",wU,p(i?.eyebrow),1)]),n("span",kU,[v(p(i?.title.split("-")[0]),1),i?.title.includes("-")?(a(),l("span",CU,"-")):f("v-if",!0),v(p(i?.title.split("-").slice(1).join("-"))+" "+p(i?.accent),1)])],40,vU),n("div",EU,[n("span",SU,[v(p(i?.title.split("-")[0]),1),i?.title.includes("-")?(a(),l("span",NU,"-")):f("v-if",!0),v(p(i?.title.split("-").slice(1).join("-"))+" "+p(i?.accent),1)]),n("p",null,p(i?.text),1),n("a",{class:"paper-link-arrow",href:e.safeUrl(e.featureHref(i)),target:e.featureTarget(i)},p(i?.cta)+" \u2192",9,RU)])],2))),128))]),n("div",DU,[(a(!0),l(F,null,se(e.features,(i,s)=>T((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",AU,[n("div",TU,[t[18]||(t[18]=n("span",{class:"dots"},[n("i"),n("i"),n("i")],-1)),n("span",OU,p(i?.url),1)]),n("div",{class:P(["feat-mock","is-"+i?.key]),role:"img","aria-label":i?.alt},[i?.key==="anonymize"?(a(),l("div",MU,[...t[19]||(t[19]=[Se('<div class="fm-label">GitHub re 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
@@ -54,14 +55,18 @@ python experiments/run.py`),n("p",null,[v("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)])])):(l(),d("div",MF,[...t[21]||(t[21]=[Se('<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,PF)])],8,RF)),[[ee,e.feature===i?.key]])),128))])]),f(" FAQ teaser "),t[24]||(t[24]=Se('<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)),_e(o,{name:"partials/footer.htm",state:e.viewState},null,8,["state"])])}var _F={class:"paper-empty"},VF={class:"paper-empty-inner"},qF={key:0,class:"paper-eyebrow"},$F={key:1,class:"paper-eyebrow"},LF={key:2,class:"paper-empty-title"},UF=["textContent"];function ep(e,t){return l(),d("div",_F,[n("div",VF,[e.error?f("v-if",!0):(l(),d("div",qF,"Working")),e.error?(l(),d("div",$F,"Error")):f("v-if",!0),e.error?f("v-if",!0):(l(),d("h1",LF,[...t[0]||(t[0]=[v(" Loading",-1),n("span",{class:"dot-anim"},"\u2026",-1)])])),e.error?(l(),d("h1",{key:3,class:"paper-empty-title",textContent:c(e.fmt.translate(e.error))},null,8,UF)):f("v-if",!0)])])}var FF={class:"container paper-page paper-settings"},BF={class:"paper-crumbs"},zF={class:"here"},HF={class:"paper-page-title"},jF={class:"paper-settings-body"},GF={class:"paper-settings-toc"},WF={href:"#conf-billing"},KF={class:"form needs-validation paper-settings-main",name:"conference",novalidate:""},YF={id:"conf-basics",class:"paper-settings-section"},XF={class:"form-group"},QF={class:"invalid-feedback"},JF={class:"invalid-feedback"},ZF={class:"form-group"},xF={class:"invalid-feedback"},e7={class:"form-group"},t7={class:"invalid-feedback"},n7={class:"invalid-feedback"},o7={id:"conf-window",class:"paper-settings-section"},s7={class:"form-grid-2"},i7={class:"form-group"},r7={class:"invalid-feedback"},a7={class:"invalid-feedback"},l7={class:"form-group"},d7={class:"invalid-feedback"},u7={class:"invalid-feedback"},c7={id:"conf-rendering",class:"paper-settings-section"},p7={class:"form-check"},f7={class:"form-check-input",type:"checkbox",id:"link",name:"link"},h7={class:"form-check"},m7={class:"form-check-input",type:"checkbox",id:"image",name:"image"},g7={class:"form-check"},v7={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},y7={class:"form-check"},b7={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},w7={id:"conf-features",class:"paper-settings-section"},k7={class:"form-check"},C7={class:"form-check-input",type:"checkbox",id:"update",name:"update"},E7={class:"form-check"},S7={class:"form-check-input",type:"checkbox",id:"page",name:"page"},N7={id:"conf-plan",class:"paper-settings-section"},R7={key:0,class:"paper-section-copy"},D7={class:"conference-tiers",role:"radiogroup","aria-label":"Review package size"}Line truncated
`).length))+" lines",1)):f("v-if",!0)]),O(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]=a=>e.copyPath())},[(l(),d("svg",w9,[n("use",{href:e.pathCopied?"#ui-icon-check":"#ui-icon-link"},null,8,k9)]))],8,b9),[[ee,e.filePath]])]),e.type!="html"&&typeof e.content=="string"?(l(),d("span",C9,[e.redactionCount()?(l(),d(L,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[v(c(e.redactionCount()),1),t[47]||(t[47]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,E9),t[48]||(t[48]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),v(c(e.languageName||"Text"),1),n("span",S9,[t[49]||(t[49]=n("span",{class:"sep"},"\xB7",-1)),v(c(e.content.length<1024?e.content.length+" B":(e.content.length/1024).toFixed(1)+" KB"),1)]),t[50]||(t[50]=n("span",{class:"sep"},"\xB7",-1)),v(c(e.fmt?.number(e.content.split(`
`).length))+" lines",1)])):f("v-if",!0),e.type=="html"?(l(),d("span",N9,[e.redactionCount()?(l(),d(L,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[v(c(e.redactionCount()),1),t[51]||(t[51]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,R9),t[52]||(t[52]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),t[54]||(t[54]=v("Markdown",-1)),e.fileSize(e.filePath)!=null?(l(),d(L,{key:1},[t[53]||(t[53]=n("span",{class:"sep"},"\xB7",-1)),v(c(e.formatSize(e.fileSize(e.filePath))),1)],64)):f("v-if",!0)])):f("v-if",!0),n("div",D9,[e.isCsv()?(l(),d("div",A9,[n("button",{type:"button",role:"radio",class:T(["seg-chip",{active:e.csvView==="table"}]),"aria-checked":e.csvView==="table",onClick:t[3]||(t[3]=a=>e.csvView="table")},"Table",10,T9),n("button",{type:"button",role:"radio",class:T(["seg-chip",{active:e.csvView==="raw"}]),"aria-checked":e.csvView==="raw",onClick:t[4]||(t[4]=a=>e.csvView="raw"),title:"Show the file as text with line numbers"},"Text",10,P9)])):f("v-if",!0),e.type!="html"&&e.symbols().length>1?(l(),d("div",O9,[n("button",{type:"button",class:T(["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[5]||(t[5]=a=>e.symbolsOpen=!e.symbolsOpen)},[...t[55]||(t[55]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-list"})],-1),n("span",{class:"btn-find-label"},"Symbols",-1)])],10,I9),e.symbolsOpen?(l(),d("div",M9,[n("div",_9,c(e.symbols().length)+" "+c(e.symbols().length===1?"symbol":"symbols"),1),(l(!0),d(L,null,ie(e.symbols(),a=>(l(),d("button",{type:"button",class:"symbols-item",role:"menuitem",key:a.line+a.name,onClick:u=>e.goToSymbol(a.line)},[n("span",{class:T(["symbols-kind","is-"+a.kind])},c(a.kind==="class"?"C":a.kind==="function"?"\u0192":"v"),3),n("span",q9,c(a.name),1),n("span",$9,c(a.line),1)],8,V9))),128))])):f("v-if",!0)])):f("v-if",!0),e.type=="html"?(l(),d("button",{key:2,type:"button",class:T(["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[6]||(t[6]=a=>e.toggleMdFind())},[...t[56]||(t[56]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],10,L9)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?(l(),d("div",U9,[e.type!="html"?(l(),d("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[7]||(t[7]=a=>e.gotoLine())},[...t[57]||(t[57]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1)])],8,F9)):f("v-if",!0),e.type!="html"?(l(),d("button",{key:1,type:"button",class:T(["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[8]||(t[8]=a=>e.toggleWrap())},[...t[58]||(t[58]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)])],10,B9)):f("v-if",!0),e.type!="html"?(l(),d("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[9]||(t[9]=a=>e.findInFile())},[...t[59]||(t[59]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1)])],8,z9)):f("v-if",!0)])):f("v-if",!0),n("div",H9,[n("a",{target:"_self",class:"tb-seg-btn",title:e.type=="html"?"Open the Markdown source":"Open the raw file",href:e.safeUrl(e.url)},"Raw",8,j9),typeof e.content=="string"?(l(),d("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[10]||(t[10]=a=>e.copyContent())},[(l(),d("svg",W9,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,K9)]))],8,G9)):f("v-if",!0),n("a",{target:"_self",class:"tb-seg-btn tb-seg-icon","aria-label":"Download file",title:"Download file",href:e.safeUrl(e.url+"&download=true")},[...t[60]||(t[60]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1)])],8,Y9)]),typeof e.content=="string"?(l(),d("button",{key:4,type:"button",class:"btn btn-sm btn-icon-only btn-ghost tb-copy-m","aria-label":e.contentCopied?"Copied":"Copy file contents",onClick:t[11]||(t[11]=a=>e.copyContent())},[(l(),d("svg",Q9,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,J9)]))],8,X9)):f("v-if",!0),e.type=="html"&&e.readmeToc().length>=3?(l(),d("div",Z9,[n("button",{type:"button",class:T(["btn btn-sm btn-icon-only btn-ghost tb-toc-btn",{"is-on":e.tocOpen}]),"aria-label":"On this page",title:"On this page","aria-haspopup":"true","aria-expanded":e.tocOpen?"true":"false",onClick:t[12]||(t[12]=de(a=>{e.tocOpe 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?(l(),d("div",rB)):f("v-if",!0),e.type=="html"?(l(),d("button",{key:3,type:"button",role:"menuitem",onClick:t[16]||(t[16]=a=>e.toggleMdFind())},[...t[65]||(t[65]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),v("Find in file",-1)])])):f("v-if",!0),e.type=="html"?(l(),d("div",aB)):f("v-if",!0),e.type!="html"?(l(),d("button",{key:5,type:"button",role:"menuitem",onClick:t[17]||(t[17]=a=>e.findInFile())},[...t[66]||(t[66]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-search"})],-1),v("Find in file",-1)])])):f("v-if",!0),e.type!="html"?(l(),d("button",{key:6,type:"button",role:"menuitem",onClick:t[18]||(t[18]=a=>e.gotoLine())},[...t[67]||(t[67]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-goto"})],-1),v("Go to line",-1)])])):f("v-if",!0),e.type!="html"?(l(),d("button",{key:7,type:"button",role:"menuitemcheckbox","aria-checked":e.wrapLines?"true":"false",onClick:t[19]||(t[19]=a=>e.toggleWrap())},[t[68]||(t[68]=n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-wrap"})],-1)),t[69]||(t[69]=v("Wrap lines",-1)),e.wrapLines?(l(),d("span",dB,"\u2713")):f("v-if",!0)],8,lB)):f("v-if",!0),e.isCsv()?(l(),d("button",{key:8,type:"button",role:"menuitem",class:"tb-csv-view",onClick:t[20]||(t[20]=a=>{e.csvView=e.csvView==="table"?"raw":"table",e.moreOpen=!1})},[(l(),d("svg",uB,[n("use",{href:e.csvView==="table"?"#ui-icon-code":"#ui-icon-list"},null,8,cB)])),v(c(e.csvView==="table"?"Show as text":"Show as table"),1)])):f("v-if",!0),e.type!="html"?(l(),d("div",pB)):f("v-if",!0),e.type=="html"?(l(),d("a",{key:10,role:"menuitem",target:"_self",href:e.safeUrl(e.url)},[...t[70]||(t[70]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),v("View raw",-1)])],8,fB)):f("v-if",!0),e.type!="html"?(l(),d("a",{key:11,role:"menuitem",target:"_self",href:e.safeUrl(e.url)},[...t[71]||(t[71]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-code"})],-1),v("View raw",-1)])],8,hB)):f("v-if",!0),n("a",{role:"menuitem",target:"_self",href:e.safeUrl(e.url+"&download=true")},[...t[72]||(t[72]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-download"})],-1),v("Download file",-1)])],8,mB),e.options?.hasWebsite?(l(),d("a",{key:12,role:"menuitem",target:"_self",href:e.safeUrl("/w/"+e.repoId+"/")},[...t[73]||(t[73]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-globe"})],-1),v("Open website",-1)])],8,gB)):f("v-if",!0),e.options?.isAdmin||e.options?.isOwner?(l(),d("a",{key:13,role:"menuitem",href:e.safeUrl("/anonymize/"+e.repoId)},[...t[74]||(t[74]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-edit"})],-1),v("Edit anonymization",-1)])],8,vB)):f("v-if",!0),e.options?.download?(l(),d("a",{key:14,role:"menuitem",target:"_self",href:e.safeUrl("/api/repo/"+e.repoId+"/zip")},[...t[75]||(t[75]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-archive"})],-1),v("Download ZIP",-1)])],8,yB)):f("v-if",!0),n("button",{type:"button",role:"menuitem",onClick:t[21]||(t[21]=a=>e.copyPath())},[...t[76]||(t[76]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-link"})],-1),v("Copy file path",-1)])]),t[77]||(t[77]=n("div",{class:"tb-menu-sep"},null,-1)),t[78]||(t[78]=n("a",{role:"menuitem",href:"/faq"},[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-help"})]),v("FAQ")],-1)),t[79]||(t[79]=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"})]),v("Report a bug")],-1))])):f("v-if",!0)])]),e.gotoOpen&&e.type!="html"?(l(),d("form",{key:2,class:"goto-pop",role:"dialog","aria-label":"Go to line",onSubmit:t[25]||(t[25]=de(a=>e.submitGoto(),["prevent"]))},[t[80]||(t[80]=n("label",{class:"goto-label",for:"goto-input"},"Go to line",-1)),O(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[23]||(t[23]=a=>e.gotoValue=a),onKeydown:t[24]||(t[24]=ut(de(a=>e.closeGoto(),["prevent","stop"]),["esc"]))},null,40,bB),[[lt,e.gotoValue]]),n("span",{class:T(["goto-hint",{"is-error":e.gotoError}])},c(e.gotoError||"Line, or line:column"),3)],32)):f("v-if",!0)]),e.isCsv()&&e.csvView==="table"?(l(),d("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",kB,[n("thead",null,[n("tr",null,[t[81]||(t[81]=n("th",{class:"csv-rownum",scope:"col"},[n("span",{class:"sr-only"},"Row")],-1)),(l(!0),d(L,null,ie(e.csvRows()[0]||[],(a,u)=>(l(),d("th",{scope:"col",key:u,class:T({"is-num":e.csvNumCol(u)})},[(l(!0),d(L,null,ie(e.redactParts(a),(p,y)=>(l(),d(L,{key:y},[p.n?(l(),d("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+p.n},[n("i",null,c(p.n),1)],8,CB)):(l(),d(L,{key:1},[v(c(p.t),1)],64))],64))),128))],2))),128))])]),n("tbody",null,[(l(!0),d(L,null,ie(e.csvRows().slice(1),(a,u)=>(l(),d("tr",{key:u},[n("td",EB,c(u+1),1),(l(!0),d(L,null,ie(a,(p,y)=>(l(),d("td",{key:y,class:T({"is-num":e.csvNumCol(y)})},[(l(!0),d(L,null,ie(e.redactParts(p),(h,b)=>(l(),d(L,{key:b},[h.n?(l(),d("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+h.n},[n("i",null,c(h.n),1)],8,SB)):(l(),d(L,{key:1},[v(c(h.t),1)],64))],64))),128))],2))),128))]))),128))])])],8,wB)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?O((l(),d("div",NB,null,512)),[[r,{content:e.content,options:e.aceOption}]]):f("v-if",!0),e.type=="html"&&e.mdFindOpen?(l(),d("div",RB,[n("input",{type:"search",class:"md-find-input",placeholder:"Find on this page","aria-label":"Find on this page",value:e.mdFindQuery,onInput:t[26]||(t[26]=a=>{e.mdFindQuery=a.target.value,e.runMdFind()}),onKeydown:[t[27]||(t[27]=ut(de(a=>a.shiftKey?e.stepMdFind(-1):e.stepMdFind(1),["prevent"]),["enter"])),t[28]||(t[28]=ut(de(a=>e.toggleMdFind(!1),["prevent"]),["esc"]))]},null,40,DB),n("span",AB,[n("button",{type:"button","aria-label":"Previous match",onClick:t[29]||(t[29]=a=>e.stepMdFind(-1)),disabled:!e.mdFindTotal},[...t[82]||(t[82]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-left"})],-1)])],8,TB),n("button",{type:"button","aria-label":"Next match",onClick:t[30]||(t[30]=a=>e.stepMdFind(1)),disabled:!e.mdFindTotal},[...t[83]||(t[83]=[n("svg",{class:"ui-icon","aria-hidden":"true"},[n("use",{href:"#ui-icon-chevron-right"})],-1)])],8,PB)]),n("span",OB,c(e.mdFindQuery?e.mdFindTotal?e.mdFindIndex+1+" of "+e.mdFindTotal:"No results":""),1),n("button",{type:"button",class:T(["md-find-opt",{"is-on":e.mdFindCase}]),"aria-pressed":e.mdFindCase?"true":"false",title:"Match case","aria-label":"Match case",onClick:t[31]||(t[31]=a=>{e.mdFindCase=!e.mdFindCase,e.runMdFind()})},"Aa",10,IB),n("button",{type:"button",class:"md-find-close","aria-label":"Close find",onClick:t[32]||(t[32]=a=>e.toggleMdFind(!1))},"\xD7")])):f("v-if",!0),e.type=="html"?(l(),d("div",MB,[n("div",{class:"file-content markdown-body",innerHTML:e.renderReadme(e.sanitize(e.content))},null,8,_B),e.readmeToc().length>=3?(l(),d("aside",VB,[t[84]||(t[84]=n("div",{class:"readme-toc-head"},"On this page",-1)),n("nav",qB,[n("a",{href:"#",class:T(["lvl-2 toc-top",{"is-active":!e.activeHeading}]),onClick:t[33]||(t[33]=de(a=>e.scrollToHeading(null),["prevent"]))},"Introduction",2),(l(!0),d(L,null,ie(e.readmeToc(),(a,u)=>(l(),d("a",{key:a.id,href:"#"+a.id,class:T(["lvl-"+a.level,{"is-active":e.activeHeading===a.id}]),onClick:de(p=>e.scrollToHeading(a.id),["prevent"])},c(a.text),11,$B))),128))])])):f("v-if",!0)])):f("v-if",!0)],2)):f("v-if",!0),e.type=="html-doc"&&!e.showSource&&e.content!=null?(l(),dn(o,{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()?(l(),d("section",{key:3,class:T(["file-card file-card-media","view-"+e.type])},[n("header",LB,[n("div",UB,[n("button",{type:"button",class:T(["btn btn-sm btn-icon-only btn-ghost card-files-btn",{"is-needed":e.sidebarHidden}]),title:"Show file tree",onClick:t[34]||(t[34]=a=>e.sidebarHidden?e.sidebarHidden=!1:e.sidebarCollapsed=!1)},[...t[85]||(t[85]=[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",FB,[n("li",BB,[n("a",{href:e.safeUrl("/r/"+e.repoId+"/"),title:e.repoId,textContent:c(/^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(e.repoId||"")?"repository":e.repoId)},null,8,zB)]),(l(!0),d(L,null,ie(e.paths,(a,u)=>(l(),d("li",{class:"breadcrumb-item","aria-current":u===e.paths.length-1?"page":null},[(l(!0),d(L,null,ie(e.redactParts(a),(p,y)=>(l(),d(L,{key:y},[p.n?(l(),d("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+p.n},[n("i",null,c(p.n),1)],8,jB)):(l(),d(L,{key:1},[v(c(p.t),1)],64))],64))),128))],8,HB))),256))]),n("span",GB,[e.type== 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",VU,[...t[21]||(t[21]=[Se('<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,IU)])],8,PU)),[[Z,e.feature===i?.key]])),128))])]),f(" FAQ teaser "),t[24]||(t[24]=Se('<section class="paper-qa paper-qa-r3 paper-wrap" aria-labelledby="qa-heading"><div class="qa-head"><div><div class="paper-eyebrow">Before you sign in</div><h2 id="qa-heading">The questions that come up most.</h2></div><a class="paper-link-arrow" href="/faq">Read the full FAQ \u2192</a></div><div class="qa-grid"><div class="q"><a href="/faq#permissions">What access does GitHub sign-in require?</a><p> The GitHub App has read-only access to gists and the repositories you choose. Legacy OAuth uses broader permissions. Anonymous GitHub never writes to your repositories. </p></div><div class="q"><a href="/faq#formats">Which file formats are supported?</a><p> Source code with syntax highlighting, Markdown, Jupyter notebooks, PDFs, images, and GitHub Pages sites. Text files are anonymized; enabled images and PDFs are served unchanged. </p></div><div class="q"><a href="/faq#expiration">What happens when an anonymized repository expires?</a><p> You choose: the mirror is removed, or visitors are redirected to the original GitHub repository once the review is over. </p></div></div></section><section class="paper-cta paper-wrap" aria-labelledby="cta-heading"><div><h2 id="cta-heading">Ready for review?</h2><p>Create an anonymous mirror in a couple of minutes. Reviewers just open the link.</p></div><div class="paper-cta-actions"><a class="btn-hero" href="/signin" target="_self"><i class="fab fa-github" aria-hidden="true"></i> Sign in with GitHub</a><a class="paper-link-arrow" target="_self" href="https://anonymous.4open.science/r/840c8c57-3c32-451e-bf12-0e20be300389/">See an anonymized repository \u2192</a></div></section>',2)),Oe(o,{name:"partials/footer.htm",state:e.viewState},null,8,["state"])])}var qU={class:"paper-empty"},$U={class:"paper-empty-inner"},LU={key:0,class:"paper-eyebrow"},FU={key:1,class:"paper-eyebrow"},UU={key:2,class:"paper-empty-title"},BU=["textContent"];function fp(e,t){return a(),l("div",qU,[n("div",$U,[e.error?f("v-if",!0):(a(),l("div",LU,"Working")),e.error?(a(),l("div",FU,"Error")):f("v-if",!0),e.error?f("v-if",!0):(a(),l("h1",UU,[...t[0]||(t[0]=[v(" Loading",-1),n("span",{class:"dot-anim"},"\u2026",-1)])])),e.error?(a(),l("h1",{key:3,class:"paper-empty-title",textContent:p(e.fmt.translate(e.error))},null,8,BU)):f("v-if",!0)])])}var zU={class:"container paper-page paper-settings"},HU={class:"paper-crumbs"},jU={class:"here"},GU={class:"paper-page-title"},WU={class:"paper-settings-body"},KU={class:"paper-settings-toc"},YU={href:"#conf-billing"},XU={class:"form needs-validation paper-settings-main",name:"conference",novalidate:""},QU={id:"conf-basics",class:"paper-settings-section"},JU={class:"form-group"},ZU={class:"invalid-feedback"},xU={class:"invalid-feedback"},e7={class:"form-group"},t7={class:"invalid-feedback"},n7={class:"form-group"},o7={class:"invalid-feedback"},s7={class:"invalid-feedback"},i7={id:"conf-window",class:"paper-settings-section"},r7={class:"form-grid-2"},a7={class:"form-group"},l7={class:"invalid-feedback"},d7={class:"invalid-feedback"},u7={class:"form-group"},c7={class:"invalid-feedback"},p7={class:"invalid-feedback"},f7={id:"conf-rendering",class:"paper-settings-section"},h7={class:"form-check"},m7={class:"form-check-input",type:"checkbox",id:"link",name:"link"},g7={class:"form-check"},v7={class:"form-check-input",type:"checkbox",id:"image",name:"image"},y7={class:"form-check"},b7={class:"form-check-input",type:"checkbox",id:"pdf",name:"pdf"},w7={class:"form-check"},k7={class:"form-check-input",type:"checkbox",id:"notebook",name:"notebook"},C7={id:"conf-features",class:"paper-settings-section"},E7={class:"form-check"},S7={class:"form-check-input",type:"checkbox",id:"update",name:"update"},N7={class:"form-check"},R7={class:"form-check-input",type:"checkbox",id:"page",name:"page"},D7={id:"conf-plan",class:"paper-settings-section"},P7={key:0,class:"paper-section-copy"},A7={class:"conference-tiers",role:"radiogroup","aria-label":"Review package size"},Line truncated
`).length))+" lines",1)):f("v-if",!0)]),T(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",C9,[n("use",{href:e.pathCopied?"#ui-icon-check":"#ui-icon-link"},null,8,E9)]))],8,k9),[[Z,e.filePath]])]),e.type!="html"&&typeof e.content=="string"?(a(),l("span",S9,[e.redactionCount()?(a(),l(F,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[v(p(e.redactionCount()),1),t[49]||(t[49]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,N9),t[50]||(t[50]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),v(p(e.languageName||"Text"),1),n("span",R9,[t[51]||(t[51]=n("span",{class:"sep"},"\xB7",-1)),v(p(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)),v(p(e.fmt?.number(e.content.split(`
`).length))+" lines",1)])):f("v-if",!0),e.type=="html"?(a(),l("span",D9,[e.redactionCount()?(a(),l(F,{key:0},[n("span",{class:"meta-redact",title:e.redactionCount()+" redacted terms"},[v(p(e.redactionCount()),1),t[53]||(t[53]=n("span",{class:"meta-redact-word"}," redacted",-1))],8,P9),t[54]||(t[54]=n("span",{class:"sep"},"\xB7",-1))],64)):f("v-if",!0),t[56]||(t[56]=v("Markdown",-1)),e.fileSize(e.filePath)!=null?(a(),l(F,{key:1},[t[55]||(t[55]=n("span",{class:"sep"},"\xB7",-1)),v(p(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",A9,[e.isCsv()?(a(),l("div",T9,[n("button",{type:"button",role:"radio",class:P(["seg-chip",{active:e.csvView==="table"}]),"aria-checked":e.csvView==="table",onClick:t[4]||(t[4]=d=>e.csvView="table")},"Table",10,O9),n("button",{type:"button",role:"radio",class:P(["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,I9)])):f("v-if",!0),e.type!="html"&&e.symbols().length>1?(a(),l("div",M9,[n("button",{type:"button",class:P(["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,_9),e.symbolsOpen?(a(),l("div",V9,[n("div",q9,p(e.symbols().length)+" "+p(e.symbols().length===1?"symbol":"symbols"),1),(a(!0),l(F,null,se(e.symbols(),d=>(a(),l("button",{type:"button",class:"symbols-item",role:"menuitem",key:d.line+d.name,onClick:c=>e.goToSymbol(d.line)},[n("span",{class:P(["symbols-kind","is-"+d.kind])},p(d.kind==="class"?"C":d.kind==="function"?"\u0192":"v"),3),n("span",L9,p(d.name),1),n("span",F9,p(d.line),1)],8,$9))),128))])):f("v-if",!0)])):f("v-if",!0),e.type=="html"?(a(),l("button",{key:2,type:"button",class:P(["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,U9)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?(a(),l("div",B9,[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,z9)):f("v-if",!0),e.type!="html"?(a(),l("button",{key:1,type:"button",class:P(["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,H9)):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,j9)):f("v-if",!0)])):f("v-if",!0),!e.preview||e.url?(a(),l("div",G9,[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,W9),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",Y9,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,X9)]))],8,K9)):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,Q9)])):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",Z9,[n("use",{href:e.contentCopied?"#ui-icon-check":"#project-icon-copy"},null,8,x9)]))],8,J9)):f("v-if",!0),e.type=="html"&&e. 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",lB)):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),v("Find in file",-1)])])):f("v-if",!0),e.type=="html"?(a(),l("div",dB)):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),v("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),v("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]=v("Wrap lines",-1)),e.wrapLines?(a(),l("span",cB,"\u2713")):f("v-if",!0)],8,uB)):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",pB,[n("use",{href:e.csvView==="table"?"#ui-icon-code":"#ui-icon-list"},null,8,fB)])),v(p(e.csvView==="table"?"Show as text":"Show as table"),1)])):f("v-if",!0),e.type!="html"?(a(),l("div",hB)):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),v("View raw",-1)])],8,mB)):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),v("View raw",-1)])],8,gB)):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),v("Download file",-1)])],8,vB)):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),v("Open website",-1)])],8,yB)):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),v("Edit anonymization",-1)])],8,bB)):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),v("Download ZIP",-1)])],8,wB)):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),v("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"})]),v("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"})]),v("Report a bug")],-1))])):f("v-if",!0)])]),e.gotoOpen&&e.type!="html"?(a(),l("form",{key:3,class:"goto-pop",role:"dialog","aria-label":"Go to line",onSubmit:t[26]||(t[26]=le(d=>e.submitGoto(),["prevent"]))},[t[82]||(t[82]=n("label",{class:"goto-label",for:"goto-input"},"Go to line",-1)),T(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]=kt(le(d=>e.closeGoto(),["prevent","stop"]),["esc"]))},null,40,kB),[[pt,e.gotoValue]]),n("span",{class:P(["goto-hint",{"is-error":e.gotoError}])},p(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",EB,[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(F,null,se(e.csvRows()[0]||[],(d,c)=>(a(),l("th",{scope:"col",key:c,class:P({"is-num":e.csvNumCol(c)})},[(a(!0),l(F,null,se(e.redactParts(d),(u,y)=>(a(),l(F,{key:y},[u.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+u.n},[n("i",null,p(u.n),1)],8,SB)):(a(),l(F,{key:1},[v(p(u.t),1)],64))],64))),128))],2))),128))])]),n("tbody",null,[(a(!0),l(F,null,se(e.csvRows().slice(1),(d,c)=>(a(),l("tr",{key:c},[n("td",NB,p(c+1),1),(a(!0),l(F,null,se(d,(u,y)=>(a(),l("td",{key:y,class:P({"is-num":e.csvNumCol(y)})},[(a(!0),l(F,null,se(e.redactParts(u),(h,b)=>(a(),l(F,{key:b},[h.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+h.n},[n("i",null,p(h.n),1)],8,RB)):(a(),l(F,{key:1},[v(p(h.t),1)],64))],64))),128))],2))),128))]))),128))])])],8,CB)):f("v-if",!0),e.type!="html"&&!(e.isCsv()&&e.csvView==="table")?T((a(),l("div",DB,null,512)),[[r,{content:e.content,options:e.aceOption}]]):f("v-if",!0),e.type=="html"&&e.mdFindOpen?(a(),l("div",PB,[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]=kt(le(d=>d.shiftKey?e.stepMdFind(-1):e.stepMdFind(1),["prevent"]),["enter"])),t[29]||(t[29]=kt(le(d=>e.toggleMdFind(!1),["prevent"]),["esc"]))]},null,40,AB),n("span",TB,[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,OB),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,IB)]),n("span",MB,p(e.mdFindQuery?e.mdFindTotal?e.mdFindIndex+1+" of "+e.mdFindTotal:"No results":""),1),n("button",{type:"button",class:P(["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,_B),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",VB,[n("div",{class:"file-content markdown-body",innerHTML:e.renderReadme(e.sanitize(e.content))},null,8,qB),e.readmeToc().length>=3?(a(),l("aside",$B,[t[86]||(t[86]=n("div",{class:"readme-toc-head"},"On this page",-1)),n("nav",LB,[n("a",{href:"#",class:P(["lvl-2 toc-top",{"is-active":!e.activeHeading}]),onClick:t[34]||(t[34]=le(d=>e.scrollToHeading(null),["prevent"]))},"Introduction",2),(a(!0),l(F,null,se(e.readmeToc(),(d,c)=>(a(),l("a",{key:d.id,href:"#"+d.id,class:P(["lvl-"+d.level,{"is-active":e.activeHeading===d.id}]),onClick:le(u=>e.scrollToHeading(d.id),["prevent"])},p(d.text),11,FB))),128))])])):f("v-if",!0)])):f("v-if",!0)],2)):f("v-if",!0),e.type=="html-doc"&&!e.showSource&&e.content!=null?(a(),Gt(o,{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:P(["file-card file-card-media","view-"+e.type])},[n("header",UB,[n("div",BB,[n("button",{type:"button",class:P(["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",zB,[n("li",HB,[n("a",{href:e.safeUrl("/r/"+e.repoId+"/"),title:e.repoId,textContent:p(/^[0-9a-f]{8}-[0-9a-f]{4}-/i.test(e.repoId||"")?"repository":e.repoId)},null,8,jB)]),(a(!0),l(F,null,se(e.paths,(d,c)=>(a(),l("li",{class:"breadcrumb-item","aria-current":c===e.paths.length-1?"page":null},[(a(!0),l(F,null,se(e.redactParts(d),(u,y)=>(a(),l(F,{key:y},[u.n?(a(),l("span",{key:0,class:"redact-slot",role:"img","aria-label":"Redacted term "+u.n},[n("i",null,p(u.n),1)],8,WB)):(a(),l(F,{key:1},[v(p(u.t),1)],64))],64))),128))],8,GB))),256))]),n("span",KB,[e.type== Line truncated
`).length+1)),placeholder:`Jane Smith
MIT CSAIL
jane.smith@example.org`},null,8,ej),[[i,{state:e.viewState,set:r=>{e.terms=r},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),n("details",tj,[t[25]||(t[25]=n("summary",null,"Regex & replacement syntax",-1)),n("p",null,[t[21]||(t[21]=v("Matches become ",-1)),n("code",null,c(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[22]||(t[22]=v(". Use ",-1)),t[23]||(t[23]=n("code",null,"term=>replacement",-1)),t[24]||(t[24]=v(" for a custom replacement. Regex is supported.",-1))])]),O(n("div",nj,"Terms are in an invalid format.",512),[[ee,e.defaultsForm?.terms?.errors?.format]])])]),n("section",oj,[t[35]||(t[35]=n("h2",null,"Reviewer display",-1)),n("div",null,[n("div",sj,[n("label",ij,[O(n("input",rj,null,512),[[i,{state:e.viewState,set:r=>{e.options.link=r},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[27]||(t[27]=v("Keep links",-1))]),n("label",aj,[O(n("input",lj,null,512),[[i,{state:e.viewState,set:r=>{e.options.image=r},value:e.options?.image,form:"defaultsForm",options:{}}]]),t[28]||(t[28]=v("Display images",-1))]),n("label",dj,[O(n("input",uj,null,512),[[i,{state:e.viewState,set:r=>{e.options.pdf=r},value:e.options?.pdf,form:"defaultsForm",options:{}}]]),t[29]||(t[29]=v("Display PDFs",-1))]),n("label",cj,[O(n("input",pj,null,512),[[i,{state:e.viewState,set:r=>{e.options.notebook=r},value:e.options?.notebook,form:"defaultsForm",options:{}}]]),t[30]||(t[30]=v("Display notebooks",-1))]),n("label",fj,[O(n("input",hj,null,512),[[i,{state:e.viewState,set:r=>{e.options.loc=r},value:e.options?.loc,form:"defaultsForm",options:{}}]]),t[31]||(t[31]=v("Show line counts",-1))]),n("label",mj,[O(n("input",gj,null,512),[[i,{state:e.viewState,set:r=>{e.options.page=r},value:e.options?.page,form:"defaultsForm",options:{}}]]),t[32]||(t[32]=v("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",vj,[t[38]||(t[38]=n("h2",null,"Source updates",-1)),n("div",null,[n("label",yj,[O(n("input",bj,null,512),[[i,{state:e.viewState,set:r=>{e.options.update=r},value:e.options?.update,form:"defaultsForm",options:{}}]]),t[36]||(t[36]=v("Auto-update from GitHub",-1))]),t[37]||(t[37]=n("p",{class:"settings-help"},"Latest commit, at most once an hour.",-1))])]),n("section",wj,[t[40]||(t[40]=n("label",{class:"settings-label",for:"expiration"},"On expiration",-1)),n("div",null,[O((l(),d("select",kj,[...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",Cj,c(e.options.expirationMode==="redirect"?"Redirecting reveals the original repository. Choose the date per anonymization.":"Set the expiration date for each repository."),1)])]),n("footer",Ej,[n("div",Sj,[e.draftRestored?(l(),d("span",Nj,"Your unsaved draft was restored.")):e.unsavedChanges?(l(),d("span",Rj,"Unsaved changes"+c(e.draftSaved?" \xB7 Draft saved in this tab":""),1)):(l(),d("span",Dj,c(e.message?"Defaults saved":"No unsaved changes"),1))]),e.draftRestored||e.unsavedChanges?(l(),d("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:T(["btn btn-ink",{"is-saving":e.saving}]),disabled:e.saving||!(e.unsavedChanges||e.draftRestored)},c(e.saving?"Saving\u2026":"Save defaults"),11,Aj),e.error?(l(),d("div",Tj,c(e.error),1)):f("v-if",!0)])],32)),[[s,e.viewState]])],512),[[ee,e.settingsTab==="defaults"]]),O(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?(l(),d("p",Oj,"Loading billing\u2026")):f("v-if",!0),e.billingError?(l(),d("div",Ij,[v(c(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,Mj)])):f("v-if",!0),e.billingNotice?(l(),d("p",_j,c(e.billingNotice),1)):f("v-if",!0),e.billingPending?(l(),d("div",Vj,[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,qj)])):f("v-if",!0),n("section",$j,[n("div",Lj,[n("div",null,[t[44]||(t[44]=n("p",{class:"billing-eyebrow"},"Current plan",-1)),n("h2",Uj,c(e.profileAuthorGrant()?e.profileGrantName(e.profileAuthorGrant()):e.billing?.enabled?"Free":"Account allowance"),1),e.profileAuthorGrant()?(l(),d("p",Fj,[v(c(e.profileAuthorGrant().cancelAtPeriodEnd?"Renewal cancelled \xB7 access Line truncated
jane.smith@example.org`},null,8,oj),[[i,{state:e.viewState,set:r=>{e.terms=r},value:e.terms,form:"defaultsForm",options:{debounce:250}}]]),n("details",sj,[t[25]||(t[25]=n("summary",null,"Regex & replacement syntax",-1)),n("p",null,[t[21]||(t[21]=v("Matches become ",-1)),n("code",null,p(e.site_options?.ANONYMIZATION_MASK||"XXX")+"-[N]",1),t[22]||(t[22]=v(". Use ",-1)),t[23]||(t[23]=n("code",null,"term=>replacement",-1)),t[24]||(t[24]=v(" for a custom replacement. Regex is supported.",-1))])]),T(n("div",ij,"Terms are in an invalid format.",512),[[Z,e.defaultsForm?.terms?.errors?.format]])])]),n("section",rj,[t[35]||(t[35]=n("h2",null,"Reviewer display",-1)),n("div",null,[n("div",aj,[n("label",lj,[T(n("input",dj,null,512),[[i,{state:e.viewState,set:r=>{e.options.link=r},value:e.options?.link,form:"defaultsForm",options:{}}]]),t[27]||(t[27]=v("Keep links",-1))]),n("label",uj,[T(n("input",cj,null,512),[[i,{state:e.viewState,set:r=>{e.options.image=r},value:e.options?.image,form:"defaultsForm",options:{}}]]),t[28]||(t[28]=v("Display images",-1))]),n("label",pj,[T(n("input",fj,null,512),[[i,{state:e.viewState,set:r=>{e.options.pdf=r},value:e.options?.pdf,form:"defaultsForm",options:{}}]]),t[29]||(t[29]=v("Display PDFs",-1))]),n("label",hj,[T(n("input",mj,null,512),[[i,{state:e.viewState,set:r=>{e.options.notebook=r},value:e.options?.notebook,form:"defaultsForm",options:{}}]]),t[30]||(t[30]=v("Display notebooks",-1))]),n("label",gj,[T(n("input",vj,null,512),[[i,{state:e.viewState,set:r=>{e.options.loc=r},value:e.options?.loc,form:"defaultsForm",options:{}}]]),t[31]||(t[31]=v("Show line counts",-1))]),n("label",yj,[T(n("input",bj,null,512),[[i,{state:e.viewState,set:r=>{e.options.page=r},value:e.options?.page,form:"defaultsForm",options:{}}]]),t[32]||(t[32]=v("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",wj,[t[38]||(t[38]=n("h2",null,"Source updates",-1)),n("div",null,[n("label",kj,[T(n("input",Cj,null,512),[[i,{state:e.viewState,set:r=>{e.options.update=r},value:e.options?.update,form:"defaultsForm",options:{}}]]),t[36]||(t[36]=v("Auto-update from GitHub",-1))]),t[37]||(t[37]=n("p",{class:"settings-help"},"Latest commit, at most once an hour.",-1))])]),n("section",Ej,[t[40]||(t[40]=n("label",{class:"settings-label",for:"expiration"},"On expiration",-1)),n("div",null,[T((a(),l("select",Sj,[...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",Nj,p(e.options.expirationMode==="redirect"?"Redirecting reveals the original repository. Choose the date per anonymization.":"Set the expiration date for each repository."),1)])]),n("footer",Rj,[n("div",Dj,[e.draftRestored?(a(),l("span",Pj,"Your unsaved draft was restored.")):e.unsavedChanges?(a(),l("span",Aj,"Unsaved changes"+p(e.draftSaved?" \xB7 Draft saved in this tab":""),1)):(a(),l("span",Tj,p(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:P(["btn btn-ink",{"is-saving":e.saving}]),disabled:e.saving||!(e.unsavedChanges||e.draftRestored)},p(e.saving?"Saving\u2026":"Save defaults"),11,Oj),e.error?(a(),l("div",Ij,p(e.error),1)):f("v-if",!0)])],32)),[[s,e.viewState]])],512),[[Z,e.settingsTab==="defaults"]]),T(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",_j,"Loading billing\u2026")):f("v-if",!0),e.billingError?(a(),l("div",Vj,[v(p(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,qj)])):f("v-if",!0),e.billingNotice?(a(),l("p",$j,p(e.billingNotice),1)):f("v-if",!0),e.billingPending?(a(),l("div",Lj,[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,Fj)])):f("v-if",!0),n("section",Uj,[n("div",Bj,[n("div",null,[t[44]||(t[44]=n("p",{class:"billing-eyebrow"},"Current plan",-1)),n("h2",zj,p(e.profileAuthorGrant()?e.profileGrantName(e.profileAuthorGrant()):e.billing?.enabled?"Free":"Account allowance"),1),e.profileAuthorGrant()?(a(),l("p",Hj,[v(p(e.profileAuthorGrant().cancelAtPeriodEnd?"Renewal cancelled \xB7 access u Line truncated
`);t.innerHTML=o.map(i=>{let s=i.replace(/^(<[^>]+>)+/,"").charAt(0),r=i.startsWith("@@")?"hunk":s==="+"?"add":s==="-"?"remove":"";return`<span class="md-diff-line${r?" is-"+r:""}">${i||" "}</span>`}).join(`
`)}),Ap=(e,t=0)=>{let o=(String(e).slice(t).match(/^[ \t]*/)[0]||"").replace(/\t/g," ").length;return Math.min(t+o+4,24)},Ip=e=>{e?.closest?.(".reviewer-preview")&&e.querySelectorAll("pre code").forEach(t=>{let o=t.querySelectorAll(".md-diff-line");if(o.length){o.forEach(s=>{s.classList.contains("is-hunk")||s.style.setProperty("--hang",Ap(s.textContent,1)+"ch")});return}if(t.querySelector(".code-line"))return;let i=[];t.innerHTML=t.innerHTML.replace(/\n$/,"").split(`
`).map(s=>{let r=i.join("");s.replace(/<\/?span\b[^>]*>/g,c=>(c.startsWith("</")?i.pop():i.push(c),c));let d=s.replace(/<[^>]+>/g,"");return`<span class="code-line" style="--hang:${Ap(d)}ch">${r}${s||" "}${"</span>".repeat(i.length)}</span>`}).join(`
`)})},Mp={props:["content","terms","options"],setup(e){let t=Et(null),o=()=>{t.value.innerHTML=renderMD(e.content||"",window.location.pathname+"/../"),Op(t.value),Ip(t.value)};return fn(()=>{o(),dt(()=>[e.content,e.terms,e.options],o,{deep:!0})}),()=>Ae("markdown",{ref:t})}},aY={props:["file","terms","options"],setup(e){let t=Et(null),o=()=>tt(()=>{t.value?.querySelectorAll("pre code").forEach(i=>window.Prism?.highlightElement(i)),Op(t.value),Ip(t.value)});return fn(o),dt(()=>[e.file?.content,e.terms,e.options],o,{deep:!0}),()=>{let i=e.file||{},s=(i.filename||"").split(".").pop().toLowerCase();if(["md","markdown"].includes(s)||i.language==="Markdown")return Ae("gist-file",{ref:t},Ae(Mp,{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||s||"none").toLowerCase();return Ae("gist-file",{ref:t},Ae("pre",{class:"line-numbers"},Ae("code",{class:"language-"+(r[d]||d),key:i.content},i.content||"")))}}},lY=e=>e?.querySelectorAll(".nb-input pre").forEach(t=>{if(t.parentElement?.classList.contains("nb-code-scroll"))return;let o=document.createElement("div");o.className="nb-code-scroll",t.replaceWith(o),o.appendChild(t);let i=()=>{let s=t.scrollWidth-t.clientWidth>1;if(o.classList.toggle("is-overflowing",s),o.classList.toggle("is-at-end",s&&t.scrollLeft+t.clientWidth>=t.scrollWidth-2),!s)return;let r=t.clientWidth-16,d=Math.max(24,r*t.clientWidth/t.scrollWidth);o.style.setProperty("--thumb-w",d+"px"),o.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()}),dY={props:["file","content"],setup(e){let t=Et(null),o=0,i,s=async()=>{let r=++o;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(c=>{if(!c.ok)throw Error("Notebook request failed");return c.json()});if(await Xn("notebook"),r!==o)return;t.value.innerHTML=qs(DOMPurify.sanitize(nb.parse(d).render())),t.value.querySelectorAll("pre code").forEach(c=>window.Prism?.highlightElement(c)),lY(t.value)}catch(d){r===o&&d.name!=="AbortError"&&(t.value.textContent="Unable to render the notebook.")}};return fn(()=>{s(),dt(()=>[e.file,e.content],s)}),so(()=>{o++,i?.abort()}),()=>Ae("notebook",{ref:t})}},uY={props:["stats"],setup(e){return()=>{let t=Object.entries(e.stats||{}).filter(([,i])=>i.code),o=t.reduce((i,[,s])=>i+s.code,0);return Ae("loc",t.map(([i,s])=>Ae("div",{class:"lang",title:`${i}: ${s.code.toLocaleString()} lines`,style:{width:s.code*100/o+"%",background:langColors[i]}})))}}},_p={Markdown:Mp,GistFile:aY,Notebook:dY,Loc:uY,HtmlDoc:Rp,QuotaUsage:iY,Pdfviewer:id(async()=>(await Xn("pdf"),pdfjsLib.GlobalWorkerOptions.workerSrc="/script/external/pdf.worker.js",Dp))},Vp={async mounted(e,{value:t}){e._editorValue=t;try{if(await ni(),e._editorDisposed)return;let o=e._editorValue,i=ace.edit(e);e._editor=i,i.setValue(String(o.content??""),-1),Tp(e,o.options),e._editorCleanup=o.options?.onLoad?.(i)}catch(o){e._editorDisposed||(e.textContent=o.message)}},updated(e,{value:t}){e._editorValue=t,e._editor&&(e._editor.getValue()!==String(t.content??"")&&e._editor.setValue(String(t.content??""),-1),Tp(e,t.options))},beforeUnmount(e){e._editorDisposed=!0,e._editorCleanup?.(),e._editor?.destroy()}};function Tp(e,t={}){let o=rY.has(t.mode)?t.mode:"text";e._editor.session.setMode("ace/mode/"+o),t.theme&&e._editor.setTheme("ace/theme/"+t.theme),e._editor.setReadOnly(t.readOnly!==!1)}var qp={mounted(e){if(!window.IntersectionObserver)return;let t=[...e.querySelectorAll('a[href^="#"]')],o=new Set,i=new IntersectionObserver(s=>{s.forEach(d=>d.isIntersecting?o.add(d.target.id):o.delete(d.target.id));let r=t.find(d=>o.has(d.hash.slice(1)));r&&t.forEach(d=>d.classList.toggle("active",d===r))},{rootMargin:"-20% 0px -60% 0px",threshold:0});tt(()=>{t.forEach(s=>{let r=document.getElementById(s.hash.slice(1));r&&i.observe(r)}),t[0]&&!t.some(s=>s.classList.contains("active"))&&t[0].classList.add("active")}),e._observer=i},beforeUnmount(e){e._observer?.disconnect()}};function $p(e){let t=[],o=0,i=/\bXXXX-(\d+)\b/g,s;for(;s=i.exec(e);)s.index>o&&t.push(e.slice(o,s.index)),t.push(Ae("span",{class:"redact-slot",role:"img","aria-label":"Redacted term "+s[1]},[Ae("i",null,s[1])])),o=s.index+s[0].length;return t.length?(o<e.length&&t.push(e.slice(o)),t):e}function cY(e){let t=$p(e),o=[];for(let i of Array.isArray(t)?t:[t]){if(typeof i!="string"){o.push(i);continue}let s=i.split(/(?<=[._-])/);s.forEach((r,d)=>{o.push(r),d<s.length-1&&o.push(Ae("wbr"))})}return o}function pY(e){if(e<1024)return`${e} B`;let t=["KB","MB","GB"],o=e/1024,i=0;for(;o>=1024&&i<t.length-1;)o/=1024,i++;return`${o.toFixed(1)} ${t[i]}`}function fY(e){let t={children:[]},o=new Map([["",t]]);function i(s){if(o.has(s))return o.get(s);let r=s.lastIndexOf( Line truncated
/*! Bundled license information:
@vue/shared/dist/shared.esm-bundler.js:
+99 -1
View File
@@ -278,7 +278,7 @@ app.get("/api/user/anonymized_repositories", (req, res) => res.json(repositories
app.get("/api/user/anonymized_pull_requests", (req, res) => res.json(pullRequests));
app.get("/api/user/anonymized_gists", (req, res) => res.json(gists));
app.get("/api/user/default", (req, res) =>
res.json({ terms: ["Jane Smith", "MIT CSAIL"], options: { link: true, image: true, pdf: true, notebook: true, loc: true, page: false, update: false, mode: "GitHubStream", expirationMode: "remove" } })
res.json({ terms: ["Jane Smith", "MIT CSAIL", "jsmith"], options: { link: true, image: true, pdf: true, notebook: true, loc: true, page: false, update: false, mode: "GitHubStream", expirationMode: "remove" } })
);
app.post("/api/user/default", (req, res) => res.json({}));
// Conference review packages (billing enabled), mirroring src/core/billing/config.ts.
@@ -425,6 +425,104 @@ app.get(`/api/repo/${GALLERY_ID}/file/{*rest}`, (req, res) => {
res.status(404).json({ error: "file_not_found" });
});
// Anonymize workspace source: https://github.com/jsmith/robust-repair. The
// files carry the mock's default terms (Jane Smith, MIT CSAIL, jsmith) so the
// preview's redactions, its file viewer and the "Leave files unredacted"
// cases (a docs/ README, a bibliography) can be checked without GitHub.
// Same endpoints as src/server/routes/repository-private.ts.
const SOURCE = { owner: "jsmith", repo: "robust-repair", commit: "5be2a7c1d0e94f3b8a6c2d1e0f9a8b7c6d5e4f3a" };
const sourceText = {
"README.md": "# Robust Repair\n\nCode and data for *Learning Robust Repair Strategies from Developer Histories* by Jane Smith (MIT CSAIL).\n\n![Overview](figures/overview.png)\n\n## Getting started\n\n```bash\ngit clone https://github.com/jsmith/robust-repair\npip install -r requirements.txt\npython src/train.py --config configs/base.yaml\n```\n\nThe full documentation is in [docs/](docs/README.md). Questions: open an issue or write to Jane Smith.\n\n## Layout\n\n| Folder | Content |\n| --- | --- |\n| `src/` | Training and evaluation code |\n| `paper/` | LaTeX sources of the paper |\n| `configs/` | Experiment configurations |\n",
"docs/README.md": "# Documentation\n\nMaintained by Jane Smith at MIT CSAIL. See [usage](usage.md) for the command line.\n",
"docs/usage.md": "# Usage\n\n```bash\npython src/train.py --config configs/base.yaml --seed 1\n```\n\nRuns from the jsmith cluster write to `out/`.\n",
"src/train.py": "# Copyright 2026 Jane Smith, MIT CSAIL\n\"\"\"Train the repair model (contact: jsmith).\"\"\"\nimport argparse\n\nimport yaml\n\nfrom jsmith_utils import load_dataset\n\n\ndef main():\n parser = argparse.ArgumentParser(description=\"Train the model\")\n parser.add_argument(\"--config\", required=True)\n parser.add_argument(\"--seed\", type=int, default=1)\n args = parser.parse_args()\n with open(args.config) as f:\n config = yaml.safe_load(f)\n dataset = load_dataset(config[\"data\"])\n print(f\"Loaded {len(dataset)} examples for Jane Smith's run\")\n\n\nif __name__ == \"__main__\":\n main()\n",
"src/jsmith-utils/io.js": "// Helpers shared by the evaluation scripts. Author: Jane Smith <jane.smith@csail.mit.edu>\nconst fs = require(\"fs\");\n\n/** Reads one JSON object per line. */\nfunction readJsonLines(path) {\n return fs.readFileSync(path, \"utf8\").split(\"\\n\").filter(Boolean).map((line) => JSON.parse(line));\n}\n\nmodule.exports = { readJsonLines, lab: \"MIT CSAIL\" };\n",
"paper/main.tex": "\\documentclass{article}\n\\title{Learning Robust Repair Strategies from Developer Histories}\n\\author{Jane Smith \\\\ MIT CSAIL}\n\n\\begin{document}\n\\maketitle\n\n\\section{Introduction}\nWe build on our earlier work~\\cite{smith2024repair}, done at MIT CSAIL.\n\n\\bibliographystyle{plain}\n\\bibliography{refs}\n\\end{document}\n",
"paper/refs.bib": "@inproceedings{smith2024repair,\n title = {Repairing Programs with Developer Histories},\n author = {Jane Smith and Ana Lopez},\n booktitle = {Proceedings of ICSE},\n year = {2024},\n note = {MIT CSAIL}\n}\n",
"configs/base.yaml": "# Base configuration (Jane Smith)\ndata: data/train.jsonl\nmodel: transformer-small\nseed: 1\noutput: /home/jsmith/out\n",
"requirements.txt": "torch>=2.3\nnumpy\npyyaml\n",
LICENSE: "MIT License\n\nCopyright (c) 2026 Jane Smith\n",
// Long and nested names for the tree (wrapping, middle truncation, slots).
"experiments/jsmith-ablations/2026-03/robust_repair_baseline_with_pretraining_and_augmentation_seed_1_jsmith_final.yaml": "seed: 1\nowner: jsmith\n",
"experiments/jsmith-ablations/2026-03/notes-for-Jane Smith.md": "# Notes\n\nAblations run by Jane Smith.\n",
};
// figures/overview.png reuses the gallery image; data/train.csv is over the 1 MB preview limit.
const sourceBinary = ["figures/overview.png"];
const sourceTooBig = ["data/train.csv"];
const sourceAccess = (req, res) => {
if (/^[0-9a-f]{6,40}$/i.test(String(req.query.commit || ""))) return true;
res.status(400).json({ error: "invalid_commit_format" });
return false;
};
const SOURCE_BASE = `/api/repo/${SOURCE.owner}/${SOURCE.repo}`;
app.get(SOURCE_BASE + "/", (req, res) => res.json({
id: "mock-source-1", externalId: "gh_910001", repo: SOURCE.repo, owner: SOURCE.owner,
hasPage: false, fullName: `${SOURCE.owner}/${SOURCE.repo}`, defaultBranch: "main", size: 2048,
}));
app.get(SOURCE_BASE + "/branches", (req, res) => res.json([
{ name: "main", commit: SOURCE.commit, readme: sourceText["README.md"] },
{ name: "camera-ready", commit: "9a8b7c6d5e4f3a2b1c0d9e8f7a6b5c4d3e2f1a0b" },
]));
app.get(SOURCE_BASE + "/readme", (req, res) => res.type("text/plain").send(sourceText["README.md"]));
app.get(SOURCE_BASE + "/tree", (req, res) => {
if (!sourceAccess(req, res)) return;
res.set("Cache-Control", "private, no-store");
res.json({ files: [...Object.keys(sourceText), ...sourceTooBig].sort(), binaryFiles: sourceBinary, truncated: false });
});
app.get(SOURCE_BASE + "/file", (req, res) => {
if (!sourceAccess(req, res)) return;
const file = String(req.query.path || "");
if (!file || file.split("/").some((part) => !part || part === "." || part === "..") || /[\\\0]/.test(file)) {
return res.status(400).json({ error: "invalid_path" });
}
res.set("Cache-Control", "private, no-store");
// MOCK_FILE_DELAY=ms holds the response so the loading state can be captured.
global.setTimeout(() => {
if (sourceTooBig.includes(file)) return res.status(413).json({ error: "file_too_big" });
if (sourceBinary.includes(file)) return res.json({ binary: true, size: galleryPng.length });
if (!(file in sourceText)) return res.status(404).json({ error: "file_not_found" });
res.type("text/plain; charset=utf-8").send(sourceText[file]);
}, Number(process.env.MOCK_FILE_DELAY || 150));
});
// Use the production anonymizer for both sides of the visual comparison.
require("ts-node/register/transpile-only");
const { ContentAnonimizer } = require("../src/core/anonymize-utils");
const { isPreservedPath } = require("../src/core/preserve-files");
const fixtureOptions = { terms: ["Jane Smith", "MIT CSAIL", "jsmith"], image: true, link: true, repoName: "jsmith/robust-repair", branchName: "main", repoId: "robust-repair-preview" };
function anonymizeFixture(text, opt) {
return new ContentAnonimizer({ ...opt, terms: isPreservedPath(opt.filePath, opt.preserveFiles) ? [] : opt.terms }).anonymize(text);
}
app.post("/api/anonymize-preview", express.json({ limit: "4mb" }), (req, res) => {
const body = req.body || {}, opt = body.options || {};
res.set("Cache-Control", "private, no-store");
if (typeof body.content === "string") return res.json({ content: anonymizeFixture(body.content, opt) });
if (Array.isArray(body.contents) && body.contents.every(c => typeof c === "string")) return res.json({ contents: body.contents.map(text => anonymizeFixture(text, opt)) });
res.status(400).json({ error: "missing_content" });
});
// A reviewer repository generated from the exact source fixtures above.
const fixturePath = path => anonymizeFixture(path, { terms: fixtureOptions.terms });
const fixturePaths = [...Object.keys(sourceText), ...sourceBinary, ...sourceTooBig];
app.get("/api/repo/robust-repair-preview/options", (req, res) => res.json({ download: true, truncatedFolders: [], hasSubmodules: false }));
app.get("/api/repo/robust-repair-preview/files/counts", (req, res) => res.json({ "": fixturePaths.length }));
app.get("/api/repo/robust-repair-preview/files", (req, res) => {
const dir = String(req.query.path || ""), entries = new Map();
for (const sourcePath of fixturePaths) {
const name = fixturePath(sourcePath);
if (dir && !name.startsWith(dir + "/")) continue;
const rest = dir ? name.slice(dir.length + 1) : name;
const [first, ...nested] = rest.split("/");
entries.set(first, nested.length ? { name: first, path: dir } : { name: first, path: dir, size: Buffer.byteLength(sourceText[sourcePath] || ""), sha: "fixture" });
}
res.json([...entries.values()]);
});
app.get("/api/repo/robust-repair-preview/file/{*rest}", (req, res) => {
const sourcePath = fixturePaths.find(file => fixturePath(file) === req.params.rest.join("/"));
if (sourceTooBig.includes(sourcePath)) return res.status(413).json({ error: "file_too_big" });
if (sourceBinary.includes(sourcePath)) return res.type("png").send(galleryPng);
if (!sourcePath) return res.status(404).json({ error: "file_not_found" });
res.type("text/plain").send(anonymizeFixture(sourceText[sourcePath], { ...fixtureOptions, filePath: sourcePath }));
});
app.get("/api/repo/:id", (req, res) => {
const r = repositories.find((x) => x.repoId === req.params.id) || repositories[0];
res.json(r);
+73 -6
View File
@@ -1,12 +1,14 @@
import { octokit } from "./GitHubUtils";
import AnonymousError from "./AnonymousError";
import { classifyByName } from "./anonymize-utils";
import { classifyByName, isTextFile } from "./anonymize-utils";
/** Enough for the picker; larger repositories fall back to patterns. */
export const SOURCE_FILE_LIST_LIMIT = 20000;
export interface SourceFileList {
files: string[];
/** Known binary files (images, PDFs, archives): listed in the preview's tree, never redacted. */
binaryFiles: string[];
truncated: boolean;
}
@@ -43,11 +45,76 @@ export async function sourceFileList(opt: {
throw error;
}
const files: string[] = [];
const binaryFiles: string[] = [];
for (const entry of data.tree) {
if (entry.type !== "blob" || !entry.path) continue;
if (entry.path === ".gitmodules" || classifyByName(entry.path) === false) continue;
if (files.length === SOURCE_FILE_LIST_LIMIT) return { files: files.sort(), truncated: true };
files.push(entry.path);
if (entry.type !== "blob" || !entry.path || entry.path === ".gitmodules") continue;
const list = classifyByName(entry.path) === false ? binaryFiles : files;
if (files.length + binaryFiles.length === SOURCE_FILE_LIST_LIMIT) {
return { files: files.sort(), binaryFiles: binaryFiles.sort(), truncated: true };
}
list.push(entry.path);
}
return { files: files.sort(), truncated: !!data.truncated };
return { files: files.sort(), binaryFiles: binaryFiles.sort(), truncated: !!data.truncated };
}
/** Largest file the anonymize preview reads from GitHub (the contents API's inline limit). */
export const SOURCE_FILE_PREVIEW_LIMIT = 1024 * 1024;
/**
* A repository-relative path as the tree API returns it: no leading or
* trailing slash, no empty, "." or ".." segment, no backslash or control
* character.
*/
export function isSafeSourcePath(path: unknown): path is string {
if (typeof path !== "string" || !path || path.length > 4096) return false;
// eslint-disable-next-line no-control-regex
if (/[\\\u0000-\u001f]/.test(path)) return false;
return path.split("/").every((part) => part !== "" && part !== "." && part !== "..");
}
export type SourceFileContent =
| { binary: false; content: string; size: number }
| { binary: true; size: number };
/**
* One file of a commit, for the anonymize preview's file viewer. The text is
* returned as is: the caller redacts it through /api/anonymize-preview, like
* the README. Binary files are reported, not sent.
*/
export async function sourceFileContent(opt: {
owner: string;
repo: string;
commit: string;
path: string;
accessToken: string;
}): Promise<SourceFileContent> {
if (!isSafeSourcePath(opt.path)) throw new AnonymousError("invalid_path", { httpStatus: 400 });
let data;
try {
({ data } = await octokit(opt.accessToken).repos.getContent({
owner: opt.owner,
repo: opt.repo,
path: opt.path,
ref: opt.commit,
mediaType: { format: "object" },
}));
} catch (error) {
const status = (error as { status?: number }).status;
if (status === 404 || status === 422) {
throw new AnonymousError("file_not_found", { httpStatus: 404, cause: error as Error });
}
throw error;
}
const file = data as { type?: string; size?: number; content?: string; encoding?: string };
if (Array.isArray(data) || file.type !== "file") {
throw new AnonymousError("file_not_found", { httpStatus: 404 });
}
const size = file.size || 0;
if (classifyByName(opt.path) === false) return { binary: true, size };
if (size > SOURCE_FILE_PREVIEW_LIMIT || (size > 0 && file.encoding === "none")) {
throw new AnonymousError("file_too_big", { httpStatus: 413 });
}
const buffer = Buffer.from(file.content || "", file.encoding === "base64" ? "base64" : "utf8");
if (buffer.length && !isTextFile(opt.path, buffer)) return { binary: true, size };
return { binary: false, content: buffer.toString("utf8"), size };
}
+5 -1
View File
@@ -126,7 +126,11 @@ export default async function start() {
app.use("/service", createReviewCapabilities(process.env.REVIEW_SERVICE_KEYS));
app.use("/github/app/webhook", githubAppWebhook);
app.use("/api/billing/webhook", billingWebhook);
app.use(express.json());
// The anonymize preview posts whole source files (up to the 1 MB preview
// limit, plus JSON escaping); every other route keeps the default limit.
const previewJson = express.json({ limit: "3mb" });
const defaultJson = express.json();
app.use((req, res, next) => (req.path === "/api/anonymize-preview" ? previewJson : defaultJson)(req, res, next));
// Preserve the empty body used by API validation when no JSON was parsed.
app.use((req, _res, next) => {
req.body ??= {};
+14 -1
View File
@@ -1,4 +1,6 @@
import * as express from "express";
import { isPreservedPath, normalizePreserveFiles } from "../../core/preserve-files";
import { isSafeSourcePath } from "../../core/source-file-list";
import { ContentAnonimizer } from "../../core/anonymize-utils";
import { handleError } from "./route-utils";
import { ensureAuthenticated } from "./connection";
@@ -21,6 +23,8 @@ router.post("/", async (req: express.Request, res: express.Response) => {
contents?: unknown;
options?: {
terms?: string[];
filePath?: string;
preserveFiles?: string[];
image?: boolean;
link?: boolean;
repoName?: string;
@@ -44,11 +48,20 @@ router.post("/", async (req: express.Request, res: express.Response) => {
}
const opt = body.options || {};
const preserveFiles = normalizePreserveFiles(opt.preserveFiles);
if (!preserveFiles) return res.status(400).json({ error: "invalid_preserve_files_format" });
if (opt.filePath !== undefined && (typeof opt.filePath !== "string" || !isSafeSourcePath(opt.filePath))) {
return res.status(400).json({ error: "invalid_path" });
}
// Identical to Anonymize: preserving a file disables term replacement only.
// Image/link options and self-link rewriting still apply.
const terms = isPreservedPath(opt.filePath, preserveFiles) ? [] : opt.terms;
res.set("Cache-Control", "private, no-store");
// Construct one anonymizer per snippet so the wasAnonymized flag is per
// input. ContentAnonimizer is cheap to instantiate.
const outputs = inputs.map((content) => {
const a = new ContentAnonimizer({
terms: Array.isArray(opt.terms) ? opt.terms : [],
terms: Array.isArray(terms) ? terms : [],
image: opt.image,
link: opt.link,
repoName: opt.repoName,
+29 -1
View File
@@ -31,7 +31,7 @@ import { RepositoryStatus } from "../../core/types";
import { octokit, getRedisGateResetAt, getToken } from "../../core/GitHubUtils";
import { createLogger } from "../../core/logger";
import { normalizePreserveFiles } from "../../core/preserve-files";
import { sourceFileList } from "../../core/source-file-list";
import { sourceFileContent, sourceFileList, isSafeSourcePath } from "../../core/source-file-list";
const logger = createLogger("route:repo");
@@ -380,6 +380,34 @@ router.get(
}
);
// One file of a source commit, for the anonymize preview's file viewer. The
// raw text is returned; the preview redacts it through /api/anonymize-preview.
// Binary files are reported as { binary: true, size } instead of being sent.
router.get(
"/:owner/:repo/file",
async (req, res) => {
try {
const commit = typeof req.query.commit === "string" ? req.query.commit : "";
if (!/^[0-9a-f]{6,40}$/i.test(commit)) throw appError("invalid_commit_format", 400);
if (!isSafeSourcePath(req.query.path)) throw appError("invalid_path", 400);
const token = await previewToken(req);
const file = await sourceFileContent({
owner: req.params.owner,
repo: req.params.repo,
commit,
path: req.query.path,
accessToken: token,
});
res.set("Cache-Control", "private, no-store");
res.set("X-Content-Type-Options", "nosniff");
if (file.binary) return res.json({ binary: true, size: file.size });
res.type("text/plain; charset=utf-8").send(file.content);
} catch (error) {
handleError(error, res, req);
}
}
);
// get repository information
router.get("/:repoId/", async (req, res) => {
try {
+47
View File
@@ -0,0 +1,47 @@
const { expect } = require("chai");
require("ts-node/register/transpile-only");
const { ContentAnonimizer } = require("../src/core/anonymize-utils");
const { AnonymizeTransformer: Anonymize } = require("../src/core/anonymize-utils");
const router = require("../src/server/routes/anonymize-preview").default;
const handler = router.stack.find(layer => layer.route?.methods.post).route.stack[0].handle;
describe("POST /api/anonymize-preview preservation", () => {
const content = "Jane Smith https://example.org ![Jane Smith](plot.png)";
const options = { terms: ["Jane Smith", "Smith"], image: false, link: false };
function request(body) {
const res = { statusCode: 200, headers: {} };
res.status = code => { res.statusCode = code; return res; };
res.set = (key, value) => { res.headers[key] = value; return res; };
res.json = body => { res.body = body; return res; };
return handler({ body }, res).then(() => res);
}
for (const [filePath, preserveFiles] of [
["README.md", ["docs/"]], ["docs/README.md", ["docs/"]],
["paper/refs.bib", ["*.bib"]], ["paper/refs.bib", ["*.bib", "!/paper/refs.bib"]],
]) {
it(`matches the production stream for ${filePath} with ${preserveFiles.join(", ")}`, async () => {
const opt = { ...options, filePath, preserveFiles };
const stream = new Anonymize(opt);
let expected = "";
stream.on("data", chunk => { expected += chunk.toString(); });
const done = new Promise((resolve, reject) => { stream.on("end", resolve); stream.on("error", reject); });
stream.end(content);
await done;
const res = await request({ content, options: opt });
expect(res.body.content).to.equal(expected);
expect(res.headers["Cache-Control"]).to.equal("private, no-store");
});
}
it("keeps snippet batches working without a file path", async () => {
const res = await request({ contents: [content, "Smith"], options });
expect(res.body.contents).to.deep.equal([content, "Smith"].map(text => new ContentAnonimizer(options).anonymize(text)));
});
it("rejects malformed preservation rules and paths", async () => {
for (const preserveFiles of ["*.bib", [42], ["../private"]]) {
expect((await request({ content, options: { ...options, preserveFiles } })).statusCode).to.equal(400);
}
for (const filePath of ["../private", "/absolute", ["README.md"]]) {
expect((await request({ content, options: { ...options, filePath } })).statusCode).to.equal(400);
}
});
});
+113
View File
@@ -28,6 +28,9 @@ function harness(date) {
context.createTimers = () => ({ timeout: Object.assign(context.setTimeout, { cancel: context.clearTimeout }), interval: Object.assign(context.setInterval, { cancel: context.clearInterval }) });
context.createListeners = () => (target, name, callback) => target.addEventListener(name, callback);
vm.runInNewContext(fs.readFileSync(path.join(__dirname, "../public/script/billing.js"), "utf8").replaceAll("export function", "function"), context);
context.createPageState = parent => Object.create(parent);
const viewerSource = fs.readFileSync(path.join(__dirname, "../public/script/file-viewer.js"), "utf8");
vm.runInNewContext(viewerSource.replace(/^import .*;$/gm, "").replace(/export const/g, "var"), context);
const names = [...source.matchAll(/export const (\w+)/g)].map(match => match[1]);
vm.runInNewContext(source.replace(/^import .*;$/gm, "").replace(/export const/g, "var") + "\nthis.pageSetups = {" + names.join(",") + "};", context);
Object.assign(defs, context.pageSetups);
@@ -233,6 +236,116 @@ describe("frontend production regressions", function () {
expect(h.scope.readmePreserved()).to.equal(true);
expect(typeof h.watches["options.preserveFiles"]).to.equal("function");
});
it("redacts the root README when only docs/ is left unredacted, and finds the README GitHub shows", async function () {
const h = harness(); const timeout = () => 0; timeout.cancel = () => {};
h.context.document.getElementById = () => null;
h.defs.anonymizeController(h.scope, h.http, {}, {}, {}, () => {}, timeout);
h.scope.detectedType = "repo";
h.scope.options.preserveFiles = ["/docs/**"];
// Before the tree loads only the root README names are assumed.
expect(h.scope.readmePreserved()).to.equal(false);
expect(h.scope.readmeName()).to.equal("README.md");
h.scope.options.preserveFiles = ["docs/"];
expect(h.scope.readmePreserved()).to.equal(false);
h.scope.source = { commit: "a".repeat(40) };
h.scope.sourceUrl = "https://github.com/owner/repo";
h.scope.openPreserveFiles();
h.requests.at(-1).resolve({ data: { files: ["Readme.markdown", "docs/README.md", "readme.txt", "src/a.py"], binaryFiles: ["fig.png"], truncated: false } });
await h.flush();
expect(h.scope.readmePath()).to.equal("Readme.markdown");
expect(h.scope.readmeName()).to.equal("Readme.markdown");
expect(h.scope.readmePreserved()).to.equal(false);
h.scope.options.preserveFiles = ["*.markdown"];
expect(h.scope.readmePreserved()).to.equal(true);
// .github/ comes first, then the root, then docs/.
h.scope.source = { commit: "b".repeat(40) };
h.scope.preserve.commit = "";
h.scope.openPreserveFiles();
h.requests.at(-1).resolve({ data: { files: [".github/README.md", "README.md"], truncated: false } });
await h.flush();
expect(h.scope.readmePath()).to.equal(".github/README.md");
// The preview's tree lists binary files too, and marks the open file.
h.scope.source = { commit: "c".repeat(40) };
h.scope.preserve.commit = "";
h.scope.openPreserveFiles();
h.requests.at(-1).resolve({ data: { files: ["README.md", "src/a.py"], binaryFiles: ["fig.png"], truncated: false } });
await h.flush();
expect(Array.from(h.scope.previewTreeFiles(), row => row.name)).to.include.members(["a.py", "fig.png", "README.md"]);
});
it("redacts preview paths in the same directory and basename contexts as production", async function () {
this.timeout(10000);
const { anonymizePathCompiled, compileTerms } = require("../src/core/anonymize-utils");
for (const term of ["^Alice", "people/Alice"]) {
const h = harness(); const pending = [];
const timeout = fn => { pending.push(fn); return pending.length; }; timeout.cancel = () => {};
h.defs.anonymizeController(h.scope, h.http, {}, {}, {}, () => {}, timeout);
h.scope.terms = term;
h.scope.previewPathName("people/Alice/report.py");
pending.splice(0).forEach(fn => fn());
const request = h.requests.find(r => Array.isArray(r.body?.contents));
expect(Array.from(request.body.contents)).to.deep.equal(["people/Alice", "report.py"]);
const compiled = compileTerms([term]);
request.resolve({ data: { contents: request.body.contents.map(name => anonymizePathCompiled(name, compiled)) } });
await h.flush();
expect(h.scope.previewPathName("people/Alice/report.py")).to.equal(
anonymizePathCompiled("people/Alice", compiled) + "/" + anonymizePathCompiled("report.py", compiled));
}
});
it("opens a file of the preview tree, redacted like the README unless it is left unredacted", async function () {
const h = harness(); const pending = []; const timeout = fn => { pending.push(fn); return pending.length; }; timeout.cancel = () => {};
h.context.document.getElementById = () => null;
h.defs.anonymizeController(h.scope, h.http, {}, {}, {}, () => {}, timeout);
h.scope.detectedType = "repo";
h.scope.terms = "Jane Smith";
h.scope.source = { commit: "a".repeat(40), branch: "main" };
h.scope.sourceUrl = "https://github.com/owner/repo";
h.scope.openPreserveFiles();
h.requests.at(-1).resolve({ data: { files: ["README.md", "paper/refs.bib", "src/a.py"], binaryFiles: ["fig.png"], truncated: false } });
await h.flush();
h.scope.openPreviewFile("src/a.py");
const file = h.requests.at(-1);
expect(file.url).to.equal("/api/repo/owner/repo/file");
expect(file.body.params).to.include({ commit: "a".repeat(40), path: "src/a.py" });
expect(h.scope.previewStatus).to.equal("loading");
file.resolve({ data: "# Jane Smith\nprint(1)\n", headers: () => "text/plain; charset=utf-8" });
await h.flush();
pending.splice(0).forEach(fn => fn());
const preview = h.requests.at(-1);
expect(preview.url).to.equal("/api/anonymize-preview");
expect(preview.body.content).to.equal("# Jane Smith\nprint(1)\n");
expect(Array.from(preview.body.options.terms)).to.deep.equal(["Jane Smith"]);
preview.resolve({ data: { content: "# XXXX-1\nprint(1)\n" } });
await h.flush();
expect(h.scope.previewStatus).to.equal("ready");
expect(h.scope.previewRedactions()).to.equal(1);
expect(h.scope.previewViewer.content).to.equal("# XXXX-1\nprint(1)\n");
expect(h.scope.previewViewer.aceOption.mode).to.equal("python");
expect(h.scope.previewViewer.languageName).to.equal("Python");
expect(h.scope.previewViewer.fileBaseUrl).to.equal("https://github.com/owner/repo/raw/main/src/");
// The server receives the terms and preservation rules, just like the streamer.
h.scope.options.preserveFiles = ["*.bib"];
h.scope.openPreviewFile("paper/refs.bib");
h.requests.at(-1).resolve({ data: "author = {Jane Smith}", headers: () => "text/plain" });
await h.flush();
pending.splice(0).forEach(fn => fn());
expect(Array.from(h.requests.at(-1).body.options.terms)).to.deep.equal(["Jane Smith"]);
expect(h.requests.at(-1).body.options.filePath).to.equal("paper/refs.bib");
expect(Array.from(h.requests.at(-1).body.options.preserveFiles)).to.deep.equal(["*.bib"]);
expect(h.scope.previewPreserved()).to.equal(true);
// Binary files are not fetched; the server's { binary: true } is a note too.
const before = h.requests.length;
h.scope.openPreviewFile("fig.png");
expect(h.requests.length).to.equal(before);
expect(h.scope.previewViewer.type).to.equal("binary");
expect(h.scope.previewStatus).to.equal("ready");
h.scope.openPreviewFile("src/a.py");
h.requests.at(-1).resolve({ data: JSON.stringify({ binary: true, size: 10 }), headers: () => "application/json; charset=utf-8" });
await h.flush();
expect(h.scope.previewViewer.type).to.equal("binary");
// Back to the README.
h.scope.openPreviewFile("README.md");
expect(h.scope.previewFile).to.equal("");
});
it("includes PR comment authors and bodies in the preview batch", async function () {
const h = harness(); const pending = new Map(); let id = 0;
const timeout = fn => { pending.set(++id, fn); return id; }; timeout.cancel = id => pending.delete(id);
+60 -3
View File
@@ -1,7 +1,7 @@
const { expect } = require("chai");
require("ts-node/register/transpile-only");
const GitHubUtils = require("../src/core/GitHubUtils");
const { sourceFileList, SOURCE_FILE_LIST_LIMIT } = require("../src/core/source-file-list");
const { sourceFileList, sourceFileContent, isSafeSourcePath, SOURCE_FILE_LIST_LIMIT, SOURCE_FILE_PREVIEW_LIMIT } = require("../src/core/source-file-list");
describe("sourceFileList (#941)", function () {
const original = GitHubUtils.octokit;
@@ -21,7 +21,7 @@ describe("sourceFileList (#941)", function () {
const opt = { owner: "o", repo: "r", commit: "a".repeat(40), accessToken: "t" };
it("lists text files of the commit, sorted, without folders, submodules or binaries", async function () {
it("lists text files of the commit, sorted, with binaries apart and without folders or submodules", async function () {
response = { truncated: false, tree: [
{ type: "tree", path: "paper" },
{ type: "blob", path: "paper/refs.bib" },
@@ -30,7 +30,7 @@ describe("sourceFileList (#941)", function () {
{ type: "blob", path: ".gitmodules" },
{ type: "commit", path: "vendor/lib" },
] };
expect(await sourceFileList(opt)).to.deep.equal({ files: ["README.md", "paper/refs.bib"], truncated: false });
expect(await sourceFileList(opt)).to.deep.equal({ files: ["README.md", "paper/refs.bib"], binaryFiles: ["fig.png"], truncated: false });
expect(request).to.include({ owner: "o", repo: "r", tree_sha: "a".repeat(40), recursive: "true" });
});
@@ -55,3 +55,60 @@ describe("sourceFileList (#941)", function () {
catch (error) { expect(error.message).to.equal("repo_not_found"); }
});
});
describe("sourceFileContent (anonymize preview)", function () {
const original = GitHubUtils.octokit;
let response;
let request;
beforeEach(() => {
request = null;
GitHubUtils.octokit = () => ({
repos: { getContent: async (params) => {
request = params;
if (response instanceof Error) throw response;
return { data: response };
} },
});
});
afterEach(() => { GitHubUtils.octokit = original; });
const opt = { owner: "o", repo: "r", commit: "abc123", path: "src/main.py", accessToken: "t" };
const file = (text, extra = {}) => ({ type: "file", size: Buffer.byteLength(text), encoding: "base64", content: Buffer.from(text).toString("base64"), ...extra });
it("returns the text of a file at the commit", async function () {
response = file("print('Jane Smith')\n");
expect(await sourceFileContent(opt)).to.deep.equal({ binary: false, content: "print('Jane Smith')\n", size: 20 });
expect(request).to.include({ owner: "o", repo: "r", path: "src/main.py", ref: "abc123" });
});
it("reports binary files instead of returning them", async function () {
response = file("\u0089PNG", { size: 2048 });
expect(await sourceFileContent({ ...opt, path: "fig/plot.png" })).to.deep.equal({ binary: true, size: 2048 });
response = file("\u0000\u0001\u0002\u0000binary", { size: 9 });
expect((await sourceFileContent({ ...opt, path: "model.weights" })).binary).to.equal(true);
});
it("refuses files over the preview limit", async function () {
response = { type: "file", size: SOURCE_FILE_PREVIEW_LIMIT + 1, encoding: "none", content: "" };
try { await sourceFileContent(opt); expect.fail("should throw"); }
catch (error) { expect(error.message).to.equal("file_too_big"); expect(error.httpStatus).to.equal(413); }
});
it("maps folders, submodules and missing files to file_not_found", async function () {
for (const value of [[{ type: "file", path: "a" }], { type: "submodule" }, Object.assign(new Error("Not Found"), { status: 404 })]) {
response = value;
try { await sourceFileContent(opt); expect.fail("should throw"); }
catch (error) { expect(error.message).to.equal("file_not_found"); expect(error.httpStatus).to.equal(404); }
}
});
it("rejects path traversal before calling GitHub", async function () {
for (const path of ["../secret", "a/../../b", "/etc/passwd", "a//b", "a/./b", "a\\b", "dir/", "", "a\u0000b", 42]) {
expect(isSafeSourcePath(path), String(path)).to.equal(false);
try { await sourceFileContent({ ...opt, path }); expect.fail("should throw"); }
catch (error) { expect(error.message).to.equal("invalid_path"); }
}
expect(request).to.equal(null);
expect(isSafeSourcePath("docs/.github/README.md")).to.equal(true);
});
});
+110
View File
@@ -0,0 +1,110 @@
const { expect } = require("chai");
require("ts-node/register/transpile-only");
const utils = require("../src/server/routes/route-utils");
const app = require("../src/core/github-app");
const tokens = require("../src/core/GitHubUtils");
const db = require("../src/server/database");
const router = require("../src/server/routes/repository-private").default;
const handler = (path) => router.stack.find(layer =>
layer.route?.path === path && layer.route.methods.get).route.stack[0].handle;
// GET /api/repo/:owner/:repo/file: one file of a source commit for the
// anonymize preview, with the same access checks as /tree.
describe("GET /api/repo/:owner/:repo/file (anonymize preview)", () => {
const restores = [];
function stub(object, key, value) {
const original = object[key]; restores.push(() => { object[key] = original; }); object[key] = value;
}
let user, selections, contentRequests, content;
beforeEach(() => {
user = { id: "owner-id", model: { id: "owner-id" } };
selections = []; contentRequests = [];
content = { type: "file", size: 11, encoding: "base64", content: Buffer.from("Jane Smith\n").toString("base64") };
stub(utils, "getUser", async () => user);
stub(utils, "handleError", error => { throw error; });
stub(app, "selectRepositoryAccess", async (owner, name, kind) => {
selections.push([owner, name, kind]);
return { token: "selected-token" };
});
stub(tokens, "octokit", token => ({ repos: { getContent: async params => {
contentRequests.push({ token, ...params });
if (content instanceof Error) throw content;
return { data: content };
} } }));
});
afterEach(() => { while (restores.length) restores.pop()(); });
function response() {
const res = { headers: {}, body: undefined, type: undefined };
res.set = (key, value) => { res.headers[key] = value; return res; };
res.type = value => { res.type = value; return res; };
res.send = value => { res.body = value; return res; };
res.json = value => { res.body = value; return res; };
return res;
}
const request = query => ({ params: { owner: "owner", repo: "repo" }, query: { commit: "abc1234", path: "src/a.py", connection: "github-app", ...query } });
async function failure(query, message) {
let error;
try { await handler("/:owner/:repo/file")(request(query), response()); } catch (caught) { error = caught; }
expect(error?.message).to.equal(message);
return error;
}
it("returns the raw text, uncached, with the source's access", async () => {
const res = response();
await handler("/:owner/:repo/file")(request(), res);
expect(res.body).to.equal("Jane Smith\n");
expect(res.type).to.equal("text/plain; charset=utf-8");
expect(res.headers["Cache-Control"]).to.equal("private, no-store");
expect(selections).to.deep.equal([["owner-id", "owner/repo", "github-app"]]);
expect(contentRequests[0]).to.include({ token: "selected-token", owner: "owner", repo: "repo", path: "src/a.py", ref: "abc1234" });
});
it("reports binary files as JSON instead of sending them", async () => {
content = { type: "file", size: 5000, encoding: "base64", content: Buffer.from([0x89, 0x50, 0x4e, 0x47, 0]).toString("base64") };
const res = response();
await handler("/:owner/:repo/file")(request({ path: "fig/plot.png" }), res);
expect(res.body).to.deep.equal({ binary: true, size: 5000 });
});
it("caps the size with file_too_big (413)", async () => {
content = { type: "file", size: 2 * 1024 * 1024, encoding: "none", content: "" };
const error = await failure({}, "file_too_big");
expect(error.httpStatus).to.equal(413);
});
it("validates the commit and the path before any GitHub call", async () => {
await failure({ commit: "main" }, "invalid_commit_format");
await failure({ commit: undefined }, "invalid_commit_format");
for (const path of ["../x", "a/../../etc/passwd", "/abs", "a//b", "a\\b", undefined, ["a", "b"]]) {
await failure({ path }, "invalid_path");
}
expect(selections).to.have.length(0);
expect(contentRequests).to.have.length(0);
});
it("checks the saved repository's owner and source like /tree", async () => {
const repository = { owner: { id: "someone-else" }, model: { source: { repositoryName: "owner/repo" }, coauthors: [] } };
stub(db, "getRepository", async () => repository);
stub(utils, "isOwnerCoauthorOrAdmin", (resource, who) => {
if (resource.owner.id !== who.id) throw Object.assign(new Error("not_authorized"), { httpStatus: 403 });
});
await failure({ anonymizedRepoId: "saved" }, "not_authorized");
repository.owner.id = "owner-id";
repository.model.source.repositoryName = "other/repo";
await failure({ anonymizedRepoId: "saved" }, "repo_not_found");
repository.model.source.repositoryName = "Owner/Repo";
stub(tokens, "getToken", async () => "saved-token");
const res = response();
await handler("/:owner/:repo/file")(request({ anonymizedRepoId: "saved" }), res);
expect(res.body).to.equal("Jane Smith\n");
expect(contentRequests.at(-1).token).to.equal("saved-token");
});
it("maps a missing file to file_not_found", async () => {
content = Object.assign(new Error("Not Found"), { status: 404 });
const error = await failure({}, "file_not_found");
expect(error.httpStatus).to.equal(404);
});
});
+40 -8
View File
@@ -469,6 +469,38 @@ describe("Vue 3 UI", function () {
"/api/anonymize-preview": request => ({ content: request.payload.content.replaceAll("Private Author", "MASKED") }),
};
it("browses redacted preview paths with the explorer tree and Ace renderer", async () => {
ui = await browser("/anonymize/saved", {
...repositorySource,
"/api/repo/saved": { source: { fullName: "owner/repo", branch: "main", commit: "abcdef123" }, options: { terms: ["Private Author"] } },
"/api/repo/owner/repo/tree": { files: ["README.md", "src/other.py", "src/Private Author-utils/train.py"], binaryFiles: [] },
"/api/repo/owner/repo/file": "# Private Author\nprint(1)\n",
"/api/anonymize-preview": request => {
const redact = text => text.replaceAll("Private Author", "XXXX-1");
return request.payload.contents ? { contents: request.payload.contents.map(redact) } : { content: redact(request.payload.content) };
},
});
await delay(450);
const doc = ui.window.document;
const tree = doc.querySelector(".reviewer-preview tree.files");
expect(tree).not.to.equal(null);
tree.querySelector('a[data-path="/src"]').click();
await delay(20);
const folder = tree.querySelector('a[data-path="/src/XXXX-1-utils"]');
expect(folder.querySelector(".redact-slot i").textContent).to.equal("1");
folder.click(); await delay(20);
tree.querySelector('a[data-path="/src/XXXX-1-utils/train.py"]').click();
await delay(450);
expect(ui.app.router.currentRoute.value.path).to.equal("/anonymize/saved");
expect(tree.querySelector("li.active > a").dataset.path).to.equal("/src/XXXX-1-utils/train.py");
const state = doc.querySelector("#sourceUrl")._field.binding.state;
expect(state.previewViewer.content).to.equal("# XXXX-1\nprint(1)\n");
expect(state.previewViewer.aceOption.mode).to.equal("python");
expect(doc.querySelector(".reviewer-preview .ace_editor")).not.to.equal(null);
expect(doc.querySelector(".reviewer-preview .file-card-head .redact-slot i").textContent).to.equal("1");
expect(ui.errors).to.deep.equal([]);
});
const taskBilling = { enabled: true, csrf: "token", allowance: { plan: "free", repositories: 5 }, plans: [
{ id: "author_monthly", amount: 500, currency: "eur", interval: "month", repositories: 20, storage: 10737418240, description: "Renews monthly." },
] };
@@ -542,8 +574,8 @@ describe("Vue 3 UI", function () {
}
state.terms = "Private Author";
await delay(450);
expect(doc.querySelector('.anonymize-preview-body').textContent).to.include("MASKED");
expect(doc.querySelector('.anonymize-preview-body').textContent).not.to.include("Private Author");
expect(doc.querySelector('.reviewer-preview .file-content, .anonymize-preview-body').textContent).to.include("MASKED");
expect(doc.querySelector('.reviewer-preview .file-content, .anonymize-preview-body').textContent).not.to.include("Private Author");
state.options.expirationMode = "never"; await delay(20);
expect(doc.querySelector('.hosting-options').textContent).to.include("20 repositories");
expect(doc.querySelector('.anonymize-submit-bar').textContent).to.include("Continue to checkout");
@@ -763,8 +795,8 @@ describe("Vue 3 UI", function () {
expect(state.details.repo).to.equal("repo");
expect(state.repositoryID).to.equal("new-id");
expect(state.source.branch).to.equal("main");
expect(ui.window.document.querySelector(".anonymize-preview-body").textContent).to.include("Private Author");
expect(ui.window.document.querySelector(".anonymize-preview-body").textContent).not.to.include("OLD PRIVATE README");
expect(ui.window.document.querySelector(".file-content, .anonymize-preview-body").textContent).to.include("Private Author");
expect(ui.window.document.querySelector(".file-content, .anonymize-preview-body").textContent).not.to.include("OLD PRIVATE README");
expect(state.sourceLoading).to.equal(false);
expect(ui.errors).to.deep.equal([]);
});
@@ -965,7 +997,7 @@ describe("Vue 3 UI", function () {
[...preview().querySelectorAll("button")].find(b => b.textContent === "Retry preview").click();
await delay(260);
expect(preview().textContent).to.include("MASKED");
expect(preview().querySelector(".anonymize-preview-body")).not.to.equal(null);
expect(preview().querySelector(".file-content, .anonymize-preview-body")).not.to.equal(null);
expect(ui.errors).to.deep.equal([]);
});
}
@@ -1580,7 +1612,7 @@ describe("Vue 3 UI", function () {
for (let node = button; node; node = node.parentElement) expect(ui.window.getComputedStyle(node).display).not.to.equal("none");
button.click(); button.click();
await delay(100);
expect(ui.requests.filter(r => r.method === "POST")).to.have.length(1);
expect(ui.requests.filter(r => r.method === "POST" && r.url.pathname === "/github/connections/migrate")).to.have.length(1);
expect(ui.window.document.querySelector("#commit").value).to.equal("saved-sha");
expect(ui.requests.some(r => r.url.searchParams.get("reconnect") === "1")).to.equal(false);
expect(ui.window.document.body.textContent).to.include(failed ? "Unable to repair GitHub access" : "GitHub access repaired");
@@ -1631,11 +1663,11 @@ describe("Vue 3 UI", function () {
});
const button = [...ui.window.document.querySelectorAll("button")].find(b => b.textContent === "Reconnect source repository");
expect(button).not.to.equal(undefined);
const before = ui.requests.length;
const before = ui.requests.filter(r => r.url.searchParams.get("reconnect") === "1").length;
ui.window.confirm = () => false;
button.click();
await delay(20);
expect(ui.requests.length).to.equal(before);
expect(ui.requests.filter(r => r.url.searchParams.get("reconnect") === "1")).to.have.length(before);
ui.window.confirm = () => true;
button.click();
await delay(100);