From 9ff1f9bf624614b04d270f167acda4bba4b497e1 Mon Sep 17 00:00:00 2001 From: AcipenserSturio Date: Thu, 10 Aug 2023 13:09:06 +0500 Subject: [PATCH] Updates --- build/bundle.css | 7 ++++--- build/bundle.js | 2 +- build/bundle.js.map | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build/bundle.css b/build/bundle.css index 1103c1a..6809377 100644 --- a/build/bundle.css +++ b/build/bundle.css @@ -1,6 +1,7 @@ button.svelte-eb3889{background-color:inherit;border:none;font-size:inherit} -.entry.svelte-zcnotl{display:flex;flex-direction:row;padding:7px 7px 7px 0px;border-left-width:2px;border-left-style:solid;margin:10px 0px;border-top:1px solid var(--border-color)}.word_info.svelte-zcnotl{display:flex;flex-direction:row;justify-content:space-between;align-items:baseline}.word_main.svelte-zcnotl{display:flex;flex-direction:column;width:100%}.core.svelte-zcnotl{border-left-color:#dedede}.widespread.svelte-zcnotl{border-left-color:#b5b5b5}.common.svelte-zcnotl{border-left-color:#949494}.uncommon.svelte-zcnotl{border-left-color:#6b6a6b}.rare.svelte-zcnotl{border-left-color:#4a4a4a}.obscure.svelte-zcnotl{border-left-color:#292929}.sp.svelte-zcnotl{display:inline-block;font-family:"sitelen seli kiwen";font-size:50px;width:60px;text-align:center;vertical-align:middle;margin:0px 10px}dt.svelte-zcnotl{display:inline-block;font-size:150%;color:var(--highlight-color);font-weight:bold;font-style:italic;vertical-align:middle}dd.svelte-zcnotl{margin:unset} +.entry.svelte-1mrnbg1{display:flex;flex-direction:row;padding:7px 7px 7px 0px;border-left-width:2px;border-left-style:solid;margin:10px 0px;border-top:1px solid var(--border-color)}.word_info.svelte-1mrnbg1{display:flex;flex-direction:row;justify-content:space-between;align-items:baseline}.word_main.svelte-1mrnbg1{display:flex;flex-direction:column;width:100%}.core.svelte-1mrnbg1{border-left-color:#dedede}.widespread.svelte-1mrnbg1{border-left-color:#b5b5b5}.common.svelte-1mrnbg1{border-left-color:#949494}.uncommon.svelte-1mrnbg1{border-left-color:#6b6a6b}.rare.svelte-1mrnbg1{border-left-color:#4a4a4a}.obscure.svelte-1mrnbg1{border-left-color:#292929}.sp.svelte-1mrnbg1{display:inline-block;font-family:"sitelen seli kiwen";font-size:50px;width:60px;text-align:center;vertical-align:middle;margin:0px 10px}dt.svelte-1mrnbg1{display:inline-block;font-size:150%;color:var(--highlight-color);font-weight:bold;font-style:italic;vertical-align:middle}dd.svelte-1mrnbg1{margin:unset}.shaded.svelte-1mrnbg1{color:var(--shade-color)} .searchbar.svelte-epcfer{text-align:center;font-size:150%;font-family:inherit;font-weight:bold;font-style:italic;width:100%;background-color:var(--bg-alt-color);color:var(--highlight-color);border:1px solid var(--border-color);border-radius:0.25rem;padding:0.25rem 0}.main_input.svelte-epcfer{border:1px solid var(--border-color);border-radius:0.25rem;transition:box-shadow 0.2s, border 0.2s}.main_input.svelte-epcfer:focus{outline:none;box-shadow:0 0 0 1px var(--highlight-color);border-color:var(--highlight-color)}.svelte-epcfer::placeholder{color:var(--shade-color);opacity:0.5} #checkbox_lightmode.svelte-1rhze3c{cursor:pointer;position:absolute;top:0;left:0;width:100%;height:100%;z-index:10;opacity:0}#checkbox_lightmode_wrapper.svelte-1rhze3c{position:relative}img.svelte-1rhze3c{width:2rem;height:2rem;display:block}.lightmode img.svelte-1rhze3c{filter:invert(100%)} -nav.svelte-19dnf62.svelte-19dnf62{display:flex;justify-content:space-between;align-items:center;gap:1rem;position:sticky;padding:0.5rem 1rem;top:0;z-index:1;background-color:var(--bg-color);border-bottom:1px solid var(--border-color)}nav.svelte-19dnf62>div.svelte-19dnf62{flex:1;display:flex;align-items:center;gap:0.5rem}nav.svelte-19dnf62>.svelte-19dnf62:last-child{justify-content:end}nav.svelte-19dnf62 img.svelte-19dnf62{width:2rem;height:2rem;display:block}.lightmode img.svelte-19dnf62.svelte-19dnf62{filter:invert(100%)}.search_container.svelte-19dnf62.svelte-19dnf62{max-width:20rem;flex-basis:100%;flex-shrink:0}#language_selector.svelte-19dnf62.svelte-19dnf62{font:inherit;background-color:var(--bg-color);color:var(--txt-color);cursor:pointer;position:absolute;top:0;left:0;width:100%;height:100%;opacity:0}#language_selector.svelte-19dnf62+img.svelte-19dnf62{pointer-events:none;border-radius:100%}#language_selector.svelte-19dnf62:focus+img.svelte-19dnf62{outline:2px solid var(--highlight-color);outline-offset:2px}#language_selector_wrapper.svelte-19dnf62.svelte-19dnf62{position:relative}#normal_mode_button.svelte-19dnf62.svelte-19dnf62{font:inherit;color:inherit;display:none;background:var(--bg-alt-color);border:1px solid var(--border-color);border-radius:0.25rem;margin:0 auto;padding:0.25rem 0.5rem;cursor:pointer;transition:background 0.2s, color 0.2s, border-color 0.2s}#normal_mode_button.svelte-19dnf62.svelte-19dnf62:hover{background:var(--highlight-color);border-color:var(--highlight-color);color:var(--bg-color)}@media screen and (max-width: 640px){nav.svelte-19dnf62.svelte-19dnf62{display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"logo" "buttons" "search";gap:0.5rem;top:-3rem}nav.svelte-19dnf62>.svelte-19dnf62:first-child{white-space:nowrap}nav.svelte-19dnf62>.search_container.svelte-19dnf62{grid-area:search;grid-column:1 / -1;max-width:100%}} -@font-face{font-family:"sitelen seli kiwen";font-style:normal;font-weight:400;src:url(https://raw.githubusercontent.com/lipu-linku/nasin-sitelen/main/sitelenselikiwenasuki.ttf)}.width_limiter.svelte-16rcv3q{display:block;margin:auto;padding:0 10px;max-width:840px} +#language_selector.svelte-c3tgvh.svelte-c3tgvh{font:inherit;background-color:var(--bg-color);color:var(--txt-color);cursor:pointer;position:absolute;top:0;left:0;width:100%;height:100%;opacity:0}#language_selector.svelte-c3tgvh+img.svelte-c3tgvh{pointer-events:none;border-radius:100%}#language_selector.svelte-c3tgvh:focus+img.svelte-c3tgvh{outline:2px solid var(--highlight-color);outline-offset:2px}#language_selector_wrapper.svelte-c3tgvh.svelte-c3tgvh{position:relative}img.svelte-c3tgvh.svelte-c3tgvh{width:2rem;height:2rem;display:block}.lightmode img.svelte-c3tgvh.svelte-c3tgvh{filter:invert(100%)} +nav.svelte-16d0fwg.svelte-16d0fwg{display:flex;justify-content:space-between;align-items:center;gap:1rem;position:sticky;padding:0.5rem 1rem;top:0;z-index:1;background-color:var(--bg-color);border-bottom:1px solid var(--border-color)}nav.svelte-16d0fwg>div.svelte-16d0fwg{flex:1;display:flex;align-items:center;gap:0.5rem}nav.svelte-16d0fwg>.svelte-16d0fwg:last-child{justify-content:end}nav.svelte-16d0fwg img.svelte-16d0fwg{width:2rem;height:2rem;display:block}.lightmode img.svelte-16d0fwg.svelte-16d0fwg{filter:invert(100%)}.search_container.svelte-16d0fwg.svelte-16d0fwg{max-width:20rem;flex-basis:100%;flex-shrink:0}#normal_mode_button.svelte-16d0fwg.svelte-16d0fwg{font:inherit;color:inherit;display:none;background:var(--bg-alt-color);border:1px solid var(--border-color);border-radius:0.25rem;margin:0 auto;padding:0.25rem 0.5rem;cursor:pointer;transition:background 0.2s, color 0.2s, border-color 0.2s}#normal_mode_button.svelte-16d0fwg.svelte-16d0fwg:hover{background:var(--highlight-color);border-color:var(--highlight-color);color:var(--bg-color)}@media screen and (max-width: 640px){nav.svelte-16d0fwg.svelte-16d0fwg{display:grid;grid-template-columns:1fr 1fr;grid-template-areas:"logo" "buttons" "search";gap:0.5rem;top:-3rem}nav.svelte-16d0fwg>.svelte-16d0fwg:first-child{white-space:nowrap}nav.svelte-16d0fwg>.search_container.svelte-16d0fwg{grid-area:search;grid-column:1 / -1;max-width:100%}} +@font-face{font-family:"sitelen seli kiwen";font-style:normal;font-weight:400;src:url(https://raw.githubusercontent.com/lipu-linku/nasin-sitelen/main/sitelenselikiwenasuki.ttf)}.app.svelte-16rcv3q{margin:0 auto;padding:0}.width_limiter.svelte-16rcv3q{display:block;margin:auto;padding:0 10px;max-width:840px} diff --git a/build/bundle.js b/build/bundle.js index a8bfad4..9fadd01 100644 --- a/build/bundle.js +++ b/build/bundle.js @@ -1,2 +1,2 @@ -var app=function(){"use strict";function t(){}function e(t){return t()}function n(){return Object.create(null)}function o(t){t.forEach(e)}function r(t){return"function"==typeof t}function s(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}let c,l;function i(t){return null==t?"":t}function u(t,e){t.appendChild(e)}function a(t,e,n){t.insertBefore(e,n||null)}function d(t){t.parentNode&&t.parentNode.removeChild(t)}function f(t){return document.createElement(t)}function p(t){return document.createTextNode(t)}function $(){return p(" ")}function g(t,e,n,o){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n,o)}function h(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function m(t,e){e=""+e,t.data!==e&&(t.data=e)}function v(t,e){t.value=null==e?"":e}function y(t){l=t}const _=[],b=[];let x=[];const k=[],w=Promise.resolve();let q=!1;function E(t){x.push(t)}function L(t){k.push(t)}const j=new Set;let z=0;function O(){if(0!==z)return;const t=l;do{try{for(;z<_.length;){const t=_[z];z++,y(t),A(t.$$)}}catch(t){throw _.length=0,z=0,t}for(y(null),_.length=0,z=0;b.length;)b.pop()();for(let t=0;t{C.delete(t),o&&(n&&t.d(1),o())})),t.o(e)}else o&&o()}function B(t,e,n){const o=t.$$.props[e];void 0!==o&&(t.$$.bound[o]=n,n(t.$$.ctx[o]))}function D(t){t&&t.c()}function G(t,n,s,c){const{fragment:l,after_update:i}=t.$$;l&&l.m(n,s),c||E((()=>{const n=t.$$.on_mount.map(e).filter(r);t.$$.on_destroy?t.$$.on_destroy.push(...n):o(n),t.$$.on_mount=[]})),i.forEach(E)}function J(t,e){const n=t.$$;null!==n.fragment&&(!function(t){const e=[],n=[];x.forEach((o=>-1===t.indexOf(o)?e.push(o):n.push(o))),n.forEach((t=>t())),x=e}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function P(t,e){-1===t.$$.dirty[0]&&(_.push(t),q||(q=!0,w.then(O)),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<{const r=o.length?o[0]:n;return $.ctx&&i($.ctx[t],$.ctx[t]=r)&&(!$.skip_bound&&$.bound[t]&&$.bound[t](r),g&&P(e,t)),n})):[],$.update(),g=!0,o($.before_update),$.fragment=!!c&&c($.ctx),r.target){if(r.hydrate){const t=function(t){return Array.from(t.childNodes)}(r.target);$.fragment&&$.fragment.l(t),t.forEach(d)}else $.fragment&&$.fragment.c();r.intro&&S(e.$$.fragment),G(e,r.target,r.anchor,r.customElement),O()}y(p)}class X{$destroy(){J(this,1),this.$destroy=t}$on(e,n){if(!r(n))return t;const o=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return o.push(n),()=>{const t=o.indexOf(n);-1!==t&&o.splice(t,1)}}$set(t){var e;this.$$set&&(e=t,0!==Object.keys(e).length)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function F(e){let n,o,r;return{c(){n=f("button"),n.textContent="🔊",h(n,"class","svelte-eb3889")},m(t,s){a(t,n,s),o||(r=g(n,"click",e[0]),o=!0)},p:t,i:t,o:t,d(t){t&&d(n),o=!1,r()}}}function I(t,e,n){let o,{audio:r}=e;return t.$$set=t=>{"audio"in t&&n(1,r=t.audio)},t.$$.update=()=>{2&t.$$.dirty&&(o=r.jan_lakuse?new Audio(r.jan_lakuse):r.kala_asi?new Audio(r.kala_asi):void 0)},[()=>{o&&o.play()},r]}class K extends X{constructor(t){super(),R(this,t,I,F,s,{audio:1})}}function Q(t){let e,n,o,r;return o=new K({props:{audio:t[1]}}),{c(){e=f("span"),e.textContent="·",n=$(),D(o.$$.fragment)},m(t,s){a(t,e,s),a(t,n,s),G(o,t,s),r=!0},p(t,e){const n={};2&e&&(n.audio=t[1]),o.$set(n)},i(t){r||(S(o.$$.fragment,t),r=!0)},o(t){H(o.$$.fragment,t),r=!1},d(t){t&&d(e),t&&d(n),J(o,t)}}}function U(t){let e,n,o,r,s,c,l,g,v,y,_,b,x,k,w,q,E,L,j,z,O,A,C,M,B,D,G,J=t[0].word+"",P=t[0].usage_category+"",R=t[0].book+"",X=t[0].def.en+"",F=t[0].audio&&Q(t);return{c(){e=f("div"),n=f("div"),o=p(t[2]),r=$(),s=f("div"),c=f("div"),l=f("dt"),g=p(J),v=$(),y=f("span"),_=f("span"),b=p(P),x=$(),k=f("span"),k.textContent="·",w=$(),q=f("span"),E=p(R),L=$(),F&&F.c(),j=$(),z=f("span"),z.textContent="·",O=$(),A=f("span"),A.textContent="more",C=$(),M=f("dd"),B=p(X),h(n,"class","sp svelte-zcnotl"),h(l,"class","svelte-zcnotl"),h(c,"class","word_info svelte-zcnotl"),h(M,"class","svelte-zcnotl"),h(s,"class","word_main svelte-zcnotl"),h(e,"class",D=i("entry "+t[0].usage_category)+" svelte-zcnotl")},m(t,i){a(t,e,i),u(e,n),u(n,o),u(e,r),u(e,s),u(s,c),u(c,l),u(l,g),u(c,v),u(c,y),u(y,_),u(_,b),u(y,x),u(y,k),u(y,w),u(y,q),u(q,E),u(y,L),F&&F.m(y,null),u(y,j),u(y,z),u(y,O),u(y,A),u(s,C),u(s,M),u(M,B),G=!0},p(t,[n]){(!G||4&n)&&m(o,t[2]),(!G||1&n)&&J!==(J=t[0].word+"")&&m(g,J),(!G||1&n)&&P!==(P=t[0].usage_category+"")&&m(b,P),(!G||1&n)&&R!==(R=t[0].book+"")&&m(E,R),t[0].audio?F?(F.p(t,n),1&n&&S(F,1)):(F=Q(t),F.c(),S(F,1),F.m(y,j)):F&&(T(),H(F,1,1,(()=>{F=null})),N()),(!G||1&n)&&X!==(X=t[0].def.en+"")&&m(B,X),(!G||1&n&&D!==(D=i("entry "+t[0].usage_category)+" svelte-zcnotl"))&&h(e,"class",D)},i(t){G||(S(F),G=!0)},o(t){H(F),G=!1},d(t){t&&d(e),F&&F.d()}}}function V(t,e,n){let o,r,{word:s}=e;return t.$$set=t=>{"word"in t&&n(0,s=t.word)},t.$$.update=()=>{1&t.$$.dirty&&n(2,o=s.sitelen_pona?s.sitelen_pona.split(" ")[0]:""),1&t.$$.dirty&&n(1,r=s.audio)},[s,r,o]}class W extends X{constructor(t){super(),R(this,t,V,U,s,{word:0})}}function Y(e){let n,o,r;return{c(){n=f("input"),h(n,"id","searchbar"),h(n,"class","searchbar main_input svelte-epcfer"),h(n,"placeholder","nimi"),h(n,"autocapitalize","off"),h(n,"autocomplete","off"),h(n,"autocorrect","off"),h(n,"spellcheck","false")},m(t,s){a(t,n,s),v(n,e[0]),o||(r=g(n,"input",e[1]),o=!0)},p(t,[e]){1&e&&n.value!==t[0]&&v(n,t[0])},i:t,o:t,d(t){t&&d(n),o=!1,r()}}}function Z(t,e,n){let{query:o}=e;return t.$$set=t=>{"query"in t&&n(0,o=t.query)},[o,function(){o=this.value,n(0,o)}]}class tt extends X{constructor(t){super(),R(this,t,Z,Y,s,{query:0})}}function et(e){let n,o,r,s,l,i,p;return{c(){var t,e;n=f("label"),o=f("input"),r=$(),s=f("img"),h(o,"type","checkbox"),h(o,"id","checkbox_lightmode"),h(o,"class","svelte-1rhze3c"),t=s.src,e=l="./assets/suno.png",c||(c=document.createElement("a")),c.href=e,t!==c.href&&h(s,"src","./assets/suno.png"),h(s,"alt","Light Mode"),h(s,"class","svelte-1rhze3c"),h(n,"id","checkbox_lightmode_wrapper"),h(n,"class","svelte-1rhze3c")},m(t,c){a(t,n,c),u(n,o),o.checked=e[0],u(n,r),u(n,s),i||(p=g(o,"change",e[1]),i=!0)},p(t,[e]){1&e&&(o.checked=t[0])},i:t,o:t,d(t){t&&d(n),i=!1,p()}}}function nt(t,e,n){let{lightmode:o}=e;return t.$$set=t=>{"lightmode"in t&&n(0,o=t.lightmode)},[o,function(){o=this.checked,n(0,o)}]}class ot extends X{constructor(t){super(),R(this,t,nt,et,s,{lightmode:0})}}function rt(t){let e,n,o,r,s,c,l,i,p,g,m,v,y,_,x,k,w;function q(e){t[2](e)}let E={};function j(e){t[3](e)}void 0!==t[0]&&(E.query=t[0]),s=new tt({props:E}),b.push((()=>B(s,"query",q)));let z={};return void 0!==t[1]&&(z.lightmode=t[1]),m=new ot({props:z}),b.push((()=>B(m,"lightmode",j))),{c(){e=f("nav"),n=f("div"),n.innerHTML='lipu Linku\n lipu Linku',o=$(),r=f("div"),D(s.$$.fragment),l=$(),i=f("button"),i.textContent="Back to Dictionary",p=$(),g=f("div"),D(m.$$.fragment),y=$(),_=f("label"),_.innerHTML=' \n Select language',x=$(),k=f("a"),k.innerHTML='About Linku',h(n,"class","logo svelte-19dnf62"),h(i,"id","normal_mode_button"),h(i,"onclick","normal_mode()"),h(i,"class","svelte-19dnf62"),h(r,"class","search_container svelte-19dnf62"),h(_,"id","language_selector_wrapper"),h(_,"title","Select Language"),h(_,"class","svelte-19dnf62"),h(k,"href","about"),h(k,"title","About Linku"),h(g,"class","svelte-19dnf62"),h(e,"class","svelte-19dnf62")},m(t,c){a(t,e,c),u(e,n),u(e,o),u(e,r),G(s,r,null),u(r,l),u(r,i),u(e,p),u(e,g),G(m,g,null),u(g,y),u(g,_),u(g,x),u(g,k),w=!0},p(t,[e]){const n={};!c&&1&e&&(c=!0,n.query=t[0],L((()=>c=!1))),s.$set(n);const o={};!v&&2&e&&(v=!0,o.lightmode=t[1],L((()=>v=!1))),m.$set(o)},i(t){w||(S(s.$$.fragment,t),S(m.$$.fragment,t),w=!0)},o(t){H(s.$$.fragment,t),H(m.$$.fragment,t),w=!1},d(t){t&&d(e),J(s),J(m)}}}function st(t,e,n){let{query:o}=e,{lightmode:r}=e;return t.$$set=t=>{"query"in t&&n(0,o=t.query),"lightmode"in t&&n(1,r=t.lightmode)},[o,r,function(t){o=t,n(0,o)},function(t){r=t,n(1,r)}]}class ct extends X{constructor(t){super(),R(this,t,st,rt,s,{query:0,lightmode:1})}}function lt(t,e,n){const o=t.slice();return o[8]=e[n][0],o[9]=e[n][1],o[8]=n,o}function it(t){let e,n,o;return e=new W({props:{word:t[9]}}),{c(){D(e.$$.fragment),n=$()},m(t,r){G(e,t,r),a(t,n,r),o=!0},p(t,n){const o={};4&n&&(o.word=t[9]),e.$set(o)},i(t){o||(S(e.$$.fragment,t),o=!0)},o(t){H(e.$$.fragment,t),o=!1},d(t){J(e,t),t&&d(n)}}}function ut(t){let e,n,o,r,s,c,l;function i(e){t[3](e)}function p(e){t[4](e)}let g={};void 0!==t[0]&&(g.query=t[0]),void 0!==t[1]&&(g.lightmode=t[1]),n=new ct({props:g}),b.push((()=>B(n,"query",i))),b.push((()=>B(n,"lightmode",p)));let m=Object.entries(t[2]),v=[];for(let e=0;eH(v[t],1,1,(()=>{v[t]=null}));return{c(){e=f("div"),D(n.$$.fragment),s=$(),c=f("div");for(let t=0;to=!1))),!r&&2&e&&(r=!0,s.lightmode=t[1],L((()=>r=!1))),n.$set(s),4&e){let n;for(m=Object.entries(t[2]),n=0;n{1&t.$$.dirty&&n(2,o=function(t,e){const n=Object.entries(t).filter((([t,n])=>function(t,e){return t.word.includes(e)}(n,e)));return Object.fromEntries(n)}(l,i)),2&t.$$.dirty&&(u?document.documentElement.classList.add("lightmode"):document.documentElement.classList.remove("lightmode"))},[i,u,o,function(t){i=t,n(0,i)},function(t){u=t,n(1,u)}]}return new class extends X{constructor(t){super(),R(this,t,at,ut,s,{})}}({target:document.body})}(); +var app=function(){"use strict";function e(){}function t(e){return e()}function n(){return Object.create(null)}function o(e){e.forEach(t)}function s(e){return"function"==typeof e}function l(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let r,c;function u(e,t){return r||(r=document.createElement("a")),r.href=t,e===r.href}function a(e){return null==e?"":e}function i(e,t){e.appendChild(t)}function d(e,t,n){e.insertBefore(t,n||null)}function g(e){e.parentNode&&e.parentNode.removeChild(e)}function f(e,t){for(let n=0;ne.removeEventListener(t,n,o)}function _(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function v(e,t){t=""+t,e.data!==t&&(e.data=t)}function y(e,t){e.value=null==t?"":t}function b(e,t,n){for(let n=0;n{T.delete(e),o&&(n&&e.d(1),o())})),e.o(t)}else o&&o()}function I(e,t,n){const o=e.$$.props[t];void 0!==o&&(e.$$.bound[o]=n,n(e.$$.ctx[o]))}function J(e){e&&e.c()}function P(e,n,l,r){const{fragment:c,after_update:u}=e.$$;c&&c.m(n,l),r||O((()=>{const n=e.$$.on_mount.map(t).filter(s);e.$$.on_destroy?e.$$.on_destroy.push(...n):o(n),e.$$.on_mount=[]})),u.forEach(O)}function R(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];q.forEach((o=>-1===e.indexOf(o)?t.push(o):n.push(o))),n.forEach((e=>e())),q=t}(n.after_update),o(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function X(e,t){-1===e.$$.dirty[0]&&(x.push(e),L||(L=!0,j.then(M)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<{const s=o.length?o[0]:n;return p.ctx&&u(p.ctx[e],p.ctx[e]=s)&&(!p.skip_bound&&p.bound[e]&&p.bound[e](s),$&&X(t,e)),n})):[],p.update(),$=!0,o(p.before_update),p.fragment=!!r&&r(p.ctx),s.target){if(s.hydrate){const e=function(e){return Array.from(e.childNodes)}(s.target);p.fragment&&p.fragment.l(e),e.forEach(g)}else p.fragment&&p.fragment.c();s.intro&&D(t.$$.fragment),P(t,s.target,s.anchor,s.customElement),M()}w(f)}class K{$destroy(){R(this,1),this.$destroy=e}$on(t,n){if(!s(n))return e;const o=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return o.push(n),()=>{const e=o.indexOf(n);-1!==e&&o.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function Q(t){let n,o,s;return{c(){n=p("button"),n.textContent="🔊",_(n,"class","svelte-eb3889")},m(e,l){d(e,n,l),o||(s=m(n,"click",t[0]),o=!0)},p:e,i:e,o:e,d(e){e&&g(n),o=!1,s()}}}function U(e,t,n){let o,{audio:s}=t;return e.$$set=e=>{"audio"in e&&n(1,s=e.audio)},e.$$.update=()=>{2&e.$$.dirty&&(o=s.jan_lakuse?new Audio(s.jan_lakuse):s.kala_asi?new Audio(s.kala_asi):void 0)},[()=>{o&&o.play()},s]}class V extends K{constructor(e){super(),F(this,e,U,Q,l,{audio:1})}}function W(e){let t,n,o,s;return o=new V({props:{audio:e[3]}}),{c(){t=p("span"),t.textContent="·",n=h(),J(o.$$.fragment)},m(e,l){d(e,t,l),d(e,n,l),P(o,e,l),s=!0},p(e,t){const n={};8&t&&(n.audio=e[3]),o.$set(n)},i(e){s||(D(o.$$.fragment,e),s=!0)},o(e){G(o.$$.fragment,e),s=!1},d(e){e&&g(t),e&&g(n),R(o,e)}}}function Y(e){let t,n,o,s,l,r,c,u,f,m,y,b,w,x,k,q,E,j,L,O,A,C,S,M,N,T,z,I,J=e[0].word+"",P=e[0].usage_category+"",R=e[0].book+"",X=e[0].audio&&W(e);return{c(){t=p("div"),n=p("div"),o=$(e[4]),s=h(),l=p("div"),r=p("div"),c=p("dt"),u=$(J),f=h(),m=p("span"),y=p("span"),b=$(P),w=h(),x=p("span"),x.textContent="·",k=h(),q=p("span"),E=$(R),j=h(),X&&X.c(),L=h(),O=p("span"),O.textContent="·",A=h(),C=p("span"),C.textContent="more",S=h(),M=p("dd"),N=$(e[1]),_(n,"class","sp svelte-1mrnbg1"),_(c,"class","svelte-1mrnbg1"),_(r,"class","word_info svelte-1mrnbg1"),_(M,"class",T=a(e[2]?"":"shaded")+" svelte-1mrnbg1"),_(l,"class","word_main svelte-1mrnbg1"),_(t,"class",z=a("entry "+e[0].usage_category)+" svelte-1mrnbg1")},m(e,a){d(e,t,a),i(t,n),i(n,o),i(t,s),i(t,l),i(l,r),i(r,c),i(c,u),i(r,f),i(r,m),i(m,y),i(y,b),i(m,w),i(m,x),i(m,k),i(m,q),i(q,E),i(m,j),X&&X.m(m,null),i(m,L),i(m,O),i(m,A),i(m,C),i(l,S),i(l,M),i(M,N),I=!0},p(e,[n]){(!I||16&n)&&v(o,e[4]),(!I||1&n)&&J!==(J=e[0].word+"")&&v(u,J),(!I||1&n)&&P!==(P=e[0].usage_category+"")&&v(b,P),(!I||1&n)&&R!==(R=e[0].book+"")&&v(E,R),e[0].audio?X?(X.p(e,n),1&n&&D(X,1)):(X=W(e),X.c(),D(X,1),X.m(m,L)):X&&(B(),G(X,1,1,(()=>{X=null})),H()),(!I||2&n)&&v(N,e[1]),(!I||4&n&&T!==(T=a(e[2]?"":"shaded")+" svelte-1mrnbg1"))&&_(M,"class",T),(!I||1&n&&z!==(z=a("entry "+e[0].usage_category)+" svelte-1mrnbg1"))&&_(t,"class",z)},i(e){I||(D(X),I=!0)},o(e){G(X),I=!1},d(e){e&&g(t),X&&X.d()}}}function Z(e,t,n){let o,s,l,r,{word:c}=t,{selected_language:u}=t;return e.$$set=e=>{"word"in e&&n(0,c=e.word),"selected_language"in e&&n(5,u=e.selected_language)},e.$$.update=()=>{33&e.$$.dirty&&console.log(c.word,u),1&e.$$.dirty&&n(4,o=c.sitelen_pona?c.sitelen_pona.split(" ")[0]:""),1&e.$$.dirty&&n(3,s=c.audio),33&e.$$.dirty&&n(2,l=c.def[u]),37&e.$$.dirty&&n(1,r=l?c.def[u]:"(en) "+c.def.en),2&e.$$.dirty&&console.log(r)},[c,r,l,s,o,u]}class ee extends K{constructor(e){super(),F(this,e,Z,Y,l,{word:0,selected_language:5})}}function te(t){let n,o,s;return{c(){n=p("input"),_(n,"id","searchbar"),_(n,"class","searchbar main_input svelte-epcfer"),_(n,"placeholder","nimi"),_(n,"autocapitalize","off"),_(n,"autocomplete","off"),_(n,"autocorrect","off"),_(n,"spellcheck","false")},m(e,l){d(e,n,l),y(n,t[0]),o||(s=m(n,"input",t[1]),o=!0)},p(e,[t]){1&t&&n.value!==e[0]&&y(n,e[0])},i:e,o:e,d(e){e&&g(n),o=!1,s()}}}function ne(e,t,n){let{query:o}=t;return e.$$set=e=>{"query"in e&&n(0,o=e.query)},[o,function(){o=this.value,n(0,o)}]}class oe extends K{constructor(e){super(),F(this,e,ne,te,l,{query:0})}}function se(t){let n,o,s,l,r,c,a;return{c(){n=p("label"),o=p("input"),s=h(),l=p("img"),_(o,"type","checkbox"),_(o,"id","checkbox_lightmode"),_(o,"class","svelte-1rhze3c"),u(l.src,r="./assets/suno.png")||_(l,"src","./assets/suno.png"),_(l,"alt","Light Mode"),_(l,"class","svelte-1rhze3c"),_(n,"id","checkbox_lightmode_wrapper"),_(n,"class","svelte-1rhze3c")},m(e,r){d(e,n,r),i(n,o),o.checked=t[0],i(n,s),i(n,l),c||(a=m(o,"change",t[1]),c=!0)},p(e,[t]){1&t&&(o.checked=e[0])},i:e,o:e,d(e){e&&g(n),c=!1,a()}}}function le(e,t,n){let{lightmode:o}=t;return e.$$set=e=>{"lightmode"in e&&n(0,o=e.lightmode)},[o,function(){o=this.checked,n(0,o)}]}class re extends K{constructor(e){super(),F(this,e,le,se,l,{lightmode:0})}}function ce(e,t,n){const o=e.slice();return o[3]=t[n][0],o[4]=t[n][1],o}function ue(e){let t,n,o,s=e[4].name_endonym+"";return{c(){t=p("option"),n=$(s),t.__value=o=e[3],t.value=t.__value},m(e,o){d(e,t,o),i(t,n)},p(e,l){2&l&&s!==(s=e[4].name_endonym+"")&&v(n,s),2&l&&o!==(o=e[3])&&(t.__value=o,t.value=t.__value)},d(e){e&&g(t)}}}function ae(t){let n,o,s,l,r,c,a,$=Object.entries(t[1]),v=[];for(let e=0;e<$.length;e+=1)v[e]=ue(ce(t,$,e));return{c(){n=p("label"),o=p("select");for(let e=0;et[2].call(o))),u(l.src,r="./assets/world.png")||_(l,"src","./assets/world.png"),_(l,"alt","Select language"),_(l,"class","svelte-c3tgvh"),_(n,"id","language_selector_wrapper"),_(n,"title","Select Language"),_(n,"class","svelte-c3tgvh")},m(e,r){d(e,n,r),i(n,o);for(let e=0;e{"selected_language"in e&&n(0,o=e.selected_language),"languages"in e&&n(1,s=e.languages)},[o,s,function(){o=function(e){const t=e.querySelector(":checked");return t&&t.__value}(this),n(0,o),n(1,s)}]}class de extends K{constructor(e){super(),F(this,e,ie,ae,l,{selected_language:0,languages:1})}}function ge(e){let t,n,o,s,l,r,c,u,a,f,$,m,v,y,b,w,x,q;function E(t){e[4](t)}let j={};function L(t){e[5](t)}void 0!==e[0]&&(j.query=e[0]),l=new oe({props:j}),k.push((()=>I(l,"query",E)));let O={};function C(t){e[6](t)}void 0!==e[1]&&(O.lightmode=e[1]),$=new re({props:O}),k.push((()=>I($,"lightmode",L)));let S={languages:e[3]};return void 0!==e[2]&&(S.selected_language=e[2]),y=new de({props:S}),k.push((()=>I(y,"selected_language",C))),{c(){t=p("nav"),n=p("div"),n.innerHTML='lipu Linku\n lipu Linku',o=h(),s=p("div"),J(l.$$.fragment),c=h(),u=p("button"),u.textContent="Back to Dictionary",a=h(),f=p("div"),J($.$$.fragment),v=h(),J(y.$$.fragment),w=h(),x=p("a"),x.innerHTML='About Linku',_(n,"class","logo svelte-16d0fwg"),_(u,"id","normal_mode_button"),_(u,"onclick","normal_mode()"),_(u,"class","svelte-16d0fwg"),_(s,"class","search_container svelte-16d0fwg"),_(x,"href","about"),_(x,"title","About Linku"),_(f,"class","svelte-16d0fwg"),_(t,"class","svelte-16d0fwg")},m(e,r){d(e,t,r),i(t,n),i(t,o),i(t,s),P(l,s,null),i(s,c),i(s,u),i(t,a),i(t,f),P($,f,null),i(f,v),P(y,f,null),i(f,w),i(f,x),q=!0},p(e,[t]){const n={};!r&&1&t&&(r=!0,n.query=e[0],A((()=>r=!1))),l.$set(n);const o={};!m&&2&t&&(m=!0,o.lightmode=e[1],A((()=>m=!1))),$.$set(o);const s={};8&t&&(s.languages=e[3]),!b&&4&t&&(b=!0,s.selected_language=e[2],A((()=>b=!1))),y.$set(s)},i(e){q||(D(l.$$.fragment,e),D($.$$.fragment,e),D(y.$$.fragment,e),q=!0)},o(e){G(l.$$.fragment,e),G($.$$.fragment,e),G(y.$$.fragment,e),q=!1},d(e){e&&g(t),R(l),R($),R(y)}}}function fe(e,t,n){let{query:o}=t,{lightmode:s}=t,{selected_language:l}=t,{languages:r}=t;return e.$$set=e=>{"query"in e&&n(0,o=e.query),"lightmode"in e&&n(1,s=e.lightmode),"selected_language"in e&&n(2,l=e.selected_language),"languages"in e&&n(3,r=e.languages)},[o,s,l,r,function(e){o=e,n(0,o)},function(e){s=e,n(1,s)},function(e){l=e,n(2,l)}]}class pe extends K{constructor(e){super(),F(this,e,fe,ge,l,{query:0,lightmode:1,selected_language:2,languages:3})}}function $e(e,t,n){const o=e.slice();return o[10]=t[n][0],o[11]=t[n][1],o[10]=n,o}function he(e){let t,n,o;return t=new ee({props:{word:e[11],selected_language:e[2]}}),{c(){J(t.$$.fragment),n=h()},m(e,s){P(t,e,s),d(e,n,s),o=!0},p(e,n){const o={};8&n&&(o.word=e[11]),4&n&&(o.selected_language=e[2]),t.$set(o)},i(e){o||(D(t.$$.fragment,e),o=!0)},o(e){G(t.$$.fragment,e),o=!1},d(e){R(t,e),e&&g(n)}}}function me(e){let t,n,o,s,l,r,c,u;function a(t){e[5](t)}function $(t){e[6](t)}function m(t){e[7](t)}let v={languages:e[4]};void 0!==e[0]&&(v.query=e[0]),void 0!==e[1]&&(v.lightmode=e[1]),void 0!==e[2]&&(v.selected_language=e[2]),n=new pe({props:v}),k.push((()=>I(n,"query",a))),k.push((()=>I(n,"lightmode",$))),k.push((()=>I(n,"selected_language",m)));let y=Object.entries(e[3]),b=[];for(let t=0;tG(b[e],1,1,(()=>{b[e]=null}));return{c(){t=p("div"),J(n.$$.fragment),r=h(),c=p("div");for(let e=0;eo=!1))),!s&&2&t&&(s=!0,r.lightmode=e[1],A((()=>s=!1))),!l&&4&t&&(l=!0,r.selected_language=e[2],A((()=>l=!1))),n.$set(r),12&t){let n;for(y=Object.entries(e[3]),n=0;n{1&e.$$.dirty&&n(3,o=function(e,t){const n=Object.entries(e).filter((([e,n])=>function(e,t){return e.word.includes(t)}(n,t)));return Object.fromEntries(n)}(c,a)),2&e.$$.dirty&&(d?document.documentElement.classList.add("lightmode"):document.documentElement.classList.remove("lightmode"))},[a,d,i,o,u,function(e){a=e,n(0,a)},function(e){d=e,n(1,d)},function(e){i=e,n(2,i)}]}return new class extends K{constructor(e){super(),F(this,e,_e,me,l,{})}}({target:document.body})}(); //# sourceMappingURL=bundle.js.map diff --git a/build/bundle.js.map b/build/bundle.js.map index 80c1084..0afbe29 100644 --- a/build/bundle.js.map +++ b/build/bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"bundle.js","sources":["../../node_modules/svelte/internal/index.mjs","../../src/AudioButton.svelte","../../src/Entry.svelte","../../src/Searchbar.svelte","../../src/LightmodeCheckbox.svelte","../../src/Navbar.svelte","../../src/App.svelte","../../src/search.js","../../src/main.js"],"sourcesContent":["function noop() { }\nconst identity = x => x;\nfunction assign(tar, src) {\n // @ts-ignore\n for (const k in src)\n tar[k] = src[k];\n return tar;\n}\n// Adapted from https://github.com/then/is-promise/blob/master/index.js\n// Distributed under MIT License https://github.com/then/is-promise/blob/master/LICENSE\nfunction is_promise(value) {\n return !!value && (typeof value === 'object' || typeof value === 'function') && typeof value.then === 'function';\n}\nfunction add_location(element, file, line, column, char) {\n element.__svelte_meta = {\n loc: { file, line, column, char }\n };\n}\nfunction run(fn) {\n return fn();\n}\nfunction blank_object() {\n return Object.create(null);\n}\nfunction run_all(fns) {\n fns.forEach(run);\n}\nfunction is_function(thing) {\n return typeof thing === 'function';\n}\nfunction safe_not_equal(a, b) {\n return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');\n}\nlet src_url_equal_anchor;\nfunction src_url_equal(element_src, url) {\n if (!src_url_equal_anchor) {\n src_url_equal_anchor = document.createElement('a');\n }\n src_url_equal_anchor.href = url;\n return element_src === src_url_equal_anchor.href;\n}\nfunction not_equal(a, b) {\n return a != a ? b == b : a !== b;\n}\nfunction is_empty(obj) {\n return Object.keys(obj).length === 0;\n}\nfunction validate_store(store, name) {\n if (store != null && typeof store.subscribe !== 'function') {\n throw new Error(`'${name}' is not a store with a 'subscribe' method`);\n }\n}\nfunction subscribe(store, ...callbacks) {\n if (store == null) {\n return noop;\n }\n const unsub = store.subscribe(...callbacks);\n return unsub.unsubscribe ? () => unsub.unsubscribe() : unsub;\n}\nfunction get_store_value(store) {\n let value;\n subscribe(store, _ => value = _)();\n return value;\n}\nfunction component_subscribe(component, store, callback) {\n component.$$.on_destroy.push(subscribe(store, callback));\n}\nfunction create_slot(definition, ctx, $$scope, fn) {\n if (definition) {\n const slot_ctx = get_slot_context(definition, ctx, $$scope, fn);\n return definition[0](slot_ctx);\n }\n}\nfunction get_slot_context(definition, ctx, $$scope, fn) {\n return definition[1] && fn\n ? assign($$scope.ctx.slice(), definition[1](fn(ctx)))\n : $$scope.ctx;\n}\nfunction get_slot_changes(definition, $$scope, dirty, fn) {\n if (definition[2] && fn) {\n const lets = definition[2](fn(dirty));\n if ($$scope.dirty === undefined) {\n return lets;\n }\n if (typeof lets === 'object') {\n const merged = [];\n const len = Math.max($$scope.dirty.length, lets.length);\n for (let i = 0; i < len; i += 1) {\n merged[i] = $$scope.dirty[i] | lets[i];\n }\n return merged;\n }\n return $$scope.dirty | lets;\n }\n return $$scope.dirty;\n}\nfunction update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn) {\n if (slot_changes) {\n const slot_context = get_slot_context(slot_definition, ctx, $$scope, get_slot_context_fn);\n slot.p(slot_context, slot_changes);\n }\n}\nfunction update_slot(slot, slot_definition, ctx, $$scope, dirty, get_slot_changes_fn, get_slot_context_fn) {\n const slot_changes = get_slot_changes(slot_definition, $$scope, dirty, get_slot_changes_fn);\n update_slot_base(slot, slot_definition, ctx, $$scope, slot_changes, get_slot_context_fn);\n}\nfunction get_all_dirty_from_scope($$scope) {\n if ($$scope.ctx.length > 32) {\n const dirty = [];\n const length = $$scope.ctx.length / 32;\n for (let i = 0; i < length; i++) {\n dirty[i] = -1;\n }\n return dirty;\n }\n return -1;\n}\nfunction exclude_internal_props(props) {\n const result = {};\n for (const k in props)\n if (k[0] !== '$')\n result[k] = props[k];\n return result;\n}\nfunction compute_rest_props(props, keys) {\n const rest = {};\n keys = new Set(keys);\n for (const k in props)\n if (!keys.has(k) && k[0] !== '$')\n rest[k] = props[k];\n return rest;\n}\nfunction compute_slots(slots) {\n const result = {};\n for (const key in slots) {\n result[key] = true;\n }\n return result;\n}\nfunction once(fn) {\n let ran = false;\n return function (...args) {\n if (ran)\n return;\n ran = true;\n fn.call(this, ...args);\n };\n}\nfunction null_to_empty(value) {\n return value == null ? '' : value;\n}\nfunction set_store_value(store, ret, value) {\n store.set(value);\n return ret;\n}\nconst has_prop = (obj, prop) => Object.prototype.hasOwnProperty.call(obj, prop);\nfunction action_destroyer(action_result) {\n return action_result && is_function(action_result.destroy) ? action_result.destroy : noop;\n}\nfunction split_css_unit(value) {\n const split = typeof value === 'string' && value.match(/^\\s*(-?[\\d.]+)([^\\s]*)\\s*$/);\n return split ? [parseFloat(split[1]), split[2] || 'px'] : [value, 'px'];\n}\nconst contenteditable_truthy_values = ['', true, 1, 'true', 'contenteditable'];\n\nconst is_client = typeof window !== 'undefined';\nlet now = is_client\n ? () => window.performance.now()\n : () => Date.now();\nlet raf = is_client ? cb => requestAnimationFrame(cb) : noop;\n// used internally for testing\nfunction set_now(fn) {\n now = fn;\n}\nfunction set_raf(fn) {\n raf = fn;\n}\n\nconst tasks = new Set();\nfunction run_tasks(now) {\n tasks.forEach(task => {\n if (!task.c(now)) {\n tasks.delete(task);\n task.f();\n }\n });\n if (tasks.size !== 0)\n raf(run_tasks);\n}\n/**\n * For testing purposes only!\n */\nfunction clear_loops() {\n tasks.clear();\n}\n/**\n * Creates a new task that runs on each raf frame\n * until it returns a falsy value or is aborted\n */\nfunction loop(callback) {\n let task;\n if (tasks.size === 0)\n raf(run_tasks);\n return {\n promise: new Promise(fulfill => {\n tasks.add(task = { c: callback, f: fulfill });\n }),\n abort() {\n tasks.delete(task);\n }\n };\n}\n\nconst globals = (typeof window !== 'undefined'\n ? window\n : typeof globalThis !== 'undefined'\n ? globalThis\n : global);\n\n/**\n * Resize observer singleton.\n * One listener per element only!\n * https://groups.google.com/a/chromium.org/g/blink-dev/c/z6ienONUb5A/m/F5-VcUZtBAAJ\n */\nclass ResizeObserverSingleton {\n constructor(options) {\n this.options = options;\n this._listeners = 'WeakMap' in globals ? new WeakMap() : undefined;\n }\n observe(element, listener) {\n this._listeners.set(element, listener);\n this._getObserver().observe(element, this.options);\n return () => {\n this._listeners.delete(element);\n this._observer.unobserve(element); // this line can probably be removed\n };\n }\n _getObserver() {\n var _a;\n return (_a = this._observer) !== null && _a !== void 0 ? _a : (this._observer = new ResizeObserver((entries) => {\n var _a;\n for (const entry of entries) {\n ResizeObserverSingleton.entries.set(entry.target, entry);\n (_a = this._listeners.get(entry.target)) === null || _a === void 0 ? void 0 : _a(entry);\n }\n }));\n }\n}\n// Needs to be written like this to pass the tree-shake-test\nResizeObserverSingleton.entries = 'WeakMap' in globals ? new WeakMap() : undefined;\n\n// Track which nodes are claimed during hydration. Unclaimed nodes can then be removed from the DOM\n// at the end of hydration without touching the remaining nodes.\nlet is_hydrating = false;\nfunction start_hydrating() {\n is_hydrating = true;\n}\nfunction end_hydrating() {\n is_hydrating = false;\n}\nfunction upper_bound(low, high, key, value) {\n // Return first index of value larger than input value in the range [low, high)\n while (low < high) {\n const mid = low + ((high - low) >> 1);\n if (key(mid) <= value) {\n low = mid + 1;\n }\n else {\n high = mid;\n }\n }\n return low;\n}\nfunction init_hydrate(target) {\n if (target.hydrate_init)\n return;\n target.hydrate_init = true;\n // We know that all children have claim_order values since the unclaimed have been detached if target is not \n let children = target.childNodes;\n // If target is , there may be children without claim_order\n if (target.nodeName === 'HEAD') {\n const myChildren = [];\n for (let i = 0; i < children.length; i++) {\n const node = children[i];\n if (node.claim_order !== undefined) {\n myChildren.push(node);\n }\n }\n children = myChildren;\n }\n /*\n * Reorder claimed children optimally.\n * We can reorder claimed children optimally by finding the longest subsequence of\n * nodes that are already claimed in order and only moving the rest. The longest\n * subsequence of nodes that are claimed in order can be found by\n * computing the longest increasing subsequence of .claim_order values.\n *\n * This algorithm is optimal in generating the least amount of reorder operations\n * possible.\n *\n * Proof:\n * We know that, given a set of reordering operations, the nodes that do not move\n * always form an increasing subsequence, since they do not move among each other\n * meaning that they must be already ordered among each other. Thus, the maximal\n * set of nodes that do not move form a longest increasing subsequence.\n */\n // Compute longest increasing subsequence\n // m: subsequence length j => index k of smallest value that ends an increasing subsequence of length j\n const m = new Int32Array(children.length + 1);\n // Predecessor indices + 1\n const p = new Int32Array(children.length);\n m[0] = -1;\n let longest = 0;\n for (let i = 0; i < children.length; i++) {\n const current = children[i].claim_order;\n // Find the largest subsequence length such that it ends in a value less than our current value\n // upper_bound returns first greater value, so we subtract one\n // with fast path for when we are on the current longest subsequence\n const seqLen = ((longest > 0 && children[m[longest]].claim_order <= current) ? longest + 1 : upper_bound(1, longest, idx => children[m[idx]].claim_order, current)) - 1;\n p[i] = m[seqLen] + 1;\n const newLen = seqLen + 1;\n // We can guarantee that current is the smallest value. Otherwise, we would have generated a longer sequence.\n m[newLen] = i;\n longest = Math.max(newLen, longest);\n }\n // The longest increasing subsequence of nodes (initially reversed)\n const lis = [];\n // The rest of the nodes, nodes that will be moved\n const toMove = [];\n let last = children.length - 1;\n for (let cur = m[longest] + 1; cur != 0; cur = p[cur - 1]) {\n lis.push(children[cur - 1]);\n for (; last >= cur; last--) {\n toMove.push(children[last]);\n }\n last--;\n }\n for (; last >= 0; last--) {\n toMove.push(children[last]);\n }\n lis.reverse();\n // We sort the nodes being moved to guarantee that their insertion order matches the claim order\n toMove.sort((a, b) => a.claim_order - b.claim_order);\n // Finally, we move the nodes\n for (let i = 0, j = 0; i < toMove.length; i++) {\n while (j < lis.length && toMove[i].claim_order >= lis[j].claim_order) {\n j++;\n }\n const anchor = j < lis.length ? lis[j] : null;\n target.insertBefore(toMove[i], anchor);\n }\n}\nfunction append(target, node) {\n target.appendChild(node);\n}\nfunction append_styles(target, style_sheet_id, styles) {\n const append_styles_to = get_root_for_style(target);\n if (!append_styles_to.getElementById(style_sheet_id)) {\n const style = element('style');\n style.id = style_sheet_id;\n style.textContent = styles;\n append_stylesheet(append_styles_to, style);\n }\n}\nfunction get_root_for_style(node) {\n if (!node)\n return document;\n const root = node.getRootNode ? node.getRootNode() : node.ownerDocument;\n if (root && root.host) {\n return root;\n }\n return node.ownerDocument;\n}\nfunction append_empty_stylesheet(node) {\n const style_element = element('style');\n append_stylesheet(get_root_for_style(node), style_element);\n return style_element.sheet;\n}\nfunction append_stylesheet(node, style) {\n append(node.head || node, style);\n return style.sheet;\n}\nfunction append_hydration(target, node) {\n if (is_hydrating) {\n init_hydrate(target);\n if ((target.actual_end_child === undefined) || ((target.actual_end_child !== null) && (target.actual_end_child.parentNode !== target))) {\n target.actual_end_child = target.firstChild;\n }\n // Skip nodes of undefined ordering\n while ((target.actual_end_child !== null) && (target.actual_end_child.claim_order === undefined)) {\n target.actual_end_child = target.actual_end_child.nextSibling;\n }\n if (node !== target.actual_end_child) {\n // We only insert if the ordering of this node should be modified or the parent node is not target\n if (node.claim_order !== undefined || node.parentNode !== target) {\n target.insertBefore(node, target.actual_end_child);\n }\n }\n else {\n target.actual_end_child = node.nextSibling;\n }\n }\n else if (node.parentNode !== target || node.nextSibling !== null) {\n target.appendChild(node);\n }\n}\nfunction insert(target, node, anchor) {\n target.insertBefore(node, anchor || null);\n}\nfunction insert_hydration(target, node, anchor) {\n if (is_hydrating && !anchor) {\n append_hydration(target, node);\n }\n else if (node.parentNode !== target || node.nextSibling != anchor) {\n target.insertBefore(node, anchor || null);\n }\n}\nfunction detach(node) {\n if (node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}\nfunction destroy_each(iterations, detaching) {\n for (let i = 0; i < iterations.length; i += 1) {\n if (iterations[i])\n iterations[i].d(detaching);\n }\n}\nfunction element(name) {\n return document.createElement(name);\n}\nfunction element_is(name, is) {\n return document.createElement(name, { is });\n}\nfunction object_without_properties(obj, exclude) {\n const target = {};\n for (const k in obj) {\n if (has_prop(obj, k)\n // @ts-ignore\n && exclude.indexOf(k) === -1) {\n // @ts-ignore\n target[k] = obj[k];\n }\n }\n return target;\n}\nfunction svg_element(name) {\n return document.createElementNS('http://www.w3.org/2000/svg', name);\n}\nfunction text(data) {\n return document.createTextNode(data);\n}\nfunction space() {\n return text(' ');\n}\nfunction empty() {\n return text('');\n}\nfunction comment(content) {\n return document.createComment(content);\n}\nfunction listen(node, event, handler, options) {\n node.addEventListener(event, handler, options);\n return () => node.removeEventListener(event, handler, options);\n}\nfunction prevent_default(fn) {\n return function (event) {\n event.preventDefault();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_propagation(fn) {\n return function (event) {\n event.stopPropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction stop_immediate_propagation(fn) {\n return function (event) {\n event.stopImmediatePropagation();\n // @ts-ignore\n return fn.call(this, event);\n };\n}\nfunction self(fn) {\n return function (event) {\n // @ts-ignore\n if (event.target === this)\n fn.call(this, event);\n };\n}\nfunction trusted(fn) {\n return function (event) {\n // @ts-ignore\n if (event.isTrusted)\n fn.call(this, event);\n };\n}\nfunction attr(node, attribute, value) {\n if (value == null)\n node.removeAttribute(attribute);\n else if (node.getAttribute(attribute) !== value)\n node.setAttribute(attribute, value);\n}\n/**\n * List of attributes that should always be set through the attr method,\n * because updating them through the property setter doesn't work reliably.\n * In the example of `width`/`height`, the problem is that the setter only\n * accepts numeric values, but the attribute can also be set to a string like `50%`.\n * If this list becomes too big, rethink this approach.\n */\nconst always_set_through_set_attribute = ['width', 'height'];\nfunction set_attributes(node, attributes) {\n // @ts-ignore\n const descriptors = Object.getOwnPropertyDescriptors(node.__proto__);\n for (const key in attributes) {\n if (attributes[key] == null) {\n node.removeAttribute(key);\n }\n else if (key === 'style') {\n node.style.cssText = attributes[key];\n }\n else if (key === '__value') {\n node.value = node[key] = attributes[key];\n }\n else if (descriptors[key] && descriptors[key].set && always_set_through_set_attribute.indexOf(key) === -1) {\n node[key] = attributes[key];\n }\n else {\n attr(node, key, attributes[key]);\n }\n }\n}\nfunction set_svg_attributes(node, attributes) {\n for (const key in attributes) {\n attr(node, key, attributes[key]);\n }\n}\nfunction set_custom_element_data_map(node, data_map) {\n Object.keys(data_map).forEach((key) => {\n set_custom_element_data(node, key, data_map[key]);\n });\n}\nfunction set_custom_element_data(node, prop, value) {\n if (prop in node) {\n node[prop] = typeof node[prop] === 'boolean' && value === '' ? true : value;\n }\n else {\n attr(node, prop, value);\n }\n}\nfunction set_dynamic_element_data(tag) {\n return (/-/.test(tag)) ? set_custom_element_data_map : set_attributes;\n}\nfunction xlink_attr(node, attribute, value) {\n node.setAttributeNS('http://www.w3.org/1999/xlink', attribute, value);\n}\nfunction get_binding_group_value(group, __value, checked) {\n const value = new Set();\n for (let i = 0; i < group.length; i += 1) {\n if (group[i].checked)\n value.add(group[i].__value);\n }\n if (!checked) {\n value.delete(__value);\n }\n return Array.from(value);\n}\nfunction init_binding_group(group) {\n let _inputs;\n return {\n /* push */ p(...inputs) {\n _inputs = inputs;\n _inputs.forEach(input => group.push(input));\n },\n /* remove */ r() {\n _inputs.forEach(input => group.splice(group.indexOf(input), 1));\n }\n };\n}\nfunction init_binding_group_dynamic(group, indexes) {\n let _group = get_binding_group(group);\n let _inputs;\n function get_binding_group(group) {\n for (let i = 0; i < indexes.length; i++) {\n group = group[indexes[i]] = group[indexes[i]] || [];\n }\n return group;\n }\n function push() {\n _inputs.forEach(input => _group.push(input));\n }\n function remove() {\n _inputs.forEach(input => _group.splice(_group.indexOf(input), 1));\n }\n return {\n /* update */ u(new_indexes) {\n indexes = new_indexes;\n const new_group = get_binding_group(group);\n if (new_group !== _group) {\n remove();\n _group = new_group;\n push();\n }\n },\n /* push */ p(...inputs) {\n _inputs = inputs;\n push();\n },\n /* remove */ r: remove\n };\n}\nfunction to_number(value) {\n return value === '' ? null : +value;\n}\nfunction time_ranges_to_array(ranges) {\n const array = [];\n for (let i = 0; i < ranges.length; i += 1) {\n array.push({ start: ranges.start(i), end: ranges.end(i) });\n }\n return array;\n}\nfunction children(element) {\n return Array.from(element.childNodes);\n}\nfunction init_claim_info(nodes) {\n if (nodes.claim_info === undefined) {\n nodes.claim_info = { last_index: 0, total_claimed: 0 };\n }\n}\nfunction claim_node(nodes, predicate, processNode, createNode, dontUpdateLastIndex = false) {\n // Try to find nodes in an order such that we lengthen the longest increasing subsequence\n init_claim_info(nodes);\n const resultNode = (() => {\n // We first try to find an element after the previous one\n for (let i = nodes.claim_info.last_index; i < nodes.length; i++) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n return node;\n }\n }\n // Otherwise, we try to find one before\n // We iterate in reverse so that we don't go too far back\n for (let i = nodes.claim_info.last_index - 1; i >= 0; i--) {\n const node = nodes[i];\n if (predicate(node)) {\n const replacement = processNode(node);\n if (replacement === undefined) {\n nodes.splice(i, 1);\n }\n else {\n nodes[i] = replacement;\n }\n if (!dontUpdateLastIndex) {\n nodes.claim_info.last_index = i;\n }\n else if (replacement === undefined) {\n // Since we spliced before the last_index, we decrease it\n nodes.claim_info.last_index--;\n }\n return node;\n }\n }\n // If we can't find any matching node, we create a new one\n return createNode();\n })();\n resultNode.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n return resultNode;\n}\nfunction claim_element_base(nodes, name, attributes, create_element) {\n return claim_node(nodes, (node) => node.nodeName === name, (node) => {\n const remove = [];\n for (let j = 0; j < node.attributes.length; j++) {\n const attribute = node.attributes[j];\n if (!attributes[attribute.name]) {\n remove.push(attribute.name);\n }\n }\n remove.forEach(v => node.removeAttribute(v));\n return undefined;\n }, () => create_element(name));\n}\nfunction claim_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, element);\n}\nfunction claim_svg_element(nodes, name, attributes) {\n return claim_element_base(nodes, name, attributes, svg_element);\n}\nfunction claim_text(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 3, (node) => {\n const dataStr = '' + data;\n if (node.data.startsWith(dataStr)) {\n if (node.data.length !== dataStr.length) {\n return node.splitText(dataStr.length);\n }\n }\n else {\n node.data = dataStr;\n }\n }, () => text(data), true // Text nodes should not update last index since it is likely not worth it to eliminate an increasing subsequence of actual elements\n );\n}\nfunction claim_space(nodes) {\n return claim_text(nodes, ' ');\n}\nfunction claim_comment(nodes, data) {\n return claim_node(nodes, (node) => node.nodeType === 8, (node) => {\n node.data = '' + data;\n return undefined;\n }, () => comment(data), true);\n}\nfunction find_comment(nodes, text, start) {\n for (let i = start; i < nodes.length; i += 1) {\n const node = nodes[i];\n if (node.nodeType === 8 /* comment node */ && node.textContent.trim() === text) {\n return i;\n }\n }\n return nodes.length;\n}\nfunction claim_html_tag(nodes, is_svg) {\n // find html opening tag\n const start_index = find_comment(nodes, 'HTML_TAG_START', 0);\n const end_index = find_comment(nodes, 'HTML_TAG_END', start_index);\n if (start_index === end_index) {\n return new HtmlTagHydration(undefined, is_svg);\n }\n init_claim_info(nodes);\n const html_tag_nodes = nodes.splice(start_index, end_index - start_index + 1);\n detach(html_tag_nodes[0]);\n detach(html_tag_nodes[html_tag_nodes.length - 1]);\n const claimed_nodes = html_tag_nodes.slice(1, html_tag_nodes.length - 1);\n for (const n of claimed_nodes) {\n n.claim_order = nodes.claim_info.total_claimed;\n nodes.claim_info.total_claimed += 1;\n }\n return new HtmlTagHydration(claimed_nodes, is_svg);\n}\nfunction set_data(text, data) {\n data = '' + data;\n if (text.data === data)\n return;\n text.data = data;\n}\nfunction set_data_contenteditable(text, data) {\n data = '' + data;\n if (text.wholeText === data)\n return;\n text.data = data;\n}\nfunction set_data_maybe_contenteditable(text, data, attr_value) {\n if (~contenteditable_truthy_values.indexOf(attr_value)) {\n set_data_contenteditable(text, data);\n }\n else {\n set_data(text, data);\n }\n}\nfunction set_input_value(input, value) {\n input.value = value == null ? '' : value;\n}\nfunction set_input_type(input, type) {\n try {\n input.type = type;\n }\n catch (e) {\n // do nothing\n }\n}\nfunction set_style(node, key, value, important) {\n if (value == null) {\n node.style.removeProperty(key);\n }\n else {\n node.style.setProperty(key, value, important ? 'important' : '');\n }\n}\nfunction select_option(select, value, mounting) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n if (option.__value === value) {\n option.selected = true;\n return;\n }\n }\n if (!mounting || value !== undefined) {\n select.selectedIndex = -1; // no option should be selected\n }\n}\nfunction select_options(select, value) {\n for (let i = 0; i < select.options.length; i += 1) {\n const option = select.options[i];\n option.selected = ~value.indexOf(option.__value);\n }\n}\nfunction select_value(select) {\n const selected_option = select.querySelector(':checked');\n return selected_option && selected_option.__value;\n}\nfunction select_multiple_value(select) {\n return [].map.call(select.querySelectorAll(':checked'), option => option.__value);\n}\n// unfortunately this can't be a constant as that wouldn't be tree-shakeable\n// so we cache the result instead\nlet crossorigin;\nfunction is_crossorigin() {\n if (crossorigin === undefined) {\n crossorigin = false;\n try {\n if (typeof window !== 'undefined' && window.parent) {\n void window.parent.document;\n }\n }\n catch (error) {\n crossorigin = true;\n }\n }\n return crossorigin;\n}\nfunction add_iframe_resize_listener(node, fn) {\n const computed_style = getComputedStyle(node);\n if (computed_style.position === 'static') {\n node.style.position = 'relative';\n }\n const iframe = element('iframe');\n iframe.setAttribute('style', 'display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; ' +\n 'overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;');\n iframe.setAttribute('aria-hidden', 'true');\n iframe.tabIndex = -1;\n const crossorigin = is_crossorigin();\n let unsubscribe;\n if (crossorigin) {\n iframe.src = \"data:text/html,\";\n unsubscribe = listen(window, 'message', (event) => {\n if (event.source === iframe.contentWindow)\n fn();\n });\n }\n else {\n iframe.src = 'about:blank';\n iframe.onload = () => {\n unsubscribe = listen(iframe.contentWindow, 'resize', fn);\n // make sure an initial resize event is fired _after_ the iframe is loaded (which is asynchronous)\n // see https://github.com/sveltejs/svelte/issues/4233\n fn();\n };\n }\n append(node, iframe);\n return () => {\n if (crossorigin) {\n unsubscribe();\n }\n else if (unsubscribe && iframe.contentWindow) {\n unsubscribe();\n }\n detach(iframe);\n };\n}\nconst resize_observer_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'content-box' });\nconst resize_observer_border_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'border-box' });\nconst resize_observer_device_pixel_content_box = /* @__PURE__ */ new ResizeObserverSingleton({ box: 'device-pixel-content-box' });\nfunction toggle_class(element, name, toggle) {\n element.classList[toggle ? 'add' : 'remove'](name);\n}\nfunction custom_event(type, detail, { bubbles = false, cancelable = false } = {}) {\n const e = document.createEvent('CustomEvent');\n e.initCustomEvent(type, bubbles, cancelable, detail);\n return e;\n}\nfunction query_selector_all(selector, parent = document.body) {\n return Array.from(parent.querySelectorAll(selector));\n}\nfunction head_selector(nodeId, head) {\n const result = [];\n let started = 0;\n for (const node of head.childNodes) {\n if (node.nodeType === 8 /* comment node */) {\n const comment = node.textContent.trim();\n if (comment === `HEAD_${nodeId}_END`) {\n started -= 1;\n result.push(node);\n }\n else if (comment === `HEAD_${nodeId}_START`) {\n started += 1;\n result.push(node);\n }\n }\n else if (started > 0) {\n result.push(node);\n }\n }\n return result;\n}\nclass HtmlTag {\n constructor(is_svg = false) {\n this.is_svg = false;\n this.is_svg = is_svg;\n this.e = this.n = null;\n }\n c(html) {\n this.h(html);\n }\n m(html, target, anchor = null) {\n if (!this.e) {\n if (this.is_svg)\n this.e = svg_element(target.nodeName);\n /** #7364 target for