\").append( jQuery.parseHTML( responseText ) ).find( selector ) :\n\t\n\t\t\t\t\t// Otherwise use the full result\n\t\t\t\t\tresponseText );\n\t\n\t\t\t}).complete( callback && function( jqXHR, status ) {\n\t\t\t\tself.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );\n\t\t\t});\n\t\t}\n\t\n\t\treturn this;\n\t};\n\t\n\t\n\t\n\t\n\t// Attach a bunch of functions for handling common AJAX events\n\tjQuery.each( [ \"ajaxStart\", \"ajaxStop\", \"ajaxComplete\", \"ajaxError\", \"ajaxSuccess\", \"ajaxSend\" ], function( i, type ) {\n\t\tjQuery.fn[ type ] = function( fn ) {\n\t\t\treturn this.on( type, fn );\n\t\t};\n\t});\n\t\n\t\n\t\n\t\n\tjQuery.expr.filters.animated = function( elem ) {\n\t\treturn jQuery.grep(jQuery.timers, function( fn ) {\n\t\t\treturn elem === fn.elem;\n\t\t}).length;\n\t};\n\t\n\t\n\t\n\t\n\t\n\tvar docElem = window.document.documentElement;\n\t\n\t/**\n\t * Gets a window from an element\n\t */\n\tfunction getWindow( elem ) {\n\t\treturn jQuery.isWindow( elem ) ?\n\t\t\telem :\n\t\t\telem.nodeType === 9 ?\n\t\t\t\telem.defaultView || elem.parentWindow :\n\t\t\t\tfalse;\n\t}\n\t\n\tjQuery.offset = {\n\t\tsetOffset: function( elem, options, i ) {\n\t\t\tvar curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,\n\t\t\t\tposition = jQuery.css( elem, \"position\" ),\n\t\t\t\tcurElem = jQuery( elem ),\n\t\t\t\tprops = {};\n\t\n\t\t\t// set position first, in-case top/left are set even on static elem\n\t\t\tif ( position === \"static\" ) {\n\t\t\t\telem.style.position = \"relative\";\n\t\t\t}\n\t\n\t\t\tcurOffset = curElem.offset();\n\t\t\tcurCSSTop = jQuery.css( elem, \"top\" );\n\t\t\tcurCSSLeft = jQuery.css( elem, \"left\" );\n\t\t\tcalculatePosition = ( position === \"absolute\" || position === \"fixed\" ) &&\n\t\t\t\tjQuery.inArray(\"auto\", [ curCSSTop, curCSSLeft ] ) > -1;\n\t\n\t\t\t// need to be able to calculate position if either top or left is auto and position is either absolute or fixed\n\t\t\tif ( calculatePosition ) {\n\t\t\t\tcurPosition = curElem.position();\n\t\t\t\tcurTop = curPosition.top;\n\t\t\t\tcurLeft = curPosition.left;\n\t\t\t} else {\n\t\t\t\tcurTop = parseFloat( curCSSTop ) || 0;\n\t\t\t\tcurLeft = parseFloat( curCSSLeft ) || 0;\n\t\t\t}\n\t\n\t\t\tif ( jQuery.isFunction( options ) ) {\n\t\t\t\toptions = options.call( elem, i, curOffset );\n\t\t\t}\n\t\n\t\t\tif ( options.top != null ) {\n\t\t\t\tprops.top = ( options.top - curOffset.top ) + curTop;\n\t\t\t}\n\t\t\tif ( options.left != null ) {\n\t\t\t\tprops.left = ( options.left - curOffset.left ) + curLeft;\n\t\t\t}\n\t\n\t\t\tif ( \"using\" in options ) {\n\t\t\t\toptions.using.call( elem, props );\n\t\t\t} else {\n\t\t\t\tcurElem.css( props );\n\t\t\t}\n\t\t}\n\t};\n\t\n\tjQuery.fn.extend({\n\t\toffset: function( options ) {\n\t\t\tif ( arguments.length ) {\n\t\t\t\treturn options === undefined ?\n\t\t\t\t\tthis :\n\t\t\t\t\tthis.each(function( i ) {\n\t\t\t\t\t\tjQuery.offset.setOffset( this, options, i );\n\t\t\t\t\t});\n\t\t\t}\n\t\n\t\t\tvar docElem, win,\n\t\t\t\tbox = { top: 0, left: 0 },\n\t\t\t\telem = this[ 0 ],\n\t\t\t\tdoc = elem && elem.ownerDocument;\n\t\n\t\t\tif ( !doc ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tdocElem = doc.documentElement;\n\t\n\t\t\t// Make sure it's not a disconnected DOM node\n\t\t\tif ( !jQuery.contains( docElem, elem ) ) {\n\t\t\t\treturn box;\n\t\t\t}\n\t\n\t\t\t// If we don't have gBCR, just use 0,0 rather than error\n\t\t\t// BlackBerry 5, iOS 3 (original iPhone)\n\t\t\tif ( typeof elem.getBoundingClientRect !== strundefined ) {\n\t\t\t\tbox = elem.getBoundingClientRect();\n\t\t\t}\n\t\t\twin = getWindow( doc );\n\t\t\treturn {\n\t\t\t\ttop: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),\n\t\t\t\tleft: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )\n\t\t\t};\n\t\t},\n\t\n\t\tposition: function() {\n\t\t\tif ( !this[ 0 ] ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tvar offsetParent, offset,\n\t\t\t\tparentOffset = { top: 0, left: 0 },\n\t\t\t\telem = this[ 0 ];\n\t\n\t\t\t// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent\n\t\t\tif ( jQuery.css( elem, \"position\" ) === \"fixed\" ) {\n\t\t\t\t// we assume that getBoundingClientRect is available when computed position is fixed\n\t\t\t\toffset = elem.getBoundingClientRect();\n\t\t\t} else {\n\t\t\t\t// Get *real* offsetParent\n\t\t\t\toffsetParent = this.offsetParent();\n\t\n\t\t\t\t// Get correct offsets\n\t\t\t\toffset = this.offset();\n\t\t\t\tif ( !jQuery.nodeName( offsetParent[ 0 ], \"html\" ) ) {\n\t\t\t\t\tparentOffset = offsetParent.offset();\n\t\t\t\t}\n\t\n\t\t\t\t// Add offsetParent borders\n\t\t\t\tparentOffset.top += jQuery.css( offsetParent[ 0 ], \"borderTopWidth\", true );\n\t\t\t\tparentOffset.left += jQuery.css( offsetParent[ 0 ], \"borderLeftWidth\", true );\n\t\t\t}\n\t\n\t\t\t// Subtract parent offsets and element margins\n\t\t\t// note: when an element has margin: auto the offsetLeft and marginLeft\n\t\t\t// are the same in Safari causing offset.left to incorrectly be 0\n\t\t\treturn {\n\t\t\t\ttop: offset.top - parentOffset.top - jQuery.css( elem, \"marginTop\", true ),\n\t\t\t\tleft: offset.left - parentOffset.left - jQuery.css( elem, \"marginLeft\", true)\n\t\t\t};\n\t\t},\n\t\n\t\toffsetParent: function() {\n\t\t\treturn this.map(function() {\n\t\t\t\tvar offsetParent = this.offsetParent || docElem;\n\t\n\t\t\t\twhile ( offsetParent && ( !jQuery.nodeName( offsetParent, \"html\" ) && jQuery.css( offsetParent, \"position\" ) === \"static\" ) ) {\n\t\t\t\t\toffsetParent = offsetParent.offsetParent;\n\t\t\t\t}\n\t\t\t\treturn offsetParent || docElem;\n\t\t\t});\n\t\t}\n\t});\n\t\n\t// Create scrollLeft and scrollTop methods\n\tjQuery.each( { scrollLeft: \"pageXOffset\", scrollTop: \"pageYOffset\" }, function( method, prop ) {\n\t\tvar top = /Y/.test( prop );\n\t\n\t\tjQuery.fn[ method ] = function( val ) {\n\t\t\treturn access( this, function( elem, method, val ) {\n\t\t\t\tvar win = getWindow( elem );\n\t\n\t\t\t\tif ( val === undefined ) {\n\t\t\t\t\treturn win ? (prop in win) ? win[ prop ] :\n\t\t\t\t\t\twin.document.documentElement[ method ] :\n\t\t\t\t\t\telem[ method ];\n\t\t\t\t}\n\t\n\t\t\t\tif ( win ) {\n\t\t\t\t\twin.scrollTo(\n\t\t\t\t\t\t!top ? val : jQuery( win ).scrollLeft(),\n\t\t\t\t\t\ttop ? val : jQuery( win ).scrollTop()\n\t\t\t\t\t);\n\t\n\t\t\t\t} else {\n\t\t\t\t\telem[ method ] = val;\n\t\t\t\t}\n\t\t\t}, method, val, arguments.length, null );\n\t\t};\n\t});\n\t\n\t// Add the top/left cssHooks using jQuery.fn.position\n\t// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084\n\t// getComputedStyle returns percent when specified for top/left/bottom/right\n\t// rather than make the css module depend on the offset module, we just check for it here\n\tjQuery.each( [ \"top\", \"left\" ], function( i, prop ) {\n\t\tjQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,\n\t\t\tfunction( elem, computed ) {\n\t\t\t\tif ( computed ) {\n\t\t\t\t\tcomputed = curCSS( elem, prop );\n\t\t\t\t\t// if curCSS returns percentage, fallback to offset\n\t\t\t\t\treturn rnumnonpx.test( computed ) ?\n\t\t\t\t\t\tjQuery( elem ).position()[ prop ] + \"px\" :\n\t\t\t\t\t\tcomputed;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t});\n\t\n\t\n\t// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods\n\tjQuery.each( { Height: \"height\", Width: \"width\" }, function( name, type ) {\n\t\tjQuery.each( { padding: \"inner\" + name, content: type, \"\": \"outer\" + name }, function( defaultExtra, funcName ) {\n\t\t\t// margin is only for outerHeight, outerWidth\n\t\t\tjQuery.fn[ funcName ] = function( margin, value ) {\n\t\t\t\tvar chainable = arguments.length && ( defaultExtra || typeof margin !== \"boolean\" ),\n\t\t\t\t\textra = defaultExtra || ( margin === true || value === true ? \"margin\" : \"border\" );\n\t\n\t\t\t\treturn access( this, function( elem, type, value ) {\n\t\t\t\t\tvar doc;\n\t\n\t\t\t\t\tif ( jQuery.isWindow( elem ) ) {\n\t\t\t\t\t\t// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there\n\t\t\t\t\t\t// isn't a whole lot we can do. See pull request at this URL for discussion:\n\t\t\t\t\t\t// https://github.com/jquery/jquery/pull/764\n\t\t\t\t\t\treturn elem.document.documentElement[ \"client\" + name ];\n\t\t\t\t\t}\n\t\n\t\t\t\t\t// Get document width or height\n\t\t\t\t\tif ( elem.nodeType === 9 ) {\n\t\t\t\t\t\tdoc = elem.documentElement;\n\t\n\t\t\t\t\t\t// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest\n\t\t\t\t\t\t// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.\n\t\t\t\t\t\treturn Math.max(\n\t\t\t\t\t\t\telem.body[ \"scroll\" + name ], doc[ \"scroll\" + name ],\n\t\t\t\t\t\t\telem.body[ \"offset\" + name ], doc[ \"offset\" + name ],\n\t\t\t\t\t\t\tdoc[ \"client\" + name ]\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\n\t\t\t\t\treturn value === undefined ?\n\t\t\t\t\t\t// Get width or height on the element, requesting but not forcing parseFloat\n\t\t\t\t\t\tjQuery.css( elem, type, extra ) :\n\t\n\t\t\t\t\t\t// Set width or height on the element\n\t\t\t\t\t\tjQuery.style( elem, type, value, extra );\n\t\t\t\t}, type, chainable ? margin : undefined, chainable, null );\n\t\t\t};\n\t\t});\n\t});\n\t\n\t\n\t// The number of elements contained in the matched element set\n\tjQuery.fn.size = function() {\n\t\treturn this.length;\n\t};\n\t\n\tjQuery.fn.andSelf = jQuery.fn.addBack;\n\t\n\t\n\t\n\t\n\t// Register as a named AMD module, since jQuery can be concatenated with other\n\t// files that may use define, but not via a proper concatenation script that\n\t// understands anonymous AMD modules. A named AMD is safest and most robust\n\t// way to register. Lowercase jquery is used because AMD module names are\n\t// derived from file names, and jQuery is normally delivered in a lowercase\n\t// file name. Do this after creating the global so that if an AMD module wants\n\t// to call noConflict to hide this version of jQuery, it will work.\n\t\n\t// Note that for maximum portability, libraries that are not jQuery should\n\t// declare themselves as anonymous modules, and avoid setting a global if an\n\t// AMD loader is present. jQuery is a special case. For more information, see\n\t// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon\n\t\n\tif ( true ) {\n\t\t!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\treturn jQuery;\n\t\t}.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t}\n\t\n\t\n\t\n\t\n\tvar\n\t\t// Map over jQuery in case of overwrite\n\t\t_jQuery = window.jQuery,\n\t\n\t\t// Map over the $ in case of overwrite\n\t\t_$ = window.$;\n\t\n\tjQuery.noConflict = function( deep ) {\n\t\tif ( window.$ === jQuery ) {\n\t\t\twindow.$ = _$;\n\t\t}\n\t\n\t\tif ( deep && window.jQuery === jQuery ) {\n\t\t\twindow.jQuery = _jQuery;\n\t\t}\n\t\n\t\treturn jQuery;\n\t};\n\t\n\t// Expose jQuery and $ identifiers, even in\n\t// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)\n\t// and CommonJS for browser emulators (#13566)\n\tif ( typeof noGlobal === strundefined ) {\n\t\twindow.jQuery = window.$ = jQuery;\n\t}\n\t\n\t\n\t\n\t\n\treturn jQuery;\n\t\n\t}));\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;// Backbone.js 1.1.2\n\t\n\t// (c) 2010-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n\t// Backbone may be freely distributed under the MIT license.\n\t// For all details and documentation:\n\t// http://backbonejs.org\n\t\n\t(function(root, factory) {\n\t\n\t // Set up Backbone appropriately for the environment. Start with AMD.\n\t if (true) {\n\t !(__WEBPACK_AMD_DEFINE_ARRAY__ = [__webpack_require__(3), __webpack_require__(1), exports], __WEBPACK_AMD_DEFINE_RESULT__ = function(_, $, exports) {\n\t // Export global even in AMD case in case this script is loaded with\n\t // others that may still expect a global Backbone.\n\t root.Backbone = factory(root, exports, _, $);\n\t }.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\n\t // Next for Node.js or CommonJS. jQuery may not be needed as a module.\n\t } else if (typeof exports !== 'undefined') {\n\t var _ = require('underscore');\n\t factory(root, exports, _);\n\t\n\t // Finally, as a browser global.\n\t } else {\n\t root.Backbone = factory(root, {}, root._, (root.jQuery || root.Zepto || root.ender || root.$));\n\t }\n\t\n\t}(this, function(root, Backbone, _, $) {\n\t\n\t // Initial Setup\n\t // -------------\n\t\n\t // Save the previous value of the `Backbone` variable, so that it can be\n\t // restored later on, if `noConflict` is used.\n\t var previousBackbone = root.Backbone;\n\t\n\t // Create local references to array methods we'll want to use later.\n\t var array = [];\n\t var push = array.push;\n\t var slice = array.slice;\n\t var splice = array.splice;\n\t\n\t // Current version of the library. Keep in sync with `package.json`.\n\t Backbone.VERSION = '1.1.2';\n\t\n\t // For Backbone's purposes, jQuery, Zepto, Ender, or My Library (kidding) owns\n\t // the `$` variable.\n\t Backbone.$ = $;\n\t\n\t // Runs Backbone.js in *noConflict* mode, returning the `Backbone` variable\n\t // to its previous owner. Returns a reference to this Backbone object.\n\t Backbone.noConflict = function() {\n\t root.Backbone = previousBackbone;\n\t return this;\n\t };\n\t\n\t // Turn on `emulateHTTP` to support legacy HTTP servers. Setting this option\n\t // will fake `\"PATCH\"`, `\"PUT\"` and `\"DELETE\"` requests via the `_method` parameter and\n\t // set a `X-Http-Method-Override` header.\n\t Backbone.emulateHTTP = false;\n\t\n\t // Turn on `emulateJSON` to support legacy servers that can't deal with direct\n\t // `application/json` requests ... will encode the body as\n\t // `application/x-www-form-urlencoded` instead and will send the model in a\n\t // form param named `model`.\n\t Backbone.emulateJSON = false;\n\t\n\t // Backbone.Events\n\t // ---------------\n\t\n\t // A module that can be mixed in to *any object* in order to provide it with\n\t // custom events. You may bind with `on` or remove with `off` callback\n\t // functions to an event; `trigger`-ing an event fires all callbacks in\n\t // succession.\n\t //\n\t // var object = {};\n\t // _.extend(object, Backbone.Events);\n\t // object.on('expand', function(){ alert('expanded'); });\n\t // object.trigger('expand');\n\t //\n\t var Events = Backbone.Events = {\n\t\n\t // Bind an event to a `callback` function. Passing `\"all\"` will bind\n\t // the callback to all events fired.\n\t on: function(name, callback, context) {\n\t if (!eventsApi(this, 'on', name, [callback, context]) || !callback) return this;\n\t this._events || (this._events = {});\n\t var events = this._events[name] || (this._events[name] = []);\n\t events.push({callback: callback, context: context, ctx: context || this});\n\t return this;\n\t },\n\t\n\t // Bind an event to only be triggered a single time. After the first time\n\t // the callback is invoked, it will be removed.\n\t once: function(name, callback, context) {\n\t if (!eventsApi(this, 'once', name, [callback, context]) || !callback) return this;\n\t var self = this;\n\t var once = _.once(function() {\n\t self.off(name, once);\n\t callback.apply(this, arguments);\n\t });\n\t once._callback = callback;\n\t return this.on(name, once, context);\n\t },\n\t\n\t // Remove one or many callbacks. If `context` is null, removes all\n\t // callbacks with that function. If `callback` is null, removes all\n\t // callbacks for the event. If `name` is null, removes all bound\n\t // callbacks for all events.\n\t off: function(name, callback, context) {\n\t var retain, ev, events, names, i, l, j, k;\n\t if (!this._events || !eventsApi(this, 'off', name, [callback, context])) return this;\n\t if (!name && !callback && !context) {\n\t this._events = void 0;\n\t return this;\n\t }\n\t names = name ? [name] : _.keys(this._events);\n\t for (i = 0, l = names.length; i < l; i++) {\n\t name = names[i];\n\t if (events = this._events[name]) {\n\t this._events[name] = retain = [];\n\t if (callback || context) {\n\t for (j = 0, k = events.length; j < k; j++) {\n\t ev = events[j];\n\t if ((callback && callback !== ev.callback && callback !== ev.callback._callback) ||\n\t (context && context !== ev.context)) {\n\t retain.push(ev);\n\t }\n\t }\n\t }\n\t if (!retain.length) delete this._events[name];\n\t }\n\t }\n\t\n\t return this;\n\t },\n\t\n\t // Trigger one or many events, firing all bound callbacks. Callbacks are\n\t // passed the same arguments as `trigger` is, apart from the event name\n\t // (unless you're listening on `\"all\"`, which will cause your callback to\n\t // receive the true name of the event as the first argument).\n\t trigger: function(name) {\n\t if (!this._events) return this;\n\t var args = slice.call(arguments, 1);\n\t if (!eventsApi(this, 'trigger', name, args)) return this;\n\t var events = this._events[name];\n\t var allEvents = this._events.all;\n\t if (events) triggerEvents(events, args);\n\t if (allEvents) triggerEvents(allEvents, arguments);\n\t return this;\n\t },\n\t\n\t // Tell this object to stop listening to either specific events ... or\n\t // to every object it's currently listening to.\n\t stopListening: function(obj, name, callback) {\n\t var listeningTo = this._listeningTo;\n\t if (!listeningTo) return this;\n\t var remove = !name && !callback;\n\t if (!callback && typeof name === 'object') callback = this;\n\t if (obj) (listeningTo = {})[obj._listenId] = obj;\n\t for (var id in listeningTo) {\n\t obj = listeningTo[id];\n\t obj.off(name, callback, this);\n\t if (remove || _.isEmpty(obj._events)) delete this._listeningTo[id];\n\t }\n\t return this;\n\t }\n\t\n\t };\n\t\n\t // Regular expression used to split event strings.\n\t var eventSplitter = /\\s+/;\n\t\n\t // Implement fancy features of the Events API such as multiple event\n\t // names `\"change blur\"` and jQuery-style event maps `{change: action}`\n\t // in terms of the existing API.\n\t var eventsApi = function(obj, action, name, rest) {\n\t if (!name) return true;\n\t\n\t // Handle event maps.\n\t if (typeof name === 'object') {\n\t for (var key in name) {\n\t obj[action].apply(obj, [key, name[key]].concat(rest));\n\t }\n\t return false;\n\t }\n\t\n\t // Handle space separated event names.\n\t if (eventSplitter.test(name)) {\n\t var names = name.split(eventSplitter);\n\t for (var i = 0, l = names.length; i < l; i++) {\n\t obj[action].apply(obj, [names[i]].concat(rest));\n\t }\n\t return false;\n\t }\n\t\n\t return true;\n\t };\n\t\n\t // A difficult-to-believe, but optimized internal dispatch function for\n\t // triggering events. Tries to keep the usual cases speedy (most internal\n\t // Backbone events have 3 arguments).\n\t var triggerEvents = function(events, args) {\n\t var ev, i = -1, l = events.length, a1 = args[0], a2 = args[1], a3 = args[2];\n\t switch (args.length) {\n\t case 0: while (++i < l) (ev = events[i]).callback.call(ev.ctx); return;\n\t case 1: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1); return;\n\t case 2: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2); return;\n\t case 3: while (++i < l) (ev = events[i]).callback.call(ev.ctx, a1, a2, a3); return;\n\t default: while (++i < l) (ev = events[i]).callback.apply(ev.ctx, args); return;\n\t }\n\t };\n\t\n\t var listenMethods = {listenTo: 'on', listenToOnce: 'once'};\n\t\n\t // Inversion-of-control versions of `on` and `once`. Tell *this* object to\n\t // listen to an event in another object ... keeping track of what it's\n\t // listening to.\n\t _.each(listenMethods, function(implementation, method) {\n\t Events[method] = function(obj, name, callback) {\n\t var listeningTo = this._listeningTo || (this._listeningTo = {});\n\t var id = obj._listenId || (obj._listenId = _.uniqueId('l'));\n\t listeningTo[id] = obj;\n\t if (!callback && typeof name === 'object') callback = this;\n\t obj[implementation](name, callback, this);\n\t return this;\n\t };\n\t });\n\t\n\t // Aliases for backwards compatibility.\n\t Events.bind = Events.on;\n\t Events.unbind = Events.off;\n\t\n\t // Allow the `Backbone` object to serve as a global event bus, for folks who\n\t // want global \"pubsub\" in a convenient place.\n\t _.extend(Backbone, Events);\n\t\n\t // Backbone.Model\n\t // --------------\n\t\n\t // Backbone **Models** are the basic data object in the framework --\n\t // frequently representing a row in a table in a database on your server.\n\t // A discrete chunk of data and a bunch of useful, related methods for\n\t // performing computations and transformations on that data.\n\t\n\t // Create a new model with the specified attributes. A client id (`cid`)\n\t // is automatically generated and assigned for you.\n\t var Model = Backbone.Model = function(attributes, options) {\n\t var attrs = attributes || {};\n\t options || (options = {});\n\t this.cid = _.uniqueId('c');\n\t this.attributes = {};\n\t if (options.collection) this.collection = options.collection;\n\t if (options.parse) attrs = this.parse(attrs, options) || {};\n\t attrs = _.defaults({}, attrs, _.result(this, 'defaults'));\n\t this.set(attrs, options);\n\t this.changed = {};\n\t this.initialize.apply(this, arguments);\n\t };\n\t\n\t // Attach all inheritable methods to the Model prototype.\n\t _.extend(Model.prototype, Events, {\n\t\n\t // A hash of attributes whose current and previous value differ.\n\t changed: null,\n\t\n\t // The value returned during the last failed validation.\n\t validationError: null,\n\t\n\t // The default name for the JSON `id` attribute is `\"id\"`. MongoDB and\n\t // CouchDB users may want to set this to `\"_id\"`.\n\t idAttribute: 'id',\n\t\n\t // Initialize is an empty function by default. Override it with your own\n\t // initialization logic.\n\t initialize: function(){},\n\t\n\t // Return a copy of the model's `attributes` object.\n\t toJSON: function(options) {\n\t return _.clone(this.attributes);\n\t },\n\t\n\t // Proxy `Backbone.sync` by default -- but override this if you need\n\t // custom syncing semantics for *this* particular model.\n\t sync: function() {\n\t return Backbone.sync.apply(this, arguments);\n\t },\n\t\n\t // Get the value of an attribute.\n\t get: function(attr) {\n\t return this.attributes[attr];\n\t },\n\t\n\t // Get the HTML-escaped value of an attribute.\n\t escape: function(attr) {\n\t return _.escape(this.get(attr));\n\t },\n\t\n\t // Returns `true` if the attribute contains a value that is not null\n\t // or undefined.\n\t has: function(attr) {\n\t return this.get(attr) != null;\n\t },\n\t\n\t // Set a hash of model attributes on the object, firing `\"change\"`. This is\n\t // the core primitive operation of a model, updating the data and notifying\n\t // anyone who needs to know about the change in state. The heart of the beast.\n\t set: function(key, val, options) {\n\t var attr, attrs, unset, changes, silent, changing, prev, current;\n\t if (key == null) return this;\n\t\n\t // Handle both `\"key\", value` and `{key: value}` -style arguments.\n\t if (typeof key === 'object') {\n\t attrs = key;\n\t options = val;\n\t } else {\n\t (attrs = {})[key] = val;\n\t }\n\t\n\t options || (options = {});\n\t\n\t // Run validation.\n\t if (!this._validate(attrs, options)) return false;\n\t\n\t // Extract attributes and options.\n\t unset = options.unset;\n\t silent = options.silent;\n\t changes = [];\n\t changing = this._changing;\n\t this._changing = true;\n\t\n\t if (!changing) {\n\t this._previousAttributes = _.clone(this.attributes);\n\t this.changed = {};\n\t }\n\t current = this.attributes, prev = this._previousAttributes;\n\t\n\t // Check for changes of `id`.\n\t if (this.idAttribute in attrs) this.id = attrs[this.idAttribute];\n\t\n\t // For each `set` attribute, update or delete the current value.\n\t for (attr in attrs) {\n\t val = attrs[attr];\n\t if (!_.isEqual(current[attr], val)) changes.push(attr);\n\t if (!_.isEqual(prev[attr], val)) {\n\t this.changed[attr] = val;\n\t } else {\n\t delete this.changed[attr];\n\t }\n\t unset ? delete current[attr] : current[attr] = val;\n\t }\n\t\n\t // Trigger all relevant attribute changes.\n\t if (!silent) {\n\t if (changes.length) this._pending = options;\n\t for (var i = 0, l = changes.length; i < l; i++) {\n\t this.trigger('change:' + changes[i], this, current[changes[i]], options);\n\t }\n\t }\n\t\n\t // You might be wondering why there's a `while` loop here. Changes can\n\t // be recursively nested within `\"change\"` events.\n\t if (changing) return this;\n\t if (!silent) {\n\t while (this._pending) {\n\t options = this._pending;\n\t this._pending = false;\n\t this.trigger('change', this, options);\n\t }\n\t }\n\t this._pending = false;\n\t this._changing = false;\n\t return this;\n\t },\n\t\n\t // Remove an attribute from the model, firing `\"change\"`. `unset` is a noop\n\t // if the attribute doesn't exist.\n\t unset: function(attr, options) {\n\t return this.set(attr, void 0, _.extend({}, options, {unset: true}));\n\t },\n\t\n\t // Clear all attributes on the model, firing `\"change\"`.\n\t clear: function(options) {\n\t var attrs = {};\n\t for (var key in this.attributes) attrs[key] = void 0;\n\t return this.set(attrs, _.extend({}, options, {unset: true}));\n\t },\n\t\n\t // Determine if the model has changed since the last `\"change\"` event.\n\t // If you specify an attribute name, determine if that attribute has changed.\n\t hasChanged: function(attr) {\n\t if (attr == null) return !_.isEmpty(this.changed);\n\t return _.has(this.changed, attr);\n\t },\n\t\n\t // Return an object containing all the attributes that have changed, or\n\t // false if there are no changed attributes. Useful for determining what\n\t // parts of a view need to be updated and/or what attributes need to be\n\t // persisted to the server. Unset attributes will be set to undefined.\n\t // You can also pass an attributes object to diff against the model,\n\t // determining if there *would be* a change.\n\t changedAttributes: function(diff) {\n\t if (!diff) return this.hasChanged() ? _.clone(this.changed) : false;\n\t var val, changed = false;\n\t var old = this._changing ? this._previousAttributes : this.attributes;\n\t for (var attr in diff) {\n\t if (_.isEqual(old[attr], (val = diff[attr]))) continue;\n\t (changed || (changed = {}))[attr] = val;\n\t }\n\t return changed;\n\t },\n\t\n\t // Get the previous value of an attribute, recorded at the time the last\n\t // `\"change\"` event was fired.\n\t previous: function(attr) {\n\t if (attr == null || !this._previousAttributes) return null;\n\t return this._previousAttributes[attr];\n\t },\n\t\n\t // Get all of the attributes of the model at the time of the previous\n\t // `\"change\"` event.\n\t previousAttributes: function() {\n\t return _.clone(this._previousAttributes);\n\t },\n\t\n\t // Fetch the model from the server. If the server's representation of the\n\t // model differs from its current attributes, they will be overridden,\n\t // triggering a `\"change\"` event.\n\t fetch: function(options) {\n\t options = options ? _.clone(options) : {};\n\t if (options.parse === void 0) options.parse = true;\n\t var model = this;\n\t var success = options.success;\n\t options.success = function(resp) {\n\t if (!model.set(model.parse(resp, options), options)) return false;\n\t if (success) success(model, resp, options);\n\t model.trigger('sync', model, resp, options);\n\t };\n\t wrapError(this, options);\n\t return this.sync('read', this, options);\n\t },\n\t\n\t // Set a hash of model attributes, and sync the model to the server.\n\t // If the server returns an attributes hash that differs, the model's\n\t // state will be `set` again.\n\t save: function(key, val, options) {\n\t var attrs, method, xhr, attributes = this.attributes;\n\t\n\t // Handle both `\"key\", value` and `{key: value}` -style arguments.\n\t if (key == null || typeof key === 'object') {\n\t attrs = key;\n\t options = val;\n\t } else {\n\t (attrs = {})[key] = val;\n\t }\n\t\n\t options = _.extend({validate: true}, options);\n\t\n\t // If we're not waiting and attributes exist, save acts as\n\t // `set(attr).save(null, opts)` with validation. Otherwise, check if\n\t // the model will be valid when the attributes, if any, are set.\n\t if (attrs && !options.wait) {\n\t if (!this.set(attrs, options)) return false;\n\t } else {\n\t if (!this._validate(attrs, options)) return false;\n\t }\n\t\n\t // Set temporary attributes if `{wait: true}`.\n\t if (attrs && options.wait) {\n\t this.attributes = _.extend({}, attributes, attrs);\n\t }\n\t\n\t // After a successful server-side save, the client is (optionally)\n\t // updated with the server-side state.\n\t if (options.parse === void 0) options.parse = true;\n\t var model = this;\n\t var success = options.success;\n\t options.success = function(resp) {\n\t // Ensure attributes are restored during synchronous saves.\n\t model.attributes = attributes;\n\t var serverAttrs = model.parse(resp, options);\n\t if (options.wait) serverAttrs = _.extend(attrs || {}, serverAttrs);\n\t if (_.isObject(serverAttrs) && !model.set(serverAttrs, options)) {\n\t return false;\n\t }\n\t if (success) success(model, resp, options);\n\t model.trigger('sync', model, resp, options);\n\t };\n\t wrapError(this, options);\n\t\n\t method = this.isNew() ? 'create' : (options.patch ? 'patch' : 'update');\n\t if (method === 'patch') options.attrs = attrs;\n\t xhr = this.sync(method, this, options);\n\t\n\t // Restore attributes.\n\t if (attrs && options.wait) this.attributes = attributes;\n\t\n\t return xhr;\n\t },\n\t\n\t // Destroy this model on the server if it was already persisted.\n\t // Optimistically removes the model from its collection, if it has one.\n\t // If `wait: true` is passed, waits for the server to respond before removal.\n\t destroy: function(options) {\n\t options = options ? _.clone(options) : {};\n\t var model = this;\n\t var success = options.success;\n\t\n\t var destroy = function() {\n\t model.trigger('destroy', model, model.collection, options);\n\t };\n\t\n\t options.success = function(resp) {\n\t if (options.wait || model.isNew()) destroy();\n\t if (success) success(model, resp, options);\n\t if (!model.isNew()) model.trigger('sync', model, resp, options);\n\t };\n\t\n\t if (this.isNew()) {\n\t options.success();\n\t return false;\n\t }\n\t wrapError(this, options);\n\t\n\t var xhr = this.sync('delete', this, options);\n\t if (!options.wait) destroy();\n\t return xhr;\n\t },\n\t\n\t // Default URL for the model's representation on the server -- if you're\n\t // using Backbone's restful methods, override this to change the endpoint\n\t // that will be called.\n\t url: function() {\n\t var base =\n\t _.result(this, 'urlRoot') ||\n\t _.result(this.collection, 'url') ||\n\t urlError();\n\t if (this.isNew()) return base;\n\t return base.replace(/([^\\/])$/, '$1/') + encodeURIComponent(this.id);\n\t },\n\t\n\t // **parse** converts a response into the hash of attributes to be `set` on\n\t // the model. The default implementation is just to pass the response along.\n\t parse: function(resp, options) {\n\t return resp;\n\t },\n\t\n\t // Create a new model with identical attributes to this one.\n\t clone: function() {\n\t return new this.constructor(this.attributes);\n\t },\n\t\n\t // A model is new if it has never been saved to the server, and lacks an id.\n\t isNew: function() {\n\t return !this.has(this.idAttribute);\n\t },\n\t\n\t // Check if the model is currently in a valid state.\n\t isValid: function(options) {\n\t return this._validate({}, _.extend(options || {}, { validate: true }));\n\t },\n\t\n\t // Run validation against the next complete set of model attributes,\n\t // returning `true` if all is well. Otherwise, fire an `\"invalid\"` event.\n\t _validate: function(attrs, options) {\n\t if (!options.validate || !this.validate) return true;\n\t attrs = _.extend({}, this.attributes, attrs);\n\t var error = this.validationError = this.validate(attrs, options) || null;\n\t if (!error) return true;\n\t this.trigger('invalid', this, error, _.extend(options, {validationError: error}));\n\t return false;\n\t }\n\t\n\t });\n\t\n\t // Underscore methods that we want to implement on the Model.\n\t var modelMethods = ['keys', 'values', 'pairs', 'invert', 'pick', 'omit'];\n\t\n\t // Mix in each Underscore method as a proxy to `Model#attributes`.\n\t _.each(modelMethods, function(method) {\n\t Model.prototype[method] = function() {\n\t var args = slice.call(arguments);\n\t args.unshift(this.attributes);\n\t return _[method].apply(_, args);\n\t };\n\t });\n\t\n\t // Backbone.Collection\n\t // -------------------\n\t\n\t // If models tend to represent a single row of data, a Backbone Collection is\n\t // more analagous to a table full of data ... or a small slice or page of that\n\t // table, or a collection of rows that belong together for a particular reason\n\t // -- all of the messages in this particular folder, all of the documents\n\t // belonging to this particular author, and so on. Collections maintain\n\t // indexes of their models, both in order, and for lookup by `id`.\n\t\n\t // Create a new **Collection**, perhaps to contain a specific type of `model`.\n\t // If a `comparator` is specified, the Collection will maintain\n\t // its models in sort order, as they're added and removed.\n\t var Collection = Backbone.Collection = function(models, options) {\n\t options || (options = {});\n\t if (options.model) this.model = options.model;\n\t if (options.comparator !== void 0) this.comparator = options.comparator;\n\t this._reset();\n\t this.initialize.apply(this, arguments);\n\t if (models) this.reset(models, _.extend({silent: true}, options));\n\t };\n\t\n\t // Default options for `Collection#set`.\n\t var setOptions = {add: true, remove: true, merge: true};\n\t var addOptions = {add: true, remove: false};\n\t\n\t // Define the Collection's inheritable methods.\n\t _.extend(Collection.prototype, Events, {\n\t\n\t // The default model for a collection is just a **Backbone.Model**.\n\t // This should be overridden in most cases.\n\t model: Model,\n\t\n\t // Initialize is an empty function by default. Override it with your own\n\t // initialization logic.\n\t initialize: function(){},\n\t\n\t // The JSON representation of a Collection is an array of the\n\t // models' attributes.\n\t toJSON: function(options) {\n\t return this.map(function(model){ return model.toJSON(options); });\n\t },\n\t\n\t // Proxy `Backbone.sync` by default.\n\t sync: function() {\n\t return Backbone.sync.apply(this, arguments);\n\t },\n\t\n\t // Add a model, or list of models to the set.\n\t add: function(models, options) {\n\t return this.set(models, _.extend({merge: false}, options, addOptions));\n\t },\n\t\n\t // Remove a model, or a list of models from the set.\n\t remove: function(models, options) {\n\t var singular = !_.isArray(models);\n\t models = singular ? [models] : _.clone(models);\n\t options || (options = {});\n\t var i, l, index, model;\n\t for (i = 0, l = models.length; i < l; i++) {\n\t model = models[i] = this.get(models[i]);\n\t if (!model) continue;\n\t delete this._byId[model.id];\n\t delete this._byId[model.cid];\n\t index = this.indexOf(model);\n\t this.models.splice(index, 1);\n\t this.length--;\n\t if (!options.silent) {\n\t options.index = index;\n\t model.trigger('remove', model, this, options);\n\t }\n\t this._removeReference(model, options);\n\t }\n\t return singular ? models[0] : models;\n\t },\n\t\n\t // Update a collection by `set`-ing a new list of models, adding new ones,\n\t // removing models that are no longer present, and merging models that\n\t // already exist in the collection, as necessary. Similar to **Model#set**,\n\t // the core operation for updating the data contained by the collection.\n\t set: function(models, options) {\n\t options = _.defaults({}, options, setOptions);\n\t if (options.parse) models = this.parse(models, options);\n\t var singular = !_.isArray(models);\n\t models = singular ? (models ? [models] : []) : _.clone(models);\n\t var i, l, id, model, attrs, existing, sort;\n\t var at = options.at;\n\t var targetModel = this.model;\n\t var sortable = this.comparator && (at == null) && options.sort !== false;\n\t var sortAttr = _.isString(this.comparator) ? this.comparator : null;\n\t var toAdd = [], toRemove = [], modelMap = {};\n\t var add = options.add, merge = options.merge, remove = options.remove;\n\t var order = !sortable && add && remove ? [] : false;\n\t\n\t // Turn bare objects into model references, and prevent invalid models\n\t // from being added.\n\t for (i = 0, l = models.length; i < l; i++) {\n\t attrs = models[i] || {};\n\t if (attrs instanceof Model) {\n\t id = model = attrs;\n\t } else {\n\t id = attrs[targetModel.prototype.idAttribute || 'id'];\n\t }\n\t\n\t // If a duplicate is found, prevent it from being added and\n\t // optionally merge it into the existing model.\n\t if (existing = this.get(id)) {\n\t if (remove) modelMap[existing.cid] = true;\n\t if (merge) {\n\t attrs = attrs === model ? model.attributes : attrs;\n\t if (options.parse) attrs = existing.parse(attrs, options);\n\t existing.set(attrs, options);\n\t if (sortable && !sort && existing.hasChanged(sortAttr)) sort = true;\n\t }\n\t models[i] = existing;\n\t\n\t // If this is a new, valid model, push it to the `toAdd` list.\n\t } else if (add) {\n\t model = models[i] = this._prepareModel(attrs, options);\n\t if (!model) continue;\n\t toAdd.push(model);\n\t this._addReference(model, options);\n\t }\n\t\n\t // Do not add multiple models with the same `id`.\n\t model = existing || model;\n\t if (order && (model.isNew() || !modelMap[model.id])) order.push(model);\n\t modelMap[model.id] = true;\n\t }\n\t\n\t // Remove nonexistent models if appropriate.\n\t if (remove) {\n\t for (i = 0, l = this.length; i < l; ++i) {\n\t if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model);\n\t }\n\t if (toRemove.length) this.remove(toRemove, options);\n\t }\n\t\n\t // See if sorting is needed, update `length` and splice in new models.\n\t if (toAdd.length || (order && order.length)) {\n\t if (sortable) sort = true;\n\t this.length += toAdd.length;\n\t if (at != null) {\n\t for (i = 0, l = toAdd.length; i < l; i++) {\n\t this.models.splice(at + i, 0, toAdd[i]);\n\t }\n\t } else {\n\t if (order) this.models.length = 0;\n\t var orderedModels = order || toAdd;\n\t for (i = 0, l = orderedModels.length; i < l; i++) {\n\t this.models.push(orderedModels[i]);\n\t }\n\t }\n\t }\n\t\n\t // Silently sort the collection if appropriate.\n\t if (sort) this.sort({silent: true});\n\t\n\t // Unless silenced, it's time to fire all appropriate add/sort events.\n\t if (!options.silent) {\n\t for (i = 0, l = toAdd.length; i < l; i++) {\n\t (model = toAdd[i]).trigger('add', model, this, options);\n\t }\n\t if (sort || (order && order.length)) this.trigger('sort', this, options);\n\t }\n\t\n\t // Return the added (or merged) model (or models).\n\t return singular ? models[0] : models;\n\t },\n\t\n\t // When you have more items than you want to add or remove individually,\n\t // you can reset the entire set with a new list of models, without firing\n\t // any granular `add` or `remove` events. Fires `reset` when finished.\n\t // Useful for bulk operations and optimizations.\n\t reset: function(models, options) {\n\t options || (options = {});\n\t for (var i = 0, l = this.models.length; i < l; i++) {\n\t this._removeReference(this.models[i], options);\n\t }\n\t options.previousModels = this.models;\n\t this._reset();\n\t models = this.add(models, _.extend({silent: true}, options));\n\t if (!options.silent) this.trigger('reset', this, options);\n\t return models;\n\t },\n\t\n\t // Add a model to the end of the collection.\n\t push: function(model, options) {\n\t return this.add(model, _.extend({at: this.length}, options));\n\t },\n\t\n\t // Remove a model from the end of the collection.\n\t pop: function(options) {\n\t var model = this.at(this.length - 1);\n\t this.remove(model, options);\n\t return model;\n\t },\n\t\n\t // Add a model to the beginning of the collection.\n\t unshift: function(model, options) {\n\t return this.add(model, _.extend({at: 0}, options));\n\t },\n\t\n\t // Remove a model from the beginning of the collection.\n\t shift: function(options) {\n\t var model = this.at(0);\n\t this.remove(model, options);\n\t return model;\n\t },\n\t\n\t // Slice out a sub-array of models from the collection.\n\t slice: function() {\n\t return slice.apply(this.models, arguments);\n\t },\n\t\n\t // Get a model from the set by id.\n\t get: function(obj) {\n\t if (obj == null) return void 0;\n\t return this._byId[obj] || this._byId[obj.id] || this._byId[obj.cid];\n\t },\n\t\n\t // Get the model at the given index.\n\t at: function(index) {\n\t return this.models[index];\n\t },\n\t\n\t // Return models with matching attributes. Useful for simple cases of\n\t // `filter`.\n\t where: function(attrs, first) {\n\t if (_.isEmpty(attrs)) return first ? void 0 : [];\n\t return this[first ? 'find' : 'filter'](function(model) {\n\t for (var key in attrs) {\n\t if (attrs[key] !== model.get(key)) return false;\n\t }\n\t return true;\n\t });\n\t },\n\t\n\t // Return the first model with matching attributes. Useful for simple cases\n\t // of `find`.\n\t findWhere: function(attrs) {\n\t return this.where(attrs, true);\n\t },\n\t\n\t // Force the collection to re-sort itself. You don't need to call this under\n\t // normal circumstances, as the set will maintain sort order as each item\n\t // is added.\n\t sort: function(options) {\n\t if (!this.comparator) throw new Error('Cannot sort a set without a comparator');\n\t options || (options = {});\n\t\n\t // Run sort based on type of `comparator`.\n\t if (_.isString(this.comparator) || this.comparator.length === 1) {\n\t this.models = this.sortBy(this.comparator, this);\n\t } else {\n\t this.models.sort(_.bind(this.comparator, this));\n\t }\n\t\n\t if (!options.silent) this.trigger('sort', this, options);\n\t return this;\n\t },\n\t\n\t // Pluck an attribute from each model in the collection.\n\t pluck: function(attr) {\n\t return _.invoke(this.models, 'get', attr);\n\t },\n\t\n\t // Fetch the default set of models for this collection, resetting the\n\t // collection when they arrive. If `reset: true` is passed, the response\n\t // data will be passed through the `reset` method instead of `set`.\n\t fetch: function(options) {\n\t options = options ? _.clone(options) : {};\n\t if (options.parse === void 0) options.parse = true;\n\t var success = options.success;\n\t var collection = this;\n\t options.success = function(resp) {\n\t var method = options.reset ? 'reset' : 'set';\n\t collection[method](resp, options);\n\t if (success) success(collection, resp, options);\n\t collection.trigger('sync', collection, resp, options);\n\t };\n\t wrapError(this, options);\n\t return this.sync('read', this, options);\n\t },\n\t\n\t // Create a new instance of a model in this collection. Add the model to the\n\t // collection immediately, unless `wait: true` is passed, in which case we\n\t // wait for the server to agree.\n\t create: function(model, options) {\n\t options = options ? _.clone(options) : {};\n\t if (!(model = this._prepareModel(model, options))) return false;\n\t if (!options.wait) this.add(model, options);\n\t var collection = this;\n\t var success = options.success;\n\t options.success = function(model, resp) {\n\t if (options.wait) collection.add(model, options);\n\t if (success) success(model, resp, options);\n\t };\n\t model.save(null, options);\n\t return model;\n\t },\n\t\n\t // **parse** converts a response into a list of models to be added to the\n\t // collection. The default implementation is just to pass it through.\n\t parse: function(resp, options) {\n\t return resp;\n\t },\n\t\n\t // Create a new collection with an identical list of models as this one.\n\t clone: function() {\n\t return new this.constructor(this.models);\n\t },\n\t\n\t // Private method to reset all internal state. Called when the collection\n\t // is first initialized or reset.\n\t _reset: function() {\n\t this.length = 0;\n\t this.models = [];\n\t this._byId = {};\n\t },\n\t\n\t // Prepare a hash of attributes (or other model) to be added to this\n\t // collection.\n\t _prepareModel: function(attrs, options) {\n\t if (attrs instanceof Model) return attrs;\n\t options = options ? _.clone(options) : {};\n\t options.collection = this;\n\t var model = new this.model(attrs, options);\n\t if (!model.validationError) return model;\n\t this.trigger('invalid', this, model.validationError, options);\n\t return false;\n\t },\n\t\n\t // Internal method to create a model's ties to a collection.\n\t _addReference: function(model, options) {\n\t this._byId[model.cid] = model;\n\t if (model.id != null) this._byId[model.id] = model;\n\t if (!model.collection) model.collection = this;\n\t model.on('all', this._onModelEvent, this);\n\t },\n\t\n\t // Internal method to sever a model's ties to a collection.\n\t _removeReference: function(model, options) {\n\t if (this === model.collection) delete model.collection;\n\t model.off('all', this._onModelEvent, this);\n\t },\n\t\n\t // Internal method called every time a model in the set fires an event.\n\t // Sets need to update their indexes when models change ids. All other\n\t // events simply proxy through. \"add\" and \"remove\" events that originate\n\t // in other collections are ignored.\n\t _onModelEvent: function(event, model, collection, options) {\n\t if ((event === 'add' || event === 'remove') && collection !== this) return;\n\t if (event === 'destroy') this.remove(model, options);\n\t if (model && event === 'change:' + model.idAttribute) {\n\t delete this._byId[model.previous(model.idAttribute)];\n\t if (model.id != null) this._byId[model.id] = model;\n\t }\n\t this.trigger.apply(this, arguments);\n\t }\n\t\n\t });\n\t\n\t // Underscore methods that we want to implement on the Collection.\n\t // 90% of the core usefulness of Backbone Collections is actually implemented\n\t // right here:\n\t var methods = ['forEach', 'each', 'map', 'collect', 'reduce', 'foldl',\n\t 'inject', 'reduceRight', 'foldr', 'find', 'detect', 'filter', 'select',\n\t 'reject', 'every', 'all', 'some', 'any', 'include', 'contains', 'invoke',\n\t 'max', 'min', 'toArray', 'size', 'first', 'head', 'take', 'initial', 'rest',\n\t 'tail', 'drop', 'last', 'without', 'difference', 'indexOf', 'shuffle',\n\t 'lastIndexOf', 'isEmpty', 'chain', 'sample'];\n\t\n\t // Mix in each Underscore method as a proxy to `Collection#models`.\n\t _.each(methods, function(method) {\n\t Collection.prototype[method] = function() {\n\t var args = slice.call(arguments);\n\t args.unshift(this.models);\n\t return _[method].apply(_, args);\n\t };\n\t });\n\t\n\t // Underscore methods that take a property name as an argument.\n\t var attributeMethods = ['groupBy', 'countBy', 'sortBy', 'indexBy'];\n\t\n\t // Use attributes instead of properties.\n\t _.each(attributeMethods, function(method) {\n\t Collection.prototype[method] = function(value, context) {\n\t var iterator = _.isFunction(value) ? value : function(model) {\n\t return model.get(value);\n\t };\n\t return _[method](this.models, iterator, context);\n\t };\n\t });\n\t\n\t // Backbone.View\n\t // -------------\n\t\n\t // Backbone Views are almost more convention than they are actual code. A View\n\t // is simply a JavaScript object that represents a logical chunk of UI in the\n\t // DOM. This might be a single item, an entire list, a sidebar or panel, or\n\t // even the surrounding frame which wraps your whole app. Defining a chunk of\n\t // UI as a **View** allows you to define your DOM events declaratively, without\n\t // having to worry about render order ... and makes it easy for the view to\n\t // react to specific changes in the state of your models.\n\t\n\t // Creating a Backbone.View creates its initial element outside of the DOM,\n\t // if an existing element is not provided...\n\t var View = Backbone.View = function(options) {\n\t this.cid = _.uniqueId('view');\n\t options || (options = {});\n\t _.extend(this, _.pick(options, viewOptions));\n\t this._ensureElement();\n\t this.initialize.apply(this, arguments);\n\t this.delegateEvents();\n\t };\n\t\n\t // Cached regex to split keys for `delegate`.\n\t var delegateEventSplitter = /^(\\S+)\\s*(.*)$/;\n\t\n\t // List of view options to be merged as properties.\n\t var viewOptions = ['model', 'collection', 'el', 'id', 'attributes', 'className', 'tagName', 'events'];\n\t\n\t // Set up all inheritable **Backbone.View** properties and methods.\n\t _.extend(View.prototype, Events, {\n\t\n\t // The default `tagName` of a View's element is `\"div\"`.\n\t tagName: 'div',\n\t\n\t // jQuery delegate for element lookup, scoped to DOM elements within the\n\t // current view. This should be preferred to global lookups where possible.\n\t $: function(selector) {\n\t return this.$el.find(selector);\n\t },\n\t\n\t // Initialize is an empty function by default. Override it with your own\n\t // initialization logic.\n\t initialize: function(){},\n\t\n\t // **render** is the core function that your view should override, in order\n\t // to populate its element (`this.el`), with the appropriate HTML. The\n\t // convention is for **render** to always return `this`.\n\t render: function() {\n\t return this;\n\t },\n\t\n\t // Remove this view by taking the element out of the DOM, and removing any\n\t // applicable Backbone.Events listeners.\n\t remove: function() {\n\t this.$el.remove();\n\t this.stopListening();\n\t return this;\n\t },\n\t\n\t // Change the view's element (`this.el` property), including event\n\t // re-delegation.\n\t setElement: function(element, delegate) {\n\t if (this.$el) this.undelegateEvents();\n\t this.$el = element instanceof Backbone.$ ? element : Backbone.$(element);\n\t this.el = this.$el[0];\n\t if (delegate !== false) this.delegateEvents();\n\t return this;\n\t },\n\t\n\t // Set callbacks, where `this.events` is a hash of\n\t //\n\t // *{\"event selector\": \"callback\"}*\n\t //\n\t // {\n\t // 'mousedown .title': 'edit',\n\t // 'click .button': 'save',\n\t // 'click .open': function(e) { ... }\n\t // }\n\t //\n\t // pairs. Callbacks will be bound to the view, with `this` set properly.\n\t // Uses event delegation for efficiency.\n\t // Omitting the selector binds the event to `this.el`.\n\t // This only works for delegate-able events: not `focus`, `blur`, and\n\t // not `change`, `submit`, and `reset` in Internet Explorer.\n\t delegateEvents: function(events) {\n\t if (!(events || (events = _.result(this, 'events')))) return this;\n\t this.undelegateEvents();\n\t for (var key in events) {\n\t var method = events[key];\n\t if (!_.isFunction(method)) method = this[events[key]];\n\t if (!method) continue;\n\t\n\t var match = key.match(delegateEventSplitter);\n\t var eventName = match[1], selector = match[2];\n\t method = _.bind(method, this);\n\t eventName += '.delegateEvents' + this.cid;\n\t if (selector === '') {\n\t this.$el.on(eventName, method);\n\t } else {\n\t this.$el.on(eventName, selector, method);\n\t }\n\t }\n\t return this;\n\t },\n\t\n\t // Clears all callbacks previously bound to the view with `delegateEvents`.\n\t // You usually don't need to use this, but may wish to if you have multiple\n\t // Backbone views attached to the same DOM element.\n\t undelegateEvents: function() {\n\t this.$el.off('.delegateEvents' + this.cid);\n\t return this;\n\t },\n\t\n\t // Ensure that the View has a DOM element to render into.\n\t // If `this.el` is a string, pass it through `$()`, take the first\n\t // matching element, and re-assign it to `el`. Otherwise, create\n\t // an element from the `id`, `className` and `tagName` properties.\n\t _ensureElement: function() {\n\t if (!this.el) {\n\t var attrs = _.extend({}, _.result(this, 'attributes'));\n\t if (this.id) attrs.id = _.result(this, 'id');\n\t if (this.className) attrs['class'] = _.result(this, 'className');\n\t var $el = Backbone.$('<' + _.result(this, 'tagName') + '>').attr(attrs);\n\t this.setElement($el, false);\n\t } else {\n\t this.setElement(_.result(this, 'el'), false);\n\t }\n\t }\n\t\n\t });\n\t\n\t // Backbone.sync\n\t // -------------\n\t\n\t // Override this function to change the manner in which Backbone persists\n\t // models to the server. You will be passed the type of request, and the\n\t // model in question. By default, makes a RESTful Ajax request\n\t // to the model's `url()`. Some possible customizations could be:\n\t //\n\t // * Use `setTimeout` to batch rapid-fire updates into a single request.\n\t // * Send up the models as XML instead of JSON.\n\t // * Persist models via WebSockets instead of Ajax.\n\t //\n\t // Turn on `Backbone.emulateHTTP` in order to send `PUT` and `DELETE` requests\n\t // as `POST`, with a `_method` parameter containing the true HTTP method,\n\t // as well as all requests with the body as `application/x-www-form-urlencoded`\n\t // instead of `application/json` with the model in a param named `model`.\n\t // Useful when interfacing with server-side languages like **PHP** that make\n\t // it difficult to read the body of `PUT` requests.\n\t Backbone.sync = function(method, model, options) {\n\t var type = methodMap[method];\n\t\n\t // Default options, unless specified.\n\t _.defaults(options || (options = {}), {\n\t emulateHTTP: Backbone.emulateHTTP,\n\t emulateJSON: Backbone.emulateJSON\n\t });\n\t\n\t // Default JSON-request options.\n\t var params = {type: type, dataType: 'json'};\n\t\n\t // Ensure that we have a URL.\n\t if (!options.url) {\n\t params.url = _.result(model, 'url') || urlError();\n\t }\n\t\n\t // Ensure that we have the appropriate request data.\n\t if (options.data == null && model && (method === 'create' || method === 'update' || method === 'patch')) {\n\t params.contentType = 'application/json';\n\t params.data = JSON.stringify(options.attrs || model.toJSON(options));\n\t }\n\t\n\t // For older servers, emulate JSON by encoding the request into an HTML-form.\n\t if (options.emulateJSON) {\n\t params.contentType = 'application/x-www-form-urlencoded';\n\t params.data = params.data ? {model: params.data} : {};\n\t }\n\t\n\t // For older servers, emulate HTTP by mimicking the HTTP method with `_method`\n\t // And an `X-HTTP-Method-Override` header.\n\t if (options.emulateHTTP && (type === 'PUT' || type === 'DELETE' || type === 'PATCH')) {\n\t params.type = 'POST';\n\t if (options.emulateJSON) params.data._method = type;\n\t var beforeSend = options.beforeSend;\n\t options.beforeSend = function(xhr) {\n\t xhr.setRequestHeader('X-HTTP-Method-Override', type);\n\t if (beforeSend) return beforeSend.apply(this, arguments);\n\t };\n\t }\n\t\n\t // Don't process data on a non-GET request.\n\t if (params.type !== 'GET' && !options.emulateJSON) {\n\t params.processData = false;\n\t }\n\t\n\t // If we're sending a `PATCH` request, and we're in an old Internet Explorer\n\t // that still has ActiveX enabled by default, override jQuery to use that\n\t // for XHR instead. Remove this line when jQuery supports `PATCH` on IE8.\n\t if (params.type === 'PATCH' && noXhrPatch) {\n\t params.xhr = function() {\n\t return new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t };\n\t }\n\t\n\t // Make the request, allowing the user to override any Ajax options.\n\t var xhr = options.xhr = Backbone.ajax(_.extend(params, options));\n\t model.trigger('request', model, xhr, options);\n\t return xhr;\n\t };\n\t\n\t var noXhrPatch =\n\t typeof window !== 'undefined' && !!window.ActiveXObject &&\n\t !(window.XMLHttpRequest && (new XMLHttpRequest).dispatchEvent);\n\t\n\t // Map from CRUD to HTTP for our default `Backbone.sync` implementation.\n\t var methodMap = {\n\t 'create': 'POST',\n\t 'update': 'PUT',\n\t 'patch': 'PATCH',\n\t 'delete': 'DELETE',\n\t 'read': 'GET'\n\t };\n\t\n\t // Set the default implementation of `Backbone.ajax` to proxy through to `$`.\n\t // Override this if you'd like to use a different library.\n\t Backbone.ajax = function() {\n\t return Backbone.$.ajax.apply(Backbone.$, arguments);\n\t };\n\t\n\t // Backbone.Router\n\t // ---------------\n\t\n\t // Routers map faux-URLs to actions, and fire events when routes are\n\t // matched. Creating a new one sets its `routes` hash, if not set statically.\n\t var Router = Backbone.Router = function(options) {\n\t options || (options = {});\n\t if (options.routes) this.routes = options.routes;\n\t this._bindRoutes();\n\t this.initialize.apply(this, arguments);\n\t };\n\t\n\t // Cached regular expressions for matching named param parts and splatted\n\t // parts of route strings.\n\t var optionalParam = /\\((.*?)\\)/g;\n\t var namedParam = /(\\(\\?)?:\\w+/g;\n\t var splatParam = /\\*\\w+/g;\n\t var escapeRegExp = /[\\-{}\\[\\]+?.,\\\\\\^$|#\\s]/g;\n\t\n\t // Set up all inheritable **Backbone.Router** properties and methods.\n\t _.extend(Router.prototype, Events, {\n\t\n\t // Initialize is an empty function by default. Override it with your own\n\t // initialization logic.\n\t initialize: function(){},\n\t\n\t // Manually bind a single named route to a callback. For example:\n\t //\n\t // this.route('search/:query/p:num', 'search', function(query, num) {\n\t // ...\n\t // });\n\t //\n\t route: function(route, name, callback) {\n\t if (!_.isRegExp(route)) route = this._routeToRegExp(route);\n\t if (_.isFunction(name)) {\n\t callback = name;\n\t name = '';\n\t }\n\t if (!callback) callback = this[name];\n\t var router = this;\n\t Backbone.history.route(route, function(fragment) {\n\t var args = router._extractParameters(route, fragment);\n\t router.execute(callback, args);\n\t router.trigger.apply(router, ['route:' + name].concat(args));\n\t router.trigger('route', name, args);\n\t Backbone.history.trigger('route', router, name, args);\n\t });\n\t return this;\n\t },\n\t\n\t // Execute a route handler with the provided parameters. This is an\n\t // excellent place to do pre-route setup or post-route cleanup.\n\t execute: function(callback, args) {\n\t if (callback) callback.apply(this, args);\n\t },\n\t\n\t // Simple proxy to `Backbone.history` to save a fragment into the history.\n\t navigate: function(fragment, options) {\n\t Backbone.history.navigate(fragment, options);\n\t return this;\n\t },\n\t\n\t // Bind all defined routes to `Backbone.history`. We have to reverse the\n\t // order of the routes here to support behavior where the most general\n\t // routes can be defined at the bottom of the route map.\n\t _bindRoutes: function() {\n\t if (!this.routes) return;\n\t this.routes = _.result(this, 'routes');\n\t var route, routes = _.keys(this.routes);\n\t while ((route = routes.pop()) != null) {\n\t this.route(route, this.routes[route]);\n\t }\n\t },\n\t\n\t // Convert a route string into a regular expression, suitable for matching\n\t // against the current location hash.\n\t _routeToRegExp: function(route) {\n\t route = route.replace(escapeRegExp, '\\\\$&')\n\t .replace(optionalParam, '(?:$1)?')\n\t .replace(namedParam, function(match, optional) {\n\t return optional ? match : '([^/?]+)';\n\t })\n\t .replace(splatParam, '([^?]*?)');\n\t return new RegExp('^' + route + '(?:\\\\?([\\\\s\\\\S]*))?$');\n\t },\n\t\n\t // Given a route, and a URL fragment that it matches, return the array of\n\t // extracted decoded parameters. Empty or unmatched parameters will be\n\t // treated as `null` to normalize cross-browser behavior.\n\t _extractParameters: function(route, fragment) {\n\t var params = route.exec(fragment).slice(1);\n\t return _.map(params, function(param, i) {\n\t // Don't decode the search params.\n\t if (i === params.length - 1) return param || null;\n\t return param ? decodeURIComponent(param) : null;\n\t });\n\t }\n\t\n\t });\n\t\n\t // Backbone.History\n\t // ----------------\n\t\n\t // Handles cross-browser history management, based on either\n\t // [pushState](http://diveintohtml5.info/history.html) and real URLs, or\n\t // [onhashchange](https://developer.mozilla.org/en-US/docs/DOM/window.onhashchange)\n\t // and URL fragments. If the browser supports neither (old IE, natch),\n\t // falls back to polling.\n\t var History = Backbone.History = function() {\n\t this.handlers = [];\n\t _.bindAll(this, 'checkUrl');\n\t\n\t // Ensure that `History` can be used outside of the browser.\n\t if (typeof window !== 'undefined') {\n\t this.location = window.location;\n\t this.history = window.history;\n\t }\n\t };\n\t\n\t // Cached regex for stripping a leading hash/slash and trailing space.\n\t var routeStripper = /^[#\\/]|\\s+$/g;\n\t\n\t // Cached regex for stripping leading and trailing slashes.\n\t var rootStripper = /^\\/+|\\/+$/g;\n\t\n\t // Cached regex for detecting MSIE.\n\t var isExplorer = /msie [\\w.]+/;\n\t\n\t // Cached regex for removing a trailing slash.\n\t var trailingSlash = /\\/$/;\n\t\n\t // Cached regex for stripping urls of hash.\n\t var pathStripper = /#.*$/;\n\t\n\t // Has the history handling already been started?\n\t History.started = false;\n\t\n\t // Set up all inheritable **Backbone.History** properties and methods.\n\t _.extend(History.prototype, Events, {\n\t\n\t // The default interval to poll for hash changes, if necessary, is\n\t // twenty times a second.\n\t interval: 50,\n\t\n\t // Are we at the app root?\n\t atRoot: function() {\n\t return this.location.pathname.replace(/[^\\/]$/, '$&/') === this.root;\n\t },\n\t\n\t // Gets the true hash value. Cannot use location.hash directly due to bug\n\t // in Firefox where location.hash will always be decoded.\n\t getHash: function(window) {\n\t var match = (window || this).location.href.match(/#(.*)$/);\n\t return match ? match[1] : '';\n\t },\n\t\n\t // Get the cross-browser normalized URL fragment, either from the URL,\n\t // the hash, or the override.\n\t getFragment: function(fragment, forcePushState) {\n\t if (fragment == null) {\n\t if (this._hasPushState || !this._wantsHashChange || forcePushState) {\n\t fragment = decodeURI(this.location.pathname + this.location.search);\n\t var root = this.root.replace(trailingSlash, '');\n\t if (!fragment.indexOf(root)) fragment = fragment.slice(root.length);\n\t } else {\n\t fragment = this.getHash();\n\t }\n\t }\n\t return fragment.replace(routeStripper, '');\n\t },\n\t\n\t // Start the hash change handling, returning `true` if the current URL matches\n\t // an existing route, and `false` otherwise.\n\t start: function(options) {\n\t if (History.started) throw new Error(\"Backbone.history has already been started\");\n\t History.started = true;\n\t\n\t // Figure out the initial configuration. Do we need an iframe?\n\t // Is pushState desired ... is it available?\n\t this.options = _.extend({root: '/'}, this.options, options);\n\t this.root = this.options.root;\n\t this._wantsHashChange = this.options.hashChange !== false;\n\t this._wantsPushState = !!this.options.pushState;\n\t this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState);\n\t var fragment = this.getFragment();\n\t var docMode = document.documentMode;\n\t var oldIE = (isExplorer.exec(navigator.userAgent.toLowerCase()) && (!docMode || docMode <= 7));\n\t\n\t // Normalize root to always include a leading and trailing slash.\n\t this.root = ('/' + this.root + '/').replace(rootStripper, '/');\n\t\n\t if (oldIE && this._wantsHashChange) {\n\t var frame = Backbone.$('