@@ -1,49 +1,50 @@
1−var Guid=function(){var c=0;return{guid:function(){return c+=1}}}(),Data=function(){var c=function(){var a=function(a){a.replace('"',""");a.replace("&","&");a.replace("'","'");a.replace("<","<");a.replace(">",">");return a};return{toText:function(c){if("string"===typeof c)return c;for(var b=[];"Cons"===c[0];)b.push(c[1]),c=c[2];return a(b.join(""))},properEscape:a}}(),a=function(){return{fromCode:function(a){return String.fromCharCode(a)},toCode:function(a){return a.charCodeAt(0)},
2−toUpper:function(a){return a.toUpperCase()},toLower:function(a){return a.toLowerCase()},toLocaleUpper:function(a){return a.toLocaleUpperCase()},toLocaleLower:function(a){return a.toLocaleLowerCase()}}}();return{String:c,Char:a}}(),Value=function(){var c=function(a){if("boolean"===typeof a)return a?"True":"False";if("number"!==typeof a&&a[0]){if("Tuple"===a[0].substring(0,5)){for(var d="",e=a.length;--e;)d=","+c(a[e])+d;","===d[0]&&(d=d.substring(1));return"("+d+")"}if("Cons"===a[0])for(var e="string"===
3−typeof a[1]?'"':"]",b="string"===typeof a[1]?"":",",d=("string"===typeof a[1]?'"':"[")+c(a[1]),a=a[2];;)if("Cons"===a[0])d+=b+c(a[1]),a=a[2];else return d+e;else{if("Nil"===a[0])return"[]";d="";for(e=a.length;--e;)d=" "+c(a[e])+d;d=a[0]+d;return 1<a.length?"("+d+")":d}}return a+""};return{show:function(a){return Text.monospace(Data.String.properEscape(c(a)))},Tuple:function(){var a=arguments.length,d=Array(a+1);for(d[0]="Tuple"+arguments.length;a--;)d[a+1]=arguments[a];return d},append:function(a,
4−d){if("string"===typeof a&&"string"===typeof d)return a.concat(d);if("Nil"===a[0])return d;for(var c=["Cons",a[1],["Nil"]],b=c,a=a[2];"Cons"===a[0];)b[2]=["Cons",a[1],["Nil"]],a=a[2],b=b[2];b[2]=d;return c}}}(),Color=function(){var c=function(a,c,e,b){return{r:Math.round(255*a),g:Math.round(255*c),b:Math.round(255*e),a:b}};return{black:c(0,0,0,1),white:c(1,1,1,1),red:c(1,0,0,1),green:c(0,1,0,1),blue:c(0,0,1,1),rgba:function(a){return function(d){return function(e){return function(b){return c(a,d,
5−e,b)}}}},rgb:function(a){return function(d){return function(e){return c(a,d,e,1)}}},Internal:{extract:function(a){return 1===a.a?"rgb("+a.r+","+a.g+","+a.b+")":"rgba("+a.r+","+a.g+","+a.b+","+a.a+")"}}}}(),Element=function(){var c=function(a){a=document.createElement(a);a.id=Guid.guid();return a},a=function(a){var f=c("div");f.appendChild(a);return f},d=function(a){return function(f){return function(d){var b=c("div");b.isElmText=!0;b.innerHTML=d;b.style.textAlign=f;0<a&&(b.style.width=a+"px");b.isElmLeaf=
6−!0;b.style.visibility="hidden";b.style.styleFloat="left";b.style.cssFloat="left";document.body.appendChild(b);d=window.getComputedStyle(b);0>=a&&(b.style.width=d.getPropertyValue("width"));b.style.height=d.getPropertyValue("height");document.body.removeChild(b);b.style.visibility="visible";b.style.styleFloat="none";b.style.cssFloat="none";return b}}},e=d(0)("left"),b=d(0)("justify"),g=d(0)("center"),h=function(c){return"DIV"===c.tagName?c:a(c)},j=function(a){a.style.styleFloat="left";a.style.cssFloat=
7−"left";return a},k=function(a){a.style.position="absolute";return a},i=function(a,f,d){for(var b=c("div"),e=d.length;e--;){var g=f(d[e]);b.appendChild(g)}b.elmFlowDirection=a;return b},m=function(a){return function(f){for(var c=[];"Cons"===f[0];)c.push(f[1]),f=f[2];3<=a&&c.reverse();f=a%3;if(0==f)return i("Y",h,c);if(1==f)return i("X",j,c);if(2==f)return i("Z",k,c)}},n=function(a){return function(f){if("A"===f.tagName)return n(a)(f.firstChild),f;if(f.hasOwnProperty("isElmText")){var c=d(a)(f.style.textAlign)(f.innerHTML);
8−f.style.height=c.style.height}f.style.width=a+"px";return f}};return{text:e,image:function(a){var f=c("img");f.isElmLeaf=!0;f.onload=function(){""===f.style.width&&0<this.width&&(f.style.width=f.width=this.width+"px");""===f.style.height&&0<this.height&&(f.style.height=f.height=this.height+"px");Dispatcher.adjust()};f.src=Data.String.toText(a);f.name=f.src;return f},fittedImage:function(a){return function(f){return function(d){var b=c("canvas");b.style.width=a+"px";b.style.height=f+"px";b.width=a;
9−b.height=f;b.innerHTML="Your browser does not support the canvas element.";b.isElmLeaf=!0;var e=c("img");e.onload=function(){if(b.getContext){var c=b.getContext("2d"),d=0,q=0,g=this.width,i=this.height;a/f>this.width/this.height?(i=this.width*f/a,q=(this.height-i)/2):(g=this.height*a/f,d=(this.width-g)/2);c.drawImage(e,d,q,g,i,0,0,b.width,b.height)}};e.src=Data.String.toText(d);return b}}},video:function(a){var a=Data.String.toText(a),f=c("video");f.controls="controls";var b=c("source");b.src=a;b.type=
10−"video/"+a.substring(a.length-3,a.length);f.appendChild(b);f.isElmLeaf=!0;return f},audio:function(a){var a=Data.String.toString(a),f=c("video");f.controls="controls";var b=c("source");b.src=a;b.type="audio/"+a.substring(a.length-3,a.length);f.appendChild(b);f.isElmLeaf=!0;return f},collage:function(a){return function(f){return function(b){var d=c("canvas");d.style.width=a+"px";d.style.height=f+"px";d.width=a;d.height=f;if(d.getContext){var e=d.getContext("2d");for(e.clearRect(0,0,d.width,d.height);"Cons"===
11−b[0];)e=b[1](e),b=b[2];return d}d.innerHTML="Your browser does not support the canvas element.";d.isElmLeaf=!0;return d}}},flow:m,layers:m(2),beside:function(a){return function(f){return m(4)(["Cons",a,["Cons",f,["Nil"]]])}},above:function(a){return function(f){return m(3)(["Cons",a,["Cons",f,["Nil"]]])}},below:function(a){return function(f){return m(0)(["Cons",a,["Cons",f,["Nil"]]])}},box:function(a){return function(f){f.style.position="absolute";f.style.margin="auto";var b=(a-1)%3,d=(a-1)/3;2>b&&
12−(f.style.left=0);0<b&&(f.style.right=0);2>d&&(f.style.top=0);0<d&&(f.style.bottom=0);b=c("div");b.style.position="relative";b.appendChild(f);return b}},width:n,height:function(a){return function(f){("A"===f.tagName?f.firstChild:f).style.height=a+"px";return f}},size:function(a){return function(f){return function(b){var d="A"===b.tagName?b.firstChild:b;d.style.width=a+"px";d.style.height=f+"px";return b}}},color:function(a){return function(f){f.style.backgroundColor=Color.Internal.extract(a);return f}},
13−opacity:function(a){return function(f){f.style.opacity=a;return f}},link:function(b){return function(f){var d=c("a");d.href=Text.fromString(b);d.appendChild(f);return a(d)}},asText:function(a){return d(0)("left")(Value.show(a))},plainText:function(a){return d(0)("left")(Data.String.toText(a))},justifiedText:b,centeredText:g,up:0,left:1,inward:2,down:3,right:4,outward:5}}(),Text=function(){var c=function(a){if("string"===typeof a)return a;for(var b=[];"Cons"===a[0];)b.push(a[1]),a=a[2];return Data.String.properEscape(b.join(""))},
14−a=function(a){return function(b){return"<"+a+">"+b+"</"+a+">"}},d=function(a,b){return function(d){return"<span style='"+a+":"+b+"'>"+d+"</span>"}},e=a("h1"),b=d("font-style","italic"),a=a("b"),g=d("text-decoration","underline"),h=d("text-decoration","overline"),j=d("text-decoration","line-through");return{fromString:c,toText:c,header:e,height:function(a){return d("font-size",a+"em")},italic:b,bold:a,underline:g,overline:h,strikeThrough:j,monospace:d("font-family","monospace"),color:function(a){return d("color",
15−Color.Internal.extract(a))},link:function(a){return function(b){return"<a href='"+c(a)+"'>"+b+"</a>"}}}}(),Shape=function(){var c=function(a,c,b,g){return{center:a,points:c,theta:b,scale:g}},a=function(a){return function(c){return function(b){return function(g){g.save();g.translate(b.center[0],b.center[1]);g.rotate(b.theta);g.scale(b.scale,b.scale);g.beginPath();var h=b.points;g.moveTo(h[0][0],h[0][1]);for(var j=h.length;j--;)g.lineTo(h[j][0],h[j][1]);g.closePath();a?(g.fillStyle=Color.Internal.extract(c),
16−g.fill()):(g.strokeStyle=Color.Internal.extract(c),g.stroke());g.restore();return g}}}};return{polygon:function(a){return function(e){for(var b=[];"Cons"===a[0];)b.push([a[1][1],a[1][2]]),a=a[2];e=[e[1],e[2]];return c(e,b,0,1)}},ngon:function(a){return function(e){return function(b){for(var g=[],h=a;h--;)g.push([e*Math.cos(2*Math.PI*h/a),e*Math.sin(2*Math.PI*h/a)]);b=[b[1],b[2]];return c(b,g,0,1)}}},rect:function(a){return function(e){return function(b){var g=[[-a/2,-e/2],[a/2,-e/2],[a/2,e/2],[-a/
17−2,e/2]],b=[b[1],b[2]];return c(b,g,0,1)}}},oval:function(a){return function(e){return function(b){for(var g=[],h=2*Math.PI;0<h;h-=Math.PI/50)g.push([a/2*Math.cos(h),e/2*Math.sin(h)]);b=[b[1],b[2]];return c(b,g,0,1)}}},move:function(a){return function(e){return function(b){return c([a+b.center[0],e+b.center[1]],b.points,b.theta,b.scale)}}},rotate:function(a){return function(e){return c(e.center,e.points,e.theta+2*Math.PI*a,e.scale)}},scale:function(a){return function(e){return c(e.center,e.points,
18−e.theta,e.scale*a)}},filled:a(!0),outlined:a(!1),customOutline:function(a){return function(c){return function(b){b.points.push(b.points[0]);return Line.customLine(a)(c)(b)}}}}}(),Line=function(){var c=function(a){return function(c){return function(e){if("string"===typeof a[0]){for(var b=[];"Cons"===a[0];)b.push(a[1]),a=a[2];a=b}0===a.length&&(a=[8,4]);return function(b){b.save();b.beginPath();b.translate(e.center[0],e.center[1]);b.rotate(e.theta);b.scale(e.scale,e.scale);var h=a,j=e.points,k=j.length-
19−1,i=j[k][0],m=j[k][1],n=0,l=0,f=0,o=0,p=0,r=0,t=h.length,s=!0,q=h[0];for(b.moveTo(i,m);k--;){n=j[k][0];l=j[k][1];f=n-i;o=l-m;for(p=Math.sqrt(f*f+o*o);q<=p;)i+=f*q/p,m+=o*q/p,b[s?"lineTo":"moveTo"](i,m),f=n-i,o=l-m,p=Math.sqrt(f*f+o*o),s=!s,r=(r+1)%t,q=h[r];0<p&&(b[s?"lineTo":"moveTo"](n,l),q-=p);i=n;m=l}b.strokeStyle=Color.Internal.extract(c);b.stroke();b.restore();return b}}}};return{line:function(a){for(var c=[];"Cons"===a[0];)c.push([a[1][1],a[1][2]]),a=a[2];return{center:[0,0],points:c,theta:0,
20−scale:1}},customLine:c,solid:function(a){return function(c){return function(e){e.save();e.beginPath();e.translate(c.center[0],c.center[1]);e.rotate(c.theta);e.scale(c.scale,c.scale);var b=c.points,g=b.length;for(e.moveTo(b[g-1][0],b[g-1][1]);g--;)e.lineTo(b[g][0],b[g][1]);e.strokeStyle=Color.Internal.extract(a);e.stroke();e.restore();return e}}},dashed:c([8,4]),dotted:c([3,3])}}(),Elm=function(){var c=function(a,c,d){for(var e=a.length;e--;)a[e].recv(c,d)},a=function(a){this.id=Guid.guid();this.value=
21−a;this.kids=[];this.recv=function(a,b,d){if(b=b===this.id)this.value=d;c(this.kids,a,b)};Dispatcher.inputs.push(this)},d=function(a,d){this.id=Guid.guid();this.value=null;this.kids=[];this.inbox={};d.reverse();this.recalc=function(){for(var c=a,e=d.length;e--;)c=c(d[e].value);this.value=c};this.recalc();this.recv=function(a,b){this.inbox.hasOwnProperty(a)||(this.inbox[a]={changed:!1,count:0});var e=this.inbox[a];e.count+=1;b&&(e.changed=!0);e.count==d.length&&(e.changed&&this.recalc(),c(this.kids,
22−a,e.changed),delete this.inbox[a])};for(var e=d.length;e--;)d[e].kids.push(this)},e=function(a,d,e){this.id=Guid.guid();this.value=d;this.kids=[];this.recv=function(d,g){g&&(this.value=a(e.value)(this.value));c(this.kids,d,g)};e.kids.push(this)};return{Input:function(b){return new a(b)},Lift:function(a,c){return new d(a,c)},Fold:function(a,c,d){return new e(a,c,d)}}}(),Dispatcher=function(){var c=null,a=0,d=[],e=function(a){var c=a.childNodes,d=c.length;if(a.hasOwnProperty("isElmLeaf")){var c=""===
23−a.style.width?0:a.style.width.slice(0,-2)-0,j=""===a.style.height?0:a.style.height.slice(0,-2)-0;return[c,j]}if(1===d){var k=e(c[0]);""!==a.style.width&&(k[0]=a.style.width.slice(0,-2)-0);""!==a.style.height&&(k[1]=a.style.height.slice(0,-2)-0);0!==k[0]&&(a.style.width=k[0]+"px");0!==k[1]&&(a.style.height=k[1]+"px");return k}for(var i=0,m=j=0,n=0,l=!0,f=!0;d--;)k=e(c[d]),i=Math.max(i,k[0]),j=Math.max(j,k[1]),m+=k[0],n+=k[1],l=l&&0<k[0],f=f&&0<k[1];c=i;d=a.elmFlowDirection;"X"===d&&(c=l?m:0);"Y"===
24−d&&(j=f?n:0);0<c&&(a.style.width=c+"px");0<j&&(a.style.height=j+"px");return[c,j]};return{initialize:function(){try{c=main()}catch(a){throw document.body.innerHTML=monospace("Runtime Error:<br>JavaScript "+a),a;}c.hasOwnProperty("recv")||(c=Elm.Input(c));var d=document.getElementById("content");d.appendChild(c.value);e(d);d=document.getElementById("widthChecker").offsetWidth;d!==window.innerWidth&&Dispatcher.notify(Window.dimensions.id,Value.Tuple(d,window.innerHeight));c=Elm.Lift(function(a){var c=
25−document.getElementById("content");c.replaceChild(a,c.children[0]);e(c);return a},[c])},notify:function(c,e){a+=1;for(var h=d.length;h--;)d[h].recv(a,c,e)},adjust:function(){var a=document.getElementById("content");e(a)},inputs:d}}(),Signal=function(){function c(a){for(var c=["Nil"],b=a.length;b--;)c=["Cons",a[b],c];return c}var a=function(){return document.addEventListener?function(a,c,b){a.addEventListener(c,b,!1)}:function(a,c,b){a.attachEvent("on"+c,b)}}(),d=function(){function c(a){var b=0,d=
26−0;a||(a=window.event);if(a.pageX||a.pageY)b=a.pageX,d=a.pageY;else if(a.clientX||a.clientY)b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,d=a.clientY+document.body.scrollTop+document.documentElement.scrollTop;return Value.Tuple(b,d)}var b=Elm.Input(Value.Tuple(0,0)),d=Elm.Input(!1),e=Elm.Input(!1);a(document,"click",function(){Dispatcher.notify(e.id,!0);Dispatcher.notify(e.id,!1)});a(document,"mousedown",function(){Dispatcher.notify(d.id,!0)});a(document,"mouseup",function(){Dispatcher.notify(d.id,
27−!1)});a(document,"mousemove",function(a){Dispatcher.notify(b.id,c(a))});return{position:b,x:Elm.Lift(function(a){return a[1]},[b]),y:Elm.Lift(function(a){return a[2]},[b]),isClicked:e,isDown:d,clickedOn:function(c){var b=Elm.Input(!1);a(c,"click",function(){Dispatcher.notify(b.id,!0);Dispatcher.notify(b.id,!1)});return Value.Tuple(c,b)}}}(),e=function(){return{every:function(a){var a=1E3*a,c=Elm.Input(0),b=0;setInterval(function(){b+=a;Dispatcher.notify(c.id,b/1E3)},a);return c},after:function(a){var a=
28−1E3*a,c=Elm.Input(!1);setTimeout(function(){Dispatcher.notify(c.id,!0)},a);return c},before:function(a){var a=1E3*a,c=Elm.Input(!0);setTimeout(function(){Dispatcher.notify(c.id,!1)},a);return c}}}(),b=function(){var c=Elm.Input(Value.Tuple(window.innerWidth,window.innerHeight));a(window,"resize",function(){var a=document.getElementById("widthChecker").offsetWidth;Dispatcher.notify(c.id,Value.Tuple(a,window.innerHeight))});return{dimensions:c,width:Elm.Lift(function(a){return a[1]},[c]),height:Elm.Lift(function(a){return a[2]},
29−[c])}}(),g={Raw:function(){function c(a,b){return"Nil"===b[0]?b:b[1]===a?b[2]:["Cons",b[1],c(a,b[2])]}var b=Elm.Input(["Nil"]),d=Elm.Input(["Nothing"]);a(document,"keydown",function(a){var c;a:{for(c=b.value;"Nil"!==c[0];){if(c[1]===a.keyCode){c=!0;break a}c=c[2]}c=!1}c||Dispatcher.notify(b.id,["Cons",a.keyCode,b.value])});a(document,"keyup",function(a){a=c(a.keyCode,b.value);Dispatcher.notify(b.id,a)});a(window,"blur",function(){Dispatcher.notify(b.id,["Nil"])});a(document,"keypress",function(a){Dispatcher.notify(d.id,
30−["Just",a.charCode||a.keyCode]);Dispatcher.notify(d.id,["Nothing"])});return{keysDown:b,charPressed:d}}()},h=function(){var a=function(a){return function(b){var d=Elm.Input(["Waiting"]),e={};window.XMLHttpRequest?e=new XMLHttpRequest:window.ActiveXObject&&(e=new ActiveXObject("Microsoft.XMLHTTP"));e.onreadystatechange=function(){4===e.readyState&&Dispatcher.notify(d.id,200===e.status?["Success",c(e.responseText)]:["Failure",e.status,c(e.statusText)])};e.open(a,Data.String.toText(b),!0);e.send(null);
31−return d}},b=function(a){return function(b){var d=Elm.Input(["Nothing"]),b=Elm.Lift(function(b){if("Just"!==b[0]){try{Dispatcher.notify(d.id,["Nothing"])}catch(e){}return[]}try{Dispatcher.notify(d.id,["Just",["Waiting"]])}catch(g){d.value=["Just",["Waiting"]]}var l={};window.XMLHttpRequest?l=new XMLHttpRequest:window.ActiveXObject&&(l=new ActiveXObject("Microsoft.XMLHTTP"));l.onreadystatechange=function(){4===l.readyState&&Dispatcher.notify(d.id,["Just",200===l.status?["Success",c(l.responseText)]:
32−["Failure",l.status,c(l.statusText)]])};l.open(a,Data.String.toText(b[1]),!0);l.send(null);return[]},[b]);return Elm.Lift(function(a){return function(){return a}},[d,b])}};return{get:a("GET"),post:a("POST"),gets:b("GET"),posts:b("POST")}}(),j=function(){return{inRange:function(a){return function(c){return Elm.Input(Math.floor(Math.random()*(c-a+1))+a)}},randomize:function(a){return function(c){return function(b){return Elm.Lift(function(){return Math.floor(Math.random()*(c-a+1))+a},[b])}}}}}(),k=
33−function(){var b=function(b){b.isElmLeaf=!0;var d=Elm.Input(["Nil"]);a(b,"keyup",function(){Dispatcher.notify(d.id,c(b.value));b.focus()});return Value.Tuple(b,d)},d=function(a){a=document.createElement(a);a.id=Guid.guid();return a},e=function(c){for(var b=d("select"),e=[];"Cons"===c[0];){var g=d("option"),h=Text.toText(c[1][1]);g.value=h;g.innerHTML=h;b.appendChild(g);e.push(c[1][2]);c=c[2]}var i=Elm.Input(e[0]);a(b,"change",function(){Dispatcher.notify(i.id,e[b.selectedIndex])});return Value.Tuple(b,
34−i)};return{textArea:function(a){return function(c){var e=d("textarea");e.rows=c;e.cols=a;return b(e,"")}},textField:function(a){var c=d("input");c.type="text";return b(c,a)},password:function(a){var c=d("input");c.type="password";return b(c,a)},checkbox:function(c){var b=d("input");b.type="checkbox";b.checked=c;var e=Elm.Input(c);a(b,"change",function(){Dispatcher.notify(e.id,b.checked)});return Value.Tuple(b,e)},dropDown:e,stringDropDown:function(a){return e(List.map(function(a){return Value.Tuple(a,
35−a)})(a))},button:function(c){var b=d("input");b.type="button";b.value=Text.toText(c);var e=Elm.Input(!1);a(b,"click",function(){Dispatcher.notify(e.id,!0);Dispatcher.notify(e.id,!1)});return Value.Tuple(b,e)}}}();return{Mouse:d,Keyboard:g,Time:e,Window:b,HTTP:h,Random:j,Input:k}}(),List=function(){function c(a){return function(c){if("Nil"===c[0])return c;"Cons"!==c[0]&&i();for(var b=["Cons",a(c[1]),["Nil"]],d=b,c=c[2];"Cons"===c[0];)d[2]=["Cons",a(c[1]),["Nil"]],c=c[2],d=d[2];return b}}function a(a){return function(c){return function(b){var d=
36−c;if("Nil"===b[0])return d;for("Cons"!==b[0]&&i();"Cons"===b[0];)d=a(b[1])(d),b=b[2];return d}}}function d(a){return function(c){return function(b){var d=c;if("Nil"===b[0])return d;"Cons"!==b[0]&&i();for(var e=[];"Cons"===b[0];)e.push(b[1]),b=b[2];for(b=e.length;b--;)d=a(e[b])(d);return d}}}function e(c){return function(b){var d;"Cons"!==b[0]?d=void 0:(d=b[1],b=b[2],d=a(c)(d)(b));return d}}function b(a){return function(c){return function(b){if("Nil"===b[0])return["Cons",c,["Nil"]];"Cons"!==b[0]&&
37−i();for(var d=[c];"Cons"===b[0];)c=a(b[1])(c),d.push(c),b=b[2];for(var b=["Nil"],e=d.length;e--;)b=["Cons",d[e],b];return b}}}function g(a){return function(b){return function(){for(var c=[function(a){return"Nil"!==a[0]?void 0:["Tuple2",["Nil"],["Nil"]]},function(b){if("Cons"===b[0]){var c=b[1],b=b[2];var d=g(a)(b);"Tuple2"!==d[0]?c=void 0:(b=d[1],d=d[2],c=a(c)?["Tuple2",["Cons",c,b],d]:["Tuple2",b,["Cons",c,d]]);return c}}],d=c.length;d--;){var e=c[d](b);if(void 0!==e)return e}}()}}function h(a){return function(){for(var b=
38−[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],h(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=
39−a[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 k(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=
40−b[2][1],b=b[2][2];return Value.append(c,Value.append(a,k(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!";},m=a(function(a){return function(b){return["Cons",a,b]}})(["Nil"]),n=d(function(a){return function(b){return Value.append(a,b)}})(["Nil"]),l=a(function(a){return function(b){return a&&b}})(!0),f=a(function(a){return function(b){return a||b}})(!1),o=a(function(a){return function(b){return a+b}})(0),p=a(function(a){return function(b){return a*
41−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:d,foldl1:e,foldr1:function(a){return function(b){var c;"Cons"!==b[0]?c=void 0:(c=b[1],b=b[2],c=d(a)(c)(b));return c}},
42−scanl:b,scanl1:function(a){return function(c){if("Cons"!==c[0])throw"Error: 'scanl1' requires a list of at least length 1.";return b(a)(c[1])(c[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:m,concat:n,concatMap:function(a){return function(b){return n(c(a)(b))}},and:l,
43−or:f,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:o,product:p,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"===
44−a[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:h,intersperse:j,intercalate:k,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},
45−sqrt=function(c){return Math.sqrt(c)},rem=function(c){return function(a){return c%a}},mod=function(c){return function(a){var d=c%a,d=0==c?0:0<a?0<=c?d:d+a:-mod(-c)(-a);return d==a?0:d}},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(d){return Math.min(a,Math.max(c,d))}}},
46−sin=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(d){return c(d)(a)}}},Just=function(c){return["Just",c]},Nothing=["Nothing"],eq=function(c,a){if("object"===typeof c){if(c===a)return!0;if(c.length!==a.length)return!1;for(var d=c.length;d--;)if(!eq(c[d],a[d]))return!1;return!0}return c===a};function constant(c){return Elm.Input(c)}function lift(c){return function(a){return Elm.Lift(c,[a])}}
47−function lift2(c){return function(a){return function(d){return Elm.Lift(c,[a,d])}}}function lift3(c){return function(a){return function(d){return function(e){return Elm.Lift(c,[a,d,e])}}}}function lift4(c){return function(a){return function(d){return function(e){return function(b){return Elm.Lift(c,[a,d,e,b])}}}}}function foldp(c){return function(a){return function(d){return Elm.Fold(c,a,d)}}}var includeGlobal=this;
48−(function(){var c=function(a){for(var c in a)if("Internal"!==c)try{includeGlobal[c]=a[c]}catch(b){"length"===c&&(includeGlobal.execScript("var length;"),length=a[c])}},a=function(a){return function(c){includeGlobal[a]=includeGlobal[a]||{};for(var b in c)"Internal"!==b&&(includeGlobal[a][b]=c[b])}};c(Element);c(Text);color=Element.color;height=Element.height;show=Value.show;a("Time")(Signal.Time);a("Mouse")(Signal.Mouse);a("Keyboard")(Signal.Keyboard);a("Window")(Signal.Window);a("HTTP")(Signal.HTTP);
49−a("Input")(Signal.Input);a("Random")(Signal.Random);c(Color);c(Shape);c(Line)})();
1+var Guid=function(){var b=0;return{guid:function(){return b+=1}}}(),Value=function(){var b=function(a){a.replace('"',""");a.replace("&","&");a.replace("'","'");a.replace("<","<");a.replace(">",">");return a},c=function(a){if("boolean"===typeof a)return a?"True":"False";if("number"!==typeof a&&a[0]){if("Tuple"===a[0].substring(0,5)){for(var b="",g=a.length;--g;)b=","+c(a[g])+b;","===b[0]&&(b=b.substring(1));return"("+b+")"}if("Cons"===a[0])for(var g="string"===typeof a[1]?'"':"]",
2+f="string"===typeof a[1]?"":",",b=("string"===typeof a[1]?'"':"[")+c(a[1]),a=a[2];;)if("Cons"===a[0])b+=f+c(a[1]),a=a[2];else return b+g;else{if("Nil"===a[0])return"[]";b="";for(g=a.length;--g;)b=" "+c(a[g])+b;b=a[0]+b;return 1<a.length?"("+b+")":b}}return a+""};return{show:function(a){return Text.monospace(b(c(a)))},Tuple:function(){var a=arguments.length,b=Array(a+1);for(b[0]="Tuple"+arguments.length;a--;)b[a+1]=arguments[a];return b},append:function(a,b){if("string"===typeof a&&"string"===typeof b)return a.concat(b);
3+if("Nil"===a[0])return b;for(var c=["Cons",a[1],["Nil"]],f=c,a=a[2];"Cons"===a[0];)f[2]=["Cons",a[1],["Nil"]],a=a[2],f=f[2];f[2]=b;return c},toText:function(a){if("string"===typeof a)return a;for(var c=[];"Cons"===a[0];)c.push(a[1]),a=a[2];return b(c.join(""))},properEscape:b}}(),List=function(){function b(a){return function(e){if("Nil"===e[0])return e;"Cons"!==e[0]&&i();for(var b=["Cons",a(e[1]),["Nil"]],d=b,e=e[2];"Cons"===e[0];)d[2]=["Cons",a(e[1]),["Nil"]],e=e[2],d=d[2];return b}}function c(e){return function(a){return function(b){var d=
4+a;if("Nil"===b[0])return d;for("Cons"!==b[0]&&i();"Cons"===b[0];)d=e(b[1])(d),b=b[2];return d}}}function a(e){return function(a){return function(b){var d=a;if("Nil"===b[0])return d;"Cons"!==b[0]&&i();for(var c=[];"Cons"===b[0];)c.push(b[1]),b=b[2];for(b=c.length;b--;)d=e(c[b])(d);return d}}}function h(e){return function(a){var b;"Cons"!==a[0]?b=void 0:(b=a[1],a=a[2],b=c(e)(b)(a));return b}}function g(e){return function(a){return function(b){if("Nil"===b[0])return["Cons",a,["Nil"]];"Cons"!==b[0]&&
5+i();for(var d=[a];"Cons"===b[0];)a=e(b[1])(a),d.push(a),b=b[2];for(var b=["Nil"],c=d.length;c--;)b=["Cons",d[c],b];return b}}}function f(a){return function(e){return function(){for(var b=[function(a){return"Nil"!==a[0]?void 0:["Tuple2",["Nil"],["Nil"]]},function(e){if("Cons"===e[0]){var b=e[1],e=e[2];var d=f(a)(e);"Tuple2"!==d[0]?b=void 0:(e=d[1],d=d[2],b=a(b)?["Tuple2",["Cons",b,e],d]:["Tuple2",e,["Cons",b,d]]);return b}}],d=b.length;d--;){var c=b[d](e);if(void 0!==c)return c}}()}}function j(e){return function(){for(var a=
6+[function(e){return"Nil"!==e[0]?void 0:["Tuple2",["Nil"],["Nil"]]},function(e){if("Cons"!==e[0])e=void 0;else if(e=["Tuple2",e[1],j(e[2])],"Tuple2"!==e[0]||"Tuple2"!==e[1][0])e=void 0;else var a=e[1][1],b=e[1][2],e="Tuple2"!==e[2][0]?void 0:["Tuple2",["Cons",a,e[2][1]],["Cons",b,e[2][2]]];return e}],b=a.length;b--;){var d=a[b](e);if(void 0!==d)return d}}()}function l(e){return function(a){return function(){for(var b=[function(e){return"Nil"!==e[0]?void 0:["Nil"]},function(e){if("Cons"===e[0]){var a=
7+e[1];return"Nil"!==e[2][0]?void 0:["Cons",a,["Nil"]]}},function(a){if("Cons"===a[0]){var b=a[1];if("Cons"===a[2][0]){var d=a[2][1],a=a[2][2];return["Cons",b,["Cons",e,l(e)(["Cons",d,a])]]}}}],d=b.length;d--;){var c=b[d](a);if(void 0!==c)return c}}()}}function o(e){return function(a){return function(){for(var b=[function(e){return"Nil"!==e[0]?void 0:["Nil"]},function(e){if("Cons"===e[0]){var a=e[1];return"Nil"!==e[2][0]?void 0:a}},function(a){if("Cons"===a[0]){var b=a[1];if("Cons"===a[2][0]){var d=
8+a[2][1],a=a[2][2];return Value.append(b,Value.append(e,o(e)(["Cons",d,a])))}}}],d=b.length;d--;){var c=b[d](a);if(void 0!==c)return c}}()}}var i=function(){throw"Function expecting a list!";},k=c(function(e){return function(a){return["Cons",e,a]}})(["Nil"]),m=a(function(e){return function(a){return Value.append(e,a)}})(["Nil"]),n=c(function(e){return function(a){return e&&a}})(!0),e=c(function(e){return function(a){return e||a}})(!1),d=c(function(e){return function(a){return e+a}})(0),p=c(function(e){return function(a){return e*
9+a}})(1),r=h(function(e){return function(a){return Math.max(e,a)}}),t=h(function(e){return function(a){return Math.min(e,a)}});return{head:function(e){if("Cons"!==e[0])throw"Error: 'head' only accepts lists of length greater than one.";return e[1]},tail:function(e){if("Cons"!==e[0])throw"Error: 'tail' only accepts lists of length greater than one.";return e[2]},map:b,foldl:c,foldr:a,foldl1:h,foldr1:function(e){return function(b){var d;"Cons"!==b[0]?d=void 0:(d=b[1],b=b[2],d=a(e)(d)(b));return d}},
10+scanl:g,scanl1:function(e){return function(a){if("Cons"!==a[0])throw"Error: 'scanl1' requires a list of at least length 1.";return g(e)(a[1])(a[2])}},filter:function(e){return function(a){if("Nil"===a[0])return a;"Cons"!==a[0]&&i();for(var b=[];"Cons"===a[0];)e(a[1])&&b.push(a[1]),a=a[2];for(var a=["Nil"],d=b.length;d--;)a=["Cons",b[d],a];return a}},length:function(e){for(var a=0;"Cons"===e[0];)a+=1,e=e[2];return a},reverse:k,concat:m,concatMap:function(e){return function(a){return m(b(e)(a))}},and:n,
11+or:e,forall:function(e){return c(function(a){return function(b){return b&&e(a)}})(!0)},exists:function(e){return c(function(a){return function(b){return b||e(a)}})(!1)},sum:d,product:p,maximum:r,minimum:t,partition:f,zipWith:function(e){return function(a){return function(b){if("Nil"===a[0]||"Nil"===b[0])return a;("Cons"!==a[0]||"Cons"!==b[0])&&i();for(var d=[];"Cons"===a[0]&&"Cons"===b[0];)d.push(e(a[1])(b[1])),a=a[2],b=b[2];for(var b=["Nil"],c=d.length;c--;)b=["Cons",d[c],b];return b}}},zip:function(e){return function(a){if("Nil"===
12+e[0]||"Nil"===a[0])return e;("Cons"!==e[0]||"Cons"!==a[0])&&i();for(var b=[];"Cons"===e[0]&&"Cons"===a[0];)b.push(["Tuple2",e[1],a[1]]),e=e[2],a=a[2];for(var a=["Nil"],d=b.length;d--;)a=["Cons",b[d],a];return a}},unzip:j,intersperse:l,intercalate:o,sort:function(a){if("Nil"===a[0])return a;"Cons"!==a[0]&&i();for(var e=[];"Cons"===a[0];)e.push(a[1]),a=a[2];e.sort(function(a,e){return a-e});for(var a=["Nil"],b=e.length;b--;)a=["Cons",e[b],a];return a}}}(),Data=function(){var b=function(){return{fromCode:function(a){return String.fromCharCode(a)},
13+toCode:function(a){return a.charCodeAt(0)},toUpper:function(a){return a.toUpperCase()},toLower:function(a){return a.toLowerCase()},toLocaleUpper:function(a){return a.toLocaleUpperCase()},toLocaleLower:function(a){return a.toLocaleLowerCase()}}}(),c=function(){function a(a){return function(b){return"Just"===a[0]?["Cons",a[1],b]:b}}function b(a){return function(){return function(b){var c=a(c);return"Just"===c[0]?["Cons",c[1],b]:b}}}return{catMaybes:List.foldr(a)(["Nil"]),isJust:function(a){return"Just"===
14+a[0]},isNothing:function(a){return"Nothing"===a[0]},fromMaybe:function(a){return function(b){return"Just"===b[0]?b[1]:a}},consMaybe:a,mapMaybe:function(a){return List.foldr(b(a))(["Nil"])}}}();return{String:{toText:Value.toText,properEscape:Value.properEscape},Char:b,Maybe:c,List:List}}(),Color=function(){var b=function(b,a,h,g){return{r:Math.round(255*b),g:Math.round(255*a),b:Math.round(255*h),a:g}};return{black:b(0,0,0,1),white:b(1,1,1,1),red:b(1,0,0,1),green:b(0,1,0,1),blue:b(0,0,1,1),rgba:function(c){return function(a){return function(h){return function(g){return b(c,
15+a,h,g)}}}},rgb:function(c){return function(a){return function(h){return b(c,a,h,1)}}},Internal:{extract:function(b){return 1===b.a?"rgb("+b.r+","+b.g+","+b.b+")":"rgba("+b.r+","+b.g+","+b.b+","+b.a+")"}}}}(),Element=function(){var b=function(a){a=document.createElement(a);a.id=Guid.guid();return a},c=function(a){var d=b("div");d.appendChild(a);return d},a=function(a){return function(d){return function(c){var f=b("div");f.isElmLeaf=!0;f.isElmText=!0;f.innerHTML=c;f.style.textAlign=d;0<a&&(f.style.width=
16+a+"px");return f}}},h=a(0)("left"),g=a(0)("justify"),f=a(0)("center"),j=a(0)("right"),l=function(a){return"DIV"===a.tagName?a:c(a)},o=function(a){a.style.styleFloat="left";a.style.cssFloat="left";return a},i=function(a){a.style.position="absolute";return a},k=function(a,d,c){for(var f=b("div"),i=c.length;i--;){var g=d(c[i]);f.appendChild(g)}f.elmFlowDirection=a;return f},m=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 k("Y",l,
17+c);if(1==b)return k("X",o,c);if(2==b)return k("Z",i,c)}},n=function(b){return function(d){if("A"===d.tagName)return n(b)(d.firstChild),d;if(d.hasOwnProperty("isElmText")){var c=a(b)(d.style.textAlign)(d.innerHTML);d.style.height=c.style.height}d.style.width=b+"px";return d}};return{text:h,image:function(a){var d=b("img");d.isElmLeaf=!0;d.onload=function(){""===d.style.width&&0<this.width&&(d.style.width=d.width=this.width+"px");""===d.style.height&&0<this.height&&(d.style.height=d.height=this.height+
18+"px");Dispatcher.adjust()};d.src=Data.String.toText(a);d.name=d.src;return d},fittedImage:function(a){return function(d){return function(c){var f=b("canvas");f.style.width=a+"px";f.style.height=d+"px";f.width=a;f.height=d;f.innerHTML="Your browser does not support the canvas element.";f.isElmLeaf=!0;var i=b("img");i.onload=function(){if(f.getContext){var b=f.getContext("2d"),c=0,g=0,h=this.width,k=this.height;a/d>this.width/this.height?(k=this.width*d/a,g=(this.height-k)/2):(h=this.height*a/d,c=(this.width-
19+h)/2);b.drawImage(i,c,g,h,k,0,0,f.width,f.height)}};i.src=Data.String.toText(c);return f}}},video:function(a){var a=Data.String.toText(a),d=b("video");d.controls="controls";var c=b("source");c.src=a;c.type="video/"+a.substring(a.length-3,a.length);d.appendChild(c);d.isElmLeaf=!0;return d},audio:function(a){var a=Data.String.toString(a),d=b("video");d.controls="controls";var c=b("source");c.src=a;c.type="audio/"+a.substring(a.length-3,a.length);d.appendChild(c);d.isElmLeaf=!0;return d},collage:function(a){return function(d){return function(c){var f=
20+b("canvas");f.style.width=a+"px";f.style.height=d+"px";f.width=a;f.height=d;if(f.getContext){var i=f.getContext("2d");for(i.clearRect(0,0,f.width,f.height);"Cons"===c[0];)i=c[1](i),c=c[2];return f}f.innerHTML="Your browser does not support the canvas element.";f.isElmLeaf=!0;return f}}},flow:m,layers:m(2),rectangle:function(a){return function(d){var c=b("div");c.isElmLeaf=!0;c.style.width=a+"px";c.style.height=d+"px";return c}},beside:function(a){return function(b){return m(4)(["Cons",a,["Cons",b,
21+["Nil"]]])}},above:function(a){return function(b){return m(3)(["Cons",a,["Cons",b,["Nil"]]])}},below:function(a){return function(b){return m(0)(["Cons",a,["Cons",b,["Nil"]]])}},box:function(a){return function(d){d.style.position="absolute";d.style.margin="auto";var c=(a-1)%3,f=(a-1)/3;2>c&&(d.style.left=0);0<c&&(d.style.right=0);2>f&&(d.style.top=0);0<f&&(d.style.bottom=0);c=b("div");c.style.position="relative";c.appendChild(d);return c}},width:n,height:function(a){return function(b){("A"===b.tagName?
22+b.firstChild:b).style.height=a+"px";return b}},size:function(a){return function(b){return function(c){var f="A"===c.tagName?c.firstChild:c;f.style.width=a+"px";f.style.height=b+"px";return c}}},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(a){return function(d){var f=b("a");f.href=Text.fromString(a);f.appendChild(d);return c(f)}},asText:function(b){return a(0)("left")(Value.show(b))},
23+plainText:function(b){return a(0)("left")(Data.String.toText(b))},justifiedText:g,centeredText:f,rightedText:j,up:0,left:1,inward:2,down:3,right:4,outward:5,correctTextSize:function(a){var c=a.style.width?a.style.width.slice(0,-2):0,f=b("div");f.innerHTML=a.innerHTML;f.style.textAlign=a.style.textAlign;0<c&&(f.style.width=c+"px");f.style.visibility="hidden";f.style.styleFloat="left";f.style.cssFloat="left";document.body.appendChild(f);var i=window.getComputedStyle(f);0>=c&&(a.style.width=i.getPropertyValue("width"));
24+a.style.height=i.getPropertyValue("height");document.body.removeChild(f)}}}(),Text=function(){var b=function(a){if("string"===typeof a)return a;for(var b=[];"Cons"===a[0];)b.push(a[1]),a=a[2];return Data.String.properEscape(b.join(""))},c=function(a){return function(b){return"<"+a+">"+b+"</"+a+">"}},a=function(a,b){return function(c){return"<span style='"+a+":"+b+"'>"+c+"</span>"}},h=c("h1"),g=a("font-style","italic"),c=c("b"),f=a("text-decoration","underline"),j=a("text-decoration","overline"),l=
25+a("text-decoration","line-through");return{fromString:b,toText:b,header:h,height:function(b){return a("font-size",b+"em")},italic:g,bold:c,underline:f,overline:j,strikeThrough:l,monospace:a("font-family","monospace"),color:function(b){return a("color",Color.Internal.extract(b))},link:function(a){return function(c){return"<a href='"+b(a)+"'>"+c+"</a>"}}}}(),Shape=function(){var b=function(a,b,c,f){return{center:a,points:b,theta:c,scale:f}},c=function(a){return function(b){return function(c){return function(f){f.save();
26+f.translate(c.center[0],c.center[1]);f.rotate(c.theta);f.scale(c.scale,c.scale);f.beginPath();var j=c.points;f.moveTo(j[0][0],j[0][1]);for(var l=j.length;l--;)f.lineTo(j[l][0],j[l][1]);f.closePath();a?(f.fillStyle=Color.Internal.extract(b),f.fill()):(f.strokeStyle=Color.Internal.extract(b),f.stroke());f.restore();return f}}}};return{polygon:function(a){return function(c){for(var g=[];"Cons"===a[0];)g.push([a[1][1],a[1][2]]),a=a[2];c=[c[1],c[2]];return b(c,g,0,1)}},ngon:function(a){return function(c){return function(g){for(var f=
27+[],j=a;j--;)f.push([c*Math.cos(2*Math.PI*j/a),c*Math.sin(2*Math.PI*j/a)]);g=[g[1],g[2]];return b(g,f,0,1)}}},rect:function(a){return function(c){return function(g){var f=[[-a/2,-c/2],[a/2,-c/2],[a/2,c/2],[-a/2,c/2]],g=[g[1],g[2]];return b(g,f,0,1)}}},oval:function(a){return function(c){return function(g){for(var f=[],j=2*Math.PI;0<j;j-=Math.PI/50)f.push([a/2*Math.cos(j),c/2*Math.sin(j)]);g=[g[1],g[2]];return b(g,f,0,1)}}},move:function(a){return function(c){return function(g){return b([a+g.center[0],
28+c+g.center[1]],g.points,g.theta,g.scale)}}},rotate:function(a){return function(c){return b(c.center,c.points,c.theta+2*Math.PI*a,c.scale)}},scale:function(a){return function(c){return b(c.center,c.points,c.theta,c.scale*a)}},filled:c(!0),outlined:c(!1),customOutline:function(a){return function(b){return function(c){c.points.push(c.points[0]);return Line.customLine(a)(b)(c)}}}}}(),Line=function(){var b=function(b){return function(a){return function(h){if("string"===typeof b[0]){for(var g=[];"Cons"===
29+b[0];)g.push(b[1]),b=b[2];b=g}0===b.length&&(b=[8,4]);return function(f){f.save();f.beginPath();f.translate(h.center[0],h.center[1]);f.rotate(h.theta);f.scale(h.scale,h.scale);var g=b,l=h.points,o=l.length-1,i=l[o][0],k=l[o][1],m=0,n=0,e=0,d=0,p=0,r=0,t=g.length,s=!0,q=g[0];for(f.moveTo(i,k);o--;){m=l[o][0];n=l[o][1];e=m-i;d=n-k;for(p=Math.sqrt(e*e+d*d);q<=p;)i+=e*q/p,k+=d*q/p,f[s?"lineTo":"moveTo"](i,k),e=m-i,d=n-k,p=Math.sqrt(e*e+d*d),s=!s,r=(r+1)%t,q=g[r];0<p&&(f[s?"lineTo":"moveTo"](m,n),q-=p);
30+i=m;k=n}f.strokeStyle=Color.Internal.extract(a);f.stroke();f.restore();return f}}}};return{line:function(b){for(var a=[];"Cons"===b[0];)a.push([b[1][1],b[1][2]]),b=b[2];return{center:[0,0],points:a,theta:0,scale:1}},customLine:b,solid:function(b){return function(a){return function(h){h.save();h.beginPath();h.translate(a.center[0],a.center[1]);h.rotate(a.theta);h.scale(a.scale,a.scale);var g=a.points,f=g.length;for(h.moveTo(g[f-1][0],g[f-1][1]);f--;)h.lineTo(g[f][0],g[f][1]);h.strokeStyle=Color.Internal.extract(b);
31+h.stroke();h.restore();return h}}},dashed:b([8,4]),dotted:b([3,3])}}(),Elm=function(){var b=function(a,b,c){for(var h=a.length;h--;)a[h].recv(b,c)},c=function(a){this.id=Guid.guid();this.value=a;this.kids=[];this.recv=function(a,c,g){if(c=c===this.id)this.value=g;b(this.kids,a,c)};Dispatcher.inputs.push(this)},a=function(a,c){this.id=Guid.guid();this.value=null;this.kids=[];this.inbox={};c.reverse();this.recalc=function(){for(var b=a,h=c.length;h--;)b=b(c[h].value);this.value=b};this.recalc();this.recv=
32+function(a,g){this.inbox.hasOwnProperty(a)||(this.inbox[a]={changed:!1,count:0});var i=this.inbox[a];i.count+=1;g&&(i.changed=!0);i.count==c.length&&(i.changed&&this.recalc(),b(this.kids,a,i.changed),delete this.inbox[a])};for(var h=c.length;h--;)c[h].kids.push(this)},h=function(a,c,h){this.id=Guid.guid();this.value=c;this.kids=[];this.recv=function(c,f){f&&(this.value=a(h.value)(this.value));b(this.kids,c,f)};h.kids.push(this)};return{Input:function(a){return new c(a)},Lift:function(b,c){return new a(b,
33+c)},Fold:function(a,b,c){return new h(a,b,c)}}}(),Dispatcher=function(){var b=null,c=0,a=[],h=function(a){var b=a.childNodes,c=b.length;if(a.hasOwnProperty("isElmLeaf")){a.hasOwnProperty("isElmText")&&Element.correctTextSize(a);var b=""===a.style.width?0:a.style.width.slice(0,-2)-0,g=""===a.style.height?0:a.style.height.slice(0,-2)-0;return[b,g]}if(1===c){var i=h(b[0]);""!==a.style.width&&(i[0]=a.style.width.slice(0,-2)-0);""!==a.style.height&&(i[1]=a.style.height.slice(0,-2)-0);0!==i[0]&&(a.style.width=
34+i[0]+"px");0!==i[1]&&(a.style.height=i[1]+"px");return i}for(var k=0,m=g=0,n=0,e=!0,d=!0;c--;)i=h(b[c]),k=Math.max(k,i[0]),g=Math.max(g,i[1]),m+=i[0],n+=i[1],e=e&&0<i[0],d=d&&0<i[1];b=k;c=a.elmFlowDirection;"X"===c&&(b=e?m:0);"Y"===c&&(g=d?n:0);0<b&&(a.style.width=b+"px");0<g&&(a.style.height=g+"px");return[b,g]},g=function(){var a=document.getElementById("content");h(a.children[0])};return{initialize:function(){var a=ElmCode.hasOwnProperty("main")?ElmCode.main:main;try{b=a()}catch(c){throw c;}b.hasOwnProperty("recv")||
35+(b=Elm.Input(b));document.getElementById("content").appendChild(b.value);g();a=document.getElementById("widthChecker").offsetWidth;a!==window.innerWidth&&Dispatcher.notify(Window.dimensions.id,Value.Tuple(a,window.innerHeight));b=Elm.Lift(function(a){var b=document.getElementById("content"),c=b.children[0];b.replaceChild(a,c);delete c;g();return a},[b])},notify:function(b,g){c+=1;for(var h=a.length;h--;)a[h].recv(c,b,g)},adjust:g,inputs:a}}(),Signal=function(){function b(a){for(var b=["Nil"],c=a.length;c--;)b=
36+["Cons",a[c],b];return b}var c=function(){return document.addEventListener?function(a,b,c){a.addEventListener(b,c,!1)}:function(a,b,c){a.attachEvent("on"+b,c)}}(),a=function(){function a(b){var c=0,f=0;b||(b=window.event);if(b.pageX||b.pageY)c=b.pageX,f=b.pageY;else if(b.clientX||b.clientY)c=b.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,f=b.clientY+document.body.scrollTop+document.documentElement.scrollTop;return Value.Tuple(c,f)}var b=Elm.Input(Value.Tuple(0,0)),f=Elm.Input(!1),
37+g=Elm.Input(!1);c(document,"click",function(){Dispatcher.notify(g.id,!0);Dispatcher.notify(g.id,!1)});c(document,"mousedown",function(){Dispatcher.notify(f.id,!0)});c(document,"mouseup",function(){Dispatcher.notify(f.id,!1)});c(document,"mousemove",function(c){Dispatcher.notify(b.id,a(c))});return{position:b,x:Elm.Lift(function(a){return a[1]},[b]),y:Elm.Lift(function(a){return a[2]},[b]),isClicked:g,isDown:f,clickedOn:function(a){var b=Elm.Input(!1);c(a,"click",function(){Dispatcher.notify(b.id,
38+!0);Dispatcher.notify(b.id,!1)});return Value.Tuple(a,b)}}}(),h=function(){return{every:function(a){var a=1E3*a,b=Elm.Input(0),c=0;setInterval(function(){c+=a;Dispatcher.notify(b.id,c/1E3)},a);return b},after:function(a){var a=1E3*a,b=Elm.Input(!1);setTimeout(function(){Dispatcher.notify(b.id,!0)},a);return b},before:function(a){var a=1E3*a,b=Elm.Input(!0);setTimeout(function(){Dispatcher.notify(b.id,!1)},a);return b}}}(),g=function(){var a=Elm.Input(Value.Tuple(window.innerWidth,window.innerHeight));
39+c(window,"resize",function(){var b=document.getElementById("widthChecker").offsetWidth;Dispatcher.notify(a.id,Value.Tuple(b,window.innerHeight))});return{dimensions:a,width:Elm.Lift(function(a){return a[1]},[a]),height:Elm.Lift(function(a){return a[2]},[a])}}(),f={Raw:function(){function a(b,c){return"Nil"===c[0]?c:c[1]===b?c[2]:["Cons",c[1],a(b,c[2])]}var b=Elm.Input(["Nil"]),f=Elm.Input(["Nothing"]);c(document,"keydown",function(a){var c;a:{for(c=b.value;"Nil"!==c[0];){if(c[1]===a.keyCode){c=!0;
40+break a}c=c[2]}c=!1}c||Dispatcher.notify(b.id,["Cons",a.keyCode,b.value])});c(document,"keyup",function(c){c=a(c.keyCode,b.value);Dispatcher.notify(b.id,c)});c(window,"blur",function(){Dispatcher.notify(b.id,["Nil"])});c(document,"keypress",function(a){Dispatcher.notify(f.id,["Just",a.charCode||a.keyCode]);Dispatcher.notify(f.id,["Nothing"])});return{keysDown:b,charPressed:f}}()},j=function(){var a=function(a){return function(c){var e=Elm.Input(["Waiting"]),d={};window.XMLHttpRequest?d=new XMLHttpRequest:
41+window.ActiveXObject&&(d=new ActiveXObject("Microsoft.XMLHTTP"));d.onreadystatechange=function(){4===d.readyState&&Dispatcher.notify(e.id,200===d.status?["Success",b(d.responseText)]:["Failure",d.status,b(d.statusText)])};d.open(a,Data.String.toText(c),!0);d.send(null);return e}},c=function(a){return function(c){var e=Elm.Input(["Nothing"]),c=Elm.Lift(function(c){if("Just"!==c[0]){try{Dispatcher.notify(e.id,["Nothing"])}catch(f){}return[]}try{Dispatcher.notify(e.id,["Just",["Waiting"]])}catch(g){e.value=
42+["Just",["Waiting"]]}var h={};window.XMLHttpRequest?h=new XMLHttpRequest:window.ActiveXObject&&(h=new ActiveXObject("Microsoft.XMLHTTP"));h.onreadystatechange=function(){4===h.readyState&&Dispatcher.notify(e.id,["Just",200===h.status?["Success",b(h.responseText)]:["Failure",h.status,b(h.statusText)]])};h.open(a,Data.String.toText(c[1]),!0);h.send(null);return[]},[c]);return Elm.Lift(function(a){return function(){return a}},[e,c])}};return{get:a("GET"),post:a("POST"),gets:c("GET"),posts:c("POST")}}(),
43+l=function(){return{inRange:function(a){return function(b){return Elm.Input(Math.floor(Math.random()*(b-a+1))+a)}},randomize:function(a){return function(b){return function(c){return Elm.Lift(function(){return Math.floor(Math.random()*(b-a+1))+a},[c])}}}}}(),o=function(){var a=function(a){a.isElmLeaf=!0;var e=Elm.Input(["Nil"]);c(a,"keyup",function(){Dispatcher.notify(e.id,b(a.value));a.focus()});return Value.Tuple(a,e)},f=function(a){a=document.createElement(a);a.id=Guid.guid();return a},g=function(a){for(var b=
44+f("select"),d=[];"Cons"===a[0];){var g=f("option"),h=Text.toText(a[1][1]);g.value=h;g.innerHTML=h;b.appendChild(g);d.push(a[1][2]);a=a[2]}var i=Elm.Input(d[0]);c(b,"change",function(){Dispatcher.notify(i.id,d[b.selectedIndex])});return Value.Tuple(b,i)};return{textArea:function(b){return function(c){var d=f("textarea");d.rows=c;d.cols=b;return a(d,"")}},textField:function(b){var c=f("input");c.type="text";return a(c,b)},password:function(b){var c=f("input");c.type="password";return a(c,b)},checkbox:function(a){var b=
45+f("input");b.type="checkbox";b.checked=a;var d=Elm.Input(a);c(b,"change",function(){Dispatcher.notify(d.id,b.checked)});return Value.Tuple(b,d)},dropDown:g,stringDropDown:function(a){return g(List.map(function(a){return Value.Tuple(a,a)})(a))},button:function(a){var b=f("input");b.type="button";b.value=Text.toText(a);var d=Elm.Input(!1);c(b,"click",function(){Dispatcher.notify(d.id,!0);Dispatcher.notify(d.id,!1)});return Value.Tuple(b,d)}}}();return{Mouse:a,Keyboard:f,Time:h,Window:g,HTTP:j,Random:l,
46+Input:o}}(),id=function(b){return b},not=function(b){return!b},sqrt=function(b){return Math.sqrt(b)},rem=function(b){return function(c){return b%c}},mod=function(b){return function(c){var a=b%c,a=0==b?0:0<c?0<=b?a:a+c:-mod(-b)(-c);return a==c?0:a}},abs=function(b){return Math.abs(b)},logBase=function(b){return function(c){return Math.log(c)/Math.log(b)}},min=function(b){return function(c){return Math.min(b,c)}},max=function(b){return function(c){return Math.max(b,c)}},clamp=function(b){return function(c){return function(a){return Math.min(c,
47+Math.max(b,a))}}},sin=Math.sin,cos=Math.cos,tan=Math.tan,asin=Math.asin,acos=Math.acos,atan=Math.atan,flip=function(b){return function(c){return function(a){return b(a)(c)}}},Just=function(b){return["Just",b]},Nothing=["Nothing"],eq=function(b,c){if("object"===typeof b){if(b===c)return!0;if(b.length!==c.length)return!1;for(var a=b.length;a--;)if(!eq(b[a],c[a]))return!1;return!0}return b===c};function constant(b){return Elm.Input(b)}function lift(b){return function(c){return Elm.Lift(b,[c])}}
48+function lift2(b){return function(c){return function(a){return Elm.Lift(b,[c,a])}}}function lift3(b){return function(c){return function(a){return function(h){return Elm.Lift(b,[c,a,h])}}}}function lift4(b){return function(c){return function(a){return function(h){return function(g){return Elm.Lift(b,[c,a,h,g])}}}}}function foldp(b){return function(c){return function(a){return Elm.Fold(b,c,a)}}}var includeGlobal=this;
49+(function(){var b=function(a){for(var b in a)if("Internal"!==b)try{includeGlobal[b]=a[b]}catch(c){"length"===b&&(includeGlobal.execScript("var length;"),length=a[b])}},c=function(a){return function(b){includeGlobal[a]=includeGlobal[a]||{};for(var c in b)"Internal"!==c&&(includeGlobal[a][c]=b[c])}};b(Element);b(Text);color=Element.color;height=Element.height;show=Value.show;c("Time")(Signal.Time);c("Mouse")(Signal.Mouse);c("Keyboard")(Signal.Keyboard);c("Window")(Signal.Window);c("HTTP")(Signal.HTTP);
50+c("Input")(Signal.Input);c("Random")(Signal.Random);b(Color);b(Shape);b(Line)})();var ElmCode={};ElmCode.Data=Data;ElmCode.Signal=Signal;ElmCode.Data.List=List;