import{S as t,i as e,a as n,b as i,s as l,e as o,n as r,d as s,c,o as a,f as d,h as m,l as u,t as f,g as h,j as g,r as p,u as b,m as w,p as x,v as y,y as v,H as k}from"./index-ce8c147b.js";import{w as j}from"./index-f2dbf8ff.js";import{loadLocaleContent as H,getData as I}from"../../../../../../../../../js/libraries/serverTools.js";import{px2rem as L}from"../../../../../../../../../js/libraries/miscTools.js";function T(t,e,n){const i=t.slice();return i[32]=e[n],i[33]=e,i[34]=n,i}function Y(t,e,n){const i=t.slice();return i[35]=e[n],i}function C(t,e,n){const i=t.slice();return i[35]=e[n],i}function M(t,e,n){const i=t.slice();return i[40]=e[n],i[41]=e,i[42]=n,i}function O(t,e,n){const i=t.slice();return i[43]=e[n],i[44]=e,i[45]=n,i}function z(t){let e,n,o=t[0],r=K(t);return{c(){e=d("div"),n=d("div"),r.c(),m(n,"id","text-container"),m(e,"id","container")},m(l,o){i(l,e,o),u(e,n),r.m(n,null),t[27](e)},p(t,e){1&e[0]&&l(o,o=t[0])?(r.d(1),r=K(t),r.c(),r.m(n,null)):r.p(t,e)},d(n){n&&s(e),r.d(n),t[27](null)}}}function A(t){let e,n,l,o,r,c,a=t[40].name+"",g=t[40];const p=()=>t[20](n,g),w=()=>t[20](null,g);function x(){return t[21](t[40])}return{c(){e=d("div"),n=d("button"),l=f(a),o=h(),m(n,"class","level0 heading-button"),m(e,"class","heading-button-wrapper")},m(t,s){i(t,e,s),u(e,n),u(n,l),p(),u(e,o),r||(c=b(n,"click",x),r=!0)},p(e,n){g!==(t=e)[40]&&(w(),g=t[40],p())},d(t){t&&s(e),w(),r=!1,c()}}}function V(t){let e,n=t[40],l=[];for(let e=0;et[18](n,g),w=()=>t[18](null,g);function x(){return t[19](t[43])}return{c(){e=d("div"),n=d("button"),l=f(a),o=h(),m(n,"class","level1 heading-button"),m(e,"class","heading-button-wrapper")},m(t,s){i(t,e,s),u(e,n),u(n,l),p(),u(e,o),r||(c=b(n,"click",x),r=!0)},p(e,n){g!==(t=e)[43]&&(w(),g=t[43],p())},d(t){t&&s(e),w(),r=!1,c()}}}function S(t){let e;let n=function(t,e){return Array.isArray(t[40])?V:A}(t),l=n(t);return{c(){l.c(),e=o()},m(t,n){l.m(t,n),i(t,e,n)},p(t,e){l.p(t,e)},d(t){l.d(t),t&&s(e)}}}function E(t){let e;let n=function(t,e){return t[32],"ul"==Object.keys(t[32])[0]?D:(t[32],"ol"==Object.keys(t[32])[0]?q:(t[32],"h3"==t[32].type?W:(t[32],"h2"==t[32].type?_:"#"==t[32][0]?N:B)))}(t),l=n(t);return{c(){l.c(),e=o()},m(t,n){l.m(t,n),i(t,e,n)},p(t,e){l.p(t,e)},d(t){l.d(t),t&&s(e)}}}function B(t){let e,n,l,o=t[32]+"";return{c(){e=d("p"),n=new k(!1),l=h(),n.a=l,m(e,"class","margin-end")},m(t,r){i(t,e,r),n.m(o,e),u(e,l)},p:r,d(t){t&&s(e)}}}function N(t){let e,n=t[32].slice(2,t[32].length)+"";return{c(){e=d("h1")},m(t,l){i(t,e,l),e.innerHTML=n},p:r,d(t){t&&s(e)}}}function _(t){let e,n,l,o,r,c=t[32].line+"",a=t[32];const f=()=>t[25](n,a),g=()=>t[25](null,a);return{c(){e=d("button"),n=d("h2"),l=h(),m(n,"id",t[32].id),p(e,"display","block"),p(e,"width","100%")},m(s,a){i(s,e,a),u(e,n),n.innerHTML=c,f(),u(e,l),o||(r=b(e,"click",(function(){v(t[6].scrollIntoView({block:"start"},!0))&&t[6].scrollIntoView({block:"start"},!0).apply(this,arguments)})),o=!0)},p(e,n){a!==(t=e)[32]&&(g(),a=t[32],f())},d(t){t&&s(e),g(),o=!1,r()}}}function W(t){let e,n,l,o,r,c=t[32].line+"",a=t[32];const f=()=>t[24](n,a),g=()=>t[24](null,a);return{c(){e=d("button"),n=d("h3"),l=h(),m(n,"id",t[32].id),p(e,"display","block"),p(e,"width","100%")},m(s,a){i(s,e,a),u(e,n),n.innerHTML=c,f(),u(e,l),o||(r=b(e,"click",(function(){v(t[6].scrollIntoView({block:"start"},!0))&&t[6].scrollIntoView({block:"start"},!0).apply(this,arguments)})),o=!0)},p(e,n){a!==(t=e)[32]&&(g(),a=t[32],f())},d(t){t&&s(e),g(),o=!1,r()}}}function q(t){let e,n,l=t[32].ol,o=[];for(let e=0;en(9,i=t)));let k=H(v,"manifesto-component",f);const T=["ul","ol"];function Y(t){p[t].scrollIntoView({block:"start"},!0)}I("/locales/"+k+"/manifesto.txt",(function(t){let e,i=t.split(/\r?\n/),o=0;for(let t=0;tn.includes("<"+t+">"))).findIndex((t=>t));if(-1!=l){let e=T[l],o={};o[e]=[];let r="";for(;;){if(t+=1,n=i[t],n.includes(r)){h.push(o);break}o[e].push(n)}}else if("###"==n.slice(0,3)){let t=n.slice(4,n.length),i=t.toLowerCase().trim().replaceAll(" ","-");e.push({id:i,name:t,index:o}),o+=1,h.push({type:"h3",id:i,line:t,index:o})}else if("##"==n.slice(0,2)){let t=n.slice(3,n.length),i=t.toLowerCase().trim().replaceAll(" ","-");b.push({id:t.toLowerCase().trim().replaceAll(" ","-"),name:t,index:o}),o+=1,e=[],b.push(e),h.push({type:"h2",id:i,line:t,index:o})}else h.push(n)}n(0,l+=1)})),addEventListener("scroll",(t=>{if(window.innerWidth>1080){let t=L(window.scrollY),e=L(m.getBoundingClientRect().bottom+window.scrollY),i=L(d.getBoundingClientRect().bottom+window.scrollY);if(t>w&&t<5||t=e-1.5)x-=i-(e-1.5);else if(x>-5&&(x=-5),t<5&&0!=t){let t=L(d.offsetHeight-window.innerHeight);x=-Math.min(L(window.scrollY),5+t+2.5)}else if(twindow.innerHeight){let e=L(d.offsetHeight)-L(window.innerHeight);x>-(e+8)?x+=w-t:x=-(e+8)}n(6,d.style.marginTop=x+"rem",d),w=L(window.scrollY)}else n(6,d.style.marginTop="0rem",d)})),a((()=>{let t=localStorage.getItem("manifesto-hide-content");null!=t&&null!=t&&"true"==t&&Q(r,s)}));return[l,o,r,s,g,p,d,m,u,i,h,b,f,v,Y,function(t){y[t?"unshift":"push"]((()=>{r=t,n(2,r)}))},function(t){y[t?"unshift":"push"]((()=>{o=t,n(1,o)}))},()=>Q(r,s),function(t,e){y[t?"unshift":"push"]((()=>{g[e.index]=t,n(4,g)}))},t=>Y(t.id),function(t,e){y[t?"unshift":"push"]((()=>{g[e.index]=t,n(4,g)}))},t=>Y(t.id),function(t){y[t?"unshift":"push"]((()=>{s=t,n(3,s)}))},function(t){y[t?"unshift":"push"]((()=>{d=t,n(6,d)}))},function(t,e){y[t?"unshift":"push"]((()=>{p[e.id]=t,n(5,p)}))},function(t,e){y[t?"unshift":"push"]((()=>{p[e.id]=t,n(5,p)}))},function(t){y[t?"unshift":"push"]((()=>{u=t,n(8,u)}))},function(t){y[t?"unshift":"push"]((()=>{m=t,n(7,m)}))}]}class X extends t{constructor(t){super(),this.shadowRoot.innerHTML="",e(this,{target:this.shadowRoot,props:n(this.attributes),customElement:!0},U,P,l,{},null,[-1,-1]),t&&t.target&&i(t.target,this,t.anchor)}}customElements.define("manifesto-component",X);export{X as default};