Cannot fetch quotes. Try again later.
',m(e,"class","svelte-1xewuj4")},m(n,l){_(n,e,l)},p:k,i:k,o:k,d(n){n&&g(e)}}}function ct(t){let e,n,l,o,c,s;function u(h,p){if(h[0]==="single")return st;if(h[0]==="full")return rt}let i=u(t),r=i&&i(t);const d=[ut,it],a=[];function f(h,p){return h[0]==="single"?0:h[0]==="full"?1:-1}return~(o=f(t))&&(c=a[o]=d[o](t)),{c(){e=b("blockquote"),r&&r.c(),n=j(),l=b("div"),c&&c.c(),m(e,"class","svelte-1xewuj4"),m(l,"id","btn-container"),m(l,"class","svelte-1xewuj4")},m(h,p){_(h,e,p),r&&r.m(e,null),_(h,n,p),_(h,l,p),~o&&a[o].m(l,null),s=!0},p(h,p){i===(i=u(h))&&r?r.p(h,p):(r&&r.d(1),r=i&&i(h),r&&(r.c(),r.m(e,null)));let y=o;o=f(h),o===y?~o&&a[o].p(h,p):(c&&(we(),q(a[y],1,1,()=>{a[y]=null}),ve()),~o?(c=a[o],c?c.p(h,p):(c=a[o]=d[o](h),c.c()),L(c,1),c.m(l,null)):c=null)},i(h){s||(L(c),s=!0)},o(h){q(c),s=!1},d(h){h&&(g(e),g(n),g(l)),r&&r.d(),~o&&a[o].d()}}}function rt(t){let e,n,l=t[2][t[3]].id+"",o,c,s=t[2][t[3]].title+"",u,i,r,d=t[2][t[3]].desc+"",a;return{c(){e=b("p"),n=$("Law "),o=$(l),c=$(": "),u=$(s),i=j(),r=b("p"),a=$(d),m(e,"id","title"),m(e,"class","svelte-1xewuj4"),m(r,"id","content"),m(r,"class","svelte-1xewuj4")},m(f,h){_(f,e,h),v(e,n),v(e,o),v(e,c),v(e,u),_(f,i,h),_(f,r,h),v(r,a)},p(f,h){h&12&&l!==(l=f[2][f[3]].id+"")&&O(o,l),h&12&&s!==(s=f[2][f[3]].title+"")&&O(u,s),h&12&&d!==(d=f[2][f[3]].desc+"")&&O(a,d)},d(f){f&&(g(e),g(i),g(r))}}}function st(t){let e,n,l=t[9].quote+"",o,c,s,u,i,r=t[9].name+"",d;return{c(){e=b("p"),n=$('"'),o=$(l),c=$('"'),s=j(),u=b("p"),i=$("- "),d=$(r),m(e,"id","text"),m(e,"class","svelte-1xewuj4"),m(u,"id","author"),m(u,"class","svelte-1xewuj4")},m(a,f){_(a,e,f),v(e,n),v(e,o),v(e,c),_(a,s,f),_(a,u,f),v(u,i),v(u,d)},p(a,f){f&2&&l!==(l=a[9].quote+"")&&O(o,l),f&2&&r!==(r=a[9].name+"")&&O(d,r)},d(a){a&&(g(e),g(s),g(u))}}}function it(t){let e,n,l,o,c,s,u;return e=new Z({props:{id:"randomize",$$slots:{default:[ft]},$$scope:{ctx:t}}}),e.$on("click",t[6]),o=new Z({props:{id:"previous-quote",$$slots:{default:[at]},$$scope:{ctx:t}}}),o.$on("click",t[7]),s=new Z({props:{id:"next-quote",$$slots:{default:[dt]},$$scope:{ctx:t}}}),s.$on("click",t[8]),{c(){F(e.$$.fragment),n=j(),l=b("div"),F(o.$$.fragment),c=j(),F(s.$$.fragment),m(l,"class","svelte-1xewuj4")},m(i,r){E(e,i,r),_(i,n,r),_(i,l,r),E(o,l,null),v(l,c),E(s,l,null),u=!0},p(i,r){const d={};r&1024&&(d.$$scope={dirty:r,ctx:i}),e.$set(d);const a={};r&1024&&(a.$$scope={dirty:r,ctx:i}),o.$set(a);const f={};r&1024&&(f.$$scope={dirty:r,ctx:i}),s.$set(f)},i(i){u||(L(e.$$.fragment,i),L(o.$$.fragment,i),L(s.$$.fragment,i),u=!0)},o(i){q(e.$$.fragment,i),q(o.$$.fragment,i),q(s.$$.fragment,i),u=!1},d(i){i&&(g(n),g(l)),z(e,i),z(o),z(s)}}}function ut(t){let e,n,l,o,c,s,u;return n=new ce({props:{id:"tweet-quote",icon:Xe,href:re(t[9].name,t[9].quote),alt:"Twitter"}}),o=new ce({props:{id:"share-quote",icon:et,href:se(t[9].name,t[9].quote),alt:"Tumblr"}}),s=new Z({props:{id:"new-quote",content:"New Quote"}}),s.$on("click",t[5]),{c(){e=b("div"),F(n.$$.fragment),l=j(),F(o.$$.fragment),c=j(),F(s.$$.fragment),m(e,"class","svelte-1xewuj4")},m(i,r){_(i,e,r),E(n,e,null),v(e,l),E(o,e,null),_(i,c,r),E(s,i,r),u=!0},p(i,r){const d={};r&2&&(d.href=re(i[9].name,i[9].quote)),n.$set(d);const a={};r&2&&(a.href=se(i[9].name,i[9].quote)),o.$set(a)},i(i){u||(L(n.$$.fragment,i),L(o.$$.fragment,i),L(s.$$.fragment,i),u=!0)},o(i){q(n.$$.fragment,i),q(o.$$.fragment,i),q(s.$$.fragment,i),u=!1},d(i){i&&(g(e),g(c)),z(n),z(o),z(s,i)}}}function ft(t){let e,n;return{c(){e=b("img"),B(e.src,n=tt)||m(e,"src",n),m(e,"alt","")},m(l,o){_(l,e,o)},p:k,d(l){l&&g(e)}}}function at(t){let e,n;return{c(){e=b("img"),B(e.src,n=nt)||m(e,"src",n),m(e,"alt","")},m(l,o){_(l,e,o)},p:k,d(l){l&&g(e)}}}function dt(t){let e,n;return{c(){e=b("img"),B(e.src,n=ot)||m(e,"src",n),m(e,"alt","")},m(l,o){_(l,e,o)},p:k,d(l){l&&g(e)}}}function ht(t){let e;return{c(){e=b("blockquote"),e.innerHTML='Fetching quote...
',m(e,"class","svelte-1xewuj4")},m(n,l){_(n,e,l)},p:k,i:k,o:k,d(n){n&&g(e)}}}function mt(t){let e,n,l,o={ctx:t,current:null,token:null,hasCatch:!0,pending:ht,then:ct,catch:lt,value:9,blocks:[,,,]};return le(n=t[1],o),{c(){e=b("section"),o.block.c(),m(e,"id","quote-box"),m(e,"class","svelte-1xewuj4")},m(c,s){_(c,e,s),o.block.m(e,o.anchor=null),o.mount=()=>e,o.anchor=null,l=!0},p(c,[s]){t=c,o.ctx=t,s&2&&n!==(n=t[1])&&le(n,o)||Ge(o,t,s)},i(c){l||(L(o.block),l=!0)},o(c){for(let s=0;s<3;s+=1){const u=o.blocks[s];q(u)}l=!1},d(c){c&&g(e),o.block.d(),o.token=null,o=null}}}function re(t,e){return`https://twitter.com/intent/tweet?hashtags=quotes&text=${encodeURIComponent(`${t} ${e}`)}`}function se(t,e){return`https://www.tumblr.com/widgets/share/tool?posttype=quote&tags=quotes&caption=${encodeURIComponent(e.slice(0))}&content=${encodeURIComponent(t.slice(0))}&canonicalUrl=https%3A%2F%2Fwww.tumblr.com%2Fbuttons&shareSource=tumblr_share_button`}function gt(t,e,n){let{collectionType:l}=e,{quote:o}=e,{fullQuotes:c}=e,{index:s}=e;const u=Pe(),i=()=>u("newQuote"),r=()=>u("randomize"),d=()=>u("previous"),a=()=>u("next");return t.$$set=f=>{"collectionType"in f&&n(0,l=f.collectionType),"quote"in f&&n(1,o=f.quote),"fullQuotes"in f&&n(2,c=f.fullQuotes),"index"in f&&n(3,s=f.index)},[l,o,c,s,u,i,r,d,a]}class _t extends S{constructor(e){super(),R(this,e,gt,mt,N,{collectionType:0,quote:1,fullQuotes:2,index:3})}}const pt="data:image/svg+xml,%3csvg%20viewBox='0%200%2017%2016'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20fill='%23fff'%20fill-rule='evenodd'%3e%3cpath%20d='m8.20003216%200c-4.5281696%200-8.20003216%203.67233045-8.20003216%208.2025137%200%203.6241466%202.34955472%206.6987785%205.60770169%207.7833978.40979259.0759104.5602814-.1779394.5602814-.3946059%200-.195566-.00765306-.84177-.01112588-1.5271516-2.28132027.4961843-2.76269151-.9677944-2.76269151-.9677944-.37300645-.948109-.91045728-1.2001576-.91045728-1.2001576-.74395492-.5091149.05607959-.4986933.05607959-.4986933.82344388.0578979%201.25703171.8453083%201.25703171.8453083.73134987%201.2540026%201.9182821.8914335%202.38621225.6819077.07357231-.5302154.28612167-.8920125.52060124-1.0968421-1.82130043-.2074672-3.73598109-.9107972-3.73598109-4.05374848%200-.89548638.32033536-1.62725057.84492391-2.20166134-.08514837-.20663091-.36580356-1.04087425.07942464-2.17071817%200%200%20.68858276-.22046205%202.25559569.8408051.6540475-.18179917%201.35555686-.27289175%202.0524358-.27597964.69687893.00308789%201.39890278.09418047%202.05423654.27597964%201.5651479-1.06126715%202.252766-.8408051%202.252766-.8408051.4463215%201.12984392.1655376%201.96408726.0803893%202.17071817.5257461.57441077.8438949%201.30611063.8438949%202.20166134%200%203.15041368-1.9182821%203.84415838-3.74421295%204.04718668.29409628.2545575.55616545.7537654.55616545%201.5189817%200%201.0974854-.0095181%201.9808133-.0095181%202.2510031%200%20.2182748.1475948.4740546.5633041.3935122%203.2563462-1.0858415%205.6029426-4.1593798%205.6029426-7.7823041%200-4.53018325-3.6713481-8.2025137-8.19996784-8.2025137'/%3e%3cpath%20d='m3.07518929%2011.6824029c-.01787762.0408541-.08159856.0531168-.13950928.0251063-.05905999-.0268489-.09226129-.0826118-.07310669-.1236596.01755837-.0420803.08127932-.0538267.14021161-.025558.05918769.0267843.09289978.0830636.07240436.1241113m.40045868.3611685c-.03881997.0364008-.11473601.0194912-.16626186-.0380143-.05324977-.0573765-.06321015-.1340506-.02381554-.1710323.0400331-.0363363.11365058-.0193621.16702804.0380789.05324977.0580219.06359325.1342442.02298552.1710322m.27480455.4620452c-.04992964.0350455-.1315282.0021944-.18190478-.0709945-.04986579-.0731243-.04986579-.1608994.00108543-.1960739.05056812-.0351746.13088971-.0035497.18196863.0690583.04980194.0744151.04980194.1621902-.00121313.1980747m.46462657.5351695c-.0446302.0496962-.13963698.0364009-.209232-.0314957-.07112739-.0663476-.09098432-.1605121-.04622642-.2102728.04514099-.0498253.14072241-.03582.21082822.0314957.07068044.0662185.09226128.161093.04469405.2102728m.60036877.1807134c-.01960153.0644113-.11116048.0937127-.20335792.0663476-.09206974-.0282042-.15234286-.1037166-.1337629-.1688379.01915459-.0648632.11109663-.0953908.20399641-.0660894.09194204.0280751.15234286.1030065.13318826.1685797m.68337202.0766095c.00229855.0678966-.07591604.1241759-.17271058.1254021-.09736918.0021299-.17609455-.0527941-.17711613-.1195289%200-.068542.07642682-.124305.17373215-.1259185.09679454-.0019362.17609456.0526005.17609456.1200453m.67130462-.0260098c.01162045.0662185-.05567602.1342442-.15176823.1523155-.09449599.0174259-.18196862-.0234282-.19403602-.0890659-.01174815-.0678965.05682529-.1358576.15112974-.1534772.09628375-.0169096.18241557.0229119.19467451.0902276'%20fill-rule='nonzero'/%3e%3c/g%3e%3c/svg%3e";function bt(t){let e,n,l,o;return{c(){e=b("footer"),n=b("span"),n.textContent=`Copyright @ ${t[0]} ChiefWoods`,l=j(),o=b("a"),o.innerHTML=``,m(n,"class","made-by"),m(o,"class","github-link"),m(o,"href","https://github.com/ChiefWoods/random-quote-machine"),m(o,"target","_blank")},m(c,s){_(c,e,s),v(e,n),v(e,l),v(e,o)},p:k,i:k,o:k,d(c){c&&g(e)}}}function wt(t){return[new Date().getFullYear()]}class vt extends S{constructor(e){super(),R(this,e,wt,bt,N,{})}}function ie(t){return fetch(`https://quote-api-u0ka.onrender.com/api/quotes/${t}/random`).then(e=>e.json()).then(e=>e)}function kt(t){return fetch(`https://quote-api-u0ka.onrender.com/api/quotes/${t}`).then(e=>e.json()).then(e=>e)}const x=[];function yt(t,e=k){let n;const l=new Set;function o(u){if(N(t,u)&&(t=u,n)){const i=!x.length;for(const r of l)r[1](),x.push(r,t);if(i){for(let r=0;r