import{a as S,n as j}from"./utils-09ff0c0e.js";import{a as v,s as M,b,f as $,m as C,k as D,d as p,h as F,i as w,j as h,r as I,t as A,g as z,l as T}from"./lifecycle-9898a056.js";import{S as W,i as q,b as k,e as N,t as y,g as P,c as E,a as H,m as L,d as V}from"./index-d94d5794.js";import{B}from"./Button-5254db0b.js";function R(m){let t,s,n,r;return t=new B({props:{size:"small",label:"Log in"}}),t.$on("click",m[1]),n=new B({props:{primary:!0,size:"small",label:"Sign up"}}),n.$on("click",m[3]),{c(){E(t.$$.fragment),s=M(),E(n.$$.fragment)},l(l){H(t.$$.fragment,l),s=D(l),H(n.$$.fragment,l)},m(l,c){L(t,l,c),w(l,s,c),L(n,l,c),r=!0},p:j,i(l){r||(y(t.$$.fragment,l),y(n.$$.fragment,l),r=!0)},o(l){k(t.$$.fragment,l),k(n.$$.fragment,l),r=!1},d(l){l&&p(s),V(t,l),V(n,l)}}}function G(m){let t,s,n,r=m[0].name+"",l,c,a,e,f;return e=new B({props:{size:"small",label:"Log out"}}),e.$on("click",m[2]),{c(){t=v("span"),s=A("Welcome, "),n=v("b"),l=A(r),c=A("!"),a=M(),E(e.$$.fragment),this.h()},l(i){t=b(i,"SPAN",{class:!0});var o=$(t);s=z(o,"Welcome, "),n=b(o,"B",{});var g=$(n);l=z(g,r),g.forEach(p),c=z(o,"!"),o.forEach(p),a=D(i),H(e.$$.fragment,i),this.h()},h(){F(t,"class","welcome")},m(i,o){w(i,t,o),h(t,s),h(t,n),h(n,l),h(t,c),w(i,a,o),L(e,i,o),f=!0},p(i,o){(!f||o&1)&&r!==(r=i[0].name+"")&&T(l,r)},i(i){f||(y(e.$$.fragment,i),f=!0)},o(i){k(e.$$.fragment,i),f=!1},d(i){i&&(p(t),p(a)),V(e,i)}}}function J(m){let t,s,n,r='

Acme

',l,c,a,e,f;const i=[G,R],o=[];function g(u,d){return u[0]?0:1}return a=g(m),e=o[a]=i[a](m),{c(){t=v("header"),s=v("div"),n=v("div"),n.innerHTML=r,l=M(),c=v("div"),e.c(),this.h()},l(u){t=b(u,"HEADER",{});var d=$(t);s=b(d,"DIV",{class:!0});var _=$(s);n=b(_,"DIV",{"data-svelte-h":!0}),C(n)!=="svelte-mhlgcu"&&(n.innerHTML=r),l=D(_),c=b(_,"DIV",{});var x=$(c);e.l(x),x.forEach(p),_.forEach(p),d.forEach(p),this.h()},h(){F(s,"class","storybook-header")},m(u,d){w(u,t,d),h(t,s),h(s,n),h(s,l),h(s,c),o[a].m(c,null),f=!0},p(u,[d]){let _=a;a=g(u),a===_?o[a].p(u,d):(P(),k(o[_],1,1,()=>{o[_]=null}),N(),e=o[a],e?e.p(u,d):(e=o[a]=i[a](u),e.c()),y(e,1),e.m(c,null))},i(u){f||(y(e),f=!0)},o(u){k(e),f=!1},d(u){u&&p(t),o[a].d()}}}function K(m,t,s){let{user:n=null}=t;const r=I();function l(e){r("login",e)}function c(e){r("logout",e)}function a(e){r("createAccount",e)}return m.$$set=e=>{"user"in e&&s(0,n=e.user)},[n,l,c,a]}class O extends W{constructor(t){super(),q(this,t,K,J,S,{user:0})}}O.__docgen={version:3,name:"Header.svelte",data:[{visibility:"public",description:null,keywords:[],name:"user",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"object",type:"object"},defaultValue:null}],computed:[],methods:[],components:[],description:null,keywords:[],events:[{visibility:"public",description:null,keywords:[],name:"login"},{visibility:"public",description:null,keywords:[],name:"logout"},{visibility:"public",description:null,keywords:[],name:"createAccount"}],slots:[],refs:[]};export{O as H};