@@ -5,8 +5,8 @@ a[1],["Nil"]],a=a[2],d=d[2];d[2]=b;return c}}}(),String=function(){return{toText
55b=function(a){return function(b){return function(e){var d=c("div");d.isElmText=!0;d.innerHTML=e;d.style.textAlign=b;0<a&&(d.style.width=a+"px");d.isElmLeaf=!0;d.style.visibility="hidden";d.style.styleFloat="left";d.style.cssFloat="left";document.body.appendChild(d);e=window.getComputedStyle(d);0>=a&&(d.style.width=e.getPropertyValue("width"));d.style.height=e.getPropertyValue("height");document.body.removeChild(d);d.style.visibility="visible";d.style.styleFloat="none";d.style.cssFloat="none";return d}}},
66e=b(0)("left"),d=b(0)("justify"),g=b(0)("center"),f=function(b){return"DIV"===b.tagName?b:a(b)},j=function(a){a.style.styleFloat="left";a.style.cssFloat="left";return a},h=function(a){a.style.position="absolute";return a},i=function(a,b,e){for(var d=c("div"),h=e.length;h--;){var g=b(e[h]);d.appendChild(g)}d.elmFlowDirection=a;return d},k=function(a){return function(b){for(var c=[];"Cons"===b[0];)c.push(b[1]),b=b[2];3<=a&&c.reverse();b=a%3;if(0==b)return i("Y",f,c);if(1==b)return i("X",j,c);if(2==
77b)return i("Z",h,c)}},l=function(a){return function(c){if("A"===c.tagName)return l(a)(c.firstChild),c;if(c.hasOwnProperty("isElmText")){var e=b(a)(c.style.textAlign)(c.innerHTML);c.style.height=e.style.height}c.style.width=a+"px";return c}};return{text:e,image:function(a){var b=c("img");b.isElmLeaf=!0;b.onload=function(){""===b.style.width&&0<this.width&&(b.style.width=b.width=this.width+"px");""===b.style.height&&0<this.height&&(b.style.height=b.height=this.height+"px");Dispatcher.adjust()};b.src=
8−String.toText(a);b.name=b.src;return b},fittedImage:function(a){return function(b){return function(e){var d=c("canvas");d.style.width=a+"px";d.style.height=b+"px";d.width=a;d.height=b;d.innerHTML="Your browser does not support the canvas element.";d.isElmLeaf=!0;var h=c("img");h.onload=function(){if(d.getContext){var c=d.getContext("2d"),e=0,p=0,t=this.width,g=this.height;a/b>this.width/this.height?(g=this.width*b/a,p=(this.height-g)/2):(t=this.height*a/b,e=(this.width-t)/2);console.log(t,g);c.drawImage(h,
9−e,p,t,g,0,0,d.width,d.height)}};h.src=String.toText(e);h.name=h.src;return d}}},video:function(a){var a=String.toText(a),b=c("video");b.controls="controls";var e=c("source");e.src=a;e.type="video/"+a.substring(a.length-3,a.length);b.appendChild(e);b.isElmLeaf=!0;return b},audio:function(a){var a=String.toString(a),b=c("video");b.controls="controls";var e=c("source");e.src=a;e.type="audio/"+a.substring(a.length-3,a.length);b.appendChild(e);b.isElmLeaf=!0;return b},collage:function(a){return function(b){return function(e){var d=
8+String.toText(a);b.name=b.src;return b},fittedImage:function(a){return function(b){return function(e){var d=c("canvas");d.style.width=a+"px";d.style.height=b+"px";d.width=a;d.height=b;d.innerHTML="Your browser does not support the canvas element.";d.isElmLeaf=!0;var h=c("img");h.onload=function(){if(d.getContext){var c=d.getContext("2d"),e=0,p=0,u=this.width,g=this.height;a/b>this.width/this.height?(g=this.width*b/a,p=(this.height-g)/2):(u=this.height*a/b,e=(this.width-u)/2);c.drawImage(h,e,p,u,g,
9+0,0,d.width,d.height)}};h.src=String.toText(e);return d}}},video:function(a){var a=String.toText(a),b=c("video");b.controls="controls";var e=c("source");e.src=a;e.type="video/"+a.substring(a.length-3,a.length);b.appendChild(e);b.isElmLeaf=!0;return b},audio:function(a){var a=String.toString(a),b=c("video");b.controls="controls";var e=c("source");e.src=a;e.type="audio/"+a.substring(a.length-3,a.length);b.appendChild(e);b.isElmLeaf=!0;return b},collage:function(a){return function(b){return function(e){var d=
1010c("canvas");d.style.width=a+"px";d.style.height=b+"px";d.width=a;d.height=b;if(d.getContext){var h=d.getContext("2d");for(h.clearRect(0,0,d.width,d.height);"Cons"===e[0];)h=e[1](h),e=e[2];return d}d.innerHTML="Your browser does not support the canvas element.";d.isElmLeaf=!0;return d}}},flow:k,layers:k(2),beside:function(a){return function(b){return k(1)(["Cons",a,["Cons",b,["Nil"]]])}},above:function(a){return function(b){return k(0)(["Cons",a,["Cons",b,["Nil"]]])}},below:function(a){return function(b){return k(3)(["Cons",
1111a,["Cons",b,["Nil"]]])}},box:function(a){return function(b){b.style.position="absolute";b.style.margin="auto";var e=(a-1)%3,d=(a-1)/3;2>e&&(b.style.left=0);0<e&&(b.style.right=0);2>d&&(b.style.top=0);0<d&&(b.style.bottom=0);e=c("div");e.style.position="relative";e.appendChild(b);return e}},width:l,height:function(a){return function(b){("A"===b.tagName?b.firstChild:b).style.height=a+"px";return b}},size:function(a){return function(b){return function(e){var c="A"===e.tagName?e.firstChild:e;c.style.width=
1212a+"px";c.style.height=b+"px";return e}}},color:function(a){return function(b){b.style.backgroundColor=Color.Internal.extract(a);return b}},opacity:function(a){return function(b){b.style.opacity=a;return b}},link:function(b){return function(e){var d=c("a");d.href=Text.fromString(b);d.appendChild(e);return a(d)}},asText:function(a){return b(0)("left")(Value.show(a))},plainText:function(a){return b(0)("left")(String.toText(a))},justifiedText:d,centeredText:g,up:0,left:1,inward:2,down:3,right:4,outward:5}}(),
@@ -15,7 +15,7 @@ a+"em")},italic:d,bold:a,underline:g,overline:f,strikeThrough:j,monospace:b("fon
1515var f=c.points;g.moveTo(f[0][0],f[0][1]);for(var j=f.length;j--;)g.lineTo(f[j][0],f[j][1]);g.closePath();a?(g.fillStyle=Color.Internal.extract(e),g.fill()):(g.strokeStyle=Color.Internal.extract(e),g.stroke());g.restore();return g}}}};return{polygon:function(a){return function(e){for(var d=[];"Cons"===a[0];)d.push([a[1][1],a[1][2]]),a=a[2];e=[e[1],e[2]];return c(e,d,0,1)}},ngon:function(a){return function(e){return function(d){for(var g=[],f=a;f--;)g.push([e*Math.cos(2*Math.PI*f/a),e*Math.sin(2*Math.PI*
1616f/a)]);d=[d[1],d[2]];return c(d,g,0,1)}}},rect:function(a){return function(e){return function(d){var g=[[-a/2,-e/2],[a/2,-e/2],[a/2,e/2],[-a/2,e/2]],d=[d[1],d[2]];return c(d,g,0,1)}}},oval:function(a){return function(e){return function(d){for(var g=[],f=2*Math.PI;0<f;f-=Math.PI/50)g.push([a/2*Math.cos(f),e/2*Math.sin(f)]);d=[d[1],d[2]];return c(d,g,0,1)}}},move:function(a){return function(e){return function(d){return c([a+d.center[0],e+d.center[1]],d.points,d.theta,d.scale)}}},rotate:function(a){return function(e){return c(e.center,
1717e.points,e.theta+2*Math.PI*a,e.scale)}},scale:function(a){return function(e){return c(e.center,e.points,e.theta,e.scale*a)}},filled:a(!0),outlined:a(!1),customOutline:function(a){return function(e){return function(c){c.points.push(c.points[0]);return Line.customLine(a)(e)(c)}}}}}(),Line=function(){var c=function(a){return function(b){return function(c){if("string"===typeof a[0]){for(var d=[];"Cons"===a[0];)d.push(a[1]),a=a[2];a=d}0===a.length&&(a=[8,4]);return function(d){d.save();d.beginPath();d.translate(c.center[0],
18−c.center[1]);d.rotate(c.theta);d.scale(c.scale,c.scale);var f=a,j=c.points,h=j.length-1,i=j[h][0],k=j[h][1],l=0,q=0,m=0,n=0,o=0,r=0,u=f.length,s=!0,p=f[0];for(d.moveTo(i,k);h--;){l=j[h][0];q=j[h][1];m=l-i;n=q-k;for(o=Math.sqrt(m*m+n*n);p<=o;)i+=m*p/o,k+=n*p/o,d[s?"lineTo":"moveTo"](i,k),m=l-i,n=q-k,o=Math.sqrt(m*m+n*n),s=!s,r=(r+1)%u,p=f[r];0<o&&(d[s?"lineTo":"moveTo"](l,q),p-=o);i=l;k=q}d.strokeStyle=Color.Internal.extract(b);d.stroke();d.restore();return d}}}};return{line:function(a){for(var b=
18+c.center[1]);d.rotate(c.theta);d.scale(c.scale,c.scale);var f=a,j=c.points,h=j.length-1,i=j[h][0],k=j[h][1],l=0,q=0,m=0,n=0,o=0,r=0,t=f.length,s=!0,p=f[0];for(d.moveTo(i,k);h--;){l=j[h][0];q=j[h][1];m=l-i;n=q-k;for(o=Math.sqrt(m*m+n*n);p<=o;)i+=m*p/o,k+=n*p/o,d[s?"lineTo":"moveTo"](i,k),m=l-i,n=q-k,o=Math.sqrt(m*m+n*n),s=!s,r=(r+1)%t,p=f[r];0<o&&(d[s?"lineTo":"moveTo"](l,q),p-=o);i=l;k=q}d.strokeStyle=Color.Internal.extract(b);d.stroke();d.restore();return d}}}};return{line:function(a){for(var b=
1919[];"Cons"===a[0];)b.push([a[1][1],a[1][2]]),a=a[2];return{center:[0,0],points:b,theta:0,scale:1}},customLine:c,solid:function(a){return function(b){return function(c){c.save();c.beginPath();c.translate(b.center[0],b.center[1]);c.rotate(b.theta);c.scale(b.scale,b.scale);var d=b.points,g=d.length;for(c.moveTo(d[g-1][0],d[g-1][1]);g--;)c.lineTo(d[g][0],d[g][1]);c.strokeStyle=Color.Internal.extract(a);c.stroke();c.restore();return c}}},dashed:c([8,4]),dotted:c([3,3])}}(),Elm=function(){var c=function(a){this.id=
2020Guid.guid();this.value=a;this.step=function(a,b){var c=a===this.id;c&&(this.value=b);return c}},a=function(a,b){this.id=Guid.guid();this.value=null;b.reverse();this.recalc=function(){for(var c=a,f=b.length;f--;)c=c(b[f].value);this.value=c};this.recalc();this.step=function(a,c){if(this.hasOwnProperty(a))return!1;for(var e=!1,h=b.length;h--;)e=b[h].step(a,c)||e;e?this.recalc():this[a]=!0;return e}},b=function(a,b,c){this.id=Guid.guid();this.value=b;this.step=function(b,d){if(this.hasOwnProperty(b))return!1;
2121var h=c.step(b,d);h?this.value=a(c.value)(this.value):this[b]=!0;return h}};return{Input:function(a){return new c(a)},Lift:function(b,c){return new a(b,c)},Fold:function(a,c,g){return new b(a,c,g)}}}(),Dispatcher=function(){var c=null,a=function(b){var c=b.childNodes,d=c.length;if(b.hasOwnProperty("isElmLeaf")){var c=""===b.style.width?0:b.style.width.slice(0,-2)-0,g=""===b.style.height?0:b.style.height.slice(0,-2)-0;return[c,g]}if(1===d){var f=a(c[0]);""!==b.style.width&&(f[0]=b.style.width.slice(0,
@@ -35,9 +35,9 @@ i();for(var d=[b];"Cons"===c[0];)b=a(c[1])(b),d.push(b),c=c[2];for(var c=["Nil"]
3535[function(a){return"Nil"!==a[0]?void 0:["Tuple2",["Nil"],["Nil"]]},function(a){if("Cons"!==a[0])a=void 0;else if(a=["Tuple2",a[1],f(a[2])],"Tuple2"!==a[0]||"Tuple2"!==a[1][0])a=void 0;else var b=a[1][1],c=a[1][2],a="Tuple2"!==a[2][0]?void 0:["Tuple2",["Cons",b,a[2][1]],["Cons",c,a[2][2]]];return a}],c=b.length;c--;){var d=b[c](a);if(void 0!==d)return d}}()}function j(a){return function(b){return function(){for(var c=[function(a){return"Nil"!==a[0]?void 0:["Nil"]},function(a){if("Cons"===a[0]){var b=
3636a[1];return"Nil"!==a[2][0]?void 0:["Cons",b,["Nil"]]}},function(b){if("Cons"===b[0]){var c=b[1];if("Cons"===b[2][0]){var d=b[2][1],b=b[2][2];return["Cons",c,["Cons",a,j(a)(["Cons",d,b])]]}}}],d=c.length;d--;){var e=c[d](b);if(void 0!==e)return e}}()}}function h(a){return function(b){return function(){for(var c=[function(a){return"Nil"!==a[0]?void 0:["Nil"]},function(a){if("Cons"===a[0]){var b=a[1];return"Nil"!==a[2][0]?void 0:b}},function(b){if("Cons"===b[0]){var c=b[1];if("Cons"===b[2][0]){var d=
3737b[2][1],b=b[2][2];return Value.append(c,Value.append(a,h(a)(["Cons",d,b])))}}}],d=c.length;d--;){var e=c[d](b);if(void 0!==e)return e}}()}}var i=function(){throw"Function expecting a list!";},k=a(function(a){return function(b){return["Cons",a,b]}})(["Nil"]),l=b(function(a){return function(b){return Value.append(a,b)}})(["Nil"]),q=a(function(a){return function(b){return a&&b}})(!0),m=a(function(a){return function(b){return a||b}})(!1),n=a(function(a){return function(b){return a+b}})(0),o=a(function(a){return function(b){return a*
38−b}})(1),r=e(function(a){return function(b){return Math.max(a,b)}}),u=e(function(a){return function(b){return Math.min(a,b)}});return{head:function(a){if("Cons"!==a[0])throw"Error: 'head' only accepts lists of length greater than one.";return a[1]},tail:function(a){if("Cons"!==a[0])throw"Error: 'tail' only accepts lists of length greater than one.";return a[2]},map:c,foldl:a,foldr:b,foldl1:e,foldr1:function(a){return function(c){var d;"Cons"!==c[0]?d=void 0:(d=c[1],c=c[2],d=b(a)(d)(c));return d}},
38+b}})(1),r=e(function(a){return function(b){return Math.max(a,b)}}),t=e(function(a){return function(b){return Math.min(a,b)}});return{head:function(a){if("Cons"!==a[0])throw"Error: 'head' only accepts lists of length greater than one.";return a[1]},tail:function(a){if("Cons"!==a[0])throw"Error: 'tail' only accepts lists of length greater than one.";return a[2]},map:c,foldl:a,foldr:b,foldl1:e,foldr1:function(a){return function(c){var d;"Cons"!==c[0]?d=void 0:(d=c[1],c=c[2],d=b(a)(d)(c));return d}},
3939scanl:d,scanl1:function(a){return function(b){if("Cons"!==b[0])throw"Error: 'scanl1' requires a list of at least length 1.";return d(a)(b[1])(b[2])}},filter:function(a){return function(b){if("Nil"===b[0])return b;"Cons"!==b[0]&&i();for(var c=[];"Cons"===b[0];)a(b[1])&&c.push(b[1]),b=b[2];for(var b=["Nil"],d=c.length;d--;)b=["Cons",c[d],b];return b}},length:function(a){for(var b=0;"Cons"===a[0];)b+=1,a=a[2];return b},reverse:k,concat:l,concatMap:function(a){return function(b){return l(c(a)(b))}},and:q,
40−or:m,forall:function(b){return a(function(a){return function(c){return c&&b(a)}})(!0)},exists:function(b){return a(function(a){return function(c){return c||b(a)}})(!1)},sum:n,product:o,maximum:r,minimum:u,partition:g,zipWith:function(a){return function(b){return function(c){if("Nil"===b[0]||"Nil"===c[0])return b;("Cons"!==b[0]||"Cons"!==c[0])&&i();for(var d=[];"Cons"===b[0]&&"Cons"===c[0];)d.push(a(b[1])(c[1])),b=b[2],c=c[2];for(var c=["Nil"],e=d.length;e--;)c=["Cons",d[e],c];return c}}},zip:function(a){return function(b){if("Nil"===
40+or:m,forall:function(b){return a(function(a){return function(c){return c&&b(a)}})(!0)},exists:function(b){return a(function(a){return function(c){return c||b(a)}})(!1)},sum:n,product:o,maximum:r,minimum:t,partition:g,zipWith:function(a){return function(b){return function(c){if("Nil"===b[0]||"Nil"===c[0])return b;("Cons"!==b[0]||"Cons"!==c[0])&&i();for(var d=[];"Cons"===b[0]&&"Cons"===c[0];)d.push(a(b[1])(c[1])),b=b[2],c=c[2];for(var c=["Nil"],e=d.length;e--;)c=["Cons",d[e],c];return c}}},zip:function(a){return function(b){if("Nil"===
4141a[0]||"Nil"===b[0])return a;("Cons"!==a[0]||"Cons"!==b[0])&&i();for(var c=[];"Cons"===a[0]&&"Cons"===b[0];)c.push(["Tuple2",a[1],b[1]]),a=a[2],b=b[2];for(var b=["Nil"],d=c.length;d--;)b=["Cons",c[d],b];return b}},unzip:f,intersperse:j,intercalate:h,sort:function(a){if("Nil"===a[0])return a;"Cons"!==a[0]&&i();for(var b=[];"Cons"===a[0];)b.push(a[1]),a=a[2];b.sort(function(a,b){return a-b});for(var a=["Nil"],c=b.length;c--;)a=["Cons",b[c],a];return a}}}(),id=function(c){return c},not=function(c){return!c},
4242sqrt=function(c){return Math.sqrt(c)},rem=function(c){return function(a){return c%a}},mod=function(c){return function(a){var b=c%a,b=0==c?0:0<a?0<=c?b:b+a:-mod(-c)(-a);return b==a?0:b}},abs=function(c){return Math.abs(c)},logBase=function(c){return function(a){return Math.log(a)/Math.log(c)}},min=function(c){return function(a){return Math.min(c,a)}},max=function(c){return function(a){return Math.max(c,a)}},clamp=function(c){return function(a){return function(b){return Math.min(a,Math.max(c,b))}}},
4343sin=Math.sin,cos=Math.cos,tan=Math.tan,asin=Math.asin,acos=Math.acos,atan=Math.atan,flip=function(c){return function(a){return function(b){return c(b)(a)}}},Just=function(c){return["Just",c]},Nothing=["Nothing"];function constant(c){return Elm.Input(c)}function lift(c){return function(a){return Elm.Lift(c,[a])}}function lift2(c){return function(a){return function(b){return Elm.Lift(c,[a,b])}}}