review-workspace 1.10.1 → 1.10.2
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.
|
@@ -68,6 +68,19 @@ export function resolveTarget(target, patch) {
|
|
|
68
68
|
}
|
|
69
69
|
return undefined;
|
|
70
70
|
}
|
|
71
|
+
// A Verification item's targetIds may name an Annotation id, an Evidence id, or a file
|
|
72
|
+
// path directly (see render.ts's buildVerificationByTargetId) — none of which is itself
|
|
73
|
+
// a guarantee of a concrete place. An Evidence id only anchors if that Evidence's own
|
|
74
|
+
// targetIds resolve to an Annotation or a file in turn; anything else (a Behavioral Group
|
|
75
|
+
// id, a dangling id) resolves to nowhere the reviewer can be sent.
|
|
76
|
+
function isConcreteAnchor(id, annotationIds, evidenceById, filePaths) {
|
|
77
|
+
if (annotationIds.has(id) || filePaths.has(id))
|
|
78
|
+
return true;
|
|
79
|
+
const evidence = evidenceById.get(id);
|
|
80
|
+
if (!evidence)
|
|
81
|
+
return false;
|
|
82
|
+
return (evidence.targetIds ?? []).some((innerId) => annotationIds.has(innerId) || filePaths.has(innerId));
|
|
83
|
+
}
|
|
71
84
|
export function collectDiagnostics(document, patch, bundlePath, limits = DEFAULT_LIMITS) {
|
|
72
85
|
const diagnostics = [];
|
|
73
86
|
const schemaResult = validateReviewDocumentSchema(document);
|
|
@@ -110,5 +123,20 @@ export function collectDiagnostics(document, patch, bundlePath, limits = DEFAULT
|
|
|
110
123
|
}
|
|
111
124
|
}
|
|
112
125
|
}
|
|
126
|
+
if (document.verification?.length) {
|
|
127
|
+
const annotationIds = new Set((document.annotations ?? []).map((a) => a.id));
|
|
128
|
+
const evidenceById = new Map((document.evidence ?? []).map((e) => [e.id, e]));
|
|
129
|
+
const filePaths = new Set(patch.files.map((f) => f.path));
|
|
130
|
+
for (const item of document.verification) {
|
|
131
|
+
if (item.status !== 'gap' || item.diffuse)
|
|
132
|
+
continue;
|
|
133
|
+
const ids = item.targetIds ?? [];
|
|
134
|
+
const anchored = ids.some((id) => isConcreteAnchor(id, annotationIds, evidenceById, filePaths));
|
|
135
|
+
if (!anchored) {
|
|
136
|
+
const detail = ids.length === 0 ? 'targetIds is empty' : `targetIds ${JSON.stringify(ids)} resolve to no Annotation, Evidence, or file`;
|
|
137
|
+
diagnostics.push({ kind: 'unanchored-verification-gap', verificationId: item.id, detail });
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
113
141
|
return diagnostics;
|
|
114
142
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "review-workspace",
|
|
3
|
-
"version": "1.10.
|
|
3
|
+
"version": "1.10.2",
|
|
4
4
|
"description": "A local, offline decision surface for reviewing a code Comparison — evidence-linked map of intent, behavior, risk, and observable effects.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Salih Sayer",
|
|
@@ -154,7 +154,8 @@
|
|
|
154
154
|
"id": { "type": "string", "minLength": 1 },
|
|
155
155
|
"description": { "type": "string", "minLength": 1 },
|
|
156
156
|
"status": { "enum": ["unverified", "verified", "gap"] },
|
|
157
|
-
"targetIds": { "type": "array", "items": { "type": "string" } }
|
|
157
|
+
"targetIds": { "type": "array", "items": { "type": "string" } },
|
|
158
|
+
"diffuse": { "type": "boolean" }
|
|
158
159
|
}
|
|
159
160
|
},
|
|
160
161
|
"answer": {
|
|
@@ -115,4 +115,4 @@ ${e}</tr>
|
|
|
115
115
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${En(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),s=pp(e);if(s===null)return r;e=s;let o='<a href="'+e+'"';return t&&(o+=' title="'+En(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let s=pp(e);if(s===null)return En(n);e=s;let o=`<img src="${e}" alt="${En(n)}"`;return t&&(o+=` title="${En(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:En(e.text)}},jc=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},hn=class Cu{constructor(t){Fe(this,"options");Fe(this,"renderer");Fe(this,"textRenderer");this.options=t||ts,this.options.renderer=this.options.renderer||new Gi,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new jc}static parse(t,n){return new Cu(n).parse(t)}static parseInline(t,n){return new Cu(n).parseInline(t)}parse(t){var r,s;this.renderer.parser=this;let n="";for(let o=0;o<t.length;o++){let i=t[o];if((s=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&s[i.type]){let l=i,u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){n+=u||"";continue}}let a=i;switch(a.type){case"space":{n+=this.renderer.space(a);break}case"hr":{n+=this.renderer.hr(a);break}case"heading":{n+=this.renderer.heading(a);break}case"code":{n+=this.renderer.code(a);break}case"table":{n+=this.renderer.table(a);break}case"blockquote":{n+=this.renderer.blockquote(a);break}case"list":{n+=this.renderer.list(a);break}case"checkbox":{n+=this.renderer.checkbox(a);break}case"html":{n+=this.renderer.html(a);break}case"def":{n+=this.renderer.def(a);break}case"paragraph":{n+=this.renderer.paragraph(a);break}case"text":{n+=this.renderer.text(a);break}default:{let l='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return n}parseInline(t,n=this.renderer){var s,o;this.renderer.parser=this;let r="";for(let i=0;i<t.length;i++){let a=t[i];if((o=(s=this.options.extensions)==null?void 0:s.renderers)!=null&&o[a.type]){let u=this.options.extensions.renderers[a.type].call({parser:this},a);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){r+=u||"";continue}}let l=a;switch(l.type){case"escape":{r+=n.text(l);break}case"html":{r+=n.html(l);break}case"link":{r+=n.link(l);break}case"image":{r+=n.image(l);break}case"checkbox":{r+=n.checkbox(l);break}case"strong":{r+=n.strong(l);break}case"em":{r+=n.em(l);break}case"codespan":{r+=n.codespan(l);break}case"br":{r+=n.br(l);break}case"del":{r+=n.del(l);break}case"text":{r+=n.text(l);break}default:{let u='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},gi,to=(gi=class{constructor(e){Fe(this,"options");Fe(this,"block");this.options=e||ts}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?pn.lex:pn.lexInline}provideParser(e=this.block){return e?hn.parse:hn.parseInline}},Fe(gi,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),Fe(gi,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),gi),eO=class{constructor(...e){Fe(this,"defaults",$c());Fe(this,"options",this.setOptions);Fe(this,"parse",this.parseMarkdown(!0));Fe(this,"parseInline",this.parseMarkdown(!1));Fe(this,"Parser",hn);Fe(this,"Renderer",Gi);Fe(this,"TextRenderer",jc);Fe(this,"Lexer",pn);Fe(this,"Tokenizer",Wi);Fe(this,"Hooks",to);this.use(...e)}walkTokens(e,t){var r,s;let n=[];for(let o of e)switch(n=n.concat(t.call(this,o)),o.type){case"table":{let i=o;for(let a of i.header)n=n.concat(this.walkTokens(a.tokens,t));for(let a of i.rows)for(let l of a)n=n.concat(this.walkTokens(l.tokens,t));break}case"list":{let i=o;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=o;(s=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&s[i.type]?this.defaults.extensions.childTokens[i.type].forEach(a=>{let l=i[a].flat(1/0);n=n.concat(this.walkTokens(l,t))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){let o=t.renderers[s.name];o?t.renderers[s.name]=function(...i){let a=s.renderer.apply(this,i);return a===!1&&(a=o.apply(this,i)),a}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[s.level];o?o.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),n.renderer){let s=this.defaults.renderer||new Gi(this.defaults);for(let o in n.renderer){if(!(o in s))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let i=o,a=n.renderer[i],l=s[i];s[i]=(...u)=>{let c=a.apply(s,u);return c===!1&&(c=l.apply(s,u)),c||""}}r.renderer=s}if(n.tokenizer){let s=this.defaults.tokenizer||new Wi(this.defaults);for(let o in n.tokenizer){if(!(o in s))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let i=o,a=n.tokenizer[i],l=s[i];s[i]=(...u)=>{let c=a.apply(s,u);return c===!1&&(c=l.apply(s,u)),c}}r.tokenizer=s}if(n.hooks){let s=this.defaults.hooks||new to;for(let o in n.hooks){if(!(o in s))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let i=o,a=n.hooks[i],l=s[i];to.passThroughHooks.has(o)?s[i]=u=>{if(this.defaults.async&&to.passThroughHooksRespectAsync.has(o))return(async()=>{let d=await a.call(s,u);return l.call(s,d)})();let c=a.call(s,u);return l.call(s,c)}:s[i]=(...u)=>{if(this.defaults.async)return(async()=>{let d=await a.apply(s,u);return d===!1&&(d=await l.apply(s,u)),d})();let c=a.apply(s,u);return c===!1&&(c=l.apply(s,u)),c}}r.hooks=s}if(n.walkTokens){let s=this.defaults.walkTokens,o=n.walkTokens;r.walkTokens=function(i){let a=[];return a.push(o.call(this,i)),s&&(a=a.concat(s.call(this,i))),a}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return pn.lex(e,t??this.defaults)}parser(e,t){return hn.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},s={...this.defaults,...r},o=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return o(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 t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let i=s.hooks?await s.hooks.preprocess(t):t,a=await(s.hooks?await s.hooks.provideLexer(e):e?pn.lex:pn.lexInline)(i,s),l=s.hooks?await s.hooks.processAllTokens(a):a;s.walkTokens&&await Promise.all(this.walkTokens(l,s.walkTokens));let u=await(s.hooks?await s.hooks.provideParser(e):e?hn.parse:hn.parseInline)(l,s);return s.hooks?await s.hooks.postprocess(u):u})().catch(o);try{s.hooks&&(t=s.hooks.preprocess(t));let i=(s.hooks?s.hooks.provideLexer(e):e?pn.lex:pn.lexInline)(t,s);s.hooks&&(i=s.hooks.processAllTokens(i)),s.walkTokens&&this.walkTokens(i,s.walkTokens);let a=(s.hooks?s.hooks.provideParser(e):e?hn.parse:hn.parseInline)(i,s);return s.hooks&&(a=s.hooks.postprocess(a)),a}catch(i){return o(i)}}}onError(e,t){return n=>{if(n.message+=`
|
|
116
116
|
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+En(n.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}},Qr=new eO;function Ye(e,t){return Qr.parse(e,t)}Ye.options=Ye.setOptions=function(e){return Qr.setOptions(e),Ye.defaults=Qr.defaults,ov(Ye.defaults),Ye};Ye.getDefaults=$c;Ye.defaults=ts;Ye.use=function(...e){return Qr.use(...e),Ye.defaults=Qr.defaults,ov(Ye.defaults),Ye};Ye.walkTokens=function(e,t){return Qr.walkTokens(e,t)};Ye.parseInline=Qr.parseInline;Ye.Parser=hn;Ye.parser=hn.parse;Ye.Renderer=Gi;Ye.TextRenderer=jc;Ye.Lexer=pn;Ye.lexer=pn.lex;Ye.Tokenizer=Wi;Ye.Hooks=to;Ye.parse=Ye;Ye.options;Ye.setOptions;Ye.use;Ye.walkTokens;Ye.parseInline;hn.parse;pn.lex;/*! @license DOMPurify 3.4.12 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.12/LICENSE */function vp(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tO(e){if(Array.isArray(e))return e}function nO(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,s,o,i,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(l=(r=o.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(c){u=!0,s=c}finally{try{if(!l&&n.return!=null&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw s}}return a}}function rO(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
117
117
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sO(e,t){return tO(e)||nO(e,t)||oO(e,t)||rO()}function oO(e,t){if(e){if(typeof e=="string")return vp(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vp(e,t):void 0}}const gv=Object.entries,yp=Object.setPrototypeOf,iO=Object.isFrozen,aO=Object.getPrototypeOf,lO=Object.getOwnPropertyDescriptor;let Tt=Object.freeze,At=Object.seal,ms=Object.create,mv=typeof Reflect<"u"&&Reflect,Su=mv.apply,Tu=mv.construct;Tt||(Tt=function(t){return t});At||(At=function(t){return t});Su||(Su=function(t,n){for(var r=arguments.length,s=new Array(r>2?r-2:0),o=2;o<r;o++)s[o-2]=arguments[o];return t.apply(n,s)});Tu||(Tu=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return new t(...r)});const cs=ht(Array.prototype.forEach),uO=ht(Array.prototype.lastIndexOf),bp=ht(Array.prototype.pop),ds=ht(Array.prototype.push),cO=ht(Array.prototype.splice),kr=Array.isArray,no=ht(String.prototype.toLowerCase),Tl=ht(String.prototype.toString),xp=ht(String.prototype.match),Qs=ht(String.prototype.replace),wp=ht(String.prototype.indexOf),dO=ht(String.prototype.trim),fO=ht(Number.prototype.toString),pO=ht(Boolean.prototype.toString),_p=typeof BigInt>"u"?null:ht(BigInt.prototype.toString),kp=typeof Symbol>"u"?null:ht(Symbol.prototype.toString),xt=ht(Object.prototype.hasOwnProperty),Xs=ht(Object.prototype.toString),bt=ht(RegExp.prototype.test),$r=hO(TypeError);function ht(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];return Su(e,t,r)}}function hO(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return Tu(e,n)}}function Le(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:no;if(yp&&yp(e,null),!kr(t))return e;let r=t.length;for(;r--;){let s=t[r];if(typeof s=="string"){const o=n(s);o!==s&&(iO(t)||(t[r]=o),s=o)}e[s]=!0}return e}function gO(e){for(let t=0;t<e.length;t++)xt(e,t)||(e[t]=null);return e}function jt(e){const t=ms(null);for(const r of gv(e)){var n=sO(r,2);const s=n[0],o=n[1];xt(e,s)&&(kr(o)?t[s]=gO(o):o&&typeof o=="object"&&o.constructor===Object?t[s]=jt(o):t[s]=o)}return t}function mO(e){switch(typeof e){case"string":return e;case"number":return fO(e);case"boolean":return pO(e);case"bigint":return _p?_p(e):"0";case"symbol":return kp?kp(e):"Symbol()";case"undefined":return Xs(e);case"function":case"object":{if(e===null)return Xs(e);const t=e,n=On(t,"toString");if(typeof n=="function"){const r=n(t);return typeof r=="string"?r:Xs(r)}return Xs(e)}default:return Xs(e)}}function On(e,t){for(;e!==null;){const r=lO(e,t);if(r){if(r.get)return ht(r.get);if(typeof r.value=="function")return ht(r.value)}e=aO(e)}function n(){return null}return n}function vO(e){try{return bt(e,""),!0}catch{return!1}}const Cp=Tt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Al=Tt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),El=Tt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),yO=Tt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ol=Tt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),bO=Tt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Sp=Tt(["#text"]),Tp=Tt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Rl=Tt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Ap=Tt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),pi=Tt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),xO=At(/{{[\w\W]*|^[\w\W]*}}/g),wO=At(/<%[\w\W]*|^[\w\W]*%>/g),_O=At(/\${[\w\W]*/g),kO=At(/^data-[\-\w.\u00B7-\uFFFF]+$/),CO=At(/^aria-[\-\w]+$/),Ep=At(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),SO=At(/^(?:\w+script|data):/i),TO=At(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),AO=At(/^html$/i),EO=At(/^[a-z][.\w]*(-[.\w]+)+$/i),Op=At(/<[/\w!]/g),Rp=At(/<[/\w]/g),OO=At(/<\/no(script|embed|frames)/i),RO=At(/\/>/i),tn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},PO=function(){return typeof window>"u"?null:window},IO=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const s="data-tt-policy-suffix";n&&n.hasAttribute(s)&&(r=n.getAttribute(s));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(i){return i},createScriptURL(i){return i}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Pp=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},yr=function(t,n,r,s){return xt(t,n)&&kr(t[n])?Le(s.base?jt(s.base):{},t[n],s.transform):r};function vv(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:PO();const t=oe=>vv(oe);if(t.version="3.4.12",t.removed=[],!e||!e.document||e.document.nodeType!==tn.document||!e.Element)return t.isSupported=!1,t;let n=e.document;const r=n,s=r.currentScript;e.DocumentFragment;const o=e.HTMLTemplateElement,i=e.Node,a=e.Element,l=e.NodeFilter,u=e.NamedNodeMap;u===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const c=e.DOMParser,d=e.trustedTypes,p=a.prototype,h=On(p,"cloneNode"),g=On(p,"remove"),m=On(p,"nextSibling"),v=On(p,"childNodes"),b=On(p,"parentNode"),w=On(p,"shadowRoot"),x=On(p,"attributes"),_=i&&i.prototype?On(i.prototype,"nodeType"):null,R=i&&i.prototype?On(i.prototype,"nodeName"):null;if(typeof o=="function"){const oe=n.createElement("template");oe.content&&oe.content.ownerDocument&&(n=oe.content.ownerDocument)}let T,E="",$,N=!1,D=0;const Y=function(){if(D>0)throw $r('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},te=function(k){Y(),D++;try{return T.createHTML(k)}finally{D--}},re=function(k){Y(),D++;try{return T.createScriptURL(k)}finally{D--}},j=function(){return N||($=IO(d,s),N=!0),$},de=n,G=de.implementation,ue=de.createNodeIterator,X=de.createDocumentFragment,_e=de.getElementsByTagName,le=r.importNode;let Se=Pp();t.isSupported=typeof gv=="function"&&typeof b=="function"&&G&&G.createHTMLDocument!==void 0;const Ne=xO,tt=wO,it=_O,Qe=kO,Be=CO,U=SO,ge=TO,ne=EO;let we=Ep,ye=null;const C=Le({},[...Cp,...Al,...El,...Ol,...Sp]);let S=null;const M=Le({},[...Tp,...Rl,...Ap,...pi]);let B=Object.seal(ms(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),K=null,H=null;const ie=Object.seal(ms(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ae=!0,se=!0,Z=!1,Te=!0,fe=!1,be=!0,ke=!1,Me=!1,Ve=null,He=null,nt=!1,rt=!1,Nt=!1,Lt=!1,pr=!0,Ns=!1;const Ot="user-content-";let Qt=!0,ns=!1,Gn={},kn=null;const Na=Le({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Yc=null;const Qc=Le({},["audio","video","img","source","image","track"]);let La=null;const Xc=Le({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),jo="http://www.w3.org/1998/Math/MathML",Ho="http://www.w3.org/2000/svg",Cn="http://www.w3.org/1999/xhtml";let rs=Cn,za=!1,Ba=null;const Kv=Le({},[jo,Ho,Cn],Tl),Zc=Tt(["mi","mo","mn","ms","mtext"]);let Fa=Le({},Zc);const Jc=Tt(["annotation-xml"]);let ja=Le({},Jc);const Yv=Le({},["title","style","font","a","script"]);let Ls=null;const Qv=["application/xhtml+xml","text/html"],Xv="text/html";let at=null,ss=null;const Zv=n.createElement("form"),ed=function(k){return k instanceof RegExp||k instanceof Function},Ha=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ss&&ss===k)return;(!k||typeof k!="object")&&(k={}),k=jt(k),Ls=Qv.indexOf(k.PARSER_MEDIA_TYPE)===-1?Xv:k.PARSER_MEDIA_TYPE,at=Ls==="application/xhtml+xml"?Tl:no,ye=yr(k,"ALLOWED_TAGS",C,{transform:at}),S=yr(k,"ALLOWED_ATTR",M,{transform:at}),Ba=yr(k,"ALLOWED_NAMESPACES",Kv,{transform:Tl}),La=yr(k,"ADD_URI_SAFE_ATTR",Xc,{transform:at,base:Xc}),Yc=yr(k,"ADD_DATA_URI_TAGS",Qc,{transform:at,base:Qc}),kn=yr(k,"FORBID_CONTENTS",Na,{transform:at}),K=yr(k,"FORBID_TAGS",jt({}),{transform:at}),H=yr(k,"FORBID_ATTR",jt({}),{transform:at}),Gn=xt(k,"USE_PROFILES")?k.USE_PROFILES&&typeof k.USE_PROFILES=="object"?jt(k.USE_PROFILES):k.USE_PROFILES:!1,ae=k.ALLOW_ARIA_ATTR!==!1,se=k.ALLOW_DATA_ATTR!==!1,Z=k.ALLOW_UNKNOWN_PROTOCOLS||!1,Te=k.ALLOW_SELF_CLOSE_IN_ATTR!==!1,fe=k.SAFE_FOR_TEMPLATES||!1,be=k.SAFE_FOR_XML!==!1,ke=k.WHOLE_DOCUMENT||!1,rt=k.RETURN_DOM||!1,Nt=k.RETURN_DOM_FRAGMENT||!1,Lt=k.RETURN_TRUSTED_TYPE||!1,nt=k.FORCE_BODY||!1,pr=k.SANITIZE_DOM!==!1,Ns=k.SANITIZE_NAMED_PROPS||!1,Qt=k.KEEP_CONTENT!==!1,ns=k.IN_PLACE||!1,we=vO(k.ALLOWED_URI_REGEXP)?k.ALLOWED_URI_REGEXP:Ep,rs=typeof k.NAMESPACE=="string"?k.NAMESPACE:Cn,Fa=xt(k,"MATHML_TEXT_INTEGRATION_POINTS")&&k.MATHML_TEXT_INTEGRATION_POINTS&&typeof k.MATHML_TEXT_INTEGRATION_POINTS=="object"?jt(k.MATHML_TEXT_INTEGRATION_POINTS):Le({},Zc),ja=xt(k,"HTML_INTEGRATION_POINTS")&&k.HTML_INTEGRATION_POINTS&&typeof k.HTML_INTEGRATION_POINTS=="object"?jt(k.HTML_INTEGRATION_POINTS):Le({},Jc);const L=xt(k,"CUSTOM_ELEMENT_HANDLING")&&k.CUSTOM_ELEMENT_HANDLING&&typeof k.CUSTOM_ELEMENT_HANDLING=="object"?jt(k.CUSTOM_ELEMENT_HANDLING):ms(null);if(B=ms(null),xt(L,"tagNameCheck")&&ed(L.tagNameCheck)&&(B.tagNameCheck=L.tagNameCheck),xt(L,"attributeNameCheck")&&ed(L.attributeNameCheck)&&(B.attributeNameCheck=L.attributeNameCheck),xt(L,"allowCustomizedBuiltInElements")&&typeof L.allowCustomizedBuiltInElements=="boolean"&&(B.allowCustomizedBuiltInElements=L.allowCustomizedBuiltInElements),At(B),fe&&(se=!1),Nt&&(rt=!0),Gn&&(ye=Le({},Sp),S=ms(null),Gn.html===!0&&(Le(ye,Cp),Le(S,Tp)),Gn.svg===!0&&(Le(ye,Al),Le(S,Rl),Le(S,pi)),Gn.svgFilters===!0&&(Le(ye,El),Le(S,Rl),Le(S,pi)),Gn.mathMl===!0&&(Le(ye,Ol),Le(S,Ap),Le(S,pi))),ie.tagCheck=null,ie.attributeCheck=null,xt(k,"ADD_TAGS")&&(typeof k.ADD_TAGS=="function"?ie.tagCheck=k.ADD_TAGS:kr(k.ADD_TAGS)&&(ye===C&&(ye=jt(ye)),Le(ye,k.ADD_TAGS,at))),xt(k,"ADD_ATTR")&&(typeof k.ADD_ATTR=="function"?ie.attributeCheck=k.ADD_ATTR:kr(k.ADD_ATTR)&&(S===M&&(S=jt(S)),Le(S,k.ADD_ATTR,at))),xt(k,"ADD_URI_SAFE_ATTR")&&kr(k.ADD_URI_SAFE_ATTR)&&Le(La,k.ADD_URI_SAFE_ATTR,at),xt(k,"FORBID_CONTENTS")&&kr(k.FORBID_CONTENTS)&&(kn===Na&&(kn=jt(kn)),Le(kn,k.FORBID_CONTENTS,at)),xt(k,"ADD_FORBID_CONTENTS")&&kr(k.ADD_FORBID_CONTENTS)&&(kn===Na&&(kn=jt(kn)),Le(kn,k.ADD_FORBID_CONTENTS,at)),Qt&&(ye["#text"]=!0),ke&&Le(ye,["html","head","body"]),ye.table&&(Le(ye,["tbody"]),delete K.tbody),k.TRUSTED_TYPES_POLICY){if(typeof k.TRUSTED_TYPES_POLICY.createHTML!="function")throw $r('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof k.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw $r('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const J=T;T=k.TRUSTED_TYPES_POLICY;try{E=te("")}catch(xe){throw T=J,xe}}else k.TRUSTED_TYPES_POLICY===null?(T=void 0,E=""):(T===void 0&&(T=j()),T&&typeof E=="string"&&(E=te("")));Tt&&Tt(k),ss=k},td=Le({},[...Al,...El,...yO]),nd=Le({},[...Ol,...bO]),Jv=function(k,L,J){return L.namespaceURI===Cn?k==="svg":L.namespaceURI===jo?k==="svg"&&(J==="annotation-xml"||Fa[J]):!!td[k]},ey=function(k,L,J){return L.namespaceURI===Cn?k==="math":L.namespaceURI===Ho?k==="math"&&ja[J]:!!nd[k]},ty=function(k,L,J){return L.namespaceURI===Ho&&!ja[J]||L.namespaceURI===jo&&!Fa[J]?!1:!nd[k]&&(Yv[k]||!td[k])},ny=function(k){let L=b(k);(!L||!L.tagName)&&(L={namespaceURI:rs,tagName:"template"});const J=no(k.tagName),xe=no(L.tagName);return Ba[k.namespaceURI]?k.namespaceURI===Ho?Jv(J,L,xe):k.namespaceURI===jo?ey(J,L,xe):k.namespaceURI===Cn?ty(J,L,xe):!!(Ls==="application/xhtml+xml"&&Ba[k.namespaceURI]):!1},hr=function(k){ds(t.removed,{element:k});try{b(k).removeChild(k)}catch{if(g(k),!b(k))throw $r("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Vo=function(k){Va(k);const L=v(k);if(L){const xe=[];cs(L,Ee=>{ds(xe,Ee)}),cs(xe,Ee=>{try{g(Ee)}catch{}})}const J=x(k);if(J)for(let xe=J.length-1;xe>=0;--xe){const Ee=J[xe],Pe=Ee&&Ee.name;if(typeof Pe=="string")try{k.removeAttribute(Pe)}catch{}}},Or=function(k,L){try{ds(t.removed,{attribute:L.getAttributeNode(k),from:L})}catch{ds(t.removed,{attribute:null,from:L})}if(L.removeAttribute(k),k==="is")if(rt||Nt)try{hr(L)}catch{}else try{L.setAttribute(k,"")}catch{}},ry=function(k){const L=x(k);if(L)for(let J=L.length-1;J>=0;--J){const xe=L[J],Ee=xe&&xe.name;if(!(typeof Ee!="string"||S[at(Ee)]))try{k.removeAttribute(Ee)}catch{}}},Va=function(k){const L=[k];for(;L.length>0;){const J=L.pop();(_?_(J):J.nodeType)===tn.element&&ry(J);const Ee=v(J);if(Ee)for(let Pe=Ee.length-1;Pe>=0;--Pe)L.push(Ee[Pe])}},sy=function(k){if(!be)return;const L=[k];for(;L.length>0;){const J=L.pop(),xe=_?_(J):J.nodeType;if(xe===tn.processingInstruction||xe===tn.comment&&bt(Rp,J.data)){try{g(J)}catch{}continue}if(xe===tn.element){const Pe=J,ct=at(R?R(J):J.nodeName);try{Pe.hasAttribute&&Pe.hasAttribute("patchsrc")&&Pe.removeAttribute("patchsrc"),Pe.hasAttribute&&Pe.hasAttribute("for")&&ct!=="label"&&ct!=="output"&&Pe.removeAttribute("for")}catch{}}const Ee=v(J);if(Ee)for(let Pe=Ee.length-1;Pe>=0;--Pe)L.push(Ee[Pe])}},rd=function(k){let L=null,J=null;if(nt)k="<remove></remove>"+k;else{const Pe=xp(k,/^[\r\n\t ]+/);J=Pe&&Pe[0]}Ls==="application/xhtml+xml"&&rs===Cn&&(k='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+k+"</body></html>");const xe=T?te(k):k;if(rs===Cn)try{L=new c().parseFromString(xe,Ls)}catch{}if(!L||!L.documentElement){L=G.createDocument(rs,"template",null);try{L.documentElement.innerHTML=za?E:xe}catch{}}const Ee=L.body||L.documentElement;return k&&J&&Ee.insertBefore(n.createTextNode(J),Ee.childNodes[0]||null),rs===Cn?_e.call(L,ke?"html":"body")[0]:ke?L.documentElement:Ee},sd=function(k){return ue.call(k.ownerDocument||k,k,l.SHOW_ELEMENT|l.SHOW_COMMENT|l.SHOW_TEXT|l.SHOW_PROCESSING_INSTRUCTION|l.SHOW_CDATA_SECTION,null)},Uo=function(k){return k=Qs(k,Ne," "),k=Qs(k,tt," "),k=Qs(k,it," "),k},Ua=function(k){var L;k.normalize();const J=ue.call(k.ownerDocument||k,k,l.SHOW_TEXT|l.SHOW_COMMENT|l.SHOW_CDATA_SECTION|l.SHOW_PROCESSING_INSTRUCTION,null);let xe=J.nextNode();for(;xe;)xe.data=Uo(xe.data),xe=J.nextNode();const Ee=(L=k.querySelectorAll)===null||L===void 0?void 0:L.call(k,"template");Ee&&cs(Ee,Pe=>{os(Pe.content)&&Ua(Pe.content)})},Wo=function(k){const L=R?R(k):null;return typeof L!="string"||at(L)!=="form"?!1:typeof k.nodeName!="string"||typeof k.textContent!="string"||typeof k.removeChild!="function"||k.attributes!==x(k)||typeof k.removeAttribute!="function"||typeof k.setAttribute!="function"||typeof k.namespaceURI!="string"||typeof k.insertBefore!="function"||typeof k.hasChildNodes!="function"||k.nodeType!==_(k)||k.childNodes!==v(k)},os=function(k){if(!_||typeof k!="object"||k===null)return!1;try{return _(k)===tn.documentFragment}catch{return!1}},zs=function(k){if(!_||typeof k!="object"||k===null)return!1;try{return typeof _(k)=="number"}catch{return!1}};function Sn(oe,k,L){oe.length!==0&&cs(oe,J=>{J.call(t,k,L,ss)})}const oy=function(k,L){return!!(be&&k.hasChildNodes()&&!zs(k.firstElementChild)&&bt(Op,k.textContent)&&bt(Op,k.innerHTML)||be&&k.namespaceURI===Cn&&L==="style"&&zs(k.firstElementChild)||k.nodeType===tn.processingInstruction||be&&k.nodeType===tn.comment&&bt(Rp,k.data))},iy=function(k,L){if(!K[L]&&ad(L)&&(B.tagNameCheck instanceof RegExp&&bt(B.tagNameCheck,L)||B.tagNameCheck instanceof Function&&B.tagNameCheck(L)))return!1;if(Qt&&!kn[L]){const J=b(k),xe=v(k);if(xe&&J){const Ee=xe.length;for(let Pe=Ee-1;Pe>=0;--Pe){const ct=ns?xe[Pe]:h(xe[Pe],!0);J.insertBefore(ct,m(k))}}}return hr(k),!0},od=function(k,L){if(Sn(Se.beforeSanitizeElements,k,null),k!==L&&b(k)===null)return!0;if(Wo(k))return hr(k),!0;const J=at(R?R(k):k.nodeName);if(Sn(Se.uponSanitizeElement,k,{tagName:J,allowedTags:ye}),k!==L&&b(k)===null)return!0;if(oy(k,J))return hr(k),!0;if(K[J]||!(ie.tagCheck instanceof Function&&ie.tagCheck(J))&&!ye[J]){const Ee=iy(k,J);return Ee===!1&&Sn(Se.afterSanitizeElements,k,null),Ee}if((_?_(k):k.nodeType)===tn.element&&!ny(k)||(J==="noscript"||J==="noembed"||J==="noframes")&&bt(OO,k.innerHTML))return hr(k),!0;if(fe&&k.nodeType===tn.text){const Ee=Uo(k.textContent);k.textContent!==Ee&&(ds(t.removed,{element:k.cloneNode()}),k.textContent=Ee)}return Sn(Se.afterSanitizeElements,k,null),!1},id=function(k,L,J){if(H[L]||be&&L==="patchsrc"||be&&L==="for"&&k!=="label"&&k!=="output"||pr&&(L==="id"||L==="name")&&(J in n||J in Zv))return!1;const xe=S[L]||ie.attributeCheck instanceof Function&&ie.attributeCheck(L,k);if(!(se&&bt(Qe,L))){if(!(ae&&bt(Be,L))){if(xe){if(!La[L]){if(!bt(we,Qs(J,ge,""))){if(!((L==="src"||L==="xlink:href"||L==="href")&&k!=="script"&&wp(J,"data:")===0&&Yc[k])){if(!(Z&&!bt(U,Qs(J,ge,"")))){if(J)return!1}}}}}else if(!(ad(k)&&(B.tagNameCheck instanceof RegExp&&bt(B.tagNameCheck,k)||B.tagNameCheck instanceof Function&&B.tagNameCheck(k))&&(B.attributeNameCheck instanceof RegExp&&bt(B.attributeNameCheck,L)||B.attributeNameCheck instanceof Function&&B.attributeNameCheck(L,k))||L==="is"&&B.allowCustomizedBuiltInElements&&(B.tagNameCheck instanceof RegExp&&bt(B.tagNameCheck,J)||B.tagNameCheck instanceof Function&&B.tagNameCheck(J))))return!1}}return!0},ay=Le({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ad=function(k){return!ay[no(k)]&&bt(ne,k)},ly=function(k,L,J,xe){if(T&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!J)switch(d.getAttributeType(k,L)){case"TrustedHTML":return te(xe);case"TrustedScriptURL":return re(xe)}return xe},uy=function(k,L,J,xe){try{J?k.setAttributeNS(J,L,xe):k.setAttribute(L,xe),Wo(k)?hr(k):bp(t.removed)}catch{Or(L,k)}},ld=function(k){Sn(Se.beforeSanitizeAttributes,k,null);const L=k.attributes;if(!L||Wo(k))return;const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:S,forceKeepAttr:void 0};let xe=L.length;const Ee=at(k.nodeName);for(;xe--;){const Pe=L[xe],ct=Pe.name,Rt=Pe.namespaceURI,dn=Pe.value,Xt=at(ct),fn=dn;let zt=ct==="value"?fn:dO(fn);if(J.attrName=Xt,J.attrValue=zt,J.keepAttr=!0,J.forceKeepAttr=void 0,Sn(Se.uponSanitizeAttribute,k,J),zt=J.attrValue,Ns&&(Xt==="id"||Xt==="name")&&wp(zt,Ot)!==0&&(Or(ct,k),zt=Ot+zt),be&&bt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,zt)){Or(ct,k);continue}if(Xt==="attributename"&&xp(zt,"href")){Or(ct,k);continue}if(!J.forceKeepAttr){if(!J.keepAttr){Or(ct,k);continue}if(!Te&&bt(RO,zt)){Or(ct,k);continue}if(fe&&(zt=Uo(zt)),!id(Ee,Xt,zt)){Or(ct,k);continue}zt=ly(Ee,Xt,Rt,zt),zt!==fn&&uy(k,ct,Rt,zt)}}Sn(Se.afterSanitizeAttributes,k,null)},Go=function(k){let L=null;const J=sd(k);for(Sn(Se.beforeSanitizeShadowDOM,k,null);L=J.nextNode();)if(Sn(Se.uponSanitizeShadowNode,L,null),od(L,k),ld(L),os(L.content)&&Go(L.content),(_?_(L):L.nodeType)===tn.element){const Ee=w(L);os(Ee)&&(Wa(Ee),Go(Ee))}Sn(Se.afterSanitizeShadowDOM,k,null)},Wa=function(k){const L=[{node:k,shadow:null}];for(;L.length>0;){const J=L.pop();if(J.shadow){Go(J.shadow);continue}const xe=J.node,Pe=(_?_(xe):xe.nodeType)===tn.element,ct=v(xe);if(ct)for(let Rt=ct.length-1;Rt>=0;--Rt)L.push({node:ct[Rt],shadow:null});if(Pe){const Rt=R?R(xe):null;if(typeof Rt=="string"&&at(Rt)==="template"){const dn=xe.content;os(dn)&&L.push({node:dn,shadow:null})}}if(Pe){const Rt=w(xe);os(Rt)&&L.push({node:null,shadow:Rt},{node:Rt,shadow:null})}}};return t.sanitize=function(oe){let k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},L=null,J=null,xe=null,Ee=null;if(za=!oe,za&&(oe="<!-->"),typeof oe!="string"&&!zs(oe)&&(oe=mO(oe),typeof oe!="string"))throw $r("dirty is not a string, aborting");if(!t.isSupported)return oe;Me?(ye=Ve,S=He):Ha(k),(Se.uponSanitizeElement.length>0||Se.uponSanitizeAttribute.length>0)&&(ye=jt(ye)),Se.uponSanitizeAttribute.length>0&&(S=jt(S)),t.removed=[];const Pe=ns&&typeof oe!="string"&&zs(oe);if(Pe){sy(oe);const Xt=R?R(oe):oe.nodeName;if(typeof Xt=="string"){const fn=at(Xt);if(!ye[fn]||K[fn])throw Vo(oe),$r("root node is forbidden and cannot be sanitized in-place")}if(Wo(oe))throw Vo(oe),$r("root node is clobbered and cannot be sanitized in-place");try{Wa(oe)}catch(fn){throw Vo(oe),fn}}else if(zs(oe))L=rd("<!---->"),J=L.ownerDocument.importNode(oe,!0),J.nodeType===tn.element&&J.nodeName==="BODY"||J.nodeName==="HTML"?L=J:L.appendChild(J),Wa(J);else{if(!rt&&!fe&&!ke&&oe.indexOf("<")===-1)return T&&Lt?te(oe):oe;if(L=rd(oe),!L)return rt?null:Lt?E:""}L&&nt&&hr(L.firstChild);const ct=Pe?oe:L,Rt=sd(ct);try{for(;xe=Rt.nextNode();)od(xe,ct),ld(xe),os(xe.content)&&Go(xe.content)}catch(Xt){throw Pe&&(Vo(oe),cs(t.removed,fn=>{fn.element&&Va(fn.element)})),Xt}if(Pe)return cs(t.removed,Xt=>{Xt.element&&Va(Xt.element)}),fe&&Ua(oe),oe;if(rt){if(fe&&Ua(L),Nt)for(Ee=X.call(L.ownerDocument);L.firstChild;)Ee.appendChild(L.firstChild);else Ee=L;return(S.shadowroot||S.shadowrootmode)&&(Ee=le.call(r,Ee,!0)),Ee}let dn=ke?L.outerHTML:L.innerHTML;return ke&&ye["!doctype"]&&L.ownerDocument&&L.ownerDocument.doctype&&L.ownerDocument.doctype.name&&bt(AO,L.ownerDocument.doctype.name)&&(dn="<!DOCTYPE "+L.ownerDocument.doctype.name+`>
|
|
118
|
-
`+dn),fe&&(dn=Uo(dn)),T&&Lt?te(dn):dn},t.setConfig=function(){let oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ha(oe),Me=!0,Ve=ye,He=S},t.clearConfig=function(){ss=null,Me=!1,Ve=null,He=null,T=$,E=""},t.isValidAttribute=function(oe,k,L){ss||Ha({});const J=at(oe),xe=at(k);return id(J,xe,L)},t.addHook=function(oe,k){typeof k=="function"&&xt(Se,oe)&&ds(Se[oe],k)},t.removeHook=function(oe,k){if(xt(Se,oe)){if(k!==void 0){const L=uO(Se[oe],k);return L===-1?void 0:cO(Se[oe],L,1)[0]}return bp(Se[oe])}},t.removeHooks=function(oe){xt(Se,oe)&&(Se[oe]=[])},t.removeAllHooks=function(){Se=Pp()},t}var qO=vv();function Au(e){return`/api/assets/${e.split("/").map(encodeURIComponent).join("/")}`}async function $O(){const e=await fetch("/api/view");if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(`GET /view failed (${e.status}): ${t.error??e.statusText}`)}return e.json()}function MO(e,t){if(e=e.replace(/(<img[^>]+src=")\/uploads\//g,`$1${Au("uploads/")}`),!t)return e;let n;try{n=new URL(t).origin}catch{return e}return e.replace(/(<img[^>]+src=")\/(?!\/)/g,`$1${n}/`)}function qa(e,t){const n=Ye.parse(e,{async:!1,breaks:!0});return qO.sanitize(MO(n,t))}const Ip=3;function Eu(e,t){const n=e.find(r=>r.path===t.path);if(!n)return null;if(t.type==="hunk"){const r=n.hunks[t.hunkIndex];return r?{path:t.path,lines:r.lines}:null}if(t.type==="line"){for(const r of n.hunks){const s=r.lines.findIndex(a=>t.side==="base"?a.oldLine===t.line:a.newLine===t.line);if(s===-1)continue;const o=Math.max(0,s-Ip),i=Math.min(r.lines.length,s+Ip+1);return{path:t.path,lines:r.lines.slice(o,i)}}return null}return null}const Ao=un([]),yv="review-workspace:write-token",gn=$t({questions:[],writeToken:localStorage.getItem(yv)??"",loading:!1,error:null});function DO(e){gn.writeToken=e,localStorage.setItem(yv,e)}function NO(){return gn.writeToken}async function $a(e){return(await e.json().catch(()=>({}))).error??e.statusText}async function Ma(){gn.loading=!0;try{const e=await fetch("/api/questions");if(!e.ok)throw new Error(`GET /questions failed: ${await $a(e)}`);gn.questions=await e.json(),gn.error=null}catch(e){gn.error=e instanceof Error?e.message:String(e)}finally{gn.loading=!1}}async function LO(e,t,n="question"){const r=await fetch("/api/questions",{method:"POST",headers:{"content-type":"application/json","x-write-token":gn.writeToken},body:JSON.stringify({body:e,target:t,kind:n})});if(!r.ok)throw new Error(`Could not raise Comment: ${await $a(r)}`);await Ma()}async function zO(e,t,n){const r=await fetch(`/api/questions/${e}/withdraw`,{method:"POST",headers:{"content-type":"application/json","x-write-token":gn.writeToken},body:JSON.stringify({body:t,target:n})});if(!r.ok)throw new Error(`Could not withdraw Question: ${await $a(r)}`);await Ma()}async function BO(e){const t=await fetch(`/api/questions/${e}/resolve`,{method:"POST",headers:{"x-write-token":gn.writeToken}});if(!t.ok)throw new Error(`Could not resolve Comment: ${await $a(t)}`);await Ma()}function bv(){return ho(gn)}const Ps=$t({data:{}});async function FO(){const e=await fetch("/state");Ps.data=e.ok?await e.json():{}}async function jO(){await fetch("/state",{method:"PUT",headers:{"content-type":"application/json","x-write-token":NO()},body:JSON.stringify(Ps.data)})}function xv(e,t){const n=new Set(Ps.data[e]??[]);n.has(t)?n.delete(t):n.add(t),Ps.data[e]=[...n],jO()}function HO(e){var t;return((t=Ps.data.reviewedFiles)==null?void 0:t.includes(e))??!1}function VO(e){xv("reviewedFiles",e)}function wv(e){var t;return((t=Ps.data.resolvedNotes)==null?void 0:t.includes(e))??!1}function _v(e){xv("resolvedNotes",e)}const UO={slots:{root:"relative inline-flex items-center",base:["w-full rounded-md border-0 appearance-none placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute start-0 flex items-start",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute end-0 flex items-start",trailingIcon:"shrink-0 text-dimmed"},variants:{fieldGroup:{horizontal:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"},vertical:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"}},size:{xs:{base:"px-2 py-1 text-sm/4 gap-1",leading:"ps-2 inset-y-1",trailing:"pe-2 inset-y-1",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},sm:{base:"px-2.5 py-1.5 text-sm/4 gap-1.5",leading:"ps-2.5 inset-y-1.5",trailing:"pe-2.5 inset-y-1.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},md:{base:"px-2.5 py-1.5 text-base/5 gap-1.5",leading:"ps-2.5 inset-y-1.5",trailing:"pe-2.5 inset-y-1.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},lg:{base:"px-3 py-2 text-base/5 gap-2",leading:"ps-3 inset-y-2",trailing:"pe-3 inset-y-2",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3 inset-y-2",trailing:"pe-3 inset-y-2",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent focus:outline-none"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},fixed:{false:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"},autoresize:{true:{base:"resize-none"}}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"outline-success/25 focus-visible:outline-3 focus-visible:ring-success"},{color:"info",variant:["outline","subtle"],class:"outline-info/25 focus-visible:outline-3 focus-visible:ring-info"},{color:"warning",variant:["outline","subtle"],class:"outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning"},{color:"error",variant:["outline","subtle"],class:"outline-error/25 focus-visible:outline-3 focus-visible:ring-error"},{color:"primary",variant:["soft","ghost"],class:"outline-primary/25 focus-visible:outline-3"},{color:"secondary",variant:["soft","ghost"],class:"outline-secondary/25 focus-visible:outline-3"},{color:"success",variant:["soft","ghost"],class:"outline-success/25 focus-visible:outline-3"},{color:"info",variant:["soft","ghost"],class:"outline-info/25 focus-visible:outline-3"},{color:"warning",variant:["soft","ghost"],class:"outline-warning/25 focus-visible:outline-3"},{color:"error",variant:["soft","ghost"],class:"outline-error/25 focus-visible:outline-3"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted"},{color:"neutral",variant:["soft","ghost"],class:"outline-inverted/25 focus-visible:outline-3"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}},{fixed:!1,size:"xs",class:"md:text-xs"},{fixed:!1,size:"sm",class:"md:text-xs"},{fixed:!1,size:"md",class:"md:text-sm"},{fixed:!1,size:"lg",class:"md:text-sm"}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},WO=["id","value","name","rows","placeholder","disabled","required"],kv=Object.assign({inheritAttrs:!1},{__name:"Textarea",props:{as:{type:null,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},autoresize:{type:Boolean,required:!1},autoresizeDelay:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},rows:{type:Number,required:!1,default:3},maxrows:{type:Number,required:!1,default:0},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:["update:modelValue","blur","change"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=Vn(),i=Mt("textarea",r),a=Fn(i,"modelValue",s,{defaultValue:i.defaultValue}),l=pt(),{emitFormFocus:u,emitFormBlur:c,emitFormInput:d,emitFormChange:p,size:h,color:g,id:m,name:v,highlight:b,disabled:w,ariaAttrs:x}=Ic(r,{deferInputValidation:!0}),{isLeading:_,isTrailing:R,leadingIconName:T,trailingIconName:E}=Ra(i),$=A(()=>{var G;return Dt({extend:UO,...((G=l.ui)==null?void 0:G.textarea)||{}})({color:g.value??i.color,variant:i.variant,size:(h==null?void 0:h.value)??i.size,loading:i.loading,highlight:b.value??i.highlight,fixed:i.fixed,autoresize:i.autoresize,leading:_.value||!!i.avatar||!!o.leading,trailing:R.value||!!o.trailing})}),N=Hr("textareaRef");function D(G){var ue,X,_e,le,Se;(ue=i.modelModifiers)!=null&&ue.trim&&(typeof G=="string"||G===null||G===void 0)&&(G=(G==null?void 0:G.trim())??null),(X=i.modelModifiers)!=null&&X.number&&(G=Zg(G)),(_e=i.modelModifiers)!=null&&_e.nullable&&(G||(G=null)),(le=i.modelModifiers)!=null&&le.optional&&!((Se=i.modelModifiers)!=null&&Se.nullable)&&G!==null&&(G||(G=void 0)),a.value=G,d()}function Y(G){var ue;de(),(ue=i.modelModifiers)!=null&&ue.lazy||D(G.target.value)}function te(G){var X,_e;const ue=G.target.value;(X=i.modelModifiers)!=null&&X.lazy&&D(ue),(_e=i.modelModifiers)!=null&&_e.trim&&(G.target.value=ue.trim()),p(),s("change",G)}function re(G){c(),s("blur",G)}function j(){var G;i.autofocus&&((G=N.value)==null||G.focus())}function de(){if(i.autoresize&&N.value){N.value.rows=i.rows;const G=N.value.style.overflow;N.value.style.overflow="hidden";const ue=window.getComputedStyle(N.value),X=Number.parseInt(ue.paddingTop),_e=Number.parseInt(ue.paddingBottom),le=X+_e,Se=Number.parseInt(ue.lineHeight),{scrollHeight:Ne}=N.value,tt=(Ne-le)/Se;tt>i.rows&&(N.value.rows=i.maxrows?Math.min(tt,i.maxrows):tt),N.value.style.overflow=G}}return De(a,()=>{ut(de)}),ft(()=>{setTimeout(()=>{j()},i.autofocusDelay),setTimeout(async()=>{await ut(),de()},i.autoresizeDelay)}),t({textareaRef:N,autoResize:de}),(G,ue)=>{var X;return y(),P(f(Ie),{as:f(i).as,"data-slot":G.$attrs["data-slot"]??"root",class:he($.value.root({class:[(X=f(i).ui)==null?void 0:X.root,f(i).class]}))},{default:O(()=>{var _e,le,Se;return[q("textarea",ce({id:f(m),ref_key:"textareaRef",ref:N,value:f(a),name:f(v),rows:f(i).rows,placeholder:f(i).placeholder,class:$.value.base({class:(_e=f(i).ui)==null?void 0:_e.base}),disabled:f(w),required:f(i).required},{...G.$attrs,...f(x)},{"data-slot":"base",onInput:Y,onBlur:re,onChange:te,onFocus:ue[0]||(ue[0]=(...Ne)=>f(u)&&f(u)(...Ne))}),null,16,WO),V(G.$slots,"default",{ui:$.value}),f(_)||f(i).avatar||o.leading?(y(),I("span",{key:0,"data-slot":"leading",class:he($.value.leading({class:(le=f(i).ui)==null?void 0:le.leading}))},[V(G.$slots,"leading",{ui:$.value},()=>{var Ne,tt,it;return[f(_)&&f(T)?(y(),P(en,{key:0,name:f(T),"data-slot":"leadingIcon",class:he($.value.leadingIcon({class:(Ne=f(i).ui)==null?void 0:Ne.leadingIcon}))},null,8,["name","class"])):f(i).avatar?(y(),P(Bo,ce({key:1,size:((tt=f(i).ui)==null?void 0:tt.leadingAvatarSize)||$.value.leadingAvatarSize()},f(i).avatar,{"data-slot":"leadingAvatar",class:$.value.leadingAvatar({class:(it=f(i).ui)==null?void 0:it.leadingAvatar})}),null,16,["size","class"])):F("",!0)]})],2)):F("",!0),f(R)||o.trailing?(y(),I("span",{key:1,"data-slot":"trailing",class:he($.value.trailing({class:(Se=f(i).ui)==null?void 0:Se.trailing}))},[V(G.$slots,"trailing",{ui:$.value},()=>{var Ne;return[f(E)?(y(),P(en,{key:0,name:f(E),"data-slot":"trailingIcon",class:he($.value.trailingIcon({class:(Ne=f(i).ui)==null?void 0:Ne.trailingIcon}))},null,8,["name","class"])):F("",!0)]})],2)):F("",!0)]}),_:3},8,["as","data-slot","class"])}}}),GO={base:"relative",variants:{size:{xs:"",sm:"",md:"",lg:"",xl:""},orientation:{horizontal:"inline-flex -space-x-px",vertical:"flex flex-col -space-y-px"}}},Hc={__name:"FieldGroup",props:{as:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(e){const n=Mt("fieldGroup",e),r=pt(),s=A(()=>{var o;return Dt({extend:GO,...((o=r.ui)==null?void 0:o.fieldGroup)||{}})});return sn(Oc,A(()=>({orientation:n.orientation,size:n.size}))),(o,i)=>{var a;return y(),P(f(Ie),{as:f(n).as,"data-orientation":f(n).orientation,class:he(s.value({orientation:f(n).orientation,class:[(a=f(n).ui)==null?void 0:a.base,f(n).class]}))},{default:O(()=>[V(o.$slots,"default")]),_:3},8,["as","data-orientation","class"])}}};function Cv(e){const t=bv(),n=Q(""),r=Q("question"),s=Q(!1),o=Q(null),i=Q(null),a=Q("");async function l(p){if(n.value.trim()){s.value=!0,o.value=null;try{await LO(n.value.trim(),e(),r.value),n.value="",r.value="question",p()}catch(h){o.value=h instanceof Error?h.message:String(h)}finally{s.value=!1}}}function u(p){i.value=p,a.value=""}async function c(p,h){if(a.value.trim()){s.value=!0,o.value=null;try{await zO(p,a.value.trim(),e()),i.value=null,a.value="",h()}catch(g){o.value=g instanceof Error?g.message:String(g)}finally{s.value=!1}}}async function d(p){s.value=!0,o.value=null;try{await BO(p)}catch(h){o.value=h instanceof Error?h.message:String(h)}finally{s.value=!1}}return{store:t,draft:n,draftKind:r,busy:s,localError:o,editingId:i,editDraft:a,submitNewQuestion:l,startEdit:u,submitEdit:c,resolve:d}}const KO={key:0,class:"flex flex-wrap gap-2"},YO={key:0,class:"mt-1 text-error"},QO={key:1,class:"mt-1 text-warning"},XO={class:"mt-1 flex gap-2"},Vc=ee({__name:"AskQuestionForm",props:{target:{},annotation:{}},setup(e){const t=e,n=Q(!1),{draft:r,draftKind:s,busy:o,localError:i,submitNewQuestion:a,store:l}=Cv(()=>t.target),u=A(()=>l.writeToken.length>0),c=[{value:"question",label:"Question"},{value:"change-request",label:"Change request"}];function d(){n.value=!1}function p(){var h;s.value="change-request",r.value=((h=t.annotation)==null?void 0:h.summary)??"",n.value=!0}return(h,g)=>{const m=cn,v=Hc,b=kv;return y(),I("div",null,[n.value?(y(),I(pe,{key:1},[W(v,{size:"xs",class:"mb-2"},{default:O(()=>[(y(),I(pe,null,$e(c,w=>W(m,{key:w.value,variant:f(s)===w.value?"solid":"outline",color:w.value==="change-request"?"error":"neutral",onClick:x=>s.value=w.value},{default:O(()=>[Ce(z(w.label),1)]),_:2},1032,["variant","color","onClick"])),64))]),_:1}),W(b,{modelValue:f(r),"onUpdate:modelValue":g[1]||(g[1]=w=>Xe(r)?r.value=w:null),size:"sm",class:"w-full",rows:2,placeholder:f(s)==="change-request"?"What needs to change?":"What's the reasoning here?"},null,8,["modelValue","placeholder"]),f(i)?(y(),I("p",YO,z(f(i)),1)):F("",!0),u.value?F("",!0):(y(),I("p",QO,"Set your write token first (top right).")),q("div",XO,[W(m,{size:"xs",disabled:f(o)||!u.value,onClick:g[2]||(g[2]=w=>f(a)(d))},{default:O(()=>[Ce(z(f(s)==="change-request"?"Raise change request":"Ask"),1)]),_:1},8,["disabled"]),W(m,{size:"xs",variant:"ghost",onClick:d},{default:O(()=>[...g[5]||(g[5]=[Ce("Cancel",-1)])]),_:1})])],64)):(y(),I("span",KO,[W(m,{size:"xs",variant:"ghost",onClick:g[0]||(g[0]=w=>n.value=!0)},{default:O(()=>[...g[3]||(g[3]=[Ce("Ask a question",-1)])]),_:1}),e.annotation?(y(),P(m,{key:0,size:"xs",variant:"ghost",color:"error",onClick:p},{default:O(()=>[...g[4]||(g[4]=[Ce(" Flag as change-request ",-1)])]),_:1})):F("",!0)]))])}}}),ZO=new Set(["as","async","await","break","case","catch","class","const","continue","default","delete","do","else","export","extends","false","finally","for","from","function","if","implements","import","in","interface","keyof","let","new","null","of","readonly","return","switch","throw","true","try","type","typeof","undefined","var","while"]),JO={comment:"italic text-[var(--syntax-comment)]",keyword:"font-semibold text-[var(--syntax-keyword)]",string:"text-[var(--syntax-string)]",number:"text-[var(--syntax-number)]",function:"text-[var(--syntax-function)]",type:"text-[var(--syntax-type)]",property:"text-[var(--syntax-property)]",operator:"text-[var(--syntax-operator)]"},eR=/(\/\/.*|\/\*.*?\*\/|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`|\b\d+(?:\.\d+)?\b|[A-Za-z_$][\w$]*|\s+|.)/g,tR={"&":"&","<":"<",">":">",'"':""","'":"'"};function nR(e){return e.replace(/[&<>"']/g,t=>tR[t])}function Eo(e){const t=String(e);let n="";for(const r of t.matchAll(eR)){const s=r[0],o=r.index??0,i=t.slice(0,o).trimEnd().at(-1),a=t.slice(o+s.length).trimStart().at(0);let l="";s.startsWith("//")||s.startsWith("/*")?l="comment":/^["'`]/.test(s)?l="string":/^\d/.test(s)?l="number":ZO.has(s)?l="keyword":/^[A-Z][A-Za-z0-9_$]*$/.test(s)?l="type":/^[A-Za-z_$]/.test(s)&&a==="("?l="function":/^[A-Za-z_$]/.test(s)&&(i==="."||a===":")?l="property":/^[{}[\]().,:;?=><!&|+\-*/]+$/.test(s)&&(l="operator");const u=nR(s);n+=l?`<span class="${JO[l]}">${u}</span>`:u}return n}const rR={class:"max-w-full overflow-x-auto rounded border border-default bg-default p-1.5 font-mono text-[10px]"},sR={class:"mr-1.5 select-none text-dimmed"},oR=["innerHTML"],qp=ee({__name:"DiffLinesPreview",props:{lines:{}},setup(e){return(t,n)=>(y(),I("div",rR,[(y(!0),I(pe,null,$e(e.lines,r=>(y(),I("div",{key:r.id,class:he(["whitespace-pre",{"bg-success/10":r.kind==="add","bg-error/10":r.kind==="remove"}])},[q("span",sR,z(r.kind==="add"?"+":r.kind==="remove"?"−":" "),1),q("code",{innerHTML:f(Eo)(r.text)},null,8,oR)],2))),128))]))}});function Sv(e){const t=e.indexOf(". "),n=e.indexOf(" — "),r=[t,n].filter(i=>i>=0);if(!r.length)return{headline:e,body:""};const s=Math.min(...r),o=s===n;return{headline:e.slice(0,s+(o?0:1)).trim(),body:e.slice(s+(o?3:2)).trim()}}function Uc(e){var n;const t=new Map;for(const r of e)for(const s of r.verification)t.has(s.id)||t.set(s.id,{verification:s,annotationId:(n=r.annotations.find(o=>o.verification.some(i=>i.id===s.id)))==null?void 0:n.id,path:r.path});return[...t.values()]}function Tv(e){const t=new Map;for(const r of e)for(const s of r.verification)t.set(s.id,s);const n={verified:0,unverified:0,gap:0};for(const r of t.values())n[r.status]++;return n}const $p={high:0,medium:1,low:2};function Wc(e){const t=new Map(e.flatMap(n=>n.filePaths.map(r=>[r,n.risk])));return n=>t.get(n)}function Gc(e,t){return e.filter(n=>n.verification.status!=="verified").sort((n,r)=>($p[t(n.path)??"low"]??3)-($p[t(r.path)??"low"]??3))}const iR={class:"mb-1 flex flex-wrap items-start justify-between gap-2"},aR={class:"text-sm font-semibold text-highlighted"},lR={class:"flex items-center gap-2"},uR=["innerHTML"],cR={key:2,class:"mb-3 space-y-1 text-xs"},dR={class:"text-muted"},fR={key:3,class:"mb-2 flex flex-wrap items-center gap-1.5 text-[11px]"},pR={key:4,class:"mb-2 space-y-1 border-t border-default pt-2 text-xs"},hR=["onMouseenter"],gR=["onClick"],mR={class:"text-muted"},vR={class:"flex items-center gap-3"},yR={class:"mt-3 border-t border-default pt-2"},Av=ee({__name:"AnnotationCard",props:{annotation:{},defaultExpanded:{type:Boolean,default:!1},jumpToDiff:{}},setup(e){const t=e,n=A(()=>Sv(t.annotation.summary)),r=Q(t.defaultExpanded);De(()=>t.annotation.id,()=>{r.value=t.defaultExpanded});const s={verified:"✓",gap:"⚑",unverified:"○"},o={verified:"success",gap:"error",unverified:"neutral"},i={observed:"observed","author-claim":"claim",inference:"inference"},a={observed:"success","author-claim":"warning",inference:"neutral"};function l(g){var m;if(t.jumpToDiff){t.jumpToDiff(g);return}(m=document.getElementById(Ms(g)))==null||m.scrollIntoView({behavior:"smooth",block:"start"})}const u=Q(null);function c(g){var v;const m=(v=t.annotation.relatedTargets)==null?void 0:v[g];return m?Eu(Ao.value,m.target):null}const d=A(()=>wv(t.annotation.id)),p=Q(!1),h=A(()=>Eu(Ao.value,t.annotation.target));return De(()=>t.annotation.id,()=>{p.value=!1}),(g,m)=>{var w;const v=Wn,b=qc;return y(),I("article",{class:he(["rounded-lg border p-4",d.value?"border-success bg-success/5":"border-default bg-elevated"])},[q("div",iR,[q("h3",aR,z(n.value.headline),1),q("span",lR,[e.annotation.kind?(y(),P(v,{key:0,size:"sm",variant:"subtle",color:"primary"},{default:O(()=>[Ce(z(e.annotation.kind),1)]),_:1})):F("",!0),W(b,{"model-value":d.value,label:"Resolved",size:"sm","onUpdate:modelValue":m[0]||(m[0]=x=>f(_v)(e.annotation.id))},null,8,["model-value"])])]),n.value.body?(y(),I("button",{key:0,type:"button",class:"mb-2 text-xs text-primary hover:underline",onClick:m[1]||(m[1]=x=>r.value=!r.value)},z(r.value?"▾ hide detail":"▸ detail"),1)):F("",!0),r.value&&n.value.body?(y(),I("div",{key:1,class:"markdown-body mb-3 text-sm text-muted",innerHTML:f(qa)(n.value.body)},null,8,uR)):F("",!0),e.annotation.verification.length?(y(),I("ul",cR,[(y(!0),I(pe,null,$e(e.annotation.verification,x=>(y(),I("li",{key:x.id,class:"flex items-start gap-1.5"},[q("span",{class:he(`text-${o[x.status]}`)},z(s[x.status]),3),q("span",dR,z(x.description),1)]))),128))])):F("",!0),e.annotation.evidence.length?(y(),I("div",fR,[m[5]||(m[5]=q("span",{class:"text-dimmed uppercase tracking-wide"},"Evidence",-1)),(y(!0),I(pe,null,$e(e.annotation.evidence,x=>(y(),P(v,{key:x.id,size:"sm",variant:"subtle",color:a[x.kind],title:x.description},{default:O(()=>{var _;return[Ce(z(((_=x.pipeline)==null?void 0:_.jobName)??i[x.kind])+" · "+z(i[x.kind]),1)]}),_:2},1032,["color","title"]))),128))])):F("",!0),(w=e.annotation.relatedTargets)!=null&&w.length?(y(),I("ul",pR,[(y(!0),I(pe,null,$e(e.annotation.relatedTargets,(x,_)=>(y(),I("li",{key:_,onMouseenter:R=>u.value=_,onMouseleave:m[2]||(m[2]=R=>u.value=null)},[q("button",{type:"button",class:"font-mono text-primary hover:underline",onClick:R=>l(x.target.path)}," → "+z(x.target.path),9,gR),q("span",mR," — "+z(x.reason),1),u.value===_&&c(_)?(y(),P(qp,{key:0,class:"mt-1",lines:c(_).lines},null,8,["lines"])):F("",!0)],40,hR))),128))])):F("",!0),q("div",vR,[h.value?(y(),I("button",{key:0,type:"button",class:"text-xs font-medium text-primary hover:underline",onClick:m[3]||(m[3]=x=>p.value=!p.value)},z(p.value?"▾ close diff preview":"▸ preview diff"),1)):F("",!0),q("button",{type:"button",class:"text-xs font-medium text-primary hover:underline",onClick:m[4]||(m[4]=x=>l(e.annotation.target.path))}," → jump to diff ")]),p.value&&h.value?(y(),P(qp,{key:5,class:"mt-2",lines:h.value.lines},null,8,["lines"])):F("",!0),q("div",yR,[W(Vc,{target:e.annotation.target,annotation:e.annotation},null,8,["target","annotation"])])],2)}}}),Ev=$t(new Map);function bR(e,t){return Ev.get(e)??t}function xR(e,t){Ev.set(e,!t)}const wR=300;function _R(e){return e.hunks.reduce((t,n)=>t+n.lines.filter(r=>r.kind==="add").length,0)}function kR(e){return e.hunks.reduce((t,n)=>t+n.lines.filter(r=>r.kind==="remove").length,0)}function Ov(e){return e.hunks.reduce((t,n)=>t+n.lines.length,0)}function CR(e,t=wR){return!e.binary&&Ov(e)>t}function SR(e){return e.annotations.filter(t=>t.target.type!=="line")}function TR(e){const t=[];return e.hunks.forEach((n,r)=>{for(const s of n.lines)for(const o of s.annotations)t.push({annotation:o,hunkIndex:r,lineId:s.id})}),t}const Rv=$t(new Set);function Pv(e,t){return`${e}#${t}`}function Iv(e,t){return Rv.has(Pv(e,t))}function Oo(e,t){Rv.add(Pv(e,t))}function AR(e,t,n){return n.map(r=>{const s=t.find(a=>a.questionId===r.id),o=r.target;if(!o)return{question:r,answer:s};const i=e.find(a=>a.path===o.path);if(!i)return{question:r,answer:s,filePath:o.path};if(o.type==="line")for(let a=0;a<i.hunks.length;a++){const l=i.hunks[a].lines.find(u=>o.side==="base"?u.oldLine===o.line:u.newLine===o.line);if(l)return{question:r,answer:s,filePath:i.path,hunkIndex:a,lineId:l.id}}return{question:r,answer:s,filePath:i.path}})}function ER(e){return e.filter(t=>t.question.status!=="open"?!1:t.question.kind==="change-request"?!t.question.resolved:!t.answer).length}async function OR(e){var n;if(!e.filePath)return;e.hunkIndex!==void 0&&Oo(e.filePath,e.hunkIndex),await ut();const t=e.lineId?To(e.lineId):Ms(e.filePath);(n=document.getElementById(t))==null||n.scrollIntoView({behavior:"smooth",block:"center"})}async function qv(e,t,n){var r;Oo(e,t),await ut(),(r=document.getElementById(To(n)))==null||r.scrollIntoView({behavior:"smooth",block:"center"})}function RR(e,t,n,r){return r!==void 0?{type:"line",path:e,side:"head",line:r,expectedText:t}:{type:"line",path:e,side:"base",line:n,expectedText:t}}function $v(e,t){return e.filter(n=>{var r;return((r=n.target)==null?void 0:r.path)===t})}function PR(e,t){return $v(e,t).filter(n=>{var r;return((r=n.target)==null?void 0:r.type)!=="line"})}function Ou(e,t,n,r){return r===void 0?[]:$v(e,t).filter(s=>{var o;return((o=s.target)==null?void 0:o.type)==="line"&&s.target.side===n&&s.target.line===r})}const IR={Root:_S,Trigger:PS,Portal:OS,Content:AS,Arrow:bS},qR={Root:eS,Trigger:vS,Portal:gS,Content:pS,Arrow:sS,Close:iS,Anchor:nS};function Mv(e,t={}){const n=e.detail.originalEvent,r=n.target;if(!(r!=null&&r.isConnected)){e.preventDefault();return}t.scrollable&&(n.offsetX>r.clientWidth||n.offsetY>r.clientHeight)&&e.preventDefault()}const $R={slots:{content:"bg-default shadow-lg rounded-md ring ring-default data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-popover-content-transform-origin) focus:outline-none pointer-events-auto",arrow:"fill-bg stroke-default"}},Da={__name:"Popover",props:{mode:{type:null,required:!1,default:"click"},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:null,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},modal:{type:Boolean,required:!1},openDelay:{type:Number,required:!1,default:0},closeDelay:{type:Number,required:!1,default:0},enableTouch:{type:Boolean,required:!1}},emits:["close:prevent","update:open"],setup(e,{emit:t}){const n=e,r=t,s=Vn(),o=Mt("popover",n),i=pt(),a=o.mode==="hover"?zn(o,"defaultOpen","open","openDelay","closeDelay","enableTouch"):zn(o,"defaultOpen","open","modal"),l=fr(a,r),u=Ea(Ct(()=>o.portal)),c=Ct(()=>wn(o.content,{side:"bottom",sideOffset:8,collisionPadding:8})),d=A(()=>o.dismissible?{pointerDownOutside:Mv}:["interactOutside","escapeKeyDown"].reduce((v,b)=>(v[b]=w=>{w.preventDefault(),r("close:prevent")},v),{})),p=Ct(()=>wn(o.arrow,{rounded:!0})),h=A(()=>{var m;return Dt({extend:$R,...((m=i.ui)==null?void 0:m.popover)||{}})({side:c.value.side})}),g=A(()=>o.mode==="hover"?IR:qR);return(m,v)=>(y(),P(f(g).Root,st(lt(f(l))),{default:O(({open:b,close:w})=>[s.default?(y(),P(f(g).Trigger,{key:0,"as-child":"",class:he(f(o).class)},{default:O(()=>[V(m.$slots,"default",{open:b})]),_:2},1032,["class"])):F("",!0),"Anchor"in g.value&&s.anchor?(y(),P(f(g).Anchor,{key:1,"as-child":""},{default:O(()=>[V(m.$slots,"anchor",st(lt(w?{close:w}:{})))]),_:2},1024)):F("",!0),W(f(g).Portal,st(lt(f(u))),{default:O(()=>[W(f(Pc),null,{default:O(()=>{var x,_;return[W(f(g).Content,ce(c.value,{reference:f(o).reference??((x=f(o).content)==null?void 0:x.reference),"data-slot":"content",class:h.value.content({class:[!s.default&&f(o).class,(_=f(o).ui)==null?void 0:_.content]})},Uu(d.value)),{default:O(()=>{var R;return[V(m.$slots,"content",st(lt(w?{close:w}:{}))),f(o).arrow?(y(),P(f(g).Arrow,ce({key:0},p.value,{"data-slot":"arrow",class:h.value.arrow({class:(R=f(o).ui)==null?void 0:R.arrow})}),null,16,["class"])):F("",!0)]}),_:2},1040,["reference","class"])]}),_:2},1024)]),_:2},1040)]),_:3},16))}},MR=["aria-label"],DR={class:"w-80 max-h-96 overflow-y-auto p-3 text-left font-sans text-xs whitespace-normal break-words normal-case select-text"},NR={class:"mb-1.5 flex items-center gap-2"},LR=["innerHTML"],zR={key:0,class:"mt-2 space-y-1 border-t border-default pt-2"},BR=["onMouseenter"],FR=["onClick"],jR={class:"text-muted"},HR={key:0,class:"mt-1 max-w-full overflow-x-auto rounded border border-default bg-elevated p-1.5 font-mono text-[10px] normal-case"},VR={class:"mr-1.5 select-none text-dimmed"},UR=["innerHTML"],WR={class:"mt-2 border-t border-default pt-2"},Dv=ee({__name:"AnnotationBadge",props:{annotation:{},number:{}},setup(e){const t=e,n=A(()=>wv(t.annotation.id));function r(i){var a;(a=document.getElementById(Ms(i)))==null||a.scrollIntoView({behavior:"smooth",block:"start"})}const s=Q(null);function o(i){var l;const a=(l=t.annotation.relatedTargets)==null?void 0:l[i];return a?Eu(Ao.value,a.target):null}return(i,a)=>{const l=Wn,u=qc,c=Da;return y(),P(c,{class:"ml-1 inline-grid align-middle"},{content:O(()=>{var d;return[q("div",DR,[q("span",NR,[W(l,{size:"sm",variant:"subtle",color:"primary"},{default:O(()=>[Ce(z(e.annotation.kind??"note"),1)]),_:1}),W(u,{class:"ml-auto","model-value":n.value,label:"Resolved",size:"sm","onUpdate:modelValue":a[0]||(a[0]=p=>f(_v)(e.annotation.id))},null,8,["model-value"])]),q("div",{class:"markdown-body text-muted",innerHTML:f(qa)(e.annotation.summary)},null,8,LR),(d=e.annotation.relatedTargets)!=null&&d.length?(y(),I("ul",zR,[(y(!0),I(pe,null,$e(e.annotation.relatedTargets,(p,h)=>(y(),I("li",{key:h,class:"leading-relaxed",onMouseenter:g=>s.value=h,onMouseleave:a[1]||(a[1]=g=>s.value=null)},[q("button",{type:"button",class:"font-mono text-primary hover:underline",onClick:g=>r(p.target.path)}," → "+z(p.target.path),9,FR),q("span",jR," — "+z(p.reason),1),s.value===h&&o(h)?(y(),I("div",HR,[(y(!0),I(pe,null,$e(o(h).lines,g=>(y(),I("div",{key:g.id,class:he(["whitespace-pre",{"bg-success/10":g.kind==="add","bg-error/10":g.kind==="remove"}])},[q("span",VR,z(g.kind==="add"?"+":g.kind==="remove"?"−":" "),1),q("code",{innerHTML:f(Eo)(g.text)},null,8,UR)],2))),128))])):F("",!0)],40,BR))),128))])):F("",!0),q("div",WR,[W(Vc,{target:e.annotation.target,annotation:e.annotation},null,8,["target","annotation"])])])]}),default:O(()=>[q("button",{type:"button",class:he(["grid h-[18px] w-[18px] place-items-center rounded-full border text-[10px] font-bold transition hover:scale-110 focus-visible:scale-110 focus-visible:outline-none",n.value?"border-success/60 bg-success/15 text-success hover:bg-success hover:text-inverted focus-visible:bg-success focus-visible:text-inverted":"border-warning/60 bg-warning/15 text-warning hover:bg-warning hover:text-inverted focus-visible:bg-warning focus-visible:text-inverted"]),"aria-label":`Note ${e.number}${n.value?" (resolved)":""}: ${e.annotation.summary}`},z(e.number),11,MR)]),_:1})}}}),Nv=50;function Lv(e,t,n=Nv){return e||t.length<=n?t:t.slice(0,n)}function zv(e,t,n=Nv){return e?0:Math.max(0,t.length-n)}const Lr=$t({open:!1,x:0,y:0,symbol:"",occurrences:[]});function GR(){return Lr}function KR(e,t,n,r){Lr.x=e,Lr.y=t,Lr.symbol=n,Lr.occurrences=r,Lr.open=!0}function Mp(){Lr.open=!1}const hi=/[\w$]/;function YR(e,t){if(!hi.test(e[t]??"")&&!hi.test(e[t-1]??""))return null;let n=t;for(;n>0&&hi.test(e[n-1]);)n--;let r=t;for(;r<e.length&&hi.test(e[r]);)r++;const s=e.slice(n,r);return/^[A-Za-z_$]/.test(s)?s:null}function QR(e,t){var s;const n=(s=document.caretRangeFromPoint)==null?void 0:s.call(document,e,t),r=n==null?void 0:n.startContainer;return!r||r.nodeType!==Node.TEXT_NODE?null:YR(r.textContent??"",n.startOffset)}function ys(e){if(!e.metaKey&&!e.ctrlKey)return;const t=QR(e.clientX,e.clientY);if(!t)return;const n=XR(Ao.value,t);n.length<=1||KR(e.clientX,e.clientY,t,n)}function XR(e,t){const n=new RegExp(`\\b${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`),r=[];for(const s of e)s.hunks.forEach((o,i)=>{for(const a of o.lines)n.test(a.text)&&r.push({path:s.path,hunkIndex:i,lineId:a.id,lineNumber:a.newLine??a.oldLine??0,text:a.text})});return r}function ZR(e){switch(e.kind){case"stale-line-target":return`Stale annotation: ${e.detail}`;case"invalid-field":return`Invalid field (${e.instancePath}): ${e.message}`;case"unresolved-target":return`Unresolved ${e.targetType} target: ${e.detail}`;case"missing-asset":return`Missing asset: ${e.assetPath}`;case"unsafe-asset-path":return`Unsafe asset path: ${e.assetPath}`;case"disallowed-asset-type":return`Disallowed asset type: ${e.assetPath}`;case"asset-too-large":return`Asset too large (${e.bytes} bytes): ${e.assetPath}`;case"dangling-answer":return`Answer ${e.answerId} references unknown Question ${e.questionId}`}}const JR={key:0,class:"sticky right-1 z-10 ml-1 inline-flex items-center gap-1 align-middle"},Ru=ee({__name:"DiffLineNote",props:{annotations:{},diagnostics:{},numbers:{}},setup(e){return(t,n)=>{const r=Wn;return e.annotations.length||e.diagnostics.length?(y(),I("span",JR,[(y(!0),I(pe,null,$e(e.annotations,s=>(y(),P(Dv,{key:s.id,annotation:s,number:e.numbers.get(s.id)??0},null,8,["annotation","number"]))),128)),(y(!0),I(pe,null,$e(e.diagnostics,(s,o)=>(y(),P(r,{key:o,color:"warning",variant:"subtle",size:"sm",class:"ml-1",title:f(ZR)(s)},{default:O(()=>[...n[0]||(n[0]=[Ce(" ⚠ ",-1)])]),_:1},8,["title"]))),128))])):F("",!0)}}});function Bv(){const e=Q(new Set);function t(r){return r.resolved&&!e.value.has(r.id)}function n(r){const s=new Set(e.value);s.has(r)?s.delete(r):s.add(r),e.value=s}return{isCollapsed:t,toggleExpanded:n}}function eP(e){return e.kind==="change-request"?e.resolved?"✓":"!":"?"}function tP(e){return e.status==="withdrawn"?"border-dimmed/60 bg-dimmed/10 text-dimmed line-through":e.kind==="change-request"?e.resolved?"border-success/60 bg-success/10 text-success opacity-70":"border-error/60 bg-error/15 text-error hover:bg-error hover:text-inverted":"border-info/60 bg-info/15 text-info hover:bg-info hover:text-inverted"}function Fv(e){return e.kind==="change-request"?"error":"info"}function jv(e){return e.kind==="change-request"?"Change request":"Question"}function Hv(e,t=!1){return e.resolved||t?"success":e.status==="open"?"warning":"neutral"}function Vv(e,t=!1){return e.resolved?"Resolved":t?"Answered":e.status==="open"?"Open":"Withdrawn"}function Uv(e){return e==="target-touched"?"success":e==="target-partially-touched"?"warning":e==="target-gone"?"error":"neutral"}function Wv(e){switch(e){case"target-touched":return"Touched by new commits";case"target-partially-touched":return"Partially touched by new commits";case"target-untouched":return"Not touched by new commits";case"target-gone":return"Target gone"}}const nP={class:"inline-flex items-center gap-1 align-middle"},rP=["aria-label"],sP={class:"w-80 p-3 text-xs"},oP={class:"mb-1 flex items-center gap-2"},iP={class:"mb-2 leading-relaxed"},aP={key:0,class:"mb-2 text-muted"},lP={key:0,class:"mb-1 text-[10px] font-bold text-muted"},uP={key:1,class:"mb-2 leading-relaxed text-muted"},cP={key:2,class:"mb-2 text-muted italic"},dP={key:2,class:"mb-2 text-muted italic"},fP={key:0,class:"mt-1 text-warning"},pP={class:"mt-1 flex gap-2"},hP={key:0,class:"mt-1 text-warning"},gP={key:1,class:"truncate text-muted italic"},mP={class:"w-80 p-3 text-xs"},vP={class:"mb-2 text-muted"},yP={key:0,class:"mt-1 text-error"},bP={key:1,class:"mt-1 text-warning"},Ki=ee({__name:"QuestionThread",props:{target:{},questions:{},answers:{}},setup(e){const t=e,{store:n,draft:r,draftKind:s,busy:o,localError:i,editingId:a,editDraft:l,submitNewQuestion:u,startEdit:c,submitEdit:d,resolve:p}=Cv(()=>t.target),h=A(()=>n.writeToken.length>0),{isCollapsed:g,toggleExpanded:m}=Bv();function v(w){return t.answers.find(x=>x.questionId===w)}const b=[{value:"question",label:"Question"},{value:"change-request",label:"Change request"}];return(w,x)=>{const _=Wn,R=cn,T=kv,E=Da,$=Hc;return y(),I("span",nP,[(y(!0),I(pe,null,$e(e.questions,N=>(y(),P(E,{key:N.id},{content:O(({close:D})=>[q("div",sP,[q("p",oP,[W(_,{size:"sm",variant:"subtle",color:f(Fv)(N)},{default:O(()=>[Ce(z(f(jv)(N)),1)]),_:2},1032,["color"]),W(_,{size:"sm",variant:"subtle",color:f(Hv)(N)},{default:O(()=>[Ce(z(f(Vv)(N)),1)]),_:2},1032,["color"]),N.resolution?(y(),P(_,{key:0,size:"sm",variant:"subtle",color:f(Uv)(N.resolution.status),title:N.resolution.evidence},{default:O(()=>[Ce(z(f(Wv)(N.resolution.status)),1)]),_:2},1032,["color","title"])):F("",!0),N.resolved?(y(),P(R,{key:1,size:"xs",variant:"ghost",class:"ml-auto",onClick:Y=>f(m)(N.id)},{default:O(()=>[Ce(z(f(g)(N)?"Show":"Hide"),1)]),_:2},1032,["onClick"])):F("",!0)]),f(g)(N)?(y(),I("p",gP,z(N.body),1)):(y(),I(pe,{key:0},[q("p",iP,z(N.body),1),N.resolution?(y(),I("p",aP,z(N.resolution.evidence),1)):F("",!0),N.kind==="question"?(y(),I(pe,{key:1},[v(N.id)?(y(),I("p",lP,"Answer")):F("",!0),v(N.id)?(y(),I("p",uP,z(v(N.id).body),1)):N.status==="open"?(y(),I("p",cP,"Not answered yet.")):F("",!0)],64)):N.resolved?(y(),I("p",dP,"Resolved "+z(new Date(N.resolvedAt).toLocaleString()),1)):F("",!0),N.status==="open"&&N.kind==="change-request"&&!N.resolved?(y(),I(pe,{key:3},[W(R,{size:"xs",disabled:f(o)||!h.value,onClick:Y=>f(p)(N.id)},{default:O(()=>[...x[3]||(x[3]=[Ce("Mark resolved",-1)])]),_:1},8,["disabled","onClick"]),h.value?F("",!0):(y(),I("p",fP,"Set your write token first (top right)."))],64)):N.status==="open"&&N.kind==="question"?(y(),I(pe,{key:4},[f(a)!==N.id?(y(),P(R,{key:0,size:"xs",variant:"ghost",onClick:Y=>f(c)(N.id)},{default:O(()=>[...x[4]||(x[4]=[Ce("Withdraw & rephrase",-1)])]),_:1},8,["onClick"])):(y(),I(pe,{key:1},[W(T,{modelValue:f(l),"onUpdate:modelValue":x[0]||(x[0]=Y=>Xe(l)?l.value=Y:null),size:"sm",class:"mt-1 w-full",rows:2,placeholder:"Better phrased question…"},null,8,["modelValue"]),q("div",pP,[W(R,{size:"xs",disabled:f(o)||!h.value,onClick:Y=>f(d)(N.id,D)},{default:O(()=>[...x[5]||(x[5]=[Ce("Submit",-1)])]),_:1},8,["disabled","onClick"]),W(R,{size:"xs",variant:"ghost",onClick:x[1]||(x[1]=Y=>a.value=null)},{default:O(()=>[...x[6]||(x[6]=[Ce("Cancel",-1)])]),_:1})]),h.value?F("",!0):(y(),I("p",hP,"Set your write token first (top right)."))],64))],64)):F("",!0)],64))])]),default:O(()=>[q("button",{type:"button",class:he(["grid h-[18px] w-[18px] place-items-center rounded-full border text-[10px] font-bold transition hover:scale-110",f(tP)(N)]),"aria-label":`${N.kind==="change-request"?"Change request":"Question"}${N.resolved?" (resolved)":""}: ${N.body}`},z(f(eP)(N)),11,rP)]),_:2},1024))),128)),W(E,null,{content:O(({close:N})=>[q("div",mP,[W($,{size:"xs",class:"mb-2"},{default:O(()=>[(y(),I(pe,null,$e(b,D=>W(R,{key:D.value,variant:f(s)===D.value?"solid":"outline",color:D.value==="change-request"?"error":"neutral",onClick:Y=>s.value=D.value},{default:O(()=>[Ce(z(D.label),1)]),_:2},1032,["variant","color","onClick"])),64))]),_:1}),q("p",vP,z(f(s)==="change-request"?"Ask for a change on this exact line.":"Ask a question about this exact line."),1),W(T,{modelValue:f(r),"onUpdate:modelValue":x[2]||(x[2]=D=>Xe(r)?r.value=D:null),size:"sm",class:"w-full",rows:2,placeholder:f(s)==="change-request"?"What needs to change?":"What's the reasoning here?"},null,8,["modelValue","placeholder"]),f(i)?(y(),I("p",yP,z(f(i)),1)):F("",!0),h.value?F("",!0):(y(),I("p",bP,"Set your write token first (top right).")),W(R,{size:"xs",class:"mt-2",disabled:f(o)||!h.value,onClick:D=>f(u)(N)},{default:O(()=>[Ce(z(f(s)==="change-request"?"Raise change request":"Ask"),1)]),_:1},8,["disabled","onClick"])])]),default:O(()=>[x[7]||(x[7]=q("button",{type:"button",class:"grid h-[18px] w-[18px] place-items-center rounded-full border border-dimmed/40 text-[10px] text-dimmed opacity-0 transition group-hover:opacity-100 hover:scale-110 hover:border-info hover:text-info","aria-label":"Comment on this"}," + ",-1))]),_:1})])}}}),xP={class:"overflow-x-auto font-mono text-xs"},wP={class:"table w-max min-w-full border-collapse"},_P={class:"table-caption caption-top whitespace-nowrap bg-elevated px-3 py-1 text-primary"},kP=["id"],CP={class:"table-cell select-none px-2 text-right align-baseline text-dimmed"},SP={class:"table-cell select-none px-2 text-right align-baseline text-dimmed"},TP={class:"table-cell select-none px-1 align-baseline"},AP={class:"table-cell whitespace-pre px-2 align-baseline text-[var(--syntax-text)]"},EP=["innerHTML"],OP=["onClick"],RP=ee({__name:"DiffInlineLayout",props:{file:{},annotationNumbers:{},questions:{},answers:{}},setup(e){const t=e;function n(i){return Iv(t.file.path,i)}function r(i){const a=t.file.hunks[i];return Lv(n(i),a.lines)}function s(i){return zv(n(i),t.file.hunks[i].lines)}const o=A(()=>t.file.path);return(i,a)=>(y(),I("div",xP,[(y(!0),I(pe,null,$e(e.file.hunks,(l,u)=>(y(),I(pe,{key:u},[q("div",wP,[q("div",_P," @@ -"+z(l.oldStart)+","+z(l.oldLines)+" +"+z(l.newStart)+","+z(l.newLines)+" @@ ",1),(y(!0),I(pe,null,$e(r(u),c=>(y(),I("div",{id:f(To)(c.id),key:c.id,class:he(["group table-row",{"bg-success/10":c.kind==="add","bg-error/10":c.kind==="remove"}])},[q("span",CP,z(c.oldLine??""),1),q("span",SP,z(c.newLine??""),1),q("span",{class:he(["table-cell select-none text-center align-baseline",{"text-success":c.kind==="add","text-error":c.kind==="remove"}])},z(c.kind==="add"?"+":c.kind==="remove"?"−":""),3),q("span",TP,[W(Ki,{target:f(RR)(o.value,c.text,c.oldLine,c.newLine),questions:f(Ou)(e.questions,o.value,c.newLine!==void 0?"head":"base",c.newLine??c.oldLine),answers:e.answers},null,8,["target","questions","answers"])]),q("span",AP,[q("code",{innerHTML:f(Eo)(c.text),onClick:a[0]||(a[0]=(...d)=>f(ys)&&f(ys)(...d))},null,8,EP),W(Ru,{annotations:c.annotations,diagnostics:c.diagnostics,numbers:e.annotationNumbers},null,8,["annotations","diagnostics","numbers"])])],10,kP))),128))]),s(u)?(y(),I("button",{key:0,type:"button",class:"w-full border-b border-default bg-elevated/50 px-3 py-1.5 text-left text-[10px] text-muted hover:text-default",onClick:c=>f(Oo)(e.file.path,u)}," ⋯ Show "+z(s(u))+" more lines ",9,OP)):F("",!0)],64))),128))]))}});function PP(){const e=Hr("leftPane"),t=Hr("rightPane");let n=!1;function r(s,o){!s||!o||n||(n=!0,o.scrollLeft=s.scrollLeft,n=!1)}return{leftPane:e,rightPane:t,syncScroll:r}}const IP={class:"font-mono text-xs"},qP={class:"grid grid-cols-2"},$P={class:"table w-max min-w-full border-collapse"},MP={class:"table-caption caption-top whitespace-nowrap bg-elevated px-3 py-1 text-primary"},DP=["id"],NP={class:"table-cell w-12 select-none px-2 text-right align-baseline text-dimmed"},LP={class:"table-cell w-4 select-none text-center align-baseline text-error"},zP={class:"table-cell select-none px-1 align-baseline"},BP={class:"table-cell whitespace-pre px-2 align-baseline text-[var(--syntax-text)]"},FP=["innerHTML"],jP=["onClick"],HP={class:"table w-max min-w-full border-collapse"},VP={class:"table-caption caption-top whitespace-nowrap bg-elevated px-3 py-1 text-primary"},UP=["id"],WP={class:"table-cell w-12 select-none px-2 text-right align-baseline text-dimmed"},GP={class:"table-cell w-4 select-none text-center align-baseline text-success"},KP={class:"table-cell select-none px-1 align-baseline"},YP={class:"table-cell whitespace-pre px-2 align-baseline text-[var(--syntax-text)]"},QP=["innerHTML"],XP=["onClick"],ZP=ee({__name:"DiffSideBySideLayout",props:{file:{},annotationNumbers:{},questions:{},answers:{}},setup(e){const t=e,{leftPane:n,rightPane:r,syncScroll:s}=PP(),o=A(()=>t.file.hunks.map(c=>d2(c.lines))),i=A(()=>t.file.path);function a(c){return Iv(t.file.path,c)}function l(c){return Lv(a(c),o.value[c])}function u(c){return zv(a(c),o.value[c])}return(c,d)=>(y(),I("div",IP,[d[4]||(d[4]=q("div",{class:"grid grid-cols-2 border-b border-default bg-elevated text-[10px] font-bold text-muted"},[q("span",{class:"px-3 py-1"},"Base · before"),q("span",{class:"border-l border-default px-3 py-1"},"MR head · after")],-1)),q("div",qP,[q("div",{ref_key:"leftPane",ref:n,class:"min-w-0 overflow-x-auto",onScroll:d[1]||(d[1]=p=>f(s)(f(n),f(r)))},[(y(!0),I(pe,null,$e(e.file.hunks,(p,h)=>(y(),I(pe,{key:h},[q("div",$P,[q("div",MP," @@ -"+z(p.oldStart)+","+z(p.oldLines)+" @@ ",1),(y(!0),I(pe,null,$e(l(h),(g,m)=>{var v,b,w;return y(),I("div",{id:g.left&&g.left!==g.right?f(To)(g.left.id):void 0,key:m,class:he(["group table-row",{"bg-error/10":((v=g.left)==null?void 0:v.kind)==="remove"}])},[q("span",NP,z(((b=g.left)==null?void 0:b.oldLine)??""),1),q("span",LP,z(((w=g.left)==null?void 0:w.kind)==="remove"?"−":""),1),q("span",zP,[g.left?(y(),P(Ki,{key:0,target:{type:"line",path:i.value,side:"base",line:g.left.oldLine,expectedText:g.left.text},questions:f(Ou)(e.questions,i.value,"base",g.left.oldLine),answers:e.answers},null,8,["target","questions","answers"])):F("",!0)]),q("span",BP,[g.left?(y(),I(pe,{key:0},[q("code",{innerHTML:f(Eo)(g.left.text),onClick:d[0]||(d[0]=(...x)=>f(ys)&&f(ys)(...x))},null,8,FP),W(Ru,{annotations:g.left.annotations,diagnostics:g.left.diagnostics,numbers:e.annotationNumbers},null,8,["annotations","diagnostics","numbers"])],64)):F("",!0)])],10,DP)}),128))]),u(h)?(y(),I("button",{key:0,type:"button",class:"w-full border-b border-default bg-elevated/50 px-3 py-1.5 text-left text-[10px] text-muted hover:text-default",onClick:g=>f(Oo)(e.file.path,h)}," ⋯ Show "+z(u(h))+" more rows ",9,jP)):F("",!0)],64))),128))],544),q("div",{ref_key:"rightPane",ref:r,class:"min-w-0 overflow-x-auto border-l border-default",onScroll:d[3]||(d[3]=p=>f(s)(f(r),f(n)))},[(y(!0),I(pe,null,$e(e.file.hunks,(p,h)=>(y(),I(pe,{key:h},[q("div",HP,[q("div",VP," @@ +"+z(p.newStart)+","+z(p.newLines)+" @@ ",1),(y(!0),I(pe,null,$e(l(h),(g,m)=>{var v,b,w;return y(),I("div",{id:g.right?f(To)(g.right.id):void 0,key:m,class:he(["group table-row",{"bg-success/10":((v=g.right)==null?void 0:v.kind)==="add"}])},[q("span",WP,z(((b=g.right)==null?void 0:b.newLine)??""),1),q("span",GP,z(((w=g.right)==null?void 0:w.kind)==="add"?"+":""),1),q("span",KP,[g.right?(y(),P(Ki,{key:0,target:{type:"line",path:i.value,side:"head",line:g.right.newLine,expectedText:g.right.text},questions:f(Ou)(e.questions,i.value,"head",g.right.newLine),answers:e.answers},null,8,["target","questions","answers"])):F("",!0)]),q("span",YP,[g.right?(y(),I(pe,{key:0},[q("code",{innerHTML:f(Eo)(g.right.text),onClick:d[2]||(d[2]=(...x)=>f(ys)&&f(ys)(...x))},null,8,QP),W(Ru,{annotations:g.right.annotations,diagnostics:g.right.diagnostics,numbers:e.annotationNumbers},null,8,["annotations","diagnostics","numbers"])],64)):F("",!0)])],10,UP)}),128))]),u(h)?(y(),I("button",{key:0,type:"button",class:"w-full border-b border-default bg-elevated/50 px-3 py-1.5 text-left text-[10px] text-muted hover:text-default",onClick:g=>f(Oo)(e.file.path,h)}," ⋯ Show "+z(u(h))+" more rows ",9,XP)):F("",!0)],64))),128))],544)])]))}}),JP=32;function Dp(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=()=>n(new Error(`failed to load ${e}`)),r.src=e})}function Np(e){const t=document.createElement("canvas");t.width=e.naturalWidth,t.height=e.naturalHeight;const n=t.getContext("2d");return n.drawImage(e,0,0),n.getImageData(0,0,t.width,t.height)}function eI(e,t,n){const r=e.width,s=e.height;let o=0;for(let i=0;i<e.data.length;i+=4)if(Math.abs(e.data[i]-t.data[i])+Math.abs(e.data[i+1]-t.data[i+1])+Math.abs(e.data[i+2]-t.data[i+2])>JP)o++,n.data[i]=255,n.data[i+1]=0,n.data[i+2]=0,n.data[i+3]=255;else{const l=(t.data[i]+t.data[i+1]+t.data[i+2])/3;n.data[i]=l,n.data[i+1]=l,n.data[i+2]=l,n.data[i+3]=90}return{width:r,height:s,changedPercent:o/(r*s)*100}}function tI(e,t,n){if(e.naturalWidth!==t.naturalWidth||e.naturalHeight!==t.naturalHeight)return{error:`Dimensions differ: base ${e.naturalWidth}×${e.naturalHeight} vs head ${t.naturalWidth}×${t.naturalHeight} — cannot pixel-diff.`};const r=e.naturalWidth,s=e.naturalHeight,o=Np(e),i=Np(t);n.width=r,n.height=s;const a=n.getContext("2d"),l=a.createImageData(r,s),u=eI(o,i,l);return a.putImageData(l,0,0),u}const nI={class:"border-t border-default p-4"},rI={class:"mb-3 text-xs text-muted"},sI={key:0,class:"max-w-md"},oI=["src","alt"],iI={key:1},aI={class:"mb-3 flex gap-2"},lI={key:0,class:"flex gap-3"},uI={class:"max-w-md flex-1"},cI=["src","alt"],dI={class:"max-w-md flex-1"},fI=["src","alt"],pI={key:1,class:"max-w-2xl"},hI={class:"relative inline-block overflow-hidden rounded border border-default"},gI=["src","alt"],mI=["src","alt"],vI={key:2,class:"max-w-2xl"},yI={class:"relative inline-block overflow-hidden rounded border border-default"},bI=["src","alt"],xI=["src","alt"],wI={class:"mt-1 text-[10px] text-muted"},_I={key:3,class:"max-w-2xl"},kI={key:0,class:"text-xs text-muted"},CI={key:1,class:"text-xs text-warning"},SI={key:2,class:"mb-2 text-xs text-muted"},TI=["src"],AI=ee({__name:"ImageDiff",props:{assetPath:{},baseAssetPath:{},comparisonModes:{},description:{}},setup(e){const t=e,n=Q(t.comparisonModes[0]??"side-by-side"),r=Q(50),s=A(()=>Au(t.assetPath)),o=A(()=>t.baseAssetPath?Au(t.baseAssetPath):null),i=Hr("diffCanvas"),a=Q(null),l=Q(null),u=Q(!1);async function c(){if(o.value&&(await ut(),!!i.value)){u.value=!0,l.value=null,a.value=null;try{const[v,b]=await Promise.all([Dp(o.value),Dp(s.value)]),w=tI(v,b,i.value);"error"in w?l.value=w.error:a.value=w}catch(v){l.value=v instanceof Error?v.message:String(v)}finally{u.value=!1}}}De(n,v=>{v==="changed-pixel"&&c()}),ft(()=>{n.value==="changed-pixel"&&c()});const d={"side-by-side":"Side by side",swipe:"Swipe","onion-skin":"Onion skin","changed-pixel":"Changed pixels"},p=Q(null),h=Hr("lightboxDialog");function g(v){var b;p.value=v,(b=h.value)==null||b.showModal()}function m(){var v;(v=h.value)==null||v.close(),p.value=null}return(v,b)=>{const w=cn;return y(),I("div",nI,[q("p",rI,z(e.description),1),o.value?(y(),I("div",iI,[q("div",aI,[(y(!0),I(pe,null,$e(e.comparisonModes,x=>(y(),P(w,{key:x,size:"xs",variant:n.value===x?"solid":"outline",onClick:_=>n.value=x},{default:O(()=>[Ce(z(d[x]),1)]),_:2},1032,["variant","onClick"]))),128))]),n.value==="side-by-side"?(y(),I("div",lI,[q("div",uI,[b[10]||(b[10]=q("div",{class:"mb-1 text-[10px] font-bold text-muted"},"Base",-1)),q("img",{src:o.value,alt:`${e.assetPath} (base)`,class:"w-full cursor-zoom-in rounded border border-default",onClick:b[1]||(b[1]=x=>g(o.value))},null,8,cI)]),q("div",dI,[b[11]||(b[11]=q("div",{class:"mb-1 text-[10px] font-bold text-muted"},"Head",-1)),q("img",{src:s.value,alt:`${e.assetPath} (head)`,class:"w-full cursor-zoom-in rounded border border-default",onClick:b[2]||(b[2]=x=>g(s.value))},null,8,fI)])])):n.value==="swipe"?(y(),I("div",pI,[q("div",hI,[q("img",{src:o.value,alt:`${e.assetPath} (base)`,class:"block max-w-full cursor-zoom-in",onClick:b[3]||(b[3]=x=>g(o.value))},null,8,gI),q("div",{class:"absolute inset-0 overflow-hidden",style:kt({clipPath:`inset(0 ${100-r.value}% 0 0)`})},[q("img",{src:s.value,alt:`${e.assetPath} (head)`,class:"block max-w-full cursor-zoom-in",onClick:b[4]||(b[4]=x=>g(s.value))},null,8,mI)],4),q("div",{class:"pointer-events-none absolute inset-y-0 w-0.5 bg-primary",style:kt({left:`${r.value}%`})},null,4)]),mo(q("input",{"onUpdate:modelValue":b[5]||(b[5]=x=>r.value=x),type:"range",min:"0",max:"100",class:"mt-2 w-full"},null,512),[[jd,r.value,void 0,{number:!0}]]),b[12]||(b[12]=q("p",{class:"mt-1 text-[10px] text-muted"},"Left of the line: head. Right of the line: base.",-1))])):n.value==="onion-skin"?(y(),I("div",vI,[q("div",yI,[q("img",{src:o.value,alt:`${e.assetPath} (base)`,class:"block max-w-full cursor-zoom-in",onClick:b[6]||(b[6]=x=>g(o.value))},null,8,bI),q("img",{src:s.value,alt:`${e.assetPath} (head)`,class:"absolute inset-0 block max-w-full cursor-zoom-in",style:kt({opacity:r.value/100}),onClick:b[7]||(b[7]=x=>g(s.value))},null,12,xI)]),mo(q("input",{"onUpdate:modelValue":b[8]||(b[8]=x=>r.value=x),type:"range",min:"0",max:"100",class:"mt-2 w-full"},null,512),[[jd,r.value,void 0,{number:!0}]]),q("p",wI,z(r.value)+"% head opacity over base.",1)])):(y(),I("div",_I,[u.value?(y(),I("p",kI,"Computing pixel diff…")):l.value?(y(),I("p",CI,z(l.value),1)):a.value?(y(),I("p",SI,z(a.value.width)+"×"+z(a.value.height)+" — "+z(a.value.changedPercent.toFixed(2))+"% pixels changed (red = changed, threshold-based, not pixel-perfect) ",1)):F("",!0),q("canvas",{ref_key:"diffCanvas",ref:i,class:"max-w-full rounded border border-default"},null,512)]))])):(y(),I("div",sI,[q("img",{src:s.value,alt:e.assetPath,class:"cursor-zoom-in rounded border border-default",onClick:b[0]||(b[0]=x=>g(s.value))},null,8,oI)])),q("dialog",{ref_key:"lightboxDialog",ref:h,class:"max-h-none max-w-none overflow-visible border-0 bg-transparent p-0 backdrop:bg-black/80",onClick:m,onClose:b[9]||(b[9]=x=>p.value=null)},[p.value?(y(),I("img",{key:0,src:p.value,alt:"",class:"max-h-[92vh] max-w-[92vw] cursor-zoom-out object-contain"},null,8,TI)):F("",!0)],544)])}}}),EI={class:"border-t border-default p-4 text-sm"},OI={class:"flex flex-wrap items-center gap-2"},RI=["href"],PI={class:"mt-2 text-xs text-muted"},II={key:0,class:"mt-2 overflow-x-auto rounded bg-elevated p-2 font-mono text-xs whitespace-pre-wrap"},qI=ee({__name:"PipelineEvidence",props:{jobName:{},status:{},url:{},logExcerpt:{},description:{}},setup(e){const t={success:"success",failed:"error",running:"info",canceled:"neutral",skipped:"neutral"},n=Q(!1);return(r,s)=>{const o=Wn,i=cn;return y(),I("div",EI,[q("div",OI,[W(o,{size:"sm",variant:"subtle",color:t[e.status]},{default:O(()=>[Ce(z(e.status),1)]),_:1},8,["color"]),q("a",{href:e.url,target:"_blank",rel:"noopener",class:"font-mono text-xs text-primary hover:underline"},z(e.jobName),9,RI),e.logExcerpt?(y(),P(i,{key:0,size:"xs",variant:"ghost",class:"ml-auto",onClick:s[0]||(s[0]=a=>n.value=!n.value)},{default:O(()=>[Ce(z(n.value?"Hide log":"Show log"),1)]),_:1})):F("",!0)]),q("p",PI,z(e.description),1),n.value&&e.logExcerpt?(y(),I("pre",II,z(e.logExcerpt),1)):F("",!0)])}}}),$I=["id"],MI={class:"truncate font-mono text-sm"},DI={class:"ml-auto flex items-center gap-2"},NI={key:0,class:"px-4 py-2 text-xs text-muted"},LI={key:0,class:"flex flex-wrap items-center gap-3 border-b border-default bg-elevated/50 px-4 py-2 text-xs text-muted"},zI={key:1,class:"flex flex-wrap items-center gap-2 border-b border-default bg-elevated/50 px-4 py-2 text-xs text-muted"},BI=["title","onClick"],FI={class:"group flex flex-wrap items-center gap-3 border-b border-default bg-elevated/50 px-4 py-2 text-xs text-muted"},jI={key:0,class:"p-4 text-sm text-muted"},HI=ee({__name:"DiffFile",props:{file:{},layout:{},annotationNumbers:{},questions:{},answers:{}},setup(e){const t=e,n=A(()=>_R(t.file)),r=A(()=>kR(t.file)),s=A(()=>Ov(t.file)),o=A(()=>HO(t.file.path)),i=A(()=>bR(t.file.path,CR(t.file)||o.value)),a=A(()=>SR(t.file)),l=A(()=>TR(t.file)),u=A(()=>PR(t.questions,t.file.path));return(c,d)=>{const p=Wn,h=qc,g=cn;return y(),I("article",{id:f(Ms)(e.file.path),class:he(["mb-6 overflow-hidden rounded-lg border",o.value?"border-success bg-success/5":"border-default"])},[q("header",{class:he(["sticky top-0 z-10 flex items-center gap-3 border-b border-default bg-elevated px-4 py-2",{"bg-success/10":o.value}])},[d[3]||(d[3]=q("span",{class:"text-dimmed"},"◇",-1)),q("strong",MI,z(e.file.path),1),q("span",DI,[e.file.binary?(y(),P(p,{key:0,color:"neutral",variant:"subtle",size:"sm"},{default:O(()=>[...d[2]||(d[2]=[Ce("binary",-1)])]),_:1})):(y(),I(pe,{key:1},[W(p,{color:"success",variant:"subtle",size:"sm"},{default:O(()=>[Ce("+"+z(n.value),1)]),_:1}),W(p,{color:"error",variant:"subtle",size:"sm"},{default:O(()=>[Ce("−"+z(r.value),1)]),_:1}),W(h,{"model-value":o.value,label:"Reviewed",size:"sm","onUpdate:modelValue":d[0]||(d[0]=m=>f(VO)(e.file.path))},null,8,["model-value"]),W(g,{icon:i.value?"i-lucide-chevron-right":"i-lucide-chevron-down",size:"xs",variant:"ghost",color:"neutral","aria-label":i.value?"Expand diff":"Collapse diff",onClick:d[1]||(d[1]=m=>f(xR)(e.file.path,i.value))},null,8,["icon","aria-label"])],64))])],2),i.value?(y(),I("div",NI," Diff collapsed ("+z(s.value)+" lines) — click Expand above to view. ",1)):(y(),I(pe,{key:1},[a.value.length?(y(),I("div",LI,[d[4]||(d[4]=q("span",null,"Notes on this file:",-1)),(y(!0),I(pe,null,$e(a.value,m=>(y(),P(Dv,{key:m.id,annotation:m,number:e.annotationNumbers.get(m.id)??0},null,8,["annotation","number"]))),128))])):F("",!0),l.value.length?(y(),I("div",zI,[d[5]||(d[5]=q("span",null,"Agent comments in this file:",-1)),(y(!0),I(pe,null,$e(l.value,m=>(y(),I("button",{key:m.annotation.id,type:"button",title:m.annotation.summary,class:"grid h-[18px] w-[18px] place-items-center rounded-full border border-warning/60 bg-warning/15 text-[10px] font-bold text-warning transition hover:scale-110 hover:bg-warning hover:text-inverted",onClick:v=>f(qv)(e.file.path,m.hunkIndex,m.lineId)},z(e.annotationNumbers.get(m.annotation.id)??0),9,BI))),128))])):F("",!0),q("div",FI,[d[6]||(d[6]=q("span",null,"Questions on this file:",-1)),W(Ki,{target:{type:"file",path:e.file.path},questions:u.value,answers:e.answers},null,8,["target","questions","answers"])]),(y(!0),I(pe,null,$e(e.file.pipelineEvidence,m=>(y(),P(qI,{key:m.id,"job-name":m.jobName,status:m.status,url:m.url,"log-excerpt":m.logExcerpt,description:m.description},null,8,["job-name","status","url","log-excerpt","description"]))),128)),e.file.binary?(y(),I(pe,{key:2},[e.file.imageEvidence.length===0?(y(),I("div",jI," Binary change — no image evidence attached to compare. ")):F("",!0),(y(!0),I(pe,null,$e(e.file.imageEvidence,m=>(y(),P(AI,{key:m.id,"asset-path":m.assetPath,"base-asset-path":m.baseAssetPath,"comparison-modes":m.comparisonModes,description:m.description},null,8,["asset-path","base-asset-path","comparison-modes","description"]))),128))],64)):e.layout==="inline"?(y(),P(RP,{key:3,file:e.file,"annotation-numbers":e.annotationNumbers,questions:e.questions,answers:e.answers},null,8,["file","annotation-numbers","questions","answers"])):(y(),P(ZP,{key:4,file:e.file,"annotation-numbers":e.annotationNumbers,questions:e.questions,answers:e.answers},null,8,["file","annotation-numbers","questions","answers"]))],64))],10,$I)}}}),VI={key:0,class:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center"},UI={key:1,class:"flex flex-1 flex-col items-center justify-center gap-6 overflow-y-auto p-8"},WI={class:"w-full max-w-2xl"},GI={class:"mb-3 flex items-center justify-between text-xs text-dimmed"},KI={key:1,class:"rounded-lg border border-default bg-elevated p-4 text-sm text-muted"},YI={class:"mb-3"},QI={key:0,class:"border-t border-default pt-2"},XI={class:"flex items-center gap-3"},ZI=["disabled"],JI=["disabled"],eq=ee({__name:"FocusMode",props:{files:{},groups:{},currentId:{}},emits:["exit","update:currentId"],setup(e,{emit:t}){const n=e,r=t,s=A(()=>{const h=new Map;for(const g of n.files)for(const m of g.annotations)h.set(m.id,m);return h}),o=A(()=>{const h=Wc(n.groups);return Gc(Uc(n.files),h)}),i=A(()=>{const h=o.value.findIndex(g=>g.verification.id===n.currentId);return h===-1?0:h}),a=A(()=>o.value[i.value]),l=A(()=>{var h;return(h=a.value)!=null&&h.annotationId?s.value.get(a.value.annotationId):void 0});function u(h){const g=Math.min(Math.max(h,0),o.value.length-1),m=o.value[g];m&&r("update:currentId",m.verification.id)}function c(){u(i.value+1)}function d(){u(i.value-1)}function p(h){const g=h.target;g&&["INPUT","TEXTAREA"].includes(g.tagName)||g!=null&&g.isContentEditable||((h.key==="ArrowRight"||h.key==="ArrowDown"||h.key==="j")&&c(),(h.key==="ArrowLeft"||h.key==="ArrowUp"||h.key==="k")&&d(),h.key==="Escape"&&r("exit",null))}return ft(()=>window.addEventListener("keydown",p)),qo(()=>window.removeEventListener("keydown",p)),(h,g)=>{var m;return o.value.length?(y(),I("div",UI,[q("div",WI,[q("div",GI,[q("span",null,z(i.value+1)+" / "+z(o.value.length)+" — ordered by risk",1),q("button",{type:"button",class:"text-primary hover:underline",onClick:g[1]||(g[1]=v=>r("exit",null))},"Esc — exit focus mode")]),l.value?(y(),P(Av,{key:0,annotation:l.value,"default-expanded":!0,"jump-to-diff":v=>r("exit",v)},null,8,["annotation","jump-to-diff"])):(y(),I("div",KI,[q("p",YI,z((m=a.value)==null?void 0:m.verification.description),1),a.value?(y(),I("div",QI,[W(Vc,{target:{type:"file",path:a.value.path}},null,8,["target"])])):F("",!0)])),a.value?(y(),I("button",{key:2,type:"button",class:"mt-3 text-sm font-medium text-primary hover:underline",onClick:g[2]||(g[2]=v=>r("exit",a.value.path))}," → view diff for this item ")):F("",!0)]),q("div",XI,[q("button",{type:"button",class:"rounded-full border border-default px-4 py-1.5 text-sm hover:bg-elevated disabled:opacity-30",disabled:i.value===0,onClick:d}," ← prev ",8,ZI),q("button",{type:"button",class:"rounded-full border border-default px-4 py-1.5 text-sm hover:bg-elevated disabled:opacity-30",disabled:i.value===o.value.length-1,onClick:c}," next → ",8,JI)]),g[5]||(g[5]=q("p",{class:"text-[11px] text-dimmed"},"← → or j/k to step, Esc to exit",-1))])):(y(),I("div",VI,[g[3]||(g[3]=q("p",{class:"text-lg font-semibold text-highlighted"},"Nothing needs attention",-1)),g[4]||(g[4]=q("p",{class:"text-sm text-muted"},"Every Verification item in this bundle is already marked verified.",-1)),q("button",{type:"button",class:"mt-2 text-sm text-primary hover:underline",onClick:g[0]||(g[0]=v=>r("exit",null))},"Esc — exit focus mode")]))}}}),tq={slots:{overlay:"fixed inset-0 bg-elevated/75",content:"fixed bg-default divide-y divide-default sm:ring ring-default sm:shadow-lg flex flex-col focus:outline-none",header:"flex items-center gap-1.5 p-4 sm:px-6 min-h-(--ui-header-height)",wrapper:"",body:"flex-1 overflow-y-auto p-4 sm:p-6",footer:"flex items-center gap-1.5 p-4 sm:px-6",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",close:"absolute top-4 end-4"},variants:{side:{top:{content:""},right:{content:"max-w-md"},bottom:{content:""},left:{content:"max-w-md"}},inset:{true:{content:"rounded-lg"}},transition:{true:{overlay:"data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]"}}},compoundVariants:[{side:"top",inset:!0,class:{content:"max-h-[calc(100%-2rem)] inset-x-4 top-4"}},{side:"top",inset:!1,class:{content:"max-h-full inset-x-0 top-0"}},{side:"right",inset:!0,class:{content:"w-[calc(100%-2rem)] inset-y-4 right-4"}},{side:"right",inset:!1,class:{content:"w-full inset-y-0 right-0"}},{side:"bottom",inset:!0,class:{content:"max-h-[calc(100%-2rem)] inset-x-4 bottom-4"}},{side:"bottom",inset:!1,class:{content:"max-h-full inset-x-0 bottom-0"}},{side:"left",inset:!0,class:{content:"w-[calc(100%-2rem)] inset-y-4 left-4"}},{side:"left",inset:!1,class:{content:"w-full inset-y-0 left-0"}},{transition:!0,side:"top",class:{content:"data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-top_200ms_ease-in-out]"}},{transition:!0,side:"right",class:{content:"data-[state=open]:animate-[slide-in-from-right_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-right_200ms_ease-in-out]"}},{transition:!0,side:"bottom",class:{content:"data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-bottom_200ms_ease-in-out]"}},{transition:!0,side:"left",class:{content:"data-[state=open]:animate-[slide-in-from-left_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-left_200ms_ease-in-out]"}}]},Gv={__name:"Slideover",props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},transition:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1,default:"right"},inset:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1}},emits:["leave","after:leave","enter","after:enter","close:prevent","update:open"],setup(e,{emit:t}){const n=e,r=t,s=Vn(),o=Mt("slideover",n),{t:i}=ma(),a=pt(),l=fr(zn(o,"open","defaultOpen","modal","unmountOnHide"),r),u=Ea(Ct(()=>o.portal)),c=Ct(()=>o.content),d=A(()=>o.dismissible?{pointerDownOutside:Mv}:["interactOutside","escapeKeyDown"].reduce((g,m)=>(g[m]=v=>{v.preventDefault(),r("close:prevent")},g),{})),p=A(()=>{var h;return Dt({extend:tq,...((h=a.ui)==null?void 0:h.slideover)||{}})({transition:o.transition,side:o.side,inset:o.inset})});return(h,g)=>(y(),P(f(zk),st(lt(f(l))),{default:O(({open:m,close:v})=>[s.default?(y(),P(f(b1),{key:0,"as-child":"",class:he(f(o).class)},{default:O(()=>[V(h.$slots,"default",{open:m})]),_:2},1032,["class"])):F("",!0),W(f(m1),ce(f(u),{"force-mount":f(u).disabled&&f(o).unmountOnHide===!1||void 0}),{default:O(()=>[W(f(Pc),null,{default:O(()=>{var b,w;return[f(o).overlay?(y(),P(f(p1),{key:0,"data-slot":"overlay",class:he(p.value.overlay({class:(b=f(o).ui)==null?void 0:b.overlay}))},null,8,["class"])):F("",!0),W(f(l1),ce({"data-side":f(o).side,"data-slot":"content",class:p.value.content({class:[!s.default&&f(o).class,(w=f(o).ui)==null?void 0:w.content]})},c.value,{onEnter:g[0]||(g[0]=x=>r("enter")),onAfterEnter:g[1]||(g[1]=x=>r("after:enter")),onLeave:g[2]||(g[2]=x=>r("leave")),onAfterLeave:g[3]||(g[3]=x=>r("after:leave"))},Uu(d.value)),{default:O(()=>[!f(o).title&&!s.title||!f(o).description&&!s.description||s.content?(y(),P(f(Lo),{key:0},{default:O(()=>[!f(o).title&&!s.title?(y(),P(f(xl),{key:0})):s.content?(y(),P(f(xl),{key:1},{default:O(()=>[V(h.$slots,"title",{},()=>[Ce(z(f(o).title),1)])]),_:3})):F("",!0),!f(o).description&&!s.description?(y(),P(f(bl),{key:2})):s.content?(y(),P(f(bl),{key:3},{default:O(()=>[V(h.$slots,"description",{},()=>[Ce(z(f(o).description),1)])]),_:3})):F("",!0)]),_:3})):F("",!0),V(h.$slots,"content",{close:v},()=>{var x,_,R;return[s.header||f(o).title||s.title||f(o).description||s.description||f(o).close||s.close?(y(),I("div",{key:0,"data-slot":"header",class:he(p.value.header({class:(x=f(o).ui)==null?void 0:x.header}))},[V(h.$slots,"header",{close:v},()=>{var T,E,$;return[f(o).title||s.title||f(o).description||s.description?(y(),I("div",{key:0,"data-slot":"wrapper",class:he(p.value.wrapper({class:(T=f(o).ui)==null?void 0:T.wrapper}))},[f(o).title||s.title?(y(),P(f(xl),{key:0,"data-slot":"title",class:he(p.value.title({class:(E=f(o).ui)==null?void 0:E.title}))},{default:O(()=>[V(h.$slots,"title",{},()=>[Ce(z(f(o).title),1)])]),_:3},8,["class"])):F("",!0),f(o).description||s.description?(y(),P(f(bl),{key:1,"data-slot":"description",class:he(p.value.description({class:($=f(o).ui)==null?void 0:$.description}))},{default:O(()=>[V(h.$slots,"description",{},()=>[Ce(z(f(o).description),1)])]),_:3},8,["class"])):F("",!0)],2)):F("",!0),V(h.$slots,"actions"),f(o).close||s.close?(y(),P(f(Fk),{key:1,"as-child":""},{default:O(()=>[V(h.$slots,"close",{ui:p.value},()=>{var N;return[f(o).close?(y(),P(cn,ce({key:0,icon:f(o).closeIcon||f(a).ui.icons.close,color:"neutral",variant:"ghost","aria-label":f(i)("slideover.close")},typeof f(o).close=="object"?f(o).close:{},{"data-slot":"close",class:p.value.close({class:(N=f(o).ui)==null?void 0:N.close})}),null,16,["icon","aria-label","class"])):F("",!0)]})]),_:2},1024)):F("",!0)]})],2)):F("",!0),q("div",{"data-slot":"body",class:he(p.value.body({class:(_=f(o).ui)==null?void 0:_.body}))},[V(h.$slots,"body",{close:v})],2),s.footer?(y(),I("div",{key:1,"data-slot":"footer",class:he(p.value.footer({class:(R=f(o).ui)==null?void 0:R.footer}))},[V(h.$slots,"footer",{close:v})],2)):F("",!0)]})]),_:2},1040,["data-side","class"])]}),_:2},1024)]),_:2},1040,["force-mount"])]),_:3},16))}},nq={class:"space-y-4 text-sm"},rq={key:0,class:"text-muted"},sq=["href"],oq={class:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-muted"},iq={class:"text-default"},aq={class:"text-default font-mono"},lq={class:"text-default"},uq=["innerHTML"],cq=ee({__name:"MrDetailsSlideover",props:Ri({comparison:{},descriptionHtml:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:["update:open"],setup(e){const t=Wu(e,"open");return(n,r)=>{const s=Gv;return y(),P(s,{open:t.value,"onUpdate:open":r[0]||(r[0]=o=>t.value=o),title:e.comparison.title||"MR details",side:"right"},{body:O(()=>[q("div",nq,[e.comparison.number?(y(),I("div",rq,"!"+z(e.comparison.number),1)):F("",!0),e.comparison.url?(y(),I("a",{key:1,href:e.comparison.url,target:"_blank",rel:"noopener",class:"block truncate text-primary hover:underline"},z(e.comparison.url),9,sq)):F("",!0),q("dl",oq,[e.comparison.author?(y(),I(pe,{key:0},[r[1]||(r[1]=q("dt",null,"Author",-1)),q("dd",iq,z(e.comparison.author),1)],64)):F("",!0),e.comparison.sourceBranch||e.comparison.targetBranch?(y(),I(pe,{key:1},[r[2]||(r[2]=q("dt",null,"Branch",-1)),q("dd",aq,z(e.comparison.sourceBranch??"?")+" → "+z(e.comparison.targetBranch??"?"),1)],64)):F("",!0),e.comparison.repository?(y(),I(pe,{key:2},[r[3]||(r[3]=q("dt",null,"Repository",-1)),q("dd",lq,z(e.comparison.repository),1)],64)):F("",!0)]),e.descriptionHtml?(y(),I("div",{key:2,class:"markdown-body border-t border-default pt-4",innerHTML:e.descriptionHtml},null,8,uq)):F("",!0)])]),_:1},8,["open","title"])}}}),dq={key:0,class:"text-sm text-muted"},fq={class:"space-y-3"},pq={class:"mb-1 flex items-center gap-2"},hq={key:2,class:"truncate font-mono text-xs text-muted"},gq=["disabled","onClick"],mq={key:0,class:"mt-2 border-t border-default pt-2 text-muted"},vq={class:"leading-relaxed whitespace-pre-wrap"},yq={key:1,class:"truncate text-muted italic"},bq=ee({__name:"QuestionsSlideover",props:Ri({entries:{},currentRound:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:Ri(["select"],["update:open"]),setup(e,{emit:t}){const n=Wu(e,"open"),r=t,{isCollapsed:s,toggleExpanded:o}=Bv();function i(a){return s(a.question)}return(a,l)=>{const u=Wn,c=cn,d=Gv;return y(),P(d,{open:n.value,"onUpdate:open":l[0]||(l[0]=p=>n.value=p),title:"Questions",side:"right"},{body:O(()=>[e.entries.length?F("",!0):(y(),I("p",dq,"No comments raised on this bundle yet.")),q("ul",fq,[(y(!0),I(pe,null,$e(e.entries,p=>(y(),I("li",{key:p.question.id,class:"rounded-lg border border-default p-3 text-sm"},[q("div",pq,[W(u,{size:"sm",variant:"subtle",color:f(Fv)(p.question)},{default:O(()=>[Ce(z(f(jv)(p.question)),1)]),_:2},1032,["color"]),W(u,{size:"sm",variant:"subtle",color:f(Hv)(p.question,!!p.answer)},{default:O(()=>[Ce(z(f(Vv)(p.question,!!p.answer)),1)]),_:2},1032,["color"]),p.question.resolution?(y(),P(u,{key:0,size:"sm",variant:"subtle",color:f(Uv)(p.question.resolution.status),title:p.question.resolution.evidence},{default:O(()=>[Ce(z(f(Wv)(p.question.resolution.status)),1)]),_:2},1032,["color","title"])):F("",!0),p.question.originRound!==e.currentRound?(y(),P(u,{key:1,size:"sm",variant:"outline",color:"neutral"},{default:O(()=>[Ce(" Round "+z(p.question.originRound),1)]),_:2},1024)):F("",!0),p.filePath?(y(),I("span",hq,z(p.filePath),1)):F("",!0),p.question.resolved?(y(),P(c,{key:3,size:"xs",variant:"ghost",class:"ml-auto",onClick:h=>f(o)(p.question.id)},{default:O(()=>[Ce(z(i(p)?"Show":"Hide"),1)]),_:2},1032,["onClick"])):F("",!0)]),i(p)?(y(),I("p",yq,z(p.question.body),1)):(y(),I("button",{key:0,type:"button",class:"block w-full text-left",disabled:!p.filePath,onClick:h=>r("select",p)},[q("p",{class:he(["leading-relaxed",{"text-muted line-through":p.question.status==="withdrawn"}])},z(p.question.body),3),p.answer?(y(),I("div",mq,[l[1]||(l[1]=q("p",{class:"mb-0.5 text-[10px] font-bold"},"Answer",-1)),q("p",vq,z(p.answer.body),1)])):F("",!0)],8,gq))]))),128))])]),_:1},8,["open"])}}});function xq(){var n;const t=(n=pt().ui)==null?void 0:n.prefix;return r=>!t||!r?r:r.split(/\s+/).filter(Boolean).map(s=>`${t}:${s}`).join(" ")}const wq=Object.assign({inheritAttrs:!1},{__name:"ColorModeButton",props:{color:{type:null,required:!1,default:"neutral"},variant:{type:null,required:!1,default:"ghost"},label:{type:String,required:!1},activeColor:{type:null,required:!1},activeVariant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},block:{type:Boolean,required:!1},loadingAuto:{type:Boolean,required:!1},onClick:{type:[Function,Array],required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},as:{type:null,required:!1},type:{type:null,required:!1},disabled:{type:Boolean,required:!1},exactActiveClass:{type:String,required:!1},viewTransition:{type:Boolean,required:!1}},setup(e){const n=Mt("button",e),{t:r}=ma(),s=rk(),o=pt(),i=xq(),a=fr(sc(n,"icon")),l=A({get(){return s.value==="dark"},set(u){s.preference=u?"dark":"light"}});return(u,c)=>(y(),P(cn,ce({...f(a),"aria-label":l.value?f(r)("colorMode.switchToLight"):f(r)("colorMode.switchToDark"),...u.$attrs},{onClick:c[0]||(c[0]=d=>l.value=!l.value)}),{leading:O(({ui:d})=>{var p,h;return[W(en,{class:he(d.leadingIcon({class:[(p=f(n).ui)==null?void 0:p.leadingIcon,f(i)("hidden dark:inline-block")]})),name:f(o).ui.icons.dark},null,8,["class","name"]),W(en,{class:he(d.leadingIcon({class:[(h=f(n).ui)==null?void 0:h.leadingIcon,f(i)("dark:hidden")]})),name:f(o).ui.icons.light},null,8,["class","name"])]}),_:1},16))}}),_q={slots:{root:"relative inline-flex items-center",base:["w-full rounded-md border-0 appearance-none placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute inset-y-0 start-0 flex items-center",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute inset-y-0 end-0 flex items-center",trailingIcon:"shrink-0 text-dimmed"},variants:{fieldGroup:{horizontal:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"},vertical:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"}},size:{xs:{base:"px-2 py-1 text-sm/4 gap-1",leading:"ps-2",trailing:"pe-2",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},sm:{base:"px-2.5 py-1.5 text-sm/4 gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},md:{base:"px-2.5 py-1.5 text-base/5 gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},lg:{base:"px-3 py-2 text-base/5 gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent focus:outline-none"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},fixed:{false:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"outline-success/25 focus-visible:outline-3 focus-visible:ring-success"},{color:"info",variant:["outline","subtle"],class:"outline-info/25 focus-visible:outline-3 focus-visible:ring-info"},{color:"warning",variant:["outline","subtle"],class:"outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning"},{color:"error",variant:["outline","subtle"],class:"outline-error/25 focus-visible:outline-3 focus-visible:ring-error"},{color:"primary",variant:["soft","ghost"],class:"outline-primary/25 focus-visible:outline-3"},{color:"secondary",variant:["soft","ghost"],class:"outline-secondary/25 focus-visible:outline-3"},{color:"success",variant:["soft","ghost"],class:"outline-success/25 focus-visible:outline-3"},{color:"info",variant:["soft","ghost"],class:"outline-info/25 focus-visible:outline-3"},{color:"warning",variant:["soft","ghost"],class:"outline-warning/25 focus-visible:outline-3"},{color:"error",variant:["soft","ghost"],class:"outline-error/25 focus-visible:outline-3"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted"},{color:"neutral",variant:["soft","ghost"],class:"outline-inverted/25 focus-visible:outline-3"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}},{fixed:!1,size:"xs",class:"md:text-xs"},{fixed:!1,size:"sm",class:"md:text-xs"},{fixed:!1,size:"md",class:"md:text-sm"},{fixed:!1,size:"lg",class:"md:text-sm"}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},kq=["id","type","value","name","placeholder","disabled","required","autocomplete"],Cq=Object.assign({inheritAttrs:!1},{__name:"Input",props:{as:{type:null,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},type:{type:null,required:!1,default:"text"},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autocomplete:{type:[String,Object],required:!1,default:"off"},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:["update:modelValue","blur","change"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=Vn(),i=Mt("input",r),a=Fn(i,"modelValue",s,{defaultValue:i.defaultValue}),l=pt(),{emitFormBlur:u,emitFormInput:c,emitFormChange:d,size:p,color:h,id:g,name:m,highlight:v,disabled:b,emitFormFocus:w,ariaAttrs:x}=Ic(r,{deferInputValidation:!0}),{orientation:_,size:R}=Rc(r),{isLeading:T,isTrailing:E,leadingIconName:$,trailingIconName:N}=Ra(i),D=A(()=>R.value||p.value),Y=A(()=>{var X;return Dt({extend:_q,...((X=l.ui)==null?void 0:X.input)||{}})({type:i.type,color:h.value??i.color,variant:i.variant,size:(D==null?void 0:D.value)??i.size,loading:i.loading,highlight:v.value??i.highlight,fixed:i.fixed,leading:T.value||!!i.avatar||!!o.leading,trailing:E.value||!!o.trailing,fieldGroup:_.value})}),te=Hr("inputRef");function re(X){var _e,le,Se,Ne,tt;(_e=i.modelModifiers)!=null&&_e.trim&&(typeof X=="string"||X===null||X===void 0)&&(X=(X==null?void 0:X.trim())??null),((le=i.modelModifiers)!=null&&le.number||i.type==="number")&&(X=Zg(X)),(Se=i.modelModifiers)!=null&&Se.nullable&&(X||(X=null)),(Ne=i.modelModifiers)!=null&&Ne.optional&&!((tt=i.modelModifiers)!=null&&tt.nullable)&&X!==null&&(X||(X=void 0)),a.value=X,c()}function j(X){var _e;(_e=i.modelModifiers)!=null&&_e.lazy||re(X.target.value)}function de(X){var le,Se;const _e=X.target.value;(le=i.modelModifiers)!=null&&le.lazy&&re(_e),(Se=i.modelModifiers)!=null&&Se.trim&&(X.target.value=_e.trim()),d(),s("change",X)}function G(X){u(),s("blur",X)}function ue(){var X;i.autofocus&&((X=te.value)==null||X.focus())}return ft(()=>{setTimeout(()=>{ue()},i.autofocusDelay)}),t({inputRef:te}),(X,_e)=>{var le;return y(),P(f(Ie),{as:f(i).as,"data-slot":X.$attrs["data-slot"]??"root",class:he(Y.value.root({class:[(le=f(i).ui)==null?void 0:le.root,f(i).class]}))},{default:O(()=>{var Se,Ne,tt;return[q("input",ce({id:f(g),ref_key:"inputRef",ref:te,type:f(i).type,value:f(a),name:f(m),placeholder:f(i).placeholder,class:Y.value.base({class:(Se=f(i).ui)==null?void 0:Se.base}),disabled:f(b),required:f(i).required,autocomplete:f(i).autocomplete},{...X.$attrs,...f(x)},{"data-slot":"base",onInput:j,onBlur:G,onChange:de,onFocus:_e[0]||(_e[0]=(...it)=>f(w)&&f(w)(...it))}),null,16,kq),V(X.$slots,"default",{ui:Y.value}),f(T)||f(i).avatar||o.leading?(y(),I("span",{key:0,"data-slot":"leading",class:he(Y.value.leading({class:(Ne=f(i).ui)==null?void 0:Ne.leading}))},[V(X.$slots,"leading",{ui:Y.value},()=>{var it,Qe,Be;return[f(T)&&f($)?(y(),P(en,{key:0,name:f($),"data-slot":"leadingIcon",class:he(Y.value.leadingIcon({class:(it=f(i).ui)==null?void 0:it.leadingIcon}))},null,8,["name","class"])):f(i).avatar?(y(),P(Bo,ce({key:1,size:((Qe=f(i).ui)==null?void 0:Qe.leadingAvatarSize)||Y.value.leadingAvatarSize()},f(i).avatar,{"data-slot":"leadingAvatar",class:Y.value.leadingAvatar({class:(Be=f(i).ui)==null?void 0:Be.leadingAvatar})}),null,16,["size","class"])):F("",!0)]})],2)):F("",!0),f(E)||o.trailing?(y(),I("span",{key:1,"data-slot":"trailing",class:he(Y.value.trailing({class:(tt=f(i).ui)==null?void 0:tt.trailing}))},[V(X.$slots,"trailing",{ui:Y.value},()=>{var it;return[f(N)?(y(),P(en,{key:0,name:f(N),"data-slot":"trailingIcon",class:he(Y.value.trailingIcon({class:(it=f(i).ui)==null?void 0:it.trailingIcon}))},null,8,["name","class"])):F("",!0)]})],2)):F("",!0)]}),_:3},8,["as","data-slot","class"])}}}),Sq={base:"inline-flex items-center justify-center px-1 rounded-sm font-medium font-sans uppercase",variants:{color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{solid:"",outline:"",soft:"",subtle:""},size:{sm:"h-4 min-w-[16px] text-[10px]",md:"h-5 min-w-[20px] text-[11px]",lg:"h-6 min-w-[24px] text-[12px]"}},compoundVariants:[{color:"primary",variant:"solid",class:"text-inverted bg-primary"},{color:"secondary",variant:"solid",class:"text-inverted bg-secondary"},{color:"success",variant:"solid",class:"text-inverted bg-success"},{color:"info",variant:"solid",class:"text-inverted bg-info"},{color:"warning",variant:"solid",class:"text-inverted bg-warning"},{color:"error",variant:"solid",class:"text-inverted bg-error"},{color:"primary",variant:"outline",class:"ring ring-inset ring-primary/50 text-primary"},{color:"secondary",variant:"outline",class:"ring ring-inset ring-secondary/50 text-secondary"},{color:"success",variant:"outline",class:"ring ring-inset ring-success/50 text-success"},{color:"info",variant:"outline",class:"ring ring-inset ring-info/50 text-info"},{color:"warning",variant:"outline",class:"ring ring-inset ring-warning/50 text-warning"},{color:"error",variant:"outline",class:"ring ring-inset ring-error/50 text-error"},{color:"primary",variant:"soft",class:"text-primary bg-primary/10"},{color:"secondary",variant:"soft",class:"text-secondary bg-secondary/10"},{color:"success",variant:"soft",class:"text-success bg-success/10"},{color:"info",variant:"soft",class:"text-info bg-info/10"},{color:"warning",variant:"soft",class:"text-warning bg-warning/10"},{color:"error",variant:"soft",class:"text-error bg-error/10"},{color:"primary",variant:"subtle",class:"text-primary ring ring-inset ring-primary/25 bg-primary/10"},{color:"secondary",variant:"subtle",class:"text-secondary ring ring-inset ring-secondary/25 bg-secondary/10"},{color:"success",variant:"subtle",class:"text-success ring ring-inset ring-success/25 bg-success/10"},{color:"info",variant:"subtle",class:"text-info ring ring-inset ring-info/25 bg-info/10"},{color:"warning",variant:"subtle",class:"text-warning ring ring-inset ring-warning/25 bg-warning/10"},{color:"error",variant:"subtle",class:"text-error ring ring-inset ring-error/25 bg-error/10"},{color:"neutral",variant:"solid",class:"text-inverted bg-inverted"},{color:"neutral",variant:"outline",class:"ring ring-inset ring-accented text-default bg-default"},{color:"neutral",variant:"soft",class:"text-default bg-elevated"},{color:"neutral",variant:"subtle",class:"ring ring-inset ring-accented text-default bg-elevated"}],defaultVariants:{variant:"outline",color:"neutral",size:"md"}},Tq={__name:"Kbd",props:{as:{type:null,required:!1,default:"kbd"},value:{type:null,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(e){const n=Mt("kbd",e),{getKbdKey:r}=V_(),s=pt(),o=A(()=>{var i;return Dt({extend:Sq,...((i=s.ui)==null?void 0:i.kbd)||{}})});return(i,a)=>{var l;return y(),P(f(Ie),{as:f(n).as,class:he(o.value({class:[(l=f(n).ui)==null?void 0:l.base,f(n).class],color:f(n).color,variant:f(n).variant,size:f(n).size}))},{default:O(()=>[V(i.$slots,"default",{},()=>[Ce(z(f(r)(f(n).value)),1)])]),_:3},8,["as","class"])}}},Aq={slots:{content:"flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto",arrow:"fill-bg stroke-default",text:"truncate",kbds:"hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['·'] not-first-of-type:before:me-0.5",kbdsSize:"sm"}},Eq={__name:"Tooltip",props:{text:{type:String,required:!1},kbds:{type:Array,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},delayDuration:{type:Number,required:!1},disableHoverableContent:{type:Boolean,required:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1}},emits:["update:open"],setup(e,{emit:t}){const n=e,r=t,s=Vn(),o=Mt("tooltip",n),i=pt(),a=zo(),l=fr(zn(o,"defaultOpen","open","delayDuration","disableHoverableContent","disableClosingTrigger","ignoreNonKeyboardFocus"),r),u=Ea(Ct(()=>o.portal)),c=Ct(()=>wn(o.content,a.content.value,{side:"bottom",sideOffset:8,collisionPadding:8})),d=Ct(()=>wn(o.arrow,{rounded:!0})),p=A(()=>{var h;return Dt({extend:Aq,...((h=i.ui)==null?void 0:h.tooltip)||{}})({side:c.value.side})});return(h,g)=>{var m;return y(),P(f(_T),ce(f(l),{disabled:!(f(o).text||(m=f(o).kbds)!=null&&m.length||s.content)||f(o).disabled}),{default:O(({open:v})=>[s.default||f(o).reference?(y(),P(f(PT),ce({key:0},h.$attrs,{"as-child":"",reference:f(o).reference,class:f(o).class}),{default:O(()=>[V(h.$slots,"default",{open:v})]),_:2},1040,["reference","class"])):F("",!0),W(f(OT),st(lt(f(u))),{default:O(()=>[W(f(Pc),null,{default:O(()=>{var b;return[W(f(AT),ce(c.value,{"data-slot":"content",class:p.value.content({class:[!s.default&&f(o).class,(b=f(o).ui)==null?void 0:b.content]})}),{default:O(()=>{var w;return[V(h.$slots,"content",{ui:p.value},()=>{var x,_,R;return[f(o).text?(y(),I("span",{key:0,"data-slot":"text",class:he(p.value.text({class:(x=f(o).ui)==null?void 0:x.text}))},z(f(o).text),3)):F("",!0),(_=f(o).kbds)!=null&&_.length?(y(),I("span",{key:1,"data-slot":"kbds",class:he(p.value.kbds({class:(R=f(o).ui)==null?void 0:R.kbds}))},[(y(!0),I(pe,null,$e(f(o).kbds,(T,E)=>{var $;return y(),P(Tq,ce({key:E,size:(($=f(o).ui)==null?void 0:$.kbdsSize)||p.value.kbdsSize()},{ref_for:!0},typeof T=="string"?{value:T}:T),null,16,["size"])}),128))],2)):F("",!0)]}),f(o).arrow?(y(),P(f(mT),ce({key:0},d.value,{"data-slot":"arrow",class:p.value.arrow({class:(w=f(o).ui)==null?void 0:w.arrow})}),null,16,["class"])):F("",!0)]}),_:3},16,["class"])]}),_:3})]),_:3},16)]),_:3},16,["disabled"])}}},Oq={class:"flex items-center gap-3 border-b border-default px-4 py-3"},Rq={key:0,class:"min-w-0"},Pq={class:"flex items-center gap-2"},Iq={class:"truncate text-sm font-semibold"},qq={key:0,class:"mt-0.5 flex items-center gap-2 text-xs text-muted"},$q=["href"],Mq={key:1,class:"shrink-0 font-mono"},Dq={key:1,class:"truncate text-sm font-semibold"},Nq={class:"ml-auto flex items-center gap-3"},Lq={class:"w-80 p-3"},zq=ee({__name:"ReviewHeader",props:{headerTitle:{},comparison:{},hasMrMetadata:{type:Boolean},navVisible:{type:Boolean},layout:{},openQuestionCount:{},promptCopied:{type:Boolean},hasWriteToken:{type:Boolean},writeTokenDraft:{},focusMode:{type:Boolean},focusModeCount:{}},emits:["update:navVisible","update:layout","update:writeTokenDraft","update:focusMode","openQuestions","openMrDetails","copyPrompt","saveWriteToken"],setup(e,{emit:t}){const n=t;return(r,s)=>{const o=cn,i=Eq,a=sv,l=Hc,u=Cq,c=Da,d=wq;return y(),I("header",Oq,[W(i,{text:e.navVisible?"Hide file list":"Show file list"},{default:O(()=>[W(o,{size:"sm",color:"neutral",variant:e.navVisible?"subtle":"ghost",icon:"i-lucide-panel-left","aria-pressed":e.navVisible,onClick:s[0]||(s[0]=p=>n("update:navVisible",!e.navVisible))},null,8,["variant","aria-pressed"])]),_:1},8,["text"]),e.comparison?(y(),I("div",Rq,[q("div",Pq,[q("h1",Iq,z(e.headerTitle),1),e.hasMrMetadata?(y(),P(o,{key:0,size:"xs",variant:"soft",color:"primary",icon:"i-lucide-file-text",onClick:s[1]||(s[1]=p=>n("openMrDetails"))},{default:O(()=>[...s[8]||(s[8]=[Ce(" Details ",-1)])]),_:1})):F("",!0)]),e.hasMrMetadata?(y(),I("div",qq,[e.comparison.url?(y(),I("a",{key:0,href:e.comparison.url,target:"_blank",rel:"noopener",class:"truncate text-primary hover:underline"},z(e.comparison.url),9,$q)):F("",!0),e.comparison.sourceBranch?(y(),I("span",Mq,z(e.comparison.sourceBranch)+" → "+z(e.comparison.targetBranch??"main"),1)):F("",!0)])):F("",!0)])):(y(),I("h1",Dq,z(e.headerTitle),1)),q("div",Nq,[e.comparison?(y(),P(i,{key:0,text:"All questions"},{default:O(()=>[W(a,{text:e.openQuestionCount,show:e.openQuestionCount>0,color:"warning",size:"sm"},{default:O(()=>[W(o,{size:"sm",variant:"ghost",color:"neutral",icon:"i-lucide-message-circle-question",onClick:s[2]||(s[2]=p=>n("openQuestions"))})]),_:1},8,["text","show"])]),_:1})):F("",!0),s[12]||(s[12]=q("div",{class:"h-5 w-px bg-default"},null,-1)),W(i,{text:e.focusMode?"Exit focus mode":`Focus mode — step through ${e.focusModeCount} item(s) needing attention`},{default:O(()=>[W(o,{size:"sm",variant:e.focusMode?"solid":"ghost",color:e.focusMode?"primary":"neutral",icon:"i-lucide-crosshair",onClick:s[3]||(s[3]=p=>n("update:focusMode",!e.focusMode))},{default:O(()=>[...s[9]||(s[9]=[Ce(" Focus ",-1)])]),_:1},8,["variant","color"])]),_:1},8,["text"]),s[13]||(s[13]=q("div",{class:"h-5 w-px bg-default"},null,-1)),W(l,{size:"sm"},{default:O(()=>[W(i,{text:"Inline diff"},{default:O(()=>[W(o,{icon:"i-lucide-align-justify",variant:e.layout==="inline"?"solid":"outline",color:"neutral",onClick:s[4]||(s[4]=p=>n("update:layout","inline"))},null,8,["variant"])]),_:1}),W(i,{text:"Side-by-side diff"},{default:O(()=>[W(o,{icon:"i-lucide-columns-2",variant:e.layout==="side-by-side"?"solid":"outline",color:"neutral",onClick:s[5]||(s[5]=p=>n("update:layout","side-by-side"))},null,8,["variant"])]),_:1})]),_:1}),s[14]||(s[14]=q("div",{class:"h-5 w-px bg-default"},null,-1)),e.comparison?(y(),P(i,{key:1,text:e.promptCopied?"Copied!":"Copy Generator prompt"},{default:O(()=>[W(o,{size:"sm",variant:"ghost",color:e.promptCopied?"success":"neutral",icon:e.promptCopied?"i-lucide-check":"i-lucide-clipboard-copy",onClick:s[6]||(s[6]=p=>n("copyPrompt"))},null,8,["color","icon"])]),_:1},8,["text"])):F("",!0),s[15]||(s[15]=q("div",{class:"h-5 w-px bg-default"},null,-1)),W(c,null,{content:O(({close:p})=>[q("div",Lq,[s[11]||(s[11]=q("p",{class:"mb-2 text-xs text-muted"},[Ce(" Paste the write token printed by "),q("code",{class:"font-mono"},"review-workspace serve"),Ce(". Needed to raise Questions or change Review State — read-only viewing works without it. ")],-1)),W(u,{"model-value":e.writeTokenDraft,size:"sm",class:"w-full",placeholder:"write token","onUpdate:modelValue":s[7]||(s[7]=h=>n("update:writeTokenDraft",h)),onKeyup:lg(h=>n("saveWriteToken",p),["enter"])},null,8,["model-value","onKeyup"]),W(o,{size:"sm",class:"mt-2",block:"",onClick:h=>n("saveWriteToken",p)},{default:O(()=>[...s[10]||(s[10]=[Ce("Save",-1)])]),_:1},8,["onClick"])])]),default:O(()=>[W(i,{text:e.hasWriteToken?"Write token set":"Set write token"},{default:O(()=>[W(o,{size:"sm",variant:"ghost",color:e.hasWriteToken?"primary":"warning",icon:"i-lucide-key"},null,8,["color"])]),_:1},8,["text"])]),_:1}),W(i,{text:"Toggle color mode"},{default:O(()=>[W(d,{size:"sm"})]),_:1})])])}}}),Bq={class:"flex flex-col gap-5"},Fq={class:"flex flex-col gap-4"},jq={class:"mb-1 flex items-center gap-2"},Hq={key:0,class:"text-xs font-semibold text-highlighted"},Vq={key:1,class:"text-xs font-semibold text-muted"},Uq={class:"flex flex-col gap-1"},Wq=["title","onClick"],Gq={key:0},Kq={class:"mb-2 flex h-1.5 overflow-hidden rounded-full bg-elevated"},Yq={class:"space-y-0.5 text-xs"},Qq={class:"flex justify-between"},Xq={class:"flex justify-between"},Zq={class:"flex justify-between"},Jq=ee({__name:"Sidebar",props:{groups:{},files:{}},setup(e){const t=e;function n(l){return`file-${l.replace(/[^a-zA-Z0-9]/g,"-")}`}function r(l){return l.split("/").pop()??l}function s(l){var u;(u=document.getElementById(n(l)))==null||u.scrollIntoView({behavior:"smooth",block:"start"})}const o={high:"error",medium:"warning",low:"success"},i=A(()=>Tv(t.files)),a=A(()=>i.value.verified+i.value.unverified+i.value.gap);return(l,u)=>{const c=Wn;return y(),I("nav",Bq,[q("div",null,[u[0]||(u[0]=q("p",{class:"mb-2 text-[11px] font-semibold tracking-wide text-dimmed uppercase"},"Behavioral groups",-1)),q("div",Fq,[(y(!0),I(pe,null,$e(e.groups,(d,p)=>{var h,g;return y(),I("div",{key:((h=d.group)==null?void 0:h.id)??`ungrouped-${p}`},[q("div",jq,[d.group?(y(),I("span",Hq,z(d.group.title),1)):(y(),I("span",Vq,"Other changes")),(g=d.group)!=null&&g.risk?(y(),P(c,{key:2,color:o[d.group.risk],variant:"subtle",size:"sm"},{default:O(()=>[Ce(z(d.group.risk),1)]),_:2},1032,["color"])):F("",!0)]),q("div",Uq,[(y(!0),I(pe,null,$e(d.filePaths,m=>(y(),I("button",{key:m,type:"button",class:"truncate rounded px-2 py-1 text-left font-mono text-xs text-muted hover:bg-elevated hover:text-highlighted",title:m,onClick:v=>s(m)},z(r(m)),9,Wq))),128))])])}),128))])]),a.value?(y(),I("div",Gq,[u[4]||(u[4]=q("p",{class:"mb-2 text-[11px] font-semibold tracking-wide text-dimmed uppercase"},"Verification",-1)),q("div",Kq,[q("div",{class:"bg-success",style:kt({width:`${100*i.value.verified/a.value}%`})},null,4),q("div",{class:"bg-warning",style:kt({width:`${100*i.value.unverified/a.value}%`})},null,4),q("div",{class:"bg-error",style:kt({width:`${100*i.value.gap/a.value}%`})},null,4)]),q("ul",Yq,[q("li",Qq,[u[1]||(u[1]=q("span",{class:"text-success"},"verified",-1)),q("span",null,z(i.value.verified),1)]),q("li",Xq,[u[2]||(u[2]=q("span",{class:"text-warning"},"unverified",-1)),q("span",null,z(i.value.unverified),1)]),q("li",Zq,[u[3]||(u[3]=q("span",{class:"text-error"},"gap",-1)),q("span",null,z(i.value.gap),1)])])])):F("",!0)])}}}),e$={class:"max-h-72 w-80 overflow-y-auto p-2 font-mono text-xs"},t$={class:"mb-1 px-1 font-sans text-[10px] text-muted"},n$=["onClick"],r$={class:"text-primary"},s$={class:"text-dimmed"},o$={class:"text-muted"},i$=ee({__name:"SymbolOccurrencesPopover",setup(e){const t=GR();async function n(s,o,i){Mp(),await qv(s,o,i)}function r(s){s||Mp()}return(s,o)=>{const i=Da;return y(),P(i,{open:f(t).open,"onUpdate:open":r},{content:O(()=>[q("div",e$,[q("div",t$,z(f(t).occurrences.length)+" occurrence"+z(f(t).occurrences.length===1?"":"s")+" of “"+z(f(t).symbol)+"” ",1),(y(!0),I(pe,null,$e(f(t).occurrences,a=>(y(),I("button",{key:a.lineId,type:"button",class:"block w-full truncate rounded px-1.5 py-1 text-left hover:bg-elevated",onClick:l=>n(a.path,a.hunkIndex,a.lineId)},[q("span",r$,z(a.path),1),q("span",s$,":"+z(a.lineNumber),1),q("span",o$," — "+z(a.text.trim()),1)],8,n$))),128))])]),default:O(()=>[q("span",{class:"pointer-events-none fixed h-0 w-0",style:kt({left:`${f(t).x}px`,top:`${f(t).y}px`})},null,4)]),_:1},8,["open"])}}}),a$={role:"region","aria-label":"Verdict",class:"mb-6 rounded-lg border border-default bg-elevated p-4"},l$={class:"mb-1 text-base font-bold text-highlighted"},u$=["innerHTML"],c$={class:"mb-4 grid grid-cols-2 gap-3 sm:grid-cols-4"},d$={class:"text-2xl font-bold text-success"},f$={class:"text-2xl font-bold text-error"},p$={class:"text-2xl font-bold text-warning"},h$={class:"text-2xl font-bold text-highlighted"},g$={key:1},m$={class:"mb-2 text-[11px] font-semibold tracking-wide text-dimmed uppercase"},v$={class:"space-y-1.5 text-xs"},y$={class:"w-4 shrink-0 text-right text-dimmed"},b$=["onClick"],x$={class:"hidden shrink-0 font-mono text-dimmed sm:inline"},w$={key:0,class:"mt-1.5 text-[11px] text-dimmed"},_$={key:2,class:"mt-3 flex flex-wrap gap-2 text-xs"},k$=["onClick"],Lp=5,C$=ee({__name:"VerdictPanel",props:{summary:{},files:{},groups:{}},setup(e){const t=e,n=Q(!1),r=A(()=>t.summary?Sv(t.summary.text):{headline:"",body:""}),s=A(()=>Tv(t.files)),o=A(()=>{const d=Wc(t.groups);return Gc(Uc(t.files),d)}),i=A(()=>o.value.slice(0,Lp)),a=A(()=>Math.max(0,o.value.length-Lp)),l={gap:"⚑",unverified:"○"},u={gap:"error",unverified:"warning"};function c(d){var p;(p=document.getElementById(Ms(d)))==null||p.scrollIntoView({behavior:"smooth",block:"start"})}return(d,p)=>{var g;const h=Wn;return y(),I("section",a$,[e.summary?(y(),I(pe,{key:0},[q("h2",l$,z(r.value.headline),1),r.value.body?(y(),I("button",{key:0,type:"button",class:"mb-3 text-xs text-primary hover:underline",onClick:p[0]||(p[0]=m=>n.value=!n.value)},z(n.value?"▾ hide rest":"▸ read rest"),1)):F("",!0),n.value&&r.value.body?(y(),I("div",{key:1,class:"markdown-body mb-3 text-sm text-muted",innerHTML:f(qa)(r.value.body)},null,8,u$)):F("",!0)],64)):F("",!0),q("div",c$,[q("div",null,[q("p",d$,z(s.value.verified),1),p[1]||(p[1]=q("p",{class:"text-[11px] tracking-wide text-dimmed uppercase"},"Resolved",-1))]),q("div",null,[q("p",f$,z(s.value.gap),1),p[2]||(p[2]=q("p",{class:"text-[11px] tracking-wide text-dimmed uppercase"},"Open gaps",-1))]),q("div",null,[q("p",p$,z(s.value.unverified),1),p[3]||(p[3]=q("p",{class:"text-[11px] tracking-wide text-dimmed uppercase"},"Needs eyes",-1))]),q("div",null,[q("p",h$,z(e.files.length),1),p[4]||(p[4]=q("p",{class:"text-[11px] tracking-wide text-dimmed uppercase"},"Files changed",-1))])]),i.value.length?(y(),I("div",g$,[q("p",m$," Start here — "+z(o.value.length)+" item"+z(o.value.length===1?"":"s")+", ordered by risk ",1),q("ol",v$,[(y(!0),I(pe,null,$e(i.value,(m,v)=>(y(),I("li",{key:m.verification.id,class:"flex items-center gap-2"},[q("span",y$,z(v+1),1),q("button",{type:"button",class:"flex-1 truncate text-left hover:underline",onClick:b=>c(m.path)},z(m.verification.description),9,b$),W(h,{size:"sm",variant:"subtle",color:u[m.verification.status]},{default:O(()=>[Ce(z(l[m.verification.status])+" "+z(m.verification.status),1)]),_:2},1032,["color"]),q("span",x$,z(m.path.split("/").pop()),1)]))),128))]),a.value?(y(),I("p",w$,"+"+z(a.value)+" more not shown",1)):F("",!0)])):F("",!0),(g=e.summary)!=null&&g.highlightPaths.length?(y(),I("ul",_$,[(y(!0),I(pe,null,$e(e.summary.highlightPaths,m=>(y(),I("li",{key:m},[q("button",{type:"button",class:"font-mono text-primary hover:underline",onClick:v=>c(m)},"→ "+z(m),9,k$)]))),128))])):F("",!0)])}}});function S$(e=1500){const t=Q(!1);let n;async function r(s){await navigator.clipboard.writeText(s),t.value=!0,clearTimeout(n),n=setTimeout(()=>t.value=!1,e)}return{copied:t,copy:r}}const T$=4e3;function A$(){const e=Q(null),t=Q(null);let n;async function r(){try{e.value=await $O(),Ao.value=e.value.files,t.value=null}catch(s){t.value=s instanceof Error?s.message:String(s)}await Ma()}return ft(async()=>{await FO(),await r(),n=setInterval(r,T$)}),qo(()=>clearInterval(n)),{viewModel:e,error:t,refresh:r}}function E$(e){const t=new Map;let n=1;for(const r of e)for(const s of r.files){for(const o of s.annotations)o.target.type!=="line"&&t.set(o.id,n++);for(const o of s.hunks)for(const i of o.lines)for(const a of i.annotations)t.set(a.id,n++)}return t}function O$(e){return!!e&&!!(e.title||e.url||e.author||e.sourceBranch||e.description)}function R$(e){return e?e.title?e.number?`!${e.number} ${e.title}`:e.title:`${e.base} → ${e.head}`:"Review Workspace"}function P$(e){return e!=null&&e.description?qa(e.description,e.url):""}function I$(e,t){const n=new Set,r=t.map(o=>{const i=o.filePaths.map(a=>e.find(l=>l.path===a)).filter(a=>!!a);return i.forEach(a=>n.add(a.path)),{group:o,filePaths:i.map(a=>a.path),files:i}}),s=e.filter(o=>!n.has(o.path));return s.length&&r.push({group:null,filePaths:s.map(o=>o.path),files:s}),r}const q$={class:"flex h-screen flex-col bg-default text-default"},$$={key:1,class:"p-4 text-error"},M$={key:2,class:"p-4 text-muted"},D$={key:4,class:"flex flex-1 overflow-hidden"},N$={key:0,class:"w-64 shrink-0 overflow-y-auto border-r border-default p-3"},L$={class:"flex-1 overflow-y-auto p-4"},z$={key:0,class:"mb-4 rounded border border-warning/50 bg-warning/10 p-3 text-xs"},B$={class:"mb-3 flex items-center gap-2"},F$={key:0,class:"text-base font-semibold"},j$={key:1,class:"text-base font-semibold text-muted"},H$={key:0,class:"mb-4 flex flex-col gap-3"},V$=ee({__name:"DiffReviewView",setup(e){const{viewModel:t,error:n}=A$(),r=bv(),{copied:s,copy:o}=S$(),i=Q("inline"),a=Q(!0),l=Q(!1),u=Q(!1),c=Q(!1),d=Q(),p=Q(r.writeToken),h=A(()=>{const D=t.value;return D?I$(D.files,D.groups):[]}),g=A(()=>{const D=t.value;return D?Gc(Uc(D.files),Wc(D.groups)).length:0});function m(D){c.value=!1,D&&requestAnimationFrame(()=>{var Y;return(Y=document.getElementById(Ms(D)))==null?void 0:Y.scrollIntoView({behavior:"smooth",block:"start"})})}const v=A(()=>E$(h.value)),b=A(()=>{var D;return((D=t.value)==null?void 0:D.comparison)??null}),w=A(()=>R$(b.value??void 0)),x=A(()=>O$(b.value??void 0)),_=A(()=>P$(b.value??void 0)),R=A(()=>{const D=t.value;return D?AR(D.files,D.answers,r.questions):[]}),T=A(()=>ER(R.value));function E(D){DO(p.value.trim()),D()}async function $(){t.value&&await o(t.value.generatorPrompt)}async function N(D){u.value=!1,await OR(D)}return(D,Y)=>{var re;const te=Wn;return y(),I("div",q$,[W(zq,{"header-title":w.value,comparison:b.value,"has-mr-metadata":x.value,"nav-visible":a.value,layout:i.value,"open-question-count":T.value,"prompt-copied":f(s),"has-write-token":f(r).writeToken.length>0,"write-token-draft":p.value,"focus-mode":c.value,"focus-mode-count":g.value,"onUpdate:navVisible":Y[0]||(Y[0]=j=>a.value=j),"onUpdate:layout":Y[1]||(Y[1]=j=>i.value=j),"onUpdate:writeTokenDraft":Y[2]||(Y[2]=j=>p.value=j),"onUpdate:focusMode":Y[3]||(Y[3]=j=>c.value=j),onOpenQuestions:Y[4]||(Y[4]=j=>u.value=!0),onOpenMrDetails:Y[5]||(Y[5]=j=>l.value=!0),onCopyPrompt:$,onSaveWriteToken:E},null,8,["header-title","comparison","has-mr-metadata","nav-visible","layout","open-question-count","prompt-copied","has-write-token","write-token-draft","focus-mode","focus-mode-count"]),W(i$),b.value?(y(),P(cq,{key:0,open:l.value,"onUpdate:open":Y[6]||(Y[6]=j=>l.value=j),comparison:b.value,"description-html":_.value},null,8,["open","comparison","description-html"])):F("",!0),W(bq,{open:u.value,"onUpdate:open":Y[7]||(Y[7]=j=>u.value=j),entries:R.value,"current-round":((re=f(t))==null?void 0:re.round)??1,onSelect:N},null,8,["open","entries","current-round"]),f(n)?(y(),I("div",$$,"Failed to load bundle: "+z(f(n)),1)):f(t)?c.value?(y(),P(eq,{key:3,files:f(t).files,groups:f(t).groups,"current-id":d.value,"onUpdate:currentId":Y[8]||(Y[8]=j=>d.value=j),onExit:m},null,8,["files","groups","current-id"])):(y(),I("div",D$,[a.value?(y(),I("aside",N$,[W(Jq,{groups:h.value,files:f(t).files},null,8,["groups","files"])])):F("",!0),q("main",L$,[f(t).diagnostics.length?(y(),I("div",z$,[q("strong",null,z(f(t).diagnostics.length)+" bundle-level diagnostic(s)",1)])):F("",!0),f(t).summary?(y(),P(C$,{key:1,summary:f(t).summary,files:f(t).files,groups:f(t).groups},null,8,["summary","files","groups"])):F("",!0),(y(!0),I(pe,null,$e(h.value,(j,de)=>{var G,ue;return y(),I("section",{key:((G=j.group)==null?void 0:G.id)??`ungrouped-${de}`,class:"mb-8"},[q("div",B$,[j.group?(y(),I("h2",F$,z(j.group.title),1)):(y(),I("h2",j$,"Other changes")),(ue=j.group)!=null&&ue.risk?(y(),P(te,{key:2,color:{high:"error",medium:"warning",low:"success"}[j.group.risk],variant:"subtle",size:"sm"},{default:O(()=>[Ce(z(j.group.risk),1)]),_:2},1032,["color"])):F("",!0)]),j.files.some(X=>X.annotations.length)?(y(),I("div",H$,[(y(!0),I(pe,null,$e(j.files.flatMap(X=>X.annotations),X=>(y(),P(Av,{key:X.id,annotation:X},null,8,["annotation"]))),128))])):F("",!0),(y(!0),I(pe,null,$e(j.files,X=>(y(),P(HI,{key:X.path,file:X,layout:i.value,"annotation-numbers":v.value,questions:f(r).questions,answers:f(t).answers},null,8,["file","layout","annotation-numbers","questions","answers"]))),128))])}),128))])])):(y(),I("div",M$,"Loading…"))])}}}),U$=[{path:"/",name:"diff-review",component:V$}],Kc=A0(l2),W$=$x({routes:U$,history:px()});Kc.use(W$);Kc.use(pk);Kc.mount("#app");
|
|
118
|
+
`+dn),fe&&(dn=Uo(dn)),T&&Lt?te(dn):dn},t.setConfig=function(){let oe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ha(oe),Me=!0,Ve=ye,He=S},t.clearConfig=function(){ss=null,Me=!1,Ve=null,He=null,T=$,E=""},t.isValidAttribute=function(oe,k,L){ss||Ha({});const J=at(oe),xe=at(k);return id(J,xe,L)},t.addHook=function(oe,k){typeof k=="function"&&xt(Se,oe)&&ds(Se[oe],k)},t.removeHook=function(oe,k){if(xt(Se,oe)){if(k!==void 0){const L=uO(Se[oe],k);return L===-1?void 0:cO(Se[oe],L,1)[0]}return bp(Se[oe])}},t.removeHooks=function(oe){xt(Se,oe)&&(Se[oe]=[])},t.removeAllHooks=function(){Se=Pp()},t}var qO=vv();function Au(e){return`/api/assets/${e.split("/").map(encodeURIComponent).join("/")}`}async function $O(){const e=await fetch("/api/view");if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(`GET /view failed (${e.status}): ${t.error??e.statusText}`)}return e.json()}function MO(e,t){if(e=e.replace(/(<img[^>]+src=")\/uploads\//g,`$1${Au("uploads/")}`),!t)return e;let n;try{n=new URL(t).origin}catch{return e}return e.replace(/(<img[^>]+src=")\/(?!\/)/g,`$1${n}/`)}function qa(e,t){const n=Ye.parse(e,{async:!1,breaks:!0});return qO.sanitize(MO(n,t))}const Ip=3;function Eu(e,t){const n=e.find(r=>r.path===t.path);if(!n)return null;if(t.type==="hunk"){const r=n.hunks[t.hunkIndex];return r?{path:t.path,lines:r.lines}:null}if(t.type==="line"){for(const r of n.hunks){const s=r.lines.findIndex(a=>t.side==="base"?a.oldLine===t.line:a.newLine===t.line);if(s===-1)continue;const o=Math.max(0,s-Ip),i=Math.min(r.lines.length,s+Ip+1);return{path:t.path,lines:r.lines.slice(o,i)}}return null}return null}const Ao=un([]),yv="review-workspace:write-token",gn=$t({questions:[],writeToken:localStorage.getItem(yv)??"",loading:!1,error:null});function DO(e){gn.writeToken=e,localStorage.setItem(yv,e)}function NO(){return gn.writeToken}async function $a(e){return(await e.json().catch(()=>({}))).error??e.statusText}async function Ma(){gn.loading=!0;try{const e=await fetch("/api/questions");if(!e.ok)throw new Error(`GET /questions failed: ${await $a(e)}`);gn.questions=await e.json(),gn.error=null}catch(e){gn.error=e instanceof Error?e.message:String(e)}finally{gn.loading=!1}}async function LO(e,t,n="question"){const r=await fetch("/api/questions",{method:"POST",headers:{"content-type":"application/json","x-write-token":gn.writeToken},body:JSON.stringify({body:e,target:t,kind:n})});if(!r.ok)throw new Error(`Could not raise Comment: ${await $a(r)}`);await Ma()}async function zO(e,t,n){const r=await fetch(`/api/questions/${e}/withdraw`,{method:"POST",headers:{"content-type":"application/json","x-write-token":gn.writeToken},body:JSON.stringify({body:t,target:n})});if(!r.ok)throw new Error(`Could not withdraw Question: ${await $a(r)}`);await Ma()}async function BO(e){const t=await fetch(`/api/questions/${e}/resolve`,{method:"POST",headers:{"x-write-token":gn.writeToken}});if(!t.ok)throw new Error(`Could not resolve Comment: ${await $a(t)}`);await Ma()}function bv(){return ho(gn)}const Ps=$t({data:{}});async function FO(){const e=await fetch("/state");Ps.data=e.ok?await e.json():{}}async function jO(){await fetch("/state",{method:"PUT",headers:{"content-type":"application/json","x-write-token":NO()},body:JSON.stringify(Ps.data)})}function xv(e,t){const n=new Set(Ps.data[e]??[]);n.has(t)?n.delete(t):n.add(t),Ps.data[e]=[...n],jO()}function HO(e){var t;return((t=Ps.data.reviewedFiles)==null?void 0:t.includes(e))??!1}function VO(e){xv("reviewedFiles",e)}function wv(e){var t;return((t=Ps.data.resolvedNotes)==null?void 0:t.includes(e))??!1}function _v(e){xv("resolvedNotes",e)}const UO={slots:{root:"relative inline-flex items-center",base:["w-full rounded-md border-0 appearance-none placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute start-0 flex items-start",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute end-0 flex items-start",trailingIcon:"shrink-0 text-dimmed"},variants:{fieldGroup:{horizontal:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"},vertical:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"}},size:{xs:{base:"px-2 py-1 text-sm/4 gap-1",leading:"ps-2 inset-y-1",trailing:"pe-2 inset-y-1",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},sm:{base:"px-2.5 py-1.5 text-sm/4 gap-1.5",leading:"ps-2.5 inset-y-1.5",trailing:"pe-2.5 inset-y-1.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},md:{base:"px-2.5 py-1.5 text-base/5 gap-1.5",leading:"ps-2.5 inset-y-1.5",trailing:"pe-2.5 inset-y-1.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},lg:{base:"px-3 py-2 text-base/5 gap-2",leading:"ps-3 inset-y-2",trailing:"pe-3 inset-y-2",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3 inset-y-2",trailing:"pe-3 inset-y-2",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent focus:outline-none"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},fixed:{false:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"},autoresize:{true:{base:"resize-none"}}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"outline-success/25 focus-visible:outline-3 focus-visible:ring-success"},{color:"info",variant:["outline","subtle"],class:"outline-info/25 focus-visible:outline-3 focus-visible:ring-info"},{color:"warning",variant:["outline","subtle"],class:"outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning"},{color:"error",variant:["outline","subtle"],class:"outline-error/25 focus-visible:outline-3 focus-visible:ring-error"},{color:"primary",variant:["soft","ghost"],class:"outline-primary/25 focus-visible:outline-3"},{color:"secondary",variant:["soft","ghost"],class:"outline-secondary/25 focus-visible:outline-3"},{color:"success",variant:["soft","ghost"],class:"outline-success/25 focus-visible:outline-3"},{color:"info",variant:["soft","ghost"],class:"outline-info/25 focus-visible:outline-3"},{color:"warning",variant:["soft","ghost"],class:"outline-warning/25 focus-visible:outline-3"},{color:"error",variant:["soft","ghost"],class:"outline-error/25 focus-visible:outline-3"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted"},{color:"neutral",variant:["soft","ghost"],class:"outline-inverted/25 focus-visible:outline-3"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}},{fixed:!1,size:"xs",class:"md:text-xs"},{fixed:!1,size:"sm",class:"md:text-xs"},{fixed:!1,size:"md",class:"md:text-sm"},{fixed:!1,size:"lg",class:"md:text-sm"}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},WO=["id","value","name","rows","placeholder","disabled","required"],kv=Object.assign({inheritAttrs:!1},{__name:"Textarea",props:{as:{type:null,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},autoresize:{type:Boolean,required:!1},autoresizeDelay:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},rows:{type:Number,required:!1,default:3},maxrows:{type:Number,required:!1,default:0},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:["update:modelValue","blur","change"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=Vn(),i=Mt("textarea",r),a=Fn(i,"modelValue",s,{defaultValue:i.defaultValue}),l=pt(),{emitFormFocus:u,emitFormBlur:c,emitFormInput:d,emitFormChange:p,size:h,color:g,id:m,name:v,highlight:b,disabled:w,ariaAttrs:x}=Ic(r,{deferInputValidation:!0}),{isLeading:_,isTrailing:R,leadingIconName:T,trailingIconName:E}=Ra(i),$=A(()=>{var G;return Dt({extend:UO,...((G=l.ui)==null?void 0:G.textarea)||{}})({color:g.value??i.color,variant:i.variant,size:(h==null?void 0:h.value)??i.size,loading:i.loading,highlight:b.value??i.highlight,fixed:i.fixed,autoresize:i.autoresize,leading:_.value||!!i.avatar||!!o.leading,trailing:R.value||!!o.trailing})}),N=Hr("textareaRef");function D(G){var ue,X,_e,le,Se;(ue=i.modelModifiers)!=null&&ue.trim&&(typeof G=="string"||G===null||G===void 0)&&(G=(G==null?void 0:G.trim())??null),(X=i.modelModifiers)!=null&&X.number&&(G=Zg(G)),(_e=i.modelModifiers)!=null&&_e.nullable&&(G||(G=null)),(le=i.modelModifiers)!=null&&le.optional&&!((Se=i.modelModifiers)!=null&&Se.nullable)&&G!==null&&(G||(G=void 0)),a.value=G,d()}function Y(G){var ue;de(),(ue=i.modelModifiers)!=null&&ue.lazy||D(G.target.value)}function te(G){var X,_e;const ue=G.target.value;(X=i.modelModifiers)!=null&&X.lazy&&D(ue),(_e=i.modelModifiers)!=null&&_e.trim&&(G.target.value=ue.trim()),p(),s("change",G)}function re(G){c(),s("blur",G)}function j(){var G;i.autofocus&&((G=N.value)==null||G.focus())}function de(){if(i.autoresize&&N.value){N.value.rows=i.rows;const G=N.value.style.overflow;N.value.style.overflow="hidden";const ue=window.getComputedStyle(N.value),X=Number.parseInt(ue.paddingTop),_e=Number.parseInt(ue.paddingBottom),le=X+_e,Se=Number.parseInt(ue.lineHeight),{scrollHeight:Ne}=N.value,tt=(Ne-le)/Se;tt>i.rows&&(N.value.rows=i.maxrows?Math.min(tt,i.maxrows):tt),N.value.style.overflow=G}}return De(a,()=>{ut(de)}),ft(()=>{setTimeout(()=>{j()},i.autofocusDelay),setTimeout(async()=>{await ut(),de()},i.autoresizeDelay)}),t({textareaRef:N,autoResize:de}),(G,ue)=>{var X;return y(),P(f(Ie),{as:f(i).as,"data-slot":G.$attrs["data-slot"]??"root",class:he($.value.root({class:[(X=f(i).ui)==null?void 0:X.root,f(i).class]}))},{default:O(()=>{var _e,le,Se;return[q("textarea",ce({id:f(m),ref_key:"textareaRef",ref:N,value:f(a),name:f(v),rows:f(i).rows,placeholder:f(i).placeholder,class:$.value.base({class:(_e=f(i).ui)==null?void 0:_e.base}),disabled:f(w),required:f(i).required},{...G.$attrs,...f(x)},{"data-slot":"base",onInput:Y,onBlur:re,onChange:te,onFocus:ue[0]||(ue[0]=(...Ne)=>f(u)&&f(u)(...Ne))}),null,16,WO),V(G.$slots,"default",{ui:$.value}),f(_)||f(i).avatar||o.leading?(y(),I("span",{key:0,"data-slot":"leading",class:he($.value.leading({class:(le=f(i).ui)==null?void 0:le.leading}))},[V(G.$slots,"leading",{ui:$.value},()=>{var Ne,tt,it;return[f(_)&&f(T)?(y(),P(en,{key:0,name:f(T),"data-slot":"leadingIcon",class:he($.value.leadingIcon({class:(Ne=f(i).ui)==null?void 0:Ne.leadingIcon}))},null,8,["name","class"])):f(i).avatar?(y(),P(Bo,ce({key:1,size:((tt=f(i).ui)==null?void 0:tt.leadingAvatarSize)||$.value.leadingAvatarSize()},f(i).avatar,{"data-slot":"leadingAvatar",class:$.value.leadingAvatar({class:(it=f(i).ui)==null?void 0:it.leadingAvatar})}),null,16,["size","class"])):F("",!0)]})],2)):F("",!0),f(R)||o.trailing?(y(),I("span",{key:1,"data-slot":"trailing",class:he($.value.trailing({class:(Se=f(i).ui)==null?void 0:Se.trailing}))},[V(G.$slots,"trailing",{ui:$.value},()=>{var Ne;return[f(E)?(y(),P(en,{key:0,name:f(E),"data-slot":"trailingIcon",class:he($.value.trailingIcon({class:(Ne=f(i).ui)==null?void 0:Ne.trailingIcon}))},null,8,["name","class"])):F("",!0)]})],2)):F("",!0)]}),_:3},8,["as","data-slot","class"])}}}),GO={base:"relative",variants:{size:{xs:"",sm:"",md:"",lg:"",xl:""},orientation:{horizontal:"inline-flex -space-x-px",vertical:"flex flex-col -space-y-px"}}},Hc={__name:"FieldGroup",props:{as:{type:null,required:!1},size:{type:null,required:!1},orientation:{type:null,required:!1,default:"horizontal"},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(e){const n=Mt("fieldGroup",e),r=pt(),s=A(()=>{var o;return Dt({extend:GO,...((o=r.ui)==null?void 0:o.fieldGroup)||{}})});return sn(Oc,A(()=>({orientation:n.orientation,size:n.size}))),(o,i)=>{var a;return y(),P(f(Ie),{as:f(n).as,"data-orientation":f(n).orientation,class:he(s.value({orientation:f(n).orientation,class:[(a=f(n).ui)==null?void 0:a.base,f(n).class]}))},{default:O(()=>[V(o.$slots,"default")]),_:3},8,["as","data-orientation","class"])}}};function Cv(e){const t=bv(),n=Q(""),r=Q("question"),s=Q(!1),o=Q(null),i=Q(null),a=Q("");async function l(p){if(n.value.trim()){s.value=!0,o.value=null;try{await LO(n.value.trim(),e(),r.value),n.value="",r.value="question",p()}catch(h){o.value=h instanceof Error?h.message:String(h)}finally{s.value=!1}}}function u(p){i.value=p,a.value=""}async function c(p,h){if(a.value.trim()){s.value=!0,o.value=null;try{await zO(p,a.value.trim(),e()),i.value=null,a.value="",h()}catch(g){o.value=g instanceof Error?g.message:String(g)}finally{s.value=!1}}}async function d(p){s.value=!0,o.value=null;try{await BO(p)}catch(h){o.value=h instanceof Error?h.message:String(h)}finally{s.value=!1}}return{store:t,draft:n,draftKind:r,busy:s,localError:o,editingId:i,editDraft:a,submitNewQuestion:l,startEdit:u,submitEdit:c,resolve:d}}const KO={key:0,class:"flex flex-wrap gap-2"},YO={key:0,class:"mt-1 text-error"},QO={key:1,class:"mt-1 text-warning"},XO={class:"mt-1 flex gap-2"},Vc=ee({__name:"AskQuestionForm",props:{target:{},annotation:{}},setup(e){const t=e,n=Q(!1),{draft:r,draftKind:s,busy:o,localError:i,submitNewQuestion:a,store:l}=Cv(()=>t.target),u=A(()=>l.writeToken.length>0),c=[{value:"question",label:"Question"},{value:"change-request",label:"Change request"}];function d(){n.value=!1}function p(){var h;s.value="change-request",r.value=((h=t.annotation)==null?void 0:h.summary)??"",n.value=!0}return(h,g)=>{const m=cn,v=Hc,b=kv;return y(),I("div",null,[n.value?(y(),I(pe,{key:1},[W(v,{size:"xs",class:"mb-2"},{default:O(()=>[(y(),I(pe,null,$e(c,w=>W(m,{key:w.value,variant:f(s)===w.value?"solid":"outline",color:w.value==="change-request"?"error":"neutral",onClick:x=>s.value=w.value},{default:O(()=>[Ce(z(w.label),1)]),_:2},1032,["variant","color","onClick"])),64))]),_:1}),W(b,{modelValue:f(r),"onUpdate:modelValue":g[1]||(g[1]=w=>Xe(r)?r.value=w:null),size:"sm",class:"w-full",rows:2,placeholder:f(s)==="change-request"?"What needs to change?":"What's the reasoning here?"},null,8,["modelValue","placeholder"]),f(i)?(y(),I("p",YO,z(f(i)),1)):F("",!0),u.value?F("",!0):(y(),I("p",QO,"Set your write token first (top right).")),q("div",XO,[W(m,{size:"xs",disabled:f(o)||!u.value,onClick:g[2]||(g[2]=w=>f(a)(d))},{default:O(()=>[Ce(z(f(s)==="change-request"?"Raise change request":"Ask"),1)]),_:1},8,["disabled"]),W(m,{size:"xs",variant:"ghost",onClick:d},{default:O(()=>[...g[5]||(g[5]=[Ce("Cancel",-1)])]),_:1})])],64)):(y(),I("span",KO,[W(m,{size:"xs",variant:"ghost",onClick:g[0]||(g[0]=w=>n.value=!0)},{default:O(()=>[...g[3]||(g[3]=[Ce("Ask a question",-1)])]),_:1}),e.annotation?(y(),P(m,{key:0,size:"xs",variant:"ghost",color:"error",onClick:p},{default:O(()=>[...g[4]||(g[4]=[Ce(" Flag as change-request ",-1)])]),_:1})):F("",!0)]))])}}}),ZO=new Set(["as","async","await","break","case","catch","class","const","continue","default","delete","do","else","export","extends","false","finally","for","from","function","if","implements","import","in","interface","keyof","let","new","null","of","readonly","return","switch","throw","true","try","type","typeof","undefined","var","while"]),JO={comment:"italic text-[var(--syntax-comment)]",keyword:"font-semibold text-[var(--syntax-keyword)]",string:"text-[var(--syntax-string)]",number:"text-[var(--syntax-number)]",function:"text-[var(--syntax-function)]",type:"text-[var(--syntax-type)]",property:"text-[var(--syntax-property)]",operator:"text-[var(--syntax-operator)]"},eR=/(\/\/.*|\/\*.*?\*\/|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`|\b\d+(?:\.\d+)?\b|[A-Za-z_$][\w$]*|\s+|.)/g,tR={"&":"&","<":"<",">":">",'"':""","'":"'"};function nR(e){return e.replace(/[&<>"']/g,t=>tR[t])}function Eo(e){const t=String(e);let n="";for(const r of t.matchAll(eR)){const s=r[0],o=r.index??0,i=t.slice(0,o).trimEnd().at(-1),a=t.slice(o+s.length).trimStart().at(0);let l="";s.startsWith("//")||s.startsWith("/*")?l="comment":/^["'`]/.test(s)?l="string":/^\d/.test(s)?l="number":ZO.has(s)?l="keyword":/^[A-Z][A-Za-z0-9_$]*$/.test(s)?l="type":/^[A-Za-z_$]/.test(s)&&a==="("?l="function":/^[A-Za-z_$]/.test(s)&&(i==="."||a===":")?l="property":/^[{}[\]().,:;?=><!&|+\-*/]+$/.test(s)&&(l="operator");const u=nR(s);n+=l?`<span class="${JO[l]}">${u}</span>`:u}return n}const rR={class:"max-w-full overflow-x-auto rounded border border-default bg-default p-1.5 font-mono text-[10px]"},sR={class:"mr-1.5 select-none text-dimmed"},oR=["innerHTML"],qp=ee({__name:"DiffLinesPreview",props:{lines:{}},setup(e){return(t,n)=>(y(),I("div",rR,[(y(!0),I(pe,null,$e(e.lines,r=>(y(),I("div",{key:r.id,class:he(["whitespace-pre",{"bg-success/10":r.kind==="add","bg-error/10":r.kind==="remove"}])},[q("span",sR,z(r.kind==="add"?"+":r.kind==="remove"?"−":" "),1),q("code",{innerHTML:f(Eo)(r.text)},null,8,oR)],2))),128))]))}});function Sv(e){const t=e.indexOf(". "),n=e.indexOf(" — "),r=[t,n].filter(i=>i>=0);if(!r.length)return{headline:e,body:""};const s=Math.min(...r),o=s===n;return{headline:e.slice(0,s+(o?0:1)).trim(),body:e.slice(s+(o?3:2)).trim()}}function Uc(e){var n;const t=new Map;for(const r of e)for(const s of r.verification)t.has(s.id)||t.set(s.id,{verification:s,annotationId:(n=r.annotations.find(o=>o.verification.some(i=>i.id===s.id)))==null?void 0:n.id,path:r.path});return[...t.values()]}function Tv(e){const t=new Map;for(const r of e)for(const s of r.verification)t.set(s.id,s);const n={verified:0,unverified:0,gap:0};for(const r of t.values())n[r.status]++;return n}const $p={high:0,medium:1,low:2};function Wc(e){const t=new Map(e.flatMap(n=>n.filePaths.map(r=>[r,n.risk])));return n=>t.get(n)}function Gc(e,t){return e.filter(n=>n.verification.status!=="verified").sort((n,r)=>($p[t(n.path)??"low"]??3)-($p[t(r.path)??"low"]??3))}const iR={class:"mb-1 flex flex-wrap items-start justify-between gap-2"},aR={class:"text-sm font-semibold text-highlighted"},lR={class:"flex items-center gap-2"},uR=["innerHTML"],cR={key:2,class:"mb-3 space-y-1 text-xs"},dR={class:"text-muted"},fR={key:3,class:"mb-2 flex flex-wrap items-center gap-1.5 text-[11px]"},pR={key:4,class:"mb-2 space-y-1 border-t border-default pt-2 text-xs"},hR=["onMouseenter"],gR=["onClick"],mR={class:"text-muted"},vR={class:"flex items-center gap-3"},yR={class:"mt-3 border-t border-default pt-2"},Av=ee({__name:"AnnotationCard",props:{annotation:{},defaultExpanded:{type:Boolean,default:!1},jumpToDiff:{}},setup(e){const t=e,n=A(()=>Sv(t.annotation.summary)),r=Q(t.defaultExpanded);De(()=>t.annotation.id,()=>{r.value=t.defaultExpanded});const s={verified:"✓",gap:"⚑",unverified:"○"},o={verified:"success",gap:"error",unverified:"neutral"},i={observed:"observed","author-claim":"claim",inference:"inference"},a={observed:"success","author-claim":"warning",inference:"neutral"};function l(g){var m;if(t.jumpToDiff){t.jumpToDiff(g);return}(m=document.getElementById(Ms(g)))==null||m.scrollIntoView({behavior:"smooth",block:"start"})}const u=Q(null);function c(g){var v;const m=(v=t.annotation.relatedTargets)==null?void 0:v[g];return m?Eu(Ao.value,m.target):null}const d=A(()=>wv(t.annotation.id)),p=Q(!1),h=A(()=>Eu(Ao.value,t.annotation.target));return De(()=>t.annotation.id,()=>{p.value=!1}),(g,m)=>{var w;const v=Wn,b=qc;return y(),I("article",{class:he(["rounded-lg border p-4",d.value?"border-success bg-success/5":"border-default bg-elevated"])},[q("div",iR,[q("h3",aR,z(n.value.headline),1),q("span",lR,[e.annotation.kind?(y(),P(v,{key:0,size:"sm",variant:"subtle",color:"primary"},{default:O(()=>[Ce(z(e.annotation.kind),1)]),_:1})):F("",!0),W(b,{"model-value":d.value,label:"Resolved",size:"sm","onUpdate:modelValue":m[0]||(m[0]=x=>f(_v)(e.annotation.id))},null,8,["model-value"])])]),n.value.body?(y(),I("button",{key:0,type:"button",class:"mb-2 text-xs text-primary hover:underline",onClick:m[1]||(m[1]=x=>r.value=!r.value)},z(r.value?"▾ hide detail":"▸ detail"),1)):F("",!0),r.value&&n.value.body?(y(),I("div",{key:1,class:"markdown-body mb-3 text-sm text-muted",innerHTML:f(qa)(n.value.body)},null,8,uR)):F("",!0),e.annotation.verification.length?(y(),I("ul",cR,[(y(!0),I(pe,null,$e(e.annotation.verification,x=>(y(),I("li",{key:x.id,class:"flex items-start gap-1.5"},[q("span",{class:he(`text-${o[x.status]}`)},z(s[x.status]),3),q("span",dR,z(x.description),1)]))),128))])):F("",!0),e.annotation.evidence.length?(y(),I("div",fR,[m[5]||(m[5]=q("span",{class:"text-dimmed uppercase tracking-wide"},"Evidence",-1)),(y(!0),I(pe,null,$e(e.annotation.evidence,x=>(y(),P(v,{key:x.id,size:"sm",variant:"subtle",color:a[x.kind],title:x.description},{default:O(()=>{var _;return[Ce(z(((_=x.pipeline)==null?void 0:_.jobName)??i[x.kind])+" · "+z(i[x.kind]),1)]}),_:2},1032,["color","title"]))),128))])):F("",!0),(w=e.annotation.relatedTargets)!=null&&w.length?(y(),I("ul",pR,[(y(!0),I(pe,null,$e(e.annotation.relatedTargets,(x,_)=>(y(),I("li",{key:_,onMouseenter:R=>u.value=_,onMouseleave:m[2]||(m[2]=R=>u.value=null)},[q("button",{type:"button",class:"font-mono text-primary hover:underline",onClick:R=>l(x.target.path)}," → "+z(x.target.path),9,gR),q("span",mR," — "+z(x.reason),1),u.value===_&&c(_)?(y(),P(qp,{key:0,class:"mt-1",lines:c(_).lines},null,8,["lines"])):F("",!0)],40,hR))),128))])):F("",!0),q("div",vR,[h.value?(y(),I("button",{key:0,type:"button",class:"text-xs font-medium text-primary hover:underline",onClick:m[3]||(m[3]=x=>p.value=!p.value)},z(p.value?"▾ close diff preview":"▸ preview diff"),1)):F("",!0),q("button",{type:"button",class:"text-xs font-medium text-primary hover:underline",onClick:m[4]||(m[4]=x=>l(e.annotation.target.path))}," → jump to diff ")]),p.value&&h.value?(y(),P(qp,{key:5,class:"mt-2",lines:h.value.lines},null,8,["lines"])):F("",!0),q("div",yR,[W(Vc,{target:e.annotation.target,annotation:e.annotation},null,8,["target","annotation"])])],2)}}}),Ev=$t(new Map);function bR(e,t){return Ev.get(e)??t}function xR(e,t){Ev.set(e,!t)}const wR=300;function _R(e){return e.hunks.reduce((t,n)=>t+n.lines.filter(r=>r.kind==="add").length,0)}function kR(e){return e.hunks.reduce((t,n)=>t+n.lines.filter(r=>r.kind==="remove").length,0)}function Ov(e){return e.hunks.reduce((t,n)=>t+n.lines.length,0)}function CR(e,t=wR){return!e.binary&&Ov(e)>t}function SR(e){return e.annotations.filter(t=>t.target.type!=="line")}function TR(e){const t=[];return e.hunks.forEach((n,r)=>{for(const s of n.lines)for(const o of s.annotations)t.push({annotation:o,hunkIndex:r,lineId:s.id})}),t}const Rv=$t(new Set);function Pv(e,t){return`${e}#${t}`}function Iv(e,t){return Rv.has(Pv(e,t))}function Oo(e,t){Rv.add(Pv(e,t))}function AR(e,t,n){return n.map(r=>{const s=t.find(a=>a.questionId===r.id),o=r.target;if(!o)return{question:r,answer:s};const i=e.find(a=>a.path===o.path);if(!i)return{question:r,answer:s,filePath:o.path};if(o.type==="line")for(let a=0;a<i.hunks.length;a++){const l=i.hunks[a].lines.find(u=>o.side==="base"?u.oldLine===o.line:u.newLine===o.line);if(l)return{question:r,answer:s,filePath:i.path,hunkIndex:a,lineId:l.id}}return{question:r,answer:s,filePath:i.path}})}function ER(e){return e.filter(t=>t.question.status!=="open"?!1:t.question.kind==="change-request"?!t.question.resolved:!t.answer).length}async function OR(e){var n;if(!e.filePath)return;e.hunkIndex!==void 0&&Oo(e.filePath,e.hunkIndex),await ut();const t=e.lineId?To(e.lineId):Ms(e.filePath);(n=document.getElementById(t))==null||n.scrollIntoView({behavior:"smooth",block:"center"})}async function qv(e,t,n){var r;Oo(e,t),await ut(),(r=document.getElementById(To(n)))==null||r.scrollIntoView({behavior:"smooth",block:"center"})}function RR(e,t,n,r){return r!==void 0?{type:"line",path:e,side:"head",line:r,expectedText:t}:{type:"line",path:e,side:"base",line:n,expectedText:t}}function $v(e,t){return e.filter(n=>{var r;return((r=n.target)==null?void 0:r.path)===t})}function PR(e,t){return $v(e,t).filter(n=>{var r;return((r=n.target)==null?void 0:r.type)!=="line"})}function Ou(e,t,n,r){return r===void 0?[]:$v(e,t).filter(s=>{var o;return((o=s.target)==null?void 0:o.type)==="line"&&s.target.side===n&&s.target.line===r})}const IR={Root:_S,Trigger:PS,Portal:OS,Content:AS,Arrow:bS},qR={Root:eS,Trigger:vS,Portal:gS,Content:pS,Arrow:sS,Close:iS,Anchor:nS};function Mv(e,t={}){const n=e.detail.originalEvent,r=n.target;if(!(r!=null&&r.isConnected)){e.preventDefault();return}t.scrollable&&(n.offsetX>r.clientWidth||n.offsetY>r.clientHeight)&&e.preventDefault()}const $R={slots:{content:"bg-default shadow-lg rounded-md ring ring-default data-[state=open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-popover-content-transform-origin) focus:outline-none pointer-events-auto",arrow:"fill-bg stroke-default"}},Da={__name:"Popover",props:{mode:{type:null,required:!1,default:"click"},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:null,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},modal:{type:Boolean,required:!1},openDelay:{type:Number,required:!1,default:0},closeDelay:{type:Number,required:!1,default:0},enableTouch:{type:Boolean,required:!1}},emits:["close:prevent","update:open"],setup(e,{emit:t}){const n=e,r=t,s=Vn(),o=Mt("popover",n),i=pt(),a=o.mode==="hover"?zn(o,"defaultOpen","open","openDelay","closeDelay","enableTouch"):zn(o,"defaultOpen","open","modal"),l=fr(a,r),u=Ea(Ct(()=>o.portal)),c=Ct(()=>wn(o.content,{side:"bottom",sideOffset:8,collisionPadding:8})),d=A(()=>o.dismissible?{pointerDownOutside:Mv}:["interactOutside","escapeKeyDown"].reduce((v,b)=>(v[b]=w=>{w.preventDefault(),r("close:prevent")},v),{})),p=Ct(()=>wn(o.arrow,{rounded:!0})),h=A(()=>{var m;return Dt({extend:$R,...((m=i.ui)==null?void 0:m.popover)||{}})({side:c.value.side})}),g=A(()=>o.mode==="hover"?IR:qR);return(m,v)=>(y(),P(f(g).Root,st(lt(f(l))),{default:O(({open:b,close:w})=>[s.default?(y(),P(f(g).Trigger,{key:0,"as-child":"",class:he(f(o).class)},{default:O(()=>[V(m.$slots,"default",{open:b})]),_:2},1032,["class"])):F("",!0),"Anchor"in g.value&&s.anchor?(y(),P(f(g).Anchor,{key:1,"as-child":""},{default:O(()=>[V(m.$slots,"anchor",st(lt(w?{close:w}:{})))]),_:2},1024)):F("",!0),W(f(g).Portal,st(lt(f(u))),{default:O(()=>[W(f(Pc),null,{default:O(()=>{var x,_;return[W(f(g).Content,ce(c.value,{reference:f(o).reference??((x=f(o).content)==null?void 0:x.reference),"data-slot":"content",class:h.value.content({class:[!s.default&&f(o).class,(_=f(o).ui)==null?void 0:_.content]})},Uu(d.value)),{default:O(()=>{var R;return[V(m.$slots,"content",st(lt(w?{close:w}:{}))),f(o).arrow?(y(),P(f(g).Arrow,ce({key:0},p.value,{"data-slot":"arrow",class:h.value.arrow({class:(R=f(o).ui)==null?void 0:R.arrow})}),null,16,["class"])):F("",!0)]}),_:2},1040,["reference","class"])]}),_:2},1024)]),_:2},1040)]),_:3},16))}},MR=["aria-label"],DR={class:"w-80 max-h-96 overflow-y-auto p-3 text-left font-sans text-xs whitespace-normal break-words normal-case select-text"},NR={class:"mb-1.5 flex items-center gap-2"},LR=["innerHTML"],zR={key:0,class:"mt-2 space-y-1 border-t border-default pt-2"},BR=["onMouseenter"],FR=["onClick"],jR={class:"text-muted"},HR={key:0,class:"mt-1 max-w-full overflow-x-auto rounded border border-default bg-elevated p-1.5 font-mono text-[10px] normal-case"},VR={class:"mr-1.5 select-none text-dimmed"},UR=["innerHTML"],WR={class:"mt-2 border-t border-default pt-2"},Dv=ee({__name:"AnnotationBadge",props:{annotation:{},number:{}},setup(e){const t=e,n=A(()=>wv(t.annotation.id));function r(i){var a;(a=document.getElementById(Ms(i)))==null||a.scrollIntoView({behavior:"smooth",block:"start"})}const s=Q(null);function o(i){var l;const a=(l=t.annotation.relatedTargets)==null?void 0:l[i];return a?Eu(Ao.value,a.target):null}return(i,a)=>{const l=Wn,u=qc,c=Da;return y(),P(c,{class:"ml-1 inline-grid align-middle"},{content:O(()=>{var d;return[q("div",DR,[q("span",NR,[W(l,{size:"sm",variant:"subtle",color:"primary"},{default:O(()=>[Ce(z(e.annotation.kind??"note"),1)]),_:1}),W(u,{class:"ml-auto","model-value":n.value,label:"Resolved",size:"sm","onUpdate:modelValue":a[0]||(a[0]=p=>f(_v)(e.annotation.id))},null,8,["model-value"])]),q("div",{class:"markdown-body text-muted",innerHTML:f(qa)(e.annotation.summary)},null,8,LR),(d=e.annotation.relatedTargets)!=null&&d.length?(y(),I("ul",zR,[(y(!0),I(pe,null,$e(e.annotation.relatedTargets,(p,h)=>(y(),I("li",{key:h,class:"leading-relaxed",onMouseenter:g=>s.value=h,onMouseleave:a[1]||(a[1]=g=>s.value=null)},[q("button",{type:"button",class:"font-mono text-primary hover:underline",onClick:g=>r(p.target.path)}," → "+z(p.target.path),9,FR),q("span",jR," — "+z(p.reason),1),s.value===h&&o(h)?(y(),I("div",HR,[(y(!0),I(pe,null,$e(o(h).lines,g=>(y(),I("div",{key:g.id,class:he(["whitespace-pre",{"bg-success/10":g.kind==="add","bg-error/10":g.kind==="remove"}])},[q("span",VR,z(g.kind==="add"?"+":g.kind==="remove"?"−":" "),1),q("code",{innerHTML:f(Eo)(g.text)},null,8,UR)],2))),128))])):F("",!0)],40,BR))),128))])):F("",!0),q("div",WR,[W(Vc,{target:e.annotation.target,annotation:e.annotation},null,8,["target","annotation"])])])]}),default:O(()=>[q("button",{type:"button",class:he(["grid h-[18px] w-[18px] place-items-center rounded-full border text-[10px] font-bold transition hover:scale-110 focus-visible:scale-110 focus-visible:outline-none",n.value?"border-success/60 bg-success/15 text-success hover:bg-success hover:text-inverted focus-visible:bg-success focus-visible:text-inverted":"border-warning/60 bg-warning/15 text-warning hover:bg-warning hover:text-inverted focus-visible:bg-warning focus-visible:text-inverted"]),"aria-label":`Note ${e.number}${n.value?" (resolved)":""}: ${e.annotation.summary}`},z(e.number),11,MR)]),_:1})}}}),Nv=50;function Lv(e,t,n=Nv){return e||t.length<=n?t:t.slice(0,n)}function zv(e,t,n=Nv){return e?0:Math.max(0,t.length-n)}const Lr=$t({open:!1,x:0,y:0,symbol:"",occurrences:[]});function GR(){return Lr}function KR(e,t,n,r){Lr.x=e,Lr.y=t,Lr.symbol=n,Lr.occurrences=r,Lr.open=!0}function Mp(){Lr.open=!1}const hi=/[\w$]/;function YR(e,t){if(!hi.test(e[t]??"")&&!hi.test(e[t-1]??""))return null;let n=t;for(;n>0&&hi.test(e[n-1]);)n--;let r=t;for(;r<e.length&&hi.test(e[r]);)r++;const s=e.slice(n,r);return/^[A-Za-z_$]/.test(s)?s:null}function QR(e,t){var s;const n=(s=document.caretRangeFromPoint)==null?void 0:s.call(document,e,t),r=n==null?void 0:n.startContainer;return!r||r.nodeType!==Node.TEXT_NODE?null:YR(r.textContent??"",n.startOffset)}function ys(e){if(!e.metaKey&&!e.ctrlKey)return;const t=QR(e.clientX,e.clientY);if(!t)return;const n=XR(Ao.value,t);n.length<=1||KR(e.clientX,e.clientY,t,n)}function XR(e,t){const n=new RegExp(`\\b${t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b`),r=[];for(const s of e)s.hunks.forEach((o,i)=>{for(const a of o.lines)n.test(a.text)&&r.push({path:s.path,hunkIndex:i,lineId:a.id,lineNumber:a.newLine??a.oldLine??0,text:a.text})});return r}function ZR(e){switch(e.kind){case"stale-line-target":return`Stale annotation: ${e.detail}`;case"invalid-field":return`Invalid field (${e.instancePath}): ${e.message}`;case"unresolved-target":return`Unresolved ${e.targetType} target: ${e.detail}`;case"missing-asset":return`Missing asset: ${e.assetPath}`;case"unsafe-asset-path":return`Unsafe asset path: ${e.assetPath}`;case"disallowed-asset-type":return`Disallowed asset type: ${e.assetPath}`;case"asset-too-large":return`Asset too large (${e.bytes} bytes): ${e.assetPath}`;case"dangling-answer":return`Answer ${e.answerId} references unknown Question ${e.questionId}`;case"unanchored-verification-gap":return`Verification gap ${e.verificationId} has no concrete anchor: ${e.detail}`}}const JR={key:0,class:"sticky right-1 z-10 ml-1 inline-flex items-center gap-1 align-middle"},Ru=ee({__name:"DiffLineNote",props:{annotations:{},diagnostics:{},numbers:{}},setup(e){return(t,n)=>{const r=Wn;return e.annotations.length||e.diagnostics.length?(y(),I("span",JR,[(y(!0),I(pe,null,$e(e.annotations,s=>(y(),P(Dv,{key:s.id,annotation:s,number:e.numbers.get(s.id)??0},null,8,["annotation","number"]))),128)),(y(!0),I(pe,null,$e(e.diagnostics,(s,o)=>(y(),P(r,{key:o,color:"warning",variant:"subtle",size:"sm",class:"ml-1",title:f(ZR)(s)},{default:O(()=>[...n[0]||(n[0]=[Ce(" ⚠ ",-1)])]),_:1},8,["title"]))),128))])):F("",!0)}}});function Bv(){const e=Q(new Set);function t(r){return r.resolved&&!e.value.has(r.id)}function n(r){const s=new Set(e.value);s.has(r)?s.delete(r):s.add(r),e.value=s}return{isCollapsed:t,toggleExpanded:n}}function eP(e){return e.kind==="change-request"?e.resolved?"✓":"!":"?"}function tP(e){return e.status==="withdrawn"?"border-dimmed/60 bg-dimmed/10 text-dimmed line-through":e.kind==="change-request"?e.resolved?"border-success/60 bg-success/10 text-success opacity-70":"border-error/60 bg-error/15 text-error hover:bg-error hover:text-inverted":"border-info/60 bg-info/15 text-info hover:bg-info hover:text-inverted"}function Fv(e){return e.kind==="change-request"?"error":"info"}function jv(e){return e.kind==="change-request"?"Change request":"Question"}function Hv(e,t=!1){return e.resolved||t?"success":e.status==="open"?"warning":"neutral"}function Vv(e,t=!1){return e.resolved?"Resolved":t?"Answered":e.status==="open"?"Open":"Withdrawn"}function Uv(e){return e==="target-touched"?"success":e==="target-partially-touched"?"warning":e==="target-gone"?"error":"neutral"}function Wv(e){switch(e){case"target-touched":return"Touched by new commits";case"target-partially-touched":return"Partially touched by new commits";case"target-untouched":return"Not touched by new commits";case"target-gone":return"Target gone"}}const nP={class:"inline-flex items-center gap-1 align-middle"},rP=["aria-label"],sP={class:"w-80 p-3 text-xs"},oP={class:"mb-1 flex items-center gap-2"},iP={class:"mb-2 leading-relaxed"},aP={key:0,class:"mb-2 text-muted"},lP={key:0,class:"mb-1 text-[10px] font-bold text-muted"},uP={key:1,class:"mb-2 leading-relaxed text-muted"},cP={key:2,class:"mb-2 text-muted italic"},dP={key:2,class:"mb-2 text-muted italic"},fP={key:0,class:"mt-1 text-warning"},pP={class:"mt-1 flex gap-2"},hP={key:0,class:"mt-1 text-warning"},gP={key:1,class:"truncate text-muted italic"},mP={class:"w-80 p-3 text-xs"},vP={class:"mb-2 text-muted"},yP={key:0,class:"mt-1 text-error"},bP={key:1,class:"mt-1 text-warning"},Ki=ee({__name:"QuestionThread",props:{target:{},questions:{},answers:{}},setup(e){const t=e,{store:n,draft:r,draftKind:s,busy:o,localError:i,editingId:a,editDraft:l,submitNewQuestion:u,startEdit:c,submitEdit:d,resolve:p}=Cv(()=>t.target),h=A(()=>n.writeToken.length>0),{isCollapsed:g,toggleExpanded:m}=Bv();function v(w){return t.answers.find(x=>x.questionId===w)}const b=[{value:"question",label:"Question"},{value:"change-request",label:"Change request"}];return(w,x)=>{const _=Wn,R=cn,T=kv,E=Da,$=Hc;return y(),I("span",nP,[(y(!0),I(pe,null,$e(e.questions,N=>(y(),P(E,{key:N.id},{content:O(({close:D})=>[q("div",sP,[q("p",oP,[W(_,{size:"sm",variant:"subtle",color:f(Fv)(N)},{default:O(()=>[Ce(z(f(jv)(N)),1)]),_:2},1032,["color"]),W(_,{size:"sm",variant:"subtle",color:f(Hv)(N)},{default:O(()=>[Ce(z(f(Vv)(N)),1)]),_:2},1032,["color"]),N.resolution?(y(),P(_,{key:0,size:"sm",variant:"subtle",color:f(Uv)(N.resolution.status),title:N.resolution.evidence},{default:O(()=>[Ce(z(f(Wv)(N.resolution.status)),1)]),_:2},1032,["color","title"])):F("",!0),N.resolved?(y(),P(R,{key:1,size:"xs",variant:"ghost",class:"ml-auto",onClick:Y=>f(m)(N.id)},{default:O(()=>[Ce(z(f(g)(N)?"Show":"Hide"),1)]),_:2},1032,["onClick"])):F("",!0)]),f(g)(N)?(y(),I("p",gP,z(N.body),1)):(y(),I(pe,{key:0},[q("p",iP,z(N.body),1),N.resolution?(y(),I("p",aP,z(N.resolution.evidence),1)):F("",!0),N.kind==="question"?(y(),I(pe,{key:1},[v(N.id)?(y(),I("p",lP,"Answer")):F("",!0),v(N.id)?(y(),I("p",uP,z(v(N.id).body),1)):N.status==="open"?(y(),I("p",cP,"Not answered yet.")):F("",!0)],64)):N.resolved?(y(),I("p",dP,"Resolved "+z(new Date(N.resolvedAt).toLocaleString()),1)):F("",!0),N.status==="open"&&N.kind==="change-request"&&!N.resolved?(y(),I(pe,{key:3},[W(R,{size:"xs",disabled:f(o)||!h.value,onClick:Y=>f(p)(N.id)},{default:O(()=>[...x[3]||(x[3]=[Ce("Mark resolved",-1)])]),_:1},8,["disabled","onClick"]),h.value?F("",!0):(y(),I("p",fP,"Set your write token first (top right)."))],64)):N.status==="open"&&N.kind==="question"?(y(),I(pe,{key:4},[f(a)!==N.id?(y(),P(R,{key:0,size:"xs",variant:"ghost",onClick:Y=>f(c)(N.id)},{default:O(()=>[...x[4]||(x[4]=[Ce("Withdraw & rephrase",-1)])]),_:1},8,["onClick"])):(y(),I(pe,{key:1},[W(T,{modelValue:f(l),"onUpdate:modelValue":x[0]||(x[0]=Y=>Xe(l)?l.value=Y:null),size:"sm",class:"mt-1 w-full",rows:2,placeholder:"Better phrased question…"},null,8,["modelValue"]),q("div",pP,[W(R,{size:"xs",disabled:f(o)||!h.value,onClick:Y=>f(d)(N.id,D)},{default:O(()=>[...x[5]||(x[5]=[Ce("Submit",-1)])]),_:1},8,["disabled","onClick"]),W(R,{size:"xs",variant:"ghost",onClick:x[1]||(x[1]=Y=>a.value=null)},{default:O(()=>[...x[6]||(x[6]=[Ce("Cancel",-1)])]),_:1})]),h.value?F("",!0):(y(),I("p",hP,"Set your write token first (top right)."))],64))],64)):F("",!0)],64))])]),default:O(()=>[q("button",{type:"button",class:he(["grid h-[18px] w-[18px] place-items-center rounded-full border text-[10px] font-bold transition hover:scale-110",f(tP)(N)]),"aria-label":`${N.kind==="change-request"?"Change request":"Question"}${N.resolved?" (resolved)":""}: ${N.body}`},z(f(eP)(N)),11,rP)]),_:2},1024))),128)),W(E,null,{content:O(({close:N})=>[q("div",mP,[W($,{size:"xs",class:"mb-2"},{default:O(()=>[(y(),I(pe,null,$e(b,D=>W(R,{key:D.value,variant:f(s)===D.value?"solid":"outline",color:D.value==="change-request"?"error":"neutral",onClick:Y=>s.value=D.value},{default:O(()=>[Ce(z(D.label),1)]),_:2},1032,["variant","color","onClick"])),64))]),_:1}),q("p",vP,z(f(s)==="change-request"?"Ask for a change on this exact line.":"Ask a question about this exact line."),1),W(T,{modelValue:f(r),"onUpdate:modelValue":x[2]||(x[2]=D=>Xe(r)?r.value=D:null),size:"sm",class:"w-full",rows:2,placeholder:f(s)==="change-request"?"What needs to change?":"What's the reasoning here?"},null,8,["modelValue","placeholder"]),f(i)?(y(),I("p",yP,z(f(i)),1)):F("",!0),h.value?F("",!0):(y(),I("p",bP,"Set your write token first (top right).")),W(R,{size:"xs",class:"mt-2",disabled:f(o)||!h.value,onClick:D=>f(u)(N)},{default:O(()=>[Ce(z(f(s)==="change-request"?"Raise change request":"Ask"),1)]),_:1},8,["disabled","onClick"])])]),default:O(()=>[x[7]||(x[7]=q("button",{type:"button",class:"grid h-[18px] w-[18px] place-items-center rounded-full border border-dimmed/40 text-[10px] text-dimmed opacity-0 transition group-hover:opacity-100 hover:scale-110 hover:border-info hover:text-info","aria-label":"Comment on this"}," + ",-1))]),_:1})])}}}),xP={class:"overflow-x-auto font-mono text-xs"},wP={class:"table w-max min-w-full border-collapse"},_P={class:"table-caption caption-top whitespace-nowrap bg-elevated px-3 py-1 text-primary"},kP=["id"],CP={class:"table-cell select-none px-2 text-right align-baseline text-dimmed"},SP={class:"table-cell select-none px-2 text-right align-baseline text-dimmed"},TP={class:"table-cell select-none px-1 align-baseline"},AP={class:"table-cell whitespace-pre px-2 align-baseline text-[var(--syntax-text)]"},EP=["innerHTML"],OP=["onClick"],RP=ee({__name:"DiffInlineLayout",props:{file:{},annotationNumbers:{},questions:{},answers:{}},setup(e){const t=e;function n(i){return Iv(t.file.path,i)}function r(i){const a=t.file.hunks[i];return Lv(n(i),a.lines)}function s(i){return zv(n(i),t.file.hunks[i].lines)}const o=A(()=>t.file.path);return(i,a)=>(y(),I("div",xP,[(y(!0),I(pe,null,$e(e.file.hunks,(l,u)=>(y(),I(pe,{key:u},[q("div",wP,[q("div",_P," @@ -"+z(l.oldStart)+","+z(l.oldLines)+" +"+z(l.newStart)+","+z(l.newLines)+" @@ ",1),(y(!0),I(pe,null,$e(r(u),c=>(y(),I("div",{id:f(To)(c.id),key:c.id,class:he(["group table-row",{"bg-success/10":c.kind==="add","bg-error/10":c.kind==="remove"}])},[q("span",CP,z(c.oldLine??""),1),q("span",SP,z(c.newLine??""),1),q("span",{class:he(["table-cell select-none text-center align-baseline",{"text-success":c.kind==="add","text-error":c.kind==="remove"}])},z(c.kind==="add"?"+":c.kind==="remove"?"−":""),3),q("span",TP,[W(Ki,{target:f(RR)(o.value,c.text,c.oldLine,c.newLine),questions:f(Ou)(e.questions,o.value,c.newLine!==void 0?"head":"base",c.newLine??c.oldLine),answers:e.answers},null,8,["target","questions","answers"])]),q("span",AP,[q("code",{innerHTML:f(Eo)(c.text),onClick:a[0]||(a[0]=(...d)=>f(ys)&&f(ys)(...d))},null,8,EP),W(Ru,{annotations:c.annotations,diagnostics:c.diagnostics,numbers:e.annotationNumbers},null,8,["annotations","diagnostics","numbers"])])],10,kP))),128))]),s(u)?(y(),I("button",{key:0,type:"button",class:"w-full border-b border-default bg-elevated/50 px-3 py-1.5 text-left text-[10px] text-muted hover:text-default",onClick:c=>f(Oo)(e.file.path,u)}," ⋯ Show "+z(s(u))+" more lines ",9,OP)):F("",!0)],64))),128))]))}});function PP(){const e=Hr("leftPane"),t=Hr("rightPane");let n=!1;function r(s,o){!s||!o||n||(n=!0,o.scrollLeft=s.scrollLeft,n=!1)}return{leftPane:e,rightPane:t,syncScroll:r}}const IP={class:"font-mono text-xs"},qP={class:"grid grid-cols-2"},$P={class:"table w-max min-w-full border-collapse"},MP={class:"table-caption caption-top whitespace-nowrap bg-elevated px-3 py-1 text-primary"},DP=["id"],NP={class:"table-cell w-12 select-none px-2 text-right align-baseline text-dimmed"},LP={class:"table-cell w-4 select-none text-center align-baseline text-error"},zP={class:"table-cell select-none px-1 align-baseline"},BP={class:"table-cell whitespace-pre px-2 align-baseline text-[var(--syntax-text)]"},FP=["innerHTML"],jP=["onClick"],HP={class:"table w-max min-w-full border-collapse"},VP={class:"table-caption caption-top whitespace-nowrap bg-elevated px-3 py-1 text-primary"},UP=["id"],WP={class:"table-cell w-12 select-none px-2 text-right align-baseline text-dimmed"},GP={class:"table-cell w-4 select-none text-center align-baseline text-success"},KP={class:"table-cell select-none px-1 align-baseline"},YP={class:"table-cell whitespace-pre px-2 align-baseline text-[var(--syntax-text)]"},QP=["innerHTML"],XP=["onClick"],ZP=ee({__name:"DiffSideBySideLayout",props:{file:{},annotationNumbers:{},questions:{},answers:{}},setup(e){const t=e,{leftPane:n,rightPane:r,syncScroll:s}=PP(),o=A(()=>t.file.hunks.map(c=>d2(c.lines))),i=A(()=>t.file.path);function a(c){return Iv(t.file.path,c)}function l(c){return Lv(a(c),o.value[c])}function u(c){return zv(a(c),o.value[c])}return(c,d)=>(y(),I("div",IP,[d[4]||(d[4]=q("div",{class:"grid grid-cols-2 border-b border-default bg-elevated text-[10px] font-bold text-muted"},[q("span",{class:"px-3 py-1"},"Base · before"),q("span",{class:"border-l border-default px-3 py-1"},"MR head · after")],-1)),q("div",qP,[q("div",{ref_key:"leftPane",ref:n,class:"min-w-0 overflow-x-auto",onScroll:d[1]||(d[1]=p=>f(s)(f(n),f(r)))},[(y(!0),I(pe,null,$e(e.file.hunks,(p,h)=>(y(),I(pe,{key:h},[q("div",$P,[q("div",MP," @@ -"+z(p.oldStart)+","+z(p.oldLines)+" @@ ",1),(y(!0),I(pe,null,$e(l(h),(g,m)=>{var v,b,w;return y(),I("div",{id:g.left&&g.left!==g.right?f(To)(g.left.id):void 0,key:m,class:he(["group table-row",{"bg-error/10":((v=g.left)==null?void 0:v.kind)==="remove"}])},[q("span",NP,z(((b=g.left)==null?void 0:b.oldLine)??""),1),q("span",LP,z(((w=g.left)==null?void 0:w.kind)==="remove"?"−":""),1),q("span",zP,[g.left?(y(),P(Ki,{key:0,target:{type:"line",path:i.value,side:"base",line:g.left.oldLine,expectedText:g.left.text},questions:f(Ou)(e.questions,i.value,"base",g.left.oldLine),answers:e.answers},null,8,["target","questions","answers"])):F("",!0)]),q("span",BP,[g.left?(y(),I(pe,{key:0},[q("code",{innerHTML:f(Eo)(g.left.text),onClick:d[0]||(d[0]=(...x)=>f(ys)&&f(ys)(...x))},null,8,FP),W(Ru,{annotations:g.left.annotations,diagnostics:g.left.diagnostics,numbers:e.annotationNumbers},null,8,["annotations","diagnostics","numbers"])],64)):F("",!0)])],10,DP)}),128))]),u(h)?(y(),I("button",{key:0,type:"button",class:"w-full border-b border-default bg-elevated/50 px-3 py-1.5 text-left text-[10px] text-muted hover:text-default",onClick:g=>f(Oo)(e.file.path,h)}," ⋯ Show "+z(u(h))+" more rows ",9,jP)):F("",!0)],64))),128))],544),q("div",{ref_key:"rightPane",ref:r,class:"min-w-0 overflow-x-auto border-l border-default",onScroll:d[3]||(d[3]=p=>f(s)(f(r),f(n)))},[(y(!0),I(pe,null,$e(e.file.hunks,(p,h)=>(y(),I(pe,{key:h},[q("div",HP,[q("div",VP," @@ +"+z(p.newStart)+","+z(p.newLines)+" @@ ",1),(y(!0),I(pe,null,$e(l(h),(g,m)=>{var v,b,w;return y(),I("div",{id:g.right?f(To)(g.right.id):void 0,key:m,class:he(["group table-row",{"bg-success/10":((v=g.right)==null?void 0:v.kind)==="add"}])},[q("span",WP,z(((b=g.right)==null?void 0:b.newLine)??""),1),q("span",GP,z(((w=g.right)==null?void 0:w.kind)==="add"?"+":""),1),q("span",KP,[g.right?(y(),P(Ki,{key:0,target:{type:"line",path:i.value,side:"head",line:g.right.newLine,expectedText:g.right.text},questions:f(Ou)(e.questions,i.value,"head",g.right.newLine),answers:e.answers},null,8,["target","questions","answers"])):F("",!0)]),q("span",YP,[g.right?(y(),I(pe,{key:0},[q("code",{innerHTML:f(Eo)(g.right.text),onClick:d[2]||(d[2]=(...x)=>f(ys)&&f(ys)(...x))},null,8,QP),W(Ru,{annotations:g.right.annotations,diagnostics:g.right.diagnostics,numbers:e.annotationNumbers},null,8,["annotations","diagnostics","numbers"])],64)):F("",!0)])],10,UP)}),128))]),u(h)?(y(),I("button",{key:0,type:"button",class:"w-full border-b border-default bg-elevated/50 px-3 py-1.5 text-left text-[10px] text-muted hover:text-default",onClick:g=>f(Oo)(e.file.path,h)}," ⋯ Show "+z(u(h))+" more rows ",9,XP)):F("",!0)],64))),128))],544)])]))}}),JP=32;function Dp(e){return new Promise((t,n)=>{const r=new Image;r.onload=()=>t(r),r.onerror=()=>n(new Error(`failed to load ${e}`)),r.src=e})}function Np(e){const t=document.createElement("canvas");t.width=e.naturalWidth,t.height=e.naturalHeight;const n=t.getContext("2d");return n.drawImage(e,0,0),n.getImageData(0,0,t.width,t.height)}function eI(e,t,n){const r=e.width,s=e.height;let o=0;for(let i=0;i<e.data.length;i+=4)if(Math.abs(e.data[i]-t.data[i])+Math.abs(e.data[i+1]-t.data[i+1])+Math.abs(e.data[i+2]-t.data[i+2])>JP)o++,n.data[i]=255,n.data[i+1]=0,n.data[i+2]=0,n.data[i+3]=255;else{const l=(t.data[i]+t.data[i+1]+t.data[i+2])/3;n.data[i]=l,n.data[i+1]=l,n.data[i+2]=l,n.data[i+3]=90}return{width:r,height:s,changedPercent:o/(r*s)*100}}function tI(e,t,n){if(e.naturalWidth!==t.naturalWidth||e.naturalHeight!==t.naturalHeight)return{error:`Dimensions differ: base ${e.naturalWidth}×${e.naturalHeight} vs head ${t.naturalWidth}×${t.naturalHeight} — cannot pixel-diff.`};const r=e.naturalWidth,s=e.naturalHeight,o=Np(e),i=Np(t);n.width=r,n.height=s;const a=n.getContext("2d"),l=a.createImageData(r,s),u=eI(o,i,l);return a.putImageData(l,0,0),u}const nI={class:"border-t border-default p-4"},rI={class:"mb-3 text-xs text-muted"},sI={key:0,class:"max-w-md"},oI=["src","alt"],iI={key:1},aI={class:"mb-3 flex gap-2"},lI={key:0,class:"flex gap-3"},uI={class:"max-w-md flex-1"},cI=["src","alt"],dI={class:"max-w-md flex-1"},fI=["src","alt"],pI={key:1,class:"max-w-2xl"},hI={class:"relative inline-block overflow-hidden rounded border border-default"},gI=["src","alt"],mI=["src","alt"],vI={key:2,class:"max-w-2xl"},yI={class:"relative inline-block overflow-hidden rounded border border-default"},bI=["src","alt"],xI=["src","alt"],wI={class:"mt-1 text-[10px] text-muted"},_I={key:3,class:"max-w-2xl"},kI={key:0,class:"text-xs text-muted"},CI={key:1,class:"text-xs text-warning"},SI={key:2,class:"mb-2 text-xs text-muted"},TI=["src"],AI=ee({__name:"ImageDiff",props:{assetPath:{},baseAssetPath:{},comparisonModes:{},description:{}},setup(e){const t=e,n=Q(t.comparisonModes[0]??"side-by-side"),r=Q(50),s=A(()=>Au(t.assetPath)),o=A(()=>t.baseAssetPath?Au(t.baseAssetPath):null),i=Hr("diffCanvas"),a=Q(null),l=Q(null),u=Q(!1);async function c(){if(o.value&&(await ut(),!!i.value)){u.value=!0,l.value=null,a.value=null;try{const[v,b]=await Promise.all([Dp(o.value),Dp(s.value)]),w=tI(v,b,i.value);"error"in w?l.value=w.error:a.value=w}catch(v){l.value=v instanceof Error?v.message:String(v)}finally{u.value=!1}}}De(n,v=>{v==="changed-pixel"&&c()}),ft(()=>{n.value==="changed-pixel"&&c()});const d={"side-by-side":"Side by side",swipe:"Swipe","onion-skin":"Onion skin","changed-pixel":"Changed pixels"},p=Q(null),h=Hr("lightboxDialog");function g(v){var b;p.value=v,(b=h.value)==null||b.showModal()}function m(){var v;(v=h.value)==null||v.close(),p.value=null}return(v,b)=>{const w=cn;return y(),I("div",nI,[q("p",rI,z(e.description),1),o.value?(y(),I("div",iI,[q("div",aI,[(y(!0),I(pe,null,$e(e.comparisonModes,x=>(y(),P(w,{key:x,size:"xs",variant:n.value===x?"solid":"outline",onClick:_=>n.value=x},{default:O(()=>[Ce(z(d[x]),1)]),_:2},1032,["variant","onClick"]))),128))]),n.value==="side-by-side"?(y(),I("div",lI,[q("div",uI,[b[10]||(b[10]=q("div",{class:"mb-1 text-[10px] font-bold text-muted"},"Base",-1)),q("img",{src:o.value,alt:`${e.assetPath} (base)`,class:"w-full cursor-zoom-in rounded border border-default",onClick:b[1]||(b[1]=x=>g(o.value))},null,8,cI)]),q("div",dI,[b[11]||(b[11]=q("div",{class:"mb-1 text-[10px] font-bold text-muted"},"Head",-1)),q("img",{src:s.value,alt:`${e.assetPath} (head)`,class:"w-full cursor-zoom-in rounded border border-default",onClick:b[2]||(b[2]=x=>g(s.value))},null,8,fI)])])):n.value==="swipe"?(y(),I("div",pI,[q("div",hI,[q("img",{src:o.value,alt:`${e.assetPath} (base)`,class:"block max-w-full cursor-zoom-in",onClick:b[3]||(b[3]=x=>g(o.value))},null,8,gI),q("div",{class:"absolute inset-0 overflow-hidden",style:kt({clipPath:`inset(0 ${100-r.value}% 0 0)`})},[q("img",{src:s.value,alt:`${e.assetPath} (head)`,class:"block max-w-full cursor-zoom-in",onClick:b[4]||(b[4]=x=>g(s.value))},null,8,mI)],4),q("div",{class:"pointer-events-none absolute inset-y-0 w-0.5 bg-primary",style:kt({left:`${r.value}%`})},null,4)]),mo(q("input",{"onUpdate:modelValue":b[5]||(b[5]=x=>r.value=x),type:"range",min:"0",max:"100",class:"mt-2 w-full"},null,512),[[jd,r.value,void 0,{number:!0}]]),b[12]||(b[12]=q("p",{class:"mt-1 text-[10px] text-muted"},"Left of the line: head. Right of the line: base.",-1))])):n.value==="onion-skin"?(y(),I("div",vI,[q("div",yI,[q("img",{src:o.value,alt:`${e.assetPath} (base)`,class:"block max-w-full cursor-zoom-in",onClick:b[6]||(b[6]=x=>g(o.value))},null,8,bI),q("img",{src:s.value,alt:`${e.assetPath} (head)`,class:"absolute inset-0 block max-w-full cursor-zoom-in",style:kt({opacity:r.value/100}),onClick:b[7]||(b[7]=x=>g(s.value))},null,12,xI)]),mo(q("input",{"onUpdate:modelValue":b[8]||(b[8]=x=>r.value=x),type:"range",min:"0",max:"100",class:"mt-2 w-full"},null,512),[[jd,r.value,void 0,{number:!0}]]),q("p",wI,z(r.value)+"% head opacity over base.",1)])):(y(),I("div",_I,[u.value?(y(),I("p",kI,"Computing pixel diff…")):l.value?(y(),I("p",CI,z(l.value),1)):a.value?(y(),I("p",SI,z(a.value.width)+"×"+z(a.value.height)+" — "+z(a.value.changedPercent.toFixed(2))+"% pixels changed (red = changed, threshold-based, not pixel-perfect) ",1)):F("",!0),q("canvas",{ref_key:"diffCanvas",ref:i,class:"max-w-full rounded border border-default"},null,512)]))])):(y(),I("div",sI,[q("img",{src:s.value,alt:e.assetPath,class:"cursor-zoom-in rounded border border-default",onClick:b[0]||(b[0]=x=>g(s.value))},null,8,oI)])),q("dialog",{ref_key:"lightboxDialog",ref:h,class:"max-h-none max-w-none overflow-visible border-0 bg-transparent p-0 backdrop:bg-black/80",onClick:m,onClose:b[9]||(b[9]=x=>p.value=null)},[p.value?(y(),I("img",{key:0,src:p.value,alt:"",class:"max-h-[92vh] max-w-[92vw] cursor-zoom-out object-contain"},null,8,TI)):F("",!0)],544)])}}}),EI={class:"border-t border-default p-4 text-sm"},OI={class:"flex flex-wrap items-center gap-2"},RI=["href"],PI={class:"mt-2 text-xs text-muted"},II={key:0,class:"mt-2 overflow-x-auto rounded bg-elevated p-2 font-mono text-xs whitespace-pre-wrap"},qI=ee({__name:"PipelineEvidence",props:{jobName:{},status:{},url:{},logExcerpt:{},description:{}},setup(e){const t={success:"success",failed:"error",running:"info",canceled:"neutral",skipped:"neutral"},n=Q(!1);return(r,s)=>{const o=Wn,i=cn;return y(),I("div",EI,[q("div",OI,[W(o,{size:"sm",variant:"subtle",color:t[e.status]},{default:O(()=>[Ce(z(e.status),1)]),_:1},8,["color"]),q("a",{href:e.url,target:"_blank",rel:"noopener",class:"font-mono text-xs text-primary hover:underline"},z(e.jobName),9,RI),e.logExcerpt?(y(),P(i,{key:0,size:"xs",variant:"ghost",class:"ml-auto",onClick:s[0]||(s[0]=a=>n.value=!n.value)},{default:O(()=>[Ce(z(n.value?"Hide log":"Show log"),1)]),_:1})):F("",!0)]),q("p",PI,z(e.description),1),n.value&&e.logExcerpt?(y(),I("pre",II,z(e.logExcerpt),1)):F("",!0)])}}}),$I=["id"],MI={class:"truncate font-mono text-sm"},DI={class:"ml-auto flex items-center gap-2"},NI={key:0,class:"px-4 py-2 text-xs text-muted"},LI={key:0,class:"flex flex-wrap items-center gap-3 border-b border-default bg-elevated/50 px-4 py-2 text-xs text-muted"},zI={key:1,class:"flex flex-wrap items-center gap-2 border-b border-default bg-elevated/50 px-4 py-2 text-xs text-muted"},BI=["title","onClick"],FI={class:"group flex flex-wrap items-center gap-3 border-b border-default bg-elevated/50 px-4 py-2 text-xs text-muted"},jI={key:0,class:"p-4 text-sm text-muted"},HI=ee({__name:"DiffFile",props:{file:{},layout:{},annotationNumbers:{},questions:{},answers:{}},setup(e){const t=e,n=A(()=>_R(t.file)),r=A(()=>kR(t.file)),s=A(()=>Ov(t.file)),o=A(()=>HO(t.file.path)),i=A(()=>bR(t.file.path,CR(t.file)||o.value)),a=A(()=>SR(t.file)),l=A(()=>TR(t.file)),u=A(()=>PR(t.questions,t.file.path));return(c,d)=>{const p=Wn,h=qc,g=cn;return y(),I("article",{id:f(Ms)(e.file.path),class:he(["mb-6 overflow-hidden rounded-lg border",o.value?"border-success bg-success/5":"border-default"])},[q("header",{class:he(["sticky top-0 z-10 flex items-center gap-3 border-b border-default bg-elevated px-4 py-2",{"bg-success/10":o.value}])},[d[3]||(d[3]=q("span",{class:"text-dimmed"},"◇",-1)),q("strong",MI,z(e.file.path),1),q("span",DI,[e.file.binary?(y(),P(p,{key:0,color:"neutral",variant:"subtle",size:"sm"},{default:O(()=>[...d[2]||(d[2]=[Ce("binary",-1)])]),_:1})):(y(),I(pe,{key:1},[W(p,{color:"success",variant:"subtle",size:"sm"},{default:O(()=>[Ce("+"+z(n.value),1)]),_:1}),W(p,{color:"error",variant:"subtle",size:"sm"},{default:O(()=>[Ce("−"+z(r.value),1)]),_:1}),W(h,{"model-value":o.value,label:"Reviewed",size:"sm","onUpdate:modelValue":d[0]||(d[0]=m=>f(VO)(e.file.path))},null,8,["model-value"]),W(g,{icon:i.value?"i-lucide-chevron-right":"i-lucide-chevron-down",size:"xs",variant:"ghost",color:"neutral","aria-label":i.value?"Expand diff":"Collapse diff",onClick:d[1]||(d[1]=m=>f(xR)(e.file.path,i.value))},null,8,["icon","aria-label"])],64))])],2),i.value?(y(),I("div",NI," Diff collapsed ("+z(s.value)+" lines) — click Expand above to view. ",1)):(y(),I(pe,{key:1},[a.value.length?(y(),I("div",LI,[d[4]||(d[4]=q("span",null,"Notes on this file:",-1)),(y(!0),I(pe,null,$e(a.value,m=>(y(),P(Dv,{key:m.id,annotation:m,number:e.annotationNumbers.get(m.id)??0},null,8,["annotation","number"]))),128))])):F("",!0),l.value.length?(y(),I("div",zI,[d[5]||(d[5]=q("span",null,"Agent comments in this file:",-1)),(y(!0),I(pe,null,$e(l.value,m=>(y(),I("button",{key:m.annotation.id,type:"button",title:m.annotation.summary,class:"grid h-[18px] w-[18px] place-items-center rounded-full border border-warning/60 bg-warning/15 text-[10px] font-bold text-warning transition hover:scale-110 hover:bg-warning hover:text-inverted",onClick:v=>f(qv)(e.file.path,m.hunkIndex,m.lineId)},z(e.annotationNumbers.get(m.annotation.id)??0),9,BI))),128))])):F("",!0),q("div",FI,[d[6]||(d[6]=q("span",null,"Questions on this file:",-1)),W(Ki,{target:{type:"file",path:e.file.path},questions:u.value,answers:e.answers},null,8,["target","questions","answers"])]),(y(!0),I(pe,null,$e(e.file.pipelineEvidence,m=>(y(),P(qI,{key:m.id,"job-name":m.jobName,status:m.status,url:m.url,"log-excerpt":m.logExcerpt,description:m.description},null,8,["job-name","status","url","log-excerpt","description"]))),128)),e.file.binary?(y(),I(pe,{key:2},[e.file.imageEvidence.length===0?(y(),I("div",jI," Binary change — no image evidence attached to compare. ")):F("",!0),(y(!0),I(pe,null,$e(e.file.imageEvidence,m=>(y(),P(AI,{key:m.id,"asset-path":m.assetPath,"base-asset-path":m.baseAssetPath,"comparison-modes":m.comparisonModes,description:m.description},null,8,["asset-path","base-asset-path","comparison-modes","description"]))),128))],64)):e.layout==="inline"?(y(),P(RP,{key:3,file:e.file,"annotation-numbers":e.annotationNumbers,questions:e.questions,answers:e.answers},null,8,["file","annotation-numbers","questions","answers"])):(y(),P(ZP,{key:4,file:e.file,"annotation-numbers":e.annotationNumbers,questions:e.questions,answers:e.answers},null,8,["file","annotation-numbers","questions","answers"]))],64))],10,$I)}}}),VI={key:0,class:"flex flex-1 flex-col items-center justify-center gap-2 p-8 text-center"},UI={key:1,class:"flex flex-1 flex-col items-center justify-center gap-6 overflow-y-auto p-8"},WI={class:"w-full max-w-2xl"},GI={class:"mb-3 flex items-center justify-between text-xs text-dimmed"},KI={key:1,class:"rounded-lg border border-default bg-elevated p-4 text-sm text-muted"},YI={class:"mb-3"},QI={key:0,class:"border-t border-default pt-2"},XI={class:"flex items-center gap-3"},ZI=["disabled"],JI=["disabled"],eq=ee({__name:"FocusMode",props:{files:{},groups:{},currentId:{}},emits:["exit","update:currentId"],setup(e,{emit:t}){const n=e,r=t,s=A(()=>{const h=new Map;for(const g of n.files)for(const m of g.annotations)h.set(m.id,m);return h}),o=A(()=>{const h=Wc(n.groups);return Gc(Uc(n.files),h)}),i=A(()=>{const h=o.value.findIndex(g=>g.verification.id===n.currentId);return h===-1?0:h}),a=A(()=>o.value[i.value]),l=A(()=>{var h;return(h=a.value)!=null&&h.annotationId?s.value.get(a.value.annotationId):void 0});function u(h){const g=Math.min(Math.max(h,0),o.value.length-1),m=o.value[g];m&&r("update:currentId",m.verification.id)}function c(){u(i.value+1)}function d(){u(i.value-1)}function p(h){const g=h.target;g&&["INPUT","TEXTAREA"].includes(g.tagName)||g!=null&&g.isContentEditable||((h.key==="ArrowRight"||h.key==="ArrowDown"||h.key==="j")&&c(),(h.key==="ArrowLeft"||h.key==="ArrowUp"||h.key==="k")&&d(),h.key==="Escape"&&r("exit",null))}return ft(()=>window.addEventListener("keydown",p)),qo(()=>window.removeEventListener("keydown",p)),(h,g)=>{var m;return o.value.length?(y(),I("div",UI,[q("div",WI,[q("div",GI,[q("span",null,z(i.value+1)+" / "+z(o.value.length)+" — ordered by risk",1),q("button",{type:"button",class:"text-primary hover:underline",onClick:g[1]||(g[1]=v=>r("exit",null))},"Esc — exit focus mode")]),l.value?(y(),P(Av,{key:0,annotation:l.value,"default-expanded":!0,"jump-to-diff":v=>r("exit",v)},null,8,["annotation","jump-to-diff"])):(y(),I("div",KI,[q("p",YI,z((m=a.value)==null?void 0:m.verification.description),1),a.value?(y(),I("div",QI,[W(Vc,{target:{type:"file",path:a.value.path}},null,8,["target"])])):F("",!0)])),a.value?(y(),I("button",{key:2,type:"button",class:"mt-3 text-sm font-medium text-primary hover:underline",onClick:g[2]||(g[2]=v=>r("exit",a.value.path))}," → view diff for this item ")):F("",!0)]),q("div",XI,[q("button",{type:"button",class:"rounded-full border border-default px-4 py-1.5 text-sm hover:bg-elevated disabled:opacity-30",disabled:i.value===0,onClick:d}," ← prev ",8,ZI),q("button",{type:"button",class:"rounded-full border border-default px-4 py-1.5 text-sm hover:bg-elevated disabled:opacity-30",disabled:i.value===o.value.length-1,onClick:c}," next → ",8,JI)]),g[5]||(g[5]=q("p",{class:"text-[11px] text-dimmed"},"← → or j/k to step, Esc to exit",-1))])):(y(),I("div",VI,[g[3]||(g[3]=q("p",{class:"text-lg font-semibold text-highlighted"},"Nothing needs attention",-1)),g[4]||(g[4]=q("p",{class:"text-sm text-muted"},"Every Verification item in this bundle is already marked verified.",-1)),q("button",{type:"button",class:"mt-2 text-sm text-primary hover:underline",onClick:g[0]||(g[0]=v=>r("exit",null))},"Esc — exit focus mode")]))}}}),tq={slots:{overlay:"fixed inset-0 bg-elevated/75",content:"fixed bg-default divide-y divide-default sm:ring ring-default sm:shadow-lg flex flex-col focus:outline-none",header:"flex items-center gap-1.5 p-4 sm:px-6 min-h-(--ui-header-height)",wrapper:"",body:"flex-1 overflow-y-auto p-4 sm:p-6",footer:"flex items-center gap-1.5 p-4 sm:px-6",title:"text-highlighted font-semibold",description:"mt-1 text-muted text-sm",close:"absolute top-4 end-4"},variants:{side:{top:{content:""},right:{content:"max-w-md"},bottom:{content:""},left:{content:"max-w-md"}},inset:{true:{content:"rounded-lg"}},transition:{true:{overlay:"data-[state=open]:animate-[fade-in_200ms_ease-out] data-[state=closed]:animate-[fade-out_200ms_ease-in]"}}},compoundVariants:[{side:"top",inset:!0,class:{content:"max-h-[calc(100%-2rem)] inset-x-4 top-4"}},{side:"top",inset:!1,class:{content:"max-h-full inset-x-0 top-0"}},{side:"right",inset:!0,class:{content:"w-[calc(100%-2rem)] inset-y-4 right-4"}},{side:"right",inset:!1,class:{content:"w-full inset-y-0 right-0"}},{side:"bottom",inset:!0,class:{content:"max-h-[calc(100%-2rem)] inset-x-4 bottom-4"}},{side:"bottom",inset:!1,class:{content:"max-h-full inset-x-0 bottom-0"}},{side:"left",inset:!0,class:{content:"w-[calc(100%-2rem)] inset-y-4 left-4"}},{side:"left",inset:!1,class:{content:"w-full inset-y-0 left-0"}},{transition:!0,side:"top",class:{content:"data-[state=open]:animate-[slide-in-from-top_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-top_200ms_ease-in-out]"}},{transition:!0,side:"right",class:{content:"data-[state=open]:animate-[slide-in-from-right_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-right_200ms_ease-in-out]"}},{transition:!0,side:"bottom",class:{content:"data-[state=open]:animate-[slide-in-from-bottom_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-bottom_200ms_ease-in-out]"}},{transition:!0,side:"left",class:{content:"data-[state=open]:animate-[slide-in-from-left_200ms_ease-in-out] data-[state=closed]:animate-[slide-out-to-left_200ms_ease-in-out]"}}]},Gv={__name:"Slideover",props:{title:{type:String,required:!1},description:{type:String,required:!1},content:{type:Object,required:!1},overlay:{type:Boolean,required:!1,default:!0},transition:{type:Boolean,required:!1,default:!0},side:{type:null,required:!1,default:"right"},inset:{type:Boolean,required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},close:{type:[Boolean,Object],required:!1,default:!0},closeIcon:{type:null,required:!1},dismissible:{type:Boolean,required:!1,default:!0},class:{type:null,required:!1},ui:{type:Object,required:!1},open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1},modal:{type:Boolean,required:!1,default:!0},unmountOnHide:{type:Boolean,required:!1}},emits:["leave","after:leave","enter","after:enter","close:prevent","update:open"],setup(e,{emit:t}){const n=e,r=t,s=Vn(),o=Mt("slideover",n),{t:i}=ma(),a=pt(),l=fr(zn(o,"open","defaultOpen","modal","unmountOnHide"),r),u=Ea(Ct(()=>o.portal)),c=Ct(()=>o.content),d=A(()=>o.dismissible?{pointerDownOutside:Mv}:["interactOutside","escapeKeyDown"].reduce((g,m)=>(g[m]=v=>{v.preventDefault(),r("close:prevent")},g),{})),p=A(()=>{var h;return Dt({extend:tq,...((h=a.ui)==null?void 0:h.slideover)||{}})({transition:o.transition,side:o.side,inset:o.inset})});return(h,g)=>(y(),P(f(zk),st(lt(f(l))),{default:O(({open:m,close:v})=>[s.default?(y(),P(f(b1),{key:0,"as-child":"",class:he(f(o).class)},{default:O(()=>[V(h.$slots,"default",{open:m})]),_:2},1032,["class"])):F("",!0),W(f(m1),ce(f(u),{"force-mount":f(u).disabled&&f(o).unmountOnHide===!1||void 0}),{default:O(()=>[W(f(Pc),null,{default:O(()=>{var b,w;return[f(o).overlay?(y(),P(f(p1),{key:0,"data-slot":"overlay",class:he(p.value.overlay({class:(b=f(o).ui)==null?void 0:b.overlay}))},null,8,["class"])):F("",!0),W(f(l1),ce({"data-side":f(o).side,"data-slot":"content",class:p.value.content({class:[!s.default&&f(o).class,(w=f(o).ui)==null?void 0:w.content]})},c.value,{onEnter:g[0]||(g[0]=x=>r("enter")),onAfterEnter:g[1]||(g[1]=x=>r("after:enter")),onLeave:g[2]||(g[2]=x=>r("leave")),onAfterLeave:g[3]||(g[3]=x=>r("after:leave"))},Uu(d.value)),{default:O(()=>[!f(o).title&&!s.title||!f(o).description&&!s.description||s.content?(y(),P(f(Lo),{key:0},{default:O(()=>[!f(o).title&&!s.title?(y(),P(f(xl),{key:0})):s.content?(y(),P(f(xl),{key:1},{default:O(()=>[V(h.$slots,"title",{},()=>[Ce(z(f(o).title),1)])]),_:3})):F("",!0),!f(o).description&&!s.description?(y(),P(f(bl),{key:2})):s.content?(y(),P(f(bl),{key:3},{default:O(()=>[V(h.$slots,"description",{},()=>[Ce(z(f(o).description),1)])]),_:3})):F("",!0)]),_:3})):F("",!0),V(h.$slots,"content",{close:v},()=>{var x,_,R;return[s.header||f(o).title||s.title||f(o).description||s.description||f(o).close||s.close?(y(),I("div",{key:0,"data-slot":"header",class:he(p.value.header({class:(x=f(o).ui)==null?void 0:x.header}))},[V(h.$slots,"header",{close:v},()=>{var T,E,$;return[f(o).title||s.title||f(o).description||s.description?(y(),I("div",{key:0,"data-slot":"wrapper",class:he(p.value.wrapper({class:(T=f(o).ui)==null?void 0:T.wrapper}))},[f(o).title||s.title?(y(),P(f(xl),{key:0,"data-slot":"title",class:he(p.value.title({class:(E=f(o).ui)==null?void 0:E.title}))},{default:O(()=>[V(h.$slots,"title",{},()=>[Ce(z(f(o).title),1)])]),_:3},8,["class"])):F("",!0),f(o).description||s.description?(y(),P(f(bl),{key:1,"data-slot":"description",class:he(p.value.description({class:($=f(o).ui)==null?void 0:$.description}))},{default:O(()=>[V(h.$slots,"description",{},()=>[Ce(z(f(o).description),1)])]),_:3},8,["class"])):F("",!0)],2)):F("",!0),V(h.$slots,"actions"),f(o).close||s.close?(y(),P(f(Fk),{key:1,"as-child":""},{default:O(()=>[V(h.$slots,"close",{ui:p.value},()=>{var N;return[f(o).close?(y(),P(cn,ce({key:0,icon:f(o).closeIcon||f(a).ui.icons.close,color:"neutral",variant:"ghost","aria-label":f(i)("slideover.close")},typeof f(o).close=="object"?f(o).close:{},{"data-slot":"close",class:p.value.close({class:(N=f(o).ui)==null?void 0:N.close})}),null,16,["icon","aria-label","class"])):F("",!0)]})]),_:2},1024)):F("",!0)]})],2)):F("",!0),q("div",{"data-slot":"body",class:he(p.value.body({class:(_=f(o).ui)==null?void 0:_.body}))},[V(h.$slots,"body",{close:v})],2),s.footer?(y(),I("div",{key:1,"data-slot":"footer",class:he(p.value.footer({class:(R=f(o).ui)==null?void 0:R.footer}))},[V(h.$slots,"footer",{close:v})],2)):F("",!0)]})]),_:2},1040,["data-side","class"])]}),_:2},1024)]),_:2},1040,["force-mount"])]),_:3},16))}},nq={class:"space-y-4 text-sm"},rq={key:0,class:"text-muted"},sq=["href"],oq={class:"grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-muted"},iq={class:"text-default"},aq={class:"text-default font-mono"},lq={class:"text-default"},uq=["innerHTML"],cq=ee({__name:"MrDetailsSlideover",props:Ri({comparison:{},descriptionHtml:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:["update:open"],setup(e){const t=Wu(e,"open");return(n,r)=>{const s=Gv;return y(),P(s,{open:t.value,"onUpdate:open":r[0]||(r[0]=o=>t.value=o),title:e.comparison.title||"MR details",side:"right"},{body:O(()=>[q("div",nq,[e.comparison.number?(y(),I("div",rq,"!"+z(e.comparison.number),1)):F("",!0),e.comparison.url?(y(),I("a",{key:1,href:e.comparison.url,target:"_blank",rel:"noopener",class:"block truncate text-primary hover:underline"},z(e.comparison.url),9,sq)):F("",!0),q("dl",oq,[e.comparison.author?(y(),I(pe,{key:0},[r[1]||(r[1]=q("dt",null,"Author",-1)),q("dd",iq,z(e.comparison.author),1)],64)):F("",!0),e.comparison.sourceBranch||e.comparison.targetBranch?(y(),I(pe,{key:1},[r[2]||(r[2]=q("dt",null,"Branch",-1)),q("dd",aq,z(e.comparison.sourceBranch??"?")+" → "+z(e.comparison.targetBranch??"?"),1)],64)):F("",!0),e.comparison.repository?(y(),I(pe,{key:2},[r[3]||(r[3]=q("dt",null,"Repository",-1)),q("dd",lq,z(e.comparison.repository),1)],64)):F("",!0)]),e.descriptionHtml?(y(),I("div",{key:2,class:"markdown-body border-t border-default pt-4",innerHTML:e.descriptionHtml},null,8,uq)):F("",!0)])]),_:1},8,["open","title"])}}}),dq={key:0,class:"text-sm text-muted"},fq={class:"space-y-3"},pq={class:"mb-1 flex items-center gap-2"},hq={key:2,class:"truncate font-mono text-xs text-muted"},gq=["disabled","onClick"],mq={key:0,class:"mt-2 border-t border-default pt-2 text-muted"},vq={class:"leading-relaxed whitespace-pre-wrap"},yq={key:1,class:"truncate text-muted italic"},bq=ee({__name:"QuestionsSlideover",props:Ri({entries:{},currentRound:{}},{open:{type:Boolean,required:!0},openModifiers:{}}),emits:Ri(["select"],["update:open"]),setup(e,{emit:t}){const n=Wu(e,"open"),r=t,{isCollapsed:s,toggleExpanded:o}=Bv();function i(a){return s(a.question)}return(a,l)=>{const u=Wn,c=cn,d=Gv;return y(),P(d,{open:n.value,"onUpdate:open":l[0]||(l[0]=p=>n.value=p),title:"Questions",side:"right"},{body:O(()=>[e.entries.length?F("",!0):(y(),I("p",dq,"No comments raised on this bundle yet.")),q("ul",fq,[(y(!0),I(pe,null,$e(e.entries,p=>(y(),I("li",{key:p.question.id,class:"rounded-lg border border-default p-3 text-sm"},[q("div",pq,[W(u,{size:"sm",variant:"subtle",color:f(Fv)(p.question)},{default:O(()=>[Ce(z(f(jv)(p.question)),1)]),_:2},1032,["color"]),W(u,{size:"sm",variant:"subtle",color:f(Hv)(p.question,!!p.answer)},{default:O(()=>[Ce(z(f(Vv)(p.question,!!p.answer)),1)]),_:2},1032,["color"]),p.question.resolution?(y(),P(u,{key:0,size:"sm",variant:"subtle",color:f(Uv)(p.question.resolution.status),title:p.question.resolution.evidence},{default:O(()=>[Ce(z(f(Wv)(p.question.resolution.status)),1)]),_:2},1032,["color","title"])):F("",!0),p.question.originRound!==e.currentRound?(y(),P(u,{key:1,size:"sm",variant:"outline",color:"neutral"},{default:O(()=>[Ce(" Round "+z(p.question.originRound),1)]),_:2},1024)):F("",!0),p.filePath?(y(),I("span",hq,z(p.filePath),1)):F("",!0),p.question.resolved?(y(),P(c,{key:3,size:"xs",variant:"ghost",class:"ml-auto",onClick:h=>f(o)(p.question.id)},{default:O(()=>[Ce(z(i(p)?"Show":"Hide"),1)]),_:2},1032,["onClick"])):F("",!0)]),i(p)?(y(),I("p",yq,z(p.question.body),1)):(y(),I("button",{key:0,type:"button",class:"block w-full text-left",disabled:!p.filePath,onClick:h=>r("select",p)},[q("p",{class:he(["leading-relaxed",{"text-muted line-through":p.question.status==="withdrawn"}])},z(p.question.body),3),p.answer?(y(),I("div",mq,[l[1]||(l[1]=q("p",{class:"mb-0.5 text-[10px] font-bold"},"Answer",-1)),q("p",vq,z(p.answer.body),1)])):F("",!0)],8,gq))]))),128))])]),_:1},8,["open"])}}});function xq(){var n;const t=(n=pt().ui)==null?void 0:n.prefix;return r=>!t||!r?r:r.split(/\s+/).filter(Boolean).map(s=>`${t}:${s}`).join(" ")}const wq=Object.assign({inheritAttrs:!1},{__name:"ColorModeButton",props:{color:{type:null,required:!1,default:"neutral"},variant:{type:null,required:!1,default:"ghost"},label:{type:String,required:!1},activeColor:{type:null,required:!1},activeVariant:{type:null,required:!1},size:{type:null,required:!1},square:{type:Boolean,required:!1},block:{type:Boolean,required:!1},loadingAuto:{type:Boolean,required:!1},onClick:{type:[Function,Array],required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1},as:{type:null,required:!1},type:{type:null,required:!1},disabled:{type:Boolean,required:!1},exactActiveClass:{type:String,required:!1},viewTransition:{type:Boolean,required:!1}},setup(e){const n=Mt("button",e),{t:r}=ma(),s=rk(),o=pt(),i=xq(),a=fr(sc(n,"icon")),l=A({get(){return s.value==="dark"},set(u){s.preference=u?"dark":"light"}});return(u,c)=>(y(),P(cn,ce({...f(a),"aria-label":l.value?f(r)("colorMode.switchToLight"):f(r)("colorMode.switchToDark"),...u.$attrs},{onClick:c[0]||(c[0]=d=>l.value=!l.value)}),{leading:O(({ui:d})=>{var p,h;return[W(en,{class:he(d.leadingIcon({class:[(p=f(n).ui)==null?void 0:p.leadingIcon,f(i)("hidden dark:inline-block")]})),name:f(o).ui.icons.dark},null,8,["class","name"]),W(en,{class:he(d.leadingIcon({class:[(h=f(n).ui)==null?void 0:h.leadingIcon,f(i)("dark:hidden")]})),name:f(o).ui.icons.light},null,8,["class","name"])]}),_:1},16))}}),_q={slots:{root:"relative inline-flex items-center",base:["w-full rounded-md border-0 appearance-none placeholder:text-dimmed disabled:cursor-not-allowed disabled:opacity-75","transition-colors"],leading:"absolute inset-y-0 start-0 flex items-center",leadingIcon:"shrink-0 text-dimmed",leadingAvatar:"shrink-0",leadingAvatarSize:"",trailing:"absolute inset-y-0 end-0 flex items-center",trailingIcon:"shrink-0 text-dimmed"},variants:{fieldGroup:{horizontal:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-e-none group-not-only:group-last:rounded-s-none group-not-last:group-not-first:rounded-none"},vertical:{root:"group has-focus-visible:z-[1]",base:"group-not-only:group-first:rounded-b-none group-not-only:group-last:rounded-t-none group-not-last:group-not-first:rounded-none"}},size:{xs:{base:"px-2 py-1 text-sm/4 gap-1",leading:"ps-2",trailing:"pe-2",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},sm:{base:"px-2.5 py-1.5 text-sm/4 gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-4",leadingAvatarSize:"3xs",trailingIcon:"size-4"},md:{base:"px-2.5 py-1.5 text-base/5 gap-1.5",leading:"ps-2.5",trailing:"pe-2.5",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},lg:{base:"px-3 py-2 text-base/5 gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-5",leadingAvatarSize:"2xs",trailingIcon:"size-5"},xl:{base:"px-3 py-2 text-base gap-2",leading:"ps-3",trailing:"pe-3",leadingIcon:"size-6",leadingAvatarSize:"xs",trailingIcon:"size-6"}},variant:{outline:"text-highlighted bg-default ring ring-inset ring-accented",soft:"text-highlighted bg-elevated/50 hover:bg-elevated focus:bg-elevated disabled:bg-elevated/50",subtle:"text-highlighted bg-elevated ring ring-inset ring-accented",ghost:"text-highlighted bg-transparent hover:bg-elevated focus:bg-elevated disabled:bg-transparent dark:disabled:bg-transparent",none:"text-highlighted bg-transparent focus:outline-none"},color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},leading:{true:""},trailing:{true:""},loading:{true:""},highlight:{true:""},fixed:{false:""},type:{file:"file:me-1.5 file:font-medium file:text-muted file:outline-none"}},compoundVariants:[{color:"primary",variant:["outline","subtle"],class:"outline-primary/25 focus-visible:outline-3 focus-visible:ring-primary"},{color:"secondary",variant:["outline","subtle"],class:"outline-secondary/25 focus-visible:outline-3 focus-visible:ring-secondary"},{color:"success",variant:["outline","subtle"],class:"outline-success/25 focus-visible:outline-3 focus-visible:ring-success"},{color:"info",variant:["outline","subtle"],class:"outline-info/25 focus-visible:outline-3 focus-visible:ring-info"},{color:"warning",variant:["outline","subtle"],class:"outline-warning/25 focus-visible:outline-3 focus-visible:ring-warning"},{color:"error",variant:["outline","subtle"],class:"outline-error/25 focus-visible:outline-3 focus-visible:ring-error"},{color:"primary",variant:["soft","ghost"],class:"outline-primary/25 focus-visible:outline-3"},{color:"secondary",variant:["soft","ghost"],class:"outline-secondary/25 focus-visible:outline-3"},{color:"success",variant:["soft","ghost"],class:"outline-success/25 focus-visible:outline-3"},{color:"info",variant:["soft","ghost"],class:"outline-info/25 focus-visible:outline-3"},{color:"warning",variant:["soft","ghost"],class:"outline-warning/25 focus-visible:outline-3"},{color:"error",variant:["soft","ghost"],class:"outline-error/25 focus-visible:outline-3"},{color:"primary",highlight:!0,class:"ring ring-inset ring-primary"},{color:"secondary",highlight:!0,class:"ring ring-inset ring-secondary"},{color:"success",highlight:!0,class:"ring ring-inset ring-success"},{color:"info",highlight:!0,class:"ring ring-inset ring-info"},{color:"warning",highlight:!0,class:"ring ring-inset ring-warning"},{color:"error",highlight:!0,class:"ring ring-inset ring-error"},{color:"neutral",variant:["outline","subtle"],class:"outline-inverted/25 focus-visible:outline-3 focus-visible:ring-inverted"},{color:"neutral",variant:["soft","ghost"],class:"outline-inverted/25 focus-visible:outline-3"},{color:"neutral",highlight:!0,class:"ring ring-inset ring-inverted"},{leading:!0,size:"xs",class:"ps-7"},{leading:!0,size:"sm",class:"ps-8"},{leading:!0,size:"md",class:"ps-9"},{leading:!0,size:"lg",class:"ps-10"},{leading:!0,size:"xl",class:"ps-11"},{trailing:!0,size:"xs",class:"pe-7"},{trailing:!0,size:"sm",class:"pe-8"},{trailing:!0,size:"md",class:"pe-9"},{trailing:!0,size:"lg",class:"pe-10"},{trailing:!0,size:"xl",class:"pe-11"},{loading:!0,leading:!0,class:{leadingIcon:"animate-spin"}},{loading:!0,leading:!1,trailing:!0,class:{trailingIcon:"animate-spin"}},{fixed:!1,size:"xs",class:"md:text-xs"},{fixed:!1,size:"sm",class:"md:text-xs"},{fixed:!1,size:"md",class:"md:text-sm"},{fixed:!1,size:"lg",class:"md:text-sm"}],defaultVariants:{size:"md",color:"primary",variant:"outline"}},kq=["id","type","value","name","placeholder","disabled","required","autocomplete"],Cq=Object.assign({inheritAttrs:!1},{__name:"Input",props:{as:{type:null,required:!1},id:{type:String,required:!1},name:{type:String,required:!1},type:{type:null,required:!1,default:"text"},placeholder:{type:String,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},required:{type:Boolean,required:!1},autocomplete:{type:[String,Object],required:!1,default:"off"},autofocus:{type:Boolean,required:!1},autofocusDelay:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},highlight:{type:Boolean,required:!1},fixed:{type:Boolean,required:!1},modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},modelModifiers:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},icon:{type:null,required:!1},avatar:{type:Object,required:!1},leading:{type:Boolean,required:!1},leadingIcon:{type:null,required:!1},trailing:{type:Boolean,required:!1},trailingIcon:{type:null,required:!1},loading:{type:Boolean,required:!1},loadingIcon:{type:null,required:!1}},emits:["update:modelValue","blur","change"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=Vn(),i=Mt("input",r),a=Fn(i,"modelValue",s,{defaultValue:i.defaultValue}),l=pt(),{emitFormBlur:u,emitFormInput:c,emitFormChange:d,size:p,color:h,id:g,name:m,highlight:v,disabled:b,emitFormFocus:w,ariaAttrs:x}=Ic(r,{deferInputValidation:!0}),{orientation:_,size:R}=Rc(r),{isLeading:T,isTrailing:E,leadingIconName:$,trailingIconName:N}=Ra(i),D=A(()=>R.value||p.value),Y=A(()=>{var X;return Dt({extend:_q,...((X=l.ui)==null?void 0:X.input)||{}})({type:i.type,color:h.value??i.color,variant:i.variant,size:(D==null?void 0:D.value)??i.size,loading:i.loading,highlight:v.value??i.highlight,fixed:i.fixed,leading:T.value||!!i.avatar||!!o.leading,trailing:E.value||!!o.trailing,fieldGroup:_.value})}),te=Hr("inputRef");function re(X){var _e,le,Se,Ne,tt;(_e=i.modelModifiers)!=null&&_e.trim&&(typeof X=="string"||X===null||X===void 0)&&(X=(X==null?void 0:X.trim())??null),((le=i.modelModifiers)!=null&&le.number||i.type==="number")&&(X=Zg(X)),(Se=i.modelModifiers)!=null&&Se.nullable&&(X||(X=null)),(Ne=i.modelModifiers)!=null&&Ne.optional&&!((tt=i.modelModifiers)!=null&&tt.nullable)&&X!==null&&(X||(X=void 0)),a.value=X,c()}function j(X){var _e;(_e=i.modelModifiers)!=null&&_e.lazy||re(X.target.value)}function de(X){var le,Se;const _e=X.target.value;(le=i.modelModifiers)!=null&&le.lazy&&re(_e),(Se=i.modelModifiers)!=null&&Se.trim&&(X.target.value=_e.trim()),d(),s("change",X)}function G(X){u(),s("blur",X)}function ue(){var X;i.autofocus&&((X=te.value)==null||X.focus())}return ft(()=>{setTimeout(()=>{ue()},i.autofocusDelay)}),t({inputRef:te}),(X,_e)=>{var le;return y(),P(f(Ie),{as:f(i).as,"data-slot":X.$attrs["data-slot"]??"root",class:he(Y.value.root({class:[(le=f(i).ui)==null?void 0:le.root,f(i).class]}))},{default:O(()=>{var Se,Ne,tt;return[q("input",ce({id:f(g),ref_key:"inputRef",ref:te,type:f(i).type,value:f(a),name:f(m),placeholder:f(i).placeholder,class:Y.value.base({class:(Se=f(i).ui)==null?void 0:Se.base}),disabled:f(b),required:f(i).required,autocomplete:f(i).autocomplete},{...X.$attrs,...f(x)},{"data-slot":"base",onInput:j,onBlur:G,onChange:de,onFocus:_e[0]||(_e[0]=(...it)=>f(w)&&f(w)(...it))}),null,16,kq),V(X.$slots,"default",{ui:Y.value}),f(T)||f(i).avatar||o.leading?(y(),I("span",{key:0,"data-slot":"leading",class:he(Y.value.leading({class:(Ne=f(i).ui)==null?void 0:Ne.leading}))},[V(X.$slots,"leading",{ui:Y.value},()=>{var it,Qe,Be;return[f(T)&&f($)?(y(),P(en,{key:0,name:f($),"data-slot":"leadingIcon",class:he(Y.value.leadingIcon({class:(it=f(i).ui)==null?void 0:it.leadingIcon}))},null,8,["name","class"])):f(i).avatar?(y(),P(Bo,ce({key:1,size:((Qe=f(i).ui)==null?void 0:Qe.leadingAvatarSize)||Y.value.leadingAvatarSize()},f(i).avatar,{"data-slot":"leadingAvatar",class:Y.value.leadingAvatar({class:(Be=f(i).ui)==null?void 0:Be.leadingAvatar})}),null,16,["size","class"])):F("",!0)]})],2)):F("",!0),f(E)||o.trailing?(y(),I("span",{key:1,"data-slot":"trailing",class:he(Y.value.trailing({class:(tt=f(i).ui)==null?void 0:tt.trailing}))},[V(X.$slots,"trailing",{ui:Y.value},()=>{var it;return[f(N)?(y(),P(en,{key:0,name:f(N),"data-slot":"trailingIcon",class:he(Y.value.trailingIcon({class:(it=f(i).ui)==null?void 0:it.trailingIcon}))},null,8,["name","class"])):F("",!0)]})],2)):F("",!0)]}),_:3},8,["as","data-slot","class"])}}}),Sq={base:"inline-flex items-center justify-center px-1 rounded-sm font-medium font-sans uppercase",variants:{color:{primary:"",secondary:"",success:"",info:"",warning:"",error:"",neutral:""},variant:{solid:"",outline:"",soft:"",subtle:""},size:{sm:"h-4 min-w-[16px] text-[10px]",md:"h-5 min-w-[20px] text-[11px]",lg:"h-6 min-w-[24px] text-[12px]"}},compoundVariants:[{color:"primary",variant:"solid",class:"text-inverted bg-primary"},{color:"secondary",variant:"solid",class:"text-inverted bg-secondary"},{color:"success",variant:"solid",class:"text-inverted bg-success"},{color:"info",variant:"solid",class:"text-inverted bg-info"},{color:"warning",variant:"solid",class:"text-inverted bg-warning"},{color:"error",variant:"solid",class:"text-inverted bg-error"},{color:"primary",variant:"outline",class:"ring ring-inset ring-primary/50 text-primary"},{color:"secondary",variant:"outline",class:"ring ring-inset ring-secondary/50 text-secondary"},{color:"success",variant:"outline",class:"ring ring-inset ring-success/50 text-success"},{color:"info",variant:"outline",class:"ring ring-inset ring-info/50 text-info"},{color:"warning",variant:"outline",class:"ring ring-inset ring-warning/50 text-warning"},{color:"error",variant:"outline",class:"ring ring-inset ring-error/50 text-error"},{color:"primary",variant:"soft",class:"text-primary bg-primary/10"},{color:"secondary",variant:"soft",class:"text-secondary bg-secondary/10"},{color:"success",variant:"soft",class:"text-success bg-success/10"},{color:"info",variant:"soft",class:"text-info bg-info/10"},{color:"warning",variant:"soft",class:"text-warning bg-warning/10"},{color:"error",variant:"soft",class:"text-error bg-error/10"},{color:"primary",variant:"subtle",class:"text-primary ring ring-inset ring-primary/25 bg-primary/10"},{color:"secondary",variant:"subtle",class:"text-secondary ring ring-inset ring-secondary/25 bg-secondary/10"},{color:"success",variant:"subtle",class:"text-success ring ring-inset ring-success/25 bg-success/10"},{color:"info",variant:"subtle",class:"text-info ring ring-inset ring-info/25 bg-info/10"},{color:"warning",variant:"subtle",class:"text-warning ring ring-inset ring-warning/25 bg-warning/10"},{color:"error",variant:"subtle",class:"text-error ring ring-inset ring-error/25 bg-error/10"},{color:"neutral",variant:"solid",class:"text-inverted bg-inverted"},{color:"neutral",variant:"outline",class:"ring ring-inset ring-accented text-default bg-default"},{color:"neutral",variant:"soft",class:"text-default bg-elevated"},{color:"neutral",variant:"subtle",class:"ring ring-inset ring-accented text-default bg-elevated"}],defaultVariants:{variant:"outline",color:"neutral",size:"md"}},Tq={__name:"Kbd",props:{as:{type:null,required:!1,default:"kbd"},value:{type:null,required:!1},color:{type:null,required:!1},variant:{type:null,required:!1},size:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1}},setup(e){const n=Mt("kbd",e),{getKbdKey:r}=V_(),s=pt(),o=A(()=>{var i;return Dt({extend:Sq,...((i=s.ui)==null?void 0:i.kbd)||{}})});return(i,a)=>{var l;return y(),P(f(Ie),{as:f(n).as,class:he(o.value({class:[(l=f(n).ui)==null?void 0:l.base,f(n).class],color:f(n).color,variant:f(n).variant,size:f(n).size}))},{default:O(()=>[V(i.$slots,"default",{},()=>[Ce(z(f(r)(f(n).value)),1)])]),_:3},8,["as","class"])}}},Aq={slots:{content:"flex items-center gap-1 bg-default text-highlighted shadow-sm rounded-sm ring ring-default h-6 px-2.5 py-1 text-xs select-none data-[state=delayed-open]:animate-[scale-in_100ms_ease-out] data-[state=closed]:animate-[scale-out_100ms_ease-in] origin-(--reka-tooltip-content-transform-origin) pointer-events-auto",arrow:"fill-bg stroke-default",text:"truncate",kbds:"hidden lg:inline-flex items-center shrink-0 gap-0.5 not-first-of-type:before:content-['·'] not-first-of-type:before:me-0.5",kbdsSize:"sm"}},Eq={__name:"Tooltip",props:{text:{type:String,required:!1},kbds:{type:Array,required:!1},content:{type:Object,required:!1},arrow:{type:[Boolean,Object],required:!1},portal:{type:[Boolean,String],required:!1,skipCheck:!0,default:!0},reference:{type:null,required:!1},class:{type:null,required:!1},ui:{type:Object,required:!1},defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1},delayDuration:{type:Number,required:!1},disableHoverableContent:{type:Boolean,required:!1},disableClosingTrigger:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},ignoreNonKeyboardFocus:{type:Boolean,required:!1}},emits:["update:open"],setup(e,{emit:t}){const n=e,r=t,s=Vn(),o=Mt("tooltip",n),i=pt(),a=zo(),l=fr(zn(o,"defaultOpen","open","delayDuration","disableHoverableContent","disableClosingTrigger","ignoreNonKeyboardFocus"),r),u=Ea(Ct(()=>o.portal)),c=Ct(()=>wn(o.content,a.content.value,{side:"bottom",sideOffset:8,collisionPadding:8})),d=Ct(()=>wn(o.arrow,{rounded:!0})),p=A(()=>{var h;return Dt({extend:Aq,...((h=i.ui)==null?void 0:h.tooltip)||{}})({side:c.value.side})});return(h,g)=>{var m;return y(),P(f(_T),ce(f(l),{disabled:!(f(o).text||(m=f(o).kbds)!=null&&m.length||s.content)||f(o).disabled}),{default:O(({open:v})=>[s.default||f(o).reference?(y(),P(f(PT),ce({key:0},h.$attrs,{"as-child":"",reference:f(o).reference,class:f(o).class}),{default:O(()=>[V(h.$slots,"default",{open:v})]),_:2},1040,["reference","class"])):F("",!0),W(f(OT),st(lt(f(u))),{default:O(()=>[W(f(Pc),null,{default:O(()=>{var b;return[W(f(AT),ce(c.value,{"data-slot":"content",class:p.value.content({class:[!s.default&&f(o).class,(b=f(o).ui)==null?void 0:b.content]})}),{default:O(()=>{var w;return[V(h.$slots,"content",{ui:p.value},()=>{var x,_,R;return[f(o).text?(y(),I("span",{key:0,"data-slot":"text",class:he(p.value.text({class:(x=f(o).ui)==null?void 0:x.text}))},z(f(o).text),3)):F("",!0),(_=f(o).kbds)!=null&&_.length?(y(),I("span",{key:1,"data-slot":"kbds",class:he(p.value.kbds({class:(R=f(o).ui)==null?void 0:R.kbds}))},[(y(!0),I(pe,null,$e(f(o).kbds,(T,E)=>{var $;return y(),P(Tq,ce({key:E,size:(($=f(o).ui)==null?void 0:$.kbdsSize)||p.value.kbdsSize()},{ref_for:!0},typeof T=="string"?{value:T}:T),null,16,["size"])}),128))],2)):F("",!0)]}),f(o).arrow?(y(),P(f(mT),ce({key:0},d.value,{"data-slot":"arrow",class:p.value.arrow({class:(w=f(o).ui)==null?void 0:w.arrow})}),null,16,["class"])):F("",!0)]}),_:3},16,["class"])]}),_:3})]),_:3},16)]),_:3},16,["disabled"])}}},Oq={class:"flex items-center gap-3 border-b border-default px-4 py-3"},Rq={key:0,class:"min-w-0"},Pq={class:"flex items-center gap-2"},Iq={class:"truncate text-sm font-semibold"},qq={key:0,class:"mt-0.5 flex items-center gap-2 text-xs text-muted"},$q=["href"],Mq={key:1,class:"shrink-0 font-mono"},Dq={key:1,class:"truncate text-sm font-semibold"},Nq={class:"ml-auto flex items-center gap-3"},Lq={class:"w-80 p-3"},zq=ee({__name:"ReviewHeader",props:{headerTitle:{},comparison:{},hasMrMetadata:{type:Boolean},navVisible:{type:Boolean},layout:{},openQuestionCount:{},promptCopied:{type:Boolean},hasWriteToken:{type:Boolean},writeTokenDraft:{},focusMode:{type:Boolean},focusModeCount:{}},emits:["update:navVisible","update:layout","update:writeTokenDraft","update:focusMode","openQuestions","openMrDetails","copyPrompt","saveWriteToken"],setup(e,{emit:t}){const n=t;return(r,s)=>{const o=cn,i=Eq,a=sv,l=Hc,u=Cq,c=Da,d=wq;return y(),I("header",Oq,[W(i,{text:e.navVisible?"Hide file list":"Show file list"},{default:O(()=>[W(o,{size:"sm",color:"neutral",variant:e.navVisible?"subtle":"ghost",icon:"i-lucide-panel-left","aria-pressed":e.navVisible,onClick:s[0]||(s[0]=p=>n("update:navVisible",!e.navVisible))},null,8,["variant","aria-pressed"])]),_:1},8,["text"]),e.comparison?(y(),I("div",Rq,[q("div",Pq,[q("h1",Iq,z(e.headerTitle),1),e.hasMrMetadata?(y(),P(o,{key:0,size:"xs",variant:"soft",color:"primary",icon:"i-lucide-file-text",onClick:s[1]||(s[1]=p=>n("openMrDetails"))},{default:O(()=>[...s[8]||(s[8]=[Ce(" Details ",-1)])]),_:1})):F("",!0)]),e.hasMrMetadata?(y(),I("div",qq,[e.comparison.url?(y(),I("a",{key:0,href:e.comparison.url,target:"_blank",rel:"noopener",class:"truncate text-primary hover:underline"},z(e.comparison.url),9,$q)):F("",!0),e.comparison.sourceBranch?(y(),I("span",Mq,z(e.comparison.sourceBranch)+" → "+z(e.comparison.targetBranch??"main"),1)):F("",!0)])):F("",!0)])):(y(),I("h1",Dq,z(e.headerTitle),1)),q("div",Nq,[e.comparison?(y(),P(i,{key:0,text:"All questions"},{default:O(()=>[W(a,{text:e.openQuestionCount,show:e.openQuestionCount>0,color:"warning",size:"sm"},{default:O(()=>[W(o,{size:"sm",variant:"ghost",color:"neutral",icon:"i-lucide-message-circle-question",onClick:s[2]||(s[2]=p=>n("openQuestions"))})]),_:1},8,["text","show"])]),_:1})):F("",!0),s[12]||(s[12]=q("div",{class:"h-5 w-px bg-default"},null,-1)),W(i,{text:e.focusMode?"Exit focus mode":`Focus mode — step through ${e.focusModeCount} item(s) needing attention`},{default:O(()=>[W(o,{size:"sm",variant:e.focusMode?"solid":"ghost",color:e.focusMode?"primary":"neutral",icon:"i-lucide-crosshair",onClick:s[3]||(s[3]=p=>n("update:focusMode",!e.focusMode))},{default:O(()=>[...s[9]||(s[9]=[Ce(" Focus ",-1)])]),_:1},8,["variant","color"])]),_:1},8,["text"]),s[13]||(s[13]=q("div",{class:"h-5 w-px bg-default"},null,-1)),W(l,{size:"sm"},{default:O(()=>[W(i,{text:"Inline diff"},{default:O(()=>[W(o,{icon:"i-lucide-align-justify",variant:e.layout==="inline"?"solid":"outline",color:"neutral",onClick:s[4]||(s[4]=p=>n("update:layout","inline"))},null,8,["variant"])]),_:1}),W(i,{text:"Side-by-side diff"},{default:O(()=>[W(o,{icon:"i-lucide-columns-2",variant:e.layout==="side-by-side"?"solid":"outline",color:"neutral",onClick:s[5]||(s[5]=p=>n("update:layout","side-by-side"))},null,8,["variant"])]),_:1})]),_:1}),s[14]||(s[14]=q("div",{class:"h-5 w-px bg-default"},null,-1)),e.comparison?(y(),P(i,{key:1,text:e.promptCopied?"Copied!":"Copy Generator prompt"},{default:O(()=>[W(o,{size:"sm",variant:"ghost",color:e.promptCopied?"success":"neutral",icon:e.promptCopied?"i-lucide-check":"i-lucide-clipboard-copy",onClick:s[6]||(s[6]=p=>n("copyPrompt"))},null,8,["color","icon"])]),_:1},8,["text"])):F("",!0),s[15]||(s[15]=q("div",{class:"h-5 w-px bg-default"},null,-1)),W(c,null,{content:O(({close:p})=>[q("div",Lq,[s[11]||(s[11]=q("p",{class:"mb-2 text-xs text-muted"},[Ce(" Paste the write token printed by "),q("code",{class:"font-mono"},"review-workspace serve"),Ce(". Needed to raise Questions or change Review State — read-only viewing works without it. ")],-1)),W(u,{"model-value":e.writeTokenDraft,size:"sm",class:"w-full",placeholder:"write token","onUpdate:modelValue":s[7]||(s[7]=h=>n("update:writeTokenDraft",h)),onKeyup:lg(h=>n("saveWriteToken",p),["enter"])},null,8,["model-value","onKeyup"]),W(o,{size:"sm",class:"mt-2",block:"",onClick:h=>n("saveWriteToken",p)},{default:O(()=>[...s[10]||(s[10]=[Ce("Save",-1)])]),_:1},8,["onClick"])])]),default:O(()=>[W(i,{text:e.hasWriteToken?"Write token set":"Set write token"},{default:O(()=>[W(o,{size:"sm",variant:"ghost",color:e.hasWriteToken?"primary":"warning",icon:"i-lucide-key"},null,8,["color"])]),_:1},8,["text"])]),_:1}),W(i,{text:"Toggle color mode"},{default:O(()=>[W(d,{size:"sm"})]),_:1})])])}}}),Bq={class:"flex flex-col gap-5"},Fq={class:"flex flex-col gap-4"},jq={class:"mb-1 flex items-center gap-2"},Hq={key:0,class:"text-xs font-semibold text-highlighted"},Vq={key:1,class:"text-xs font-semibold text-muted"},Uq={class:"flex flex-col gap-1"},Wq=["title","onClick"],Gq={key:0},Kq={class:"mb-2 flex h-1.5 overflow-hidden rounded-full bg-elevated"},Yq={class:"space-y-0.5 text-xs"},Qq={class:"flex justify-between"},Xq={class:"flex justify-between"},Zq={class:"flex justify-between"},Jq=ee({__name:"Sidebar",props:{groups:{},files:{}},setup(e){const t=e;function n(l){return`file-${l.replace(/[^a-zA-Z0-9]/g,"-")}`}function r(l){return l.split("/").pop()??l}function s(l){var u;(u=document.getElementById(n(l)))==null||u.scrollIntoView({behavior:"smooth",block:"start"})}const o={high:"error",medium:"warning",low:"success"},i=A(()=>Tv(t.files)),a=A(()=>i.value.verified+i.value.unverified+i.value.gap);return(l,u)=>{const c=Wn;return y(),I("nav",Bq,[q("div",null,[u[0]||(u[0]=q("p",{class:"mb-2 text-[11px] font-semibold tracking-wide text-dimmed uppercase"},"Behavioral groups",-1)),q("div",Fq,[(y(!0),I(pe,null,$e(e.groups,(d,p)=>{var h,g;return y(),I("div",{key:((h=d.group)==null?void 0:h.id)??`ungrouped-${p}`},[q("div",jq,[d.group?(y(),I("span",Hq,z(d.group.title),1)):(y(),I("span",Vq,"Other changes")),(g=d.group)!=null&&g.risk?(y(),P(c,{key:2,color:o[d.group.risk],variant:"subtle",size:"sm"},{default:O(()=>[Ce(z(d.group.risk),1)]),_:2},1032,["color"])):F("",!0)]),q("div",Uq,[(y(!0),I(pe,null,$e(d.filePaths,m=>(y(),I("button",{key:m,type:"button",class:"truncate rounded px-2 py-1 text-left font-mono text-xs text-muted hover:bg-elevated hover:text-highlighted",title:m,onClick:v=>s(m)},z(r(m)),9,Wq))),128))])])}),128))])]),a.value?(y(),I("div",Gq,[u[4]||(u[4]=q("p",{class:"mb-2 text-[11px] font-semibold tracking-wide text-dimmed uppercase"},"Verification",-1)),q("div",Kq,[q("div",{class:"bg-success",style:kt({width:`${100*i.value.verified/a.value}%`})},null,4),q("div",{class:"bg-warning",style:kt({width:`${100*i.value.unverified/a.value}%`})},null,4),q("div",{class:"bg-error",style:kt({width:`${100*i.value.gap/a.value}%`})},null,4)]),q("ul",Yq,[q("li",Qq,[u[1]||(u[1]=q("span",{class:"text-success"},"verified",-1)),q("span",null,z(i.value.verified),1)]),q("li",Xq,[u[2]||(u[2]=q("span",{class:"text-warning"},"unverified",-1)),q("span",null,z(i.value.unverified),1)]),q("li",Zq,[u[3]||(u[3]=q("span",{class:"text-error"},"gap",-1)),q("span",null,z(i.value.gap),1)])])])):F("",!0)])}}}),e$={class:"max-h-72 w-80 overflow-y-auto p-2 font-mono text-xs"},t$={class:"mb-1 px-1 font-sans text-[10px] text-muted"},n$=["onClick"],r$={class:"text-primary"},s$={class:"text-dimmed"},o$={class:"text-muted"},i$=ee({__name:"SymbolOccurrencesPopover",setup(e){const t=GR();async function n(s,o,i){Mp(),await qv(s,o,i)}function r(s){s||Mp()}return(s,o)=>{const i=Da;return y(),P(i,{open:f(t).open,"onUpdate:open":r},{content:O(()=>[q("div",e$,[q("div",t$,z(f(t).occurrences.length)+" occurrence"+z(f(t).occurrences.length===1?"":"s")+" of “"+z(f(t).symbol)+"” ",1),(y(!0),I(pe,null,$e(f(t).occurrences,a=>(y(),I("button",{key:a.lineId,type:"button",class:"block w-full truncate rounded px-1.5 py-1 text-left hover:bg-elevated",onClick:l=>n(a.path,a.hunkIndex,a.lineId)},[q("span",r$,z(a.path),1),q("span",s$,":"+z(a.lineNumber),1),q("span",o$," — "+z(a.text.trim()),1)],8,n$))),128))])]),default:O(()=>[q("span",{class:"pointer-events-none fixed h-0 w-0",style:kt({left:`${f(t).x}px`,top:`${f(t).y}px`})},null,4)]),_:1},8,["open"])}}}),a$={role:"region","aria-label":"Verdict",class:"mb-6 rounded-lg border border-default bg-elevated p-4"},l$={class:"mb-1 text-base font-bold text-highlighted"},u$=["innerHTML"],c$={class:"mb-4 grid grid-cols-2 gap-3 sm:grid-cols-4"},d$={class:"text-2xl font-bold text-success"},f$={class:"text-2xl font-bold text-error"},p$={class:"text-2xl font-bold text-warning"},h$={class:"text-2xl font-bold text-highlighted"},g$={key:1},m$={class:"mb-2 text-[11px] font-semibold tracking-wide text-dimmed uppercase"},v$={class:"space-y-1.5 text-xs"},y$={class:"w-4 shrink-0 text-right text-dimmed"},b$=["onClick"],x$={class:"hidden shrink-0 font-mono text-dimmed sm:inline"},w$={key:0,class:"mt-1.5 text-[11px] text-dimmed"},_$={key:2,class:"mt-3 flex flex-wrap gap-2 text-xs"},k$=["onClick"],Lp=5,C$=ee({__name:"VerdictPanel",props:{summary:{},files:{},groups:{}},setup(e){const t=e,n=Q(!1),r=A(()=>t.summary?Sv(t.summary.text):{headline:"",body:""}),s=A(()=>Tv(t.files)),o=A(()=>{const d=Wc(t.groups);return Gc(Uc(t.files),d)}),i=A(()=>o.value.slice(0,Lp)),a=A(()=>Math.max(0,o.value.length-Lp)),l={gap:"⚑",unverified:"○"},u={gap:"error",unverified:"warning"};function c(d){var p;(p=document.getElementById(Ms(d)))==null||p.scrollIntoView({behavior:"smooth",block:"start"})}return(d,p)=>{var g;const h=Wn;return y(),I("section",a$,[e.summary?(y(),I(pe,{key:0},[q("h2",l$,z(r.value.headline),1),r.value.body?(y(),I("button",{key:0,type:"button",class:"mb-3 text-xs text-primary hover:underline",onClick:p[0]||(p[0]=m=>n.value=!n.value)},z(n.value?"▾ hide rest":"▸ read rest"),1)):F("",!0),n.value&&r.value.body?(y(),I("div",{key:1,class:"markdown-body mb-3 text-sm text-muted",innerHTML:f(qa)(r.value.body)},null,8,u$)):F("",!0)],64)):F("",!0),q("div",c$,[q("div",null,[q("p",d$,z(s.value.verified),1),p[1]||(p[1]=q("p",{class:"text-[11px] tracking-wide text-dimmed uppercase"},"Resolved",-1))]),q("div",null,[q("p",f$,z(s.value.gap),1),p[2]||(p[2]=q("p",{class:"text-[11px] tracking-wide text-dimmed uppercase"},"Open gaps",-1))]),q("div",null,[q("p",p$,z(s.value.unverified),1),p[3]||(p[3]=q("p",{class:"text-[11px] tracking-wide text-dimmed uppercase"},"Needs eyes",-1))]),q("div",null,[q("p",h$,z(e.files.length),1),p[4]||(p[4]=q("p",{class:"text-[11px] tracking-wide text-dimmed uppercase"},"Files changed",-1))])]),i.value.length?(y(),I("div",g$,[q("p",m$," Start here — "+z(o.value.length)+" item"+z(o.value.length===1?"":"s")+", ordered by risk ",1),q("ol",v$,[(y(!0),I(pe,null,$e(i.value,(m,v)=>(y(),I("li",{key:m.verification.id,class:"flex items-center gap-2"},[q("span",y$,z(v+1),1),q("button",{type:"button",class:"flex-1 truncate text-left hover:underline",onClick:b=>c(m.path)},z(m.verification.description),9,b$),W(h,{size:"sm",variant:"subtle",color:u[m.verification.status]},{default:O(()=>[Ce(z(l[m.verification.status])+" "+z(m.verification.status),1)]),_:2},1032,["color"]),q("span",x$,z(m.path.split("/").pop()),1)]))),128))]),a.value?(y(),I("p",w$,"+"+z(a.value)+" more not shown",1)):F("",!0)])):F("",!0),(g=e.summary)!=null&&g.highlightPaths.length?(y(),I("ul",_$,[(y(!0),I(pe,null,$e(e.summary.highlightPaths,m=>(y(),I("li",{key:m},[q("button",{type:"button",class:"font-mono text-primary hover:underline",onClick:v=>c(m)},"→ "+z(m),9,k$)]))),128))])):F("",!0)])}}});function S$(e=1500){const t=Q(!1);let n;async function r(s){await navigator.clipboard.writeText(s),t.value=!0,clearTimeout(n),n=setTimeout(()=>t.value=!1,e)}return{copied:t,copy:r}}const T$=4e3;function A$(){const e=Q(null),t=Q(null);let n;async function r(){try{e.value=await $O(),Ao.value=e.value.files,t.value=null}catch(s){t.value=s instanceof Error?s.message:String(s)}await Ma()}return ft(async()=>{await FO(),await r(),n=setInterval(r,T$)}),qo(()=>clearInterval(n)),{viewModel:e,error:t,refresh:r}}function E$(e){const t=new Map;let n=1;for(const r of e)for(const s of r.files){for(const o of s.annotations)o.target.type!=="line"&&t.set(o.id,n++);for(const o of s.hunks)for(const i of o.lines)for(const a of i.annotations)t.set(a.id,n++)}return t}function O$(e){return!!e&&!!(e.title||e.url||e.author||e.sourceBranch||e.description)}function R$(e){return e?e.title?e.number?`!${e.number} ${e.title}`:e.title:`${e.base} → ${e.head}`:"Review Workspace"}function P$(e){return e!=null&&e.description?qa(e.description,e.url):""}function I$(e,t){const n=new Set,r=t.map(o=>{const i=o.filePaths.map(a=>e.find(l=>l.path===a)).filter(a=>!!a);return i.forEach(a=>n.add(a.path)),{group:o,filePaths:i.map(a=>a.path),files:i}}),s=e.filter(o=>!n.has(o.path));return s.length&&r.push({group:null,filePaths:s.map(o=>o.path),files:s}),r}const q$={class:"flex h-screen flex-col bg-default text-default"},$$={key:1,class:"p-4 text-error"},M$={key:2,class:"p-4 text-muted"},D$={key:4,class:"flex flex-1 overflow-hidden"},N$={key:0,class:"w-64 shrink-0 overflow-y-auto border-r border-default p-3"},L$={class:"flex-1 overflow-y-auto p-4"},z$={key:0,class:"mb-4 rounded border border-warning/50 bg-warning/10 p-3 text-xs"},B$={class:"mb-3 flex items-center gap-2"},F$={key:0,class:"text-base font-semibold"},j$={key:1,class:"text-base font-semibold text-muted"},H$={key:0,class:"mb-4 flex flex-col gap-3"},V$=ee({__name:"DiffReviewView",setup(e){const{viewModel:t,error:n}=A$(),r=bv(),{copied:s,copy:o}=S$(),i=Q("inline"),a=Q(!0),l=Q(!1),u=Q(!1),c=Q(!1),d=Q(),p=Q(r.writeToken),h=A(()=>{const D=t.value;return D?I$(D.files,D.groups):[]}),g=A(()=>{const D=t.value;return D?Gc(Uc(D.files),Wc(D.groups)).length:0});function m(D){c.value=!1,D&&requestAnimationFrame(()=>{var Y;return(Y=document.getElementById(Ms(D)))==null?void 0:Y.scrollIntoView({behavior:"smooth",block:"start"})})}const v=A(()=>E$(h.value)),b=A(()=>{var D;return((D=t.value)==null?void 0:D.comparison)??null}),w=A(()=>R$(b.value??void 0)),x=A(()=>O$(b.value??void 0)),_=A(()=>P$(b.value??void 0)),R=A(()=>{const D=t.value;return D?AR(D.files,D.answers,r.questions):[]}),T=A(()=>ER(R.value));function E(D){DO(p.value.trim()),D()}async function $(){t.value&&await o(t.value.generatorPrompt)}async function N(D){u.value=!1,await OR(D)}return(D,Y)=>{var re;const te=Wn;return y(),I("div",q$,[W(zq,{"header-title":w.value,comparison:b.value,"has-mr-metadata":x.value,"nav-visible":a.value,layout:i.value,"open-question-count":T.value,"prompt-copied":f(s),"has-write-token":f(r).writeToken.length>0,"write-token-draft":p.value,"focus-mode":c.value,"focus-mode-count":g.value,"onUpdate:navVisible":Y[0]||(Y[0]=j=>a.value=j),"onUpdate:layout":Y[1]||(Y[1]=j=>i.value=j),"onUpdate:writeTokenDraft":Y[2]||(Y[2]=j=>p.value=j),"onUpdate:focusMode":Y[3]||(Y[3]=j=>c.value=j),onOpenQuestions:Y[4]||(Y[4]=j=>u.value=!0),onOpenMrDetails:Y[5]||(Y[5]=j=>l.value=!0),onCopyPrompt:$,onSaveWriteToken:E},null,8,["header-title","comparison","has-mr-metadata","nav-visible","layout","open-question-count","prompt-copied","has-write-token","write-token-draft","focus-mode","focus-mode-count"]),W(i$),b.value?(y(),P(cq,{key:0,open:l.value,"onUpdate:open":Y[6]||(Y[6]=j=>l.value=j),comparison:b.value,"description-html":_.value},null,8,["open","comparison","description-html"])):F("",!0),W(bq,{open:u.value,"onUpdate:open":Y[7]||(Y[7]=j=>u.value=j),entries:R.value,"current-round":((re=f(t))==null?void 0:re.round)??1,onSelect:N},null,8,["open","entries","current-round"]),f(n)?(y(),I("div",$$,"Failed to load bundle: "+z(f(n)),1)):f(t)?c.value?(y(),P(eq,{key:3,files:f(t).files,groups:f(t).groups,"current-id":d.value,"onUpdate:currentId":Y[8]||(Y[8]=j=>d.value=j),onExit:m},null,8,["files","groups","current-id"])):(y(),I("div",D$,[a.value?(y(),I("aside",N$,[W(Jq,{groups:h.value,files:f(t).files},null,8,["groups","files"])])):F("",!0),q("main",L$,[f(t).diagnostics.length?(y(),I("div",z$,[q("strong",null,z(f(t).diagnostics.length)+" bundle-level diagnostic(s)",1)])):F("",!0),f(t).summary?(y(),P(C$,{key:1,summary:f(t).summary,files:f(t).files,groups:f(t).groups},null,8,["summary","files","groups"])):F("",!0),(y(!0),I(pe,null,$e(h.value,(j,de)=>{var G,ue;return y(),I("section",{key:((G=j.group)==null?void 0:G.id)??`ungrouped-${de}`,class:"mb-8"},[q("div",B$,[j.group?(y(),I("h2",F$,z(j.group.title),1)):(y(),I("h2",j$,"Other changes")),(ue=j.group)!=null&&ue.risk?(y(),P(te,{key:2,color:{high:"error",medium:"warning",low:"success"}[j.group.risk],variant:"subtle",size:"sm"},{default:O(()=>[Ce(z(j.group.risk),1)]),_:2},1032,["color"])):F("",!0)]),j.files.some(X=>X.annotations.length)?(y(),I("div",H$,[(y(!0),I(pe,null,$e(j.files.flatMap(X=>X.annotations),X=>(y(),P(Av,{key:X.id,annotation:X},null,8,["annotation"]))),128))])):F("",!0),(y(!0),I(pe,null,$e(j.files,X=>(y(),P(HI,{key:X.path,file:X,layout:i.value,"annotation-numbers":v.value,questions:f(r).questions,answers:f(t).answers},null,8,["file","layout","annotation-numbers","questions","answers"]))),128))])}),128))])])):(y(),I("div",M$,"Loading…"))])}}}),U$=[{path:"/",name:"diff-review",component:V$}],Kc=A0(l2),W$=$x({routes:U$,history:px()});Kc.use(W$);Kc.use(pk);Kc.mount("#app");
|
package/ui-dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>Review Workspace</title>
|
|
7
7
|
<link rel="icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ctext y='.9em' font-size='90'%3E%F0%9F%94%8D%3C/text%3E%3C/svg%3E" />
|
|
8
|
-
<script type="module" crossorigin src="/_app/index-
|
|
8
|
+
<script type="module" crossorigin src="/_app/index-BZCY_1od.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/_app/index-Cqnbk3t0.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|