edit_templ.go

 1// Code generated by templ - DO NOT EDIT.
 2
 3// templ: version: v0.3.1020
 4package pages
 5
 6//lint:file-ignore SA4006 This context is only used if a nested component is present.
 7
 8import "github.com/a-h/templ"
 9import templruntime "github.com/a-h/templ/runtime"
10
11func Edit(initData InitData) templ.Component {
12	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
13		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
14		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
15			return templ_7745c5c3_CtxErr
16		}
17		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
18		if !templ_7745c5c3_IsBuffer {
19			defer func() {
20				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
21				if templ_7745c5c3_Err == nil {
22					templ_7745c5c3_Err = templ_7745c5c3_BufErr
23				}
24			}()
25		}
26		ctx = templ.InitializeContext(ctx)
27		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
28		if templ_7745c5c3_Var1 == nil {
29			templ_7745c5c3_Var1 = templ.NopComponent
30		}
31		ctx = templ.ClearChildren(ctx)
32		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<!doctype html><html lang=\"en\"><head><meta charset=\"UTF-8\"><link rel=\"icon\" type=\"image/svg+xml\" href=\"")
33		if templ_7745c5c3_Err != nil {
34			return templ_7745c5c3_Err
35		}
36		var templ_7745c5c3_Var2 templ.SafeURL
37		templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinURLErrs(hashStatic("/static/favicon.svg"))
38		if templ_7745c5c3_Err != nil {
39			return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/edit.templ`, Line: 8, Col: 81}
40		}
41		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
42		if templ_7745c5c3_Err != nil {
43			return templ_7745c5c3_Err
44		}
45		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>RTW - Adventure Intelligence</title><script type=\"module\" crossorigin src=\"")
46		if templ_7745c5c3_Err != nil {
47			return templ_7745c5c3_Err
48		}
49		var templ_7745c5c3_Var3 string
50		templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.ResolveAttributeValue(hashStatic("/static/js/edit.js"))
51		if templ_7745c5c3_Err != nil {
52			return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/edit.templ`, Line: 11, Col: 75}
53		}
54		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var3)
55		if templ_7745c5c3_Err != nil {
56			return templ_7745c5c3_Err
57		}
58		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\"></script><link rel=\"stylesheet\" crossorigin href=\"")
59		if templ_7745c5c3_Err != nil {
60			return templ_7745c5c3_Err
61		}
62		var templ_7745c5c3_Var4 templ.SafeURL
63		templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinURLErrs(hashStatic("/static/css/edit.css"))
64		if templ_7745c5c3_Err != nil {
65			return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/edit.templ`, Line: 12, Col: 79}
66		}
67		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
68		if templ_7745c5c3_Err != nil {
69			return templ_7745c5c3_Err
70		}
71		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\"></head><body><div id=\"root\"></div><div id=\"summary\"></div>")
72		if templ_7745c5c3_Err != nil {
73			return templ_7745c5c3_Err
74		}
75		templ_7745c5c3_Err = templ.JSONScript("initdata", initData).Render(ctx, templ_7745c5c3_Buffer)
76		if templ_7745c5c3_Err != nil {
77			return templ_7745c5c3_Err
78		}
79		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "<script>\n              window.addEventListener('load', () => {\n                if ('serviceWorker' in navigator) {\n                  navigator.serviceWorker.register(")
80		if templ_7745c5c3_Err != nil {
81			return templ_7745c5c3_Err
82		}
83		templ_7745c5c3_Var5, templ_7745c5c3_Err := templruntime.ScriptContentOutsideStringLiteral(hashStatic("/static/js/sw.js"))
84		if templ_7745c5c3_Err != nil {
85			return templ.Error{Err: templ_7745c5c3_Err, FileName: `pages/edit.templ`, Line: 21, Col: 84}
86		}
87		_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5)
88		if templ_7745c5c3_Err != nil {
89			return templ_7745c5c3_Err
90		}
91		templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, ").then(() => {\n                    console.info('Service worker registered!');\n                  }).catch((error) => {\n                    console.warn(`Error registering service worker:\\n${error}.`);\n                  });\n                }\n              });\n\t\t\t</script></body></html>")
92		if templ_7745c5c3_Err != nil {
93			return templ_7745c5c3_Err
94		}
95		return nil
96	})
97}
98
99var _ = templruntime.GeneratedTemplate