v0.35.2 80d5067

mr_templ.go RawHistoryFolder

1// Code generated by templ - DO NOT EDIT.
2
3// templ: version: v0.3.1020
4// SPDX-License-Identifier: AGPL-3.0-or-later
5
6package web
7
8//lint:file-ignore SA4006 This context is only used if a nested component is present.
9
10import "github.com/a-h/templ"
11import templruntime "github.com/a-h/templ/runtime"
12
13import (
14	"strconv"
15	"strings"
16)
17
18// MRList is the list of the merge requests of a repository: the open ones,
19// then the merged and closed ones.
20func MRList(l Layout, p MRListPage) templ.Component {
21	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
22		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
23		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
24			return templ_7745c5c3_CtxErr
25		}
26		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
27		if !templ_7745c5c3_IsBuffer {
28			defer func() {
29				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
30				if templ_7745c5c3_Err == nil {
31					templ_7745c5c3_Err = templ_7745c5c3_BufErr
32				}
33			}()
34		}
35		ctx = templ.InitializeContext(ctx)
36		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
37		if templ_7745c5c3_Var1 == nil {
38			templ_7745c5c3_Var1 = templ.NopComponent
39		}
40		ctx = templ.ClearChildren(ctx)
41		templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
42			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
43			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
44			if !templ_7745c5c3_IsBuffer {
45				defer func() {
46					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
47					if templ_7745c5c3_Err == nil {
48						templ_7745c5c3_Err = templ_7745c5c3_BufErr
49					}
50				}()
51			}
52			ctx = templ.InitializeContext(ctx)
53			if p.Live {
54				templ_7745c5c3_Err = LiveSlot("mr-notice").Render(ctx, templ_7745c5c3_Buffer)
55				if templ_7745c5c3_Err != nil {
56					return templ_7745c5c3_Err
57				}
58				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, " <div id=\"mr-refresh-status\" role=\"status\" aria-live=\"polite\"></div>")
59				if templ_7745c5c3_Err != nil {
60					return templ_7745c5c3_Err
61				}
62			}
63			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, " <div class=\"filter\"><label for=\"mr-filter\" class=\"sr\">filter</label> <input id=\"mr-filter\" type=\"search\" data-filter=\".mrs tbody tr\" placeholder=\"Filter by title, branch, author or state…\" autocomplete=\"off\" hx-on:input=\"ermite.filter(this)\"></div>")
64			if templ_7745c5c3_Err != nil {
65				return templ_7745c5c3_Err
66			}
67			if p.Newest == "" {
68				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "<h2 class=\"rule-h\"><span>Open</span><span class=\"count\">")
69				if templ_7745c5c3_Err != nil {
70					return templ_7745c5c3_Err
71				}
72				var templ_7745c5c3_Var3 string
73				templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Open)))
74				if templ_7745c5c3_Err != nil {
75					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 30, Col: 78}
76				}
77				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
78				if templ_7745c5c3_Err != nil {
79					return templ_7745c5c3_Err
80				}
81				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "</span></h2>")
82				if templ_7745c5c3_Err != nil {
83					return templ_7745c5c3_Err
84				}
85				templ_7745c5c3_Err = mrRows(p.Open, "Open merge requests").Render(ctx, templ_7745c5c3_Buffer)
86				if templ_7745c5c3_Err != nil {
87					return templ_7745c5c3_Err
88				}
89				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, " ")
90				if templ_7745c5c3_Err != nil {
91					return templ_7745c5c3_Err
92				}
93				if len(p.Open) == 0 {
94					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "<p class=\"lede dim\">no open merge requests.</p>")
95					if templ_7745c5c3_Err != nil {
96						return templ_7745c5c3_Err
97					}
98				}
99				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, " ")
100				if templ_7745c5c3_Err != nil {
101					return templ_7745c5c3_Err
102				}
103				if p.OpenNote != "" {
104					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "<p class=\"note\">")
105					if templ_7745c5c3_Err != nil {
106						return templ_7745c5c3_Err
107					}
108					var templ_7745c5c3_Var4 string
109					templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(p.OpenNote)
110					if templ_7745c5c3_Err != nil {
111						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 36, Col: 32}
112					}
113					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
114					if templ_7745c5c3_Err != nil {
115						return templ_7745c5c3_Err
116					}
117					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 9, "</p>")
118					if templ_7745c5c3_Err != nil {
119						return templ_7745c5c3_Err
120					}
121				}
122			}
123			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 10, " <h2 class=\"rule-h\"><span>Merged and closed</span><span class=\"count\">")
124			if templ_7745c5c3_Err != nil {
125				return templ_7745c5c3_Err
126			}
127			var templ_7745c5c3_Var5 string
128			templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Done)))
129			if templ_7745c5c3_Err != nil {
130				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 39, Col: 90}
131			}
132			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
133			if templ_7745c5c3_Err != nil {
134				return templ_7745c5c3_Err
135			}
136			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 11, "</span></h2>")
137			if templ_7745c5c3_Err != nil {
138				return templ_7745c5c3_Err
139			}
140			templ_7745c5c3_Err = mrRows(p.Done, "Merged and closed merge requests").Render(ctx, templ_7745c5c3_Buffer)
141			if templ_7745c5c3_Err != nil {
142				return templ_7745c5c3_Err
143			}
144			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 12, " ")
145			if templ_7745c5c3_Err != nil {
146				return templ_7745c5c3_Err
147			}
148			if len(p.Done) == 0 {
149				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 13, "<p class=\"lede dim\">nothing merged or closed yet.</p>")
150				if templ_7745c5c3_Err != nil {
151					return templ_7745c5c3_Err
152				}
153			}
154			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 14, " ")
155			if templ_7745c5c3_Err != nil {
156				return templ_7745c5c3_Err
157			}
158			if p.Older != "" || p.Newest != "" {
159				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, "<nav class=\"pager\" aria-label=\"Pages\">")
160				if templ_7745c5c3_Err != nil {
161					return templ_7745c5c3_Err
162				}
163				if p.Newest != "" {
164					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 16, "<a class=\"btn\" href=\"")
165					if templ_7745c5c3_Err != nil {
166						return templ_7745c5c3_Err
167					}
168					var templ_7745c5c3_Var6 templ.SafeURL
169					templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Newest))
170					if templ_7745c5c3_Err != nil {
171						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 47, Col: 50}
172					}
173					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
174					if templ_7745c5c3_Err != nil {
175						return templ_7745c5c3_Err
176					}
177					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 17, "\">← Newest</a> ")
178					if templ_7745c5c3_Err != nil {
179						return templ_7745c5c3_Err
180					}
181				} else {
182					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 18, "<span class=\"btn\" aria-disabled=\"true\">← Newest</span> ")
183					if templ_7745c5c3_Err != nil {
184						return templ_7745c5c3_Err
185					}
186				}
187				if p.Older != "" {
188					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 19, "<a class=\"btn\" href=\"")
189					if templ_7745c5c3_Err != nil {
190						return templ_7745c5c3_Err
191					}
192					var templ_7745c5c3_Var7 templ.SafeURL
193					templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Older))
194					if templ_7745c5c3_Err != nil {
195						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 52, Col: 49}
196					}
197					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
198					if templ_7745c5c3_Err != nil {
199						return templ_7745c5c3_Err
200					}
201					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 20, "\" rel=\"next\">Older →</a>")
202					if templ_7745c5c3_Err != nil {
203						return templ_7745c5c3_Err
204					}
205				} else {
206					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 21, "<span class=\"btn\" aria-disabled=\"true\">Older →</span>")
207					if templ_7745c5c3_Err != nil {
208						return templ_7745c5c3_Err
209					}
210				}
211				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 22, "</nav>")
212				if templ_7745c5c3_Err != nil {
213					return templ_7745c5c3_Err
214				}
215			}
216			return nil
217		})
218		templ_7745c5c3_Err = Shell(l, mrListRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
219		if templ_7745c5c3_Err != nil {
220			return templ_7745c5c3_Err
221		}
222		return nil
223	})
224}
225
226func mrRows(rows []MRRow, label string) templ.Component {
227	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
228		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
229		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
230			return templ_7745c5c3_CtxErr
231		}
232		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
233		if !templ_7745c5c3_IsBuffer {
234			defer func() {
235				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
236				if templ_7745c5c3_Err == nil {
237					templ_7745c5c3_Err = templ_7745c5c3_BufErr
238				}
239			}()
240		}
241		ctx = templ.InitializeContext(ctx)
242		templ_7745c5c3_Var8 := templ.GetChildren(ctx)
243		if templ_7745c5c3_Var8 == nil {
244			templ_7745c5c3_Var8 = templ.NopComponent
245		}
246		ctx = templ.ClearChildren(ctx)
247		if len(rows) > 0 {
248			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 23, "<table class=\"list mrs\" aria-label=\"")
249			if templ_7745c5c3_Err != nil {
250				return templ_7745c5c3_Err
251			}
252			var templ_7745c5c3_Var9 string
253			templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.ResolveAttributeValue(label)
254			if templ_7745c5c3_Err != nil {
255				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 63, Col: 44}
256			}
257			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var9)
258			if templ_7745c5c3_Err != nil {
259				return templ_7745c5c3_Err
260			}
261			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 24, "\"><tbody data-rows>")
262			if templ_7745c5c3_Err != nil {
263				return templ_7745c5c3_Err
264			}
265			for _, m := range rows {
266				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 25, "<tr")
267				if templ_7745c5c3_Err != nil {
268					return templ_7745c5c3_Err
269				}
270				if m.Cursor {
271					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 26, " data-cursor")
272					if templ_7745c5c3_Err != nil {
273						return templ_7745c5c3_Err
274					}
275				}
276				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 27, " data-state=\"")
277				if templ_7745c5c3_Err != nil {
278					return templ_7745c5c3_Err
279				}
280				var templ_7745c5c3_Var10 string
281				templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.State)
282				if templ_7745c5c3_Err != nil {
283					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 66, Col: 55}
284				}
285				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var10)
286				if templ_7745c5c3_Err != nil {
287					return templ_7745c5c3_Err
288				}
289				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 28, "\"><td class=\"c-n mute\">")
290				if templ_7745c5c3_Err != nil {
291					return templ_7745c5c3_Err
292				}
293				var templ_7745c5c3_Var11 string
294				templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(m.Number)
295				if templ_7745c5c3_Err != nil {
296					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 67, Col: 37}
297				}
298				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
299				if templ_7745c5c3_Err != nil {
300					return templ_7745c5c3_Err
301				}
302				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 29, "</td><td class=\"c-state\">")
303				if templ_7745c5c3_Err != nil {
304					return templ_7745c5c3_Err
305				}
306				var templ_7745c5c3_Var12 string
307				templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(m.State)
308				if templ_7745c5c3_Err != nil {
309					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 68, Col: 35}
310				}
311				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
312				if templ_7745c5c3_Err != nil {
313					return templ_7745c5c3_Err
314				}
315				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 30, "</td><td class=\"c-subject\"><a href=\"")
316				if templ_7745c5c3_Err != nil {
317					return templ_7745c5c3_Err
318				}
319				var templ_7745c5c3_Var13 templ.SafeURL
320				templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(m.Href))
321				if templ_7745c5c3_Err != nil {
322					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 69, Col: 59}
323				}
324				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
325				if templ_7745c5c3_Err != nil {
326					return templ_7745c5c3_Err
327				}
328				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 31, "\">")
329				if templ_7745c5c3_Err != nil {
330					return templ_7745c5c3_Err
331				}
332				var templ_7745c5c3_Var14 string
333				templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(m.Title)
334				if templ_7745c5c3_Err != nil {
335					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 69, Col: 71}
336				}
337				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
338				if templ_7745c5c3_Err != nil {
339					return templ_7745c5c3_Err
340				}
341				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 32, "</a> <span class=\"mute\">")
342				if templ_7745c5c3_Err != nil {
343					return templ_7745c5c3_Err
344				}
345				var templ_7745c5c3_Var15 string
346				templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(m.Branches)
347				if templ_7745c5c3_Err != nil {
348					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 69, Col: 109}
349				}
350				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
351				if templ_7745c5c3_Err != nil {
352					return templ_7745c5c3_Err
353				}
354				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 33, "</span></td><td class=\"c-who dim\">")
355				if templ_7745c5c3_Err != nil {
356					return templ_7745c5c3_Err
357				}
358				var templ_7745c5c3_Var16 string
359				templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(m.Author)
360				if templ_7745c5c3_Err != nil {
361					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 70, Col: 38}
362				}
363				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
364				if templ_7745c5c3_Err != nil {
365					return templ_7745c5c3_Err
366				}
367				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 34, "</td><td class=\"c-when nowrap dim\">")
368				if templ_7745c5c3_Err != nil {
369					return templ_7745c5c3_Err
370				}
371				if m.WhenAt != "" {
372					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 35, "<time datetime=\"")
373					if templ_7745c5c3_Err != nil {
374						return templ_7745c5c3_Err
375					}
376					var templ_7745c5c3_Var17 string
377					templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.WhenAt)
378					if templ_7745c5c3_Err != nil {
379						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 73, Col: 33}
380					}
381					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var17)
382					if templ_7745c5c3_Err != nil {
383						return templ_7745c5c3_Err
384					}
385					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 36, "\" title=\"")
386					if templ_7745c5c3_Err != nil {
387						return templ_7745c5c3_Err
388					}
389					var templ_7745c5c3_Var18 string
390					templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.WhenAt)
391					if templ_7745c5c3_Err != nil {
392						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 73, Col: 52}
393					}
394					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18)
395					if templ_7745c5c3_Err != nil {
396						return templ_7745c5c3_Err
397					}
398					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 37, "\">")
399					if templ_7745c5c3_Err != nil {
400						return templ_7745c5c3_Err
401					}
402					var templ_7745c5c3_Var19 string
403					templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(m.When)
404					if templ_7745c5c3_Err != nil {
405						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 73, Col: 63}
406					}
407					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
408					if templ_7745c5c3_Err != nil {
409						return templ_7745c5c3_Err
410					}
411					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 38, "</time>")
412					if templ_7745c5c3_Err != nil {
413						return templ_7745c5c3_Err
414					}
415				}
416				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 39, "</td></tr>")
417				if templ_7745c5c3_Err != nil {
418					return templ_7745c5c3_Err
419				}
420			}
421			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 40, "</tbody></table>")
422			if templ_7745c5c3_Err != nil {
423				return templ_7745c5c3_Err
424			}
425		}
426		return nil
427	})
428}
429
430func mrListRail(p MRListPage) templ.Component {
431	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
432		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
433		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
434			return templ_7745c5c3_CtxErr
435		}
436		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
437		if !templ_7745c5c3_IsBuffer {
438			defer func() {
439				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
440				if templ_7745c5c3_Err == nil {
441					templ_7745c5c3_Err = templ_7745c5c3_BufErr
442				}
443			}()
444		}
445		ctx = templ.InitializeContext(ctx)
446		templ_7745c5c3_Var20 := templ.GetChildren(ctx)
447		if templ_7745c5c3_Var20 == nil {
448			templ_7745c5c3_Var20 = templ.NopComponent
449		}
450		ctx = templ.ClearChildren(ctx)
451		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 41, "<section aria-labelledby=\"r-states\"><h2 id=\"r-states\">States</h2><dl class=\"kv\"><dt>open</dt><dd>awaits review</dd><dt>merged</dt><dd>the target took the branch</dd><dt>closed</dt><dd>refused, branch kept</dd></dl></section><section aria-labelledby=\"r-new\"><h2 id=\"r-new\">Open one</h2>")
452		if templ_7745c5c3_Err != nil {
453			return templ_7745c5c3_Err
454		}
455		if len(p.Branches) > 0 {
456			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 42, "<p class=\"dim\">compare a branch with ")
457			if templ_7745c5c3_Err != nil {
458				return templ_7745c5c3_Err
459			}
460			var templ_7745c5c3_Var21 string
461			templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(p.Default)
462			if templ_7745c5c3_Err != nil {
463				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 98, Col: 51}
464			}
465			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
466			if templ_7745c5c3_Err != nil {
467				return templ_7745c5c3_Err
468			}
469			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 43, ":</p><nav class=\"outline\" aria-label=\"Branches\">")
470			if templ_7745c5c3_Err != nil {
471				return templ_7745c5c3_Err
472			}
473			for _, b := range p.Branches {
474				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 44, "<a href=\"")
475				if templ_7745c5c3_Err != nil {
476					return templ_7745c5c3_Err
477				}
478				var templ_7745c5c3_Var22 templ.SafeURL
479				templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(b.Href))
480				if templ_7745c5c3_Err != nil {
481					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 101, Col: 36}
482				}
483				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
484				if templ_7745c5c3_Err != nil {
485					return templ_7745c5c3_Err
486				}
487				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 45, "\">")
488				if templ_7745c5c3_Err != nil {
489					return templ_7745c5c3_Err
490				}
491				var templ_7745c5c3_Var23 string
492				templ_7745c5c3_Var23, templ_7745c5c3_Err = templ.JoinStringErrs(b.Name)
493				if templ_7745c5c3_Err != nil {
494					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 101, Col: 47}
495				}
496				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var23))
497				if templ_7745c5c3_Err != nil {
498					return templ_7745c5c3_Err
499				}
500				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 46, "</a>")
501				if templ_7745c5c3_Err != nil {
502					return templ_7745c5c3_Err
503				}
504			}
505			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 47, "</nav>")
506			if templ_7745c5c3_Err != nil {
507				return templ_7745c5c3_Err
508			}
509		} else {
510			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 48, "<p class=\"dim\">there is no other branch to merge yet.</p>")
511			if templ_7745c5c3_Err != nil {
512				return templ_7745c5c3_Err
513			}
514		}
515		templ_7745c5c3_Err = CloneBlock(p.CLI).Render(ctx, templ_7745c5c3_Buffer)
516		if templ_7745c5c3_Err != nil {
517			return templ_7745c5c3_Err
518		}
519		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 49, "</section>")
520		if templ_7745c5c3_Err != nil {
521			return templ_7745c5c3_Err
522		}
523		return nil
524	})
525}
526
527// MergeRequest is a merge request: its facts, its description, the diff with
528// the notes under their lines, the general comments. The merge and More menus
529// sit in the toolbar, the commits and checks in the card footer, and the rail
530// holds the files and verdicts.
531func MergeRequest(l Layout, p MRPage) templ.Component {
532	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
533		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
534		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
535			return templ_7745c5c3_CtxErr
536		}
537		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
538		if !templ_7745c5c3_IsBuffer {
539			defer func() {
540				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
541				if templ_7745c5c3_Err == nil {
542					templ_7745c5c3_Err = templ_7745c5c3_BufErr
543				}
544			}()
545		}
546		ctx = templ.InitializeContext(ctx)
547		templ_7745c5c3_Var24 := templ.GetChildren(ctx)
548		if templ_7745c5c3_Var24 == nil {
549			templ_7745c5c3_Var24 = templ.NopComponent
550		}
551		ctx = templ.ClearChildren(ctx)
552		templ_7745c5c3_Var25 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
553			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
554			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
555			if !templ_7745c5c3_IsBuffer {
556				defer func() {
557					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
558					if templ_7745c5c3_Err == nil {
559						templ_7745c5c3_Err = templ_7745c5c3_BufErr
560					}
561				}()
562			}
563			ctx = templ.InitializeContext(ctx)
564			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "<section class=\"mr-card\"><header class=\"show mr-h\"><h1><span class=\"mute\">")
565			if templ_7745c5c3_Err != nil {
566				return templ_7745c5c3_Err
567			}
568			var templ_7745c5c3_Var26 string
569			templ_7745c5c3_Var26, templ_7745c5c3_Err = templ.JoinStringErrs(p.Number)
570			if templ_7745c5c3_Err != nil {
571				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 119, Col: 37}
572			}
573			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var26))
574			if templ_7745c5c3_Err != nil {
575				return templ_7745c5c3_Err
576			}
577			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "</span> ")
578			if templ_7745c5c3_Err != nil {
579				return templ_7745c5c3_Err
580			}
581			var templ_7745c5c3_Var27 string
582			templ_7745c5c3_Var27, templ_7745c5c3_Err = templ.JoinStringErrs(p.Title)
583			if templ_7745c5c3_Err != nil {
584				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 119, Col: 56}
585			}
586			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var27))
587			if templ_7745c5c3_Err != nil {
588				return templ_7745c5c3_Err
589			}
590			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 52, "</h1><dl class=\"kv show-kv\"><dt>state</dt>")
591			if templ_7745c5c3_Err != nil {
592				return templ_7745c5c3_Err
593			}
594			templ_7745c5c3_Err = mrState(p).Render(ctx, templ_7745c5c3_Buffer)
595			if templ_7745c5c3_Err != nil {
596				return templ_7745c5c3_Err
597			}
598			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 53, "<dt>branch</dt><dd>")
599			if templ_7745c5c3_Err != nil {
600				return templ_7745c5c3_Err
601			}
602			templ_7745c5c3_Err = branchLink(p.Source, p.SourceHref).Render(ctx, templ_7745c5c3_Buffer)
603			if templ_7745c5c3_Err != nil {
604				return templ_7745c5c3_Err
605			}
606			var templ_7745c5c3_Var28 string
607			templ_7745c5c3_Var28, templ_7745c5c3_Err = templ.JoinStringErrs(" → ")
608			if templ_7745c5c3_Err != nil {
609				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 126, Col: 15}
610			}
611			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var28))
612			if templ_7745c5c3_Err != nil {
613				return templ_7745c5c3_Err
614			}
615			templ_7745c5c3_Err = branchLink(p.Target, p.TargetHref).Render(ctx, templ_7745c5c3_Buffer)
616			if templ_7745c5c3_Err != nil {
617				return templ_7745c5c3_Err
618			}
619			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 54, "</dd><dt>opened</dt><dd>")
620			if templ_7745c5c3_Err != nil {
621				return templ_7745c5c3_Err
622			}
623			var templ_7745c5c3_Var29 string
624			templ_7745c5c3_Var29, templ_7745c5c3_Err = templ.JoinStringErrs(p.Opened.Name)
625			if templ_7745c5c3_Err != nil {
626				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 131, Col: 21}
627			}
628			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var29))
629			if templ_7745c5c3_Err != nil {
630				return templ_7745c5c3_Err
631			}
632			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 55, " ")
633			if templ_7745c5c3_Err != nil {
634				return templ_7745c5c3_Err
635			}
636			if p.Opened.WhenAt != "" {
637				var templ_7745c5c3_Var30 string
638				templ_7745c5c3_Var30, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
639				if templ_7745c5c3_Err != nil {
640					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 133, Col: 15}
641				}
642				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var30))
643				if templ_7745c5c3_Err != nil {
644					return templ_7745c5c3_Err
645				}
646				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 56, "<time datetime=\"")
647				if templ_7745c5c3_Err != nil {
648					return templ_7745c5c3_Err
649				}
650				var templ_7745c5c3_Var31 string
651				templ_7745c5c3_Var31, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Opened.WhenAt)
652				if templ_7745c5c3_Err != nil {
653					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 133, Col: 49}
654				}
655				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var31)
656				if templ_7745c5c3_Err != nil {
657					return templ_7745c5c3_Err
658				}
659				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "\" title=\"")
660				if templ_7745c5c3_Err != nil {
661					return templ_7745c5c3_Err
662				}
663				var templ_7745c5c3_Var32 string
664				templ_7745c5c3_Var32, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Opened.Abs)
665				if templ_7745c5c3_Err != nil {
666					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 133, Col: 72}
667				}
668				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var32)
669				if templ_7745c5c3_Err != nil {
670					return templ_7745c5c3_Err
671				}
672				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, "\">")
673				if templ_7745c5c3_Err != nil {
674					return templ_7745c5c3_Err
675				}
676				var templ_7745c5c3_Var33 string
677				templ_7745c5c3_Var33, templ_7745c5c3_Err = templ.JoinStringErrs(p.Opened.When)
678				if templ_7745c5c3_Err != nil {
679					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 133, Col: 90}
680				}
681				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var33))
682				if templ_7745c5c3_Err != nil {
683					return templ_7745c5c3_Err
684				}
685				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 59, "</time>")
686				if templ_7745c5c3_Err != nil {
687					return templ_7745c5c3_Err
688				}
689			}
690			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 60, "</dd>")
691			if templ_7745c5c3_Err != nil {
692				return templ_7745c5c3_Err
693			}
694			if p.UpdatedAt != "" {
695				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 61, "<dt>updated</dt><dd><time datetime=\"")
696				if templ_7745c5c3_Err != nil {
697					return templ_7745c5c3_Err
698				}
699				var templ_7745c5c3_Var34 string
700				templ_7745c5c3_Var34, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.UpdatedAt)
701				if templ_7745c5c3_Err != nil {
702					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 138, Col: 38}
703				}
704				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var34)
705				if templ_7745c5c3_Err != nil {
706					return templ_7745c5c3_Err
707				}
708				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 62, "\">")
709				if templ_7745c5c3_Err != nil {
710					return templ_7745c5c3_Err
711				}
712				var templ_7745c5c3_Var35 string
713				templ_7745c5c3_Var35, templ_7745c5c3_Err = templ.JoinStringErrs(p.Updated)
714				if templ_7745c5c3_Err != nil {
715					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 138, Col: 52}
716				}
717				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var35))
718				if templ_7745c5c3_Err != nil {
719					return templ_7745c5c3_Err
720				}
721				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 63, "</time></dd>")
722				if templ_7745c5c3_Err != nil {
723					return templ_7745c5c3_Err
724				}
725			}
726			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 64, "</dl></header>")
727			if templ_7745c5c3_Err != nil {
728				return templ_7745c5c3_Err
729			}
730			if p.Desc != "" {
731				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 65, "<article class=\"mr-desc prose\" aria-label=\"description\" hx-ignore>")
732				if templ_7745c5c3_Err != nil {
733					return templ_7745c5c3_Err
734				}
735				templ_7745c5c3_Err = templ.Raw(string(p.Desc)).Render(ctx, templ_7745c5c3_Buffer)
736				if templ_7745c5c3_Err != nil {
737					return templ_7745c5c3_Err
738				}
739				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 66, "</article>")
740				if templ_7745c5c3_Err != nil {
741					return templ_7745c5c3_Err
742				}
743			}
744			templ_7745c5c3_Err = mrFooter(p).Render(ctx, templ_7745c5c3_Buffer)
745			if templ_7745c5c3_Err != nil {
746				return templ_7745c5c3_Err
747			}
748			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 67, "</section>")
749			if templ_7745c5c3_Err != nil {
750				return templ_7745c5c3_Err
751			}
752			if p.Deleting != "" {
753				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 68, "<p class=\"note\" role=\"status\">merged. the branch ")
754				if templ_7745c5c3_Err != nil {
755					return templ_7745c5c3_Err
756				}
757				var templ_7745c5c3_Var36 string
758				templ_7745c5c3_Var36, templ_7745c5c3_Err = templ.JoinStringErrs(p.Deleting)
759				if templ_7745c5c3_Err != nil {
760					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 150, Col: 64}
761				}
762				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var36))
763				if templ_7745c5c3_Err != nil {
764					return templ_7745c5c3_Err
765				}
766				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 69, " is being deleted.</p>")
767				if templ_7745c5c3_Err != nil {
768					return templ_7745c5c3_Err
769				}
770			}
771			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 70, " ")
772			if templ_7745c5c3_Err != nil {
773				return templ_7745c5c3_Err
774			}
775			if p.MergeError != "" {
776				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 71, "<p class=\"d-err\" role=\"alert\">")
777				if templ_7745c5c3_Err != nil {
778					return templ_7745c5c3_Err
779				}
780				var templ_7745c5c3_Var37 string
781				templ_7745c5c3_Var37, templ_7745c5c3_Err = templ.JoinStringErrs(p.MergeError)
782				if templ_7745c5c3_Err != nil {
783					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 153, Col: 47}
784				}
785				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var37))
786				if templ_7745c5c3_Err != nil {
787					return templ_7745c5c3_Err
788				}
789				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 72, "</p>")
790				if templ_7745c5c3_Err != nil {
791					return templ_7745c5c3_Err
792				}
793			}
794			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 73, " ")
795			if templ_7745c5c3_Err != nil {
796				return templ_7745c5c3_Err
797			}
798			templ_7745c5c3_Err = LiveSlot("mr-notice").Render(ctx, templ_7745c5c3_Buffer)
799			if templ_7745c5c3_Err != nil {
800				return templ_7745c5c3_Err
801			}
802			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 74, " <div id=\"mr-refresh-status\" role=\"status\" aria-live=\"polite\"></div><div id=\"mr-range\"")
803			if templ_7745c5c3_Err != nil {
804				return templ_7745c5c3_Err
805			}
806			if p.Since == nil && p.SinceNote == "" {
807				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 75, " hidden")
808				if templ_7745c5c3_Err != nil {
809					return templ_7745c5c3_Err
810				}
811			}
812			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 76, ">")
813			if templ_7745c5c3_Err != nil {
814				return templ_7745c5c3_Err
815			}
816			if p.Since != nil {
817				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 77, "<nav class=\"since\" aria-label=\"Diff range\"><a href=\"")
818				if templ_7745c5c3_Err != nil {
819					return templ_7745c5c3_Err
820				}
821				var templ_7745c5c3_Var38 templ.SafeURL
822				templ_7745c5c3_Var38, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Since.AllHref))
823				if templ_7745c5c3_Err != nil {
824					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 161, Col: 43}
825				}
826				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var38))
827				if templ_7745c5c3_Err != nil {
828					return templ_7745c5c3_Err
829				}
830				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 78, "\"")
831				if templ_7745c5c3_Err != nil {
832					return templ_7745c5c3_Err
833				}
834				if !p.Since.Current {
835					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 79, " aria-current=\"page\"")
836					if templ_7745c5c3_Err != nil {
837						return templ_7745c5c3_Err
838					}
839				}
840				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 80, ">all changes <span class=\"mute\">vs ")
841				if templ_7745c5c3_Err != nil {
842					return templ_7745c5c3_Err
843				}
844				var templ_7745c5c3_Var39 string
845				templ_7745c5c3_Var39, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
846				if templ_7745c5c3_Err != nil {
847					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 165, Col: 50}
848				}
849				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var39))
850				if templ_7745c5c3_Err != nil {
851					return templ_7745c5c3_Err
852				}
853				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 81, "</span></a> <a href=\"")
854				if templ_7745c5c3_Err != nil {
855					return templ_7745c5c3_Err
856				}
857				var templ_7745c5c3_Var40 templ.SafeURL
858				templ_7745c5c3_Var40, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Since.SinceHref))
859				if templ_7745c5c3_Err != nil {
860					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 167, Col: 45}
861				}
862				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var40))
863				if templ_7745c5c3_Err != nil {
864					return templ_7745c5c3_Err
865				}
866				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 82, "\"")
867				if templ_7745c5c3_Err != nil {
868					return templ_7745c5c3_Err
869				}
870				if p.Since.Current {
871					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 83, " aria-current=\"page\"")
872					if templ_7745c5c3_Err != nil {
873						return templ_7745c5c3_Err
874					}
875				}
876				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 84, ">since your last read <span class=\"mute\">")
877				if templ_7745c5c3_Err != nil {
878					return templ_7745c5c3_Err
879				}
880				var templ_7745c5c3_Var41 string
881				templ_7745c5c3_Var41, templ_7745c5c3_Err = templ.JoinStringErrs(p.Since.ReadShort)
882				if templ_7745c5c3_Err != nil {
883					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 171, Col: 65}
884				}
885				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var41))
886				if templ_7745c5c3_Err != nil {
887					return templ_7745c5c3_Err
888				}
889				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 85, " → ")
890				if templ_7745c5c3_Err != nil {
891					return templ_7745c5c3_Err
892				}
893				var templ_7745c5c3_Var42 string
894				templ_7745c5c3_Var42, templ_7745c5c3_Err = templ.JoinStringErrs(p.Since.HeadShort)
895				if templ_7745c5c3_Err != nil {
896					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 171, Col: 91}
897				}
898				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var42))
899				if templ_7745c5c3_Err != nil {
900					return templ_7745c5c3_Err
901				}
902				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 86, "</span></a></nav>")
903				if templ_7745c5c3_Err != nil {
904					return templ_7745c5c3_Err
905				}
906			}
907			if p.SinceNote != "" {
908				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 87, "<p class=\"notice\">")
909				if templ_7745c5c3_Err != nil {
910					return templ_7745c5c3_Err
911				}
912				var templ_7745c5c3_Var43 string
913				templ_7745c5c3_Var43, templ_7745c5c3_Err = templ.JoinStringErrs(p.SinceNote)
914				if templ_7745c5c3_Err != nil {
915					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 175, Col: 35}
916				}
917				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var43))
918				if templ_7745c5c3_Err != nil {
919					return templ_7745c5c3_Err
920				}
921				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 88, "</p>")
922				if templ_7745c5c3_Err != nil {
923					return templ_7745c5c3_Err
924				}
925			}
926			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 89, "</div>")
927			if templ_7745c5c3_Err != nil {
928				return templ_7745c5c3_Err
929			}
930			templ_7745c5c3_Err = mrBar(p).Render(ctx, templ_7745c5c3_Buffer)
931			if templ_7745c5c3_Err != nil {
932				return templ_7745c5c3_Err
933			}
934			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 90, " <div id=\"mr-diff-notices\"")
935			if templ_7745c5c3_Err != nil {
936				return templ_7745c5c3_Err
937			}
938			if !p.Invisible && p.Note == "" {
939				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 91, " hidden")
940				if templ_7745c5c3_Err != nil {
941					return templ_7745c5c3_Err
942				}
943			}
944			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 92, ">")
945			if templ_7745c5c3_Err != nil {
946				return templ_7745c5c3_Err
947			}
948			if p.Invisible {
949				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 93, "<p class=\"notice\">this diff holds invisible characters (direction controls, zero-width characters). They are shown as <span class=\"inv\">&lt;U+XXXX&gt;</span> markers, never applied.</p>")
950				if templ_7745c5c3_Err != nil {
951					return templ_7745c5c3_Err
952				}
953			}
954			if p.Note != "" {
955				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 94, "<p class=\"notice\">")
956				if templ_7745c5c3_Err != nil {
957					return templ_7745c5c3_Err
958				}
959				var templ_7745c5c3_Var44 string
960				templ_7745c5c3_Var44, templ_7745c5c3_Err = templ.JoinStringErrs(p.Note)
961				if templ_7745c5c3_Err != nil {
962					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 187, Col: 30}
963				}
964				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var44))
965				if templ_7745c5c3_Err != nil {
966					return templ_7745c5c3_Err
967				}
968				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 95, "</p>")
969				if templ_7745c5c3_Err != nil {
970					return templ_7745c5c3_Err
971				}
972			}
973			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 96, "</div><div id=\"diffs\" data-mr")
974			if templ_7745c5c3_Err != nil {
975				return templ_7745c5c3_Err
976			}
977			if p.Canonical != "" {
978				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 97, " data-canonical=\"")
979				if templ_7745c5c3_Err != nil {
980					return templ_7745c5c3_Err
981				}
982				var templ_7745c5c3_Var45 string
983				templ_7745c5c3_Var45, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Canonical)
984				if templ_7745c5c3_Err != nil {
985					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 194, Col: 32}
986				}
987				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var45)
988				if templ_7745c5c3_Err != nil {
989					return templ_7745c5c3_Err
990				}
991				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 98, "\"")
992				if templ_7745c5c3_Err != nil {
993					return templ_7745c5c3_Err
994				}
995			}
996			if p.Both {
997				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 99, " data-diff=\"")
998				if templ_7745c5c3_Err != nil {
999					return templ_7745c5c3_Err
1000				}
1001				var templ_7745c5c3_Var46 string
1002				templ_7745c5c3_Var46, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
1003				if templ_7745c5c3_Err != nil {
1004					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 197, Col: 22}
1005				}
1006				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var46)
1007				if templ_7745c5c3_Err != nil {
1008					return templ_7745c5c3_Err
1009				}
1010				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 100, "\"")
1011				if templ_7745c5c3_Err != nil {
1012					return templ_7745c5c3_Err
1013				}
1014			} else {
1015				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 101, " data-view=\"")
1016				if templ_7745c5c3_Err != nil {
1017					return templ_7745c5c3_Err
1018				}
1019				var templ_7745c5c3_Var47 string
1020				templ_7745c5c3_Var47, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
1021				if templ_7745c5c3_Err != nil {
1022					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 199, Col: 22}
1023				}
1024				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var47)
1025				if templ_7745c5c3_Err != nil {
1026					return templ_7745c5c3_Err
1027				}
1028				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 102, "\"")
1029				if templ_7745c5c3_Err != nil {
1030					return templ_7745c5c3_Err
1031				}
1032			}
1033			if p.Both && !p.Pinned {
1034				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 103, " hx-live=\"this.dataset.diff = sessionStorage.getItem('diff') || this.dataset.diff\"")
1035				if templ_7745c5c3_Err != nil {
1036					return templ_7745c5c3_Err
1037				}
1038			}
1039			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 104, ">")
1040			if templ_7745c5c3_Err != nil {
1041				return templ_7745c5c3_Err
1042			}
1043			for _, f := range p.Files {
1044				templ_7745c5c3_Err = DiffFileView(f, p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
1045				if templ_7745c5c3_Err != nil {
1046					return templ_7745c5c3_Err
1047				}
1048			}
1049			if len(p.Files) == 0 {
1050				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 105, "<p class=\"note\">no changed files.</p>")
1051				if templ_7745c5c3_Err != nil {
1052					return templ_7745c5c3_Err
1053				}
1054			}
1055			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 106, "</div><div id=\"mr-comments\"><h2 class=\"rule-h\" id=\"comments\"><span>Comments</span><span class=\"count\">")
1056			if templ_7745c5c3_Err != nil {
1057				return templ_7745c5c3_Err
1058			}
1059			var templ_7745c5c3_Var48 string
1060			templ_7745c5c3_Var48, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.NUnresolved))
1061			if templ_7745c5c3_Err != nil {
1062				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 213, Col: 98}
1063			}
1064			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var48))
1065			if templ_7745c5c3_Err != nil {
1066				return templ_7745c5c3_Err
1067			}
1068			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 107, " open / ")
1069			if templ_7745c5c3_Err != nil {
1070				return templ_7745c5c3_Err
1071			}
1072			var templ_7745c5c3_Var49 string
1073			templ_7745c5c3_Var49, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.NComments))
1074			if templ_7745c5c3_Err != nil {
1075				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 213, Col: 127}
1076			}
1077			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var49))
1078			if templ_7745c5c3_Err != nil {
1079				return templ_7745c5c3_Err
1080			}
1081			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 108, "</span></h2>")
1082			if templ_7745c5c3_Err != nil {
1083				return templ_7745c5c3_Err
1084			}
1085			for _, c := range p.Loose {
1086				templ_7745c5c3_Err = commentView(c, "").Render(ctx, templ_7745c5c3_Buffer)
1087				if templ_7745c5c3_Err != nil {
1088					return templ_7745c5c3_Err
1089				}
1090			}
1091			for _, c := range p.General {
1092				templ_7745c5c3_Err = commentView(c, "").Render(ctx, templ_7745c5c3_Buffer)
1093				if templ_7745c5c3_Err != nil {
1094					return templ_7745c5c3_Err
1095				}
1096			}
1097			if p.NComments == 0 {
1098				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 109, "<p class=\"dim\">no comments yet.</p>")
1099				if templ_7745c5c3_Err != nil {
1100					return templ_7745c5c3_Err
1101				}
1102			}
1103			if p.GeneralForm != nil {
1104				templ_7745c5c3_Err = commentForm(*p.GeneralForm, "").Render(ctx, templ_7745c5c3_Buffer)
1105				if templ_7745c5c3_Err != nil {
1106					return templ_7745c5c3_Err
1107				}
1108			}
1109			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 110, "</div>")
1110			if templ_7745c5c3_Err != nil {
1111				return templ_7745c5c3_Err
1112			}
1113			return nil
1114		})
1115		templ_7745c5c3_Err = Shell(l, mrRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var25), templ_7745c5c3_Buffer)
1116		if templ_7745c5c3_Err != nil {
1117			return templ_7745c5c3_Err
1118		}
1119		return nil
1120	})
1121}
1122
1123func branchLink(name, href string) templ.Component {
1124	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1125		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1126		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1127			return templ_7745c5c3_CtxErr
1128		}
1129		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1130		if !templ_7745c5c3_IsBuffer {
1131			defer func() {
1132				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1133				if templ_7745c5c3_Err == nil {
1134					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1135				}
1136			}()
1137		}
1138		ctx = templ.InitializeContext(ctx)
1139		templ_7745c5c3_Var50 := templ.GetChildren(ctx)
1140		if templ_7745c5c3_Var50 == nil {
1141			templ_7745c5c3_Var50 = templ.NopComponent
1142		}
1143		ctx = templ.ClearChildren(ctx)
1144		if href != "" {
1145			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 111, "<a href=\"")
1146			if templ_7745c5c3_Err != nil {
1147				return templ_7745c5c3_Err
1148			}
1149			var templ_7745c5c3_Var51 templ.SafeURL
1150			templ_7745c5c3_Var51, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(href))
1151			if templ_7745c5c3_Err != nil {
1152				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 232, Col: 31}
1153			}
1154			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var51))
1155			if templ_7745c5c3_Err != nil {
1156				return templ_7745c5c3_Err
1157			}
1158			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 112, "\">")
1159			if templ_7745c5c3_Err != nil {
1160				return templ_7745c5c3_Err
1161			}
1162			var templ_7745c5c3_Var52 string
1163			templ_7745c5c3_Var52, templ_7745c5c3_Err = templ.JoinStringErrs(name)
1164			if templ_7745c5c3_Err != nil {
1165				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 232, Col: 40}
1166			}
1167			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var52))
1168			if templ_7745c5c3_Err != nil {
1169				return templ_7745c5c3_Err
1170			}
1171			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 113, "</a>")
1172			if templ_7745c5c3_Err != nil {
1173				return templ_7745c5c3_Err
1174			}
1175		} else {
1176			var templ_7745c5c3_Var53 string
1177			templ_7745c5c3_Var53, templ_7745c5c3_Err = templ.JoinStringErrs(name)
1178			if templ_7745c5c3_Err != nil {
1179				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 234, Col: 8}
1180			}
1181			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var53))
1182			if templ_7745c5c3_Err != nil {
1183				return templ_7745c5c3_Err
1184			}
1185		}
1186		return nil
1187	})
1188}
1189
1190// lineNotes are the comments under a line of the diff, and the form to write
1191// one when the reader asked for it. The diff is in the page twice (unified and
1192// split); the suffix keeps the ids unique, the unified table having none.
1193func lineNotes(notes []CommentView, form *CommentForm, suffix string) templ.Component {
1194	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1195		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1196		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1197			return templ_7745c5c3_CtxErr
1198		}
1199		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1200		if !templ_7745c5c3_IsBuffer {
1201			defer func() {
1202				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1203				if templ_7745c5c3_Err == nil {
1204					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1205				}
1206			}()
1207		}
1208		ctx = templ.InitializeContext(ctx)
1209		templ_7745c5c3_Var54 := templ.GetChildren(ctx)
1210		if templ_7745c5c3_Var54 == nil {
1211			templ_7745c5c3_Var54 = templ.NopComponent
1212		}
1213		ctx = templ.ClearChildren(ctx)
1214		for _, c := range notes {
1215			templ_7745c5c3_Err = commentView(c, suffix).Render(ctx, templ_7745c5c3_Buffer)
1216			if templ_7745c5c3_Err != nil {
1217				return templ_7745c5c3_Err
1218			}
1219		}
1220		if form != nil {
1221			templ_7745c5c3_Err = commentForm(*form, suffix).Render(ctx, templ_7745c5c3_Buffer)
1222			if templ_7745c5c3_Err != nil {
1223				return templ_7745c5c3_Err
1224			}
1225		}
1226		return nil
1227	})
1228}
1229
1230// commentView is a note: a ruled block, under its line in the diff or in the
1231// list of comments. Body comes only from the safe Markdown renderer.
1232func commentView(c CommentView, suffix string) templ.Component {
1233	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1234		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1235		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1236			return templ_7745c5c3_CtxErr
1237		}
1238		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1239		if !templ_7745c5c3_IsBuffer {
1240			defer func() {
1241				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1242				if templ_7745c5c3_Err == nil {
1243					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1244				}
1245			}()
1246		}
1247		ctx = templ.InitializeContext(ctx)
1248		templ_7745c5c3_Var55 := templ.GetChildren(ctx)
1249		if templ_7745c5c3_Var55 == nil {
1250			templ_7745c5c3_Var55 = templ.NopComponent
1251		}
1252		ctx = templ.ClearChildren(ctx)
1253		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 114, "<div class=\"cmt\" id=\"")
1254		if templ_7745c5c3_Err != nil {
1255			return templ_7745c5c3_Err
1256		}
1257		var templ_7745c5c3_Var56 string
1258		templ_7745c5c3_Var56, templ_7745c5c3_Err = templ.ResolveAttributeValue("c" + c.ID + suffix)
1259		if templ_7745c5c3_Err != nil {
1260			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 253, Col: 42}
1261		}
1262		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var56)
1263		if templ_7745c5c3_Err != nil {
1264			return templ_7745c5c3_Err
1265		}
1266		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 115, "\" data-resolved=\"")
1267		if templ_7745c5c3_Err != nil {
1268			return templ_7745c5c3_Err
1269		}
1270		var templ_7745c5c3_Var57 string
1271		templ_7745c5c3_Var57, templ_7745c5c3_Err = templ.ResolveAttributeValue(boolText(c.Resolved))
1272		if templ_7745c5c3_Err != nil {
1273			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 253, Col: 81}
1274		}
1275		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var57)
1276		if templ_7745c5c3_Err != nil {
1277			return templ_7745c5c3_Err
1278		}
1279		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 116, "\"")
1280		if templ_7745c5c3_Err != nil {
1281			return templ_7745c5c3_Err
1282		}
1283		if c.Reply != nil {
1284			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 117, " data-thread")
1285			if templ_7745c5c3_Err != nil {
1286				return templ_7745c5c3_Err
1287			}
1288		}
1289		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 118, "><p class=\"c-head\"><span class=\"c-who\">")
1290		if templ_7745c5c3_Err != nil {
1291			return templ_7745c5c3_Err
1292		}
1293		var templ_7745c5c3_Var58 string
1294		templ_7745c5c3_Var58, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
1295		if templ_7745c5c3_Err != nil {
1296			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 255, Col: 33}
1297		}
1298		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var58))
1299		if templ_7745c5c3_Err != nil {
1300			return templ_7745c5c3_Err
1301		}
1302		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 119, "</span> ")
1303		if templ_7745c5c3_Err != nil {
1304			return templ_7745c5c3_Err
1305		}
1306		if c.WhenAt != "" {
1307			var templ_7745c5c3_Var59 string
1308			templ_7745c5c3_Var59, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
1309			if templ_7745c5c3_Err != nil {
1310				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 257, Col: 9}
1311			}
1312			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var59))
1313			if templ_7745c5c3_Err != nil {
1314				return templ_7745c5c3_Err
1315			}
1316			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 120, "<time class=\"mute\" datetime=\"")
1317			if templ_7745c5c3_Err != nil {
1318				return templ_7745c5c3_Err
1319			}
1320			var templ_7745c5c3_Var60 string
1321			templ_7745c5c3_Var60, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
1322			if templ_7745c5c3_Err != nil {
1323				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 257, Col: 49}
1324			}
1325			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var60)
1326			if templ_7745c5c3_Err != nil {
1327				return templ_7745c5c3_Err
1328			}
1329			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 121, "\" title=\"")
1330			if templ_7745c5c3_Err != nil {
1331				return templ_7745c5c3_Err
1332			}
1333			var templ_7745c5c3_Var61 string
1334			templ_7745c5c3_Var61, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.Abs)
1335			if templ_7745c5c3_Err != nil {
1336				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 257, Col: 65}
1337			}
1338			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var61)
1339			if templ_7745c5c3_Err != nil {
1340				return templ_7745c5c3_Err
1341			}
1342			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 122, "\">")
1343			if templ_7745c5c3_Err != nil {
1344				return templ_7745c5c3_Err
1345			}
1346			var templ_7745c5c3_Var62 string
1347			templ_7745c5c3_Var62, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
1348			if templ_7745c5c3_Err != nil {
1349				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 257, Col: 76}
1350			}
1351			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var62))
1352			if templ_7745c5c3_Err != nil {
1353				return templ_7745c5c3_Err
1354			}
1355			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 123, "</time> ")
1356			if templ_7745c5c3_Err != nil {
1357				return templ_7745c5c3_Err
1358			}
1359		}
1360		if c.Resolved {
1361			var templ_7745c5c3_Var63 string
1362			templ_7745c5c3_Var63, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
1363			if templ_7745c5c3_Err != nil {
1364				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 260, Col: 9}
1365			}
1366			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var63))
1367			if templ_7745c5c3_Err != nil {
1368				return templ_7745c5c3_Err
1369			}
1370			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 124, "<span class=\"c-state\">resolved</span> ")
1371			if templ_7745c5c3_Err != nil {
1372				return templ_7745c5c3_Err
1373			}
1374		}
1375		if c.Outdated {
1376			var templ_7745c5c3_Var64 string
1377			templ_7745c5c3_Var64, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
1378			if templ_7745c5c3_Err != nil {
1379				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 263, Col: 9}
1380			}
1381			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var64))
1382			if templ_7745c5c3_Err != nil {
1383				return templ_7745c5c3_Err
1384			}
1385			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 125, "<span class=\"c-state\" title=\"written on an earlier head; the line may have moved\">outdated</span> ")
1386			if templ_7745c5c3_Err != nil {
1387				return templ_7745c5c3_Err
1388			}
1389		}
1390		if c.Where != "" {
1391			var templ_7745c5c3_Var65 string
1392			templ_7745c5c3_Var65, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
1393			if templ_7745c5c3_Err != nil {
1394				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 266, Col: 9}
1395			}
1396			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var65))
1397			if templ_7745c5c3_Err != nil {
1398				return templ_7745c5c3_Err
1399			}
1400			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 126, "<span class=\"c-where mute\">")
1401			if templ_7745c5c3_Err != nil {
1402				return templ_7745c5c3_Err
1403			}
1404			var templ_7745c5c3_Var66 string
1405			templ_7745c5c3_Var66, templ_7745c5c3_Err = templ.JoinStringErrs(c.Where)
1406			if templ_7745c5c3_Err != nil {
1407				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 266, Col: 47}
1408			}
1409			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var66))
1410			if templ_7745c5c3_Err != nil {
1411				return templ_7745c5c3_Err
1412			}
1413			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 127, "</span>")
1414			if templ_7745c5c3_Err != nil {
1415				return templ_7745c5c3_Err
1416			}
1417		}
1418		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 128, "</p>")
1419		if templ_7745c5c3_Err != nil {
1420			return templ_7745c5c3_Err
1421		}
1422		if len(c.Parts) > 0 {
1423			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 129, "<p class=\"c-text\">")
1424			if templ_7745c5c3_Err != nil {
1425				return templ_7745c5c3_Err
1426			}
1427			templ_7745c5c3_Err = userText(c.Parts).Render(ctx, templ_7745c5c3_Buffer)
1428			if templ_7745c5c3_Err != nil {
1429				return templ_7745c5c3_Err
1430			}
1431			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 130, "</p>")
1432			if templ_7745c5c3_Err != nil {
1433				return templ_7745c5c3_Err
1434			}
1435		} else if c.Deleted {
1436			if c.Verdict != "" {
1437				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 131, "<p class=\"mute\">text deleted</p>")
1438				if templ_7745c5c3_Err != nil {
1439					return templ_7745c5c3_Err
1440				}
1441			} else {
1442				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 132, "<p class=\"mute\">deleted note</p>")
1443				if templ_7745c5c3_Err != nil {
1444					return templ_7745c5c3_Err
1445				}
1446			}
1447		} else {
1448			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 133, "<div class=\"c-body prose\">")
1449			if templ_7745c5c3_Err != nil {
1450				return templ_7745c5c3_Err
1451			}
1452			if suffix == "-s" {
1453				templ_7745c5c3_Err = templ.Raw(string(c.BodySplit)).Render(ctx, templ_7745c5c3_Buffer)
1454				if templ_7745c5c3_Err != nil {
1455					return templ_7745c5c3_Err
1456				}
1457			} else {
1458				templ_7745c5c3_Err = templ.Raw(string(c.Body)).Render(ctx, templ_7745c5c3_Buffer)
1459				if templ_7745c5c3_Err != nil {
1460					return templ_7745c5c3_Err
1461				}
1462			}
1463			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 134, "</div>")
1464			if templ_7745c5c3_Err != nil {
1465				return templ_7745c5c3_Err
1466			}
1467		}
1468		if c.Edited {
1469			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 135, "<span class=\"mute\">edited</span> ")
1470			if templ_7745c5c3_Err != nil {
1471				return templ_7745c5c3_Err
1472			}
1473		}
1474		if c.Verdict != "" {
1475			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 136, "<span class=\"c-state\">")
1476			if templ_7745c5c3_Err != nil {
1477				return templ_7745c5c3_Err
1478			}
1479			var templ_7745c5c3_Var67 string
1480			templ_7745c5c3_Var67, templ_7745c5c3_Err = templ.JoinStringErrs(c.Verdict)
1481			if templ_7745c5c3_Err != nil {
1482				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 290, Col: 36}
1483			}
1484			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var67))
1485			if templ_7745c5c3_Err != nil {
1486				return templ_7745c5c3_Err
1487			}
1488			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 137, "</span> ")
1489			if templ_7745c5c3_Err != nil {
1490				return templ_7745c5c3_Err
1491			}
1492		}
1493		if c.Range != "" {
1494			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 138, "<span class=\"mute\">")
1495			if templ_7745c5c3_Err != nil {
1496				return templ_7745c5c3_Err
1497			}
1498			var templ_7745c5c3_Var68 string
1499			templ_7745c5c3_Var68, templ_7745c5c3_Err = templ.JoinStringErrs(c.Range)
1500			if templ_7745c5c3_Err != nil {
1501				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 293, Col: 31}
1502			}
1503			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var68))
1504			if templ_7745c5c3_Err != nil {
1505				return templ_7745c5c3_Err
1506			}
1507			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 139, "</span> ")
1508			if templ_7745c5c3_Err != nil {
1509				return templ_7745c5c3_Err
1510			}
1511		}
1512		if c.Quote != "" {
1513			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 140, "<button type=\"button\" class=\"btn\" data-js data-quote=\"")
1514			if templ_7745c5c3_Err != nil {
1515				return templ_7745c5c3_Err
1516			}
1517			var templ_7745c5c3_Var69 string
1518			templ_7745c5c3_Var69, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.Quote)
1519			if templ_7745c5c3_Err != nil {
1520				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 296, Col: 65}
1521			}
1522			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var69)
1523			if templ_7745c5c3_Err != nil {
1524				return templ_7745c5c3_Err
1525			}
1526			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 141, "\">Quote</button> ")
1527			if templ_7745c5c3_Err != nil {
1528				return templ_7745c5c3_Err
1529			}
1530		}
1531		if c.Edit != nil {
1532			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 142, "<details><summary>Edit</summary><form method=\"post\" action=\"")
1533			if templ_7745c5c3_Err != nil {
1534				return templ_7745c5c3_Err
1535			}
1536			var templ_7745c5c3_Var70 templ.SafeURL
1537			templ_7745c5c3_Var70, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Edit.Action))
1538			if templ_7745c5c3_Err != nil {
1539				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 299, Col: 92}
1540			}
1541			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var70))
1542			if templ_7745c5c3_Err != nil {
1543				return templ_7745c5c3_Err
1544			}
1545			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 143, "\"><input type=\"hidden\" name=\"from\" value=\"")
1546			if templ_7745c5c3_Err != nil {
1547				return templ_7745c5c3_Err
1548			}
1549			var templ_7745c5c3_Var71 string
1550			templ_7745c5c3_Var71, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(c.Edit.From))
1551			if templ_7745c5c3_Err != nil {
1552				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 299, Col: 153}
1553			}
1554			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var71)
1555			if templ_7745c5c3_Err != nil {
1556				return templ_7745c5c3_Err
1557			}
1558			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 144, "\"><textarea name=\"text\" maxlength=\"8000\" aria-label=\"Edit note\">")
1559			if templ_7745c5c3_Err != nil {
1560				return templ_7745c5c3_Err
1561			}
1562			var templ_7745c5c3_Var72 string
1563			templ_7745c5c3_Var72, templ_7745c5c3_Err = templ.JoinStringErrs(c.Edit.Text)
1564			if templ_7745c5c3_Err != nil {
1565				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 299, Col: 232}
1566			}
1567			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var72))
1568			if templ_7745c5c3_Err != nil {
1569				return templ_7745c5c3_Err
1570			}
1571			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 145, "</textarea><button class=\"btn\" type=\"submit\">Save</button></form></details> ")
1572			if templ_7745c5c3_Err != nil {
1573				return templ_7745c5c3_Err
1574			}
1575		}
1576		if c.Delete != nil {
1577			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 146, "<details><summary>Delete</summary><form method=\"post\" action=\"")
1578			if templ_7745c5c3_Err != nil {
1579				return templ_7745c5c3_Err
1580			}
1581			var templ_7745c5c3_Var73 templ.SafeURL
1582			templ_7745c5c3_Var73, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Delete.Action))
1583			if templ_7745c5c3_Err != nil {
1584				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 302, Col: 96}
1585			}
1586			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var73))
1587			if templ_7745c5c3_Err != nil {
1588				return templ_7745c5c3_Err
1589			}
1590			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 147, "\"><input type=\"hidden\" name=\"from\" value=\"")
1591			if templ_7745c5c3_Err != nil {
1592				return templ_7745c5c3_Err
1593			}
1594			var templ_7745c5c3_Var74 string
1595			templ_7745c5c3_Var74, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(c.Delete.From))
1596			if templ_7745c5c3_Err != nil {
1597				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 302, Col: 159}
1598			}
1599			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var74)
1600			if templ_7745c5c3_Err != nil {
1601				return templ_7745c5c3_Err
1602			}
1603			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 148, "\"><p>Delete this note?</p><button class=\"btn\" type=\"submit\">Confirm delete</button></form></details> ")
1604			if templ_7745c5c3_Err != nil {
1605				return templ_7745c5c3_Err
1606			}
1607		}
1608		for _, reply := range c.Replies {
1609			templ_7745c5c3_Err = commentView(reply, suffix).Render(ctx, templ_7745c5c3_Buffer)
1610			if templ_7745c5c3_Err != nil {
1611				return templ_7745c5c3_Err
1612			}
1613		}
1614		if c.Reply != nil {
1615			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 149, "<details data-reply><summary>Reply</summary>")
1616			if templ_7745c5c3_Err != nil {
1617				return templ_7745c5c3_Err
1618			}
1619			templ_7745c5c3_Err = commentForm(*c.Reply, suffix).Render(ctx, templ_7745c5c3_Buffer)
1620			if templ_7745c5c3_Err != nil {
1621				return templ_7745c5c3_Err
1622			}
1623			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 150, "</details> ")
1624			if templ_7745c5c3_Err != nil {
1625				return templ_7745c5c3_Err
1626			}
1627		}
1628		if c.Resolve != nil {
1629			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 151, "<form class=\"c-act\" method=\"post\" action=\"")
1630			if templ_7745c5c3_Err != nil {
1631				return templ_7745c5c3_Err
1632			}
1633			var templ_7745c5c3_Var75 templ.SafeURL
1634			templ_7745c5c3_Var75, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Resolve.Action))
1635			if templ_7745c5c3_Err != nil {
1636				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 313, Col: 77}
1637			}
1638			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var75))
1639			if templ_7745c5c3_Err != nil {
1640				return templ_7745c5c3_Err
1641			}
1642			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 152, "\"><input type=\"hidden\" name=\"resolved\" value=\"")
1643			if templ_7745c5c3_Err != nil {
1644				return templ_7745c5c3_Err
1645			}
1646			var templ_7745c5c3_Var76 string
1647			templ_7745c5c3_Var76, templ_7745c5c3_Err = templ.ResolveAttributeValue(boolText(c.Resolve.Value))
1648			if templ_7745c5c3_Err != nil {
1649				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 314, Col: 74}
1650			}
1651			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var76)
1652			if templ_7745c5c3_Err != nil {
1653				return templ_7745c5c3_Err
1654			}
1655			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 153, "\"> ")
1656			if templ_7745c5c3_Err != nil {
1657				return templ_7745c5c3_Err
1658			}
1659			if c.Resolve.From > 0 {
1660				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 154, "<input type=\"hidden\" name=\"from\" value=\"")
1661				if templ_7745c5c3_Err != nil {
1662					return templ_7745c5c3_Err
1663				}
1664				var templ_7745c5c3_Var77 string
1665				templ_7745c5c3_Var77, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(c.Resolve.From))
1666				if templ_7745c5c3_Err != nil {
1667					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 316, Col: 66}
1668				}
1669				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var77)
1670				if templ_7745c5c3_Err != nil {
1671					return templ_7745c5c3_Err
1672				}
1673				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 155, "\"> ")
1674				if templ_7745c5c3_Err != nil {
1675					return templ_7745c5c3_Err
1676				}
1677			}
1678			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 156, "<button type=\"submit\" class=\"btn\">")
1679			if templ_7745c5c3_Err != nil {
1680				return templ_7745c5c3_Err
1681			}
1682			var templ_7745c5c3_Var78 string
1683			templ_7745c5c3_Var78, templ_7745c5c3_Err = templ.JoinStringErrs(c.Resolve.Label)
1684			if templ_7745c5c3_Err != nil {
1685				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 318, Col: 55}
1686			}
1687			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var78))
1688			if templ_7745c5c3_Err != nil {
1689				return templ_7745c5c3_Err
1690			}
1691			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 157, "</button></form>")
1692			if templ_7745c5c3_Err != nil {
1693				return templ_7745c5c3_Err
1694			}
1695		}
1696		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 158, "</div>")
1697		if templ_7745c5c3_Err != nil {
1698			return templ_7745c5c3_Err
1699		}
1700		return nil
1701	})
1702}
1703
1704func boolText(b bool) string {
1705	if b {
1706		return "true"
1707	}
1708	return "false"
1709}
1710
1711// commentForm writes a comment, general or on a line.
1712func commentForm(f CommentForm, suffix string) templ.Component {
1713	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1714		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1715		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1716			return templ_7745c5c3_CtxErr
1717		}
1718		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1719		if !templ_7745c5c3_IsBuffer {
1720			defer func() {
1721				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1722				if templ_7745c5c3_Err == nil {
1723					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1724				}
1725			}()
1726		}
1727		ctx = templ.InitializeContext(ctx)
1728		templ_7745c5c3_Var79 := templ.GetChildren(ctx)
1729		if templ_7745c5c3_Var79 == nil {
1730			templ_7745c5c3_Var79 = templ.NopComponent
1731		}
1732		ctx = templ.ClearChildren(ctx)
1733		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 159, "<form class=\"cform\" method=\"post\" action=\"")
1734		if templ_7745c5c3_Err != nil {
1735			return templ_7745c5c3_Err
1736		}
1737		var templ_7745c5c3_Var80 templ.SafeURL
1738		templ_7745c5c3_Var80, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(f.Action))
1739		if templ_7745c5c3_Err != nil {
1740			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 333, Col: 67}
1741		}
1742		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var80))
1743		if templ_7745c5c3_Err != nil {
1744			return templ_7745c5c3_Err
1745		}
1746		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 160, "\"><label for=\"")
1747		if templ_7745c5c3_Err != nil {
1748			return templ_7745c5c3_Err
1749		}
1750		var templ_7745c5c3_Var81 string
1751		templ_7745c5c3_Var81, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.ID + suffix)
1752		if templ_7745c5c3_Err != nil {
1753			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 334, Col: 28}
1754		}
1755		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var81)
1756		if templ_7745c5c3_Err != nil {
1757			return templ_7745c5c3_Err
1758		}
1759		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 161, "\">")
1760		if templ_7745c5c3_Err != nil {
1761			return templ_7745c5c3_Err
1762		}
1763		var templ_7745c5c3_Var82 string
1764		templ_7745c5c3_Var82, templ_7745c5c3_Err = templ.JoinStringErrs(f.Title)
1765		if templ_7745c5c3_Err != nil {
1766			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 334, Col: 40}
1767		}
1768		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var82))
1769		if templ_7745c5c3_Err != nil {
1770			return templ_7745c5c3_Err
1771		}
1772		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 162, "</label> <textarea id=\"")
1773		if templ_7745c5c3_Err != nil {
1774			return templ_7745c5c3_Err
1775		}
1776		var templ_7745c5c3_Var83 string
1777		templ_7745c5c3_Var83, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.ID + suffix)
1778		if templ_7745c5c3_Err != nil {
1779			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 336, Col: 21}
1780		}
1781		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var83)
1782		if templ_7745c5c3_Err != nil {
1783			return templ_7745c5c3_Err
1784		}
1785		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 163, "\" name=\"text\" rows=\"3\" maxlength=\"8000\"")
1786		if templ_7745c5c3_Err != nil {
1787			return templ_7745c5c3_Err
1788		}
1789		if f.Plain {
1790			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 164, " required placeholder=\"plain text, 8000 characters at most\"")
1791			if templ_7745c5c3_Err != nil {
1792				return templ_7745c5c3_Err
1793			}
1794		} else {
1795			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 165, " placeholder=\"Markdown, 8000 characters at most\"")
1796			if templ_7745c5c3_Err != nil {
1797				return templ_7745c5c3_Err
1798			}
1799		}
1800		if f.Focus {
1801			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 166, " autofocus")
1802			if templ_7745c5c3_Err != nil {
1803				return templ_7745c5c3_Err
1804			}
1805		}
1806		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 167, "></textarea> ")
1807		if templ_7745c5c3_Err != nil {
1808			return templ_7745c5c3_Err
1809		}
1810		if f.Path != "" {
1811			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 168, "<input type=\"hidden\" name=\"path\" value=\"")
1812			if templ_7745c5c3_Err != nil {
1813				return templ_7745c5c3_Err
1814			}
1815			var templ_7745c5c3_Var84 string
1816			templ_7745c5c3_Var84, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.Path)
1817			if templ_7745c5c3_Err != nil {
1818				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 351, Col: 50}
1819			}
1820			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var84)
1821			if templ_7745c5c3_Err != nil {
1822				return templ_7745c5c3_Err
1823			}
1824			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 169, "\"> <input type=\"hidden\" name=\"line\" value=\"")
1825			if templ_7745c5c3_Err != nil {
1826				return templ_7745c5c3_Err
1827			}
1828			var templ_7745c5c3_Var85 string
1829			templ_7745c5c3_Var85, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.Line)
1830			if templ_7745c5c3_Err != nil {
1831				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 352, Col: 50}
1832			}
1833			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var85)
1834			if templ_7745c5c3_Err != nil {
1835				return templ_7745c5c3_Err
1836			}
1837			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 170, "\"> <input type=\"hidden\" name=\"side\" value=\"")
1838			if templ_7745c5c3_Err != nil {
1839				return templ_7745c5c3_Err
1840			}
1841			var templ_7745c5c3_Var86 string
1842			templ_7745c5c3_Var86, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.Side)
1843			if templ_7745c5c3_Err != nil {
1844				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 353, Col: 50}
1845			}
1846			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var86)
1847			if templ_7745c5c3_Err != nil {
1848				return templ_7745c5c3_Err
1849			}
1850			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 171, "\"> <label>from line <input type=\"number\" name=\"start_line\" min=\"1\" value=\"")
1851			if templ_7745c5c3_Err != nil {
1852				return templ_7745c5c3_Err
1853			}
1854			var templ_7745c5c3_Var87 string
1855			templ_7745c5c3_Var87, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.StartLine)
1856			if templ_7745c5c3_Err != nil {
1857				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 354, Col: 86}
1858			}
1859			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var87)
1860			if templ_7745c5c3_Err != nil {
1861				return templ_7745c5c3_Err
1862			}
1863			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 172, "\"></label> ")
1864			if templ_7745c5c3_Err != nil {
1865				return templ_7745c5c3_Err
1866			}
1867		}
1868		if f.ReplyTo != "" {
1869			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 173, "<input type=\"hidden\" name=\"reply_to\" value=\"")
1870			if templ_7745c5c3_Err != nil {
1871				return templ_7745c5c3_Err
1872			}
1873			var templ_7745c5c3_Var88 string
1874			templ_7745c5c3_Var88, templ_7745c5c3_Err = templ.ResolveAttributeValue(f.ReplyTo)
1875			if templ_7745c5c3_Err != nil {
1876				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 357, Col: 57}
1877			}
1878			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var88)
1879			if templ_7745c5c3_Err != nil {
1880				return templ_7745c5c3_Err
1881			}
1882			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 174, "\"> ")
1883			if templ_7745c5c3_Err != nil {
1884				return templ_7745c5c3_Err
1885			}
1886		}
1887		if f.Path == "" && f.ReplyTo == "" && !f.Plain {
1888			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 175, "<fieldset><legend>Verdict</legend><label><input type=\"radio\" name=\"verdict\" value=\"\" checked>Note</label><label><input type=\"radio\" name=\"verdict\" value=\"approve\">Approve</label><label><input type=\"radio\" name=\"verdict\" value=\"changes_requested\">Request changes</label></fieldset>")
1889			if templ_7745c5c3_Err != nil {
1890				return templ_7745c5c3_Err
1891			}
1892		}
1893		if f.From > 0 {
1894			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 176, "<input type=\"hidden\" name=\"from\" value=\"")
1895			if templ_7745c5c3_Err != nil {
1896				return templ_7745c5c3_Err
1897			}
1898			var templ_7745c5c3_Var89 string
1899			templ_7745c5c3_Var89, templ_7745c5c3_Err = templ.ResolveAttributeValue(itoa(f.From))
1900			if templ_7745c5c3_Err != nil {
1901				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 363, Col: 56}
1902			}
1903			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var89)
1904			if templ_7745c5c3_Err != nil {
1905				return templ_7745c5c3_Err
1906			}
1907			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 177, "\">")
1908			if templ_7745c5c3_Err != nil {
1909				return templ_7745c5c3_Err
1910			}
1911		}
1912		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 178, "<div class=\"f-btns\"><button type=\"submit\" class=\"btn primary\">Comment</button> ")
1913		if templ_7745c5c3_Err != nil {
1914			return templ_7745c5c3_Err
1915		}
1916		if f.Cancel != "" {
1917			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 179, "<a class=\"btn\" href=\"")
1918			if templ_7745c5c3_Err != nil {
1919				return templ_7745c5c3_Err
1920			}
1921			var templ_7745c5c3_Var90 templ.SafeURL
1922			templ_7745c5c3_Var90, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(f.Cancel))
1923			if templ_7745c5c3_Err != nil {
1924				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 368, Col: 49}
1925			}
1926			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var90))
1927			if templ_7745c5c3_Err != nil {
1928				return templ_7745c5c3_Err
1929			}
1930			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 180, "\">Cancel</a>")
1931			if templ_7745c5c3_Err != nil {
1932				return templ_7745c5c3_Err
1933			}
1934		}
1935		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 181, "</div></form>")
1936		if templ_7745c5c3_Err != nil {
1937			return templ_7745c5c3_Err
1938		}
1939		return nil
1940	})
1941}
1942
1943func mrFooter(p MRPage) templ.Component {
1944	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
1945		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
1946		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
1947			return templ_7745c5c3_CtxErr
1948		}
1949		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
1950		if !templ_7745c5c3_IsBuffer {
1951			defer func() {
1952				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
1953				if templ_7745c5c3_Err == nil {
1954					templ_7745c5c3_Err = templ_7745c5c3_BufErr
1955				}
1956			}()
1957		}
1958		ctx = templ.InitializeContext(ctx)
1959		templ_7745c5c3_Var91 := templ.GetChildren(ctx)
1960		if templ_7745c5c3_Var91 == nil {
1961			templ_7745c5c3_Var91 = templ.NopComponent
1962		}
1963		ctx = templ.ClearChildren(ctx)
1964		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 182, "<footer class=\"mr-footer\"><div data-mr-tabs data-js role=\"group\" aria-label=\"Branch details\"><button type=\"button\" id=\"mr-tab-commits\" aria-expanded=\"true\" aria-controls=\"mr-commits\">Commits <span class=\"count\">")
1965		if templ_7745c5c3_Err != nil {
1966			return templ_7745c5c3_Err
1967		}
1968		var templ_7745c5c3_Var92 string
1969		templ_7745c5c3_Var92, templ_7745c5c3_Err = templ.JoinStringErrs(p.CommitCount)
1970		if templ_7745c5c3_Err != nil {
1971			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 377, Col: 136}
1972		}
1973		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var92))
1974		if templ_7745c5c3_Err != nil {
1975			return templ_7745c5c3_Err
1976		}
1977		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 183, "</span></button> <button type=\"button\" id=\"mr-tab-checks\" aria-expanded=\"true\" aria-controls=\"mr-checks-panel\">")
1978		if templ_7745c5c3_Err != nil {
1979			return templ_7745c5c3_Err
1980		}
1981		var templ_7745c5c3_Var93 string
1982		templ_7745c5c3_Var93, templ_7745c5c3_Err = templ.JoinStringErrs("Checks ")
1983		if templ_7745c5c3_Err != nil {
1984			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 379, Col: 15}
1985		}
1986		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var93))
1987		if templ_7745c5c3_Err != nil {
1988			return templ_7745c5c3_Err
1989		}
1990		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 184, " <span data-checks-label>")
1991		if templ_7745c5c3_Err != nil {
1992			return templ_7745c5c3_Err
1993		}
1994		if p.ChecksSum.Total > 0 {
1995			var templ_7745c5c3_Var94 string
1996			templ_7745c5c3_Var94, templ_7745c5c3_Err = templ.JoinStringErrs(p.ChecksSum.Title)
1997			if templ_7745c5c3_Err != nil {
1998				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 382, Col: 25}
1999			}
2000			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var94))
2001			if templ_7745c5c3_Err != nil {
2002				return templ_7745c5c3_Err
2003			}
2004		} else {
2005			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 185, "no checks")
2006			if templ_7745c5c3_Err != nil {
2007				return templ_7745c5c3_Err
2008			}
2009		}
2010		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 186, "</span></button></div><div id=\"mr-commits\" data-mr-panel role=\"group\" aria-labelledby=\"mr-tab-commits\"><table class=\"mr-commits\" aria-label=\"Commits\"><thead><tr><th>Commit</th><th>Subject</th><th>Author</th><th>Date</th><th>Signature</th><th>Status</th></tr></thead> <tbody>")
2011		if templ_7745c5c3_Err != nil {
2012			return templ_7745c5c3_Err
2013		}
2014		for _, c := range p.Commits {
2015			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 187, "<tr")
2016			if templ_7745c5c3_Err != nil {
2017				return templ_7745c5c3_Err
2018			}
2019			if c.New {
2020				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 188, " data-new")
2021				if templ_7745c5c3_Err != nil {
2022					return templ_7745c5c3_Err
2023				}
2024			}
2025			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 189, "><td><a href=\"")
2026			if templ_7745c5c3_Err != nil {
2027				return templ_7745c5c3_Err
2028			}
2029			var templ_7745c5c3_Var95 templ.SafeURL
2030			templ_7745c5c3_Var95, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.Href))
2031			if templ_7745c5c3_Err != nil {
2032				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 395, Col: 42}
2033			}
2034			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var95))
2035			if templ_7745c5c3_Err != nil {
2036				return templ_7745c5c3_Err
2037			}
2038			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 190, "\">")
2039			if templ_7745c5c3_Err != nil {
2040				return templ_7745c5c3_Err
2041			}
2042			var templ_7745c5c3_Var96 string
2043			templ_7745c5c3_Var96, templ_7745c5c3_Err = templ.JoinStringErrs(c.Short)
2044			if templ_7745c5c3_Err != nil {
2045				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 395, Col: 54}
2046			}
2047			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var96))
2048			if templ_7745c5c3_Err != nil {
2049				return templ_7745c5c3_Err
2050			}
2051			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 191, "</a></td><td>")
2052			if templ_7745c5c3_Err != nil {
2053				return templ_7745c5c3_Err
2054			}
2055			var templ_7745c5c3_Var97 string
2056			templ_7745c5c3_Var97, templ_7745c5c3_Err = templ.JoinStringErrs(c.Subject)
2057			if templ_7745c5c3_Err != nil {
2058				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 396, Col: 22}
2059			}
2060			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var97))
2061			if templ_7745c5c3_Err != nil {
2062				return templ_7745c5c3_Err
2063			}
2064			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 192, "</td><td>")
2065			if templ_7745c5c3_Err != nil {
2066				return templ_7745c5c3_Err
2067			}
2068			var templ_7745c5c3_Var98 string
2069			templ_7745c5c3_Var98, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
2070			if templ_7745c5c3_Err != nil {
2071				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 397, Col: 21}
2072			}
2073			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var98))
2074			if templ_7745c5c3_Err != nil {
2075				return templ_7745c5c3_Err
2076			}
2077			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 193, "</td><td>")
2078			if templ_7745c5c3_Err != nil {
2079				return templ_7745c5c3_Err
2080			}
2081			if c.WhenAt != "" {
2082				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 194, "<time datetime=\"")
2083				if templ_7745c5c3_Err != nil {
2084					return templ_7745c5c3_Err
2085				}
2086				var templ_7745c5c3_Var99 string
2087				templ_7745c5c3_Var99, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
2088				if templ_7745c5c3_Err != nil {
2089					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 400, Col: 34}
2090				}
2091				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var99)
2092				if templ_7745c5c3_Err != nil {
2093					return templ_7745c5c3_Err
2094				}
2095				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 195, "\">")
2096				if templ_7745c5c3_Err != nil {
2097					return templ_7745c5c3_Err
2098				}
2099				var templ_7745c5c3_Var100 string
2100				templ_7745c5c3_Var100, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
2101				if templ_7745c5c3_Err != nil {
2102					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 400, Col: 45}
2103				}
2104				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var100))
2105				if templ_7745c5c3_Err != nil {
2106					return templ_7745c5c3_Err
2107				}
2108				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 196, "</time>")
2109				if templ_7745c5c3_Err != nil {
2110					return templ_7745c5c3_Err
2111				}
2112			}
2113			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 197, "</td><td>")
2114			if templ_7745c5c3_Err != nil {
2115				return templ_7745c5c3_Err
2116			}
2117			if c.Sig != nil {
2118				templ_7745c5c3_Err = signaturePill(c.Sig).Render(ctx, templ_7745c5c3_Buffer)
2119				if templ_7745c5c3_Err != nil {
2120					return templ_7745c5c3_Err
2121				}
2122			}
2123			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 198, "</td><td>")
2124			if templ_7745c5c3_Err != nil {
2125				return templ_7745c5c3_Err
2126			}
2127			if c.New {
2128				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 199, "<span>new</span>")
2129				if templ_7745c5c3_Err != nil {
2130					return templ_7745c5c3_Err
2131				}
2132			}
2133			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 200, "</td></tr>")
2134			if templ_7745c5c3_Err != nil {
2135				return templ_7745c5c3_Err
2136			}
2137		}
2138		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 201, "</tbody></table>")
2139		if templ_7745c5c3_Err != nil {
2140			return templ_7745c5c3_Err
2141		}
2142		if len(p.Commits) == 0 {
2143			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 202, "<p class=\"dim\">no commit to merge.</p>")
2144			if templ_7745c5c3_Err != nil {
2145				return templ_7745c5c3_Err
2146			}
2147		}
2148		if p.CommitsNote != "" {
2149			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 203, "<p class=\"note\">")
2150			if templ_7745c5c3_Err != nil {
2151				return templ_7745c5c3_Err
2152			}
2153			var templ_7745c5c3_Var101 string
2154			templ_7745c5c3_Var101, templ_7745c5c3_Err = templ.JoinStringErrs(p.CommitsNote)
2155			if templ_7745c5c3_Err != nil {
2156				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 421, Col: 35}
2157			}
2158			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var101))
2159			if templ_7745c5c3_Err != nil {
2160				return templ_7745c5c3_Err
2161			}
2162			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 204, "</p>")
2163			if templ_7745c5c3_Err != nil {
2164				return templ_7745c5c3_Err
2165			}
2166		}
2167		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 205, "</div><div id=\"mr-checks-panel\" data-mr-panel role=\"group\" aria-labelledby=\"mr-tab-checks\">")
2168		if templ_7745c5c3_Err != nil {
2169			return templ_7745c5c3_Err
2170		}
2171		templ_7745c5c3_Err = MRChecks(p.Checks).Render(ctx, templ_7745c5c3_Buffer)
2172		if templ_7745c5c3_Err != nil {
2173			return templ_7745c5c3_Err
2174		}
2175		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 206, "</div></footer>")
2176		if templ_7745c5c3_Err != nil {
2177			return templ_7745c5c3_Err
2178		}
2179		return nil
2180	})
2181}
2182
2183func mrRail(p MRPage) templ.Component {
2184	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2185		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2186		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2187			return templ_7745c5c3_CtxErr
2188		}
2189		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2190		if !templ_7745c5c3_IsBuffer {
2191			defer func() {
2192				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2193				if templ_7745c5c3_Err == nil {
2194					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2195				}
2196			}()
2197		}
2198		ctx = templ.InitializeContext(ctx)
2199		templ_7745c5c3_Var102 := templ.GetChildren(ctx)
2200		if templ_7745c5c3_Var102 == nil {
2201			templ_7745c5c3_Var102 = templ.NopComponent
2202		}
2203		ctx = templ.ClearChildren(ctx)
2204		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 207, "<section aria-labelledby=\"r-files\" class=\"r-files\"><h2 id=\"r-files\">Files <span class=\"count\">")
2205		if templ_7745c5c3_Err != nil {
2206			return templ_7745c5c3_Err
2207		}
2208		var templ_7745c5c3_Var103 string
2209		templ_7745c5c3_Var103, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Files)))
2210		if templ_7745c5c3_Err != nil {
2211			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 433, Col: 49}
2212		}
2213		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var103))
2214		if templ_7745c5c3_Err != nil {
2215			return templ_7745c5c3_Err
2216		}
2217		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 208, "</span><kbd aria-hidden=\"true\">l</kbd> <button type=\"button\" class=\"btn icon fold\" data-js aria-expanded=\"true\" title=\"fold the list of files\" hx-on:click=\"ermiteMR.foldFiles()\"><span class=\"ico i-chevron\" aria-hidden=\"true\"></span><span class=\"sr\">fold the list of files</span></button></h2>")
2218		if templ_7745c5c3_Err != nil {
2219			return templ_7745c5c3_Err
2220		}
2221		templ_7745c5c3_Err = FileList(p.Files).Render(ctx, templ_7745c5c3_Buffer)
2222		if templ_7745c5c3_Err != nil {
2223			return templ_7745c5c3_Err
2224		}
2225		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 209, "</section>")
2226		if templ_7745c5c3_Err != nil {
2227			return templ_7745c5c3_Err
2228		}
2229		if len(p.Verdicts) > 0 {
2230			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 210, "<section><h2>Verdicts</h2><ul>")
2231			if templ_7745c5c3_Err != nil {
2232				return templ_7745c5c3_Err
2233			}
2234			for _, v := range p.Verdicts {
2235				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 211, "<li><a href=\"")
2236				if templ_7745c5c3_Err != nil {
2237					return templ_7745c5c3_Err
2238				}
2239				var templ_7745c5c3_Var104 templ.SafeURL
2240				templ_7745c5c3_Var104, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(v.Href))
2241				if templ_7745c5c3_Err != nil {
2242					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 446, Col: 37}
2243				}
2244				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var104))
2245				if templ_7745c5c3_Err != nil {
2246					return templ_7745c5c3_Err
2247				}
2248				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 212, "\">")
2249				if templ_7745c5c3_Err != nil {
2250					return templ_7745c5c3_Err
2251				}
2252				var templ_7745c5c3_Var105 string
2253				templ_7745c5c3_Var105, templ_7745c5c3_Err = templ.JoinStringErrs(v.Author)
2254				if templ_7745c5c3_Err != nil {
2255					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 446, Col: 50}
2256				}
2257				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var105))
2258				if templ_7745c5c3_Err != nil {
2259					return templ_7745c5c3_Err
2260				}
2261				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 213, ": ")
2262				if templ_7745c5c3_Err != nil {
2263					return templ_7745c5c3_Err
2264				}
2265				var templ_7745c5c3_Var106 string
2266				templ_7745c5c3_Var106, templ_7745c5c3_Err = templ.JoinStringErrs(v.Label)
2267				if templ_7745c5c3_Err != nil {
2268					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 446, Col: 63}
2269				}
2270				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var106))
2271				if templ_7745c5c3_Err != nil {
2272					return templ_7745c5c3_Err
2273				}
2274				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 214, "</a> ")
2275				if templ_7745c5c3_Err != nil {
2276					return templ_7745c5c3_Err
2277				}
2278				if v.Stale {
2279					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 215, "<span class=\"mute\">(stale)</span>")
2280					if templ_7745c5c3_Err != nil {
2281						return templ_7745c5c3_Err
2282					}
2283				}
2284				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 216, "</li>")
2285				if templ_7745c5c3_Err != nil {
2286					return templ_7745c5c3_Err
2287				}
2288			}
2289			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 217, "</ul></section>")
2290			if templ_7745c5c3_Err != nil {
2291				return templ_7745c5c3_Err
2292			}
2293		}
2294		return nil
2295	})
2296}
2297
2298// mrBar is the bar above the diff, which follows the review: the totals, the
2299// layout of the diff, the state of the checks and, for the owner of an open
2300// request, the merge menu and the other actions. Each menu is a <details>: it
2301// works without scripts; with them, M and the keys of the menu drive it.
2302func mrBar(p MRPage) templ.Component {
2303	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2304		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2305		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2306			return templ_7745c5c3_CtxErr
2307		}
2308		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2309		if !templ_7745c5c3_IsBuffer {
2310			defer func() {
2311				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2312				if templ_7745c5c3_Err == nil {
2313					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2314				}
2315			}()
2316		}
2317		ctx = templ.InitializeContext(ctx)
2318		templ_7745c5c3_Var107 := templ.GetChildren(ctx)
2319		if templ_7745c5c3_Var107 == nil {
2320			templ_7745c5c3_Var107 = templ.NopComponent
2321		}
2322		ctx = templ.ClearChildren(ctx)
2323		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 218, "<div class=\"diff-tools mr-bar\" role=\"group\" aria-label=\"Diff view and merge\"><span class=\"dim\">")
2324		if templ_7745c5c3_Err != nil {
2325			return templ_7745c5c3_Err
2326		}
2327		var templ_7745c5c3_Var108 string
2328		templ_7745c5c3_Var108, templ_7745c5c3_Err = templ.JoinStringErrs(plural(p.NFiles, "file", "files"))
2329		if templ_7745c5c3_Err != nil {
2330			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 463, Col: 55}
2331		}
2332		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var108))
2333		if templ_7745c5c3_Err != nil {
2334			return templ_7745c5c3_Err
2335		}
2336		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 219, " · <span class=\"plus\">+")
2337		if templ_7745c5c3_Err != nil {
2338			return templ_7745c5c3_Err
2339		}
2340		var templ_7745c5c3_Var109 string
2341		templ_7745c5c3_Var109, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Adds))
2342		if templ_7745c5c3_Err != nil {
2343			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 463, Col: 95}
2344		}
2345		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var109))
2346		if templ_7745c5c3_Err != nil {
2347			return templ_7745c5c3_Err
2348		}
2349		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 220, "</span> <span class=\"minus\">-")
2350		if templ_7745c5c3_Err != nil {
2351			return templ_7745c5c3_Err
2352		}
2353		var templ_7745c5c3_Var110 string
2354		templ_7745c5c3_Var110, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Dels))
2355		if templ_7745c5c3_Err != nil {
2356			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 463, Col: 140}
2357		}
2358		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var110))
2359		if templ_7745c5c3_Err != nil {
2360			return templ_7745c5c3_Err
2361		}
2362		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 221, "</span></span>")
2363		if templ_7745c5c3_Err != nil {
2364			return templ_7745c5c3_Err
2365		}
2366		templ_7745c5c3_Err = diffViewMenu(p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
2367		if templ_7745c5c3_Err != nil {
2368			return templ_7745c5c3_Err
2369		}
2370		templ_7745c5c3_Err = mrActions(p, false).Render(ctx, templ_7745c5c3_Buffer)
2371		if templ_7745c5c3_Err != nil {
2372			return templ_7745c5c3_Err
2373		}
2374		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 222, "</div>")
2375		if templ_7745c5c3_Err != nil {
2376			return templ_7745c5c3_Err
2377		}
2378		return nil
2379	})
2380}
2381
2382// mergeMenu is the merge of an open request, for the owner: the form (it
2383// carries the head that was read), or "Ready for review" for a draft. The
2384// mode and the branch deletion have keys (1-3, D) while it is open.
2385//
2386// The badge is a live slot (mr-mergeability); the modes and the button read
2387// its data-* attributes (hx-live bindings), so that they follow the slot when
2388// the stream replaces its content. The server renders the same state in the
2389// attributes, for a page without scripts.
2390func mergeMenu(p MRPage) templ.Component {
2391	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2392		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2393		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2394			return templ_7745c5c3_CtxErr
2395		}
2396		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2397		if !templ_7745c5c3_IsBuffer {
2398			defer func() {
2399				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2400				if templ_7745c5c3_Err == nil {
2401					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2402				}
2403			}()
2404		}
2405		ctx = templ.InitializeContext(ctx)
2406		templ_7745c5c3_Var111 := templ.GetChildren(ctx)
2407		if templ_7745c5c3_Var111 == nil {
2408			templ_7745c5c3_Var111 = templ.NopComponent
2409		}
2410		ctx = templ.ClearChildren(ctx)
2411		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 223, "<details class=\"menu mmenu\" id=\"merge-menu\" data-state=\"open\"")
2412		if templ_7745c5c3_Err != nil {
2413			return templ_7745c5c3_Err
2414		}
2415		if p.Box.Error != "" {
2416			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 224, " open")
2417			if templ_7745c5c3_Err != nil {
2418				return templ_7745c5c3_Err
2419			}
2420		}
2421		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 225, "><summary class=\"btn primary\" aria-keyshortcuts=\"Shift+M\">")
2422		if templ_7745c5c3_Err != nil {
2423			return templ_7745c5c3_Err
2424		}
2425		if p.Box.ReadyAction != "" {
2426			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 226, "Draft ")
2427			if templ_7745c5c3_Err != nil {
2428				return templ_7745c5c3_Err
2429			}
2430		} else {
2431			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 227, "Merge ")
2432			if templ_7745c5c3_Err != nil {
2433				return templ_7745c5c3_Err
2434			}
2435		}
2436		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 228, "<kbd aria-hidden=\"true\">M</kbd></summary><div class=\"menu-pop\" role=\"group\" aria-label=\"Merge\">")
2437		if templ_7745c5c3_Err != nil {
2438			return templ_7745c5c3_Err
2439		}
2440		if p.Box.HeadGone {
2441			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 229, "<p class=\"dim\">the source branch was deleted</p>")
2442			if templ_7745c5c3_Err != nil {
2443				return templ_7745c5c3_Err
2444			}
2445		}
2446		if p.Box.Error != "" {
2447			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 230, "<p class=\"d-err\" role=\"alert\">")
2448			if templ_7745c5c3_Err != nil {
2449				return templ_7745c5c3_Err
2450			}
2451			var templ_7745c5c3_Var112 string
2452			templ_7745c5c3_Var112, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.Error)
2453			if templ_7745c5c3_Err != nil {
2454				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 492, Col: 47}
2455			}
2456			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var112))
2457			if templ_7745c5c3_Err != nil {
2458				return templ_7745c5c3_Err
2459			}
2460			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 231, "</p>")
2461			if templ_7745c5c3_Err != nil {
2462				return templ_7745c5c3_Err
2463			}
2464		}
2465		if p.Box.ReadyAction != "" {
2466			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 232, "<p class=\"d-draft\">this is a draft: it cannot be merged until it is ready for review.</p><form class=\"d-btns\" method=\"post\" action=\"")
2467			if templ_7745c5c3_Err != nil {
2468				return templ_7745c5c3_Err
2469			}
2470			var templ_7745c5c3_Var113 templ.SafeURL
2471			templ_7745c5c3_Var113, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadyAction))
2472			if templ_7745c5c3_Err != nil {
2473				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 496, Col: 80}
2474			}
2475			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var113))
2476			if templ_7745c5c3_Err != nil {
2477				return templ_7745c5c3_Err
2478			}
2479			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 233, "\"><button type=\"submit\" class=\"btn primary\" data-default title=\"remove the draft prefix from the title\">Ready for review</button></form>")
2480			if templ_7745c5c3_Err != nil {
2481				return templ_7745c5c3_Err
2482			}
2483		} else if !p.Box.HeadGone {
2484			templ_7745c5c3_Err = mrMergeabilitySlot(p.Box.Mergeability).Render(ctx, templ_7745c5c3_Buffer)
2485			if templ_7745c5c3_Err != nil {
2486				return templ_7745c5c3_Err
2487			}
2488			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 234, " ")
2489			if templ_7745c5c3_Err != nil {
2490				return templ_7745c5c3_Err
2491			}
2492			if p.Box.AutoMerge != nil {
2493				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 235, "<form class=\"d-acts\" method=\"post\" action=\"")
2494				if templ_7745c5c3_Err != nil {
2495					return templ_7745c5c3_Err
2496				}
2497				var templ_7745c5c3_Var114 templ.SafeURL
2498				templ_7745c5c3_Var114, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.CancelAutoAction))
2499				if templ_7745c5c3_Err != nil {
2500					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 502, Col: 86}
2501				}
2502				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var114))
2503				if templ_7745c5c3_Err != nil {
2504					return templ_7745c5c3_Err
2505				}
2506				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 236, "\"><p class=\"dim\" role=\"status\">Auto-merge: ")
2507				if templ_7745c5c3_Err != nil {
2508					return templ_7745c5c3_Err
2509				}
2510				var templ_7745c5c3_Var115 string
2511				templ_7745c5c3_Var115, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.AutoMerge.Mode)
2512				if templ_7745c5c3_Err != nil {
2513					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 504, Col: 41}
2514				}
2515				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var115))
2516				if templ_7745c5c3_Err != nil {
2517					return templ_7745c5c3_Err
2518				}
2519				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 237, " when ready, enabled by ")
2520				if templ_7745c5c3_Err != nil {
2521					return templ_7745c5c3_Err
2522				}
2523				var templ_7745c5c3_Var116 string
2524				templ_7745c5c3_Var116, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.AutoMerge.EnabledBy)
2525				if templ_7745c5c3_Err != nil {
2526					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 504, Col: 94}
2527				}
2528				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var116))
2529				if templ_7745c5c3_Err != nil {
2530					return templ_7745c5c3_Err
2531				}
2532				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 238, " ")
2533				if templ_7745c5c3_Err != nil {
2534					return templ_7745c5c3_Err
2535				}
2536				if p.Box.AutoMerge.When != "" {
2537					var templ_7745c5c3_Var117 string
2538					templ_7745c5c3_Var117, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
2539					if templ_7745c5c3_Err != nil {
2540						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 506, Col: 13}
2541					}
2542					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var117))
2543					if templ_7745c5c3_Err != nil {
2544						return templ_7745c5c3_Err
2545					}
2546					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 239, "<time datetime=\"")
2547					if templ_7745c5c3_Err != nil {
2548						return templ_7745c5c3_Err
2549					}
2550					var templ_7745c5c3_Var118 string
2551					templ_7745c5c3_Var118, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.AutoMerge.WhenAt)
2552					if templ_7745c5c3_Err != nil {
2553						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 506, Col: 54}
2554					}
2555					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var118)
2556					if templ_7745c5c3_Err != nil {
2557						return templ_7745c5c3_Err
2558					}
2559					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 240, "\">")
2560					if templ_7745c5c3_Err != nil {
2561						return templ_7745c5c3_Err
2562					}
2563					var templ_7745c5c3_Var119 string
2564					templ_7745c5c3_Var119, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.AutoMerge.When)
2565					if templ_7745c5c3_Err != nil {
2566						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 506, Col: 79}
2567					}
2568					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var119))
2569					if templ_7745c5c3_Err != nil {
2570						return templ_7745c5c3_Err
2571					}
2572					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 241, "</time> ")
2573					if templ_7745c5c3_Err != nil {
2574						return templ_7745c5c3_Err
2575					}
2576				}
2577				var templ_7745c5c3_Var120 string
2578				templ_7745c5c3_Var120, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
2579				if templ_7745c5c3_Err != nil {
2580					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 508, Col: 12}
2581				}
2582				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var120))
2583				if templ_7745c5c3_Err != nil {
2584					return templ_7745c5c3_Err
2585				}
2586				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 242, "(head ")
2587				if templ_7745c5c3_Err != nil {
2588					return templ_7745c5c3_Err
2589				}
2590				var templ_7745c5c3_Var121 string
2591				templ_7745c5c3_Var121, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.AutoMerge.HeadShort)
2592				if templ_7745c5c3_Err != nil {
2593					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 508, Col: 47}
2594				}
2595				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var121))
2596				if templ_7745c5c3_Err != nil {
2597					return templ_7745c5c3_Err
2598				}
2599				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 243, ")</p><div class=\"d-btns\"><button type=\"submit\" class=\"btn\">Cancel auto-merge</button></div></form>")
2600				if templ_7745c5c3_Err != nil {
2601					return templ_7745c5c3_Err
2602				}
2603			}
2604			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 244, " <form class=\"d-acts\" method=\"post\" action=\"")
2605			if templ_7745c5c3_Err != nil {
2606				return templ_7745c5c3_Err
2607			}
2608			var templ_7745c5c3_Var122 templ.SafeURL
2609			templ_7745c5c3_Var122, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.MergeAction))
2610			if templ_7745c5c3_Err != nil {
2611				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 518, Col: 46}
2612			}
2613			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var122))
2614			if templ_7745c5c3_Err != nil {
2615				return templ_7745c5c3_Err
2616			}
2617			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 245, "\" hx-post=\"")
2618			if templ_7745c5c3_Err != nil {
2619				return templ_7745c5c3_Err
2620			}
2621			var templ_7745c5c3_Var123 string
2622			templ_7745c5c3_Var123, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.MergeAction)
2623			if templ_7745c5c3_Err != nil {
2624				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 519, Col: 32}
2625			}
2626			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var123)
2627			if templ_7745c5c3_Err != nil {
2628				return templ_7745c5c3_Err
2629			}
2630			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 246, "\" hx-swap=\"none\" hx-sync=\"this:drop\" hx-disable=\"find button[type=submit]\"><input type=\"hidden\" name=\"head_id\" value=\"")
2631			if templ_7745c5c3_Err != nil {
2632				return templ_7745c5c3_Err
2633			}
2634			var templ_7745c5c3_Var124 string
2635			templ_7745c5c3_Var124, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
2636			if templ_7745c5c3_Err != nil {
2637				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 524, Col: 59}
2638			}
2639			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var124)
2640			if templ_7745c5c3_Err != nil {
2641				return templ_7745c5c3_Err
2642			}
2643			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 247, "\"><fieldset class=\"d-modes\"><legend class=\"sr\">merge mode</legend> ")
2644			if templ_7745c5c3_Err != nil {
2645				return templ_7745c5c3_Err
2646			}
2647			for i, m := range p.Box.Modes {
2648				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 248, "<label><input type=\"radio\" name=\"mode\" value=\"")
2649				if templ_7745c5c3_Err != nil {
2650					return templ_7745c5c3_Err
2651				}
2652				var templ_7745c5c3_Var125 string
2653				templ_7745c5c3_Var125, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.Value)
2654				if templ_7745c5c3_Err != nil {
2655					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 532, Col: 24}
2656				}
2657				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var125)
2658				if templ_7745c5c3_Err != nil {
2659					return templ_7745c5c3_Err
2660				}
2661				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 249, "\"")
2662				if templ_7745c5c3_Err != nil {
2663					return templ_7745c5c3_Err
2664				}
2665				if i == p.Box.Checked() {
2666					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 250, " checked")
2667					if templ_7745c5c3_Err != nil {
2668						return templ_7745c5c3_Err
2669					}
2670				}
2671				if m.Disabled {
2672					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 251, " disabled")
2673					if templ_7745c5c3_Err != nil {
2674						return templ_7745c5c3_Err
2675					}
2676				}
2677				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 252, " title=\"")
2678				if templ_7745c5c3_Err != nil {
2679					return templ_7745c5c3_Err
2680				}
2681				var templ_7745c5c3_Var126 string
2682				templ_7745c5c3_Var126, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.Reason)
2683				if templ_7745c5c3_Err != nil {
2684					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 535, Col: 25}
2685				}
2686				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var126)
2687				if templ_7745c5c3_Err != nil {
2688					return templ_7745c5c3_Err
2689				}
2690				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 253, "\" :disabled=\"this.value === 'fast-forward' ? q('[data-mergeability]').data.ffOk !== true : q('[data-mergeability]').data.mergeOk !== true\" :title=\"this.value === 'fast-forward' ? q('[data-mergeability]').data.ffReason : q('[data-mergeability]').data.mergeReason\"> ")
2691				if templ_7745c5c3_Err != nil {
2692					return templ_7745c5c3_Err
2693				}
2694				var templ_7745c5c3_Var127 string
2695				templ_7745c5c3_Var127, templ_7745c5c3_Err = templ.JoinStringErrs(m.Label)
2696				if templ_7745c5c3_Err != nil {
2697					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 539, Col: 17}
2698				}
2699				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var127))
2700				if templ_7745c5c3_Err != nil {
2701					return templ_7745c5c3_Err
2702				}
2703				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 254, " ")
2704				if templ_7745c5c3_Err != nil {
2705					return templ_7745c5c3_Err
2706				}
2707				if i < 9 {
2708					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 255, "<kbd aria-hidden=\"true\">")
2709					if templ_7745c5c3_Err != nil {
2710						return templ_7745c5c3_Err
2711					}
2712					var templ_7745c5c3_Var128 string
2713					templ_7745c5c3_Var128, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(i + 1))
2714					if templ_7745c5c3_Err != nil {
2715						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 541, Col: 46}
2716					}
2717					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var128))
2718					if templ_7745c5c3_Err != nil {
2719						return templ_7745c5c3_Err
2720					}
2721					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 256, "</kbd>")
2722					if templ_7745c5c3_Err != nil {
2723						return templ_7745c5c3_Err
2724					}
2725				}
2726				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 257, "</label>")
2727				if templ_7745c5c3_Err != nil {
2728					return templ_7745c5c3_Err
2729				}
2730			}
2731			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 258, "</fieldset>")
2732			if templ_7745c5c3_Err != nil {
2733				return templ_7745c5c3_Err
2734			}
2735			templ_7745c5c3_Err = MRMergeChecks(p.ChecksSum).Render(ctx, templ_7745c5c3_Buffer)
2736			if templ_7745c5c3_Err != nil {
2737				return templ_7745c5c3_Err
2738			}
2739			if p.Box.CanDeleteBranch {
2740				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 259, "<label class=\"d-check\"><input type=\"checkbox\" name=\"delete_branch\" value=\"1\"> delete ")
2741				if templ_7745c5c3_Err != nil {
2742					return templ_7745c5c3_Err
2743				}
2744				var templ_7745c5c3_Var129 string
2745				templ_7745c5c3_Var129, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
2746				if templ_7745c5c3_Err != nil {
2747					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 548, Col: 102}
2748				}
2749				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var129))
2750				if templ_7745c5c3_Err != nil {
2751					return templ_7745c5c3_Err
2752				}
2753				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 260, " after the merge <kbd aria-hidden=\"true\">D</kbd></label>")
2754				if templ_7745c5c3_Err != nil {
2755					return templ_7745c5c3_Err
2756				}
2757			}
2758			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 261, "<div class=\"d-btns\"><button type=\"submit\" class=\"btn primary\" data-default")
2759			if templ_7745c5c3_Err != nil {
2760				return templ_7745c5c3_Err
2761			}
2762			if !p.Box.CanMerge() {
2763				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 262, " disabled")
2764				if templ_7745c5c3_Err != nil {
2765					return templ_7745c5c3_Err
2766				}
2767			}
2768			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 263, " title=\"")
2769			if templ_7745c5c3_Err != nil {
2770				return templ_7745c5c3_Err
2771			}
2772			var templ_7745c5c3_Var130 string
2773			templ_7745c5c3_Var130, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.MergeTitle())
2774			if templ_7745c5c3_Err != nil {
2775				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 556, Col: 33}
2776			}
2777			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var130)
2778			if templ_7745c5c3_Err != nil {
2779				return templ_7745c5c3_Err
2780			}
2781			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 264, "\" :disabled=\"this.form.classList.contains('htmx-request') || !this.form.querySelector('input[name=mode]:checked:not(:disabled)')\" :title=\"(this.form.querySelector('input[name=mode]:checked') || {}).title || ''\">Merge into ")
2782			if templ_7745c5c3_Err != nil {
2783				return templ_7745c5c3_Err
2784			}
2785			var templ_7745c5c3_Var131 string
2786			templ_7745c5c3_Var131, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
2787			if templ_7745c5c3_Err != nil {
2788				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 559, Col: 28}
2789			}
2790			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var131))
2791			if templ_7745c5c3_Err != nil {
2792				return templ_7745c5c3_Err
2793			}
2794			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 265, "</button> <span class=\"htmx-indicator\" role=\"status\">Merging…</span></div></form>")
2795			if templ_7745c5c3_Err != nil {
2796				return templ_7745c5c3_Err
2797			}
2798			if p.Box.CanAutoMerge {
2799				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 266, "<form class=\"d-acts\" method=\"post\" action=\"")
2800				if templ_7745c5c3_Err != nil {
2801					return templ_7745c5c3_Err
2802				}
2803				var templ_7745c5c3_Var132 templ.SafeURL
2804				templ_7745c5c3_Var132, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.AutoAction))
2805				if templ_7745c5c3_Err != nil {
2806					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 564, Col: 80}
2807				}
2808				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var132))
2809				if templ_7745c5c3_Err != nil {
2810					return templ_7745c5c3_Err
2811				}
2812				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 267, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
2813				if templ_7745c5c3_Err != nil {
2814					return templ_7745c5c3_Err
2815				}
2816				var templ_7745c5c3_Var133 string
2817				templ_7745c5c3_Var133, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
2818				if templ_7745c5c3_Err != nil {
2819					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 565, Col: 60}
2820				}
2821				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var133)
2822				if templ_7745c5c3_Err != nil {
2823					return templ_7745c5c3_Err
2824				}
2825				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 268, "\"><fieldset class=\"d-modes\"><legend>Auto-merge mode</legend> ")
2826				if templ_7745c5c3_Err != nil {
2827					return templ_7745c5c3_Err
2828				}
2829				for i, m := range p.Box.Modes {
2830					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 269, "<label><input type=\"radio\" name=\"mode\" value=\"")
2831					if templ_7745c5c3_Err != nil {
2832						return templ_7745c5c3_Err
2833					}
2834					var templ_7745c5c3_Var134 string
2835					templ_7745c5c3_Var134, templ_7745c5c3_Err = templ.ResolveAttributeValue(m.Value)
2836					if templ_7745c5c3_Err != nil {
2837						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 569, Col: 62}
2838					}
2839					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var134)
2840					if templ_7745c5c3_Err != nil {
2841						return templ_7745c5c3_Err
2842					}
2843					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 270, "\"")
2844					if templ_7745c5c3_Err != nil {
2845						return templ_7745c5c3_Err
2846					}
2847					if i == 0 {
2848						templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 271, " checked")
2849						if templ_7745c5c3_Err != nil {
2850							return templ_7745c5c3_Err
2851						}
2852					}
2853					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 272, "> ")
2854					if templ_7745c5c3_Err != nil {
2855						return templ_7745c5c3_Err
2856					}
2857					var templ_7745c5c3_Var135 string
2858					templ_7745c5c3_Var135, templ_7745c5c3_Err = templ.JoinStringErrs(m.Label)
2859					if templ_7745c5c3_Err != nil {
2860						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 569, Col: 96}
2861					}
2862					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var135))
2863					if templ_7745c5c3_Err != nil {
2864						return templ_7745c5c3_Err
2865					}
2866					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 273, "</label>")
2867					if templ_7745c5c3_Err != nil {
2868						return templ_7745c5c3_Err
2869					}
2870				}
2871				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 274, "</fieldset><div class=\"d-btns\"><button type=\"submit\" class=\"btn\"")
2872				if templ_7745c5c3_Err != nil {
2873					return templ_7745c5c3_Err
2874				}
2875				if len(p.Box.Modes) == 0 {
2876					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 275, " disabled")
2877					if templ_7745c5c3_Err != nil {
2878						return templ_7745c5c3_Err
2879					}
2880				}
2881				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 276, " title=\"merge once the checks pass\">Merge when ready</button></div></form>")
2882				if templ_7745c5c3_Err != nil {
2883					return templ_7745c5c3_Err
2884				}
2885			}
2886		}
2887		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 277, "</div></details>")
2888		if templ_7745c5c3_Err != nil {
2889			return templ_7745c5c3_Err
2890		}
2891		return nil
2892	})
2893}
2894
2895// MRMergeability is the content of the mergeability slot: the badge, and the
2896// state the controls of the merge box read.
2897func MRMergeability(v MergeabilityView) templ.Component {
2898	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
2899		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
2900		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
2901			return templ_7745c5c3_CtxErr
2902		}
2903		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
2904		if !templ_7745c5c3_IsBuffer {
2905			defer func() {
2906				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
2907				if templ_7745c5c3_Err == nil {
2908					templ_7745c5c3_Err = templ_7745c5c3_BufErr
2909				}
2910			}()
2911		}
2912		ctx = templ.InitializeContext(ctx)
2913		templ_7745c5c3_Var136 := templ.GetChildren(ctx)
2914		if templ_7745c5c3_Var136 == nil {
2915			templ_7745c5c3_Var136 = templ.NopComponent
2916		}
2917		ctx = templ.ClearChildren(ctx)
2918		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 278, "<span data-mergeability data-state=\"")
2919		if templ_7745c5c3_Err != nil {
2920			return templ_7745c5c3_Err
2921		}
2922		var templ_7745c5c3_Var137 string
2923		templ_7745c5c3_Var137, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.State)
2924		if templ_7745c5c3_Err != nil {
2925			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 587, Col: 22}
2926		}
2927		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var137)
2928		if templ_7745c5c3_Err != nil {
2929			return templ_7745c5c3_Err
2930		}
2931		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 279, "\" data-ff-ok=\"")
2932		if templ_7745c5c3_Err != nil {
2933			return templ_7745c5c3_Err
2934		}
2935		var templ_7745c5c3_Var138 string
2936		templ_7745c5c3_Var138, templ_7745c5c3_Err = templ.ResolveAttributeValue(strconv.FormatBool(v.FFOk))
2937		if templ_7745c5c3_Err != nil {
2938			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 588, Col: 41}
2939		}
2940		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var138)
2941		if templ_7745c5c3_Err != nil {
2942			return templ_7745c5c3_Err
2943		}
2944		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 280, "\" data-merge-ok=\"")
2945		if templ_7745c5c3_Err != nil {
2946			return templ_7745c5c3_Err
2947		}
2948		var templ_7745c5c3_Var139 string
2949		templ_7745c5c3_Var139, templ_7745c5c3_Err = templ.ResolveAttributeValue(strconv.FormatBool(v.MergeOk))
2950		if templ_7745c5c3_Err != nil {
2951			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 589, Col: 47}
2952		}
2953		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var139)
2954		if templ_7745c5c3_Err != nil {
2955			return templ_7745c5c3_Err
2956		}
2957		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 281, "\" data-ff-reason=\"")
2958		if templ_7745c5c3_Err != nil {
2959			return templ_7745c5c3_Err
2960		}
2961		var templ_7745c5c3_Var140 string
2962		templ_7745c5c3_Var140, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.FFReason)
2963		if templ_7745c5c3_Err != nil {
2964			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 590, Col: 29}
2965		}
2966		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var140)
2967		if templ_7745c5c3_Err != nil {
2968			return templ_7745c5c3_Err
2969		}
2970		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 282, "\" data-merge-reason=\"")
2971		if templ_7745c5c3_Err != nil {
2972			return templ_7745c5c3_Err
2973		}
2974		var templ_7745c5c3_Var141 string
2975		templ_7745c5c3_Var141, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.MergeReason)
2976		if templ_7745c5c3_Err != nil {
2977			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 591, Col: 35}
2978		}
2979		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var141)
2980		if templ_7745c5c3_Err != nil {
2981			return templ_7745c5c3_Err
2982		}
2983		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 283, "\"><span class=\"badge\" data-state=\"")
2984		if templ_7745c5c3_Err != nil {
2985			return templ_7745c5c3_Err
2986		}
2987		var templ_7745c5c3_Var142 string
2988		templ_7745c5c3_Var142, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.State)
2989		if templ_7745c5c3_Err != nil {
2990			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 593, Col: 42}
2991		}
2992		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var142)
2993		if templ_7745c5c3_Err != nil {
2994			return templ_7745c5c3_Err
2995		}
2996		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 284, "\">")
2997		if templ_7745c5c3_Err != nil {
2998			return templ_7745c5c3_Err
2999		}
3000		var templ_7745c5c3_Var143 string
3001		templ_7745c5c3_Var143, templ_7745c5c3_Err = templ.JoinStringErrs(v.Label)
3002		if templ_7745c5c3_Err != nil {
3003			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 593, Col: 54}
3004		}
3005		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var143))
3006		if templ_7745c5c3_Err != nil {
3007			return templ_7745c5c3_Err
3008		}
3009		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 285, "</span> ")
3010		if templ_7745c5c3_Err != nil {
3011			return templ_7745c5c3_Err
3012		}
3013		if v.Detail != "" {
3014			var templ_7745c5c3_Var144 string
3015			templ_7745c5c3_Var144, templ_7745c5c3_Err = templ.JoinStringErrs(" ")
3016			if templ_7745c5c3_Err != nil {
3017				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 595, Col: 8}
3018			}
3019			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var144))
3020			if templ_7745c5c3_Err != nil {
3021				return templ_7745c5c3_Err
3022			}
3023			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 286, "<span class=\"dim\">")
3024			if templ_7745c5c3_Err != nil {
3025				return templ_7745c5c3_Err
3026			}
3027			var templ_7745c5c3_Var145 string
3028			templ_7745c5c3_Var145, templ_7745c5c3_Err = templ.JoinStringErrs(v.Detail)
3029			if templ_7745c5c3_Err != nil {
3030				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 595, Col: 38}
3031			}
3032			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var145))
3033			if templ_7745c5c3_Err != nil {
3034				return templ_7745c5c3_Err
3035			}
3036			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 287, "</span>")
3037			if templ_7745c5c3_Err != nil {
3038				return templ_7745c5c3_Err
3039			}
3040		}
3041		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 288, "</span> ")
3042		if templ_7745c5c3_Err != nil {
3043			return templ_7745c5c3_Err
3044		}
3045		if len(v.Paths) > 0 {
3046			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 289, "<ul class=\"mg-paths\" aria-label=\"conflicting files\">")
3047			if templ_7745c5c3_Err != nil {
3048				return templ_7745c5c3_Err
3049			}
3050			for _, path := range v.Paths {
3051				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 290, "<li><code>")
3052				if templ_7745c5c3_Err != nil {
3053					return templ_7745c5c3_Err
3054				}
3055				var templ_7745c5c3_Var146 string
3056				templ_7745c5c3_Var146, templ_7745c5c3_Err = templ.JoinStringErrs(path)
3057				if templ_7745c5c3_Err != nil {
3058					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 601, Col: 20}
3059				}
3060				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var146))
3061				if templ_7745c5c3_Err != nil {
3062					return templ_7745c5c3_Err
3063				}
3064				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 291, "</code></li>")
3065				if templ_7745c5c3_Err != nil {
3066					return templ_7745c5c3_Err
3067				}
3068			}
3069			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 292, "</ul>")
3070			if templ_7745c5c3_Err != nil {
3071				return templ_7745c5c3_Err
3072			}
3073		}
3074		if v.PathsNote != "" {
3075			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 293, "<p class=\"dim\">")
3076			if templ_7745c5c3_Err != nil {
3077				return templ_7745c5c3_Err
3078			}
3079			var templ_7745c5c3_Var147 string
3080			templ_7745c5c3_Var147, templ_7745c5c3_Err = templ.JoinStringErrs(v.PathsNote)
3081			if templ_7745c5c3_Err != nil {
3082				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 606, Col: 30}
3083			}
3084			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var147))
3085			if templ_7745c5c3_Err != nil {
3086				return templ_7745c5c3_Err
3087			}
3088			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 294, "</p>")
3089			if templ_7745c5c3_Err != nil {
3090				return templ_7745c5c3_Err
3091			}
3092		}
3093		return nil
3094	})
3095}
3096
3097// mrMergeabilitySlot is the status region of the badge, with its content: the
3098// stream replaces the children, never the element (see LiveSlot).
3099func mrMergeabilitySlot(v MergeabilityView) templ.Component {
3100	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3101		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3102		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3103			return templ_7745c5c3_CtxErr
3104		}
3105		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3106		if !templ_7745c5c3_IsBuffer {
3107			defer func() {
3108				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3109				if templ_7745c5c3_Err == nil {
3110					templ_7745c5c3_Err = templ_7745c5c3_BufErr
3111				}
3112			}()
3113		}
3114		ctx = templ.InitializeContext(ctx)
3115		templ_7745c5c3_Var148 := templ.GetChildren(ctx)
3116		if templ_7745c5c3_Var148 == nil {
3117			templ_7745c5c3_Var148 = templ.NopComponent
3118		}
3119		ctx = templ.ClearChildren(ctx)
3120		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 295, "<div id=\"mr-mergeability\" class=\"live-slot\" role=\"status\" data-slot>")
3121		if templ_7745c5c3_Err != nil {
3122			return templ_7745c5c3_Err
3123		}
3124		templ_7745c5c3_Err = MRMergeability(v).Render(ctx, templ_7745c5c3_Buffer)
3125		if templ_7745c5c3_Err != nil {
3126			return templ_7745c5c3_Err
3127		}
3128		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 296, "</div>")
3129		if templ_7745c5c3_Err != nil {
3130			return templ_7745c5c3_Err
3131		}
3132		return nil
3133	})
3134}
3135
3136// MRMergeabilityFragment is the slot as the stream sends it.
3137func MRMergeabilityFragment(v MergeabilityView) templ.Component {
3138	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3139		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3140		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3141			return templ_7745c5c3_CtxErr
3142		}
3143		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3144		if !templ_7745c5c3_IsBuffer {
3145			defer func() {
3146				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3147				if templ_7745c5c3_Err == nil {
3148					templ_7745c5c3_Err = templ_7745c5c3_BufErr
3149				}
3150			}()
3151		}
3152		ctx = templ.InitializeContext(ctx)
3153		templ_7745c5c3_Var149 := templ.GetChildren(ctx)
3154		if templ_7745c5c3_Var149 == nil {
3155			templ_7745c5c3_Var149 = templ.NopComponent
3156		}
3157		ctx = templ.ClearChildren(ctx)
3158		templ_7745c5c3_Err = mrMergeabilitySlot(v).Render(ctx, templ_7745c5c3_Buffer)
3159		if templ_7745c5c3_Err != nil {
3160			return templ_7745c5c3_Err
3161		}
3162		return nil
3163	})
3164}
3165
3166// moreMenu shows read-only settings to every viewer, and keeps owner actions
3167// behind the same merge-box permission as before.
3168func moreMenu(p MRPage) templ.Component {
3169	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3170		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3171		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3172			return templ_7745c5c3_CtxErr
3173		}
3174		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3175		if !templ_7745c5c3_IsBuffer {
3176			defer func() {
3177				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3178				if templ_7745c5c3_Err == nil {
3179					templ_7745c5c3_Err = templ_7745c5c3_BufErr
3180				}
3181			}()
3182		}
3183		ctx = templ.InitializeContext(ctx)
3184		templ_7745c5c3_Var150 := templ.GetChildren(ctx)
3185		if templ_7745c5c3_Var150 == nil {
3186			templ_7745c5c3_Var150 = templ.NopComponent
3187		}
3188		ctx = templ.ClearChildren(ctx)
3189		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 297, "<details class=\"menu omenu\"><summary class=\"btn icon\" aria-label=\"More actions\" title=\"more actions\">⋯</summary><div class=\"menu-pop\" role=\"group\" aria-label=\"More actions\"><section class=\"merge-settings\"><h2>Merge settings</h2><dl class=\"kv\"><dt>modes</dt><dd>")
3190		if templ_7745c5c3_Err != nil {
3191			return templ_7745c5c3_Err
3192		}
3193		var templ_7745c5c3_Var151 string
3194		templ_7745c5c3_Var151, templ_7745c5c3_Err = templ.JoinStringErrs(strings.Join(p.Modes, ", "))
3195		if templ_7745c5c3_Err != nil {
3196			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 633, Col: 38}
3197		}
3198		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var151))
3199		if templ_7745c5c3_Err != nil {
3200			return templ_7745c5c3_Err
3201		}
3202		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 298, "</dd><dt>checks</dt><dd>")
3203		if templ_7745c5c3_Err != nil {
3204			return templ_7745c5c3_Err
3205		}
3206		if p.ChecksBlock {
3207			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 299, "failing or unfinished checks block the merge")
3208			if templ_7745c5c3_Err != nil {
3209				return templ_7745c5c3_Err
3210			}
3211		} else {
3212			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 300, "do not block the merge")
3213			if templ_7745c5c3_Err != nil {
3214				return templ_7745c5c3_Err
3215			}
3216		}
3217		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 301, "</dd></dl></section>")
3218		if templ_7745c5c3_Err != nil {
3219			return templ_7745c5c3_Err
3220		}
3221		if p.Box != nil {
3222			if p.Box.Signed {
3223				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 302, "<p class=\"d-note\" id=\"mr-signing\">squash and merge commits are signed with ermite's own key (generated on first start). ")
3224				if templ_7745c5c3_Err != nil {
3225					return templ_7745c5c3_Err
3226				}
3227				if p.Box.Fingerprint != "" {
3228					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 303, "fingerprint <code>")
3229					if templ_7745c5c3_Err != nil {
3230						return templ_7745c5c3_Err
3231					}
3232					var templ_7745c5c3_Var152 string
3233					templ_7745c5c3_Var152, templ_7745c5c3_Err = templ.JoinStringErrs(p.Box.Fingerprint)
3234					if templ_7745c5c3_Err != nil {
3235						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 649, Col: 44}
3236					}
3237					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var152))
3238					if templ_7745c5c3_Err != nil {
3239						return templ_7745c5c3_Err
3240					}
3241					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 304, "</code> ")
3242					if templ_7745c5c3_Err != nil {
3243						return templ_7745c5c3_Err
3244					}
3245				}
3246				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 305, "<code>ermite signing-key show</code> prints it.</p>")
3247				if templ_7745c5c3_Err != nil {
3248					return templ_7745c5c3_Err
3249				}
3250			}
3251			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 306, " ")
3252			if templ_7745c5c3_Err != nil {
3253				return templ_7745c5c3_Err
3254			}
3255			if p.Box.CanMarkRead {
3256				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 307, "<form method=\"post\" action=\"")
3257				if templ_7745c5c3_Err != nil {
3258					return templ_7745c5c3_Err
3259				}
3260				var templ_7745c5c3_Var153 templ.SafeURL
3261				templ_7745c5c3_Var153, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.ReadAction))
3262				if templ_7745c5c3_Err != nil {
3263					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 655, Col: 65}
3264				}
3265				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var153))
3266				if templ_7745c5c3_Err != nil {
3267					return templ_7745c5c3_Err
3268				}
3269				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 308, "\"><input type=\"hidden\" name=\"head_id\" value=\"")
3270				if templ_7745c5c3_Err != nil {
3271					return templ_7745c5c3_Err
3272				}
3273				var templ_7745c5c3_Var154 string
3274				templ_7745c5c3_Var154, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Box.Head)
3275				if templ_7745c5c3_Err != nil {
3276					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 656, Col: 60}
3277				}
3278				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var154)
3279				if templ_7745c5c3_Err != nil {
3280					return templ_7745c5c3_Err
3281				}
3282				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 309, "\"> <button type=\"submit\" title=\"the next visit can show only what changed after this head\" class=\"btn\" aria-keyshortcuts=\"Shift+R\" data-read>Mark read <kbd aria-hidden=\"true\">R</kbd></button></form>")
3283				if templ_7745c5c3_Err != nil {
3284					return templ_7745c5c3_Err
3285				}
3286			}
3287			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 310, " <form method=\"post\" action=\"")
3288			if templ_7745c5c3_Err != nil {
3289				return templ_7745c5c3_Err
3290			}
3291			var templ_7745c5c3_Var155 templ.SafeURL
3292			templ_7745c5c3_Var155, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Box.CloseAction))
3293			if templ_7745c5c3_Err != nil {
3294				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 660, Col: 65}
3295			}
3296			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var155))
3297			if templ_7745c5c3_Err != nil {
3298				return templ_7745c5c3_Err
3299			}
3300			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 311, "\"><button type=\"submit\" title=\"close without merging; the branch is kept\" class=\"btn danger\">Close</button></form>")
3301			if templ_7745c5c3_Err != nil {
3302				return templ_7745c5c3_Err
3303			}
3304			if !p.Box.HeadGone && p.Box.ReadyAction == "" {
3305				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 312, "<details class=\"d-or\"><summary class=\"mute\">or from a terminal</summary>")
3306				if templ_7745c5c3_Err != nil {
3307					return templ_7745c5c3_Err
3308				}
3309				templ_7745c5c3_Err = CloneBlock(p.Box.CLI).Render(ctx, templ_7745c5c3_Buffer)
3310				if templ_7745c5c3_Err != nil {
3311					return templ_7745c5c3_Err
3312				}
3313				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 313, "</details>")
3314				if templ_7745c5c3_Err != nil {
3315					return templ_7745c5c3_Err
3316				}
3317			}
3318		}
3319		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 314, "</div></details>")
3320		if templ_7745c5c3_Err != nil {
3321			return templ_7745c5c3_Err
3322		}
3323		return nil
3324	})
3325}
3326
3327func Compare(l Layout, p ComparePage) templ.Component {
3328	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3329		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3330		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3331			return templ_7745c5c3_CtxErr
3332		}
3333		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3334		if !templ_7745c5c3_IsBuffer {
3335			defer func() {
3336				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3337				if templ_7745c5c3_Err == nil {
3338					templ_7745c5c3_Err = templ_7745c5c3_BufErr
3339				}
3340			}()
3341		}
3342		ctx = templ.InitializeContext(ctx)
3343		templ_7745c5c3_Var156 := templ.GetChildren(ctx)
3344		if templ_7745c5c3_Var156 == nil {
3345			templ_7745c5c3_Var156 = templ.NopComponent
3346		}
3347		ctx = templ.ClearChildren(ctx)
3348		templ_7745c5c3_Var157 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3349			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3350			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3351			if !templ_7745c5c3_IsBuffer {
3352				defer func() {
3353					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3354					if templ_7745c5c3_Err == nil {
3355						templ_7745c5c3_Err = templ_7745c5c3_BufErr
3356					}
3357				}()
3358			}
3359			ctx = templ.InitializeContext(ctx)
3360			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 315, "<header class=\"show mr-h\"><h1>")
3361			if templ_7745c5c3_Err != nil {
3362				return templ_7745c5c3_Err
3363			}
3364			var templ_7745c5c3_Var158 string
3365			templ_7745c5c3_Var158, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
3366			if templ_7745c5c3_Err != nil {
3367				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 677, Col: 17}
3368			}
3369			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var158))
3370			if templ_7745c5c3_Err != nil {
3371				return templ_7745c5c3_Err
3372			}
3373			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 316, " → ")
3374			if templ_7745c5c3_Err != nil {
3375				return templ_7745c5c3_Err
3376			}
3377			var templ_7745c5c3_Var159 string
3378			templ_7745c5c3_Var159, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3379			if templ_7745c5c3_Err != nil {
3380				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 677, Col: 34}
3381			}
3382			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var159))
3383			if templ_7745c5c3_Err != nil {
3384				return templ_7745c5c3_Err
3385			}
3386			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 317, "</h1><dl class=\"kv show-kv\"><dt>branch</dt><dd><a href=\"")
3387			if templ_7745c5c3_Err != nil {
3388				return templ_7745c5c3_Err
3389			}
3390			var templ_7745c5c3_Var160 templ.SafeURL
3391			templ_7745c5c3_Var160, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.SourceHref))
3392			if templ_7745c5c3_Err != nil {
3393				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 680, Col: 45}
3394			}
3395			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var160))
3396			if templ_7745c5c3_Err != nil {
3397				return templ_7745c5c3_Err
3398			}
3399			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 318, "\">")
3400			if templ_7745c5c3_Err != nil {
3401				return templ_7745c5c3_Err
3402			}
3403			var templ_7745c5c3_Var161 string
3404			templ_7745c5c3_Var161, templ_7745c5c3_Err = templ.JoinStringErrs(p.Source)
3405			if templ_7745c5c3_Err != nil {
3406				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 680, Col: 58}
3407			}
3408			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var161))
3409			if templ_7745c5c3_Err != nil {
3410				return templ_7745c5c3_Err
3411			}
3412			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 319, "</a></dd><dt>target</dt><dd><a href=\"")
3413			if templ_7745c5c3_Err != nil {
3414				return templ_7745c5c3_Err
3415			}
3416			var templ_7745c5c3_Var162 templ.SafeURL
3417			templ_7745c5c3_Var162, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.TargetHref))
3418			if templ_7745c5c3_Err != nil {
3419				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 682, Col: 45}
3420			}
3421			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var162))
3422			if templ_7745c5c3_Err != nil {
3423				return templ_7745c5c3_Err
3424			}
3425			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 320, "\">")
3426			if templ_7745c5c3_Err != nil {
3427				return templ_7745c5c3_Err
3428			}
3429			var templ_7745c5c3_Var163 string
3430			templ_7745c5c3_Var163, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3431			if templ_7745c5c3_Err != nil {
3432				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 682, Col: 58}
3433			}
3434			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var163))
3435			if templ_7745c5c3_Err != nil {
3436				return templ_7745c5c3_Err
3437			}
3438			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 321, "</a></dd><dt>ahead</dt><dd>")
3439			if templ_7745c5c3_Err != nil {
3440				return templ_7745c5c3_Err
3441			}
3442			var templ_7745c5c3_Var164 string
3443			templ_7745c5c3_Var164, templ_7745c5c3_Err = templ.JoinStringErrs(p.AheadText)
3444			if templ_7745c5c3_Err != nil {
3445				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 684, Col: 21}
3446			}
3447			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var164))
3448			if templ_7745c5c3_Err != nil {
3449				return templ_7745c5c3_Err
3450			}
3451			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 322, "</dd></dl></header>")
3452			if templ_7745c5c3_Err != nil {
3453				return templ_7745c5c3_Err
3454			}
3455			if p.Note != "" {
3456				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 323, "<p class=\"notice\">")
3457				if templ_7745c5c3_Err != nil {
3458					return templ_7745c5c3_Err
3459				}
3460				var templ_7745c5c3_Var165 string
3461				templ_7745c5c3_Var165, templ_7745c5c3_Err = templ.JoinStringErrs(p.Note)
3462				if templ_7745c5c3_Err != nil {
3463					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 688, Col: 29}
3464				}
3465				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var165))
3466				if templ_7745c5c3_Err != nil {
3467					return templ_7745c5c3_Err
3468				}
3469				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 324, "</p>")
3470				if templ_7745c5c3_Err != nil {
3471					return templ_7745c5c3_Err
3472				}
3473			}
3474			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 325, " ")
3475			if templ_7745c5c3_Err != nil {
3476				return templ_7745c5c3_Err
3477			}
3478			if p.Existing != nil {
3479				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 326, "<p class=\"notice\">an open merge request already covers these branches: <a href=\"")
3480				if templ_7745c5c3_Err != nil {
3481					return templ_7745c5c3_Err
3482				}
3483				var templ_7745c5c3_Var166 templ.SafeURL
3484				templ_7745c5c3_Var166, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Existing.Href))
3485				if templ_7745c5c3_Err != nil {
3486					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 691, Col: 114}
3487				}
3488				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var166))
3489				if templ_7745c5c3_Err != nil {
3490					return templ_7745c5c3_Err
3491				}
3492				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 327, "\">")
3493				if templ_7745c5c3_Err != nil {
3494					return templ_7745c5c3_Err
3495				}
3496				var templ_7745c5c3_Var167 string
3497				templ_7745c5c3_Var167, templ_7745c5c3_Err = templ.JoinStringErrs(p.Existing.Label)
3498				if templ_7745c5c3_Err != nil {
3499					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 691, Col: 135}
3500				}
3501				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var167))
3502				if templ_7745c5c3_Err != nil {
3503					return templ_7745c5c3_Err
3504				}
3505				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 328, "</a></p>")
3506				if templ_7745c5c3_Err != nil {
3507					return templ_7745c5c3_Err
3508				}
3509			}
3510			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 329, " ")
3511			if templ_7745c5c3_Err != nil {
3512				return templ_7745c5c3_Err
3513			}
3514			if p.Create != nil {
3515				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 330, "<form class=\"cform create\" method=\"post\" action=\"")
3516				if templ_7745c5c3_Err != nil {
3517					return templ_7745c5c3_Err
3518				}
3519				var templ_7745c5c3_Var168 templ.SafeURL
3520				templ_7745c5c3_Var168, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.Create.Action))
3521				if templ_7745c5c3_Err != nil {
3522					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 694, Col: 83}
3523				}
3524				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var168))
3525				if templ_7745c5c3_Err != nil {
3526					return templ_7745c5c3_Err
3527				}
3528				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 331, "\"><input type=\"hidden\" name=\"source\" value=\"")
3529				if templ_7745c5c3_Err != nil {
3530					return templ_7745c5c3_Err
3531				}
3532				var templ_7745c5c3_Var169 string
3533				templ_7745c5c3_Var169, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Source)
3534				if templ_7745c5c3_Err != nil {
3535					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 695, Col: 62}
3536				}
3537				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var169)
3538				if templ_7745c5c3_Err != nil {
3539					return templ_7745c5c3_Err
3540				}
3541				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 332, "\"> <input type=\"hidden\" name=\"target\" value=\"")
3542				if templ_7745c5c3_Err != nil {
3543					return templ_7745c5c3_Err
3544				}
3545				var templ_7745c5c3_Var170 string
3546				templ_7745c5c3_Var170, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Target)
3547				if templ_7745c5c3_Err != nil {
3548					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 696, Col: 62}
3549				}
3550				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var170)
3551				if templ_7745c5c3_Err != nil {
3552					return templ_7745c5c3_Err
3553				}
3554				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 333, "\"> <label for=\"mr-title\">title</label> <input id=\"mr-title\" name=\"title\" type=\"text\" maxlength=\"120\" required value=\"")
3555				if templ_7745c5c3_Err != nil {
3556					return templ_7745c5c3_Err
3557				}
3558				var templ_7745c5c3_Var171 string
3559				templ_7745c5c3_Var171, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.Create.Title)
3560				if templ_7745c5c3_Err != nil {
3561					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 698, Col: 97}
3562				}
3563				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var171)
3564				if templ_7745c5c3_Err != nil {
3565					return templ_7745c5c3_Err
3566				}
3567				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 334, "\" autocomplete=\"off\"> <label for=\"mr-desc\">description</label> <textarea id=\"mr-desc\" name=\"description\" rows=\"4\" maxlength=\"8000\" placeholder=\"Markdown, optional\"></textarea><div class=\"f-btns\"><button type=\"submit\" class=\"btn primary\">Create merge request</button></div></form>")
3568				if templ_7745c5c3_Err != nil {
3569					return templ_7745c5c3_Err
3570				}
3571			}
3572			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 335, " ")
3573			if templ_7745c5c3_Err != nil {
3574				return templ_7745c5c3_Err
3575			}
3576			if p.HasDiff {
3577				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 336, "<div class=\"diff-tools\" role=\"group\" aria-label=\"Diff view\"><span class=\"dim\">")
3578				if templ_7745c5c3_Err != nil {
3579					return templ_7745c5c3_Err
3580				}
3581				var templ_7745c5c3_Var172 string
3582				templ_7745c5c3_Var172, templ_7745c5c3_Err = templ.JoinStringErrs(plural(p.NFiles, "file", "files"))
3583				if templ_7745c5c3_Err != nil {
3584					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 708, Col: 57}
3585				}
3586				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var172))
3587				if templ_7745c5c3_Err != nil {
3588					return templ_7745c5c3_Err
3589				}
3590				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 337, " · <span class=\"plus\">+")
3591				if templ_7745c5c3_Err != nil {
3592					return templ_7745c5c3_Err
3593				}
3594				var templ_7745c5c3_Var173 string
3595				templ_7745c5c3_Var173, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Adds))
3596				if templ_7745c5c3_Err != nil {
3597					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 708, Col: 97}
3598				}
3599				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var173))
3600				if templ_7745c5c3_Err != nil {
3601					return templ_7745c5c3_Err
3602				}
3603				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 338, "</span> <span class=\"minus\">-")
3604				if templ_7745c5c3_Err != nil {
3605					return templ_7745c5c3_Err
3606				}
3607				var templ_7745c5c3_Var174 string
3608				templ_7745c5c3_Var174, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(p.Dels))
3609				if templ_7745c5c3_Err != nil {
3610					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 708, Col: 142}
3611				}
3612				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var174))
3613				if templ_7745c5c3_Err != nil {
3614					return templ_7745c5c3_Err
3615				}
3616				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 339, "</span></span> <span class=\"grow\"></span>")
3617				if templ_7745c5c3_Err != nil {
3618					return templ_7745c5c3_Err
3619				}
3620				templ_7745c5c3_Err = diffViewMenu(p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
3621				if templ_7745c5c3_Err != nil {
3622					return templ_7745c5c3_Err
3623				}
3624				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 340, "</div>")
3625				if templ_7745c5c3_Err != nil {
3626					return templ_7745c5c3_Err
3627				}
3628				if p.Invisible {
3629					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 341, "<p class=\"notice\">this diff holds invisible characters (direction controls, zero-width characters). They are shown as <span class=\"inv\">&lt;U+XXXX&gt;</span> markers, never applied.</p>")
3630					if templ_7745c5c3_Err != nil {
3631						return templ_7745c5c3_Err
3632					}
3633				}
3634				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 342, " <div id=\"diffs\"")
3635				if templ_7745c5c3_Err != nil {
3636					return templ_7745c5c3_Err
3637				}
3638				if p.Both {
3639					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 343, " data-diff=\"")
3640					if templ_7745c5c3_Err != nil {
3641						return templ_7745c5c3_Err
3642					}
3643					var templ_7745c5c3_Var175 string
3644					templ_7745c5c3_Var175, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
3645					if templ_7745c5c3_Err != nil {
3646						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 721, Col: 23}
3647					}
3648					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var175)
3649					if templ_7745c5c3_Err != nil {
3650						return templ_7745c5c3_Err
3651					}
3652					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 344, "\"")
3653					if templ_7745c5c3_Err != nil {
3654						return templ_7745c5c3_Err
3655					}
3656				} else {
3657					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 345, " data-view=\"")
3658					if templ_7745c5c3_Err != nil {
3659						return templ_7745c5c3_Err
3660					}
3661					var templ_7745c5c3_Var176 string
3662					templ_7745c5c3_Var176, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.View)
3663					if templ_7745c5c3_Err != nil {
3664						return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 723, Col: 23}
3665					}
3666					_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var176)
3667					if templ_7745c5c3_Err != nil {
3668						return templ_7745c5c3_Err
3669					}
3670					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 346, "\"")
3671					if templ_7745c5c3_Err != nil {
3672						return templ_7745c5c3_Err
3673					}
3674				}
3675				if p.Both && !p.Pinned {
3676					templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 347, " hx-live=\"this.dataset.diff = sessionStorage.getItem('diff') || this.dataset.diff\"")
3677					if templ_7745c5c3_Err != nil {
3678						return templ_7745c5c3_Err
3679					}
3680				}
3681				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 348, ">")
3682				if templ_7745c5c3_Err != nil {
3683					return templ_7745c5c3_Err
3684				}
3685				for _, f := range p.Files {
3686					templ_7745c5c3_Err = DiffFileView(f, p.DiffView).Render(ctx, templ_7745c5c3_Buffer)
3687					if templ_7745c5c3_Err != nil {
3688						return templ_7745c5c3_Err
3689					}
3690				}
3691				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 349, "</div>")
3692				if templ_7745c5c3_Err != nil {
3693					return templ_7745c5c3_Err
3694				}
3695			}
3696			return nil
3697		})
3698		templ_7745c5c3_Err = Shell(l, compareRail(p)).Render(templ.WithChildren(ctx, templ_7745c5c3_Var157), templ_7745c5c3_Buffer)
3699		if templ_7745c5c3_Err != nil {
3700			return templ_7745c5c3_Err
3701		}
3702		return nil
3703	})
3704}
3705
3706func compareRail(p ComparePage) templ.Component {
3707	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3708		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3709		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3710			return templ_7745c5c3_CtxErr
3711		}
3712		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3713		if !templ_7745c5c3_IsBuffer {
3714			defer func() {
3715				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3716				if templ_7745c5c3_Err == nil {
3717					templ_7745c5c3_Err = templ_7745c5c3_BufErr
3718				}
3719			}()
3720		}
3721		ctx = templ.InitializeContext(ctx)
3722		templ_7745c5c3_Var177 := templ.GetChildren(ctx)
3723		if templ_7745c5c3_Var177 == nil {
3724			templ_7745c5c3_Var177 = templ.NopComponent
3725		}
3726		ctx = templ.ClearChildren(ctx)
3727		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 350, "<section aria-labelledby=\"r-ahead\"><h2 id=\"r-ahead\">Commits <span class=\"count\">")
3728		if templ_7745c5c3_Err != nil {
3729			return templ_7745c5c3_Err
3730		}
3731		var templ_7745c5c3_Var178 string
3732		templ_7745c5c3_Var178, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Ahead)))
3733		if templ_7745c5c3_Err != nil {
3734			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 739, Col: 67}
3735		}
3736		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var178))
3737		if templ_7745c5c3_Err != nil {
3738			return templ_7745c5c3_Err
3739		}
3740		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 351, "</span></h2><ul class=\"pcommits\">")
3741		if templ_7745c5c3_Err != nil {
3742			return templ_7745c5c3_Err
3743		}
3744		for _, c := range p.Ahead {
3745			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 352, "<li><a href=\"")
3746			if templ_7745c5c3_Err != nil {
3747				return templ_7745c5c3_Err
3748			}
3749			var templ_7745c5c3_Var179 templ.SafeURL
3750			templ_7745c5c3_Var179, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(c.CHref))
3751			if templ_7745c5c3_Err != nil {
3752				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 743, Col: 37}
3753			}
3754			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var179))
3755			if templ_7745c5c3_Err != nil {
3756				return templ_7745c5c3_Err
3757			}
3758			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 353, "\">")
3759			if templ_7745c5c3_Err != nil {
3760				return templ_7745c5c3_Err
3761			}
3762			var templ_7745c5c3_Var180 string
3763			templ_7745c5c3_Var180, templ_7745c5c3_Err = templ.JoinStringErrs(c.Short)
3764			if templ_7745c5c3_Err != nil {
3765				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 743, Col: 49}
3766			}
3767			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var180))
3768			if templ_7745c5c3_Err != nil {
3769				return templ_7745c5c3_Err
3770			}
3771			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 354, "</a> <span class=\"s\">")
3772			if templ_7745c5c3_Err != nil {
3773				return templ_7745c5c3_Err
3774			}
3775			var templ_7745c5c3_Var181 string
3776			templ_7745c5c3_Var181, templ_7745c5c3_Err = templ.JoinStringErrs(c.Subject)
3777			if templ_7745c5c3_Err != nil {
3778				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 744, Col: 32}
3779			}
3780			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var181))
3781			if templ_7745c5c3_Err != nil {
3782				return templ_7745c5c3_Err
3783			}
3784			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 355, "</span> <span class=\"mute\">")
3785			if templ_7745c5c3_Err != nil {
3786				return templ_7745c5c3_Err
3787			}
3788			var templ_7745c5c3_Var182 string
3789			templ_7745c5c3_Var182, templ_7745c5c3_Err = templ.JoinStringErrs(c.Author)
3790			if templ_7745c5c3_Err != nil {
3791				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 746, Col: 16}
3792			}
3793			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var182))
3794			if templ_7745c5c3_Err != nil {
3795				return templ_7745c5c3_Err
3796			}
3797			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 356, " ")
3798			if templ_7745c5c3_Err != nil {
3799				return templ_7745c5c3_Err
3800			}
3801			if c.WhenAt != "" {
3802				var templ_7745c5c3_Var183 string
3803				templ_7745c5c3_Var183, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
3804				if templ_7745c5c3_Err != nil {
3805					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 748, Col: 15}
3806				}
3807				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var183))
3808				if templ_7745c5c3_Err != nil {
3809					return templ_7745c5c3_Err
3810				}
3811				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 357, "<time datetime=\"")
3812				if templ_7745c5c3_Err != nil {
3813					return templ_7745c5c3_Err
3814				}
3815				var templ_7745c5c3_Var184 string
3816				templ_7745c5c3_Var184, templ_7745c5c3_Err = templ.ResolveAttributeValue(c.WhenAt)
3817				if templ_7745c5c3_Err != nil {
3818					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 748, Col: 42}
3819				}
3820				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var184)
3821				if templ_7745c5c3_Err != nil {
3822					return templ_7745c5c3_Err
3823				}
3824				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 358, "\">")
3825				if templ_7745c5c3_Err != nil {
3826					return templ_7745c5c3_Err
3827				}
3828				var templ_7745c5c3_Var185 string
3829				templ_7745c5c3_Var185, templ_7745c5c3_Err = templ.JoinStringErrs(c.When)
3830				if templ_7745c5c3_Err != nil {
3831					return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 748, Col: 53}
3832				}
3833				_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var185))
3834				if templ_7745c5c3_Err != nil {
3835					return templ_7745c5c3_Err
3836				}
3837				templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 359, "</time>")
3838				if templ_7745c5c3_Err != nil {
3839					return templ_7745c5c3_Err
3840				}
3841			}
3842			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 360, "</span></li>")
3843			if templ_7745c5c3_Err != nil {
3844				return templ_7745c5c3_Err
3845			}
3846		}
3847		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 361, "</ul>")
3848		if templ_7745c5c3_Err != nil {
3849			return templ_7745c5c3_Err
3850		}
3851		if len(p.Ahead) == 0 {
3852			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 362, "<p class=\"dim\">no commit ahead of ")
3853			if templ_7745c5c3_Err != nil {
3854				return templ_7745c5c3_Err
3855			}
3856			var templ_7745c5c3_Var186 string
3857			templ_7745c5c3_Var186, templ_7745c5c3_Err = templ.JoinStringErrs(p.Target)
3858			if templ_7745c5c3_Err != nil {
3859				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 755, Col: 47}
3860			}
3861			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var186))
3862			if templ_7745c5c3_Err != nil {
3863				return templ_7745c5c3_Err
3864			}
3865			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 363, ".</p>")
3866			if templ_7745c5c3_Err != nil {
3867				return templ_7745c5c3_Err
3868			}
3869		}
3870		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 364, "</section>")
3871		if templ_7745c5c3_Err != nil {
3872			return templ_7745c5c3_Err
3873		}
3874		if p.HasDiff {
3875			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 365, "<section aria-labelledby=\"r-files\"><h2 id=\"r-files\">Files <span class=\"count\">")
3876			if templ_7745c5c3_Err != nil {
3877				return templ_7745c5c3_Err
3878			}
3879			var templ_7745c5c3_Var187 string
3880			templ_7745c5c3_Var187, templ_7745c5c3_Err = templ.JoinStringErrs(itoa(len(p.Files)))
3881			if templ_7745c5c3_Err != nil {
3882				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 760, Col: 66}
3883			}
3884			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var187))
3885			if templ_7745c5c3_Err != nil {
3886				return templ_7745c5c3_Err
3887			}
3888			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 366, "</span></h2>")
3889			if templ_7745c5c3_Err != nil {
3890				return templ_7745c5c3_Err
3891			}
3892			templ_7745c5c3_Err = FileList(p.Files).Render(ctx, templ_7745c5c3_Buffer)
3893			if templ_7745c5c3_Err != nil {
3894				return templ_7745c5c3_Err
3895			}
3896			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 367, "</section>")
3897			if templ_7745c5c3_Err != nil {
3898				return templ_7745c5c3_Err
3899			}
3900		}
3901		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 368, "<section aria-labelledby=\"r-cli\"><h2 id=\"r-cli\">From a terminal</h2>")
3902		if templ_7745c5c3_Err != nil {
3903			return templ_7745c5c3_Err
3904		}
3905		templ_7745c5c3_Err = CloneBlock(p.CLI).Render(ctx, templ_7745c5c3_Buffer)
3906		if templ_7745c5c3_Err != nil {
3907			return templ_7745c5c3_Err
3908		}
3909		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 369, "</section>")
3910		if templ_7745c5c3_Err != nil {
3911			return templ_7745c5c3_Err
3912		}
3913		return nil
3914	})
3915}
3916
3917// MRMergeChecks is the part of the owner's merge form that depends on the
3918// checks: a live update replaces it and keeps "Ignore checks" ticked.
3919func MRMergeChecks(c ChecksSummary) templ.Component {
3920	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3921		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3922		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3923			return templ_7745c5c3_CtxErr
3924		}
3925		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3926		if !templ_7745c5c3_IsBuffer {
3927			defer func() {
3928				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3929				if templ_7745c5c3_Err == nil {
3930					templ_7745c5c3_Err = templ_7745c5c3_BufErr
3931				}
3932			}()
3933		}
3934		ctx = templ.InitializeContext(ctx)
3935		templ_7745c5c3_Var188 := templ.GetChildren(ctx)
3936		if templ_7745c5c3_Var188 == nil {
3937			templ_7745c5c3_Var188 = templ.NopComponent
3938		}
3939		ctx = templ.ClearChildren(ctx)
3940		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 370, "<div id=\"mr-merge-checks\" data-keep-checks>")
3941		if templ_7745c5c3_Err != nil {
3942			return templ_7745c5c3_Err
3943		}
3944		if c.Kind == "bad" || c.Kind == "running" {
3945			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 371, "<p class=\"d-note\">")
3946			if templ_7745c5c3_Err != nil {
3947				return templ_7745c5c3_Err
3948			}
3949			var templ_7745c5c3_Var189 string
3950			templ_7745c5c3_Var189, templ_7745c5c3_Err = templ.JoinStringErrs(c.State + ": a failing or unfinished check blocks the merge.")
3951			if templ_7745c5c3_Err != nil {
3952				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 775, Col: 84}
3953			}
3954			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var189))
3955			if templ_7745c5c3_Err != nil {
3956				return templ_7745c5c3_Err
3957			}
3958			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 372, "</p><label class=\"d-check\"><input type=\"checkbox\" name=\"ignore_checks\"> Ignore checks</label>")
3959			if templ_7745c5c3_Err != nil {
3960				return templ_7745c5c3_Err
3961			}
3962		}
3963		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 373, "</div>")
3964		if templ_7745c5c3_Err != nil {
3965			return templ_7745c5c3_Err
3966		}
3967		return nil
3968	})
3969}
3970
3971// MRStateFragment updates only state and actions, leaving review drafts alone.
3972func MRStateFragment(p MRPage) templ.Component {
3973	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
3974		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
3975		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
3976			return templ_7745c5c3_CtxErr
3977		}
3978		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
3979		if !templ_7745c5c3_IsBuffer {
3980			defer func() {
3981				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
3982				if templ_7745c5c3_Err == nil {
3983					templ_7745c5c3_Err = templ_7745c5c3_BufErr
3984				}
3985			}()
3986		}
3987		ctx = templ.InitializeContext(ctx)
3988		templ_7745c5c3_Var190 := templ.GetChildren(ctx)
3989		if templ_7745c5c3_Var190 == nil {
3990			templ_7745c5c3_Var190 = templ.NopComponent
3991		}
3992		ctx = templ.ClearChildren(ctx)
3993		templ_7745c5c3_Err = mrState(p).Render(ctx, templ_7745c5c3_Buffer)
3994		if templ_7745c5c3_Err != nil {
3995			return templ_7745c5c3_Err
3996		}
3997		templ_7745c5c3_Err = mrActions(p, true).Render(ctx, templ_7745c5c3_Buffer)
3998		if templ_7745c5c3_Err != nil {
3999			return templ_7745c5c3_Err
4000		}
4001		return nil
4002	})
4003}
4004
4005func mrState(p MRPage) templ.Component {
4006	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
4007		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
4008		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
4009			return templ_7745c5c3_CtxErr
4010		}
4011		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
4012		if !templ_7745c5c3_IsBuffer {
4013			defer func() {
4014				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
4015				if templ_7745c5c3_Err == nil {
4016					templ_7745c5c3_Err = templ_7745c5c3_BufErr
4017				}
4018			}()
4019		}
4020		ctx = templ.InitializeContext(ctx)
4021		templ_7745c5c3_Var191 := templ.GetChildren(ctx)
4022		if templ_7745c5c3_Var191 == nil {
4023			templ_7745c5c3_Var191 = templ.NopComponent
4024		}
4025		ctx = templ.ClearChildren(ctx)
4026		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 374, "<dd id=\"mr-state\" hx-swap-oob=\"true\" class=\"mr-state\" data-state=\"")
4027		if templ_7745c5c3_Err != nil {
4028			return templ_7745c5c3_Err
4029		}
4030		var templ_7745c5c3_Var192 string
4031		templ_7745c5c3_Var192, templ_7745c5c3_Err = templ.ResolveAttributeValue(p.State)
4032		if templ_7745c5c3_Err != nil {
4033			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 788, Col: 75}
4034		}
4035		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var192)
4036		if templ_7745c5c3_Err != nil {
4037			return templ_7745c5c3_Err
4038		}
4039		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 375, "\">")
4040		if templ_7745c5c3_Err != nil {
4041			return templ_7745c5c3_Err
4042		}
4043		var templ_7745c5c3_Var193 string
4044		templ_7745c5c3_Var193, templ_7745c5c3_Err = templ.JoinStringErrs(p.State)
4045		if templ_7745c5c3_Err != nil {
4046			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 789, Col: 11}
4047		}
4048		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var193))
4049		if templ_7745c5c3_Err != nil {
4050			return templ_7745c5c3_Err
4051		}
4052		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 376, " ")
4053		if templ_7745c5c3_Err != nil {
4054			return templ_7745c5c3_Err
4055		}
4056		if p.MergedShort != "" {
4057			var templ_7745c5c3_Var194 string
4058			templ_7745c5c3_Var194, templ_7745c5c3_Err = templ.JoinStringErrs(" · ")
4059			if templ_7745c5c3_Err != nil {
4060				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 791, Col: 11}
4061			}
4062			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var194))
4063			if templ_7745c5c3_Err != nil {
4064				return templ_7745c5c3_Err
4065			}
4066			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 377, "<a href=\"")
4067			if templ_7745c5c3_Err != nil {
4068				return templ_7745c5c3_Err
4069			}
4070			var templ_7745c5c3_Var195 templ.SafeURL
4071			templ_7745c5c3_Var195, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(p.MergedHref))
4072			if templ_7745c5c3_Err != nil {
4073				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 791, Col: 50}
4074			}
4075			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var195))
4076			if templ_7745c5c3_Err != nil {
4077				return templ_7745c5c3_Err
4078			}
4079			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 378, "\">")
4080			if templ_7745c5c3_Err != nil {
4081				return templ_7745c5c3_Err
4082			}
4083			var templ_7745c5c3_Var196 string
4084			templ_7745c5c3_Var196, templ_7745c5c3_Err = templ.JoinStringErrs(p.MergedShort)
4085			if templ_7745c5c3_Err != nil {
4086				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 791, Col: 68}
4087			}
4088			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var196))
4089			if templ_7745c5c3_Err != nil {
4090				return templ_7745c5c3_Err
4091			}
4092			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 379, "</a>")
4093			if templ_7745c5c3_Err != nil {
4094				return templ_7745c5c3_Err
4095			}
4096			var templ_7745c5c3_Var197 string
4097			templ_7745c5c3_Var197, templ_7745c5c3_Err = templ.JoinStringErrs(" · " + p.MergeMode)
4098			if templ_7745c5c3_Err != nil {
4099				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 791, Col: 96}
4100			}
4101			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var197))
4102			if templ_7745c5c3_Err != nil {
4103				return templ_7745c5c3_Err
4104			}
4105		}
4106		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 380, "</dd>")
4107		if templ_7745c5c3_Err != nil {
4108			return templ_7745c5c3_Err
4109		}
4110		return nil
4111	})
4112}
4113
4114func mrActions(p MRPage, fragment bool) templ.Component {
4115	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
4116		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
4117		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
4118			return templ_7745c5c3_CtxErr
4119		}
4120		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
4121		if !templ_7745c5c3_IsBuffer {
4122			defer func() {
4123				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
4124				if templ_7745c5c3_Err == nil {
4125					templ_7745c5c3_Err = templ_7745c5c3_BufErr
4126				}
4127			}()
4128		}
4129		ctx = templ.InitializeContext(ctx)
4130		templ_7745c5c3_Var198 := templ.GetChildren(ctx)
4131		if templ_7745c5c3_Var198 == nil {
4132			templ_7745c5c3_Var198 = templ.NopComponent
4133		}
4134		ctx = templ.ClearChildren(ctx)
4135		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 381, "<div id=\"mr-actions\" hx-swap-oob=\"true\" class=\"mr-acts\">")
4136		if templ_7745c5c3_Err != nil {
4137			return templ_7745c5c3_Err
4138		}
4139		templ_7745c5c3_Err = MRChecksSum(p.ChecksSum).Render(ctx, templ_7745c5c3_Buffer)
4140		if templ_7745c5c3_Err != nil {
4141			return templ_7745c5c3_Err
4142		}
4143		if p.Box != nil {
4144			templ_7745c5c3_Err = mergeMenu(p).Render(ctx, templ_7745c5c3_Buffer)
4145			if templ_7745c5c3_Err != nil {
4146				return templ_7745c5c3_Err
4147			}
4148		}
4149		templ_7745c5c3_Err = moreMenu(p).Render(ctx, templ_7745c5c3_Buffer)
4150		if templ_7745c5c3_Err != nil {
4151			return templ_7745c5c3_Err
4152		}
4153		if fragment && p.MergeError != "" {
4154			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 382, "<p class=\"d-err\" role=\"alert\">")
4155			if templ_7745c5c3_Err != nil {
4156				return templ_7745c5c3_Err
4157			}
4158			var templ_7745c5c3_Var199 string
4159			templ_7745c5c3_Var199, templ_7745c5c3_Err = templ.JoinStringErrs(p.MergeError)
4160			if templ_7745c5c3_Err != nil {
4161				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 804, Col: 47}
4162			}
4163			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var199))
4164			if templ_7745c5c3_Err != nil {
4165				return templ_7745c5c3_Err
4166			}
4167			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 383, "</p>")
4168			if templ_7745c5c3_Err != nil {
4169				return templ_7745c5c3_Err
4170			}
4171		}
4172		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 384, "</div>")
4173		if templ_7745c5c3_Err != nil {
4174			return templ_7745c5c3_Err
4175		}
4176		return nil
4177	})
4178}
4179
4180// MRActionStatus remains visible even when the request detail cannot be read.
4181func MRActionStatus(message, href string) templ.Component {
4182	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
4183		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
4184		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
4185			return templ_7745c5c3_CtxErr
4186		}
4187		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
4188		if !templ_7745c5c3_IsBuffer {
4189			defer func() {
4190				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
4191				if templ_7745c5c3_Err == nil {
4192					templ_7745c5c3_Err = templ_7745c5c3_BufErr
4193				}
4194			}()
4195		}
4196		ctx = templ.InitializeContext(ctx)
4197		templ_7745c5c3_Var200 := templ.GetChildren(ctx)
4198		if templ_7745c5c3_Var200 == nil {
4199			templ_7745c5c3_Var200 = templ.NopComponent
4200		}
4201		ctx = templ.ClearChildren(ctx)
4202		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 385, "<div id=\"mr-actions\" class=\"mr-acts\" hx-swap-oob=\"true\"><p class=\"d-err\" role=\"alert\">")
4203		if templ_7745c5c3_Err != nil {
4204			return templ_7745c5c3_Err
4205		}
4206		var templ_7745c5c3_Var201 string
4207		templ_7745c5c3_Var201, templ_7745c5c3_Err = templ.JoinStringErrs(message)
4208		if templ_7745c5c3_Err != nil {
4209			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 812, Col: 40}
4210		}
4211		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var201))
4212		if templ_7745c5c3_Err != nil {
4213			return templ_7745c5c3_Err
4214		}
4215		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 386, " <a href=\"")
4216		if templ_7745c5c3_Err != nil {
4217			return templ_7745c5c3_Err
4218		}
4219		var templ_7745c5c3_Var202 templ.SafeURL
4220		templ_7745c5c3_Var202, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(href))
4221		if templ_7745c5c3_Err != nil {
4222			return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/adapters/web/mr.templ`, Line: 812, Col: 72}
4223		}
4224		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var202))
4225		if templ_7745c5c3_Err != nil {
4226			return templ_7745c5c3_Err
4227		}
4228		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 387, "\">reload</a></p></div>")
4229		if templ_7745c5c3_Err != nil {
4230			return templ_7745c5c3_Err
4231		}
4232		return nil
4233	})
4234}
4235
4236var _ = templruntime.GeneratedTemplate

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 4

Tags 45

↑↓ moveenter openesc close