cafe
Version:
Rails' view helpers and core extensions ported to Coffeescript
1 lines • 46.8 kB
JavaScript
var require=function(d,e){var a=require.resolve(d,e||"/");var c=require.modules[a];if(!c){throw new Error("Failed to resolve module "+d+", tried "+a)}var b=c._cached?c._cached:c();return b};require.paths=[];require.modules={};require.extensions=[".js",".coffee"];require._core={assert:true,events:true,fs:true,path:true,vm:true};require.resolve=(function(){return function(h,g){if(!g){g="/"}if(require._core[h]){return h}var j=require.modules.path();g=j.resolve("/",g);var f=g||"/";if(h.match(/^(?:\.\.?\/|\/)/)){var c=i(j.resolve(f,h))||a(j.resolve(f,h));if(c){return c}}var b=d(h,f);if(b){return b}throw new Error("Cannot find module '"+h+"'");function i(l){if(require.modules[l]){return l}for(var m=0;m<require.extensions.length;m++){var n=require.extensions[m];if(require.modules[l+n]){return l+n}}}function a(o){o=o.replace(/\/+$/,"");var q=o+"/package.json";if(require.modules[q]){var p=require.modules[q]();var n=p.browserify;if(typeof n==="object"&&n.main){var l=i(j.resolve(o,n.main));if(l){return l}}else{if(typeof n==="string"){var l=i(j.resolve(o,n));if(l){return l}}else{if(p.main){var l=i(j.resolve(o,p.main));if(l){return l}}}}}return i(o+"/index")}function d(o,t){var r=e(t);for(var q=0;q<r.length;q++){var p=r[q];var l=i(p+"/"+o);if(l){return l}var s=a(p+"/"+o);if(s){return s}}var l=i(o);if(l){return l}}function e(p){var o;if(p==="/"){o=[""]}else{o=j.normalize(p).split("/")}var n=[];for(var m=o.length-1;m>=0;m--){if(o[m]==="node_modules"){continue}var l=o.slice(0,m+1).join("/")+"/node_modules";n.push(l)}return n}}})();require.alias=function(g,h){var m=require.modules.path();var d=null;try{d=require.resolve(g+"/package.json","/")}catch(a){d=require.resolve(g,"/")}var e=m.dirname(d);var l=(Object.keys||function(n){var i=[];for(var f in n){i.push(f)}return i})(require.modules);for(var b=0;b<l.length;b++){var j=l[b];if(j.slice(0,e.length+1)===e+"/"){var c=j.slice(e.length);require.modules[h+c]=require.modules[e+c]}else{if(j===e){require.modules[h]=require.modules[e]}}}};require.define=function(b,d){var e=require._core[b]?"":require.modules.path().dirname(b);var c=function(f){return require(f,e)};c.resolve=function(f){return require.resolve(f,e)};c.modules=require.modules;c.define=require.define;var a={exports:{}};require.modules[b]=function(){require.modules[b]._cached=a.exports;d.call(a.exports,c,a,a.exports,e,b);require.modules[b]._cached=a.exports;return a.exports}};if(typeof process==="undefined"){process={}}if(!process.nextTick){process.nextTick=(function(){var a=[];var b=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(b){window.addEventListener("message",function(d){if(d.source===window&&d.data==="browserify-tick"){d.stopPropagation();if(a.length>0){var c=a.shift();c()}}},true)}return function(c){if(b){a.push(c);window.postMessage("browserify-tick","*")}else{setTimeout(c,0)}}})()}if(!process.title){process.title="browser"}if(!process.binding){process.binding=function(a){if(a==="evals"){return require("vm")}else{throw new Error("No such module")}}}if(!process.cwd){process.cwd=function(){return"."}}if(!process.env){process.env={}}if(!process.argv){process.argv=[]}require.define("path",function(b,c,a,h,g){function f(j,n){var m=[];for(var l=0;l<j.length;l++){if(n(j[l],l,j)){m.push(j[l])}}return m}function e(o,l){var j=0;for(var m=o.length;m>=0;m--){var n=o[m];if(n=="."){o.splice(m,1)}else{if(n===".."){o.splice(m,1);j++}else{if(j){o.splice(m,1);j--}}}}if(l){for(;j--;j){o.unshift("..")}}return o}var d=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;a.resolve=function(){var m="",j=false;for(var l=arguments.length;l>=-1&&!j;l--){var n=(l>=0)?arguments[l]:process.cwd();if(typeof n!=="string"||!n){continue}m=n+"/"+m;j=n.charAt(0)==="/"}m=e(f(m.split("/"),function(i){return !!i}),!j).join("/");return((j?"/":"")+m)||"."};a.normalize=function(l){var j=l.charAt(0)==="/",i=l.slice(-1)==="/";l=e(f(l.split("/"),function(m){return !!m}),!j).join("/");if(!l&&!j){l="."}if(l&&i){l+="/"}return(j?"/":"")+l};a.join=function(){var i=Array.prototype.slice.call(arguments,0);return a.normalize(f(i,function(l,j){return l&&typeof l==="string"}).join("/"))};a.dirname=function(l){var j=d.exec(l)[1]||"";var i=false;if(!j){return"."}else{if(j.length===1||(i&&j.length<=3&&j.charAt(1)===":")){return j}else{return j.substring(0,j.length-1)}}};a.basename=function(l,i){var j=d.exec(l)[2]||"";if(i&&j.substr(-1*i.length)===i){j=j.substr(0,j.length-i.length)}return j};a.extname=function(i){return d.exec(i)[3]||""}});require.define("/node_modules/date-helper/package.json",function(b,c,a,e,d){c.exports={main:"./date_helper.js"}});require.define("/node_modules/date-helper/date_helper.js",function(b,c,a,e,d){(function(){var i,f,h,g;f=b("./datetime_selector");g=b("tag-helper");h=b("instance-tag");i=(function(){function j(){}j.prototype.date_select=function(m,p,n,o){var l;if(n==null){n={}}if(o==null){o={}}delete n.object;l=new h(m,p,this,n);return l.to_date_select_tag(n,o)};j.prototype.time_select=function(l,o,m,n){if(m==null){m={}}if(n==null){n={}}delete m.object;return(new h(l,o,this,m)).to_time_select_tag(m,n)};j.prototype.datetime_select=function(l,o,m,n){if(m==null){m={}}if(n==null){n={}}delete m.object;return(new h(l,o,this,m)).to_datetime_select_tag(m,n)};j.prototype.select_datetime=function(n,l,m){if(l==null){l={}}if(m==null){m={}}if((arguments.length===0)&&((n===null)||(n===void 0))){n=new Date()}return(new f(n,l,m)).select_datetime()};j.prototype.select_date=function(m,l,n){if(l==null){l={}}if(n==null){n={}}if((arguments.length===0)&&((m===null)||(m===void 0))){m=new Date()}return(new f(m,l,n)).select_date()};j.prototype.select_time=function(n,l,m){if(n==null){n=Time.current}if(l==null){l={}}if(m==null){m={}}return(new f(n,l,m)).select_time()};j.prototype.select_second=function(n,l,m){if(l==null){l={}}if(m==null){m={}}return(new f(n,l,m)).select_second()};j.prototype.select_minute=function(n,l,m){if(l==null){l={}}if(m==null){m={}}return(new f(n,l,m)).select_minute()};j.prototype.select_hour=function(n,l,m){if(l==null){l={}}if(m==null){m={}}return(new f(n,l,m)).select_hour()};j.prototype.select_day=function(m,l,n){if(l==null){l={}}if(n==null){n={}}return(new f(m,l,n)).select_day()};j.prototype.select_month=function(m,l,n){if(l==null){l={}}if(n==null){n={}}return(new f(m,l,n)).select_month()};j.prototype.select_year=function(m,l,n){if(l==null){l={}}if(n==null){n={}}return(new f(m,l,n)).select_year()};return j})();h.prototype.to_date_select_tag=function(j,l){if(j==null){j={}}if(l==null){l={}}return this.datetime_selector(j,l).select_date().html_safe().valueOf()};h.prototype.to_time_select_tag=function(j,l){if(j==null){j={}}if(l==null){l={}}return this.datetime_selector(j,l).select_time().html_safe().valueOf()};h.prototype.to_datetime_select_tag=function(j,l){if(j==null){j={}}if(l==null){l={}}return this.datetime_selector(j,l).select_datetime().html_safe().valueOf()};h.prototype.datetime_selector=function(l,m){var o,n,j;o=(typeof(n=this.object)[j=this.method_name]==="function"?n[j]():void 0)||this.default_datetime(l);this.auto_index||(this.auto_index=null);l=Object.clone(l);l.field_name=this.method_name;l.include_position=true;l.prefix||(l.prefix=this.object_name);if(this.auto_index&&!(l.index!=null)){l.index=this.auto_index}return new f(o,l,m)};h.prototype.default_datetime=function(l){var q,m,p,o,j,n;if(!(l.include_blank||l.prompt)){if(!l["default"]){return new Date()}else{if(l["default"] instanceof Date){return l["default"]}else{q=Object.clone(l["default"]);q.min||(q.min=q.minute);q.sec||(q.sec=q.second);p=new Date();n=["month","hours","minutes","seconds"];for(o=0,j=n.length;o<j;o++){m=n[o];q[m]||(q[m]=p["get"+(m.capitalize())]())}q.fullYear||(q.fullYear=p.getFullYear());q.day||(q.day=p.getDate());return new Date(q.fullYear,q.month,q.day,q.hours,q.minutes,q.seconds)}}}};c.exports=new i()}).call(this)});require.define("/node_modules/date-helper/datetime_selector.js",function(b,c,a,e,d){(function(){var f,g,h=Array.prototype.indexOf||function(n){for(var m=0,j=this.length;m<j;m++){if(m in this&&this[m]===n){return m}}return -1};b("cream");g=b("tag-helper");f=(function(){function i(m,j,l){if(j==null){j={}}if(l==null){l={}}this.options=Object.clone(j);this.html_options=Object.clone(l);if(m instanceof Date){this.datetime=m}else{if(m){this.datetime=new Date(new String(m))}}if(this.options.datetime_separator==null){this.options.datetime_separator=" — "}if(this.options.time_separator==null){this.options.time_separator=" : "}this.sec=function(){var n;return(n=this.datetime)!=null?n.getSeconds():void 0};this.min=function(){var n;return(n=this.datetime)!=null?n.getMinutes():void 0};this.hour=function(){var n;return(n=this.datetime)!=null?n.getHours():void 0};this.day=function(){var n;return(n=this.datetime)!=null?n.getDate():void 0};this.month=function(){if(this.datetime){return(this.datetime.getMonth()%12)+1}};this.year=function(){var n;return(n=this.datetime)!=null?n.getFullYear():void 0}}i.prototype.date_order=function(){return this.options.order||["year","month","day"]||[]};i.prototype.select_datetime=function(){var l,m,r,j,u,t,s,n,q,p;m=Object.clone(this.date_order());m=m.filter(function(o){return o!=="hour"&&o!=="minute"&&o!=="second"});(r=this.options).discard_year||(r.discard_year=h.call(m,"year")<0?true:void 0);(j=this.options).discard_month||(j.discard_month=h.call(m,"month")<0?true:void 0);(u=this.options).discard_day||(u.discard_day=this.options.discard_month||(h.call(m,"day")<0)?true:void 0);(t=this.options).discard_minute||(t.discard_minute=this.options.discard_hour?true:void 0);(s=this.options).discard_second||(s.discard_second=!(this.options.include_seconds&&(!this.options.discard_minute))?true:void 0);if(this.datetime&&this.options.discard_day&&!this.options.discard_month){this.datetime.setDate(1)}if(this.options.tag&&this.options.ignore_date){return this.select_time()}else{p=["day","month","year"];for(n=0,q=p.length;n<q;n++){l=p[n];if(h.call(m,l)<0){m.unshift(l)}}if(!this.options.discard_hour){m=m.concat(["hour","minute","second"])}return(this.build_selects_from_types(m)).valueOf()}};i.prototype.select_date=function(){var l,m,q,s,j,t,n,r,p;m=Object.clone(this.date_order());this.options.discard_hour=true;this.options.discard_minute=true;this.options.discard_second=true;(s=this.options).discard_year||(s.discard_year=(h.call(m,"year")<0?true:void 0));(j=this.options).discard_month||(j.discard_month=(h.call(m,"month")<0?true:void 0));(t=this.options).discard_day||(t.discard_day=this.options.discard_month||h.call(m,"day")<0?true:void 0);if(this.datetime&&this.options.discard_day&&!this.options.discard_month){this.datetime.setDate(1)}p=["day","month","year"];for(n=0,r=p.length;n<r;n++){l=p[n];if(h.call(m,l)<0){m.unshift(l)}}q=(this.build_selects_from_types(m)).valueOf();return q};i.prototype.select_time=function(){var j,l;j=[];this.options.discard_month=true;this.options.discard_year=true;this.options.discard_day=true;(l=this.options).discard_second||(l.discard_second=!this.options.include_seconds?true:void 0);if(!this.options.ignore_date){j=j.concat(["year","month","day"])}j=j.concat(["hour","minute"]);if(this.options.include_seconds){j.push("second")}return this.build_selects_from_types(j)};i.prototype.select_second=function(){if(this.options.use_hidden||this.options.discard_second){if(this.options.include_seconds){return this.build_hidden("second",this.sec())}else{return""}}else{return this.build_options_and_select("second",this.sec())}};i.prototype.select_minute=function(){if(this.options.use_hidden||this.options.discard_minute){return this.build_hidden("minute",this.min())}else{return this.build_options_and_select("minute",this.min(),{step:this.options.minute_step})}};i.prototype.select_hour=function(){if(this.options.use_hidden||this.options.discard_hour){return this.build_hidden("hour",this.hour())}else{return this.build_options_and_select("hour",this.hour(),{end:23,ampm:this.options.ampm})}};i.prototype.select_day=function(){if(this.options.use_hidden||this.options.discard_day){return this.build_hidden("day",this.day())}else{return this.build_options_and_select("day",this.day(),{start:1,end:31,leading_zeros:false})}};i.prototype.select_month=function(){var m,l,j;if(this.options.use_hidden||this.options.discard_month){return this.build_hidden("month",this.month())}else{l=[];for(m=1;m<=12;m++){j={value:m};if(this.month()===m){j.selected="selected"}l.push(g.content_tag("option",this.month_name(m),j)+"\n")}return this.build_select("month",l.join(""))}};i.prototype.select_year=function(){var j,l,m;if((!this.datetime)||this.datetime===0){m="";j=(new Date()).getFullYear()}else{m=j=this.year()}if(this.options.use_hidden||this.options.discard_year){return this.build_hidden("year",m)}else{l={};l.start=this.options.start_year||(j-5);l.end=this.options.end_year||(j+5);l.step=l.start<l.end?1:-1;l.leading_zeros=false;return this.build_options_and_select("year",m,l)}};i.prototype.build_selects_from_types=function(l){var n,j,r,o,q,m,p;j="";p=Object.clone(l).reverse();for(q=0,m=p.length;q<m;q++){o=p[q];if(o===l.first()){r=""}else{r=this.separator(o)}n=this["select_"+o]();j=""+r+n+j}return j.html_safe()};i.prototype.separator=function(l){var j;j=(function(){switch(l){case"year":if(this.options.discard_year){return""}else{return this.options.date_separator}break;case"month":if(this.options.discard_month){return""}else{return this.options.date_separator}break;case"day":if(this.options.discard_day){return""}else{return this.options.date_separator}break;case"hour":if(this.options.discard_year&&this.options.discard_day){return""}else{return this.options.datetime_separator}break;case"minute":if(this.options.discard_minute){return""}else{return this.options.time_separator}break;case"second":if(this.options.include_seconds){return this.options.time_separator}else{return""}}}).call(this);return j||(j="")};i.prototype.month_names=function(){var j;j=this.options.use_month_names||this.translated_month_names();if(j.length<13){j.unshift(null)}return j};i.prototype.month_name=function(j){if(this.options.use_month_numbers){return j}else{if(this.options.add_month_numbers){return""+j+" - "+(this.month_names()[j])}else{return this.month_names()[j]}}};i.prototype.translated_month_names=function(){if(this.options.use_short_month){return[null,"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}else{return["January","February","March","April","May","June","July","August","September","October","November","December"]}};i.prototype.build_options_and_select=function(m,l,j){if(j==null){j={}}return this.build_select(m,this.build_options(l,j))};i.prototype.AMPM_TRANSLATION={0:"12 AM",1:"01 AM",2:"02 AM",3:"03 AM",4:"04 AM",5:"05 AM",6:"06 AM",7:"07 AM",8:"08 AM",9:"09 AM",10:"10 AM",11:"11 AM",12:"12 PM",13:"01 PM",14:"02 PM",15:"03 PM",16:"04 PM",17:"05 PM",18:"06 PM",19:"07 PM",20:"08 PM",21:"09 PM",22:"10 PM",23:"11 PM"};i.prototype.DEFAULT_PREFIX="date";i.prototype.POSITION={year:1,month:2,day:3,hour:4,minute:5,second:6};i.prototype.build_options=function(m,u){var n,p,o,j,l,q,s,t,r;if(u==null){u={}}j=0;if(u.start){j=u.start;delete u.start}q=59;if(u.end){q=u.end;delete u.end}l=1;if(u.step){l=u.step;delete u.step}if(u.leading_zeros==null){u.leading_zeros=true}p=u.leading_zeros;delete u.leading_zeros;if(u.ampm==null){u.ampm=false}o=[];for(n=j;j<=q?n<=q:n>=q;n+=l){r=String(n);if(p){if(r.length===1){r="0"+r}else{if(r.length===0){r="00"}}}s={value:r};if(m===n){s.selected="selected"}t=u.ampm?this.AMPM_TRANSLATION[n]:r;o.push(g.content_tag("option",t,s))}return(o.join("\n")+"\n").html_safe()};i.prototype.build_select=function(o,n){var l,m,q,j,p;q={id:this.input_id_from_type(o),name:this.input_name_from_type(o)};p=this.html_options;for(l in p){j=p[l];q[l]=j}if(this.options.disabled){q.disabled="disabled"}m="\n";if(this.options.include_blank){m+=g.content_tag("option","",{value:""})+"\n"}if(this.options.prompt){m+=this.prompt_option_tag(o,this.options.prompt)+"\n"}m+=n;return(g.content_tag("select",m.html_safe(),q)+"\n").html_safe()};i.prototype.build_hidden=function(l,m){var j;j={type:"hidden",id:this.input_id_from_type(l),name:this.input_name_from_type(l),value:m};if(this.html_options.disabled){j=this.html_options.disabled}return(g.tag("input",j)+"\n").html_safe()};i.prototype.input_name_from_type=function(m){var n,l,o,j;o=this.options.prefix||this.DEFAULT_PREFIX;if(h.call((function(){var q,p;q=this.options;p=[];for(l in q){j=q[l];p.push(l)}return p}).call(this),"index")>=0){o+="["+this.options.index+"]"}n=this.options.field_name||m;if(this.options.include_position){n+="("+this.POSITION[m]+"i)"}if(this.options.discard_type){return o}else{return""+o+"["+n+"]"}};i.prototype.input_id_from_type=function(j){return this.input_name_from_type(j).replace(/([\[\(])|(\]\[)/g,"_").replace(/[\]\)]/g,"")};return i})();c.exports=f}).call(this)});require.define("/node_modules/cream/package.json",function(b,c,a,e,d){c.exports={main:"./cream.js"}});require.define("/node_modules/cream/cream.js",function(b,c,a,e,d){(function(){var f,g=Object.prototype.hasOwnProperty,h=Array.prototype.slice;Object["delete"]=function(l,j){var i;i=l[j];delete l[j];return i};Object.clone=function(l){var j,i;if(!(l!=null)||typeof l!=="object"){return l}i=new l.constructor();for(j in l){i[j]=Object.clone(l[j])}return i};Object.merge=function(m,l){var j,i;m=Object.clone(m);for(j in l){if(!g.call(l,j)){continue}i=l[j];m[j]=i}return m};Object.update=function(m,l){var j,i;for(j in l){if(!g.call(l,j)){continue}i=l[j];m[j]=i}return m};Object.toArray=function(m){var l,j,i;i=[];for(l in m){if(!g.call(m,l)){continue}j=m[l];i.push([l,j])}return i};Object.isPlainObject=function(i){return(i&&(typeof i==="object")&&(Object.getPrototypeOf(i)===Object.prototype)&&(Object.prototype.toString.call(i)==={}.toString()))||false};Object.fromArray=function(n){var m,j,l,i;m=new Object();for(l=0,i=n.length;l<i;l++){j=n[l];m[j[0]]=j[1]}return m};Object.invert=function(l){var j,i;return Object.fromArray((function(){var m;m=[];for(j in l){if(!g.call(l,j)){continue}i=l[j];m.push([i,j])}return m})())};Array.wrap=function(i){if(i instanceof Array){return i}else{if(i===null||i===void 0){return[]}else{return[i]}}};Array.prototype.sum=function(){if(this.length>0){return this.reduce(function(i,j){return i+j})}else{return 0}};Array.prototype.first=function(){if(this.length>0){return this[0]}else{return}};Array.prototype.last=function(){if(this.length>0){return this[this.length-1]}};Array.prototype.butLast=function(){if(this.length>0){return this.slice(0,-1)}};Array.prototype.max=function(){return Math.max.apply(Math,this)};Array.prototype.min=function(){return Math.min.apply(Math,this)};Array.prototype.zip=function(){var j,n,q,o,r,m,p,l;n=1<=arguments.length?h.call(arguments,0):[];n=[Object.clone(this)].concat(n);r=n.map(function(i){return i.length}).max();m=[];for(o=0;0<=r?o<r:o>r;0<=r?o++:o--){q=[];for(p=0,l=n.length;p<l;p++){j=n[p];q.push(j[o])}m.push(q)}return m};Array.prototype.flatten=function(){return this.reduce((function(i,j){if(Array.isArray(j)){return i.concat(j.flatten())}else{return i.concat([j])}}),[])};Array.prototype.select=Array.prototype.filter;Array.prototype.reject=function(i){return this.select(function(j){return !i(j)})};Array.prototype.compact=function(){return this.reject(function(i){return i===void 0||i===null})};Array.prototype.extract_options=function(){if(Object.isPlainObject(this.last())){return this.pop()}else{return{}}};Array.prototype.group_by=function(l){var o,m,j,n,i;o={};for(n=0,i=this.length;n<i;n++){m=this[n];j=l(m);if(o[j]){o[j].push(m)}else{o[j]=[m]}}return o};String.prototype.capitalize=function(){if(this.trim().length===0){return this.valueOf()}else{return(this.split(" ").map(function(i){return i[0].toUpperCase()+i.slice(1).toLowerCase()})).join(" ")}};String.prototype.humanize=function(){var i,j;i=this.valueOf();i=i.replace(/_id$/g,"");i=i.replace(/_/g," ");j=i.split(" ");if(j.length>1){return i=j[0].capitalize()+" "+j.slice(1).join(" ")}else{return i=j[0].capitalize()}};String.prototype.beginsWith=function(i){if(this.match(new RegExp("^"+i))){return true}else{return false}};String.prototype.endsWith=function(i){if(this.match(new RegExp(""+i+"$"))){return true}else{return false}};String.prototype.dasherize=function(i){if(i==null){i=/_/g}if(typeof i==="string"){i=new RegExp(i,"g")}return this.replace(i,"-")};String.prototype.strip=String.prototype.trim;String.prototype.isBlank=function(){return !this.trim()};String.prototype.html_safe=function(){this.is_html_safe=1;return this};Number.prototype.seconds=function(){return this*1000};Number.prototype.minutes=function(){return this.seconds()*60};Number.prototype.minute=Number.prototype.minutes;Number.prototype.hours=function(){return this.minutes()*60};Number.prototype.hour=Number.prototype.hours;Number.prototype.ago=function(){return new Date(new Date().valueOf()-this)};Number.prototype.from_now=function(){return new Date(new Date().valueOf()+this)};Date.COMMON_YEAR_DAYS_IN_MONTH=[31,28,31,30,31,30,31,31,30,31,30,31];Date.is_gregorian_leap_year=function(i){return i%4===0&&i%100!==0||i%400===0};Date.prototype.days_in_month=function(){if(this.getMonth()===1&&Date.is_gregorian_leap_year(this.getFullYear())){return 29}else{return Date.COMMON_YEAR_DAYS_IN_MONTH[this.getMonth()]}};Date.prototype.tomorrow=function(){return new Date(this.valueOf()+24*60*60*1000)};Date.prototype.yesterday=function(){return new Date(this.valueOf()-24*60*60*1000)};Date.prototype.beginning_of_day=function(){return new Date(new Date(this).setHours(0,0,0,0))};Date.prototype.end_of_day=function(){return new Date(new Date(this).setHours(23,59,59,999))};Date.prototype.prev_month=function(){var j,i,l;j=new Date(this);i=j.beginning_of_month();i.setMonth(this.getMonth()-1);l=i.days_in_month();if(l<j.getDate()){j.setDate(l)}j.setMonth(this.getMonth()-1);return j};Date.prototype.next_month=function(){var l,j,i;l=new Date(this);j=l.beginning_of_month();j.setMonth(this.getMonth()+1);i=j.days_in_month();if(i<l.getDate()){l.setDate(i)}l.setMonth(this.getMonth()+1);return l};Date.prototype.beginning_of_month=function(){return new Date(new Date(this).setDate(1)).beginning_of_day()};Date.prototype.end_of_month=function(){var i;i=this.days_in_month();return new Date(new Date(this).setDate(i)).end_of_day()};f=b("prettydate").strftime;Date.prototype.strftime=function(i){return f(this,i)}}).call(this)});require.define("/node_modules/cream/node_modules/prettydate/package.json",function(b,c,a,e,d){c.exports={main:"lib/prettydate.js"}});require.define("/node_modules/cream/node_modules/prettydate/lib/prettydate.js",function(b,c,a,e,d){a.strftime=strftime=b("./strftime")});require.define("/node_modules/cream/node_modules/prettydate/lib/strftime.js",function(c,b,e,i,d){function l(m,o,n){if(typeof n==="undefined"){n=10}o=o.toString();for(;parseInt(m,10)<n&&n>1;n/=10){m=o+m}return m.toString()}var j={a:function(n,m){return m.a[n.getDay()]},A:function(n,m){return m.A[n.getDay()]},b:function(n,m){return m.b[n.getMonth()]},B:function(n,m){return m.B[n.getMonth()]},C:function(m){return l(parseInt(m.getFullYear()/100,10),0)},d:["getDate","0"],e:["getDate"," "],g:function(m){return l(parseInt(j.G(m)%100,10),0)},G:function(o){var p=o.getFullYear();var n=parseInt(j.V(o),10);var m=parseInt(j.W(o),10);if(m>n){p++}else{if(m===0&&n>=52){p--}}return p},H:["getHours","0"],I:function(n){var m=n.getHours()%12;return l(m===0?12:m,0)},j:function(q){var p=new Date(""+q.getFullYear()+"/1/1 GMT");var n=new Date(""+q.getFullYear()+"/"+(q.getMonth()+1)+"/"+q.getDate()+" GMT");var m=n-p;var o=parseInt(m/60000/60/24,10)+1;return l(o,0,100)},k:["getHours"," "],l:function(n){var m=n.getHours()%12;return l(m===0?12:m," ")},m:function(m){return l(m.getMonth()+1,0)},M:["getMinutes","0"],p:function(n,m){return m.p[n.getHours()>=12?1:0]},P:function(n,m){return m.P[n.getHours()>=12?1:0]},s:function(n,m){return parseInt(n.getTime()/1000,10)},S:["getSeconds","0"],u:function(m){var n=m.getDay();return n===0?7:n},U:function(p){var m=parseInt(j.j(p),10);var o=6-p.getDay();var n=parseInt((m+o)/7,10);return l(n,0)},V:function(p){var o=parseInt(j.W(p),10);var m=(new Date(""+p.getFullYear()+"/1/1")).getDay();var n=o+(m>4||m<=1?0:1);if(n===53&&(new Date(""+p.getFullYear()+"/12/31")).getDay()<4){n=1}else{if(n===0){n=j.V(new Date(""+(p.getFullYear()-1)+"/12/31"))}}return l(n,0)},w:"getDay",W:function(p){var m=parseInt(j.j(p),10);var o=7-j.u(p);var n=parseInt((m+o)/7,10);return l(n,0,10)},y:function(m){return l(m.getFullYear()%100,0)},Y:"getFullYear",z:function(p){var n=p.getTimezoneOffset();var m=l(parseInt(Math.abs(n/60),10),0);var q=l(Math.abs(n%60),0);return(n>0?"-":"+")+m+q},Z:function(m){var n=m.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");if(n.length>4){n=j.z(m)}return n},"%":function(m){return"%"}};var h={c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"%I:%M:%S %p",R:"%H:%M",t:"\t",T:"%H:%M:%S",x:"locale",X:"locale"};function g(r,o,p){var m;if(!r){return""}if(!o){o=""}if(!p){p="en-US"}p=p.replace(/_/g,"-");if(!f[p]){console.warn("selected locale "+p+" not found, trying alternatives");var s=p.replace(/-[a-zA-Z]+$/,"");if(s in f){p=s}else{p="en"}console.info("falling back to "+p)}m=f[p];var n=function(v,u){var w=h[u];return(w==="locale"?m[u]:w)};var q=function(v,u){var w=j[u];if(typeof w=="string"){return r[w]()}else{if(typeof w=="function"){return w.call(r,r,m)}else{if(w instanceof Array&&typeof w[0]==="string"){return l(r[w[0]](),w[1])}else{console.warn("unrecognised replacement type, please file a bug (format: "+o+")");return u}}}};o=o.replace(/%%/g,"%\b");while(o.match(/%[cDFhnrRtTxX]/)){o=o.replace(/%([cDFhnrRtTxX])/g,n)}var t=o.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ])/g,q);t=t.replace("%\b","%%");n=q=undefined;return t}var f={};f.en={a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a %d %b %Y %T %Z",p:["AM","PM"],P:["am","pm"],r:"%I:%M:%S %p",x:"%d/%m/%y",X:"%T"};function a(o,n,m){if(!m){m="en"}f[o]=n;for(k in f[m]){if(!(k in n)){f[o][k]=f[m][k]}}}a("en-US",{c:"%a %d %b %Y %I:%M:%S %p %Z",x:"%m/%d/%Y",X:"%I:%M:%S %p"});a("en-GB",{r:"%l:%M:%S %P %Z"});a("en-AU",{});g.addLocale=a;b.exports=g});require.define("/node_modules/date-helper/node_modules/tag-helper/package.json",function(b,c,a,e,d){c.exports={main:"./tag_helper.js"}});require.define("/node_modules/date-helper/node_modules/tag-helper/tag_helper.js",function(b,c,a,e,d){(function(){var f,h,g=Array.prototype.indexOf||function(n){for(var m=0,j=this.length;m<j;m++){if(m in this&&this[m]===n){return m}}return -1};b("cream");String.prototype.html_safe=function(){this.is_html_safe=1;return this};f=(function(){function i(){}i.prototype.HTML_ESCAPE={"&":"&",">":">","<":"<",'"':"""};i.prototype.JSON_ESCAPE={"&":"\u0026",">":"\u003E","<":"\u003C"};i.prototype.BOOLEAN_ATTRIBUTES=["disabled","readonly","multiple","checked","autobuffer","autoplay","controls","loop","selected","hidden","scoped","async","defer","reversed","ismap","seemless","muted","required","autofocus","novalidate","formnovalidate","open","pubdate"];i.prototype.html_escape=function(j){if(!(j instanceof String)){j=String(j)}if(j.is_html_safe==null){return j.replace(/&/g,"&").replace(/\"/g,""").replace(/>/g,">").replace(/</g,"<").html_safe()}else{return j}};i.prototype.tag=function(m,l,j,n){var o;if(l==null){l=null}if(j==null){j=false}if(n==null){n=true}o="";if(l){o=this.tag_options(l,n)}return("<"+m+o+(j?">":" />")).html_safe()};i.prototype.content_tag=function(m,j,l,n){if(j==null){j=null}if(l==null){l=null}if(n==null){n=true}return this.content_tag_string(m,j,l,n)};i.prototype.content_tag_string=function(l,n,j,m){var o;if(m==null){m=true}o=j?this.tag_options(j,m):"";return("<"+l+o+">"+(m?this.html_escape(n):n)+"</"+l+">").html_safe()};i.prototype.tag_options=function(s,q){var o,j,l,n,r,p,m;if(q==null){q=true}r=(function(){var t;t=[];for(l in s){p=s[l];t.push(l)}return t})();if(r.length!==0){o=[];for(n in s){m=s[n];if(n==="data"&&typeof m==="object"){for(l in m){p=m[l];if(typeof p!=="string"){p=JSON.stringify(p)}if(q){p=this.html_escape(p)}o.push("data-"+(l.dasherize())+'="'+p+'"')}}else{if(g.call(this.BOOLEAN_ATTRIBUTES,n)>=0){if(m){o.push(""+n+'="'+n+'"')}}else{if(m!==null&&m!==void 0){j=m;if(m instanceof Array){j=m.join(" ")}if(q){j=this.html_escape(j)}o.push(""+n+'="'+j+'"')}}}}if(o.length!==0){return(" "+(o.sort().join(" "))).html_safe()}}};return i})();h=new f();a.html_escape=h.html_escape;a.tag=h.tag;a.content_tag=h.content_tag_string;a.tag_options=h.tag_options;a.BOOLEAN_ATTRIBUTES=h.BOOLEAN_ATTRIBUTES;a.HTML_ESCAPE=h.HTML_ESCAPE;a.JSON_ESCAPE=h.JSON_ESCAPE}).call(this)});require.define("/node_modules/date-helper/node_modules/instance-tag/package.json",function(b,c,a,e,d){c.exports={main:"./instance_tag.js"}});require.define("/node_modules/date-helper/node_modules/instance-tag/instance_tag.js",function(b,c,a,e,d){(function(){var i,g,f=Object.prototype.hasOwnProperty,h=function(n,l){for(var j in l){if(f.call(l,j)){n[j]=l[j]}}function m(){this.constructor=n}m.prototype=l.prototype;n.prototype=new m;n.__super__=l.prototype;return n};b("cream");i=(function(j){h(l,j);function l(){l.__super__.constructor.apply(this,arguments)}return l})(Error);g=(function(){function j(l,o,n,m){var p,r,q;if(m==null){m=null}q=[Object.clone(String(l).valueOf()),Object.clone(String(o).valueOf())],this.object_name=q[0],this.method_name=q[1];this.template_object=n;p=/\[\]$/;if(p.test(this.object_name)){this.object_name=this.object_name.replace(p,"")}else{p=/\[\]\]$/;if(p.test(this.object_name)){this.object_name=this.object_name.replace(p,"]")}else{p=null}}this.object=this.retrieve_object(m);if(p){r=p.exec(this.object_name);this.auto_index=this.retrieve_autoindex(this.object_name.slice(0,this.object_name.indexOf(r)))}}j.prototype.retrieve_object=function(l){if(l){return l}else{if(this.template_object[""+this.object_name]!=null){return this.template_object[""+this.object_name]}}};j.prototype.retrieve_autoindex=function(m){var l;l=this.object||this.template_object[""+m];if(l){return JSON.stringify(l)}else{throw new i("object[] naming but object param and @object var don't exist or don't respond to to_param: "+l.inspect)}};return j})();c.exports=g}).call(this)});require.define("/node_modules/url-helper/package.json",function(b,c,a,e,d){c.exports={main:"./url_helper.js"}});require.define("/node_modules/url-helper/url_helper.js",function(b,c,a,e,d){(function(){var f,i,h,g=Array.prototype.slice;f=b("tag-helper");i=(function(){function j(){}j.prototype.url_for=function(l){if(typeof l==="string"){return l}else{if(l.url&&typeof l.url==="function"){return l.url()}}};j.prototype.link_to=function(){var p,l,r,q,o,n,s,m;p=1<=arguments.length?g.call(arguments,0):[];o=p[0];n=p[1]||{};q=p[2]||{};m=this.url_for(n);l=q.href;s=f.tag_options(q)||"";if(!l){r='href="'+(f.html_escape(m))+'"'}return"<a "+r+s+">"+(f.html_escape(o||m))+"</a>"};return j})();h=new i();a.link_to=h.link_to;a.url_for=h.url_for}).call(this)});require.define("/node_modules/url-helper/node_modules/tag-helper/package.json",function(b,c,a,e,d){c.exports={main:"./tag_helper.js"}});require.define("/node_modules/url-helper/node_modules/tag-helper/tag_helper.js",function(b,c,a,e,d){(function(){var f,h,g=Array.prototype.indexOf||function(n){for(var m=0,j=this.length;m<j;m++){if(m in this&&this[m]===n){return m}}return -1};b("cream");String.prototype.html_safe=function(){this.is_html_safe=1;return this};f=(function(){function i(){}i.prototype.HTML_ESCAPE={"&":"&",">":">","<":"<",'"':"""};i.prototype.JSON_ESCAPE={"&":"\u0026",">":"\u003E","<":"\u003C"};i.prototype.BOOLEAN_ATTRIBUTES=["disabled","readonly","multiple","checked","autobuffer","autoplay","controls","loop","selected","hidden","scoped","async","defer","reversed","ismap","seemless","muted","required","autofocus","novalidate","formnovalidate","open","pubdate"];i.prototype.html_escape=function(j){if(!(j instanceof String)){j=String(j)}if(j.is_html_safe==null){return j.replace(/&/g,"&").replace(/\"/g,""").replace(/>/g,">").replace(/</g,"<").html_safe()}else{return j}};i.prototype.tag=function(m,l,j,n){var o;if(l==null){l=null}if(j==null){j=false}if(n==null){n=true}o="";if(l){o=this.tag_options(l,n)}return("<"+m+o+(j?">":" />")).html_safe()};i.prototype.content_tag=function(m,j,l,n){if(j==null){j=null}if(l==null){l=null}if(n==null){n=true}return this.content_tag_string(m,j,l,n)};i.prototype.content_tag_string=function(l,n,j,m){var o;if(m==null){m=true}o=j?this.tag_options(j,m):"";return("<"+l+o+">"+(m?this.html_escape(n):n)+"</"+l+">").html_safe()};i.prototype.tag_options=function(s,q){var o,j,l,n,r,p,m;if(q==null){q=true}r=(function(){var t;t=[];for(l in s){p=s[l];t.push(l)}return t})();if(r.length!==0){o=[];for(n in s){m=s[n];if(n==="data"&&typeof m==="object"){for(l in m){p=m[l];if(typeof p!=="string"){p=JSON.stringify(p)}if(q){p=this.html_escape(p)}o.push("data-"+(l.dasherize())+'="'+p+'"')}}else{if(g.call(this.BOOLEAN_ATTRIBUTES,n)>=0){if(m){o.push(""+n+'="'+n+'"')}}else{if(m!==null&&m!==void 0){j=m;if(m instanceof Array){j=m.join(" ")}if(q){j=this.html_escape(j)}o.push(""+n+'="'+j+'"')}}}}if(o.length!==0){return(" "+(o.sort().join(" "))).html_safe()}}};return i})();h=new f();a.html_escape=h.html_escape;a.tag=h.tag;a.content_tag=h.content_tag_string;a.tag_options=h.tag_options;a.BOOLEAN_ATTRIBUTES=h.BOOLEAN_ATTRIBUTES;a.HTML_ESCAPE=h.HTML_ESCAPE;a.JSON_ESCAPE=h.JSON_ESCAPE}).call(this)});require.define("/node_modules/asset-tag-helper/package.json",function(b,c,a,e,d){c.exports={main:"./asset_tag_helper.js"}});require.define("/node_modules/asset-tag-helper/asset_tag_helper.js",function(b,c,a,e,d){(function(){var f,g,i,h;b("cream");g=b("tag-helper");i=function(m,l){var j;if(l==null){l=null}j=m.split("/").last();if(l){return j.replace(new RegExp(""+(l.replace(/\./g,"\\.").replace(/\*/g,".*"))+"$"),"")}else{return j}};f=(function(){function j(){}j.prototype.image_path=function(l){return"/images/"+l};j.prototype.path_to_image=function(l){return this.image_path(l)};j.prototype.image_tag=function(p,m){var l,n,q,o;if(m==null){m={}}q=m.src=this.path_to_image(p);if(!(q!=null?q.match(/^cid:/):void 0)){m.alt||(m.alt=this.image_alt(q))}if(n=Object["delete"](m,"size")){if(n.match(/^\d+x\d+$/)){o=n.split("x"),m.width=o[0],m.height=o[1]}}if(l=Object["delete"](m,"mouseover")){m.onmouseover="this.src='"+(this.path_to_image(l))+"'";m.onmouseout="this.src='"+q+"'"}return g.tag("img",m)};j.prototype.image_alt=function(l){return i(l,".*").capitalize()};return j})();h=new f();a.image_path=h.image_path;a.path_to_image=h.path_to_image;a.image_tag=h.image_tag;a.image_alt=h.image_alt}).call(this)});require.define("/node_modules/asset-tag-helper/node_modules/tag-helper/package.json",function(b,c,a,e,d){c.exports={main:"./tag_helper.js"}});require.define("/node_modules/asset-tag-helper/node_modules/tag-helper/tag_helper.js",function(b,c,a,e,d){(function(){var f,h,g=Array.prototype.indexOf||function(n){for(var m=0,j=this.length;m<j;m++){if(m in this&&this[m]===n){return m}}return -1};b("cream");String.prototype.html_safe=function(){this.is_html_safe=1;return this};f=(function(){function i(){}i.prototype.HTML_ESCAPE={"&":"&",">":">","<":"<",'"':"""};i.prototype.JSON_ESCAPE={"&":"\u0026",">":"\u003E","<":"\u003C"};i.prototype.BOOLEAN_ATTRIBUTES=["disabled","readonly","multiple","checked","autobuffer","autoplay","controls","loop","selected","hidden","scoped","async","defer","reversed","ismap","seemless","muted","required","autofocus","novalidate","formnovalidate","open","pubdate"];i.prototype.html_escape=function(j){if(!(j instanceof String)){j=String(j)}if(j.is_html_safe==null){return j.replace(/&/g,"&").replace(/\"/g,""").replace(/>/g,">").replace(/</g,"<").html_safe()}else{return j}};i.prototype.tag=function(m,l,j,n){var o;if(l==null){l=null}if(j==null){j=false}if(n==null){n=true}o="";if(l){o=this.tag_options(l,n)}return("<"+m+o+(j?">":" />")).html_safe()};i.prototype.content_tag=function(m,j,l,n){if(j==null){j=null}if(l==null){l=null}if(n==null){n=true}return this.content_tag_string(m,j,l,n)};i.prototype.content_tag_string=function(l,n,j,m){var o;if(m==null){m=true}o=j?this.tag_options(j,m):"";return("<"+l+o+">"+(m?this.html_escape(n):n)+"</"+l+">").html_safe()};i.prototype.tag_options=function(s,q){var o,j,l,n,r,p,m;if(q==null){q=true}r=(function(){var t;t=[];for(l in s){p=s[l];t.push(l)}return t})();if(r.length!==0){o=[];for(n in s){m=s[n];if(n==="data"&&typeof m==="object"){for(l in m){p=m[l];if(typeof p!=="string"){p=JSON.stringify(p)}if(q){p=this.html_escape(p)}o.push("data-"+(l.dasherize())+'="'+p+'"')}}else{if(g.call(this.BOOLEAN_ATTRIBUTES,n)>=0){if(m){o.push(""+n+'="'+n+'"')}}else{if(m!==null&&m!==void 0){j=m;if(m instanceof Array){j=m.join(" ")}if(q){j=this.html_escape(j)}o.push(""+n+'="'+j+'"')}}}}if(o.length!==0){return(" "+(o.sort().join(" "))).html_safe()}}};return i})();h=new f();a.html_escape=h.html_escape;a.tag=h.tag;a.content_tag=h.content_tag_string;a.tag_options=h.tag_options;a.BOOLEAN_ATTRIBUTES=h.BOOLEAN_ATTRIBUTES;a.HTML_ESCAPE=h.HTML_ESCAPE;a.JSON_ESCAPE=h.JSON_ESCAPE}).call(this)});require.define("/node_modules/form-options-helper/package.json",function(b,c,a,e,d){c.exports={main:"./form_options_helper.js"}});require.define("/node_modules/form-options-helper/form_options_helper.js",function(b,c,a,e,d){(function(){var j,h,l,g=function(m,n){return function(){return m.apply(n,arguments)}},f=Object.prototype.hasOwnProperty,i=Array.prototype.indexOf||function(o){for(var n=0,m=this.length;n<m;n++){if(n in this&&this[n]===o){return n}}return -1};b("cream");h=b("tag-helper");j=(function(){function m(){this.extract_selected_and_disabled=g(this.extract_selected_and_disabled,this);this.is_option_value_selected=g(this.is_option_value_selected,this);this.option_text_and_value=g(this.option_text_and_value,this);this.option_html_attributes=g(this.option_html_attributes,this);this.options_for_select=g(this.options_for_select,this)}m.prototype.options_for_select=function(n,p){var o,q,r=this;if(p==null){p=null}if(typeof n==="string"){return n}q=this.extract_selected_and_disabled(p).map(function(s){return Array.wrap(s).map(function(t){if(t instanceof String){return t}else{return String(t)}})}),p=q[0],o=q[1];if(Object.isPlainObject(n)){n=Object.toArray(n)}return n.map(function(t){var u,y,s,w,v,x;y=r.option_html_attributes(t);x=r.option_text_and_value(t).map(function(z){if(z instanceof String){return z}else{return String(z)}}),w=x[0],v=x[1];if(r.is_option_value_selected(v,p)){s=' selected="selected"'}if(o&&r.is_option_value_selected(v,o)){u=' disabled="disabled"'}return'<option value="'+(h.html_escape(v))+'"'+(s||"")+(u||"")+(y||"")+">"+(h.html_escape(w))+"</option>"}).join("\n").html_safe()};m.prototype.option_html_attributes=function(p){var r,o,n,q;if(!(p instanceof Array)){return""}r=[];q=p.select(function(s){return Object.isPlainObject(s)}).reduce(Object.merge,{});for(o in q){if(!f.call(q,o)){continue}n=q[o];r.push(" "+o+'="'+(h.html_escape(n.toString()))+'"')}return r.join("")};m.prototype.option_text_and_value=function(n){var o=this;if(n instanceof Array){n=n.reject(function(p){return Object.isPlainObject(p)});return[n.first(),n.last()]}else{if((!(n instanceof String))&&(n.first instanceof Function)&&(n.last instanceof Function)){return[n.first(),n.last()]}else{return[n,n]}}};m.prototype.is_option_value_selected=function(o,n){if(n instanceof Array){return i.call(n,o)>=0}else{if(Object.isPlainObject(n)){return n[o]!=null}else{return o===n}}};m.prototype.extract_selected_and_disabled=function(o){var n;if(o instanceof Function){return[o,null]}else{o=Array.wrap(o);n=o.extract_options();return[(n.selected!=null?n.selected:o),n.disabled]}};return m})();l=new j();a.options_for_select=l.options_for_select}).call(this)});require.define("/node_modules/form-options-helper/node_modules/tag-helper/package.json",function(b,c,a,e,d){c.exports={main:"./tag_helper.js"}});require.define("/node_modules/form-options-helper/node_modules/tag-helper/tag_helper.js",function(b,c,a,e,d){(function(){var f,h,g=Array.prototype.indexOf||function(n){for(var m=0,j=this.length;m<j;m++){if(m in this&&this[m]===n){return m}}return -1};b("cream");String.prototype.html_safe=function(){this.is_html_safe=1;return this};f=(function(){function i(){}i.prototype.HTML_ESCAPE={"&":"&",">":">","<":"<",'"':"""};i.prototype.JSON_ESCAPE={"&":"\u0026",">":"\u003E","<":"\u003C"};i.prototype.BOOLEAN_ATTRIBUTES=["disabled","readonly","multiple","checked","autobuffer","autoplay","controls","loop","selected","hidden","scoped","async","defer","reversed","ismap","seemless","muted","required","autofocus","novalidate","formnovalidate","open","pubdate"];i.prototype.html_escape=function(j){if(!(j instanceof String)){j=String(j)}if(j.is_html_safe==null){return j.replace(/&/g,"&").replace(/\"/g,""").replace(/>/g,">").replace(/</g,"<").html_safe()}else{return j}};i.prototype.tag=function(m,l,j,n){var o;if(l==null){l=null}if(j==null){j=false}if(n==null){n=true}o="";if(l){o=this.tag_options(l,n)}return("<"+m+o+(j?">":" />")).html_safe()};i.prototype.content_tag=function(m,j,l,n){if(j==null){j=null}if(l==null){l=null}if(n==null){n=true}return this.content_tag_string(m,j,l,n)};i.prototype.content_tag_string=function(l,n,j,m){var o;if(m==null){m=true}o=j?this.tag_options(j,m):"";return("<"+l+o+">"+(m?this.html_escape(n):n)+"</"+l+">").html_safe()};i.prototype.tag_options=function(s,q){var o,j,l,n,r,p,m;if(q==null){q=true}r=(function(){var t;t=[];for(l in s){p=s[l];t.push(l)}return t})();if(r.length!==0){o=[];for(n in s){m=s[n];if(n==="data"&&typeof m==="object"){for(l in m){p=m[l];if(typeof p!=="string"){p=JSON.stringify(p)}if(q){p=this.html_escape(p)}o.push("data-"+(l.dasherize())+'="'+p+'"')}}else{if(g.call(this.BOOLEAN_ATTRIBUTES,n)>=0){if(m){o.push(""+n+'="'+n+'"')}}else{if(m!==null&&m!==void 0){j=m;if(m instanceof Array){j=m.join(" ")}if(q){j=this.html_escape(j)}o.push(""+n+'="'+j+'"')}}}}if(o.length!==0){return(" "+(o.sort().join(" "))).html_safe()}}};return i})();h=new f();a.html_escape=h.html_escape;a.tag=h.tag;a.content_tag=h.content_tag_string;a.tag_options=h.tag_options;a.BOOLEAN_ATTRIBUTES=h.BOOLEAN_ATTRIBUTES;a.HTML_ESCAPE=h.HTML_ESCAPE;a.JSON_ESCAPE=h.JSON_ESCAPE}).call(this)});require.define("/node_modules/form-tag-helper/package.json",function(b,c,a,e,d){c.exports={main:"./form_tag_helper.js"}});require.define("/node_modules/form-tag-helper/form_tag_helper.js",function(b,c,a,e,d){(function(){var h,g,i,f=function(j,l){return function(){return j.apply(l,arguments)}};b("cream");g=b("tag-helper");h=(function(){function j(){this.sanitize_to_id=f(this.sanitize_to_id,this);this.label_tag=f(this.label_tag,this);this.select_tag=f(this.select_tag,this)}j.prototype.select_tag=function(o,p,n){var m,l;if(p==null){p=null}if(n==null){n={}}m=n.multiple===true&&(!new String(o).endsWith("[]"))?""+o+"[]":o;if(Object["delete"](n,"include_blank")){p='<option value=""></option>'.html_safe().concat(p)}if(l=Object["delete"](n,"prompt")){p=('<option value="">'+l+"</option>").html_safe().concat(p)}return g.content_tag("select",p,Object.update({name:m,id:this.sanitize_to_id(o)},n))};j.prototype.label_tag=function(m,n,o){var l;if(n==null){n=null}if(o&&Object.isPlainObject(n)){l=n}else{l||(l={})}if(!(m.trim().length===0||(l["for"]!=null))){l["for"]=this.sanitize_to_id(m)}return g.content_tag("label",n||String(m).humanize(),l,o)};j.prototype.sanitize_to_id=function(l){return new String(l).replace(/]/g,"").replace(/[^-a-zA-Z0-9:.]/g,"_")};return j})();i=new h();a.select_tag=i.select_tag}).call(this)});require.define("/node_modules/form-tag-helper/node_modules/tag-helper/package.json",function(b,c,a,e,d){c.exports={main:"./tag_helper.js"}});require.define("/node_modules/form-tag-helper/node_modules/tag-helper/tag_helper.js",function(b,c,a,e,d){(function(){var f,h,g=Array.prototype.indexOf||function(n){for(var m=0,j=this.length;m<j;m++){if(m in this&&this[m]===n){return m}}return -1};b("cream");String.prototype.html_safe=function(){this.is_html_safe=1;return this};f=(function(){function i(){}i.prototype.HTML_ESCAPE={"&":"&",">":">","<":"<",'"':"""};i.prototype.JSON_ESCAPE={"&":"\u0026",">":"\u003E","<":"\u003C"};i.prototype.BOOLEAN_ATTRIBUTES=["disabled","readonly","multiple","checked","autobuffer","autoplay","controls","loop","selected","hidden","scoped","async","defer","reversed","ismap","seemless","muted","required","autofocus","novalidate","formnovalidate","open","pubdate"];i.prototype.html_escape=function(j){if(!(j instanceof String)){j=String(j)}if(j.is_html_safe==null){return j.replace(/&/g,"&").replace(/\"/g,""").replace(/>/g,">").replace(/</g,"<").html_safe()}else{return j}};i.prototype.tag=function(m,l,j,n){var o;if(l==null){l=null}if(j==null){j=false}if(n==null){n=true}o="";if(l){o=this.tag_options(l,n)}return("<"+m+o+(j?">":" />")).html_safe()};i.prototype.content_tag=function(m,j,l,n){if(j==null){j=null}if(l==null){l=null}if(n==null){n=true}return this.content_tag_string(m,j,l,n)};i.prototype.content_tag_string=function(l,n,j,m){var o;if(m==null){m=true}o=j?this.tag_options(j,m):"";return("<"+l+o+">"+(m?this.html_escape(n):n)+"</"+l+">").html_safe()};i.prototype.tag_options=function(s,q){var o,j,l,n,r,p,m;if(q==null){q=true}r=(function(){var t;t=[];for(l in s){p=s[l];t.push(l)}return t})();if(r.length!==0){o=[];for(n in s){m=s[n];if(n==="data"&&typeof m==="object"){for(l in m){p=m[l];if(typeof p!=="string"){p=JSON.stringify(p)}if(q){p=this.html_escape(p)}o.push("data-"+(l.dasherize())+'="'+p+'"')}}else{if(g.call(this.BOOLEAN_ATTRIBUTES,n)>=0){if(m){o.push(""+n+'="'+n+'"')}}else{if(m!==null&&m!==void 0){j=m;if(m instanceof Array){j=m.join(" ")}if(q){j=this.html_escape(j)}o.push(""+n+'="'+j+'"')}}}}if(o.length!==0){return(" "+(o.sort().join(" "))).html_safe()}}};return i})();h=new f();a.html_escape=h.html_escape;a.tag=h.tag;a.content_tag=h.content_tag_string;a.tag_options=h.tag_options;a.BOOLEAN_ATTRIBUTES=h.BOOLEAN_ATTRIBUTES;a.HTML_ESCAPE=h.HTML_ESCAPE;a.JSON_ESCAPE=h.JSON_ESCAPE}).call(this)});require.define("/cafe.coffee",function(b,c,a,e,d){(function(){var g,m,l,j,n,i,f,h;m=b("date-helper");n=b("url-helper");g=b("asset-tag-helper");l=b("form-options-helper");j=b("form-tag-helper");f=typeof window!=="undefined"&&window!==null?window:global;for(i in m){h=m[i];f[i]=h}for(i in n){h=n[i];f[i]=h}for(i in g){h=g[i];f[i]=h}for(i in l){h=l[i];f[i]=h}for(i in j){h=j[i];f[i]=h}}).call(this)});require("/cafe.coffee");