diff --git a/crates/archivr-server/static/assets/index-B4F8YNlR.css b/crates/archivr-server/static/assets/index-B4F8YNlR.css new file mode 100644 index 0000000..f9d0156 --- /dev/null +++ b/crates/archivr-server/static/assets/index-B4F8YNlR.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Spectral:wght@500;600&display=swap";:root{color-scheme:light;--ink: #20251f;--muted: #6b6f66;--muted-2: #8a8d83;--paper: #f5f0e7;--paper-2: #e9e1d2;--paper-3: #fffaf0;--line: #d2c6b5;--line-soft: #e5dccd;--accent: #8d3f30;--accent-2: #b78342;--link: #245f72;--top: #141d18;--field: #fffdf7;--r: 3px;--r2: 6px;--r3: 10px;--sans: "Helvetica Neue", Helvetica, Arial, sans-serif;--serif: "Spectral", Georgia, "Times New Roman", serif;--display: "Cormorant Garamond", Georgia, serif}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:var(--paper);color:var(--ink);font-family:var(--sans);font-size:14px;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}button,input,select{font:inherit}.workspace,.context-rail{scrollbar-width:thin;scrollbar-color:var(--line) transparent}.workspace::-webkit-scrollbar,.context-rail::-webkit-scrollbar{width:11px;height:11px}.workspace::-webkit-scrollbar-track,.context-rail::-webkit-scrollbar-track{background:transparent}.workspace::-webkit-scrollbar-thumb,.context-rail::-webkit-scrollbar-thumb{background:var(--line);border-radius:999px;border:3px solid transparent;background-clip:padding-box}.workspace::-webkit-scrollbar-thumb:hover,.context-rail::-webkit-scrollbar-thumb:hover{background:var(--muted-2);background-clip:padding-box;border:3px solid transparent}.topbar{height:58px;display:grid;grid-template-columns:auto auto 1fr auto auto;align-items:center;gap:26px;padding:0 22px;background:var(--top);color:#efe6d6;border-bottom:3px solid var(--accent)}.brand{font-family:var(--display);font-weight:600;font-size:30px;line-height:1;letter-spacing:.01em;color:#f4ead8}.switcher{position:relative;display:inline-flex;align-items:center}.switcher select{-moz-appearance:none;appearance:none;-webkit-appearance:none;border:1px solid rgba(247,238,223,.2);background:#f7eedf0f;color:#f1e8d8;font-family:var(--sans);font-weight:550;font-size:13.5px;letter-spacing:.04em;padding:8px 32px 8px 15px;cursor:pointer;border-radius:6px;transition:background .15s ease,border-color .15s ease}.switcher select:hover{background:#f7eedf1c;border-color:#f7eedf57}.switcher:after{content:"";position:absolute;right:15px;top:50%;width:6px;height:6px;margin-top:-5px;border-right:1.2px solid #b6ab98;border-bottom:1.2px solid #b6ab98;transform:rotate(45deg);pointer-events:none}.nav{display:flex;gap:22px;justify-content:flex-end;min-width:0}.nav-link{border:0;background:transparent;color:#cdc1ad;cursor:pointer;padding:6px 0;font-size:12.5px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;position:relative}.nav-link:hover,.nav-link.is-active{color:#f4ead8}.nav-link.is-active:after{content:"";position:absolute;left:0;right:0;bottom:-2px;height:1px;background:var(--accent-2)}.capture-button{display:inline-flex;align-items:center;gap:8px;position:relative;overflow:hidden;border:0;background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 88%,#fff) 0%,var(--accent) 55%);color:#f7eddd;padding:10px 18px;cursor:pointer;font-size:12px;font-weight:600;letter-spacing:.15em;text-transform:uppercase;border-radius:var(--r);box-shadow:inset 0 1px #fff5e629,0 1px 2px #141d184d;transition:filter .18s ease,box-shadow .18s ease}.capture-button:hover{filter:brightness(.93);box-shadow:inset 0 1px #fff5e61f,0 2px 6px #141d1857}.capture-button:before{content:"";position:absolute;top:0;bottom:0;left:0;width:45%;background:linear-gradient(100deg,transparent 0%,rgba(255,246,232,.45) 50%,transparent 100%);transform:translate(-180%) skew(-18deg);pointer-events:none}@media (prefers-reduced-motion: no-preference){.capture-button:hover:before{animation:cap-sheen .7s ease}}@keyframes cap-sheen{0%{transform:translate(-180%) skew(-18deg)}to{transform:translate(340%) skew(-18deg)}}.app-shell{height:calc(100vh - 58px);display:grid;grid-template-columns:minmax(0,1fr) 340px}.workspace{min-width:0;overflow:auto;display:flex;flex-direction:column}.view{display:none}.view.is-active{display:block}.toolbar{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:16px;padding:12px 22px;background:color-mix(in srgb,var(--paper) 88%,white);border-bottom:1px solid var(--line-soft)}.search-field{position:relative;flex:1 1 auto;min-width:0;display:flex;align-items:center;height:42px;background:var(--field);border:1px solid var(--line);border-radius:20px;transition:border-color .15s ease,box-shadow .15s ease}.search-field:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}.search-field .ico{display:grid;place-items:center;width:46px;height:100%;color:var(--muted-2);flex-shrink:0}.search-field .ico svg{width:16px;height:16px}.search-input{flex:1;min-width:0;height:100%;border:0;background:transparent;color:var(--ink);padding:0 6px 0 0;font-size:14px;letter-spacing:.01em;outline:none}.search-input::placeholder{color:var(--muted-2)}.search-field .kbd{margin-right:12px;display:inline-flex;align-items:center;padding:3px 7px;font-size:11px;color:var(--muted);background:var(--paper-2);border:1px solid var(--line-soft);border-radius:var(--r);flex-shrink:0}.result-count{flex-shrink:0;font-size:13px;color:var(--muted);letter-spacing:.02em;white-space:nowrap}.result-count b{color:var(--ink);font-weight:600;font-variant-numeric:tabular-nums}.tag-filter-badge{display:inline-flex;align-items:center;gap:4px;background:var(--accent);color:#fff;border:0;border-radius:var(--r);font-size:12px;padding:2px 8px;cursor:pointer;margin-left:8px}.tag-filter-badge:hover{opacity:.85}.entry-table{width:100%;font-size:12.5px}.entry-header-row{display:flex;align-items:stretch;position:sticky;top:67px;z-index:2;background:color-mix(in srgb,var(--paper) 92%,white);border-bottom:1px solid var(--line-soft);color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.08em}.entry-header-row>div{padding:9px 10px;flex-shrink:0;font-weight:600;display:flex;align-items:center}#entries-body>div{display:flex;align-items:center;cursor:default;border-bottom:1px solid var(--line-soft)}#entries-body>div>div{padding:7px 10px;flex-shrink:0;overflow:hidden}#entries-body>div:nth-child(2n){background:#f2ede5}#entries-body>div:nth-child(odd){background:var(--paper-3)}#entries-body>div.is-selected{background:#eee2d2;outline:2px solid var(--accent);outline-offset:-2px}.col-added{width:162px;color:var(--muted)}.col-title{flex:1 1 0;min-width:0;overflow:hidden;display:flex;align-items:center;gap:.42em}.col-type{width:116px}.col-size{width:100px;display:flex;flex-direction:column;justify-content:center;gap:1px}.size-total{font-variant-numeric:tabular-nums}.size-cached-pct{font-size:10px;color:var(--muted);opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.col-url{flex:0 0 30%;min-width:0;overflow:hidden}.entry-header-row>div:first-child,#entries-body>div>div:first-child{padding-left:22px}.entry-header-row>div:last-child,#entries-body>div>div:last-child{padding-right:22px}.entry-title{color:var(--link);font-weight:700;min-width:0}.entry-header-row>div{padding:9px 10px;flex-shrink:0;font-weight:600}.source-icon{display:flex;align-items:center;justify-content:center;width:1.05em;height:1.05em;flex-shrink:0}.source-icon>*{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.source-icon svg{width:100%;height:100%}.url-cell{color:#555b55;white-space:nowrap;text-overflow:ellipsis;word-break:break-all}#entries-body .url-cell:hover,#entries-body .is-selected .url-cell{overflow:visible;white-space:normal}.type-pill{display:inline-block;padding:2px 6px;background:#d8e3df;color:#275a5f;border:1px solid #bfd0ca;border-radius:var(--r)}#runs-view .entry-table{border-collapse:collapse;table-layout:auto}#runs-view .entry-table th{position:sticky;top:0;z-index:1;text-align:left;padding:10px;background:color-mix(in srgb,var(--paper) 92%,white);color:var(--muted);border-bottom:1px solid var(--line-soft);font-size:10.5px;text-transform:uppercase;letter-spacing:.08em}#runs-view .entry-table td{padding:10px;border-bottom:1px solid var(--line-soft);vertical-align:top}#runs-view .entry-table tr:nth-child(2n) td{background:#f2ede5}#runs-view .entry-table tr:nth-child(odd) td{background:var(--paper-3)}.context-rail{border-left:1px solid var(--line);background:var(--paper);padding:20px 20px 32px;overflow:auto}.rail-eyebrow{font-size:10.5px;font-weight:600;letter-spacing:.16em;text-transform:uppercase;color:var(--muted-2);margin-bottom:16px}.rail-title{display:block;font-family:var(--sans);font-weight:700;font-size:15.5px;line-height:1.4;color:var(--ink);margin:0 0 16px;word-break:break-word}.url-tile{display:flex;align-items:center;gap:9px;padding:10px 12px;background:var(--paper-3);border:1px solid var(--line);border-radius:var(--r3);margin-bottom:20px;text-decoration:none}.url-tile:hover{background:var(--field);border-color:var(--accent)}.url-tile .ico{color:var(--ink);flex-shrink:0;display:grid;place-items:center}.url-tile .ico svg{width:15px;height:15px}.url-tile .u-text{min-width:0;flex:1;font-size:12.5px;color:var(--link);font-family:ui-monospace,SF Mono,Menlo,monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.url-tile .ext{color:var(--muted-2);flex-shrink:0}.url-tile .ext svg{width:13px;height:13px;display:block}.meta-list{margin-bottom:24px;border-top:1px solid var(--line-soft)}.meta-item{display:grid;grid-template-columns:92px 1fr;gap:14px;align-items:baseline;padding:9px 0;border-bottom:1px solid var(--line-soft)}.meta-k{font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--muted-2)}.meta-v{font-size:13.5px;color:var(--ink);word-break:break-word;line-height:1.4}.meta-v.mono{font-family:ui-monospace,SF Mono,Menlo,monospace;font-size:12px;color:var(--muted)}.rail-section{margin-bottom:24px}.rail-section-heading{display:flex;align-items:baseline;gap:8px;font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--muted-2);margin-bottom:9px;padding-bottom:8px;border-bottom:1px solid var(--line)}.rail-section-heading .num{color:var(--muted-2);font-weight:600}.artifact-list{list-style:none;margin:0;padding:0}.artifact-link{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:7px 2px;border-bottom:1px solid var(--line-soft);text-decoration:none}.artifact-link:last-child{border-bottom:0}.artifact-name{font-size:13px;color:var(--link);min-width:0;word-break:break-word}.artifact-link:hover .artifact-name{text-decoration:underline}.artifact-size{font-size:11.5px;color:var(--muted-2);flex-shrink:0;font-variant-numeric:tabular-nums}.tags-wrap{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 12px}.tag-pill{display:inline-flex;align-items:center;gap:7px;background:var(--paper-2);border:1px solid var(--line);border-radius:var(--r);font-size:12px;padding:4px 7px 4px 10px;color:var(--ink)}.tag-pill .remove{border:0;background:transparent;cursor:pointer;color:var(--muted-2);width:15px;height:15px;display:grid;place-items:center;font-size:13px;line-height:1}.tag-pill .remove:hover{color:var(--accent)}.tags-empty{font-size:13px;color:var(--muted);margin:0 0 11px}.tag-input-wrap{display:flex;align-items:center;gap:8px;background:var(--field);border:1px solid var(--line);border-radius:var(--r2);padding:2px 2px 2px 11px;transition:border-color .15s ease,box-shadow .15s ease}.tag-input-wrap:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent)}.tag-input-wrap .hash{color:var(--muted-2);font-size:13px}.tag-input{flex:1;min-width:0;border:0;background:transparent;color:var(--ink);font-size:13px;padding:6px 0;outline:none;font-family:ui-monospace,SF Mono,Menlo,monospace}.tag-add-btn{border:0;background:var(--ink);color:var(--paper-3);padding:6px 13px;font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;border-radius:var(--r);cursor:pointer;white-space:nowrap}.tag-add-btn:hover{background:#2c332b}.coll-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 13px;background:var(--field);border:1px solid var(--line);border-radius:var(--r2);margin-bottom:6px;transition:border-color .15s ease}.coll-row:hover{border-color:var(--accent)}.coll-name{font-size:13px;color:var(--ink);font-weight:500}.vis-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--muted);background:var(--paper-2);border:1px solid var(--line-soft);border-radius:999px;padding:3px 10px}.vis-badge:before{content:"";width:6px;height:6px;border-radius:50%;background:var(--accent-2)}.capture-dialog{border:1px solid var(--line);background:var(--paper);padding:0;min-width:360px;max-width:520px;border-radius:var(--r3);box-shadow:0 20px 60px #141d1847}.capture-dialog::backdrop{background:#141d1873}.capture-dialog-inner{padding:28px}.capture-dialog-title{margin:0 0 16px;font-size:22px;font-family:var(--display);font-weight:600}.capture-label{display:block;font-size:11px;font-weight:600;margin-bottom:6px;color:var(--muted-2);text-transform:uppercase;letter-spacing:.06em}.capture-input{width:100%;height:44px;border:1px solid var(--line);background:var(--field);color:var(--ink);padding:0 14px;font-size:15px;margin-bottom:10px;border-radius:var(--r2);outline:none;transition:border-color .15s ease,box-shadow .15s ease}.capture-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}.form-field .capture-input{margin-bottom:0}.capture-error{color:var(--accent);font-size:13px;margin-bottom:10px;min-height:18px}.capture-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:16px}.capture-cancel{border:1px solid var(--line);background:none;color:var(--ink);padding:8px 18px;border-radius:var(--r);cursor:pointer}.capture-cancel:hover{background:var(--paper-2)}.capture-submit{border:0;background:var(--ink);color:var(--paper);padding:8px 20px;border-radius:var(--r);cursor:pointer;font-weight:600}.capture-submit:hover{opacity:.85}.capture-submit:disabled{opacity:.45;cursor:default}.muted{color:var(--muted)}.admin-view{padding:22px}.admin-list{display:grid;gap:10px;max-width:780px}.admin-archive{border:1px solid var(--line);background:var(--paper-3);padding:12px;border-radius:var(--r2)}.tag-tree{padding:20px 22px;max-width:320px}.tag-tree-header{display:flex;align-items:baseline;gap:10px;margin-bottom:14px;border-bottom:1px solid var(--line-soft);padding-bottom:10px}.tag-tree-title{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.07em}.tag-tree-active{font-size:12px;color:var(--muted-2);font-style:italic}.tag-tree-list{list-style:none;margin:0;padding:0}.tag-children{padding-left:16px}.tag-node-btn{border:0;background:transparent;color:var(--link);cursor:pointer;padding:3px 0;text-align:left;font-size:13px;display:block;width:100%}.tag-node-btn:hover{text-decoration:underline}.tag-node-btn.is-active{font-weight:600;color:var(--ink)}.tag-node-row{display:flex;align-items:center;gap:4px}.tag-node-row .tag-node-btn{flex:1 1 0;min-width:0;display:flex;align-items:center;gap:4px;width:auto}.tag-node-btn .edit-icon{width:.75em;height:.75em;flex-shrink:0;vertical-align:-.1em;opacity:.35}.tag-node-btn:hover .edit-icon{opacity:.65}.tag-node-delete{flex-shrink:0;border:0;background:transparent;color:var(--muted-2);cursor:pointer;padding:0 3px;font-size:14px;line-height:1;opacity:0}.tag-node-row:hover .tag-node-delete{opacity:1}.tag-node-delete:hover{color:var(--accent)}.tag-rename-input{font-size:13px;flex:1 1 0;min-width:0;padding:2px 5px;border:1px solid var(--accent);border-radius:var(--r);background:var(--field);color:var(--ink);outline:none}.collections-view{padding:24px}.collections-heading{margin:0 0 16px;font-size:22px;font-family:var(--display);font-weight:600}.collections-error{color:var(--accent);font-size:13px;margin-bottom:8px}.coll-dismiss{background:none;border:none;cursor:pointer;color:var(--accent);font-size:16px;line-height:1;padding:0 4px}.collections-layout{display:grid;grid-template-columns:220px 1fr;gap:0;border:1px solid var(--line);border-radius:var(--r2);min-height:340px}.collections-sidebar{border-right:1px solid var(--line);overflow-y:auto}.coll-sidebar-row{display:flex;flex-direction:column;width:100%;padding:10px 14px;border:none;border-bottom:1px solid var(--line-soft);background:none;cursor:pointer;text-align:left;gap:2px}.coll-sidebar-row:hover{background:var(--paper-2)}.coll-sidebar-row.is-active{background:var(--paper-2);border-left:3px solid var(--accent)}.coll-row-name{font-size:14px;font-weight:600;color:var(--ink)}.coll-row-meta{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}.coll-detail{padding:20px 24px;display:flex;flex-direction:column;gap:16px}.coll-detail--empty{justify-content:center;align-items:center}.coll-detail-header{display:flex;align-items:center;gap:12px}.coll-detail-name{margin:0;font-size:18px;font-family:var(--display);font-weight:600;flex:1}.coll-detail-name--editable{cursor:pointer}.coll-detail-name--editable:hover{color:var(--link)}.coll-edit-hint{font-size:14px;opacity:.5;margin-left:4px}.coll-rename-input{flex:1;font-size:16px;font-family:var(--display);border:1px solid var(--line);padding:4px 8px;background:var(--field);color:var(--ink);border-radius:var(--r)}.coll-delete-btn{border:1px solid var(--accent);background:none;color:var(--accent);padding:5px 12px;font-size:13px;cursor:pointer;border-radius:var(--r)}.coll-delete-btn:hover{background:var(--accent);color:var(--paper)}.coll-detail-vis{display:flex;align-items:center;gap:10px}.coll-vis-label{font-size:13px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;white-space:nowrap}.coll-vis-select{border:1px solid var(--line);background:var(--paper-3);color:var(--ink);padding:4px 8px;font-size:13px;border-radius:var(--r)}.coll-section-heading{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin-bottom:8px}.coll-entries-section{flex:1}.coll-entries-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}.coll-entry-row{display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid var(--line-soft)}.coll-entry-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.coll-entry-title{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.coll-entry-kind{font-size:11px;text-transform:uppercase;letter-spacing:.04em}.coll-entry-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}.coll-entry-vis-select{border:1px solid var(--line);background:var(--paper-3);color:var(--ink);padding:3px 6px;font-size:12px;border-radius:var(--r)}.coll-entry-remove{border:none;background:none;cursor:pointer;color:var(--muted);font-size:18px;line-height:1;padding:0 4px}.coll-entry-remove:hover{color:var(--accent)}.coll-add-entry-form{border-top:1px solid var(--line-soft);padding-top:12px}.coll-add-entry-row{display:flex;gap:8px;align-items:center}.coll-add-entry-input{flex:1;border:1px solid var(--line);background:var(--paper-3);color:var(--ink);padding:6px 10px;font-size:13px;min-width:0;border-radius:var(--r)}.coll-add-btn{border:none;background:var(--ink);color:var(--paper);padding:6px 14px;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap;border-radius:var(--r)}.coll-add-btn:hover{opacity:.85}.coll-add-btn:disabled{opacity:.45;cursor:default}.auth-loading{min-height:100vh;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:15px;background:var(--paper)}.user-menu{display:flex;align-items:center;gap:14px;padding-left:6px;flex-shrink:0}.user-name{font-size:12.5px;color:var(--muted-2);letter-spacing:.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:140px}.logout-btn{border:1px solid rgba(255,255,255,.18);background:transparent;color:#c8bfb0;font-size:12px;padding:4px 11px;border-radius:var(--r);cursor:pointer;white-space:nowrap;transition:background .15s,color .15s}.logout-btn:hover{background:#ffffff1a;color:var(--paper)}.logout-btn:disabled{opacity:.5;cursor:default}.login-page,.setup-page{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--paper)}.login-card,.setup-card{width:100%;max-width:360px;padding:40px 36px 44px;background:var(--paper-3);border:1px solid var(--line);border-radius:var(--r3);box-shadow:0 2px 20px #141d1812}.login-brand,.setup-brand{font-family:var(--display);font-size:32px;font-weight:600;color:var(--ink);letter-spacing:-.01em;margin:0 0 6px}.login-tagline,.setup-tagline{font-size:13px;color:var(--muted);margin:0 0 28px}.login-field,.setup-field{display:flex;flex-direction:column;gap:5px;margin-bottom:14px}.login-label,.setup-label{font-size:11.5px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}.login-input,.setup-input{width:100%;border:1px solid var(--line);background:var(--field);color:var(--ink);padding:9px 11px;font-size:14px;border-radius:var(--r2);outline:none;transition:border-color .15s}.login-input:focus,.setup-input:focus{border-color:var(--accent)}.login-error,.setup-error{font-size:13px;color:var(--accent);margin:4px 0 8px}.login-submit,.setup-submit{width:100%;margin-top:8px;border:none;background:var(--top);color:var(--paper);font-size:14px;font-weight:600;padding:11px 16px;border-radius:var(--r2);cursor:pointer;letter-spacing:.02em;transition:opacity .15s}.login-submit:hover,.setup-submit:hover{opacity:.85}.login-submit:disabled,.setup-submit:disabled{opacity:.45;cursor:default}.view-tabs{display:flex;gap:2px;margin-bottom:22px;border-bottom:1px solid var(--line-soft);padding-bottom:0}.view-tab{border:none;background:none;color:var(--muted);font-size:13px;font-weight:600;padding:7px 14px;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;letter-spacing:.02em;transition:color .12s;text-transform:uppercase;letter-spacing:.06em;font-size:11.5px}.view-tab:hover{color:var(--ink)}.view-tab.is-active{color:var(--ink);border-bottom-color:var(--accent)}.form-section{margin-bottom:32px}.form-section h2{font-size:14px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin:0 0 14px}.form-row{display:flex;gap:8px;margin-bottom:10px}.form-field{display:flex;flex-direction:column;gap:5px;margin-bottom:12px}.form-label{font-size:11.5px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}.field-input{border:1px solid var(--line);background:var(--field);color:var(--ink);padding:8px 10px;font-size:13.5px;border-radius:var(--r);outline:none;transition:border-color .15s;min-width:0}.field-input:focus{border-color:var(--accent)}.field-input--flex{flex:1}.form-msg{font-size:13px;margin:6px 0}.form-msg--ok{color:var(--link)}.form-msg--err{color:var(--accent)}.btn-primary{border:none;background:var(--top);color:var(--paper);font-size:13px;font-weight:600;padding:8px 16px;border-radius:var(--r);cursor:pointer;white-space:nowrap}.btn-primary:hover{opacity:.85}.btn-primary:disabled{opacity:.45;cursor:default}.btn-ghost{border:1px solid var(--line);background:none;color:var(--ink);font-size:13px;padding:7px 14px;border-radius:var(--r);cursor:pointer}.btn-ghost:hover{background:var(--paper-2)}.btn-danger{border:1px solid var(--accent);background:none;color:var(--accent);font-size:13px;padding:7px 14px;border-radius:var(--r);cursor:pointer}.btn-danger:hover{background:var(--accent);color:var(--paper)}.admin-view h1{font-family:var(--display);font-weight:600;font-size:26px;margin:0 0 20px}.admin-table{width:100%;border-collapse:collapse;font-size:13px;margin-bottom:28px}.admin-table th{text-align:left;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);padding:8px 10px;border-bottom:1px solid var(--line);background:var(--paper-2)}.admin-table th:first-child{padding-left:16px}.admin-table td{padding:9px 10px;border-bottom:1px solid var(--line-soft);color:var(--ink);vertical-align:middle}.admin-table td:first-child{padding-left:16px}.admin-table tr:hover td{background:var(--paper-2)}.admin-row-disabled td{opacity:.45}.admin-section{margin-bottom:36px;max-width:860px}.admin-section h2{font-size:14px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin:0 0 14px}.admin-section h3{font-size:13px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin:22px 0 10px}.admin-form{display:flex;flex-direction:column;gap:8px;max-width:480px}.admin-input{border:1px solid var(--line);background:var(--field);color:var(--ink);padding:8px 10px;font-size:13.5px;border-radius:var(--r);outline:none;transition:border-color .15s}.admin-input:focus{border-color:var(--accent)}.admin-action-btn{border:1px solid var(--line);background:none;color:var(--ink);font-size:12px;padding:4px 10px;border-radius:var(--r);cursor:pointer;white-space:nowrap}.admin-action-btn:hover{border-color:var(--accent);color:var(--accent)}.status-badge{display:inline-block;padding:2px 8px;border-radius:var(--r);font-size:11.5px;font-weight:600;text-transform:uppercase;letter-spacing:.04em}.status-active{background:#d8eddf;color:#235c35;border:1px solid #b4d9be}.status-disabled{background:#ede8e0;color:var(--muted);border:1px solid var(--line)}.run-status{display:inline-block;padding:2px 8px;border-radius:var(--r);font-size:11.5px;font-weight:600;text-transform:uppercase;letter-spacing:.04em}.run-status--completed{background:#d8eddf;color:#235c35;border:1px solid #b4d9be}.run-status--failed{background:#f5ddd8;color:#8d3f30;border:1px solid #e0b8b0}.run-status--running{background:#dde8f5;color:#245f72;border:1px solid #b8cde0}.token-banner{background:#d8eddf;border:1px solid #b4d9be;padding:12px 14px;margin-bottom:16px;font-size:13px;border-radius:var(--r2)}.token-banner code{word-break:break-all;display:block;margin-top:6px;padding:6px 8px;background:var(--field);border:1px solid var(--line);border-radius:var(--r);font-size:12px;font-family:ui-monospace,SF Mono,Menlo,monospace}.token-dismiss{margin-top:8px;font-size:12px;border:1px solid var(--line);background:none;cursor:pointer;padding:3px 8px;border-radius:var(--r);color:var(--muted)}.token-dismiss:hover{background:var(--paper-2)}.token-row{display:flex;align-items:center;justify-content:space-between;border:1px solid var(--line);background:var(--paper-3);padding:10px 12px;border-radius:var(--r);margin-bottom:6px}.token-row-info strong{font-size:14px;display:block}.token-row-info .muted{font-size:12px;margin-top:2px}.token-create-row{display:flex;gap:8px;margin-bottom:16px}.checkbox-row{display:flex;align-items:center;gap:10px;margin-bottom:12px;cursor:pointer;font-size:14px}.checkbox-row input[type=checkbox]{width:15px;height:15px;accent-color:var(--accent)}.coll-create-details{margin-top:16px}.coll-create-details summary{font-weight:600;cursor:pointer;font-size:13px;color:var(--link);list-style:none;display:flex;align-items:center;gap:6px;padding:8px 12px;border:1px solid var(--line-soft);border-radius:var(--r2);background:var(--paper-3);width:fit-content}.coll-create-details summary:hover{background:var(--paper-2)}.coll-create-details[open] summary{border-bottom-left-radius:0;border-bottom-right-radius:0}.coll-create-form{border:1px solid var(--line-soft);border-top:none;padding:14px;border-radius:0 0 var(--r2) var(--r2);background:var(--paper-3);display:flex;flex-direction:column;gap:10px;max-width:440px}@media (max-width: 900px){.topbar{grid-template-columns:1fr auto;height:auto;min-height:58px;padding:12px}.switcher,.nav{grid-column:1 / -1}.nav{justify-content:flex-start;overflow-x:auto}.app-shell{height:auto;grid-template-columns:1fr}.context-rail{border-left:0;border-top:1px solid var(--line)}.entry-table{min-width:860px}}.rail-title--editable{cursor:pointer}.rail-title--editable:hover{opacity:.75}.rail-title--editable .edit-icon{display:inline-block;width:.75em;height:.75em;margin-left:.35em;vertical-align:middle;opacity:0;transition:opacity .1s;flex-shrink:0}.rail-title--editable:hover .edit-icon{opacity:.5}.rail-title-input{width:100%;font:inherit;font-size:inherit;font-weight:600;background:transparent;border:none;border-bottom:1px solid currentColor;color:inherit;padding:0;margin:0 0 8px;outline:none} diff --git a/crates/archivr-server/static/assets/index-BWKljqgT.js b/crates/archivr-server/static/assets/index-BWKljqgT.js new file mode 100644 index 0000000..067e683 --- /dev/null +++ b/crates/archivr-server/static/assets/index-BWKljqgT.js @@ -0,0 +1,40 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();var da={exports:{}},ml={},fa={exports:{}},F={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var dr=Symbol.for("react.element"),Tc=Symbol.for("react.portal"),Pc=Symbol.for("react.fragment"),Lc=Symbol.for("react.strict_mode"),zc=Symbol.for("react.profiler"),Rc=Symbol.for("react.provider"),Dc=Symbol.for("react.context"),Oc=Symbol.for("react.forward_ref"),$c=Symbol.for("react.suspense"),Mc=Symbol.for("react.memo"),Fc=Symbol.for("react.lazy"),Gs=Symbol.iterator;function Ic(e){return e===null||typeof e!="object"?null:(e=Gs&&e[Gs]||e["@@iterator"],typeof e=="function"?e:null)}var pa={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ha=Object.assign,ma={};function Nn(e,t,n){this.props=e,this.context=t,this.refs=ma,this.updater=n||pa}Nn.prototype.isReactComponent={};Nn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Nn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function va(){}va.prototype=Nn.prototype;function ns(e,t,n){this.props=e,this.context=t,this.refs=ma,this.updater=n||pa}var rs=ns.prototype=new va;rs.constructor=ns;ha(rs,Nn.prototype);rs.isPureReactComponent=!0;var Zs=Array.isArray,ga=Object.prototype.hasOwnProperty,ls={current:null},ya={key:!0,ref:!0,__self:!0,__source:!0};function wa(e,t,n){var r,l={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)ga.call(t,r)&&!ya.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,O=T[B];if(0>>1;Bl(Ze,D))Vel(rt,Ze)?(T[B]=rt,T[Ve]=D,B=Ve):(T[B]=Ze,T[ce]=D,B=ce);else if(Vel(rt,D))T[B]=rt,T[Ve]=D,B=Ve;else break e}}return N}function l(T,N){var D=T.sortIndex-N.sortIndex;return D!==0?D:T.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var u=[],d=[],v=1,m=null,h=3,k=!1,x=!1,S=!1,R=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(T){for(var N=n(d);N!==null;){if(N.callback===null)r(d);else if(N.startTime<=T)r(d),N.sortIndex=N.expirationTime,t(u,N);else break;N=n(d)}}function w(T){if(S=!1,p(T),!x)if(n(u)!==null)x=!0,$e(y);else{var N=n(d);N!==null&&me(w,N.startTime-T)}}function y(T,N){x=!1,S&&(S=!1,f(L),L=-1),k=!0;var D=h;try{for(p(N),m=n(u);m!==null&&(!(m.expirationTime>N)||T&&!z());){var B=m.callback;if(typeof B=="function"){m.callback=null,h=m.priorityLevel;var O=B(m.expirationTime<=N);N=e.unstable_now(),typeof O=="function"?m.callback=O:m===n(u)&&r(u),p(N)}else r(u);m=n(u)}if(m!==null)var ue=!0;else{var ce=n(d);ce!==null&&me(w,ce.startTime-N),ue=!1}return ue}finally{m=null,h=D,k=!1}}var C=!1,_=null,L=-1,I=5,M=-1;function z(){return!(e.unstable_now()-MT||125B?(T.sortIndex=D,t(d,T),n(u)===null&&T===n(d)&&(S?(f(L),L=-1):S=!0,me(w,D-B))):(T.sortIndex=O,t(u,T),x||k||(x=!0,$e(y))),T},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(T){var N=h;return function(){var D=h;h=N;try{return T.apply(this,arguments)}finally{h=D}}}})(ja);Na.exports=ja;var Xc=Na.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Gc=g,ze=Xc;function j(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ui=Object.prototype.hasOwnProperty,Zc=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,bs={},eo={};function qc(e){return ui.call(eo,e)?!0:ui.call(bs,e)?!1:Zc.test(e)?eo[e]=!0:(bs[e]=!0,!1)}function bc(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ed(e,t,n,r){if(t===null||typeof t>"u"||bc(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function we(e,t,n,r,l,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ae[e]=new we(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ae[t]=new we(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ae[e]=new we(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ae[e]=new we(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ae[e]=new we(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ae[e]=new we(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ae[e]=new we(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ae[e]=new we(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ae[e]=new we(e,5,!1,e.toLowerCase(),null,!1,!1)});var ss=/[\-:]([a-z])/g;function os(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ss,os);ae[t]=new we(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ss,os);ae[t]=new we(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ss,os);ae[t]=new we(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ae[e]=new we(e,1,!1,e.toLowerCase(),null,!1,!1)});ae.xlinkHref=new we("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ae[e]=new we(e,1,!1,e.toLowerCase(),null,!0,!0)});function as(e,t,n,r){var l=ae.hasOwnProperty(t)?ae[t]:null;(l!==null?l.type!==0:r||!(2a||l[s]!==i[a]){var u=` +`+l[s].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=s&&0<=a);break}}}finally{Ml=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?On(e):""}function td(e){switch(e.tag){case 5:return On(e.type);case 16:return On("Lazy");case 13:return On("Suspense");case 19:return On("SuspenseList");case 0:case 2:case 15:return e=Fl(e.type,!1),e;case 11:return e=Fl(e.type.render,!1),e;case 1:return e=Fl(e.type,!0),e;default:return""}}function pi(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case qt:return"Fragment";case Zt:return"Portal";case ci:return"Profiler";case us:return"StrictMode";case di:return"Suspense";case fi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _a:return(e.displayName||"Context")+".Consumer";case Ea:return(e._context.displayName||"Context")+".Provider";case cs:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ds:return t=e.displayName||null,t!==null?t:pi(e.type)||"Memo";case mt:t=e._payload,e=e._init;try{return pi(e(t))}catch{}}return null}function nd(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pi(t);case 8:return t===us?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Pt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rd(e){var t=Pa(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yr(e){e._valueTracker||(e._valueTracker=rd(e))}function La(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Pa(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Qr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function hi(e,t){var n=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function no(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Pt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function za(e,t){t=t.checked,t!=null&&as(e,"checked",t,!1)}function mi(e,t){za(e,t);var n=Pt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?vi(e,t.type,n):t.hasOwnProperty("defaultValue")&&vi(e,t.type,Pt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ro(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function vi(e,t,n){(t!=="number"||Qr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var $n=Array.isArray;function cn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=wr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Un={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ld=["Webkit","ms","Moz","O"];Object.keys(Un).forEach(function(e){ld.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Un[t]=Un[e]})});function $a(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Un.hasOwnProperty(e)&&Un[e]?(""+t).trim():t+"px"}function Ma(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=$a(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var id=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function wi(e,t){if(t){if(id[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(j(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(j(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(j(61))}if(t.style!=null&&typeof t.style!="object")throw Error(j(62))}}function xi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Si=null;function fs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ki=null,dn=null,fn=null;function so(e){if(e=hr(e)){if(typeof ki!="function")throw Error(j(280));var t=e.stateNode;t&&(t=xl(t),ki(e.stateNode,e.type,t))}}function Fa(e){dn?fn?fn.push(e):fn=[e]:dn=e}function Ia(){if(dn){var e=dn,t=fn;if(fn=dn=null,so(e),t)for(e=0;e>>=0,e===0?32:31-(vd(e)/gd|0)|0}var xr=64,Sr=4194304;function Mn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Xr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~l;a!==0?r=Mn(a):(i&=s,i!==0&&(r=Mn(i)))}else s=n&~l,s!==0?r=Mn(s):i!==0&&(r=Mn(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function fr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ye(t),e[t]=n}function Sd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Bn),vo=" ",go=!1;function lu(e,t){switch(e){case"keyup":return Xd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bt=!1;function Zd(e,t){switch(e){case"compositionend":return iu(t);case"keypress":return t.which!==32?null:(go=!0,vo);case"textInput":return e=t.data,e===vo&&go?null:e;default:return null}}function qd(e,t){if(bt)return e==="compositionend"||!xs&&lu(e,t)?(e=nu(),Mr=gs=wt=null,bt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=So(n)}}function uu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?uu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cu(){for(var e=window,t=Qr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qr(e.document)}return t}function Ss(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function af(e){var t=cu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&uu(n.ownerDocument.documentElement,n)){if(r!==null&&Ss(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=ko(n,i);var s=ko(n,r);l&&s&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,en=null,Ti=null,Hn=null,Pi=!1;function No(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pi||en==null||en!==Qr(r)||(r=en,"selectionStart"in r&&Ss(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Hn&&tr(Hn,r)||(Hn=r,r=qr(Ti,"onSelect"),0rn||(e.current=$i[rn],$i[rn]=null,rn--)}function W(e,t){rn++,$i[rn]=e.current,e.current=t}var Lt={},he=Rt(Lt),je=Rt(!1),Ht=Lt;function gn(e,t){var n=e.type.contextTypes;if(!n)return Lt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ce(e){return e=e.childContextTypes,e!=null}function el(){K(je),K(he)}function Lo(e,t,n){if(he.current!==Lt)throw Error(j(168));W(he,t),W(je,n)}function wu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(j(108,nd(e)||"Unknown",l));return G({},n,r)}function tl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Lt,Ht=he.current,W(he,e),W(je,je.current),!0}function zo(e,t,n){var r=e.stateNode;if(!r)throw Error(j(169));n?(e=wu(e,t,Ht),r.__reactInternalMemoizedMergedChildContext=e,K(je),K(he),W(he,e)):K(je),W(je,n)}var it=null,Sl=!1,Zl=!1;function xu(e){it===null?it=[e]:it.push(e)}function xf(e){Sl=!0,xu(e)}function Dt(){if(!Zl&&it!==null){Zl=!0;var e=0,t=H;try{var n=it;for(H=1;e>=s,l-=s,st=1<<32-Ye(t)+l|n<L?(I=_,_=null):I=_.sibling;var M=h(f,_,p[L],w);if(M===null){_===null&&(_=I);break}e&&_&&M.alternate===null&&t(f,_),c=i(M,c,L),C===null?y=M:C.sibling=M,C=M,_=I}if(L===p.length)return n(f,_),J&&$t(f,L),y;if(_===null){for(;LL?(I=_,_=null):I=_.sibling;var z=h(f,_,M.value,w);if(z===null){_===null&&(_=I);break}e&&_&&z.alternate===null&&t(f,_),c=i(z,c,L),C===null?y=z:C.sibling=z,C=z,_=I}if(M.done)return n(f,_),J&&$t(f,L),y;if(_===null){for(;!M.done;L++,M=p.next())M=m(f,M.value,w),M!==null&&(c=i(M,c,L),C===null?y=M:C.sibling=M,C=M);return J&&$t(f,L),y}for(_=r(f,_);!M.done;L++,M=p.next())M=k(_,f,L,M.value,w),M!==null&&(e&&M.alternate!==null&&_.delete(M.key===null?L:M.key),c=i(M,c,L),C===null?y=M:C.sibling=M,C=M);return e&&_.forEach(function(A){return t(f,A)}),J&&$t(f,L),y}function R(f,c,p,w){if(typeof p=="object"&&p!==null&&p.type===qt&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case gr:e:{for(var y=p.key,C=c;C!==null;){if(C.key===y){if(y=p.type,y===qt){if(C.tag===7){n(f,C.sibling),c=l(C,p.props.children),c.return=f,f=c;break e}}else if(C.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===mt&&Oo(y)===C.type){n(f,C.sibling),c=l(C,p.props),c.ref=zn(f,C,p),c.return=f,f=c;break e}n(f,C);break}else t(f,C);C=C.sibling}p.type===qt?(c=Vt(p.props.children,f.mode,w,p.key),c.return=f,f=c):(w=Wr(p.type,p.key,p.props,null,f.mode,w),w.ref=zn(f,c,p),w.return=f,f=w)}return s(f);case Zt:e:{for(C=p.key;c!==null;){if(c.key===C)if(c.tag===4&&c.stateNode.containerInfo===p.containerInfo&&c.stateNode.implementation===p.implementation){n(f,c.sibling),c=l(c,p.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=ii(p,f.mode,w),c.return=f,f=c}return s(f);case mt:return C=p._init,R(f,c,C(p._payload),w)}if($n(p))return x(f,c,p,w);if(En(p))return S(f,c,p,w);Tr(f,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,p),c.return=f,f=c):(n(f,c),c=li(p,f.mode,w),c.return=f,f=c),s(f)):n(f,c)}return R}var wn=ju(!0),Cu=ju(!1),ll=Rt(null),il=null,on=null,Cs=null;function Es(){Cs=on=il=null}function _s(e){var t=ll.current;K(ll),e._currentValue=t}function Ii(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function hn(e,t){il=e,Cs=on=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ne=!0),e.firstContext=null)}function Ae(e){var t=e._currentValue;if(Cs!==e)if(e={context:e,memoizedValue:t,next:null},on===null){if(il===null)throw Error(j(308));on=e,il.dependencies={lanes:0,firstContext:e}}else on=on.next=e;return t}var It=null;function Ts(e){It===null?It=[e]:It.push(e)}function Eu(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Ts(t)):(n.next=l.next,l.next=n),t.interleaved=n,dt(e,r)}function dt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var vt=!1;function Ps(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _u(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function at(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ct(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,U&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,dt(e,n)}return l=r.interleaved,l===null?(t.next=t,Ts(r)):(t.next=l.next,l.next=t),r.interleaved=t,dt(e,n)}function Ir(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hs(e,n)}}function $o(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function sl(e,t,n,r){var l=e.updateQueue;vt=!1;var i=l.firstBaseUpdate,s=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var u=a,d=u.next;u.next=null,s===null?i=d:s.next=d,s=u;var v=e.alternate;v!==null&&(v=v.updateQueue,a=v.lastBaseUpdate,a!==s&&(a===null?v.firstBaseUpdate=d:a.next=d,v.lastBaseUpdate=u))}if(i!==null){var m=l.baseState;s=0,v=d=u=null,a=i;do{var h=a.lane,k=a.eventTime;if((r&h)===h){v!==null&&(v=v.next={eventTime:k,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,S=a;switch(h=t,k=n,S.tag){case 1:if(x=S.payload,typeof x=="function"){m=x.call(k,m,h);break e}m=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=S.payload,h=typeof x=="function"?x.call(k,m,h):x,h==null)break e;m=G({},m,h);break e;case 2:vt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=l.effects,h===null?l.effects=[a]:h.push(a))}else k={eventTime:k,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},v===null?(d=v=k,u=m):v=v.next=k,s|=h;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;h=a,a=h.next,h.next=null,l.lastBaseUpdate=h,l.shared.pending=null}}while(!0);if(v===null&&(u=m),l.baseState=u,l.firstBaseUpdate=d,l.lastBaseUpdate=v,t=l.shared.interleaved,t!==null){l=t;do s|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Kt|=s,e.lanes=s,e.memoizedState=m}}function Mo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=bl.transition;bl.transition={};try{e(!1),t()}finally{H=n,bl.transition=r}}function Wu(){return Be().memoizedState}function jf(e,t,n){var r=_t(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qu(e))Ku(t,n);else if(n=Eu(e,t,n,r),n!==null){var l=ge();Xe(n,e,r,l),Ju(n,t,r)}}function Cf(e,t,n){var r=_t(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qu(e))Ku(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(l.hasEagerState=!0,l.eagerState=a,Ge(a,s)){var u=t.interleaved;u===null?(l.next=l,Ts(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Eu(e,t,l,r),n!==null&&(l=ge(),Xe(n,e,r,l),Ju(n,t,r))}}function Qu(e){var t=e.alternate;return e===X||t!==null&&t===X}function Ku(e,t){Wn=al=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ju(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hs(e,n)}}var ul={readContext:Ae,useCallback:de,useContext:de,useEffect:de,useImperativeHandle:de,useInsertionEffect:de,useLayoutEffect:de,useMemo:de,useReducer:de,useRef:de,useState:de,useDebugValue:de,useDeferredValue:de,useTransition:de,useMutableSource:de,useSyncExternalStore:de,useId:de,unstable_isNewReconciler:!1},Ef={readContext:Ae,useCallback:function(e,t){return be().memoizedState=[e,t===void 0?null:t],e},useContext:Ae,useEffect:Io,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ar(4194308,4,Uu.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ar(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ar(4,2,e,t)},useMemo:function(e,t){var n=be();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=be();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=jf.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=be();return e={current:e},t.memoizedState=e},useState:Fo,useDebugValue:Fs,useDeferredValue:function(e){return be().memoizedState=e},useTransition:function(){var e=Fo(!1),t=e[0];return e=Nf.bind(null,e[1]),be().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=X,l=be();if(J){if(n===void 0)throw Error(j(407));n=n()}else{if(n=t(),re===null)throw Error(j(349));Qt&30||zu(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Io(Du.bind(null,r,i,e),[e]),r.flags|=2048,ur(9,Ru.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=be(),t=re.identifierPrefix;if(J){var n=ot,r=st;n=(r&~(1<<32-Ye(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=or++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[et]=t,e[lr]=r,rc(e,t,!1,!1),t.stateNode=e;e:{switch(s=xi(n,r),n){case"dialog":Q("cancel",e),Q("close",e),l=r;break;case"iframe":case"object":case"embed":Q("load",e),l=r;break;case"video":case"audio":for(l=0;lkn&&(t.flags|=128,r=!0,Rn(i,!1),t.lanes=4194304)}else{if(!r)if(e=ol(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Rn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!J)return fe(t),null}else 2*q()-i.renderingStartTime>kn&&n!==1073741824&&(t.flags|=128,r=!0,Rn(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=q(),t.sibling=null,n=Y.current,W(Y,r?n&1|2:n&1),t):(fe(t),null);case 22:case 23:return Hs(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Te&1073741824&&(fe(t),t.subtreeFlags&6&&(t.flags|=8192)):fe(t),null;case 24:return null;case 25:return null}throw Error(j(156,t.tag))}function Of(e,t){switch(Ns(t),t.tag){case 1:return Ce(t.type)&&el(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xn(),K(je),K(he),Rs(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return zs(t),null;case 13:if(K(Y),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(j(340));yn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(Y),null;case 4:return xn(),null;case 10:return _s(t.type._context),null;case 22:case 23:return Hs(),null;case 24:return null;default:return null}}var Lr=!1,pe=!1,$f=typeof WeakSet=="function"?WeakSet:Set,P=null;function an(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Z(e,t,r)}else n.current=null}function Ji(e,t,n){try{n()}catch(r){Z(e,t,r)}}var Xo=!1;function Mf(e,t){if(Li=Gr,e=cu(),Ss(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,u=-1,d=0,v=0,m=e,h=null;t:for(;;){for(var k;m!==n||l!==0&&m.nodeType!==3||(a=s+l),m!==i||r!==0&&m.nodeType!==3||(u=s+r),m.nodeType===3&&(s+=m.nodeValue.length),(k=m.firstChild)!==null;)h=m,m=k;for(;;){if(m===e)break t;if(h===n&&++d===l&&(a=s),h===i&&++v===r&&(u=s),(k=m.nextSibling)!==null)break;m=h,h=m.parentNode}m=k}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(zi={focusedElem:e,selectionRange:n},Gr=!1,P=t;P!==null;)if(t=P,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,P=e;else for(;P!==null;){t=P;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var S=x.memoizedProps,R=x.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?S:Qe(t.type,S),R);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(j(163))}}catch(w){Z(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,P=e;break}P=t.return}return x=Xo,Xo=!1,x}function Qn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&Ji(t,n,i)}l=l.next}while(l!==r)}}function jl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Yi(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function sc(e){var t=e.alternate;t!==null&&(e.alternate=null,sc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[et],delete t[lr],delete t[Oi],delete t[yf],delete t[wf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function oc(e){return e.tag===5||e.tag===3||e.tag===4}function Go(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||oc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=br));else if(r!==4&&(e=e.child,e!==null))for(Xi(e,t,n),e=e.sibling;e!==null;)Xi(e,t,n),e=e.sibling}function Gi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Gi(e,t,n),e=e.sibling;e!==null;)Gi(e,t,n),e=e.sibling}var se=null,Ke=!1;function ht(e,t,n){for(n=n.child;n!==null;)ac(e,t,n),n=n.sibling}function ac(e,t,n){if(tt&&typeof tt.onCommitFiberUnmount=="function")try{tt.onCommitFiberUnmount(vl,n)}catch{}switch(n.tag){case 5:pe||an(n,t);case 6:var r=se,l=Ke;se=null,ht(e,t,n),se=r,Ke=l,se!==null&&(Ke?(e=se,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):se.removeChild(n.stateNode));break;case 18:se!==null&&(Ke?(e=se,n=n.stateNode,e.nodeType===8?Gl(e.parentNode,n):e.nodeType===1&&Gl(e,n),bn(e)):Gl(se,n.stateNode));break;case 4:r=se,l=Ke,se=n.stateNode.containerInfo,Ke=!0,ht(e,t,n),se=r,Ke=l;break;case 0:case 11:case 14:case 15:if(!pe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Ji(n,t,s),l=l.next}while(l!==r)}ht(e,t,n);break;case 1:if(!pe&&(an(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Z(n,t,a)}ht(e,t,n);break;case 21:ht(e,t,n);break;case 22:n.mode&1?(pe=(r=pe)||n.memoizedState!==null,ht(e,t,n),pe=r):ht(e,t,n);break;default:ht(e,t,n)}}function Zo(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new $f),t.forEach(function(r){var l=Qf.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function We(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=s),r&=~i}if(r=l,r=q()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*If(r/1960))-r,10e?16:e,xt===null)var r=!1;else{if(e=xt,xt=null,fl=0,U&6)throw Error(j(331));var l=U;for(U|=4,P=e.current;P!==null;){var i=P,s=i.child;if(P.flags&16){var a=i.deletions;if(a!==null){for(var u=0;uq()-Bs?Bt(e,0):As|=n),Ee(e,t)}function vc(e,t){t===0&&(e.mode&1?(t=Sr,Sr<<=1,!(Sr&130023424)&&(Sr=4194304)):t=1);var n=ge();e=dt(e,t),e!==null&&(fr(e,t,n),Ee(e,n))}function Wf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vc(e,n)}function Qf(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(j(314))}r!==null&&r.delete(t),vc(e,n)}var gc;gc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||je.current)Ne=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ne=!1,Rf(e,t,n);Ne=!!(e.flags&131072)}else Ne=!1,J&&t.flags&1048576&&Su(t,rl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Br(e,t),e=t.pendingProps;var l=gn(t,he.current);hn(t,n),l=Os(null,t,r,e,l,n);var i=$s();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ce(r)?(i=!0,tl(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Ps(t),l.updater=Nl,t.stateNode=l,l._reactInternals=t,Ai(t,r,e,n),t=Hi(null,t,r,!0,i,n)):(t.tag=0,J&&i&&ks(t),ve(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Br(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Jf(r),e=Qe(r,e),l){case 0:t=Vi(null,t,r,e,n);break e;case 1:t=Ko(null,t,r,e,n);break e;case 11:t=Wo(null,t,r,e,n);break e;case 14:t=Qo(null,t,r,Qe(r.type,e),n);break e}throw Error(j(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Qe(r,l),Vi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Qe(r,l),Ko(e,t,r,l,n);case 3:e:{if(ec(t),e===null)throw Error(j(387));r=t.pendingProps,i=t.memoizedState,l=i.element,_u(e,t),sl(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=Sn(Error(j(423)),t),t=Jo(e,t,r,n,l);break e}else if(r!==l){l=Sn(Error(j(424)),t),t=Jo(e,t,r,n,l);break e}else for(Pe=jt(t.stateNode.containerInfo.firstChild),Le=t,J=!0,Je=null,n=Cu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yn(),r===l){t=ft(e,t,n);break e}ve(e,t,r,n)}t=t.child}return t;case 5:return Tu(t),e===null&&Fi(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,s=l.children,Ri(r,l)?s=null:i!==null&&Ri(r,i)&&(t.flags|=32),bu(e,t),ve(e,t,s,n),t.child;case 6:return e===null&&Fi(t),null;case 13:return tc(e,t,n);case 4:return Ls(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=wn(t,null,r,n):ve(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Qe(r,l),Wo(e,t,r,l,n);case 7:return ve(e,t,t.pendingProps,n),t.child;case 8:return ve(e,t,t.pendingProps.children,n),t.child;case 12:return ve(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,s=l.value,W(ll,r._currentValue),r._currentValue=s,i!==null)if(Ge(i.value,s)){if(i.children===l.children&&!je.current){t=ft(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=at(-1,n&-n),u.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var v=d.pending;v===null?u.next=u:(u.next=v.next,v.next=u),d.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Ii(i.return,n,t),a.lanes|=n;break}u=u.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(j(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ii(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}ve(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,hn(t,n),l=Ae(l),r=r(l),t.flags|=1,ve(e,t,r,n),t.child;case 14:return r=t.type,l=Qe(r,t.pendingProps),l=Qe(r.type,l),Qo(e,t,r,l,n);case 15:return Zu(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Qe(r,l),Br(e,t),t.tag=1,Ce(r)?(e=!0,tl(t)):e=!1,hn(t,n),Yu(t,r,l),Ai(t,r,l,n),Hi(null,t,r,!0,e,n);case 19:return nc(e,t,n);case 22:return qu(e,t,n)}throw Error(j(156,t.tag))};function yc(e,t){return Qa(e,t)}function Kf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ie(e,t,n,r){return new Kf(e,t,n,r)}function Qs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jf(e){if(typeof e=="function")return Qs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===cs)return 11;if(e===ds)return 14}return 2}function Tt(e,t){var n=e.alternate;return n===null?(n=Ie(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Wr(e,t,n,r,l,i){var s=2;if(r=e,typeof e=="function")Qs(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case qt:return Vt(n.children,l,i,t);case us:s=8,l|=8;break;case ci:return e=Ie(12,n,t,l|2),e.elementType=ci,e.lanes=i,e;case di:return e=Ie(13,n,t,l),e.elementType=di,e.lanes=i,e;case fi:return e=Ie(19,n,t,l),e.elementType=fi,e.lanes=i,e;case Ta:return El(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ea:s=10;break e;case _a:s=9;break e;case cs:s=11;break e;case ds:s=14;break e;case mt:s=16,r=null;break e}throw Error(j(130,e==null?e:typeof e,""))}return t=Ie(s,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function Vt(e,t,n,r){return e=Ie(7,e,r,t),e.lanes=n,e}function El(e,t,n,r){return e=Ie(22,e,r,t),e.elementType=Ta,e.lanes=n,e.stateNode={isHidden:!1},e}function li(e,t,n){return e=Ie(6,e,null,t),e.lanes=n,e}function ii(e,t,n){return t=Ie(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Yf(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ul(0),this.expirationTimes=Ul(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ul(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ks(e,t,n,r,l,i,s,a,u){return e=new Yf(e,t,n,a,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ie(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ps(i),e}function Xf(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kc)}catch(e){console.error(e)}}kc(),ka.exports=Re;var ep=ka.exports,Nc,ia=ep;Nc=ia.createRoot,ia.hydrateRoot;async function xe(e){const t=await fetch(e);if(!t.ok)throw new Error(`${t.status} ${t.statusText}`);return t.json()}async function tp(){return xe("/api/archives")}async function np(e){return xe(`/api/archives/${e}/entries`)}async function rp(e,t,n){const r=new URLSearchParams;return t&&r.set("q",t),n&&r.set("tag",n),xe(`/api/archives/${e}/entries/search?${r}`)}async function lp(e,t){return xe(`/api/archives/${e}/entries/${t}`)}async function ip(e,t,n){const r=await fetch(`/api/archives/${e}/entries/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:n??null})});if(!r.ok)throw new Error(await r.text())}async function si(e,t){return xe(`/api/archives/${e}/entries/${t}/tags`)}async function sp(e,t,n){const r=await fetch(`/api/archives/${e}/entries/${t}/tags`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tag_path:n})});if(!r.ok)throw new Error(`Failed to add tag (${r.status})`)}async function op(e,t,n){const r=await fetch(`/api/archives/${e}/entries/${t}/tags/${n}`,{method:"DELETE"});if(!r.ok)throw new Error(`Remove failed (${r.status})`)}async function ap(e,t,n){const r=await fetch(`/api/archives/${e}/tags/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})});if(!r.ok)throw new Error(await r.text());return r.json()}async function up(e,t){const n=await fetch(`/api/archives/${e}/tags/${t}`,{method:"DELETE"});if(!n.ok)throw new Error(await n.text())}async function sa(e){return xe(`/api/archives/${e}/runs`)}async function oi(e){return xe(`/api/archives/${e}/tags`)}async function cp(e,t){const n=await fetch(`/api/archives/${e}/captures`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locator:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||`HTTP ${n.status}`)}return n.json()}async function oa(e,t){return xe(`/api/archives/${e}/capture_jobs/${t}`)}async function dp(){return(await(await fetch("/api/auth/setup")).json()).setup_required===!0}async function fp(e,t){const n=await fetch("/api/auth/setup",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:e,password:t})});if(!n.ok)throw new Error((await n.json()).error||"Setup failed");return n.json()}async function pp(e,t){const n=await fetch("/api/auth/login",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:e,password:t})});if(!n.ok)throw new Error((await n.json()).error||"Login failed");return n.json()}async function hp(){await fetch("/api/auth/logout",{method:"POST"})}async function mp(){const e=await fetch("/api/auth/me");return e.status===401?null:e.json()}async function vp(e){const t=await fetch("/api/auth/me",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({display_name:e})});if(!t.ok)throw new Error(await t.text())}async function gp(e){const t=await fetch("/api/auth/me",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await t.text())}async function yp(e,t){const n=await fetch("/api/auth/me",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({current_password:e,new_password:t})});if(!n.ok){let r=await n.text();try{r=JSON.parse(r).error??r}catch{}throw new Error(r)}}async function wp(){return xe("/api/auth/tokens")}async function xp(e){const t=await fetch("/api/auth/tokens",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});if(!t.ok)throw new Error(await t.text());return t.json()}async function Sp(e){const t=await fetch(`/api/auth/tokens/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(await t.text())}async function kp(){return xe("/api/admin/instance-settings")}async function Np(e){const t=await fetch("/api/admin/instance-settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await t.text())}async function jp(){return xe("/api/admin/users")}async function Cp(e,t,n){const r=await fetch("/api/admin/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t,email:n||void 0})});if(!r.ok){const l=await r.json().catch(()=>({}));throw new Error(l.error||`HTTP ${r.status}`)}return r.json()}async function Ep(e,t){const n=await fetch(`/api/admin/users/${e}/status`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||`HTTP ${n.status}`)}return n.json()}async function _p(){return xe("/api/admin/roles")}async function Tp(e,t){const n=await fetch("/api/admin/roles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:e,name:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||`HTTP ${n.status}`)}return n.json()}async function Pp(e){return xe(`/api/archives/${e}/collections`)}async function Lp(e,t,n,r=2){const l=await fetch(`/api/archives/${e}/collections`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:t,slug:n,default_visibility_bits:r})});if(!l.ok){const i=await l.json().catch(()=>({error:l.statusText}));throw new Error(i.error||l.statusText)}return l.json()}async function zp(e,t){return xe(`/api/archives/${e}/collections/${t}`)}async function Rp(e,t,n,r=2){const l=await fetch(`/api/archives/${e}/collections/${t}/entries`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({entry_uid:n,visibility_bits:r})});if(!l.ok){const i=await l.json().catch(()=>({error:l.statusText}));throw new Error(i.error||l.statusText)}}async function Dp(e,t,n){const r=await fetch(`/api/archives/${e}/collections/${t}/entries/${n}`,{method:"DELETE"});if(!r.ok){const l=await r.json().catch(()=>({error:r.statusText}));throw new Error(l.error||r.statusText)}}async function Op(e,t,n,r){const l=await fetch(`/api/archives/${e}/collections/${t}/entries/${n}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({visibility_bits:r})});if(!l.ok){const i=await l.json().catch(()=>({error:l.statusText}));throw new Error(i.error||l.statusText)}}async function $p(e,t){return xe(`/api/archives/${e}/entries/${t}/collections`)}async function aa(e,t,n){const r=await fetch(`/api/archives/${e}/collections/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const l=await r.json().catch(()=>({}));throw new Error(l.error??r.statusText)}}async function Mp(e,t){const n=await fetch(`/api/archives/${e}/collections/${t}`,{method:"DELETE"});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error??n.statusText)}}const Fp=window.fetch;window.fetch=async(...e)=>{var n;const t=await Fp(...e);return t.status===401&&((typeof e[0]=="string"?e[0]:((n=e[0])==null?void 0:n.url)??"").includes("/api/auth/")||window.dispatchEvent(new CustomEvent("auth:expired"))),t};function Ip({onLogin:e}){const[t,n]=g.useState(""),[r,l]=g.useState(""),[i,s]=g.useState(null),[a,u]=g.useState(!1);async function d(v){v.preventDefault(),s(null),u(!0);try{const m=await pp(t,r);e(m)}catch(m){s(m.message)}finally{u(!1)}}return o.jsx("div",{className:"login-page",children:o.jsxs("div",{className:"login-card",children:[o.jsx("h1",{className:"login-brand",children:"Archivr"}),o.jsx("p",{className:"login-tagline",children:"Sign in to your archive"}),o.jsxs("form",{onSubmit:d,children:[o.jsxs("div",{className:"login-field",children:[o.jsx("label",{className:"login-label",htmlFor:"login-username",children:"Username"}),o.jsx("input",{className:"login-input",id:"login-username",type:"text",value:t,onChange:v=>n(v.target.value),autoFocus:!0,required:!0,autoComplete:"username"})]}),o.jsxs("div",{className:"login-field",children:[o.jsx("label",{className:"login-label",htmlFor:"login-password",children:"Password"}),o.jsx("input",{className:"login-input",id:"login-password",type:"password",value:r,onChange:v=>l(v.target.value),required:!0,autoComplete:"current-password"})]}),i&&o.jsx("p",{className:"login-error",children:i}),o.jsx("button",{className:"login-submit",type:"submit",disabled:a,children:a?"Signing in…":"Sign in"})]})]})})}function Up({onComplete:e}){const[t,n]=g.useState(""),[r,l]=g.useState(""),[i,s]=g.useState(""),[a,u]=g.useState(null),[d,v]=g.useState(!1);async function m(h){if(h.preventDefault(),r!==i){u("Passwords do not match");return}if(r.length<8){u("Password must be at least 8 characters");return}u(null),v(!0);try{await fp(t,r),e()}catch(k){u(k.message)}finally{v(!1)}}return o.jsx("div",{className:"setup-page",children:o.jsxs("div",{className:"setup-card",children:[o.jsx("h1",{className:"setup-brand",children:"Archivr"}),o.jsx("p",{className:"setup-tagline",children:"Create your owner account to get started."}),o.jsxs("form",{onSubmit:m,children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"setup-username",children:"Username"}),o.jsx("input",{className:"setup-input",id:"setup-username",type:"text",value:t,onChange:h=>n(h.target.value),autoFocus:!0,required:!0,autoComplete:"username"})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"setup-password",children:"Password"}),o.jsx("input",{className:"setup-input",id:"setup-password",type:"password",value:r,onChange:h=>l(h.target.value),required:!0,autoComplete:"new-password"})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"setup-confirm",children:"Confirm password"}),o.jsx("input",{className:"setup-input",id:"setup-confirm",type:"password",value:i,onChange:h=>s(h.target.value),required:!0,autoComplete:"new-password"})]}),a&&o.jsx("p",{className:"setup-error",children:a}),o.jsx("button",{className:"setup-submit",type:"submit",disabled:d,children:d?"Creating account…":"Create account"})]})]})})}function Ap({archives:e,archiveId:t,onArchiveChange:n,view:r,onViewChange:l,onCaptureClick:i}){const{currentUser:s,setCurrentUser:a}=g.useContext(zl)??{},[u,d]=g.useState(!1);async function v(){d(!0),await hp(),a(null),window.location.reload()}return o.jsxs("header",{className:"topbar",children:[o.jsx("div",{className:"brand",children:"Archivr"}),o.jsx("div",{className:"switcher",children:o.jsx("select",{"aria-label":"Select archive",value:t??"",onChange:m=>n(m.target.value),children:e.map(m=>o.jsx("option",{value:m.id,children:m.label},m.id))})}),o.jsx("nav",{className:"nav","aria-label":"Primary",children:["archive","tags","collections","runs","admin","settings"].map(m=>o.jsx("button",{className:`nav-link${r===m?" is-active":""}`,onClick:()=>l(m),children:m.charAt(0).toUpperCase()+m.slice(1)},m))}),o.jsx("button",{className:"capture-button",onClick:i,children:"Capture"}),s&&o.jsxs("div",{className:"user-menu",children:[o.jsx("span",{className:"user-name",children:s.display_name||s.username}),o.jsx("button",{className:"logout-btn",onClick:v,disabled:u,children:u?"Logging out…":"Log out"})]})]})}function Bp({open:e,archiveId:t,onClose:n,onCaptured:r}){const l=g.useRef(null),i=g.useRef(!0),s=g.useRef(!1),[a,u]=g.useState(()=>sessionStorage.getItem("captureDialogLocator")||""),[d,v]=g.useState(()=>sessionStorage.getItem("captureDialogError")||null),[m,h]=g.useState(()=>sessionStorage.getItem("captureDialogBusy")==="true"),[k,x]=g.useState(()=>sessionStorage.getItem("captureDialogJobStatus")||null),[S,R]=g.useState(()=>sessionStorage.getItem("captureDialogJobUid")||null),f=g.useRef(null);g.useEffect(()=>{sessionStorage.setItem("captureDialogLocator",a)},[a]),g.useEffect(()=>{sessionStorage.setItem("captureDialogError",d||"")},[d]),g.useEffect(()=>{sessionStorage.setItem("captureDialogBusy",m)},[m]),g.useEffect(()=>{sessionStorage.setItem("captureDialogJobStatus",k||"")},[k]),g.useEffect(()=>{sessionStorage.setItem("captureDialogJobUid",S||"")},[S]),g.useEffect(()=>{s.current||!S||k!=="running"||!t||(s.current=!0,f.current=setInterval(async()=>{var y;try{const C=await oa(t,S);C.status==="completed"?(clearInterval(f.current),f.current=null,h(!1),x("completed"),c(),(y=l.current)==null||y.close(),r()):C.status==="failed"&&(clearInterval(f.current),f.current=null,h(!1),x("failed"),v(C.error_text||"Capture failed."))}catch(C){clearInterval(f.current),f.current=null,h(!1),v(C.message)}},500))},[S,k,t,r]),g.useEffect(()=>{const y=l.current;if(!y)return;const C=()=>{clearInterval(f.current),n()};return y.addEventListener("close",C),()=>y.removeEventListener("close",C)},[n]),g.useEffect(()=>{const y=l.current;y&&(e?(i.current||(u(""),v(null),x(null),h(!1),R(null),clearInterval(f.current)),i.current=!1,y.open||y.showModal()):y.open&&y.close())},[e]);function c(){sessionStorage.removeItem("captureDialogLocator"),sessionStorage.removeItem("captureDialogError"),sessionStorage.removeItem("captureDialogBusy"),sessionStorage.removeItem("captureDialogJobStatus"),sessionStorage.removeItem("captureDialogJobUid"),u(""),v(null),h(!1),x(null),R(null)}async function p(){if(!a.trim()){v("Enter a locator.");return}h(!0),v(null),x(null);try{const y=await cp(t,a.trim());R(y.job_uid),x("running"),f.current=setInterval(async()=>{var C;try{const _=await oa(t,y.job_uid);_.status==="completed"?(clearInterval(f.current),f.current=null,h(!1),x("completed"),c(),(C=l.current)==null||C.close(),r()):_.status==="failed"&&(clearInterval(f.current),f.current=null,h(!1),x("failed"),v(_.error_text||"Capture failed."))}catch(_){clearInterval(f.current),f.current=null,h(!1),v(_.message)}},500)}catch(y){v(y.message),h(!1)}}function w(){return m?k==="running"?"Running…":"Capturing…":"Capture"}return o.jsx("dialog",{ref:l,className:"capture-dialog",children:o.jsxs("div",{className:"capture-dialog-inner",children:[o.jsx("h2",{className:"capture-dialog-title",children:"Capture"}),o.jsx("label",{htmlFor:"capture-locator",className:"capture-label",children:"Locator"}),o.jsx("input",{id:"capture-locator",className:"capture-input",type:"text",placeholder:"tweet:1234567890 or https://...",value:a,onChange:y=>u(y.target.value),onKeyDown:y=>{y.key==="Enter"&&p()},autoComplete:"off"}),d&&o.jsx("div",{className:"capture-error",children:d}),o.jsxs("div",{className:"capture-actions",children:[o.jsx("button",{type:"button",className:"capture-cancel",onClick:()=>{var y;return(y=l.current)==null?void 0:y.close()},children:"Cancel"}),o.jsx("button",{type:"button",className:"capture-submit",onClick:p,disabled:m,children:w()})]})]})})}function ts(e){if(!e)return"0 B";const t=["B","KB","MB","GB"];let n=e,r=0;for(;n>=1024&&r").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'")}function At(e){return Vp(e)??""}function jc(e){if(!e)return"";const t=new Date(e);if(isNaN(t))return e;const n=r=>String(r).padStart(2,"0");return`${t.getUTCFullYear()}-${n(t.getUTCMonth()+1)}-${n(t.getUTCDate())} ${n(t.getUTCHours())}:${n(t.getUTCMinutes())}`}const ua={youtube:'',x:'',instagram:'',facebook:'',tiktok:'',reddit:'',snapchat:'',local:'',web:'',other:'?'};function Cc(e){return ua[e]??ua.other}function Ec(e){return e.split("/").map(t=>t?t.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "):"").join("/")}function Hp({entry:e,archiveId:t,isSelected:n,onSelect:r}){const[l,i]=g.useState(!1),a=e.source_kind==="web"&&e.entity_kind==="page"&&e.has_favicon&&t&&!l?o.jsx("img",{src:`/api/archives/${t}/entries/${e.entry_uid}/favicon`,width:"16",height:"16",alt:"",onError:()=>i(!0),style:{objectFit:"contain"}}):o.jsx("span",{dangerouslySetInnerHTML:{__html:Cc(e.source_kind)}});return o.jsxs("div",{className:n?"is-selected":void 0,tabIndex:0,"data-entry-uid":e.entry_uid,onClick:r,onKeyDown:u=>{u.key==="Enter"&&r()},children:[o.jsx("div",{className:"col-added",children:jc(e.archived_at)}),o.jsxs("div",{className:"col-title",children:[o.jsx("span",{className:"source-icon",children:a}),o.jsx("span",{className:"entry-title",children:At(e.title)||At(e.entry_uid)})]}),o.jsx("div",{className:"col-type",children:o.jsx("span",{className:"type-pill",children:At(e.entity_kind)})}),o.jsxs("div",{className:"col-size",children:[o.jsx("span",{className:"size-total",children:ts(e.total_artifact_bytes)}),e.cached_bytes>0&&e.total_artifact_bytes>0&&o.jsxs("span",{className:"size-cached-pct",title:`${ts(e.cached_bytes)} already on disk from an earlier entry`,children:[Math.round(e.cached_bytes/e.total_artifact_bytes*100),"% cached"]})]}),o.jsx("div",{className:"url-cell col-url",children:o.jsx("span",{className:"url-text",children:At(e.original_url)})})]})}function Wp({entries:e,selectedEntryUid:t,onSelectEntry:n,archiveId:r}){return o.jsx("section",{id:"archive-view",className:"view is-active",children:o.jsxs("div",{className:"entry-table",children:[o.jsxs("div",{className:"entry-header-row",children:[o.jsx("div",{className:"col-added",children:"Added"}),o.jsx("div",{className:"col-title",children:"Title"}),o.jsx("div",{className:"col-type",children:"Type"}),o.jsx("div",{className:"col-size",children:"Size"}),o.jsx("div",{className:"col-url",children:"Original URL"})]}),o.jsx("div",{id:"entries-body",children:e.map(l=>o.jsx(Hp,{entry:l,archiveId:r,isSelected:l.entry_uid===t,onSelect:()=>n(l)},l.entry_uid))})]})})}function Qp(e){if(!e)return"—";try{return new Date(e).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}function Kp({status:e}){const t=e==="completed"?"run-status--completed":e==="failed"?"run-status--failed":e==="running"?"run-status--running":"";return o.jsx("span",{className:`run-status ${t}`,children:e||"—"})}function Jp({runs:e}){return o.jsx("section",{id:"runs-view",className:"view is-active",children:o.jsxs("table",{className:"entry-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Started"}),o.jsx("th",{children:"Status"}),o.jsx("th",{children:"Requested"}),o.jsx("th",{children:"Completed"}),o.jsx("th",{children:"Failed"})]})}),o.jsx("tbody",{children:e.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:5,style:{color:"var(--muted)",padding:"24px 16px",textAlign:"center"},children:"No runs yet."})}):e.map((t,n)=>o.jsxs("tr",{children:[o.jsx("td",{children:Qp(t.started_at)}),o.jsx("td",{children:o.jsx(Kp,{status:t.status})}),o.jsx("td",{children:t.requested_count??"—"}),o.jsx("td",{children:t.completed_count??"—"}),o.jsx("td",{children:t.failed_count??"—"})]},n))})]})})}const Yp=4;function Xp({archives:e}){const{currentUser:t}=g.useContext(zl)??{},n=t&&(t.role_bits&Yp)!==0,[r,l]=g.useState("users"),[i,s]=g.useState([]),[a,u]=g.useState([]),[d,v]=g.useState(!1),[m,h]=g.useState(null),[k,x]=g.useState(""),[S,R]=g.useState(""),[f,c]=g.useState(""),[p,w]=g.useState(null),[y,C]=g.useState(!1),[_,L]=g.useState(""),[I,M]=g.useState(""),[z,A]=g.useState(null),[le,Se]=g.useState(!1),Oe=g.useCallback(async()=>{if(n){v(!0),h(null);try{const[N,D]=await Promise.all([jp(),_p()]);s(N),u(D)}catch(N){h(N.message)}finally{v(!1)}}},[n]);g.useEffect(()=>{Oe()},[Oe]);async function $e(N){const D=N.status==="active"?"disabled":"active";try{await Ep(N.user_uid,D),s(B=>B.map(O=>O.user_uid===N.user_uid?{...O,status:D}:O))}catch(B){h(B.message)}}async function me(N){if(N.preventDefault(),!k.trim()||!S){w("Username and password required");return}C(!0),w(null);try{await Cp(k.trim(),S,f.trim()||void 0),x(""),R(""),c(""),await Oe()}catch(D){w(D.message)}finally{C(!1)}}async function T(N){if(N.preventDefault(),!_.trim()||!I.trim()){A("Slug and name required");return}Se(!0),A(null);try{await Tp(_.trim(),I.trim()),L(""),M(""),await Oe()}catch(D){A(D.message)}finally{Se(!1)}}return n?o.jsxs("section",{id:"admin-view",className:"view admin-view is-active",children:[o.jsx("h1",{children:"Admin"}),o.jsxs("div",{className:"view-tabs",children:[o.jsx("button",{className:`view-tab${r==="users"?" is-active":""}`,onClick:()=>l("users"),children:"Users"}),o.jsx("button",{className:`view-tab${r==="roles"?" is-active":""}`,onClick:()=>l("roles"),children:"Roles"}),o.jsx("button",{className:`view-tab${r==="archives"?" is-active":""}`,onClick:()=>l("archives"),children:"Archives"})]}),m&&o.jsx("div",{className:"form-msg form-msg--err",children:m}),r==="users"&&o.jsxs("div",{className:"admin-section",children:[o.jsx("h2",{children:"Users"}),d?o.jsx("p",{className:"muted",children:"Loading…"}):o.jsxs("table",{className:"admin-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Username"}),o.jsx("th",{children:"Email"}),o.jsx("th",{children:"Roles"}),o.jsx("th",{children:"Status"}),o.jsx("th",{children:"Actions"})]})}),o.jsx("tbody",{children:i.map(N=>o.jsxs("tr",{className:N.status==="disabled"?"admin-row-disabled":"",children:[o.jsx("td",{children:N.username}),o.jsx("td",{className:"muted",children:N.email||"—"}),o.jsx("td",{children:N.role_slugs.join(", ")||"—"}),o.jsx("td",{children:o.jsx("span",{className:`status-badge status-${N.status}`,children:N.status})}),o.jsx("td",{children:o.jsx("button",{className:"admin-action-btn",onClick:()=>$e(N),children:N.status==="active"?"Ban":"Unban"})})]},N.user_uid))})]}),o.jsx("h3",{children:"Create User"}),o.jsxs("form",{className:"admin-form",onSubmit:me,children:[o.jsx("input",{className:"admin-input",placeholder:"Username",value:k,onChange:N=>x(N.target.value),required:!0}),o.jsx("input",{className:"admin-input",type:"password",placeholder:"Password (min 8 chars)",value:S,onChange:N=>R(N.target.value),required:!0}),o.jsx("input",{className:"admin-input",type:"email",placeholder:"Email (optional)",value:f,onChange:N=>c(N.target.value)}),p&&o.jsx("div",{className:"form-msg form-msg--err",children:p}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:y,children:y?"Creating…":"Create User"})]})]}),r==="roles"&&o.jsxs("div",{className:"admin-section",children:[o.jsx("h2",{children:"Roles"}),d?o.jsx("p",{className:"muted",children:"Loading…"}):o.jsxs("table",{className:"admin-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Slug"}),o.jsx("th",{children:"Name"}),o.jsx("th",{children:"Level"}),o.jsx("th",{children:"Bit"}),o.jsx("th",{children:"Built-in"})]})}),o.jsx("tbody",{children:a.map(N=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("code",{children:N.slug})}),o.jsx("td",{children:N.name}),o.jsx("td",{children:N.level}),o.jsx("td",{children:N.bit_position}),o.jsx("td",{children:N.is_builtin?"✓":""})]},N.role_uid))})]}),o.jsx("h3",{children:"Create Custom Role"}),o.jsxs("form",{className:"admin-form",onSubmit:T,children:[o.jsx("input",{className:"admin-input",placeholder:"Slug (e.g. moderator)",value:_,onChange:N=>L(N.target.value),required:!0}),o.jsx("input",{className:"admin-input",placeholder:"Display Name (e.g. Moderator)",value:I,onChange:N=>M(N.target.value),required:!0}),z&&o.jsx("div",{className:"form-msg form-msg--err",children:z}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:le,children:le?"Creating…":"Create Role"})]})]}),r==="archives"&&o.jsxs("div",{className:"admin-section",children:[o.jsx("h2",{children:"Mounted Archives"}),o.jsx("div",{className:"admin-list",children:e.map(N=>o.jsxs("div",{className:"admin-archive",children:[o.jsx("strong",{children:N.label}),o.jsx("div",{className:"muted",children:N.archive_path})]},N.id))})]})]}):o.jsxs("section",{id:"admin-view",className:"view admin-view is-active",children:[o.jsx("h1",{children:"Admin"}),o.jsx("p",{className:"muted",children:"You need admin privileges to access this panel."}),o.jsx("h2",{children:"Mounted Archives"}),o.jsx("div",{className:"admin-list",children:e.map(N=>o.jsxs("div",{className:"admin-archive",children:[o.jsx("strong",{children:N.label}),o.jsx("div",{className:"muted",children:N.archive_path})]},N.id))})]})}function _c({node:e,archiveId:t,tagFilter:n,onTagFilterSet:r,onViewChange:l,onTagRenamed:i,onTagDeleted:s,onTagsRefresh:a,humanizeTags:u}){var w;const d=n===e.tag.full_path,[v,m]=g.useState(!1),[h,k]=g.useState(""),x=g.useRef(!1);function S(){if(v)return;const y=d?null:e.tag.full_path;r(y),l("archive")}function R(y){y.stopPropagation(),k(e.tag.slug),m(!0)}async function f(){const y=h.trim();if(!y||y===e.tag.slug){m(!1);return}try{const C=await ap(t,e.tag.tag_uid,y);i(e.tag.full_path,C.full_path),a()}catch{}finally{m(!1)}}async function c(y){var _;y.stopPropagation();const C=((_=e.children)==null?void 0:_.length)>0?`Delete tag "${e.tag.full_path}" and all its child tags? This cannot be undone.`:`Delete tag "${e.tag.full_path}"? This cannot be undone.`;if(window.confirm(C))try{await up(t,e.tag.tag_uid),s(e.tag.full_path),a()}catch{}}const p={archiveId:t,tagFilter:n,onTagFilterSet:r,onViewChange:l,onTagRenamed:i,onTagDeleted:s,onTagsRefresh:a,humanizeTags:u};return o.jsxs("li",{children:[o.jsxs("div",{className:"tag-node-row",children:[v?o.jsx("input",{className:"tag-rename-input",autoFocus:!0,value:h,onChange:y=>k(y.target.value),onKeyDown:y=>{y.key==="Enter"&&y.currentTarget.blur(),y.key==="Escape"&&(x.current=!0,y.currentTarget.blur())},onBlur:()=>{x.current?(x.current=!1,m(!1)):f()}}):o.jsxs("button",{className:`tag-node-btn${d?" is-active":""}`,title:e.tag.full_path,onClick:S,onDoubleClick:R,children:[u?e.tag.name:e.tag.slug,o.jsx("svg",{className:"edit-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",onClick:y=>{y.stopPropagation(),R(y)},children:o.jsx("path",{d:"M11.5 2.5a1.5 1.5 0 0 1 2 2L5 13l-3 1 1-3 8.5-8.5z"})})]}),o.jsx("button",{className:"remove tag-node-delete",title:`Delete tag ${e.tag.full_path}`,onClick:c,"aria-label":`Delete tag ${e.tag.full_path}`,children:"×"})]}),((w=e.children)==null?void 0:w.length)>0&&o.jsx("div",{className:"tag-children",children:o.jsx("ul",{className:"tag-tree-list",children:e.children.map(y=>o.jsx(_c,{node:y,...p},y.tag.tag_uid))})})]})}function Gp({archiveId:e,tagNodes:t,tagFilter:n,onTagFilterSet:r,onViewChange:l,onTagRenamed:i,onTagDeleted:s,onTagsRefresh:a,humanizeTags:u}){return o.jsx("section",{id:"tags-view",className:"view is-active",children:o.jsxs("div",{className:"tag-tree",children:[o.jsxs("div",{className:"tag-tree-header",children:[o.jsx("span",{className:"tag-tree-title",children:"Tags"}),n&&o.jsxs("span",{className:"tag-tree-active",children:["Filtering: ",n]})]}),t.length===0?o.jsx("p",{className:"muted",style:{padding:"8px 0"},children:"No tags yet."}):o.jsx("ul",{className:"tag-tree-list",children:t.map(d=>o.jsx(_c,{node:d,archiveId:e,tagFilter:n,onTagFilterSet:r,onViewChange:l,onTagRenamed:i,onTagDeleted:s,onTagsRefresh:a,humanizeTags:u},d.tag.tag_uid))})]})})}const In=[{value:0,label:"Private"},{value:2,label:"Users only"},{value:3,label:"Public"}],Zp=e=>{var t;return((t=In.find(n=>n.value===e))==null?void 0:t.label)??String(e)};function qp({archiveId:e}){const[t,n]=g.useState([]),[r,l]=g.useState(!1),[i,s]=g.useState(null),[a,u]=g.useState(null),[d,v]=g.useState(null),[m,h]=g.useState(!1),[k,x]=g.useState(null),[S,R]=g.useState(""),[f,c]=g.useState(""),[p,w]=g.useState(2),[y,C]=g.useState(!1),[_,L]=g.useState(null),[I,M]=g.useState(""),[z,A]=g.useState(2),[le,Se]=g.useState(!1),[Oe,$e]=g.useState(null),[me,T]=g.useState(!1),[N,D]=g.useState(""),B=g.useRef(null),O=t.find(E=>E.collection_uid===a)??null,ue=(O==null?void 0:O.slug)==="_default_",ce=g.useCallback(async()=>{if(e){l(!0),s(null);try{const E=await Pp(e);n(E)}catch(E){s(E.message)}finally{l(!1)}}},[e]),Ze=g.useCallback(async E=>{if(!E){v(null);return}h(!0),x(null);try{const V=await zp(e,E);v(V)}catch(V){x(V.message)}finally{h(!1)}},[e]);g.useEffect(()=>{ce()},[ce]),g.useEffect(()=>{Ze(a)},[a,Ze]),g.useEffect(()=>{me&&B.current&&B.current.focus()},[me]);async function Ve(E){E.preventDefault();const V=S.trim(),He=f.trim();if(!(!V||!He)){C(!0),L(null);try{const Ot=await Lp(e,V,He,p);R(""),c(""),w(2),await ce(),u(Ot.collection_uid)}catch(Ot){L(Ot.message)}finally{C(!1)}}}async function rt(){const E=N.trim();if(!E||!O){T(!1);return}try{await aa(e,O.collection_uid,{name:E}),await ce(),v(V=>V&&{...V,name:E})}catch(V){s(V.message)}finally{T(!1)}}async function Rl(E){if(O)try{await aa(e,O.collection_uid,{default_visibility_bits:E}),await ce(),v(V=>V&&{...V,default_visibility_bits:E})}catch(V){s(V.message)}}async function Dl(){if(O&&window.confirm(`Delete collection "${O.name}"? Entries will not be deleted.`))try{await Mp(e,O.collection_uid),u(null),v(null),await ce()}catch(E){s(E.message)}}async function $(E){E.preventDefault();const V=I.trim();if(!(!V||!O)){Se(!0),$e(null);try{await Rp(e,O.collection_uid,V,z),M(""),await Ze(O.collection_uid)}catch(He){$e(He.message)}finally{Se(!1)}}}async function ie(E){if(O)try{await Dp(e,O.collection_uid,E),await Ze(O.collection_uid)}catch(V){x(V.message)}}async function _e(E,V){if(O)try{await Op(e,O.collection_uid,E,V),v(He=>He&&{...He,entries:He.entries.map(Ot=>Ot.entry_uid===E?{...Ot,collection_visibility_bits:V}:Ot)})}catch(He){x(He.message)}}return e?o.jsxs("div",{className:"collections-view",children:[o.jsx("h2",{className:"collections-heading",children:"Collections"}),r&&o.jsx("div",{className:"muted",children:"Loading…"}),i&&o.jsxs("div",{className:"collections-error",children:[i," ",o.jsx("button",{onClick:()=>s(null),className:"coll-dismiss",children:"×"})]}),o.jsxs("div",{className:"collections-layout",children:[o.jsxs("div",{className:"collections-sidebar",children:[t.map(E=>o.jsxs("button",{className:`coll-sidebar-row${a===E.collection_uid?" is-active":""}`,onClick:()=>u(E.collection_uid),children:[o.jsx("span",{className:"coll-row-name",children:E.name}),o.jsx("span",{className:"coll-row-meta",children:Zp(E.default_visibility_bits)})]},E.collection_uid)),t.length===0&&!r&&o.jsx("div",{className:"muted",style:{padding:"8px 12px"},children:"No collections yet."})]}),O?o.jsxs("div",{className:"coll-detail",children:[o.jsxs("div",{className:"coll-detail-header",children:[me?o.jsx("input",{ref:B,className:"coll-rename-input",value:N,onChange:E=>D(E.target.value),onBlur:rt,onKeyDown:E=>{E.key==="Enter"&&rt(),E.key==="Escape"&&T(!1)}}):o.jsxs("h3",{className:`coll-detail-name${ue?"":" coll-detail-name--editable"}`,title:ue?void 0:"Click to rename",onClick:()=>{ue||(D(O.name),T(!0))},children:[(d==null?void 0:d.name)??O.name,!ue&&o.jsx("span",{className:"coll-edit-hint",children:" ✎"})]}),!ue&&o.jsx("button",{className:"coll-delete-btn",onClick:Dl,title:"Delete collection",children:"Delete"})]}),o.jsxs("div",{className:"coll-detail-vis",children:[o.jsx("span",{className:"coll-vis-label",children:"Default visibility"}),o.jsx("select",{className:"coll-vis-select",value:(d==null?void 0:d.default_visibility_bits)??O.default_visibility_bits,onChange:E=>Rl(Number(E.target.value)),disabled:ue,children:In.map(E=>o.jsx("option",{value:E.value,children:E.label},E.value))})]}),o.jsxs("div",{className:"coll-entries-section",children:[o.jsx("div",{className:"coll-section-heading",children:"Entries"}),m&&o.jsx("div",{className:"muted",children:"Loading…"}),k&&o.jsx("div",{className:"collections-error",children:k}),!m&&d&&(d.entries.length===0?o.jsx("div",{className:"muted",children:"No entries in this collection."}):o.jsx("ul",{className:"coll-entries-list",children:d.entries.map(E=>o.jsxs("li",{className:"coll-entry-row",children:[o.jsxs("div",{className:"coll-entry-info",children:[o.jsx("span",{className:"coll-entry-title",children:E.title||E.entry_uid}),o.jsx("span",{className:"coll-entry-kind muted",children:E.source_kind})]}),o.jsxs("div",{className:"coll-entry-actions",children:[o.jsx("select",{className:"coll-entry-vis-select",value:E.collection_visibility_bits,onChange:V=>_e(E.entry_uid,Number(V.target.value)),children:In.map(V=>o.jsx("option",{value:V.value,children:V.label},V.value))}),!ue&&o.jsx("button",{className:"coll-entry-remove",onClick:()=>ie(E.entry_uid),title:"Remove from collection",children:"×"})]})]},E.entry_uid))}))]}),!ue&&o.jsxs("form",{className:"coll-add-entry-form",onSubmit:$,children:[o.jsx("div",{className:"coll-section-heading",children:"Add entry"}),o.jsxs("div",{className:"coll-add-entry-row",children:[o.jsx("input",{className:"coll-add-entry-input",type:"text",value:I,onChange:E=>M(E.target.value),placeholder:"entry_uid",required:!0}),o.jsx("select",{className:"coll-vis-select",value:z,onChange:E=>A(Number(E.target.value)),children:In.map(E=>o.jsx("option",{value:E.value,children:E.label},E.value))}),o.jsx("button",{className:"coll-add-btn",type:"submit",disabled:le,children:le?"…":"Add"})]}),Oe&&o.jsx("div",{className:"collections-error",style:{marginTop:4},children:Oe})]})]}):o.jsx("div",{className:"coll-detail coll-detail--empty",children:o.jsx("div",{className:"muted",children:"Select a collection to view details."})})]}),o.jsxs("details",{className:"coll-create-details",children:[o.jsx("summary",{children:"+ Create collection"}),o.jsxs("form",{className:"coll-create-form",onSubmit:Ve,children:[o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"coll-name",children:"Name"}),o.jsx("input",{className:"capture-input",id:"coll-name",type:"text",value:S,onChange:E=>{R(E.target.value),f||c(E.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""))},placeholder:"My Collection",required:!0})]}),o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"coll-slug",children:"Slug"}),o.jsx("input",{className:"capture-input",id:"coll-slug",type:"text",value:f,onChange:E=>c(E.target.value),placeholder:"my-collection",required:!0})]}),o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"coll-vis",children:"Default visibility"}),o.jsx("select",{className:"capture-input",id:"coll-vis",style:{height:42},value:p,onChange:E=>w(Number(E.target.value)),children:In.map(E=>o.jsx("option",{value:E.value,children:E.label},E.value))})]}),_&&o.jsx("div",{className:"collections-error",children:_}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:y,children:y?"Creating…":"Create collection"})]})]})]}):o.jsx("div",{className:"view-placeholder",children:"Select an archive."})}const bp=4;function eh({tab:e,onTabChange:t}){const{currentUser:n,setCurrentUser:r}=g.useContext(zl)??{},l=n&&(n.role_bits&bp)!==0,i=["profile","tokens",...l?["instance"]:[]],s={profile:"Profile",tokens:"API Tokens",instance:"Instance"};return o.jsxs("section",{className:"admin-view",children:[o.jsx("h1",{children:"Settings"}),o.jsx("div",{className:"view-tabs",children:i.map(a=>o.jsx("button",{className:`view-tab${e===a?" is-active":""}`,onClick:()=>t(a),children:s[a]},a))}),e==="profile"&&o.jsx(th,{currentUser:n,setCurrentUser:r}),e==="tokens"&&o.jsx(nh,{}),e==="instance"&&l&&o.jsx(rh,{})]})}function th({currentUser:e,setCurrentUser:t}){const[n,r]=g.useState((e==null?void 0:e.display_name)??""),[l,i]=g.useState(!1),[s,a]=g.useState(null),[u,d]=g.useState(""),[v,m]=g.useState(""),[h,k]=g.useState(""),[x,S]=g.useState(!1),[R,f]=g.useState(null);async function c(w){w.preventDefault(),i(!0),a(null);try{await vp(n),t(y=>({...y,display_name:n||null})),a({ok:!0,text:"Saved."})}catch(y){a({ok:!1,text:y.message})}finally{i(!1)}}async function p(w){if(w.preventDefault(),v!==h){f({ok:!1,text:"Passwords do not match."});return}S(!0),f(null);try{await yp(u,v),d(""),m(""),k(""),f({ok:!0,text:"Password changed."})}catch(y){f({ok:!1,text:y.message})}finally{S(!1)}}return o.jsxs("div",{style:{maxWidth:440},children:[o.jsxs("div",{className:"form-section",children:[o.jsx("h2",{children:"Display Name"}),o.jsxs("form",{onSubmit:c,children:[o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"display-name",children:"Name shown in the UI"}),o.jsx("input",{className:"field-input",id:"display-name",placeholder:(e==null?void 0:e.username)??"",value:n,onChange:w=>r(w.target.value)})]}),s&&o.jsx("div",{className:`form-msg form-msg--${s.ok?"ok":"err"}`,children:s.text}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:l,children:l?"Saving…":"Save"})]})]}),o.jsxs("div",{className:"form-section",children:[o.jsx("h2",{children:"Display Preferences"}),o.jsxs("label",{className:"checkbox-row",children:[o.jsx("input",{type:"checkbox",checked:(e==null?void 0:e.humanize_slugs)??!1,onChange:async w=>{const y=w.target.checked;try{await gp({humanize_slugs:y}),t(C=>({...C,humanize_slugs:y}))}catch{}}}),o.jsx("span",{className:"form-label",style:{margin:0},children:"Humanize tag display"})]}),o.jsx("p",{className:"muted",style:{fontSize:13,margin:"4px 0 0"},children:'When on, tag paths show as "X / Articles" instead of "x/articles".'})]}),o.jsxs("div",{className:"form-section",children:[o.jsx("h2",{children:"Change Password"}),o.jsxs("form",{onSubmit:p,children:[o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"cur-pw",children:"Current password"}),o.jsx("input",{className:"field-input",id:"cur-pw",type:"password",value:u,onChange:w=>d(w.target.value),required:!0})]}),o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"new-pw",children:"New password"}),o.jsx("input",{className:"field-input",id:"new-pw",type:"password",value:v,onChange:w=>m(w.target.value),required:!0})]}),o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"confirm-pw",children:"Confirm new password"}),o.jsx("input",{className:"field-input",id:"confirm-pw",type:"password",value:h,onChange:w=>k(w.target.value),required:!0})]}),R&&o.jsx("div",{className:`form-msg form-msg--${R.ok?"ok":"err"}`,children:R.text}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:x,children:x?"Changing…":"Change Password"})]})]})]})}function nh(){const[e,t]=g.useState([]),[n,r]=g.useState(!0),[l,i]=g.useState(null),[s,a]=g.useState(""),[u,d]=g.useState(!1),[v,m]=g.useState(null),h=g.useCallback(async()=>{r(!0),i(null);try{t(await wp())}catch(S){i(S.message)}finally{r(!1)}},[]);g.useEffect(()=>{h()},[h]);async function k(S){if(S.preventDefault(),!!s.trim()){d(!0);try{const R=await xp(s.trim());m(R),a(""),h()}catch(R){i(R.message)}finally{d(!1)}}}async function x(S){try{await Sp(S),t(R=>R.filter(f=>f.token_uid!==S))}catch(R){i(R.message)}}return o.jsx("div",{style:{maxWidth:600},children:o.jsxs("div",{className:"form-section",children:[o.jsx("h2",{children:"API Tokens"}),v&&o.jsxs("div",{className:"token-banner",children:[o.jsx("strong",{children:"Token created."})," Copy it now — it won't be shown again.",o.jsx("code",{children:v.raw_token}),o.jsx("button",{className:"token-dismiss",onClick:()=>m(null),children:"Dismiss"})]}),o.jsxs("form",{className:"token-create-row",onSubmit:k,children:[o.jsx("input",{className:"field-input field-input--flex",placeholder:"Token name",value:s,onChange:S=>a(S.target.value),required:!0}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:u,children:u?"Creating…":"Create token"})]}),l&&o.jsx("div",{className:"form-msg form-msg--err",children:l}),n?o.jsx("div",{className:"muted",children:"Loading\\u2026"}):o.jsxs("div",{children:[e.length===0&&o.jsx("div",{className:"muted",children:"No tokens yet."}),e.map(S=>o.jsxs("div",{className:"token-row",children:[o.jsxs("div",{className:"token-row-info",children:[o.jsx("strong",{children:S.name}),o.jsxs("div",{className:"muted",children:["Created ",S.created_at.slice(0,10),S.last_used_at&&` · Last used ${S.last_used_at.slice(0,10)}`]})]}),o.jsx("button",{className:"btn-danger",style:{fontSize:12,padding:"4px 10px"},onClick:()=>x(S.token_uid),children:"Revoke"})]},S.token_uid))]})]})})}function rh(){const[e,t]=g.useState(null),[n,r]=g.useState(!0),[l,i]=g.useState(null),[s,a]=g.useState(!1),[u,d]=g.useState(null);g.useEffect(()=>{(async()=>{try{t(await kp())}catch(m){i(m.message)}finally{r(!1)}})()},[]);async function v(m){m.preventDefault(),a(!0),d(null);try{await Np(e),d({ok:!0,text:"Saved."})}catch(h){d({ok:!1,text:h.message})}finally{a(!1)}}return n?o.jsx("div",{className:"muted",children:"Loading\\u2026"}):l?o.jsx("div",{className:"form-msg form-msg--err",children:l}):e?o.jsx("div",{style:{maxWidth:440},children:o.jsxs("div",{className:"form-section",children:[o.jsx("h2",{children:"Instance Settings"}),o.jsxs("form",{onSubmit:v,children:[[["public_index_enabled","Public index (unauthenticated browsing)"],["public_entry_content_enabled","Public entry content"],["open_registration_enabled","Open registration"]].map(([m,h])=>o.jsxs("label",{className:"checkbox-row",children:[o.jsx("input",{type:"checkbox",checked:!!e[m],onChange:k=>t(x=>({...x,[m]:k.target.checked}))}),h]},m)),o.jsxs("div",{className:"form-field",style:{marginTop:4},children:[o.jsx("label",{className:"form-label",children:"Default entry visibility"}),o.jsxs("select",{className:"field-input",value:e.default_entry_visibility,onChange:m=>t(h=>({...h,default_entry_visibility:Number(m.target.value)})),children:[o.jsx("option",{value:0,children:"Private"}),o.jsx("option",{value:2,children:"Unlisted"}),o.jsx("option",{value:3,children:"Public"})]})]}),u&&o.jsx("div",{className:`form-msg form-msg--${u.ok?"ok":"err"}`,children:u.text}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:s,children:s?"Saving…":"Save Settings"})]})]})}):null}const ca={0:"Private",1:"Public",2:"Users only",3:"Public"},lh=()=>o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M7 17 17 7M9 7h8v8"})});function ih({archiveId:e,selectedEntry:t,onTagFilterSet:n,tagNodes:r,onTagsRefresh:l,onEntryTitleChange:i,humanizeTags:s}){const[a,u]=g.useState(null),[d,v]=g.useState([]),[m,h]=g.useState(""),[k,x]=g.useState([]),[S,R]=g.useState(""),f=g.useRef(0),c=g.useRef(!1),[p,w]=g.useState(!1),[y,C]=g.useState("");g.useEffect(()=>{if(!t||!e){u(null),v([]),x([]);return}w(!1),C(""),c.current=!1;const z=++f.current;u(null),v([]),Promise.all([lp(e,t.entry_uid),si(e,t.entry_uid),$p(e,t.entry_uid)]).then(([A,le,Se])=>{z===f.current&&(u(A),v(le),x(Se))}).catch(()=>{})},[t,e]);async function _(){const z=y.trim()||null;try{await ip(e,t.entry_uid,z),u(A=>A&&{...A,summary:{...A.summary,title:z}}),i==null||i(t.entry_uid,z)}catch{}finally{w(!1)}}async function L(){const z=m.trim();if(!(!z||!t))try{await sp(e,t.entry_uid,z),h(""),R("");const A=await si(e,t.entry_uid);v(A),l()}catch(A){R(A.message)}}async function I(z){try{await op(e,t.entry_uid,z);const A=await si(e,t.entry_uid);v(A),l()}catch{}}const M=a?[["Added",jc(a.summary.archived_at)],["Source",a.summary.source_kind],["Type",a.summary.entity_kind],["Visibility",ca[a.summary.visibility]??a.summary.visibility],["Root",a.structured_root_relpath]]:[];return o.jsxs("aside",{className:"context-rail",children:[o.jsx("div",{className:"rail-eyebrow",children:"Context"}),t?a?o.jsxs(o.Fragment,{children:[p?o.jsx("input",{className:"rail-title-input",autoFocus:!0,value:y,onChange:z=>C(z.target.value),onKeyDown:z=>{z.key==="Enter"&&z.currentTarget.blur(),z.key==="Escape"&&(c.current=!0,z.currentTarget.blur())},onBlur:()=>{c.current?w(!1):_(),c.current=!1}}):o.jsxs("h2",{className:"rail-title rail-title--editable",title:"Click to rename",onClick:()=>{C(a.summary.title??""),w(!0)},children:[At(a.summary.title)||At(a.summary.entry_uid),o.jsx("svg",{className:"edit-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"M11.5 2.5a1.5 1.5 0 0 1 2 2L5 13l-3 1 1-3 8.5-8.5z"})})]}),a.summary.original_url&&o.jsxs("a",{className:"url-tile",href:a.summary.original_url,target:"_blank",rel:"noopener noreferrer",children:[o.jsx("span",{className:"ico",dangerouslySetInnerHTML:{__html:Cc(a.summary.source_kind)}}),o.jsx("span",{className:"u-text",children:a.summary.original_url}),o.jsx("span",{className:"ext",children:o.jsx(lh,{})})]}),o.jsx("div",{className:"meta-list",children:M.filter(([,z])=>z!=null&&z!=="").map(([z,A])=>o.jsxs("div",{className:"meta-item",children:[o.jsx("span",{className:"meta-k",children:z}),o.jsx("span",{className:`meta-v${z==="Root"?" mono":""}`,children:At(A)})]},z))}),a.artifacts.length>0&&o.jsxs("div",{className:"rail-section",children:[o.jsxs("div",{className:"rail-section-heading",children:["Artifacts ",o.jsx("span",{className:"num",children:a.artifacts.length})]}),o.jsx("ul",{className:"artifact-list",children:a.artifacts.map((z,A)=>o.jsx("li",{children:o.jsxs("a",{href:`/api/archives/${e}/entries/${a.summary.entry_uid}/artifacts/${A}`,target:"_blank",rel:"noopener noreferrer",className:"artifact-link",children:[o.jsx("span",{className:"artifact-name",children:z.artifact_role.replace(/_/g," ")}),o.jsx("span",{className:"artifact-size",children:z.byte_size!=null?ts(z.byte_size):"—"})]})},A))})]})]}):o.jsx("p",{className:"tags-empty",children:"Loading…"}):o.jsx("p",{className:"tags-empty",children:"Select an entry."}),t&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"rail-section",children:[o.jsx("div",{className:"rail-section-heading",children:"Tags"}),d.length===0?o.jsx("p",{className:"tags-empty",children:"No tags yet."}):o.jsx("div",{className:"tags-wrap",children:d.map(z=>o.jsxs("span",{className:"tag-pill",title:z.full_path,children:[s?Ec(z.full_path):z.full_path,o.jsx("button",{className:"remove",title:`Remove tag ${z.full_path}`,onClick:()=>I(z.tag_uid),children:"×"})]},z.tag_uid))}),S&&o.jsx("p",{className:"form-msg form-msg--err",style:{margin:"0 0 8px"},children:S}),o.jsxs("div",{className:"tag-input-wrap",children:[o.jsx("span",{className:"hash",children:"/"}),o.jsx("input",{className:"tag-input",type:"text",placeholder:"science/cs",autoComplete:"off",value:m,onChange:z=>h(z.target.value),onKeyDown:z=>{z.key==="Enter"&&L()}}),o.jsx("button",{className:"tag-add-btn",onClick:L,children:"Add"})]})]}),k.length>0&&o.jsxs("div",{className:"rail-section",children:[o.jsx("div",{className:"rail-section-heading",children:"Collections"}),k.map(z=>o.jsxs("div",{className:"coll-row",children:[o.jsx("span",{className:"coll-name",children:z.collection_uid}),o.jsx("span",{className:"vis-badge",children:ca[z.visibility_bits]??`bits:${z.visibility_bits}`})]},z.collection_uid))]})]})]})}const zl=g.createContext(null),sh=["archive","tags","collections","runs","admin","settings"],oh=["profile","tokens","instance"];function ai(){const e=window.location.pathname.split("/").filter(Boolean),t=sh.includes(e[0])?e[0]:"archive",n=t==="settings"&&oh.includes(e[1])?e[1]:"profile";return{view:t,settingsTab:n}}function ah(e,t){return e==="archive"?"/":e==="settings"?`/settings/${t}`:`/${e}`}function uh(){const[e,t]=g.useState("loading"),[n,r]=g.useState(null);g.useEffect(()=>{(async()=>{if(await dp()){t("setup");return}const ie=await mp();if(!ie){t("login");return}r(ie),t("authenticated")})()},[]),g.useEffect(()=>{const $=()=>{r(null),t("login")};return window.addEventListener("auth:expired",$),()=>window.removeEventListener("auth:expired",$)},[]),g.useEffect(()=>{const $=()=>{const{view:ie,settingsTab:_e}=ai();f(ie),p(_e)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[]);const[l,i]=g.useState([]),[s,a]=g.useState(null),[u,d]=g.useState([]),[v,m]=g.useState(null),[h,k]=g.useState(null),[x,S]=g.useState(null),[R,f]=g.useState(()=>ai().view),[c,p]=g.useState(()=>ai().settingsTab),[w,y]=g.useState(""),[C,_]=g.useState(""),[L,I]=g.useState(!1),[M,z]=g.useState([]),[A,le]=g.useState([]),[Se,Oe]=g.useState(()=>sessionStorage.getItem("captureDialogOpen")==="true"),$e=(n==null?void 0:n.humanize_slugs)??!1;g.useEffect(()=>{sessionStorage.setItem("captureDialogOpen",Se)},[Se]);const me=g.useCallback(async($,ie,_e)=>{if($){I(!0);try{let E;ie||_e?E=await rp($,ie,_e):E=await np($),d(E),_(E.length===0?"No results":`${E.length} result${E.length===1?"":"s"}`)}catch{d([]),_("Search failed. Try again.")}finally{I(!1)}}},[]);g.useEffect(()=>{e==="authenticated"&&tp().then($=>{if(i($),$.length>0){const ie=$[0].id;a(ie)}})},[e]),g.useEffect(()=>{s&&(S(null),k(null),m(null),Promise.all([me(s,"",null),sa(s).then(z),oi(s).then(le)]))},[s]),g.useEffect(()=>{if(s===null)return;const $=setTimeout(()=>{me(s,w,x)},300);return()=>clearTimeout($)},[w,s]),g.useEffect(()=>{s!==null&&(x!==null&&f("archive"),me(s,w,x))},[x,s]);const T=g.useCallback($=>{a($)},[]),N=g.useCallback($=>{f($),$==="tags"&&s&&oi(s).then(le)},[s]);g.useEffect(()=>{const $=ah(R,c);window.location.pathname!==$&&history.pushState(null,"",$)},[R,c]);const D=g.useCallback($=>{m($?$.entry_uid:null),k($)},[]),B=g.useCallback($=>{S($)},[]),O=g.useCallback(()=>{S(null)},[]),ue=g.useCallback(()=>{s&&oi(s).then(le)},[s]),ce=g.useCallback(($,ie)=>{x===$?S(ie):x!=null&&x.startsWith($+"/")&&S(ie+x.slice($.length))},[x]),Ze=g.useCallback($=>{(x===$||x!=null&&x.startsWith($+"/"))&&S(null)},[x]),Ve=g.useCallback(($,ie)=>{d(_e=>_e.map(E=>E.entry_uid===$?{...E,title:ie}:E)),k(_e=>_e&&_e.entry_uid===$?{..._e,title:ie}:_e)},[]),rt=g.useCallback(()=>{Oe(!0)},[]),Rl=g.useCallback(()=>{Oe(!1)},[]),Dl=g.useCallback(()=>{s&&Promise.all([me(s,w,x),sa(s).then(z)])},[s,w,x,me]);return e==="loading"?o.jsx("div",{className:"auth-loading",children:"Loading\\u2026"}):e==="setup"?o.jsx(Up,{onComplete:()=>t("login")}):e==="login"?o.jsx(Ip,{onLogin:$=>{r($),t("authenticated")}}):o.jsx(zl.Provider,{value:{currentUser:n,setCurrentUser:r},children:o.jsxs(o.Fragment,{children:[o.jsx(Ap,{archives:l,archiveId:s,onArchiveChange:T,view:R,onViewChange:N,onCaptureClick:rt}),o.jsxs("main",{className:"app-shell",children:[o.jsxs("div",{className:"workspace",children:[R==="archive"&&o.jsxs("div",{className:"toolbar",children:[o.jsxs("div",{className:"search-field",children:[o.jsx("span",{className:"ico","aria-hidden":"true",children:o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7"}),o.jsx("line",{x1:"16.5",y1:"16.5",x2:"21",y2:"21"})]})}),o.jsx("input",{className:"search-input",type:"search","aria-label":"Search archive","aria-busy":L,placeholder:"Search titles, URLs, types, tags…",value:w,onChange:$=>y($.target.value)}),o.jsx("span",{className:"kbd",children:"⌘K"})]}),o.jsxs("span",{className:"result-count",children:[C&&o.jsxs(o.Fragment,{children:[o.jsx("b",{children:C.split(" ")[0]})," ",C.split(" ").slice(1).join(" ")]}),x&&o.jsxs("button",{className:"tag-filter-badge",onClick:O,children:["× ",$e?Ec(x):x]})]})]}),R==="archive"&&o.jsx(Wp,{entries:u,selectedEntryUid:v,onSelectEntry:D,archiveId:s,tagFilter:x,onClearTagFilter:O,searchQuery:w,onSearchChange:y,resultCount:C,searchBusy:L}),R==="runs"&&o.jsx(Jp,{runs:M}),R==="admin"&&o.jsx(Xp,{archives:l}),R==="tags"&&o.jsx(Gp,{archiveId:s,tagNodes:A,tagFilter:x,onTagFilterSet:B,onViewChange:N,onTagRenamed:ce,onTagDeleted:Ze,onTagsRefresh:ue,humanizeTags:$e}),R==="collections"&&o.jsx(qp,{archiveId:s}),R==="settings"&&o.jsx(eh,{tab:c,onTabChange:p})]}),o.jsx(ih,{archiveId:s,selectedEntry:h,onTagFilterSet:B,tagNodes:A,onTagsRefresh:ue,onEntryTitleChange:Ve,humanizeTags:$e})]}),o.jsx(Bp,{open:Se,archiveId:s,onClose:Rl,onCaptured:Dl})]})})}Nc(document.getElementById("root")).render(o.jsx(g.StrictMode,{children:o.jsx(uh,{})})); diff --git a/crates/archivr-server/static/assets/index-CGioPLgk.js b/crates/archivr-server/static/assets/index-CGioPLgk.js new file mode 100644 index 0000000..2d409b5 --- /dev/null +++ b/crates/archivr-server/static/assets/index-CGioPLgk.js @@ -0,0 +1,40 @@ +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))r(l);new MutationObserver(l=>{for(const i of l)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(l){const i={};return l.integrity&&(i.integrity=l.integrity),l.referrerPolicy&&(i.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?i.credentials="include":l.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(l){if(l.ep)return;l.ep=!0;const i=n(l);fetch(l.href,i)}})();var da={exports:{}},ml={},fa={exports:{}},F={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var dr=Symbol.for("react.element"),Tc=Symbol.for("react.portal"),Pc=Symbol.for("react.fragment"),Lc=Symbol.for("react.strict_mode"),zc=Symbol.for("react.profiler"),Rc=Symbol.for("react.provider"),Dc=Symbol.for("react.context"),Oc=Symbol.for("react.forward_ref"),$c=Symbol.for("react.suspense"),Mc=Symbol.for("react.memo"),Fc=Symbol.for("react.lazy"),Gs=Symbol.iterator;function Ic(e){return e===null||typeof e!="object"?null:(e=Gs&&e[Gs]||e["@@iterator"],typeof e=="function"?e:null)}var pa={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ha=Object.assign,ma={};function Nn(e,t,n){this.props=e,this.context=t,this.refs=ma,this.updater=n||pa}Nn.prototype.isReactComponent={};Nn.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Nn.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function va(){}va.prototype=Nn.prototype;function ns(e,t,n){this.props=e,this.context=t,this.refs=ma,this.updater=n||pa}var rs=ns.prototype=new va;rs.constructor=ns;ha(rs,Nn.prototype);rs.isPureReactComponent=!0;var Zs=Array.isArray,ga=Object.prototype.hasOwnProperty,ls={current:null},ya={key:!0,ref:!0,__self:!0,__source:!0};function wa(e,t,n){var r,l={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)ga.call(t,r)&&!ya.hasOwnProperty(r)&&(l[r]=t[r]);var a=arguments.length-2;if(a===1)l.children=n;else if(1>>1,O=T[B];if(0>>1;Bl(Ze,D))Vel(rt,Ze)?(T[B]=rt,T[Ve]=D,B=Ve):(T[B]=Ze,T[ce]=D,B=ce);else if(Vel(rt,D))T[B]=rt,T[Ve]=D,B=Ve;else break e}}return N}function l(T,N){var D=T.sortIndex-N.sortIndex;return D!==0?D:T.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var u=[],d=[],v=1,m=null,h=3,k=!1,x=!1,S=!1,R=typeof setTimeout=="function"?setTimeout:null,f=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function p(T){for(var N=n(d);N!==null;){if(N.callback===null)r(d);else if(N.startTime<=T)r(d),N.sortIndex=N.expirationTime,t(u,N);else break;N=n(d)}}function w(T){if(S=!1,p(T),!x)if(n(u)!==null)x=!0,$e(y);else{var N=n(d);N!==null&&me(w,N.startTime-T)}}function y(T,N){x=!1,S&&(S=!1,f(L),L=-1),k=!0;var D=h;try{for(p(N),m=n(u);m!==null&&(!(m.expirationTime>N)||T&&!z());){var B=m.callback;if(typeof B=="function"){m.callback=null,h=m.priorityLevel;var O=B(m.expirationTime<=N);N=e.unstable_now(),typeof O=="function"?m.callback=O:m===n(u)&&r(u),p(N)}else r(u);m=n(u)}if(m!==null)var ue=!0;else{var ce=n(d);ce!==null&&me(w,ce.startTime-N),ue=!1}return ue}finally{m=null,h=D,k=!1}}var C=!1,_=null,L=-1,I=5,M=-1;function z(){return!(e.unstable_now()-MT||125B?(T.sortIndex=D,t(d,T),n(u)===null&&T===n(d)&&(S?(f(L),L=-1):S=!0,me(w,D-B))):(T.sortIndex=O,t(u,T),x||k||(x=!0,$e(y))),T},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(T){var N=h;return function(){var D=h;h=N;try{return T.apply(this,arguments)}finally{h=D}}}})(ja);Na.exports=ja;var Xc=Na.exports;/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Gc=g,ze=Xc;function j(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ui=Object.prototype.hasOwnProperty,Zc=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,bs={},eo={};function qc(e){return ui.call(eo,e)?!0:ui.call(bs,e)?!1:Zc.test(e)?eo[e]=!0:(bs[e]=!0,!1)}function bc(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function ed(e,t,n,r){if(t===null||typeof t>"u"||bc(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function we(e,t,n,r,l,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=l,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var ae={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ae[e]=new we(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ae[t]=new we(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ae[e]=new we(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ae[e]=new we(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ae[e]=new we(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ae[e]=new we(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ae[e]=new we(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ae[e]=new we(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ae[e]=new we(e,5,!1,e.toLowerCase(),null,!1,!1)});var ss=/[\-:]([a-z])/g;function os(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ss,os);ae[t]=new we(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ss,os);ae[t]=new we(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ss,os);ae[t]=new we(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ae[e]=new we(e,1,!1,e.toLowerCase(),null,!1,!1)});ae.xlinkHref=new we("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ae[e]=new we(e,1,!1,e.toLowerCase(),null,!0,!0)});function as(e,t,n,r){var l=ae.hasOwnProperty(t)?ae[t]:null;(l!==null?l.type!==0:r||!(2a||l[s]!==i[a]){var u=` +`+l[s].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=s&&0<=a);break}}}finally{Ml=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?On(e):""}function td(e){switch(e.tag){case 5:return On(e.type);case 16:return On("Lazy");case 13:return On("Suspense");case 19:return On("SuspenseList");case 0:case 2:case 15:return e=Fl(e.type,!1),e;case 11:return e=Fl(e.type.render,!1),e;case 1:return e=Fl(e.type,!0),e;default:return""}}function pi(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case qt:return"Fragment";case Zt:return"Portal";case ci:return"Profiler";case us:return"StrictMode";case di:return"Suspense";case fi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case _a:return(e.displayName||"Context")+".Consumer";case Ea:return(e._context.displayName||"Context")+".Provider";case cs:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ds:return t=e.displayName||null,t!==null?t:pi(e.type)||"Memo";case mt:t=e._payload,e=e._init;try{return pi(e(t))}catch{}}return null}function nd(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return pi(t);case 8:return t===us?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Pt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Pa(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rd(e){var t=Pa(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var l=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function yr(e){e._valueTracker||(e._valueTracker=rd(e))}function La(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Pa(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Qr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function hi(e,t){var n=t.checked;return G({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function no(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Pt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function za(e,t){t=t.checked,t!=null&&as(e,"checked",t,!1)}function mi(e,t){za(e,t);var n=Pt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?vi(e,t.type,n):t.hasOwnProperty("defaultValue")&&vi(e,t.type,Pt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function ro(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function vi(e,t,n){(t!=="number"||Qr(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var $n=Array.isArray;function cn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=wr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Un={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ld=["Webkit","ms","Moz","O"];Object.keys(Un).forEach(function(e){ld.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Un[t]=Un[e]})});function $a(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Un.hasOwnProperty(e)&&Un[e]?(""+t).trim():t+"px"}function Ma(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,l=$a(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,l):e[n]=l}}var id=G({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function wi(e,t){if(t){if(id[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(j(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(j(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(j(61))}if(t.style!=null&&typeof t.style!="object")throw Error(j(62))}}function xi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Si=null;function fs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ki=null,dn=null,fn=null;function so(e){if(e=hr(e)){if(typeof ki!="function")throw Error(j(280));var t=e.stateNode;t&&(t=xl(t),ki(e.stateNode,e.type,t))}}function Fa(e){dn?fn?fn.push(e):fn=[e]:dn=e}function Ia(){if(dn){var e=dn,t=fn;if(fn=dn=null,so(e),t)for(e=0;e>>=0,e===0?32:31-(vd(e)/gd|0)|0}var xr=64,Sr=4194304;function Mn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Xr(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,l=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~l;a!==0?r=Mn(a):(i&=s,i!==0&&(r=Mn(i)))}else s=n&~l,s!==0?r=Mn(s):i!==0&&(r=Mn(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&l)&&(l=r&-r,i=t&-t,l>=i||l===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function fr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Ye(t),e[t]=n}function Sd(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Bn),vo=" ",go=!1;function lu(e,t){switch(e){case"keyup":return Xd.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function iu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bt=!1;function Zd(e,t){switch(e){case"compositionend":return iu(t);case"keypress":return t.which!==32?null:(go=!0,vo);case"textInput":return e=t.data,e===vo&&go?null:e;default:return null}}function qd(e,t){if(bt)return e==="compositionend"||!xs&&lu(e,t)?(e=nu(),Mr=gs=wt=null,bt=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=So(n)}}function uu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?uu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cu(){for(var e=window,t=Qr();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qr(e.document)}return t}function Ss(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function af(e){var t=cu(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&uu(n.ownerDocument.documentElement,n)){if(r!==null&&Ss(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var l=n.textContent.length,i=Math.min(r.start,l);r=r.end===void 0?i:Math.min(r.end,l),!e.extend&&i>r&&(l=r,r=i,i=l),l=ko(n,i);var s=ko(n,r);l&&s&&(e.rangeCount!==1||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(l.node,l.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,en=null,Ti=null,Hn=null,Pi=!1;function No(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pi||en==null||en!==Qr(r)||(r=en,"selectionStart"in r&&Ss(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Hn&&tr(Hn,r)||(Hn=r,r=qr(Ti,"onSelect"),0rn||(e.current=$i[rn],$i[rn]=null,rn--)}function W(e,t){rn++,$i[rn]=e.current,e.current=t}var Lt={},he=Rt(Lt),je=Rt(!1),Ht=Lt;function gn(e,t){var n=e.type.contextTypes;if(!n)return Lt;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l={},i;for(i in n)l[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=l),l}function Ce(e){return e=e.childContextTypes,e!=null}function el(){K(je),K(he)}function Lo(e,t,n){if(he.current!==Lt)throw Error(j(168));W(he,t),W(je,n)}function wu(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var l in r)if(!(l in t))throw Error(j(108,nd(e)||"Unknown",l));return G({},n,r)}function tl(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Lt,Ht=he.current,W(he,e),W(je,je.current),!0}function zo(e,t,n){var r=e.stateNode;if(!r)throw Error(j(169));n?(e=wu(e,t,Ht),r.__reactInternalMemoizedMergedChildContext=e,K(je),K(he),W(he,e)):K(je),W(je,n)}var it=null,Sl=!1,Zl=!1;function xu(e){it===null?it=[e]:it.push(e)}function xf(e){Sl=!0,xu(e)}function Dt(){if(!Zl&&it!==null){Zl=!0;var e=0,t=H;try{var n=it;for(H=1;e>=s,l-=s,st=1<<32-Ye(t)+l|n<L?(I=_,_=null):I=_.sibling;var M=h(f,_,p[L],w);if(M===null){_===null&&(_=I);break}e&&_&&M.alternate===null&&t(f,_),c=i(M,c,L),C===null?y=M:C.sibling=M,C=M,_=I}if(L===p.length)return n(f,_),J&&$t(f,L),y;if(_===null){for(;LL?(I=_,_=null):I=_.sibling;var z=h(f,_,M.value,w);if(z===null){_===null&&(_=I);break}e&&_&&z.alternate===null&&t(f,_),c=i(z,c,L),C===null?y=z:C.sibling=z,C=z,_=I}if(M.done)return n(f,_),J&&$t(f,L),y;if(_===null){for(;!M.done;L++,M=p.next())M=m(f,M.value,w),M!==null&&(c=i(M,c,L),C===null?y=M:C.sibling=M,C=M);return J&&$t(f,L),y}for(_=r(f,_);!M.done;L++,M=p.next())M=k(_,f,L,M.value,w),M!==null&&(e&&M.alternate!==null&&_.delete(M.key===null?L:M.key),c=i(M,c,L),C===null?y=M:C.sibling=M,C=M);return e&&_.forEach(function(A){return t(f,A)}),J&&$t(f,L),y}function R(f,c,p,w){if(typeof p=="object"&&p!==null&&p.type===qt&&p.key===null&&(p=p.props.children),typeof p=="object"&&p!==null){switch(p.$$typeof){case gr:e:{for(var y=p.key,C=c;C!==null;){if(C.key===y){if(y=p.type,y===qt){if(C.tag===7){n(f,C.sibling),c=l(C,p.props.children),c.return=f,f=c;break e}}else if(C.elementType===y||typeof y=="object"&&y!==null&&y.$$typeof===mt&&Oo(y)===C.type){n(f,C.sibling),c=l(C,p.props),c.ref=zn(f,C,p),c.return=f,f=c;break e}n(f,C);break}else t(f,C);C=C.sibling}p.type===qt?(c=Vt(p.props.children,f.mode,w,p.key),c.return=f,f=c):(w=Wr(p.type,p.key,p.props,null,f.mode,w),w.ref=zn(f,c,p),w.return=f,f=w)}return s(f);case Zt:e:{for(C=p.key;c!==null;){if(c.key===C)if(c.tag===4&&c.stateNode.containerInfo===p.containerInfo&&c.stateNode.implementation===p.implementation){n(f,c.sibling),c=l(c,p.children||[]),c.return=f,f=c;break e}else{n(f,c);break}else t(f,c);c=c.sibling}c=ii(p,f.mode,w),c.return=f,f=c}return s(f);case mt:return C=p._init,R(f,c,C(p._payload),w)}if($n(p))return x(f,c,p,w);if(En(p))return S(f,c,p,w);Tr(f,p)}return typeof p=="string"&&p!==""||typeof p=="number"?(p=""+p,c!==null&&c.tag===6?(n(f,c.sibling),c=l(c,p),c.return=f,f=c):(n(f,c),c=li(p,f.mode,w),c.return=f,f=c),s(f)):n(f,c)}return R}var wn=ju(!0),Cu=ju(!1),ll=Rt(null),il=null,on=null,Cs=null;function Es(){Cs=on=il=null}function _s(e){var t=ll.current;K(ll),e._currentValue=t}function Ii(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function hn(e,t){il=e,Cs=on=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ne=!0),e.firstContext=null)}function Ae(e){var t=e._currentValue;if(Cs!==e)if(e={context:e,memoizedValue:t,next:null},on===null){if(il===null)throw Error(j(308));on=e,il.dependencies={lanes:0,firstContext:e}}else on=on.next=e;return t}var It=null;function Ts(e){It===null?It=[e]:It.push(e)}function Eu(e,t,n,r){var l=t.interleaved;return l===null?(n.next=n,Ts(t)):(n.next=l.next,l.next=n),t.interleaved=n,dt(e,r)}function dt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var vt=!1;function Ps(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _u(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function at(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ct(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,U&2){var l=r.pending;return l===null?t.next=t:(t.next=l.next,l.next=t),r.pending=t,dt(e,n)}return l=r.interleaved,l===null?(t.next=t,Ts(r)):(t.next=l.next,l.next=t),r.interleaved=t,dt(e,n)}function Ir(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hs(e,n)}}function $o(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var l=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?l=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?l=i=t:i=i.next=t}else l=i=t;n={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function sl(e,t,n,r){var l=e.updateQueue;vt=!1;var i=l.firstBaseUpdate,s=l.lastBaseUpdate,a=l.shared.pending;if(a!==null){l.shared.pending=null;var u=a,d=u.next;u.next=null,s===null?i=d:s.next=d,s=u;var v=e.alternate;v!==null&&(v=v.updateQueue,a=v.lastBaseUpdate,a!==s&&(a===null?v.firstBaseUpdate=d:a.next=d,v.lastBaseUpdate=u))}if(i!==null){var m=l.baseState;s=0,v=d=u=null,a=i;do{var h=a.lane,k=a.eventTime;if((r&h)===h){v!==null&&(v=v.next={eventTime:k,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var x=e,S=a;switch(h=t,k=n,S.tag){case 1:if(x=S.payload,typeof x=="function"){m=x.call(k,m,h);break e}m=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=S.payload,h=typeof x=="function"?x.call(k,m,h):x,h==null)break e;m=G({},m,h);break e;case 2:vt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=l.effects,h===null?l.effects=[a]:h.push(a))}else k={eventTime:k,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},v===null?(d=v=k,u=m):v=v.next=k,s|=h;if(a=a.next,a===null){if(a=l.shared.pending,a===null)break;h=a,a=h.next,h.next=null,l.lastBaseUpdate=h,l.shared.pending=null}}while(!0);if(v===null&&(u=m),l.baseState=u,l.firstBaseUpdate=d,l.lastBaseUpdate=v,t=l.shared.interleaved,t!==null){l=t;do s|=l.lane,l=l.next;while(l!==t)}else i===null&&(l.shared.lanes=0);Kt|=s,e.lanes=s,e.memoizedState=m}}function Mo(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=bl.transition;bl.transition={};try{e(!1),t()}finally{H=n,bl.transition=r}}function Wu(){return Be().memoizedState}function jf(e,t,n){var r=_t(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qu(e))Ku(t,n);else if(n=Eu(e,t,n,r),n!==null){var l=ge();Xe(n,e,r,l),Ju(n,t,r)}}function Cf(e,t,n){var r=_t(e),l={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qu(e))Ku(t,l);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(l.hasEagerState=!0,l.eagerState=a,Ge(a,s)){var u=t.interleaved;u===null?(l.next=l,Ts(t)):(l.next=u.next,u.next=l),t.interleaved=l;return}}catch{}finally{}n=Eu(e,t,l,r),n!==null&&(l=ge(),Xe(n,e,r,l),Ju(n,t,r))}}function Qu(e){var t=e.alternate;return e===X||t!==null&&t===X}function Ku(e,t){Wn=al=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ju(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,hs(e,n)}}var ul={readContext:Ae,useCallback:de,useContext:de,useEffect:de,useImperativeHandle:de,useInsertionEffect:de,useLayoutEffect:de,useMemo:de,useReducer:de,useRef:de,useState:de,useDebugValue:de,useDeferredValue:de,useTransition:de,useMutableSource:de,useSyncExternalStore:de,useId:de,unstable_isNewReconciler:!1},Ef={readContext:Ae,useCallback:function(e,t){return be().memoizedState=[e,t===void 0?null:t],e},useContext:Ae,useEffect:Io,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ar(4194308,4,Uu.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ar(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ar(4,2,e,t)},useMemo:function(e,t){var n=be();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=be();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=jf.bind(null,X,e),[r.memoizedState,e]},useRef:function(e){var t=be();return e={current:e},t.memoizedState=e},useState:Fo,useDebugValue:Fs,useDeferredValue:function(e){return be().memoizedState=e},useTransition:function(){var e=Fo(!1),t=e[0];return e=Nf.bind(null,e[1]),be().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=X,l=be();if(J){if(n===void 0)throw Error(j(407));n=n()}else{if(n=t(),re===null)throw Error(j(349));Qt&30||zu(r,t,n)}l.memoizedState=n;var i={value:n,getSnapshot:t};return l.queue=i,Io(Du.bind(null,r,i,e),[e]),r.flags|=2048,ur(9,Ru.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=be(),t=re.identifierPrefix;if(J){var n=ot,r=st;n=(r&~(1<<32-Ye(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=or++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[et]=t,e[lr]=r,rc(e,t,!1,!1),t.stateNode=e;e:{switch(s=xi(n,r),n){case"dialog":Q("cancel",e),Q("close",e),l=r;break;case"iframe":case"object":case"embed":Q("load",e),l=r;break;case"video":case"audio":for(l=0;lkn&&(t.flags|=128,r=!0,Rn(i,!1),t.lanes=4194304)}else{if(!r)if(e=ol(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Rn(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!J)return fe(t),null}else 2*q()-i.renderingStartTime>kn&&n!==1073741824&&(t.flags|=128,r=!0,Rn(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=q(),t.sibling=null,n=Y.current,W(Y,r?n&1|2:n&1),t):(fe(t),null);case 22:case 23:return Hs(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Te&1073741824&&(fe(t),t.subtreeFlags&6&&(t.flags|=8192)):fe(t),null;case 24:return null;case 25:return null}throw Error(j(156,t.tag))}function Of(e,t){switch(Ns(t),t.tag){case 1:return Ce(t.type)&&el(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return xn(),K(je),K(he),Rs(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return zs(t),null;case 13:if(K(Y),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(j(340));yn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return K(Y),null;case 4:return xn(),null;case 10:return _s(t.type._context),null;case 22:case 23:return Hs(),null;case 24:return null;default:return null}}var Lr=!1,pe=!1,$f=typeof WeakSet=="function"?WeakSet:Set,P=null;function an(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Z(e,t,r)}else n.current=null}function Ji(e,t,n){try{n()}catch(r){Z(e,t,r)}}var Xo=!1;function Mf(e,t){if(Li=Gr,e=cu(),Ss(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var l=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,u=-1,d=0,v=0,m=e,h=null;t:for(;;){for(var k;m!==n||l!==0&&m.nodeType!==3||(a=s+l),m!==i||r!==0&&m.nodeType!==3||(u=s+r),m.nodeType===3&&(s+=m.nodeValue.length),(k=m.firstChild)!==null;)h=m,m=k;for(;;){if(m===e)break t;if(h===n&&++d===l&&(a=s),h===i&&++v===r&&(u=s),(k=m.nextSibling)!==null)break;m=h,h=m.parentNode}m=k}n=a===-1||u===-1?null:{start:a,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(zi={focusedElem:e,selectionRange:n},Gr=!1,P=t;P!==null;)if(t=P,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,P=e;else for(;P!==null;){t=P;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var S=x.memoizedProps,R=x.memoizedState,f=t.stateNode,c=f.getSnapshotBeforeUpdate(t.elementType===t.type?S:Qe(t.type,S),R);f.__reactInternalSnapshotBeforeUpdate=c}break;case 3:var p=t.stateNode.containerInfo;p.nodeType===1?p.textContent="":p.nodeType===9&&p.documentElement&&p.removeChild(p.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(j(163))}}catch(w){Z(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,P=e;break}P=t.return}return x=Xo,Xo=!1,x}function Qn(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var l=r=r.next;do{if((l.tag&e)===e){var i=l.destroy;l.destroy=void 0,i!==void 0&&Ji(t,n,i)}l=l.next}while(l!==r)}}function jl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Yi(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function sc(e){var t=e.alternate;t!==null&&(e.alternate=null,sc(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[et],delete t[lr],delete t[Oi],delete t[yf],delete t[wf])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function oc(e){return e.tag===5||e.tag===3||e.tag===4}function Go(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||oc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=br));else if(r!==4&&(e=e.child,e!==null))for(Xi(e,t,n),e=e.sibling;e!==null;)Xi(e,t,n),e=e.sibling}function Gi(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Gi(e,t,n),e=e.sibling;e!==null;)Gi(e,t,n),e=e.sibling}var se=null,Ke=!1;function ht(e,t,n){for(n=n.child;n!==null;)ac(e,t,n),n=n.sibling}function ac(e,t,n){if(tt&&typeof tt.onCommitFiberUnmount=="function")try{tt.onCommitFiberUnmount(vl,n)}catch{}switch(n.tag){case 5:pe||an(n,t);case 6:var r=se,l=Ke;se=null,ht(e,t,n),se=r,Ke=l,se!==null&&(Ke?(e=se,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):se.removeChild(n.stateNode));break;case 18:se!==null&&(Ke?(e=se,n=n.stateNode,e.nodeType===8?Gl(e.parentNode,n):e.nodeType===1&&Gl(e,n),bn(e)):Gl(se,n.stateNode));break;case 4:r=se,l=Ke,se=n.stateNode.containerInfo,Ke=!0,ht(e,t,n),se=r,Ke=l;break;case 0:case 11:case 14:case 15:if(!pe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){l=r=r.next;do{var i=l,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Ji(n,t,s),l=l.next}while(l!==r)}ht(e,t,n);break;case 1:if(!pe&&(an(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){Z(n,t,a)}ht(e,t,n);break;case 21:ht(e,t,n);break;case 22:n.mode&1?(pe=(r=pe)||n.memoizedState!==null,ht(e,t,n),pe=r):ht(e,t,n);break;default:ht(e,t,n)}}function Zo(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new $f),t.forEach(function(r){var l=Qf.bind(null,e,r);n.has(r)||(n.add(r),r.then(l,l))})}}function We(e,t){var n=t.deletions;if(n!==null)for(var r=0;rl&&(l=s),r&=~i}if(r=l,r=q()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*If(r/1960))-r,10e?16:e,xt===null)var r=!1;else{if(e=xt,xt=null,fl=0,U&6)throw Error(j(331));var l=U;for(U|=4,P=e.current;P!==null;){var i=P,s=i.child;if(P.flags&16){var a=i.deletions;if(a!==null){for(var u=0;uq()-Bs?Bt(e,0):As|=n),Ee(e,t)}function vc(e,t){t===0&&(e.mode&1?(t=Sr,Sr<<=1,!(Sr&130023424)&&(Sr=4194304)):t=1);var n=ge();e=dt(e,t),e!==null&&(fr(e,t,n),Ee(e,n))}function Wf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),vc(e,n)}function Qf(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;l!==null&&(n=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(j(314))}r!==null&&r.delete(t),vc(e,n)}var gc;gc=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||je.current)Ne=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ne=!1,Rf(e,t,n);Ne=!!(e.flags&131072)}else Ne=!1,J&&t.flags&1048576&&Su(t,rl,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Br(e,t),e=t.pendingProps;var l=gn(t,he.current);hn(t,n),l=Os(null,t,r,e,l,n);var i=$s();return t.flags|=1,typeof l=="object"&&l!==null&&typeof l.render=="function"&&l.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ce(r)?(i=!0,tl(t)):i=!1,t.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,Ps(t),l.updater=Nl,t.stateNode=l,l._reactInternals=t,Ai(t,r,e,n),t=Hi(null,t,r,!0,i,n)):(t.tag=0,J&&i&&ks(t),ve(null,t,l,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Br(e,t),e=t.pendingProps,l=r._init,r=l(r._payload),t.type=r,l=t.tag=Jf(r),e=Qe(r,e),l){case 0:t=Vi(null,t,r,e,n);break e;case 1:t=Ko(null,t,r,e,n);break e;case 11:t=Wo(null,t,r,e,n);break e;case 14:t=Qo(null,t,r,Qe(r.type,e),n);break e}throw Error(j(306,r,""))}return t;case 0:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Qe(r,l),Vi(e,t,r,l,n);case 1:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Qe(r,l),Ko(e,t,r,l,n);case 3:e:{if(ec(t),e===null)throw Error(j(387));r=t.pendingProps,i=t.memoizedState,l=i.element,_u(e,t),sl(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){l=Sn(Error(j(423)),t),t=Jo(e,t,r,n,l);break e}else if(r!==l){l=Sn(Error(j(424)),t),t=Jo(e,t,r,n,l);break e}else for(Pe=jt(t.stateNode.containerInfo.firstChild),Le=t,J=!0,Je=null,n=Cu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(yn(),r===l){t=ft(e,t,n);break e}ve(e,t,r,n)}t=t.child}return t;case 5:return Tu(t),e===null&&Fi(t),r=t.type,l=t.pendingProps,i=e!==null?e.memoizedProps:null,s=l.children,Ri(r,l)?s=null:i!==null&&Ri(r,i)&&(t.flags|=32),bu(e,t),ve(e,t,s,n),t.child;case 6:return e===null&&Fi(t),null;case 13:return tc(e,t,n);case 4:return Ls(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=wn(t,null,r,n):ve(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Qe(r,l),Wo(e,t,r,l,n);case 7:return ve(e,t,t.pendingProps,n),t.child;case 8:return ve(e,t,t.pendingProps.children,n),t.child;case 12:return ve(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,i=t.memoizedProps,s=l.value,W(ll,r._currentValue),r._currentValue=s,i!==null)if(Ge(i.value,s)){if(i.children===l.children&&!je.current){t=ft(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var u=a.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=at(-1,n&-n),u.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var v=d.pending;v===null?u.next=u:(u.next=v.next,v.next=u),d.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Ii(i.return,n,t),a.lanes|=n;break}u=u.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(j(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ii(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}ve(e,t,l.children,n),t=t.child}return t;case 9:return l=t.type,r=t.pendingProps.children,hn(t,n),l=Ae(l),r=r(l),t.flags|=1,ve(e,t,r,n),t.child;case 14:return r=t.type,l=Qe(r,t.pendingProps),l=Qe(r.type,l),Qo(e,t,r,l,n);case 15:return Zu(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,l=t.pendingProps,l=t.elementType===r?l:Qe(r,l),Br(e,t),t.tag=1,Ce(r)?(e=!0,tl(t)):e=!1,hn(t,n),Yu(t,r,l),Ai(t,r,l,n),Hi(null,t,r,!0,e,n);case 19:return nc(e,t,n);case 22:return qu(e,t,n)}throw Error(j(156,t.tag))};function yc(e,t){return Qa(e,t)}function Kf(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ie(e,t,n,r){return new Kf(e,t,n,r)}function Qs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Jf(e){if(typeof e=="function")return Qs(e)?1:0;if(e!=null){if(e=e.$$typeof,e===cs)return 11;if(e===ds)return 14}return 2}function Tt(e,t){var n=e.alternate;return n===null?(n=Ie(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Wr(e,t,n,r,l,i){var s=2;if(r=e,typeof e=="function")Qs(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case qt:return Vt(n.children,l,i,t);case us:s=8,l|=8;break;case ci:return e=Ie(12,n,t,l|2),e.elementType=ci,e.lanes=i,e;case di:return e=Ie(13,n,t,l),e.elementType=di,e.lanes=i,e;case fi:return e=Ie(19,n,t,l),e.elementType=fi,e.lanes=i,e;case Ta:return El(n,l,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ea:s=10;break e;case _a:s=9;break e;case cs:s=11;break e;case ds:s=14;break e;case mt:s=16,r=null;break e}throw Error(j(130,e==null?e:typeof e,""))}return t=Ie(s,n,t,l),t.elementType=e,t.type=r,t.lanes=i,t}function Vt(e,t,n,r){return e=Ie(7,e,r,t),e.lanes=n,e}function El(e,t,n,r){return e=Ie(22,e,r,t),e.elementType=Ta,e.lanes=n,e.stateNode={isHidden:!1},e}function li(e,t,n){return e=Ie(6,e,null,t),e.lanes=n,e}function ii(e,t,n){return t=Ie(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Yf(e,t,n,r,l){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Ul(0),this.expirationTimes=Ul(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ul(0),this.identifierPrefix=r,this.onRecoverableError=l,this.mutableSourceEagerHydrationData=null}function Ks(e,t,n,r,l,i,s,a,u){return e=new Yf(e,t,n,a,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Ie(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ps(i),e}function Xf(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kc)}catch(e){console.error(e)}}kc(),ka.exports=Re;var ep=ka.exports,Nc,ia=ep;Nc=ia.createRoot,ia.hydrateRoot;async function xe(e){const t=await fetch(e);if(!t.ok)throw new Error(`${t.status} ${t.statusText}`);return t.json()}async function tp(){return xe("/api/archives")}async function np(e){return xe(`/api/archives/${e}/entries`)}async function rp(e,t,n){const r=new URLSearchParams;return t&&r.set("q",t),n&&r.set("tag",n),xe(`/api/archives/${e}/entries/search?${r}`)}async function lp(e,t){return xe(`/api/archives/${e}/entries/${t}`)}async function ip(e,t,n){const r=await fetch(`/api/archives/${e}/entries/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:n??null})});if(!r.ok)throw new Error(await r.text())}async function si(e,t){return xe(`/api/archives/${e}/entries/${t}/tags`)}async function sp(e,t,n){const r=await fetch(`/api/archives/${e}/entries/${t}/tags`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tag_path:n})});if(!r.ok)throw new Error(`Failed to add tag (${r.status})`)}async function op(e,t,n){const r=await fetch(`/api/archives/${e}/entries/${t}/tags/${n}`,{method:"DELETE"});if(!r.ok)throw new Error(`Remove failed (${r.status})`)}async function ap(e,t,n){const r=await fetch(`/api/archives/${e}/tags/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:n})});if(!r.ok)throw new Error(await r.text());return r.json()}async function up(e,t){const n=await fetch(`/api/archives/${e}/tags/${t}`,{method:"DELETE"});if(!n.ok)throw new Error(await n.text())}async function sa(e){return xe(`/api/archives/${e}/runs`)}async function oi(e){return xe(`/api/archives/${e}/tags`)}async function cp(e,t){const n=await fetch(`/api/archives/${e}/captures`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locator:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||`HTTP ${n.status}`)}return n.json()}async function oa(e,t){return xe(`/api/archives/${e}/capture_jobs/${t}`)}async function dp(){return(await(await fetch("/api/auth/setup")).json()).setup_required===!0}async function fp(e,t){const n=await fetch("/api/auth/setup",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:e,password:t})});if(!n.ok)throw new Error((await n.json()).error||"Setup failed");return n.json()}async function pp(e,t){const n=await fetch("/api/auth/login",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:e,password:t})});if(!n.ok)throw new Error((await n.json()).error||"Login failed");return n.json()}async function hp(){await fetch("/api/auth/logout",{method:"POST"})}async function mp(){const e=await fetch("/api/auth/me");return e.status===401?null:e.json()}async function vp(e){const t=await fetch("/api/auth/me",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({display_name:e})});if(!t.ok)throw new Error(await t.text())}async function gp(e){const t=await fetch("/api/auth/me",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await t.text())}async function yp(e,t){const n=await fetch("/api/auth/me",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({current_password:e,new_password:t})});if(!n.ok){let r=await n.text();try{r=JSON.parse(r).error??r}catch{}throw new Error(r)}}async function wp(){return xe("/api/auth/tokens")}async function xp(e){const t=await fetch("/api/auth/tokens",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});if(!t.ok)throw new Error(await t.text());return t.json()}async function Sp(e){const t=await fetch(`/api/auth/tokens/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(await t.text())}async function kp(){return xe("/api/admin/instance-settings")}async function Np(e){const t=await fetch("/api/admin/instance-settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(await t.text())}async function jp(){return xe("/api/admin/users")}async function Cp(e,t,n){const r=await fetch("/api/admin/users",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:t,email:n||void 0})});if(!r.ok){const l=await r.json().catch(()=>({}));throw new Error(l.error||`HTTP ${r.status}`)}return r.json()}async function Ep(e,t){const n=await fetch(`/api/admin/users/${e}/status`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({status:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||`HTTP ${n.status}`)}return n.json()}async function _p(){return xe("/api/admin/roles")}async function Tp(e,t){const n=await fetch("/api/admin/roles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({slug:e,name:t})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error||`HTTP ${n.status}`)}return n.json()}async function Pp(e){return xe(`/api/archives/${e}/collections`)}async function Lp(e,t,n,r=2){const l=await fetch(`/api/archives/${e}/collections`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:t,slug:n,default_visibility_bits:r})});if(!l.ok){const i=await l.json().catch(()=>({error:l.statusText}));throw new Error(i.error||l.statusText)}return l.json()}async function zp(e,t){return xe(`/api/archives/${e}/collections/${t}`)}async function Rp(e,t,n,r=2){const l=await fetch(`/api/archives/${e}/collections/${t}/entries`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({entry_uid:n,visibility_bits:r})});if(!l.ok){const i=await l.json().catch(()=>({error:l.statusText}));throw new Error(i.error||l.statusText)}}async function Dp(e,t,n){const r=await fetch(`/api/archives/${e}/collections/${t}/entries/${n}`,{method:"DELETE"});if(!r.ok){const l=await r.json().catch(()=>({error:r.statusText}));throw new Error(l.error||r.statusText)}}async function Op(e,t,n,r){const l=await fetch(`/api/archives/${e}/collections/${t}/entries/${n}`,{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({visibility_bits:r})});if(!l.ok){const i=await l.json().catch(()=>({error:l.statusText}));throw new Error(i.error||l.statusText)}}async function $p(e,t){return xe(`/api/archives/${e}/entries/${t}/collections`)}async function aa(e,t,n){const r=await fetch(`/api/archives/${e}/collections/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const l=await r.json().catch(()=>({}));throw new Error(l.error??r.statusText)}}async function Mp(e,t){const n=await fetch(`/api/archives/${e}/collections/${t}`,{method:"DELETE"});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error??n.statusText)}}const Fp=window.fetch;window.fetch=async(...e)=>{var n;const t=await Fp(...e);return t.status===401&&((typeof e[0]=="string"?e[0]:((n=e[0])==null?void 0:n.url)??"").includes("/api/auth/")||window.dispatchEvent(new CustomEvent("auth:expired"))),t};function Ip({onLogin:e}){const[t,n]=g.useState(""),[r,l]=g.useState(""),[i,s]=g.useState(null),[a,u]=g.useState(!1);async function d(v){v.preventDefault(),s(null),u(!0);try{const m=await pp(t,r);e(m)}catch(m){s(m.message)}finally{u(!1)}}return o.jsx("div",{className:"login-page",children:o.jsxs("div",{className:"login-card",children:[o.jsx("h1",{className:"login-brand",children:"Archivr"}),o.jsx("p",{className:"login-tagline",children:"Sign in to your archive"}),o.jsxs("form",{onSubmit:d,children:[o.jsxs("div",{className:"login-field",children:[o.jsx("label",{className:"login-label",htmlFor:"login-username",children:"Username"}),o.jsx("input",{className:"login-input",id:"login-username",type:"text",value:t,onChange:v=>n(v.target.value),autoFocus:!0,required:!0,autoComplete:"username"})]}),o.jsxs("div",{className:"login-field",children:[o.jsx("label",{className:"login-label",htmlFor:"login-password",children:"Password"}),o.jsx("input",{className:"login-input",id:"login-password",type:"password",value:r,onChange:v=>l(v.target.value),required:!0,autoComplete:"current-password"})]}),i&&o.jsx("p",{className:"login-error",children:i}),o.jsx("button",{className:"login-submit",type:"submit",disabled:a,children:a?"Signing in…":"Sign in"})]})]})})}function Up({onComplete:e}){const[t,n]=g.useState(""),[r,l]=g.useState(""),[i,s]=g.useState(""),[a,u]=g.useState(null),[d,v]=g.useState(!1);async function m(h){if(h.preventDefault(),r!==i){u("Passwords do not match");return}if(r.length<8){u("Password must be at least 8 characters");return}u(null),v(!0);try{await fp(t,r),e()}catch(k){u(k.message)}finally{v(!1)}}return o.jsx("div",{className:"setup-page",children:o.jsxs("div",{className:"setup-card",children:[o.jsx("h1",{className:"setup-brand",children:"Archivr"}),o.jsx("p",{className:"setup-tagline",children:"Create your owner account to get started."}),o.jsxs("form",{onSubmit:m,children:[o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"setup-username",children:"Username"}),o.jsx("input",{className:"setup-input",id:"setup-username",type:"text",value:t,onChange:h=>n(h.target.value),autoFocus:!0,required:!0,autoComplete:"username"})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"setup-password",children:"Password"}),o.jsx("input",{className:"setup-input",id:"setup-password",type:"password",value:r,onChange:h=>l(h.target.value),required:!0,autoComplete:"new-password"})]}),o.jsxs("div",{className:"setup-field",children:[o.jsx("label",{className:"setup-label",htmlFor:"setup-confirm",children:"Confirm password"}),o.jsx("input",{className:"setup-input",id:"setup-confirm",type:"password",value:i,onChange:h=>s(h.target.value),required:!0,autoComplete:"new-password"})]}),a&&o.jsx("p",{className:"setup-error",children:a}),o.jsx("button",{className:"setup-submit",type:"submit",disabled:d,children:d?"Creating account…":"Create account"})]})]})})}function Ap({archives:e,archiveId:t,onArchiveChange:n,view:r,onViewChange:l,onCaptureClick:i}){const{currentUser:s,setCurrentUser:a}=g.useContext(zl)??{},[u,d]=g.useState(!1);async function v(){d(!0),await hp(),a(null),window.location.reload()}return o.jsxs("header",{className:"topbar",children:[o.jsx("div",{className:"brand",children:"Archivr"}),o.jsx("div",{className:"switcher",children:o.jsx("select",{"aria-label":"Select archive",value:t??"",onChange:m=>n(m.target.value),children:e.map(m=>o.jsx("option",{value:m.id,children:m.label},m.id))})}),o.jsx("nav",{className:"nav","aria-label":"Primary",children:["archive","tags","collections","runs","admin","settings"].map(m=>o.jsx("button",{className:`nav-link${r===m?" is-active":""}`,onClick:()=>l(m),children:m.charAt(0).toUpperCase()+m.slice(1)},m))}),o.jsx("button",{className:"capture-button",onClick:i,children:"Capture"}),s&&o.jsxs("div",{className:"user-menu",children:[o.jsx("span",{className:"user-name",children:s.display_name||s.username}),o.jsx("button",{className:"logout-btn",onClick:v,disabled:u,children:u?"Logging out…":"Log out"})]})]})}function Bp({open:e,archiveId:t,onClose:n,onCaptured:r}){const l=g.useRef(null),i=g.useRef(!0),s=g.useRef(!1),[a,u]=g.useState(()=>sessionStorage.getItem("captureDialogLocator")||""),[d,v]=g.useState(()=>sessionStorage.getItem("captureDialogError")||null),[m,h]=g.useState(()=>sessionStorage.getItem("captureDialogBusy")==="true"),[k,x]=g.useState(()=>sessionStorage.getItem("captureDialogJobStatus")||null),[S,R]=g.useState(()=>sessionStorage.getItem("captureDialogJobUid")||null),f=g.useRef(null);g.useEffect(()=>{sessionStorage.setItem("captureDialogLocator",a)},[a]),g.useEffect(()=>{sessionStorage.setItem("captureDialogError",d||"")},[d]),g.useEffect(()=>{sessionStorage.setItem("captureDialogBusy",m)},[m]),g.useEffect(()=>{sessionStorage.setItem("captureDialogJobStatus",k||"")},[k]),g.useEffect(()=>{sessionStorage.setItem("captureDialogJobUid",S||"")},[S]),g.useEffect(()=>{s.current||!S||k!=="running"||!t||(s.current=!0,f.current=setInterval(async()=>{var y;try{const C=await oa(t,S);C.status==="completed"?(clearInterval(f.current),f.current=null,h(!1),x("completed"),c(),(y=l.current)==null||y.close(),r()):C.status==="failed"&&(clearInterval(f.current),f.current=null,h(!1),x("failed"),v(C.error_text||"Capture failed."))}catch(C){clearInterval(f.current),f.current=null,h(!1),v(C.message)}},500))},[S,k,t,r]),g.useEffect(()=>{const y=l.current;if(!y)return;const C=()=>{clearInterval(f.current),n()};return y.addEventListener("close",C),()=>y.removeEventListener("close",C)},[n]),g.useEffect(()=>{const y=l.current;y&&(e?(i.current||(u(""),v(null),x(null),h(!1),R(null),clearInterval(f.current)),i.current=!1,y.open||y.showModal()):y.open&&y.close())},[e]);function c(){sessionStorage.removeItem("captureDialogLocator"),sessionStorage.removeItem("captureDialogError"),sessionStorage.removeItem("captureDialogBusy"),sessionStorage.removeItem("captureDialogJobStatus"),sessionStorage.removeItem("captureDialogJobUid"),u(""),v(null),h(!1),x(null),R(null)}async function p(){if(!a.trim()){v("Enter a locator.");return}h(!0),v(null),x(null);try{const y=await cp(t,a.trim());R(y.job_uid),x("running"),f.current=setInterval(async()=>{var C;try{const _=await oa(t,y.job_uid);_.status==="completed"?(clearInterval(f.current),f.current=null,h(!1),x("completed"),c(),(C=l.current)==null||C.close(),r()):_.status==="failed"&&(clearInterval(f.current),f.current=null,h(!1),x("failed"),v(_.error_text||"Capture failed."))}catch(_){clearInterval(f.current),f.current=null,h(!1),v(_.message)}},500)}catch(y){v(y.message),h(!1)}}function w(){return m?k==="running"?"Running…":"Capturing…":"Capture"}return o.jsx("dialog",{ref:l,className:"capture-dialog",children:o.jsxs("div",{className:"capture-dialog-inner",children:[o.jsx("h2",{className:"capture-dialog-title",children:"Capture"}),o.jsx("label",{htmlFor:"capture-locator",className:"capture-label",children:"Locator"}),o.jsx("input",{id:"capture-locator",className:"capture-input",type:"text",placeholder:"tweet:1234567890 or https://...",value:a,onChange:y=>u(y.target.value),onKeyDown:y=>{y.key==="Enter"&&p()},autoComplete:"off"}),d&&o.jsx("div",{className:"capture-error",children:d}),o.jsxs("div",{className:"capture-actions",children:[o.jsx("button",{type:"button",className:"capture-cancel",onClick:()=>{var y;return(y=l.current)==null?void 0:y.close()},children:"Cancel"}),o.jsx("button",{type:"button",className:"capture-submit",onClick:p,disabled:m,children:w()})]})]})})}function ts(e){if(!e)return"0 B";const t=["B","KB","MB","GB"];let n=e,r=0;for(;n>=1024&&r").replace(/"/g,'"').replace(/'/g,"'").replace(/'/g,"'")}function At(e){return Vp(e)??""}function jc(e){if(!e)return"";const t=new Date(e);if(isNaN(t))return e;const n=r=>String(r).padStart(2,"0");return`${t.getUTCFullYear()}-${n(t.getUTCMonth()+1)}-${n(t.getUTCDate())} ${n(t.getUTCHours())}:${n(t.getUTCMinutes())}`}const ua={youtube:'',x:'',instagram:'',facebook:'',tiktok:'',reddit:'',snapchat:'',local:'',web:'',other:'?'};function Cc(e){return ua[e]??ua.other}function Ec(e){return e.split("/").map(t=>t?t.split("-").map(n=>n.charAt(0).toUpperCase()+n.slice(1)).join(" "):"").join("/")}function Hp({entry:e,archiveId:t,isSelected:n,onSelect:r}){const[l,i]=g.useState(!1),a=e.source_kind==="web"&&e.entity_kind==="page"&&e.has_favicon&&t&&!l?o.jsx("img",{src:`/api/archives/${t}/entries/${e.entry_uid}/favicon`,width:"16",height:"16",alt:"",onError:()=>i(!0),style:{objectFit:"contain"}}):o.jsx("span",{dangerouslySetInnerHTML:{__html:Cc(e.source_kind)}});return o.jsxs("div",{className:n?"is-selected":void 0,tabIndex:0,"data-entry-uid":e.entry_uid,onClick:r,onKeyDown:u=>{u.key==="Enter"&&r()},children:[o.jsx("div",{className:"col-added",children:jc(e.archived_at)}),o.jsxs("div",{className:"col-title",children:[o.jsx("span",{className:"source-icon",children:a}),o.jsx("span",{className:"entry-title",children:At(e.title)||At(e.entry_uid)})]}),o.jsx("div",{className:"col-type",children:o.jsx("span",{className:"type-pill",children:At(e.entity_kind)})}),o.jsxs("div",{className:"col-size",children:[o.jsx("span",{className:"size-total",children:ts(e.total_artifact_bytes)}),e.cached_bytes>0&&e.total_artifact_bytes>0&&o.jsxs("span",{className:"size-cached-pct",title:`${ts(e.cached_bytes)} already on disk from an earlier entry`,children:[Math.round(e.cached_bytes/e.total_artifact_bytes*100),"% cached"]})]}),o.jsx("div",{className:"url-cell col-url",children:At(e.original_url)})]})}function Wp({entries:e,selectedEntryUid:t,onSelectEntry:n,archiveId:r}){return o.jsx("section",{id:"archive-view",className:"view is-active",children:o.jsxs("div",{className:"entry-table",children:[o.jsxs("div",{className:"entry-header-row",children:[o.jsx("div",{className:"col-added",children:"Added"}),o.jsx("div",{className:"col-title",children:"Title"}),o.jsx("div",{className:"col-type",children:"Type"}),o.jsx("div",{className:"col-size",children:"Size"}),o.jsx("div",{className:"col-url",children:"Original URL"})]}),o.jsx("div",{id:"entries-body",children:e.map(l=>o.jsx(Hp,{entry:l,archiveId:r,isSelected:l.entry_uid===t,onSelect:()=>n(l)},l.entry_uid))})]})})}function Qp(e){if(!e)return"—";try{return new Date(e).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}catch{return e}}function Kp({status:e}){const t=e==="completed"?"run-status--completed":e==="failed"?"run-status--failed":e==="running"?"run-status--running":"";return o.jsx("span",{className:`run-status ${t}`,children:e||"—"})}function Jp({runs:e}){return o.jsx("section",{id:"runs-view",className:"view is-active",children:o.jsxs("table",{className:"entry-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Started"}),o.jsx("th",{children:"Status"}),o.jsx("th",{children:"Requested"}),o.jsx("th",{children:"Completed"}),o.jsx("th",{children:"Failed"})]})}),o.jsx("tbody",{children:e.length===0?o.jsx("tr",{children:o.jsx("td",{colSpan:5,style:{color:"var(--muted)",padding:"24px 16px",textAlign:"center"},children:"No runs yet."})}):e.map((t,n)=>o.jsxs("tr",{children:[o.jsx("td",{children:Qp(t.started_at)}),o.jsx("td",{children:o.jsx(Kp,{status:t.status})}),o.jsx("td",{children:t.requested_count??"—"}),o.jsx("td",{children:t.completed_count??"—"}),o.jsx("td",{children:t.failed_count??"—"})]},n))})]})})}const Yp=4;function Xp({archives:e}){const{currentUser:t}=g.useContext(zl)??{},n=t&&(t.role_bits&Yp)!==0,[r,l]=g.useState("users"),[i,s]=g.useState([]),[a,u]=g.useState([]),[d,v]=g.useState(!1),[m,h]=g.useState(null),[k,x]=g.useState(""),[S,R]=g.useState(""),[f,c]=g.useState(""),[p,w]=g.useState(null),[y,C]=g.useState(!1),[_,L]=g.useState(""),[I,M]=g.useState(""),[z,A]=g.useState(null),[le,Se]=g.useState(!1),Oe=g.useCallback(async()=>{if(n){v(!0),h(null);try{const[N,D]=await Promise.all([jp(),_p()]);s(N),u(D)}catch(N){h(N.message)}finally{v(!1)}}},[n]);g.useEffect(()=>{Oe()},[Oe]);async function $e(N){const D=N.status==="active"?"disabled":"active";try{await Ep(N.user_uid,D),s(B=>B.map(O=>O.user_uid===N.user_uid?{...O,status:D}:O))}catch(B){h(B.message)}}async function me(N){if(N.preventDefault(),!k.trim()||!S){w("Username and password required");return}C(!0),w(null);try{await Cp(k.trim(),S,f.trim()||void 0),x(""),R(""),c(""),await Oe()}catch(D){w(D.message)}finally{C(!1)}}async function T(N){if(N.preventDefault(),!_.trim()||!I.trim()){A("Slug and name required");return}Se(!0),A(null);try{await Tp(_.trim(),I.trim()),L(""),M(""),await Oe()}catch(D){A(D.message)}finally{Se(!1)}}return n?o.jsxs("section",{id:"admin-view",className:"view admin-view is-active",children:[o.jsx("h1",{children:"Admin"}),o.jsxs("div",{className:"view-tabs",children:[o.jsx("button",{className:`view-tab${r==="users"?" is-active":""}`,onClick:()=>l("users"),children:"Users"}),o.jsx("button",{className:`view-tab${r==="roles"?" is-active":""}`,onClick:()=>l("roles"),children:"Roles"}),o.jsx("button",{className:`view-tab${r==="archives"?" is-active":""}`,onClick:()=>l("archives"),children:"Archives"})]}),m&&o.jsx("div",{className:"form-msg form-msg--err",children:m}),r==="users"&&o.jsxs("div",{className:"admin-section",children:[o.jsx("h2",{children:"Users"}),d?o.jsx("p",{className:"muted",children:"Loading…"}):o.jsxs("table",{className:"admin-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Username"}),o.jsx("th",{children:"Email"}),o.jsx("th",{children:"Roles"}),o.jsx("th",{children:"Status"}),o.jsx("th",{children:"Actions"})]})}),o.jsx("tbody",{children:i.map(N=>o.jsxs("tr",{className:N.status==="disabled"?"admin-row-disabled":"",children:[o.jsx("td",{children:N.username}),o.jsx("td",{className:"muted",children:N.email||"—"}),o.jsx("td",{children:N.role_slugs.join(", ")||"—"}),o.jsx("td",{children:o.jsx("span",{className:`status-badge status-${N.status}`,children:N.status})}),o.jsx("td",{children:o.jsx("button",{className:"admin-action-btn",onClick:()=>$e(N),children:N.status==="active"?"Ban":"Unban"})})]},N.user_uid))})]}),o.jsx("h3",{children:"Create User"}),o.jsxs("form",{className:"admin-form",onSubmit:me,children:[o.jsx("input",{className:"admin-input",placeholder:"Username",value:k,onChange:N=>x(N.target.value),required:!0}),o.jsx("input",{className:"admin-input",type:"password",placeholder:"Password (min 8 chars)",value:S,onChange:N=>R(N.target.value),required:!0}),o.jsx("input",{className:"admin-input",type:"email",placeholder:"Email (optional)",value:f,onChange:N=>c(N.target.value)}),p&&o.jsx("div",{className:"form-msg form-msg--err",children:p}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:y,children:y?"Creating…":"Create User"})]})]}),r==="roles"&&o.jsxs("div",{className:"admin-section",children:[o.jsx("h2",{children:"Roles"}),d?o.jsx("p",{className:"muted",children:"Loading…"}):o.jsxs("table",{className:"admin-table",children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Slug"}),o.jsx("th",{children:"Name"}),o.jsx("th",{children:"Level"}),o.jsx("th",{children:"Bit"}),o.jsx("th",{children:"Built-in"})]})}),o.jsx("tbody",{children:a.map(N=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx("code",{children:N.slug})}),o.jsx("td",{children:N.name}),o.jsx("td",{children:N.level}),o.jsx("td",{children:N.bit_position}),o.jsx("td",{children:N.is_builtin?"✓":""})]},N.role_uid))})]}),o.jsx("h3",{children:"Create Custom Role"}),o.jsxs("form",{className:"admin-form",onSubmit:T,children:[o.jsx("input",{className:"admin-input",placeholder:"Slug (e.g. moderator)",value:_,onChange:N=>L(N.target.value),required:!0}),o.jsx("input",{className:"admin-input",placeholder:"Display Name (e.g. Moderator)",value:I,onChange:N=>M(N.target.value),required:!0}),z&&o.jsx("div",{className:"form-msg form-msg--err",children:z}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:le,children:le?"Creating…":"Create Role"})]})]}),r==="archives"&&o.jsxs("div",{className:"admin-section",children:[o.jsx("h2",{children:"Mounted Archives"}),o.jsx("div",{className:"admin-list",children:e.map(N=>o.jsxs("div",{className:"admin-archive",children:[o.jsx("strong",{children:N.label}),o.jsx("div",{className:"muted",children:N.archive_path})]},N.id))})]})]}):o.jsxs("section",{id:"admin-view",className:"view admin-view is-active",children:[o.jsx("h1",{children:"Admin"}),o.jsx("p",{className:"muted",children:"You need admin privileges to access this panel."}),o.jsx("h2",{children:"Mounted Archives"}),o.jsx("div",{className:"admin-list",children:e.map(N=>o.jsxs("div",{className:"admin-archive",children:[o.jsx("strong",{children:N.label}),o.jsx("div",{className:"muted",children:N.archive_path})]},N.id))})]})}function _c({node:e,archiveId:t,tagFilter:n,onTagFilterSet:r,onViewChange:l,onTagRenamed:i,onTagDeleted:s,onTagsRefresh:a,humanizeTags:u}){var w;const d=n===e.tag.full_path,[v,m]=g.useState(!1),[h,k]=g.useState(""),x=g.useRef(!1);function S(){if(v)return;const y=d?null:e.tag.full_path;r(y),l("archive")}function R(y){y.stopPropagation(),k(e.tag.slug),m(!0)}async function f(){const y=h.trim();if(!y||y===e.tag.slug){m(!1);return}try{const C=await ap(t,e.tag.tag_uid,y);i(e.tag.full_path,C.full_path),a()}catch{}finally{m(!1)}}async function c(y){var _;y.stopPropagation();const C=((_=e.children)==null?void 0:_.length)>0?`Delete tag "${e.tag.full_path}" and all its child tags? This cannot be undone.`:`Delete tag "${e.tag.full_path}"? This cannot be undone.`;if(window.confirm(C))try{await up(t,e.tag.tag_uid),s(e.tag.full_path),a()}catch{}}const p={archiveId:t,tagFilter:n,onTagFilterSet:r,onViewChange:l,onTagRenamed:i,onTagDeleted:s,onTagsRefresh:a,humanizeTags:u};return o.jsxs("li",{children:[o.jsxs("div",{className:"tag-node-row",children:[v?o.jsx("input",{className:"tag-rename-input",autoFocus:!0,value:h,onChange:y=>k(y.target.value),onKeyDown:y=>{y.key==="Enter"&&y.currentTarget.blur(),y.key==="Escape"&&(x.current=!0,y.currentTarget.blur())},onBlur:()=>{x.current?(x.current=!1,m(!1)):f()}}):o.jsxs("button",{className:`tag-node-btn${d?" is-active":""}`,title:e.tag.full_path,onClick:S,onDoubleClick:R,children:[u?e.tag.name:e.tag.slug,o.jsx("svg",{className:"edit-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",onClick:y=>{y.stopPropagation(),R(y)},children:o.jsx("path",{d:"M11.5 2.5a1.5 1.5 0 0 1 2 2L5 13l-3 1 1-3 8.5-8.5z"})})]}),o.jsx("button",{className:"remove tag-node-delete",title:`Delete tag ${e.tag.full_path}`,onClick:c,"aria-label":`Delete tag ${e.tag.full_path}`,children:"×"})]}),((w=e.children)==null?void 0:w.length)>0&&o.jsx("div",{className:"tag-children",children:o.jsx("ul",{className:"tag-tree-list",children:e.children.map(y=>o.jsx(_c,{node:y,...p},y.tag.tag_uid))})})]})}function Gp({archiveId:e,tagNodes:t,tagFilter:n,onTagFilterSet:r,onViewChange:l,onTagRenamed:i,onTagDeleted:s,onTagsRefresh:a,humanizeTags:u}){return o.jsx("section",{id:"tags-view",className:"view is-active",children:o.jsxs("div",{className:"tag-tree",children:[o.jsxs("div",{className:"tag-tree-header",children:[o.jsx("span",{className:"tag-tree-title",children:"Tags"}),n&&o.jsxs("span",{className:"tag-tree-active",children:["Filtering: ",n]})]}),t.length===0?o.jsx("p",{className:"muted",style:{padding:"8px 0"},children:"No tags yet."}):o.jsx("ul",{className:"tag-tree-list",children:t.map(d=>o.jsx(_c,{node:d,archiveId:e,tagFilter:n,onTagFilterSet:r,onViewChange:l,onTagRenamed:i,onTagDeleted:s,onTagsRefresh:a,humanizeTags:u},d.tag.tag_uid))})]})})}const In=[{value:0,label:"Private"},{value:2,label:"Users only"},{value:3,label:"Public"}],Zp=e=>{var t;return((t=In.find(n=>n.value===e))==null?void 0:t.label)??String(e)};function qp({archiveId:e}){const[t,n]=g.useState([]),[r,l]=g.useState(!1),[i,s]=g.useState(null),[a,u]=g.useState(null),[d,v]=g.useState(null),[m,h]=g.useState(!1),[k,x]=g.useState(null),[S,R]=g.useState(""),[f,c]=g.useState(""),[p,w]=g.useState(2),[y,C]=g.useState(!1),[_,L]=g.useState(null),[I,M]=g.useState(""),[z,A]=g.useState(2),[le,Se]=g.useState(!1),[Oe,$e]=g.useState(null),[me,T]=g.useState(!1),[N,D]=g.useState(""),B=g.useRef(null),O=t.find(E=>E.collection_uid===a)??null,ue=(O==null?void 0:O.slug)==="_default_",ce=g.useCallback(async()=>{if(e){l(!0),s(null);try{const E=await Pp(e);n(E)}catch(E){s(E.message)}finally{l(!1)}}},[e]),Ze=g.useCallback(async E=>{if(!E){v(null);return}h(!0),x(null);try{const V=await zp(e,E);v(V)}catch(V){x(V.message)}finally{h(!1)}},[e]);g.useEffect(()=>{ce()},[ce]),g.useEffect(()=>{Ze(a)},[a,Ze]),g.useEffect(()=>{me&&B.current&&B.current.focus()},[me]);async function Ve(E){E.preventDefault();const V=S.trim(),He=f.trim();if(!(!V||!He)){C(!0),L(null);try{const Ot=await Lp(e,V,He,p);R(""),c(""),w(2),await ce(),u(Ot.collection_uid)}catch(Ot){L(Ot.message)}finally{C(!1)}}}async function rt(){const E=N.trim();if(!E||!O){T(!1);return}try{await aa(e,O.collection_uid,{name:E}),await ce(),v(V=>V&&{...V,name:E})}catch(V){s(V.message)}finally{T(!1)}}async function Rl(E){if(O)try{await aa(e,O.collection_uid,{default_visibility_bits:E}),await ce(),v(V=>V&&{...V,default_visibility_bits:E})}catch(V){s(V.message)}}async function Dl(){if(O&&window.confirm(`Delete collection "${O.name}"? Entries will not be deleted.`))try{await Mp(e,O.collection_uid),u(null),v(null),await ce()}catch(E){s(E.message)}}async function $(E){E.preventDefault();const V=I.trim();if(!(!V||!O)){Se(!0),$e(null);try{await Rp(e,O.collection_uid,V,z),M(""),await Ze(O.collection_uid)}catch(He){$e(He.message)}finally{Se(!1)}}}async function ie(E){if(O)try{await Dp(e,O.collection_uid,E),await Ze(O.collection_uid)}catch(V){x(V.message)}}async function _e(E,V){if(O)try{await Op(e,O.collection_uid,E,V),v(He=>He&&{...He,entries:He.entries.map(Ot=>Ot.entry_uid===E?{...Ot,collection_visibility_bits:V}:Ot)})}catch(He){x(He.message)}}return e?o.jsxs("div",{className:"collections-view",children:[o.jsx("h2",{className:"collections-heading",children:"Collections"}),r&&o.jsx("div",{className:"muted",children:"Loading…"}),i&&o.jsxs("div",{className:"collections-error",children:[i," ",o.jsx("button",{onClick:()=>s(null),className:"coll-dismiss",children:"×"})]}),o.jsxs("div",{className:"collections-layout",children:[o.jsxs("div",{className:"collections-sidebar",children:[t.map(E=>o.jsxs("button",{className:`coll-sidebar-row${a===E.collection_uid?" is-active":""}`,onClick:()=>u(E.collection_uid),children:[o.jsx("span",{className:"coll-row-name",children:E.name}),o.jsx("span",{className:"coll-row-meta",children:Zp(E.default_visibility_bits)})]},E.collection_uid)),t.length===0&&!r&&o.jsx("div",{className:"muted",style:{padding:"8px 12px"},children:"No collections yet."})]}),O?o.jsxs("div",{className:"coll-detail",children:[o.jsxs("div",{className:"coll-detail-header",children:[me?o.jsx("input",{ref:B,className:"coll-rename-input",value:N,onChange:E=>D(E.target.value),onBlur:rt,onKeyDown:E=>{E.key==="Enter"&&rt(),E.key==="Escape"&&T(!1)}}):o.jsxs("h3",{className:`coll-detail-name${ue?"":" coll-detail-name--editable"}`,title:ue?void 0:"Click to rename",onClick:()=>{ue||(D(O.name),T(!0))},children:[(d==null?void 0:d.name)??O.name,!ue&&o.jsx("span",{className:"coll-edit-hint",children:" ✎"})]}),!ue&&o.jsx("button",{className:"coll-delete-btn",onClick:Dl,title:"Delete collection",children:"Delete"})]}),o.jsxs("div",{className:"coll-detail-vis",children:[o.jsx("span",{className:"coll-vis-label",children:"Default visibility"}),o.jsx("select",{className:"coll-vis-select",value:(d==null?void 0:d.default_visibility_bits)??O.default_visibility_bits,onChange:E=>Rl(Number(E.target.value)),disabled:ue,children:In.map(E=>o.jsx("option",{value:E.value,children:E.label},E.value))})]}),o.jsxs("div",{className:"coll-entries-section",children:[o.jsx("div",{className:"coll-section-heading",children:"Entries"}),m&&o.jsx("div",{className:"muted",children:"Loading…"}),k&&o.jsx("div",{className:"collections-error",children:k}),!m&&d&&(d.entries.length===0?o.jsx("div",{className:"muted",children:"No entries in this collection."}):o.jsx("ul",{className:"coll-entries-list",children:d.entries.map(E=>o.jsxs("li",{className:"coll-entry-row",children:[o.jsxs("div",{className:"coll-entry-info",children:[o.jsx("span",{className:"coll-entry-title",children:E.title||E.entry_uid}),o.jsx("span",{className:"coll-entry-kind muted",children:E.source_kind})]}),o.jsxs("div",{className:"coll-entry-actions",children:[o.jsx("select",{className:"coll-entry-vis-select",value:E.collection_visibility_bits,onChange:V=>_e(E.entry_uid,Number(V.target.value)),children:In.map(V=>o.jsx("option",{value:V.value,children:V.label},V.value))}),!ue&&o.jsx("button",{className:"coll-entry-remove",onClick:()=>ie(E.entry_uid),title:"Remove from collection",children:"×"})]})]},E.entry_uid))}))]}),!ue&&o.jsxs("form",{className:"coll-add-entry-form",onSubmit:$,children:[o.jsx("div",{className:"coll-section-heading",children:"Add entry"}),o.jsxs("div",{className:"coll-add-entry-row",children:[o.jsx("input",{className:"coll-add-entry-input",type:"text",value:I,onChange:E=>M(E.target.value),placeholder:"entry_uid",required:!0}),o.jsx("select",{className:"coll-vis-select",value:z,onChange:E=>A(Number(E.target.value)),children:In.map(E=>o.jsx("option",{value:E.value,children:E.label},E.value))}),o.jsx("button",{className:"coll-add-btn",type:"submit",disabled:le,children:le?"…":"Add"})]}),Oe&&o.jsx("div",{className:"collections-error",style:{marginTop:4},children:Oe})]})]}):o.jsx("div",{className:"coll-detail coll-detail--empty",children:o.jsx("div",{className:"muted",children:"Select a collection to view details."})})]}),o.jsxs("details",{className:"coll-create-details",children:[o.jsx("summary",{children:"+ Create collection"}),o.jsxs("form",{className:"coll-create-form",onSubmit:Ve,children:[o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"coll-name",children:"Name"}),o.jsx("input",{className:"capture-input",id:"coll-name",type:"text",value:S,onChange:E=>{R(E.target.value),f||c(E.target.value.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""))},placeholder:"My Collection",required:!0})]}),o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"coll-slug",children:"Slug"}),o.jsx("input",{className:"capture-input",id:"coll-slug",type:"text",value:f,onChange:E=>c(E.target.value),placeholder:"my-collection",required:!0})]}),o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"coll-vis",children:"Default visibility"}),o.jsx("select",{className:"capture-input",id:"coll-vis",style:{height:42},value:p,onChange:E=>w(Number(E.target.value)),children:In.map(E=>o.jsx("option",{value:E.value,children:E.label},E.value))})]}),_&&o.jsx("div",{className:"collections-error",children:_}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:y,children:y?"Creating…":"Create collection"})]})]})]}):o.jsx("div",{className:"view-placeholder",children:"Select an archive."})}const bp=4;function eh({tab:e,onTabChange:t}){const{currentUser:n,setCurrentUser:r}=g.useContext(zl)??{},l=n&&(n.role_bits&bp)!==0,i=["profile","tokens",...l?["instance"]:[]],s={profile:"Profile",tokens:"API Tokens",instance:"Instance"};return o.jsxs("section",{className:"admin-view",children:[o.jsx("h1",{children:"Settings"}),o.jsx("div",{className:"view-tabs",children:i.map(a=>o.jsx("button",{className:`view-tab${e===a?" is-active":""}`,onClick:()=>t(a),children:s[a]},a))}),e==="profile"&&o.jsx(th,{currentUser:n,setCurrentUser:r}),e==="tokens"&&o.jsx(nh,{}),e==="instance"&&l&&o.jsx(rh,{})]})}function th({currentUser:e,setCurrentUser:t}){const[n,r]=g.useState((e==null?void 0:e.display_name)??""),[l,i]=g.useState(!1),[s,a]=g.useState(null),[u,d]=g.useState(""),[v,m]=g.useState(""),[h,k]=g.useState(""),[x,S]=g.useState(!1),[R,f]=g.useState(null);async function c(w){w.preventDefault(),i(!0),a(null);try{await vp(n),t(y=>({...y,display_name:n||null})),a({ok:!0,text:"Saved."})}catch(y){a({ok:!1,text:y.message})}finally{i(!1)}}async function p(w){if(w.preventDefault(),v!==h){f({ok:!1,text:"Passwords do not match."});return}S(!0),f(null);try{await yp(u,v),d(""),m(""),k(""),f({ok:!0,text:"Password changed."})}catch(y){f({ok:!1,text:y.message})}finally{S(!1)}}return o.jsxs("div",{style:{maxWidth:440},children:[o.jsxs("div",{className:"form-section",children:[o.jsx("h2",{children:"Display Name"}),o.jsxs("form",{onSubmit:c,children:[o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"display-name",children:"Name shown in the UI"}),o.jsx("input",{className:"field-input",id:"display-name",placeholder:(e==null?void 0:e.username)??"",value:n,onChange:w=>r(w.target.value)})]}),s&&o.jsx("div",{className:`form-msg form-msg--${s.ok?"ok":"err"}`,children:s.text}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:l,children:l?"Saving…":"Save"})]})]}),o.jsxs("div",{className:"form-section",children:[o.jsx("h2",{children:"Display Preferences"}),o.jsxs("label",{className:"checkbox-row",children:[o.jsx("input",{type:"checkbox",checked:(e==null?void 0:e.humanize_slugs)??!1,onChange:async w=>{const y=w.target.checked;try{await gp({humanize_slugs:y}),t(C=>({...C,humanize_slugs:y}))}catch{}}}),o.jsx("span",{className:"form-label",style:{margin:0},children:"Humanize tag display"})]}),o.jsx("p",{className:"muted",style:{fontSize:13,margin:"4px 0 0"},children:'When on, tag paths show as "X / Articles" instead of "x/articles".'})]}),o.jsxs("div",{className:"form-section",children:[o.jsx("h2",{children:"Change Password"}),o.jsxs("form",{onSubmit:p,children:[o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"cur-pw",children:"Current password"}),o.jsx("input",{className:"field-input",id:"cur-pw",type:"password",value:u,onChange:w=>d(w.target.value),required:!0})]}),o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"new-pw",children:"New password"}),o.jsx("input",{className:"field-input",id:"new-pw",type:"password",value:v,onChange:w=>m(w.target.value),required:!0})]}),o.jsxs("div",{className:"form-field",children:[o.jsx("label",{className:"form-label",htmlFor:"confirm-pw",children:"Confirm new password"}),o.jsx("input",{className:"field-input",id:"confirm-pw",type:"password",value:h,onChange:w=>k(w.target.value),required:!0})]}),R&&o.jsx("div",{className:`form-msg form-msg--${R.ok?"ok":"err"}`,children:R.text}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:x,children:x?"Changing…":"Change Password"})]})]})]})}function nh(){const[e,t]=g.useState([]),[n,r]=g.useState(!0),[l,i]=g.useState(null),[s,a]=g.useState(""),[u,d]=g.useState(!1),[v,m]=g.useState(null),h=g.useCallback(async()=>{r(!0),i(null);try{t(await wp())}catch(S){i(S.message)}finally{r(!1)}},[]);g.useEffect(()=>{h()},[h]);async function k(S){if(S.preventDefault(),!!s.trim()){d(!0);try{const R=await xp(s.trim());m(R),a(""),h()}catch(R){i(R.message)}finally{d(!1)}}}async function x(S){try{await Sp(S),t(R=>R.filter(f=>f.token_uid!==S))}catch(R){i(R.message)}}return o.jsx("div",{style:{maxWidth:600},children:o.jsxs("div",{className:"form-section",children:[o.jsx("h2",{children:"API Tokens"}),v&&o.jsxs("div",{className:"token-banner",children:[o.jsx("strong",{children:"Token created."})," Copy it now — it won't be shown again.",o.jsx("code",{children:v.raw_token}),o.jsx("button",{className:"token-dismiss",onClick:()=>m(null),children:"Dismiss"})]}),o.jsxs("form",{className:"token-create-row",onSubmit:k,children:[o.jsx("input",{className:"field-input field-input--flex",placeholder:"Token name",value:s,onChange:S=>a(S.target.value),required:!0}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:u,children:u?"Creating…":"Create token"})]}),l&&o.jsx("div",{className:"form-msg form-msg--err",children:l}),n?o.jsx("div",{className:"muted",children:"Loading\\u2026"}):o.jsxs("div",{children:[e.length===0&&o.jsx("div",{className:"muted",children:"No tokens yet."}),e.map(S=>o.jsxs("div",{className:"token-row",children:[o.jsxs("div",{className:"token-row-info",children:[o.jsx("strong",{children:S.name}),o.jsxs("div",{className:"muted",children:["Created ",S.created_at.slice(0,10),S.last_used_at&&` · Last used ${S.last_used_at.slice(0,10)}`]})]}),o.jsx("button",{className:"btn-danger",style:{fontSize:12,padding:"4px 10px"},onClick:()=>x(S.token_uid),children:"Revoke"})]},S.token_uid))]})]})})}function rh(){const[e,t]=g.useState(null),[n,r]=g.useState(!0),[l,i]=g.useState(null),[s,a]=g.useState(!1),[u,d]=g.useState(null);g.useEffect(()=>{(async()=>{try{t(await kp())}catch(m){i(m.message)}finally{r(!1)}})()},[]);async function v(m){m.preventDefault(),a(!0),d(null);try{await Np(e),d({ok:!0,text:"Saved."})}catch(h){d({ok:!1,text:h.message})}finally{a(!1)}}return n?o.jsx("div",{className:"muted",children:"Loading\\u2026"}):l?o.jsx("div",{className:"form-msg form-msg--err",children:l}):e?o.jsx("div",{style:{maxWidth:440},children:o.jsxs("div",{className:"form-section",children:[o.jsx("h2",{children:"Instance Settings"}),o.jsxs("form",{onSubmit:v,children:[[["public_index_enabled","Public index (unauthenticated browsing)"],["public_entry_content_enabled","Public entry content"],["open_registration_enabled","Open registration"]].map(([m,h])=>o.jsxs("label",{className:"checkbox-row",children:[o.jsx("input",{type:"checkbox",checked:!!e[m],onChange:k=>t(x=>({...x,[m]:k.target.checked}))}),h]},m)),o.jsxs("div",{className:"form-field",style:{marginTop:4},children:[o.jsx("label",{className:"form-label",children:"Default entry visibility"}),o.jsxs("select",{className:"field-input",value:e.default_entry_visibility,onChange:m=>t(h=>({...h,default_entry_visibility:Number(m.target.value)})),children:[o.jsx("option",{value:0,children:"Private"}),o.jsx("option",{value:2,children:"Unlisted"}),o.jsx("option",{value:3,children:"Public"})]})]}),u&&o.jsx("div",{className:`form-msg form-msg--${u.ok?"ok":"err"}`,children:u.text}),o.jsx("button",{className:"btn-primary",type:"submit",disabled:s,children:s?"Saving…":"Save Settings"})]})]})}):null}const ca={0:"Private",1:"Public",2:"Users only",3:"Public"},lh=()=>o.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:o.jsx("path",{d:"M7 17 17 7M9 7h8v8"})});function ih({archiveId:e,selectedEntry:t,onTagFilterSet:n,tagNodes:r,onTagsRefresh:l,onEntryTitleChange:i,humanizeTags:s}){const[a,u]=g.useState(null),[d,v]=g.useState([]),[m,h]=g.useState(""),[k,x]=g.useState([]),[S,R]=g.useState(""),f=g.useRef(0),c=g.useRef(!1),[p,w]=g.useState(!1),[y,C]=g.useState("");g.useEffect(()=>{if(!t||!e){u(null),v([]),x([]);return}w(!1),C(""),c.current=!1;const z=++f.current;u(null),v([]),Promise.all([lp(e,t.entry_uid),si(e,t.entry_uid),$p(e,t.entry_uid)]).then(([A,le,Se])=>{z===f.current&&(u(A),v(le),x(Se))}).catch(()=>{})},[t,e]);async function _(){const z=y.trim()||null;try{await ip(e,t.entry_uid,z),u(A=>A&&{...A,summary:{...A.summary,title:z}}),i==null||i(t.entry_uid,z)}catch{}finally{w(!1)}}async function L(){const z=m.trim();if(!(!z||!t))try{await sp(e,t.entry_uid,z),h(""),R("");const A=await si(e,t.entry_uid);v(A),l()}catch(A){R(A.message)}}async function I(z){try{await op(e,t.entry_uid,z);const A=await si(e,t.entry_uid);v(A),l()}catch{}}const M=a?[["Added",jc(a.summary.archived_at)],["Source",a.summary.source_kind],["Type",a.summary.entity_kind],["Visibility",ca[a.summary.visibility]??a.summary.visibility],["Root",a.structured_root_relpath]]:[];return o.jsxs("aside",{className:"context-rail",children:[o.jsx("div",{className:"rail-eyebrow",children:"Context"}),t?a?o.jsxs(o.Fragment,{children:[p?o.jsx("input",{className:"rail-title-input",autoFocus:!0,value:y,onChange:z=>C(z.target.value),onKeyDown:z=>{z.key==="Enter"&&z.currentTarget.blur(),z.key==="Escape"&&(c.current=!0,z.currentTarget.blur())},onBlur:()=>{c.current?w(!1):_(),c.current=!1}}):o.jsxs("h2",{className:"rail-title rail-title--editable",title:"Click to rename",onClick:()=>{C(a.summary.title??""),w(!0)},children:[At(a.summary.title)||At(a.summary.entry_uid),o.jsx("svg",{className:"edit-icon",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:o.jsx("path",{d:"M11.5 2.5a1.5 1.5 0 0 1 2 2L5 13l-3 1 1-3 8.5-8.5z"})})]}),a.summary.original_url&&o.jsxs("a",{className:"url-tile",href:a.summary.original_url,target:"_blank",rel:"noopener noreferrer",children:[o.jsx("span",{className:"ico",dangerouslySetInnerHTML:{__html:Cc(a.summary.source_kind)}}),o.jsx("span",{className:"u-text",children:a.summary.original_url}),o.jsx("span",{className:"ext",children:o.jsx(lh,{})})]}),o.jsx("div",{className:"meta-list",children:M.filter(([,z])=>z!=null&&z!=="").map(([z,A])=>o.jsxs("div",{className:"meta-item",children:[o.jsx("span",{className:"meta-k",children:z}),o.jsx("span",{className:`meta-v${z==="Root"?" mono":""}`,children:At(A)})]},z))}),a.artifacts.length>0&&o.jsxs("div",{className:"rail-section",children:[o.jsxs("div",{className:"rail-section-heading",children:["Artifacts ",o.jsx("span",{className:"num",children:a.artifacts.length})]}),o.jsx("ul",{className:"artifact-list",children:a.artifacts.map((z,A)=>o.jsx("li",{children:o.jsxs("a",{href:`/api/archives/${e}/entries/${a.summary.entry_uid}/artifacts/${A}`,target:"_blank",rel:"noopener noreferrer",className:"artifact-link",children:[o.jsx("span",{className:"artifact-name",children:z.artifact_role.replace(/_/g," ")}),o.jsx("span",{className:"artifact-size",children:z.byte_size!=null?ts(z.byte_size):"—"})]})},A))})]})]}):o.jsx("p",{className:"tags-empty",children:"Loading…"}):o.jsx("p",{className:"tags-empty",children:"Select an entry."}),t&&o.jsxs(o.Fragment,{children:[o.jsxs("div",{className:"rail-section",children:[o.jsx("div",{className:"rail-section-heading",children:"Tags"}),d.length===0?o.jsx("p",{className:"tags-empty",children:"No tags yet."}):o.jsx("div",{className:"tags-wrap",children:d.map(z=>o.jsxs("span",{className:"tag-pill",title:z.full_path,children:[s?Ec(z.full_path):z.full_path,o.jsx("button",{className:"remove",title:`Remove tag ${z.full_path}`,onClick:()=>I(z.tag_uid),children:"×"})]},z.tag_uid))}),S&&o.jsx("p",{className:"form-msg form-msg--err",style:{margin:"0 0 8px"},children:S}),o.jsxs("div",{className:"tag-input-wrap",children:[o.jsx("span",{className:"hash",children:"/"}),o.jsx("input",{className:"tag-input",type:"text",placeholder:"science/cs",autoComplete:"off",value:m,onChange:z=>h(z.target.value),onKeyDown:z=>{z.key==="Enter"&&L()}}),o.jsx("button",{className:"tag-add-btn",onClick:L,children:"Add"})]})]}),k.length>0&&o.jsxs("div",{className:"rail-section",children:[o.jsx("div",{className:"rail-section-heading",children:"Collections"}),k.map(z=>o.jsxs("div",{className:"coll-row",children:[o.jsx("span",{className:"coll-name",children:z.collection_uid}),o.jsx("span",{className:"vis-badge",children:ca[z.visibility_bits]??`bits:${z.visibility_bits}`})]},z.collection_uid))]})]})]})}const zl=g.createContext(null),sh=["archive","tags","collections","runs","admin","settings"],oh=["profile","tokens","instance"];function ai(){const e=window.location.pathname.split("/").filter(Boolean),t=sh.includes(e[0])?e[0]:"archive",n=t==="settings"&&oh.includes(e[1])?e[1]:"profile";return{view:t,settingsTab:n}}function ah(e,t){return e==="archive"?"/":e==="settings"?`/settings/${t}`:`/${e}`}function uh(){const[e,t]=g.useState("loading"),[n,r]=g.useState(null);g.useEffect(()=>{(async()=>{if(await dp()){t("setup");return}const ie=await mp();if(!ie){t("login");return}r(ie),t("authenticated")})()},[]),g.useEffect(()=>{const $=()=>{r(null),t("login")};return window.addEventListener("auth:expired",$),()=>window.removeEventListener("auth:expired",$)},[]),g.useEffect(()=>{const $=()=>{const{view:ie,settingsTab:_e}=ai();f(ie),p(_e)};return window.addEventListener("popstate",$),()=>window.removeEventListener("popstate",$)},[]);const[l,i]=g.useState([]),[s,a]=g.useState(null),[u,d]=g.useState([]),[v,m]=g.useState(null),[h,k]=g.useState(null),[x,S]=g.useState(null),[R,f]=g.useState(()=>ai().view),[c,p]=g.useState(()=>ai().settingsTab),[w,y]=g.useState(""),[C,_]=g.useState(""),[L,I]=g.useState(!1),[M,z]=g.useState([]),[A,le]=g.useState([]),[Se,Oe]=g.useState(()=>sessionStorage.getItem("captureDialogOpen")==="true"),$e=(n==null?void 0:n.humanize_slugs)??!1;g.useEffect(()=>{sessionStorage.setItem("captureDialogOpen",Se)},[Se]);const me=g.useCallback(async($,ie,_e)=>{if($){I(!0);try{let E;ie||_e?E=await rp($,ie,_e):E=await np($),d(E),_(E.length===0?"No results":`${E.length} result${E.length===1?"":"s"}`)}catch{d([]),_("Search failed. Try again.")}finally{I(!1)}}},[]);g.useEffect(()=>{e==="authenticated"&&tp().then($=>{if(i($),$.length>0){const ie=$[0].id;a(ie)}})},[e]),g.useEffect(()=>{s&&(S(null),k(null),m(null),Promise.all([me(s,"",null),sa(s).then(z),oi(s).then(le)]))},[s]),g.useEffect(()=>{if(s===null)return;const $=setTimeout(()=>{me(s,w,x)},300);return()=>clearTimeout($)},[w,s]),g.useEffect(()=>{s!==null&&(x!==null&&f("archive"),me(s,w,x))},[x,s]);const T=g.useCallback($=>{a($)},[]),N=g.useCallback($=>{f($),$==="tags"&&s&&oi(s).then(le)},[s]);g.useEffect(()=>{const $=ah(R,c);window.location.pathname!==$&&history.pushState(null,"",$)},[R,c]);const D=g.useCallback($=>{m($?$.entry_uid:null),k($)},[]),B=g.useCallback($=>{S($)},[]),O=g.useCallback(()=>{S(null)},[]),ue=g.useCallback(()=>{s&&oi(s).then(le)},[s]),ce=g.useCallback(($,ie)=>{x===$?S(ie):x!=null&&x.startsWith($+"/")&&S(ie+x.slice($.length))},[x]),Ze=g.useCallback($=>{(x===$||x!=null&&x.startsWith($+"/"))&&S(null)},[x]),Ve=g.useCallback(($,ie)=>{d(_e=>_e.map(E=>E.entry_uid===$?{...E,title:ie}:E)),k(_e=>_e&&_e.entry_uid===$?{..._e,title:ie}:_e)},[]),rt=g.useCallback(()=>{Oe(!0)},[]),Rl=g.useCallback(()=>{Oe(!1)},[]),Dl=g.useCallback(()=>{s&&Promise.all([me(s,w,x),sa(s).then(z)])},[s,w,x,me]);return e==="loading"?o.jsx("div",{className:"auth-loading",children:"Loading\\u2026"}):e==="setup"?o.jsx(Up,{onComplete:()=>t("login")}):e==="login"?o.jsx(Ip,{onLogin:$=>{r($),t("authenticated")}}):o.jsx(zl.Provider,{value:{currentUser:n,setCurrentUser:r},children:o.jsxs(o.Fragment,{children:[o.jsx(Ap,{archives:l,archiveId:s,onArchiveChange:T,view:R,onViewChange:N,onCaptureClick:rt}),o.jsxs("main",{className:"app-shell",children:[o.jsxs("div",{className:"workspace",children:[R==="archive"&&o.jsxs("div",{className:"toolbar",children:[o.jsxs("div",{className:"search-field",children:[o.jsx("span",{className:"ico","aria-hidden":"true",children:o.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[o.jsx("circle",{cx:"11",cy:"11",r:"7"}),o.jsx("line",{x1:"16.5",y1:"16.5",x2:"21",y2:"21"})]})}),o.jsx("input",{className:"search-input",type:"search","aria-label":"Search archive","aria-busy":L,placeholder:"Search titles, URLs, types, tags…",value:w,onChange:$=>y($.target.value)}),o.jsx("span",{className:"kbd",children:"⌘K"})]}),o.jsxs("span",{className:"result-count",children:[C&&o.jsxs(o.Fragment,{children:[o.jsx("b",{children:C.split(" ")[0]})," ",C.split(" ").slice(1).join(" ")]}),x&&o.jsxs("button",{className:"tag-filter-badge",onClick:O,children:["× ",$e?Ec(x):x]})]})]}),R==="archive"&&o.jsx(Wp,{entries:u,selectedEntryUid:v,onSelectEntry:D,archiveId:s,tagFilter:x,onClearTagFilter:O,searchQuery:w,onSearchChange:y,resultCount:C,searchBusy:L}),R==="runs"&&o.jsx(Jp,{runs:M}),R==="admin"&&o.jsx(Xp,{archives:l}),R==="tags"&&o.jsx(Gp,{archiveId:s,tagNodes:A,tagFilter:x,onTagFilterSet:B,onViewChange:N,onTagRenamed:ce,onTagDeleted:Ze,onTagsRefresh:ue,humanizeTags:$e}),R==="collections"&&o.jsx(qp,{archiveId:s}),R==="settings"&&o.jsx(eh,{tab:c,onTabChange:p})]}),o.jsx(ih,{archiveId:s,selectedEntry:h,onTagFilterSet:B,tagNodes:A,onTagsRefresh:ue,onEntryTitleChange:Ve,humanizeTags:$e})]}),o.jsx(Bp,{open:Se,archiveId:s,onClose:Rl,onCaptured:Dl})]})})}Nc(document.getElementById("root")).render(o.jsx(g.StrictMode,{children:o.jsx(uh,{})})); diff --git a/crates/archivr-server/static/assets/index-CemOWtGK.css b/crates/archivr-server/static/assets/index-CemOWtGK.css new file mode 100644 index 0000000..0809790 --- /dev/null +++ b/crates/archivr-server/static/assets/index-CemOWtGK.css @@ -0,0 +1 @@ +@import"https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Spectral:wght@500;600&display=swap";:root{color-scheme:light;--ink: #20251f;--muted: #6b6f66;--muted-2: #8a8d83;--paper: #f5f0e7;--paper-2: #e9e1d2;--paper-3: #fffaf0;--line: #d2c6b5;--line-soft: #e5dccd;--accent: #8d3f30;--accent-2: #b78342;--link: #245f72;--top: #141d18;--field: #fffdf7;--r: 3px;--r2: 6px;--r3: 10px;--sans: "Helvetica Neue", Helvetica, Arial, sans-serif;--serif: "Spectral", Georgia, "Times New Roman", serif;--display: "Cormorant Garamond", Georgia, serif}*{box-sizing:border-box}body{margin:0;min-height:100vh;background:var(--paper);color:var(--ink);font-family:var(--sans);font-size:14px;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}button,input,select{font:inherit}.workspace,.context-rail{scrollbar-width:thin;scrollbar-color:var(--line) transparent}.workspace::-webkit-scrollbar,.context-rail::-webkit-scrollbar{width:11px;height:11px}.workspace::-webkit-scrollbar-track,.context-rail::-webkit-scrollbar-track{background:transparent}.workspace::-webkit-scrollbar-thumb,.context-rail::-webkit-scrollbar-thumb{background:var(--line);border-radius:999px;border:3px solid transparent;background-clip:padding-box}.workspace::-webkit-scrollbar-thumb:hover,.context-rail::-webkit-scrollbar-thumb:hover{background:var(--muted-2);background-clip:padding-box;border:3px solid transparent}.topbar{height:58px;display:grid;grid-template-columns:auto auto 1fr auto auto;align-items:center;gap:26px;padding:0 22px;background:var(--top);color:#efe6d6;border-bottom:3px solid var(--accent)}.brand{font-family:var(--display);font-weight:600;font-size:30px;line-height:1;letter-spacing:.01em;color:#f4ead8}.switcher{position:relative;display:inline-flex;align-items:center}.switcher select{-moz-appearance:none;appearance:none;-webkit-appearance:none;border:1px solid rgba(247,238,223,.2);background:#f7eedf0f;color:#f1e8d8;font-family:var(--sans);font-weight:550;font-size:13.5px;letter-spacing:.04em;padding:8px 32px 8px 15px;cursor:pointer;border-radius:6px;transition:background .15s ease,border-color .15s ease}.switcher select:hover{background:#f7eedf1c;border-color:#f7eedf57}.switcher:after{content:"";position:absolute;right:15px;top:50%;width:6px;height:6px;margin-top:-5px;border-right:1.2px solid #b6ab98;border-bottom:1.2px solid #b6ab98;transform:rotate(45deg);pointer-events:none}.nav{display:flex;gap:22px;justify-content:flex-end;min-width:0}.nav-link{border:0;background:transparent;color:#cdc1ad;cursor:pointer;padding:6px 0;font-size:12.5px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;position:relative}.nav-link:hover,.nav-link.is-active{color:#f4ead8}.nav-link.is-active:after{content:"";position:absolute;left:0;right:0;bottom:-2px;height:1px;background:var(--accent-2)}.capture-button{display:inline-flex;align-items:center;gap:8px;position:relative;overflow:hidden;border:0;background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 88%,#fff) 0%,var(--accent) 55%);color:#f7eddd;padding:10px 18px;cursor:pointer;font-size:12px;font-weight:600;letter-spacing:.15em;text-transform:uppercase;border-radius:var(--r);box-shadow:inset 0 1px #fff5e629,0 1px 2px #141d184d;transition:filter .18s ease,box-shadow .18s ease}.capture-button:hover{filter:brightness(.93);box-shadow:inset 0 1px #fff5e61f,0 2px 6px #141d1857}.capture-button:before{content:"";position:absolute;top:0;bottom:0;left:0;width:45%;background:linear-gradient(100deg,transparent 0%,rgba(255,246,232,.45) 50%,transparent 100%);transform:translate(-180%) skew(-18deg);pointer-events:none}@media (prefers-reduced-motion: no-preference){.capture-button:hover:before{animation:cap-sheen .7s ease}}@keyframes cap-sheen{0%{transform:translate(-180%) skew(-18deg)}to{transform:translate(340%) skew(-18deg)}}.app-shell{height:calc(100vh - 58px);display:grid;grid-template-columns:minmax(0,1fr) 340px}.workspace{min-width:0;overflow:auto;display:flex;flex-direction:column}.view{display:none}.view.is-active{display:block}.toolbar{position:sticky;top:0;z-index:3;display:flex;align-items:center;gap:16px;padding:12px 22px;background:color-mix(in srgb,var(--paper) 88%,white);border-bottom:1px solid var(--line-soft)}.search-field{position:relative;flex:1 1 auto;min-width:0;display:flex;align-items:center;height:42px;background:var(--field);border:1px solid var(--line);border-radius:20px;transition:border-color .15s ease,box-shadow .15s ease}.search-field:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}.search-field .ico{display:grid;place-items:center;width:46px;height:100%;color:var(--muted-2);flex-shrink:0}.search-field .ico svg{width:16px;height:16px}.search-input{flex:1;min-width:0;height:100%;border:0;background:transparent;color:var(--ink);padding:0 6px 0 0;font-size:14px;letter-spacing:.01em;outline:none}.search-input::placeholder{color:var(--muted-2)}.search-field .kbd{margin-right:12px;display:inline-flex;align-items:center;padding:3px 7px;font-size:11px;color:var(--muted);background:var(--paper-2);border:1px solid var(--line-soft);border-radius:var(--r);flex-shrink:0}.result-count{flex-shrink:0;font-size:13px;color:var(--muted);letter-spacing:.02em;white-space:nowrap}.result-count b{color:var(--ink);font-weight:600;font-variant-numeric:tabular-nums}.tag-filter-badge{display:inline-flex;align-items:center;gap:4px;background:var(--accent);color:#fff;border:0;border-radius:var(--r);font-size:12px;padding:2px 8px;cursor:pointer;margin-left:8px}.tag-filter-badge:hover{opacity:.85}.entry-table{width:100%;font-size:12.5px}.entry-header-row{display:flex;align-items:stretch;position:sticky;top:67px;z-index:2;background:color-mix(in srgb,var(--paper) 92%,white);border-bottom:1px solid var(--line-soft);color:var(--muted);font-size:10.5px;text-transform:uppercase;letter-spacing:.08em}.entry-header-row>div{padding:9px 10px;flex-shrink:0;font-weight:600;display:flex;align-items:center}#entries-body>div{display:flex;align-items:center;cursor:default;border-bottom:1px solid var(--line-soft)}#entries-body>div>div{padding:7px 10px;flex-shrink:0;overflow:hidden}#entries-body>div:nth-child(2n){background:#f2ede5}#entries-body>div:nth-child(odd){background:var(--paper-3)}#entries-body>div.is-selected{background:#eee2d2;outline:2px solid var(--accent);outline-offset:-2px}.col-added{width:162px;color:var(--muted)}.col-title{flex:1 1 0;min-width:0;overflow:hidden;display:flex;align-items:center;gap:.42em}.col-type{width:116px}.col-size{width:100px;display:flex;flex-direction:column;justify-content:center;gap:1px}.size-total{font-variant-numeric:tabular-nums}.size-cached-pct{font-size:10px;color:var(--muted);opacity:.8;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.col-url{flex:0 0 30%;min-width:0;overflow:hidden;position:relative}.entry-header-row>div:first-child,#entries-body>div>div:first-child{padding-left:22px}.entry-header-row>div:last-child,#entries-body>div>div:last-child{padding-right:22px}.entry-title{color:var(--link);font-weight:700;min-width:0}.entry-header-row>div{padding:9px 10px;flex-shrink:0;font-weight:600}.source-icon{display:flex;align-items:center;justify-content:center;width:1.05em;height:1.05em;flex-shrink:0}.source-icon>*{width:100%;height:100%;display:flex;align-items:center;justify-content:center}.source-icon svg{width:100%;height:100%}.url-cell{color:#555b55;white-space:nowrap;text-overflow:ellipsis}#entries-body .url-cell:hover,#entries-body .is-selected .url-cell{overflow:visible;z-index:5}.url-cell .url-text{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#entries-body .url-cell:hover .url-text,#entries-body .is-selected .url-cell .url-text{position:absolute;right:0;top:0;white-space:normal;word-break:break-all;background:var(--paper-3);padding:7px 22px 7px 10px;min-width:100%;max-width:480px;border:1px solid var(--line);border-radius:var(--r2);box-shadow:-3px 4px 16px #0000001f}.type-pill{display:inline-block;padding:2px 6px;background:#d8e3df;color:#275a5f;border:1px solid #bfd0ca;border-radius:var(--r)}#runs-view .entry-table{border-collapse:collapse;table-layout:auto}#runs-view .entry-table th{position:sticky;top:0;z-index:1;text-align:left;padding:10px;background:color-mix(in srgb,var(--paper) 92%,white);color:var(--muted);border-bottom:1px solid var(--line-soft);font-size:10.5px;text-transform:uppercase;letter-spacing:.08em}#runs-view .entry-table td{padding:10px;border-bottom:1px solid var(--line-soft);vertical-align:top}#runs-view .entry-table tr:nth-child(2n) td{background:#f2ede5}#runs-view .entry-table tr:nth-child(odd) td{background:var(--paper-3)}.context-rail{border-left:1px solid var(--line);background:var(--paper);padding:20px 20px 32px;overflow:auto}.rail-eyebrow{font-size:10.5px;font-weight:600;letter-spacing:.16em;text-transform:uppercase;color:var(--muted-2);margin-bottom:16px}.rail-title{display:block;font-family:var(--sans);font-weight:700;font-size:15.5px;line-height:1.4;color:var(--ink);margin:0 0 16px;word-break:break-word}.url-tile{display:flex;align-items:center;gap:9px;padding:10px 12px;background:var(--paper-3);border:1px solid var(--line);border-radius:var(--r3);margin-bottom:20px;text-decoration:none}.url-tile:hover{background:var(--field);border-color:var(--accent)}.url-tile .ico{color:var(--ink);flex-shrink:0;display:grid;place-items:center}.url-tile .ico svg{width:15px;height:15px}.url-tile .u-text{min-width:0;flex:1;font-size:12.5px;color:var(--link);font-family:ui-monospace,SF Mono,Menlo,monospace;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.url-tile .ext{color:var(--muted-2);flex-shrink:0}.url-tile .ext svg{width:13px;height:13px;display:block}.meta-list{margin-bottom:24px;border-top:1px solid var(--line-soft)}.meta-item{display:grid;grid-template-columns:92px 1fr;gap:14px;align-items:baseline;padding:9px 0;border-bottom:1px solid var(--line-soft)}.meta-k{font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.06em;color:var(--muted-2)}.meta-v{font-size:13.5px;color:var(--ink);word-break:break-word;line-height:1.4}.meta-v.mono{font-family:ui-monospace,SF Mono,Menlo,monospace;font-size:12px;color:var(--muted)}.rail-section{margin-bottom:24px}.rail-section-heading{display:flex;align-items:baseline;gap:8px;font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.12em;color:var(--muted-2);margin-bottom:9px;padding-bottom:8px;border-bottom:1px solid var(--line)}.rail-section-heading .num{color:var(--muted-2);font-weight:600}.artifact-list{list-style:none;margin:0;padding:0}.artifact-link{display:flex;align-items:baseline;justify-content:space-between;gap:12px;padding:7px 2px;border-bottom:1px solid var(--line-soft);text-decoration:none}.artifact-link:last-child{border-bottom:0}.artifact-name{font-size:13px;color:var(--link);min-width:0;word-break:break-word}.artifact-link:hover .artifact-name{text-decoration:underline}.artifact-size{font-size:11.5px;color:var(--muted-2);flex-shrink:0;font-variant-numeric:tabular-nums}.tags-wrap{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 12px}.tag-pill{display:inline-flex;align-items:center;gap:7px;background:var(--paper-2);border:1px solid var(--line);border-radius:var(--r);font-size:12px;padding:4px 7px 4px 10px;color:var(--ink)}.tag-pill .remove{border:0;background:transparent;cursor:pointer;color:var(--muted-2);width:15px;height:15px;display:grid;place-items:center;font-size:13px;line-height:1}.tag-pill .remove:hover{color:var(--accent)}.tags-empty{font-size:13px;color:var(--muted);margin:0 0 11px}.tag-input-wrap{display:flex;align-items:center;gap:8px;background:var(--field);border:1px solid var(--line);border-radius:var(--r2);padding:2px 2px 2px 11px;transition:border-color .15s ease,box-shadow .15s ease}.tag-input-wrap:focus-within{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 12%,transparent)}.tag-input-wrap .hash{color:var(--muted-2);font-size:13px}.tag-input{flex:1;min-width:0;border:0;background:transparent;color:var(--ink);font-size:13px;padding:6px 0;outline:none;font-family:ui-monospace,SF Mono,Menlo,monospace}.tag-add-btn{border:0;background:var(--ink);color:var(--paper-3);padding:6px 13px;font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;border-radius:var(--r);cursor:pointer;white-space:nowrap}.tag-add-btn:hover{background:#2c332b}.coll-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 13px;background:var(--field);border:1px solid var(--line);border-radius:var(--r2);margin-bottom:6px;transition:border-color .15s ease}.coll-row:hover{border-color:var(--accent)}.coll-name{font-size:13px;color:var(--ink);font-weight:500}.vis-badge{display:inline-flex;align-items:center;gap:6px;font-size:11px;color:var(--muted);background:var(--paper-2);border:1px solid var(--line-soft);border-radius:999px;padding:3px 10px}.vis-badge:before{content:"";width:6px;height:6px;border-radius:50%;background:var(--accent-2)}.capture-dialog{border:1px solid var(--line);background:var(--paper);padding:0;min-width:360px;max-width:520px;border-radius:var(--r3);box-shadow:0 20px 60px #141d1847}.capture-dialog::backdrop{background:#141d1873}.capture-dialog-inner{padding:28px}.capture-dialog-title{margin:0 0 16px;font-size:22px;font-family:var(--display);font-weight:600}.capture-label{display:block;font-size:11px;font-weight:600;margin-bottom:6px;color:var(--muted-2);text-transform:uppercase;letter-spacing:.06em}.capture-input{width:100%;height:44px;border:1px solid var(--line);background:var(--field);color:var(--ink);padding:0 14px;font-size:15px;margin-bottom:10px;border-radius:var(--r2);outline:none;transition:border-color .15s ease,box-shadow .15s ease}.capture-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent)}.form-field .capture-input{margin-bottom:0}.capture-error{color:var(--accent);font-size:13px;margin-bottom:10px;min-height:18px}.capture-actions{display:flex;gap:10px;justify-content:flex-end;margin-top:16px}.capture-cancel{border:1px solid var(--line);background:none;color:var(--ink);padding:8px 18px;border-radius:var(--r);cursor:pointer}.capture-cancel:hover{background:var(--paper-2)}.capture-submit{border:0;background:var(--ink);color:var(--paper);padding:8px 20px;border-radius:var(--r);cursor:pointer;font-weight:600}.capture-submit:hover{opacity:.85}.capture-submit:disabled{opacity:.45;cursor:default}.muted{color:var(--muted)}.admin-view{padding:22px}.admin-list{display:grid;gap:10px;max-width:780px}.admin-archive{border:1px solid var(--line);background:var(--paper-3);padding:12px;border-radius:var(--r2)}.tag-tree{padding:20px 22px;max-width:320px}.tag-tree-header{display:flex;align-items:baseline;gap:10px;margin-bottom:14px;border-bottom:1px solid var(--line-soft);padding-bottom:10px}.tag-tree-title{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.07em}.tag-tree-active{font-size:12px;color:var(--muted-2);font-style:italic}.tag-tree-list{list-style:none;margin:0;padding:0}.tag-children{padding-left:16px}.tag-node-btn{border:0;background:transparent;color:var(--link);cursor:pointer;padding:3px 0;text-align:left;font-size:13px;display:block;width:100%}.tag-node-btn:hover{text-decoration:underline}.tag-node-btn.is-active{font-weight:600;color:var(--ink)}.tag-node-row{display:flex;align-items:center;gap:4px}.tag-node-row .tag-node-btn{flex:1 1 0;min-width:0;display:flex;align-items:center;gap:4px;width:auto}.tag-node-btn .edit-icon{width:.75em;height:.75em;flex-shrink:0;vertical-align:-.1em;opacity:.35}.tag-node-btn:hover .edit-icon{opacity:.65}.tag-node-delete{flex-shrink:0;border:0;background:transparent;color:var(--muted-2);cursor:pointer;padding:0 3px;font-size:14px;line-height:1;opacity:0}.tag-node-row:hover .tag-node-delete{opacity:1}.tag-node-delete:hover{color:var(--accent)}.tag-rename-input{font-size:13px;flex:1 1 0;min-width:0;padding:2px 5px;border:1px solid var(--accent);border-radius:var(--r);background:var(--field);color:var(--ink);outline:none}.collections-view{padding:24px}.collections-heading{margin:0 0 16px;font-size:22px;font-family:var(--display);font-weight:600}.collections-error{color:var(--accent);font-size:13px;margin-bottom:8px}.coll-dismiss{background:none;border:none;cursor:pointer;color:var(--accent);font-size:16px;line-height:1;padding:0 4px}.collections-layout{display:grid;grid-template-columns:220px 1fr;gap:0;border:1px solid var(--line);border-radius:var(--r2);min-height:340px}.collections-sidebar{border-right:1px solid var(--line);overflow-y:auto}.coll-sidebar-row{display:flex;flex-direction:column;width:100%;padding:10px 14px;border:none;border-bottom:1px solid var(--line-soft);background:none;cursor:pointer;text-align:left;gap:2px}.coll-sidebar-row:hover{background:var(--paper-2)}.coll-sidebar-row.is-active{background:var(--paper-2);border-left:3px solid var(--accent)}.coll-row-name{font-size:14px;font-weight:600;color:var(--ink)}.coll-row-meta{font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}.coll-detail{padding:20px 24px;display:flex;flex-direction:column;gap:16px}.coll-detail--empty{justify-content:center;align-items:center}.coll-detail-header{display:flex;align-items:center;gap:12px}.coll-detail-name{margin:0;font-size:18px;font-family:var(--display);font-weight:600;flex:1}.coll-detail-name--editable{cursor:pointer}.coll-detail-name--editable:hover{color:var(--link)}.coll-edit-hint{font-size:14px;opacity:.5;margin-left:4px}.coll-rename-input{flex:1;font-size:16px;font-family:var(--display);border:1px solid var(--line);padding:4px 8px;background:var(--field);color:var(--ink);border-radius:var(--r)}.coll-delete-btn{border:1px solid var(--accent);background:none;color:var(--accent);padding:5px 12px;font-size:13px;cursor:pointer;border-radius:var(--r)}.coll-delete-btn:hover{background:var(--accent);color:var(--paper)}.coll-detail-vis{display:flex;align-items:center;gap:10px}.coll-vis-label{font-size:13px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.04em;white-space:nowrap}.coll-vis-select{border:1px solid var(--line);background:var(--paper-3);color:var(--ink);padding:4px 8px;font-size:13px;border-radius:var(--r)}.coll-section-heading{font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin-bottom:8px}.coll-entries-section{flex:1}.coll-entries-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}.coll-entry-row{display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px solid var(--line-soft)}.coll-entry-info{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.coll-entry-title{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.coll-entry-kind{font-size:11px;text-transform:uppercase;letter-spacing:.04em}.coll-entry-actions{display:flex;align-items:center;gap:6px;flex-shrink:0}.coll-entry-vis-select{border:1px solid var(--line);background:var(--paper-3);color:var(--ink);padding:3px 6px;font-size:12px;border-radius:var(--r)}.coll-entry-remove{border:none;background:none;cursor:pointer;color:var(--muted);font-size:18px;line-height:1;padding:0 4px}.coll-entry-remove:hover{color:var(--accent)}.coll-add-entry-form{border-top:1px solid var(--line-soft);padding-top:12px}.coll-add-entry-row{display:flex;gap:8px;align-items:center}.coll-add-entry-input{flex:1;border:1px solid var(--line);background:var(--paper-3);color:var(--ink);padding:6px 10px;font-size:13px;min-width:0;border-radius:var(--r)}.coll-add-btn{border:none;background:var(--ink);color:var(--paper);padding:6px 14px;font-size:13px;font-weight:600;cursor:pointer;white-space:nowrap;border-radius:var(--r)}.coll-add-btn:hover{opacity:.85}.coll-add-btn:disabled{opacity:.45;cursor:default}.auth-loading{min-height:100vh;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:15px;background:var(--paper)}.user-menu{display:flex;align-items:center;gap:14px;padding-left:6px;flex-shrink:0}.user-name{font-size:12.5px;color:var(--muted-2);letter-spacing:.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:140px}.logout-btn{border:1px solid rgba(255,255,255,.18);background:transparent;color:#c8bfb0;font-size:12px;padding:4px 11px;border-radius:var(--r);cursor:pointer;white-space:nowrap;transition:background .15s,color .15s}.logout-btn:hover{background:#ffffff1a;color:var(--paper)}.logout-btn:disabled{opacity:.5;cursor:default}.login-page,.setup-page{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;background:var(--paper)}.login-card,.setup-card{width:100%;max-width:360px;padding:40px 36px 44px;background:var(--paper-3);border:1px solid var(--line);border-radius:var(--r3);box-shadow:0 2px 20px #141d1812}.login-brand,.setup-brand{font-family:var(--display);font-size:32px;font-weight:600;color:var(--ink);letter-spacing:-.01em;margin:0 0 6px}.login-tagline,.setup-tagline{font-size:13px;color:var(--muted);margin:0 0 28px}.login-field,.setup-field{display:flex;flex-direction:column;gap:5px;margin-bottom:14px}.login-label,.setup-label{font-size:11.5px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}.login-input,.setup-input{width:100%;border:1px solid var(--line);background:var(--field);color:var(--ink);padding:9px 11px;font-size:14px;border-radius:var(--r2);outline:none;transition:border-color .15s}.login-input:focus,.setup-input:focus{border-color:var(--accent)}.login-error,.setup-error{font-size:13px;color:var(--accent);margin:4px 0 8px}.login-submit,.setup-submit{width:100%;margin-top:8px;border:none;background:var(--top);color:var(--paper);font-size:14px;font-weight:600;padding:11px 16px;border-radius:var(--r2);cursor:pointer;letter-spacing:.02em;transition:opacity .15s}.login-submit:hover,.setup-submit:hover{opacity:.85}.login-submit:disabled,.setup-submit:disabled{opacity:.45;cursor:default}.view-tabs{display:flex;gap:2px;margin-bottom:22px;border-bottom:1px solid var(--line-soft);padding-bottom:0}.view-tab{border:none;background:none;color:var(--muted);font-size:13px;font-weight:600;padding:7px 14px;cursor:pointer;border-bottom:2px solid transparent;margin-bottom:-1px;letter-spacing:.02em;transition:color .12s;text-transform:uppercase;letter-spacing:.06em;font-size:11.5px}.view-tab:hover{color:var(--ink)}.view-tab.is-active{color:var(--ink);border-bottom-color:var(--accent)}.form-section{margin-bottom:32px}.form-section h2{font-size:14px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin:0 0 14px}.form-row{display:flex;gap:8px;margin-bottom:10px}.form-field{display:flex;flex-direction:column;gap:5px;margin-bottom:12px}.form-label{font-size:11.5px;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}.field-input{border:1px solid var(--line);background:var(--field);color:var(--ink);padding:8px 10px;font-size:13.5px;border-radius:var(--r);outline:none;transition:border-color .15s;min-width:0}.field-input:focus{border-color:var(--accent)}.field-input--flex{flex:1}.form-msg{font-size:13px;margin:6px 0}.form-msg--ok{color:var(--link)}.form-msg--err{color:var(--accent)}.btn-primary{border:none;background:var(--top);color:var(--paper);font-size:13px;font-weight:600;padding:8px 16px;border-radius:var(--r);cursor:pointer;white-space:nowrap}.btn-primary:hover{opacity:.85}.btn-primary:disabled{opacity:.45;cursor:default}.btn-ghost{border:1px solid var(--line);background:none;color:var(--ink);font-size:13px;padding:7px 14px;border-radius:var(--r);cursor:pointer}.btn-ghost:hover{background:var(--paper-2)}.btn-danger{border:1px solid var(--accent);background:none;color:var(--accent);font-size:13px;padding:7px 14px;border-radius:var(--r);cursor:pointer}.btn-danger:hover{background:var(--accent);color:var(--paper)}.admin-view h1{font-family:var(--display);font-weight:600;font-size:26px;margin:0 0 20px}.admin-table{width:100%;border-collapse:collapse;font-size:13px;margin-bottom:28px}.admin-table th{text-align:left;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);padding:8px 10px;border-bottom:1px solid var(--line);background:var(--paper-2)}.admin-table th:first-child{padding-left:16px}.admin-table td{padding:9px 10px;border-bottom:1px solid var(--line-soft);color:var(--ink);vertical-align:middle}.admin-table td:first-child{padding-left:16px}.admin-table tr:hover td{background:var(--paper-2)}.admin-row-disabled td{opacity:.45}.admin-section{margin-bottom:36px;max-width:860px}.admin-section h2{font-size:14px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin:0 0 14px}.admin-section h3{font-size:13px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin:22px 0 10px}.admin-form{display:flex;flex-direction:column;gap:8px;max-width:480px}.admin-input{border:1px solid var(--line);background:var(--field);color:var(--ink);padding:8px 10px;font-size:13.5px;border-radius:var(--r);outline:none;transition:border-color .15s}.admin-input:focus{border-color:var(--accent)}.admin-action-btn{border:1px solid var(--line);background:none;color:var(--ink);font-size:12px;padding:4px 10px;border-radius:var(--r);cursor:pointer;white-space:nowrap}.admin-action-btn:hover{border-color:var(--accent);color:var(--accent)}.status-badge{display:inline-block;padding:2px 8px;border-radius:var(--r);font-size:11.5px;font-weight:600;text-transform:uppercase;letter-spacing:.04em}.status-active{background:#d8eddf;color:#235c35;border:1px solid #b4d9be}.status-disabled{background:#ede8e0;color:var(--muted);border:1px solid var(--line)}.run-status{display:inline-block;padding:2px 8px;border-radius:var(--r);font-size:11.5px;font-weight:600;text-transform:uppercase;letter-spacing:.04em}.run-status--completed{background:#d8eddf;color:#235c35;border:1px solid #b4d9be}.run-status--failed{background:#f5ddd8;color:#8d3f30;border:1px solid #e0b8b0}.run-status--running{background:#dde8f5;color:#245f72;border:1px solid #b8cde0}.token-banner{background:#d8eddf;border:1px solid #b4d9be;padding:12px 14px;margin-bottom:16px;font-size:13px;border-radius:var(--r2)}.token-banner code{word-break:break-all;display:block;margin-top:6px;padding:6px 8px;background:var(--field);border:1px solid var(--line);border-radius:var(--r);font-size:12px;font-family:ui-monospace,SF Mono,Menlo,monospace}.token-dismiss{margin-top:8px;font-size:12px;border:1px solid var(--line);background:none;cursor:pointer;padding:3px 8px;border-radius:var(--r);color:var(--muted)}.token-dismiss:hover{background:var(--paper-2)}.token-row{display:flex;align-items:center;justify-content:space-between;border:1px solid var(--line);background:var(--paper-3);padding:10px 12px;border-radius:var(--r);margin-bottom:6px}.token-row-info strong{font-size:14px;display:block}.token-row-info .muted{font-size:12px;margin-top:2px}.token-create-row{display:flex;gap:8px;margin-bottom:16px}.checkbox-row{display:flex;align-items:center;gap:10px;margin-bottom:12px;cursor:pointer;font-size:14px}.checkbox-row input[type=checkbox]{width:15px;height:15px;accent-color:var(--accent)}.coll-create-details{margin-top:16px}.coll-create-details summary{font-weight:600;cursor:pointer;font-size:13px;color:var(--link);list-style:none;display:flex;align-items:center;gap:6px;padding:8px 12px;border:1px solid var(--line-soft);border-radius:var(--r2);background:var(--paper-3);width:fit-content}.coll-create-details summary:hover{background:var(--paper-2)}.coll-create-details[open] summary{border-bottom-left-radius:0;border-bottom-right-radius:0}.coll-create-form{border:1px solid var(--line-soft);border-top:none;padding:14px;border-radius:0 0 var(--r2) var(--r2);background:var(--paper-3);display:flex;flex-direction:column;gap:10px;max-width:440px}@media (max-width: 900px){.topbar{grid-template-columns:1fr auto;height:auto;min-height:58px;padding:12px}.switcher,.nav{grid-column:1 / -1}.nav{justify-content:flex-start;overflow-x:auto}.app-shell{height:auto;grid-template-columns:1fr}.context-rail{border-left:0;border-top:1px solid var(--line)}.entry-table{min-width:860px}}.rail-title--editable{cursor:pointer}.rail-title--editable:hover{opacity:.75}.rail-title--editable .edit-icon{display:inline-block;width:.75em;height:.75em;margin-left:.35em;vertical-align:middle;opacity:0;transition:opacity .1s;flex-shrink:0}.rail-title--editable:hover .edit-icon{opacity:.5}.rail-title-input{width:100%;font:inherit;font-size:inherit;font-weight:600;background:transparent;border:none;border-bottom:1px solid currentColor;color:inherit;padding:0;margin:0 0 8px;outline:none} diff --git a/frontend/src/styles.css b/frontend/src/styles.css index e65d9ec..c0c928f 100644 --- a/frontend/src/styles.css +++ b/frontend/src/styles.css @@ -332,7 +332,9 @@ select { .source-icon { display: flex; align-items: center; justify-content: center; width: 1.05em; height: 1.05em; flex-shrink: 0; } .source-icon > * { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; } .source-icon svg { width: 100%; height: 100%; } -.url-cell { color: #555b55; word-break: break-all; } +.url-cell { color: #555b55; white-space: nowrap; text-overflow: ellipsis; word-break: break-all; } +#entries-body .url-cell:hover, +#entries-body .is-selected .url-cell { overflow: visible; white-space: normal; } .type-pill { display: inline-block; padding: 2px 6px; background: #d8e3df; color: #275a5f; border: 1px solid #bfd0ca; border-radius: var(--r); } /* ── Runs view (table) ───────────────────────────────────────────────────── */