Anvil/assets/Header-eb95101d.js
André Jaenisch dff41f66d3
Updates
2024-02-17 23:52:33 +01:00

1 line
3.3 KiB
JavaScript

import{a as S,n as j}from"./utils-3fb61e8d.js";import{j as v,k as M,l as b,a as $,m as C,n as D,d as p,b as F,i as w,f as h,p as I,q as A,r as z,u as q}from"./lifecycle-de4a075a.js";import{S as T,i as W,a as k,c as N,t as y,g as P,b as E,d as H,m as L,e as V}from"./index-464a621b.js";import{B}from"./Button-34be1b92.js";function R(m){let t,a,l,r;return t=new B({props:{size:"small",label:"Log in"}}),t.$on("click",m[1]),l=new B({props:{primary:!0,size:"small",label:"Sign up"}}),l.$on("click",m[3]),{c(){E(t.$$.fragment),a=M(),E(l.$$.fragment)},l(n){H(t.$$.fragment,n),a=D(n),H(l.$$.fragment,n)},m(n,c){L(t,n,c),w(n,a,c),L(l,n,c),r=!0},p:j,i(n){r||(y(t.$$.fragment,n),y(l.$$.fragment,n),r=!0)},o(n){k(t.$$.fragment,n),k(l.$$.fragment,n),r=!1},d(n){n&&p(a),V(t,n),V(l,n)}}}function G(m){let t,a,l,r=m[0].name+"",n,c,s,e,f;return e=new B({props:{size:"small",label:"Log out"}}),e.$on("click",m[2]),{c(){t=v("span"),a=A("Welcome, "),l=v("b"),n=A(r),c=A("!"),s=M(),E(e.$$.fragment),this.h()},l(i){t=b(i,"SPAN",{class:!0});var o=$(t);a=z(o,"Welcome, "),l=b(o,"B",{});var g=$(l);n=z(g,r),g.forEach(p),c=z(o,"!"),o.forEach(p),s=D(i),H(e.$$.fragment,i),this.h()},h(){F(t,"class","welcome")},m(i,o){w(i,t,o),h(t,a),h(t,l),h(l,n),h(t,c),w(i,s,o),L(e,i,o),f=!0},p(i,o){(!f||o&1)&&r!==(r=i[0].name+"")&&q(n,r)},i(i){f||(y(e.$$.fragment,i),f=!0)},o(i){k(e.$$.fragment,i),f=!1},d(i){i&&(p(t),p(s)),V(e,i)}}}function J(m){let t,a,l,r='<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="M10 0h12a10 10 0 0110 10v12a10 10 0 01-10 10H10A10 10 0 010 22V10A10 10 0 0110 0z" fill="#FFF"></path><path d="M5.3 10.6l10.4 6v11.1l-10.4-6v-11zm11.4-6.2l9.7 5.5-9.7 5.6V4.4z" fill="#555AB9"></path><path d="M27.2 10.6v11.2l-10.5 6V16.5l10.5-6zM15.7 4.4v11L6 10l9.7-5.5z" fill="#91BAF8"></path></g></svg> <h1>Acme</h1>',n,c,s,e,f;const i=[G,R],o=[];function g(u,d){return u[0]?0:1}return s=g(m),e=o[s]=i[s](m),{c(){t=v("header"),a=v("div"),l=v("div"),l.innerHTML=r,n=M(),c=v("div"),e.c(),this.h()},l(u){t=b(u,"HEADER",{});var d=$(t);a=b(d,"DIV",{class:!0});var _=$(a);l=b(_,"DIV",{"data-svelte-h":!0}),C(l)!=="svelte-mhlgcu"&&(l.innerHTML=r),n=D(_),c=b(_,"DIV",{});var x=$(c);e.l(x),x.forEach(p),_.forEach(p),d.forEach(p),this.h()},h(){F(a,"class","storybook-header")},m(u,d){w(u,t,d),h(t,a),h(a,l),h(a,n),h(a,c),o[s].m(c,null),f=!0},p(u,[d]){let _=s;s=g(u),s===_?o[s].p(u,d):(P(),k(o[_],1,1,()=>{o[_]=null}),N(),e=o[s],e?e.p(u,d):(e=o[s]=i[s](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[s].d()}}}function K(m,t,a){let{user:l=null}=t;const r=I();function n(e){r("login",e)}function c(e){r("logout",e)}function s(e){r("createAccount",e)}return m.$$set=e=>{"user"in e&&a(0,l=e.user)},[l,n,c,s]}class O extends T{constructor(t){super(),W(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};