(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{1525:function(e,t,s){Promise.resolve().then(s.t.bind(s,8326,23)),Promise.resolve().then(s.t.bind(s,9167,23)),Promise.resolve().then(s.t.bind(s,1654,23)),Promise.resolve().then(s.t.bind(s,2489,23)),Promise.resolve().then(s.bind(s,9358)),Promise.resolve().then(s.bind(s,157))},9358:function(e,t,s){"use strict";s.r(t);var n=s(6705),a=s(8004),l=s(2549),r=s(9538),d=s(9844),i=s(310),o=s(1396),c=s.n(o);t.default=()=>{let[e,t]=(0,r.n)(!1,!0),close=()=>{var e;t(0),null===(e=document.querySelector("body"))||void 0===e||e.style.setProperty("overflow",null)};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("button",{onClick:()=>{var e;t(1),null===(e=document.querySelector("body"))||void 0===e||e.style.setProperty("overflow","hidden")},className:"block lg:hidden",children:(0,n.jsx)(a.Z,{size:28})}),(0,n.jsxs)(d.E.nav,{className:(0,i.cn)("hidden absolute top-0 left-0 bottom-0 right-0 bg-mint z-[2] p-8 text-3xl",e&&"block"),children:[(0,n.jsx)("button",{className:(0,i.cn)("absolute top-0 right-0 p-8 text-3xl"),onClick:close,children:(0,n.jsx)(l.Z,{})}),(0,n.jsxs)("ul",{className:(0,i.cn)("flex flex-col gap-8 justify-center h-full"),children:[(0,n.jsx)(c(),{href:"/",onClick:close,children:(0,n.jsx)("li",{children:"Forside"})}),(0,n.jsx)(c(),{href:"/gravsten",onClick:close,children:(0,n.jsx)("li",{children:"Gravsten"})}),(0,n.jsx)(c(),{href:"/om",onClick:close,children:(0,n.jsx)("li",{children:"Om os"})}),(0,n.jsx)(c(),{href:"/kontakt",onClick:close,children:(0,n.jsx)("li",{children:"Kontakt os"})})]})]})]})}},157:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return HeaderUserMenu}});var n=s(6705),a=s(955),l=s(9336),r=s(7158),d=s(2442),i=s(6369),o=s(310);let c=l.fC,u=l.xz;l.ZA,l.Uv,l.Tr,l.Ee;let m=a.forwardRef((e,t)=>{let{className:s,inset:a,children:d,...i}=e;return(0,n.jsxs)(l.fF,{ref:t,className:(0,o.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-neutral-100 data-[state=open]:bg-neutral-100",a&&"pl-8",s),...i,children:[d,(0,n.jsx)(r.Z,{className:"ml-auto h-4 w-4"})]})});m.displayName=l.fF.displayName;let f=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(l.tu,{ref:t,className:(0,o.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...a})});f.displayName=l.tu.displayName;let x=a.forwardRef((e,t)=>{let{className:s,sideOffset:a=4,...r}=e;return(0,n.jsx)(l.Uv,{children:(0,n.jsx)(l.VY,{ref:t,sideOffset:a,className:(0,o.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 bg-white p-1 text-neutral-950 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...r})})});x.displayName=l.VY.displayName;let h=a.forwardRef((e,t)=>{let{className:s,inset:a,...r}=e;return(0,n.jsx)(l.ck,{ref:t,className:(0,o.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",s),...r})});h.displayName=l.ck.displayName;let p=a.forwardRef((e,t)=>{let{className:s,children:a,checked:r,...i}=e;return(0,n.jsxs)(l.oC,{ref:t,className:(0,o.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:r,...i,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(l.wU,{children:(0,n.jsx)(d.Z,{className:"h-4 w-4"})})}),a]})});p.displayName=l.oC.displayName;let j=a.forwardRef((e,t)=>{let{className:s,children:a,...r}=e;return(0,n.jsxs)(l.Rk,{ref:t,className:(0,o.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-neutral-100 focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...r,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(l.wU,{children:(0,n.jsx)(i.Z,{className:"h-2 w-2 fill-current"})})}),a]})});j.displayName=l.Rk.displayName;let b=a.forwardRef((e,t)=>{let{className:s,inset:a,...r}=e;return(0,n.jsx)(l.__,{ref:t,className:(0,o.cn)("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",s),...r})});b.displayName=l.__.displayName;let y=a.forwardRef((e,t)=>{let{className:s,...a}=e;return(0,n.jsx)(l.Z0,{ref:t,className:(0,o.cn)("-mx-1 my-1 h-px bg-neutral-100",s),...a})});y.displayName=l.Z0.displayName;var N=s(3237),v=s(1396),g=s.n(v),w=s(6231);function HeaderUserMenuLoginLink(){return(0,n.jsx)(w.Vf,{postLoginRedirectURL:"http://localhost:3000/api/",children:"Log ind"})}function HeaderUserMenu(){var e,t;let[s,l]=(0,a.useState)(!0),[r,d]=(0,a.useState)(null);return((0,a.useEffect)(()=>{let load=async()=>{l(!1)};load()},[]),s||!r)?(0,n.jsx)(HeaderUserMenuLoginLink,{}):(0,n.jsxs)(c,{children:[(0,n.jsx)(u,{children:(0,n.jsxs)("div",{className:(0,o.cn)("flex flex-row gap-2 items-center"),children:[(0,n.jsx)(N.Z,{size:16}),(0,n.jsxs)("p",{children:[r.user_metadata.full_name," ",!!(null===(e=r.app_metadata)||void 0===e?void 0:e.claims_admin)&&(0,n.jsx)("span",{className:"text-xs px-2 py-1 bg-darkGreen text-lime rounded-[9999px]",children:"Admin"})]})]})}),(0,n.jsxs)(x,{children:[(0,n.jsxs)(g(),{href:"/dashboard",children:[(0,n.jsx)(b,{children:"Min konto"}),(0,n.jsx)(h,{children:"Min side"})]}),(0,n.jsx)(g(),{href:"/dashboard/orders",children:(0,n.jsx)(h,{children:"Mine bestillinger"})}),(0,n.jsx)(g(),{href:"/dashboard/billing",children:(0,n.jsx)(h,{children:"Betaling og fakturering"})}),!!(null===(t=r.app_metadata)||void 0===t?void 0:t.claims_admin)&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(y,{}),(0,n.jsx)(b,{children:"Admin"}),(0,n.jsx)(g(),{href:"/admin/gravsten",children:(0,n.jsx)(h,{children:"Gravsten"})}),(0,n.jsx)(g(),{href:"/admin/crm",children:(0,n.jsx)(h,{children:"Kunder"})})]}),(0,n.jsx)(y,{}),(0,n.jsx)(b,{children:"Handlinger"}),(0,n.jsx)("a",{href:"#",onClick:e=>{e.preventDefault()},children:(0,n.jsx)(h,{children:"Log ud"})})]})]})}},2489:function(){}},function(e){e.O(0,[326,701,844,986,310,121,290,744],function(){return e(e.s=1525)}),_N_E=e.O()}]);