prreviewbuddy 0.86.1 → 0.86.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/dist/{delete_review-rwn_-SnJ.js → delete_review-CwKZQlMg.js} +3 -2
- package/dist/main.js +1 -1
- package/dist/server.js +71 -31
- package/package.json +1 -1
- package/static/chunk-BUD1RoN4.js +1 -0
- package/static/chunk-D9x9bcKf.js +1 -0
- package/static/{chunk-BL6xJoZm.js → chunk-Di41wu5k.js} +1 -1
- package/static/chunk-huqt-B16.js +1 -0
- package/static/help.js +1 -1
- package/static/notifications.js +1 -1
- package/static/reviews.js +1 -1
- package/static/runs.js +1 -1
- package/static/settings.js +1 -1
- package/static/shell.css +106 -31
- package/static/workspace.js +66 -66
- package/static/chunk-B2vcrGTe.js +0 -1
- package/static/chunk-DWTt0jUK.js +0 -1
- package/static/chunk-DwdwtB9r.js +0 -1
package/static/reviews.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,I as c,J as ee,K as te,L as ne,M as re,N as l,O as ie,P as u,R as ae,S as oe,T as se,U as ce,V as le,W as ue,X as de,Y as fe,Z as pe,_ as d,a as me,b as he,ct as ge,d as _e,ft as ve,g as f,i as ye,it as be,j as xe,k as Se,n as Ce,q as we,r as Te,rt as Ee,s as De,st as Oe,t as ke,tt as Ae,ut as je,v as Me,w as Ne,x as Pe,y as Fe,z as Ie}from"./chunk-DwdwtB9r.js";import{a as Le,c as Re,i as ze,l as Be,n as Ve,r as He,s as Ue,t as We}from"./chunk-DWTt0jUK.js";import{n as Ge,t as Ke}from"./chunk-B2vcrGTe.js";import{t as qe}from"./chunk-C8kkSv38.js";import{n as Je,r as Ye}from"./chunk-BL6xJoZm.js";function Xe(e,t){t.forEach((t,n)=>{e.children[n]!==t&&e.insertBefore(t,e.children[n]??null)})}async function Ze(e,t,n){if(e.disabled)return;let r=e.getAttribute(`aria-pressed`)!==`true`;Qe(e,r),e.disabled=!0;let i=await t(r).catch(()=>!1);if(e.disabled=!1,!i)return Qe(e,!r);n(r)}function Qe(e,t){e.setAttribute(`aria-pressed`,String(t)),e.innerHTML=t?`★`:`☆`,e.setAttribute(`aria-label`,`${t?`Unpin`:`Pin`} this review`)}function $e(e){let t=e.querySelector(`[data-collections-registry]`)?.textContent??`[]`;try{let e=JSON.parse(t);return Array.isArray(e)?e.filter(e=>!!e&&typeof e.id==`string`&&typeof e.name==`string`):[]}catch{return[]}}function et(e){return(e.dataset.collections??``).split(` `).filter(Boolean)}async function tt(e,t,n){try{let r=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...t,snapshot:n})}),i=await r.json().catch(()=>null);return r.ok&&i&&(typeof i.area==`string`||i.stale===!0)?{ok:!0,answer:i}:{ok:!1,error:i?.error??`That could not be saved. The workspace server refused it.`}}catch{return{ok:!1,error:`The workspace server did not answer. It may have stopped.`}}}var nt=`prb-reviews-selection`;function rt(e,t){let n=new Set(e);return t.filter(e=>(e.dataset.lineage??e.dataset.id??``).split(` `).some(e=>n.has(e))).map(e=>e.dataset.id??``).filter(Boolean)}function it(e,t){return t===``||e.name.toLowerCase().includes(t.trim().toLowerCase())}function at(e,t){let n=e.trim().replace(/\s+/g,` `);if(n!==``)return t.some(e=>e.name.localeCompare(n,void 0,{sensitivity:`base`})===0)?void 0:n}function ot(e,t,n,r){let i=e.ownerDocument,a=(e,t)=>{let r=i.createElement(`label`);r.className=`prb-collections-option`;let a=i.createElement(`input`);return a.type=`checkbox`,a.value=e,a.checked=n.includes(e),a.setAttribute(`data-collections-filter-option`,``),r.append(a,i.createTextNode(` ${t}`)),r},o=t.filter(e=>it(e,r)).map(e=>a(e.id,e.name));it({id:`none`,name:`Uncollected`},r)&&o.unshift(a(Fe,`Uncollected`)),e.replaceChildren(...o)}function st(e,t,n,r){let i=e.ownerDocument,a=t.filter(e=>it(e,r)).map(e=>{let t=Ie(n,e.id),r=i.createElement(`label`);r.className=`prb-collections-option`;let a=i.createElement(`input`);a.type=`checkbox`,a.value=e.id,a.checked=t===`all`,a.indeterminate=t===`some`,a.dataset.membership=t,a.setAttribute(`data-collections-dialog-option`,``);let o=i.createElement(`span`);if(o.textContent=e.name,r.append(a,o),t===`some`){let t=i.createElement(`span`);t.className=`prb-collections-some`,t.textContent=`${n.filter(t=>t.includes(e.id)).length} of ${n.length}`,r.append(t)}return r});if(a.length===0&&t.length===0){let e=i.createElement(`p`);e.className=`prb-collections-none`,e.textContent=`No collections yet. Type a name to make one.`,a.push(e)}e.replaceChildren(...a)}function ct(e,t){return t?`For ${t}. Tick a collection to add it, untick to remove it.`:e===1?`For 1 selected review. Tick a collection to add it, untick to remove it.`:`For ${e} selected reviews. A part-filled box adds the rest; it never removes anything.`}function lt(e){return{title:`Expand or collapse a collection`,mount(t,n){let r=t.ownerDocument,i=r.createElement(`div`);i.className=`prb-palette-results`,i.setAttribute(`role`,`group`),i.setAttribute(`aria-label`,`Collections`);let a=e.collections().map((e,t)=>{let n=r.createElement(`button`);n.type=`button`,n.className=`prb-palette-result prb-palette-collection`,n.dataset.collectionChoice=e.id;let i=r.createElement(`kbd`);i.className=`prb-kbd prb-palette-num`;let a=Re(t);a?i.textContent=a:i.setAttribute(`aria-hidden`,`true`);let o=r.createElement(`span`);o.className=`prb-palette-result-title`,o.textContent=e.name;let s=r.createElement(`span`);s.className=`prb-palette-collection-count`,s.textContent=e.count;let c=r.createElement(`span`);return c.className=`prb-palette-state`,c.textContent=e.open?`Expanded`:`Collapsed`,n.append(i,o,s,c),n});i.replaceChildren(...a);let o=t=>{t&&(n(),e.toggle(t))};i.addEventListener(`click`,e=>{o(e.target.closest(`[data-collection-choice]`)?.dataset.collectionChoice)}),t.addEventListener(`keydown`,e=>{if(e.isComposing||e.metaKey||e.ctrlKey||e.altKey)return;let t=Ue(e.key);if(t!==null)return e.preventDefault(),o(a[t]?.dataset.collectionChoice);let n=a.indexOf(e.target),r=e.key===`ArrowDown`||e.key===`j`?a[Math.min(n+1,a.length-1)]:e.key===`ArrowUp`||e.key===`k`?a[Math.max(n-1,0)]:e.key===`Home`?a[0]:e.key===`End`?a[a.length-1]:void 0;r&&(e.preventDefault(),r.focus())}),t.append(i),a[0]?.focus()}}}function ut(e){let t=e.dataset.id??``,n=e.dataset.placement;return n===void 0||n===`home`?t:`${t}|${n}`}function dt(e,t){let n=e.parentElement?.querySelector(`[data-history-list]`);n&&(n.hidden=!t,e.setAttribute(`aria-expanded`,String(t)))}function ft(e,t,n,r,i=new Map){return{limits:n,...i.size===0?{}:{collectionLimits:Object.fromEntries(i)},expanded:t.filter(e=>e.dataset.id&&e.querySelector(`[data-history-list]:not([hidden])`)).map(ut),main:r?.scrollTop??0,...be(e)}}function pt(e,t){let n=e?.limits;if(!n||typeof n!=`object`)return t;let r={...t};for(let e of d){let t=n[e];typeof t==`number`&&Number.isInteger(t)&&t>r[e]&&(r[e]=t)}return r}function mt(e){let t=e?.collectionLimits,n=new Map;if(!t||typeof t!=`object`||Array.isArray(t))return n;for(let[e,r]of Object.entries(t))e.startsWith(`collection`)&&o(e)&&typeof r==`number`&&Number.isInteger(r)&&r>15&&n.set(e,r);return n}function ht(e,t,n){if(!t)return;n.reveal(pt(t,n.limits),mt(t));let r=new Set(je(t,`expanded`));for(let e of n.cards){let t=e.querySelector(`[data-history-toggle]`);t&&r.has(ut(e))&&dt(t,!0)}let i=Oe(t,`main`);n.pane&&i!==null&&(n.pane.scrollTop=i),ge(e,t.focus,t.focusVisible)}var gt=Ee({ownsRestore:!0});ke(`/restart`);var p=[...document.querySelectorAll(`[data-card][data-placement="home"]`)].sort((e,t)=>Number(e.dataset.rank)-Number(t.dataset.rank)),m=new Map;function _t(){m=new Map;for(let e of document.querySelectorAll(`[data-card]`)){let t=e.dataset.id??``;m.set(t,[...m.get(t)??[],e])}}_t();function vt(e,t){for(let n of m.get(e)??[])t(n)}function h(){return[...m.values()].flat()}var g=$e(document),yt=[...document.querySelectorAll(`[data-operation]`)],bt=document.querySelector(`[data-section="in-progress"]`),xt=e=>e.dataset.inProgressOnly!==void 0,St=Object.fromEntries(d.map(e=>[e,document.querySelector(`[data-cards="${e}"]`)])),Ct=document.querySelector(`.prb-index`);function wt(e){return{id:e.dataset.id??``,collections:et(e),queue:e.dataset.queue===void 0?void 0:Number(e.dataset.queue),status:e.dataset.status??`new`,prState:e.dataset.prState}}var _=document.querySelector(`[data-search]`),v=document.querySelector(`[data-status-filter]`),y=document.querySelector(`[data-author-filter]`),b=document.querySelector(`[data-pr-filter]`),Tt=document.querySelector(`[data-no-matches]`),x=document.querySelector(`[data-count]`),Et=document.querySelector(`[data-clear-filters]`),S=document.querySelector(`[data-collections-filter]`),Dt=document.querySelector(`[data-collections-filter-search]`);function Ot(){if(!S)return;S.hidden=g.length===0;let e=S.querySelector(`[data-collections-filter-label]`);e&&(e.textContent=Ne(D.collections,g)),D.collections.length===0?delete S.dataset.active:S.dataset.active=``;let t=S.querySelector(`[data-collections-filter-options]`);t&&ot(t,g,D.collections,Dt?.value??``)}var C=l();function kt(e){return{stored:Ae({state:e.dataset.lifecycle,at:Number(e.dataset.lifecycleAt)}),activity:de(e.dataset)??{at:0,kind:`created`}}}function At(e){return e.dataset.pinned===`true`}function jt(e){let{stored:t,activity:n}=kt(e);return re(At(e),t,n,et(e).length>0,D.filter)}function Mt(e){let t=jt(e);return t===void 0?.5:d.indexOf(t)}function Nt(e){return[...e].sort((e,t)=>Mt(e)-Mt(t))}var w=new Map,T=document.querySelector(`[data-bulk]`),Pt=document.querySelector(`[data-bulk-count]`),Ft=document.querySelector(`[data-bulk-delete]`),It=document.querySelector(`[data-bulk-question]`),Lt=document.querySelector(`[data-bulk-confirm]`),Rt=document.querySelector(`[data-bulk-actions]`),E=document.querySelector(`[data-bulk-error]`),zt=document.querySelector(`[data-bulk-select-all]`),D=le(window.location.hash),O=new Set,k=!1,A=document.querySelector(`[data-bulk-fetch]`),Bt={},j=[],Vt=!1;function M(){let e=D.query.trim().toLowerCase();D.author!==``&&![...y?.options??[]].some(e=>e.value===D.author)&&(D.author=``),D.collections=D.collections.filter(e=>e===`none`||g.some(t=>t.id===e)),g.length===0&&(D.collections=[]);let n=Nt(t(p.map(e=>({...wt(e),searchText:e.dataset.searchText??``,author:e.dataset.author,card:e})),{...D,query:e}).map(e=>e.card)),r=n.filter(e=>!xt(e));j=r;let a=new Set(t(yt.map(e=>({...wt(e),searchText:e.dataset.searchText??``,author:e.dataset.author,entry:e})),{...D,query:e}).map(e=>e.entry));for(let e of yt)e.hidden=!a.has(e);if(bt){bt.hidden=a.size===0;let e=bt.querySelector(`[data-section-count]`);e&&(e.textContent=String(a.size))}let o=r.filter(e=>jt(e)!==void 0),s=te(o,e=>jt(e),C),c=new Set(d.flatMap(e=>s[e].shown));for(let e of d){let t=St[e];t&&Xe(t,s[e].shown);let n=document.querySelector(`[data-load-more="${e}"]`);n&&(n.hidden=s[e].total<=s[e].shown.length);let r=document.querySelector(`[data-section="${e}"]`);r&&(r.hidden=s[e].total===0);let i=r?.querySelector(`[data-section-count]`);i&&(i.textContent=String(s[e].total))}for(let e of Ht(r))c.add(e);for(let e of h())e.hidden=!c.has(e);if(_&&_.value!==D.query&&(_.value=D.query),y&&(y.value=D.author,D.author===``?delete y.dataset.active:y.dataset.active=``),b||(D.pr=`any`),b&&(b.value=D.pr,D.pr===`any`?delete b.dataset.active:b.dataset.active=``),v&&(v.value=D.filter,D.filter===`all`?delete v.dataset.active:v.dataset.active=``),Ot(),Et&&(Et.hidden=!u(D)),x){let e=e=>e.reduce((e,t)=>e+Number(t.dataset.reviews??1),0);x.textContent=i(e(n),n.length,u(D)?e(p):void 0)}Tt&&(Tt.hidden=n.length>0||a.size>0||p.length===0),Zt(r)}function Ht(e){let t=document.querySelector(`[data-collections-area]`);if(!t)return[];let i=n(D.filter),o=u(D),s=e.flatMap(e=>et(e).map(t=>({card:e,collection:t}))),ee=e=>{let{stored:t,activity:n}=kt(e);return r(At(e),t,n,D.filter)},te=c(s,({card:e,collection:t})=>{let n=ee(e);return n===void 0?void 0:`${n===`completed`?`collection-done`:`collection`}:${t}`},e=>w.get(e)??15),ne=(e,t)=>(m.get(e)??[]).find(e=>e.dataset.placement===`collection:${t}`),re=[],l=!1;for(let e of t.querySelectorAll(`[data-collection]`)){let t=e.dataset.collection??``,n=te.get(`collection:${t}`)??{shown:[],total:0},r=te.get(`collection-done:${t}`)??{shown:[],total:0},c=s.filter(e=>e.collection===t),ee=c.filter(e=>At(e.card)).length,ie=D.collections.length>0&&!D.collections.includes(t),u=!i&&!ie&&(!o||c.length>0);if(e.hidden=!u,!u)continue;l=!0;for(let[i,a]of[[`collection:${t}`,n],[`collection-done:${t}`,r]]){let n=a.shown.map(e=>ne(e.card.dataset.id??``,t)).filter(e=>e!==void 0),r=e.querySelector(`[data-cards="${i}"]`);r&&Xe(r,n),re.push(...n);let o=e.querySelector(`[data-load-more="${i}"]`);o&&(o.hidden=a.total<=a.shown.length)}let ae=e.querySelector(`[data-section="collection:${t}"] > summary [data-section-count]`);ae&&(ae.textContent=Pe(n.total,ee));let se=e.querySelector(`[data-collection-empty]`),ce=oe({active:n.total,completed:r.total,pinned:ee,members:c.length},o);se&&(se.hidden=ce===void 0,se.textContent=ce??``);let le=e.querySelector(`[data-section="collection-done:${t}"]`);le&&(le.hidden=r.total===0);let ue=e.querySelector(`[data-completed-label]`);ue&&(ue.textContent=a(r.total))}return t.hidden=i||!l,re}var Ut=300,N=null;function P(){N!==null&&window.clearTimeout(N),N=null,gt.replace(xe(D),{})}function F(e,t){if(D={...D,...e},C=l(),w=new Map,M(),t===`now`)return P();N!==null&&window.clearTimeout(N),N=window.setTimeout(P,Ut)}window.addEventListener(`pagehide`,()=>{N!==null&&P()}),document.addEventListener(`click`,e=>{N!==null&&e.target?.closest?.(`a[href]`)&&P()},!0),_?.addEventListener(`input`,()=>F({query:_.value},`settled`)),_?.addEventListener(`keydown`,e=>{e.key===`Escape`&&_.value!==``&&(e.preventDefault(),F({query:``},`now`))}),v?.addEventListener(`change`,()=>{F({filter:v.value},`now`)}),y?.addEventListener(`change`,()=>{F({author:y.value},`now`)}),b?.addEventListener(`change`,()=>{F({pr:b.value},`now`)}),Et?.addEventListener(`click`,()=>{F({query:f.query,filter:f.filter,author:f.author,pr:f.pr,collections:f.collections},`now`),_?.focus()}),Ye(),document.addEventListener(`click`,e=>{let t=e.target.closest(`[data-load-more]`)?.dataset.loadMore;if(t&&t.startsWith(`collection`)&&o(t))return w.set(t,(w.get(t)??15)+15),M();!t||!d.includes(t)||(C={...C,[t]:C[t]+15},M())});for(let e of[`popstate`,`hashchange`])window.addEventListener(e,()=>{D=le(window.location.hash),C=l(),w=new Map,M(),qt()});document.addEventListener(`click`,e=>{let t=e.target.closest(`[data-pin]`);if(!t?.dataset.pin)return;e.preventDefault(),e.stopPropagation();let n=t.dataset.pin;Ze(t,e=>fetch(`/pin`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:n,pinned:e})}).then(e=>e.ok),e=>{vt(n,n=>{n.dataset.pinned=String(e);let r=n.querySelector(`[data-pin]`);r&&r!==t&&Qe(r,e),_n(n)}),M()})});async function Wt(e,t){let n;try{let r=await fetch(`/queue`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:e,action:t})});if(!r.ok)return;n=(await r.json()).queue}catch{return}Gt(n),M()}function Gt(e){let t=new Map(e.map((e,t)=>[e,t]));for(let e of h()){let n=t.get(e.dataset.id??``);n===void 0?delete e.dataset.queue:e.dataset.queue=String(n),n!==void 0&&e.dataset.lifecycle!==`active`&&(e.dataset.lifecycle=`active`,delete e.dataset.lifecycleAt,_n(e))}for(let e of document.querySelectorAll(`[data-queue-action][data-queue-id]`)){let n=t.has(e.dataset.queueId??``);e.dataset.queueAction=n?`remove`:`add`,e.textContent=ce(n)}let n=document.querySelector(`[data-queue-option]`);n&&(n.textContent=ue(e.length))}document.addEventListener(`click`,e=>{let t=e.target.closest(`[data-history-toggle]`);if(!t)return;e.preventDefault(),e.stopPropagation();let n=t.parentElement?.querySelector(`[data-history-list]`);n&&dt(t,n.hidden!==!1)});var Kt=document.querySelector(`.prb-shell > main`);function qt(){ht(document,gt.current().ui,{cards:h(),pane:Kt,limits:C,reveal:(e,t)=>{C=e,w=t,M()}})}gt.setCapturer(()=>ft(document,h(),C,Kt,w)),M(),qt();var I=Ge(document,{onOpen:Jt,onClose:Jt});function Jt(e){let t=e.querySelector(`[data-menu-items]`),n=e.querySelector(`[data-menu-confirm]`);t&&(t.hidden=!1),n&&(n.hidden=!0);let r=e.querySelector(`[data-collection-rename-form]`);r&&(r.hidden=!0,J(r,void 0)),e.querySelector(`[data-menu-error]`)?.remove(),e.querySelector(`[data-id-field]`)?.remove()}document.addEventListener(`click`,e=>{let t=e.target,n=t.closest(`[data-menu]`);if(!n||n.matches(`[data-collections-filter]`))return;if(n.matches(`.prb-collection-menu`))return jn(e,t,n);let r=t.closest(`[data-collections-for]`);if(r?.dataset.collectionsFor){e.preventDefault(),e.stopPropagation(),I.closeAll();let t=r.closest(`[data-card]`)?.querySelector(`[data-select]`)?.getAttribute(`aria-label`)?.replace(/^Select /,``);Mn([r.dataset.collectionsFor],{card:t??`this review`});return}let i=t.closest(`[data-copy-id]`);if(i?.dataset.copyId){e.preventDefault(),e.stopPropagation(),Be(i,i.dataset.copyId);return}let a=t.closest(`[data-fetch-review]`);if(a?.dataset.fetchReview){e.preventDefault(),e.stopPropagation(),I.closeAll();let t=a.closest(`[data-card]`);t&&Vn([t]);return}let o=t.closest(`[data-mark-status]`);if(o?.dataset.markId){e.preventDefault(),e.stopPropagation(),I.closeAll(),hn(o.dataset.markId,o.dataset.markStatus===`complete`);return}let s=t.closest(`[data-lifecycle-set]`);if(s?.dataset.lifecycleId){e.preventDefault(),e.stopPropagation(),I.closeAll(),gn([s.dataset.lifecycleId],s.dataset.lifecycleSet);return}let c=t.closest(`[data-queue-action]`);if(c?.dataset.queueId){e.preventDefault(),e.stopPropagation(),I.closeAll(),Wt(c.dataset.queueId,c.dataset.queueAction===`remove`?`remove`:`add`);return}if(t.closest(`[data-delete]`)){e.preventDefault(),e.stopPropagation();let t=n.querySelector(`[data-menu-items]`),r=n.querySelector(`[data-menu-confirm]`);t&&(t.hidden=!0),r&&(r.hidden=!1),e.detail===0&&n.querySelector(`[data-cancel-delete]`)?.focus();return}if(t.closest(`[data-cancel-delete]`)){e.preventDefault(),e.stopPropagation(),Jt(n),e.detail===0&&n.querySelector(`[data-delete]`)?.focus();return}if(t.closest(`[data-confirm-delete]`)){e.preventDefault(),e.stopPropagation(),Yt(n);return}e.preventDefault(),e.stopPropagation()});async function Yt(e){let t=e.querySelector(`[data-delete]`),n=t?.dataset.delete;if(!n)return;let r=e.querySelector(`[data-menu-confirm]`),i=e.querySelector(`[data-confirm-delete]`);i&&(i.disabled=!0,i.textContent=`Deleting`);try{let r=await fetch(`/delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:n,scope:t?.dataset.scope??`review`})});if(r.ok)return void window.location.reload();Xt(e,(await r.json().catch(()=>null))?.error??`That could not be deleted.`)}catch{Xt(e,`The workspace server did not answer. It may have stopped.`)}i&&(i.disabled=!1,i.textContent=`Delete`),r&&(r.hidden=!0);let a=e.querySelector(`[data-menu-items]`);a&&(a.hidden=!1)}function Xt(e,t){e.querySelector(`[data-menu-error]`)?.remove();let n=document.createElement(`p`);n.className=`prb-menu-error`,n.setAttribute(`data-menu-error`,``),n.textContent=t,e.querySelector(`[data-menu-panel]`)?.append(n)}function L(e){k=e,e||O.clear(),Ct&&(e?Ct.dataset.selecting=``:delete Ct.dataset.selecting),document.querySelector(`[data-select-mode]`)?.setAttribute(`aria-pressed`,String(e));for(let t of document.querySelectorAll(`.prb-card-link`))e?t.setAttribute(`aria-disabled`,`true`):t.removeAttribute(`aria-disabled`);R(),M()}function R(){Lt&&(Lt.hidden=!0),Rt&&(Rt.hidden=!1),E&&(E.hidden=!0,E.textContent=``)}function Zt(e){for(let e of h()){let t=O.has(e.dataset.id??``),n=e.querySelector(`[data-select]`);n&&(n.checked=t),t?e.dataset.selected=``:delete e.dataset.selected}if(!T||(T.hidden=!k,!k))return;let t=new Set(h().filter(Qt).map(e=>e.dataset.id)),n=[...O].filter(e=>!t.has(e)).length;Pt&&(Pt.textContent=ee(O.size,n)),zt&&(zt.textContent=we(e.length),zt.disabled=e.every(e=>O.has(e.dataset.id??``))),Ft&&(Ft.textContent=ie(fn()));for(let e of T.querySelectorAll(`[data-bulk-mark], [data-bulk-lifecycle], [data-bulk-queue], [data-bulk-collections], [data-bulk-delete]`))e.disabled=O.size===0;A&&(A.hidden=!Ve(Bt,Ln(V())))}function Qt(e){return!e.hidden&&e.closest(`details:not([open]), [hidden]`)===null}function $t(e){let t=[...e.querySelectorAll(`details[data-section]`)];for(let e of t)e.addEventListener(`toggle`,()=>Zt(j));Je(t,(e,t)=>fetch(`/sections`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({section:e,collapsed:t})}))}$t(document),document.querySelector(`[data-select-mode]`)?.addEventListener(`click`,()=>{L(!k)}),zt?.addEventListener(`click`,()=>{for(let e of j)e.dataset.id&&O.add(e.dataset.id);R(),M()});function en(e){O.has(e)?O.delete(e):O.add(e),R(),M()}document.addEventListener(`change`,e=>{let t=e.target.closest(`[data-select]`);t?.dataset.select&&en(t.dataset.select)}),document.addEventListener(`click`,e=>{if(!k)return;let t=e.target,n=t.closest(`[data-card]`);n?.dataset.id&&(t.closest(`[data-select], [data-pin], [data-menu], [data-history-toggle]`)||(e.preventDefault(),en(n.dataset.id)))}),document.addEventListener(`keydown`,e=>{if(!k||e.key!==`Enter`)return;let t=e.target.closest(`.prb-card-link`)?.closest(`[data-card]`);t?.dataset.id&&(e.preventDefault(),en(t.dataset.id))});var z=qe({doc:document,item:`[data-card]`,link:`.prb-card-link`,walk:()=>[...document.querySelectorAll(`[data-card]`)].filter(Qt),enterAllowed:()=>!k,background:()=>Kt,leadIn:e=>[...e.closest(`[data-cards]`)?.querySelectorAll(`[data-card]:not([hidden])`)??[]][0]===e?e.closest(`details[data-section]`)?.querySelector(`summary`)??null:null});function tn(){return z.holdsKeys()?z.current()?.querySelector(`:scope > [data-menu]`)??null:null}var nn=8;function rn(e){let t=e.querySelector(`.prb-card-link`);t&&(t.focus({preventScroll:!0}),document.activeElement!==t&&document.activeElement?.blur(),N!==null&&P(),gt.leaving(),an=!0,window.location.assign(t.href))}var an=!1,on={title:`Search reviews`,mount(e,t){let n=document.createElement(`input`);n.type=`search`,n.className=`prb-palette-input`,n.placeholder=_?.placeholder??``,n.setAttribute(`aria-label`,`Search reviews`),n.spellcheck=!1,n.value=_?.value??``;let r=document.createElement(`p`);r.className=`prb-palette-summary`,r.setAttribute(`aria-live`,`polite`);let i=document.createElement(`div`);i.className=`prb-palette-results`,i.setAttribute(`role`,`group`),i.setAttribute(`aria-label`,`Matching reviews`);let a=()=>{let e=j.slice(0,nn);i.replaceChildren(...e.map(e=>{let t=document.createElement(`button`);t.type=`button`,t.className=`prb-palette-result`,t.dataset.resultId=e.dataset.id??``;let n=document.createElement(`span`);n.className=`prb-palette-result-title`,n.textContent=e.querySelector(`.prb-card-head h2`)?.textContent??``;let r=document.createElement(`span`);return r.className=`prb-palette-result-where`,r.textContent=[e.querySelector(`.prb-card-repo`)?.textContent,e.querySelector(`.prb-card-branch`)?.textContent].filter(Boolean).join(` · `),t.append(n,r),t})),r.textContent=j.length===0?`No reviews match.`:j.length>e.length?`The first ${e.length} of ${x?.textContent??j.length}`:x?.textContent??``},o=()=>[...i.querySelectorAll(`.prb-palette-result`)],s=e=>{let n=p.find(t=>t.dataset.id===e?.dataset.resultId);n&&(t(),rn(n))};n.addEventListener(`input`,()=>{_&&(_.value=n.value,_.dispatchEvent(new Event(`input`,{bubbles:!0})),a())}),i.addEventListener(`click`,e=>s(e.target.closest(`.prb-palette-result`)??void 0)),e.addEventListener(`keydown`,e=>{if(e.isComposing)return;let t=o(),r=t.indexOf(e.target);if(e.key===`Enter`&&e.target===n)return e.preventDefault(),s(t[0]);let i=e.key===`ArrowDown`?r<0?t[0]:t[r+1]:e.key===`ArrowUp`?r<=0?n:t[r-1]:null;i&&(e.preventDefault(),i.focus())}),e.append(n,r,i),a(),n.focus(),n.select()}},sn={title:`Filters`,mount(e){let t=document.createElement(`p`);t.className=`prb-palette-summary`,t.setAttribute(`aria-live`,`polite`);let n=()=>{t.textContent=x?.textContent??``},r=[v,y,b].flatMap(e=>{if(!e)return[];let t=document.createElement(`label`);t.className=`prb-palette-field`;let r=document.createElement(`span`),i=(e.getAttribute(`aria-label`)??``).replace(/^Filter by /,``);r.textContent=i.charAt(0).toUpperCase()+i.slice(1);let a=document.createElement(`select`);for(let t of e.options)a.append(new Option(t.text,t.value));return a.value=e.value,a.addEventListener(`change`,()=>{e.value=a.value,e.dispatchEvent(new Event(`change`,{bubbles:!0})),n()}),t.append(r,a),[t]});e.append(...r,t),n(),r[0]?.querySelector(`select`)?.focus()}};function cn(e){let t=()=>document.querySelector(`details[data-section="${e}"]`);return{available:()=>!!(t()&&!t().hidden),state:()=>{let e=t();return e&&!e.hidden?e.open?`Expanded`:`Collapsed`:null},run:()=>{let e=t();e&&(e.open=!e.open)}}}var ln=Object.fromEntries(Me.map(e=>[`reviews.section.${e}`,cn(e)]));function un(){return[...document.querySelectorAll(`[data-collections-area]:not([hidden]) [data-collection]:not([hidden])`)].flatMap(e=>{let t=e.querySelector(`:scope > details[data-section]`);if(!t)return[];let n=t.querySelector(`[data-collection-name]`)?.textContent??``,r=t.querySelector(`:scope > summary [data-section-count]`)?.textContent??``;return[{id:e.dataset.collection??``,name:n,count:r,open:t.open}]})}var B=document.querySelector(`[data-collection-new]`),dn=_e(`reviews`,{...ln,"reviews.search":{available:()=>_!==null,panel:on},"reviews.filters":{available:()=>v!==null,panel:sn},"reviews.collection.new":{available:()=>B!==null&&!B.disabled,run:()=>B?.click()},"reviews.collection.fold":{available:()=>un().length>0,panel:lt({collections:un,toggle:e=>{let t=document.querySelector(`[data-collection="${CSS.escape(e)}"] > details[data-section]`);t&&(t.open=!t.open)}})},"reviews.next":{run:()=>z.move(1)},"reviews.previous":{run:()=>z.move(-1)},"reviews.open":{available:()=>z.enterOpens(),run:()=>z.open()},"reviews.openInNewTab":{available:()=>z.enterOpens(),run:()=>z.openInNewTab()},"reviews.menu":{available:()=>tn()!==null,run:()=>{let e=tn();e&&I.open(e,{focusFirst:!0,returnFocus:()=>z.refocus()})}}},{onOpen:()=>I.closeAll(),onSettle:()=>$()});function V(){return Nt(p.filter(e=>O.has(e.dataset.id??``)))}function fn(){return V().reduce((e,t)=>e+Number(t.dataset.reviews??1),0)}function H(e){E&&(E.textContent=e,E.hidden=!1)}function U(e){for(let t of T?.querySelectorAll(`button`)??[])t.disabled=e}async function pn(e){let t=[...O];if(t.length!==0){U(!0);try{if(!(await fetch(`/status`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ids:t,complete:e})})).ok)return U(!1),H(`That could not be saved. The workspace server refused it.`)}catch{return U(!1),H(`The workspace server did not answer. It may have stopped.`)}mn(V(),e),U(!1),L(!1)}}function mn(e,t){let n=t?`complete`:`in-progress`,r=t?`in-progress`:`complete`;for(let t of e.flatMap(e=>m.get(e.dataset.id??``)??[e])){t.dataset.status=n;let e=t.querySelector(`.prb-card-status`);e&&(e.dataset.status=n,e.textContent=fe(n));let i=t.querySelector(`[data-mark-status]`);i&&(i.dataset.markStatus=r,i.textContent=ne(r))}}async function hn(e,t){try{if(!(await fetch(`/status`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ids:[e],complete:t})})).ok)return}catch{return}mn(p.filter(t=>t.dataset.id===e),t),M()}async function gn(e,t){let n;try{let r=await fetch(`/lifecycle`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ids:e,state:t})});n=r.ok?await r.json().catch(()=>null):null}catch{n=null}if(!n)return!1;let r=new Set(e);for(let e of h())r.has(e.dataset.id??``)&&(e.dataset.lifecycle=t,t===`active`?delete e.dataset.lifecycleAt:e.dataset.lifecycleAt=String(n.at),_n(e));return Gt(n.queue),M(),!0}function _n(t){let{stored:n,activity:r}=kt(t),i=t.querySelector(`[data-lifecycle-chip]`);if(i){let e=he(At(t),n,r);i.textContent=e??``,i.hidden=e===void 0}for(let i of t.querySelectorAll(`[data-lifecycle-set]`)){let t=i.dataset.lifecycleSet;i.hidden=!e(t,n,r),i.textContent=pe(t,n,r)}}async function vn(e){let t=[...O];if(t.length===0)return;U(!0);let n=await gn(t,e);if(U(!1),!n)return H(`That could not be saved. The workspace server refused it or did not answer.`);L(!1)}async function yn(){let e=[...O];if(e.length===0)return;U(!0);let t=null;try{let n=await fetch(`/delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ids:e})});if(t=n.ok?await n.json().catch(()=>null):null,!t)return U(!1),R(),H(`Nothing was deleted. The workspace server refused it.`)}catch{return U(!1),R(),H(`The workspace server did not answer. It may have stopped.`)}let n=t.blocked??[],r=new Set(n.map(e=>e.id));for(let e of V()){let t=e.dataset.id??``;r.has(t)||vt(t,e=>e.remove())}p=p.filter(e=>e.isConnected),_t(),O.clear();for(let e of r)O.add(e);if(U(!1),R(),n.length===0)return L(!1);M(),H([...new Set(n.map(e=>e.error))].join(` `))}async function bn(){let e=V().map(e=>e.dataset.id??``).filter(Boolean);if(e.length===0)return;U(!0);let t=null;try{let n=await fetch(`/queue`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ids:e,action:`add`})});t=n.ok?await n.json().catch(()=>null):null}catch{return U(!1),R(),H(`The workspace server did not answer. It may have stopped.`)}if(!t?.queue)return U(!1),R(),H(`Nothing was added. The workspace server refused it.`);Gt(t.queue);let n=t.refused??[];O.clear();for(let e of n)O.add(e.id);if(U(!1),R(),n.length===0)return L(!1);M(),H([...new Set(n.map(e=>e.error))].join(` `))}T?.addEventListener(`click`,e=>{let t=e.target;if(t.closest(`[data-bulk-queue]`))return void bn();if(t.closest(`[data-bulk-collections]`))return Mn(V().map(e=>e.dataset.id??``).filter(Boolean),{selection:!0});let n=t.closest(`[data-bulk-mark]`);if(n)return void pn(n.dataset.bulkMark===`complete`);let r=t.closest(`[data-bulk-lifecycle]`);if(r)return void vn(r.dataset.bulkLifecycle);if(t.closest(`[data-bulk-delete]`)){It&&(It.textContent=Se(fn())),Rt&&(Rt.hidden=!0),Lt&&(Lt.hidden=!1);return}if(t.closest(`[data-bulk-confirm-delete]`))return void yn();if(t.closest(`[data-bulk-cancel-delete]`))return R();if(t.closest(`[data-bulk-cancel]`))return L(!1)});var W=document.querySelector(`[data-collections-dialog]`),xn=document.querySelector(`[data-collections-dialog-list]`),G=document.querySelector(`[data-collections-dialog-search]`),K=document.querySelector(`[data-collections-dialog-create]`),Sn=document.querySelector(`[data-collections-dialog-error]`),Cn=document.querySelector(`[data-collections-dialog-for]`),q=[],wn=!1,Tn=!1,En=document.body.dataset.cardsSnapshot??``;function Dn(e,t){return tt(e,t,En)}function On(e){if(e.stale||e.area===void 0){try{let e={ids:[...O],selecting:k};window.sessionStorage.setItem(nt,JSON.stringify(e))}catch{}W?.close(),window.location.reload();return}let t=e.area,n=document.querySelector(`[data-collections-area]`);if(n){let e=n.contains(document.activeElement)?be(document):null,r=document.createElement(`template`);r.innerHTML=t.trim();let i=r.content.firstElementChild;if(i){if(n.replaceWith(i),$t(i),k)for(let e of i.querySelectorAll(`.prb-card-link`))e.setAttribute(`aria-disabled`,`true`);e&&ge(document,e.focus,e.focusVisible)}}g=e.collections;for(let t of p){let n=e.memberOf[t.dataset.id??``]??[];t.dataset.collections=n.join(` `);let r=t.querySelector(`[data-collections-line]`),i=se(n,g);r&&(r.textContent=i??``,r.hidden=i===void 0)}for(let t of yt){let n=e.operations?.[t.dataset.key??``];n&&(t.dataset.collections=n.join(` `))}_t(),zn(),M()}function J(e,t){let n=e.querySelector(`[data-collection-error]`);n&&(n.textContent=t??``,n.hidden=t===void 0)}Dt?.addEventListener(`input`,()=>Ot()),S?.addEventListener(`change`,e=>{let t=e.target.closest(`[data-collections-filter-option]`);if(!t)return;let n=t.checked?[...D.collections,t.value]:D.collections.filter(e=>e!==t.value);F({collections:[...new Set(n)]},`now`),S.querySelector(`[data-collections-filter-option][value="${CSS.escape(t.value)}"]`)?.focus()});var Y=document.querySelector(`[data-collection-new-dialog]`),X=Y?.querySelector(`[data-collection-name-input]`)??null,kn=Y?.querySelector(`[data-collection-create]`)??null,Z=!1;function An(){B&&(B.disabled=Z),X&&(X.readOnly=Z),kn&&(kn.disabled=Z||(X?.value.trim()??``)===``)}B?.addEventListener(`click`,()=>{Y&&(I.closeAll(),X&&(X.value=``),An(),J(Y,void 0),Y.showModal(),X?.focus())}),X?.addEventListener(`input`,()=>{An(),Y&&J(Y,void 0)}),Y?.querySelector(`[data-collection-cancel]`)?.addEventListener(`click`,()=>Y.close()),Y?.addEventListener(`close`,()=>$()),document.addEventListener(`submit`,e=>{let t=e.target;if(t.matches(`[data-collection-new-form]`)){e.preventDefault();let n=X?.value??``;if(n.trim()===``)return;Z=!0,An(),Dn(`/collections`,{action:`create`,name:n}).then(e=>{Z=!1,An();let n=Y?.open===!0;if(!e.ok)return J(t,e.error);Y?.close(),On(e.answer),n&&document.querySelector(`[data-collection="${CSS.escape(e.answer.id??``)}"] summary`)?.focus({focusVisible:!1})});return}let n=t.closest(`[data-collection-rename-form]`);if(n){e.preventDefault();let t=n.querySelector(`[data-collection-name-input]`)?.value??``,r=n.dataset.collectionRenameForm??``;Dn(`/collections`,{action:`rename`,id:r,name:t}).then(e=>{if(!e.ok)return J(n,e.error);I.closeAll(),On(e.answer),document.querySelector(`[data-collection="${CSS.escape(r)}"] summary`)?.focus({focusVisible:!1})})}});function jn(e,t,n){let r=n.querySelector(`[data-menu-items]`),i=n.querySelector(`[data-collection-rename-form]`),a=n.querySelector(`[data-menu-confirm]`);if(t.closest(`[data-collection-rename]`)&&i){e.preventDefault(),r&&(r.hidden=!0),i.hidden=!1;let t=i.querySelector(`[data-collection-name-input]`);t?.focus(),t?.select();return}if(t.closest(`[data-collection-delete]`)&&a){e.preventDefault(),r&&(r.hidden=!0),a.hidden=!1,e.detail===0&&n.querySelector(`[data-cancel-delete]`)?.focus();return}if(t.closest(`[data-collection-cancel], [data-cancel-delete]`)){e.preventDefault(),Jt(n);return}let o=t.closest(`[data-collection-confirm-delete]`);if(o?.dataset.collectionConfirmDelete){e.preventDefault(),o.disabled=!0;let t=o.dataset.collectionConfirmDelete;Dn(`/collections`,{action:`delete`,id:t}).then(e=>{if(o.disabled=!1,!e.ok)return Xt(n,e.error);I.closeAll(),On(e.answer),D.collections.includes(t)&&P(),document.querySelector(`[data-collection-new]`)?.focus()})}}function Mn(e,t){!W||e.length===0||(I.closeAll(),q=[...e],wn=!1,Tn=`selection`in t,Cn&&(Cn.textContent=ct(e.length,`card`in t?t.card:void 0)),G&&(G.value=``),Pn(void 0),Q(),W.showModal(),G?.focus())}function Nn(){return q.map(e=>et(p.find(t=>t.dataset.id===e)??document.createElement(`div`)))}function Q(){let e=G?.value??``;xn&&st(xn,g,Nn(),e);let t=at(e,g);K&&(K.hidden=t===void 0,K.textContent=t===void 0?``:`Create “${t}” and add ${q.length===1?`this review`:`these ${q.length}`}`)}function Pn(e){Sn&&(Sn.textContent=e??``,Sn.hidden=e===void 0)}async function Fn(e){Pn(void 0);let t=await Dn(`/collections/members`,{ids:q,...e});if(!t.ok)return Pn(t.error),Q();wn=!0,On(t.answer);let n=t.answer.refused??[];n.length>0&&(q=q.filter(e=>!n.some(t=>t.id===e)),Pn([...new Set(n.map(e=>e.error))].join(` `))),Q()}G?.addEventListener(`input`,()=>Q()),G?.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),K&&!K.hidden&&K.click())}),K?.addEventListener(`click`,()=>{let e=at(G?.value??``,g);e!==void 0&&Fn({action:`add`,create:e}).then(()=>{G&&(G.value=``),Q(),G?.focus()})}),xn?.addEventListener(`change`,e=>{let t=e.target.closest(`[data-collections-dialog-option]`);if(!t)return;let n=ae(t.dataset.membership??`none`),r=t.value;Fn({action:n,collection:r}).then(()=>{xn.querySelector(`[data-collections-dialog-option][value="${CSS.escape(r)}"]`)?.focus()})}),document.querySelector(`[data-collections-dialog-close]`)?.addEventListener(`click`,()=>W?.close());try{let e=window.sessionStorage.getItem(nt);if(e){window.sessionStorage.removeItem(nt);let t=JSON.parse(e),n=Array.isArray(t.ids)?t.ids.filter(e=>typeof e==`string`):[];if(t.selecting===!0||n.length>0){L(!0);for(let e of rt(n,p))O.add(e);M()}}}catch{}W?.addEventListener(`close`,()=>{wn&&k&&Tn&&L(!1),q=[],$()}),ve(window,()=>window.location.reload());var In=`prb-fetch-summary`;function Ln(e){return e.map(e=>({lineage:(e.dataset.lineage??e.dataset.id??``).split(` `).filter(Boolean)}))}function Rn(e){return He(Ln(e),Bt)}function zn(){for(let e of h()){let t=e.querySelector(`[data-fetch-review]`);t&&(t.hidden=!Ve(Bt,Ln([e])))}}async function Bn(){try{let e=await fetch(`/fetch-updates`);if(!e.ok)return;Bt=(await e.json()).targets??{}}catch{return}zn(),M()}async function Vn(e,t){let n=Rn(e);if(Vt||n.repositories===0)return;Vt=!0;let r=[A,...document.querySelectorAll(`[data-fetch-review]`)];for(let e of r)e&&(e.disabled=!0);t&&(t.textContent=Le(n.repositories));let i=null;try{let e=await fetch(`/fetch-updates`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ids:n.ids})});e.ok&&(i=await e.json())}catch{}Vt=!1;for(let e of r)e&&(e.disabled=!1);t&&(t.textContent=We),M();let a=i??{repositories:n.repositories,fetched:0,failed:[],moved:0},o={kind:a.fetched<a.repositories?`failed`:`ready`,text:ze(a)};if(a.moved>0||Wn){try{window.sessionStorage.setItem(In,JSON.stringify(o))}catch{}if(!Gn())return void window.location.reload();Wn=!0}Te(me(),o)}try{let e=window.sessionStorage.getItem(In);if(e){window.sessionStorage.removeItem(In);let t=JSON.parse(e);typeof t.kind==`string`&&typeof t.text==`string`&&Te(me(),{kind:t.kind,text:t.text})}}catch{}A?.addEventListener(`click`,()=>void Vn(V(),A)),Bn();var Hn=document.body.dataset.indexRevision??``,Un=document.body.dataset.live===`true`?Date.now():0,Wn=!1;function Gn(){let e=W?.open===!0||Y?.open===!0||document.activeElement?.closest(`[data-collections-area], [data-collections-filter]`)!=null;return O.size>0||document.activeElement===_||Vt||dn.isOpen()||an||e}function $(){Wn&&!Gn()&&window.location.reload()}async function Kn(){try{let e=await fetch(`/revision`);if(e.ok){De(document,!0);let t=await e.json();Ce(document,t),t.live&&Un===0&&(Un=Date.now()),t.live||(Un=0);let n=s(Hn,t.revision??``,Gn());if(n===`reload`)return void window.location.reload();n===`hold`&&(Wn=!0)}}catch{De(document,!1)}window.setTimeout(()=>void Kn(),Ke(Un===0?2**53-1:Date.now()-Un))}Kn(),_?.addEventListener(`blur`,$),document.addEventListener(`click`,()=>window.setTimeout($,0)),ye();
|
|
1
|
+
import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,H as c,I as l,J as ee,L as te,M as ne,N as re,O as ie,P as ae,Q as oe,R as u,S as se,T as ce,U as le,V as ue,W as de,X as fe,Y as pe,Z as me,_t as he,a as ge,b as d,ct as _e,et as ve,ft as ye,h as be,ht as xe,i as Se,it as Ce,j as we,k as Te,l as Ee,lt as De,m as Oe,n as ke,nt as Ae,o as je,ot as Me,p as Ne,pt as Pe,q as Fe,r as Ie,s as Le,t as Re,tt as ze,w as Be,x as f,z as Ve}from"./chunk-D9x9bcKf.js";import{a as He,c as Ue,i as We,n as Ge,r as Ke,s as qe,t as Je,u as Ye,x as Xe}from"./chunk-huqt-B16.js";import{n as Ze,t as Qe}from"./chunk-BUD1RoN4.js";import{t as $e}from"./chunk-C8kkSv38.js";import{n as et,r as tt}from"./chunk-Di41wu5k.js";function nt(e,t){t.forEach((t,n)=>{e.children[n]!==t&&e.insertBefore(t,e.children[n]??null)})}async function rt(e,t,n){if(e.disabled)return;let r=e.getAttribute(`aria-pressed`)!==`true`;it(e,r),e.disabled=!0;let i=await t(r).catch(()=>!1);if(e.disabled=!1,!i)return it(e,!r);n(r)}function it(e,t){e.setAttribute(`aria-pressed`,String(t)),e.innerHTML=t?`★`:`☆`,e.setAttribute(`aria-label`,`${t?`Unpin`:`Pin`} this review`)}function at(e){let t=e.querySelector(`[data-collections-registry]`)?.textContent??`[]`;try{let e=JSON.parse(t);return Array.isArray(e)?e.filter(e=>!!e&&typeof e.id==`string`&&typeof e.name==`string`):[]}catch{return[]}}function ot(e){return(e.dataset.collections??``).split(` `).filter(Boolean)}async function st(e,t,n){try{let r=await fetch(e,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({...t,snapshot:n})}),i=await r.json().catch(()=>null);return r.ok&&i&&(typeof i.area==`string`||i.stale===!0)?{ok:!0,answer:i}:{ok:!1,error:i?.error??`That could not be saved. The workspace server refused it.`}}catch{return{ok:!1,error:`The workspace server did not answer. It may have stopped.`}}}var ct=`prb-reviews-selection`;function lt(e,t){let n=new Set(e);return t.filter(e=>(e.dataset.lineage??e.dataset.id??``).split(` `).some(e=>n.has(e))).map(e=>e.dataset.id??``).filter(Boolean)}function ut(e,t){return t===``||e.name.toLowerCase().includes(t.trim().toLowerCase())}function dt(e,t){let n=e.trim().replace(/\s+/g,` `);if(n!==``)return t.some(e=>e.name.localeCompare(n,void 0,{sensitivity:`base`})===0)?void 0:n}function ft(e,t,n,i){let a=e.ownerDocument,o=(e,t)=>{let r=a.createElement(`label`);r.className=`prb-collections-option`;let i=a.createElement(`input`);return i.type=`checkbox`,i.value=e,i.checked=n.includes(e),i.setAttribute(`data-collections-filter-option`,``),r.append(i,a.createTextNode(` ${t}`)),r},s=t.filter(e=>ut(e,i)).map(e=>o(e.id,e.name));ut({id:`none`,name:`Uncollected`},i)&&s.unshift(o(r,`Uncollected`)),e.replaceChildren(...s)}function pt(e,t,n,r){let i=e.ownerDocument,a=t.filter(e=>ut(e,r)).map(e=>{let t=le(n,e.id),r=i.createElement(`label`);r.className=`prb-collections-option`;let a=i.createElement(`input`);a.type=`checkbox`,a.value=e.id,a.checked=t===`all`,a.indeterminate=t===`some`,a.dataset.membership=t,a.setAttribute(`data-collections-dialog-option`,``);let o=i.createElement(`span`);if(o.textContent=e.name,r.append(a,o),t===`some`){let t=i.createElement(`span`);t.className=`prb-collections-some`,t.textContent=`${n.filter(t=>t.includes(e.id)).length} of ${n.length}`,r.append(t)}return r});if(a.length===0&&t.length===0){let e=i.createElement(`p`);e.className=`prb-collections-none`,e.textContent=`No collections yet. Type a name to make one.`,a.push(e)}e.replaceChildren(...a)}function mt(e,t){return t?`For ${t}. Tick a collection to add it, untick to remove it.`:e===1?`For 1 selected review. Tick a collection to add it, untick to remove it.`:`For ${e} selected reviews. A part-filled box adds the rest; it never removes anything.`}function ht(e){return{title:`Expand or collapse a collection`,mount(t,n){let r=t.ownerDocument,i=r.createElement(`div`);i.className=`prb-palette-results`,i.setAttribute(`role`,`group`),i.setAttribute(`aria-label`,`Collections`);let a=e.collections().map((e,t)=>{let n=r.createElement(`button`);n.type=`button`,n.className=`prb-palette-result prb-palette-collection`,n.dataset.collectionChoice=e.id;let i=r.createElement(`kbd`);i.className=`prb-kbd prb-palette-num`;let a=Ue(t);a?i.textContent=a:i.setAttribute(`aria-hidden`,`true`);let o=r.createElement(`span`);o.className=`prb-palette-result-title`,o.textContent=e.name;let s=r.createElement(`span`);s.className=`prb-palette-collection-count`,s.textContent=e.count;let c=r.createElement(`span`);return c.className=`prb-palette-state`,c.textContent=e.open?`Expanded`:`Collapsed`,n.append(i,o,s,c),n});i.replaceChildren(...a);let o=t=>{t&&(n(),e.toggle(t))};i.addEventListener(`click`,e=>{o(e.target.closest(`[data-collection-choice]`)?.dataset.collectionChoice)}),t.addEventListener(`keydown`,e=>{if(e.isComposing||e.metaKey||e.ctrlKey||e.altKey)return;let t=qe(e.key);if(t!==null)return e.preventDefault(),o(a[t]?.dataset.collectionChoice);let n=a.indexOf(e.target),r=e.key===`ArrowDown`||e.key===`j`?a[Math.min(n+1,a.length-1)]:e.key===`ArrowUp`||e.key===`k`?a[Math.max(n-1,0)]:e.key===`Home`?a[0]:e.key===`End`?a[a.length-1]:void 0;r&&(e.preventDefault(),r.focus())}),t.append(i),a[0]?.focus()}}}function gt(e){let t=e.dataset.id??``,n=e.dataset.placement;return n===void 0||n===`home`?t:`${t}|${n}`}function _t(e,t){let n=e.parentElement?.querySelector(`[data-history-list]`);n&&(n.hidden=!t,e.setAttribute(`aria-expanded`,String(t)))}function vt(e,t,n,r,i=new Map){return{limits:n,...i.size===0?{}:{collectionLimits:Object.fromEntries(i)},expanded:t.filter(e=>e.dataset.id&&e.querySelector(`[data-history-list]:not([hidden])`)).map(gt),main:r?.scrollTop??0,...De(e)}}function yt(e,t){let n=e?.limits;if(!n||typeof n!=`object`)return t;let r={...t};for(let e of f){let t=n[e];typeof t==`number`&&Number.isInteger(t)&&t>r[e]&&(r[e]=t)}return r}function bt(e){let t=e?.collectionLimits,n=new Map;if(!t||typeof t!=`object`||Array.isArray(t))return n;for(let[e,r]of Object.entries(t))e.startsWith(`collection`)&&Ve(e)&&typeof r==`number`&&Number.isInteger(r)&&r>15&&n.set(e,r);return n}function xt(e,t,n){if(!t)return;n.reveal(yt(t,n.limits),bt(t));let r=new Set(xe(t,`expanded`));for(let e of n.cards){let t=e.querySelector(`[data-history-toggle]`);t&&r.has(gt(e))&&_t(t,!0)}let i=ye(t,`main`);n.pane&&i!==null&&(n.pane.scrollTop=i),Pe(e,t.focus,t.focusVisible)}var St=_e({ownsRestore:!0});Re(`/restart`);var p=[...document.querySelectorAll(`[data-card][data-placement="home"]`)].sort((e,t)=>Number(e.dataset.rank)-Number(t.dataset.rank)),m=new Map;function Ct(){m=new Map;for(let e of document.querySelectorAll(`[data-card]`)){let t=e.dataset.id??``;m.set(t,[...m.get(t)??[],e])}}Ct();function wt(e,t){for(let n of m.get(e)??[])t(n)}function h(){return[...m.values()].flat()}var g=at(document),Tt=[...document.querySelectorAll(`[data-operation]`)],Et=document.querySelector(`[data-section="in-progress"]`),Dt=e=>e.dataset.inProgressOnly!==void 0,Ot=Object.fromEntries(f.map(e=>[e,document.querySelector(`[data-cards="${e}"]`)])),kt=document.querySelector(`.prb-index`);function At(e){return{id:e.dataset.id??``,collections:ot(e),queue:e.dataset.queue===void 0?void 0:Number(e.dataset.queue),status:e.dataset.status??`new`,prState:e.dataset.prState}}var _=document.querySelector(`[data-search]`),v=document.querySelector(`[data-status-filter]`),y=document.querySelector(`[data-author-filter]`),b=document.querySelector(`[data-pr-filter]`),jt=document.querySelector(`[data-no-matches]`),Mt=document.querySelector(`[data-count]`),Nt=document.querySelector(`[data-clear-filters]`),x=document.querySelector(`[data-collections-filter]`),Pt=document.querySelector(`[data-collections-filter-search]`);function Ft(){if(!x)return;x.hidden=g.length===0;let e=x.querySelector(`[data-collections-filter-label]`);e&&(e.textContent=ie(D.collections,g)),D.collections.length===0?delete x.dataset.active:x.dataset.active=``;let t=x.querySelector(`[data-collections-filter-options]`);t&&ft(t,g,D.collections,Pt?.value??``)}var S=te();function It(e){return{stored:Me({state:e.dataset.lifecycle,at:Number(e.dataset.lifecycleAt)}),activity:ze(e.dataset)??{at:0,kind:`created`}}}function Lt(e){return e.dataset.pinned===`true`}function Rt(e){let{stored:t,activity:n}=It(e);return l(Lt(e),t,n,ot(e).length>0,D.filter)}function zt(e){let t=Rt(e);return t===void 0?.5:f.indexOf(t)}function Bt(e){return[...e].sort((e,t)=>zt(e)-zt(t))}var C=new Map,w=document.querySelector(`[data-bulk]`),Vt=document.querySelector(`[data-bulk-count]`),Ht=document.querySelector(`[data-bulk-detail]`),Ut=document.querySelector(`[data-bulk-delete]`),Wt=document.querySelector(`[data-bulk-delete-label]`),Gt=document.querySelector(`[data-bulk-exit]`),Kt=document.querySelector(`[data-bulk-more]`),qt=document.querySelector(`[data-bulk-question]`),T=document.querySelector(`[data-bulk-confirm]`),Jt=document.querySelector(`[data-bulk-actions]`),E=document.querySelector(`[data-bulk-error]`),Yt=document.querySelector(`[data-bulk-select-all]`),D=s(window.location.hash),O=new Set,k=!1,A=document.querySelector(`[data-bulk-fetch]`),Xt={},j=[],Zt=!1;function M(){let e=D.query.trim().toLowerCase();D.author!==``&&![...y?.options??[]].some(e=>e.value===D.author)&&(D.author=``),D.collections=D.collections.filter(e=>e===`none`||g.some(t=>t.id===e)),g.length===0&&(D.collections=[]);let t=Bt(ae(p.map(e=>({...At(e),searchText:e.dataset.searchText??``,author:e.dataset.author,card:e})),{...D,query:e}).map(e=>e.card)),n=t.filter(e=>!Dt(e));j=n;let r=new Set(ae(Tt.map(e=>({...At(e),searchText:e.dataset.searchText??``,author:e.dataset.author,entry:e})),{...D,query:e}).map(e=>e.entry));for(let e of Tt)e.hidden=!r.has(e);if(Et){Et.hidden=r.size===0;let e=Et.querySelector(`[data-section-count]`);e&&(e.textContent=String(r.size))}let i=n.filter(e=>Rt(e)!==void 0),a=fe(i,e=>Rt(e),S),o=new Set(f.flatMap(e=>a[e].shown));for(let e of f){let t=Ot[e];t&&nt(t,a[e].shown);let n=document.querySelector(`[data-load-more="${e}"]`);n&&(n.hidden=a[e].total<=a[e].shown.length);let r=document.querySelector(`[data-section="${e}"]`);r&&(r.hidden=a[e].total===0);let i=r?.querySelector(`[data-section-count]`);i&&(i.textContent=String(a[e].total))}for(let e of Qt(n))o.add(e);for(let e of h())e.hidden=!o.has(e);if(_&&_.value!==D.query&&(_.value=D.query),y&&(y.value=D.author,D.author===``?delete y.dataset.active:y.dataset.active=``),b||(D.pr=`any`),b&&(b.value=D.pr,D.pr===`any`?delete b.dataset.active:b.dataset.active=``),v&&(v.value=D.filter,D.filter===`all`?delete v.dataset.active:v.dataset.active=``),Ft(),Nt&&(Nt.hidden=!u(D)),Mt){let e=e=>e.reduce((e,t)=>e+Number(t.dataset.reviews??1),0);Mt.textContent=we(e(t),t.length,u(D)?e(p):void 0)}jt&&(jt.hidden=t.length>0||r.size>0||p.length===0),mn(n)}function Qt(e){let r=document.querySelector(`[data-collections-area]`);if(!r)return[];let o=de(D.filter),s=u(D),c=e.flatMap(e=>ot(e).map(t=>({card:e,collection:t}))),l=e=>{let{stored:t,activity:n}=It(e);return i(Lt(e),t,n,D.filter)},ee=n(c,({card:e,collection:t})=>{let n=l(e);return n===void 0?void 0:`${n===`completed`?`collection-done`:`collection`}:${t}`},e=>C.get(e)??15),te=(e,t)=>(m.get(e)??[]).find(e=>e.dataset.placement===`collection:${t}`),ne=[],re=!1;for(let e of r.querySelectorAll(`[data-collection]`)){let n=e.dataset.collection??``,r=ee.get(`collection:${n}`)??{shown:[],total:0},i=ee.get(`collection-done:${n}`)??{shown:[],total:0},l=c.filter(e=>e.collection===n),ie=l.filter(e=>Lt(e.card)).length,ae=D.collections.length>0&&!D.collections.includes(n),oe=!o&&!ae&&(!s||l.length>0);if(e.hidden=!oe,!oe)continue;re=!0;for(let[t,a]of[[`collection:${n}`,r],[`collection-done:${n}`,i]]){let r=a.shown.map(e=>te(e.card.dataset.id??``,n)).filter(e=>e!==void 0),i=e.querySelector(`[data-cards="${t}"]`);i&&nt(i,r),ne.push(...r);let o=e.querySelector(`[data-load-more="${t}"]`);o&&(o.hidden=a.total<=a.shown.length)}let u=e.querySelector(`[data-section="collection:${n}"] > summary [data-section-count]`);u&&(u.textContent=ce(r.total,ie));let se=e.querySelector(`[data-collection-empty]`),le=a({active:r.total,completed:i.total,pinned:ie,members:l.length},s);se&&(se.hidden=le===void 0,se.textContent=le??``);let ue=e.querySelector(`[data-section="collection-done:${n}"]`);ue&&(ue.hidden=i.total===0);let de=e.querySelector(`[data-completed-label]`);de&&(de.textContent=t(i.total))}return r.hidden=o||!re,ne}var $t=300,N=null;function P(){N!==null&&window.clearTimeout(N),N=null,St.replace(o(D),{})}function F(e,t){if(D={...D,...e},S=te(),C=new Map,M(),t===`now`)return P();N!==null&&window.clearTimeout(N),N=window.setTimeout(P,$t)}window.addEventListener(`pagehide`,()=>{N!==null&&P()}),document.addEventListener(`click`,e=>{N!==null&&e.target?.closest?.(`a[href]`)&&P()},!0),_?.addEventListener(`input`,()=>F({query:_.value},`settled`)),_?.addEventListener(`keydown`,e=>{e.key===`Escape`&&_.value!==``&&(e.preventDefault(),F({query:``},`now`))}),v?.addEventListener(`change`,()=>{F({filter:v.value},`now`)}),y?.addEventListener(`change`,()=>{F({author:y.value},`now`)}),b?.addEventListener(`change`,()=>{F({pr:b.value},`now`)}),Nt?.addEventListener(`click`,()=>{F({query:d.query,filter:d.filter,author:d.author,pr:d.pr,collections:d.collections},`now`),_?.focus()}),tt(),document.addEventListener(`click`,e=>{let t=e.target.closest(`[data-load-more]`)?.dataset.loadMore;if(t&&t.startsWith(`collection`)&&Ve(t))return C.set(t,(C.get(t)??15)+15),M();!t||!f.includes(t)||(S={...S,[t]:S[t]+15},M())});for(let e of[`popstate`,`hashchange`])window.addEventListener(e,()=>{D=s(window.location.hash),S=te(),C=new Map,M(),sn()});document.addEventListener(`click`,e=>{let t=e.target.closest(`[data-pin]`);if(!t?.dataset.pin)return;e.preventDefault(),e.stopPropagation();let n=t.dataset.pin;rt(t,e=>fetch(`/pin`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:n,pinned:e})}).then(e=>e.ok),e=>{wt(n,n=>{n.dataset.pinned=String(e);let r=n.querySelector(`[data-pin]`);r&&r!==t&&it(r,e),Nn(n)}),M()})});async function en(e,t){let n;try{let r=await fetch(`/queue`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:e,action:t})});if(!r.ok)return I(await rn(r));n=(await r.json()).queue}catch{return I(nn)}an(n),M()}var tn=`That could not be saved. The workspace server refused it.`,nn=`The workspace server did not answer. It may have stopped.`;function I(e){ge(Le(),{kind:`failed`,text:e})}async function rn(e){let t=await e.json().catch(()=>null);return typeof t?.error==`string`?t.error:tn}function an(e){let t=new Map(e.map((e,t)=>[e,t]));for(let e of h()){let n=t.get(e.dataset.id??``);n===void 0?delete e.dataset.queue:e.dataset.queue=String(n),n!==void 0&&e.dataset.lifecycle!==`active`&&(e.dataset.lifecycle=`active`,delete e.dataset.lifecycleAt,Nn(e))}for(let e of document.querySelectorAll(`[data-queue-action][data-queue-id]`)){let n=t.has(e.dataset.queueId??``);e.dataset.queueAction=n?`remove`:`add`,e.textContent=Fe(n)}let n=document.querySelector(`[data-queue-option]`);n&&(n.textContent=ee(e.length))}document.addEventListener(`click`,e=>{let t=e.target.closest(`[data-history-toggle]`);if(!t)return;e.preventDefault(),e.stopPropagation();let n=t.parentElement?.querySelector(`[data-history-list]`);n&&_t(t,n.hidden!==!1)});var on=document.querySelector(`.prb-shell > main`);function sn(){xt(document,St.current().ui,{cards:h(),pane:on,limits:S,reveal:(e,t)=>{S=e,C=t,M()}})}St.setCapturer(()=>vt(document,h(),S,on,C)),M(),sn();var L=Ze(document,{onOpen:dn,onClose:e=>{dn(e),window.setTimeout($,0)}});function cn(){return document.querySelector(`[data-menu-trigger][aria-expanded="true"]`)!==null}var ln=0;async function un(e){ln+=1;try{await e()}finally{--ln,$()}}function dn(e){let t=e.querySelector(`[data-menu-items]`),n=e.querySelector(`[data-menu-confirm]`);t&&(t.hidden=!1),n&&(n.hidden=!0);let r=e.querySelector(`[data-collection-rename-form]`);r&&(r.hidden=!0,Y(r,void 0)),e.querySelector(`[data-menu-error]`)?.remove(),e.querySelector(`[data-id-field]`)?.remove()}document.addEventListener(`click`,e=>{let t=e.target,n=t.closest(`[data-menu]`);if(!n||n.closest(`[data-bulk]`)||n.matches(`[data-collections-filter]`))return;if(n.matches(`.prb-collection-menu`))return Xn(e,t,n);let r=t.closest(`[data-collections-for]`);if(r?.dataset.collectionsFor){e.preventDefault(),e.stopPropagation(),L.closeAll();let t=r.closest(`[data-card]`)?.querySelector(`[data-select]`)?.getAttribute(`aria-label`)?.replace(/^Select /,``);Zn([r.dataset.collectionsFor],{card:t??`this review`});return}let i=t.closest(`[data-copy-id]`);if(i?.dataset.copyId){e.preventDefault(),e.stopPropagation(),Xe(i,i.dataset.copyId);return}let a=t.closest(`[data-fetch-review]`);if(a?.dataset.fetchReview){e.preventDefault(),e.stopPropagation(),L.closeAll();let t=a.closest(`[data-card]`);t&&sr([t]);return}let o=t.closest(`[data-mark-status]`);if(o?.dataset.markId){e.preventDefault(),e.stopPropagation(),L.closeAll();let t=o.dataset.markId;un(()=>jn(t,o.dataset.markStatus===`complete`));return}let s=t.closest(`[data-lifecycle-set]`);if(s?.dataset.lifecycleId){e.preventDefault(),e.stopPropagation(),L.closeAll();let t=s.dataset.lifecycleId;un(async()=>{await Mn([t],s.dataset.lifecycleSet)||I(`That could not be saved. The workspace server refused it or did not answer.`)});return}let c=t.closest(`[data-queue-action]`);if(c?.dataset.queueId){e.preventDefault(),e.stopPropagation(),L.closeAll();let t=c.dataset.queueId;un(()=>en(t,c.dataset.queueAction===`remove`?`remove`:`add`));return}if(t.closest(`[data-delete]`)){e.preventDefault(),e.stopPropagation();let t=n.querySelector(`[data-menu-items]`),r=n.querySelector(`[data-menu-confirm]`);t&&(t.hidden=!0),r&&(r.hidden=!1),e.detail===0&&n.querySelector(`[data-cancel-delete]`)?.focus();return}if(t.closest(`[data-cancel-delete]`)){e.preventDefault(),e.stopPropagation(),dn(n),e.detail===0&&n.querySelector(`[data-delete]`)?.focus();return}if(t.closest(`[data-confirm-delete]`)){e.preventDefault(),e.stopPropagation(),fn(n);return}e.preventDefault(),e.stopPropagation()});async function fn(e){let t=e.querySelector(`[data-delete]`),n=t?.dataset.delete;if(!n)return;let r=e.querySelector(`[data-menu-confirm]`),i=e.querySelector(`[data-confirm-delete]`);i&&(i.disabled=!0,i.textContent=`Deleting`);try{let r=await fetch(`/delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({id:n,scope:t?.dataset.scope??`review`})});if(r.ok)return void window.location.reload();pn(e,(await r.json().catch(()=>null))?.error??`That could not be deleted.`)}catch{pn(e,`The workspace server did not answer. It may have stopped.`)}i&&(i.disabled=!1,i.textContent=`Delete`),r&&(r.hidden=!0);let a=e.querySelector(`[data-menu-items]`);a&&(a.hidden=!1)}function pn(e,t){e.querySelector(`[data-menu-error]`)?.remove();let n=document.createElement(`p`);n.className=`prb-menu-error`,n.setAttribute(`data-menu-error`,``),n.textContent=t,e.querySelector(`[data-menu-panel]`)?.append(n)}function R(e){k=e,e||O.clear(),kt&&(e?kt.dataset.selecting=``:delete kt.dataset.selecting),document.querySelector(`[data-select-mode]`)?.setAttribute(`aria-pressed`,String(e)),!e&&Kt&&L.close(Kt);for(let t of document.querySelectorAll(`.prb-card-link`))e?t.setAttribute(`aria-disabled`,`true`):t.removeAttribute(`aria-disabled`);z(),M()}function z(){T&&(T.hidden=!0),Jt&&(Jt.hidden=!1),E&&(E.hidden=!0,E.textContent=``)}function mn(t){for(let e of h()){let t=O.has(e.dataset.id??``),n=e.querySelector(`[data-select]`);n&&(n.checked=t),t?e.dataset.selected=``:delete e.dataset.selected}if(!w||(w.hidden=!k,!k))return;let n=new Set(h().filter(hn).map(e=>e.dataset.id)),r=[...O].filter(e=>!n.has(e)).length,i=new Set(t.map(e=>e.dataset.id)),a=[...O].every(e=>i.has(e))?i.size:null;O.size===0?w.dataset.empty=``:delete w.dataset.empty,Vt&&(Vt.textContent=e(O.size)),Ht&&(Ht.textContent=oe(O.size,a,r)),Yt&&(Yt.textContent=me(t.length,O.size>0&&a!==null),Yt.disabled=t.every(e=>O.has(e.dataset.id??``))),Wt&&(Wt.textContent=ne(On()));for(let e of w.querySelectorAll(`[data-bulk-mark], [data-bulk-lifecycle], [data-bulk-queue], [data-bulk-collections], [data-bulk-delete]`))e.disabled=O.size===0;A&&(A.hidden=!Ge(Xt,rr(H())))}function hn(e){return!e.hidden&&e.closest(`details:not([open]), [hidden]`)===null}function gn(e){let t=[...e.querySelectorAll(`details[data-section]`)];for(let e of t)e.addEventListener(`toggle`,()=>mn(j));et(t,(e,t)=>fetch(`/sections`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({section:e,collapsed:t})}))}gn(document),document.querySelector(`[data-select-mode]`)?.addEventListener(`click`,()=>{R(!k)}),Yt?.addEventListener(`click`,()=>{for(let e of j)e.dataset.id&&O.add(e.dataset.id);z(),M()});function _n(e){O.has(e)?O.delete(e):O.add(e),z(),M()}document.addEventListener(`change`,e=>{let t=e.target.closest(`[data-select]`);t?.dataset.select&&_n(t.dataset.select)}),document.addEventListener(`click`,e=>{if(!k)return;let t=e.target,n=t.closest(`[data-card]`);n?.dataset.id&&(t.closest(`[data-select], [data-pin], [data-menu], [data-history-toggle]`)||(e.preventDefault(),_n(n.dataset.id)))}),document.addEventListener(`keydown`,e=>{if(!k||e.key!==`Enter`)return;let t=e.target.closest(`.prb-card-link`)?.closest(`[data-card]`);t?.dataset.id&&(e.preventDefault(),_n(t.dataset.id))});var B=$e({doc:document,item:`[data-card]`,link:`.prb-card-link`,walk:()=>[...document.querySelectorAll(`[data-card]`)].filter(hn),enterAllowed:()=>!k,background:()=>on,leadIn:e=>[...e.closest(`[data-cards]`)?.querySelectorAll(`[data-card]:not([hidden])`)??[]][0]===e?e.closest(`details[data-section]`)?.querySelector(`summary`)??null:null});function vn(){return B.holdsKeys()?B.current()?.querySelector(`:scope > [data-menu]`)??null:null}var yn=8;function bn(e){let t=e.querySelector(`.prb-card-link`);t&&(t.focus({preventScroll:!0}),document.activeElement!==t&&document.activeElement?.blur(),N!==null&&P(),St.leaving(),xn=!0,window.location.assign(t.href))}var xn=!1,Sn={title:`Search reviews`,mount(e,t){let n=document.createElement(`input`);n.type=`search`,n.className=`prb-palette-input`,n.placeholder=_?.placeholder??``,n.setAttribute(`aria-label`,`Search reviews`),n.spellcheck=!1,n.value=_?.value??``;let r=document.createElement(`p`);r.className=`prb-palette-summary`,r.setAttribute(`aria-live`,`polite`);let i=document.createElement(`div`);i.className=`prb-palette-results`,i.setAttribute(`role`,`group`),i.setAttribute(`aria-label`,`Matching reviews`);let a=()=>{let e=j.slice(0,yn);i.replaceChildren(...e.map(e=>{let t=document.createElement(`button`);t.type=`button`,t.className=`prb-palette-result`,t.dataset.resultId=e.dataset.id??``;let n=document.createElement(`span`);n.className=`prb-palette-result-title`,n.textContent=e.querySelector(`.prb-card-head h2`)?.textContent??``;let r=document.createElement(`span`);return r.className=`prb-palette-result-where`,r.textContent=[e.querySelector(`.prb-card-repo`)?.textContent,e.querySelector(`.prb-card-branch`)?.textContent].filter(Boolean).join(` · `),t.append(n,r),t})),r.textContent=j.length===0?`No reviews match.`:j.length>e.length?`The first ${e.length} of ${Mt?.textContent??j.length}`:Mt?.textContent??``},o=()=>[...i.querySelectorAll(`.prb-palette-result`)],s=e=>{let n=p.find(t=>t.dataset.id===e?.dataset.resultId);n&&(t(),bn(n))};n.addEventListener(`input`,()=>{_&&(_.value=n.value,_.dispatchEvent(new Event(`input`,{bubbles:!0})),a())}),i.addEventListener(`click`,e=>s(e.target.closest(`.prb-palette-result`)??void 0)),e.addEventListener(`keydown`,e=>{if(e.isComposing)return;let t=o(),r=t.indexOf(e.target);if(e.key===`Enter`&&e.target===n)return e.preventDefault(),s(t[0]);let i=e.key===`ArrowDown`?r<0?t[0]:t[r+1]:e.key===`ArrowUp`?r<=0?n:t[r-1]:null;i&&(e.preventDefault(),i.focus())}),e.append(n,r,i),a(),n.focus(),n.select()}},Cn={title:`Filters`,mount(e){let t=document.createElement(`p`);t.className=`prb-palette-summary`,t.setAttribute(`aria-live`,`polite`);let n=()=>{t.textContent=Mt?.textContent??``},r=[v,y,b].flatMap(e=>{if(!e)return[];let t=document.createElement(`label`);t.className=`prb-palette-field`;let r=document.createElement(`span`),i=(e.getAttribute(`aria-label`)??``).replace(/^Filter by /,``);r.textContent=i.charAt(0).toUpperCase()+i.slice(1);let a=document.createElement(`select`);for(let t of e.options)a.append(new Option(t.text,t.value));return a.value=e.value,a.addEventListener(`change`,()=>{e.value=a.value,e.dispatchEvent(new Event(`change`,{bubbles:!0})),n()}),t.append(r,a),[t]});e.append(...r,t),n(),r[0]?.querySelector(`select`)?.focus()}};function wn(e){let t=()=>document.querySelector(`details[data-section="${e}"]`);return{available:()=>!!(t()&&!t().hidden),state:()=>{let e=t();return e&&!e.hidden?e.open?`Expanded`:`Collapsed`:null},run:()=>{let e=t();e&&(e.open=!e.open)}}}var Tn=Object.fromEntries(se.map(e=>[`reviews.section.${e}`,wn(e)]));function En(){return[...document.querySelectorAll(`[data-collections-area]:not([hidden]) [data-collection]:not([hidden])`)].flatMap(e=>{let t=e.querySelector(`:scope > details[data-section]`);if(!t)return[];let n=t.querySelector(`[data-collection-name]`)?.textContent??``,r=t.querySelector(`:scope > summary [data-section-count]`)?.textContent??``;return[{id:e.dataset.collection??``,name:n,count:r,open:t.open}]})}var V=document.querySelector(`[data-collection-new]`),Dn=Ne(`reviews`,{...Tn,"reviews.search":{available:()=>_!==null,panel:Sn},"reviews.filters":{available:()=>v!==null,panel:Cn},"reviews.collection.new":{available:()=>V!==null&&!V.disabled,run:()=>V?.click()},"reviews.collection.fold":{available:()=>En().length>0,panel:ht({collections:En,toggle:e=>{let t=document.querySelector(`[data-collection="${CSS.escape(e)}"] > details[data-section]`);t&&(t.open=!t.open)}})},"reviews.next":{run:()=>B.move(1)},"reviews.previous":{run:()=>B.move(-1)},"reviews.open":{available:()=>B.enterOpens(),run:()=>B.open()},"reviews.openInNewTab":{available:()=>B.enterOpens(),run:()=>B.openInNewTab()},"reviews.selection.exit":{available:zn,run:()=>T&&!T.hidden?Ln(w?.contains(document.activeElement)??!1):Rn()},"reviews.menu":{available:()=>vn()!==null,run:()=>{let e=vn();e&&L.open(e,{focusFirst:!0,returnFocus:()=>B.refocus()})}}},{onOpen:()=>L.closeAll(),onSettle:()=>$()});function H(){return Bt(p.filter(e=>O.has(e.dataset.id??``)))}function On(){return H().reduce((e,t)=>e+Number(t.dataset.reviews??1),0)}function U(e){E&&(E.textContent=e,E.hidden=!1)}function W(e){for(let t of w?.querySelectorAll(`button`)??[])t.disabled=e}async function kn(e){let t=[...O];if(t.length!==0){W(!0);try{if(!(await fetch(`/status`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ids:t,complete:e})})).ok)return W(!1),U(`That could not be saved. The workspace server refused it.`)}catch{return W(!1),U(`The workspace server did not answer. It may have stopped.`)}An(H(),e),W(!1),R(!1)}}function An(e,t){let n=t?`complete`:`in-progress`,r=t?`in-progress`:`complete`;for(let t of e.flatMap(e=>m.get(e.dataset.id??``)??[e])){t.dataset.status=n;let e=t.querySelector(`.prb-card-status`);e&&(e.dataset.status=n,e.textContent=ve(n));let i=t.querySelector(`[data-mark-status]`);i&&(i.dataset.markStatus=r,i.textContent=ue(r))}}async function jn(e,t){try{let n=await fetch(`/status`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ids:[e],complete:t})});if(!n.ok)return I(await rn(n))}catch{return I(nn)}An(p.filter(t=>t.dataset.id===e),t),M()}async function Mn(e,t){let n;try{let r=await fetch(`/lifecycle`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ids:e,state:t})});n=r.ok?await r.json().catch(()=>null):null}catch{n=null}if(!n)return!1;let r=new Set(e);for(let e of h())r.has(e.dataset.id??``)&&(e.dataset.lifecycle=t,t===`active`?delete e.dataset.lifecycleAt:e.dataset.lifecycleAt=String(n.at),Nn(e));return an(n.queue),M(),!0}function Nn(e){let{stored:t,activity:n}=It(e),r=e.querySelector(`[data-lifecycle-chip]`);if(r){let i=Be(Lt(e),t,n);r.textContent=i??``,r.hidden=i===void 0}for(let r of e.querySelectorAll(`[data-lifecycle-set]`)){let e=r.dataset.lifecycleSet;r.hidden=!Ce(e,t,n),r.textContent=Ae(e,t,n)}}async function Pn(e){let t=[...O];if(t.length===0)return;W(!0);let n=await Mn(t,e);if(W(!1),!n)return U(`That could not be saved. The workspace server refused it or did not answer.`);R(!1)}async function Fn(){let e=[...O];if(e.length===0)return;W(!0);let t=null;try{let n=await fetch(`/delete`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ids:e})});if(t=n.ok?await n.json().catch(()=>null):null,!t)return W(!1),z(),U(`Nothing was deleted. The workspace server refused it.`)}catch{return W(!1),z(),U(`The workspace server did not answer. It may have stopped.`)}let n=t.blocked??[],r=new Set(n.map(e=>e.id));for(let e of H()){let t=e.dataset.id??``;r.has(t)||wt(t,e=>e.remove())}p=p.filter(e=>e.isConnected),Ct(),O.clear();for(let e of r)O.add(e);if(W(!1),z(),n.length===0)return R(!1);M(),U([...new Set(n.map(e=>e.error))].join(` `))}async function In(){let e=H().map(e=>e.dataset.id??``).filter(Boolean);if(e.length===0)return;W(!0);let t=null;try{let n=await fetch(`/queue`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ids:e,action:`add`})});t=n.ok?await n.json().catch(()=>null):null}catch{return W(!1),z(),U(`The workspace server did not answer. It may have stopped.`)}if(!t?.queue)return W(!1),z(),U(`Nothing was added. The workspace server refused it.`);an(t.queue);let n=t.refused??[];O.clear();for(let e of n)O.add(e.id);if(W(!1),z(),n.length===0)return R(!1);M(),U([...new Set(n.map(e=>e.error))].join(` `))}w?.addEventListener(`click`,e=>{let t=e.target;if(Kt&&t.closest(`[data-bulk-more] [data-menu-panel] button`)&&L.close(Kt),t.closest(`[data-bulk-queue]`))return void In();if(t.closest(`[data-bulk-collections]`))return Zn(H().map(e=>e.dataset.id??``).filter(Boolean),{selection:!0});let n=t.closest(`[data-bulk-mark]`);if(n)return void kn(n.dataset.bulkMark===`complete`);let r=t.closest(`[data-bulk-lifecycle]`);if(r)return void Pn(r.dataset.bulkLifecycle);if(t.closest(`[data-bulk-delete]`)){qt&&(qt.textContent=re(On())),Jt&&(Jt.hidden=!0),T&&(T.hidden=!1),e.detail===0&&w.querySelector(`[data-bulk-cancel-delete]`)?.focus();return}if(t.closest(`[data-bulk-confirm-delete]`))return void Fn();if(t.closest(`[data-bulk-cancel-delete]`))return Ln(e.detail===0);if(t.closest(`[data-bulk-exit]`))return Rn()});function Ln(e){z(),e&&Ut?.focus()}function Rn(){let e=w?.contains(document.activeElement)??!1;R(!1),e&&document.querySelector(`[data-select-mode]`)?.focus()}function zn(e){return!k||Gt?.disabled?!1:e===void 0||Ye(e,document,!0)}var G=document.querySelector(`[data-collections-dialog]`),Bn=document.querySelector(`[data-collections-dialog-list]`),K=document.querySelector(`[data-collections-dialog-search]`),q=document.querySelector(`[data-collections-dialog-create]`),Vn=document.querySelector(`[data-collections-dialog-error]`),Hn=document.querySelector(`[data-collections-dialog-for]`),J=[],Un=!1,Wn=!1,Gn=document.body.dataset.cardsSnapshot??``;function Kn(e,t){return st(e,t,Gn)}function qn(e){if(e.stale||e.area===void 0){try{let e={ids:[...O],selecting:k};window.sessionStorage.setItem(ct,JSON.stringify(e))}catch{}G?.close(),window.location.reload();return}let t=e.area,n=document.querySelector(`[data-collections-area]`);if(n){let e=n.contains(document.activeElement)?De(document):null,r=document.createElement(`template`);r.innerHTML=t.trim();let i=r.content.firstElementChild;if(i){if(n.replaceWith(i),gn(i),k)for(let e of i.querySelectorAll(`.prb-card-link`))e.setAttribute(`aria-disabled`,`true`);e&&Pe(document,e.focus,e.focusVisible)}}g=e.collections;for(let t of p){let n=e.memberOf[t.dataset.id??``]??[];t.dataset.collections=n.join(` `);let r=t.querySelector(`[data-collections-line]`),i=Te(n,g);r&&(r.textContent=i??``,r.hidden=i===void 0)}for(let t of Tt){let n=e.operations?.[t.dataset.key??``];n&&(t.dataset.collections=n.join(` `))}Ct(),ar(),M()}function Y(e,t){let n=e.querySelector(`[data-collection-error]`);n&&(n.textContent=t??``,n.hidden=t===void 0)}Pt?.addEventListener(`input`,()=>Ft()),x?.addEventListener(`change`,e=>{let t=e.target.closest(`[data-collections-filter-option]`);if(!t)return;let n=t.checked?[...D.collections,t.value]:D.collections.filter(e=>e!==t.value);F({collections:[...new Set(n)]},`now`),x.querySelector(`[data-collections-filter-option][value="${CSS.escape(t.value)}"]`)?.focus()});var X=document.querySelector(`[data-collection-new-dialog]`),Z=X?.querySelector(`[data-collection-name-input]`)??null,Jn=X?.querySelector(`[data-collection-create]`)??null,Q=!1;function Yn(){V&&(V.disabled=Q),Z&&(Z.readOnly=Q),Jn&&(Jn.disabled=Q||(Z?.value.trim()??``)===``)}V?.addEventListener(`click`,()=>{X&&(L.closeAll(),Z&&(Z.value=``),Yn(),Y(X,void 0),X.showModal(),Z?.focus())}),Z?.addEventListener(`input`,()=>{Yn(),X&&Y(X,void 0)}),X?.querySelector(`[data-collection-cancel]`)?.addEventListener(`click`,()=>X.close()),X?.addEventListener(`close`,()=>$()),document.addEventListener(`submit`,e=>{let t=e.target;if(t.matches(`[data-collection-new-form]`)){e.preventDefault();let n=Z?.value??``;if(n.trim()===``)return;Q=!0,Yn(),Kn(`/collections`,{action:`create`,name:n}).then(e=>{Q=!1,Yn();let n=X?.open===!0;if(!e.ok)return Y(t,e.error);X?.close(),qn(e.answer),n&&document.querySelector(`[data-collection="${CSS.escape(e.answer.id??``)}"] summary`)?.focus({focusVisible:!1})});return}let n=t.closest(`[data-collection-rename-form]`);if(n){e.preventDefault();let t=n.querySelector(`[data-collection-name-input]`)?.value??``,r=n.dataset.collectionRenameForm??``;Kn(`/collections`,{action:`rename`,id:r,name:t}).then(e=>{if(!e.ok)return Y(n,e.error);L.closeAll(),qn(e.answer),document.querySelector(`[data-collection="${CSS.escape(r)}"] summary`)?.focus({focusVisible:!1})})}});function Xn(e,t,n){let r=n.querySelector(`[data-menu-items]`),i=n.querySelector(`[data-collection-rename-form]`),a=n.querySelector(`[data-menu-confirm]`);if(t.closest(`[data-collection-rename]`)&&i){e.preventDefault(),r&&(r.hidden=!0),i.hidden=!1;let t=i.querySelector(`[data-collection-name-input]`);t?.focus(),t?.select();return}if(t.closest(`[data-collection-delete]`)&&a){e.preventDefault(),r&&(r.hidden=!0),a.hidden=!1,e.detail===0&&n.querySelector(`[data-cancel-delete]`)?.focus();return}if(t.closest(`[data-collection-cancel], [data-cancel-delete]`)){e.preventDefault(),dn(n);return}let o=t.closest(`[data-collection-confirm-delete]`);if(o?.dataset.collectionConfirmDelete){e.preventDefault(),o.disabled=!0;let t=o.dataset.collectionConfirmDelete;Kn(`/collections`,{action:`delete`,id:t}).then(e=>{if(o.disabled=!1,!e.ok)return pn(n,e.error);L.closeAll(),qn(e.answer),D.collections.includes(t)&&P(),document.querySelector(`[data-collection-new]`)?.focus()})}}function Zn(e,t){!G||e.length===0||(L.closeAll(),J=[...e],Un=!1,Wn=`selection`in t,Hn&&(Hn.textContent=mt(e.length,`card`in t?t.card:void 0)),K&&(K.value=``),er(void 0),$n(),G.showModal(),K?.focus())}function Qn(){return J.map(e=>ot(p.find(t=>t.dataset.id===e)??document.createElement(`div`)))}function $n(){let e=K?.value??``;Bn&&pt(Bn,g,Qn(),e);let t=dt(e,g);q&&(q.hidden=t===void 0,q.textContent=t===void 0?``:`Create “${t}” and add ${J.length===1?`this review`:`these ${J.length}`}`)}function er(e){Vn&&(Vn.textContent=e??``,Vn.hidden=e===void 0)}async function tr(e){er(void 0);let t=await Kn(`/collections/members`,{ids:J,...e});if(!t.ok)return er(t.error),$n();Un=!0,qn(t.answer);let n=t.answer.refused??[];n.length>0&&(J=J.filter(e=>!n.some(t=>t.id===e)),er([...new Set(n.map(e=>e.error))].join(` `))),$n()}K?.addEventListener(`input`,()=>$n()),K?.addEventListener(`keydown`,e=>{e.key===`Enter`&&(e.preventDefault(),q&&!q.hidden&&q.click())}),q?.addEventListener(`click`,()=>{let e=dt(K?.value??``,g);e!==void 0&&tr({action:`add`,create:e}).then(()=>{K&&(K.value=``),$n(),K?.focus()})}),Bn?.addEventListener(`change`,e=>{let t=e.target.closest(`[data-collections-dialog-option]`);if(!t)return;let n=c(t.dataset.membership??`none`),r=t.value;tr({action:n,collection:r}).then(()=>{Bn.querySelector(`[data-collections-dialog-option][value="${CSS.escape(r)}"]`)?.focus()})}),document.querySelector(`[data-collections-dialog-close]`)?.addEventListener(`click`,()=>G?.close());try{let e=window.sessionStorage.getItem(ct);if(e){window.sessionStorage.removeItem(ct);let t=JSON.parse(e),n=Array.isArray(t.ids)?t.ids.filter(e=>typeof e==`string`):[];if(t.selecting===!0||n.length>0){R(!0);for(let e of lt(n,p))O.add(e);M()}}}catch{}G?.addEventListener(`close`,()=>{Un&&k&&Wn&&R(!1),J=[],$()}),he(window,()=>window.location.reload());var nr=`prb-fetch-summary`;function rr(e){return e.map(e=>({lineage:(e.dataset.lineage??e.dataset.id??``).split(` `).filter(Boolean)}))}function ir(e){return Ke(rr(e),Xt)}function ar(){for(let e of h()){let t=e.querySelector(`[data-fetch-review]`);t&&(t.hidden=!Ge(Xt,rr([e])))}}async function or(){try{let e=await fetch(`/fetch-updates`);if(!e.ok)return;Xt=(await e.json()).targets??{}}catch{return}ar(),M()}async function sr(e,t){let n=ir(e);if(Zt||n.repositories===0)return;Zt=!0;let r=[A,...document.querySelectorAll(`[data-fetch-review]`)];for(let e of r)e&&(e.disabled=!0);t&&(t.textContent=He(n.repositories));let i=null;try{let e=await fetch(`/fetch-updates`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({ids:n.ids})});e.ok&&(i=await e.json())}catch{}Zt=!1;for(let e of r)e&&(e.disabled=!1);t&&(t.textContent=Je),M();let a=i??{repositories:n.repositories,fetched:0,failed:[],moved:0},o={kind:a.fetched<a.repositories?`failed`:`ready`,text:We(a)};if(a.moved>0||ur){try{window.sessionStorage.setItem(nr,JSON.stringify(o))}catch{}if(!dr())return void window.location.reload();ur=!0}ge(Le(),o)}try{let e=window.sessionStorage.getItem(nr);if(e){window.sessionStorage.removeItem(nr);let t=JSON.parse(e);typeof t.kind==`string`&&typeof t.text==`string`&&ge(Le(),{kind:t.kind,text:t.text})}}catch{}A?.addEventListener(`click`,()=>void sr(H(),A)),Se(),or();var cr=document.body.dataset.indexRevision??``,lr=document.body.dataset.live===`true`?Date.now():0,ur=!1;function dr(){let e=G?.open===!0||X?.open===!0||document.activeElement?.closest(`[data-collections-area], [data-collections-filter]`)!=null;return O.size>0||document.activeElement===_||Zt||Dn.isOpen()||xn||e||cn()||ln>0}function $(){ur&&!dr()&&Ie()}async function fr(){try{let e=await fetch(`/revision`);if(e.ok){Ee(document,!0);let t=await e.json();ke(document,t),t.live&&lr===0&&(lr=Date.now()),t.live||(lr=0);let n=pe(cr,t.revision??``,dr());if(n===`reload`)return Ie(),null;n===`hold`&&(ur=!0)}}catch{Ee(document,!1)}return Qe(lr===0?2**53-1:Date.now()-lr)}var pr=be(window,fr);Oe(document,()=>pr.now()),_?.addEventListener(`blur`,$),document.addEventListener(`click`,()=>window.setTimeout($,0)),je();
|
package/static/runs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Y as e,_t as t,a as n,ct as r,h as i,i as a,l as o,m as s,n as ee,p as te,r as c,s as l,t as u,v as d,y as f}from"./chunk-D9x9bcKf.js";import{n as p,t as m}from"./chunk-BUD1RoN4.js";import{t as h}from"./chunk-Dv0Wowan.js";import{t as g}from"./chunk-C8kkSv38.js";import{r as ne,t as re}from"./chunk-Di41wu5k.js";var _=[`all`,`in-progress`,`completed`,`failed`,`cancelled`,`not-responding`],v=[`all`,`review`,`update`,`re-run`,`kiss`];function y(e,t){let n=0;return{visible:e.map(e=>e&&n++<t),matched:e.filter(Boolean).length}}function b(e,t){return e.status!==`all`&&t.status!==e.status||e.kind!==`all`&&t.kind!==e.kind?!1:e.query.toLowerCase().split(/\s+/).filter(Boolean).every(e=>t.searchText.includes(e))}function x(e){return e.status!==`all`||e.kind!==`all`||e.query.trim()!==``}function S(e){let t=new URLSearchParams(e.replace(/^#/,``)),n=t.get(`status`),r=t.get(`kind`);return{status:_.includes(n??``)?n:`all`,kind:v.includes(r??``)?r:`all`,query:t.get(`q`)??``}}function C(e){let t=new URLSearchParams;e.status!==`all`&&t.set(`status`,e.status),e.kind!==`all`&&t.set(`kind`,e.kind),e.query.trim()!==``&&t.set(`q`,e.query);let n=t.toString();return n===``?``:`#${n}`}var w=r();u(`/restart`);var T=document.querySelector(`[data-search]`),E=document.querySelector(`[data-run-status-filter]`),D=document.querySelector(`[data-run-kind-filter]`),O=document.querySelector(`[data-clear-filters]`),k=document.querySelector(`[data-no-matches]`),A=[...document.querySelectorAll(`[data-run]`)],j=S(window.location.hash);E&&![...E.options].some(e=>e.value===j.status)&&(j={...j,status:`all`});function M(){T&&(T.value=j.query),E&&(E.value=j.status),D&&(D.value=j.kind)}var N=50,P=document.querySelector(`[data-runs-more-row]`),F=document.querySelector(`[data-runs-more]`),I=document.querySelector(`[data-runs-more-note]`),L=e=>({status:e.dataset.runStatus??``,kind:e.dataset.runKind??``,searchText:e.dataset.searchText??``});function R(){let e=0;for(let t of document.querySelectorAll(`[data-runs-section]`)){let n=[...t.querySelectorAll(`[data-run]`)],r=n.map(e=>b(j,L(e))),i=t.dataset.runsSection===`recent`,{visible:a,matched:o}=i?y(r,N):{visible:r,matched:r.filter(Boolean).length};n.forEach((e,t)=>e.hidden=!a[t]),e+=o;let s=t.querySelector(`[data-section-count]`);if(s&&(s.textContent=String(o)),i&&P){let e=Math.min(o,N);P.hidden=o<=N,I&&(I.textContent=`Showing the newest ${e} of ${o}.`)}}let t=x(j);O&&(O.hidden=!t),k&&(k.hidden=!(t&&e===0&&A.length>0))}F?.addEventListener(`click`,()=>{N+=50,R()});function z(e){j={...j,...e},N=50,R(),w.replace(C(j),{})}T?.addEventListener(`input`,()=>z({query:T.value})),E?.addEventListener(`change`,()=>z({status:E.value})),D?.addEventListener(`change`,()=>z({kind:D.value})),ne(),re(document.querySelectorAll(`details[data-runs-section]`),e=>f(e.dataset.runsSection)?e.dataset.runsSection:void 0,(e,t)=>fetch(`/runs/sections`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({section:e,collapsed:t})}));for(let e of document.querySelectorAll(`[data-clear-filters], [data-clear-filters-inline]`))e.addEventListener(`click`,()=>{z({status:`all`,kind:`all`,query:``}),M()});M(),R();var B=3e4;function V(){for(let e of document.querySelectorAll(`time[data-since]`)){let t=Number(e.dataset.since);Number.isFinite(t)&&(e.textContent=`${e.dataset.sincePrefix??``} ${h(t)}`.trim())}}window.setInterval(V,B);var H=p(document,{onClose:()=>$()}),U=()=>document.querySelector(`[data-menu-trigger][aria-expanded="true"]`)!==null,W=!1;for(let e of document.querySelectorAll(`[data-run-remove]`))e.addEventListener(`click`,()=>{let t=e.dataset.runRemove,r=e.closest(`[data-run]`);if(!t||!r)return;H.closeAll(),e.disabled=!0,W=!0;let i=t=>{e.disabled=!1,n(l(),{kind:`failed`,text:t})};fetch(`/runs/remove`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({key:t})}).then(async e=>{if(e.ok||e.status===404)r.remove(),A.splice(A.indexOf(r),1),R();else{let t=await e.json().catch(()=>null);i(typeof t?.error==`string`?t.error:`That run could not be removed. The workspace server refused it.`)}}).catch(()=>i(`The workspace server did not answer. It may have stopped.`)).finally(()=>{W=!1,$()})});var G=g({doc:document,item:`[data-run]`,link:`a.prb-card-link`,walk:()=>A.filter(e=>!e.hidden&&e.closest(`details`)?.open!==!1&&e.querySelector(`a.prb-card-link`)),background:()=>document.querySelector(`.prb-shell > main`)});function K(e){let t=()=>document.querySelector(`details[data-runs-section="${e}"]`);return{available:()=>t()!==null,state:()=>{let e=t();return e?e.open?`Expanded`:`Collapsed`:null},run:()=>{let e=t();e&&(e.open=!e.open)}}}function q(){return G.holdsKeys()?G.current()?.querySelector(`:scope > [data-menu]`)??null:null}var J=Object.fromEntries(d.map(e=>[`runs.section.${e}`,K(e)])),Y=te(`runs`,{"runs.search":{run:()=>T?.focus()},"runs.next":{run:()=>G.move(1)},"runs.previous":{run:()=>G.move(-1)},"runs.open":{available:()=>G.enterOpens(),run:()=>G.open()},"runs.openInNewTab":{available:()=>G.enterOpens(),run:()=>G.openInNewTab()},"runs.menu":{available:()=>q()!==null,run:()=>{let e=q();e&&H.open(e,{focusFirst:!0,returnFocus:()=>G.refocus()})}},...J},{onSettle:()=>$()}),ie=document.body.dataset.runsRevision??``,X=document.body.dataset.live===`true`?Date.now():0,Z=!1;function Q(){return document.activeElement===T||W||Y.isOpen()||U()}function $(){Z&&!Q()&&c()}T?.addEventListener(`blur`,()=>$());async function ae(){try{let t=await fetch(`/runs/revision`);if(t.ok){o(document,!0);let n=await t.json();ee(document,n),n.live&&X===0&&(X=Date.now()),n.live||(X=0);let r=e(ie,n.revision??``,Q());if(r===`reload`)return c(),null;r===`hold`&&(Z=!0)}}catch{o(document,!1)}return m(X===0?2**53-1:Date.now()-X)}var oe=i(window,ae);s(document,()=>oe.now()),a(),t(window,()=>window.location.reload());
|
package/static/settings.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{_t as e,ct as t,o as n,p as r,t as i,u as a}from"./chunk-D9x9bcKf.js";function o(e,t){if(e===``)return null;try{let n=new URL(e);return n.origin===t&&/^\/r\/[^/]+$/.test(n.pathname)?n.href:null}catch{return null}}function s(e){let t=[...document.querySelectorAll(`[data-shutdown]`)],n=document.querySelector(`[data-shutdown-dialog]`),r=document.querySelector(`[data-shutdown-confirm]`);for(let e of t)e.addEventListener(`click`,()=>n?.showModal());document.querySelector(`[data-shutdown-cancel]`)?.addEventListener(`click`,()=>n?.close()),r?.addEventListener(`click`,()=>{r.disabled=!0,r.textContent=`Stopping…`,fetch(e,{method:`POST`}).then(e=>{if(!e.ok)throw Error(`Shutdown refused: ${e.status}`);n?.close(),c(t)}).catch(()=>{r.disabled=!1,r.textContent=`Stop server`})})}function c(e){document.body.dataset.serverStopped=`true`,a(document,`unreachable`);let t=document.createElement(`div`);t.className=`prb-stopped-notice`,t.setAttribute(`role`,`status`);let n=document.body.dataset.wayBack;t.textContent=n?`Workspace server stopped. This page is no longer being served. Run ${n} to bring it back.`:`Workspace server stopped. This page is no longer being served.`,document.body.prepend(t);for(let t of e)t.disabled=!0,t.classList.contains(`prb-strip-action`)||(t.textContent=`Server stopped`)}var l=[{id:`system`,label:`System`,help:`Follow your device setting`},{id:`light`,label:`Light`,help:`Always use light mode`},{id:`dark`,label:`Dark`,help:`Always use dark mode`}];function u(e){return l.some(t=>t.id===e)}function d(e){let t=e.querySelector(`[data-settings-theme]:checked`)?.value;return u(t)?t:void 0}function f(e,t){e.documentElement.dataset.theme=t}function p(e){for(let t of e.querySelectorAll(`[data-settings-theme]`))t.addEventListener(`change`,()=>{let t=d(e);t&&f(e,t)})}s(`/shutdown`),t(),r(`global`,{}),i(`/restart`);function m(){let e=document.querySelector(`[data-settings-back]`),t=o(document.referrer,window.location.origin);if(!e||t===null)return;e.href=t,e.textContent=``;let n=document.createElement(`span`);n.setAttribute(`aria-hidden`,`true`),n.textContent=`‹`,e.append(n,` Back to the review`)}m(),p(document);var h=document.querySelector(`[data-settings-save]`),g=document.querySelector(`[data-settings-status]`),_=document.querySelector(`[data-settings-port]`),v=document.querySelector(`[data-settings-port-error]`),y=document.querySelector(`[data-settings-agent]`);function b(){let e=document.querySelector(`[data-settings-usage]:checked`);return e?e.value===`on`:void 0}function x(e,t){g&&(g.textContent=e,g.dataset.kind=t)}function S(e){v&&(v.textContent=e??``),_&&(e?(_.setAttribute(`aria-invalid`,`true`),_.focus(),_.select()):_.removeAttribute(`aria-invalid`))}async function C(){if(!h)return;let e=b(),t=d(document),n={..._?{port:_.value.trim()}:{},...y?{agent:y.value}:{},...e===void 0?{}:{usageCounts:e},...t===void 0?{}:{theme:t}};h.disabled=!0,h.textContent=`Saving`;try{let e=await(await fetch(`/settings`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(n)})).json().catch(()=>null);if(!e){x(`Nothing was saved. The workspace server did not answer.`,`error`);return}if(e.error){S(e.error),x(`Nothing was saved.`,`error`);return}S(null),_&&(_.value=String(e.port.configured)),f(document,e.theme),x(e.restartRequired?`Saved. This page is served on port ${e.port.current}; the workspace moves to ${e.port.configured} the next time it starts.`:`Saved.`,`saved`)}catch{x(`Nothing was saved. The workspace server could not be reached.`,`error`)}finally{h.disabled=!1,h.textContent=`Save changes`}}h?.addEventListener(`click`,()=>void C()),n(document,window,{paintUnread:!0}),e(window,()=>window.location.reload());
|
package/static/shell.css
CHANGED
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
--brand: #9333ea;
|
|
45
45
|
--brand-hover: light-dark(#7427e8, #7c3aed);
|
|
46
46
|
--brand-muted: light-dark(#f3e8ff, rgba(147, 51, 234, 0.15));
|
|
47
|
+
/* A brand outline that marks a surface as the selection's without shouting: the bulk bar. */
|
|
48
|
+
--brand-border: light-dark(rgba(147, 51, 234, 0.35), rgba(167, 112, 245, 0.45));
|
|
47
49
|
/* Brand-coloured words on a light or tinted ground, where #9333ea itself is too pale to read. */
|
|
48
50
|
--brand-ink: light-dark(#6b21a8, #c4a5f5);
|
|
49
51
|
/* Text and marks on a filled --brand control. White in both, because the fill is the same. */
|
|
@@ -989,6 +991,11 @@ a.prb-rail-item { text-decoration: none; }
|
|
|
989
991
|
color: var(--text-muted);
|
|
990
992
|
}
|
|
991
993
|
.prb-rail-group + .prb-rail-group { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
|
|
994
|
+
/* A group that is only its own row (KISS before anybody has run it) is spaced as tightly as Compact
|
|
995
|
+
spaces every row, and in every state, so sliding the sidebar out does not grow it. A group with
|
|
996
|
+
pages under it keeps the wider spacing in every state, Compact included. */
|
|
997
|
+
.prb-rail-group + .prb-rail-group:has(> .prb-rail-body:empty) { margin-top: 12px; padding-top: 12px; }
|
|
998
|
+
.prb-rail-group:has(> .prb-rail-body:empty) + .prb-rail-group { margin-top: 12px; }
|
|
992
999
|
|
|
993
1000
|
/* A group owns everything under it: the row navigates to that review type's summary and the twisty
|
|
994
1001
|
beside it folds the group away. The twisty is a sibling of the button, not a child, so one click
|
|
@@ -1140,8 +1147,13 @@ a.prb-rail-item { text-decoration: none; }
|
|
|
1140
1147
|
}
|
|
1141
1148
|
:root[data-sidebar-compact][data-sidebar-peek] .prb-rail {
|
|
1142
1149
|
width: var(--rail-full-width);
|
|
1150
|
+
overflow-x: hidden;
|
|
1143
1151
|
box-shadow: 8px 0 24px var(--shadow-float);
|
|
1144
1152
|
}
|
|
1153
|
+
/* The rows are laid out at the width they will end at from the first frame, inside the rail's one
|
|
1154
|
+
pixel of border, so the growing edge only uncovers them. Laid out at the passing width instead,
|
|
1155
|
+
"Review path" and "PR context" wrapped to two lines part-way and every row below dropped. */
|
|
1156
|
+
:root[data-sidebar-compact][data-sidebar-peek] .prb-rail > * { width: calc(var(--rail-full-width) - 1px); }
|
|
1145
1157
|
|
|
1146
1158
|
/* Compact: every row is its icon, named in a tooltip beside it on hover and keyboard focus. The
|
|
1147
1159
|
tooltip is the row's own label, moved out to the right, so the name a screen reader hears is
|
|
@@ -1181,11 +1193,16 @@ a.prb-rail-item { text-decoration: none; }
|
|
|
1181
1193
|
:root[data-sidebar-compact]:not([data-sidebar-peek]) .prb-rail-selected,
|
|
1182
1194
|
:root[data-sidebar-compact]:not([data-sidebar-peek]) .prb-rail-twisty,
|
|
1183
1195
|
:root[data-sidebar-compact]:not([data-sidebar-peek]) .prb-rail-heading,
|
|
1184
|
-
:root[data-sidebar-compact]:not([data-sidebar-peek]) .prb-rail-subhead,
|
|
1185
1196
|
:root[data-sidebar-compact]:not([data-sidebar-peek]) .prb-rail-path { display: none; }
|
|
1186
|
-
|
|
1197
|
+
/* The Review path row keeps its height, undrawn, so the icons under it are already where the
|
|
1198
|
+
expanded rows will be and sliding out moves nothing up or down. Hidden this way it is out of the
|
|
1199
|
+
tab order and the accessibility tree, as `display: none` had it; tabbing into the rail peeks it,
|
|
1200
|
+
which draws the row again before focus can reach it. One line, clipped: wrapped in the narrow
|
|
1201
|
+
strip it would be a line taller than the row it stands in for. */
|
|
1202
|
+
:root[data-sidebar-compact]:not([data-sidebar-peek]) .prb-rail-subhead { visibility: hidden; overflow: hidden; }
|
|
1203
|
+
:root[data-sidebar-compact]:not([data-sidebar-peek]) .prb-rail-subhead .prb-rail-heading { display: block; white-space: nowrap; }
|
|
1204
|
+
:root[data-sidebar-compact]:not([data-sidebar-peek]) .prb-rail-body { margin-left: 0; border-left: 0; }
|
|
1187
1205
|
:root[data-sidebar-compact]:not([data-sidebar-peek]) .prb-rail-body .prb-rail-item { padding-left: 0; }
|
|
1188
|
-
:root[data-sidebar-compact]:not([data-sidebar-peek]) .prb-rail-group + .prb-rail-group { margin-top: 12px; padding-top: 12px; }
|
|
1189
1206
|
/* New review is the square + at the top, its name and shortcut in the strip's own tooltip. */
|
|
1190
1207
|
:root[data-sidebar-compact]:not([data-sidebar-peek]) .prb-rail-new { padding: 0 10px 10px; }
|
|
1191
1208
|
:root[data-sidebar-compact]:not([data-sidebar-peek]) .prb-new-review { position: relative; justify-content: center; width: 36px; padding: 0; }
|
|
@@ -1933,6 +1950,8 @@ a.prb-rail-item { text-decoration: none; }
|
|
|
1933
1950
|
|
|
1934
1951
|
/* The prompt editor is wider than the shutdown dialog: it holds a paragraph, not a sentence. */
|
|
1935
1952
|
.prb-prompt-dialog { max-width: 560px; width: calc(100vw - 48px); }
|
|
1953
|
+
.prb-prompt-error { margin: 0; font-size: var(--t-meta); color: var(--danger-ink); }
|
|
1954
|
+
.prb-prompt-error[hidden] { display: none; }
|
|
1936
1955
|
.prb-field { display: block; margin-bottom: 12px; }
|
|
1937
1956
|
.prb-field span {
|
|
1938
1957
|
display: block;
|
|
@@ -3451,69 +3470,125 @@ a.prb-guide-pick { text-decoration: none; }
|
|
|
3451
3470
|
|
|
3452
3471
|
/* ── The bulk bar ──
|
|
3453
3472
|
Sticky at the foot of the column rather than under the list, because a selection made on page one
|
|
3454
|
-
is acted on from wherever the reader has scrolled to. On the card surface with a brand
|
|
3455
|
-
a shadow, so it reads as sitting above the list rather than as the last row of
|
|
3473
|
+
is acted on from wherever the reader has scrolled to. On the card surface with a faint brand
|
|
3474
|
+
border and a float shadow, so it reads as sitting above the list rather than as the last row of
|
|
3475
|
+
it. Two rows: what is selected, then what to do with it, the second only once something is. */
|
|
3456
3476
|
.prb-bulk {
|
|
3457
3477
|
position: sticky;
|
|
3458
3478
|
bottom: 16px;
|
|
3459
3479
|
z-index: 3;
|
|
3460
3480
|
display: flex;
|
|
3461
|
-
flex-
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
margin
|
|
3465
|
-
padding:
|
|
3466
|
-
border: 1px solid var(--brand);
|
|
3481
|
+
flex-direction: column;
|
|
3482
|
+
gap: 10px;
|
|
3483
|
+
max-width: 880px;
|
|
3484
|
+
margin: 16px auto 0;
|
|
3485
|
+
padding: 10px 10px 10px 16px;
|
|
3486
|
+
border: 1px solid var(--brand-border);
|
|
3467
3487
|
border-radius: 12px;
|
|
3468
3488
|
background: var(--surface-raised);
|
|
3469
|
-
box-shadow: 0
|
|
3489
|
+
box-shadow: 0 12px 32px var(--shadow-float), 0 2px 6px var(--shadow-soft);
|
|
3470
3490
|
}
|
|
3471
3491
|
.prb-bulk[hidden] { display: none; }
|
|
3472
|
-
.prb-bulk-
|
|
3473
|
-
|
|
3474
|
-
|
|
3475
|
-
|
|
3476
|
-
}
|
|
3492
|
+
.prb-bulk-head { display: flex; align-items: center; gap: 8px; min-height: 32px; }
|
|
3493
|
+
.prb-bulk-status { flex: 1; min-width: 0; margin: 0; font-size: var(--t-meta); color: var(--text-muted); }
|
|
3494
|
+
.prb-bulk-count { font-size: var(--t-body); font-weight: 600; color: var(--text-primary); }
|
|
3495
|
+
.prb-bulk-detail { margin-left: 4px; }
|
|
3496
|
+
.prb-bulk-detail:empty { display: none; }
|
|
3477
3497
|
/* The `display: flex` below outranks the sheet's `[hidden]` rule, so hiding this row for the
|
|
3478
3498
|
confirmation needs saying here or the buttons stay under the question they replaced. */
|
|
3479
|
-
.prb-bulk-actions[hidden]
|
|
3499
|
+
.prb-bulk-actions[hidden],
|
|
3500
|
+
.prb-bulk[data-empty] .prb-bulk-actions { display: none; }
|
|
3501
|
+
.prb-bulk-actions,
|
|
3502
|
+
.prb-bulk-confirm {
|
|
3503
|
+
padding: 10px 0 0;
|
|
3504
|
+
border-top: 1px solid var(--border);
|
|
3505
|
+
}
|
|
3480
3506
|
.prb-bulk-actions {
|
|
3481
3507
|
display: flex;
|
|
3482
3508
|
flex-wrap: wrap;
|
|
3483
3509
|
align-items: center;
|
|
3484
|
-
gap:
|
|
3485
|
-
margin-left: auto;
|
|
3510
|
+
gap: 8px;
|
|
3486
3511
|
}
|
|
3487
3512
|
.prb-bulk-button {
|
|
3488
|
-
|
|
3489
|
-
|
|
3513
|
+
display: inline-flex;
|
|
3514
|
+
align-items: center;
|
|
3515
|
+
gap: 6px;
|
|
3516
|
+
box-sizing: border-box;
|
|
3517
|
+
height: 32px;
|
|
3518
|
+
padding: 0 12px;
|
|
3519
|
+
border: 1px solid var(--border-strong);
|
|
3490
3520
|
border-radius: 8px;
|
|
3491
3521
|
background: transparent;
|
|
3492
3522
|
color: var(--text-secondary);
|
|
3493
3523
|
font: inherit;
|
|
3494
3524
|
font-size: var(--t-meta);
|
|
3525
|
+
white-space: nowrap;
|
|
3495
3526
|
cursor: pointer;
|
|
3496
3527
|
}
|
|
3497
|
-
.prb-bulk-button:hover:not(:disabled) { color: var(--text-primary);
|
|
3528
|
+
.prb-bulk-button:hover:not(:disabled) { color: var(--text-primary); background: var(--wash); }
|
|
3498
3529
|
.prb-bulk-button:disabled { opacity: 0.5; cursor: default; }
|
|
3499
|
-
|
|
3500
|
-
|
|
3501
|
-
.prb-bulk-
|
|
3502
|
-
|
|
3503
|
-
.prb-bulk-
|
|
3530
|
+
.prb-bulk-button[hidden] { display: none; }
|
|
3531
|
+
.prb-bulk-icon { display: inline-flex; flex: none; }
|
|
3532
|
+
.prb-bulk-icon svg { display: block; width: 16px; height: 16px; }
|
|
3533
|
+
/* The one filled control: what most selections are made for. */
|
|
3534
|
+
.prb-bulk-primary { border-color: var(--brand); background: var(--brand); color: var(--on-brand); font-weight: 600; }
|
|
3535
|
+
.prb-bulk-primary:hover:not(:disabled) { border-color: var(--brand-hover); background: var(--brand-hover); color: var(--on-brand); }
|
|
3536
|
+
/* The shared menu, placed as a control in the row rather than in a card's corner. Two classes,
|
|
3537
|
+
because the base `.prb-menu` rule is further down the sheet and would win a tie. */
|
|
3538
|
+
.prb-bulk .prb-bulk-more { position: relative; top: auto; right: auto; z-index: auto; }
|
|
3539
|
+
.prb-bulk-more .prb-menu-panel { top: 38px; right: auto; left: 0; width: 220px; }
|
|
3540
|
+
.prb-bulk-more .prb-menu-panel[data-menu-placement='above'] { top: auto; bottom: 38px; }
|
|
3541
|
+
/* Its trigger's end edge, when hanging from its start would run off the right (menu.ts). */
|
|
3542
|
+
.prb-bulk-more .prb-menu-panel[data-menu-align='end'] { right: 0; left: auto; }
|
|
3543
|
+
/* Last and apart, quiet until it is reached for: a word in the danger ink, no outline. */
|
|
3544
|
+
.prb-bulk-button-danger { border-color: transparent; color: var(--danger-ink); }
|
|
3545
|
+
.prb-bulk-button-danger:hover:not(:disabled) { background: var(--danger-subtle); color: var(--danger-ink-strong); }
|
|
3546
|
+
.prb-bulk-actions > [data-bulk-delete] { margin-left: auto; }
|
|
3547
|
+
/* The way out, with its key beside it. The `<kbd>` is the command layer's (`showHint`), appended
|
|
3548
|
+
after the icon and drawn before it. */
|
|
3549
|
+
.prb-bulk-exit {
|
|
3550
|
+
display: inline-flex;
|
|
3551
|
+
align-items: center;
|
|
3552
|
+
gap: 6px;
|
|
3553
|
+
height: 32px;
|
|
3554
|
+
padding: 0 6px;
|
|
3555
|
+
border: 0;
|
|
3556
|
+
border-radius: 8px;
|
|
3557
|
+
background: transparent;
|
|
3558
|
+
color: var(--text-muted);
|
|
3559
|
+
cursor: pointer;
|
|
3560
|
+
}
|
|
3561
|
+
.prb-bulk-exit:hover:not(:disabled) { background: var(--surface-2); color: var(--text-primary); }
|
|
3562
|
+
.prb-bulk-exit:disabled { opacity: 0.5; cursor: default; }
|
|
3563
|
+
.prb-bulk-exit .prb-bulk-icon svg { width: 18px; height: 18px; }
|
|
3564
|
+
.prb-bulk-exit .prb-key-hint {
|
|
3565
|
+
order: -1;
|
|
3566
|
+
margin: 0;
|
|
3567
|
+
padding: 1px 6px;
|
|
3568
|
+
border: 1px solid var(--border);
|
|
3569
|
+
border-radius: 5px;
|
|
3570
|
+
background: var(--surface-2);
|
|
3571
|
+
font: 500 var(--t-micro) / 1.5 ui-monospace, SFMono-Regular, 'SF Mono', Menlo, monospace;
|
|
3572
|
+
opacity: 1;
|
|
3573
|
+
}
|
|
3504
3574
|
/* A second state of the same bar, the way a card menu asks. */
|
|
3505
|
-
.prb-bulk-confirm { flex: 1 0 100%; }
|
|
3506
3575
|
.prb-bulk-confirm[hidden] { display: none; }
|
|
3507
3576
|
.prb-bulk-question { margin: 0 0 4px; font-size: var(--t-body); color: var(--text-primary); }
|
|
3508
3577
|
.prb-bulk-note { margin: 0 0 10px; font-size: var(--t-meta); color: var(--text-tertiary, var(--text-secondary)); }
|
|
3509
|
-
.prb-bulk-confirm
|
|
3578
|
+
.prb-bulk-confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
3579
|
+
.prb-bulk-confirm .prb-bulk-button-danger { border-color: var(--danger-border); background: var(--danger-subtle); }
|
|
3510
3580
|
.prb-bulk-error {
|
|
3511
|
-
flex: 1 0 100%;
|
|
3512
3581
|
margin: 0;
|
|
3513
3582
|
font-size: var(--t-meta);
|
|
3514
3583
|
color: var(--danger);
|
|
3515
3584
|
}
|
|
3516
3585
|
.prb-bulk-error[hidden] { display: none; }
|
|
3586
|
+
/* A narrow column: the actions wrap, and Delete starts its own line's left edge rather than
|
|
3587
|
+
stranding itself at the right of a short one. */
|
|
3588
|
+
@media (max-width: 640px) {
|
|
3589
|
+
.prb-bulk { bottom: 8px; padding-left: 12px; }
|
|
3590
|
+
.prb-bulk-actions > [data-bulk-delete] { margin-left: 0; }
|
|
3591
|
+
}
|
|
3517
3592
|
/* ── A branch's history, inside its card ──
|
|
3518
3593
|
Below the card's link and separated by a rule, because it is a different kind of thing: the link
|
|
3519
3594
|
above is this branch as it stands, and this is how it got there. Folded away by default and
|