import r from"./Container.f87d9f62.js";import n from"./Dropdown.d1060583.js";import i from"./DropdownList.02c48c2f.js";import l from"./DropdownListItem.ac31464c.js";import m from"./IconMoon.ade3e41b.js";import p from"./IconSun.8809e5d7.js";import c from"./IconSearch.27dac870.js";import d from"./IconButton.eadc8d3d.js";import{n as u}from"./plugin-vue2_normalizer.000ba15c.js";const _={components:{Container:r,Dropdown:n,DropdownList:i,DropdownListItem:l,IconMoon:m,IconSearch:c,IconSun:p,IconButton:d},data(){return{themeMode:this.$page.props.auth.user.theme}},mounted(){this.setDarkMode()},methods:{toggleTheme(){window.axios.post("/profile/toggle-theme").then(o=>{this.themeMode=o.data,this.setDarkMode()})},setDarkMode(){this.themeMode==="auto"?this.checkDarkMode()?document.documentElement.classList.add("theme--dark"):document.documentElement.classList.remove("theme--dark"):this.themeMode==="dark"?document.documentElement.classList.add("theme--dark"):document.documentElement.classList.remove("theme--dark")},checkDarkMode(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches},triggerSearch(){window.eventBus.$emit("openSearch")}}};var h=function(){var t=this,e=t._self._c;return e("header",{staticClass:"sticky top-0 border-b border-low-emphasis bg-top-bar z-30"},[e("div",{staticClass:"w-full px-4 sm:px-8 mx-auto max-w-top-bar-container"},[e("div",{staticClass:"flex flex-col"},[e("nav",{staticClass:"flex flex-col items-center justify-between py-4 space-y-4 md:space-y-0 md:flex-row text-top-bar"},[e("div",{staticClass:"flex items-center space-x-5"},[t.$page.props.settings.logo?e("img",{staticClass:"h-top-bar-logo",attrs:{src:t.$page.props.settings.logo}}):t._e(),t._t("breadcrumbs")],2),e("ul",{staticClass:"flex items-center space-x-4"},[e("li",{attrs:{"aria-label":t.__("Search"),"data-balloon-blunt":"","data-balloon-pos":"down"}},[e("IconButton",{on:{click:t.triggerSearch}},[e("IconSearch",{staticClass:"text-top-bar"})],1)],1),e("li",{attrs:{"aria-label":t.themeMode==="light"?t.__("Enable dark mode"):t.__("Enable light mode"),"data-balloon-blunt":"","data-balloon-pos":"down"}},[e("IconButton",{on:{click:t.toggleTheme}},[t.themeMode==="light"?e("IconMoon",{staticClass:"text-top-bar"}):t._e(),t.themeMode==="dark"?e("IconSun",{staticClass:"text-top-bar"}):t._e()],1)],1),e("li",[e("Dropdown",{scopedSlots:t._u([{key:"default",fn:function({toggle:a,isOpen:s}){return[e("button",{staticClass:"flex h-auto m-0 appearance-none items-center",on:{click:a}},[e("span",[t._v(t._s(t.$page.props.auth.user.name))]),e("img",{staticClass:"ml-2 inline w-8 h-8 rounded-avatar bg-surface-2",attrs:{src:t.$page.props.auth.user.avatar,alt:t.$page.props.auth.user.name}})]),s?e("DropdownList",[t.$page.props.settings.support?e("DropdownListItem",{attrs:{to:"/support"}},[t._v(t._s(t.__("Support"))+" ")]):t._e(),t.$page.props.settings.documentation?e("DropdownListItem",{attrs:{to:"/documentation"}},[t._v(t._s(t.__("Documentation")))]):t._e(),e("DropdownListItem",{attrs:{to:t.route("profile.index")}},[t._v(t._s(t.__("Profile"))+" ")]),t.$page.props.settings.billing?e("DropdownListItem",{attrs:{to:t.route("profile.billing.index")}},[t._v(t._s(t.__("Billing"))+" ")]):t._e(),t.$page.props.auth.user.role==="admin"?e("DropdownListItem",{staticClass:"!text-danger",attrs:{to:t.route("admin.dashboard")}},[t._v(t._s(t.__("Administration"))+" ")]):t._e(),e("DropdownListItem",{attrs:{to:t.route("logout"),"component-is":"button",method:"post"}},[t._v(t._s(t.__("Sign out"))+" ")])],1):t._e()]}}])})],1)])]),t._t("tab-bar")],2)])])},g=[],f=u(_,h,g,!1,null,null,null,null);const L=f.exports;export{L as default};
