text: /*!
   * CanJS - 2.1.4
   * http://canjs.us/
   * Copyright (c) 2014 Bitovi
   * Fri, 21 Nov 2014 22:25:48 GMT
   * Licensed MIT
   * Includes: CanJS default build
   * Download from: http://canjs.us/
   */
  !function(undefined){var __m3=function(){var a=window.can||{};("undefined"==typeof GLOBALCAN||GLOBALCAN!==!1)&&(window.can=a),a.k=function(){},a.isDeferred=function(a){return a&&"function"==typeof a.then&&"function"==typeof a.pipe};var b=0;return a.cid=function(a,c){return a._cid||(b++,a._cid=(c||"")+b),a._cid},a.VERSION="2.1.4",a.simpleExtend=function(a,b){for(var c in b)a[c]=b[c];return a},a.frag=function(b){var c;return b&&"string"!=typeof b?11===b.nodeType?b:"number"==typeof b.nodeType?(c=document.createDocumentFragment(),c.appendChild(b),c):"number"==typeof b.length?(c=document.createDocumentFragment(),a.each(b,function(b){c.appendChild(a.frag(b))}),c):(c=a.buildFragment(""+b,document.body),c.childNodes.length||c.appendChild(document.createTextNode("")),c):(c=a.buildFragment(null==b?"":""+b,document.body),c.childNodes.length||c.appendChild(document.createTextNode("")),c)},a.__reading=function(){},a}(),__m4=function(a){var b=window.setImmediate||function(a){return setTimeout(a,0)},c={MutationObserver:window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,map:{"class":"className",value:"value",innerText:"innerText",textContent:"textContent",checked:!0,disabled:!0,readonly:!0,required:!0,src:function(a,b){return null==b||""===b?(a.removeAttribute("src"),null):(a.setAttribute("src",b),b)},style:function(a,b){return a.style.cssText=b||""}},defaultValue:["input","textarea"],set:function(b,d,e){var f;c.MutationObserver||(f=c.get(b,d));var g,h=b.nodeName.toString().toLowerCase(),i=c.map[d];"function"==typeof i?g=i(b,e):i===!0?(g=b[d]=!0,"checked"===d&&"radio"===b.type&&a.inArray(h,c.defaultValue)>=0&&(b.defaultChecked=!0)):i?(g=b[i]=e,"value"===i&&a.inArray(h,c.defaultValue)>=0&&(b.defaultValue=e)):(b.setAttribute(d,e),g=e),c.MutationObserver||g===f||c.trigger(b,d,f)},trigger:function(c,d,e){return a.data(a.$(c),"canHasAttributesBindings")?b(function(){a.trigger(c,{type:"attributes",attributeName:d,target:c,oldValue:e,bubbles:!1},[])}):void 0},get:function(a,b){var d=c.map[b];return"string"==typeof d&&a[d]?a[d]:a.getAttribute(b)},remove:function(a,b){var d;c.MutationObserver||(d=c.get(a,b));var e=c.map[b];"function"==typeof e&&e(a,undefined),e===!0?a[b]=!1:"string"==typeof e?a[e]="":a.removeAttribute(b),c.MutationObserver||null==d||c.trigger(a,b,d)},has:function(){var a=document.createElement("div");return a.hasAttribute?function(a,b){return a.hasAttribute(b)}:function(a,b){return null!==a.getAttribute(b)}}()};return c}(__m3),__m6=function(a){return a.addEvent=function(a,b){var c=this.__bindEvents||(this.__bindEvents={}),d=c[a]||(c[a]=[]);return d.push({handler:b,name:a}),this},a.listenTo=function(b,c,d){var e=this.__listenToEvents;e||(e=this.__listenToEvents={});var f=a.cid(b),g=e[f];g||(g=e[f]={obj:b,events:{}});var h=g.events[c];h||(h=g.events[c]=[]),h.push(d),a.bind.call(b,c,d)},a.stopListening=function(b,c,d){var e=this.__listenToEvents,f=e,g=0;if(!e)return this;if(b){var h=a.cid(b);if((f={})[h]=e[h],!e[h])return this}for(var i in f){var j,k=f[i];b=e[i].obj,c?(j={})[c]=k.events[c]:j=k.events;for(var l in j){var m=j[l]||[];for(g=0;g<m.length;)d&&d===m[g]||!d?(a.unbind.call(b,l,m[g]),m.splice(g,1)):g++;m.length||delete k.events[l]}a.isEmptyObject(k.events)&&delete e[i]}return this},a.removeEvent=function(a,b,c){if(!this.__bindEvents)return this;for(var d,e=this.__bindEvents[a]||[],f=0,g="function"==typeof b;f<e.length;)d=e[f],(c?c(d,a,b):g&&d.handler===b||!g&&(d.cid===b||!b))?e.splice(f,1):f++;return this},a.dispatch=function(a,b){var c=this.__bindEvents;if(c){"string"==typeof a&&(a={type:a});var d=a.type,e=(c[d]||[]).slice(0),f=[a];b&&f.push.apply(f,b);for(var g=0,h=e.length;h>g;g++)e[g].handler.apply(this,f);return a}},a.one=function(b,c){var d=function(){return a.unbind.call(this,b,d),c.apply(this,arguments)};return a.bind.call(this,b,d),this},a.event={on:function(){return 0===arguments.length&&a.Control&&this instanceof a.Control?a.Control.prototype.on.call(this):a.addEvent.apply(this,arguments)},off:function(){return 0===arguments.length&&a.Control&&this instanceof a.Control?a.Control.prototype.off.call(this):a.removeEvent.apply(this,arguments)},bind:a.addEvent,unbind:a.removeEvent,delegate:function(b,c,d){return a.addEvent.call(this,c,d)},undelegate:function(b,c,d){return a.removeEvent.call(this,c,d)},trigger:a.dispatch,one:a.one,addEvent:a.addEvent,removeEvent:a.removeEvent,listenTo:a.listenTo,stopListening:a.stopListening,dispatch:a.dispatch},a.event}(__m3),__m7=function(a){var b=/^\s*<(\w+)[^>]*>/,c={}.toString,d=function(a,d){d===undefined&&(d=b.test(a)&&RegExp.$1),a&&"[object Function]"===c.call(a.replace)&&(a=a.replace(/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,"<$1></$2>"));var e=document.createElement("div"),f=document.createElement("div");"tbody"===d||"tfoot"===d||"thead"===d?(f.innerHTML="<table>"+a+"</table>",e=3===f.firstChild.nodeType?f.lastChild:f.firstChild):"tr"===d?(f.innerHTML="<table><tbody>"+a+"</tbody></table>",e=3===f.firstChild.nodeType?f.lastChild:f.firstChild.firstChild):"td"===d||"th"===d?(f.innerHTML="<table><tbody><tr>"+a+"</tr></tbody></table>",e=3===f.firstChild.nodeType?f.lastChild:f.firstChild.firstChild.firstChild):"option"===d?(f.innerHTML="<select>"+a+"</select>",e=3===f.firstChild.nodeType?f.lastChild:f.firstChild):e.innerHTML=""+a;var g={},h=e.childNodes;g.length=h.length;for(var i=0;i<h.length;i++)g[i]=h[i];return[].slice.call(g)};return a.buildFragment=function(a){if(a&&11===a.nodeType)return a;for(var b=d(a),c=document.createDocumentFragment(),e=0,f=b.length;f>e;e++)c.appendChild(b[e]);return c},function(){var b="<-\n>",c=a.buildFragment(b,document);if(b!==c.childNodes[0].nodeValue){var d=a.buildFragment;a.buildFragment=function(a,b){var c=d(a,b);return 1===c.childNodes.length&&3===c.childNodes[0].nodeType&&(c.childNodes[0].nodeValue=a),c}}}(),a}(__m3),__m8=function(a){var b=function(a){var b=a.length;return"function"!=typeof arr&&(0===b||"number"==typeof b&&b>0&&b-1 in a)};return a.each=function(c,d,e){var f,g,h,i=0;if(c)if(b(c))if(a.List&&c instanceof a.List)for(g=c.attr("length");g>i&&(h=c.attr(i),d.call(e||h,h,i,c)!==!1);i++);else for(g=c.length;g>i&&(h=c[i],d.call(e||h,h,i,c)!==!1);i++);else if("object"==typeof c)if(a.Map&&c instanceof a.Map||c===a.route){var j=a.Map.keys(c);for(i=0,g=j.length;g>i&&(f=j[i],h=c.attr(f),d.call(e||h,h,f,c)!==!1);i++);}else for(f in c)if(c.hasOwnProperty(f)&&d.call(e||c[f],c[f],f,c)===!1)break;return c},a}(__m3),__m9=function(a){var b=Object.prototype.hasOwnProperty,c=function(a){return null!==a&&a==a.window},d=function(a){if(!a||"object"!=typeof a||a.nodeType||c(a))return!1;try{if(a.constructor&&!b.call(a,"constructor")&&!b.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(d){return!1}var e;for(e in a);return e===undefined||b.call(a,e)};return a.isPlainObject=d,a}(__m3),__m10=function(a){var b=function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])},c=function(a){return this instanceof c?(this._doneFuncs=[],this._failFuncs=[],this._resultArgs=null,this._status="",void(a&&a.call(this,this))):new c};a.Deferred=c,a.when=c.when=function(){var b=a.makeArray(arguments);if(b.length<2){var d=b[0];return d&&a.isFunction(d.isResolved)&&a.isFunction(d.isRejected)?d:c().resolve(d)}var e=c(),f=0,g=[];return a.each(b,function(a,c){a.done(function(){g[c]=arguments.length<2?arguments[0]:arguments,++f===b.length&&e.resolve.apply(e,g)}).fail(function(){e.reject(1===arguments.length?arguments[0]:arguments)})}),e};var d=function(a,b){return function(c){var d=this._resultArgs=arguments.length>1?arguments[1]:[];return this.exec(c,this[a],d,b)}},e=function h(b,c){return function(){var d=this;return a.each(Array.prototype.slice.call(arguments),function(a){a&&(a.constructor===Array?h.apply(d,a):(d._status===c&&a.apply(d,d._resultArgs||[]),d[b].push(a)))}),this}},f=function(a){return a&&a.then&&a.fail&&a.done},g=function(b,c,d,e){f(c)?c.done(a.proxy(b.resolve,b)).fail(a.proxy(b.reject,b)):d.call(b,c!==undefined?c:e)};return b(c.prototype,{then:function(b,c){var d=a.Deferred(),e=d.resolve,f=d.reject;return this.done(function(a){"function"==typeof b?g(d,b.apply(this,arguments),e,a):e.apply(d,arguments)}),this.fail(function(a){"function"==typeof c?g(d,c.apply(this,arguments),f,a):f.apply(d,arguments)}),d},resolveWith:d("_doneFuncs","rs"),rejectWith:d("_failFuncs","rj"),done:e("_doneFuncs","rs"),fail:e("_failFuncs","rj"),always:function(){var b=a.makeArray(arguments);return b.length&&b[0]&&this.done(b[0]).fail(b[0]),this},state:function(){switch(this._status){case"rs":return"resolved";case"rj":return"rejected";default:return"pending"}},isResolved:function(){return"rs"===this._status},isRejected:function(){return"rj"===this._status},reject:function(){return this.rejectWith(this,arguments)},resolve:function(){return this.resolveWith(this,arguments)},exec:function(b,c,d,e){return""!==this._status?this:(this._status=e,a.each(c,function(a){"function"==typeof a.apply&&a.apply(b,d)}),this)},promise:function(){var a=this.then();return a.reject=a.resolve=undefined,a}}),c.prototype.pipe=c.prototype.then,a}(__m3),__m11=function(a){!function(){var b=function(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent?a.attachEvent("on"+b,c):a["on"+b]=c},c=function(){a.trigger(window,"hashchange")};b(window,"hashchange",c)}()}(__m3),__m12=function(a){a.inserted=function(b){b=a.makeArray(b);for(var c,d,e=!1,f=a.$(document.contains?document:document.body),g=0;(d=b[g])!==undefined;g++){if(!e){if(!d.getElementsByTagName)continue;if(!a.has(f,d).length)return;e=!0}if(e&&d.getElementsByTagName){c=a.makeArray(d.getElementsByTagName("*")),a.trigger(d,"inserted",[],!1);for(var h,i=0;(h=c[i])!==undefined;i++)a.trigger(h,"inserted",[],!1)}}},a.appendChild=function(b,c){var d;d=11===c.nodeType?a.makeArray(c.childNodes):[c],b.appendChild(c),a.inserted(d)},a.insertBefore=function(b,c,d){var e;e=11===c.nodeType?a.makeArray(c.childNodes):[c],b.insertBefore(c,d),a.inserted(e)}}(__m3),__m2=function(a,b){function c(a,b){var c=a[l],e=c&&j[c];return b===undefined?e||d(a):e&&e[b]}function d(a,b,c){var d=a[l]||(a[l]=++k),e=j[d]||(j[d]={});return b!==undefined&&(e[b]=c),e}var e=window.dojo;define("plugd/trigger",["dojo"],function(a){var b,c=a,d=c.isFunction,e=/mouse(enter|leave)/,f=function(a,b){return"mouse"+("enter"===b?"over":"out")},g=c._mixin;return b=c.doc.createEvent?function(a,b,d){var h=c.doc.createEvent("HTMLEvents");b=b.replace(e,f),h.initEvent(b,"removed"===b||"inserted"===b?!1:!0,!0),d&&g(h,d),a.dispatchEvent(h)}:function(a,b,e){var f="on"+b,h=!1;try{var i=document.createEventObject();("inserted"===b||"removed"===b)&&(i.cancelBubble=!0),g(i,e),a.fireEvent(f,i)}catch(j){var k=g({type:b,target:a,faux:!0,_stopper:function(){h=this.cancelBubble}},e);if(d(a[f])&&a[f](k),"inserted"===b||"removed"===b)return;for(;!h&&a!==c.doc&&a.parentNode;)a=a.parentNode,d(a[f])&&a[f](k)}},c._trigger=function(a,d,e){"string"!=typeof d&&(e=d,d=e.type,delete e.type);var f=c.byId(a),g=d&&"on"===d.slice(0,2)?d.slice(2):d;b(f,g,e)},c.trigger=function(a,b){return d(a)||d(b)||d(a[b])?c.hitch.apply(c,arguments)():c._trigger.apply(c,arguments)},c.NodeList.prototype.trigger=c.NodeList._adaptAsForEach(c._trigger),c._Node&&!c._Node.prototype.trigger&&c.extend(c._Node,{trigger:function(a,b){return c._trigger(this,a,b),this}}),c.trigger}),require(["dojo","dojo/query","plugd/trigger","dojo/NodeList-dom"]),a.trim=function(a){return a&&e.trim(a)},a.makeArray=function(a){var b=[];return e.forEach(a,function(a){b.push(a)}),b},a.isArray=e.isArray,a.inArray=function(a,b,c){return e.indexOf(b,a,c)},a.map=function(b,c){return e.map(a.makeArray(b||[]),c)},a.extend=function(b){if(b===!0){var c=a.makeArray(arguments);return c.shift(),e.mixin.apply(e,c)}return e.mixin.apply(e,arguments)},a.isEmptyObject=function(a){var b;for(b in a)break;return b===undefined},a.param=function(b){var c=[],d=function(a,b){c.push(encodeURIComponent(a)+"="+encodeURIComponent(b))};for(var e in b)a.buildParam(e,b[e],d);return c.join("&").replace(/%20/g,"+")},a.buildParam=function(b,c,d){if(a.isArray(c))for(var f=0,g=c.length;g>f;++f)d(b+"[]",c[f]);else if(e.isObject(c))for(var h in c)a.buildParam(b+"["+h+"]",c[h],d);else d(b,c)},a.proxy=function(a,b){return e.hitch(b,a)},a.isFunction=function(a){return e.isFunction(a)};var f=0,g=function(b,c,d){b.forEach(function(b){b=new e.NodeList("SELECT"===b.nodeName?[b]:b);var g=a.data(b,"events");g||a.data(b,"events",g={}),g[c]||(g[c]={}),d.__bindingsIds===undefined&&(d.__bindingsIds=f++),g[c][d.__bindingsIds]=b.on(c,d)[0]})},h=function(b,c,d){b.forEach(function(b){var f=new e.NodeList(b),g=a.data(f,"events");if(g){var h=g[c];if(h){var i=h[d.__bindingsIds];e.disconnect(i),delete h[d.__bindingsIds],a.isEmptyObject(h)&&delete g[c]}}})};a.bind=function(b,c){return this.bind&&this.bind!==a.bind?this.bind(b,c):this.on||this.nodeType?g(new e.NodeList("SELECT"===this.nodeName?[this]:this),b,c):this.addEvent?this.addEvent(b,c):a.addEvent.call(this,b,c),this},a.unbind=function(b,c){return this.unbind&&this.unbind!==a.unbind?this.unbind(b,c):this.on||this.nodeType?h(new e.NodeList(this),b,c):a.removeEvent.call(this,b,c),this},a.on=a.bind,a.off=a.unbind,a.trigger=function(b,c,d,f){if(b instanceof e.NodeList||!b.nodeName&&b!==window||(b=a.$(b)),b.trigger)if(f===!1){if(!b[0]||3===b[0].nodeType)return;var g=b.on(c,function(a){a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0,a._stopper&&a._stopper(),e.disconnect(g)});b.trigger(c,d)}else b.trigger(c,d);else"string"==typeof c&&(c={type:c}),c.target=c.target||b,a.dispatch.call(b,c,a.makeArray(d))},a.delegate=function(b,c,d){return b?this.on||this.nodeType?g(new e.NodeList(this),b+":"+c,d):this.delegate?this.delegate(b,c,d):a.bind.call(this,c,d):a.bind.call(this,c,d),this},a.undelegate=function(b,c,d){return b?this.on||this.nodeType?h(new e.NodeList(this),b+":"+c,d):this.undelegate?this.undelegate(b,c,d):a.unbind.call(this,c,d):a.unbind.call(this,c,d),this};var i=function(a,b){for(var c in a)b[c]="function"==typeof b[c]?function(){a[c].apply(a,arguments)}:c[a]};a.ajax=function(b){var c=a.capitalize((b.type||"get").toLowerCase()),d=e["xhr"+c],f=b.success,g=b.error,h=new a.Deferred,j=d({url:b.url,handleAs:b.dataType,sync:!b.async,headers:b.headers,content:b.data});j.then(function(a){i(k,h),h.resolve(a,"success",k),f&&f(a,"success",k)},function(){i(k,h),h.reject(k,"error"),g(k,"error")});var k=j.ioArgs.xhr;return i(k,h),h},a.$=function(a){return a===window?window:"string"==typeof a?e.query(a):new e.NodeList(a&&a.nodeName?[a]:a)},a.append=function(a,b){return a.forEach(function(a){e.place(b,a)})};var j={},k=a.uuid=+new Date,l=a.expando="can"+k,m=function(b){for(var c=[],d=0,f=b.length;f>d;d++)1===b[d].nodeType&&c.push(b[d]);a.trigger(new e.NodeList(c),"removed",[],!1),d=0;for(var g;(g=b[d])!==undefined;d++){var h=g[l];delete j[h]}};a.data=function(a,b,e){return e===undefined?0===a.length?undefined:c(a[0],b):a.forEach(function(a){d(a,b,e)})},a.cleanData=function(a,b){var c=a[l];delete j[c][b]},e.empty=function(a){for(var b;b=a.lastChild;)e.destroy(b)};var n=e.destroy;e.destroy=function(b){b=e.byId(b);var c=[b];return b.getElementsByTagName&&c.concat(a.makeArray(b.getElementsByTagName("*"))),m(c),n.apply(e,arguments)};var o=e.place;e.place=function(b,c,d){"string"==typeof b&&/^\s*</.test(b)&&(b=a.buildFragment(b));var e;e=11===b.nodeType?a.makeArray(b.childNodes):[b];var f=o.call(this,b,c,d);return a.inserted(e),f},a.addClass=function(a,b){return a.addClass(b)},a.remove=function(b){var c=[];return b.forEach(function(b){c.push(b),b.getElementsByTagName&&c.push.apply(c,a.makeArray(b.getElementsByTagName("*")))}),m(c),b.forEach(n),b},a.get=function(a,b){return a[b]},a.has=function(a,b){return e.isDescendant(b,a[0])?a:[]},a.extend(e.Deferred.prototype,{pipe:function(a,b){var c=new e.Deferred;return this.addCallback(function(){c.resolve(a.apply(this,arguments))}),this.addErrback(function(){b?c.reject(b.apply(this,arguments)):c.reject.apply(c,arguments)}),c}}),a.attr=b,delete b.MutationObserver;var p=e.NodeList.prototype.on;e.NodeList.prototype.on=function(b){"attributes"===b&&this.forEach(function(b){var c=a.$(b);a.data(c,"canHasAttributesBindings",(a.data(c,"canHasAttributesBindings")||0)+1)});var c=p.apply(this,arguments);if("attributes"===b){var d=this;a.each(c,function(b,c){var e=b.remove;b.remove=function(){var b=a.$(d[c]),f=a.data(b,"canHasAttributesBindings")||0;return 0>=f?a.cleanData(d[c],"canHasAttributesBindings"):a.data(b,"canHasAttributesBindings",f-1),e.call(this,arguments)}})}return c};var q=e.setAttr;e.setAttr=function(b,c){var d=e.getAttr(b,c),f=q.apply(this,arguments),g=e.getAttr(b,c);return g!==d&&a.attr.trigger(b,c,d),f};var r=e.removeAttr;return e.removeAttr=function(b,c){var d=e.getAttr(b,c),f=r.apply(this,arguments);return null!=d&&a.attr.trigger(b,c,d),f},a}(__m3,__m4,{},__m6,__m7,__m8,__m9,__m10,__m11,__m12),__m14=function(a){var b=a.isFunction,c=a.makeArray,d=1,e=function(a){var b=function(){return j.frag(a.apply(this,arguments))};return b.render=function(){return a.apply(a,arguments)},b},f=function(a,b){if(!a.length)throw"can.view: No template or empty template:"+b},g=function(c,d){if(b(c)){var e=a.Deferred();return e.resolve(c)}var g,h,i,k="string"==typeof c?c:c.url,l=c.engine&&"."+c.engine||k.match(/\.[\w\d]+$/);if(k.match(/^#/)&&(k=k.substr(1)),(h=document.getElementById(k))&&(l="."+h.type.match(/\/(x\-)?(.+)/)[2]),l||j.cached[k]||(k+=l=j.ext),a.isArray(l)&&(l=l[0]),i=j.toId(k),k.match(/^\/\//)&&(k=k.substr(2),k=window.steal?steal.config().root.mapJoin(""+steal.id(k)):k),window.require&&require.toUrl&&(k=require.toUrl(k)),g=j.types[l],j.cached[i])return j.cached[i];if(h)return j.registerView(i,h.innerHTML,g);var m=new a.Deferred;return a.ajax({async:d,url:k,dataType:"text",error:function(a){f("",k),m.reject(a)},success:function(a){f(a,k),j.registerView(i,a,g,m)}}),m},h=function(b){var c=[];if(a.isDeferred(b))return[b];for(var d in b)a.isDeferred(b[d])&&c.push(b[d]);return c},i=function(b){return a.isArray(b)&&"success"===b[1]?b[0]:b},j=a.view=a.template=function(a,c,d,e){return b(d)&&(e=d,d=undefined),j.renderAs("fragment",a,c,d,e)};return a.extend(j,{frag:function(a,b){return j.hookup(j.fragment(a),b)},fragment:function(b){if("string"!=typeof b&&11===b.nodeType)return b;var c=a.buildFragment(b,document.body);return c.childNodes.length||c.appendChild(document.createTextNode("")),c},toId:function(b){return a.map(b.toString().split(/\/|\./g),function(a){return a?a:void 0}).join("_")},toStr:function(a){return null==a?"":""+a},hookup:function(b,c){var d,e,f=[];return a.each(b.childNodes?a.makeArray(b.childNodes):b,function(b){1===b.nodeType&&(f.push(b),f.push.apply(f,a.makeArray(b.getElementsByTagName("*"))))}),a.each(f,function(a){a.getAttribute&&(d=a.getAttribute("data-view-id"))&&(e=j.hookups[d])&&(e(a,c,d),delete j.hookups[d],a.removeAttribute("data-view-id"))}),b},hookups:{},hook:function(a){return j.hookups[++d]=a," data-view-id='"+d+"'"},cached:{},cachedRenderers:{},cache:!0,register:function(b){this.types["."+b.suffix]=b,a[b.suffix]=j[b.suffix]=function(a,c){var d,f;if(!c)return f=function(){return d||(d=b.fragRenderer?b.fragRenderer(null,a):e(b.renderer(null,a))),d.apply(this,arguments)},f.render=function(){var c=b.renderer(null,a);return c.apply(c,arguments)},f;var g=function(){return d||(d=b.fragRenderer?b.fragRenderer(a,c):b.renderer(a,c)),d.apply(this,arguments)};return b.fragRenderer?j.preload(a,g):j.preloadStringRenderer(a,g)}},types:{},ext:".ejs",registerScript:function(a,b,c){return"can.view.preloadStringRenderer('"+b+"',"+j.types["."+a].script(b,c)+");"},preload:function(b,c){var d=j.cached[b]=(new a.Deferred).resolve(function(a,b){return c.call(a,a,b)});return d.__view_id=b,j.cachedRenderers[b]=c,c},preloadStringRenderer:function(a,b){return this.preload(a,e(b))},render:function(b,c,d,e){return a.view.renderAs("string",b,c,d,e)},renderTo:function(a,b,c,d){return("string"===a&&b.render?b.render:b)(c,d)},renderAs:function(d,e,f,k,l){b(k)&&(l=k,k=undefined);var m,n,o,p,q,r=h(f);if(r.length)return n=new a.Deferred,o=a.extend({},f),r.push(g(e,!0)),a.when.apply(a,r).then(function(b){var e,g=c(arguments),h=g.pop();if(a.isDeferred(f))o=i(b);else for(var j in f)a.isDeferred(f[j])&&(o[j]=i(g.shift()));e=a.view.renderTo(d,h,o,k),n.resolve(e,o),l&&l(e,o)},function(){n.reject.apply(n,arguments)}),n;if(m=a.__clearReading(),p=b(l),n=g(e,p),m&&a.__setReading(m),p)q=n,n.then(function(b){l(f?a.view.renderTo(d,b,f,k):b)});else{if("resolved"===n.state()&&n.__view_id){var s=j.cachedRenderers[n.__view_id];return f?a.view.renderTo(d,s,f,k):s}n.then(function(b){q=f?a.view.renderTo(d,b,f,k):b})}return q},registerView:function(b,c,d,f){var g,h="object"==typeof d?d:j.types[d||j.ext];return g=h.fragRenderer?h.fragRenderer(b,c):e(h.renderer(b,c)),f=f||new a.Deferred,j.cache&&(j.cached[b]=f,f.__view_id=b,j.cachedRenderers[b]=g),f.resolve(g)}}),a}(__m2),__m13=function(a){var b=a.view.attr=function(a,b){if(!b){var e=c[a];if(!e)for(var f=0,g=d.length;g>f;f++){var h=d[f];if(h.match.test(a)){e=h.handler;break}}return e}"string"==typeof a?c[a]=b:d.push({match:a,handler:b})},c={},d=[],e=/[-\:]/,f=a.view.tag=function(a,b){if(!b){var c=g[a.toLowerCase()];return!c&&e.test(a)&&(c=function(){}),c}window.html5&&(window.html5.elements+=" "+a,window.html5.shivDocument()),g[a.toLowerCase()]=b},g={};return a.view.callbacks={_tags:g,_attributes:c,_regExpAttributes:d,tag:f,attr:b,tagHandler:function(b,c,d){var e,f=d.options.attr("tags."+c),h=f||g[c],i=d.scope;if(h){var j=a.__clearReading();e=h(b,d),a.__setReading(j)}else e=i;if(e&&d.subtemplate){i!==e&&(i=i.add(e));var k=d.subtemplate(i,d.options),l="string"==typeof k?a.view.frag(k):k;a.appendChild(b,l)}}},a.view.callbacks}(__m2,__m14),__m17=function(a){var b=/_|-/,c=/\=\=/,d=/([A-Z]+)([A-Z][a-z])/g,e=/([a-z\d])([A-Z])/g,f=/([a-z\d])([A-Z])/g,g=/\{([^\}]+)\}/g,h=/"/g,i=/'/g,j=/-+(.)?/g,k=/[a-z][A-Z]/g,l=function(a,b,c){var d=a[b];return d===undefined&&c===!0&&(d=a[b]={}),d},m=function(a){return/^f|^o/.test(typeof a)},n=function(a){var b=null===a||a===undefined||isNaN(a)&&""+a=="NaN";return""+(b?"":a)};return a.extend(a,{esc:function(a){return n(a).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(h,"&#34;").replace(i,"&#39;")},getObject:function(b,c,d){var e,f,g,h,i=b?b.split("."):[],j=i.length,k=0;if(c=a.isArray(c)?c:[c||window],h=c.length,!j)return c[0];for(k;h>k;k++){for(e=c[k],g=undefined,f=0;j>f&&m(e);f++)g=e,e=l(g,i[f]);if(g!==undefined&&e!==undefined)break}if(d===!1&&e!==undefined&&delete g[i[f-1]],d===!0&&e===undefined)for(e=c[0],f=0;j>f&&m(e);f++)e=l(e,i[f],!0);return e},capitalize:function(a){return a.charAt(0).toUpperCase()+a.slice(1)},camelize:function(a){return n(a).replace(j,function(a,b){return b?b.toUpperCase():""})},hyphenate:function(a){return n(a).replace(k,function(a){return a.charAt(0)+"-"+a.charAt(1).toLowerCase()})},underscore:function(a){return a.replace(c,"/").replace(d,"$1_$2").replace(e,"$1_$2").replace(f,"_").toLowerCase()},sub:function(b,c,d){var e=[];return b=b||"",e.push(b.replace(g,function(b,f){var g=a.getObject(f,c,d===!0?!1:undefined);return g===undefined||null===g?(e=null,""):m(g)&&e?(e.push(g),""):""+g})),null===e?e:e.length<=1?e[0]:e},replacer:g,undHash:b}),a}(__m2),__m16=function(a){var b=0,c=function(a,b){var c=Object.getOwnPropertyDescriptor(a,b);return c&&(c.get||c.set)?c:null},d=function(b,d,e){e=e||b;var f;for(var g in b)(f=c(b,g))?this._defineProperty(e,d,g,f):a.Construct._overwrite(e,d,g,b[g])},e=function(b,c,d){d=d||b;for(var e in b)a.Construct._overwrite(d,c,e,b[e])};return a.Construct=function(){return arguments.length?a.Construct.extend.apply(a.Construct,arguments):void 0},a.extend(a.Construct,{constructorExtends:!0,newInstance:function(){var a,b=this.instance();return b.setup&&(a=b.setup.apply(b,arguments)),b.init&&b.init.apply(b,a||arguments),b},_inherit:Object.getOwnPropertyDescriptor?d:e,_defineProperty:function(a,b,c,d){Object.defineProperty(a,c,d)},_overwrite:function(a,b,c,d){a[c]=d},setup:function(b){this.defaults=a.extend(!0,{},b.defaults,this.defaults)},instance:function(){b=1;var a=new this;return b=0,a},extend:function(c,d,e){function f(){return b?void 0:this.constructor!==f&&arguments.length&&f.constructorExtends?f.extend.apply(f,arguments):f.newInstance.apply(f,arguments)}var g=c,h=d,i=e;"string"!=typeof g&&(i=h,h=g,g=null),i||(i=h,h=null),i=i||{};var j,k,l,m,n,o,p,q,r=this,s=this.prototype;q=this.instance(),a.Construct._inherit(i,s,q);for(n in r)r.hasOwnProperty(n)&&(f[n]=r[n]);a.Construct._inherit(h,r,f),g&&(j=g.split("."),o=j.pop(),k=a.getObject(j.join("."),window,!0),p=k,l=a.underscore(g.replace(/\./g,"_")),m=a.underscore(o),k[o]=f),a.extend(f,{constructor:f,prototype:q,namespace:p,_shortName:m,fullName:g,_fullName:l}),o!==undefined&&(f.shortName=o),f.prototype.constructor=f;var t=[r].concat(a.makeArray(arguments)),u=f.setup.apply(f,t);return f.init&&f.init.apply(f,u||t),f}}),a.Construct.prototype.setup=function(){},a.Construct.prototype.init=function(){},a.Construct}(__m17),__m15=function(a){var b,c=function(b,c,d){return a.bind.call(b,c,d),function(){a.unbind.call(b,c,d)}},d=a.isFunction,e=a.extend,f=a.each,g=[].slice,h=/\{([^\}]+)\}/g,i=a.getObject("$.event.special",[a])||{},j=function(b,c,d,e){return a.delegate.call(b,c,d,e),function(){a.undelegate.call(b,c,d,e)}},k=function(b,d,e,f){return f?j(b,a.trim(f),d,e):c(b,d,e)},l=a.Control=a.Construct({setup:function(){if(a.Construct.setup.apply(this,arguments),a.Control){var b,c=this;c.actions={};for(b in c.prototype)c._isAction(b)&&(c.actions[b]=c._action(b))}},_shifter:function(b,c){var e="string"==typeof c?b[c]:c;return d(e)||(e=b[e]),function(){return b.called=c,e.apply(b,[this.nodeName?a.$(this):this].concat(g.call(arguments,0)))}},_isAction:function(a){var b=this.prototype[a],c=typeof b;return"constructor"!==a&&("function"===c||"string"===c&&d(this.prototype[b]))&&!!(i[a]||m[a]||/[^\w]/.test(a))},_action:function(c,d){if(h.lastIndex=0,d||!h.test(c)){var e=d?a.sub(c,this._lookup(d)):c;if(!e)return null;var f=a.isArray(e),g=f?e[1]:e,i=g.split(/\s+/g),j=i.pop();return{processor:m[j]||b,parts:[g,i.join(" "),j],delegate:f?e[0]:undefined}}},_lookup:function(a){return[a,window]},processors:{},defaults:{}},{setup:function(b,c){var d,f=this.constructor,g=f.pluginName||f._fullName;return this.element=a.$(b),g&&"can_control"!==g&&this.element.addClass(g),d=a.data(this.element,"controls"),d||(d=[],a.data(this.element,"controls",d)),d.push(this),this.options=e({},f.defaults,c),this.on(),[this.element,this.options]},on:function(b,c,d,e){if(!b){this.off();var f,g,h=this.constructor,i=this._bindings,j=h.actions,l=this.element,m=a.Control._shifter(this,"destroy");for(f in j)j.hasOwnProperty(f)&&(g=j[f]||h._action(f,this.options,this),g&&(i.control[f]=g.processor(g.delegate||l,g.parts[2],g.parts[1],f,this)));return a.bind.call(l,"removed",m),i.user.push(function(b){a.unbind.call(b,"removed",m)}),i.user.length}return"string"==typeof b&&(e=d,d=c,c=b,b=this.element),e===undefined&&(e=d,d=c,c=null),"string"==typeof e&&(e=a.Control._shifter(this,e)),this._bindings.user.push(k(b,d,e,c)),this._bindings.user.length},off:function(){var a=this.element[0],b=this._bindings;b&&(f(b.user||[],function(b){b(a)}),f(b.control||{},function(b){b(a)})),this._bindings={user:[],control:{}}},destroy:function(){if(null!==this.element){var b,c=this.constructor,d=c.pluginName||c._fullName;this.off(),d&&"can_control"!==d&&this.element.removeClass(d),b=a.data(this.element,"controls"),b.splice(a.inArray(this,b),1),a.trigger(this,"destroyed"),this.element=null}}}),m=a.Control.processors;return b=function(b,c,d,e,f){return k(b,c,a.Control._shifter(f,e),d)},f(["change","click","contextmenu","dblclick","keydown","keyup","keypress","mousedown","mousemove","mouseout","mouseover","mouseup","reset","resize","scroll","select","submit","focusin","focusout","mouseenter","mouseleave","touchstart","touchmove","touchcancel","touchend","touchleave","inserted","removed"],function(a){m[a]=b}),l}(__m2,__m16),__m20=function(a){return a.bindAndSetup=function(){return a.addEvent.apply(this,arguments),this._init||(this._bindings?this._bindings++:(this._bindings=1,this._bindsetup&&this._bindsetup())),this},a.unbindAndTeardown=function(){return a.removeEvent.apply(this,arguments),null===this._bindings?this._bindings=0:this._bindings--,!this._bindings&&this._bindteardown&&this._bindteardown(),this},a}(__m2),__m21=function(a){var b=a.bubble={event:function(a,b){return a.constructor._bubbleRule(b,a)},childrenOf:function(a,c){a._each(function(d,e){d&&d.bind&&b.toParent(d,a,e,c)})},teardownChildrenFrom:function(a,c){a._each(function(d){b.teardownFromParent(a,d,c)})},toParent:function(b,c,d,e){a.listenTo.call(c,b,e,function(){var e=a.makeArray(arguments),f=e.shift();e[0]=(a.List&&c instanceof a.List?c.indexOf(b):d)+(e[0]?"."+e[0]:""),f.triggeredNS=f.triggeredNS||{},f.triggeredNS[c._cid]||(f.triggeredNS[c._cid]=!0,a.trigger(c,f,e))})},teardownFromParent:function(b,c,d){c&&c.unbind&&a.stopListening.call(b,c,d)},isBubbling:function(a,b){return a._bubbleBindings&&a._bubbleBindings[b]},bind:function(a,c){if(!a._init){var d=b.event(a,c);d&&(a._bubbleBindings||(a._bubbleBindings={}),a._bubbleBindings[d]?a._bubbleBindings[d]++:(a._bubbleBindings[d]=1,b.childrenOf(a,d)))}},unbind:function(c,d){var e=b.event(c,d);e&&(c._bubbleBindings&&c._bubbleBindings[e]--,c._bubbleBindings&&!c._bubbleBindings[e]&&(delete c._bubbleBindings[e],b.teardownChildrenFrom(c,e),a.isEmptyObject(c._bubbleBindings)&&delete c._bubbleBindings))},add:function(c,d,e){if(d instanceof a.Map&&c._bubbleBindings)for(var f in c._bubbleBindings)c._bubbleBindings[f]&&(b.teardownFromParent(c,d,f),b.toParent(d,c,e,f))},removeMany:function(a,c){for(var d=0,e=c.length;e>d;d++)b.remove(a,c[d])},remove:function(c,d){if(d instanceof a.Map&&c._bubbleBindings)for(var e in c._bubbleBindings)c._bubbleBindings[e]&&b.teardownFromParent(c,d,e)},set:function(c,d,e,f){return a.Map.helpers.isObservable(e)&&b.add(c,e,d),a.Map.helpers.isObservable(f)&&b.remove(c,f),e}};return b}(__m2),__m22=function(a){var b=1,c=0,d=[],e=[];a.batch={start:function(a){c++,a&&e.push(a)},stop:function(f,g){if(f?c=0:c--,0===c){var h,i,j=d.slice(0),k=e.slice(0);for(d=[],e=[],b++,g&&a.batch.start(),h=0,i=j.length;i>h;h++)a.dispatch.apply(j[h][0],j[h][1]);for(h=0,i=k.length;h<k.length;h++)k[h]()}},trigger:function(e,f,g){if(!e._init){if(0===c)return a.dispatch.call(e,f,g);f="string"==typeof f?{type:f}:f,f.batchNum=b,d.push([e,[f,g]])}}}}(__m3),__m19=function(a,b,c){var d=null,e=function(){for(var a in d)d[a].added&&delete d[a].obj._cid;d=null},f=function(a){return d&&d[a._cid]&&d[a._cid].instance},g=null,h=a.Map=a.Construct.extend({setup:function(){if(a.Construct.setup.apply(this,arguments),a.Map){this.defaults||(this.defaults={}),this._computes=[];for(var b in this.prototype)"define"!==b&&"constructor"!==b&&("function"!=typeof this.prototype[b]||this.prototype[b].prototype instanceof a.Construct)?this.defaults[b]=this.prototype[b]:this.prototype[b].isComputed&&this._computes.push(b);this.helpers.define&&this.helpers.define(this)}!a.List||this.prototype instanceof a.List||(this.List=h.List.extend({Map:this},{}))},_bubble:c,_bubbleRule:function(a){return("change"===a||a.indexOf(".")>=0)&&"change"},_computes:[],bind:a.bindAndSetup,on:a.bindAndSetup,unbind:a.unbindAndTeardown,off:a.unbindAndTeardown,id:"id",helpers:{define:null,attrParts:function(a,b){return b?[a]:"object"==typeof a?a:(""+a).split(".")},addToMap:function(b,c){var f;d||(f=e,d={});var g=b._cid,h=a.cid(b);return d[h]||(d[h]={obj:b,instance:c,added:!g}),f},isObservable:function(b){return b instanceof a.Map||b&&b===a.route},canMakeObserve:function(b){return b&&!a.isDeferred(b)&&(a.isArray(b)||a.isPlainObject(b))},serialize:function(b,c,d){var e=a.cid(b),f=!1;return g||(f=!0,g={attr:{},serialize:{}}),g[c][e]=d,b.each(function(e,f){var i,j=h.helpers.isObservable(e),k=j&&g[c][a.cid(e)];i=k?k:"serialize"===c?h.helpers._serialize(b,f,e):h.helpers._getValue(b,f,e,c),i!==undefined&&(d[f]=i)}),a.__reading(b,"__keys"),f&&(g=null),d
  },_serialize:function(a,b,c){return h.helpers._getValue(a,b,c,"serialize")},_getValue:function(a,b,c,d){return h.helpers.isObservable(c)?c[d]():c}},keys:function(b){var c=[];a.__reading(b,"__keys");for(var d in b._data)c.push(d);return c}},{setup:function(b){b instanceof a.Map&&(b=b.serialize()),this._data={},a.cid(this,".map"),this._init=1,this._computedBindings={};var c=this._setupDefaults(b);this._setupComputes(c);var d=b&&a.Map.helpers.addToMap(b,this),e=a.extend(a.extend(!0,{},c),b);this.attr(e),d&&d(),this.bind("change",a.proxy(this._changes,this)),delete this._init},_setupComputes:function(){for(var a,b=this.constructor._computes,c=0,d=b.length;d>c;c++)a=b[c],this[a]=this[a].clone(this),this._computedBindings[a]={count:0}},_setupDefaults:function(){return this.constructor.defaults||{}},_bindsetup:function(){},_bindteardown:function(){},_changes:function(b,c,d,e,f){a.batch.trigger(this,{type:c,batchNum:b.batchNum,target:b.target},[e,f])},_triggerChange:function(b,d,e,f){c.isBubbling(this,"change")?a.batch.trigger(this,{type:"change",target:this},[b,d,e,f]):a.batch.trigger(this,b,[e,f]),("remove"===d||"add"===d)&&a.batch.trigger(this,{type:"__keys",target:this})},_each:function(a){var b=this.__get();for(var c in b)b.hasOwnProperty(c)&&a(b[c],c)},attr:function(b,c){var d=typeof b;return"string"!==d&&"number"!==d?this._attrs(b,c):1===arguments.length?(a.__reading(this,b),this._get(b)):(this._set(b,c),this)},each:function(){return a.each.apply(undefined,[this].concat(a.makeArray(arguments)))},removeAttr:function(b){var c=a.List&&this instanceof a.List,d=a.Map.helpers.attrParts(b),e=d.shift(),f=c?this[e]:this._data[e];return d.length&&f?f.removeAttr(d):("string"==typeof b&&~b.indexOf(".")&&(e=b),this._remove(e,f),f)},_remove:function(a,b){a in this._data&&(delete this._data[a],a in this.constructor.prototype||delete this[a],this._triggerChange(a,"remove",undefined,b))},_get:function(a){a=""+a;var b=a.indexOf(".");if(b>=0){var c=this.__get(a);if(c!==undefined)return c;var d=a.substr(0,b),e=a.substr(b+1),f=this.__get(d);return f&&f._get?f._get(e):undefined}return this.__get(a)},__get:function(a){return a?this._computedBindings[a]?this[a]():this._data[a]:this._data},__type:function(b){if(!(b instanceof a.Map)&&a.Map.helpers.canMakeObserve(b)){var c=f(b);if(c)return c;if(a.isArray(b)){var d=a.List;return new d(b)}var e=this.constructor.Map||a.Map;return new e(b)}return b},_set:function(a,b,c){a=""+a;var d,e=a.indexOf(".");if(!c&&e>=0){var f=a.substr(0,e),g=a.substr(e+1);if(d=this._init?undefined:this.__get(f),!h.helpers.isObservable(d))throw"can.Map: Object does not exist";d._set(g,b)}else this.__convert&&(b=this.__convert(a,b)),d=this._init?undefined:this.__get(a),this.__set(a,this.__type(b,a),d)},__set:function(a,b,c){if(b!==c){var d=c!==undefined||this.__get().hasOwnProperty(a)?"set":"add";this.___set(a,this.constructor._bubble.set(this,a,b,c)),this._triggerChange(a,d,b,c),c&&this.constructor._bubble.teardownFromParent(this,c)}},___set:function(a,b){this._computedBindings[a]?this[a](b):this._data[a]=b,"function"==typeof this.constructor.prototype[a]||this._computedBindings[a]||(this[a]=b)},bind:function(b){var c=this._computedBindings&&this._computedBindings[b];if(c)if(c.count)c.count++;else{c.count=1;var d=this;c.handler=function(c,e,f){a.batch.trigger(d,{type:b,batchNum:c.batchNum,target:d},[e,f])},this[b].bind("change",c.handler)}return this.constructor._bubble.bind(this,b),a.bindAndSetup.apply(this,arguments)},unbind:function(b){var c=this._computedBindings&&this._computedBindings[b];return c&&(1===c.count?(c.count=0,this[b].unbind("change",c.handler),delete c.handler):c.count--),this.constructor._bubble.unbind(this,b),a.unbindAndTeardown.apply(this,arguments)},serialize:function(){return a.Map.helpers.serialize(this,"serialize",{})},_attrs:function(b,c){if(b===undefined)return h.helpers.serialize(this,"attr",{});b=a.simpleExtend({},b);var d,e,f=this;a.batch.start(),this.each(function(a,d){if("_cid"!==d){if(e=b[d],e===undefined)return void(c&&f.removeAttr(d));f.__convert&&(e=f.__convert(d,e)),h.helpers.isObservable(e)?f.__set(d,f.__type(e,d),a):h.helpers.isObservable(a)&&h.helpers.canMakeObserve(e)?a.attr(e,c):a!==e&&f.__set(d,f.__type(e,d),a),delete b[d]}});for(d in b)"_cid"!==d&&(e=b[d],this._set(d,e,!0));return a.batch.stop(),this},compute:function(b){if(a.isFunction(this.constructor.prototype[b]))return a.compute(this[b],this);var c=b.split("."),d=c.length-1,e={args:[]};return a.compute(function(b){return arguments.length?void a.compute.read(this,c.slice(0,d)).value.attr(c[d],b):a.compute.read(this,c,e).value},this)}});return h.prototype.on=h.prototype.bind,h.prototype.off=h.prototype.unbind,h}(__m2,__m20,__m21,__m16,__m22),__m23=function(a,b,c){var d=[].splice,e=function(){var a={0:"a",length:1};return d.call(a,0,1),!a[0]}(),f=b.extend({Map:b},{setup:function(b,c){this.length=0,a.cid(this,".map"),this._init=1,this._computedBindings={},this._setupComputes(),b=b||[];var d;a.isDeferred(b)?this.replace(b):(d=b.length&&a.Map.helpers.addToMap(b,this),this.push.apply(this,a.makeArray(b||[]))),d&&d(),this.bind("change",a.proxy(this._changes,this)),a.simpleExtend(this,c),delete this._init},_triggerChange:function(c,d,e,f){b.prototype._triggerChange.apply(this,arguments);var g=+c;~c.indexOf(".")||isNaN(g)||("add"===d?(a.batch.trigger(this,d,[e,g]),a.batch.trigger(this,"length",[this.length])):"remove"===d?(a.batch.trigger(this,d,[f,g]),a.batch.trigger(this,"length",[this.length])):a.batch.trigger(this,d,[e,g]))},__get:function(b){return b?this[b]&&this[b].isComputed&&a.isFunction(this.constructor.prototype[b])?this[b]():this[b]:this},___set:function(a,b){this[a]=b,+a>=this.length&&(this.length=+a+1)},_remove:function(a,b){isNaN(+a)?(delete this[a],this._triggerChange(a,"remove",undefined,b)):this.splice(a,1)},_each:function(a){for(var b=this.__get(),c=0;c<b.length;c++)a(b[c],c)},serialize:function(){return b.helpers.serialize(this,"serialize",[])},splice:function(b,f){var g,h,i=a.makeArray(arguments),j=[];for(g=2,h=i.length;h>g;g++)i[g]=this.__type(i[g],g),j.push(i[g]);f===undefined&&(f=i[1]=this.length-b);var k=d.apply(this,i);if(!e)for(g=this.length;g<k.length+this.length;g++)delete this[g];if(a.batch.start(),f>0&&(c.removeMany(this,k),this._triggerChange(""+b,"remove",undefined,k)),i.length>2){for(g=0,h=j.length;h>g;g++)c.set(this,g,j[g]);this._triggerChange(""+b,"add",j,k)}return a.batch.stop(),k},_attrs:function(c,d){return c===undefined?b.helpers.serialize(this,"attr",[]):(c=a.makeArray(c),a.batch.start(),this._updateAttrs(c,d),void a.batch.stop())},_updateAttrs:function(a,c){for(var d=Math.min(a.length,this.length),e=0;d>e;e++){var f=this[e],g=a[e];b.helpers.isObservable(f)&&b.helpers.canMakeObserve(g)?f.attr(g,c):f!==g&&this._set(e,g)}a.length>this.length?this.push.apply(this,a.slice(this.length)):a.length<this.length&&c&&this.splice(a.length)}}),g=function(b){return b[0]&&a.isArray(b[0])?b[0]:a.makeArray(b)};return a.each({push:"length",unshift:0},function(a,b){var d=[][b];f.prototype[b]=function(){for(var b,e,f=[],g=a?this.length:0,h=arguments.length;h--;)e=arguments[h],f[h]=c.set(this,h,this.__type(e,h));return b=d.apply(this,f),(!this.comparator||f.length)&&this._triggerChange(""+g,"add",f,undefined),b}}),a.each({pop:"length",shift:0},function(a,b){f.prototype[b]=function(){var d=g(arguments),e=a&&this.length?this.length-1:0,f=[][b].apply(this,d);return this._triggerChange(""+e,"remove",undefined,[f]),f&&f.unbind&&c.remove(this,f),f}}),a.extend(f.prototype,{indexOf:function(b,c){return this.attr("length"),a.inArray(b,this,c)},join:function(){return[].join.apply(this.attr(),arguments)},reverse:function(){var b=a.makeArray([].reverse.call(this));this.replace(b)},slice:function(){var a=Array.prototype.slice.apply(this,arguments);return new this.constructor(a)},concat:function(){var b=[];return a.each(a.makeArray(arguments),function(c,d){b[d]=c instanceof a.List?c.serialize():c}),new this.constructor(Array.prototype.concat.apply(this.serialize(),b))},forEach:function(b,c){return a.each(this,b,c||this)},replace:function(b){return a.isDeferred(b)?b.then(a.proxy(this.replace,this)):this.splice.apply(this,[0,this.length].concat(a.makeArray(b||[]))),this},filter:function(b,c){var d,e=new a.List,f=this;return this.each(function(a,g){d=b.call(c|f,a,g,f),d&&e.push(a)}),e}}),a.List=b.List=f,a.List}(__m2,__m19,__m21),__m24=function(a){var b=[];a.__read=function(a,c){b.push({});var d=a.call(c);return{value:d,observed:b.pop()}},a.__reading=function(a,c){b.length&&(b[b.length-1][a._cid+"|"+c]={obj:a,event:c+""})},a.__clearReading=function(){if(b.length){var a=b[b.length-1];return b[b.length-1]={},a}},a.__setReading=function(a){b.length&&(b[b.length-1]=a)},a.__addReading=function(c){b.length&&a.simpleExtend(b[b.length-1],c)};var c=function(b,c,e,g){var h=a.__read(b,c),i=h.observed;return d(e,i,g),f(e,g),h},d=function(a,b,c){for(var d in b)e(a,b,d,c)},e=function(a,b,c,d){if(a[c])delete a[c];else{var e=b[c];e.obj.bind(e.event,d)}},f=function(a,b){for(var c in a){var d=a[c];d.obj.unbind(d.event,b)}},g=function(b,c,d,e){c!==d&&a.batch.trigger(b,e?{type:"change",batchNum:e}:"change",[c,d])},h=function(b,d,e,f){var g,h,i;return{on:function(j){h||(h=function(a){if(b.bound&&(a.batchNum===undefined||a.batchNum!==i)){var f=g.value;g=c(d,e,g.observed,h),j(g.value,f,a.batchNum),i=i=a.batchNum}}),g=c(d,e,{},h),f(g.value),b.hasDependencies=!a.isEmptyObject(g.observed)},off:function(){for(var a in g.observed){var b=g.observed[a];b.obj.unbind(b.event,h)}}}},i=function(b,d,e,f){var g,h,i,j;return{on:function(k){i||(i=function(c){if(b.bound&&(c.batchNum===undefined||c.batchNum!==j)){var f=a.__clearReading(),g=d.call(e);a.__setReading(f),k(g,h,c.batchNum),h=g,j=j=c.batchNum}}),g=c(d,e,{},i),h=g.value,f(g.value),b.hasDependencies=!a.isEmptyObject(g.observed)},off:function(){for(var a in g.observed){var b=g.observed[a];b.obj.unbind(b.event,i)}}}},j=function(b){return b instanceof a.Map||b&&b.__get},k=function(){};a.compute=function(c,d,e,f){if(c&&c.isComputed)return c;for(var j,l,m,n=k,o=k,p=function(){return l},q=function(a){l=a},r=q,s=[],t=function(a,b,c){r(a),g(j,a,b,c)},u=0,v=arguments.length;v>u;u++)s[u]=arguments[u];if(j=function(c){if(arguments.length){var e=l,f=q.call(d,c,e);return j.hasDependencies?p.call(d):(l=f===undefined?p.call(d):f,g(j,l,e),l)}return b.length&&j.canReadForChangeEvent!==!1&&(a.__reading(j,"change"),j.bound||a.compute.temporarilyBind(j)),j.bound?l:p.call(d)},"function"==typeof c){q=c,p=c,j.canReadForChangeEvent=e===!1?!1:!0;var w=f?i(j,c,d||this,r):h(j,c,d||this,r);n=w.on,o=w.off}else if(d)if("string"==typeof d){var x=d,y=c instanceof a.Map;if(y){j.hasDependencies=!0;var z;p=function(){return c.attr(x)},q=function(a){c.attr(x,a)},n=function(b){z=function(a,c,d){b(c,d,a.batchNum)},c.bind(e||x,z),l=a.__read(p).value},o=function(){c.unbind(e||x,z)}}else p=function(){return c[x]},q=function(a){c[x]=a},n=function(b){z=function(){b(p(),l)},a.bind.call(c,e||x,z),l=a.__read(p).value},o=function(){a.unbind.call(c,e||x,z)}}else if("function"==typeof d)l=c,q=d,d=e,m="setter";else{l=c;var A=d,B=t;if(d=A.context||A,p=A.get||p,q=A.set||function(){return l},A.fn){var C,D=A.fn;p=function(){return D.call(d,l)},0===D.length?C=h(j,D,d,r):1===D.length?C=h(j,function(){return D.call(d,l)},d,r):(t=function(a){a!==undefined&&B(a,l)},C=h(j,function(){var a=D.call(d,l,function(a){B(a,l)});return a!==undefined?a:l},d,r)),n=C.on,o=C.off}else t=function(){var a=p.call(d);B(a,l)};n=A.on||n,o=A.off||o}else l=c;return a.cid(j,"compute"),a.simpleExtend(j,{isComputed:!0,_bindsetup:function(){this.bound=!0;var b=a.__clearReading();n.call(this,t),a.__setReading(b)},_bindteardown:function(){o.call(this,t),this.bound=!1},bind:a.bindAndSetup,unbind:a.unbindAndTeardown,clone:function(b){return b&&("setter"===m?s[2]=b:s[1]=b),a.compute.apply(a,s)}})};var l,m=function(){for(var a=0,b=l.length;b>a;a++)l[a].unbind("change",k);l=null};return a.compute.temporarilyBind=function(a){a.bind("change",k),l||(l=[],setTimeout(m,10)),l.push(a)},a.compute.truthy=function(b){return a.compute(function(){var a=b();return"function"==typeof a&&(a=a()),!!a})},a.compute.async=function(b,c,d){return a.compute(b,{fn:c,context:d})},a.compute.read=function(b,c,d){d=d||{};for(var e,f,g,h=b,i=0,k=c.length;k>i;i++)if(f=h,f&&f.isComputed&&(d.foundObservable&&d.foundObservable(f,i),f=h=f()),j(f)?(!g&&d.foundObservable&&d.foundObservable(f,i),g=1,h="function"==typeof f[c[i]]&&f.constructor.prototype[c[i]]===f[c[i]]?d.returnObserveMethods?h[c[i]]:"constructor"===c[i]&&f instanceof a.Construct||f[c[i]].prototype instanceof a.Construct?f[c[i]]:f[c[i]].apply(f,d.args||[]):h.attr(c[i])):h=null==h?undefined:f[c[i]],e=typeof h,h&&h.isComputed&&!d.isArgument&&k-1>i?(!g&&d.foundObservable&&d.foundObservable(f,i+1),h=h()):i<c.length-1&&"function"===e&&d.executeAnonymousFunctions&&!(a.Construct&&h.prototype instanceof a.Construct)&&(h=h()),i<c.length-1&&(null===h||"function"!==e&&"object"!==e))return d.earlyExit&&d.earlyExit(f,i,h),{value:undefined,parent:f};return"function"!=typeof h||a.Construct&&h.prototype instanceof a.Construct||a.route&&h===a.route||(d.isArgument?h.isComputed||d.proxyMethods===!1||(h=a.proxy(h,f)):(h.isComputed&&!g&&d.foundObservable&&d.foundObservable(h,i),h=h.call(f))),h===undefined&&d.earlyExit&&d.earlyExit(f,i-1),{value:h,parent:f}},a.compute.set=function(a,b,c){return j(a)?a.attr(b,c):a[b]&&a[b].isComputed?a[b](c):void("object"==typeof a&&(a[b]=c))},a.compute}(__m2,__m20,__m22),__m18=function(a){return a.Observe=a.Map,a.Observe.startBatch=a.batch.start,a.Observe.stopBatch=a.batch.stop,a.Observe.triggerBatch=a.batch.trigger,a}(__m2,__m19,__m23,__m24),__m26=function(a){var b=/(\\)?\./g,c=/\\\./g,d=function(a){var d=[],e=0;return a.replace(b,function(b,f,g){f||(d.push(a.slice(e,g).replace(c,".")),e=g+b.length)}),d.push(a.slice(e).replace(c,".")),d},e=a.Construct.extend({read:a.compute.read},{init:function(a,b){this._context=a,this._parent=b,this.__cache={}},attr:function(b,c){var d=a.__clearReading(),e=this.read(b,{isArgument:!0,returnObserveMethods:!0,proxyMethods:!1});if(2===arguments.length){var f=b.lastIndexOf("."),g=-1!==f?b.substring(0,f):".",h=this.read(g,{isArgument:!0,returnObserveMethods:!0,proxyMethods:!1}).value;-1!==f&&(b=b.substring(f+1,b.length)),a.compute.set(h,b,c)}return a.__setReading(d),e.value},add:function(a){return a!==this._context?new this.constructor(a,this):this},computeData:function(b,c){c=c||{args:[]};var d,e,f=this,g={compute:a.compute(function(h){if(!arguments.length){if(d)return a.compute.read(d,e,c).value;var i=f.read(b,c);return d=i.rootObserve,e=i.reads,g.scope=i.scope,g.initialValue=i.value,g.reads=i.reads,g.root=d,i.value}if(d.isComputed)d(h);else if(e.length){var j=e.length-1,k=e.length?a.compute.read(d,e.slice(0,j)).value:d;a.compute.set(k,e[j],h)}})};return g},compute:function(a,b){return this.computeData(a,b).compute},read:function(b,c){var e;if("./"===b.substr(0,2))e=!0,b=b.substr(2);else{if("../"===b.substr(0,3))return this._parent.read(b.substr(3),c);if(".."===b)return{value:this._parent._context};if("."===b||"this"===b)return{value:this._context}}for(var f,g,h,i,j,k,l=-1===b.indexOf("\\.")?b.split("."):d(b),m=this,n=[],o=-1;m;){if(f=m._context,null!==f){var p=a.compute.read(f,l,a.simpleExtend({foundObservable:function(a,b){j=a,k=l.slice(b)},earlyExit:function(b,c){c>o&&(g=j,n=k,o=c,i=m,h=a.__clearReading())},executeAnonymousFunctions:!0},c));if(p.value!==undefined)return{scope:m,rootObserve:j,value:p.value,reads:k}}a.__clearReading(),m=e?null:m._parent}return g?(a.__setReading(h),{scope:i,rootObserve:g,reads:n,value:undefined}):{names:l,value:undefined}}});return a.view.Scope=e,e}(__m2,__m16,__m19,__m23,__m14,__m24),__m28=function(a){var b=function(){return 1===a.$(document.createComment("~")).length}(),c={tagToContentPropMap:{option:"textContent"in document.createElement("option")?"textContent":"innerText",textarea:"value"},attrMap:a.attr.map,attrReg:/([^\s=]+)[\s]*=[\s]*/,defaultValue:a.attr.defaultValue,tagMap:{"":"span",colgroup:"col",table:"tbody",tr:"td",ol:"li",ul:"li",tbody:"tr",thead:"tr",tfoot:"tr",select:"option",optgroup:"option"},reverseTagMap:{col:"colgroup",tr:"tbody",option:"select",td:"tr",th:"tr",li:"ul"},getParentNode:function(a,b){return b&&11===a.parentNode.nodeType?b:a.parentNode},setAttr:a.attr.set,getAttr:a.attr.get,removeAttr:a.attr.remove,contentText:function(a){return"string"==typeof a?a:a||0===a?""+a:""},after:function(b,c){var d=b[b.length-1];d.nextSibling?a.insertBefore(d.parentNode,c,d.nextSibling):a.appendChild(d.parentNode,c)},replace:function(d,e){c.after(d,e),a.remove(a.$(d)).length<d.length&&!b&&a.each(d,function(a){8===a.nodeType&&a.parentNode.removeChild(a)})}};return a.view.elements=c,c}(__m2,__m14),__m27=function(can,elements,viewCallbacks){var newLine=/(\r|\n)+/g,notEndTag=/\//,clean=function(a){return a.split("\\").join("\\\\").split("\n").join("\\n").split('"').join('\\"').split("	").join("\\t")},getTag=function(a,b,c){if(a)return a;for(;c<b.length;){if("<"===b[c]&&!notEndTag.test(b[c+1]))return elements.reverseTagMap[b[c+1]]||"span";c++}return""},bracketNum=function(a){return--a.split("{").length- --a.split("}").length},myEval=function(script){eval(script)},attrReg=/([^\s]+)[\s]*=[\s]*$/,startTxt="var ___v1ew = [];",finishTxt="return ___v1ew.join('')",put_cmd="___v1ew.push(\n",insert_cmd=put_cmd,htmlTag=null,quote=null,beforeQuote=null,rescan=null,getAttrName=function(){var a=beforeQuote.match(attrReg);return a&&a[1]},status=function(){return quote?"'"+getAttrName()+"'":htmlTag?1:0},top=function(a){return a[a.length-1]},Scanner;return can.view.Scanner=Scanner=function(a){can.extend(this,{text:{},tokens:[]},a),this.text.options=this.text.options||"",this.tokenReg=[],this.tokenSimple={"<":"<",">":">",'"':'"',"'":"'"},this.tokenComplex=[],this.tokenMap={};for(var b,c=0;b=this.tokens[c];c++)b[2]?(this.tokenReg.push(b[2]),this.tokenComplex.push({abbr:b[1],re:new RegExp(b[2]),rescan:b[3]})):(this.tokenReg.push(b[1]),this.tokenSimple[b[1]]=b[0]),this.tokenMap[b[0]]=b[1];this.tokenReg=new RegExp("("+this.tokenReg.slice(0).concat(["<",">",'"',"'"]).join("|")+")","g")},Scanner.prototype={helpers:[],scan:function(a,b){var c=[],d=0,e=this.tokenSimple,f=this.tokenComplex;a=a.replace(newLine,"\n"),this.transform&&(a=this.transform(a)),a.replace(this.tokenReg,function(b,g){var h=arguments[arguments.length-2];if(h>d&&c.push(a.substring(d,h)),e[b])c.push(b);else for(var i,j=0;i=f[j];j++)if(i.re.test(b)){c.push(i.abbr),i.rescan&&c.push(i.rescan(g));break}d=h+g.length}),d<a.length&&c.push(a.substr(d));var g,h,i,j,k="",l=[startTxt+(this.text.start||"")],m=function(a,b){l.push(put_cmd,'"',clean(a),'"'+(b||"")+");")},n=[],o=null,p=!1,q={attributeHookups:[],tagHookups:[],lastTagHookup:""},r=function(){q.lastTagHookup=q.tagHookups.pop()+q.tagHookups.length},s="",t=[],u=!1,v=!1,w=0,x=this.tokenMap;for(htmlTag=quote=beforeQuote=null;(i=c[w++])!==undefined;){if(null===o)switch(i){case x.left:case x.escapeLeft:case x.returnLeft:p=htmlTag&&1;case x.commentLeft:o=i,k.length&&m(k),k="";break;case x.escapeFull:p=htmlTag&&1,rescan=1,o=x.escapeLeft,k.length&&m(k),rescan=c[w++],k=rescan.content||rescan,rescan.before&&m(rescan.before),c.splice(w,0,x.right);break;case x.commentFull:break;case x.templateLeft:k+=x.left;break;case"<":0!==c[w].indexOf("!--")&&(htmlTag=1,p=0),k+=i;break;case">":htmlTag=0;var y="/"===k.substr(k.length-1)||"--"===k.substr(k.length-2),z="";if(q.attributeHookups.length&&(z="attrs: ['"+q.attributeHookups.join("','")+"'], ",q.attributeHookups=[]),s+q.tagHookups.length!==q.lastTagHookup&&s===top(q.tagHookups))y&&(k=k.substr(0,k.length-1)),l.push(put_cmd,'"',clean(k),'"',",can.view.pending({tagName:'"+s+"',"+z+"scope: "+(this.text.scope||"this")+this.text.options),y?(l.push("}));"),k="/>",r()):"<"===c[w]&&c[w+1]==="/"+s?(l.push("}));"),k=i,r()):(l.push(",subtemplate: function("+this.text.argNames+"){\n"+startTxt+(this.text.start||"")),k="");else if(p||!u&&elements.tagToContentPropMap[t[t.length-1]]||z){var A=",can.view.pending({"+z+"scope: "+(this.text.scope||"this")+this.text.options+'}),"';y?m(k.substr(0,k.length-1),A+'/>"'):m(k,A+'>"'),k="",p=0}else k+=i;(y||u)&&(t.pop(),s=t[t.length-1],u=!1),q.attributeHookups=[];break;case"'":case'"':if(htmlTag)if(quote&&quote===i){quote=null;var B=getAttrName();if(viewCallbacks.attr(B)&&q.attributeHookups.push(B),v){k+=i,m(k),l.push(finishTxt,"}));\n"),k="",v=!1;break}}else if(null===quote&&(quote=i,beforeQuote=g,j=getAttrName(),"img"===s&&"src"===j||"style"===j)){m(k.replace(attrReg,"")),k="",v=!0,l.push(insert_cmd,"can.view.txt(2,'"+getTag(s,c,w)+"',"+status()+",this,function(){",startTxt),m(j+"="+i);break}default:if("<"===g){s="!--"===i.substr(0,3)?"!--":i.split(/\s/)[0];var C,D=!1;0===s.indexOf("/")&&(D=!0,C=s.substr(1)),D?(top(t)===C&&(s=C,u=!0),top(q.tagHookups)===C&&(m(k.substr(0,k.length-1)),l.push(finishTxt+"}}) );"),k="><",r())):(s.lastIndexOf("/")===s.length-1&&(s=s.substr(0,s.length-1)),"!--"!==s&&viewCallbacks.tag(s)&&("content"===s&&elements.tagMap[top(t)]&&(i=i.replace("content",elements.tagMap[top(t)])),q.tagHookups.push(s)),t.push(s))}k+=i}else switch(i){case x.right:case x.returnRight:switch(o){case x.left:h=bracketNum(k),1===h?(l.push(insert_cmd,"can.view.txt(0,'"+getTag(s,c,w)+"',"+status()+",this,function(){",startTxt,k),n.push({before:"",after:finishTxt+"}));\n"})):(d=n.length&&-1===h?n.pop():{after:";"},d.before&&l.push(d.before),l.push(k,";",d.after));break;case x.escapeLeft:case x.returnLeft:h=bracketNum(k),h&&n.push({before:finishTxt,after:"}));\n"});for(var E=o===x.escapeLeft?1:0,F={insert:insert_cmd,tagName:getTag(s,c,w),status:status(),specialAttribute:v},G=0;G<this.helpers.length;G++){var H=this.helpers[G];if(H.name.test(k)){k=H.fn(k,F),H.name.source===/^>[\s]*\w*/.source&&(E=0);break}}"object"==typeof k?k.startTxt&&k.end&&v?l.push(insert_cmd,"can.view.toStr( ",k.content,"() ) );"):(k.startTxt?l.push(insert_cmd,"can.view.txt(\n"+("string"==typeof status()||(null!=k.escaped?k.escaped:E))+",\n'"+s+"',\n"+status()+",\nthis,\n"):k.startOnlyTxt&&l.push(insert_cmd,"can.view.onlytxt(this,\n"),l.push(k.content),k.end&&l.push("));")):v?l.push(insert_cmd,k,");"):l.push(insert_cmd,"can.view.txt(\n"+("string"==typeof status()||E)+",\n'"+s+"',\n"+status()+",\nthis,\nfunction(){ "+(this.text.escape||"")+"return ",k,h?startTxt:"}));\n"),rescan&&rescan.after&&rescan.after.length&&(m(rescan.after.length),rescan=null)}o=null,k="";break;case x.templateLeft:k+=x.left;break;default:k+=i}g=i}k.length&&m(k),l.push(";");var I=l.join(""),J={out:(this.text.outStart||"")+I+" "+finishTxt+(this.text.outEnd||"")};return myEval.call(J,"this.fn = (function("+this.text.argNames+"){"+J.out+"});\r\n//# sourceURL="+b+".js"),J}},can.view.pending=function(a){var b=can.view.getHooks();return can.view.hook(function(c){can.each(b,function(a){a(c)}),a.templateType="legacy",a.tagName&&viewCallbacks.tagHandler(c,a.tagName,a),can.each(a&&a.attrs||[],function(b){a.attributeName=b;var d=viewCallbacks.attr(b);d&&d(c,a)})})},can.view.tag("content",function(a,b){return b.scope}),can.view.Scanner=Scanner,Scanner}(__m14,__m28,__m13),__m31=function(a){var b=!0;try{document.createTextNode("")._=0}catch(c){b=!1}var d={},e={},f="ejs_"+Math.random(),g=0,h=function(a,c){var d=c||e,h=i(a,d);return h?h:b||3!==a.nodeType?(++g,a[f]=(a.nodeName?"element_":"obj_")+g):(++g,d["text_"+g]=a,"text_"+g)},i=function(a,c){if(b||3!==a.nodeType)return a[f];for(var d in c)if(c[d]===a)return d},j=[].splice,k=[].push,l=function(a){for(var b=0,c=0,d=a.length;d>c;c++){var e=a[c];e.nodeType?b++:b+=l(e)}return b},m=function(a,b){for(var c={},d=0,e=a.length;e>d;d++){var f=n.first(a[d]);c[h(f,b)]=a[d]}return c},n={id:h,update:function(b,c){var d=n.unregisterChildren(b);c=a.makeArray(c);var e=b.length;return j.apply(b,[0,e].concat(c)),b.replacements?n.nestReplacements(b):n.nestList(b),d},nestReplacements:function(a){for(var b=0,c={},d=m(a.replacements,c),e=a.replacements.length;b<a.length&&e;){var f=a[b],g=d[i(f,c)];g&&(a.splice(b,l(g),g),e--),b++}a.replacements=[]},nestList:function(a){for(var b=0;b<a.length;){var c=a[b],e=d[h(c)];e?e!==a&&a.splice(b,l(e),e):d[h(c)]=a,b++}},last:function(a){var b=a[a.length-1];return b.nodeType?b:n.last(b)},first:function(a){var b=a[0];return b.nodeType?b:n.first(b)},register:function(a,b,c){return a.unregistered=b,a.parentList=c,c===!0?a.replacements=[]:c?(c.replacements.push(a),a.replacements=[]):n.nestList(a),a},unregisterChildren:function(b){var c=[];return a.each(b,function(a){a.nodeType?(b.replacements||delete d[h(a)],c.push(a)):k.apply(c,n.unregister(a))}),c},unregister:function(a){var b=n.unregisterChildren(a);if(a.unregistered){var c=a.unregistered;delete a.unregistered,delete a.replacements,c()}return b},nodeMap:d};return a.view.nodeLists=n,n}(__m2,__m28),__m32=function(a){function b(a){for(var b={},c=a.split(","),d=0;d<c.length;d++)b[c[d]]=!0;return b}var c="-:A-Za-z0-9_",d="[a-zA-Z_:]["+c+":.]*",e="\\s*=\\s*",f='"((?:\\\\.|[^"])*)"',g="'((?:\\\\.|[^'])*)'",h="(?:"+e+"(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>\\s]+))?",i="\\{\\{[^\\}]*\\}\\}\\}?",j="\\{\\{([^\\}]*)\\}\\}\\}?",k=new RegExp("^<(["+c+"]+)((?:\\s*(?:(?:(?:"+d+")?"+h+")|(?:"+i+")+))*)\\s*(\\/?)>"),l=new RegExp("^<\\/(["+c+"]+)[^>]*>"),m=new RegExp("(?:(?:("+d+")|"+j+")(?:"+e+"(?:(?:"+f+")|(?:"+g+")|([^>\\s]+)))?)","g"),n=new RegExp(j,"g"),o=/<|\{\{/,p=b("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),q=b("address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video"),r=b("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),s=b("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),t=b("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),u=b("script,style"),v=function(a,b){function c(a,c,e,f){if(c=c.toLowerCase(),q[c])for(;i.last()&&r[i.last()];)d("",i.last());s[c]&&i.last()===c&&d("",c),f=p[c]||!!f,b.start(c,f),f||i.push(c),v.parseAttrs(e,b),b.end(c,f)}function d(a,c){var d;if(c)for(d=i.length-1;d>=0&&i[d]!==c;d--);else d=0;if(d>=0){for(var e=i.length-1;e>=d;e--)b.close&&b.close(i[e]);i.length=d}}function e(a,c){b.special&&b.special(c)}var f,g,h,i=[],j=a;for(i.last=function(){return this[this.length-1]};a;){if(g=!0,i.last()&&u[i.last()])a=a.replace(new RegExp("([\\s\\S]*?)</"+i.last()+"[^>]*>"),function(a,c){return c=c.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g,"$1$2"),b.chars&&b.chars(c),""}),d("",i.last());else if(0===a.indexOf("<!--")?(f=a.indexOf("-->"),f>=0&&(b.comment&&b.comment(a.substring(4,f)),a=a.substring(f+3),g=!1)):0===a.indexOf("</")?(h=a.match(l),h&&(a=a.substring(h[0].length),h[0].replace(l,d),g=!1)):0===a.indexOf("<")?(h=a.match(k),h&&(a=a.substring(h[0].length),h[0].replace(k,c),g=!1)):0===a.indexOf("{{")&&(h=a.match(n),h&&(a=a.substring(h[0].length),h[0].replace(n,e))),g){f=a.search(o);var m=0>f?a:a.substring(0,f);a=0>f?"":a.substring(f),b.chars&&m&&b.chars(m)}if(a===j)throw"Parse Error: "+a;j=a}d(),b.done()};return v.parseAttrs=function(a,b){(null!=a?a:"").replace(m,function(a,c,d,e,f,g){if(d&&b.special(d),c||e||f||g){var h=arguments[3]?arguments[3]:arguments[4]?arguments[4]:arguments[5]?arguments[5]:t[c.toLowerCase()]?c:"";b.attrStart(c||"");for(var i,j=n.lastIndex=0,k=n.exec(h);k;)i=h.substring(j,n.lastIndex-k[0].length),i.length&&b.attrValue(i),b.special(k[1]),j=n.lastIndex,k=n.exec(h);i=h.substr(j,h.length),i&&b.attrValue(i),b.attrEnd(c||"")}})},a.view.parser=v,v}(__m14),__m30=function(a,b,c,d,e){b=b||a.view.elements,d=d||a.view.NodeLists,e=e||a.view.parser;var f=function(b,c,d){var e=!1,f=function(){return e||(e=!0,d(g),a.unbind.call(b,"removed",f)),!0},g={teardownCheck:function(a){return a?!1:f()}};return a.bind.call(b,"removed",f),c(g),g},g=function(a,b,c){return f(a,function(){b.bind("change",c)},function(a){b.unbind("change",c),a.nodeList&&d.unregister(a.nodeList)})},h=function(a){var b,c={};return e.parseAttrs(a,{attrStart:function(a){c[a]="",b=a},attrValue:function(a){c[b]+=a},attrEnd:function(){}}),c},i=[].splice,j=function(a){return a&&a.nodeType},k=function(a){a.childNodes.length||a.appendChild(document.createTextNode(""))},l={list:function(c,e,g,h,j,k){var m,n=k||[c],o=[],p=function(c,e,f){var j=document.createDocumentFragment(),l=[],m=[];a.each(e,function(b,c){var e=[];k&&d.register(e,null,!0);var i=a.compute(c+f),n=g.call(h,b,i,e),o="string"==typeof n,p=a.frag(n);p=o?a.view.hookup(p):p;var q=a.makeArray(p.childNodes);k?(d.update(e,q),l.push(e)):l.push(d.register(q)),j.appendChild(p),m.push(i)});var p=f+1;if(n[p]){var q=d.first(n[p]);a.insertBefore(q.parentNode,j,q)}else b.after(1===p?[r]:[d.last(n[p-1])],j);i.apply(n,[p,0].concat(l)),i.apply(o,[f,0].concat(m));for(var s=f+m.length,t=o.length;t>s;s++)o[s](s)},q=function(b,c,e,f,g){if(f||!u.teardownCheck(r.parentNode)){0>e&&(e=o.length+e);var h=n.splice(e+1,c.length),i=[];a.each(h,function(a){var b=d.unregister(a);[].push.apply(i,b)}),o.splice(e,c.length);for(var j=e,k=o.length;k>j;j++)o[j](j);g||a.remove(a.$(i))}},r=document.createTextNode(""),s=function(a){m&&m.unbind&&m.unbind("add",p).unbind("remove",q),q({},{length:n.length-1},0,!0,a)},t=function(a,b){s(),m=b||[],m.bind&&m.bind("add",p).bind("remove",q),p({},m,0)};j=b.getParentNode(c,j);var u=f(j,function(){a.isFunction(e)&&e.bind("change",t)},function(){a.isFunction(e)&&e.unbind("change",t),s(!0)});k?(b.replace(n,r),d.update(n,[r]),k.unregistered=u.teardownCheck):l.replace(n,r,u.teardownCheck),t({},a.isFunction(e)?e():e)},html:function(c,e,f,h){var i;f=b.getParentNode(c,f),i=g(f,e,function(a,b){var c=d.first(l).parentNode;c&&m(b),i.teardownCheck(d.first(l).parentNode)});var l=h||[c],m=function(c){var e=!j(c),g=a.frag(c),h=a.makeArray(l);k(g),e&&(g=a.view.hookup(g,f)),h=d.update(l,g.childNodes),b.replace(h,g)};i.nodeList=l,h?h.unregistered=i.teardownCheck:d.register(l,i.teardownCheck),m(e())},replace:function(c,e,f){var g=c.slice(0),h=a.frag(e);return d.register(c,f),"string"==typeof e&&(h=a.view.hookup(h,c[0].parentNode)),d.update(c,h.childNodes),b.replace(g,h),c},text:function(c,e,f,h){var i=b.getParentNode(c,f),j=g(i,e,function(b,c){"unknown"!=typeof k.nodeValue&&(k.nodeValue=a.view.toStr(c)),j.teardownCheck(k.parentNode)}),k=document.createTextNode(a.view.toStr(e()));h?(h.unregistered=j.teardownCheck,j.nodeList=h,d.update(h,[k]),b.replace([c],k)):j.nodeList=l.replace([c],k,j.teardownCheck)},setAttributes:function(b,c){var d=h(c);for(var e in d)a.attr.set(b,e,d[e])},attributes:function(c,d,e){var f={},i=function(d){var e,g=h(d);for(e in g){var i=g[e],j=f[e];i!==j&&a.attr.set(c,e,i),delete f[e]}for(e in f)b.removeAttr(c,e);f=g};g(c,d,function(a,b){i(b)}),arguments.length>=3?f=h(e):i(d())},attributePlaceholder:"__!!__",attributeReplace:/__!!__/g,attribute:function(c,d,e){g(c,e,function(){b.setAttr(c,d,i.render())});var f,h=a.$(c);f=a.data(h,"hooks"),f||a.data(h,"hooks",f={});var i,j=b.getAttr(c,d),k=j.split(l.attributePlaceholder),m=[];m.push(k.shift(),k.join(l.attributePlaceholder)),f[d]?f[d].computes.push(e):f[d]={render:function(){var a=0,c=j?j.replace(l.attributeReplace,function(){return b.contentText(i.computes[a++]())}):b.contentText(i.computes[a++]());return c},computes:[e],batchNum:undefined},i=f[d],m.splice(1,0,e()),b.setAttr(c,d,m.join(""))},specialAttribute:function(a,c,d){g(a,d,function(d,e){b.setAttr(a,c,n(e))}),b.setAttr(a,c,n(d()))},simpleAttribute:function(a,c,d){g(a,d,function(d,e){b.setAttr(a,c,e)}),b.setAttr(a,c,d())}};l.attr=l.simpleAttribute,l.attrs=l.attributes;var m=/(\r|\n)+/g,n=function(a){var c=/^["'].*["']$/;return a=a.replace(b.attrReg,"").replace(m,""),c.test(a)?a.substr(1,a.length-2):a};return a.view.live=l,l}(__m2,__m28,__m14,__m31,__m32),__m29=function(a,b,c){var d,e=[],f=function(a){var c=b.tagMap[a]||"span";
  return"span"===c?"@@!!@@":"<"+c+">"+f(c)+"</"+c+">"},g=function(b,c){if("string"==typeof b)return b;if(!b&&0!==b)return"";var d=b.hookup&&function(a,c){b.hookup.call(b,a,c)}||"function"==typeof b&&b;return d?c?"<"+c+" "+a.view.hook(d)+"></"+c+">":(e.push(d),""):""+b},h=function(b,c){return"string"==typeof b||"number"==typeof b?a.esc(b):g(b,c)},i=!1,j=function(){};return a.extend(a.view,{live:c,setupLists:function(){var b,c=a.view.lists;return a.view.lists=function(a,c){return b={list:a,renderer:c},Math.random()},function(){return a.view.lists=c,b}},getHooks:function(){var a=e.slice(0);return d=a,e=[],a},onlytxt:function(a,b){return h(b.call(a))},txt:function(k,l,m,n,o){var p,q,r,s,t=b.tagMap[l]||"span",u=!1,v=j;if(i)p=o.call(n);else{("string"==typeof m||1===m)&&(i=!0);var w=a.view.setupLists();v=function(){r.unbind("change",j)},r=a.compute(o,n,!1),r.bind("change",j),q=w(),p=r(),i=!1,u=r.hasDependencies}if(q)return v(),"<"+t+a.view.hook(function(a,b){c.list(a,q.list,q.renderer,n,b)})+"></"+t+">";if(!u||"function"==typeof p)return v(),(i||2===k||!k?g:h)(p,0===m&&t);var x=b.tagToContentPropMap[l];return 0!==m||x?1===m?(e.push(function(a){c.attributes(a,r,r()),v()}),r()):2===k?(s=m,e.push(function(a){c.specialAttribute(a,s,r),v()}),r()):(s=0===m?x:m,(0===m?d:e).push(function(a){c.attribute(a,s,r),v()}),c.attributePlaceholder):"<"+t+a.view.hook(k&&"object"!=typeof p?function(a,b){c.text(a,r,b),v()}:function(a,b){c.html(a,r,b),v()})+">"+f(t)+"</"+t+">"}}),a}(__m14,__m28,__m30,__m17),__m25=function(a){a.view.ext=".mustache";var b="scope",c="___h4sh",d="{scope:"+b+",options:options}",e="{scope:"+b+",options:options, special: true}",f=b+",options",g=/((([^'"\s]+?=)?('.*?'|".*?"))|.*?)\s/g,h=/^(('.*?'|".*?"|[0-9]+\.?[0-9]*|true|false|null|undefined)|((.+?)=(('.*?'|".*?"|[0-9]+\.?[0-9]*|true|false)|(.+))))$/,i=function(a){return'{get:"'+a.replace(/"/g,'\\"')+'"}'},j=function(a){return a&&"string"==typeof a.get},k=function(b){return b instanceof a.Map||b&&!!b._get},l=function(a){return a&&a.splice&&"number"==typeof a.length},m=function(b,c,d){var e=function(a,d){return b(a||c,d)};return function(b,f){return b===undefined||b instanceof a.view.Scope||(b=c.add(b)),f===undefined||f instanceof a.view.Options||(f=d.add(f)),e(b,f||d)}},n=function(b){if(this.constructor!==n){var c=new n(b);return function(a,b){return c.render(a,b)}}return"function"==typeof b?void(this.template={fn:b}):(a.extend(this,b),void(this.template=this.scanner.scan(this.text,this.name)))};a.Mustache=window.Mustache=n,n.prototype.render=function(b,c){return b instanceof a.view.Scope||(b=new a.view.Scope(b||{})),c instanceof a.view.Options||(c=new a.view.Options(c||{})),c=c||{},this.template.fn.call(b,b,c)},a.extend(n.prototype,{scanner:new a.view.Scanner({text:{start:"",scope:b,options:",options: options",argNames:f},tokens:[["returnLeft","{{{","{{[{&]"],["commentFull","{{!}}","^[\\s\\t]*{{!.+?}}\\n"],["commentLeft","{{!","(\\n[\\s\\t]*{{!|{{!)"],["escapeFull","{{}}","(^[\\s\\t]*{{[#/^][^}]+?}}\\n|\\n[\\s\\t]*{{[#/^][^}]+?}}\\n|\\n[\\s\\t]*{{[#/^][^}]+?}}$)",function(a){return{before:/^\n.+?\n$/.test(a)?"\n":"",content:a.match(/\{\{(.+?)\}\}/)[1]||""}}],["escapeLeft","{{"],["returnRight","}}}"],["right","}}"]],helpers:[{name:/^>[\s]*\w*/,fn:function(b){var c=a.trim(b.replace(/^>\s?/,"")).replace(/["|']/g,"");return"can.Mustache.renderPartial('"+c+"',"+f+")"}},{name:/^\s*data\s/,fn:function(a){var c=a.match(/["|'](.*)["|']/)[1];return"can.proxy(function(__){can.data(can.$(__),'"+c+"', this.attr('.')); }, "+b+")"}},{name:/\s*\(([\$\w]+)\)\s*->([^\n]*)/,fn:function(a){var c=/\s*\(([\$\w]+)\)\s*->([^\n]*)/,d=a.match(c);return"can.proxy(function(__){var "+d[1]+"=can.$(__);with("+b+".attr('.')){"+d[2]+"}}, this);"}},{name:/^.*$/,fn:function(b,j){var k=!1,l={content:"",startTxt:!1,startOnlyTxt:!1,end:!1};if(b=a.trim(b),b.length&&(k=b.match(/^([#^/]|else$)/))){switch(k=k[0]){case"#":case"^":j.specialAttribute?l.startOnlyTxt=!0:(l.startTxt=!0,l.escaped=0);break;case"/":return l.end=!0,l.content+='return ___v1ew.join("");}}])',l}b=b.substring(1)}if("else"!==k){var m,n=[],o=[],p=0;l.content+="can.Mustache.txt(\n"+(j.specialAttribute?e:d)+",\n"+(k?'"'+k+'"':"null")+",",(a.trim(b)+" ").replace(g,function(a,b){p&&(m=b.match(h))?m[2]?n.push(m[0]):o.push(m[4]+":"+(m[6]?m[6]:i(m[5]))):n.push(i(b)),p++}),l.content+=n.join(","),o.length&&(l.content+=",{"+c+":{"+o.join(",")+"}}")}switch(k&&"else"!==k&&(l.content+=",[\n\n"),k){case"^":case"#":l.content+="{fn:function("+f+"){var ___v1ew = [];";break;case"else":l.content+='return ___v1ew.join("");}},\n{inverse:function('+f+"){\nvar ___v1ew = [];";break;default:l.content+=")"}return k||(l.startTxt=!0,l.end=!0),l}}]})});for(var o=a.view.Scanner.prototype.helpers,p=0;p<o.length;p++)n.prototype.scanner.helpers.unshift(o[p]);return n.txt=function(b,d,e){for(var f,g,h=b.scope,i=b.options,o=[],p={fn:function(){},inverse:function(){}},q=h.attr("."),r=!0,s=3;s<arguments.length;s++){var t=arguments[s];if(d&&a.isArray(t))p=a.extend.apply(a,[p].concat(t));else if(t&&t[c]){f=t[c];for(var u in f)j(f[u])&&(f[u]=n.get(f[u].get,b,!1,!0))}else o.push(t&&j(t)?n.get(t.get,b,!1,!0,!0):t)}if(j(e)){var v=e.get;e=n.get(e.get,b,o.length,!1),r=v===e}if(p.fn=m(p.fn,h,i),p.inverse=m(p.inverse,h,i),"^"===d){var w=p.fn;p.fn=p.inverse,p.inverse=w}return(g=r&&"string"==typeof e&&n.getHelper(e,i)||a.isFunction(e)&&!e.isComputed&&{fn:e})?(a.extend(p,{context:q,scope:h,contexts:h,hash:f}),o.push(p),function(){return g.fn.apply(q,o)||""}):function(){var b;b=a.isFunction(e)&&e.isComputed?e():e;var c,f,g,h=o.length?o:[b],i=!0,j=[];if(d)for(c=0;c<h.length;c++)g=h[c],f="undefined"!=typeof g&&k(g),l(g)?"#"===d?i=i&&!!(f?g.attr("length"):g.length):"^"===d&&(i=i&&!(f?g.attr("length"):g.length)):i="#"===d?i&&!!g:"^"===d?i&&!g:i;if(i){if("#"===d){if(l(b)){var m=k(b);for(c=0;c<b.length;c++)j.push(p.fn(m?b.attr(""+c):b[c]));return j.join("")}return p.fn(b||{})||""}return"^"===d?p.inverse(b||{})||"":""+(null!=b?b:"")}return""}},n.get=function(b,c,d,e,f){var g=c.scope.attr("."),h=c.options||{};if(d){if(n.getHelper(b,h))return b;if(c.scope&&a.isFunction(g[b]))return g[b]}var i=c.scope.computeData(b,{isArgument:e,args:[g,c.scope]}),j=i.compute;a.compute.temporarilyBind(j);{var k=i.initialValue;n.getHelper(b,h)}return f||k!==undefined&&i.scope===c.scope||!n.getHelper(b,h)?j.hasDependencies?j:k:b},n.resolve=function(b){return k(b)&&l(b)&&b.attr("length")?b:a.isFunction(b)?b():b},a.view.Options=a.view.Scope.extend({init:function(b){b.helpers||b.partials||b.tags||(b={helpers:b}),a.view.Scope.prototype.init.apply(this,arguments)}}),n._helpers={},n.registerHelper=function(a,b){this._helpers[a]={name:a,fn:b}},n.getHelper=function(a,b){var c;return b&&(c=b.attr("helpers."+a)),c?{fn:c}:this._helpers[a]},n.render=function(b,c,d){if(!a.view.cached[b]){var e=a.__clearReading();c.attr("partial")&&(b=c.attr("partial")),a.__setReading(e)}return a.view.render(b,c,d)},n.safeString=function(a){return{toString:function(){return a}}},n.renderPartial=function(b,c,d){var e=d.attr("partials."+b);return e?e.render?e.render(c,d):e(c,d):a.Mustache.render(b,c,d)},a.each({"if":function(b,c){var d;return d=a.isFunction(b)?a.compute.truthy(b)():!!n.resolve(b),d?c.fn(c.contexts||this):c.inverse(c.contexts||this)},unless:function(b,c){return n._helpers["if"].fn.apply(this,[a.isFunction(b)?a.compute(function(){return!b()}):!b,c])},each:function(b,c){var d,e,f,g=n.resolve(b),h=[];if(a.view.lists&&(g instanceof a.List||b&&b.isComputed&&g===undefined))return a.view.lists(b,function(a,b){return c.fn(c.scope.add({"@index":b}).add(a))});if(b=g,b&&l(b)){for(f=0;f<b.length;f++)h.push(c.fn(c.scope.add({"@index":f}).add(b[f])));return h.join("")}if(k(b)){for(d=a.Map.keys(b),f=0;f<d.length;f++)e=d[f],h.push(c.fn(c.scope.add({"@key":e}).add(b[e])));return h.join("")}if(b instanceof Object){for(e in b)h.push(c.fn(c.scope.add({"@key":e}).add(b[e])));return h.join("")}},"with":function(a,b){var c=a;return a=n.resolve(a),a?b.fn(c):void 0},log:function(a,b){"undefined"!=typeof console&&console.log&&(b?console.log(a,b.context):console.log(a.context))},"@index":function(b,c){c||(c=b,b=0);var d=c.scope.attr("@index");return""+((a.isFunction(d)?d():d)+b)}},function(a,b){n.registerHelper(b,a)}),a.view.register({suffix:"mustache",contentType:"x-mustache-template",script:function(a,b){return"can.Mustache(function("+f+") { "+new n({text:b,name:a}).template.out+" })"},renderer:function(a,b){return n({text:b,name:a})}}),a.mustache.registerHelper=a.proxy(a.Mustache.registerHelper,a.Mustache),a.mustache.safeString=a.Mustache.safeString,a}(__m2,__m26,__m14,__m27,__m24,__m29),__m33=function(a){var b=function(){var a={"":!0,"true":!0,"false":!1},b=function(b){if(b&&b.getAttribute){var c=b.getAttribute("contenteditable");return a[c]}};return function(a){var c=b(a);return"boolean"==typeof c?c:!!b(a.parentNode)}}(),c=function(a){return"{"===a[0]&&"}"===a[a.length-1]?a.substr(1,a.length-2):a};a.view.attr("can-value",function(d,i){var j,k,l=c(d.getAttribute("can-value")),m=i.scope.computeData(l,{args:[]}).compute;return"input"===d.nodeName.toLowerCase()&&("checkbox"===d.type&&(j=a.attr.has(d,"can-true-value")?d.getAttribute("can-true-value"):!0,k=a.attr.has(d,"can-false-value")?d.getAttribute("can-false-value"):!1),"checkbox"===d.type||"radio"===d.type)?void new f(d,{value:m,trueValue:j,falseValue:k}):"select"===d.nodeName.toLowerCase()&&d.multiple?void new g(d,{value:m}):b(d)?void new h(d,{value:m}):void new e(d,{value:m})});var d={enter:function(a,b,c){return{event:"keyup",handler:function(a){return 13===a.keyCode?c.call(this,a):void 0}}}};a.view.attr(/can-[\w\.]+/,function(b,e){var f=e.attributeName,g=f.substr("can-".length),h=function(d){var g=c(b.getAttribute(f)),h=e.scope.read(g,{returnObserveMethods:!0,isArgument:!0});return h.value.call(h.parent,e.scope._context,a.$(this),d)};if(d[g]){var i=d[g](e,b,h);h=i.handler,g=i.event}a.bind.call(b,g,h)});var e=a.Control.extend({init:function(){"SELECT"===this.element[0].nodeName.toUpperCase()?setTimeout(a.proxy(this.set,this),1):this.set()},"{value} change":"set",set:function(){if(this.element){var a=this.options.value();this.element[0].value=null==a?"":a}},change:function(){this.element&&this.options.value(this.element[0].value)}}),f=a.Control.extend({init:function(){this.isCheckbox="checkbox"===this.element[0].type.toLowerCase(),this.check()},"{value} change":"check",check:function(){if(this.isCheckbox){var b=this.options.value(),c=this.options.trueValue||!0;this.element[0].checked=b===c}else{var d=this.options.value()==this.element[0].value?"set":"remove";a.attr[d](this.element[0],"checked",!0)}},change:function(){this.isCheckbox?this.options.value(this.element[0].checked?this.options.trueValue:this.options.falseValue):this.element[0].checked&&this.options.value(this.element[0].value)}}),g=e.extend({init:function(){this.delimiter=";",this.set()},set:function(){var b=this.options.value();"string"==typeof b?(b=b.split(this.delimiter),this.isString=!0):b&&(b=a.makeArray(b));var c={};a.each(b,function(a){c[a]=!0}),a.each(this.element[0].childNodes,function(a){a.value&&(a.selected=!!c[a.value])})},get:function(){var b=[],c=this.element[0].childNodes;return a.each(c,function(a){a.selected&&a.value&&b.push(a.value)}),b},change:function(){var b=this.get(),c=this.options.value();this.isString||"string"==typeof c?(this.isString=!0,this.options.value(b.join(this.delimiter))):c instanceof a.List?c.attr(b,!0):this.options.value(b)}}),h=a.Control.extend({init:function(){this.set(),this.on("blur","setValue")},"{value} change":"set",set:function(){var a=this.options.value();this.element[0].innerHTML="undefined"==typeof a?"":a},setValue:function(){this.options.value(this.element[0].innerHTML)}})}(__m2,__m25,__m15),__m1=function(a,b){var c=/^(dataViewId|class|id)$/i,d=/\{([^\}]+)\}/g,e=a.Component=a.Construct.extend({setup:function(){if(a.Construct.setup.apply(this,arguments),a.Component){var b=this,c=this.prototype.scope;if(this.Control=f.extend(this.prototype.events),c&&("object"!=typeof c||c instanceof a.Map)?c.prototype instanceof a.Map&&(this.Map=c):this.Map=a.Map.extend(c||{}),this.attributeScopeMappings={},a.each(this.Map?this.Map.defaults:{},function(a,c){"@"===a&&(b.attributeScopeMappings[c]=c)}),this.prototype.template)if("function"==typeof this.prototype.template){var d=this.prototype.template;this.renderer=function(){return a.view.frag(d.apply(null,arguments))}}else this.renderer=a.view.mustache(this.prototype.template);a.view.tag(this.prototype.tag,function(a,c){new b(a,c)})}}},{setup:function(d,e){var f,g,h,i={},j=this,k={};if(a.each(this.constructor.attributeScopeMappings,function(b,c){i[c]=d.getAttribute(a.hyphenate(b))}),a.each(a.makeArray(d.attributes),function(h){var l=a.camelize(h.nodeName.toLowerCase()),m=h.value;if(!(j.constructor.attributeScopeMappings[l]||c.test(l)||b.attr(h.nodeName))){if("{"===m[0]&&"}"===m[m.length-1])m=m.substr(1,m.length-2);else if("legacy"!==e.templateType)return void(i[l]=m);var n=e.scope.computeData(m,{args:[]}),o=n.compute,p=function(a,b){f=l,g.attr(l,b),f=null};o.bind("change",p),i[l]=o(),o.hasDependencies?(a.bind.call(d,"removed",function(){o.unbind("change",p)}),k[l]=n):o.unbind("change",p)}}),this.constructor.Map)g=new this.constructor.Map(i);else if(this.scope instanceof a.Map)g=this.scope;else if(a.isFunction(this.scope)){var l=this.scope(i,e.scope,d);g=l instanceof a.Map?l:l.prototype instanceof a.Map?new l(i):new(a.Map.extend(l))(i)}var m={};a.each(k,function(a,b){m[b]=function(c,d){f!==b&&a.compute(d)},g.bind(b,m[b])}),a.bind.call(d,"removed",function(){a.each(m,function(a,b){g.unbind(b,m[b])})}),a.isEmptyObject(this.constructor.attributeScopeMappings)&&"legacy"===e.templateType||a.bind.call(d,"attributes",function(b){var e=a.camelize(b.attributeName);k[e]||c.test(e)||g.attr(e,d.getAttribute(b.attributeName))}),this.scope=g,a.data(a.$(d),"scope",this.scope);var n=e.scope.add(this.scope),o={helpers:{}};a.each(this.helpers||{},function(b,c){a.isFunction(b)&&(o.helpers[c]=function(){return b.apply(g,arguments)})}),this._control=new this.constructor.Control(d,{scope:this.scope}),this.constructor.renderer?(o.tags||(o.tags={}),o.tags.content=function p(b,c){var d=e.subtemplate||c.subtemplate;d&&(delete o.tags.content,a.view.live.replace([b],d(c.scope,c.options)),o.tags.content=p)},h=this.constructor.renderer(n,e.options.add(o))):h="legacy"===e.templateType?a.view.frag(e.subtemplate?e.subtemplate(n,e.options.add(o)):""):e.subtemplate?e.subtemplate(n,e.options.add(o)):document.createDocumentFragment(),a.appendChild(d,h)}}),f=a.Control.extend({_lookup:function(a){return[a.scope,a,window]},_action:function(b,c,e){var f,g;if(d.lastIndex=0,f=d.test(b),e||!f){if(f){g=a.compute(function(){var e,f=b.replace(d,function(b,d){var f;return"scope"===d?(e=c.scope,""):(d=d.replace(/^scope\./,""),f=a.compute.read(c.scope,d.split("."),{isArgument:!0}).value,f===undefined&&(f=a.getObject(d)),"string"==typeof f?f:(e=f,""))}),g=f.split(/\s+/g),h=g.pop();return{processor:this.processors[h]||this.processors.click,parts:[f,g.join(" "),h],delegate:e||undefined}},this);var h=function(a,c){e._bindings.control[b](e.element),e._bindings.control[b]=c.processor(c.delegate||e.element,c.parts[2],c.parts[1],b,e)};return g.bind("change",h),e._bindings.readyComputes[b]={compute:g,handler:h},g()}return a.Control._action.apply(this,arguments)}}},{setup:function(b,c){return this.scope=c.scope,a.Control.prototype.setup.call(this,b,c)},off:function(){this._bindings&&a.each(this._bindings.readyComputes||{},function(a){a.compute.unbind("change",a.handler)}),a.Control.prototype.off.apply(this,arguments),this._bindings.readyComputes={}}});return window.jQuery&&jQuery.fn&&(jQuery.fn.scope=function(a){return a?this.data("scope").attr(a):this.data("scope")}),a.scope=function(b,c){return b=a.$(b),c?a.data(b,"scope").attr(c):a.data(b,"scope")},e}(__m2,__m13,__m15,__m18,__m25,__m33),__m34=function(a){var b=function(b,c,d){var e=new a.Deferred;return b.then(function(){var b=a.makeArray(arguments),f=!0;try{b[0]=d.apply(c,b)}catch(g){f=!1,e.rejectWith(e,[g].concat(b))}f&&e.resolveWith(e,b)},function(){e.rejectWith(this,arguments)}),"function"==typeof b.abort&&(e.abort=function(){return b.abort()}),e},c=0,d=function(b){return a.__reading(b,b.constructor.id),b.__get(b.constructor.id)},e=function(b,c,d,e,f,g){var h={};if("string"==typeof b){var i=b.split(/\s+/);h.url=i.pop(),i.length&&(h.type=i.pop())}else a.extend(h,b);return h.data="object"!=typeof c||a.isArray(c)?c:a.extend(h.data||{},c),h.url=a.sub(h.url,h.data,!0),a.ajax(a.extend({type:d||"post",dataType:e||"json",success:f,error:g},h))},f=function(c,e,f,g,h){var i;a.isArray(c)?(i=c[1],c=c[0]):i=c.serialize(),i=[i];var j,k,l=c.constructor;return("update"===e||"destroy"===e)&&i.unshift(d(c)),k=l[e].apply(l,i),j=b(k,c,function(a){return c[h||e+"d"](a,k),c}),k.abort&&(j.abort=function(){k.abort()}),j.then(f,g),j},g={models:function(b,c,d){if(a.Model._reqs++,b){if(b instanceof this.List)return b;var e=this,f=[],g=e.List||o,h=c instanceof a.List?c:new g,i=b instanceof o,j=i?b.serialize():b;if(j=e.parseModels(j,d),j.data&&(b=j,j=j.data),"undefined"==typeof j)throw new Error("Could not get any raw data while converting using .models");return h.length&&h.splice(0),a.each(j,function(a){f.push(e.model(a,d))}),h.push.apply(h,f),a.isArray(b)||a.each(b,function(a,b){"data"!==b&&h.attr(b,a)}),setTimeout(a.proxy(this._clean,this),1),h}},model:function(b,c,d){if(b){b="function"==typeof b.serialize?b.serialize():this.parseModel(b,d);var e=b[this.id];(e||0===e)&&this.store[e]&&(c=this.store[e]);var f=c&&a.isFunction(c.attr)?c.attr(b,this.removeAttr||!1):new this(b);return f}}},h={parseModel:function(b){return function(c){return b?a.getObject(b,c):c}},parseModels:function(b){return function(c){if(a.isArray(c))return c;b=b||"data";var d=a.getObject(b,c);if(!a.isArray(d))throw new Error("Could not get any raw data while converting using .models");return d}}},i={create:{url:"_shortName",type:"post"},update:{data:function(b,c){c=c||{};var d=this.id;return c[d]&&c[d]!==b&&(c["new"+a.capitalize(b)]=c[d],delete c[d]),c[d]=b,c},type:"put"},destroy:{type:"delete",data:function(a,b){return b=b||{},b.id=b[this.id]=a,b}},findAll:{url:"_shortName"},findOne:{}},j=function(a,b){return function(c){return c=a.data?a.data.apply(this,arguments):c,e(b||this[a.url||"_url"],c,a.type||"get")}},k=function(a,b){if(a.resource){var c=a.resource.replace(/\/+$/,"");return"findAll"===b||"create"===b?c:c+"/{"+a.id+"}"}};a.Model=a.Map.extend({fullName:"can.Model",_reqs:0,setup:function(b,d,e,f){if("string"!=typeof d&&(f=e,e=d),f||(f=e),this.store={},a.Map.setup.apply(this,arguments),a.Model){e&&e.List?(this.List=e.List,this.List.Map=this):this.List=b.List.extend({Map:this},{});var l=this,m=a.proxy(this._clean,l);a.each(i,function(c,d){if(e&&e[d]&&("string"==typeof e[d]||"object"==typeof e[d])?l[d]=j(c,e[d]):e&&e.resource&&!a.isFunction(e[d])&&(l[d]=j(c,k(l,d))),l["make"+a.capitalize(d)]){var f=l["make"+a.capitalize(d)](l[d]);a.Construct._overwrite(l,b,d,function(){a.Model._reqs++;var b=f.apply(this,arguments),c=b.then(m,m);return c.abort=b.abort,c})}});var n={};a.each(g,function(c,d){var f="parse"+a.capitalize(d),g=e&&e[d]||l[d];"string"==typeof g?(l[f]=g,a.Construct._overwrite(l,b,d,c)):e&&e[d]&&(n[f]=!0)}),a.each(h,function(c,d){var f=e&&e[d]||l[d];if("string"==typeof f)a.Construct._overwrite(l,b,d,c(f));else if(!(e&&a.isFunction(e[d])||l[d])){var g=c();g.useModelConverter=n[d],a.Construct._overwrite(l,b,d,g)}}),"can.Model"!==l.fullName&&l.fullName||(l.fullName="Model"+ ++c),a.Model._reqs=0,this._url=this._shortName+"/{"+this.id+"}"}},_ajax:j,_makeRequest:f,_clean:function(){if(a.Model._reqs--,!a.Model._reqs)for(var b in this.store)this.store[b]._bindings||delete this.store[b];return arguments[0]},models:g.models,model:g.model},{setup:function(b){var c=b&&b[this.constructor.id];a.Model._reqs&&null!=c&&(this.constructor.store[c]=this),a.Map.prototype.setup.apply(this,arguments)},isNew:function(){var a=d(this);return!(a||0===a)},save:function(a,b){return f(this,this.isNew()?"create":"update",a,b)},destroy:function(b,c){if(this.isNew()){var d=this,e=a.Deferred();return e.then(b,c),e.done(function(a){d.destroyed(a)}).resolve(d)}return f(this,"destroy",b,c,"destroyed")},_bindsetup:function(){return this.constructor.store[this.__get(this.constructor.id)]=this,a.Map.prototype._bindsetup.apply(this,arguments)},_bindteardown:function(){return delete this.constructor.store[d(this)],a.Map.prototype._bindteardown.apply(this,arguments)},___set:function(b,c){a.Map.prototype.___set.call(this,b,c),b===this.constructor.id&&this._bindings&&(this.constructor.store[d(this)]=this)}});var l=function(a){return function(b,c,d){return this[a](b,null,d)}},m=function(a){return this.parseModel.useModelConverter?this.model(a):this.parseModel(a)},n={makeFindAll:l("models"),makeFindOne:l("model"),makeCreate:m,makeUpdate:m};a.each(n,function(c,d){a.Model[d]=function(d){return function(){var e=a.makeArray(arguments),f=a.isFunction(e[1])?e.splice(0,1):e.splice(0,2),g=b(d.apply(this,f),this,c);return g.then(e[0],e[1]),g}}}),a.each(["created","updated","destroyed"],function(b){a.Model.prototype[b]=function(c){var d=this,e=d.constructor;c&&"object"==typeof c&&this.attr(a.isFunction(c.attr)?c.attr():c),a.dispatch.call(this,{type:"change",target:this},[b]),a.dispatch.call(e,b,[this])}});var o=a.Model.List=a.List.extend({_bubbleRule:function(b,c){return a.List._bubbleRule(b,c)||"destroyed"}},{setup:function(b){a.isPlainObject(b)&&!a.isArray(b)?(a.List.prototype.setup.apply(this),this.replace(a.isDeferred(b)?b:this.constructor.Map.findAll(b))):a.List.prototype.setup.apply(this,arguments),this._init=1,this.bind("destroyed",a.proxy(this._destroyed,this)),delete this._init},_destroyed:function(a,b){if(/\w+/.test(b))for(var c;(c=this.indexOf(a.target))>-1;)this.splice(c,1)}});return a.Model}(__m2,__m19,__m23),__m36=function(a){var b=/^\d+$/,c=/([^\[\]]+)|(\[\])/g,d=/([^?#]*)(#.*)?$/,e=function(a){return decodeURIComponent(a.replace(/\+/g," "))};return a.extend(a,{deparam:function(f){var g,h,i={};return f&&d.test(f)&&(g=f.split("&"),a.each(g,function(a){var d=a.split("="),f=e(d.shift()),g=e(d.join("=")),j=i;if(f){d=f.match(c);for(var k=0,l=d.length-1;l>k;k++)j[d[k]]||(j[d[k]]=b.test(d[k+1])||"[]"===d[k+1]?[]:{}),j=j[d[k]];h=d.pop(),"[]"===h?j.push(g):j[h]=g}})),i}}),a}(__m2,__m17),__m35=function(a){var b,c,d,e,f=/\:([\w\.]+)/g,g=/^(?:&[^=]+=[^&]*)+/,h=function(b){var c=[];return a.each(b,function(b,d){c.push(("className"===d?"class":d)+'="'+("href"===d?b:a.esc(b))+'"')}),c.join(" ")},i=function(a,b){var c=0,d=0,e={};for(var f in a.defaults)a.defaults[f]===b[f]&&(e[f]=1,c++);for(;d<a.names.length;d++){if(!b.hasOwnProperty(a.names[d]))return-1;e[a.names[d]]||c++}return c},j=window.location,k=function(a){return(a+"").replace(/([.?*+\^$\[\]\\(){}|\-])/g,"\\$1")},l=a.each,m=a.extend,n=function(b){return b&&"object"==typeof b?(b=b instanceof a.Map?b.attr():a.isFunction(b.slice)?b.slice():a.extend({},b),a.each(b,function(a,c){b[c]=n(a)})):b!==undefined&&null!==b&&a.isFunction(b.toString)&&(b=b.toString()),b},o=function(a){return a.replace(/\\/g,"")},p=function(){e=1,clearTimeout(b),b=setTimeout(function(){e=0;var b=a.route.data.serialize(),c=a.route.param(b,!0);a.route._call("setURL",c),a.batch.trigger(q,"__url",[c,d]),d=c},10)},q=a.extend({},a.event);a.route=function(b,c){var d=a.route._call("root");d.lastIndexOf("/")===d.length-1&&0===b.indexOf("/")&&(b=b.substr(1)),c=c||{};for(var e,g,h=[],i="",j=f.lastIndex=0,l=a.route._call("querySeparator"),m=a.route._call("matchSlashes");e=f.exec(b);)h.push(e[1]),i+=o(b.substring(j,f.lastIndex-e[0].length)),g="\\"+(o(b.substr(f.lastIndex,1))||l+(m?"":"|/")),i+="([^"+g+"]"+(c[e[1]]?"*":"+")+")",j=f.lastIndex;return i+=b.substr(j).replace("\\",""),a.route.routes[b]={test:new RegExp("^"+i+"($|"+k(l)+")"),route:b,names:h,defaults:c,length:b.split("/").length},a.route},m(a.route,{param:function(b,c){var d,e,g=0,h=b.route,j=0;if(delete b.route,l(b,function(){j++}),l(a.route.routes,function(a){return e=i(a,b),e>g&&(d=a,g=e),e>=j?!1:void 0}),a.route.routes[h]&&i(a.route.routes[h],b)===g&&(d=a.route.routes[h]),d){var k,n=m({},b),o=d.route.replace(f,function(a,c){return delete n[c],b[c]===d.defaults[c]?"":encodeURIComponent(b[c])}).replace("\\","");return l(d.defaults,function(a,b){n[b]===a&&delete n[b]}),k=a.param(n),c&&a.route.attr("route",d.route),o+(k?a.route._call("querySeparator")+k:"")}return a.isEmptyObject(b)?"":a.route._call("querySeparator")+a.param(b)},deparam:function(b){var c=a.route._call("root");c.lastIndexOf("/")===c.length-1&&0===b.indexOf("/")&&(b=b.substr(1));var d={length:-1},e=a.route._call("querySeparator"),f=a.route._call("paramsMatcher");if(l(a.route.routes,function(a){a.test.test(b)&&a.length>d.length&&(d=a)}),d.length>-1){var g=b.match(d.test),h=g.shift(),i=b.substr(h.length-(g[g.length-1]===e?1:0)),j=i&&f.test(i)?a.deparam(i.slice(1)):{};return j=m(!0,{},d.defaults,j),l(g,function(a,b){a&&a!==e&&(j[d.names[b]]=decodeURIComponent(a))}),j.route=d.route,j}return b.charAt(0)!==e&&(b=e+b),f.test(b)?a.deparam(b.slice(1)):{}},data:new a.Map({}),map:function(b){var c;c=b.prototype instanceof a.Map?new b:b,a.route.data=c},routes:{},ready:function(b){return b!==!0&&(a.route._setup(),a.route.setState()),a.route},url:function(b,c){return c&&(b=a.extend({},a.route.deparam(a.route._call("matchingPartOfURL")),b)),a.route._call("root")+a.route.param(b)},link:function(b,c,d,e){return"<a "+h(m({href:a.route.url(c,e)},d))+">"+b+"</a>"},current:function(b){return a.__reading(q,"__url"),this._call("matchingPartOfURL")===a.route.param(b)},bindings:{hashchange:{paramsMatcher:g,querySeparator:"&",matchSlashes:!1,bind:function(){a.bind.call(window,"hashchange",r)},unbind:function(){a.unbind.call(window,"hashchange",r)},matchingPartOfURL:function(){return j.href.split(/#!?/)[1]||""},setURL:function(a){return j.hash="#!"+a,a},root:"#!"}},defaultBinding:"hashchange",currentBinding:null,_setup:function(){a.route.currentBinding||(a.route._call("bind"),a.route.bind("change",p),a.route.currentBinding=a.route.defaultBinding)},_teardown:function(){a.route.currentBinding&&(a.route._call("unbind"),a.route.unbind("change",p),a.route.currentBinding=null),clearTimeout(b),e=0},_call:function(){var b=a.makeArray(arguments),c=b.shift(),d=a.route.bindings[a.route.currentBinding||a.route.defaultBinding],e=d[c];return e.apply?e.apply(d,b):e}}),l(["bind","unbind","on","off","delegate","undelegate","removeAttr","compute","_get","__get","each"],function(b){a.route[b]=function(){return a.route.data[b]?a.route.data[b].apply(a.route.data,arguments):void 0}}),a.route.attr=function(b,c){var d,e=typeof b;return d=c===undefined?arguments:"string"!==e&&"number"!==e?[n(b),c]:[b,n(c)],a.route.data.attr.apply(a.route.data,d)};var r=a.route.setState=function(){var b=a.route._call("matchingPartOfURL"),f=c;if(c=a.route.deparam(b),!e||b!==d){a.batch.start();for(var g in f)c[g]||a.route.removeAttr(g);a.route.attr(c),a.batch.trigger(q,"__url",[b,d]),a.batch.stop()}};return a.route}(__m2,__m19,__m23,__m36),__m37=function(a){return a.Control.processors.route=function(b,c,d,e,f){d=d||"",a.route.routes[d]||("/"===d[0]&&(d=d.substring(1)),a.route(d));var g,h=function(b){if(a.route.attr("route")===d&&(b.batchNum===undefined||b.batchNum!==g)){g=b.batchNum;var c=a.route.attr();delete c.route,a.isFunction(f[e])?f[e](c):f[f[e]](c)}};return a.route.bind("change",h),function(){a.route.unbind("change",h)}},a}(__m2,__m35,__m15);window.can=__m3}();