@fullstackhouse/cerber 1.6.1 → 1.6.2-pr.91.45d4d8c
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/dist/cli/index.js +1 -0
- package/dist/core/artifact.js +3 -2
- package/dist/core/state.js +18 -7
- package/dist/server/daemon.js +11 -13
- package/dist/server/index.js +61 -33
- package/package.json +1 -1
- package/web/dist/assets/{abnfDiagram-WEYOIA3C-BTgaW5Ha.js → abnfDiagram-WEYOIA3C-DDWiBgJ_.js} +1 -1
- package/web/dist/assets/{arc-CIs3AUpT.js → arc-CXTmovRq.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZHVYKT53-BxOr0InY.js → architectureDiagram-ZHVYKT53-DPwB58EC.js} +1 -1
- package/web/dist/assets/{blockDiagram-RJAE7QA3-Jz3vlC0A.js → blockDiagram-RJAE7QA3-BbdcPjtf.js} +1 -1
- package/web/dist/assets/{c4Diagram-XDPPPE54-CWxNefHm.js → c4Diagram-XDPPPE54-DHzjA55M.js} +1 -1
- package/web/dist/assets/channel-Bc1egjP3.js +1 -0
- package/web/dist/assets/{chunk-2E7WHVMD-rH7H23MR.js → chunk-2E7WHVMD-X1BSLNbz.js} +1 -1
- package/web/dist/assets/{chunk-2Q5K7J3B-CpVRQRjE.js → chunk-2Q5K7J3B-4uva6Krv.js} +1 -1
- package/web/dist/assets/{chunk-4EMNKR2T-CaV39mOM.js → chunk-4EMNKR2T-DFnlUBTZ.js} +1 -1
- package/web/dist/assets/{chunk-55XCU76K-BohfUFNm.js → chunk-55XCU76K-Cu8cVLZy.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-DvbGi5bp.js → chunk-5VM5RSS4-B9WXEPBE.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-D6RgvVPu.js → chunk-JWPE2WC7-CCsYBl0M.js} +1 -1
- package/web/dist/assets/{chunk-VQ5W62QI-ClY7U6Vf.js → chunk-VQ5W62QI-DBHQMI3P.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-eY9jOqr_.js → chunk-XXDRQBXY-DFB2lFGh.js} +1 -1
- package/web/dist/assets/{chunk-ZCHMQSOR-CgMio2CB.js → chunk-ZCHMQSOR-dvczqjG8.js} +2 -2
- package/web/dist/assets/{classDiagram-v2-4MYWR3UA-LlSJxp_t.js → classDiagram-v2-4MYWR3UA-Ck2KUiuM.js} +1 -1
- package/web/dist/assets/{cose-bilkent-JH36ORCC-Bnh1tLw9.js → cose-bilkent-JH36ORCC-DcMTug3a.js} +1 -1
- package/web/dist/assets/{cynefin-EF2NZ3EQ-kGniXg3w.js → cynefin-EF2NZ3EQ-BG2opkNs.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-WF24UDRP--Uo3wdoa.js → cynefinDiagram-WF24UDRP-BTIMNySy.js} +1 -1
- package/web/dist/assets/{dagre-NK4GIZVX-C6Wh-8uX.js → dagre-NK4GIZVX-1qi-5iCE.js} +1 -1
- package/web/dist/assets/{diagram-CBK3MWTC-5hd0s-_G.js → diagram-CBK3MWTC-CSH989hb.js} +1 -1
- package/web/dist/assets/{diagram-I5XIIV2D-Dk1mkLAG.js → diagram-I5XIIV2D-Z_1T8l7R.js} +1 -1
- package/web/dist/assets/{diagram-ODIL2UCW-CBt3ss4a.js → diagram-ODIL2UCW-B8jB07f-.js} +1 -1
- package/web/dist/assets/{diagram-PFBEJUXE-hYmeDTI1.js → diagram-PFBEJUXE-B9qraPmL.js} +1 -1
- package/web/dist/assets/{diagram-RJA3I4VV-BzbVAjB8.js → diagram-RJA3I4VV-CFhy381H.js} +1 -1
- package/web/dist/assets/{diagram-TYUNFSNR-DtRFKw4v.js → diagram-TYUNFSNR-DYEBj8MB.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-V4P3TTPT-B9DWiiEP.js → ebnfDiagram-V4P3TTPT-DGtaeIoV.js} +1 -1
- package/web/dist/assets/{elk-QONTBCTQ-BdbHmsQg.js → elk-QONTBCTQ-Cpcx9jQq.js} +1 -1
- package/web/dist/assets/{erDiagram-KYQIGQAA-hMT7oMcs.js → erDiagram-KYQIGQAA-BFMhv1lb.js} +1 -1
- package/web/dist/assets/{flowDiagram-IUGLLWBU-QHTEaXd4.js → flowDiagram-IUGLLWBU-ZvrIwHpb.js} +1 -1
- package/web/dist/assets/{ganttDiagram-R7GPNTJY-CQrMEpag.js → ganttDiagram-R7GPNTJY-CMElMuNb.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-PDYL7XHY-DTSXZY8U.js → gitGraphDiagram-PDYL7XHY-C2YKWJEE.js} +1 -1
- package/web/dist/assets/{index-DKlYleui.js → index-CcSO4iOX.js} +3 -3
- package/web/dist/assets/{infoDiagram-MVDRKAX5-xNT6AIyK.js → infoDiagram-MVDRKAX5-Cekh0IW0.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-HPEHV2GE-MOjUFqQG.js → ishikawaDiagram-HPEHV2GE-BoxRJEa6.js} +1 -1
- package/web/dist/assets/{journeyDiagram-BOSHW7O7-C6ix2UEr.js → journeyDiagram-BOSHW7O7-kDJSSn-6.js} +1 -1
- package/web/dist/assets/{kanban-definition-FNSA4HC5-m2Nnm0cp.js → kanban-definition-FNSA4HC5-CBQ3lPM5.js} +1 -1
- package/web/dist/assets/{linear-B0rSbcNk.js → linear-DSIqP0TT.js} +1 -1
- package/web/dist/assets/{mermaid.core-CzVteVfI.js → mermaid.core-wbwCbWuQ.js} +4 -4
- package/web/dist/assets/{mindmap-definition-6OY57UG3-BJXUx9NU.js → mindmap-definition-6OY57UG3-C2PqDFz9.js} +1 -1
- package/web/dist/assets/{pegDiagram-ECIUJNBX-BulMADbl.js → pegDiagram-ECIUJNBX-S9r7bybM.js} +1 -1
- package/web/dist/assets/{pieDiagram-GNMPY74T-D4YgVxMx.js → pieDiagram-GNMPY74T-C1DFot1v.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-D57K4MC3-CEV3_qk3.js → quadrantDiagram-D57K4MC3-QaUZgGzi.js} +1 -1
- package/web/dist/assets/{railroadDiagram-Y72NRBL7-CH4PrK1m.js → railroadDiagram-Y72NRBL7-BTsaNbut.js} +1 -1
- package/web/dist/assets/{requirementDiagram-EQYSW5RA-DvMpht2E.js → requirementDiagram-EQYSW5RA-Bul4YAfK.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-SY24JHO5-XVD77nVZ.js → sankeyDiagram-SY24JHO5-J8X2PWDq.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-BLEHNHQU-DkIENxL4.js → sequenceDiagram-BLEHNHQU-CTX4Y6no.js} +1 -1
- package/web/dist/assets/{sizeCapture-INFHLROL-_kq1C291.js → sizeCapture-INFHLROL-CXfB7h8n.js} +1 -1
- package/web/dist/assets/{stateDiagram-v2-A6IESKWZ-DsZFBHWW.js → stateDiagram-v2-A6IESKWZ-Kr5pKDbm.js} +1 -1
- package/web/dist/assets/{swimlanes-B3ENRKFQ-CFh405XI.js → swimlanes-B3ENRKFQ-DDWGDYUC.js} +1 -1
- package/web/dist/assets/swimlanesDiagram-AYQRV4AK-BkmYK-f1.js +8 -0
- package/web/dist/assets/{timeline-definition-JXYKGLGB-DXG5erfr.js → timeline-definition-JXYKGLGB-BAKElQ5f.js} +1 -1
- package/web/dist/assets/{usecaseDiagram-WPOLBNNX-CVHIvGVO.js → usecaseDiagram-WPOLBNNX-Dlw_OwnV.js} +1 -1
- package/web/dist/assets/{vennDiagram-Q3Y3IDCW-CaxyQ2k9.js → vennDiagram-Q3Y3IDCW-bTukfT0U.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-IVAIDKWA-Bf5fGTPN.js → wardleyDiagram-IVAIDKWA-DeM6AGmO.js} +1 -1
- package/web/dist/assets/{xychartDiagram-4URNHDU4-D1bQbTqS.js → xychartDiagram-4URNHDU4-CVYyvgbH.js} +1 -1
- package/web/dist/index.html +1 -1
- package/web/dist/assets/channel-BmW_aDh3.js +0 -1
- package/web/dist/assets/swimlanesDiagram-AYQRV4AK-BLXLX888.js +0 -8
|
@@ -163,7 +163,7 @@ Error generating stack: `+l.message+`
|
|
|
163
163
|
`);for(let b=0;b<m.length;b++){const v=m[b],_=v.match(/^@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(_){y=Number(_[2]),g=!0;continue}g&&(v===""&&b===m.length-1||v.startsWith("\\")||(v.startsWith("+")||v.startsWith(" ")||v==="")&&(h.set(y,v===""?"":v.slice(1)),y++))}s.set(u,h)}return s}function B_(i){const a=new Map;for(const[r,s]of j_(i))a.set(r,new Set(s.keys()));return a}function I_(i,a){const r=new Set(a.flatMap(s=>s.files));return ja(i).map(s=>s.path).filter(s=>!r.has(s))}function H_(i){return new Map(ja(i).map(a=>[a.path,a.patch.split(`
|
|
164
164
|
`).length]))}function q_(i){const a=i.split(`
|
|
165
165
|
`),r=a.findIndex(h=>h.startsWith("@@")),s=r<0?[]:a.slice(r).filter(h=>/^[+\- ]/.test(h)),u=(s.length>0?s:a).join(`
|
|
166
|
-
`);let f=2166136261;for(let h=0;h<u.length;h++)f^=u.charCodeAt(h),f=Math.imul(f,16777619);return(f>>>0).toString(16).padStart(8,"0")}const Zb={blocker:"🚨",minor:"⚠️",nit:"🎨"};function fg(i,a){return a?`${Zb[a]} **${a}** — ${i}`:i}function Xb(i,a,r){const s=`${a}/${r}`.toLowerCase();for(const[u,f]of Object.entries(i.autoReviewRepos))if(u.toLowerCase()===s)return f;return i.autoReview}const hg=["inbox","awaiting","drafted"],Cd=["requests","settled","sent","archived"],zu={inbox:{label:"inbox",title:"Everything still waiting on you — drafted reviews and PRs the poll found but nobody has read."},awaiting:{label:"awaiting",title:"Found by the inbox poll, not drafted yet — or a run is in flight right now."},drafted:{label:"drafted",title:"A draft is written and waiting for you to read it."},requests:{label:"open requests",title:"GitHub still lists you as a requested reviewer on these. You settled or archived them here without submitting a review, so they also appear under whichever tab you filed them in."},settled:{label:"settled",title:"You marked these reviewed or skipped, or handed them to somebody else. No review of yours was sent to GitHub."},sent:{label:"sent",title:"Reviews that reached GitHub. Kept here as a record."},archived:{label:"archived",title:"PRs that have since been merged or closed."}};function pg(i){return i.status==="awaiting"||i.status==="running"?"awaiting":i.status==="sent"?"sent":"drafted"}const Gs=i=>!!i.pr.state&&i.pr.state!=="OPEN";function Md(i){return i.status==="awaiting"?i.pr.updatedAt??i.updatedAt:i.updatedAt}function Il(i){return[...i].sort((a,r)=>Md(r).localeCompare(Md(a)))}const Vb=["sent","reviewed","skipped"],tl=i=>i.own===!0;function Qb(i){return[...i.filter(a=>!tl(a)),...i.filter(tl)]}const G_=(i,a)=>tl(i[a])&&(a===0||!tl(i[a-1]));function $s(i){return Qb(Il(i.filter(a=>!Gs(a)&&!Vb.includes(a.status))))}function $_(i,a,r){return $s(i).filter(s=>s.key===a||!r.has(s.key))}function Y_(i,a){if(!(a!=null&&a.enabled)||a.awaiting.length===0)return[];const r=new Set($s(i).map(u=>u.id)),s=new Set(a.awaiting.map(u=>u.id));return Il(i.filter(u=>s.has(u.id)&&!r.has(u.id)))}const F_=(i,a)=>a.some(r=>r.id===i.id);function P_(i,a){const r=i.filter(u=>!Gs(u)),s=Qb(Il(r.filter(u=>!Vb.includes(u.status))));return{inbox:s,awaiting:s.filter(u=>pg(u)==="awaiting"),drafted:s.filter(u=>pg(u)==="drafted"),requests:Y_(i,a),settled:Il(r.filter(u=>u.status==="reviewed"||u.status==="skipped")),sent:Il(r.filter(u=>u.status==="sent")),archived:Il(i.filter(Gs))}}function K_(i,a){return Cd.includes(i)&&a[i].length===0?"inbox":i}function Wb(i){var a,r;return i.reason==="own-review"?((a=i.review)==null?void 0:a.at)??i.at:i.reason==="own-reply"?((r=i.reply)==null?void 0:r.at)??i.at:i.at}const ho={"own-review":{tag:"reviewed on GitHub",meta:i=>`you reviewed this on GitHub on ${i}`,reasoning:"GitHub stopped asking you for a review and already had one of yours, so this draft was filed rather than left in the inbox. It was never sent — open it to read or send it.",requested:"You submitted a review on GitHub, outside cerber, so this draft was filed."},"own-reply":{tag:"replied on GitHub",meta:i=>`you replied on GitHub on ${i}`,reasoning:"You answered in the PR conversation and nobody has answered back, so the draft was filed rather than left in the inbox. GitHub does not count a comment as a review, but whoever opened the PR is the one holding it. Nothing was sent — open it to read or send it.",requested:"You commented on the PR and nobody answered, so this draft was filed."},"request-withdrawn":{tag:"request withdrawn",meta:i=>`nobody was asking for this any more on ${i}`,reasoning:"Whoever asked for this review took the request back, and you had said nothing on the PR, so the draft was filed rather than left in the inbox. It is still a review — open it to read or send it.",requested:"The review request had gone away when this draft was filed."}};function Z_(i){var a;return Gs(i)?((a=i.pr.state)==null?void 0:a.toLowerCase())??null:i.handoff?`handed to @${i.handoff.to}`:i.filed?ho[i.filed.reason].tag:i.status==="reviewed"||i.status==="skipped"?i.status:null}function X_(i,a){var r;return a!=null&&a.enabled?((r=a.awaiting.find(s=>s.id===i.id))==null?void 0:r.reply)??"unknown":"unknown"}const V_={none:{label:"you haven't replied",title:"GitHub still lists you as a requested reviewer and you have said nothing on the PR — no review, no comment. Whoever opened it is waiting on you."},you:{label:"waiting on them",title:"You had the last word in the conversation but never submitted a review, so GitHub still lists you as a requested reviewer. Nothing is blocked on you until they answer."},them:{label:"they replied last",title:"You commented and someone has answered since, so the conversation is back with you — and GitHub still lists you as a requested reviewer, because a comment is not a review."},unknown:{label:"unanswered on GitHub",title:"You have never submitted a review on GitHub for this PR, so it still lists you as a requested reviewer. Cerber could not read the conversation, so it can't say whether you replied there."}},Q_=i=>V_[i];function W_(i){const a=tf[i.event]??i.event,r=new Date(i.at).toLocaleDateString();return{label:i.auto?"auto-sent a review":"you replied with a review",title:`${i.auto?"The daemon auto-sent this review":"You sent this review"} to GitHub on ${r} as ${a}. The last inbox poll still listed a review request for you — a request can lag a send, and GitHub holds some open even after one.`}}function J_(i){const a=ho[i.reason],r=new Date(Wb(i)).toLocaleDateString();return{label:a.tag,title:`${a.requested} That was ${r}. GitHub lists a review request for you now — most likely the author has asked for another look since. Re-review it to draft against the current head.`}}function e0(i){const a=new Date(i.at).toLocaleDateString();return{label:`handed to @${i.to}`,title:i.withdrewYours?`You handed this to @${i.to} on ${a} and cerber took your own review request off the PR. GitHub still lists one for you — most likely the last inbox poll ran before the swap, or somebody has asked you again since.`:`You handed this to @${i.to} on ${a}, but cerber could not take your own review request off the PR — so GitHub is asking both of you. Remove yourself on GitHub if that is not what you wanted.`}}const t0=(i,a)=>i.handoff?e0(i.handoff):i.sent?W_(i.sent):i.filed?J_(i.filed):Q_(a);function n0(i){const a=i.length,r=a===1?"1 review request":`${a} review requests`,s=i.some(Gs)?"settled or archived":"settled";return`Nothing new in the inbox — but GitHub still has ${r} open on you. You ${s} ${a===1?"it":"them"} here without submitting a review, so ${a===1?"it is":"they are"} under open requests, tagged with whose move it is.`}function Jb(i,a=Date.now()){const r=Math.max(0,Math.round((a-new Date(i).getTime())/1e3));return r<45?"now":r<3600?`${Math.round(r/60)}m`:r<86400?`${Math.round(r/3600)}h`:`${Math.round(r/86400)}d`}const a0={approve:"approve",comment:"comment",request_changes:"changes"},tf={APPROVE:"approve",COMMENT:"comment",REQUEST_CHANGES:"request changes"};function i0(i){return i.status==="running"?{label:"reviewing…",tone:"running"}:i.status==="awaiting"?{label:"review now",tone:"awaiting"}:i.status==="failed"?{label:"run failed",tone:"failed"}:i.sent?{label:`sent · ${tf[i.sent.event]??i.sent.event}`,tone:"sent"}:i.verdict?{label:`${i.verdict.recommendation.replace("_"," ")} ${i.verdict.confidence}%`,tone:a0[i.verdict.recommendation]??"none"}:{label:"—",tone:"none"}}function l0(i){return i.status==="running"||i.status==="awaiting"||i.status==="failed"||!i.verdict&&!i.sent?"—":String(i.commentCount)}function ju(i){return i.trusted?"ran the code":i.withSource?"read the full source":"read the diff only"}function s0(i){if(i.commentCount===0)return"no comments drafted";const a=[`${i.commentCount} comment${i.commentCount===1?"":"s"} drafted`];return i.driftedCount&&a.push(`${i.driftedCount} off-diff`),i.gradedCount&&a.push(i.blockerCount?`${i.blockerCount} blocker${i.blockerCount===1?"":"s"}`:"no blockers"),a.join(", ")}function r0(i,a){const r=Object.values(a).filter(s=>s!==i).length;return r===0?"":` · ${r} repo${r===1?"":"s"} ${i?"on click":"auto"}`}function o0(i,a,r=Date.now()){var u,f;if(i.status==="running")return{reasoning:"Claude is reading the current head. This row updates itself when the run lands.",meta:[`started ${Jb(i.updatedAt,r)} ago`,ju(i)]};if(i.status==="awaiting"&&tl(i))return{reasoning:"Your own PR. Cerber never drafts these on its own — ask for a self-review when you want one. Send posts it as a comment: GitHub takes no approve or change request from a PR's author.",meta:["no run yet","press r to review now"]};if(i.status==="awaiting")return a!=null&&a.enabled&&a.pollEnabled&&!Xb({autoReview:a.autoReview,autoReviewRepos:a.autoReviewRepos??{}},i.pr.owner,i.pr.repo)?{reasoning:`Found by the inbox poll. ${a.autoReview?`Auto-review is off for ${i.pr.owner}/${i.pr.repo}`:"Auto-review is off"}, so it waits for you to ask for a draft.`,meta:["no run yet","press r to review now"]}:{reasoning:"Found by the inbox poll, not drafted yet — auto-review was off when it arrived, or it is still queued behind another run.",meta:["no run yet","press r to review now"]};if(i.status==="failed")return{reasoning:i.runError??"The review run failed before it produced a draft.",meta:["press r to try again"]};if(i.sent)return{reasoning:`Sent to GitHub as ${tf[i.sent.event]??i.sent.event} on ${new Date(i.sent.at).toLocaleDateString()}. Kept here as a record; the conversation can't continue, though a re-review can draft against the current head.`+(i.handoff?` GitHub asks @${i.handoff.to} for it now.`:""),meta:[...i.handoff?[`you handed this to @${i.handoff.to}`]:[],i.sent.auto?"auto-sent by the daemon":"sent by you",ju(i)]};const s=[ju(i)];if(i.handoff?s.unshift(`you handed this to @${i.handoff.to} on ${new Date(i.handoff.at).toLocaleDateString()}`):i.filed?s.unshift(ho[i.filed.reason].meta(new Date(Wb(i.filed)).toLocaleDateString())):i.status==="reviewed"?s.unshift("you marked this reviewed"):i.status==="skipped"&&s.unshift("you skipped this"),i.costUsd!=null&&s.push(`≈$${i.costUsd.toFixed(2)} at API rates`),s.push(s0(i)),tl(i)?s.push("your PR — sends as a comment"):a!=null&&a.enabled&&i.status==="ready"&&((u=i.verdict)==null?void 0:u.recommendation)==="approve"&&s.push(i.verdict.confidence>=a.autoSendThreshold?`auto-send candidate at ${i.verdict.confidence}%`:`below the ${a.autoSendThreshold}% auto-send bar`),i.handoff){const h=i.commentCount>0||i.verdict!=null;return{reasoning:`GitHub asks @${i.handoff.to} for this review now${i.handoff.withdrewYours?" and no longer asks you":" — and still asks you, because your own request could not be taken off"}. `+(h?"The draft was never sent: it is still yours to read or send.":"Nothing was drafted here, and nothing was sent."),meta:s}}return i.filed?{reasoning:ho[i.filed.reason].reasoning,meta:s}:{reasoning:((f=i.verdict)==null?void 0:f.reasoning)??"This review has a draft but no verdict.",meta:s}}const c0="/favicon.svg",u0="/favicon-dot.svg",d0=i=>$s(i).some(a=>!(tl(a)&&a.status==="awaiting")),f0=i=>i?u0:c0;function h0(i){const a=f0(d0(i)),r=document.querySelector("link[rel='icon']");!r||r.getAttribute("href")===a||r.setAttribute("href",a)}async function Ut(i,a){const r=await fetch(i,{...a,headers:a!=null&&a.body?{"Content-Type":"application/json"}:void 0});if(!r.ok){let s=`${(a==null?void 0:a.method)??"GET"} ${i}: ${r.status}`;try{const u=await r.json();u.error&&(s=u.error)}catch{}throw new Error(s)}return r.json()}const So=async()=>{const i=await Ut("/api/reviews");return h0(i),i},nf=()=>Ut("/api/daemon"),mg=i=>Ut(`/api/reviews/${encodeURIComponent(i)}`),p0=(i,a,r)=>Ut(`/api/reviews/${encodeURIComponent(i)}/viewed`,{method:"PUT",body:JSON.stringify({path:a,fingerprint:r})}),ro=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}`,{method:"PATCH",body:JSON.stringify(a)}),m0=(i,a,r)=>Ut(`/api/reviews/${encodeURIComponent(i)}/comments/${a}`,{method:"PATCH",body:JSON.stringify(r)}),g0=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/comments`,{method:"POST",body:JSON.stringify(a)}),b0=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/comments/${a}`,{method:"DELETE"}),y0=i=>Ut("/api/reviews",{method:"POST",body:JSON.stringify({input:i})}),v0=i=>Ut(`/api/reviews/${encodeURIComponent(i)}/refresh`,{method:"POST"}),ey=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/rerun`+(a===void 0?"":`?source=${a?"1":"0"}`),{method:"POST"}),Dd=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/chat`,{method:"POST",body:JSON.stringify(a)}),E0=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/chat/steer`,{method:"POST",body:JSON.stringify({message:a})}),_0=i=>Ut(`/api/reviews/${encodeURIComponent(i)}/chat/pending`,{method:"DELETE"}),S0=i=>Ut(`/api/reviews/${encodeURIComponent(i)}/chat/reset`,{method:"POST",body:JSON.stringify({})}),ty=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/send-preview?event=${a}`),w0=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/send`,{method:"POST",body:JSON.stringify({event:a,confirm:!0})}),N0=i=>Ut(`/api/reviews/${encodeURIComponent(i)}/raised`,{method:"POST"}),x0=i=>Ut(`/api/reviews/${encodeURIComponent(i)}/reviewers`),T0=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/handoff`,{method:"POST",body:JSON.stringify({...a,confirm:!0})}),A0=i=>`/api/reviews/${encodeURIComponent(i)}/export`,R0=()=>Ut("/api/config"),Uu=(i,a=!1)=>Ut("/api/config/trust",{method:"POST",body:JSON.stringify({rule:i,remove:a})}),k0=(i,a)=>Ut("/api/config/auto-review-repo",{method:"POST",body:JSON.stringify({repo:i,on:a})}),no=i=>Ut("/api/config/daemon",{method:"POST",body:JSON.stringify(i)}),ny="cerber.handoff.recent",ay=5,O0=/^[A-Za-z0-9](?:[A-Za-z0-9_-]{0,37}[A-Za-z0-9])?$/,iy=i=>O0.test(i);function C0(i){try{const a=JSON.parse(i??"");return Array.isArray(a)?a.filter(r=>typeof r=="string"&&iy(r)).slice(0,ay):[]}catch{return[]}}function ly(){try{return C0(localStorage.getItem(ny))}catch{return[]}}function M0(i,a){const r=i.filter(s=>s.toLowerCase()!==a.toLowerCase());return[a,...r].slice(0,ay)}function D0(i){const a=M0(ly(),i);try{localStorage.setItem(ny,JSON.stringify(a))}catch{}return a}const Ld=i=>i.trim().replace(/^@/,"");function L0(i,a){const r=new Set,s=[];for(const u of[...a,...i]){const f=u.toLowerCase();r.has(f)||(r.add(f),s.push({login:u,recent:a.some(h=>h.toLowerCase()===f)}))}return s}function z0(i,a){const r=Ld(a).toLowerCase();if(!r)return i;const s=i.filter(h=>h.login.toLowerCase().includes(r)),u=h=>h.login.toLowerCase()===r,f=h=>h.login.toLowerCase().startsWith(r);return[...s.filter(u),...s.filter(h=>!u(h)&&f(h)),...s.filter(h=>!f(h))]}function Bu(i){return i.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function zd(i){return i.nodeName.toLowerCase()}function gg(i){const a=[],r=(s,u)=>{for(let f=s.firstChild;f;f=f.nextSibling)f.nodeType===3&&f.nodeValue!==null?u+=f.nodeValue.length:f.nodeType===1&&(a.push({event:"start",offset:u,node:f}),u=r(f,u),zd(f).match(/br|hr|img|input/)||a.push({event:"stop",offset:u,node:f}));return u};return r(i,0),a}function j0(i,a,r){let s=0,u="";const f=[];function h(v){return v!==null&&(v==null?void 0:v.attributes)!==void 0}function y(){return!i.length||!a.length?i.length?i:a:i[0].offset!==a[0].offset?i[0].offset<a[0].offset?i:a:a[0].event==="start"?i:a}function g(v){if(!h(v))throw new Error("Node is not an Element");u+=`<${zd(v)} ${Array().map.call(v.attributes,_=>`${_.nodeName}="${Bu(_.value).replace(/"/g,""")}"`).join(" ")}>`}function m(v){u+="</"+zd(v)+">"}function b(v){(v.event==="start"?g:m)(v.node)}for(;i.length||a.length;){let v=y();if(u+=Bu(r.substring(s,v[0].offset)),s=v[0].offset,v===i){f.reverse().forEach(m);do b(v.splice(0,1)[0]),v=y();while(v===i&&v.length&&v[0].offset===s);f.reverse().forEach(g)}else v[0].event==="start"?f.push(v[0].node):f.pop(),b(v.splice(0,1)[0])}return u+Bu(r.substr(s))}const U0={"1c":"1c",abnf:"abnf",accesslog:"accesslog",as:"actionscript",adb:"ada",ada:"ada",ads:"ada",angelscript:"angelscript",apache:"apache",applescript:"applescript",scpt:"applescript",arcade:"arcade",cpp:"cpp",hpp:"cpp",arduino:"arduino",ino:"arduino",armasm:"armasm",arm:"armasm",xml:"xml",html:"xml",xhtml:"xml",rss:"xml",atom:"xml",xjb:"xml",xsd:"xml",xsl:"xml",plist:"xml",svg:"xml",asciidoc:"asciidoc",adoc:"asciidoc",asc:"asciidoc",aspectj:"aspectj",ahk:"autohotkey",ahkl:"autohotkey",au3:"autoit",avrasm:"avrasm",awk:"awk",axapta:"axapta","x++":"axapta",bash:"bash",sh:"bash",zsh:"bash",b:"basic",bnf:"bnf",bf:"brainfuck",c:"c",h:"c",cats:"c",idc:"c",cal:"cal",capnproto:"capnproto",capnp:"capnproto",ceylon:"ceylon",clean:"clean",clj:"clojure",boot:"clojure",cl2:"clojure",cljc:"clojure",cljs:"clojure","cljs.hl":"clojure",cljscm:"clojure",cljx:"clojure",hic:"clojure","clojure-repl":"clojure-repl",cmake:"cmake","cmake.in":"cmake",coffee:"coffeescript",_coffee:"coffeescript",cake:"coffeescript",cjsx:"coffeescript",iced:"coffeescript",cson:"coffeescript",coq:"coq",cos:"cos",cls:"cos",crmsh:"crmsh",crm:"crmsh",pcmk:"crmsh",cr:"crystal",cs:"csharp",csx:"csharp",csp:"csp",css:"css",d:"d",di:"d",md:"markdown",markdown:"markdown",mdown:"markdown",mdwn:"markdown",mkd:"markdown",mkdn:"markdown",mkdown:"markdown",ronn:"markdown",workbook:"markdown",dart:"dart",dpr:"delphi",dfm:"delphi",pas:"delphi",pascal:"delphi",diff:"diff",patch:"diff",django:"django",jinja:"django",dns:"dns",zone:"dns",bind:"dns",dockerfile:"dockerfile",docker:"dockerfile",dos:"dos",bat:"dos",cmd:"dos",dsconfig:"dsconfig",dts:"dts",dust:"dust",dst:"dust",ebnf:"ebnf",ex:"elixir",exs:"elixir",elm:"elm",rb:"ruby",builder:"ruby",eye:"ruby",gemspec:"ruby",god:"ruby",jbuilder:"ruby",mspec:"ruby",pluginspec:"ruby",podspec:"ruby",rabl:"ruby",rake:"ruby",rbuild:"ruby",rbw:"ruby",rbx:"ruby",ru:"ruby",ruby:"ruby",spec:"ruby",thor:"ruby",watchr:"ruby",erb:"erb","erlang-repl":"erlang-repl",erl:"erlang","app.src":"erlang",escript:"erlang",hrl:"erlang",xrl:"erlang",yrl:"erlang",excel:"excel",xls:"excel",xlsx:"excel",fix:"fix",flix:"flix",f90:"fortran",f:"fortran",f03:"fortran",f08:"fortran",f77:"fortran",f95:"fortran",for:"fortran",fpp:"fortran",fs:"fsharp",fsx:"fsharp",gams:"gams",gms:"gams",gauss:"gauss",gss:"gauss",gcode:"gcode",nc:"gcode",gherkin:"gherkin",glsl:"glsl",fp:"glsl",frag:"glsl",frg:"glsl",fsh:"glsl",fshader:"glsl",geo:"glsl",geom:"glsl",glslv:"glsl",gshader:"glsl",shader:"glsl",tesc:"glsl",tese:"glsl",vert:"glsl",vrx:"glsl",vsh:"glsl",vshader:"glsl",gml:"gml",go:"go",bal:"go",golo:"golo",gololang:"golo",gradle:"gradle",groovy:"groovy",grt:"groovy",gtpl:"groovy",gvy:"groovy",haml:"haml","haml.deface":"haml",handlebars:"handlebars",hbs:"handlebars","html.hbs":"handlebars","html.handlebars":"handlebars",hs:"haskell",hsc:"haskell",idr:"haskell",purs:"haskell",hx:"haxe",hxsl:"haxe",hsp:"hsp",htmlbars:"htmlbars",http:"http",https:"http",hy:"hy",inform7:"inform7",i7:"inform7",ini:"ini",toml:"ini",cfg:"ini",prefs:"ini",irpf90:"irpf90",isbl:"isbl",java:"java",jsp:"java",js:"javascript",jsx:"javascript",_js:"javascript",bones:"javascript",es:"javascript",es6:"javascript",gs:"javascript",jake:"javascript",jsb:"javascript",jscad:"javascript",jsfl:"javascript",jsm:"javascript",jss:"javascript",mjs:"javascript",njs:"javascript",pac:"javascript",sjs:"javascript",ssjs:"javascript",xsjs:"javascript",xsjslib:"javascript",cfc:"javascript","jboss-cli":"jboss-cli",json:"json",avsc:"json",geojson:"json",gltf:"json","JSON-tmLanguage":"json",jsonl:"json",tfstate:"json","tfstate.backup":"json",topojson:"json",webapp:"json",webmanifest:"json",jl:"julia","julia-repl":"julia-repl",kt:"kotlin",ktm:"kotlin",kts:"kotlin",lasso:"lasso",lassoscript:"lasso",tex:"latex",ldif:"ldif",leaf:"leaf",less:"less",lisp:"lisp",factor:"lisp",livecodeserver:"livecodeserver",ls:"livescript",_ls:"livescript",llvm:"llvm",lsl:"lsl",lua:"lua",nse:"lua",p8:"lua",pd_lua:"lua",rbxs:"lua",wlua:"lua",mak:"makefile",make:"makefile",mk:"makefile",mkfile:"makefile",mathematica:"mathematica",mma:"mathematica",wl:"mathematica",matlab:"matlab",maxima:"maxima",mel:"mel",mercury:"mercury",mipsasm:"mipsasm",miz:"mizar",voc:"mizar",al:"perl",cgi:"perl",fcgi:"perl",perl:"perl",ph:"perl",plx:"perl",pl:"perl",pm:"perl",psgi:"perl",t:"perl",mojolicious:"mojolicious",monkey:"monkey",monkey2:"monkey",moonscript:"moonscript",moon:"moonscript",n1ql:"n1ql",nginxconf:"nginx",nim:"nim",nimrod:"nim",nix:"nix",nsi:"nsis",nsh:"nsis",m:"objectivec",objc:"objectivec",mm:"objectivec","obj-c":"objectivec","obj-c++":"objectivec","objective-c++":"objectivec",fun:"ocaml",sig:"ocaml",ml:"ocaml",mli:"ocaml",eliom:"ocaml",eliomi:"ocaml",ml4:"ocaml",mll:"ocaml",mly:"ocaml",openscad:"openscad",oxygene:"oxygene",parser3:"parser3",pf:"pf","pf.conf":"pf",pgsql:"pgsql",postgres:"pgsql",postgresql:"pgsql",php:"php",aw:"php",ctp:"php",inc:"php",php3:"php",php4:"php",php5:"php",phps:"php",phpt:"php","php-template":"php-template",plaintext:"plaintext",txt:"plaintext",text:"plaintext",pony:"pony",ps:"powershell",ps1:"powershell",psd1:"powershell",psm1:"powershell",pde:"processing",profile:"profile",pro:"prolog",prolog:"prolog",yap:"prolog",properties:"properties",proto:"protobuf",puppet:"puppet",pp:"puppet",purebasic:"purebasic",py:"python",bzl:"python",gyp:"python",gypi:"python",lmi:"python",py3:"python",pyde:"python",pyi:"python",pyp:"python",pyt:"python",pyw:"python",rpy:"python",tac:"python",wsgi:"python",xpy:"python","python-repl":"python-repl",pycon:"python-repl",q:"q",k:"q",kdb:"q",qml:"qml",r:"r",rd:"r",rsx:"r",reasonml:"reasonml",re:"reasonml",rib:"rib",roboconf:"roboconf",graph:"roboconf",instances:"roboconf",routeros:"routeros",rsl:"rsl",ruleslanguage:"ruleslanguage",rs:"rust","rs.in":"rust",sas:"sas",scala:"scala",kojo:"scala",sbt:"scala",sc:"scala",scm:"scheme",sch:"scheme",sld:"scheme",sls:"scheme",sps:"scheme",ss:"scheme",rkt:"scheme",scilab:"scilab",scss:"scss",shell:"shell",smali:"smali",st:"smalltalk",sml:"sml",sqf:"sqf",sql:"sql",cql:"sql",ddl:"sql",mysql:"sql",prc:"sql",tab:"sql",udf:"sql",viw:"sql",stan:"stan",stanfuncs:"stan",stata:"stata",step21:"step21",step:"step21",stp:"step21",styl:"stylus",subunit:"subunit",swift:"swift",taggerscript:"taggerscript",yml:"yaml",mir:"yaml",reek:"yaml",rviz:"yaml","sublime-syntax":"yaml",syntax:"yaml",yaml:"yaml","yaml-tmlanguage":"yaml","yml.mysql":"yaml",tap:"tap",tcl:"tcl",adp:"tcl",tm:"tcl",thrift:"thrift",tp:"tp",twig:"twig",craftcms:"twig",ts:"typescript",tsx:"typescript",vala:"vala",vbnet:"vbnet",vb:"vbnet",vbscript:"vbscript",vbs:"vbscript","vbscript-html":"vbscript-html",v:"verilog",veo:"verilog",vhdl:"vhdl",vhd:"vhdl",vhf:"vhdl",vhi:"vhdl",vho:"vhdl",vhs:"vhdl",vht:"vhdl",vhw:"vhdl",vim:"vim",x86asm:"x86asm",xl:"xl",xquery:"xquery",xpath:"xquery",xq:"xquery",zephir:"zephir",zep:"zephir"};function B0(i){var a;return(a=U0[i])!==null&&a!==void 0?a:"plaintext"}var Iu,bg;function I0(){if(bg)return Iu;bg=1;function i(k){return k instanceof Map?k.clear=k.delete=k.set=function(){throw new Error("map is read-only")}:k instanceof Set&&(k.add=k.clear=k.delete=function(){throw new Error("set is read-only")}),Object.freeze(k),Object.getOwnPropertyNames(k).forEach(te=>{const ye=k[te],ze=typeof ye;(ze==="object"||ze==="function")&&!Object.isFrozen(ye)&&i(ye)}),k}class a{constructor(te){te.data===void 0&&(te.data={}),this.data=te.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(k){return k.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function s(k,...te){const ye=Object.create(null);for(const ze in k)ye[ze]=k[ze];return te.forEach(function(ze){for(const Qe in ze)ye[Qe]=ze[Qe]}),ye}const u="</span>",f=k=>!!k.scope,h=(k,{prefix:te})=>{if(k.startsWith("language:"))return k.replace("language:","language-");if(k.includes(".")){const ye=k.split(".");return[`${te}${ye.shift()}`,...ye.map((ze,Qe)=>`${ze}${"_".repeat(Qe+1)}`)].join(" ")}return`${te}${k}`};class y{constructor(te,ye){this.buffer="",this.classPrefix=ye.classPrefix,te.walk(this)}addText(te){this.buffer+=r(te)}openNode(te){if(!f(te))return;const ye=h(te.scope,{prefix:this.classPrefix});this.span(ye)}closeNode(te){f(te)&&(this.buffer+=u)}value(){return this.buffer}span(te){this.buffer+=`<span class="${te}">`}}const g=(k={})=>{const te={children:[]};return Object.assign(te,k),te};class m{constructor(){this.rootNode=g(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(te){this.top.children.push(te)}openNode(te){const ye=g({scope:te});this.add(ye),this.stack.push(ye)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(te){return this.constructor._walk(te,this.rootNode)}static _walk(te,ye){return typeof ye=="string"?te.addText(ye):ye.children&&(te.openNode(ye),ye.children.forEach(ze=>this._walk(te,ze)),te.closeNode(ye)),te}static _collapse(te){typeof te!="string"&&te.children&&(te.children.every(ye=>typeof ye=="string")?te.children=[te.children.join("")]:te.children.forEach(ye=>{m._collapse(ye)}))}}class b extends m{constructor(te){super(),this.options=te}addText(te){te!==""&&this.add(te)}startScope(te){this.openNode(te)}endScope(){this.closeNode()}__addSublanguage(te,ye){const ze=te.root;ye&&(ze.scope=`language:${ye}`),this.add(ze)}toHTML(){return new y(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function v(k){return k?typeof k=="string"?k:k.source:null}function _(k){return C("(?=",k,")")}function T(k){return C("(?:",k,")*")}function S(k){return C("(?:",k,")?")}function C(...k){return k.map(ye=>v(ye)).join("")}function A(k){const te=k[k.length-1];return typeof te=="object"&&te.constructor===Object?(k.splice(k.length-1,1),te):{}}function R(...k){return"("+(A(k).capture?"":"?:")+k.map(ze=>v(ze)).join("|")+")"}function $(k){return new RegExp(k.toString()+"|").exec("").length-1}function U(k,te){const ye=k&&k.exec(te);return ye&&ye.index===0}const W=new RegExp(R(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function z(k,{joinWith:te}){let ye=0;return k.map(ze=>{ye+=1;const Qe=ye;let et=v(ze),Ae="";for(;et.length>0;){const Se=W.exec(et);if(!Se){Ae+=et;break}Ae+=et.substring(0,Se.index),et=et.substring(Se.index+Se[0].length),Se[0][0]==="\\"&&Se[1]?Ae+="\\"+String(Number(Se[1])+Qe):(Ae+=Se[0],(Se[0]==="("||/^\(\?[<']/.test(Se[0]))&&ye++)}return Ae}).map(ze=>`(${ze})`).join(te)}const ae=/\b\B/,se="[a-zA-Z]\\w*",x="[a-zA-Z_]\\w*",G="\\b\\d+(\\.\\d+)?",ee="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ue="\\b(0b[01]+)",Ee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",j=(k={})=>{const te=/^#![ ]*\//;return k.binary&&(k.begin=C(te,/.*\b/,k.binary,/\b.*/)),s({scope:"meta",begin:te,end:/$/,relevance:0,"on:begin":(ye,ze)=>{ye.index!==0&&ze.ignoreMatch()}},k)},le={begin:"\\\\[\\s\\S]",relevance:0},fe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[le]},M={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[le]},Q={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},pe=function(k,te,ye={}){const ze=s({scope:"comment",begin:k,end:te,contains:[]},ye);ze.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Qe=R("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return ze.contains.push({begin:C(/[ ]+/,"(",Qe,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ze},we=pe("//","$"),De=pe("/\\*","\\*/"),w=pe("#","$"),L={scope:"number",begin:G,relevance:0},I={scope:"number",begin:ee,relevance:0},oe={scope:"number",begin:ue,relevance:0},me={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[le,{begin:/\[/,end:/\]/,relevance:0,contains:[le]}]},ve={scope:"title",begin:se,relevance:0},X={scope:"title",begin:x,relevance:0},be={begin:"\\.\\s*"+x,relevance:0};var Ge=Object.freeze({__proto__:null,APOS_STRING_MODE:fe,BACKSLASH_ESCAPE:le,BINARY_NUMBER_MODE:oe,BINARY_NUMBER_RE:ue,COMMENT:pe,C_BLOCK_COMMENT_MODE:De,C_LINE_COMMENT_MODE:we,C_NUMBER_MODE:I,C_NUMBER_RE:ee,END_SAME_AS_BEGIN:function(k){return Object.assign(k,{"on:begin":(te,ye)=>{ye.data._beginMatch=te[1]},"on:end":(te,ye)=>{ye.data._beginMatch!==te[1]&&ye.ignoreMatch()}})},HASH_COMMENT_MODE:w,IDENT_RE:se,MATCH_NOTHING_RE:ae,METHOD_GUARD:be,NUMBER_MODE:L,NUMBER_RE:G,PHRASAL_WORDS_MODE:Q,QUOTE_STRING_MODE:M,REGEXP_MODE:me,RE_STARTERS_RE:Ee,SHEBANG:j,TITLE_MODE:ve,UNDERSCORE_IDENT_RE:x,UNDERSCORE_TITLE_MODE:X});function $e(k,te){k.input[k.index-1]==="."&&te.ignoreMatch()}function Ce(k,te){k.className!==void 0&&(k.scope=k.className,delete k.className)}function St(k,te){te&&k.beginKeywords&&(k.begin="\\b("+k.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",k.__beforeBegin=$e,k.keywords=k.keywords||k.beginKeywords,delete k.beginKeywords,k.relevance===void 0&&(k.relevance=0))}function Ke(k,te){Array.isArray(k.illegal)&&(k.illegal=R(...k.illegal))}function In(k,te){if(k.match){if(k.begin||k.end)throw new Error("begin & end are not supported with match");k.begin=k.match,delete k.match}}function Je(k,te){k.relevance===void 0&&(k.relevance=1)}const Ln=(k,te)=>{if(!k.beforeMatch)return;if(k.starts)throw new Error("beforeMatch cannot be used with starts");const ye=Object.assign({},k);Object.keys(k).forEach(ze=>{delete k[ze]}),k.keywords=ye.keywords,k.begin=C(ye.beforeMatch,_(ye.begin)),k.starts={relevance:0,contains:[Object.assign(ye,{endsParent:!0})]},k.relevance=0,delete ye.beforeMatch},Hn=["of","and","for","in","not","or","if","then","parent","list","value"],It="keyword";function Rt(k,te,ye=It){const ze=Object.create(null);return typeof k=="string"?Qe(ye,k.split(" ")):Array.isArray(k)?Qe(ye,k):Object.keys(k).forEach(function(et){Object.assign(ze,Rt(k[et],te,et))}),ze;function Qe(et,Ae){te&&(Ae=Ae.map(Se=>Se.toLowerCase())),Ae.forEach(function(Se){const Ue=Se.split("|");ze[Ue[0]]=[et,on(Ue[0],Ue[1])]})}}function on(k,te){return te?Number(te):yn(k)?0:1}function yn(k){return Hn.includes(k.toLowerCase())}const Ft={},je=k=>{console.error(k)},Lt=(k,...te)=>{console.log(`WARN: ${k}`,...te)},vt=(k,te)=>{Ft[`${k}/${te}`]||(console.log(`Deprecated as of ${k}. ${te}`),Ft[`${k}/${te}`]=!0)},Ot=new Error;function Tn(k,te,{key:ye}){let ze=0;const Qe=k[ye],et={},Ae={};for(let Se=1;Se<=te.length;Se++)Ae[Se+ze]=Qe[Se],et[Se+ze]=!0,ze+=$(te[Se-1]);k[ye]=Ae,k[ye]._emit=et,k[ye]._multi=!0}function zn(k){if(Array.isArray(k.begin)){if(k.skip||k.excludeBegin||k.returnBegin)throw je("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ot;if(typeof k.beginScope!="object"||k.beginScope===null)throw je("beginScope must be object"),Ot;Tn(k,k.begin,{key:"beginScope"}),k.begin=z(k.begin,{joinWith:""})}}function An(k){if(Array.isArray(k.end)){if(k.skip||k.excludeEnd||k.returnEnd)throw je("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ot;if(typeof k.endScope!="object"||k.endScope===null)throw je("endScope must be object"),Ot;Tn(k,k.end,{key:"endScope"}),k.end=z(k.end,{joinWith:""})}}function jn(k){k.scope&&typeof k.scope=="object"&&k.scope!==null&&(k.beginScope=k.scope,delete k.scope)}function Rn(k){jn(k),typeof k.beginScope=="string"&&(k.beginScope={_wrap:k.beginScope}),typeof k.endScope=="string"&&(k.endScope={_wrap:k.endScope}),zn(k),An(k)}function cn(k){function te(Ae,Se){return new RegExp(v(Ae),"m"+(k.case_insensitive?"i":"")+(k.unicodeRegex?"u":"")+(Se?"g":""))}class ye{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Se,Ue){Ue.position=this.position++,this.matchIndexes[this.matchAt]=Ue,this.regexes.push([Ue,Se]),this.matchAt+=$(Se)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Se=this.regexes.map(Ue=>Ue[1]);this.matcherRe=te(z(Se,{joinWith:"|"}),!0),this.lastIndex=0}exec(Se){this.matcherRe.lastIndex=this.lastIndex;const Ue=this.matcherRe.exec(Se);if(!Ue)return null;const Ct=Ue.findIndex((qn,sa)=>sa>0&&qn!==void 0),mt=this.matchIndexes[Ct];return Ue.splice(0,Ct),Object.assign(Ue,mt)}}class ze{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Se){if(this.multiRegexes[Se])return this.multiRegexes[Se];const Ue=new ye;return this.rules.slice(Se).forEach(([Ct,mt])=>Ue.addRule(Ct,mt)),Ue.compile(),this.multiRegexes[Se]=Ue,Ue}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Se,Ue){this.rules.push([Se,Ue]),Ue.type==="begin"&&this.count++}exec(Se){const Ue=this.getMatcher(this.regexIndex);Ue.lastIndex=this.lastIndex;let Ct=Ue.exec(Se);if(this.resumingScanAtSamePosition()&&!(Ct&&Ct.index===this.lastIndex)){const mt=this.getMatcher(0);mt.lastIndex=this.lastIndex+1,Ct=mt.exec(Se)}return Ct&&(this.regexIndex+=Ct.position+1,this.regexIndex===this.count&&this.considerAll()),Ct}}function Qe(Ae){const Se=new ze;return Ae.contains.forEach(Ue=>Se.addRule(Ue.begin,{rule:Ue,type:"begin"})),Ae.terminatorEnd&&Se.addRule(Ae.terminatorEnd,{type:"end"}),Ae.illegal&&Se.addRule(Ae.illegal,{type:"illegal"}),Se}function et(Ae,Se){const Ue=Ae;if(Ae.isCompiled)return Ue;[Ce,In,Rn,Ln].forEach(mt=>mt(Ae,Se)),k.compilerExtensions.forEach(mt=>mt(Ae,Se)),Ae.__beforeBegin=null,[St,Ke,Je].forEach(mt=>mt(Ae,Se)),Ae.isCompiled=!0;let Ct=null;return typeof Ae.keywords=="object"&&Ae.keywords.$pattern&&(Ae.keywords=Object.assign({},Ae.keywords),Ct=Ae.keywords.$pattern,delete Ae.keywords.$pattern),Ct=Ct||/\w+/,Ae.keywords&&(Ae.keywords=Rt(Ae.keywords,k.case_insensitive)),Ue.keywordPatternRe=te(Ct,!0),Se&&(Ae.begin||(Ae.begin=/\B|\b/),Ue.beginRe=te(Ue.begin),!Ae.end&&!Ae.endsWithParent&&(Ae.end=/\B|\b/),Ae.end&&(Ue.endRe=te(Ue.end)),Ue.terminatorEnd=v(Ue.end)||"",Ae.endsWithParent&&Se.terminatorEnd&&(Ue.terminatorEnd+=(Ae.end?"|":"")+Se.terminatorEnd)),Ae.illegal&&(Ue.illegalRe=te(Ae.illegal)),Ae.contains||(Ae.contains=[]),Ae.contains=[].concat(...Ae.contains.map(function(mt){return kn(mt==="self"?Ae:mt)})),Ae.contains.forEach(function(mt){et(mt,Ue)}),Ae.starts&&et(Ae.starts,Se),Ue.matcher=Qe(Ue),Ue}if(k.compilerExtensions||(k.compilerExtensions=[]),k.contains&&k.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return k.classNameAliases=s(k.classNameAliases||{}),et(k)}function Ht(k){return k?k.endsWithParent||Ht(k.starts):!1}function kn(k){return k.variants&&!k.cachedVariants&&(k.cachedVariants=k.variants.map(function(te){return s(k,{variants:null},te)})),k.cachedVariants?k.cachedVariants:Ht(k)?s(k,{starts:k.starts?s(k.starts):null}):Object.isFrozen(k)?s(k):k}var qt="11.12.0";class la extends Error{constructor(te,ye){super(te),this.name="HTMLInjectionError",this.html=ye}}const un=r,hn=s,qe=Symbol("nomatch"),pn=7,Pt=function(k){const te=Object.create(null),ye=Object.create(null),ze=[];let Qe=!0;const et="Could not find the language '{}', did you forget to load/include a language module?",Ae={disableAutodetect:!0,name:"Plain text",contains:[]};let Se={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b};function Ue(F){return Se.noHighlightRe.test(F)}function Ct(F){let ge=F.className+" ";ge+=F.parentNode?F.parentNode.className:"";const Ie=Se.languageDetectRe.exec(ge);if(Ie){const Fe=Wt(Ie[1]);return Fe||(Lt(et.replace("{}",Ie[1])),Lt("Falling back to no-highlight mode for this block.",F)),Fe?Ie[1]:"no-highlight"}return ge.split(/\s+/).find(Fe=>Ue(Fe)||Wt(Fe))}function mt(F,ge,Ie){let Fe="",dt="";typeof ge=="object"?(Fe=F,Ie=ge.ignoreIllegals,dt=ge.language):(vt("10.7.0","highlight(lang, code, ...args) has been deprecated."),vt("10.7.0",`Please use highlight(code, options) instead.
|
|
166
|
+
`);let f=2166136261;for(let h=0;h<u.length;h++)f^=u.charCodeAt(h),f=Math.imul(f,16777619);return(f>>>0).toString(16).padStart(8,"0")}const Zb={blocker:"🚨",minor:"⚠️",nit:"🎨"};function fg(i,a){return a?`${Zb[a]} **${a}** — ${i}`:i}function Xb(i,a,r){const s=`${a}/${r}`.toLowerCase();for(const[u,f]of Object.entries(i.autoReviewRepos))if(u.toLowerCase()===s)return f;return i.autoReview}const hg=["inbox","awaiting","drafted"],Cd=["requests","settled","sent","archived"],zu={inbox:{label:"inbox",title:"Everything still waiting on you — drafted reviews and PRs the poll found but nobody has read."},awaiting:{label:"awaiting",title:"Found by the inbox poll, not drafted yet — or a run is in flight right now."},drafted:{label:"drafted",title:"A draft is written and waiting for you to read it."},requests:{label:"open requests",title:"GitHub still lists you as a requested reviewer on these. You settled or archived them here without submitting a review, so they also appear under whichever tab you filed them in."},settled:{label:"settled",title:"You marked these reviewed or skipped, or handed them to somebody else. No review of yours was sent to GitHub."},sent:{label:"sent",title:"Reviews that reached GitHub. Kept here as a record."},archived:{label:"archived",title:"PRs that have since been merged or closed."}};function pg(i){return i.status==="awaiting"||i.status==="running"?"awaiting":i.status==="sent"?"sent":"drafted"}const Gs=i=>!!i.pr.state&&i.pr.state!=="OPEN";function Md(i){return i.pr.updatedAt??i.updatedAt}function Il(i){return[...i].sort((a,r)=>Md(r).localeCompare(Md(a)))}const Vb=["sent","reviewed","skipped"],tl=i=>i.own===!0;function Qb(i){return[...i.filter(a=>!tl(a)),...i.filter(tl)]}const G_=(i,a)=>tl(i[a])&&(a===0||!tl(i[a-1]));function $s(i){return Qb(Il(i.filter(a=>!Gs(a)&&!Vb.includes(a.status))))}function $_(i,a,r){return $s(i).filter(s=>s.key===a||!r.has(s.key))}function Y_(i,a){if(!(a!=null&&a.enabled)||a.awaiting.length===0)return[];const r=new Set($s(i).map(u=>u.id)),s=new Set(a.awaiting.map(u=>u.id));return Il(i.filter(u=>s.has(u.id)&&!r.has(u.id)))}const F_=(i,a)=>a.some(r=>r.id===i.id);function P_(i,a){const r=i.filter(u=>!Gs(u)),s=Qb(Il(r.filter(u=>!Vb.includes(u.status))));return{inbox:s,awaiting:s.filter(u=>pg(u)==="awaiting"),drafted:s.filter(u=>pg(u)==="drafted"),requests:Y_(i,a),settled:Il(r.filter(u=>u.status==="reviewed"||u.status==="skipped")),sent:Il(r.filter(u=>u.status==="sent")),archived:Il(i.filter(Gs))}}function K_(i,a){return Cd.includes(i)&&a[i].length===0?"inbox":i}function Wb(i){var a,r;return i.reason==="own-review"?((a=i.review)==null?void 0:a.at)??i.at:i.reason==="own-reply"?((r=i.reply)==null?void 0:r.at)??i.at:i.at}const ho={"own-review":{tag:"reviewed on GitHub",meta:i=>`you reviewed this on GitHub on ${i}`,reasoning:"GitHub stopped asking you for a review and already had one of yours, so this draft was filed rather than left in the inbox. It was never sent — open it to read or send it.",requested:"You submitted a review on GitHub, outside cerber, so this draft was filed."},"own-reply":{tag:"replied on GitHub",meta:i=>`you replied on GitHub on ${i}`,reasoning:"You answered in the PR conversation and nobody has answered back, so the draft was filed rather than left in the inbox. GitHub does not count a comment as a review, but whoever opened the PR is the one holding it. Nothing was sent — open it to read or send it.",requested:"You commented on the PR and nobody answered, so this draft was filed."},"request-withdrawn":{tag:"request withdrawn",meta:i=>`nobody was asking for this any more on ${i}`,reasoning:"Whoever asked for this review took the request back, and you had said nothing on the PR, so the draft was filed rather than left in the inbox. It is still a review — open it to read or send it.",requested:"The review request had gone away when this draft was filed."}};function Z_(i){var a;return Gs(i)?((a=i.pr.state)==null?void 0:a.toLowerCase())??null:i.handoff?`handed to @${i.handoff.to}`:i.filed?ho[i.filed.reason].tag:i.status==="reviewed"||i.status==="skipped"?i.status:null}function X_(i,a){var r;return a!=null&&a.enabled?((r=a.awaiting.find(s=>s.id===i.id))==null?void 0:r.reply)??"unknown":"unknown"}const V_={none:{label:"you haven't replied",title:"GitHub still lists you as a requested reviewer and you have said nothing on the PR — no review, no comment. Whoever opened it is waiting on you."},you:{label:"waiting on them",title:"You had the last word in the conversation but never submitted a review, so GitHub still lists you as a requested reviewer. Nothing is blocked on you until they answer."},them:{label:"they replied last",title:"You commented and someone has answered since, so the conversation is back with you — and GitHub still lists you as a requested reviewer, because a comment is not a review."},unknown:{label:"unanswered on GitHub",title:"You have never submitted a review on GitHub for this PR, so it still lists you as a requested reviewer. Cerber could not read the conversation, so it can't say whether you replied there."}},Q_=i=>V_[i];function W_(i){const a=tf[i.event]??i.event,r=new Date(i.at).toLocaleDateString();return{label:i.auto?"auto-sent a review":"you replied with a review",title:`${i.auto?"The daemon auto-sent this review":"You sent this review"} to GitHub on ${r} as ${a}. The last inbox poll still listed a review request for you — a request can lag a send, and GitHub holds some open even after one.`}}function J_(i){const a=ho[i.reason],r=new Date(Wb(i)).toLocaleDateString();return{label:a.tag,title:`${a.requested} That was ${r}. GitHub lists a review request for you now — most likely the author has asked for another look since. Re-review it to draft against the current head.`}}function e0(i){const a=new Date(i.at).toLocaleDateString();return{label:`handed to @${i.to}`,title:i.withdrewYours?`You handed this to @${i.to} on ${a} and cerber took your own review request off the PR. GitHub still lists one for you — most likely the last inbox poll ran before the swap, or somebody has asked you again since.`:`You handed this to @${i.to} on ${a}, but cerber could not take your own review request off the PR — so GitHub is asking both of you. Remove yourself on GitHub if that is not what you wanted.`}}const t0=(i,a)=>i.handoff?e0(i.handoff):i.sent?W_(i.sent):i.filed?J_(i.filed):Q_(a);function n0(i){const a=i.length,r=a===1?"1 review request":`${a} review requests`,s=i.some(Gs)?"settled or archived":"settled";return`Nothing new in the inbox — but GitHub still has ${r} open on you. You ${s} ${a===1?"it":"them"} here without submitting a review, so ${a===1?"it is":"they are"} under open requests, tagged with whose move it is.`}function Jb(i,a=Date.now()){const r=Math.max(0,Math.round((a-new Date(i).getTime())/1e3));return r<45?"now":r<3600?`${Math.round(r/60)}m`:r<86400?`${Math.round(r/3600)}h`:`${Math.round(r/86400)}d`}const a0={approve:"approve",comment:"comment",request_changes:"changes"},tf={APPROVE:"approve",COMMENT:"comment",REQUEST_CHANGES:"request changes"};function i0(i){return i.status==="running"?{label:"reviewing…",tone:"running"}:i.status==="awaiting"?{label:"review now",tone:"awaiting"}:i.status==="failed"?{label:"run failed",tone:"failed"}:i.sent?{label:`sent · ${tf[i.sent.event]??i.sent.event}`,tone:"sent"}:i.verdict?{label:`${i.verdict.recommendation.replace("_"," ")} ${i.verdict.confidence}%`,tone:a0[i.verdict.recommendation]??"none"}:{label:"—",tone:"none"}}function l0(i){return i.status==="running"||i.status==="awaiting"||i.status==="failed"||!i.verdict&&!i.sent?"—":String(i.commentCount)}function ju(i){return i.trusted?"ran the code":i.withSource?"read the full source":"read the diff only"}function s0(i){if(i.commentCount===0)return"no comments drafted";const a=[`${i.commentCount} comment${i.commentCount===1?"":"s"} drafted`];return i.driftedCount&&a.push(`${i.driftedCount} off-diff`),i.gradedCount&&a.push(i.blockerCount?`${i.blockerCount} blocker${i.blockerCount===1?"":"s"}`:"no blockers"),a.join(", ")}function r0(i,a){const r=Object.values(a).filter(s=>s!==i).length;return r===0?"":` · ${r} repo${r===1?"":"s"} ${i?"on click":"auto"}`}function o0(i,a,r=Date.now()){var u,f;if(i.status==="running")return{reasoning:"Claude is reading the current head. This row updates itself when the run lands.",meta:[`started ${Jb(i.updatedAt,r)} ago`,ju(i)]};if(i.status==="awaiting"&&tl(i))return{reasoning:"Your own PR. Cerber never drafts these on its own — ask for a self-review when you want one. Send posts it as a comment: GitHub takes no approve or change request from a PR's author.",meta:["no run yet","press r to review now"]};if(i.status==="awaiting")return a!=null&&a.enabled&&a.pollEnabled&&!Xb({autoReview:a.autoReview,autoReviewRepos:a.autoReviewRepos??{}},i.pr.owner,i.pr.repo)?{reasoning:`Found by the inbox poll. ${a.autoReview?`Auto-review is off for ${i.pr.owner}/${i.pr.repo}`:"Auto-review is off"}, so it waits for you to ask for a draft.`,meta:["no run yet","press r to review now"]}:{reasoning:"Found by the inbox poll, not drafted yet — auto-review was off when it arrived, or it is still queued behind another run.",meta:["no run yet","press r to review now"]};if(i.status==="failed")return{reasoning:i.runError??"The review run failed before it produced a draft.",meta:["press r to try again"]};if(i.sent)return{reasoning:`Sent to GitHub as ${tf[i.sent.event]??i.sent.event} on ${new Date(i.sent.at).toLocaleDateString()}. Kept here as a record; the conversation can't continue, though a re-review can draft against the current head.`+(i.handoff?` GitHub asks @${i.handoff.to} for it now.`:""),meta:[...i.handoff?[`you handed this to @${i.handoff.to}`]:[],i.sent.auto?"auto-sent by the daemon":"sent by you",ju(i)]};const s=[ju(i)];if(i.handoff?s.unshift(`you handed this to @${i.handoff.to} on ${new Date(i.handoff.at).toLocaleDateString()}`):i.filed?s.unshift(ho[i.filed.reason].meta(new Date(Wb(i.filed)).toLocaleDateString())):i.status==="reviewed"?s.unshift("you marked this reviewed"):i.status==="skipped"&&s.unshift("you skipped this"),i.costUsd!=null&&s.push(`≈$${i.costUsd.toFixed(2)} at API rates`),s.push(s0(i)),tl(i)?s.push("your PR — sends as a comment"):a!=null&&a.enabled&&i.status==="ready"&&((u=i.verdict)==null?void 0:u.recommendation)==="approve"&&s.push(i.verdict.confidence>=a.autoSendThreshold?`auto-send candidate at ${i.verdict.confidence}%`:`below the ${a.autoSendThreshold}% auto-send bar`),i.handoff){const h=i.commentCount>0||i.verdict!=null;return{reasoning:`GitHub asks @${i.handoff.to} for this review now${i.handoff.withdrewYours?" and no longer asks you":" — and still asks you, because your own request could not be taken off"}. `+(h?"The draft was never sent: it is still yours to read or send.":"Nothing was drafted here, and nothing was sent."),meta:s}}return i.filed?{reasoning:ho[i.filed.reason].reasoning,meta:s}:{reasoning:((f=i.verdict)==null?void 0:f.reasoning)??"This review has a draft but no verdict.",meta:s}}const c0="/favicon.svg",u0="/favicon-dot.svg",d0=i=>$s(i).some(a=>!(tl(a)&&a.status==="awaiting")),f0=i=>i?u0:c0;function h0(i){const a=f0(d0(i)),r=document.querySelector("link[rel='icon']");!r||r.getAttribute("href")===a||r.setAttribute("href",a)}async function Ut(i,a){const r=await fetch(i,{...a,headers:a!=null&&a.body?{"Content-Type":"application/json"}:void 0});if(!r.ok){let s=`${(a==null?void 0:a.method)??"GET"} ${i}: ${r.status}`;try{const u=await r.json();u.error&&(s=u.error)}catch{}throw new Error(s)}return r.json()}const So=async()=>{const i=await Ut("/api/reviews");return h0(i),i},nf=()=>Ut("/api/daemon"),mg=i=>Ut(`/api/reviews/${encodeURIComponent(i)}`),p0=(i,a,r)=>Ut(`/api/reviews/${encodeURIComponent(i)}/viewed`,{method:"PUT",body:JSON.stringify({path:a,fingerprint:r})}),ro=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}`,{method:"PATCH",body:JSON.stringify(a)}),m0=(i,a,r)=>Ut(`/api/reviews/${encodeURIComponent(i)}/comments/${a}`,{method:"PATCH",body:JSON.stringify(r)}),g0=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/comments`,{method:"POST",body:JSON.stringify(a)}),b0=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/comments/${a}`,{method:"DELETE"}),y0=i=>Ut("/api/reviews",{method:"POST",body:JSON.stringify({input:i})}),v0=i=>Ut(`/api/reviews/${encodeURIComponent(i)}/refresh`,{method:"POST"}),ey=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/rerun`+(a===void 0?"":`?source=${a?"1":"0"}`),{method:"POST"}),Dd=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/chat`,{method:"POST",body:JSON.stringify(a)}),E0=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/chat/steer`,{method:"POST",body:JSON.stringify({message:a})}),_0=i=>Ut(`/api/reviews/${encodeURIComponent(i)}/chat/pending`,{method:"DELETE"}),S0=i=>Ut(`/api/reviews/${encodeURIComponent(i)}/chat/reset`,{method:"POST",body:JSON.stringify({})}),ty=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/send-preview?event=${a}`),w0=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/send`,{method:"POST",body:JSON.stringify({event:a,confirm:!0})}),N0=i=>Ut(`/api/reviews/${encodeURIComponent(i)}/raised`,{method:"POST"}),x0=i=>Ut(`/api/reviews/${encodeURIComponent(i)}/reviewers`),T0=(i,a)=>Ut(`/api/reviews/${encodeURIComponent(i)}/handoff`,{method:"POST",body:JSON.stringify({...a,confirm:!0})}),A0=i=>`/api/reviews/${encodeURIComponent(i)}/export`,R0=()=>Ut("/api/config"),Uu=(i,a=!1)=>Ut("/api/config/trust",{method:"POST",body:JSON.stringify({rule:i,remove:a})}),k0=(i,a)=>Ut("/api/config/auto-review-repo",{method:"POST",body:JSON.stringify({repo:i,on:a})}),no=i=>Ut("/api/config/daemon",{method:"POST",body:JSON.stringify(i)}),ny="cerber.handoff.recent",ay=5,O0=/^[A-Za-z0-9](?:[A-Za-z0-9_-]{0,37}[A-Za-z0-9])?$/,iy=i=>O0.test(i);function C0(i){try{const a=JSON.parse(i??"");return Array.isArray(a)?a.filter(r=>typeof r=="string"&&iy(r)).slice(0,ay):[]}catch{return[]}}function ly(){try{return C0(localStorage.getItem(ny))}catch{return[]}}function M0(i,a){const r=i.filter(s=>s.toLowerCase()!==a.toLowerCase());return[a,...r].slice(0,ay)}function D0(i){const a=M0(ly(),i);try{localStorage.setItem(ny,JSON.stringify(a))}catch{}return a}const Ld=i=>i.trim().replace(/^@/,"");function L0(i,a){const r=new Set,s=[];for(const u of[...a,...i]){const f=u.toLowerCase();r.has(f)||(r.add(f),s.push({login:u,recent:a.some(h=>h.toLowerCase()===f)}))}return s}function z0(i,a){const r=Ld(a).toLowerCase();if(!r)return i;const s=i.filter(h=>h.login.toLowerCase().includes(r)),u=h=>h.login.toLowerCase()===r,f=h=>h.login.toLowerCase().startsWith(r);return[...s.filter(u),...s.filter(h=>!u(h)&&f(h)),...s.filter(h=>!f(h))]}function Bu(i){return i.replace(/&/gm,"&").replace(/</gm,"<").replace(/>/gm,">")}function zd(i){return i.nodeName.toLowerCase()}function gg(i){const a=[],r=(s,u)=>{for(let f=s.firstChild;f;f=f.nextSibling)f.nodeType===3&&f.nodeValue!==null?u+=f.nodeValue.length:f.nodeType===1&&(a.push({event:"start",offset:u,node:f}),u=r(f,u),zd(f).match(/br|hr|img|input/)||a.push({event:"stop",offset:u,node:f}));return u};return r(i,0),a}function j0(i,a,r){let s=0,u="";const f=[];function h(v){return v!==null&&(v==null?void 0:v.attributes)!==void 0}function y(){return!i.length||!a.length?i.length?i:a:i[0].offset!==a[0].offset?i[0].offset<a[0].offset?i:a:a[0].event==="start"?i:a}function g(v){if(!h(v))throw new Error("Node is not an Element");u+=`<${zd(v)} ${Array().map.call(v.attributes,_=>`${_.nodeName}="${Bu(_.value).replace(/"/g,""")}"`).join(" ")}>`}function m(v){u+="</"+zd(v)+">"}function b(v){(v.event==="start"?g:m)(v.node)}for(;i.length||a.length;){let v=y();if(u+=Bu(r.substring(s,v[0].offset)),s=v[0].offset,v===i){f.reverse().forEach(m);do b(v.splice(0,1)[0]),v=y();while(v===i&&v.length&&v[0].offset===s);f.reverse().forEach(g)}else v[0].event==="start"?f.push(v[0].node):f.pop(),b(v.splice(0,1)[0])}return u+Bu(r.substr(s))}const U0={"1c":"1c",abnf:"abnf",accesslog:"accesslog",as:"actionscript",adb:"ada",ada:"ada",ads:"ada",angelscript:"angelscript",apache:"apache",applescript:"applescript",scpt:"applescript",arcade:"arcade",cpp:"cpp",hpp:"cpp",arduino:"arduino",ino:"arduino",armasm:"armasm",arm:"armasm",xml:"xml",html:"xml",xhtml:"xml",rss:"xml",atom:"xml",xjb:"xml",xsd:"xml",xsl:"xml",plist:"xml",svg:"xml",asciidoc:"asciidoc",adoc:"asciidoc",asc:"asciidoc",aspectj:"aspectj",ahk:"autohotkey",ahkl:"autohotkey",au3:"autoit",avrasm:"avrasm",awk:"awk",axapta:"axapta","x++":"axapta",bash:"bash",sh:"bash",zsh:"bash",b:"basic",bnf:"bnf",bf:"brainfuck",c:"c",h:"c",cats:"c",idc:"c",cal:"cal",capnproto:"capnproto",capnp:"capnproto",ceylon:"ceylon",clean:"clean",clj:"clojure",boot:"clojure",cl2:"clojure",cljc:"clojure",cljs:"clojure","cljs.hl":"clojure",cljscm:"clojure",cljx:"clojure",hic:"clojure","clojure-repl":"clojure-repl",cmake:"cmake","cmake.in":"cmake",coffee:"coffeescript",_coffee:"coffeescript",cake:"coffeescript",cjsx:"coffeescript",iced:"coffeescript",cson:"coffeescript",coq:"coq",cos:"cos",cls:"cos",crmsh:"crmsh",crm:"crmsh",pcmk:"crmsh",cr:"crystal",cs:"csharp",csx:"csharp",csp:"csp",css:"css",d:"d",di:"d",md:"markdown",markdown:"markdown",mdown:"markdown",mdwn:"markdown",mkd:"markdown",mkdn:"markdown",mkdown:"markdown",ronn:"markdown",workbook:"markdown",dart:"dart",dpr:"delphi",dfm:"delphi",pas:"delphi",pascal:"delphi",diff:"diff",patch:"diff",django:"django",jinja:"django",dns:"dns",zone:"dns",bind:"dns",dockerfile:"dockerfile",docker:"dockerfile",dos:"dos",bat:"dos",cmd:"dos",dsconfig:"dsconfig",dts:"dts",dust:"dust",dst:"dust",ebnf:"ebnf",ex:"elixir",exs:"elixir",elm:"elm",rb:"ruby",builder:"ruby",eye:"ruby",gemspec:"ruby",god:"ruby",jbuilder:"ruby",mspec:"ruby",pluginspec:"ruby",podspec:"ruby",rabl:"ruby",rake:"ruby",rbuild:"ruby",rbw:"ruby",rbx:"ruby",ru:"ruby",ruby:"ruby",spec:"ruby",thor:"ruby",watchr:"ruby",erb:"erb","erlang-repl":"erlang-repl",erl:"erlang","app.src":"erlang",escript:"erlang",hrl:"erlang",xrl:"erlang",yrl:"erlang",excel:"excel",xls:"excel",xlsx:"excel",fix:"fix",flix:"flix",f90:"fortran",f:"fortran",f03:"fortran",f08:"fortran",f77:"fortran",f95:"fortran",for:"fortran",fpp:"fortran",fs:"fsharp",fsx:"fsharp",gams:"gams",gms:"gams",gauss:"gauss",gss:"gauss",gcode:"gcode",nc:"gcode",gherkin:"gherkin",glsl:"glsl",fp:"glsl",frag:"glsl",frg:"glsl",fsh:"glsl",fshader:"glsl",geo:"glsl",geom:"glsl",glslv:"glsl",gshader:"glsl",shader:"glsl",tesc:"glsl",tese:"glsl",vert:"glsl",vrx:"glsl",vsh:"glsl",vshader:"glsl",gml:"gml",go:"go",bal:"go",golo:"golo",gololang:"golo",gradle:"gradle",groovy:"groovy",grt:"groovy",gtpl:"groovy",gvy:"groovy",haml:"haml","haml.deface":"haml",handlebars:"handlebars",hbs:"handlebars","html.hbs":"handlebars","html.handlebars":"handlebars",hs:"haskell",hsc:"haskell",idr:"haskell",purs:"haskell",hx:"haxe",hxsl:"haxe",hsp:"hsp",htmlbars:"htmlbars",http:"http",https:"http",hy:"hy",inform7:"inform7",i7:"inform7",ini:"ini",toml:"ini",cfg:"ini",prefs:"ini",irpf90:"irpf90",isbl:"isbl",java:"java",jsp:"java",js:"javascript",jsx:"javascript",_js:"javascript",bones:"javascript",es:"javascript",es6:"javascript",gs:"javascript",jake:"javascript",jsb:"javascript",jscad:"javascript",jsfl:"javascript",jsm:"javascript",jss:"javascript",mjs:"javascript",njs:"javascript",pac:"javascript",sjs:"javascript",ssjs:"javascript",xsjs:"javascript",xsjslib:"javascript",cfc:"javascript","jboss-cli":"jboss-cli",json:"json",avsc:"json",geojson:"json",gltf:"json","JSON-tmLanguage":"json",jsonl:"json",tfstate:"json","tfstate.backup":"json",topojson:"json",webapp:"json",webmanifest:"json",jl:"julia","julia-repl":"julia-repl",kt:"kotlin",ktm:"kotlin",kts:"kotlin",lasso:"lasso",lassoscript:"lasso",tex:"latex",ldif:"ldif",leaf:"leaf",less:"less",lisp:"lisp",factor:"lisp",livecodeserver:"livecodeserver",ls:"livescript",_ls:"livescript",llvm:"llvm",lsl:"lsl",lua:"lua",nse:"lua",p8:"lua",pd_lua:"lua",rbxs:"lua",wlua:"lua",mak:"makefile",make:"makefile",mk:"makefile",mkfile:"makefile",mathematica:"mathematica",mma:"mathematica",wl:"mathematica",matlab:"matlab",maxima:"maxima",mel:"mel",mercury:"mercury",mipsasm:"mipsasm",miz:"mizar",voc:"mizar",al:"perl",cgi:"perl",fcgi:"perl",perl:"perl",ph:"perl",plx:"perl",pl:"perl",pm:"perl",psgi:"perl",t:"perl",mojolicious:"mojolicious",monkey:"monkey",monkey2:"monkey",moonscript:"moonscript",moon:"moonscript",n1ql:"n1ql",nginxconf:"nginx",nim:"nim",nimrod:"nim",nix:"nix",nsi:"nsis",nsh:"nsis",m:"objectivec",objc:"objectivec",mm:"objectivec","obj-c":"objectivec","obj-c++":"objectivec","objective-c++":"objectivec",fun:"ocaml",sig:"ocaml",ml:"ocaml",mli:"ocaml",eliom:"ocaml",eliomi:"ocaml",ml4:"ocaml",mll:"ocaml",mly:"ocaml",openscad:"openscad",oxygene:"oxygene",parser3:"parser3",pf:"pf","pf.conf":"pf",pgsql:"pgsql",postgres:"pgsql",postgresql:"pgsql",php:"php",aw:"php",ctp:"php",inc:"php",php3:"php",php4:"php",php5:"php",phps:"php",phpt:"php","php-template":"php-template",plaintext:"plaintext",txt:"plaintext",text:"plaintext",pony:"pony",ps:"powershell",ps1:"powershell",psd1:"powershell",psm1:"powershell",pde:"processing",profile:"profile",pro:"prolog",prolog:"prolog",yap:"prolog",properties:"properties",proto:"protobuf",puppet:"puppet",pp:"puppet",purebasic:"purebasic",py:"python",bzl:"python",gyp:"python",gypi:"python",lmi:"python",py3:"python",pyde:"python",pyi:"python",pyp:"python",pyt:"python",pyw:"python",rpy:"python",tac:"python",wsgi:"python",xpy:"python","python-repl":"python-repl",pycon:"python-repl",q:"q",k:"q",kdb:"q",qml:"qml",r:"r",rd:"r",rsx:"r",reasonml:"reasonml",re:"reasonml",rib:"rib",roboconf:"roboconf",graph:"roboconf",instances:"roboconf",routeros:"routeros",rsl:"rsl",ruleslanguage:"ruleslanguage",rs:"rust","rs.in":"rust",sas:"sas",scala:"scala",kojo:"scala",sbt:"scala",sc:"scala",scm:"scheme",sch:"scheme",sld:"scheme",sls:"scheme",sps:"scheme",ss:"scheme",rkt:"scheme",scilab:"scilab",scss:"scss",shell:"shell",smali:"smali",st:"smalltalk",sml:"sml",sqf:"sqf",sql:"sql",cql:"sql",ddl:"sql",mysql:"sql",prc:"sql",tab:"sql",udf:"sql",viw:"sql",stan:"stan",stanfuncs:"stan",stata:"stata",step21:"step21",step:"step21",stp:"step21",styl:"stylus",subunit:"subunit",swift:"swift",taggerscript:"taggerscript",yml:"yaml",mir:"yaml",reek:"yaml",rviz:"yaml","sublime-syntax":"yaml",syntax:"yaml",yaml:"yaml","yaml-tmlanguage":"yaml","yml.mysql":"yaml",tap:"tap",tcl:"tcl",adp:"tcl",tm:"tcl",thrift:"thrift",tp:"tp",twig:"twig",craftcms:"twig",ts:"typescript",tsx:"typescript",vala:"vala",vbnet:"vbnet",vb:"vbnet",vbscript:"vbscript",vbs:"vbscript","vbscript-html":"vbscript-html",v:"verilog",veo:"verilog",vhdl:"vhdl",vhd:"vhdl",vhf:"vhdl",vhi:"vhdl",vho:"vhdl",vhs:"vhdl",vht:"vhdl",vhw:"vhdl",vim:"vim",x86asm:"x86asm",xl:"xl",xquery:"xquery",xpath:"xquery",xq:"xquery",zephir:"zephir",zep:"zephir"};function B0(i){var a;return(a=U0[i])!==null&&a!==void 0?a:"plaintext"}var Iu,bg;function I0(){if(bg)return Iu;bg=1;function i(k){return k instanceof Map?k.clear=k.delete=k.set=function(){throw new Error("map is read-only")}:k instanceof Set&&(k.add=k.clear=k.delete=function(){throw new Error("set is read-only")}),Object.freeze(k),Object.getOwnPropertyNames(k).forEach(te=>{const ye=k[te],ze=typeof ye;(ze==="object"||ze==="function")&&!Object.isFrozen(ye)&&i(ye)}),k}class a{constructor(te){te.data===void 0&&(te.data={}),this.data=te.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(k){return k.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function s(k,...te){const ye=Object.create(null);for(const ze in k)ye[ze]=k[ze];return te.forEach(function(ze){for(const Qe in ze)ye[Qe]=ze[Qe]}),ye}const u="</span>",f=k=>!!k.scope,h=(k,{prefix:te})=>{if(k.startsWith("language:"))return k.replace("language:","language-");if(k.includes(".")){const ye=k.split(".");return[`${te}${ye.shift()}`,...ye.map((ze,Qe)=>`${ze}${"_".repeat(Qe+1)}`)].join(" ")}return`${te}${k}`};class y{constructor(te,ye){this.buffer="",this.classPrefix=ye.classPrefix,te.walk(this)}addText(te){this.buffer+=r(te)}openNode(te){if(!f(te))return;const ye=h(te.scope,{prefix:this.classPrefix});this.span(ye)}closeNode(te){f(te)&&(this.buffer+=u)}value(){return this.buffer}span(te){this.buffer+=`<span class="${te}">`}}const g=(k={})=>{const te={children:[]};return Object.assign(te,k),te};class m{constructor(){this.rootNode=g(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(te){this.top.children.push(te)}openNode(te){const ye=g({scope:te});this.add(ye),this.stack.push(ye)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(te){return this.constructor._walk(te,this.rootNode)}static _walk(te,ye){return typeof ye=="string"?te.addText(ye):ye.children&&(te.openNode(ye),ye.children.forEach(ze=>this._walk(te,ze)),te.closeNode(ye)),te}static _collapse(te){typeof te!="string"&&te.children&&(te.children.every(ye=>typeof ye=="string")?te.children=[te.children.join("")]:te.children.forEach(ye=>{m._collapse(ye)}))}}class b extends m{constructor(te){super(),this.options=te}addText(te){te!==""&&this.add(te)}startScope(te){this.openNode(te)}endScope(){this.closeNode()}__addSublanguage(te,ye){const ze=te.root;ye&&(ze.scope=`language:${ye}`),this.add(ze)}toHTML(){return new y(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function v(k){return k?typeof k=="string"?k:k.source:null}function _(k){return C("(?=",k,")")}function T(k){return C("(?:",k,")*")}function S(k){return C("(?:",k,")?")}function C(...k){return k.map(ye=>v(ye)).join("")}function A(k){const te=k[k.length-1];return typeof te=="object"&&te.constructor===Object?(k.splice(k.length-1,1),te):{}}function R(...k){return"("+(A(k).capture?"":"?:")+k.map(ze=>v(ze)).join("|")+")"}function $(k){return new RegExp(k.toString()+"|").exec("").length-1}function U(k,te){const ye=k&&k.exec(te);return ye&&ye.index===0}const W=new RegExp(R(/\[(?:[^\\\]]|\\.)*\]/,/\(\?<(?![=!])[^>]+>/,/\(\?'[^']+'/,/\(\??/,/\\([1-9][0-9]*)/,/\\./));function z(k,{joinWith:te}){let ye=0;return k.map(ze=>{ye+=1;const Qe=ye;let et=v(ze),Ae="";for(;et.length>0;){const Se=W.exec(et);if(!Se){Ae+=et;break}Ae+=et.substring(0,Se.index),et=et.substring(Se.index+Se[0].length),Se[0][0]==="\\"&&Se[1]?Ae+="\\"+String(Number(Se[1])+Qe):(Ae+=Se[0],(Se[0]==="("||/^\(\?[<']/.test(Se[0]))&&ye++)}return Ae}).map(ze=>`(${ze})`).join(te)}const ae=/\b\B/,se="[a-zA-Z]\\w*",x="[a-zA-Z_]\\w*",G="\\b\\d+(\\.\\d+)?",ee="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ue="\\b(0b[01]+)",Ee="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",j=(k={})=>{const te=/^#![ ]*\//;return k.binary&&(k.begin=C(te,/.*\b/,k.binary,/\b.*/)),s({scope:"meta",begin:te,end:/$/,relevance:0,"on:begin":(ye,ze)=>{ye.index!==0&&ze.ignoreMatch()}},k)},le={begin:"\\\\[\\s\\S]",relevance:0},fe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[le]},M={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[le]},Q={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},pe=function(k,te,ye={}){const ze=s({scope:"comment",begin:k,end:te,contains:[]},ye);ze.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Qe=R("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return ze.contains.push({begin:C(/[ ]+/,"(",Qe,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),ze},we=pe("//","$"),De=pe("/\\*","\\*/"),w=pe("#","$"),L={scope:"number",begin:G,relevance:0},I={scope:"number",begin:ee,relevance:0},oe={scope:"number",begin:ue,relevance:0},me={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[le,{begin:/\[/,end:/\]/,relevance:0,contains:[le]}]},ve={scope:"title",begin:se,relevance:0},X={scope:"title",begin:x,relevance:0},be={begin:"\\.\\s*"+x,relevance:0};var Ge=Object.freeze({__proto__:null,APOS_STRING_MODE:fe,BACKSLASH_ESCAPE:le,BINARY_NUMBER_MODE:oe,BINARY_NUMBER_RE:ue,COMMENT:pe,C_BLOCK_COMMENT_MODE:De,C_LINE_COMMENT_MODE:we,C_NUMBER_MODE:I,C_NUMBER_RE:ee,END_SAME_AS_BEGIN:function(k){return Object.assign(k,{"on:begin":(te,ye)=>{ye.data._beginMatch=te[1]},"on:end":(te,ye)=>{ye.data._beginMatch!==te[1]&&ye.ignoreMatch()}})},HASH_COMMENT_MODE:w,IDENT_RE:se,MATCH_NOTHING_RE:ae,METHOD_GUARD:be,NUMBER_MODE:L,NUMBER_RE:G,PHRASAL_WORDS_MODE:Q,QUOTE_STRING_MODE:M,REGEXP_MODE:me,RE_STARTERS_RE:Ee,SHEBANG:j,TITLE_MODE:ve,UNDERSCORE_IDENT_RE:x,UNDERSCORE_TITLE_MODE:X});function $e(k,te){k.input[k.index-1]==="."&&te.ignoreMatch()}function Ce(k,te){k.className!==void 0&&(k.scope=k.className,delete k.className)}function St(k,te){te&&k.beginKeywords&&(k.begin="\\b("+k.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",k.__beforeBegin=$e,k.keywords=k.keywords||k.beginKeywords,delete k.beginKeywords,k.relevance===void 0&&(k.relevance=0))}function Ke(k,te){Array.isArray(k.illegal)&&(k.illegal=R(...k.illegal))}function In(k,te){if(k.match){if(k.begin||k.end)throw new Error("begin & end are not supported with match");k.begin=k.match,delete k.match}}function Je(k,te){k.relevance===void 0&&(k.relevance=1)}const Ln=(k,te)=>{if(!k.beforeMatch)return;if(k.starts)throw new Error("beforeMatch cannot be used with starts");const ye=Object.assign({},k);Object.keys(k).forEach(ze=>{delete k[ze]}),k.keywords=ye.keywords,k.begin=C(ye.beforeMatch,_(ye.begin)),k.starts={relevance:0,contains:[Object.assign(ye,{endsParent:!0})]},k.relevance=0,delete ye.beforeMatch},Hn=["of","and","for","in","not","or","if","then","parent","list","value"],It="keyword";function Rt(k,te,ye=It){const ze=Object.create(null);return typeof k=="string"?Qe(ye,k.split(" ")):Array.isArray(k)?Qe(ye,k):Object.keys(k).forEach(function(et){Object.assign(ze,Rt(k[et],te,et))}),ze;function Qe(et,Ae){te&&(Ae=Ae.map(Se=>Se.toLowerCase())),Ae.forEach(function(Se){const Ue=Se.split("|");ze[Ue[0]]=[et,on(Ue[0],Ue[1])]})}}function on(k,te){return te?Number(te):yn(k)?0:1}function yn(k){return Hn.includes(k.toLowerCase())}const Ft={},je=k=>{console.error(k)},Lt=(k,...te)=>{console.log(`WARN: ${k}`,...te)},vt=(k,te)=>{Ft[`${k}/${te}`]||(console.log(`Deprecated as of ${k}. ${te}`),Ft[`${k}/${te}`]=!0)},Ot=new Error;function Tn(k,te,{key:ye}){let ze=0;const Qe=k[ye],et={},Ae={};for(let Se=1;Se<=te.length;Se++)Ae[Se+ze]=Qe[Se],et[Se+ze]=!0,ze+=$(te[Se-1]);k[ye]=Ae,k[ye]._emit=et,k[ye]._multi=!0}function zn(k){if(Array.isArray(k.begin)){if(k.skip||k.excludeBegin||k.returnBegin)throw je("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),Ot;if(typeof k.beginScope!="object"||k.beginScope===null)throw je("beginScope must be object"),Ot;Tn(k,k.begin,{key:"beginScope"}),k.begin=z(k.begin,{joinWith:""})}}function An(k){if(Array.isArray(k.end)){if(k.skip||k.excludeEnd||k.returnEnd)throw je("skip, excludeEnd, returnEnd not compatible with endScope: {}"),Ot;if(typeof k.endScope!="object"||k.endScope===null)throw je("endScope must be object"),Ot;Tn(k,k.end,{key:"endScope"}),k.end=z(k.end,{joinWith:""})}}function jn(k){k.scope&&typeof k.scope=="object"&&k.scope!==null&&(k.beginScope=k.scope,delete k.scope)}function Rn(k){jn(k),typeof k.beginScope=="string"&&(k.beginScope={_wrap:k.beginScope}),typeof k.endScope=="string"&&(k.endScope={_wrap:k.endScope}),zn(k),An(k)}function cn(k){function te(Ae,Se){return new RegExp(v(Ae),"m"+(k.case_insensitive?"i":"")+(k.unicodeRegex?"u":"")+(Se?"g":""))}class ye{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Se,Ue){Ue.position=this.position++,this.matchIndexes[this.matchAt]=Ue,this.regexes.push([Ue,Se]),this.matchAt+=$(Se)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Se=this.regexes.map(Ue=>Ue[1]);this.matcherRe=te(z(Se,{joinWith:"|"}),!0),this.lastIndex=0}exec(Se){this.matcherRe.lastIndex=this.lastIndex;const Ue=this.matcherRe.exec(Se);if(!Ue)return null;const Ct=Ue.findIndex((qn,sa)=>sa>0&&qn!==void 0),mt=this.matchIndexes[Ct];return Ue.splice(0,Ct),Object.assign(Ue,mt)}}class ze{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Se){if(this.multiRegexes[Se])return this.multiRegexes[Se];const Ue=new ye;return this.rules.slice(Se).forEach(([Ct,mt])=>Ue.addRule(Ct,mt)),Ue.compile(),this.multiRegexes[Se]=Ue,Ue}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Se,Ue){this.rules.push([Se,Ue]),Ue.type==="begin"&&this.count++}exec(Se){const Ue=this.getMatcher(this.regexIndex);Ue.lastIndex=this.lastIndex;let Ct=Ue.exec(Se);if(this.resumingScanAtSamePosition()&&!(Ct&&Ct.index===this.lastIndex)){const mt=this.getMatcher(0);mt.lastIndex=this.lastIndex+1,Ct=mt.exec(Se)}return Ct&&(this.regexIndex+=Ct.position+1,this.regexIndex===this.count&&this.considerAll()),Ct}}function Qe(Ae){const Se=new ze;return Ae.contains.forEach(Ue=>Se.addRule(Ue.begin,{rule:Ue,type:"begin"})),Ae.terminatorEnd&&Se.addRule(Ae.terminatorEnd,{type:"end"}),Ae.illegal&&Se.addRule(Ae.illegal,{type:"illegal"}),Se}function et(Ae,Se){const Ue=Ae;if(Ae.isCompiled)return Ue;[Ce,In,Rn,Ln].forEach(mt=>mt(Ae,Se)),k.compilerExtensions.forEach(mt=>mt(Ae,Se)),Ae.__beforeBegin=null,[St,Ke,Je].forEach(mt=>mt(Ae,Se)),Ae.isCompiled=!0;let Ct=null;return typeof Ae.keywords=="object"&&Ae.keywords.$pattern&&(Ae.keywords=Object.assign({},Ae.keywords),Ct=Ae.keywords.$pattern,delete Ae.keywords.$pattern),Ct=Ct||/\w+/,Ae.keywords&&(Ae.keywords=Rt(Ae.keywords,k.case_insensitive)),Ue.keywordPatternRe=te(Ct,!0),Se&&(Ae.begin||(Ae.begin=/\B|\b/),Ue.beginRe=te(Ue.begin),!Ae.end&&!Ae.endsWithParent&&(Ae.end=/\B|\b/),Ae.end&&(Ue.endRe=te(Ue.end)),Ue.terminatorEnd=v(Ue.end)||"",Ae.endsWithParent&&Se.terminatorEnd&&(Ue.terminatorEnd+=(Ae.end?"|":"")+Se.terminatorEnd)),Ae.illegal&&(Ue.illegalRe=te(Ae.illegal)),Ae.contains||(Ae.contains=[]),Ae.contains=[].concat(...Ae.contains.map(function(mt){return kn(mt==="self"?Ae:mt)})),Ae.contains.forEach(function(mt){et(mt,Ue)}),Ae.starts&&et(Ae.starts,Se),Ue.matcher=Qe(Ue),Ue}if(k.compilerExtensions||(k.compilerExtensions=[]),k.contains&&k.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return k.classNameAliases=s(k.classNameAliases||{}),et(k)}function Ht(k){return k?k.endsWithParent||Ht(k.starts):!1}function kn(k){return k.variants&&!k.cachedVariants&&(k.cachedVariants=k.variants.map(function(te){return s(k,{variants:null},te)})),k.cachedVariants?k.cachedVariants:Ht(k)?s(k,{starts:k.starts?s(k.starts):null}):Object.isFrozen(k)?s(k):k}var qt="11.12.0";class la extends Error{constructor(te,ye){super(te),this.name="HTMLInjectionError",this.html=ye}}const un=r,hn=s,qe=Symbol("nomatch"),pn=7,Pt=function(k){const te=Object.create(null),ye=Object.create(null),ze=[];let Qe=!0;const et="Could not find the language '{}', did you forget to load/include a language module?",Ae={disableAutodetect:!0,name:"Plain text",contains:[]};let Se={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b};function Ue(F){return Se.noHighlightRe.test(F)}function Ct(F){let ge=F.className+" ";ge+=F.parentNode?F.parentNode.className:"";const Ie=Se.languageDetectRe.exec(ge);if(Ie){const Fe=Wt(Ie[1]);return Fe||(Lt(et.replace("{}",Ie[1])),Lt("Falling back to no-highlight mode for this block.",F)),Fe?Ie[1]:"no-highlight"}return ge.split(/\s+/).find(Fe=>Ue(Fe)||Wt(Fe))}function mt(F,ge,Ie){let Fe="",dt="";typeof ge=="object"?(Fe=F,Ie=ge.ignoreIllegals,dt=ge.language):(vt("10.7.0","highlight(lang, code, ...args) has been deprecated."),vt("10.7.0",`Please use highlight(code, options) instead.
|
|
167
167
|
https://github.com/highlightjs/highlight.js/issues/2277`),dt=F,Fe=ge),Ie===void 0&&(Ie=!0);const gt={code:Fe,language:dt};de("before:highlight",gt);const Bt=gt.result?gt.result:qn(gt.language,gt.code,Ie);return Bt.code=gt.code,de("after:highlight",Bt),Bt}function qn(F,ge,Ie,Fe){const dt=Object.create(null);function gt(he,_e){return he.keywords[_e]}function Bt(){if(!J.keywords){B.addText(ne);return}let he=0;J.keywordPatternRe.lastIndex=0;let _e=J.keywordPatternRe.exec(ne),Me="";for(;_e;){Me+=ne.substring(he,_e.index);const Ve=Jt.case_insensitive?_e[0].toLowerCase():_e[0],We=gt(J,Ve);if(We){const[oa,Yl]=We;if(B.addText(Me),Me="",dt[Ve]=(dt[Ve]||0)+1,dt[Ve]<=pn&&(Te+=Yl),oa.startsWith("_"))Me+=_e[0];else{const Ks=Jt.classNameAliases[oa]||oa;zt(_e[0],Ks)}}else Me+=_e[0];he=J.keywordPatternRe.lastIndex,_e=J.keywordPatternRe.exec(ne)}Me+=ne.substring(he),B.addText(Me)}function Zt(){if(ne==="")return;let he=null;if(typeof J.subLanguage=="string"){if(!te[J.subLanguage]){B.addText(ne);return}he=qn(J.subLanguage,ne,!0,N[J.subLanguage]),N[J.subLanguage]=he._top}else he=Na(ne,J.subLanguage.length?J.subLanguage:null);J.relevance>0&&(Te+=he.relevance),B.__addSublanguage(he._emitter,he.language)}function ft(){J.subLanguage!=null?Zt():Bt(),ne=""}function zt(he,_e){he!==""&&(B.startScope(_e),B.addText(he),B.endScope())}function il(he,_e){let Me=1;const Ve=_e.length-1;for(;Me<=Ve;){if(!he._emit[Me]){Me++;continue}const We=Jt.classNameAliases[he[Me]]||he[Me],oa=_e[Me];We?zt(oa,We):(ne=oa,Bt(),ne=""),Me++}}function li(he,_e){return he.scope&&typeof he.scope=="string"&&B.openNode(Jt.classNameAliases[he.scope]||he.scope),he.beginScope&&(he.beginScope._wrap?(zt(ne,Jt.classNameAliases[he.beginScope._wrap]||he.beginScope._wrap),ne=""):he.beginScope._multi&&(il(he.beginScope,_e),ne="")),J=Object.create(he,{parent:{value:J}}),J}function si(he,_e,Me){let Ve=U(he.endRe,Me);if(Ve){if(he["on:end"]){const We=new a(he);he["on:end"](_e,We),We.isMatchIgnored&&(Ve=!1)}if(Ve){for(;he.endsParent&&he.parent;)he=he.parent;return he}}if(he.endsWithParent)return si(he.parent,_e,Me)}function Ba(he){return J.matcher.regexIndex===0?(ne+=he[0],1):(nt=!0,0)}function ll(he){const _e=he[0],Me=he.rule,Ve=new a(Me),We=[Me.__beforeBegin,Me["on:begin"]];for(const oa of We)if(oa&&(oa(he,Ve),Ve.isMatchIgnored))return Ba(_e);return Me.skip?ne+=_e:(Me.excludeBegin&&(ne+=_e),ft(),!Me.returnBegin&&!Me.excludeBegin&&(ne=_e)),li(Me,he),Me.returnBegin?0:_e.length}function On(he){const _e=he[0],Me=ge.substring(he.index),Ve=si(J,he,Me);if(!Ve)return qe;const We=J;J.endScope&&J.endScope._wrap?(ft(),zt(_e,J.endScope._wrap)):J.endScope&&J.endScope._multi?(ft(),il(J.endScope,he)):We.skip?ne+=_e:(We.returnEnd||We.excludeEnd||(ne+=_e),ft(),We.excludeEnd&&(ne=_e));do J.scope&&B.closeNode(),!J.skip&&!J.subLanguage&&(Te+=J.relevance),J=J.parent;while(J!==Ve.parent);return Ve.starts&&li(Ve.starts,he),We.returnEnd?0:_e.length}function ri(){const he=[];for(let _e=J;_e!==Jt;_e=_e.parent)_e.scope&&he.unshift(_e.scope);he.forEach(_e=>B.openNode(_e))}let Ia={};function oi(he,_e){const Me=_e&&_e[0];if(ne+=he,Me==null)return ft(),0;if(Ia.type==="begin"&&_e.type==="end"&&Ia.index===_e.index&&Me===""){if(ne+=ge.slice(_e.index,_e.index+1),!Qe){const Ve=new Error(`0 width match regex (${F})`);throw Ve.languageName=F,Ve.badRule=Ia.rule,Ve}return 1}if(Ia=_e,_e.type==="begin")return ll(_e);if(_e.type==="illegal"&&!Ie){const Ve=new Error('Illegal lexeme "'+Me+'" for mode "'+(J.scope||"<unnamed>")+'"');throw Ve.mode=J,Ve}else if(_e.type==="end"){const Ve=On(_e);if(Ve!==qe)return Ve}if(_e.type==="illegal"&&Me==="")return _e.index===ge.length||(ne+=`
|
|
168
168
|
`),1;if(He>1e5&&He>_e.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ne+=Me,Me.length}const Jt=Wt(F);if(!Jt)throw je(et.replace("{}",F)),new Error('Unknown language: "'+F+'"');const Ha=cn(Jt);let Aa="",J=Fe||Ha;const N={},B=new Se.__emitter(Se);ri();let ne="",Te=0,ke=0,He=0,nt=!1;try{if(Jt.__emitTokens)Jt.__emitTokens(ge,B);else{for(J.matcher.considerAll();;){He++,nt?nt=!1:J.matcher.considerAll(),J.matcher.lastIndex=ke;const he=J.matcher.exec(ge);if(!he)break;const _e=ge.substring(ke,he.index),Me=oi(_e,he);ke=he.index+Me}oi(ge.substring(ke))}return B.finalize(),Aa=B.toHTML(),{language:F,value:Aa,relevance:Te,illegal:!1,_emitter:B,_top:J}}catch(he){if(he.message&&he.message.includes("Illegal"))return{language:F,value:un(ge),illegal:!0,relevance:0,_illegalBy:{message:he.message,index:ke,context:ge.slice(ke-100,ke+100),mode:he.mode,resultSoFar:Aa},_emitter:B};if(Qe)return{language:F,value:un(ge),illegal:!1,relevance:0,errorRaised:he,_emitter:B,_top:J};throw he}}function sa(F){const ge={value:un(F),illegal:!1,relevance:0,_top:Ae,_emitter:new Se.__emitter(Se)};return ge._emitter.addText(F),ge}function Na(F,ge){ge=ge||Se.languages||Object.keys(te);const Ie=sa(F),Fe=ge.filter(Wt).filter(Xn).map(ft=>qn(ft,F,!1));Fe.unshift(Ie);const dt=Fe.sort((ft,zt)=>{if(ft.relevance!==zt.relevance)return zt.relevance-ft.relevance;if(ft.language&&zt.language){if(Wt(ft.language).supersetOf===zt.language)return 1;if(Wt(zt.language).supersetOf===ft.language)return-1}return 0}),[gt,Bt]=dt,Zt=gt;return Zt.secondBest=Bt,Zt}function dn(F,ge,Ie){const Fe=ge&&ye[ge]||Ie;F.classList.add("hljs"),F.classList.add(`language-${Fe}`)}function wt(F){let ge=null;const Ie=Ct(F);if(Ue(Ie))return;if(de("before:highlightElement",{el:F,language:Ie}),F.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",F);return}if(F.children.length>0&&(Se.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(F)),Se.throwUnescapedHTML))throw new la("One of your code blocks includes unescaped HTML.",F.innerHTML);ge=F;const Fe=ge.textContent,dt=Ie?mt(Fe,{language:Ie,ignoreIllegals:!0}):Na(Fe);F.innerHTML=dt.value,F.dataset.highlighted="yes",dn(F,Ie,dt.language),F.result={language:dt.language,re:dt.relevance,relevance:dt.relevance},dt.secondBest&&(F.secondBest={language:dt.secondBest.language,relevance:dt.secondBest.relevance}),de("after:highlightElement",{el:F,result:dt,text:Fe})}function Kt(F){Se=hn(Se,F)}const tt=()=>{ba(),vt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function vn(){ba(),vt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ua=!1;function ba(){function F(){ba()}if(document.readyState==="loading"){Ua||window.addEventListener("DOMContentLoaded",F,!1),Ua=!0;return}document.querySelectorAll(Se.cssSelector).forEach(wt)}function xa(F,ge){let Ie=null;try{Ie=ge(k)}catch(Fe){if(je("Language definition for '{}' could not be registered.".replace("{}",F)),Qe)je(Fe);else throw Fe;Ie=Ae}Ie.name||(Ie.name=F),te[F]=Ie,Ie.rawDefinition=ge.bind(null,k),Ie.aliases&&Gn(Ie.aliases,{languageName:F})}function ra(F){delete te[F];for(const ge of Object.keys(ye))ye[ge]===F&&delete ye[ge]}function Ta(){return Object.keys(te)}function Wt(F){return F=(F||"").toLowerCase(),te[F]||te[ye[F]]}function Gn(F,{languageName:ge}){typeof F=="string"&&(F=[F]),F.forEach(Ie=>{ye[Ie.toLowerCase()]=ge})}function Xn(F){const ge=Wt(F);return ge&&!ge.disableAutodetect}function Vn(F){F["before:highlightBlock"]&&!F["before:highlightElement"]&&(F["before:highlightElement"]=ge=>{F["before:highlightBlock"](Object.assign({block:ge.el},ge))}),F["after:highlightBlock"]&&!F["after:highlightElement"]&&(F["after:highlightElement"]=ge=>{F["after:highlightBlock"](Object.assign({block:ge.el},ge))})}function ut(F){Vn(F),ze.push(F)}function Y(F){const ge=ze.indexOf(F);ge!==-1&&ze.splice(ge,1)}function de(F,ge){const Ie=F;ze.forEach(function(Fe){Fe[Ie]&&Fe[Ie](ge)})}function Ne(F){return vt("10.7.0","highlightBlock will be removed entirely in v12.0"),vt("10.7.0","Please use highlightElement now."),wt(F)}Object.assign(k,{highlight:mt,highlightAuto:Na,highlightAll:ba,highlightElement:wt,highlightBlock:Ne,configure:Kt,initHighlighting:tt,initHighlightingOnLoad:vn,registerLanguage:xa,unregisterLanguage:ra,listLanguages:Ta,getLanguage:Wt,registerAliases:Gn,autoDetection:Xn,inherit:hn,addPlugin:ut,removePlugin:Y}),k.debugMode=function(){Qe=!1},k.safeMode=function(){Qe=!0},k.versionString=qt,k.regex={concat:C,lookahead:_,either:R,optional:S,anyNumberOfTimes:T};for(const F in Ge)typeof Ge[F]=="object"&&i(Ge[F]);return Object.assign(k,Ge),k},Gt=Pt({});return Gt.newInstance=()=>Pt({}),Iu=Gt,Gt.HighlightJS=Gt,Gt.default=Gt,Iu}var Hu,yg;function H0(){if(yg)return Hu;yg=1;function i(a){const r=a.regex,s=r.concat(/[\p{L}_]/u,r.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),u=/[\p{L}0-9._:-]+/u,f={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},h={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},y=a.inherit(h,{begin:/\(/,end:/\)/}),g=a.inherit(a.APOS_STRING_MODE,{className:"string"}),m=a.inherit(a.QUOTE_STRING_MODE,{className:"string"}),b={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:u,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[f]},{begin:/'/,end:/'/,contains:[f]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[h,m,g,y,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[h,y,m,g]}]}]},a.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},f,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[m]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[b],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:"css"}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[b],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:"javascript"}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:r.concat(/</,r.lookahead(r.concat(s,r.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:s,relevance:0,starts:b}]},{className:"tag",begin:r.concat(/<\//,r.lookahead(r.concat(s,/>/))),contains:[{className:"name",begin:s,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return Hu=i,Hu}var qu,vg;function q0(){if(vg)return qu;vg=1;function i(a){const r=a.regex,s={},u={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[s]}]};Object.assign(s,{className:"variable",variants:[{begin:r.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},u]});const f={className:"subst",begin:/\$\(/,end:/\)/,contains:[a.BACKSLASH_ESCAPE]},h=a.inherit(a.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),y={begin:/<<-?\s*(?=\w+)/,starts:{contains:[a.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},g={className:"string",begin:/"/,end:/"/,contains:[a.BACKSLASH_ESCAPE,s,f]};f.contains.push(g);const m={match:/\\"/},b={className:"string",begin:/'/,end:/'/},v={match:/\\'/},_={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},a.NUMBER_MODE,s]},T=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],S=a.SHEBANG({binary:`(${T.join("|")})`,relevance:10}),C={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[a.inherit(a.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},A=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],R=["true","false"],$={match:/(\/[a-z._-]+)+/},U=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],W=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],z=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],ae=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:A,literal:R,built_in:[...U,...W,"set","shopt",...z,...ae]},contains:[S,a.SHEBANG(),C,_,h,y,$,g,m,b,v,s]}}return qu=i,qu}var Gu,Eg;function G0(){if(Eg)return Gu;Eg=1;function i(a){const r=a.regex,s=a.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),u="decltype\\(auto\\)",f="[a-zA-Z_]\\w*::",y="("+u+"|"+r.optional(f)+"[a-zA-Z_]\\w*"+r.optional("<[^<>]+>")+")",g=r.concat(/\batomic_/,r.either("bool","char","schar","uchar","short","ushort","int","uint","long","ulong","llong","ullong","char16_t","char32_t","wchar_t","int_least8_t","uint_least8_t","int_least16_t","uint_least16_t","int_least32_t","uint_least32_t","int_least64_t","uint_least64_t","int_fast8_t","uint_fast8_t","int_fast16_t","uint_fast16_t","int_fast32_t","uint_fast32_t","int_fast64_t","uint_fast64_t","intptr_t","uintptr_t","size_t","ptrdiff_t","intmax_t","uintmax_t"),/\b/),m={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:g}]},v={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[a.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},a.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},_={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},T={scope:"meta",begin:/#\s*include\b/,end:/$/,keywords:{keyword:"include"},contains:[{begin:/\\\n/},v,{scope:"string",begin:/<.*?>/},s,a.C_BLOCK_COMMENT_MODE]},S={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},a.inherit(v,{className:"string"}),s,a.C_BLOCK_COMMENT_MODE]},C=[T,S],A={className:"title",begin:r.optional(f)+a.IDENT_RE,relevance:0},R=r.optional(f)+a.IDENT_RE+"\\s*\\(",$=12,z={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},ae=[...C,m,s,a.C_BLOCK_COMMENT_MODE,_,v],se={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:z,contains:ae.concat([{begin:/\(/,end:/\)/,keywords:z,contains:ae.concat(["self"]),relevance:0}]),relevance:0},x={begin:"("+y+"[\\*&\\s]+){1,"+$+"}"+R,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:z,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:u,keywords:z,relevance:0},{begin:R,returnBegin:!0,contains:[a.inherit(A,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:[s,a.C_BLOCK_COMMENT_MODE,v,_,m,{begin:/\(/,end:/\)/,keywords:z,relevance:0,contains:["self",s,a.C_BLOCK_COMMENT_MODE,v,_,m]}]},m,s,a.C_BLOCK_COMMENT_MODE,...C]};return{name:"C",aliases:["h"],keywords:z,disableAutodetect:!0,illegal:"</",contains:[].concat(se,x,ae,[...C,{begin:a.IDENT_RE+"::",keywords:z},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},a.TITLE_MODE]}]),exports:{preprocessor:S,strings:v,keywords:z}}}return Gu=i,Gu}var $u,_g;function $0(){if(_g)return $u;_g=1;function i(a){const r=a.regex,s=a.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),u="decltype\\(auto\\)",f="[a-zA-Z_]\\w*::",y="(?!struct)("+u+"|"+r.optional(f)+"[a-zA-Z_]\\w*"+r.optional("<[^<>]+>")+")",g={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},b={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[a.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},a.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\\s"]{0,16})\(/,end:/\)([^()\\\s"]{0,16})"/})]},v={className:"number",variants:[{begin:"[+-]?(?:(?:\\b[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|\\b[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|\\b0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},_={scope:"meta",begin:/#\s*include\b/,end:/$/,keywords:{keyword:"include"},contains:[{begin:/\\\n/},b,{scope:"string",begin:/<.*?>/},s,a.C_BLOCK_COMMENT_MODE]},T={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},a.inherit(b,{className:"string"}),s,a.C_BLOCK_COMMENT_MODE]},S=[_,T],C={className:"title",begin:r.optional(f)+a.IDENT_RE,relevance:0},A=r.optional(f)+a.IDENT_RE+"\\s*\\(",R=12,$=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],U=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],W=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],z=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],x={type:U,keyword:$,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:W},G={className:"function.dispatch",relevance:0,keywords:{_hint:z},begin:r.concat(/\b/,`(?!${$.join("|")})`,a.IDENT_RE,r.lookahead(/(<[^<>]+>|)\s*\(/))},ee=[G,...S,g,s,a.C_BLOCK_COMMENT_MODE,v,b],ue={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:x,contains:ee.concat([{begin:/\(/,end:/\)/,keywords:x,contains:ee.concat(["self"]),relevance:0}]),relevance:0},Ee={className:"function",begin:"("+y+"[\\*&\\s]+){1,"+R+"}"+A,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:x,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:u,keywords:x,relevance:0},{begin:A,returnBegin:!0,contains:[C],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[b,v]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:[s,a.C_BLOCK_COMMENT_MODE,b,v,g,{begin:/\(/,end:/\)/,keywords:x,relevance:0,contains:["self",s,a.C_BLOCK_COMMENT_MODE,b,v,g]}]},g,s,a.C_BLOCK_COMMENT_MODE,...S]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:x,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(ue,Ee,G,ee,[...S,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:x,contains:["self",g]},{begin:a.IDENT_RE+"::",keywords:x},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return $u=i,$u}var Yu,Sg;function Y0(){if(Sg)return Yu;Sg=1;function i(a){const r=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],s=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],u=["default","false","null","true"],f=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],h=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],y={keyword:f.concat(h),built_in:r,literal:u},g=a.inherit(a.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),m="\\d(_*\\d)*",b="([uU][lL]?|[lL][uU]?)?",_={className:"number",variants:[{begin:"\\b0[bB]_*[01](_*[01])*"+b},{begin:"(-?)\\b0[xX]_*[a-fA-F0-9](_*[a-fA-F0-9])*"+b},{begin:"(-?)(\\b"+m+"(\\.("+m+")?)?|\\."+m+")([eE][-+]?"+m+")?"+"([fFdDmM]|[uU][lL]?|[lL][uU]?)?"}],relevance:0},T={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},S={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},C=a.inherit(S,{illegal:/\n/}),A={className:"subst",begin:/\{/,end:/\}/,keywords:y},R=a.inherit(A,{illegal:/\n/}),$={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},a.BACKSLASH_ESCAPE,R]},U={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},A]},W=a.inherit(U,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},R]});A.contains=[U,$,S,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,_,a.C_BLOCK_COMMENT_MODE],R.contains=[W,$,C,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,_,a.inherit(a.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const z={variants:[T,U,$,S,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE]},ae={begin:"<",end:">",contains:[{beginKeywords:"in out"},g]},se=a.IDENT_RE+"(<"+a.IDENT_RE+"(\\s*,\\s*"+a.IDENT_RE+")*>)?(\\[\\])?",x={begin:"@"+a.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:y,illegal:/::/,contains:[a.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},z,_,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},g,ae,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[g,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[g,ae,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+se+"\\s+)+"+a.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:y,contains:[{beginKeywords:s.join(" "),relevance:0},{begin:a.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[a.TITLE_MODE,ae],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:y,relevance:0,contains:[z,_,a.C_BLOCK_COMMENT_MODE]},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE]},x]}}return Yu=i,Yu}var Fu,wg;function F0(){if(wg)return Fu;wg=1;const i=m=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:m.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[m.APOS_STRING_MODE,m.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:m.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),a=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],r=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],s=[...a,...r],u=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),f=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),h=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),y=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function g(m){const b=m.regex,v=i(m),_={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},T="and or not only",S=/@-?\w[\w]*(-\w+)*/,C="[a-zA-Z-][a-zA-Z0-9_-]*",A=[m.APOS_STRING_MODE,m.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[v.BLOCK_COMMENT,_,v.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+C,relevance:0},v.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+f.join("|")+")"},{begin:":(:)?("+h.join("|")+")"}]},v.CSS_VARIABLE,{className:"attribute",begin:"\\b("+y.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[v.BLOCK_COMMENT,v.HEXCOLOR,v.IMPORTANT,v.CSS_NUMBER_MODE,v.UNICODE_RANGE,...A,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...A,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},v.FUNCTION_DISPATCH]},{begin:b.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:S},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:T,attribute:u.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...A,v.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+s.join("|")+")\\b"}]}}return Fu=g,Fu}var Pu,Ng;function P0(){if(Ng)return Pu;Ng=1;function i(a){const r=a.regex,s={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},u={match:/^ {0,3}([-*_])[ \t]*(?:\1[ \t]*){2,}$/},f={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},h={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},y={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},g=/[A-Za-z][A-Za-z0-9+.-]*/,m={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:r.concat(/\[.+?\]\(/,g,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},b={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},v={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},_=a.inherit(b,{contains:[]}),T=a.inherit(v,{contains:[]});b.contains.push(T),v.contains.push(_);let S=[s,m];return[b,v,_,T].forEach($=>{$.contains=$.contains.concat(S)}),S=S.concat(b,v),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:S},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:S}]}]},s,h,u,b,v,{className:"quote",begin:"^>\\s+",contains:S,end:"$"},f,m,y,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return Pu=i,Pu}var Ku,xg;function K0(){if(xg)return Ku;xg=1;function i(a){const r=a.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:r.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+ +\+\d+,\d+ +@@/,/^@@ +-\d+,\d+ +\+\d+ +@@/,/^@@ +-\d+ +\+\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:r.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}return Ku=i,Ku}var Zu,Tg;function Z0(){if(Tg)return Zu;Tg=1;function i(a){const r=a.regex,s="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",u=r.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),f=r.concat(u,/(::\w+)*/),y={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},g={className:"doctag",begin:"@[A-Za-z]+"},m={begin:"#<",end:">"},b=[a.COMMENT("#","$",{contains:[g]}),a.COMMENT("^=begin","^=end",{contains:[g],relevance:10}),a.COMMENT("^__END__",a.MATCH_NOTHING_RE)],v={className:"subst",begin:/#\{/,end:/\}/,keywords:y},_={className:"string",contains:[a.BACKSLASH_ESCAPE,v],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:r.concat(/<<[-~]?'?/,r.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[a.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[a.BACKSLASH_ESCAPE,v]})]}]},T="[1-9](_?[0-9])*|0",S="[0-9](_?[0-9])*",C={className:"number",relevance:0,variants:[{begin:`\\b(${T})(\\.(${S}))?([eE][+-]?(${S})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},A={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:y}]},se=[_,{variants:[{match:[/class\s+/,f,/\s+<\s+/,f]},{match:[/\b(class|module)\s+/,f]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:y},{match:[/(include|extend)\s+/,f],scope:{2:"title.class"},keywords:y},{relevance:0,match:[f,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:u,scope:"title.class"},{match:[/def/,/\s+/,s],scope:{1:"keyword",3:"title.function"},contains:[A]},{begin:"::"},{className:"symbol",begin:a.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[_,{begin:s}],relevance:0},C,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:y},{begin:"("+a.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[a.BACKSLASH_ESCAPE,v],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(m,b),relevance:0}].concat(m,b);v.contains=se,A.contains=se;const ue=[{begin:/^\s*=>/,starts:{end:"$",contains:se}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:y,contains:se}}];return b.unshift(m),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:y,illegal:/\/\*/,contains:[a.SHEBANG({binary:"ruby"})].concat(ue).concat(b).concat(se)}}return Zu=i,Zu}var Xu,Ag;function X0(){if(Ag)return Xu;Ag=1;function i(a){const h={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:h,illegal:"</",contains:[a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,{className:"string",variants:[a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\b0[bB](_?[01])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[a.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:h,illegal:/["']/}]}]}}return Xu=i,Xu}var Vu,Rg;function V0(){if(Rg)return Vu;Rg=1;function i(a){const r=a.regex,s=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[a.HASH_COMMENT_MODE,a.QUOTE_STRING_MODE,a.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:r.concat(s,r.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}return Vu=i,Vu}var Qu,kg;function Q0(){if(kg)return Qu;kg=1;function i(a){const r=a.regex,s={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:a.NUMBER_RE}]},u=a.COMMENT();u.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const f={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},h={className:"literal",begin:/\bon|off|true|false|yes|no\b/},y={className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},g={begin:/\[/,end:/\]/,contains:[u,h,f,y,s,"self"],relevance:0},m=/[A-Za-z0-9_-]+/,b=/"(\\"|[^"])*"/,v=/'[^']*'/,_=r.either(m,b,v),T=r.concat(_,"(\\s*\\.\\s*",_,")*",r.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[u,{className:"section",begin:/\[+/,end:/\]+/},{begin:T,className:"attr",starts:{end:/$/,contains:[u,g,h,f,y,s]}}]}}return Qu=i,Qu}var Wu,Og;function W0(){if(Og)return Wu;Og=1;var i="[0-9](_*[0-9])*",a=`\\.(${i})`,r="[0-9a-fA-F](_*[0-9a-fA-F])*",s={className:"number",variants:[{begin:`(\\b(${i})((${a})|\\.)?|(${a}))[eE][+-]?(${i})[fFdD]?\\b`},{begin:`\\b(${i})((${a})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${a})[fFdD]?\\b`},{begin:`\\b(${i})[fFdD]\\b`},{begin:`\\b0[xX]((${r})\\.?|(${r})?\\.(${r}))[pP][+-]?(${i})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${r})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function u(h,y,g){return g===-1?"":h.replace(y,m=>u(h,y,g-1))}function f(h){const y=h.regex,g="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",m="(?:(?:\\s*\\[\\s*])+)?",b=g+"<@@@>"+m,_="(?:"+("\\?(?:\\s+(?:extends|super)\\s+"+b+")?")+"|"+b+")",T=u("(?:\\s*<\\s*"+_+"(?:\\s*,\\s*"+_+")*\\s*>)?",/<@@@>/g,2),$={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},U={className:"meta",begin:"@"+g,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},W={className:"params",begin:/\(/,end:/\)/,keywords:$,relevance:0,contains:[h.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:$,illegal:/<\/|#/,contains:[h.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},h.C_LINE_COMMENT_MODE,h.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[h.BACKSLASH_ESCAPE]},h.APOS_STRING_MODE,h.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,g],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{beginKeywords:"new throw return else yield assert",relevance:0},{begin:[g,y.concat(T,m,/\s+/),g,m,/\s*/,/=(?!=)/],className:{1:"type",3:"variable",6:"operator"}},{begin:[/record/,/\s+/,g],className:{1:"keyword",3:"title.class"},contains:[W,h.C_LINE_COMMENT_MODE,h.C_BLOCK_COMMENT_MODE]},{begin:[g,y.concat(T,m,/\s+/),g,/\s*(?=\()/],className:{1:"type",3:"title.function"},keywords:$,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:$,relevance:0,contains:[U,h.APOS_STRING_MODE,h.QUOTE_STRING_MODE,s,h.C_BLOCK_COMMENT_MODE]},h.C_LINE_COMMENT_MODE,h.C_BLOCK_COMMENT_MODE]},s,U]}}return Wu=f,Wu}var Ju,Cg;function J0(){if(Cg)return Ju;Cg=1;const i="[A-Za-z$_][0-9A-Za-z$_]*",a=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],r=["true","false","null","undefined","NaN","Infinity"],s=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],u=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],f=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],h=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","self","global"],y=[].concat(f,s,u);function g(m){const b=m.regex,v=(X,{after:be})=>{const xe="</"+X[0].slice(1);return X.input.indexOf(xe,be)!==-1},_=i,T={begin:"<>",end:"</>"},S=/<[A-Za-z0-9\\._:-]+\s*\/>/,C={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(X,be)=>{const xe=X[0].length+X.index,Ge=X.input[xe];if(Ge==="<"||Ge===","){be.ignoreMatch();return}Ge===">"&&(v(X,{after:xe})||be.ignoreMatch());let $e;const Ce=X.input.substring(xe);if($e=Ce.match(/^\s*=/)){be.ignoreMatch();return}if(($e=Ce.match(/^\s+extends\s+/))&&$e.index===0){be.ignoreMatch();return}}},A={$pattern:i,keyword:a,literal:r,built_in:y,"variable.language":h},R="[0-9](_?[0-9])*",$=`\\.(${R})`,U="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",W={className:"number",variants:[{begin:`(\\b(${U})((${$})|\\.)?|(${$}))[eE][+-]?(${R})\\b`},{begin:`\\b(${U})\\b((${$})\\b|\\.)?|(${$})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},z={className:"subst",begin:"\\$\\{",end:"\\}",keywords:A,contains:[]},ae={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[m.BACKSLASH_ESCAPE,z],subLanguage:"xml"}},se={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[m.BACKSLASH_ESCAPE,z],subLanguage:"css"}},x={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[m.BACKSLASH_ESCAPE,z],subLanguage:"graphql"}},G={className:"string",begin:"`",end:"`",contains:[m.BACKSLASH_ESCAPE,z]},ue={className:"comment",variants:[m.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:_+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),m.C_BLOCK_COMMENT_MODE,m.C_LINE_COMMENT_MODE]},Ee=[m.APOS_STRING_MODE,m.QUOTE_STRING_MODE,ae,se,x,G,{match:/\$\d+/},W];z.contains=Ee.concat({begin:/\{/,end:/\}/,keywords:A,contains:["self"].concat(Ee)});const j=[].concat(ue,z.contains),le=j.concat([{begin:/(\s*)\(/,end:/\)/,keywords:A,contains:["self"].concat(j)}]),fe={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:A,contains:le},M={variants:[{match:[/class/,/\s+/,_,/\s+/,/extends/,/\s+/,b.concat(_,"(",b.concat(/\./,_),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,_],scope:{1:"keyword",3:"title.class"}}]},Q={relevance:0,match:b.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...s,...u]}},pe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},we={variants:[{match:[/function/,/\s+/,_,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[fe],illegal:/%/},De={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function w(X){return b.concat("(?!",X.join("|"),")")}const L={match:b.concat(/\b/,w([...f,"super","import","await"].map(X=>`${X}\\s*\\(`)),_,b.lookahead(/\s*\(/)),className:"title.function",relevance:0},I={begin:b.concat(/\./,b.lookahead(b.concat(_,/(?![0-9A-Za-z$_(])/))),end:_,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},oe={match:[/get|set/,/\s+/,_,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},fe]},me="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+m.UNDERSCORE_IDENT_RE+")\\s*=>",ve={match:[/const|var|let/,/\s+/,_,/\s*/,/=\s*/,/(async\s*)?/,b.lookahead(me)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[fe]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:A,exports:{PARAMS_CONTAINS:le,CLASS_REFERENCE:Q},illegal:/#(?![$_A-Za-z])/,contains:[m.SHEBANG({label:"shebang",binary:"node",relevance:5}),pe,m.APOS_STRING_MODE,m.QUOTE_STRING_MODE,ae,se,x,G,ue,{match:/\$\d+/},W,Q,{scope:"attr",match:_+b.lookahead(":"),relevance:0},ve,{begin:"("+m.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[ue,m.REGEXP_MODE,{className:"function",begin:me,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:m.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:A,contains:le}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:T.begin,end:T.end},{match:S},{begin:C.begin,"on:begin":C.isTrulyOpeningTag,end:C.end}],subLanguage:"xml",contains:[{begin:C.begin,end:C.end,skip:!0,contains:["self"]}]}]},we,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+m.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[fe,m.inherit(m.TITLE_MODE,{begin:_,className:"title.function"})]},{match:/\.\.\./,relevance:0},I,{match:"\\$"+_,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[fe]},L,De,M,oe,{match:/\$[(.]/}]}}return Ju=g,Ju}var ed,Mg;function eS(){if(Mg)return ed;Mg=1;const a={scope:"number",match:"([-+]?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)|NaN|[-+]?Infinity",relevance:0};function r(s){const u={className:"attr",begin:/(("(\\.|[^\\"\r\n])*")|('(\\.|[^\\'\r\n])*'))(?=\s*:)/,relevance:1.01},f={match:/[{}[\],:]/,className:"punctuation",relevance:0},h=["true","false","null"],y={scope:"literal",beginKeywords:h.join(" ")};return{name:"JSON",aliases:["jsonc","json5"],keywords:{literal:h},contains:[u,f,s.APOS_STRING_MODE,s.QUOTE_STRING_MODE,y,a,s.C_LINE_COMMENT_MODE,s.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return ed=r,ed}var td,Dg;function tS(){if(Dg)return td;Dg=1;var i="[0-9](_*[0-9])*",a=`\\.(${i})`,r="[0-9a-fA-F](_*[0-9a-fA-F])*",s={className:"number",variants:[{begin:`(\\b(${i})((${a})|\\.)?|(${a}))[eE][+-]?(${i})[fFdD]?\\b`},{begin:`\\b(${i})((${a})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${a})[fFdD]?\\b`},{begin:`\\b(${i})[fFdD]\\b`},{begin:`\\b0[xX]((${r})\\.?|(${r})?\\.(${r}))[pP][+-]?(${i})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${r})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function u(f){const h={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},y={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},g={className:"symbol",begin:f.UNDERSCORE_IDENT_RE+"@"},m={className:"subst",begin:/\$\{/,end:/\}/,contains:[f.C_NUMBER_MODE]},b={className:"variable",begin:"\\$"+f.UNDERSCORE_IDENT_RE},v={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[b,m]},{begin:"'",end:"'",illegal:/\n/,contains:[f.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[f.BACKSLASH_ESCAPE,b,m]}]};m.contains.push(v);const _={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+f.UNDERSCORE_IDENT_RE+")?"},T={className:"meta",begin:"@"+f.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[f.inherit(v,{className:"string"}),"self"]}]},S=s,C=f.COMMENT("/\\*","\\*/",{contains:[f.C_BLOCK_COMMENT_MODE]}),A={variants:[{className:"type",begin:f.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},R=A;return R.variants[1].contains=[A],A.variants[1].contains=[R],{name:"Kotlin",aliases:["kt","kts","ktm","ktx"],keywords:h,contains:[f.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),f.C_LINE_COMMENT_MODE,C,y,g,_,T,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:h,relevance:5,contains:[{begin:f.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[f.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:h,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[A,f.C_LINE_COMMENT_MODE,C],relevance:0},f.C_LINE_COMMENT_MODE,C,_,T,v,f.C_NUMBER_MODE]},C]},{begin:[/class|interface|trait/,/\s+/,f.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},f.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},_,T]},v,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
169
169
|
`},S]}}return td=u,td}var nd,Lg;function nS(){if(Lg)return nd;Lg=1;const i=b=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:b.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},UNICODE_RANGE:{scope:"number",begin:/\b[Uu]\+[0-9A-Fa-f][0-9A-Fa-f?]{0,5}(-[0-9A-Fa-f][0-9A-Fa-f]{0,5})?/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[b.APOS_STRING_MODE,b.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:b.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),a=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],r=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],s=[...a,...r],u=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),f=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),h=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),y=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","corner-bottom-left-shape","corner-bottom-right-shape","corner-shape","corner-top-left-shape","corner-top-right-shape","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","unicode-range","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),g=f.concat(h).sort().reverse();function m(b){const v=i(b),_=g,T="and or not only",S="[\\w-]+",C="("+S+"|@\\{"+S+"\\})",A=[],R=[],$=function(j){return{className:"string",begin:"~?"+j+".*?"+j}},U=function(j,le,fe){return{className:j,begin:le,relevance:fe}},W={$pattern:/[a-z-]+/,keyword:T,attribute:u.join(" ")},z={begin:"\\(",end:"\\)",contains:R,keywords:W,relevance:0};R.push(b.C_LINE_COMMENT_MODE,b.C_BLOCK_COMMENT_MODE,$("'"),$('"'),v.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},v.UNICODE_RANGE,v.HEXCOLOR,z,U("variable","@@?"+S,10),U("variable","@\\{"+S+"\\}"),U("built_in","~?`[^`]*?`"),{className:"attribute",begin:S+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},v.IMPORTANT,{beginKeywords:"and not"},v.FUNCTION_DISPATCH);const ae=R.concat({begin:/\{/,end:/\}/,contains:A}),se={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(R)},x={begin:C+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},v.CSS_VARIABLE,{className:"attribute",begin:"\\b("+y.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:R}}]},G={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:W,returnEnd:!0,contains:R,relevance:0}},ee={className:"variable",variants:[{begin:"@"+S+"\\s*:",relevance:15},{begin:"@"+S}],starts:{end:"[;}]",returnEnd:!0,contains:ae}},ue={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:C,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[b.C_LINE_COMMENT_MODE,b.C_BLOCK_COMMENT_MODE,se,U("keyword","all\\b"),U("variable","@\\{"+S+"\\}"),{begin:"\\b("+s.join("|")+")\\b",className:"selector-tag"},v.CSS_NUMBER_MODE,U("selector-tag",C,0),U("selector-id","#"+C),U("selector-class","\\."+C,0),U("selector-tag","&",0),v.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+f.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+h.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:ae},{begin:"!important"},v.FUNCTION_DISPATCH]},Ee={begin:S+`:(:)?(${_.join("|")})`,returnBegin:!0,contains:[ue]};return A.push(b.C_LINE_COMMENT_MODE,b.C_BLOCK_COMMENT_MODE,G,ee,Ee,x,ue,se,v.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:A}}return nd=m,nd}var ad,zg;function aS(){if(zg)return ad;zg=1;function i(a){const r="\\[=*\\[",s="\\]=*\\]",u={begin:r,end:s,contains:["self"]},f=[a.COMMENT("--(?!"+r+")","$"),a.COMMENT("--"+r,s,{contains:[u],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:a.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local global not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:f.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[a.inherit(a.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:f}].concat(f)},a.C_NUMBER_MODE,a.APOS_STRING_MODE,a.QUOTE_STRING_MODE,{className:"string",begin:r,end:s,contains:[u],relevance:5}])}}return ad=i,ad}var id,jg;function iS(){if(jg)return id;jg=1;function i(a){const r={className:"variable",variants:[{begin:"\\$\\("+a.UNDERSCORE_IDENT_RE+"\\)",contains:[a.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},s={className:"string",begin:/"/,end:/"/,contains:[a.BACKSLASH_ESCAPE,r]},u={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[r,s]},f={begin:"^"+a.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},h={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},y={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[r]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[a.HASH_COMMENT_MODE,r,s,u,f,h,y]}}return id=i,id}var ld,Ug;function lS(){if(Ug)return ld;Ug=1;function i(a){const r=a.regex,s=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],u=/[dualxmsipngr]{0,12}/,f={$pattern:/[\w.]+/,keyword:s.join(" ")},h={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:f},y={begin:/->\{/,end:/\}/},g={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},m={scope:"variable",variants:[{begin:/\$\d/},{begin:r.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[g]},b={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},v=[a.BACKSLASH_ESCAPE,h,m],_=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],T=(A,R,$="\\1")=>{const U=$==="\\1"?$:r.concat($,R);return r.concat(r.concat("(?:",A,")"),R,/(?:\\.|[^\\\/])*?/,U,/(?:\\.|[^\\\/])*?/,$,u)},S=(A,R,$)=>r.concat(r.concat("(?:",A,")"),R,/(?:\\.|[^\\\/])*?/,$,u),C=[m,a.HASH_COMMENT_MODE,a.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),y,{className:"string",contains:v,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[a.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[a.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},b,{begin:"(\\/\\/|"+a.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[a.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:T("s|tr|y",r.either(..._,{capture:!0}))},{begin:T("s|tr|y","\\(","\\)")},{begin:T("s|tr|y","\\[","\\]")},{begin:T("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:S("(?:m|qr)?",/\//,/\//)},{begin:S("m|qr",r.either(..._,{capture:!0}),/\1/)},{begin:S("m|qr",/\(/,/\)/)},{begin:S("m|qr",/\[/,/\]/)},{begin:S("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[a.TITLE_MODE,g]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[a.TITLE_MODE,g,b]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return h.contains=C,y.contains=C,{name:"Perl",aliases:["pl","pm"],keywords:f,contains:C}}return ld=i,ld}var sd,Bg;function sS(){if(Bg)return sd;Bg=1;function i(a){const r={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},s=/[a-zA-Z@][a-zA-Z0-9_]*/,g={"variable.language":["this","super"],$pattern:s,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},m={$pattern:s,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:g,illegal:"</",contains:[r,a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE,a.C_NUMBER_MODE,a.QUOTE_STRING_MODE,a.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[a.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},a.inherit(a.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},a.C_LINE_COMMENT_MODE,a.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+m.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:m,contains:[a.UNDERSCORE_TITLE_MODE]},{begin:"\\."+a.UNDERSCORE_IDENT_RE,relevance:0}]}}return sd=i,sd}var rd,Ig;function rS(){if(Ig)return rd;Ig=1;function i(a){const r=a.regex,s=/(?![A-Za-z0-9])(?![$])/,u=r.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,s),f=r.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,s),h=r.concat(/[A-Z]+/,s),y={scope:"variable",match:"\\$+"+u},g={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},m={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},b=a.inherit(a.APOS_STRING_MODE,{illegal:null}),v=a.inherit(a.QUOTE_STRING_MODE,{illegal:null,contains:a.QUOTE_STRING_MODE.contains.concat(m)}),_={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:a.QUOTE_STRING_MODE.contains.concat(m),"on:begin":(fe,M)=>{M.data._beginMatch=fe[1]||fe[2]},"on:end":(fe,M)=>{M.data._beginMatch!==fe[1]&&M.ignoreMatch()}},T=a.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),S=`[
|
|
@@ -238,13 +238,13 @@ ${this.parser.parse(i)}</blockquote>
|
|
|
238
238
|
${i}</tr>
|
|
239
239
|
`}tablecell(i){let a=this.parser.parseInline(i.tokens),r=i.header?"th":"td";return(i.align?`<${r} align="${i.align}">`:`<${r}>`)+a+`</${r}>
|
|
240
240
|
`}strong({tokens:i}){return`<strong>${this.parser.parseInline(i)}</strong>`}em({tokens:i}){return`<em>${this.parser.parseInline(i)}</em>`}codespan({text:i}){return`<code>${Da(i,!0)}</code>`}br(i){return"<br>"}del({tokens:i}){return`<del>${this.parser.parseInline(i)}</del>`}link({href:i,title:a,tokens:r}){let s=this.parser.parseInline(r),u=_b(i);if(u===null)return s;i=u;let f='<a href="'+i+'"';return a&&(f+=' title="'+Da(a)+'"'),f+=">"+s+"</a>",f}image({href:i,title:a,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let u=_b(i);if(u===null)return Da(r);i=u;let f=`<img src="${i}" alt="${Da(r)}"`;return a&&(f+=` title="${Da(a)}"`),f+=">",f}text(i){return"tokens"in i&&i.tokens?this.parser.parseInline(i.tokens):"escaped"in i&&i.escaped?i.text:Da(i.text)}},ff=class{strong({text:i}){return i}em({text:i}){return i}codespan({text:i}){return i}del({text:i}){return i}html({text:i}){return i}text({text:i}){return i}link({text:i}){return""+i}image({text:i}){return""+i}br(){return""}checkbox({raw:i}){return i}},wa=class Hd{constructor(a){At(this,"options");At(this,"renderer");At(this,"textRenderer");this.options=a||al,this.options.renderer=this.options.renderer||new go,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ff}static parse(a,r){return new Hd(r).parse(a)}static parseInline(a,r){return new Hd(r).parseInline(a)}parse(a){var s,u;this.renderer.parser=this;let r="";for(let f=0;f<a.length;f++){let h=a[f];if((u=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&u[h.type]){let g=h,m=this.options.extensions.renderers[g.type].call({parser:this},g);if(m!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(g.type)){r+=m||"";continue}}let y=h;switch(y.type){case"space":{r+=this.renderer.space(y);break}case"hr":{r+=this.renderer.hr(y);break}case"heading":{r+=this.renderer.heading(y);break}case"code":{r+=this.renderer.code(y);break}case"table":{r+=this.renderer.table(y);break}case"blockquote":{r+=this.renderer.blockquote(y);break}case"list":{r+=this.renderer.list(y);break}case"checkbox":{r+=this.renderer.checkbox(y);break}case"html":{r+=this.renderer.html(y);break}case"def":{r+=this.renderer.def(y);break}case"paragraph":{r+=this.renderer.paragraph(y);break}case"text":{r+=this.renderer.text(y);break}default:{let g='Token with "'+y.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return r}parseInline(a,r=this.renderer){var u,f;this.renderer.parser=this;let s="";for(let h=0;h<a.length;h++){let y=a[h];if((f=(u=this.options.extensions)==null?void 0:u.renderers)!=null&&f[y.type]){let m=this.options.extensions.renderers[y.type].call({parser:this},y);if(m!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(y.type)){s+=m||"";continue}}let g=y;switch(g.type){case"escape":{s+=r.text(g);break}case"html":{s+=r.html(g);break}case"link":{s+=r.link(g);break}case"image":{s+=r.image(g);break}case"checkbox":{s+=r.checkbox(g);break}case"strong":{s+=r.strong(g);break}case"em":{s+=r.em(g);break}case"codespan":{s+=r.codespan(g);break}case"br":{s+=r.br(g);break}case"del":{s+=r.del(g);break}case"text":{s+=r.text(g);break}default:{let m='Token with "'+g.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return s}},so,Hs=(so=class{constructor(i){At(this,"options");At(this,"block");this.options=i||al}preprocess(i){return i}postprocess(i){return i}processAllTokens(i){return i}emStrongMask(i){return i}provideLexer(i=this.block){return i?Sa.lex:Sa.lexInline}provideParser(i=this.block){return i?wa.parse:wa.parseInline}},At(so,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),At(so,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),so),fN=class{constructor(...i){At(this,"defaults",lf());At(this,"options",this.setOptions);At(this,"parse",this.parseMarkdown(!0));At(this,"parseInline",this.parseMarkdown(!1));At(this,"Parser",wa);At(this,"Renderer",go);At(this,"TextRenderer",ff);At(this,"Lexer",Sa);At(this,"Tokenizer",mo);At(this,"Hooks",Hs);this.use(...i)}walkTokens(i,a){var s,u;let r=[];for(let f of i)switch(r=r.concat(a.call(this,f)),f.type){case"table":{let h=f;for(let y of h.header)r=r.concat(this.walkTokens(y.tokens,a));for(let y of h.rows)for(let g of y)r=r.concat(this.walkTokens(g.tokens,a));break}case"list":{let h=f;r=r.concat(this.walkTokens(h.items,a));break}default:{let h=f;(u=(s=this.defaults.extensions)==null?void 0:s.childTokens)!=null&&u[h.type]?this.defaults.extensions.childTokens[h.type].forEach(y=>{let g=h[y].flat(1/0);r=r.concat(this.walkTokens(g,a))}):h.tokens&&(r=r.concat(this.walkTokens(h.tokens,a)))}}return r}use(...i){let a=this.defaults.extensions||{renderers:{},childTokens:{}};return i.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(u=>{if(!u.name)throw new Error("extension name required");if("renderer"in u){let f=a.renderers[u.name];f?a.renderers[u.name]=function(...h){let y=u.renderer.apply(this,h);return y===!1&&(y=f.apply(this,h)),y}:a.renderers[u.name]=u.renderer}if("tokenizer"in u){if(!u.level||u.level!=="block"&&u.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let f=a[u.level];f?f.unshift(u.tokenizer):a[u.level]=[u.tokenizer],u.start&&(u.level==="block"?a.startBlock?a.startBlock.push(u.start):a.startBlock=[u.start]:u.level==="inline"&&(a.startInline?a.startInline.push(u.start):a.startInline=[u.start]))}"childTokens"in u&&u.childTokens&&(a.childTokens[u.name]=u.childTokens)}),s.extensions=a),r.renderer){let u=this.defaults.renderer||new go(this.defaults);for(let f in r.renderer){if(!(f in u))throw new Error(`renderer '${f}' does not exist`);if(["options","parser"].includes(f))continue;let h=f,y=r.renderer[h],g=u[h];u[h]=(...m)=>{let b=y.apply(u,m);return b===!1&&(b=g.apply(u,m)),b||""}}s.renderer=u}if(r.tokenizer){let u=this.defaults.tokenizer||new mo(this.defaults);for(let f in r.tokenizer){if(!(f in u))throw new Error(`tokenizer '${f}' does not exist`);if(["options","rules","lexer"].includes(f))continue;let h=f,y=r.tokenizer[h],g=u[h];u[h]=(...m)=>{let b=y.apply(u,m);return b===!1&&(b=g.apply(u,m)),b}}s.tokenizer=u}if(r.hooks){let u=this.defaults.hooks||new Hs;for(let f in r.hooks){if(!(f in u))throw new Error(`hook '${f}' does not exist`);if(["options","block"].includes(f))continue;let h=f,y=r.hooks[h],g=u[h];Hs.passThroughHooks.has(f)?u[h]=m=>{if(this.defaults.async&&Hs.passThroughHooksRespectAsync.has(f))return(async()=>{let v=await y.call(u,m);return g.call(u,v)})();let b=y.call(u,m);return g.call(u,b)}:u[h]=(...m)=>{if(this.defaults.async)return(async()=>{let v=await y.apply(u,m);return v===!1&&(v=await g.apply(u,m)),v})();let b=y.apply(u,m);return b===!1&&(b=g.apply(u,m)),b}}s.hooks=u}if(r.walkTokens){let u=this.defaults.walkTokens,f=r.walkTokens;s.walkTokens=function(h){let y=[];return y.push(f.call(this,h)),u&&(y=y.concat(u.call(this,h))),y}}this.defaults={...this.defaults,...s}}),this}setOptions(i){return this.defaults={...this.defaults,...i},this}lexer(i,a){return Sa.lex(i,a??this.defaults)}parser(i,a){return wa.parse(i,a??this.defaults)}parseMarkdown(i){return(a,r)=>{let s={...r},u={...this.defaults,...s},f=this.onError(!!u.silent,!!u.async);if(this.defaults.async===!0&&s.async===!1)return f(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof a>"u"||a===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof a!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(a)+", string expected"));if(u.hooks&&(u.hooks.options=u,u.hooks.block=i),u.async)return(async()=>{let h=u.hooks?await u.hooks.preprocess(a):a,y=await(u.hooks?await u.hooks.provideLexer(i):i?Sa.lex:Sa.lexInline)(h,u),g=u.hooks?await u.hooks.processAllTokens(y):y;u.walkTokens&&await Promise.all(this.walkTokens(g,u.walkTokens));let m=await(u.hooks?await u.hooks.provideParser(i):i?wa.parse:wa.parseInline)(g,u);return u.hooks?await u.hooks.postprocess(m):m})().catch(f);try{u.hooks&&(a=u.hooks.preprocess(a));let h=(u.hooks?u.hooks.provideLexer(i):i?Sa.lex:Sa.lexInline)(a,u);u.hooks&&(h=u.hooks.processAllTokens(h)),u.walkTokens&&this.walkTokens(h,u.walkTokens);let y=(u.hooks?u.hooks.provideParser(i):i?wa.parse:wa.parseInline)(h,u);return u.hooks&&(y=u.hooks.postprocess(y)),y}catch(h){return f(h)}}}onError(i,a){return r=>{if(r.message+=`
|
|
241
|
-
Please report this to https://github.com/markedjs/marked.`,i){let s="<p>An error occurred:</p><pre>"+Da(r.message+"",!0)+"</pre>";return a?Promise.resolve(s):s}if(a)return Promise.reject(r);throw r}}},nl=new fN;function yt(i,a){return nl.parse(i,a)}yt.options=yt.setOptions=function(i){return nl.setOptions(i),yt.defaults=nl.defaults,dy(yt.defaults),yt};yt.getDefaults=lf;yt.defaults=al;function hN(...i){return nl.use(...i),yt.defaults=nl.defaults,dy(yt.defaults),yt}yt.use=hN;yt.walkTokens=function(i,a){return nl.walkTokens(i,a)};yt.parseInline=nl.parseInline;yt.Parser=wa;yt.parser=wa.parse;yt.Renderer=go;yt.TextRenderer=ff;yt.Lexer=Sa;yt.lexer=Sa.lex;yt.Tokenizer=mo;yt.Hooks=Hs;yt.parse=yt;yt.options;yt.setOptions;yt.walkTokens;yt.parseInline;wa.parse;Sa.lex;const pN="modulepreload",mN=function(i){return"/"+i},xb={},gN=function(a,r,s){let u=Promise.resolve();if(r&&r.length>0){let h=function(m){return Promise.all(m.map(b=>Promise.resolve(b).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const y=document.querySelector("meta[property=csp-nonce]"),g=(y==null?void 0:y.nonce)||(y==null?void 0:y.getAttribute("nonce"));u=h(r.map(m=>{if(m=mN(m),m in xb)return;xb[m]=!0;const b=m.endsWith(".css"),v=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${v}`))return;const _=document.createElement("link");if(_.rel=b?"stylesheet":pN,b||(_.as="script"),_.crossOrigin="",_.href=m,g&&_.setAttribute("nonce",g),document.head.appendChild(_),b)return new Promise((T,S)=>{_.addEventListener("load",T),_.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${m}`)))})}))}function f(h){const y=new Event("vite:preloadError",{cancelable:!0});if(y.payload=h,window.dispatchEvent(y),!y.defaultPrevented)throw h}return u.then(h=>{for(const y of h||[])y.status==="rejected"&&f(y.reason);return a().catch(f)})};let bN=0;async function yN(i){const a=[...i.querySelectorAll("pre > code.language-mermaid")];if(a.length===0)return;const{default:r}=await gN(async()=>{const{default:s}=await import("./mermaid.core-
|
|
241
|
+
Please report this to https://github.com/markedjs/marked.`,i){let s="<p>An error occurred:</p><pre>"+Da(r.message+"",!0)+"</pre>";return a?Promise.resolve(s):s}if(a)return Promise.reject(r);throw r}}},nl=new fN;function yt(i,a){return nl.parse(i,a)}yt.options=yt.setOptions=function(i){return nl.setOptions(i),yt.defaults=nl.defaults,dy(yt.defaults),yt};yt.getDefaults=lf;yt.defaults=al;function hN(...i){return nl.use(...i),yt.defaults=nl.defaults,dy(yt.defaults),yt}yt.use=hN;yt.walkTokens=function(i,a){return nl.walkTokens(i,a)};yt.parseInline=nl.parseInline;yt.Parser=wa;yt.parser=wa.parse;yt.Renderer=go;yt.TextRenderer=ff;yt.Lexer=Sa;yt.lexer=Sa.lex;yt.Tokenizer=mo;yt.Hooks=Hs;yt.parse=yt;yt.options;yt.setOptions;yt.walkTokens;yt.parseInline;wa.parse;Sa.lex;const pN="modulepreload",mN=function(i){return"/"+i},xb={},gN=function(a,r,s){let u=Promise.resolve();if(r&&r.length>0){let h=function(m){return Promise.all(m.map(b=>Promise.resolve(b).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};document.getElementsByTagName("link");const y=document.querySelector("meta[property=csp-nonce]"),g=(y==null?void 0:y.nonce)||(y==null?void 0:y.getAttribute("nonce"));u=h(r.map(m=>{if(m=mN(m),m in xb)return;xb[m]=!0;const b=m.endsWith(".css"),v=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${m}"]${v}`))return;const _=document.createElement("link");if(_.rel=b?"stylesheet":pN,b||(_.as="script"),_.crossOrigin="",_.href=m,g&&_.setAttribute("nonce",g),document.head.appendChild(_),b)return new Promise((T,S)=>{_.addEventListener("load",T),_.addEventListener("error",()=>S(new Error(`Unable to preload CSS for ${m}`)))})}))}function f(h){const y=new Event("vite:preloadError",{cancelable:!0});if(y.payload=h,window.dispatchEvent(y),!y.defaultPrevented)throw h}return u.then(h=>{for(const y of h||[])y.status==="rejected"&&f(y.reason);return a().catch(f)})};let bN=0;async function yN(i){const a=[...i.querySelectorAll("pre > code.language-mermaid")];if(a.length===0)return;const{default:r}=await gN(async()=>{const{default:s}=await import("./mermaid.core-wbwCbWuQ.js").then(u=>u.bA);return{default:s}},[]);r.initialize({startOnLoad:!1,securityLevel:"strict",suppressErrorRendering:!0,theme:"neutral",htmlLabels:!1,flowchart:{htmlLabels:!1,useMaxWidth:!1}});for(const s of a){const u=s.textContent??"";try{const{svg:f}=await r.render(`cerber-diagram-${++bN}`,u),h=s.parentElement;if(!(h!=null&&h.isConnected))continue;const y=document.createElement("figure");y.className="md-diagram",y.innerHTML=uy.sanitize(f,{USE_PROFILES:{svg:!0,svgFilters:!0}}),h.replaceWith(y)}catch(f){console.warn("cerber: could not draw a diagram",f)}}}yt.setOptions({gfm:!0,breaks:!1});function hf(i){const a=yt.parse(i??"",{async:!1});return uy.sanitize(a)}function _y(i){const a=H.useRef(null);return H.useEffect(()=>{a.current&&yN(a.current)},[i]),a}function ai({text:i,className:a}){const r=H.useMemo(()=>({__html:hf(i)}),[i]),s=_y(r.__html);return i!=null&&i.trim()?d.jsx("div",{ref:s,className:`md ${a??""}`,dangerouslySetInnerHTML:r}):null}const vN={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" ","#39":"'"};function EN(i){return i.replace(/<[^>]*>/g," ").replace(/&([a-z]+|#\d+);/gi,(a,r)=>vN[r.toLowerCase()]??a).replace(/\s+/g," ").trim()}function _N(i,a){return EN(a)!==i.replace(/\s+/g," ").trim()}function Ps({text:i,className:a}){const r=H.useMemo(()=>({__html:i!=null&&i.trim()?hf(i):""}),[i]),s=_y(r.__html);return!r.__html||!_N(i,r.__html)?null:d.jsxs("div",{className:"md-preview",children:[d.jsx("div",{className:"lab",children:"preview"}),d.jsx("div",{ref:s,className:`md prose ${a??""}`,dangerouslySetInnerHTML:r})]})}const SN=/\.(md|markdown)$/i;function pf(i){return SN.test(i)}function wN(i){return/^new file mode /m.test(i)||/^--- \/dev\/null$/m.test(i)}function NN(i){const a=[];let r=0,s=!1;const u=i.split(`
|
|
242
242
|
`);for(let f=0;f<u.length;f++){const h=u[f],y=h.match(/^@@ -\d+(?:,\d+)? \+(\d+)(?:,\d+)? @@/);if(y){r=Number(y[1]),s=!0;continue}s&&(h===""&&f===u.length-1||h.startsWith("\\")||h.startsWith("-")||(h.startsWith("+")||h.startsWith(" ")||h==="")&&(a.push({n:r,text:h===""?"":h.slice(1),added:h.startsWith("+")}),r++))}return a}const lo=i=>(i.match(/\n/g)??[]).length;function mf(i){const a=NN(i),r=wN(i),s=[];let u=[];const f=()=>{if(u.length===0)return;const h=u[0].n,y=new Set(u.filter(b=>b.added).map(b=>b.n)),g=u.map(b=>b.text).join(`
|
|
243
243
|
`)+`
|
|
244
244
|
`;let m=h;for(const b of yt.lexer(g)){const v=b.raw,_=v.trimEnd();if(_===""){m+=lo(v);continue}const T=v.length-v.trimStart().length,S=m+lo(v.slice(0,T)),C=S+lo(_.slice(T));let A=!1;for(let R=S;R<=C&&!A;R++)A=y.has(R);s.push({kind:"block",raw:_.slice(T),from:S,to:C,changed:A}),m+=lo(v)}u=[]};for(const h of a){const y=u[u.length-1];if(y&&h.n!==y.n+1){const g=h.n-y.n-1;f(),s.push({kind:"gap",lines:g})}u.push(h)}return f(),{items:s,isNew:r,lines:a.length}}const qd="cerber.stickyChapters";function xN(i){return i!=="off"}function TN(){try{return xN(localStorage.getItem(qd))}catch{return!0}}function Sy(){const[i,a]=H.useState(TN);return[i,s=>{try{s?localStorage.removeItem(qd):localStorage.setItem(qd,"off")}catch{}a(s)}]}function oo(i){const a=i.alreadyRaised;return!a||a.decision==="send"?"post":a.decision==="reply"?a.where.kind==="thread"?"reply":"hold":a.where.kind==="thread"&&a.where.state==="resolved"?"post":"hold"}const Gd={APPROVE:"approve",COMMENT:"comment",REQUEST_CHANGES:"request changes"},AN={APPROVE:"approve",COMMENT:"comment",REQUEST_CHANGES:"changes"};function wy(i,a=!1){return a?"COMMENT":(i==null?void 0:i.recommendation)==="approve"?"APPROVE":(i==null?void 0:i.recommendation)==="request_changes"?"REQUEST_CHANGES":"COMMENT"}function Ny(i,a){const r=B_(i);return a.filter(s=>{var u;return!s.drifted&&s.line!=null&&((u=r.get(s.path))==null?void 0:u.has(s.line))})}function Tb(i,a){const r=f=>{const h=Number((f??"").trim());return Number.isInteger(h)&&h>0?h:null},s=r(a);if(s!=null)return{line:s,side:"new"};const u=r(i);return u!=null?{line:u,side:"old"}:null}function xy(i){const a=i.comments.filter(y=>y.status==="dropped"),r=i.comments.filter(y=>y.status!=="dropped"),s=r.filter(y=>oo(y)==="reply"),u=r.filter(y=>oo(y)==="hold"),f=r.filter(y=>oo(y)==="post"),h=Ny(i.diff,f);return{inline:h,folded:f.filter(y=>!h.includes(y)),dropped:a,replies:s,held:u}}function Ab(i){return i.sent!=null||(i.priorSends??[]).length>0}function Rb(i){return(i.priorSends??[]).length+(i.sent?1:0)}function RN(i,a){if(i.sent==null)return!1;const r=a==null?void 0:a.headSha;return r!=null&&i.pr.headSha!==""&&r!==i.pr.headSha}function kN(i,a){const r=i.alreadyRaised;if(!r)return null;if(i.status==="dropped")return a?"dropped — not posted":"dropped — never posts";if(r.replied)return"replied in their thread";const s=oo(i);return a?s==="reply"?"the reply in their thread did not post":s==="hold"?"left out of the review":"posted as a comment of its own":s==="reply"?"replies in their thread when you send":s==="hold"?"left out of Send":r.decision==="send"?"posts as a comment of its own":"posts — their thread was resolved, and the problem is still here"}function ON(i){return i.where.kind==="thread"?`${i.where.state} thread`:"review"}function Rd(i){const a=i.comments.filter(u=>u.status!=="dropped");return["blocker","minor","nit"].map(u=>({tier:u,n:a.filter(f=>f.severity===u).length})).filter(({n:u})=>u>0).map(({tier:u,n:f})=>`${Zb[u]} ${f} ${u}${f===1?"":"s"}`).join(" · ")}function CN(i){if(!i.comments.some(s=>s.severity!=null))return null;const r=i.comments.filter(s=>s.status!=="dropped"&&s.severity==="blocker").length;return r===0?"no blockers":`${r} blocker${r===1?"":"s"}`}function MN(i){if(!i.verdict||!i.comments.some(u=>u.severity!=null))return null;const r=i.comments.filter(u=>u.status!=="dropped"&&u.severity==="blocker").length,s=i.verdict.recommendation;return s==="approve"&&r>0?`the verdict says approve, but ${r} blocker${r===1?"":"s"} still stand${r===1?"s":""}`:s==="request_changes"&&r===0?"the verdict says request changes, but no blocker still stands":null}function $d(i){const{inline:a,folded:r,replies:s,held:u}=xy(i),f=[s.length>0?`${s.length} ${s.length===1?"reply":"replies"} in another reviewer's thread`:"",u.length>0?`${u.length} already raised, left out`:""].filter(Boolean);return[DN(i,a,r),...f].join(" · ")}function DN(i,a,r){if(i.bodyOverride!=null)return`${a.length===0?"no inline comments":`${a.length} inline`} · body you wrote`;if(a.length===0&&r.length===0)return"no inline comments · body only";const s=[`${a.length} inline`];return r.length>0&&s.push(`${r.length} folded into the body`),s.join(" · ")}const Yd="cerber.sendKey";function LN(i){return i==="enter"?i:"mod-enter"}function zN(i,a){return a.key!=="Enter"||a.isComposing||a.keyCode===229?!1:a.metaKey||a.ctrlKey?!0:i==="enter"&&!a.shiftKey}let bo=null;function jN(i){if(bo)return bo;try{return LN((i??localStorage).getItem(Yd))}catch{return"mod-enter"}}function UN(i,a){try{const r=a??localStorage;i==="mod-enter"?r.removeItem(Yd):r.setItem(Yd,i),bo=null}catch{bo=i}}function Ty(){const[i,a]=H.useState(()=>jN());return[i,s=>{UN(s),a(s)}]}const kb={approve:"approve",comment:"comment",request_changes:"changes"},BN={approve:"approve",comment:"comment",request_changes:"changes"};function IN(i,a){return i.status==="dropped"?"none":i.drifted?"comment":i.origin==="user"?"awaiting":a}function Ay(i,a=20){const r=document.getElementById(`c-${i}`);if(r){r.scrollIntoView({behavior:"smooth",block:"center"});return}a>0&&requestAnimationFrame(()=>Ay(i,a-1))}function HN(i){const a=i,r=a==null?void 0:a.tagName;return r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||(a==null?void 0:a.isContentEditable)===!0}function Ob(i,a){const r=document.createElement("tr");r.className=a;const s=document.createElement("td");s.colSpan=2;const u=document.createElement("div");return s.appendChild(u),r.appendChild(s),i.after(r),{tr:r,holder:u}}function Cb(i,a,r){i.querySelectorAll(".d2h-file-wrapper").forEach(s=>{const u=s.dataset.path;if(!u)return;const f=a.has(u);s.classList.toggle("file-viewed-on",f),s.classList.toggle("file-peek",f&&r.has(u));const h=s.querySelector("input[data-viewed-path]");h&&(h.checked=f)})}function yo(i,a){!i||!a||i.getBoundingClientRect().top<parseFloat(getComputedStyle(a).top)&&requestAnimationFrame(()=>i.scrollIntoView({block:"start"}))}function qN(i){const a=document.createElement("label");a.className="file-viewed",a.title="Mark as viewed — folds the file until its diff changes";const r=document.createElement("input");return r.type="checkbox",r.dataset.viewedPath=i,a.append(r," Viewed"),a}function Ry({pick:i,chatBusy:a,onAdd:r,onAsk:s,onClose:u}){const[f,h]=H.useState(""),y=H.useRef(null);H.useEffect(()=>{var m;return(m=y.current)==null?void 0:m.focus()},[]);const g=f.trim();return d.jsxs("div",{className:"line-composer",children:[d.jsxs("div",{className:"line-composer-head",children:[d.jsxs("span",{className:"comment-loc",children:[i.path,":",i.line]}),i.side==="old"&&d.jsx("span",{className:"faint",title:"GitHub only takes inline comments on the new side of a diff.",children:"this line is gone from the new file — a comment on it posts on the file, not the line"})]}),d.jsx("textarea",{ref:y,className:"comment-edit",rows:3,placeholder:"what about this line?",value:f,onChange:m=>h(m.target.value),onKeyDown:m=>{m.key==="Escape"&&u(),m.key==="Enter"&&(m.metaKey||m.ctrlKey)&&g&&(m.preventDefault(),r(g))}}),d.jsx(Ps,{className:"comment-body",text:f}),d.jsxs("div",{className:"line-composer-actions",children:[d.jsxs("button",{className:"btn",disabled:!g,onClick:()=>r(g),children:[d.jsx(Xe,{name:"plus"}),"add comment",d.jsx(za,{children:"⌘↵"})]}),d.jsxs("button",{className:"btn btn-accent",disabled:!g||a,title:a?"the reviewer is still answering the last question":"Ask the reviewer about this line — the answer lands in the chat below",onClick:()=>s(g),children:[d.jsx(Xe,{name:"comment"}),"ask the reviewer"]}),d.jsx("span",{className:"grow"}),d.jsx("button",{className:"btn btn-sm",onClick:u,children:"cancel"})]})]})}function GN({patch:i,comments:a,renderComment:r,readOnly:s,chatBusy:u,onAddLineComment:f,onAskAboutLine:h,onRead:y,viewedState:g}){const m=H.useMemo(()=>i.trim()?L_(i,{drawFileList:!1,matching:"lines",outputFormat:"line-by-line"}):"",[i]),b=H.useMemo(()=>ja(i).map(j=>j.path),[i]),v=H.useMemo(()=>new Set(ja(i).filter(j=>pf(j.path)&&mf(j.patch).lines>0).map(j=>j.path)),[i]),_=H.useMemo(()=>a.map(j=>`${j.id}@${j.path}:${j.line}`).join("|"),[a]),T=H.useRef(null),S=H.useRef(y);S.current=y;const C=H.useRef(g);C.current=g;const[A,R]=H.useState([]),[$,U]=H.useState([]),[W,z]=H.useState(null),[ae,se]=H.useState(null);H.useEffect(()=>{var De,w;const j=T.current;if(!j)return;j.innerHTML=m,TS(j);const le=new Map,fe=[];j.querySelectorAll(".d2h-file-wrapper").forEach((L,I)=>{var ve,X,be,xe,Ge;const oe=(X=(ve=L.querySelector(".d2h-file-name"))==null?void 0:ve.textContent)==null?void 0:X.trim(),me=oe&&b.includes(oe)?oe:b[I];if(oe&&le.set(oe,L),me){le.set(me,L),L.dataset.path=me;const $e=document.createElement("div");if($e.className="file-comments",(be=L.querySelector(".d2h-file-header"))==null||be.after($e),fe.push({path:me,el:$e}),v.has(me)){const Ce=document.createElement("button");Ce.type="button",Ce.className="btn btn-sm md-read-toggle",Ce.dataset.readPath=me,Ce.textContent="read as a document",Ce.title="Render this markdown instead of showing it line by line",(xe=L.querySelector(".d2h-file-header"))==null||xe.appendChild(Ce)}(Ge=L.querySelector(".d2h-file-header"))==null||Ge.appendChild(qN(me))}}),Cb(j,C.current.viewed,C.current.peeked);const M=[],Q=new Map;for(const L of a){if(L.line==null)continue;const I=le.get(L.path);if(!I)continue;const oe=Array.from(I.querySelectorAll(".d2h-diff-tbody > tr")).find(ve=>{var X,be;return((be=(X=ve.querySelector(".line-num2"))==null?void 0:X.textContent)==null?void 0:be.trim())===String(L.line)});if(!oe)continue;const me=Ob(Q.get(oe)??oe,"inline-comment-row");Q.set(oe,me.tr),M.push({id:L.id,el:me.holder})}R(M),U(fe);const pe=L=>{var $e;const I=L.target,oe=I.closest(".md-read-toggle");if(oe!=null&&oe.dataset.readPath){S.current(oe.dataset.readPath);return}const me=I.closest(".d2h-file-wrapper");if(I instanceof HTMLInputElement&&I.dataset.viewedPath){I.checked&&yo(me,(me==null?void 0:me.querySelector(".d2h-file-header"))??null),C.current.onToggleViewed(I.dataset.viewedPath);return}if(I.closest(".file-viewed"))return;const ve=($e=I.closest(".d2h-file-header"))==null?void 0:$e.closest(".file-viewed-on");if(ve!=null&&ve.dataset.path){yo(me,(me==null?void 0:me.querySelector(".d2h-file-header"))??null),C.current.onTogglePeek(ve.dataset.path);return}const X=L.target.closest(".line-add");if(!X)return;const{path:be,line:xe,side:Ge}=X.dataset;!be||!xe||z({path:be,line:Number(xe),side:Ge==="old"?"old":"new"})};j.addEventListener("click",pe);const we=()=>j.removeEventListener("click",pe);if(s)return z(null),se(null),we;for(const L of j.querySelectorAll(".d2h-file-wrapper")){const I=L.dataset.path;if(I)for(const oe of L.querySelectorAll(".d2h-diff-tbody > tr > td.d2h-code-linenumber")){const me=Tb((De=oe.querySelector(".line-num1"))==null?void 0:De.textContent,(w=oe.querySelector(".line-num2"))==null?void 0:w.textContent);if(!me)continue;const ve=document.createElement("button");ve.type="button",ve.className="line-add";const X=`Say something about ${I}:${me.line}`;ve.title=X,ve.setAttribute("aria-label",X),ve.tabIndex=-1,ve.dataset.path=I,ve.dataset.line=String(me.line),ve.dataset.side=me.side,oe.appendChild(ve)}}return se(null),we},[m,_,b,v,s]);const x=b.filter(j=>g.viewed.has(j)).join(`
|
|
245
245
|
`),G=b.filter(j=>g.peeked.has(j)).join(`
|
|
246
246
|
`);H.useEffect(()=>{T.current&&Cb(T.current,g.viewed,g.peeked)},[x,G]),H.useEffect(()=>{const j=T.current;if(!j||!W||s){se(null);return}const le=Array.from(j.querySelectorAll(".d2h-file-wrapper")).find(Q=>Q.dataset.path===W.path),fe=Array.from((le==null?void 0:le.querySelectorAll(".d2h-diff-tbody > tr"))??[]).find(Q=>{var De,w;const pe=Q.querySelector(".d2h-code-linenumber"),we=Tb((De=pe==null?void 0:pe.querySelector(".line-num1"))==null?void 0:De.textContent,(w=pe==null?void 0:pe.querySelector(".line-num2"))==null?void 0:w.textContent);return(we==null?void 0:we.line)===W.line&&we.side===W.side});if(!fe){z(null);return}const M=Ob(fe,"line-composer-row");return se(M.holder),()=>M.tr.remove()},[W,A,s]);const ee=a.filter(j=>!A.some(le=>le.id===j.id)),ue=$.map(j=>({...j,comments:ee.filter(le=>le.path===j.path)})).filter(j=>j.comments.length>0),Ee=ee.filter(j=>!$.some(le=>le.path===j.path));return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"diff",ref:T}),A.map(({id:j,el:le})=>{const fe=a.find(M=>M.id===j);return fe?Lu.createPortal(r(fe),le,j):null}),ue.map(({path:j,el:le,comments:fe})=>Lu.createPortal(d.jsx(d.Fragment,{children:fe.map(r)}),le,`file:${j}`)),W&&ae&&Lu.createPortal(d.jsx(Ry,{pick:W,chatBusy:u,onAdd:j=>{f(W,j),z(null)},onAsk:j=>{h(W,j),z(null)},onClose:()=>z(null)}),ae,`pick-${W.path}-${W.side}-${W.line}`),Ee.map(j=>r(j))]})}function $N({block:i,path:a,changed:r,readOnly:s,onPick:u}){const f=H.useMemo(()=>hf(i.raw),[i.raw]),h=`Say something about ${a}:${i.from}`;return d.jsxs("div",{className:`md-block${r?" md-block-changed":""}`,children:[!s&&d.jsx("button",{type:"button",className:"md-block-add",title:h,"aria-label":h,tabIndex:-1,onClick:u,children:d.jsx(Xe,{name:"plus"})}),d.jsx("div",{className:"md md-doc prose",dangerouslySetInnerHTML:{__html:f}})]})}function YN({path:i,doc:a,comments:r,renderComment:s,readOnly:u,chatBusy:f,onAddLineComment:h,onAskAboutLine:y,onShowDiff:g,viewedState:m}){const[b,v]=H.useState(null),_=H.useRef(null),T=H.useRef(null),S=m.viewed.has(i),C=S&&!m.peeked.has(i),A=H.useMemo(()=>{const R=new Map,$=a.items.flatMap((W,z)=>W.kind==="block"?[{item:W,i:z}]:[]),U=[];for(const W of r){const z=W.line==null?void 0:$.filter(ae=>ae.item.from<=W.line).pop()??$[0];if(!z){U.push(W);continue}R.set(z.i,[...R.get(z.i)??[],W])}return{at:R,rest:U}},[a,r]);return d.jsxs("div",{className:"md-file",ref:_,children:[d.jsxs("div",{ref:T,className:`md-file-head${S?" md-file-head-viewed":""}${C?" md-file-head-folded":""}`,onClick:R=>{S&&!R.target.closest("button, label")&&(yo(_.current,T.current),m.onTogglePeek(i))},children:[d.jsx(Xe,{name:"file"}),d.jsx("span",{className:"md-file-name",children:i}),a.isNew?d.jsx("span",{className:"tag tag-added",children:"new file"}):d.jsx("span",{className:"faint",title:"A diff carries the lines around a change, not the file.",children:"the diff's lines only — what the PR removed isn't here"}),d.jsx("span",{className:"grow"}),d.jsx("button",{className:"btn btn-sm",onClick:g,title:"Back to the line-by-line diff",children:"show the diff"}),d.jsxs("label",{className:"file-viewed",title:"Mark as viewed — folds the file until its diff changes",children:[d.jsx("input",{type:"checkbox",checked:S,onChange:()=>{S||yo(_.current,T.current),m.onToggleViewed(i)}})," ","Viewed"]})]}),!C&&A.rest.length>0&&d.jsx("div",{className:"file-comments",children:A.rest.map(s)}),!C&&a.items.map((R,$)=>d.jsxs(H.Fragment,{children:[R.kind==="gap"?d.jsxs("div",{className:"md-gap",title:"These lines are in the file but not in the diff.",children:["⋯ ",R.lines.toLocaleString()," line",R.lines===1?"":"s"," the diff skips"]}):d.jsx($N,{block:R,path:i,changed:R.changed&&!a.isNew,readOnly:u,onPick:()=>v({path:i,line:R.from,side:"new"})}),(A.at.get($)??[]).map(s),R.kind==="block"&&(b==null?void 0:b.line)===R.from&&d.jsx(Ry,{pick:b,chatBusy:f,onAdd:U=>{h(b,U),v(null)},onAsk:U=>{y(b,U),v(null)},onClose:()=>v(null)})]},$))]})}function FN({patch:i,comments:a,renderComment:r,readOnly:s,chatBusy:u,onAddLineComment:f,onAskAboutLine:h,viewedState:y}){const g=H.useMemo(()=>i.trim()?ja(i):[],[i]),m=H.useMemo(()=>new Map(g.filter(A=>pf(A.path)).map(A=>[A.path,mf(A.patch)]).filter(([,A])=>A.lines>0)),[g]),[b,v]=H.useState({}),_=A=>{var R;return b[A]??((R=m.get(A))==null?void 0:R.isNew)??!1},T=[];for(const A of g){const R=T[T.length-1];if(m.has(A.path)&&_(A.path)){T.push({kind:"read",paths:[A.path],patch:A.patch});continue}(R==null?void 0:R.kind)==="diff"?(R.paths.push(A.path),R.patch+=`
|
|
247
247
|
${A.patch}`):T.push({kind:"diff",paths:[A.path],patch:A.patch})}if(g.length===0)return d.jsx("p",{className:"muted",children:"No diff for this chapter."});const S=new Set(g.map(A=>A.path)),C=A=>a.filter(R=>A(R.path));return d.jsxs(d.Fragment,{children:[T.map(A=>{const R=new Set(A.paths);if(A.kind==="read"){const $=A.paths[0];return d.jsx(YN,{path:$,doc:m.get($),comments:C(U=>U===$),renderComment:r,readOnly:s,chatBusy:u,onAddLineComment:f,onAskAboutLine:h,onShowDiff:()=>v(U=>({...U,[$]:!1})),viewedState:y},`read:${$}`)}return d.jsx(GN,{patch:A.patch,comments:C($=>R.has($)),renderComment:r,readOnly:s,chatBusy:u,onAddLineComment:f,onAskAboutLine:h,onRead:$=>v(U=>({...U,[$]:!0})),viewedState:y},`diff:${A.paths[0]}`)}),C(A=>!S.has(A)).map(r)]})}function PN({check:i,raised:a,held:r,replies:s}){if(!i)return null;const u=[r>0&&`${r} left out`,s>0&&`${s} as replies`].filter(Boolean),f=a>0?d.jsxs("div",{className:"warn",title:"Findings another reviewer already raised on the PR — each card says who, and what Send does with it.",children:[a," already raised",u.length>0?` · ${u.join(" · ")}`:""]}):null;return i.checkingSince?d.jsxs(d.Fragment,{children:[f,d.jsx("div",{className:"faint",children:"checking what others already raised…"})]}):i.error?d.jsxs(d.Fragment,{children:[f,d.jsx("div",{className:"warn",title:i.error,children:"couldn't check what others already raised"})]}):f||(i.remarks.length>0?d.jsx("div",{className:"faint",children:"none already raised by others"}):null)}function KN({comment:i,readOnly:a,onDecide:r}){var y;const s=i.alreadyRaised;if(!s)return null;const u=kN(i,a),f=s.where.kind==="thread",h=!a&&i.status!=="dropped";return d.jsxs("div",{className:"raised",children:[d.jsxs("div",{className:"raised-head",children:[d.jsxs("span",{className:"tag tag-raised",children:[d.jsx(Xe,{name:"comment"}),"already raised by @",s.by," · ",ON(s)]}),s.url&&d.jsxs("a",{href:s.url,target:"_blank",rel:"noreferrer",className:"faint",children:["see it on GitHub ",d.jsx(Xe,{name:"external"})]}),d.jsx("span",{className:"grow"}),h&&d.jsxs(d.Fragment,{children:[f&&d.jsx("button",{className:`btn btn-sm${s.decision==="reply"?" btn-keep-on":""}`,title:"Send posts this as a reply in their thread instead of a new comment — for when it adds something",onClick:()=>r(s.decision==="reply"?null:"reply"),children:"reply in their thread"}),d.jsx("button",{className:`btn btn-sm${s.decision==="send"?" btn-keep-on":""}`,title:"Send posts it as a comment of its own all the same",onClick:()=>r(s.decision==="send"?null:"send"),children:"send anyway"})]})]}),d.jsxs("p",{className:"raised-reason",children:[s.reason,u&&d.jsxs("span",{className:"raised-fate",children:[" — ",(y=s.replied)!=null&&y.url?d.jsx("a",{href:s.replied.url,target:"_blank",rel:"noreferrer",children:u}):u,"."]})]})]})}function ky({comment:i,onUpdate:a,onDelete:r,onDiscuss:s,readOnly:u,flash:f}){const[h,y]=H.useState(!1),[g,m]=H.useState(i.body),b=i.status==="dropped",v=i.origin==="user"?"yours":b?"dropped":"drafted";return d.jsxs("div",{id:`c-${i.id}`,className:`comment comment-${i.status}${f?" comment-flash":""}`,children:[d.jsxs("div",{className:"comment-head",children:[d.jsxs("span",{className:"comment-loc",children:[i.path,i.line!=null?`:${i.line}`:""]}),d.jsx("span",{className:`tag tag-${i.origin==="user"?"yours":v}`,children:v}),i.drifted?d.jsx("span",{className:"tag tag-drift",title:"The code this comment pointed at is gone from the diff, so it can't post inline.",children:"drifted — posts in the body"}):i.line==null&&d.jsx("span",{className:"tag tag-drift",title:"A comment with no line — either about the file as a whole, or on a line the PR removed, which GitHub can't take inline.",children:"on the file — posts in the body"}),!i.drifted&&i.originalLine!=null&&i.originalLine!==i.line&&d.jsxs("span",{className:"faint",title:"This comment followed its code to a new line.",children:["was :",i.originalLine]}),d.jsx("span",{className:"grow"}),!u&&(h?d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"btn btn-sm",onClick:()=>{a({body:g}),y(!1)},children:"save"}),d.jsx("button",{className:"btn btn-sm",onClick:()=>{m(i.body),y(!1)},children:"cancel"})]}):d.jsxs(d.Fragment,{children:[d.jsxs("button",{className:"btn btn-sm",title:"Edit the wording",onClick:()=>y(!0),children:[d.jsx(Xe,{name:"edit"}),"edit"]}),d.jsxs("button",{className:`btn btn-sm${b?" btn-drop-on":""}`,title:"Drop it — stays local, never posts",onClick:()=>a({status:b?"draft":"dropped"}),children:[d.jsx(Xe,{name:"drop"}),b?"dropped":"drop"]}),s&&d.jsxs("button",{className:"btn btn-sm btn-accent",title:"Point the chat at this comment",onClick:s,children:[d.jsx(Xe,{name:"comment"}),"discuss"]}),i.origin==="user"&&d.jsx("button",{className:"btn btn-sm",title:"Delete the comment you wrote",onClick:r,children:"✕"})]}))]}),d.jsx(KN,{comment:i,readOnly:u,onDecide:_=>a({raisedDecision:_})}),h?d.jsxs(d.Fragment,{children:[d.jsx("textarea",{className:"comment-edit",value:g,onChange:_=>m(_.target.value),rows:Math.max(3,g.split(`
|
|
248
|
-
`).length)}),d.jsx(Ps,{className:"comment-body",text:fg(g,i.severity??null)})]}):d.jsx(ai,{className:"comment-body prose",text:fg(i.body,i.severity??null)})]})}function ZN({files:i,chapterId:a,onAdd:r}){const[s,u]=H.useState(!1),[f,h]=H.useState(i[0]??""),[y,g]=H.useState(""),[m,b]=H.useState("");return s?d.jsxs("div",{className:"add-comment",children:[d.jsxs("div",{className:"add-comment-row",children:[d.jsx("select",{value:f,onChange:v=>h(v.target.value),children:i.map(v=>d.jsx("option",{value:v,children:v},v))}),d.jsx("input",{placeholder:"line (optional)",value:y,onChange:v=>g(v.target.value.replace(/\D/g,"")),size:12})]}),d.jsx("textarea",{placeholder:"Your comment…",value:m,onChange:v=>b(v.target.value),rows:3}),d.jsx(Ps,{className:"comment-body",text:m}),d.jsxs("div",{className:"add-comment-row",children:[d.jsx("button",{className:"btn",disabled:!m.trim()||!f,onClick:()=>{r({path:f,line:y?Number(y):null,body:m.trim(),chapterId:a}),b(""),g(""),u(!1)},children:"add"}),d.jsx("button",{className:"btn",onClick:()=>u(!1),children:"cancel"})]})]}):d.jsxs("button",{className:"btn btn-dashed",onClick:()=>u(!0),children:[d.jsx(Xe,{name:"plus"}),"add a comment of your own"]})}const XN=2e3;function VN({chapter:i,n:a,diff:r,comments:s,open:u,heavy:f,onToggle:h,onUpdateComment:y,onDeleteComment:g,onAddComment:m,onDiscuss:b,onAskAboutLine:v,chatBusy:_,readOnly:T,anchorRef:S,flash:C,viewedState:A,sticky:R,stuck:$}){const[U,W]=H.useState(!1);H.useEffect(()=>{$||W(!1)},[$]);const z=R&&$&&u,ae=H.useRef(null),se=H.useRef(null);H.useEffect(()=>{const M=ae.current,Q=se.current;if(!R||!M||!Q)return;const pe=()=>M.style.setProperty("--chapter-head-h",`${Q.offsetHeight}px`);pe();const we=new ResizeObserver(pe);return we.observe(Q),()=>{we.disconnect(),M.style.removeProperty("--chapter-head-h")}},[R]);const x=()=>{h(),z&&requestAnimationFrame(()=>{var M;return(M=ae.current)==null?void 0:M.scrollIntoView({block:"start"})})},G=H.useMemo(()=>z_(r,i.files),[r,i.files]),ee=i.files.filter(M=>A.viewed.has(M)).length,ue=H.useMemo(()=>Ny(G,s),[G,s]),Ee=H.useMemo(()=>new Set(ja(G).map(M=>M.path)),[G]),j=s.filter(M=>!ue.includes(M)&&!Ee.has(M.path)),le=s.filter(M=>ue.includes(M)||Ee.has(M.path)),fe=M=>d.jsx(ky,{comment:M,onUpdate:Q=>y(M.id,Q),onDelete:()=>g(M.id),onDiscuss:b&&(()=>b({target:"comment",id:M.id})),readOnly:T,flash:C===M.id},M.id);return d.jsxs("section",{className:`chapter${R?" chapter-sticky":""}`,ref:M=>{ae.current=M,S(M)},children:[d.jsxs("header",{ref:se,className:`chapter-head${R?" chapter-head-sticky":""}${z?" chapter-head-stuck":""}`,onClick:x,children:[d.jsx("span",{className:"faint",children:u?"▾":"▸"}),d.jsxs("h3",{children:[a," · ",i.title]}),d.jsxs("span",{className:"faint chapter-meta",children:[i.files.length," file",i.files.length===1?"":"s",s.length>0?` · ${s.length} comment${s.length===1?"":"s"}`:" · no comments",ee>0&&` · ${ee}/${i.files.length} viewed`,f!=null&&!u&&d.jsx("span",{title:"Drawing this many lines at once would leave the page too slow to scroll. Open it if you want it — nothing else on the page is affected.",children:` · ${f.toLocaleString()} lines to draw, folded to keep the page quick`})]}),d.jsx("span",{className:"grow"}),R&&u&&d.jsx("button",{className:`btn btn-sm${z?"":" chapter-about-idle"}`,"aria-expanded":U,onClick:M=>{M.stopPropagation(),W(Q=>!Q)},children:U?"hide explanation":"what this chapter is about"}),b&&d.jsxs("button",{className:"btn btn-sm",onClick:M=>{M.stopPropagation(),b({target:"chapter",id:i.id})},children:[d.jsx(Xe,{name:"comment"}),"discuss"]}),z&&U&&d.jsx("div",{className:"chapter-head-about",onClick:M=>M.stopPropagation(),children:d.jsx(ai,{className:"prose",text:i.explanation})})]}),u&&d.jsxs("div",{className:"chapter-body",children:[d.jsx(ai,{className:"prose chapter-explanation",text:i.explanation}),j.map(fe),d.jsx(FN,{patch:G,comments:le,renderComment:fe,readOnly:T,chatBusy:_,onAddLineComment:(M,Q)=>m({path:M.path,line:M.side==="new"?M.line:null,body:Q,chapterId:i.id}),onAskAboutLine:v,viewedState:A}),!T&&i.files.length>0&&d.jsx(ZN,{files:i.files,chapterId:i.id,onAdd:m})]})]})}function QN(i,a){switch(i.kind){case"summary":return"rewrote the summary";case"verdict":return`changed the verdict to ${i.verdict.recommendation.replace("_"," ")}`;case"chapter":{const r=a.chapters.find(s=>s.id===i.chapterId);return`rewrote the "${(r==null?void 0:r.title)??i.chapterId}" chapter`}case"comment-edit":{const r=a.comments.find(s=>s.id===i.commentId);return r?`rewrote the comment on ${r.path}:${r.line??"file"}`:"rewrote a comment"}case"comment-drop":{const r=a.comments.find(s=>s.id===i.commentId);return r?`dropped the comment on ${r.path}:${r.line??"file"}`:"dropped a comment"}case"comment-add":return`added a comment on ${i.path}:${i.line??"file"}`}}function Fd(i,a){var s;if(i.target==="summary")return"the summary";if(i.target==="verdict")return"the verdict";if(i.target==="chapter")return((s=a.chapters.find(u=>u.id===i.id))==null?void 0:s.title)??"a chapter";if(i.target==="line")return i.path==null||i.line==null?"a line of the diff":`${i.path}:${i.line}${i.side==="old"?" (removed)":""}`;const r=a.comments.find(u=>u.id===i.id);return r?`${r.path}:${r.line??"file"}`:"a comment"}function WN({turn:i,artifact:a}){return d.jsxs("div",{className:`chat-turn chat-turn-${i.role}`,children:[d.jsx("div",{className:"chat-turn-who",children:i.role==="user"?i.steer?"You, while it worked":"You":"Reviewer"}),i.refs.length>0&&d.jsx("div",{className:"chat-refs",children:i.refs.map((r,s)=>d.jsx("span",{className:"chat-ref",children:Fd(r,a)},s))}),d.jsx(ai,{className:"chat-turn-body prose",text:i.body}),i.revisions.map((r,s)=>d.jsxs("div",{className:"chat-revision",children:["↳ ",QN(r,a)]},s)),i.refused.map((r,s)=>d.jsxs("div",{className:"chat-refusal",title:r.reason,children:["⃠ left alone — ",r.reason]},s))]})}function JN({artifact:i,reviewKey:a,refs:r,onClearRefs:s,onDropRef:u,onArtifact:f,readOnly:h,inputRef:y,anchorRef:g}){var Ee;const[m,b]=H.useState(""),[v,_]=H.useState(!1),[T,S]=H.useState(null),[C]=Ty(),A=i.chat??[],R=i.pendingChat??null,$=R!=null&&R.error==null,U=v||$,W=H.useRef(null),z=H.useRef(!0),ae=()=>{const j=W.current;j&&(j.scrollTop=j.scrollHeight)},se=R!=null;H.useLayoutEffect(()=>{z.current=!0,ae()},[a,A.length,se,(Ee=R==null?void 0:R.steers)==null?void 0:Ee.length,R==null?void 0:R.error]),H.useLayoutEffect(()=>{z.current&&ae()},[R==null?void 0:R.progress.length]);const x=A.length>0||se;H.useEffect(()=>{const j=W.current;if(!j)return;const le=new ResizeObserver(()=>z.current&&ae());return le.observe(j),()=>le.disconnect()},[x]);const G=(j,le,fe)=>{!j||U||(_(!0),S(null),Dd(a,{message:j,refs:le}).then(M=>{f(M),fe==null||fe()}).catch(M=>S(String(M.message??M))).finally(()=>_(!1)))},ee=j=>{_(!0),S(null),E0(a,j).then(le=>{var fe;f(le),b(""),(fe=y.current)==null||fe.focus()}).catch(le=>S(String(le.message??le))).finally(()=>_(!1))},ue=()=>{const j=m.trim();if(!(!j||v)){if($)return ee(j);G(j,r,()=>{var le;b(""),s(),(le=y.current)==null||le.focus()})}};return d.jsxs("section",{className:"card chat-panel",ref:g,children:[d.jsxs("header",{className:"card-head",children:[d.jsx("h2",{children:"talk to the reviewer"}),d.jsx("span",{className:"faint",children:"it revises the draft as you go · nothing here reaches GitHub — only send does"})]}),d.jsxs("div",{className:"card-body",children:[x&&d.jsxs("div",{className:"chat-log",ref:W,onScroll:j=>{const le=j.currentTarget;z.current=le.scrollHeight-le.scrollTop-le.clientHeight<24},children:[A.map(j=>d.jsx(WN,{turn:j,artifact:i},j.id)),R&&d.jsxs("div",{className:"chat-turn chat-turn-user chat-turn-pending",children:[d.jsx("div",{className:"chat-turn-who",children:"You"}),R.refs.length>0&&d.jsx("div",{className:"chat-refs",children:R.refs.map((j,le)=>d.jsx("span",{className:"chat-ref",children:Fd(j,i)},le))}),d.jsx(ai,{className:"chat-turn-body prose",text:R.message}),
|
|
248
|
+
`).length)}),d.jsx(Ps,{className:"comment-body",text:fg(g,i.severity??null)})]}):d.jsx(ai,{className:"comment-body prose",text:fg(i.body,i.severity??null)})]})}function ZN({files:i,chapterId:a,onAdd:r}){const[s,u]=H.useState(!1),[f,h]=H.useState(i[0]??""),[y,g]=H.useState(""),[m,b]=H.useState("");return s?d.jsxs("div",{className:"add-comment",children:[d.jsxs("div",{className:"add-comment-row",children:[d.jsx("select",{value:f,onChange:v=>h(v.target.value),children:i.map(v=>d.jsx("option",{value:v,children:v},v))}),d.jsx("input",{placeholder:"line (optional)",value:y,onChange:v=>g(v.target.value.replace(/\D/g,"")),size:12})]}),d.jsx("textarea",{placeholder:"Your comment…",value:m,onChange:v=>b(v.target.value),rows:3}),d.jsx(Ps,{className:"comment-body",text:m}),d.jsxs("div",{className:"add-comment-row",children:[d.jsx("button",{className:"btn",disabled:!m.trim()||!f,onClick:()=>{r({path:f,line:y?Number(y):null,body:m.trim(),chapterId:a}),b(""),g(""),u(!1)},children:"add"}),d.jsx("button",{className:"btn",onClick:()=>u(!1),children:"cancel"})]})]}):d.jsxs("button",{className:"btn btn-dashed",onClick:()=>u(!0),children:[d.jsx(Xe,{name:"plus"}),"add a comment of your own"]})}const XN=2e3;function VN({chapter:i,n:a,diff:r,comments:s,open:u,heavy:f,onToggle:h,onUpdateComment:y,onDeleteComment:g,onAddComment:m,onDiscuss:b,onAskAboutLine:v,chatBusy:_,readOnly:T,anchorRef:S,flash:C,viewedState:A,sticky:R,stuck:$}){const[U,W]=H.useState(!1);H.useEffect(()=>{$||W(!1)},[$]);const z=R&&$&&u,ae=H.useRef(null),se=H.useRef(null);H.useEffect(()=>{const M=ae.current,Q=se.current;if(!R||!M||!Q)return;const pe=()=>M.style.setProperty("--chapter-head-h",`${Q.offsetHeight}px`);pe();const we=new ResizeObserver(pe);return we.observe(Q),()=>{we.disconnect(),M.style.removeProperty("--chapter-head-h")}},[R]);const x=()=>{h(),z&&requestAnimationFrame(()=>{var M;return(M=ae.current)==null?void 0:M.scrollIntoView({block:"start"})})},G=H.useMemo(()=>z_(r,i.files),[r,i.files]),ee=i.files.filter(M=>A.viewed.has(M)).length,ue=H.useMemo(()=>Ny(G,s),[G,s]),Ee=H.useMemo(()=>new Set(ja(G).map(M=>M.path)),[G]),j=s.filter(M=>!ue.includes(M)&&!Ee.has(M.path)),le=s.filter(M=>ue.includes(M)||Ee.has(M.path)),fe=M=>d.jsx(ky,{comment:M,onUpdate:Q=>y(M.id,Q),onDelete:()=>g(M.id),onDiscuss:b&&(()=>b({target:"comment",id:M.id})),readOnly:T,flash:C===M.id},M.id);return d.jsxs("section",{className:`chapter${R?" chapter-sticky":""}`,ref:M=>{ae.current=M,S(M)},children:[d.jsxs("header",{ref:se,className:`chapter-head${R?" chapter-head-sticky":""}${z?" chapter-head-stuck":""}`,onClick:x,children:[d.jsx("span",{className:"faint",children:u?"▾":"▸"}),d.jsxs("h3",{children:[a," · ",i.title]}),d.jsxs("span",{className:"faint chapter-meta",children:[i.files.length," file",i.files.length===1?"":"s",s.length>0?` · ${s.length} comment${s.length===1?"":"s"}`:" · no comments",ee>0&&` · ${ee}/${i.files.length} viewed`,f!=null&&!u&&d.jsx("span",{title:"Drawing this many lines at once would leave the page too slow to scroll. Open it if you want it — nothing else on the page is affected.",children:` · ${f.toLocaleString()} lines to draw, folded to keep the page quick`})]}),d.jsx("span",{className:"grow"}),R&&u&&d.jsx("button",{className:`btn btn-sm${z?"":" chapter-about-idle"}`,"aria-expanded":U,onClick:M=>{M.stopPropagation(),W(Q=>!Q)},children:U?"hide explanation":"what this chapter is about"}),b&&d.jsxs("button",{className:"btn btn-sm",onClick:M=>{M.stopPropagation(),b({target:"chapter",id:i.id})},children:[d.jsx(Xe,{name:"comment"}),"discuss"]}),z&&U&&d.jsx("div",{className:"chapter-head-about",onClick:M=>M.stopPropagation(),children:d.jsx(ai,{className:"prose",text:i.explanation})})]}),u&&d.jsxs("div",{className:"chapter-body",children:[d.jsx(ai,{className:"prose chapter-explanation",text:i.explanation}),j.map(fe),d.jsx(FN,{patch:G,comments:le,renderComment:fe,readOnly:T,chatBusy:_,onAddLineComment:(M,Q)=>m({path:M.path,line:M.side==="new"?M.line:null,body:Q,chapterId:i.id}),onAskAboutLine:v,viewedState:A}),!T&&i.files.length>0&&d.jsx(ZN,{files:i.files,chapterId:i.id,onAdd:m})]})]})}function QN(i,a){switch(i.kind){case"summary":return"rewrote the summary";case"verdict":return`changed the verdict to ${i.verdict.recommendation.replace("_"," ")}`;case"chapter":{const r=a.chapters.find(s=>s.id===i.chapterId);return`rewrote the "${(r==null?void 0:r.title)??i.chapterId}" chapter`}case"comment-edit":{const r=a.comments.find(s=>s.id===i.commentId);return r?`rewrote the comment on ${r.path}:${r.line??"file"}`:"rewrote a comment"}case"comment-drop":{const r=a.comments.find(s=>s.id===i.commentId);return r?`dropped the comment on ${r.path}:${r.line??"file"}`:"dropped a comment"}case"comment-add":return`added a comment on ${i.path}:${i.line??"file"}`}}function Fd(i,a){var s;if(i.target==="summary")return"the summary";if(i.target==="verdict")return"the verdict";if(i.target==="chapter")return((s=a.chapters.find(u=>u.id===i.id))==null?void 0:s.title)??"a chapter";if(i.target==="line")return i.path==null||i.line==null?"a line of the diff":`${i.path}:${i.line}${i.side==="old"?" (removed)":""}`;const r=a.comments.find(u=>u.id===i.id);return r?`${r.path}:${r.line??"file"}`:"a comment"}function WN({turn:i,artifact:a}){return d.jsxs("div",{className:`chat-turn chat-turn-${i.role}`,children:[d.jsx("div",{className:"chat-turn-who",children:i.role==="user"?i.steer?"You, while it worked":"You":"Reviewer"}),i.refs.length>0&&d.jsx("div",{className:"chat-refs",children:i.refs.map((r,s)=>d.jsx("span",{className:"chat-ref",children:Fd(r,a)},s))}),d.jsx(ai,{className:"chat-turn-body prose",text:i.body}),i.revisions.map((r,s)=>d.jsxs("div",{className:"chat-revision",children:["↳ ",QN(r,a)]},s)),i.refused.map((r,s)=>d.jsxs("div",{className:"chat-refusal",title:r.reason,children:["⃠ left alone — ",r.reason]},s))]})}function JN({artifact:i,reviewKey:a,refs:r,onClearRefs:s,onDropRef:u,onArtifact:f,readOnly:h,inputRef:y,anchorRef:g}){var Ee;const[m,b]=H.useState(""),[v,_]=H.useState(!1),[T,S]=H.useState(null),[C]=Ty(),A=i.chat??[],R=i.pendingChat??null,$=R!=null&&R.error==null,U=v||$,W=H.useRef(null),z=H.useRef(!0),ae=()=>{const j=W.current;j&&(j.scrollTop=j.scrollHeight)},se=R!=null;H.useLayoutEffect(()=>{z.current=!0,ae()},[a,A.length,se,(Ee=R==null?void 0:R.steers)==null?void 0:Ee.length,R==null?void 0:R.error]),H.useLayoutEffect(()=>{z.current&&ae()},[R==null?void 0:R.progress.length]);const x=A.length>0||se;H.useEffect(()=>{const j=W.current;if(!j)return;const le=new ResizeObserver(()=>z.current&&ae());return le.observe(j),()=>le.disconnect()},[x]);const G=(j,le,fe)=>{!j||U||(_(!0),S(null),Dd(a,{message:j,refs:le}).then(M=>{f(M),fe==null||fe()}).catch(M=>S(String(M.message??M))).finally(()=>_(!1)))},ee=j=>{_(!0),S(null),E0(a,j).then(le=>{var fe;f(le),b(""),(fe=y.current)==null||fe.focus()}).catch(le=>S(String(le.message??le))).finally(()=>_(!1))},ue=()=>{const j=m.trim();if(!(!j||v)){if($)return ee(j);G(j,r,()=>{var le;b(""),s(),(le=y.current)==null||le.focus()})}};return d.jsxs("section",{className:"card chat-panel",ref:g,children:[d.jsxs("header",{className:"card-head",children:[d.jsx("h2",{children:"talk to the reviewer"}),d.jsx("span",{className:"faint",children:"it revises the draft as you go · nothing here reaches GitHub — only send does"})]}),d.jsxs("div",{className:"card-body",children:[x&&d.jsxs("div",{className:"chat-log",ref:W,onScroll:j=>{const le=j.currentTarget;z.current=le.scrollHeight-le.scrollTop-le.clientHeight<24},children:[A.map(j=>d.jsx(WN,{turn:j,artifact:i},j.id)),R&&d.jsxs("div",{className:"chat-turn chat-turn-user chat-turn-pending",children:[d.jsx("div",{className:"chat-turn-who",children:"You"}),R.refs.length>0&&d.jsx("div",{className:"chat-refs",children:R.refs.map((j,le)=>d.jsx("span",{className:"chat-ref",children:Fd(j,i)},le))}),d.jsx(ai,{className:"chat-turn-body prose",text:R.message}),[...R.steers??[],...R.queued??[]].map((j,le)=>d.jsxs("div",{className:"chat-steer",children:[d.jsx("div",{className:"chat-turn-who",children:"You, while it worked"}),d.jsx(ai,{className:"chat-turn-body prose",text:j})]},le)),R.error?d.jsxs("div",{className:"chat-failed",children:["✕ this turn didn't finish — ",R.error,!h&&d.jsxs(d.Fragment,{children:[" ",d.jsx("button",{className:"btn btn-sm",onClick:()=>G([R.message,...R.steers??[],...R.queued??[]].join(`
|
|
249
249
|
|
|
250
250
|
`),R.refs),children:"ask again"})," ",d.jsx("button",{className:"btn btn-sm",onClick:()=>_0(a).then(f).catch(j=>S(String(j.message??j))),children:"dismiss"})]})]}):d.jsx("div",{className:"chat-waiting",children:R.progress.length>0?d.jsx("ol",{className:"chat-progress",children:R.progress.map((j,le)=>d.jsx("li",{className:le===R.progress.length-1?"now":void 0,children:j},le))}):"Thinking… it re-reads the code before answering."})]})]}),h?d.jsx("p",{className:"faint",children:"This review was sent — the conversation is kept as a record, but it can't continue."}):d.jsxs(d.Fragment,{children:[r.length>0&&d.jsxs("div",{className:"chat-refs chat-refs-pending",children:[d.jsx("span",{className:"faint",children:"about:"}),r.map((j,le)=>d.jsxs("button",{className:"chat-ref",onClick:()=>u(le),title:"Remove",children:[Fd(j,i)," ✕"]},le))]}),d.jsx("textarea",{ref:y,className:"chat-input",rows:2,value:m,readOnly:v,placeholder:$?"steer it — it reads this before its next step":A.length===0?"the summary restates the author's claims — say what you actually verified":"say more…",onChange:j=>b(j.target.value),title:C==="enter"?"Enter sends · Shift+Enter for a new line":"⌘↵ sends · Enter for a new line",onKeyDown:j=>{zN(C,{...j,isComposing:j.nativeEvent.isComposing})&&(j.preventDefault(),ue())}}),d.jsx(Ps,{className:"chat-turn-body",text:m}),d.jsxs("div",{className:"chat-actions",children:[d.jsxs("button",{className:"btn btn-dark",onClick:ue,disabled:v||m.trim()==="",title:$?"Add this to the turn it's working on":void 0,children:[d.jsx(Xe,{name:"send"}),v?"sending…":$?"steer":"send message",d.jsx(za,{children:C==="enter"?"↵":"⌘↵"})]}),d.jsx("span",{className:"grow"}),i.preChat&&d.jsx("button",{className:"btn btn-sm",disabled:U,title:"Put the review back the way the AI first wrote it. The conversation stays.",onClick:()=>{_(!0),S0(a).then(f).catch(j=>S(String(j.message??j))).finally(()=>_(!1))},children:"reset the review"})]})]}),T&&d.jsx("div",{className:"error",children:T})]})]})}function Oy(i){const a=H.useRef(null),r=H.useCallback(()=>{const s=a.current;s&&(s.style.height="auto",s.style.height=`${Math.min(s.scrollHeight+2,window.innerHeight*.7)}px`)},[]);return H.useEffect(r,[i,r]),H.useEffect(()=>(window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)),[r]),a}function ex({initial:i,onSave:a,onCancel:r}){const[s,u]=H.useState(i),[f,h]=H.useState(!1),[y,g]=H.useState(null),m=Oy(s),b=()=>{f||(h(!0),g(null),a(s).catch(v=>{g(String((v==null?void 0:v.message)??v)),h(!1)}))};return d.jsxs("div",{className:"body-edit-wrap",children:[d.jsx("textarea",{ref:m,className:"body-edit",autoFocus:!0,value:s,onChange:v=>u(v.target.value),rows:10,onKeyDown:v=>{v.key==="Enter"&&(v.metaKey||v.ctrlKey)&&(v.preventDefault(),b()),v.key==="Escape"&&!f&&r()}}),d.jsx(Ps,{className:"body-md",text:s}),y&&d.jsx("p",{className:"error",children:y}),d.jsxs("div",{className:"card-actions",children:[d.jsxs("button",{className:"btn btn-sm",onClick:b,disabled:f,children:[f?"saving…":"save this body",d.jsx(za,{children:"⌘↵"})]}),d.jsx("button",{className:"btn btn-sm",onClick:r,disabled:f,children:"cancel"}),d.jsx("span",{className:"faint",children:"this is exactly what posts — the review above stays as it reads"})]})]})}const tx=i=>i?`@${i} — handing this review over to you.`:"";function nx({artifact:i,reviewKey:a,onConfirm:r,onCancel:s}){const[u]=H.useState(ly),[f,h]=H.useState(""),[y,g]=H.useState(""),[m,b]=H.useState(!1),[v,_]=H.useState(!1),[T,S]=H.useState(null),[C,A]=H.useState(null),[R,$]=H.useState(null),[U,W]=H.useState(!1),[z,ae]=H.useState(null),[se,x]=H.useState(null),[G,ee]=H.useState(!1),[ue,Ee]=H.useState(-1),j=Oy(y),le=H.useRef(null),fe=Ld(f),M=iy(fe),Q=i.summary!==""||i.comments.length>0,pe=!Ab(i)&&Q,we=Ab(i)&&i.sent==null&&Q,De=U?JSON.stringify([i.bodyOverride,i.summary,i.chapters.map(X=>[X.title,X.explanation]),i.comments.map(X=>{var be,xe;return[X.path,X.line,X.body,X.severity,X.status,X.drifted,(be=X.alreadyRaised)==null?void 0:be.decision,(xe=X.alreadyRaised)==null?void 0:xe.where]})]):"";H.useEffect(()=>{if(!U)return;let X=!1;return x(null),ae(null),ty(a,"COMMENT").then(be=>!X&&ae(be)).catch(be=>{X||(ae(null),x(String((be==null?void 0:be.message)??be)))}),()=>{X=!0}},[U,a,De]);const w=!U||z!=null;H.useEffect(()=>{var X;ue<0||(X=document.getElementById(`handoff-option-${ue}`))==null||X.scrollIntoView({block:"nearest"})},[ue]);const L=H.useMemo(()=>L0(C??[],u),[C,u]),I=H.useMemo(()=>z0(L,f),[L,f]);H.useEffect(()=>{let X=!1;return x0(a).then(be=>!X&&A(be.logins)).catch(be=>!X&&$(String((be==null?void 0:be.message)??be))),()=>{X=!0}},[a]);const oe=X=>{h(X),m||g(tx(Ld(X)))},me=X=>{oe(X),ee(!1),Ee(-1)};H.useLayoutEffect(()=>{var X;(X=le.current)==null||X.showModal()},[]);const ve=()=>{v||!M||!w||(_(!0),S(null),r(fe,y.trim(),U).catch(X=>{S(String((X==null?void 0:X.message)??X)),_(!1)}))};return d.jsx("dialog",{className:"handoff-dialog",ref:le,"aria-label":`Hand off ${i.id}`,onCancel:X=>{X.preventDefault(),v||s()},onClick:X=>{X.target===le.current&&!v&&s()},children:d.jsxs("div",{className:"handoff-body",children:[d.jsxs("div",{className:"send-top",children:[d.jsx("span",{className:"lab",children:"hand off"}),d.jsx("span",{className:"grow"}),d.jsx("span",{className:"faint",children:i.id})]}),d.jsxs("div",{className:"handoff-who",children:[d.jsx("span",{className:"handoff-at",children:"@"}),d.jsxs("div",{className:"handoff-combo",children:[d.jsx("input",{className:"handoff-login",autoFocus:!0,value:f,spellCheck:!1,placeholder:"github login",role:"combobox","aria-expanded":G&&I.length>0,"aria-controls":"handoff-options","aria-autocomplete":"list","aria-activedescendant":ue>=0?`handoff-option-${ue}`:void 0,onFocus:()=>ee(!0),onBlur:()=>ee(!1),onChange:X=>{oe(X.target.value),ee(!0),Ee(0)},onKeyDown:X=>{const be=G&&I.length>0;if(X.key==="ArrowDown"||X.key==="ArrowUp"){if(X.preventDefault(),!be)return ee(!0);const xe=X.key==="ArrowDown"?1:-1;Ee(Ge=>(Ge+xe+I.length)%I.length);return}if(X.key==="Enter"){const xe=be&&ue>=0?I[ue]:void 0;xe&&xe.login.toLowerCase()!==fe.toLowerCase()?me(xe.login):ve();return}X.key==="Escape"&&be&&(X.preventDefault(),ee(!1),Ee(-1))}}),G&&I.length>0&&d.jsx("ul",{className:"handoff-options",id:"handoff-options",role:"listbox",children:I.map((X,be)=>d.jsxs("li",{id:`handoff-option-${be}`,role:"option","aria-selected":be===ue,className:be===ue?"on":void 0,onMouseEnter:()=>Ee(be),onMouseDown:xe=>{xe.preventDefault(),me(X.login)},children:[d.jsxs("span",{className:"handoff-option-login",children:["@",X.login]}),X.recent&&d.jsx("span",{className:"faint",children:"handed to before"})]},X.login))})]})]}),R&&d.jsx("p",{className:"faint handoff-who-note",children:"cerber could not read who this repo takes reviews from — type the login instead."}),d.jsx("textarea",{ref:j,className:"body-edit",rows:2,value:y,onChange:X=>{b(!0),g(X.target.value)},onKeyDown:X=>{X.key==="Enter"&&(X.metaKey||X.ctrlKey)&&(X.preventDefault(),ve())}}),d.jsxs("div",{className:"body-source",children:[d.jsx("span",{className:"faint",children:y.trim()?"goes on the PR as a plain comment, not a review":"nothing will be posted — only the review request moves"}),y.trim()!==""&&d.jsx("button",{className:"link",onClick:()=>{b(!0),g("")},disabled:v,children:"post no note"})]}),we&&d.jsx("p",{className:"faint handoff-says",children:"You already reviewed this PR, so this draft can't ride along — a handoff that carried it would be your second review. Send it yourself if that is what you mean."}),pe&&d.jsxs("div",{className:"handoff-with-review",children:[d.jsxs("label",{children:[d.jsx("input",{type:"checkbox",checked:U,disabled:v,onChange:X=>W(X.target.checked)}),d.jsxs("span",{children:["also post the review — ",d.jsx("span",{className:"faint",children:$d(i)})]})]}),U&&d.jsxs(d.Fragment,{children:[d.jsxs("p",{className:"faint",children:["Posts as a ",d.jsx("strong",{children:"comment"}),", never an approval or a change request: you are handing over the verdict, so it is @",M?fe:"them","'s to make. The findings keep their grades."]}),se?d.jsxs("p",{className:"error",children:["cerber could not build the body this would post, so it will not post one:"," ",se]}):z?d.jsx("pre",{className:"body-preview",children:z.body}):d.jsx("p",{className:"faint",children:"building the body…"})]})]}),T&&d.jsx("p",{className:"error",children:T}),d.jsxs("p",{className:"faint handoff-says",children:[M?d.jsxs(d.Fragment,{children:["@",fe]}):"They"," will be asked for this review and you will be taken off it."," ",U?"This row goes under sent, with the review on the PR.":i.sent?"This row stays under sent.":"This row is filed under settled, and comes back if anybody asks you again."]}),d.jsxs("div",{className:"card-actions",children:[d.jsxs("button",{className:"btn btn-sm",onClick:ve,disabled:v||!M||!w,children:[d.jsx(Xe,{name:"arrowRight"}),v?"handing over…":M?`hand off to @${fe}`:"hand off",d.jsx(za,{children:"⌘↵"})]}),d.jsx("button",{className:"btn btn-sm",onClick:s,disabled:v,children:"cancel"})]})]})})}function ax({artifact:i,reviewKey:a,event:r,own:s,sending:u,checking:f,onSend:h,error:y,footer:g,next:m,onAdvance:b,onBody:v,anchorRef:_}){const[T,S]=H.useState(null),[C,A]=H.useState(null),[R,$]=H.useState(i.bodyOverride!=null),[U,W]=H.useState(!1),z=i.bodyOverride!=null,ae=i.priorSends??[];H.useEffect(()=>{z&&$(!0)},[z]);const se=R&&!U?JSON.stringify([i.bodyOverride,i.summary,i.chapters.map(x=>[x.title,x.explanation]),i.comments.map(x=>{var G,ee;return[x.path,x.line,x.body,x.severity,x.status,x.drifted,(G=x.alreadyRaised)==null?void 0:G.decision,(ee=x.alreadyRaised)==null?void 0:ee.where]})]):"";return H.useEffect(()=>{if(!R||U)return;let x=!1;return S(null),A(null),ty(a,r).then(G=>{x||(S(G),A(null))}).catch(G=>{x||A(String(G))}),()=>{x=!0}},[a,r,se,R,U]),i.sent?d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"sent-strip",ref:_,children:[d.jsxs("strong",{children:["✔ sent as ",Gd[i.sent.event]]}),d.jsxs("span",{className:"faint",children:[new Date(i.sent.at).toLocaleString()," · ",$d(i),i.sent.auto?" · auto-sent by the daemon":"",ae.length>0?` · review ${Rb(i)} on this PR`:""]}),d.jsx("span",{className:"grow"}),i.sent.url&&d.jsxs("a",{href:i.sent.url,target:"_blank",rel:"noreferrer",children:["view on GitHub ",d.jsx(Xe,{name:"external"})]}),d.jsxs("button",{className:"btn",onClick:b,children:[m?`next review: ${m.pr.repo}#${m.pr.number}`:"back to the queue",d.jsx(Xe,{name:"arrowRight"})]})]}),d.jsx("div",{className:"post-actions",children:g})]}):d.jsxs("div",{className:"send-panel",ref:_,children:[d.jsxs("div",{className:"send-top",children:[d.jsx("span",{className:"lab",children:"send to github"}),d.jsx("span",{className:"grow"}),d.jsx("span",{className:"faint",children:$d(i)}),d.jsxs("button",{className:"link",onClick:()=>$(!R),disabled:U,title:U?"save or cancel the body you are writing first":void 0,children:[d.jsx(Xe,{name:"eye"}),R?"hide what gets posted":"see what gets posted"]})]}),s&&wy(i.verdict)!=="COMMENT"&&d.jsx("p",{className:"send-note",children:"This is your own PR, and GitHub takes no approve or change request from its author — so it posts as a comment."}),ae.length>0&&d.jsxs("p",{className:"send-note",children:["This posts review ",Rb(i)+1," on this PR. What you sent before stays on GitHub — a new one sits beside it rather than replacing it."]}),d.jsx("div",{className:"send-action",children:d.jsxs("button",{className:`send-btn tone-bg-${AN[r]}`,disabled:u||f,onClick:h,children:[d.jsx(Xe,{name:r==="APPROVE"?"approve":r==="COMMENT"?"comment":"changes",size:15}),u?"sending…":f?"checking what others already raised…":`${Gd[r]} on ${i.id}`," ",d.jsx(za,{children:"s"})]})}),y&&d.jsx("p",{className:"error",children:y}),R&&d.jsxs(d.Fragment,{children:[C&&d.jsx("p",{className:"error",children:C}),T?U?d.jsx(ex,{initial:T.body,onSave:x=>v(x).then(()=>W(!1)),onCancel:()=>W(!1)}):d.jsxs(d.Fragment,{children:[d.jsx("pre",{className:"body-preview",children:T.body}),d.jsxs("div",{className:"body-source",children:[z?d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"faint",children:"you wrote this body — it no longer follows the summary or the comments"}),d.jsx("button",{className:"link",onClick:()=>v(null).catch(x=>A(String((x==null?void 0:x.message)??x))),children:"build it from the review again"})]}):d.jsx("span",{className:"faint",children:"built from the summary, the walkthrough and the folded comments"}),d.jsxs("button",{className:"link",onClick:()=>W(!0),children:[d.jsx(Xe,{name:"edit"}),z?"keep editing it":"write it yourself"]})]})]}):!C&&d.jsx("p",{className:"faint",children:"building the body…"})]}),d.jsx("div",{className:"send-footer",children:g})]})}function Mb({sends:i}){const a=i[i.length-1],r=i.length===1,s=f=>new Date(f).toLocaleDateString(),u=Gd[a.event];return d.jsxs("div",{children:[d.jsxs("strong",{children:["You already sent ",r?"a review":`${i.length} reviews`," on this PR",r?"":", the last"," on ",s(a.at),r?` — ${u}`:` as ${u}`,"."]})," ",a.url?d.jsx("a",{href:a.url,target:"_blank",rel:"noreferrer",children:r?"It is still on GitHub":"The last is still on GitHub"}):r?"It is still on GitHub":"The last is still on GitHub",", untouched by the draft below — a re-review replaces what cerber holds, never what was posted. Sending this one would be review ",i.length+1,"."]})}function ix({filed:i}){var s,u,f;const a=((s=i.review)==null?void 0:s.url)??((u=i.reply)==null?void 0:u.url)??null,r=h=>new Date(h).toLocaleDateString();return i.reason==="own-reply"&&i.reply?d.jsxs("div",{children:[d.jsxs("strong",{children:["You answered on this PR on ",r(i.reply.at),", and nobody has replied since."]})," ","So cerber filed this draft under settled: GitHub does not count a"," ",a?d.jsx("a",{href:a,target:"_blank",rel:"noreferrer",children:"comment"}):"comment"," ","as a review, but the PR is with its author either way. Nothing here was changed or sent — the draft is still yours to send."]}):i.reason==="request-withdrawn"?d.jsxs("div",{children:[d.jsx("strong",{children:"Nobody is asking for this review any more."})," The request that put this PR in the inbox was taken back on or before ",r(i.at),", and you had said nothing on the PR, so cerber filed the draft under settled rather than leaving it out for you. Nothing here was changed or sent — the draft is still yours to send."]}):d.jsxs("div",{children:[d.jsxs("strong",{children:["You reviewed this PR on GitHub on ",r(((f=i.review)==null?void 0:f.at)??i.at),"."]})," ","So cerber filed this draft under settled, GitHub having stopped asking you for a review and shown one of your own"," ",a?d.jsx("a",{href:a,target:"_blank",rel:"noreferrer",children:"already on the PR"}):"already on the PR",". Nothing here was changed or sent — the draft is still yours to send."]})}function lx({entries:i,open:a,onToggle:r,anchorRef:s}){const u=f=>{const h=new Date(f);return Number.isNaN(h.getTime())?f:`${h.toLocaleDateString(void 0,{month:"short",day:"2-digit"})} ${h.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`};return d.jsxs("section",{className:"card",ref:s,children:[d.jsxs("header",{className:"card-head",children:[d.jsx("h2",{children:"history"}),d.jsx("span",{className:"faint",children:i.length>0?`${i.length} entr${i.length===1?"y":"ies"} — what cerber did to this row, and when`:"nothing recorded"}),d.jsx("span",{className:"grow"}),d.jsxs("button",{className:"btn btn-sm","aria-expanded":a,onClick:r,children:[d.jsx(Xe,{name:a?"up":"down",size:12}),a?"hide":"show"]})]}),a&&d.jsx("div",{className:"card-body",children:i.length===0?d.jsx("div",{className:"faint",children:"This review predates cerber keeping a history — it starts at the next thing that happens to it."}):d.jsx("ol",{className:"history",children:i.map((f,h)=>({e:f,i:h})).reverse().map(({e:f,i:h})=>d.jsxs("li",{className:"history-row",title:f.at,children:[d.jsx("span",{className:"history-at",children:u(f.at)}),d.jsx("span",{className:"history-by",children:f.by}),d.jsx("span",{className:"history-what",children:f.what}),f.cause&&d.jsx("span",{className:"history-cause",children:f.cause})]},`${h}-${f.at}`))})})]})}function sx({handoff:i,sent:a,hasDraft:r}){const s=new Date(i.at).toLocaleDateString();return d.jsxs("div",{children:[d.jsxs("strong",{children:["You handed this to @",i.to," on ",s,"."]})," ","GitHub asks them for this review now",i.withdrewYours?" and no longer asks you":" — but cerber could not take your own request off, so it is asking both of you","."," ",i.note?i.note.url?d.jsxs(d.Fragment,{children:["A"," ",d.jsx("a",{href:i.note.url,target:"_blank",rel:"noreferrer",children:"note"})," ","on the PR says so."]}):d.jsx(d.Fragment,{children:"A note on the PR says so."}):d.jsx(d.Fragment,{children:"No note was posted — only the request moved."})," ",a?d.jsx(d.Fragment,{children:"Your review of it is on the PR — the draft below is what went."}):r?d.jsx(d.Fragment,{children:"The draft below was never sent. It is still yours to read, or to send."}):d.jsx(d.Fragment,{children:"Nothing was drafted here, and nothing was sent."})]})}function rx({artifact:i,freshness:a,rerunning:r,onRerun:s}){const u=i.status==="running",f=(a==null?void 0:a.prState)??i.pr.state,h=f==="CLOSED"||f==="MERGED",y=i.refresh,g=a!=null&&a.changed?y:null,m=!h&&RN(i,a)?i.sent:null;if(u)return d.jsxs("div",{className:"freshness",children:[(i.sent?[]:i.priorSends??[]).length>0&&d.jsx(Mb,{sends:i.priorSends??[]}),d.jsxs("div",{className:"freshness-running",children:[d.jsx("strong",{children:"Re-reviewing…"})," Claude is reading the current head. This page updates itself when the run lands — it takes a few minutes."]})]});const b=i.filed,v=i.handoff,_=i.sent?[]:i.priorSends??[];return!h&&!g&&!m&&!b&&!v&&_.length===0?null:d.jsxs("div",{className:"freshness",children:[_.length>0&&d.jsx(Mb,{sends:_}),v&&d.jsx(sx,{handoff:v,sent:i.sent,hasDraft:i.summary!==""||i.comments.length>0}),b&&d.jsx(ix,{filed:b}),h&&d.jsxs("div",{children:[d.jsxs("strong",{children:["This PR is ",f==="MERGED"?"merged":"closed","."]})," A review can still be sent, but nobody is waiting for it."]}),g&&d.jsxs("div",{children:[d.jsx("strong",{children:"The PR moved on since this review."})," Now at"," ",d.jsx("code",{children:g.toSha.slice(0,7)}),", reviewed at"," ",d.jsx("code",{children:g.fromSha.slice(0,7)}),"."," ",g.moved>0&&d.jsxs(d.Fragment,{children:[g.moved," comment(s) followed the code. "]}),g.drifted>0&&d.jsxs(d.Fragment,{children:[g.drifted," could not — the code they point at is gone, so they will post in the review body instead of inline."," "]}),"The summary and verdict still describe the commit that was reviewed.",!i.sent&&d.jsx("button",{className:"btn btn-sm",disabled:r,onClick:()=>s(),children:r?"starting…":"re-review at the new head"})]}),m&&d.jsxs("div",{children:[d.jsx("strong",{children:"The PR moved on since you sent this review."})," ",(a==null?void 0:a.headSha)&&i.pr.headSha&&d.jsxs(d.Fragment,{children:["Now at ",d.jsx("code",{children:a.headSha.slice(0,7)}),", sent at"," ",d.jsx("code",{children:i.pr.headSha.slice(0,7)}),"."," "]}),"What you sent stays exactly as it was posted — cerber never re-anchors a review that is already on GitHub. Answering the new commits means a new draft, which replaces this one here and leaves what was posted alone.",d.jsx("button",{className:"btn btn-sm",disabled:r,onClick:()=>s(),children:r?"starting…":"re-review at the new head"})]})]})}function ox({reviewKey:i}){var Wt,Gn,Xn,Vn,ut;const[a,r]=H.useState(null),[s,u]=H.useState(null),[f,h]=H.useState(null),[y,g]=H.useState(null),[m,b]=H.useState(!1),[v,_]=H.useState([]),[T,S]=H.useState(!1),[C,A]=H.useState(new Set),R=Y=>A(de=>new Set(de).add(Y)),[$,U]=H.useState(!1),[W,z]=H.useState([]),ae=H.useRef(null),[se,x]=H.useState(new Set),[G,ee]=H.useState(new Set),ue=H.useRef(Promise.resolve()),Ee=H.useRef(0),[j,le]=H.useState(0),fe=H.useRef(new Map),[M]=Sy(),[Q,pe]=H.useState(null),we=H.useRef(null),De=H.useRef(null),w=H.useRef(null),L=H.useRef(null),I=H.useRef(null),oe=H.useRef(null),[me,ve]=H.useState(!1),X=H.useRef(null),[be,xe]=H.useState(!1),[Ge,$e]=H.useState(!1),[Ce,St]=H.useState(null),[Ke,In]=H.useState(null);H.useEffect(()=>{if(!Ke)return;const Y=setTimeout(()=>In(null),1800);return()=>clearTimeout(Y)},[Ke]);const Je=Y=>{var de,Ne;z(F=>F.some(ge=>ge.target===Y.target&&ge.id===Y.id)?F:[...F,Y]),(de=ae.current)==null||de.scrollIntoView({behavior:"smooth",block:"center"}),(Ne=ae.current)==null||Ne.focus()};H.useEffect(()=>{let Y=!1;return window.scrollTo({top:0}),r(null),u(null),h(null),g(null),St(null),$e(!1),S(!1),mg(i).then(de=>{if(!Y)return r(de),S(de.own===!0),v0(i).then(Ne=>{Y||(h(Ne),Ne.changed&&r(Ne.artifact))}).catch(Ne=>!Y&&g(String(Ne.message??Ne))).then(()=>{if(!(Y||de.sent||de.status==="running"||de.comments.length===0))return $e(!0),N0(i).then(Ne=>!Y&&r(Ne)).catch(()=>{}).finally(()=>!Y&&$e(!1))})}).catch(de=>!Y&&u(String(de))),()=>{Y=!0}},[i]),H.useEffect(()=>{So().then(_).catch(()=>{})},[]),H.useEffect(()=>{const Y=X.current;if(!Y)return;const de=()=>document.documentElement.style.setProperty("--top-h",`${Y.offsetHeight}px`);de();const Ne=new ResizeObserver(de);return Ne.observe(Y),()=>{Ne.disconnect(),document.documentElement.style.removeProperty("--top-h")}},[a==null?void 0:a.id]);const Ln=(a==null?void 0:a.pendingChat)!=null&&a.pendingChat.error==null,Hn=H.useRef(null),It=((Wt=a==null?void 0:a.raisedCheck)==null?void 0:Wt.checkingSince)!=null||Ge;H.useEffect(()=>{if((a==null?void 0:a.status)!=="running"&&!Ln&&!It)return;const Y=setInterval(()=>{mg(i).then(de=>{var Ne;if(r(de),S(de.own===!0),de.status!=="running"){b(!1);const F=Hn.current;F!=null&&de.sent&&(((Ne=de.run)==null?void 0:Ne.startedAt)??"none")===F&&u("The re-review didn't start, so nothing here changed — the review you sent is untouched. The history below says why."),Hn.current=null}}).catch(()=>{})},3e3);return()=>clearInterval(Y)},[a==null?void 0:a.status,Ln,It,i]);const Rt=(a==null?void 0:a.sent)!=null,on=H.useMemo(()=>$_(v,i,C),[v,i,C]),yn=on.findIndex(Y=>Y.key===i),Ft=(yn>0?on[yn-1]:null)??null,je=(yn>=0&&yn<on.length-1?on[yn+1]:null)??null,Lt=Y=>{window.location.hash=`#/r/${encodeURIComponent(Y)}`},vt=()=>{je?Lt(je.key):window.location.hash="#/"},Ot=H.useMemo(()=>{if(!a)return[];const Y=I_(a.diff,a.chapters);return Y.length>0?[...a.chapters,{id:"__other",title:"other changes",explanation:"Files not assigned to any chapter by the AI.",files:Y}]:a.chapters},[a]);H.useEffect(()=>{let Y=0;const de=()=>{var dt;Y=0;const ge=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--top-h"))||0,Ie=ge+16;let Fe=null;for(const gt of Ot){const Bt=(dt=fe.current.get(gt.id))==null?void 0:dt.getBoundingClientRect();Bt&&Bt.top<=Ie&&Bt.bottom>Ie&&(Fe={id:gt.id,stuck:Bt.top<ge-1})}pe(gt=>(gt==null?void 0:gt.id)===(Fe==null?void 0:Fe.id)&&(gt==null?void 0:gt.stuck)===(Fe==null?void 0:Fe.stuck)?gt:Fe)},Ne=()=>{Y||(Y=requestAnimationFrame(de))};de(),window.addEventListener("scroll",Ne,{passive:!0}),window.addEventListener("resize",Ne);const F=new ResizeObserver(Ne);return F.observe(document.body),()=>{cancelAnimationFrame(Y),window.removeEventListener("scroll",Ne),window.removeEventListener("resize",Ne),F.disconnect()}},[Ot]);const Tn=H.useMemo(()=>{const Y=H_((a==null?void 0:a.diff)??""),de=new Set(ja((a==null?void 0:a.diff)??"").filter(F=>pf(F.path)&&mf(F.patch).isNew).map(F=>F.path)),Ne=F=>{const ge=Y.get(F)??0;return de.has(F)?Math.round(ge/4):ge};return new Map(Ot.map(F=>[F.id,F.files.reduce((ge,Ie)=>ge+Ne(Ie),0)]))},[a==null?void 0:a.diff,Ot]),zn=Y=>{const de=Tn.get(Y)??0;return de>XN?de:null},An=Y=>se.has(Y)?zn(Y)!=null:zn(Y)==null,jn=Y=>x(de=>{const Ne=new Set(de);return Ne.has(Y)?Ne.delete(Y):Ne.add(Y),Ne});H.useEffect(()=>{x(new Set),ee(new Set)},[i]);const Rn=H.useMemo(()=>Object.fromEntries(ja((a==null?void 0:a.diff)??"").map(Y=>[Y.path,q_(Y.patch)])),[a==null?void 0:a.diff]),cn=H.useMemo(()=>new Set(Object.keys(Rn).filter(Y=>{var de;return((de=a==null?void 0:a.viewed)==null?void 0:de[Y])===Rn[Y]})),[Rn,a==null?void 0:a.viewed]),qt={viewed:cn,peeked:G,onToggleViewed:Y=>{const de=cn.has(Y)?null:Rn[Y]??null;ee(F=>{const ge=new Set(F);return ge.delete(Y),ge}),r(F=>{if(!F)return F;const ge={...F.viewed};return de===null?delete ge[Y]:ge[Y]=de,{...F,viewed:ge}});const Ne=++Ee.current;ue.current=ue.current.then(()=>p0(i,Y,de)).then(F=>{Ne===Ee.current&&r(ge=>ge&&ge.id===F.id?{...ge,viewed:F.viewed}:ge)}).catch(F=>u(String(F)))},onTogglePeek:Y=>ee(de=>{const Ne=new Set(de);return Ne.has(Y)?Ne.delete(Y):Ne.add(Y),Ne})},la=Y=>{const de=Ot[Y];return de?(le(Y),An(de.id)||jn(de.id),de):null},un=(...Y)=>{for(const de of Y)if(de.current)return de.current.scrollIntoView({behavior:"smooth",block:"start"})},hn=Y=>{var Ne;const de=la(Y);de&&((Ne=fe.current.get(de.id))==null||Ne.scrollIntoView({behavior:"smooth",block:"start"}))},qe=(Y,de)=>{var F;la(Y);const Ne=(F=a==null?void 0:a.comments.find(ge=>ge.id===de))==null?void 0:F.path;Ne&&cn.has(Ne)&&ee(ge=>new Set(ge).add(Ne)),In(de),Ay(de)},pn=T,Pt=wy(a==null?void 0:a.verdict,pn);H.useEffect(()=>St(null),[Pt]);const Gt=()=>{!a||a.sent||be||It||(xe(!0),St(null),w0(i,Pt).then(({replyError:Y,...de})=>{r(de),Y&&St(`Sent — but ${Y}`),R(i)}).catch(Y=>St(String(Y.message??Y))).finally(()=>xe(!1)))};if(H.useEffect(()=>{const Y=de=>{HN(de.target)||de.metaKey||de.ctrlKey||de.altKey||(de.key==="["&&Ft?Lt(Ft.key):de.key==="]"&&je?Lt(je.key):de.key==="n"?hn(Math.min(Ot.length-1,j+1)):de.key==="N"?hn(Math.max(0,j-1)):de.key==="s"&&!Rt&&Gt())};return window.addEventListener("keydown",Y),()=>window.removeEventListener("keydown",Y)},[Ft==null?void 0:Ft.key,je==null?void 0:je.key,Ot,j,Rt,Pt,a==null?void 0:a.sent,be,It]),s&&!a)return d.jsx("p",{className:"error pad",children:s});if(!a)return d.jsx("p",{className:"muted pad",children:"Loading…"});const k=Y=>{var de;b(!0),u(null),Hn.current=a.sent?((de=a.run)==null?void 0:de.startedAt)??"none":null,ey(i,Y).then(r).catch(Ne=>{u(String(Ne)),b(!1)})},te=Y=>Y.then(r).catch(de=>u(String(de))),ye=Y=>ro(i,{status:Y}).then(()=>{R(i),vt()}).catch(de=>u(String(de))),ze=(Y,de,Ne)=>T0(i,{to:Y,note:de,postReview:Ne}).then(({artifact:F,noteError:ge,sendError:Ie,replyError:Fe})=>{D0(Y),r(F),U(!1),R(i);const dt=[Ie&&`the review did not post: ${Ie}`,Fe,ge&&`the note did not post: ${ge}`].filter(Boolean);dt.length>0?u(`Handed to @${Y}, but ${dt.join("; and ")}`):vt()}),Qe=(Y,de)=>te(m0(i,Y,de)),et=Y=>te(b0(i,Y)),Ae=Y=>te(g0(i,Y)),Se=a.comments.filter(Y=>!Y.chapterId||!Ot.some(de=>de.id===Y.chapterId)),{inline:Ue,folded:Ct,dropped:mt,held:qn,replies:sa}=xy(a),Na=a.comments.filter(Y=>Y.alreadyRaised&&Y.status!=="dropped").length,dn=a.comments.filter(Y=>Y.status!=="dropped"&&Y.drifted).length,wt=a.verdict?kb[a.verdict.recommendation]:"none",Kt=MN(a),tt=CN(a),vn=a.pendingChat!=null&&a.pendingChat.error==null,Ua=a.status==="running"||vn,ba=()=>te(Dd(i,{message:"Some findings were dropped, edited or re-graded after this review was drafted. Update the summary and verdict to match what still stands — do not re-review the whole PR.",refs:[{target:"verdict",id:null}]})),xa=(Y,de)=>{te(Dd(i,{message:de,refs:[{target:"line",id:null,path:Y.path,line:Y.line,side:Y.side}]}).then(Ne=>{var F;return(F=L.current)==null||F.scrollIntoView({behavior:"smooth",block:"start"}),Ne}))},ra=(Gn=a.run)!=null&&Gn.trusted?"ran the code":(Xn=a.run)!=null&&Xn.withSource?"read the full source":a.run?"read the diff only":"no run yet",Ta=Y=>{var de;return d.jsxs("button",{className:`verdict-pick${((de=a.verdict)==null?void 0:de.recommendation)===Y?` verdict-pick-on tone-${kb[Y]}`:""}`,title:Y==="approve"?"Approve":Y==="comment"?"Comment without blocking":"Request changes",onClick:()=>te(ro(i,{verdictRecommendation:Y})),children:[d.jsx(Xe,{name:BN[Y]}),Y.replace("_"," ")]},Y)};return d.jsxs("div",{className:"review",children:[d.jsxs("div",{className:"review-top",ref:X,children:[d.jsx("div",{className:"crumb",children:d.jsxs("div",{className:"bar-inner",children:[d.jsx("a",{href:"#/",children:"← queue"}),d.jsx("span",{className:"crumb-sep",children:"/"}),d.jsx("span",{className:"crumb-slug",children:a.id}),d.jsxs("span",{className:"walk",children:[d.jsx("button",{className:"walk-btn",disabled:!Ft,title:Ft?`[ — ${Ft.id}: ${Ft.pr.title}`:"no more reviews this way",onClick:()=>Ft&&Lt(Ft.key),children:d.jsx(Xe,{name:"chevronLeft"})}),d.jsx("button",{className:"walk-btn",disabled:!je,title:je?`] — ${je.id}: ${je.pr.title}`:"no more reviews this way",onClick:()=>je&&Lt(je.key),children:d.jsx(Xe,{name:"chevronRight"})})]}),yn>=0&&d.jsxs("span",{className:"faint",children:[yn+1," of ",on.length," awaiting"]}),d.jsx("span",{className:"faint crumb-next",children:je?`next: ${je.pr.title}`:yn>=0?"last in the queue":""}),d.jsx("span",{className:"grow"}),d.jsx("a",{href:"#/settings",className:"topbar-link",title:"settings","aria-label":"settings",children:d.jsx(Xe,{name:"settings",size:15})})]})}),d.jsx("div",{className:"review-head",children:d.jsxs("div",{className:"wrap",children:[d.jsxs("div",{className:"review-head-top",children:[d.jsx("a",{className:"review-title",href:a.pr.url,target:"_blank",rel:"noreferrer",children:a.pr.title}),d.jsx("span",{className:"grow"}),a.verdict&&(Rt?d.jsxs("span",{className:`chip tone-${wt}`,children:[a.verdict.recommendation.replace("_"," "),tt&&` · ${tt}`," · ",a.verdict.confidence,"%"]}):d.jsxs("button",{className:`chip chip-btn tone-${wt}`,title:"change it, or send — both are at the foot of the page",onClick:()=>un(we,I),children:[a.verdict.recommendation.replace("_"," "),tt&&` · ${tt}`," · ",a.verdict.confidence,"%",d.jsx(Xe,{name:"down",size:12})]})),a.status!=="running"&&d.jsxs("button",{className:"btn btn-sm",disabled:m,title:Rt?"Draft a new review at the current head. What you sent stays on GitHub — this replaces the draft here, and sending again posts a second review":a.run?"Review the current head again — this draft is replaced, comments and all":"Draft a review of this PR",onClick:()=>k(!0),children:[d.jsx(Xe,{name:"rerun"}),m?"starting…":a.run?"re-review at head":"review now"]})]}),d.jsxs("div",{className:"review-head-meta",children:[d.jsx("span",{children:a.pr.author}),d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsxs("span",{children:[a.pr.headRefName," → ",a.pr.baseRefName,a.pr.headSha?` · ${a.pr.headSha.slice(0,7)}`:""]}),d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsxs("span",{children:[a.pr.changedFiles,"f ",d.jsxs("span",{className:"add",children:["+",a.pr.additions]})," ",d.jsxs("span",{className:"del",children:["−",a.pr.deletions]})]}),d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsx("span",{title:"Whether the run read a local checkout of the PR head, or the diff alone.",children:ra}),((Vn=a.run)==null?void 0:Vn.costUsd)!=null&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsxs("span",{title:"What this review would cost at API token rates. Riding a Claude subscription, it draws on your usage limits instead.",children:["≈$",a.run.costUsd.toFixed(2)," at API rates"]})]}),d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsx("span",{title:"Where this review has got to: drafted, settled locally, or sent.",children:a.status})]})]})})]}),d.jsxs("div",{className:"wrap review-body",children:[d.jsxs("aside",{className:"rail",children:[d.jsxs("div",{className:"rail-jumps",children:[d.jsx("button",{className:"lab rail-lab-btn",onClick:()=>un(De),children:"summary"}),a.verdict&&d.jsx("button",{className:"lab rail-lab-btn",onClick:()=>un(w),children:"why"}),d.jsx("button",{className:"lab rail-lab-btn",onClick:()=>{var Y;un(L),(Y=ae.current)==null||Y.focus()},children:"chat"}),d.jsx("button",{className:"lab rail-lab-btn",onClick:()=>{ve(!0),un(oe)},children:"history"})]}),Ot.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("button",{className:"lab rail-lab rail-lab-btn",onClick:()=>hn(0),children:"changes"}),Ot.map((Y,de)=>{const Ne=Y.files.length>0&&Y.files.every(F=>cn.has(F));return d.jsxs("div",{className:"rail-group",children:[d.jsxs("button",{className:`rail-item${An(Y.id)?" rail-item-on":""}${Ne?" rail-item-done":""}${(Q==null?void 0:Q.id)===Y.id?" rail-item-here":""}`,onClick:()=>hn(de),children:[d.jsxs("span",{className:"grow",children:[de+1," · ",Y.title]}),d.jsxs("span",{className:"rail-count",title:Ne?"every file viewed":void 0,children:[Ne?"✓ ":"",Y.files.length,"f"]})]}),a.comments.filter(F=>F.chapterId===Y.id).map(F=>d.jsxs("button",{className:`rail-comment${F.status==="dropped"?" rail-comment-dropped":""}`,title:`${F.path}${F.line!=null?`:${F.line}`:""} — ${F.body}`,onClick:()=>qe(de,F.id),children:[d.jsx("span",{className:`rail-dot tone-${IN(F,wt)}`,children:"●"}),d.jsxs("span",{className:"rail-comment-loc",children:[F.path.split("/").pop(),F.line!=null?`:${F.drifted?"~":""}${F.line}`:""]})]},F.id))]},Y.id)})]}),d.jsx("button",{className:`lab rail-lab-btn${Ot.length>0?" rail-lab":""}`,onClick:()=>un(we,I),children:"verdict"}),d.jsxs("div",{className:"rail-facts",children:[d.jsxs("div",{children:[a.comments.length-mt.length," keeping · ",mt.length," dropped"]}),d.jsxs("div",{children:[Ue.length," inline · ",Ct.length," folded into body"]}),dn>0&&d.jsxs("div",{className:"warn",title:"The code these comments pointed at is gone from the diff.",children:[dn," drifted"]}),d.jsx(PN,{check:a.raisedCheck??null,raised:Na,held:qn.length,replies:sa.length})]})]}),d.jsxs("div",{className:"main",children:[d.jsx(rx,{artifact:a,freshness:f,rerunning:m,onRerun:k}),y&&d.jsxs("div",{className:"freshness",title:y,children:[d.jsx("strong",{children:"Couldn't check GitHub for newer commits."})," This is the review as it was drafted — if the PR has moved on since, nothing here knows it yet."]}),s&&d.jsx("div",{className:"error",children:s}),((ut=a.run)==null?void 0:ut.error)&&d.jsxs("div",{className:"error",children:["Run failed: ",a.run.error]}),d.jsx("div",{className:"card card-summary",ref:De,children:d.jsxs("div",{className:"card-body",children:[d.jsx("div",{className:"lab",children:"summary"}),d.jsx(ai,{className:"prose lead",text:a.summary||"(no summary)"}),!Rt&&d.jsxs("button",{className:"btn btn-sm",onClick:()=>Je({target:"summary",id:null}),children:[d.jsx(Xe,{name:"comment"}),"discuss the summary"]})]})}),a.verdict&&d.jsx("div",{className:`card card-why tone-border-${wt}`,ref:w,children:d.jsxs("div",{className:"card-body",children:[d.jsx("div",{className:"lab",children:"why"}),d.jsxs("div",{className:"sev-counts",children:[Rd(a)&&d.jsx("span",{title:"Live findings by grade. Only blockers block.",children:Rd(a)}),Rd(a)&&d.jsx("span",{className:"crumb-sep",children:"·"}),d.jsxs("span",{title:"How sure the review is that its own findings and grades are right — not how good an idea merging is. That is the verdict, and it follows from the blockers.",children:[a.verdict.confidence,"% sure of the findings"]})]}),d.jsx(ai,{className:"prose lead",text:a.verdict.reasoning}),!Rt&&d.jsxs("button",{className:"btn btn-sm",onClick:()=>Je({target:"verdict",id:null}),children:[d.jsx(Xe,{name:"comment"}),"discuss the verdict"]})]})}),Ot.map((Y,de)=>d.jsx(VN,{chapter:Y,n:de+1,diff:a.diff,comments:a.comments.filter(Ne=>Ne.chapterId===Y.id),open:An(Y.id),heavy:zn(Y.id),onToggle:()=>jn(Y.id),onUpdateComment:Qe,onDeleteComment:et,onAddComment:Ae,onDiscuss:Rt?void 0:Je,onAskAboutLine:xa,chatBusy:vn,readOnly:Rt,flash:Ke,viewedState:qt,sticky:M,stuck:(Q==null?void 0:Q.id)===Y.id&&Q.stuck,anchorRef:Ne=>{Ne?fe.current.set(Y.id,Ne):fe.current.delete(Y.id)}},Y.id)),Se.length>0&&d.jsxs("section",{className:"card",children:[d.jsxs("header",{className:"card-head",children:[d.jsx("h2",{children:"unattached comments"}),d.jsx("span",{className:"faint",children:"not part of any chapter — they post in the body"})]}),d.jsx("div",{className:"card-body",children:Se.map(Y=>d.jsx(ky,{comment:Y,onUpdate:de=>Qe(Y.id,de),onDelete:()=>et(Y.id),onDiscuss:Rt?void 0:()=>Je({target:"comment",id:Y.id}),readOnly:Rt},Y.id))})]}),d.jsx(lx,{entries:a.history??[],open:me,onToggle:()=>ve(Y=>!Y),anchorRef:oe})]}),d.jsxs("aside",{className:"cockpit",children:[d.jsx(JN,{artifact:a,reviewKey:i,refs:W,onClearRefs:()=>z([]),onDropRef:Y=>z(de=>de.filter((Ne,F)=>F!==Y)),onArtifact:r,readOnly:Rt,inputRef:ae,anchorRef:L}),d.jsxs("div",{className:"cockpit-decide",children:[!Rt&&Kt&&d.jsxs("div",{className:"verdict-hint",children:[d.jsxs("span",{children:[d.jsx("strong",{children:Kt})," — the verdict was written before those edits."]}),d.jsxs("button",{className:"btn btn-sm",onClick:ba,disabled:vn,children:[d.jsx(Xe,{name:"comment"}),vn?"the reviewer is busy…":"ask the reviewer to re-true it"]})]}),a.verdict&&!Rt&&d.jsxs("div",{className:"verdict-bar",ref:we,children:[d.jsx("span",{className:"lab",children:"verdict"}),["approve","comment","request_changes"].map(Ta)]}),d.jsx(ax,{artifact:a,reviewKey:i,event:Pt,own:pn,sending:be,checking:It,onSend:Gt,error:Ce,next:je,onAdvance:vt,onBody:Y=>ro(i,{bodyOverride:Y}).then(r),anchorRef:I,footer:d.jsxs(d.Fragment,{children:[!Rt&&d.jsx("span",{className:"faint",children:"not sending?"}),!Rt&&d.jsxs(d.Fragment,{children:[d.jsxs("button",{className:"btn btn-sm",title:je?`Settle it locally and go to ${je.id}`:"Settle it locally and go back to the queue",onClick:()=>ye("reviewed"),children:[d.jsx(Xe,{name:"check"}),"mark reviewed"]}),d.jsxs("button",{className:"btn btn-sm",title:je?`Leave it and go to ${je.id}`:"Leave it and go back to the queue",onClick:()=>ye("skipped"),children:[d.jsx(Xe,{name:"skip"}),"skip"]})]}),d.jsxs("button",{className:"btn btn-sm",title:Ua?"Wait for the run to finish — a handoff settles the row it is rewriting":"Move GitHub's review request to somebody else, and settle this row",onClick:()=>U(!0),disabled:$||Ua,children:[d.jsx(Xe,{name:"arrowRight"}),"hand off"]}),d.jsxs("a",{className:"btn btn-sm",href:A0(i),children:[d.jsx(Xe,{name:"download"}),"export .md"]})]})}),$&&d.jsx(nx,{artifact:a,reviewKey:i,onConfirm:ze,onCancel:()=>U(!1)})]})]})]})]})}const Db="cerber.notify.seen.v2",cx="cerber.notify.seen",Pd="cerber.notify",ux=1e4,qs=i=>i.status==="ready",Kd=i=>{try{return localStorage.getItem(i)}catch{return null}},Zd=(i,a)=>{try{localStorage.setItem(i,a)}catch{}},dx={autoReview:!1,autoReviewRepos:{}};function fx(i,a){return i?!i.enabled||!i.pollEnabled?dx:{autoReview:i.autoReview,autoReviewRepos:i.autoReviewRepos??{}}:a}const Cy=(i,a)=>hx(i,Xb(a,i.pr.owner,i.pr.repo));function hx(i,a){return i.announceable===!1||i.status==="running"?!1:i.status==="awaiting"?!a:!0}const My=":draft",co=i=>`${i.key}${My}`,Dy=i=>qs(i)?co(i):i.key;function px(i,a,r){const s=new Set(a);return $s(i).filter(u=>Cy(u,r)&&!s.has(Dy(u)))}function mx(i,a,r=[]){const s=new Set(r),u=new Set($s(i).map(h=>h.key)),f=[];for(const h of i){if(u.has(h.key)&&!Cy(h,a)){for(const y of[h.key,co(h)])s.has(y)&&f.push(y);continue}f.push(h.key),(qs(h)||!u.has(h.key)||s.has(co(h)))&&f.push(co(h))}return f}const kd=i=>`${i.pr.repo}#${i.pr.number}`,gx={approve:"approves",comment:"comments",request_changes:"requests changes"};function bx(i){const a=i.verdict?gx[i.verdict.recommendation]:"drafted",r=i.blockerCount??0;return r===0?a:`${a} · ${r} blocker${r===1?"":"s"}`}function yx(i){if(i.length===0)return null;const a=`cerber:${i.map(Dy).sort().join("|")}`;if(i.length===1){const u=i[0];return{title:qs(u)?`${kd(u)} draft ready`:`${kd(u)} awaits your review`,body:qs(u)?`${bx(u)} — ${u.pr.title}`:`${u.pr.title} — ${u.pr.author}`,tag:a,key:u.key}}const r=i.slice(0,3).map(kd),s=i.length-r.length;return{title:i.every(qs)?`${i.length} drafts ready`:`${i.length} PRs await your review`,body:s>0?`${r.join(", ")} and ${s} more`:r.join(", "),tag:a,key:null}}const vx=new Set(["127.0.0.1","localhost","::1","[::1]"]);function Ex(i,a=window.location.hostname){return!(i!=null&&i.enabled)||!i.notify?!1:vx.has(a)}function Gl(){return typeof Notification>"u"?"unsupported":Notification.permission==="denied"?"blocked":Kd(Pd)==="off"?"off":Notification.permission==="granted"?"on":"ask"}async function _x(){const i=Gl();if(i==="unsupported"||i==="blocked")return i;if(i==="on")return Zd(Pd,"off"),Gl();if(Zd(Pd,"on"),Notification.permission==="default")try{await Notification.requestPermission()}catch{}return Gl()}function Sx(i){const a=new Notification(i.title,{body:i.body,tag:i.tag,icon:"/favicon.svg"});a.onclick=()=>{window.focus(),window.location.hash=i.key?`#/r/${encodeURIComponent(i.key)}`:"#/",a.close()}}function wx(i,a){const r=i??a;if(!r)return null;let s;try{s=JSON.parse(r)}catch{return null}if(!Array.isArray(s))return null;const u=s.filter(f=>typeof f=="string");return i?u:u.flatMap(f=>[f,`${f}${My}`])}function Nx(){const i=H.useRef(null),a=H.useRef({autoReview:!0,autoReviewRepos:{}}),[r,s]=H.useState(!1);return H.useEffect(()=>{let u=!0;i.current=wx(Kd(Db),Kd(cx));const f=()=>Promise.all([So(),nf().catch(()=>null)]).then(([y,g])=>{if(!u)return;const m=Ex(g);s(m),a.current=fx(g,a.current);const b=i.current;if(i.current=mx(y,a.current,b??[]),Zd(Db,JSON.stringify(i.current)),!b||Gl()!=="on"||m||document.visibilityState==="visible"&&document.hasFocus())return;const v=yx(px(y,b,a.current));v&&Sx(v)}).catch(()=>{});f();const h=setInterval(f,ux);return()=>{u=!1,clearInterval(h)}},[]),r}function Ly(){const[i,a]=H.useState(Gl);return H.useEffect(()=>{const r=()=>a(Gl());return window.addEventListener("focus",r),()=>window.removeEventListener("focus",r)},[]),[i,()=>void _x().then(a)]}const uo=i=>{window.location.hash=`#/r/${encodeURIComponent(i)}`};function xx(i){const a=i,r=a==null?void 0:a.tagName;return r==="INPUT"||r==="TEXTAREA"||r==="SELECT"||(a==null?void 0:a.isContentEditable)===!0}function Tx({daemon:i}){return i!=null&&i.enabled?d.jsx("div",{className:"daemon-bar",children:d.jsxs("div",{className:"bar-inner",children:[i.pollEnabled?d.jsxs("span",{className:"daemon-live",children:[d.jsx("span",{className:"dot"}),i.repos.length>0?i.repos.join(", "):"PRs awaiting you"," · every"," ",Math.round(i.intervalMs/6e4),"m"]}):d.jsxs("span",{className:"daemon-live",children:[d.jsx("span",{className:"dot dot-off"}),"polling off (settings) — local reviews only"]}),d.jsxs("span",{children:["auto-review ",d.jsx("b",{children:i.autoReview?"on":"off"}),r0(i.autoReview,i.autoReviewRepos??{})]}),d.jsxs("span",{children:["auto-send ",d.jsx("b",{children:i.autoSend==="on"?"on":"shadow"})," ≥",i.autoSendThreshold,"%",i.autoSend==="on"?` · ${i.autoSent} sent`:` · ${i.autoSendCandidates} candidate${i.autoSendCandidates===1?"":"s"}`]}),i.trustedRuns&&d.jsxs("span",{className:"warn",title:"Trust rules are set and auto-review is on: reviews of matching PRs run their code unattended. Settings → Trusted PRs, or serve --no-trust.",children:[d.jsx(Xe,{name:"zap",size:12})," trusted PRs run with Bash"]}),d.jsx("span",{className:"grow"}),i.lastPollError?d.jsx("span",{className:"danger",title:i.lastPollError,children:"discovery offline — showing local reviews only"}):d.jsx("span",{className:"faint",children:i.polling?"polling now…":[i.lastSummary?`last: ${i.lastSummary}`:null,i.nextPollAt?`next ${new Date(i.nextPollAt).toLocaleTimeString()}`:null].filter(Boolean).join(" · ")})]})}):null}function Ji({className:i,label:a,tip:r}){return d.jsx("span",{className:i,children:d.jsxs("span",{className:"head-cell",children:[a,d.jsx("span",{className:"head-tip",role:"tooltip",children:r})]})})}function Ax({r:i,selected:a,onSelect:r,onOpen:s,awaiting:u}){const f=i0(i),h=Z_(i),y=u?t0(i,u):null;return d.jsxs("div",{className:`row${a?" row-on":""}`,onClick:s,onMouseEnter:r,role:"button",tabIndex:-1,children:[d.jsx("span",{className:"col-caret",children:"›"}),d.jsxs("span",{className:"col-slug",title:`${i.pr.owner}/${i.pr.repo}#${i.pr.number}`,children:[i.pr.repo,"#",i.pr.number]}),d.jsx("span",{className:"col-author",title:i.pr.author,children:i.pr.author}),d.jsx("span",{className:"col-title",title:i.pr.title,children:i.pr.title}),i.pr.isDraft&&d.jsx("span",{className:"tag tag-draft",title:"Still a draft — its author asked for your review anyway",children:"draft"}),y&&d.jsx("span",{className:"tag tag-awaiting",title:y.title,children:y.label}),h&&d.jsx("span",{className:"tag tag-done",children:h}),d.jsx("span",{className:"col-comments",children:l0(i)}),d.jsx("span",{className:"col-size",children:i.pr.changedFiles>0?d.jsxs(d.Fragment,{children:[i.pr.changedFiles,"f ",d.jsxs("span",{className:"add",children:["+",i.pr.additions]})," ",d.jsxs("span",{className:"del",children:["−",i.pr.deletions]})]}):"—"}),d.jsx("span",{className:`col-verdict tone-${f.tone}`,children:f.label}),d.jsx("span",{className:"col-age",title:i.status==="awaiting"?"When the PR last changed on GitHub":"When this review last changed",children:Jb(Md(i))})]})}function Lb({autoFocus:i}){const[a,r]=H.useState(""),[s,u]=H.useState(!1),[f,h]=H.useState(null),y=g=>{g.preventDefault();const m=a.trim();!m||s||(u(!0),h(null),y0(m).then(b=>uo(b.key)).catch(b=>{h(String(b instanceof Error?b.message:b)),u(!1)}))};return d.jsxs("form",{className:"pull",onSubmit:y,children:[d.jsx(Xe,{name:"plus"}),d.jsx("input",{className:"pull-input",value:a,autoFocus:i,disabled:s,onChange:g=>{r(g.target.value),f&&h(null)},placeholder:"paste a PR URL to review it","aria-label":"Review any PR by URL"}),a.trim()&&d.jsx("button",{className:"btn btn-small",type:"submit",disabled:s,children:s?"starting…":"review"}),f&&d.jsx("span",{className:"pull-error",children:f})]})}function Rx({text:i}){const a=H.useRef(null),[r,s]=H.useState(!1);return H.useLayoutEffect(()=>{const u=a.current;if(!u)return;const f=()=>s(u.scrollHeight-u.clientHeight>4);f();const h=new ResizeObserver(f);return h.observe(u),()=>h.disconnect()},[i]),d.jsx("div",{ref:a,className:`strip-prose${r?" strip-prose-clipped":""}`,children:d.jsx(ai,{className:"prose",text:i})})}function kx(){var Ee;const[i,a]=H.useState(null),[r,s]=H.useState(null),[u,f]=H.useState(null),[h,y]=H.useState(new Set),[g,m]=H.useState("inbox"),[b,v]=H.useState(null),_=H.useRef(!1),T=H.useRef(null),S=H.useRef(!0);H.useEffect(()=>(S.current=!0,()=>{S.current=!1}),[]);const C=()=>{So().then(j=>S.current&&a(j)).catch(j=>S.current&&f(String(j))),nf().then(j=>S.current&&s(j)).catch(()=>{})};H.useEffect(()=>{C();const j=setInterval(C,1e4);return()=>clearInterval(j)},[]);const A=i??[],R=H.useMemo(()=>P_(A,r),[A,r]),$=R.requests,U=K_(g,R),W=R[U];H.useEffect(()=>{U!==g&&m(U)},[U,g]);const z=W.find(j=>j.key===b)??W[0]??null,ae=j=>{y(le=>new Set(le).add(j)),ey(j).then(()=>C()).catch(le=>S.current&&f(String(le))).finally(()=>{S.current&&y(le=>{const fe=new Set(le);return fe.delete(j),fe})})};if(H.useEffect(()=>{const j=le=>{if(xx(le.target)||le.metaKey||le.ctrlKey||le.altKey)return;const fe=W.findIndex(Q=>Q.key===(z==null?void 0:z.key)),M=Q=>{const pe=W[Math.min(W.length-1,Math.max(0,fe+Q))];pe&&(_.current=!0,v(pe.key))};le.key==="j"||le.key==="ArrowDown"?(le.preventDefault(),M(1)):le.key==="k"||le.key==="ArrowUp"?(le.preventDefault(),M(-1)):le.key==="Enter"&&z?uo(z.key):le.key==="r"&&z&&z.status!=="running"&&z.status!=="sent"&&ae(z.key)};return window.addEventListener("keydown",j),()=>window.removeEventListener("keydown",j)},[W,z==null?void 0:z.key]),H.useEffect(()=>{var j;_.current&&(_.current=!1,(j=document.querySelector(".row-on"))==null||j.scrollIntoView({block:"nearest"}))},[z==null?void 0:z.key]),H.useEffect(()=>{const j=T.current;if(!j)return;const le=()=>document.documentElement.style.setProperty("--strip-h",`${j.offsetHeight}px`);le();const fe=new ResizeObserver(le);return fe.observe(j),()=>{fe.disconnect(),document.documentElement.style.removeProperty("--strip-h")}},[z!=null]),u&&!i)return d.jsx("p",{className:"error",children:u});if(!i)return d.jsx("p",{className:"muted pad",children:"Loading…"});const se=W.reduce((j,le)=>j+(le.costUsd??0),0),x=z?o0(z,r):null,G=z?h.has(z.key):!1,ee=Cd.filter(j=>R[j].length>0),ue=j=>d.jsxs("button",{className:`tab${U===j?" tab-on":""}${Cd.includes(j)?" tab-filed":""}${j==="requests"?" tab-requests":""}`,title:zu[j].title,onClick:()=>m(j),children:[zu[j].label," ",d.jsx("span",{className:"tab-count",children:R[j].length})]},j);return d.jsxs(d.Fragment,{children:[d.jsx(Tx,{daemon:r}),u&&d.jsx("div",{className:"wrap",children:d.jsx("p",{className:"error",children:u})}),A.length===0?d.jsx("div",{className:"wrap",children:d.jsxs("div",{className:"empty",children:[r!=null&&r.enabled?d.jsxs("p",{children:["Inbox empty — nothing awaits your review.",r.lastPollError?" (Discovery is offline; check gh auth.)":""]}):d.jsx("p",{children:"No reviews yet."}),d.jsx(Lb,{autoFocus:!0})]})}):d.jsxs("div",{className:"wrap",children:[d.jsxs("div",{className:"tabs",children:[hg.map(ue),ee.length>0&&d.jsx("span",{className:"tab-split","aria-hidden":"true"}),ee.map(ue),d.jsx("span",{className:"grow"}),d.jsx(Lb,{}),se>0&&d.jsxs("span",{className:"faint",title:"What these reviews would cost at API token rates. Riding a Claude subscription, they draw on your usage limits instead.",children:["≈$",se.toFixed(2)," at API rates"]})]}),d.jsxs("div",{className:"table-head",children:[d.jsx("span",{className:"col-caret"}),d.jsx(Ji,{className:"col-slug",label:"repo#pr",tip:"Repository and pull request number"}),d.jsx(Ji,{className:"col-author",label:"author",tip:"Who opened the pull request"}),d.jsx(Ji,{className:"col-title",label:"title",tip:"Pull request title"}),d.jsx(Ji,{className:"col-comments",label:"comments",tip:"Comments in the draft (— before one exists)"}),d.jsx(Ji,{className:"col-size",label:"size",tip:"Files changed, lines added, lines removed"}),d.jsx(Ji,{className:"col-verdict",label:"verdict",tip:"Recommendation, and how sure the review is"}),d.jsx(Ji,{className:"col-age",label:"upd",tip:"When this review last changed — or, on a PR nobody has drafted yet, when the PR itself last changed on GitHub"})]}),W.length===0?d.jsx("div",{className:"empty-tab",children:U==="inbox"&&$.length>0?d.jsxs(d.Fragment,{children:[d.jsx("p",{children:n0($)}),d.jsxs("button",{className:"btn",onClick:()=>m("requests"),children:[d.jsx(Xe,{name:"arrowRight"}),"show ",$.length===1?"it":`all ${$.length}`]})]}):d.jsx("p",{className:"muted",children:U==="inbox"?`Inbox empty — nothing awaits your review.${r!=null&&r.enabled&&r.lastPollError?" (Discovery is offline; check gh auth.)":""}`:`Nothing ${zu[U].label} right now.`})}):W.map((j,le)=>d.jsxs(H.Fragment,{children:[hg.includes(U)&&G_(W,le)&&d.jsx("div",{className:"group-head",role:"heading","aria-level":2,title:"PRs you opened. Never drafted on their own — press r for a self-review. Send posts it as a comment.",children:"your PRs"}),d.jsx(Ax,{r:j,selected:j.key===(z==null?void 0:z.key),onSelect:()=>v(j.key),onOpen:()=>uo(j.key),awaiting:F_(j,$)?X_(j,r):null})]},j.key)),z&&x&&d.jsxs("div",{className:"cursor-strip",ref:T,children:[d.jsxs("div",{className:"cursor-strip-body",children:[d.jsxs("div",{className:"lab",children:[z.pr.owner,"/",z.pr.repo,"#",z.pr.number,z.pr.headRefName&&z.pr.baseRefName?` · ${z.pr.headRefName} → ${z.pr.baseRefName}`:""]}),d.jsx(Rx,{text:x.reasoning}),d.jsxs("div",{className:"cursor-strip-meta",children:[x.meta.join(" · "),((Ee=z.sent)==null?void 0:Ee.url)&&d.jsxs(d.Fragment,{children:[" · ",d.jsx("a",{href:z.sent.url,target:"_blank",rel:"noreferrer",children:"view on GitHub"})]})]})]}),d.jsxs("div",{className:"cursor-strip-actions",children:[d.jsxs("button",{className:"btn-primary",onClick:()=>uo(z.key),children:[d.jsx(Xe,{name:"arrowRight"}),"open review ",d.jsx(za,{children:"↵"})]}),d.jsxs("div",{className:"cursor-strip-row",children:[d.jsxs("button",{className:"btn",disabled:z.status==="sent"||z.status==="skipped",title:"Set the local queue status to skipped. Nothing is sent.",onClick:()=>ro(z.key,{status:"skipped"}).then(C).catch(j=>f(String(j))),children:[d.jsx(Xe,{name:"skip"}),"skip"]}),d.jsxs("button",{className:"btn",disabled:G||z.status==="running",title:z.status==="sent"?"Draft a review of the PR's current head. What you sent stays on GitHub.":"Draft a review of the PR's current head.",onClick:()=>ae(z.key),children:[d.jsx(Xe,{name:"rerun"}),G?"starting…":z.status==="awaiting"||z.status==="failed"?"review now":"re-review"]})]})]})]})]})]})}const vo="cerber.theme";function zy(i){return i==="light"||i==="dark"?i:"system"}function Ox(){try{return zy(localStorage.getItem(vo))}catch{return"system"}}function jy(i,a=document.documentElement){i==="system"?delete a.dataset.theme:a.dataset.theme=i}function Cx(i,a){try{const r=a??localStorage;i==="system"?r.removeItem(vo):r.setItem(vo,i)}catch{}}function Mx(){Uy(jy)}function Uy(i){const a=r=>{(r.key===vo||r.key===null)&&i(zy(r.newValue))};return window.addEventListener("storage",a),()=>window.removeEventListener("storage",a)}function Dx(){const[i,a]=H.useState(Ox);return H.useEffect(()=>Uy(a),[]),[i,s=>{Cx(s),jy(s),a(s)}]}const Lx=[{rule:"@acme/*",meaning:"anyone in the acme org"},{rule:"@acme/devs",meaning:"anyone on that GitHub team"},{rule:"@teammate",meaning:"one person, by login"},{rule:"!@acme/contractors",meaning:"deny — beats every rule above"}],zb=1440,jb=i=>i instanceof Error?i.message:String(i),zx={unsupported:"this browser has no notifications to give",blocked:"this browser has blocked notifications for cerber",off:"tell me when a review is ready for me",ask:"tell me when a review is ready for me (the browser will ask first)",on:"tell me when a review is ready for me"},jx=[{choice:"system",label:"follow this machine"},{choice:"light",label:"light"},{choice:"dark",label:"dark"}],Ux=[{choice:"mod-enter",label:"⌘↵ sends a chat message, Enter starts a new line"},{choice:"enter",label:"Enter sends a chat message, Shift+Enter starts a new line"}],Bx=/^[\w.-]+\/[\w.-]+$/,Od=i=>i?"drafts automatically":"waits for a click";function Ix({daemon:i,busy:a,save:r}){const[s,u]=H.useState(""),[f,h]=H.useState(!i.autoReview),[y,g]=H.useState([]);H.useEffect(()=>{So().then(S=>g([...new Set(S.map(C=>`${C.pr.owner}/${C.pr.repo}`))].sort())).catch(()=>{})},[]),H.useEffect(()=>h(!i.autoReview),[i.autoReview]);const m=Object.entries(i.autoReviewRepos).sort(([S],[C])=>S.localeCompare(C)),b=s.trim(),v=Bx.test(b),_=new Set(m.map(([S])=>S.toLowerCase())),T=()=>{a||!v||(r(b,f),u(""))};return d.jsxs(d.Fragment,{children:[d.jsx("h2",{children:"Per-repo exceptions"}),d.jsx("p",{className:"muted",children:"Every repo not listed here follows the switch above. List a busy repo to keep it to the click, or, with the switch off, one repo you still want drafted."}),d.jsxs("div",{className:"trust-add",children:[d.jsx("input",{value:s,"aria-label":"Repository",placeholder:"owner/repo",list:"auto-review-repos",disabled:a,onChange:S=>u(S.target.value),onKeyDown:S=>{S.key==="Enter"&&T()}}),d.jsx("datalist",{id:"auto-review-repos",children:y.filter(S=>!_.has(S.toLowerCase())).map(S=>d.jsx("option",{value:S},S))}),d.jsxs("select",{"aria-label":"What the poll does for this repo",value:f?"auto":"click",disabled:a,onChange:S=>h(S.target.value==="auto"),children:[d.jsx("option",{value:"click",children:Od(!1)}),d.jsx("option",{value:"auto",children:Od(!0)})]}),d.jsx("button",{className:"btn",disabled:a||!v,onClick:T,children:"add"})]}),m.length===0?d.jsxs("p",{className:"muted",children:["No exceptions — every repo ",i.autoReview?"is drafted automatically":"waits for a click","."]}):d.jsx("table",{className:"trust-table",children:d.jsx("tbody",{children:m.map(([S,C])=>d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx("code",{children:S})}),d.jsxs("td",{className:"muted",children:[Od(C),C===i.autoReview&&" — same as the default, so it changes nothing"]}),d.jsxs("td",{className:"trust-actions",children:[d.jsx("button",{className:"btn",disabled:a,onClick:()=>r(S,!C),children:C?"wait for a click":"draft automatically"})," ",d.jsx("button",{className:"btn",disabled:a,onClick:()=>r(S,null),children:"remove"})]})]},S))})})]})}function Hx({daemonAnnounces:i}){const[a,r]=Ly(),[s,u]=Dx(),[f,h]=Sy(),[y,g]=Ty(),[m,b]=H.useState(null),[v,_]=H.useState(""),[T,S]=H.useState(null),[C,A]=H.useState(!1),[R,$]=H.useState(""),[U,W]=H.useState(!1);H.useEffect(()=>{R0().then(b).catch(x=>S(jb(x))),nf().then(x=>W(x.enabled&&x.intervalFixed)).catch(()=>{})},[]),H.useEffect(()=>{m&&$(String(m.daemon.intervalMinutes))},[m]);const z=x=>{A(!0),S(null),x.then(b).catch(G=>S(jb(G))).finally(()=>A(!1))};if(T&&!m)return d.jsx("p",{className:"error",children:T});if(!m)return d.jsx("p",{className:"muted",children:"Loading…"});const ae=i&&m.daemon.poll&&m.daemon.notify,se=()=>{const x=Number(R);!Number.isInteger(x)||x<1||x>zb?$(String(m.daemon.intervalMinutes)):x!==m.daemon.intervalMinutes&&z(no({intervalMinutes:x}))};return d.jsxs("div",{className:"settings",children:[d.jsx("a",{href:"#/",className:"back",children:"← queue"}),d.jsx("h1",{children:"Inbox"}),d.jsx("p",{children:"By default cerber keeps the queue itself: it polls GitHub for PRs awaiting your review and drafts a review for each, so they're ready when you open the cockpit. Nothing is ever sent without you. Changes apply on the next poll — no restart."}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:m.daemon.poll,disabled:C,onChange:x=>z(no({poll:x.target.checked}))})," ","poll GitHub for PRs awaiting my review"]}),d.jsxs("label",{className:"inbox-toggle",children:["poll every",d.jsx("input",{type:"number",className:"interval-input",min:1,max:zb,step:1,value:R,disabled:C||!m.daemon.poll||U,onChange:x=>$(x.target.value),onBlur:se,onKeyDown:x=>{x.key==="Enter"&&se()}}),"minutes",U&&d.jsx("span",{className:"muted",children:" (set by --interval for this run)"})]}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:m.daemon.autoReview,disabled:C||!m.daemon.poll,onChange:x=>z(no({autoReview:x.target.checked}))})," ","draft a review automatically (off: awaiting PRs wait for a click)"]}),m.daemon.poll&&d.jsx(Ix,{daemon:m.daemon,busy:C,save:(x,G)=>z(k0(x,G))}),d.jsxs("p",{className:"muted",children:["Your own open PRs come in too, under ",d.jsx("b",{children:"your PRs"}),", for a self-review when you ask —",m.daemon.ownPrMaxAgeDays?` except ones idle for more than ${m.daemon.ownPrMaxAgeDays} days`:" all of them, however long idle"," ","(",d.jsx("code",{children:"ownPrMaxAgeDays"}),"; 0 turns the cut off)."]}),d.jsxs("p",{className:"muted",children:["Concurrency, a repo filter and that age cut live in ",d.jsx("code",{children:m.path})," ","under ",d.jsx("code",{children:"daemon"})," — hand-editable, like everything here."]}),d.jsx("h1",{children:"Notifications"}),d.jsx("p",{children:'When a PR is worth coming back for, cerber says so: one desktop notification per poll. With auto-review on that moment is the draft landing, not the PR arriving — a tap that leads to "no run yet" costs you the walk back and gives you nothing — and the notification names what the review found. A PR nobody is drafting (auto-review off, or a run that failed) is announced as it lands, since that is all the news there will be — and if a retry then drafts it after all, that is new news and you are told. Several at once fold into one notification, and a PR whose draft has been announced never arrives twice, however its next re-review ends.'}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:m.daemon.notify,disabled:C||!m.daemon.poll,onChange:x=>z(no({notify:x.target.checked}))})," ","tell this machine when a review is ready for you (no cockpit tab required)"]}),d.jsxs("p",{className:"muted",children:["This is the one that works while you're somewhere else: it rides the poll, so it needs nothing open but ",d.jsx("code",{children:"serve"})," itself. It hands the notification to whatever this machine already has — Notification Centre on macOS,"," ",d.jsx("code",{children:"notify-send"})," on Linux — and stays quiet where there is neither. On macOS it"," ",d.jsx("strong",{children:"opens that review when you click it"}),', through a small app cerber builds for the job (the first one asks you to allow notifications from "Cerber"); a'," ",d.jsx("code",{children:"notify-send"})," tap announces the PR but has no click to give."]}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:a==="on",disabled:a==="unsupported"||a==="blocked"||ae,onChange:r})," ",ae?"let this browser announce them instead":zx[a]]}),d.jsx("p",{className:"muted",children:ae?d.jsx(d.Fragment,{children:"Standing down while the machine's own notification is on — two popups for one PR is one too many. Untick the machine one above and this browser takes over: it names the PR and opens that review on click just the same, but only while a cockpit tab is open and this browser has granted the permission."}):d.jsxs(d.Fragment,{children:["Per-browser, not per-machine: the permission belongs to this browser, so the switch lives here rather than in ",d.jsx("code",{children:m.path}),". Granting it is the browser's prompt, not cerber's — a browser that has blocked cerber has to be un-blocked from the padlock next to the address bar. Nothing is announced while you're looking straight at the cockpit."]})}),d.jsx("h1",{id:"appearance",children:"Appearance"}),d.jsx("div",{role:"radiogroup","aria-labelledby":"appearance",children:jx.map(({choice:x,label:G})=>d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"radio",name:"theme",checked:s===x,onChange:()=>u(x)})," ",G]},x))}),d.jsxs("p",{className:"muted",children:["Per-browser, like the notification switch: it's about this screen, not your reviews, so it lives here rather than in ",d.jsx("code",{children:m.path}),"."]}),d.jsx("h1",{children:"Review page"}),d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"checkbox",checked:f,onChange:x=>h(x.target.checked)})," ","keep chapter titles and file headers pinned while scrolling"]}),d.jsx("p",{className:"muted",children:"Ten files into a chapter you still see which one you're in, and the pinned title can open the chapter's explanation. Deep in a long file its name and Viewed box stay in reach. Per-browser, like the theme."}),Ux.map(({choice:x,label:G})=>d.jsxs("label",{className:"inbox-toggle",children:[d.jsx("input",{type:"radio",name:"send-key",checked:y===x,onChange:()=>g(x)})," ",G]},x)),d.jsx("p",{className:"muted",children:"In the conversation with the reviewer. ⌘↵ sends under either choice, and the other boxes — comments, the review body, a handoff note — always take ⌘↵, since what goes in them runs to several lines. Per-browser, like the theme."}),d.jsx("h1",{children:"Trusted PRs"}),d.jsxs("p",{children:["Every review reads the PR's code. A ",d.jsx("strong",{children:"trusted"})," review may also run it — the test that covers the change, a typecheck, ",d.jsx("code",{children:"git log"})," — so it can report what happened instead of guessing. That means executing code from the PR on this machine, the same as checking the branch out and running the tests yourself."]}),d.jsxs("p",{className:"muted",children:["Trust the people, not the code: nothing about a PR can earn it. Rules live in"," ",d.jsx("code",{children:m.path}),"."]}),d.jsx("p",{className:"muted",children:'Only people can be trusted — there is no way to trust a repository. Anyone can open a PR against a repo you own, so trusting the repo would trust them too. Membership is checked against GitHub when the review runs, and a check that fails counts as "not a member".'}),d.jsxs("div",{className:"trust-add",children:[d.jsx("input",{value:v,"aria-label":"Trust rule",placeholder:"@org/*, @org/team, @login, !deny",disabled:C,onChange:x=>_(x.target.value),onKeyDown:x=>{x.key==="Enter"&&!C&&v.trim()&&(z(Uu(v.trim())),_(""))}}),d.jsx("button",{className:"btn",disabled:C||!v.trim(),onClick:()=>{z(Uu(v.trim())),_("")},children:"trust"})]}),T&&d.jsx("p",{className:"error",children:T}),m.trust.length===0?d.jsx("p",{className:"muted",children:"Nobody is trusted yet — every review reads the checkout and runs nothing."}):d.jsx("table",{className:"trust-table",children:d.jsx("tbody",{children:m.trust.map(x=>d.jsxs("tr",{className:x.denies?"trust-deny":void 0,children:[d.jsx("td",{children:d.jsx("code",{children:x.rule})}),d.jsx("td",{className:"muted",children:x.explanation}),d.jsx("td",{className:"trust-actions",children:d.jsx("button",{className:"btn",disabled:C,onClick:()=>z(Uu(x.rule,!0)),children:"remove"})})]},x.rule))})}),d.jsx("h2",{children:"Rule syntax"}),d.jsx("table",{className:"trust-table",children:d.jsx("tbody",{children:Lx.map(x=>d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx("code",{children:x.rule})}),d.jsx("td",{className:"muted",children:x.meaning})]},x.rule))})}),d.jsxs("p",{className:"muted",children:["A trusted review is handed no GitHub credentials — no token, no ",d.jsx("code",{children:"gh"})," login, no git or ssh identity — so a push fails to authenticate rather than being merely discouraged. It is not a sandbox though: it has ",d.jsx("code",{children:"Bash"})," and this machine, so trust people you would let run their branch here anyway. The daemon reviews unattended, so with rules set it runs matching PRs' code with nobody watching — start it with ",d.jsx("code",{children:"--no-trust"})," to prevent that."]}),d.jsxs("p",{className:"muted settings-version",children:["cerber ",m.version]})]})}function Ub(){const i=window.location.hash,a=i.match(/^#\/r\/(.+)$/);return a?{view:"detail",key:decodeURIComponent(a[1])}:i==="#/settings"?{view:"settings"}:{view:"queue"}}const Bb={unsupported:"",blocked:"This browser blocked notifications for cerber. Turn them back on in its site settings — the padlock next to the address bar.",off:"Notifications off. Click to be told when a review is ready for you.",ask:"Click to be told when a review is ready for you — the browser will ask you first.",on:"Telling you when a review is ready for you. Click to stop."},Ib="cerber taps this machine itself when a PR is worth coming back for — no tab required. The browser's own bell would be a second popup about one PR, so it stands down. Turn the machine one off in Settings to have this browser announce them instead.";function qx({daemonAnnounces:i}){const[a,r]=Ly();return i?d.jsx("span",{className:"topbar-link bell bell-daemon",role:"img",title:Ib,"aria-label":Ib,children:d.jsx(Xe,{name:"bell",size:15})}):a==="unsupported"?null:d.jsx("button",{className:`topbar-link bell bell-${a}`,title:Bb[a],"aria-label":Bb[a],"aria-pressed":a==="on",onClick:r,children:d.jsx(Xe,{name:a==="on"?"bell":"bellOff",size:15})})}function Gx(){const[i,a]=H.useState(Ub()),r=Nx();return H.useEffect(()=>{const s=()=>a(Ub());return window.addEventListener("hashchange",s),()=>window.removeEventListener("hashchange",s)},[]),i.view==="detail"?d.jsx("div",{className:"app",children:d.jsx(ox,{reviewKey:i.key})}):d.jsxs("div",{className:"app",children:[d.jsx("header",{className:"topbar",children:d.jsxs("div",{className:"bar-inner",children:[d.jsxs("a",{href:"#/",className:"brand",children:[d.jsx(BS,{}),"cerber"]}),d.jsx("span",{className:"tagline",children:"nothing reaches GitHub until you say so"}),d.jsx("span",{className:"grow"}),i.view==="queue"&&d.jsxs(d.Fragment,{children:[d.jsxs("span",{className:"hint",children:[d.jsx(za,{children:"j"}),d.jsx(za,{children:"k"}),"move"]}),d.jsxs("span",{className:"hint",children:[d.jsx(za,{children:"↵"}),"open"]}),d.jsxs("span",{className:"hint",children:[d.jsx(za,{children:"r"}),"review now"]})]}),d.jsx(qx,{daemonAnnounces:r}),d.jsx("a",{href:"#/settings",className:"topbar-link",title:"settings","aria-label":"settings",children:d.jsx(Xe,{name:"settings",size:15})})]})}),i.view==="queue"?d.jsx(kx,{}):d.jsx(Hx,{daemonAnnounces:r})]})}Mx();QE.createRoot(document.getElementById("root")).render(d.jsx(FE.StrictMode,{children:d.jsx(Gx,{})}));export{gN as _,Yx as c,Hb as g,uy as p};
|