// Code generated by templ - DO NOT EDIT.

// templ: version: v0.3.943
package home

//lint:file-ignore SA4006 This context is only used if a nested component is present.

import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"

import (
	"github.com/bastean/codexgo/v4/internal/app/server/component/layout"
	"github.com/bastean/codexgo/v4/internal/app/server/component/scripts"
	"github.com/bastean/codexgo/v4/internal/app/server/service/captcha"
)

const (
	RegisterTabTagID = "tab-register"
	LoginTabTagID    = "tab-login"
	ForgotTabTagID   = "tab-forgot"
)

func ShowTab(tabTagID string) templ.ComponentScript {
	return templ.ComponentScript{
		Name: `__templ_ShowTab_be67`,
		Function: `function __templ_ShowTab_be67(tabTagID){$(` + "`" + `.ui.menu .right .item[data-tab=${tabTagID}]` + "`" + `)
        .trigger("click")
    ;
}`,
		Call:       templ.SafeScript(`__templ_ShowTab_be67`, tabTagID),
		CallInline: templ.SafeScriptInline(`__templ_ShowTab_be67`, tabTagID),
	}
}

func ShowModal(modalTagID string) templ.ComponentScript {
	return templ.ComponentScript{
		Name: `__templ_ShowModal_42f8`,
		Function: `function __templ_ShowModal_42f8(modalTagID){$(` + "`" + `#${modalTagID}` + "`" + `)
        .modal("show")
    ;
}`,
		Call:       templ.SafeScript(`__templ_ShowModal_42f8`, modalTagID),
		CallInline: templ.SafeScriptInline(`__templ_ShowModal_42f8`, modalTagID),
	}
}

func PageInit(verifyModalTagID, resetModalTagID string) templ.ComponentScript {
	return templ.ComponentScript{
		Name: `__templ_PageInit_e361`,
		Function: `function __templ_PageInit_e361(verifyModalTagID, resetModalTagID){$(".ui.container")
        .transition("fade in", "3s")
    ;

    $(".ui.container .column .menu .right .item")
        .tab({
            context: ".container"
        })
    ;

    $(".ui.cookie.nag")
        .nag({
            key: "accepts-cookies",
            value: true
        })
    ;

   if (window.location.pathname.includes("/verify")) {
        $(` + "`" + `#${verifyModalTagID}` + "`" + `)
            .modal({
                closable: false
            })
            .modal("show")
        ;
    }

   if (window.location.pathname.includes("/reset")) {
        $(` + "`" + `#${resetModalTagID}` + "`" + `)
            .modal({
                closable: false
            })
            .modal("show")
        ;
    }
}`,
		Call:       templ.SafeScript(`__templ_PageInit_e361`, verifyModalTagID, resetModalTagID),
		CallInline: templ.SafeScriptInline(`__templ_PageInit_e361`, verifyModalTagID, resetModalTagID),
	}
}

func Page(register, forgot *captcha.Captcha) templ.Component {
	return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
		templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
		if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
			return templ_7745c5c3_CtxErr
		}
		templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
		if !templ_7745c5c3_IsBuffer {
			defer func() {
				templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
				if templ_7745c5c3_Err == nil {
					templ_7745c5c3_Err = templ_7745c5c3_BufErr
				}
			}()
		}
		ctx = templ.InitializeContext(ctx)
		templ_7745c5c3_Var1 := templ.GetChildren(ctx)
		if templ_7745c5c3_Var1 == nil {
			templ_7745c5c3_Var1 = templ.NopComponent
		}
		ctx = templ.ClearChildren(ctx)
		templ_7745c5c3_Var2 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
			templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
			templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
			if !templ_7745c5c3_IsBuffer {
				defer func() {
					templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
					if templ_7745c5c3_Err == nil {
						templ_7745c5c3_Err = templ_7745c5c3_BufErr
					}
				}()
			}
			ctx = templ.InitializeContext(ctx)
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 1, "<div class=\"ui centered grid container\" style=\"height: 100%;\"><div class=\"sixteen wide column\"><div class=\"ui inverted secondary menu\"><div class=\"header item\"><a href=\"https://github.com/bastean/codexgo\" rel=\"noopener noreferrer\" target=\"_blank\"><img class=\"ui small image\" src=\"/public/static/assets/logo.png\"></a></div><div class=\"right menu\"><a class=\"blue item\" data-tab=\"")
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			var templ_7745c5c3_Var3 string
			templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(LoginTabTagID)
			if templ_7745c5c3_Err != nil {
				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/app/server/component/page/home/page.home.templ`, Line: 77, Col: 51}
			}
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 2, "\">Sign in</a> <a class=\"active blue item\" data-tab=\"")
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			var templ_7745c5c3_Var4 string
			templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(RegisterTabTagID)
			if templ_7745c5c3_Err != nil {
				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/app/server/component/page/home/page.home.templ`, Line: 78, Col: 61}
			}
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 3, "\">Sign up</a></div></div></div><div class=\"sixteen wide mobile eight wide computer column\"><div class=\"ui tab basic segment active\" data-tab=\"")
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			var templ_7745c5c3_Var5 string
			templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(RegisterTabTagID)
			if templ_7745c5c3_Err != nil {
				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/app/server/component/page/home/page.home.templ`, Line: 83, Col: 72}
			}
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 4, "\">")
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = RegisterForm(register).Render(ctx, templ_7745c5c3_Buffer)
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = TermsModal().Render(ctx, templ_7745c5c3_Buffer)
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 5, "</div><div class=\"ui tab basic segment\" data-tab=\"")
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			var templ_7745c5c3_Var6 string
			templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(LoginTabTagID)
			if templ_7745c5c3_Err != nil {
				return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/app/server/component/page/home/page.home.templ`, Line: 87, Col: 62}
			}
			_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 6, "\">")
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = LoginForm().Render(ctx, templ_7745c5c3_Buffer)
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 7, "</div>")
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = VerifyForm().Render(ctx, templ_7745c5c3_Buffer)
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = ForgotForm(forgot).Render(ctx, templ_7745c5c3_Buffer)
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = ResetForm().Render(ctx, templ_7745c5c3_Buffer)
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 8, "</div><div class=\"ui looping pulsating transition bottom fixed cookie nag\"><div class=\"title\"><i class=\"cookie bite icon\"></i> We use cookies to ensure you get the best experience on our website</div><i class=\"close icon\"></i></div></div>")
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			templ_7745c5c3_Err = PageInit(VerifyModalTagID, ResetModalTagID).Render(ctx, templ_7745c5c3_Buffer)
			if templ_7745c5c3_Err != nil {
				return templ_7745c5c3_Err
			}
			return nil
		})
		templ_7745c5c3_Err = layout.Index(scripts.Head{}, scripts.Body{}).Render(templ.WithChildren(ctx, templ_7745c5c3_Var2), templ_7745c5c3_Buffer)
		if templ_7745c5c3_Err != nil {
			return templ_7745c5c3_Err
		}
		return nil
	})
}

var _ = templruntime.GeneratedTemplate
