From 267ee37226529a70fe1f06c5c20940ee9a3b3900 Mon Sep 17 00:00:00 2001 From: Gunnar Aastrand Grimnes Date: Wed, 28 Feb 2024 13:25:15 +0100 Subject: [PATCH] build again --- docs/assets/{index-d7fJtCbx.js => index-HuwolkMy.js} | 2 +- docs/index.html | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) rename docs/assets/{index-d7fJtCbx.js => index-HuwolkMy.js} (77%) diff --git a/docs/assets/index-d7fJtCbx.js b/docs/assets/index-HuwolkMy.js similarity index 77% rename from docs/assets/index-d7fJtCbx.js rename to docs/assets/index-HuwolkMy.js index 710a855..3da0334 100644 --- a/docs/assets/index-d7fJtCbx.js +++ b/docs/assets/index-HuwolkMy.js @@ -1 +1 @@ -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();const ht=(e,t)=>e===t,Ae=Symbol("solid-proxy"),dt=Symbol("solid-track"),fe={equals:ht};let Ve=Ze;const H=1,he=2,qe={owned:null,cleanups:null,context:null,owner:null};var v=null;let xe=null,gt=null,P=null,I=null,F=null,pe=0;function ee(e,t){const n=P,r=v,s=e.length===0,i=t===void 0?r:t,l=s?qe:{owned:null,cleanups:null,context:i?i.context:null,owner:i},o=s?e:()=>e(()=>j(()=>be(l)));v=l,P=null;try{return G(o,!0)}finally{P=n,v=r}}function T(e,t){t=t?Object.assign({},fe,t):fe;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=s=>(typeof s=="function"&&(s=s(n.value)),Ye(n,s));return[Qe.bind(n),r]}function $(e,t,n){const r=Ie(e,t,!1,H);se(r)}function mt(e,t,n){Ve=vt;const r=Ie(e,t,!1,H);(!n||!n.render)&&(r.user=!0),F?F.push(r):se(r)}function O(e,t,n){n=n?Object.assign({},fe,n):fe;const r=Ie(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,se(r),Qe.bind(r)}function j(e){if(P===null)return e();const t=P;P=null;try{return e()}finally{P=t}}function Oe(e,t,n){const r=Array.isArray(e);let s,i=n&&n.defer;return l=>{let o;if(r){o=Array(e.length);for(let h=0;ht(o,s,l));return s=o,c}}function ke(e){return v===null||(v.cleanups===null?v.cleanups=[e]:v.cleanups.push(e)),e}function Ge(){return v}function Xe(e,t){const n=v,r=P;v=e,P=null;try{return G(t,!0)}catch(s){We(s)}finally{v=n,P=r}}function pt(e){const t=P,n=v;return Promise.resolve().then(()=>{P=t,v=n;let r;return G(e,!1),P=v=null,r?r.done:void 0})}function Je(e,t){const n=Symbol("context");return{id:n,Provider:wt(n),defaultValue:e}}function bt(e){return v&&v.context&&v.context[e.id]!==void 0?v.context[e.id]:e.defaultValue}function Re(e){const t=O(e),n=O(()=>Ce(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}function Qe(){if(this.sources&&this.state)if(this.state===H)se(this);else{const e=I;I=null,G(()=>ge(this),!1),I=e}if(P){const e=this.observers?this.observers.length:0;P.sources?(P.sources.push(this),P.sourceSlots.push(e)):(P.sources=[this],P.sourceSlots=[e]),this.observers?(this.observers.push(P),this.observerSlots.push(P.sources.length-1)):(this.observers=[P],this.observerSlots=[P.sources.length-1])}return this.value}function Ye(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&G(()=>{for(let s=0;s1e6)throw I=[],new Error},!1)),t}function se(e){if(!e.fn)return;be(e);const t=pe;_t(e,e.value,t)}function _t(e,t,n){let r;const s=v,i=P;P=v=e;try{r=e.fn(t)}catch(l){return e.pure&&(e.state=H,e.owned&&e.owned.forEach(be),e.owned=null),e.updatedAt=n+1,We(l)}finally{P=i,v=s}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Ye(e,r):e.value=r,e.updatedAt=n)}function Ie(e,t,n,r=H,s){const i={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:v,context:v?v.context:null,pure:n};return v===null||v!==qe&&(v.owned?v.owned.push(i):v.owned=[i]),i}function de(e){if(e.state===0)return;if(e.state===he)return ge(e);if(e.suspense&&j(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;n--)if(e=t[n],e.state===H)se(e);else if(e.state===he){const r=I;I=null,G(()=>ge(e,t[0]),!1),I=r}}function G(e,t){if(I)return e();let n=!1;t||(I=[]),F?n=!0:F=[],pe++;try{const r=e();return yt(n),r}catch(r){n||(F=null),I=null,We(r)}}function yt(e){if(I&&(Ze(I),I=null),e)return;const t=F;F=null,t.length&&G(()=>Ve(t),!1)}function Ze(e){for(let t=0;t=0;t--)be(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function xt(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function We(e,t=v){throw xt(e)}function Ce(e){if(typeof e=="function"&&!e.length)return Ce(e());if(Array.isArray(e)){const t=[];for(let n=0;ns=j(()=>(v.context={...v.context,[e]:r.value},Re(()=>r.children))),void 0),s}}const $t=Symbol("fallback");function De(e){for(let t=0;t1?[]:null;return ke(()=>De(i)),()=>{let c=e()||[],h,a;return c[dt],j(()=>{let u=c.length,g,d,m,p,_,L,S,x,k;if(u===0)l!==0&&(De(i),i=[],r=[],s=[],l=0,o&&(o=[])),n.fallback&&(r=[$t],s[0]=ee(B=>(i[0]=B,n.fallback())),l=1);else if(l===0){for(s=new Array(u),a=0;a=L&&x>=L&&r[S]===c[x];S--,x--)m[x]=s[S],p[x]=i[S],o&&(_[x]=o[S]);for(g=new Map,d=new Array(x+1),a=x;a>=L;a--)k=c[a],h=g.get(k),d[a]=h===void 0?-1:h,g.set(k,a);for(h=L;h<=S;h++)k=r[h],a=g.get(k),a!==void 0&&a!==-1?(m[a]=s[h],p[a]=i[h],o&&(_[a]=o[h]),a=d[a],g.set(k,a)):i[h]();for(a=L;ae(t||{}))}function ie(){return!0}const At={get(e,t,n){return t===Ae?n:e.get(t)},has(e,t){return t===Ae?!0:e.has(t)},set:ie,deleteProperty:ie,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:ie,deleteProperty:ie}},ownKeys(e){return e.keys()}};function we(e){return(e=typeof e=="function"?e():e)?e:{}}function Ct(){for(let e=0,t=this.length;e=0;o--){const c=we(e[o])[l];if(c!==void 0)return c}},has(l){for(let o=e.length-1;o>=0;o--)if(l in we(e[o]))return!0;return!1},keys(){const l=[];for(let o=0;o=0;l--){const o=e[l];if(!o)continue;const c=Object.getOwnPropertyNames(o);for(let h=c.length-1;h>=0;h--){const a=c[h];if(a==="__proto__"||a==="constructor")continue;const f=Object.getOwnPropertyDescriptor(o,a);if(!r[a])r[a]=f.get?{enumerable:!0,configurable:!0,get:Ct.bind(n[a]=[f.get.bind(o)])}:f.value!==void 0?f:void 0;else{const u=n[a];u&&(f.get?u.push(f.get.bind(o)):f.value!==void 0&&u.push(()=>f.value))}}}const s={},i=Object.keys(r);for(let l=i.length-1;l>=0;l--){const o=i[l],c=r[o];c&&c.get?Object.defineProperty(s,o,c):s[o]=c?c.value:void 0}return s}const Pt=e=>`Stale read from <${e}>.`;function te(e){const t="fallback"in e&&{fallback:()=>e.fallback};return O(St(()=>e.each,e.children,t||void 0))}function q(e){const t=e.keyed,n=O(()=>e.when,void 0,{equals:(r,s)=>t?r===s:!r==!s});return O(()=>{const r=n();if(r){const s=e.children;return typeof s=="function"&&s.length>0?j(()=>s(t?r:()=>{if(!j(n))throw Pt("Show");return e.when})):s}return e.fallback},void 0,void 0)}function Lt(e,t,n){let r=n.length,s=t.length,i=r,l=0,o=0,c=t[s-1].nextSibling,h=null;for(;la-o){const d=t[l];for(;o{s=i,t===document?e():b(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{s(),t.textContent=""}}function y(e,t,n){let r;const s=()=>{const l=document.createElement("template");return l.innerHTML=e,n?l.content.firstChild.firstChild:l.content.firstChild},i=t?()=>j(()=>document.importNode(r||(r=s()),!0)):()=>(r||(r=s())).cloneNode(!0);return i.cloneNode=i,i}function _e(e,t=window.document){const n=t[Me]||(t[Me]=new Set);for(let r=0,s=e.length;re(t,n))}function b(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!="function")return me(e,t,r,n);$(s=>me(e,t(),s,n),r)}function Ue(e,t,n){const r=t.trim().split(/\s+/);for(let s=0,i=r.length;s{let o=t();for(;typeof o=="function";)o=o();n=me(e,o,n,r)}),()=>n;if(Array.isArray(t)){const o=[],c=n&&Array.isArray(n);if(Pe(o,t,n,s))return $(()=>n=me(e,o,n,r,!0)),()=>n;if(o.length===0){if(n=J(e,n,r),l)return n}else c?n.length===0?He(e,o,r):Lt(e,n,o):(n&&J(e),He(e,o));n=o}else if(t.nodeType){if(Array.isArray(n)){if(l)return n=J(e,n,r,t);J(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Pe(e,t,n,r){let s=!1;for(let i=0,l=t.length;i=0;l--){const o=t[l];if(s!==o){const c=o.parentNode===e;!i&&!l?c?e.replaceChild(s,o):e.insertBefore(s,n):c&&o.remove()}else i=!0}}else e.insertBefore(s,n);return[s]}const It=!1;function et(){let e=new Set;function t(s){return e.add(s),()=>e.delete(s)}let n=!1;function r(s,i){if(n)return!(n=!1);const l={to:s,options:i,defaultPrevented:!1,preventDefault:()=>l.defaultPrevented=!0};for(const o of e)o.listener({...l,from:o.location,retry:c=>{c&&(n=!0),o.navigate(s,{...i,resolve:!1})}});return!l.defaultPrevented}return{subscribe:t,confirm:r}}let Le;function Te(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Le=window.history.state._depth}Te();function Wt(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function Tt(e,t){let n=!1;return()=>{const r=Le;Te();const s=r==null?null:Le-r;if(n){n=!1;return}s&&t(s)?(n=!0,window.history.go(-s)):e()}}const jt=/^(?:[a-z0-9]+:)?\/\//i,Nt=/^\/+|(\/)\/+$/g,tt="http://sr";function ne(e,t=!1){const n=e.replace(Nt,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function ce(e,t,n){if(jt.test(t))return;const r=ne(e),s=n&&ne(n);let i="";return!s||t.startsWith("/")?i=r:s.toLowerCase().indexOf(r.toLowerCase())!==0?i=r+s:i=s,(i||"/")+ne(t,!i)}function Bt(e,t){return ne(e).replace(/\/*(\*.*)?$/g,"")+ne(t)}function nt(e){const t={};return e.searchParams.forEach((n,r)=>{t[r]=n}),t}function Ft(e,t,n){const[r,s]=e.split("/*",2),i=r.split("/").filter(Boolean),l=i.length;return o=>{const c=o.split("/").filter(Boolean),h=c.length-l;if(h<0||h>0&&s===void 0&&!t)return null;const a={path:l?"":"/",params:{}},f=u=>n===void 0?void 0:n[u];for(let u=0;ur.localeCompare(e,void 0,{sensitivity:"base"})===0;return t===void 0?!0:typeof t=="string"?n(t):typeof t=="function"?t(e):Array.isArray(t)?t.some(n):t instanceof RegExp?t.test(e):!1}function Dt(e){const[t,n]=e.pattern.split("/*",2),r=t.split("/").filter(Boolean);return r.reduce((s,i)=>s+(i.startsWith(":")?2:3),r.length-(n===void 0?0:1))}function rt(e){const t=new Map,n=Ge();return new Proxy({},{get(r,s){return t.has(s)||Xe(n,()=>t.set(s,O(()=>e()[s]))),t.get(s)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())}})}function st(e){let t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];let n=e.slice(0,t.index),r=e.slice(t.index+t[0].length);const s=[n,n+=t[1]];for(;t=/^(\/\:[^\/]+)\?/.exec(r);)s.push(n+=t[1]),r=r.slice(t[0].length);return st(r).reduce((i,l)=>[...i,...s.map(o=>o+l)],[])}const Mt=100,Ut=Je(),je=Je();function Ht(e,t=""){const{component:n,load:r,children:s,info:i}=e,l=!s||Array.isArray(s)&&!s.length,o={key:e,component:n,load:r,info:i};return ot(e.path).reduce((c,h)=>{for(const a of st(h)){const f=Bt(t,a);let u=l?f:f.split("/*",1)[0];u=u.split("/").map(g=>g.startsWith(":")||g.startsWith("*")?g:encodeURIComponent(g)).join("/"),c.push({...o,originalPath:a,pattern:u,matcher:Ft(u,!l,e.matchFilters)})}return c},[])}function Kt(e,t=0){return{routes:e,score:Dt(e[e.length-1])*1e4-t,matcher(n){const r=[];for(let s=e.length-1;s>=0;s--){const i=e[s],l=i.matcher(n);if(!l)return null;r.unshift({...l,route:i})}return r}}}function ot(e){return Array.isArray(e)?e:[e]}function it(e,t="",n=[],r=[]){const s=ot(e);for(let i=0,l=s.length;il.score-i.score)}function lt(e,t){for(let n=0,r=e.length;n{const h=e();try{return new URL(h,n)}catch{return console.error(`Invalid path ${h}`),c}},n,{equals:(c,h)=>c.href===h.href}),s=O(()=>r().pathname),i=O(()=>r().search,!0),l=O(()=>r().hash),o=()=>"";return{get pathname(){return s()},get search(){return i()},get hash(){return l()},get state(){return t()},get key(){return o()},query:rt(Oe(i,()=>nt(r())))}}let U;function qt(e,t,n,r={}){const{signal:[s,i],utils:l={}}=e,o=l.parsePath||(E=>E),c=l.renderPath||(E=>E),h=l.beforeLeave||et(),a=ce("",r.base||"");if(a===void 0)throw new Error(`${a} is not a valid base path`);a&&!s().value&&i({value:a,replace:!0,scroll:!1});const[f,u]=T(!1),g=async E=>{u(!0);try{await pt(E)}finally{u(!1)}},[d,m]=T(s().value),[p,_]=T(s().state),L=Vt(d,p),S=[],x=T([]),k={pattern:a,params:{},path:()=>a,outlet:()=>null,resolvePath(E){return ce(a,E)}};return $(()=>{const{value:E,state:R}=s();j(()=>{E!==d()&&g(()=>{U="native",m(E),_(R),x[1]([])}).then(()=>{U=void 0})})}),{base:k,location:L,isRouting:f,renderPath:c,parsePath:o,navigatorFactory:oe,beforeLeave:h,preloadRoute:ut,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:x};function B(E,R,K){j(()=>{if(typeof R=="number"){R&&(l.go?l.go(R):console.warn("Router integration does not support relative routing"));return}const{replace:ye,resolve:ve,scroll:X,state:Z}={replace:!1,resolve:!0,scroll:!0,...K},M=ve?E.resolvePath(R):ce("",R);if(M===void 0)throw new Error(`Path '${R}' is not a routable path`);if(S.length>=Mt)throw new Error("Too many redirects");const Fe=d();if((M!==Fe||Z!==p())&&!It){if(h.confirm(M,K)){const ft=S.push({value:Fe,replace:ye,scroll:X,state:p()});g(()=>{U="navigate",m(M),_(Z),x[1]([])}).then(()=>{S.length===ft&&(U=void 0,ct({value:M,state:Z}))})}}})}function oe(E){return E=E||bt(je)||k,(R,K)=>B(E,R,K)}function ct(E){const R=S[0];R&&((E.value!==R.value||E.state!==R.state)&&i({...E,replace:R.replace,scroll:R.scroll}),S.length=0)}function ut(E,R){const K=lt(n(),E.pathname),ye=U;U="preload";for(let ve in K){const{route:X,params:Z}=K[ve];X.component&&X.component.preload&&X.component.preload();const{load:M}=X;R&&M&&Xe(t(),()=>M({params:Z,location:{pathname:E.pathname,search:E.search,hash:E.hash,query:nt(E),state:null,key:""},intent:"preload"}))}U=ye}}function Gt(e,t,n,r,s){const{base:i,location:l}=e,{pattern:o,component:c,load:h}=r().route,a=O(()=>r().path);c&&c.preload&&c.preload();const f=h?h({params:s,location:l,intent:U||"initial"}):void 0;return{parent:t,pattern:o,path:a,params:s,outlet:()=>c?C(c,{params:s,location:l,data:f,get children(){return n()}}):n(),resolvePath(g){return ce(i.path(),g,a())}}}const Xt=e=>t=>{const{base:n}=t,r=Re(()=>t.children),s=O(()=>it(t.root?{component:t.root,load:t.rootLoad,children:r()}:r(),t.base||""));let i;const l=qt(e,()=>i,s,{base:n,singleFlight:t.singleFlight});return e.create&&e.create(l),C(Ut.Provider,{value:l,get children(){return[O(()=>(i=Ge())&&null),C(Jt,{routerState:l,get branches(){return s()}})]}})};function Jt(e){const t=O(()=>lt(e.branches,e.routerState.location.pathname)),n=rt(()=>{const l=t(),o={};for(let c=0;c{let h=o&&l.length===o.length;const a=[];for(let f=0,u=l.length;f{r[f]=m,a[f]=Gt(e.routerState,a[f-1]||e.routerState.base,Qt(()=>i()[f+1]),()=>t()[f],n)}))}return r.splice(l.length).forEach(f=>f()),c&&h?c:(s=a[0],a)}));return C(q,{get when(){return i()&&s},keyed:!0,children:l=>C(je.Provider,{value:l,get children(){return l.outlet()}})})}const Qt=e=>()=>C(q,{get when(){return e()},keyed:!0,children:t=>C(je.Provider,{value:t,get children(){return t.outlet()}})}),le=e=>{const t=Re(()=>e.children);return Et(e,{get children(){return t()}})};function Yt([e,t],n,r){return[n?()=>n(e()):e,r?s=>t(r(s)):t]}function Zt(e){if(e==="#")return null;try{return document.querySelector(e)}catch{return null}}function zt(e){let t=!1;const n=s=>typeof s=="string"?{value:s}:s,r=Yt(T(n(e.get()),{equals:(s,i)=>s.value===i.value}),void 0,s=>(!t&&e.set(s),s));return e.init&&ke(e.init((s=e.get())=>{t=!0,r[1](n(s)),t=!1})),Xt({signal:r,create:e.create,utils:e.utils})}function en(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function tn(e,t){const n=Zt(`#${e}`);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const nn=new Map;function rn(e=!0,t=!1,n="/_server"){return r=>{const s=r.base.path(),i=r.navigatorFactory(r.base);let l={};function o(d){return d.namespaceURI==="http://www.w3.org/2000/svg"}function c(d){if(d.defaultPrevented||d.button!==0||d.metaKey||d.altKey||d.ctrlKey||d.shiftKey)return;const m=d.composedPath().find(k=>k instanceof Node&&k.nodeName.toUpperCase()==="A");if(!m||t&&!m.hasAttribute("link"))return;const p=o(m),_=p?m.href.baseVal:m.href;if((p?m.target.baseVal:m.target)||!_&&!m.hasAttribute("state"))return;const S=(m.getAttribute("rel")||"").split(/\s+/);if(m.hasAttribute("download")||S&&S.includes("external"))return;const x=p?new URL(_,document.baseURI):new URL(_);if(!(x.origin!==window.location.origin||s&&x.pathname&&!x.pathname.toLowerCase().startsWith(s.toLowerCase())))return[m,x]}function h(d){const m=c(d);if(!m)return;const[p,_]=m,L=r.parsePath(_.pathname+_.search+_.hash),S=p.getAttribute("state");d.preventDefault(),i(L,{resolve:!1,replace:p.hasAttribute("replace"),scroll:!p.hasAttribute("noscroll"),state:S&&JSON.parse(S)})}function a(d){const m=c(d);if(!m)return;const[p,_]=m;l[_.pathname]||r.preloadRoute(_,p.getAttribute("preload")!=="false")}function f(d){const m=c(d);if(!m)return;const[p,_]=m;l[_.pathname]||(l[_.pathname]=setTimeout(()=>{r.preloadRoute(_,p.getAttribute("preload")!=="false"),delete l[_.pathname]},200))}function u(d){const m=c(d);if(!m)return;const[,p]=m;l[p.pathname]&&(clearTimeout(l[p.pathname]),delete l[p.pathname])}function g(d){let m=d.submitter&&d.submitter.hasAttribute("formaction")?d.submitter.getAttribute("formaction"):d.target.getAttribute("action");if(!m)return;if(!m.startsWith("https://action/")){const _=new URL(m,tt);if(m=r.parsePath(_.pathname+_.search),!m.startsWith(n))return}if(d.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const p=nn.get(m);if(p){d.preventDefault();const _=new FormData(d.target);d.submitter&&d.submitter.name&&_.append(d.submitter.name,d.submitter.value),p.call(r,_)}}_e(["click","submit"]),document.addEventListener("click",h),e&&(document.addEventListener("mouseover",f),document.addEventListener("mouseout",u),document.addEventListener("focusin",a),document.addEventListener("touchstart",a)),document.addEventListener("submit",g),ke(()=>{document.removeEventListener("click",h),e&&(document.removeEventListener("mouseover",f),document.removeEventListener("mouseout",u),document.removeEventListener("focusin",a),document.removeEventListener("touchstart",a)),document.removeEventListener("submit",g)})}}function sn(e){const t=e.replace(/^.*?#/,"");if(!t.startsWith("/")){const[,n="/"]=window.location.hash.split("#",2);return`${n}#${t}`}return t}function on(e){const t=()=>window.location.hash.slice(1),n=et();return zt({get:t,set({value:r,replace:s,scroll:i,state:l}){s?window.history.replaceState(Wt(l),"","#"+r):window.location.hash=r;const o=r.indexOf("#"),c=o>=0?r.slice(o+1):"";tn(c,i),Te()},init:r=>en(window,"hashchange",Tt(r,s=>!n.confirm(s&&s<0?s:t()))),create:rn(e.preload,e.explicitLinks,e.actionBase),utils:{go:r=>window.history.go(r),renderPath:r=>`#${r}`,parsePath:sn,beforeLeave:n}})(e)}const ln="_chordblock_1xxb2_3",an="_content_1xxb2_7",cn="_chord_1xxb2_3",un="_text_1xxb2_29",fn="_textx_1xxb2_35",hn="_nut_1xxb2_42",dn="_fret_1xxb2_48",gn="_finger_1xxb2_53",mn="_string_1xxb2_58",pn="_bar_1xxb2_63",bn="_n1_1xxb2_69",_n="_n2_1xxb2_70",yn="_n3_1xxb2_71",vn="_n4_1xxb2_72",xn="_n5_1xxb2_73",wn="_n6_1xxb2_74",$n="_n7_1xxb2_75",Sn="_active_1xxb2_78",An="_clear_1xxb2_102",Cn="_footer_1xxb2_106",En="_roman_1xxb2_112",Pn="_scale_1xxb2_119",Ln="_header_1xxb2_131",On="_menu-btn_1xxb2_156",kn="_logo_1xxb2_160",Rn="_menu_1xxb2_156",In="_menu-icon_1xxb2_178",Wn="_navicon_1xxb2_187",Tn="_steps_1xxb2_237",jn="_chord-notes_1xxb2_269",A={chordblock:ln,content:an,chord:cn,text:un,textx:fn,nut:hn,fret:dn,finger:gn,string:mn,bar:pn,n1:bn,n2:_n,n3:yn,n4:vn,n5:xn,n6:wn,n7:$n,active:Sn,clear:An,footer:Cn,roman:En,scale:Pn,header:Ln,"menu-btn":"_menu-btn_1xxb2_156",menuBtn:On,logo:kn,menu:Rn,"menu-icon":"_menu-icon_1xxb2_178",menuIcon:In,navicon:Wn,steps:Tn,"chord-notes":"_chord-notes_1xxb2_269",chordNotes:jn},D={0:"C",1:"C#",2:"D",3:"D#",4:"E",5:"F",6:"F#",7:"G",8:"G#",9:"A",10:"A#",11:"B"};class V{constructor(t){this.strings=t}fingering(t,n){const r=[];return this.strings.forEach((s,i)=>{for(let l=0;l(h||4))return;if(i==this.strings.length){const u=r.sounding;new Set(u.map(d=>d.color)).size==t.notes.length&&(!c||u[0].color===0)&&s.push(r);return}const a=this.strings[i],f=r.bar;f||this.string_fingerings(t,n,r.push(new ae(i,0,null,null)),s,i+1);for(let u=f?f.fret:0;u0&&i!=this.strings.length-1&&this.string_fingerings(t,n,r.push(new ae(i,u,g,D[t.notes[g]],!0)),s,i+1),this.string_fingerings(t,n,r.push(new ae(i,u,g,D[t.notes[g]])),s,i+1))}}chord_fingerings(t,n){const r=[];this.string_fingerings(t,n,new re([]),r,0),console.log(r);let s=r.filter(i=>!i.pointless_bar);return s=s.filter(i=>!s.some(l=>i!=l&&i.isSubSetOf(l))),s.sort(re.sorter),console.log(s),s}}class ae{constructor(t,n,r,s,i){this.string=t,this.fret=n,this.color=r,this.label=s,this.bar=i}get mute(){return this.color==null}}class re{constructor(t){this.fingers=t,this.signature=this.fingers.map(n=>n.mute?"x":n.fret+(n.bar?"b":"")).join("|")}static sorter(t,n){return!t.bar&&n.bar?-1:t.bar&&!n.bar?1:t.min_sounding_fret-n.min_sounding_fret}get min_sounding_fret(){return Math.min(...this.sounding.map(t=>t.fret))}get min_fret(){return this.fingered.length?Math.min(...this.fingered.map(t=>t.fret)):0}get max_fret(){return Math.max(...this.sounding.map(t=>t.fret))}get no_fingers(){return this.fingers.filter(t=>!t.mute&&(!t.bar||t.bar.fret!=t.fret)).length}get sounding(){return this.fingers.filter(t=>!t.mute)}get fingered(){return this.sounding.filter(t=>t.fret)}max_reach(t){return Math.max(...this.fingered.map(n=>Math.abs(n.fret-t)))}get bar(){return this.fingers.flatMap(t=>t.bar?[t]:[])[0]}get pointless_bar(){const t=this.bar;return t?!this.fingers.some(n=>n.string>t.string&&n.fret==t.fret):!1}push(t){return new re([...this.fingers,t])}isSubSetOf(t){const n=this.sounding.every(r=>t.sounding.some(s=>r.string==s.string&&r.fret==s.fret));return n&&this.bar&&!t.bar||n&&this.bar&&t.bar&&this.bar.fret==t.bar.fret&&this.bar.string[e[1],e[0]])),Fn=Object.fromEntries(ue.map(e=>[e.notes,e.symbol]));function Dn(e){return(e%12+12)%12}class at{constructor(t){this.notes=t}get root(){return this.notes[0]}get type(){const t=this.notes.map(n=>Dn(n-this.root));return(t.length>3?Bn[t[3]]:"")+Fn[t.slice(0,3)]}get label(){return D[this.root]+this.type}}const Mn={W:2,H:1};class N{constructor(t){this.notes=t}static fromSteps(t){let n=0;return t=[...t],t.pop(),new N([0,...t.map(r=>(n=(n+Mn[r])%12,n))])}transpose(t){return new N(this.notes.map(n=>(n+t)%12))}label(t){return D[t]}chord(t){return new at([0,2,4].map(n=>this.notes[(t+n)%this.notes.length]))}}const Se={"Ionian / Major":N.fromSteps("WWHWWWH"),Dorian:N.fromSteps("WHWWWHW"),Phrygian:N.fromSteps("HWWWHWW"),Lydian:N.fromSteps("WWWHWWH"),Mixolydian:N.fromSteps("WWHWWHW"),"Aeolian / Minor":N.fromSteps("WHWWHWW"),Locrian:N.fromSteps("HWWHWWW")},z={Guitar:new V([4,9,2,7,11,4]),"Guitar Open D":new V([2,9,2,6,9,2]),"Guitar Open G":new V([2,7,2,7,11,2]),Bass:new V([4,9,2,7]),Ukulele:new V([7,0,4,9]),Banjo:new V([2,7,11,2]),"Banjo Open C":new V([0,7,0,4])};var Un=y("

This is a collection of utilities to help you find your way around your stringed instrument, be it a guitar, uke, banjo, or your very own custom 9 stringed cigar box thing. "),Hn=y("

Pick your instrument on the settings page, and go either to the scales or chords page!"),Kn=y("

This is not a chord data-base, the app calculates ways to play the chords on the fly!");function Vn(){return[Un(),Hn(),Kn()]}const qn="/chord-finder/assets/guitar-AUKtsq8u.png";var Gn=y("

Force root bass will ensure the lowest sounding string is the root of a chord. On guitar, this is common, on ukulele or banjo, you probably don't care.

We'll save your instrument in your browser. More and custom tunings coming soon!"),Xn=y("

(/)(/)