on master help sign in
Add `fittedImage :: Int -> Int -> String -> Element` which displays an image fitted to a particular set of dimensions. If the desired aspect ratio is different than the original, the image will be cropped and centered as necessary to fill the desired dimensions.
4c9c06eevancz
core-js/Element.js+34
@@ -95,6 +95,39 @@ var Element = function() {
95 img.name = img.src;
95 img.name = img.src;
96 return img;
96 return img;
97 };
97 };
98+ var fittedImage = function(w) { return function(h) { return function(src) {
99+ var canvas = newElement('canvas');
100+ canvas.style.width = w + 'px';
101+ canvas.style.height = h + 'px';
102+ canvas.width = w;
103+ canvas.height = h;
104+ canvas.innerHTML = "Your browser does not support the canvas element.";
105+ canvas.isElmLeaf = true;
106+
107+ var img = newElement('img');
108+ img.onload = function() {
109+ if (canvas.getContext) {
110+ var ctx = canvas.getContext('2d');
111+ var sx = 0, sy = 0, sWidth = this.width, sHeight = this.height;
112+ if (w / h > this.width / this.height) {
113+ sHeight = this.width * h / w;
114+ sy = (this.height - sHeight) / 2
115+ } else {
116+ sWidth = this.height * w / h;
117+ sx = (this.width - sWidth) / 2
118+ }
119+ console.log(sWidth,sHeight);
120+ ctx.drawImage(img, sx, sy, sWidth, sHeight,
121+ 0,0, canvas.width, canvas.height);
122+ }
123+ };
124+ img.src = String.toText(src);
125+ img.name = img.src;
126+ return canvas;
127+ };
128+ };
129+ };
130+
98 var video = function(src) {
131 var video = function(src) {
99 src = String.toText(src);
132 src = String.toText(src);
100 var e = newElement('video');
133 var e = newElement('video');
@@ -238,6 +271,7 @@ var Element = function() {
238
271
239 return {text : text,
272 return {text : text,
240 image : image,
273 image : image,
274+ fittedImage : fittedImage,
241 video : video,
275 video : video,
242 audio : audio,
276 audio : audio,
243 collage : collage,
277 collage : collage,
elm-mini.js+44−43
@@ -1,45 +1,46 @@
1−var Guid=function(){var b=0;return{guid:function(){return b+=1}}}(),Value=function(){var b=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 c="",e=a.length;--e;)c=","+b(a[e])+c;","===c[0]&&(c=c.substring(1));return"("+c+")"}if("Cons"===a[0])for(var e="string"===typeof a[1]?'"':"]",d="string"===typeof a[1]?"":",",c=("string"===typeof a[1]?'"':"[")+b(a[1]),a=a[2];;)if("Cons"===a[0])c+=d+b(a[1]),a=a[2];else return c+e;
1+var Guid=function(){var c=0;return{guid:function(){return c+=1}}}(),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 b="",e=a.length;--e;)b=","+c(a[e])+b;","===b[0]&&(b=b.substring(1));return"("+b+")"}if("Cons"===a[0])for(var e="string"===typeof a[1]?'"':"]",d="string"===typeof a[1]?"":",",b=("string"===typeof a[1]?'"':"[")+c(a[1]),a=a[2];;)if("Cons"===a[0])b+=d+c(a[1]),a=a[2];else return b+e;
2−else{if("Nil"===a[0])return"[]";c="";for(e=a.length;--e;)c=" "+b(a[e])+c;c=a[0]+c;return 1<a.length?"("+c+")":c}}return a+""};return{show:function(a){return Text.monospace(String.properEscape(b(a)))},Tuple:function(){var a=arguments.length,c=Array(a+1);for(c[0]="Tuple"+arguments.length;a--;)c[a+1]=arguments[a];return c},append:function(a,c){if("string"===typeof a&&"string"===typeof c)return a.concat(c);if("Nil"===a[0])return c;for(var e=["Cons",a[1],["Nil"]],b=e,a=a[2];"Cons"===a[0];)b[2]=["Cons",
2+else{if("Nil"===a[0])return"[]";b="";for(e=a.length;--e;)b=" "+c(a[e])+b;b=a[0]+b;return 1<a.length?"("+b+")":b}}return a+""};return{show:function(a){return Text.monospace(String.properEscape(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);if("Nil"===a[0])return b;for(var c=["Cons",a[1],["Nil"]],d=c,a=a[2];"Cons"===a[0];)d[2]=["Cons",
3−a[1],["Nil"]],a=a[2],b=b[2];b[2]=c;return e}}}(),String=function(){return{toText:function(b){if("string"===typeof b)return b;for(var a=[];"Cons"===b[0];)a.push(b[1]),b=b[2];return String.properEscape(a.join(""))},properEscape:function(b){b.replace('"',"&#34;");b.replace("&","&#38;");b.replace("'","&#39;");b.replace("<","&#60;");b.replace(">","&#62;");return b}}}(),Color=function(){var b=function(a,c,b,d){return{r:Math.round(255*a),g:Math.round(255*c),b:Math.round(255*b),a:d}};return{black:b(0,0,0,
3+a[1],["Nil"]],a=a[2],d=d[2];d[2]=b;return c}}}(),String=function(){return{toText:function(c){if("string"===typeof c)return c;for(var a=[];"Cons"===c[0];)a.push(c[1]),c=c[2];return String.properEscape(a.join(""))},properEscape:function(c){c.replace('"',"&#34;");c.replace("&","&#38;");c.replace("'","&#39;");c.replace("<","&#60;");c.replace(">","&#62;");return c}}}(),Color=function(){var c=function(a,b,c,d){return{r:Math.round(255*a),g:Math.round(255*b),b:Math.round(255*c),a:d}};return{black:c(0,0,0,
4−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(a){return function(c){return function(e){return function(d){return b(a,c,e,d)}}}},rgb:function(a){return function(c){return function(e){return b(a,c,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 b=function(a){a=document.createElement(a);a.id=Guid.guid();return a},a=function(a){var c=b("div");c.appendChild(a);return c},
4+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(b){return function(e){return function(d){return c(a,b,e,d)}}}},rgb:function(a){return function(b){return function(e){return c(a,b,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 b=c("div");b.appendChild(a);return b},
5−c=function(a){return function(c){return function(e){var d=b("div");d.isElmText=!0;d.innerHTML=e;d.style.textAlign=c;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}}},
5+b=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}}},
6−e=c(0)("left"),d=c(0)("justify"),g=c(0)("center"),f=function(c){return"DIV"===c.tagName?c:a(c)},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,c,e){for(var d=b("div"),h=e.length;h--;){var g=c(e[h]);d.appendChild(g)}d.elmFlowDirection=a;return d},k=function(a){return function(c){for(var b=[];"Cons"===c[0];)b.push(c[1]),c=c[2];3<=a&&b.reverse();c=a%3;if(0==c)return i("Y",f,b);if(1==c)return i("X",j,b);if(2==
6+e=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==
7−c)return i("Z",h,b)}},l=function(a){return function(b){if("A"===b.tagName)return l(a)(b.firstChild),b;if(b.hasOwnProperty("isElmText")){var e=c(a)(b.style.textAlign)(b.innerHTML);b.style.height=e.style.height}b.style.width=a+"px";return b}};return{text:e,image:function(a){var c=b("img");c.isElmLeaf=!0;c.onload=function(){""===c.style.width&&0<this.width&&(c.style.width=c.width=this.width+"px");""===c.style.height&&0<this.height&&(c.style.height=c.height=this.height+"px");Dispatcher.adjust()};c.src=
7+b)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);c.name=c.src;return c},video:function(a){var a=String.toText(a),c=b("video");c.controls="controls";var e=b("source");e.src=a;e.type="video/"+a.substring(a.length-3,a.length);c.appendChild(e);c.isElmLeaf=!0;return c},audio:function(a){var a=String.toString(a),c=b("video");c.controls="controls";var e=b("source");e.src=a;e.type="audio/"+a.substring(a.length-3,a.length);c.appendChild(e);c.isElmLeaf=!0;return c},collage:function(a){return function(c){return function(e){var d=b("canvas");
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−d.style.width=a+"px";d.style.height=c+"px";d.width=a;d.height=c;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(c){return k(1)(["Cons",a,["Cons",c,["Nil"]]])}},above:function(a){return function(c){return k(0)(["Cons",a,["Cons",c,["Nil"]]])}},below:function(a){return function(c){return k(3)(["Cons",
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=
10−a,["Cons",c,["Nil"]]])}},box:function(a){return function(c){c.style.position="absolute";c.style.margin="auto";var e=(a-1)%3,d=(a-1)/3;2>e&&(c.style.left=0);0<e&&(c.style.right=0);2>d&&(c.style.top=0);0<d&&(c.style.bottom=0);e=b("div");e.style.position="relative";e.appendChild(c);return e}},width:l,height:function(a){return function(c){("A"===c.tagName?c.firstChild:c).style.height=a+"px";return c}},size:function(a){return function(c){return function(e){var b="A"===e.tagName?e.firstChild:e;b.style.width=
10+c("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",
11−a+"px";b.style.height=c+"px";return e}}},color:function(a){return function(c){c.style.backgroundColor=Color.Internal.extract(a);return c}},opacity:function(a){return function(c){c.style.opacity=a;return c}},link:function(c){return function(e){var d=b("a");d.href=Text.fromString(c);d.appendChild(e);return a(d)}},asText:function(a){return c(0)("left")(Value.show(a))},plainText:function(a){return c(0)("left")(String.toText(a))},justifiedText:d,centeredText:g,up:0,left:1,inward:2,down:3,right:4,outward:5}}(),
11+a,["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=
12−Text=function(){var b=function(a){if("string"===typeof a)return a;for(var c=[];"Cons"===a[0];)c.push(a[1]),a=a[2];return String.properEscape(c.join(""))},a=function(a){return function(c){return"<"+a+">"+c+"</"+a+">"}},c=function(a,c){return function(e){return"<span style='"+a+":"+c+"'>"+e+"</span>"}},e=a("h1"),d=c("font-style","italic"),a=a("b"),g=c("text-decoration","underline"),f=c("text-decoration","overline"),j=c("text-decoration","line-through");return{fromString:b,toText:b,header:e,height:function(a){return c("font-size",
12+a+"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}}(),
13−a+"em")},italic:d,bold:a,underline:g,overline:f,strikeThrough:j,monospace:c("font-family","monospace"),color:function(a){return c("color",Color.Internal.extract(a))},link:function(a){return function(c){return"<a href='"+b(a)+"'>"+c+"</a>"}}}}(),Shape=function(){var b=function(a,e,b,g){return{center:a,points:e,theta:b,scale:g}},a=function(a){return function(e){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();
13+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 String.properEscape(b.join(""))},a=function(a){return function(b){return"<"+a+">"+b+"</"+a+">"}},b=function(a,b){return function(e){return"<span style='"+a+":"+b+"'>"+e+"</span>"}},e=a("h1"),d=b("font-style","italic"),a=a("b"),g=b("text-decoration","underline"),f=b("text-decoration","overline"),j=b("text-decoration","line-through");return{fromString:c,toText:c,header:e,height:function(a){return b("font-size",
14−var f=b.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 b(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*
14+a+"em")},italic:d,bold:a,underline:g,overline:f,strikeThrough:j,monospace:b("font-family","monospace"),color:function(a){return b("color",Color.Internal.extract(a))},link:function(a){return function(b){return"<a href='"+c(a)+"'>"+b+"</a>"}}}}(),Shape=function(){var c=function(a,e,d,c){return{center:a,points:e,theta:d,scale:c}},a=function(a){return function(e){return function(c){return function(g){g.save();g.translate(c.center[0],c.center[1]);g.rotate(c.theta);g.scale(c.scale,c.scale);g.beginPath();
15−f/a)]);d=[d[1],d[2]];return b(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 b(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 b(d,g,0,1)}}},move:function(a){return function(e){return function(d){return b([a+d.center[0],e+d.center[1]],d.points,d.theta,d.scale)}}},rotate:function(a){return function(e){return b(e.center,
15+var 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*
16−e.points,e.theta+2*Math.PI*a,e.scale)}},scale:function(a){return function(e){return b(e.center,e.points,e.theta,e.scale*a)}},filled:a(!0),outlined:a(!1),customOutline:function(a){return function(e){return function(b){b.points.push(b.points[0]);return Line.customLine(a)(e)(b)}}}}}(),Line=function(){var b=function(a){return function(c){return function(b){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(b.center[0],
16+f/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,
17−b.center[1]);d.rotate(b.theta);d.scale(b.scale,b.scale);var f=a,j=b.points,h=j.length-1,i=j[h][0],k=j[h][1],l=0,p=0,m=0,n=0,o=0,r=0,t=f.length,s=!0,q=f[0];for(d.moveTo(i,k);h--;){l=j[h][0];p=j[h][1];m=l-i;n=p-k;for(o=Math.sqrt(m*m+n*n);q<=o;)i+=m*q/o,k+=n*q/o,d[s?"lineTo":"moveTo"](i,k),m=l-i,n=p-k,o=Math.sqrt(m*m+n*n),s=!s,r=(r+1)%t,q=f[r];0<o&&(d[s?"lineTo":"moveTo"](l,p),q-=o);i=l;k=p}d.strokeStyle=Color.Internal.extract(c);d.stroke();d.restore();return d}}}};return{line:function(a){for(var c=
17+e.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−[];"Cons"===a[0];)c.push([a[1][1],a[1][2]]),a=a[2];return{center:[0,0],points:c,theta:0,scale:1}},customLine:b,solid:function(a){return function(c){return function(b){b.save();b.beginPath();b.translate(c.center[0],c.center[1]);b.rotate(c.theta);b.scale(c.scale,c.scale);var d=c.points,g=d.length;for(b.moveTo(d[g-1][0],d[g-1][1]);g--;)b.lineTo(d[g][0],d[g][1]);b.strokeStyle=Color.Internal.extract(a);b.stroke();b.restore();return b}}},dashed:b([8,4]),dotted:b([3,3])}}(),Elm=function(){var b=function(a){this.id=
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=
19−Guid.guid();this.value=a;this.step=function(a,c){var b=a===this.id;b&&(this.value=c);return b}},a=function(a,c){this.id=Guid.guid();this.value=null;c.reverse();this.recalc=function(){for(var b=a,f=c.length;f--;)b=b(c[f].value);this.value=b};this.recalc();this.step=function(a,b){if(this.hasOwnProperty(a))return!1;for(var e=!1,h=c.length;h--;)e=c[h].step(a,b)||e;e?this.recalc():this[a]=!0;return e}},c=function(a,c,b){this.id=Guid.guid();this.value=c;this.step=function(c,d){if(this.hasOwnProperty(c))return!1;
19+[];"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=
20−var h=b.step(c,d);h?this.value=a(b.value)(this.value):this[c]=!0;return h}};return{Input:function(a){return new b(a)},Lift:function(c,b){return new a(c,b)},Fold:function(a,b,g){return new c(a,b,g)}}}(),Dispatcher=function(){var b=null,a=function(c){var b=c.childNodes,d=b.length;if(c.hasOwnProperty("isElmLeaf")){var b=""===c.style.width?0:c.style.width.slice(0,-2)-0,g=""===c.style.height?0:c.style.height.slice(0,-2)-0;return[b,g]}if(1===d){var f=a(b[0]);""!==c.style.width&&(f[0]=c.style.width.slice(0,
20+Guid.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;
21−-2)-0);""!==c.style.height&&(f[1]=c.style.height.slice(0,-2)-0);0!==f[0]&&(c.style.width=f[0]+"px");0!==f[1]&&(c.style.height=f[1]+"px");return f}for(var j=0,h=g=0,i=0,k=!0,l=!0;d--;)f=a(b[d]),j=Math.max(j,f[0]),g=Math.max(g,f[1]),h+=f[0],i+=f[1],k=k&&0<f[0],l=l&&0<f[1];b=j;d=c.elmFlowDirection;"X"===d&&(b=k?h:0);"Y"===d&&(g=l?i:0);0<b&&(c.style.width=b+"px");0<g&&(c.style.height=g+"px");return[b,g]};return{initialize:function(){try{b=main()}catch(c){throw document.body.innerHTML="An Error Occured: Better Messages to come.",
21+var 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,
22−c;}b.hasOwnProperty("step")||(b=Elm.Input(b));var e=document.getElementById("content");e.appendChild(b.value);a(e);e=document.getElementById("widthChecker").offsetWidth;e!==window.innerWidth&&Dispatcher.notify(Window.dimensions.id,Value.Tuple(e,window.innerHeight))},notify:function(c,e){if(b.step(c,e)){var d=document.getElementById("content");d.replaceChild(b.value,d.children[0]);a(d)}},adjust:function(){var c=document.getElementById("content");a(c)}}}(),Signal=function(){function b(a){for(var c=
22+-2)-0);""!==b.style.height&&(f[1]=b.style.height.slice(0,-2)-0);0!==f[0]&&(b.style.width=f[0]+"px");0!==f[1]&&(b.style.height=f[1]+"px");return f}for(var j=0,h=g=0,i=0,k=!0,l=!0;d--;)f=a(c[d]),j=Math.max(j,f[0]),g=Math.max(g,f[1]),h+=f[0],i+=f[1],k=k&&0<f[0],l=l&&0<f[1];c=j;d=b.elmFlowDirection;"X"===d&&(c=k?h:0);"Y"===d&&(g=l?i:0);0<c&&(b.style.width=c+"px");0<g&&(b.style.height=g+"px");return[c,g]};return{initialize:function(){try{c=main()}catch(b){throw document.body.innerHTML="An Error Occured: Better Messages to come.",
23−["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)}}(),c=function(){function c(a){var b=0,e=0;a||(a=window.event);if(a.pageX||a.pageY)b=a.pageX,e=a.pageY;else if(a.clientX||a.clientY)b=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,e=a.clientY+document.body.scrollTop+document.documentElement.scrollTop;return Value.Tuple(b,e)}var b=Elm.Input(Value.Tuple(0,
23+b;}c.hasOwnProperty("step")||(c=Elm.Input(c));var e=document.getElementById("content");e.appendChild(c.value);a(e);e=document.getElementById("widthChecker").offsetWidth;e!==window.innerWidth&&Dispatcher.notify(Window.dimensions.id,Value.Tuple(e,window.innerHeight))},notify:function(b,e){if(c.step(b,e)){var d=document.getElementById("content");d.replaceChild(c.value,d.children[0]);a(d)}},adjust:function(){var b=document.getElementById("content");a(b)}}}(),Signal=function(){function c(a){for(var b=
24−0)),e=Elm.Input(!1),d=Elm.Input(!1);a(document,"click",function(){Dispatcher.notify(d.id,!0);Dispatcher.notify(d.id,!1)});a(document,"mousedown",function(){Dispatcher.notify(e.id,!0)});a(document,"mouseup",function(){Dispatcher.notify(e.id,!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:d,isDown:e,clickedOn:function(c){var b=Elm.Input(!1);a(c,"click",function(){Dispatcher.notify(b.id,
24+["Nil"],c=a.length;c--;)b=["Cons",a[c],b];return b}var a=function(){return document.addEventListener?function(a,b,c){a.addEventListener(b,c,!1)}:function(a,b,c){a.attachEvent("on"+b,c)}}(),b=function(){function b(a){var c=0,d=0;a||(a=window.event);if(a.pageX||a.pageY)c=a.pageX,d=a.pageY;else if(a.clientX||a.clientY)c=a.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,d=a.clientY+document.body.scrollTop+document.documentElement.scrollTop;return Value.Tuple(c,d)}var c=Elm.Input(Value.Tuple(0,
25−!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=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}}}(),d=function(){var b=Elm.Input(Value.Tuple(window.innerWidth,window.innerHeight));
25+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,!1)});a(document,"mousemove",function(a){Dispatcher.notify(c.id,b(a))});return{position:c,x:Elm.Lift(function(a){return a[1]},[c]),y:Elm.Lift(function(a){return a[2]},[c]),isClicked:e,isDown:d,clickedOn:function(b){var c=Elm.Input(!1);a(b,"click",function(){Dispatcher.notify(c.id,
26−a(window,"resize",function(){var a=document.getElementById("widthChecker").offsetWidth;Dispatcher.notify(b.id,Value.Tuple(a,window.innerHeight))});return{dimensions:b,width:Elm.Lift(function(a){return a[1]},[b]),height:Elm.Lift(function(a){return a[2]},[b])}}(),g=function(){var a=function(a){return function(c){var e=Elm.Input(["Waiting"]),d={};window.XMLHttpRequest?d=new XMLHttpRequest:window.ActiveXObject&&(d=new ActiveXObject("Microsoft.XMLHTTP"));d.onreadystatechange=function(){4===d.readyState&&
26+!0);Dispatcher.notify(c.id,!1)});return Value.Tuple(b,c)}}}(),e=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}}}(),d=function(){var b=Elm.Input(Value.Tuple(window.innerWidth,window.innerHeight));
27−Dispatcher.notify(e.id,200===d.status?["Success",b(d.responseText)]:["Failure",d.status,b(d.statusText)])};d.open(a,String.toText(c),!0);d.send(null);return e}},c=function(a){return function(c){var d=Elm.Input(["Nothing"]),c=Elm.Lift(function(c){if("Just"!==c[0]){try{Dispatcher.notify(d.id,["Nothing"])}catch(e){}return[]}try{Dispatcher.notify(d.id,["Just",["Waiting"]])}catch(g){d.value=["Just",["Waiting"]]}var f={};window.XMLHttpRequest?f=new XMLHttpRequest:window.ActiveXObject&&(f=new ActiveXObject("Microsoft.XMLHTTP"));
27+a(window,"resize",function(){var a=document.getElementById("widthChecker").offsetWidth;Dispatcher.notify(b.id,Value.Tuple(a,window.innerHeight))});return{dimensions:b,width:Elm.Lift(function(a){return a[1]},[b]),height:Elm.Lift(function(a){return a[2]},[b])}}(),g=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&&
28−f.onreadystatechange=function(){4===f.readyState&&Dispatcher.notify(d.id,["Just",200===f.status?["Success",b(f.responseText)]:["Failure",f.status,b(f.statusText)]])};f.open(a,String.toText(c[1]),!0);f.send(null);return[]},[c]);return Elm.Lift(function(a){return function(){return a}},[d,c])}};return{get:a("GET"),post:a("POST"),gets:c("GET"),posts:c("POST")}}(),f=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()*
28+Dispatcher.notify(d.id,200===e.status?["Success",c(e.responseText)]:["Failure",e.status,c(e.statusText)])};e.open(a,String.toText(b),!0);e.send(null);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 f={};window.XMLHttpRequest?f=new XMLHttpRequest:window.ActiveXObject&&(f=new ActiveXObject("Microsoft.XMLHTTP"));
29−(c-a+1))+a},[b])}}}}}(),j=function(){var c=function(c){c.isElmLeaf=!0;var d=Elm.Input(["Nil"]);a(c,"keyup",function(){Dispatcher.notify(d.id,b(c.value));c.focus()});return Value.Tuple(c,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 f=d("option"),g=Text.toText(c[1][1]);f.value=g;f.innerHTML=g;b.appendChild(f);e.push(c[1][2]);c=c[2]}var h=Elm.Input(e[0]);a(b,"change",function(){Dispatcher.notify(h.id,e[b.selectedIndex])});
29+f.onreadystatechange=function(){4===f.readyState&&Dispatcher.notify(d.id,["Just",200===f.status?["Success",c(f.responseText)]:["Failure",f.status,c(f.statusText)]])};f.open(a,String.toText(b[1]),!0);f.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")}}(),f=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()*
30−return Value.Tuple(b,h)};return{textArea:function(a){return function(b){var e=d("textarea");e.rows=b;e.cols=a;return c(e,"")}},textField:function(a){var b=d("input");b.type="text";return c(b,a)},password:function(a){var b=d("input");b.type="password";return c(b,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,
30+(b-a+1))+a},[c])}}}}}(),j=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(b){for(var c=d("select"),e=[];"Cons"===b[0];){var f=d("option"),g=Text.toText(b[1][1]);f.value=g;f.innerHTML=g;c.appendChild(f);e.push(b[1][2]);b=b[2]}var h=Elm.Input(e[0]);a(c,"change",function(){Dispatcher.notify(h.id,e[c.selectedIndex])});
31−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:c,Time:e,Window:d,HTTP:g,Random:f,Input:j}}(),List=function(){function b(a){return function(b){if("Nil"===b[0])return b;"Cons"!==b[0]&&i();for(var c=["Cons",a(b[1]),["Nil"]],d=c,b=b[2];"Cons"===b[0];)d[2]=["Cons",a(b[1]),["Nil"]],b=b[2],d=d[2];return c}}function a(a){return function(b){return function(c){var d=
31+return Value.Tuple(c,h)};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(b){var c=d("input");c.type="checkbox";c.checked=b;var e=Elm.Input(b);a(c,"change",function(){Dispatcher.notify(e.id,c.checked)});return Value.Tuple(c,e)},dropDown:e,stringDropDown:function(a){return e(List.map(function(a){return Value.Tuple(a,
32−b;if("Nil"===c[0])return d;for("Cons"!==c[0]&&i();"Cons"===c[0];)d=a(c[1])(d),c=c[2];return d}}}function c(a){return function(b){return function(c){var d=b;if("Nil"===c[0])return d;"Cons"!==c[0]&&i();for(var e=[];"Cons"===c[0];)e.push(c[1]),c=c[2];for(c=e.length;c--;)d=a(e[c])(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 d(a){return function(c){return function(b){if("Nil"===b[0])return["Cons",c,["Nil"]];"Cons"!==b[0]&&
32+a)})(a))},button:function(b){var c=d("input");c.type="button";c.value=Text.toText(b);var e=Elm.Input(!1);a(c,"click",function(){Dispatcher.notify(e.id,!0);Dispatcher.notify(e.id,!1)});return Value.Tuple(c,e)}}}();return{Mouse:b,Time:e,Window:d,HTTP:g,Random:f,Input:j}}(),List=function(){function c(a){return function(b){if("Nil"===b[0])return b;"Cons"!==b[0]&&i();for(var c=["Cons",a(b[1]),["Nil"]],d=c,b=b[2];"Cons"===b[0];)d[2]=["Cons",a(b[1]),["Nil"]],b=b[2],d=d[2];return c}}function a(a){return function(b){return function(c){var d=
33−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 f(a){return function(){for(var b=
33+b;if("Nil"===c[0])return d;for("Cons"!==c[0]&&i();"Cons"===c[0];)d=a(c[1])(d),c=c[2];return d}}}function b(a){return function(b){return function(c){var d=b;if("Nil"===c[0])return d;"Cons"!==c[0]&&i();for(var e=[];"Cons"===c[0];)e.push(c[1]),c=c[2];for(c=e.length;c--;)d=a(e[c])(d);return d}}}function e(b){return function(c){var d;"Cons"!==c[0]?d=void 0:(d=c[1],c=c[2],d=a(b)(d)(c));return d}}function d(a){return function(b){return function(c){if("Nil"===c[0])return["Cons",b,["Nil"]];"Cons"!==c[0]&&
34+i();for(var d=[b];"Cons"===c[0];)b=a(c[1])(b),d.push(b),c=c[2];for(var c=["Nil"],e=d.length;e--;)c=["Cons",d[e],c];return c}}}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 f(a){return function(){for(var b=
34[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=
35[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=
35a[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=
36a[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=
36−b[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=c(function(a){return function(b){return Value.append(a,b)}})(["Nil"]),p=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*
37+b[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*
37−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:b,foldl:a,foldr:c,foldl1:e,foldr1:function(a){return function(b){var d;"Cons"!==b[0]?d=void 0:(d=b[1],b=b[2],d=c(a)(d)(b));return d}},
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−scanl: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(c){return l(b(a)(c))}},and:p,
39+scanl: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,
39−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"===
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−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: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(b){return b},not=function(b){return!b},
41+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: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},
41−sqrt=function(b){return Math.sqrt(b)},rem=function(b){return function(a){return b%a}},mod=function(b){return function(a){var c=b%a,c=0==b?0:0<a?0<=b?c:c+a:-mod(-b)(-a);return c==a?0:c}},abs=function(b){return Math.abs(b)},logBase=function(b){return function(a){return Math.log(a)/Math.log(b)}},min=function(b){return function(a){return Math.min(b,a)}},max=function(b){return function(a){return Math.max(b,a)}},clamp=function(b){return function(a){return function(c){return Math.min(a,Math.max(b,c))}}},
42+sqrt=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))}}},
42−sin=Math.sin,cos=Math.cos,tan=Math.tan,asin=Math.asin,acos=Math.acos,atan=Math.atan,flip=function(b){return function(a){return function(c){return b(c)(a)}}},Just=function(b){return["Just",b]},Nothing=["Nothing"];function constant(b){return Elm.Input(b)}function lift(b){return function(a){return Elm.Lift(b,[a])}}function lift2(b){return function(a){return function(c){return Elm.Lift(b,[a,c])}}}
43+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(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])}}}
43−function lift3(b){return function(a){return function(c){return function(e){return Elm.Lift(b,[a,c,e])}}}}function lift4(b){return function(a){return function(c){return function(e){return function(d){return Elm.Lift(b,[a,c,e,d])}}}}}function foldp(b){return function(a){return function(c){return Elm.Fold(b,a,c)}}}var includeGlobal=this;
44+function lift3(c){return function(a){return function(b){return function(e){return Elm.Lift(c,[a,b,e])}}}}function lift4(c){return function(a){return function(b){return function(e){return function(d){return Elm.Lift(c,[a,b,e,d])}}}}}function foldp(c){return function(a){return function(b){return Elm.Fold(c,a,b)}}}var includeGlobal=this;
44−(function(){var b=function(a){for(var b in a)if("Internal"!==b)try{includeGlobal[b]=a[b]}catch(d){"length"===b&&(includeGlobal.execScript("var length;"),length=a[b])}},a=function(a){return function(b){includeGlobal[a]=includeGlobal[a]||{};for(var d in b)"Internal"!==d&&(includeGlobal[a][d]=b[d])}};b(Element);b(Text);color=Element.color;height=Element.height;show=Value.show;a("Time")(Signal.Time);a("Mouse")(Signal.Mouse);a("Window")(Signal.Window);a("HTTP")(Signal.HTTP);a("Input")(Signal.Input);a("Random")(Signal.Random);
45+(function(){var c=function(a){for(var c in a)if("Internal"!==c)try{includeGlobal[c]=a[c]}catch(d){"length"===c&&(includeGlobal.execScript("var length;"),length=a[c])}},a=function(a){return function(c){includeGlobal[a]=includeGlobal[a]||{};for(var d in c)"Internal"!==d&&(includeGlobal[a][d]=c[d])}};c(Element);c(Text);color=Element.color;height=Element.height;show=Value.show;a("Time")(Signal.Time);a("Mouse")(Signal.Mouse);a("Window")(Signal.Window);a("HTTP")(Signal.HTTP);a("Input")(Signal.Input);a("Random")(Signal.Random);
45−b(Color);b(Shape);b(Line)})();
46+c(Color);c(Shape);c(Line)})();