/* knockback.js 0.16.5 (full version) (c) 2011, 2012 Kevin Malakoff - http://kmalakoff.github.com/knockback/ License: MIT (http://www.opensource.org/licenses/mit-license.php) Dependencies: Knockout.js, Backbone.js, and Underscore.js. */(function(){return function(e){return typeof define=="function"&&define.amd?define("knockback",["underscore","backbone","knockout"],e):e.call(this)}(function(){var e,t,n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x,T=function(e,t){return function(){return e.apply(t,arguments)}};d=function(){function t(){}return t.VERSION="0.16.5",t.TYPE_UNKNOWN=0,t.TYPE_SIMPLE=1,t.TYPE_ARRAY=2,t.TYPE_MODEL=3,t.TYPE_COLLECTION=4,t.release=function(n,i){var s,o,u,a,f,l,c,h;if(!n||n!==Object(n)||typeof n=="function"&&!v.isObservable(n)||n.__kb_destroyed||n instanceof e.Model||n instanceof e.Collection)return this;if(w.isArray(n)){s=n.splice(0,n.length);for(f=0,c=s.length;f=0)s=s.replace("{"+r+"}",o),i=e.indexOf("{"+r+"}",i+1)}return s},d.parseFormattedString=function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d;c=t.slice(),i=0,u=0,f={};while(c.search("\\{"+i+"\\}")>=0){a=t.indexOf("{"+i+"}");while(a>=0)c=c.replace("{"+i+"}","(.*)"),f[a]=i,u++,a=t.indexOf("{"+i+"}",a+1);i++}n=i,l=new RegExp(c),o=l.exec(e),o&&o.shift();if(!o||o.length!==u){h=[];while(n-->0)h.push("");return h}d=w.sortBy(w.keys(f),function(e,t){return parseInt(e,10)}),r={};for(s in d){a=d[s],i=f[a];if(r.hasOwnProperty(i))continue;r[i]=s}p=[],i=0;while(i