@atlassian/aui
Version:
Atlassian User Interface library
8 lines • 458 kB
JavaScript
/*!!
* @atlassian/aui - Atlassian User Interface library
* @version v9.3.0
* @link https://aui.atlassian.com
* @license Apache-2.0
* @author Atlassian Pty Ltd.
*/
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("jquery")):"function"==typeof define&&define.amd?define("@atlassian/aui",["jquery"],e):"object"==typeof exports?exports["@atlassian/aui"]=e(require("jquery")):t.AJS=e(t.jQuery)}(window,(function(t){return function(t){var e={};function i(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)i.d(n,s,function(e){return t[e]}.bind(null,s));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=39)}([function(t,e,i){(function(n){var s,r,a;a="object"==typeof self&&self.self===self&&self||"object"==typeof n&&n.global===n&&n,s=[i(2),i(1),e],void 0===(r=function(t,e,i){a.Backbone=function(t,e,i,n){var s=t.Backbone,r=Array.prototype.slice;e.VERSION="1.4.0",e.$=n,e.noConflict=function(){return t.Backbone=s,this},e.emulateHTTP=!1,e.emulateJSON=!1;var a,o=e.Events={},l=/\s+/,c=function(t,e,n,s,r){var a,o=0;if(n&&"object"==typeof n){void 0!==s&&"context"in r&&void 0===r.context&&(r.context=s);for(a=i.keys(n);o<a.length;o++)e=c(t,e,a[o],n[a[o]],r)}else if(n&&l.test(n))for(a=n.split(l);o<a.length;o++)e=t(e,a[o],s,r);else e=t(e,n,s,r);return e};o.on=function(t,e,i){return this._events=c(u,this._events||{},t,e,{context:i,ctx:this,listening:a}),a&&((this._listeners||(this._listeners={}))[a.id]=a,a.interop=!1),this},o.listenTo=function(t,e,n){if(!t)return this;var s=t._listenId||(t._listenId=i.uniqueId("l")),r=this._listeningTo||(this._listeningTo={}),o=a=r[s];o||(this._listenId||(this._listenId=i.uniqueId("l")),o=a=r[s]=new m(this,t));var l=d(t,e,n,this);if(a=void 0,l)throw l;return o.interop&&o.on(e,n),this};var u=function(t,e,i,n){if(i){var s=t[e]||(t[e]=[]),r=n.context,a=n.ctx,o=n.listening;o&&o.count++,s.push({callback:i,context:r,ctx:r||a,listening:o})}return t},d=function(t,e,i,n){try{t.on(e,i,n)}catch(t){return t}};o.off=function(t,e,i){return this._events?(this._events=c(h,this._events,t,e,{context:i,listeners:this._listeners}),this):this},o.stopListening=function(t,e,n){var s=this._listeningTo;if(!s)return this;for(var r=t?[t._listenId]:i.keys(s),a=0;a<r.length;a++){var o=s[r[a]];if(!o)break;o.obj.off(e,n,this),o.interop&&o.off(e,n)}return i.isEmpty(s)&&(this._listeningTo=void 0),this};var h=function(t,e,n,s){if(t){var r,a=s.context,o=s.listeners,l=0;if(e||a||n){for(r=e?[e]:i.keys(t);l<r.length;l++){var c=t[e=r[l]];if(!c)break;for(var u=[],d=0;d<c.length;d++){var h=c[d];if(n&&n!==h.callback&&n!==h.callback._callback||a&&a!==h.context)u.push(h);else{var p=h.listening;p&&p.off(e,n)}}u.length?t[e]=u:delete t[e]}return t}for(r=i.keys(o);l<r.length;l++)o[r[l]].cleanup()}};o.once=function(t,e,i){var n=c(p,{},t,e,this.off.bind(this));return"string"==typeof t&&null==i&&(e=void 0),this.on(n,e,i)},o.listenToOnce=function(t,e,i){var n=c(p,{},e,i,this.stopListening.bind(this,t));return this.listenTo(t,n)};var p=function(t,e,n,s){if(n){var r=t[e]=i.once((function(){s(e,r),n.apply(this,arguments)}));r._callback=n}return t};o.trigger=function(t){if(!this._events)return this;for(var e=Math.max(0,arguments.length-1),i=Array(e),n=0;n<e;n++)i[n]=arguments[n+1];return c(f,this._events,t,void 0,i),this};var f=function(t,e,i,n){if(t){var s=t[e],r=t.all;s&&r&&(r=r.slice()),s&&g(s,n),r&&g(r,[e].concat(n))}return t},g=function(t,e){var i,n=-1,s=t.length,r=e[0],a=e[1],o=e[2];switch(e.length){case 0:for(;++n<s;)(i=t[n]).callback.call(i.ctx);return;case 1:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r);return;case 2:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,a);return;case 3:for(;++n<s;)(i=t[n]).callback.call(i.ctx,r,a,o);return;default:for(;++n<s;)(i=t[n]).callback.apply(i.ctx,e);return}},m=function(t,e){this.id=t._listenId,this.listener=t,this.obj=e,this.interop=!0,this.count=0,this._events=void 0};m.prototype.on=o.on,m.prototype.off=function(t,e){var i;this.interop?(this._events=c(h,this._events,t,e,{context:void 0,listeners:void 0}),i=!this._events):(this.count--,i=0===this.count),i&&this.cleanup()},m.prototype.cleanup=function(){delete this.listener._listeningTo[this.obj._listenId],this.interop||delete this.obj._listeners[this.id]},o.bind=o.on,o.unbind=o.off,i.extend(e,o);var v=e.Model=function(t,e){var n=t||{};e||(e={}),this.preinitialize.apply(this,arguments),this.cid=i.uniqueId(this.cidPrefix),this.attributes={},e.collection&&(this.collection=e.collection),e.parse&&(n=this.parse(n,e)||{});var s=i.result(this,"defaults");n=i.defaults(i.extend({},s,n),s),this.set(n,e),this.changed={},this.initialize.apply(this,arguments)};i.extend(v.prototype,o,{changed:null,validationError:null,idAttribute:"id",cidPrefix:"c",preinitialize:function(){},initialize:function(){},toJSON:function(t){return i.clone(this.attributes)},sync:function(){return e.sync.apply(this,arguments)},get:function(t){return this.attributes[t]},escape:function(t){return i.escape(this.get(t))},has:function(t){return null!=this.get(t)},matches:function(t){return!!i.iteratee(t,this)(this.attributes)},set:function(t,e,n){if(null==t)return this;var s;if("object"==typeof t?(s=t,n=e):(s={})[t]=e,n||(n={}),!this._validate(s,n))return!1;var r=n.unset,a=n.silent,o=[],l=this._changing;this._changing=!0,l||(this._previousAttributes=i.clone(this.attributes),this.changed={});var c=this.attributes,u=this.changed,d=this._previousAttributes;for(var h in s)e=s[h],i.isEqual(c[h],e)||o.push(h),i.isEqual(d[h],e)?delete u[h]:u[h]=e,r?delete c[h]:c[h]=e;if(this.idAttribute in s&&(this.id=this.get(this.idAttribute)),!a){o.length&&(this._pending=n);for(var p=0;p<o.length;p++)this.trigger("change:"+o[p],this,c[o[p]],n)}if(l)return this;if(!a)for(;this._pending;)n=this._pending,this._pending=!1,this.trigger("change",this,n);return this._pending=!1,this._changing=!1,this},unset:function(t,e){return this.set(t,void 0,i.extend({},e,{unset:!0}))},clear:function(t){var e={};for(var n in this.attributes)e[n]=void 0;return this.set(e,i.extend({},t,{unset:!0}))},hasChanged:function(t){return null==t?!i.isEmpty(this.changed):i.has(this.changed,t)},changedAttributes:function(t){if(!t)return!!this.hasChanged()&&i.clone(this.changed);var e,n=this._changing?this._previousAttributes:this.attributes,s={};for(var r in t){var a=t[r];i.isEqual(n[r],a)||(s[r]=a,e=!0)}return!!e&&s},previous:function(t){return null!=t&&this._previousAttributes?this._previousAttributes[t]:null},previousAttributes:function(){return i.clone(this._previousAttributes)},fetch:function(t){t=i.extend({parse:!0},t);var e=this,n=t.success;return t.success=function(i){var s=t.parse?e.parse(i,t):i;if(!e.set(s,t))return!1;n&&n.call(t.context,e,i,t),e.trigger("sync",e,i,t)},K(this,t),this.sync("read",this,t)},save:function(t,e,n){var s;null==t||"object"==typeof t?(s=t,n=e):(s={})[t]=e;var r=(n=i.extend({validate:!0,parse:!0},n)).wait;if(s&&!r){if(!this.set(s,n))return!1}else if(!this._validate(s,n))return!1;var a=this,o=n.success,l=this.attributes;n.success=function(t){a.attributes=l;var e=n.parse?a.parse(t,n):t;if(r&&(e=i.extend({},s,e)),e&&!a.set(e,n))return!1;o&&o.call(n.context,a,t,n),a.trigger("sync",a,t,n)},K(this,n),s&&r&&(this.attributes=i.extend({},l,s));var c=this.isNew()?"create":n.patch?"patch":"update";"patch"!==c||n.attrs||(n.attrs=s);var u=this.sync(c,this,n);return this.attributes=l,u},destroy:function(t){t=t?i.clone(t):{};var e=this,n=t.success,s=t.wait,r=function(){e.stopListening(),e.trigger("destroy",e,e.collection,t)};t.success=function(i){s&&r(),n&&n.call(t.context,e,i,t),e.isNew()||e.trigger("sync",e,i,t)};var a=!1;return this.isNew()?i.defer(t.success):(K(this,t),a=this.sync("delete",this,t)),s||r(),a},url:function(){var t=i.result(this,"urlRoot")||i.result(this.collection,"url")||Y();if(this.isNew())return t;var e=this.get(this.idAttribute);return t.replace(/[^\/]$/,"$&/")+encodeURIComponent(e)},parse:function(t,e){return t},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return!this.has(this.idAttribute)},isValid:function(t){return this._validate({},i.extend({},t,{validate:!0}))},_validate:function(t,e){if(!e.validate||!this.validate)return!0;t=i.extend({},this.attributes,t);var n=this.validationError=this.validate(t,e)||null;return!n||(this.trigger("invalid",this,n,i.extend(e,{validationError:n})),!1)}});var b=e.Collection=function(t,e){e||(e={}),this.preinitialize.apply(this,arguments),e.model&&(this.model=e.model),void 0!==e.comparator&&(this.comparator=e.comparator),this._reset(),this.initialize.apply(this,arguments),t&&this.reset(t,i.extend({silent:!0},e))},y={add:!0,remove:!0,merge:!0},w={add:!0,remove:!1},_=function(t,e,i){i=Math.min(Math.max(i,0),t.length);var n,s=Array(t.length-i),r=e.length;for(n=0;n<s.length;n++)s[n]=t[n+i];for(n=0;n<r;n++)t[n+i]=e[n];for(n=0;n<s.length;n++)t[n+r+i]=s[n]};i.extend(b.prototype,o,{model:v,preinitialize:function(){},initialize:function(){},toJSON:function(t){return this.map((function(e){return e.toJSON(t)}))},sync:function(){return e.sync.apply(this,arguments)},add:function(t,e){return this.set(t,i.extend({merge:!1},e,w))},remove:function(t,e){e=i.extend({},e);var n=!i.isArray(t);t=n?[t]:t.slice();var s=this._removeModels(t,e);return!e.silent&&s.length&&(e.changes={added:[],merged:[],removed:s},this.trigger("update",this,e)),n?s[0]:s},set:function(t,e){if(null!=t){(e=i.extend({},y,e)).parse&&!this._isModel(t)&&(t=this.parse(t,e)||[]);var n=!i.isArray(t);t=n?[t]:t.slice();var s=e.at;null!=s&&(s=+s),s>this.length&&(s=this.length),s<0&&(s+=this.length+1);var r,a,o=[],l=[],c=[],u=[],d={},h=e.add,p=e.merge,f=e.remove,g=!1,m=this.comparator&&null==s&&!1!==e.sort,v=i.isString(this.comparator)?this.comparator:null;for(a=0;a<t.length;a++){r=t[a];var b=this.get(r);if(b){if(p&&r!==b){var w=this._isModel(r)?r.attributes:r;e.parse&&(w=b.parse(w,e)),b.set(w,e),c.push(b),m&&!g&&(g=b.hasChanged(v))}d[b.cid]||(d[b.cid]=!0,o.push(b)),t[a]=b}else h&&(r=t[a]=this._prepareModel(r,e))&&(l.push(r),this._addReference(r,e),d[r.cid]=!0,o.push(r))}if(f){for(a=0;a<this.length;a++)d[(r=this.models[a]).cid]||u.push(r);u.length&&this._removeModels(u,e)}var x=!1,k=!m&&h&&f;if(o.length&&k?(x=this.length!==o.length||i.some(this.models,(function(t,e){return t!==o[e]})),this.models.length=0,_(this.models,o,0),this.length=this.models.length):l.length&&(m&&(g=!0),_(this.models,l,null==s?this.length:s),this.length=this.models.length),g&&this.sort({silent:!0}),!e.silent){for(a=0;a<l.length;a++)null!=s&&(e.index=s+a),(r=l[a]).trigger("add",r,this,e);(g||x)&&this.trigger("sort",this,e),(l.length||u.length||c.length)&&(e.changes={added:l,removed:u,merged:c},this.trigger("update",this,e))}return n?t[0]:t}},reset:function(t,e){e=e?i.clone(e):{};for(var n=0;n<this.models.length;n++)this._removeReference(this.models[n],e);return e.previousModels=this.models,this._reset(),t=this.add(t,i.extend({silent:!0},e)),e.silent||this.trigger("reset",this,e),t},push:function(t,e){return this.add(t,i.extend({at:this.length},e))},pop:function(t){var e=this.at(this.length-1);return this.remove(e,t)},unshift:function(t,e){return this.add(t,i.extend({at:0},e))},shift:function(t){var e=this.at(0);return this.remove(e,t)},slice:function(){return r.apply(this.models,arguments)},get:function(t){if(null!=t)return this._byId[t]||this._byId[this.modelId(this._isModel(t)?t.attributes:t)]||t.cid&&this._byId[t.cid]},has:function(t){return null!=this.get(t)},at:function(t){return t<0&&(t+=this.length),this.models[t]},where:function(t,e){return this[e?"find":"filter"](t)},findWhere:function(t){return this.where(t,!0)},sort:function(t){var e=this.comparator;if(!e)throw new Error("Cannot sort a set without a comparator");t||(t={});var n=e.length;return i.isFunction(e)&&(e=e.bind(this)),1===n||i.isString(e)?this.models=this.sortBy(e):this.models.sort(e),t.silent||this.trigger("sort",this,t),this},pluck:function(t){return this.map(t+"")},fetch:function(t){var e=(t=i.extend({parse:!0},t)).success,n=this;return t.success=function(i){var s=t.reset?"reset":"set";n[s](i,t),e&&e.call(t.context,n,i,t),n.trigger("sync",n,i,t)},K(this,t),this.sync("read",this,t)},create:function(t,e){var n=(e=e?i.clone(e):{}).wait;if(!(t=this._prepareModel(t,e)))return!1;n||this.add(t,e);var s=this,r=e.success;return e.success=function(t,e,i){n&&s.add(t,i),r&&r.call(i.context,t,e,i)},t.save(null,e),t},parse:function(t,e){return t},clone:function(){return new this.constructor(this.models,{model:this.model,comparator:this.comparator})},modelId:function(t){return t[this.model.prototype.idAttribute||"id"]},values:function(){return new k(this,C)},keys:function(){return new k(this,E)},entries:function(){return new k(this,T)},_reset:function(){this.length=0,this.models=[],this._byId={}},_prepareModel:function(t,e){if(this._isModel(t))return t.collection||(t.collection=this),t;(e=e?i.clone(e):{}).collection=this;var n=new this.model(t,e);return n.validationError?(this.trigger("invalid",this,n.validationError,e),!1):n},_removeModels:function(t,e){for(var i=[],n=0;n<t.length;n++){var s=this.get(t[n]);if(s){var r=this.indexOf(s);this.models.splice(r,1),this.length--,delete this._byId[s.cid];var a=this.modelId(s.attributes);null!=a&&delete this._byId[a],e.silent||(e.index=r,s.trigger("remove",s,this,e)),i.push(s),this._removeReference(s,e)}}return i},_isModel:function(t){return t instanceof v},_addReference:function(t,e){this._byId[t.cid]=t;var i=this.modelId(t.attributes);null!=i&&(this._byId[i]=t),t.on("all",this._onModelEvent,this)},_removeReference:function(t,e){delete this._byId[t.cid];var i=this.modelId(t.attributes);null!=i&&delete this._byId[i],this===t.collection&&delete t.collection,t.off("all",this._onModelEvent,this)},_onModelEvent:function(t,e,i,n){if(e){if(("add"===t||"remove"===t)&&i!==this)return;if("destroy"===t&&this.remove(e,n),"change"===t){var s=this.modelId(e.previousAttributes()),r=this.modelId(e.attributes);s!==r&&(null!=s&&delete this._byId[s],null!=r&&(this._byId[r]=e))}}this.trigger.apply(this,arguments)}});var x="function"==typeof Symbol&&Symbol.iterator;x&&(b.prototype[x]=b.prototype.values);var k=function(t,e){this._collection=t,this._kind=e,this._index=0},C=1,E=2,T=3;x&&(k.prototype[x]=function(){return this}),k.prototype.next=function(){if(this._collection){if(this._index<this._collection.length){var t,e=this._collection.at(this._index);if(this._index++,this._kind===C)t=e;else{var i=this._collection.modelId(e.attributes);t=this._kind===E?i:[i,e]}return{value:t,done:!1}}this._collection=void 0}return{value:void 0,done:!0}};var D=e.View=function(t){this.cid=i.uniqueId("view"),this.preinitialize.apply(this,arguments),i.extend(this,i.pick(t,A)),this._ensureElement(),this.initialize.apply(this,arguments)},S=/^(\S+)\s*(.*)$/,A=["model","collection","el","id","attributes","className","tagName","events"];i.extend(D.prototype,o,{tagName:"div",$:function(t){return this.$el.find(t)},preinitialize:function(){},initialize:function(){},render:function(){return this},remove:function(){return this._removeElement(),this.stopListening(),this},_removeElement:function(){this.$el.remove()},setElement:function(t){return this.undelegateEvents(),this._setElement(t),this.delegateEvents(),this},_setElement:function(t){this.$el=t instanceof e.$?t:e.$(t),this.el=this.$el[0]},delegateEvents:function(t){if(t||(t=i.result(this,"events")),!t)return this;for(var e in this.undelegateEvents(),t){var n=t[e];if(i.isFunction(n)||(n=this[n]),n){var s=e.match(S);this.delegate(s[1],s[2],n.bind(this))}}return this},delegate:function(t,e,i){return this.$el.on(t+".delegateEvents"+this.cid,e,i),this},undelegateEvents:function(){return this.$el&&this.$el.off(".delegateEvents"+this.cid),this},undelegate:function(t,e,i){return this.$el.off(t+".delegateEvents"+this.cid,e,i),this},_createElement:function(t){return document.createElement(t)},_ensureElement:function(){if(this.el)this.setElement(i.result(this,"el"));else{var t=i.extend({},i.result(this,"attributes"));this.id&&(t.id=i.result(this,"id")),this.className&&(t.class=i.result(this,"className")),this.setElement(this._createElement(i.result(this,"tagName"))),this._setAttributes(t)}},_setAttributes:function(t){this.$el.attr(t)}});var O=function(t,e,i,n){switch(e){case 1:return function(){return t[i](this[n])};case 2:return function(e){return t[i](this[n],e)};case 3:return function(e,s){return t[i](this[n],N(e,this),s)};case 4:return function(e,s,r){return t[i](this[n],N(e,this),s,r)};default:return function(){var e=r.call(arguments);return e.unshift(this[n]),t[i].apply(t,e)}}},I=function(t,e,n,s){i.each(n,(function(i,n){e[n]&&(t.prototype[n]=O(e,i,n,s))}))},N=function(t,e){return i.isFunction(t)?t:i.isObject(t)&&!e._isModel(t)?P(t):i.isString(t)?function(e){return e.get(t)}:t},P=function(t){var e=i.matches(t);return function(t){return e(t.attributes)}},M={forEach:3,each:3,map:3,collect:3,reduce:0,foldl:0,inject:0,reduceRight:0,foldr:0,find:3,detect:3,filter:3,select:3,reject:3,every:3,all:3,some:3,any:3,include:3,includes:3,contains:3,invoke:0,max:3,min:3,toArray:1,size:1,first:3,head:3,take:3,initial:3,rest:3,tail:3,drop:3,last:3,without:0,difference:0,indexOf:3,shuffle:1,lastIndexOf:3,isEmpty:1,chain:1,sample:3,partition:3,groupBy:3,countBy:3,sortBy:3,indexBy:3,findIndex:3,findLastIndex:3},L={keys:1,values:1,pairs:1,invert:1,pick:0,omit:0,chain:1,isEmpty:1};i.each([[b,M,"models"],[v,L,"attributes"]],(function(t){var e=t[0],n=t[1],s=t[2];e.mixin=function(t){var n=i.reduce(i.functions(t),(function(t,e){return t[e]=0,t}),{});I(e,t,n,s)},I(e,i,n,s)})),e.sync=function(t,n,s){var r=R[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:r,dataType:"json"};if(s.url||(a.url=i.result(n,"url")||Y()),null!=s.data||!n||"create"!==t&&"update"!==t&&"patch"!==t||(a.contentType="application/json",a.data=JSON.stringify(s.attrs||n.toJSON(s))),s.emulateJSON&&(a.contentType="application/x-www-form-urlencoded",a.data=a.data?{model:a.data}:{}),s.emulateHTTP&&("PUT"===r||"DELETE"===r||"PATCH"===r)){a.type="POST",s.emulateJSON&&(a.data._method=r);var o=s.beforeSend;s.beforeSend=function(t){if(t.setRequestHeader("X-HTTP-Method-Override",r),o)return o.apply(this,arguments)}}"GET"===a.type||s.emulateJSON||(a.processData=!1);var l=s.error;s.error=function(t,e,i){s.textStatus=e,s.errorThrown=i,l&&l.call(s.context,t,e,i)};var c=s.xhr=e.ajax(i.extend(a,s));return n.trigger("request",n,c,s),c};var R={create:"POST",update:"PUT",patch:"PATCH",delete:"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var j=e.Router=function(t){t||(t={}),this.preinitialize.apply(this,arguments),t.routes&&(this.routes=t.routes),this._bindRoutes(),this.initialize.apply(this,arguments)},$=/\((.*?)\)/g,F=/(\(\?)?:\w+/g,H=/\*\w+/g,B=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend(j.prototype,o,{preinitialize:function(){},initialize:function(){},route:function(t,n,s){i.isRegExp(t)||(t=this._routeToRegExp(t)),i.isFunction(n)&&(s=n,n=""),s||(s=this[n]);var r=this;return e.history.route(t,(function(i){var a=r._extractParameters(t,i);!1!==r.execute(s,a,n)&&(r.trigger.apply(r,["route:"+n].concat(a)),r.trigger("route",n,a),e.history.trigger("route",r,n,a))})),this},execute:function(t,e,i){t&&t.apply(this,e)},navigate:function(t,i){return e.history.navigate(t,i),this},_bindRoutes:function(){if(this.routes){this.routes=i.result(this,"routes");for(var t,e=i.keys(this.routes);null!=(t=e.pop());)this.route(t,this.routes[t])}},_routeToRegExp:function(t){return t=t.replace(B,"\\$&").replace($,"(?:$1)?").replace(F,(function(t,e){return e?t:"([^/?]+)"})).replace(H,"([^?]*?)"),new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var n=t.exec(e).slice(1);return i.map(n,(function(t,e){return e===n.length-1?t||null:t?decodeURIComponent(t):null}))}});var W=e.History=function(){this.handlers=[],this.checkUrl=this.checkUrl.bind(this),"undefined"!=typeof window&&(this.location=window.location,this.history=window.history)},U=/^[#\/]|\s+$/g,V=/^\/+|\/+$/g,z=/#.*$/;W.started=!1,i.extend(W.prototype,o,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root&&!this.getSearch()},matchRoot:function(){return this.decodeFragment(this.location.pathname).slice(0,this.root.length-1)+"/"===this.root},decodeFragment:function(t){return decodeURI(t.replace(/%25/g,"%2525"))},getSearch:function(){var t=this.location.href.replace(/#.*/,"").match(/\?.+/);return t?t[0]:""},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getPath:function(){var t=this.decodeFragment(this.location.pathname+this.getSearch()).slice(this.root.length-1);return"/"===t.charAt(0)?t.slice(1):t},getFragment:function(t){return null==t&&(t=this._usePushState||!this._wantsHashChange?this.getPath():this.getHash()),t.replace(U,"")},start:function(t){if(W.started)throw new Error("Backbone.history has already been started");if(W.started=!0,this.options=i.extend({root:"/"},this.options,t),this.root=this.options.root,this._wantsHashChange=!1!==this.options.hashChange,this._hasHashChange="onhashchange"in window&&(void 0===document.documentMode||document.documentMode>7),this._useHashChange=this._wantsHashChange&&this._hasHashChange,this._wantsPushState=!!this.options.pushState,this._hasPushState=!(!this.history||!this.history.pushState),this._usePushState=this._wantsPushState&&this._hasPushState,this.fragment=this.getFragment(),this.root=("/"+this.root+"/").replace(V,"/"),this._wantsHashChange&&this._wantsPushState){if(!this._hasPushState&&!this.atRoot()){var e=this.root.slice(0,-1)||"/";return this.location.replace(e+"#"+this.getPath()),!0}this._hasPushState&&this.atRoot()&&this.navigate(this.getHash(),{replace:!0})}if(!this._hasHashChange&&this._wantsHashChange&&!this._usePushState){this.iframe=document.createElement("iframe"),this.iframe.src="javascript:0",this.iframe.style.display="none",this.iframe.tabIndex=-1;var n=document.body,s=n.insertBefore(this.iframe,n.firstChild).contentWindow;s.document.open(),s.document.close(),s.location.hash="#"+this.fragment}var r=window.addEventListener||function(t,e){return attachEvent("on"+t,e)};if(this._usePushState?r("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe?r("hashchange",this.checkUrl,!1):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),!this.options.silent)return this.loadUrl()},stop:function(){var t=window.removeEventListener||function(t,e){return detachEvent("on"+t,e)};this._usePushState?t("popstate",this.checkUrl,!1):this._useHashChange&&!this.iframe&&t("hashchange",this.checkUrl,!1),this.iframe&&(document.body.removeChild(this.iframe),this.iframe=null),this._checkUrlInterval&&clearInterval(this._checkUrlInterval),W.started=!1},route:function(t,e){this.handlers.unshift({route:t,callback:e})},checkUrl:function(t){var e=this.getFragment();if(e===this.fragment&&this.iframe&&(e=this.getHash(this.iframe.contentWindow)),e===this.fragment)return!1;this.iframe&&this.navigate(e),this.loadUrl()},loadUrl:function(t){return!!this.matchRoot()&&(t=this.fragment=this.getFragment(t),i.some(this.handlers,(function(e){if(e.route.test(t))return e.callback(t),!0})))},navigate:function(t,e){if(!W.started)return!1;e&&!0!==e||(e={trigger:!!e}),t=this.getFragment(t||"");var i=this.root;""!==t&&"?"!==t.charAt(0)||(i=i.slice(0,-1)||"/");var n=i+t;t=t.replace(z,"");var s=this.decodeFragment(t);if(this.fragment!==s){if(this.fragment=s,this._usePushState)this.history[e.replace?"replaceState":"pushState"]({},document.title,n);else{if(!this._wantsHashChange)return this.location.assign(n);if(this._updateHash(this.location,t,e.replace),this.iframe&&t!==this.getHash(this.iframe.contentWindow)){var r=this.iframe.contentWindow;e.replace||(r.document.open(),r.document.close()),this._updateHash(r.location,t,e.replace)}}return e.trigger?this.loadUrl(t):void 0}},_updateHash:function(t,e,i){if(i){var n=t.href.replace(/(javascript:|#).*$/,"");t.replace(n+"#"+e)}else t.hash="#"+e}}),e.history=new W;var q=function(t,e){var n,s=this;return n=t&&i.has(t,"constructor")?t.constructor:function(){return s.apply(this,arguments)},i.extend(n,s,e),n.prototype=i.create(s.prototype,t),n.prototype.constructor=n,n.__super__=s.prototype,n};v.extend=b.extend=j.extend=D.extend=W.extend=q;var Y=function(){throw new Error('A "url" property or function must be specified')},K=function(t,e){var i=e.error;e.error=function(n){i&&i.call(e.context,t,n,e),t.trigger("error",t,n,e)}};return e}(a,i,t,e)}.apply(e,s))||(t.exports=r)}).call(this,i(15))},function(e,i){e.exports=t},function(t,e,i){(function(e){var i;i=function(){var t="1.12.0",i="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||Function("return this")()||{},n=Array.prototype,s=Object.prototype,r="undefined"!=typeof Symbol?Symbol.prototype:null,a=n.push,o=n.slice,l=s.toString,c=s.hasOwnProperty,u="undefined"!=typeof ArrayBuffer,d="undefined"!=typeof DataView,h=Array.isArray,p=Object.keys,f=Object.create,g=u&&ArrayBuffer.isView,m=isNaN,v=isFinite,b=!{toString:null}.propertyIsEnumerable("toString"),y=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],w=Math.pow(2,53)-1;function _(t,e){return e=null==e?t.length-1:+e,function(){for(var i=Math.max(arguments.length-e,0),n=Array(i),s=0;s<i;s++)n[s]=arguments[s+e];switch(e){case 0:return t.call(this,n);case 1:return t.call(this,arguments[0],n);case 2:return t.call(this,arguments[0],arguments[1],n)}var r=Array(e+1);for(s=0;s<e;s++)r[s]=arguments[s];return r[e]=n,t.apply(this,r)}}function x(t){var e=typeof t;return"function"===e||"object"===e&&!!t}function k(t){return void 0===t}function C(t){return!0===t||!1===t||"[object Boolean]"===l.call(t)}function E(t){var e="[object "+t+"]";return function(t){return l.call(t)===e}}var T=E("String"),D=E("Number"),S=E("Date"),A=E("RegExp"),O=E("Error"),I=E("Symbol"),N=E("ArrayBuffer"),P=E("Function"),M=i.document&&i.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof M&&(P=function(t){return"function"==typeof t||!1});var L=P,R=E("Object"),j=d&&R(new DataView(new ArrayBuffer(8))),$="undefined"!=typeof Map&&R(new Map),F=E("DataView"),H=j?function(t){return null!=t&&L(t.getInt8)&&N(t.buffer)}:F,B=h||E("Array");function W(t,e){return null!=t&&c.call(t,e)}var U=E("Arguments");!function(){U(arguments)||(U=function(t){return W(t,"callee")})}();var V=U;function z(t){return D(t)&&m(t)}function q(t){return function(){return t}}function Y(t){return function(e){var i=t(e);return"number"==typeof i&&i>=0&&i<=w}}function K(t){return function(e){return null==e?void 0:e[t]}}var J=K("byteLength"),G=Y(J),Q=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,X=u?function(t){return g?g(t)&&!H(t):G(t)&&Q.test(l.call(t))}:q(!1),Z=K("length");function tt(t,e){e=function(t){for(var e={},i=t.length,n=0;n<i;++n)e[t[n]]=!0;return{contains:function(t){return e[t]},push:function(i){return e[i]=!0,t.push(i)}}}(e);var i=y.length,n=t.constructor,r=L(n)&&n.prototype||s,a="constructor";for(W(t,a)&&!e.contains(a)&&e.push(a);i--;)(a=y[i])in t&&t[a]!==r[a]&&!e.contains(a)&&e.push(a)}function et(t){if(!x(t))return[];if(p)return p(t);var e=[];for(var i in t)W(t,i)&&e.push(i);return b&&tt(t,e),e}function it(t,e){var i=et(e),n=i.length;if(null==t)return!n;for(var s=Object(t),r=0;r<n;r++){var a=i[r];if(e[a]!==s[a]||!(a in s))return!1}return!0}function nt(t){return t instanceof nt?t:this instanceof nt?void(this._wrapped=t):new nt(t)}function st(t){return new Uint8Array(t.buffer||t,t.byteOffset||0,J(t))}nt.VERSION=t,nt.prototype.value=function(){return this._wrapped},nt.prototype.valueOf=nt.prototype.toJSON=nt.prototype.value,nt.prototype.toString=function(){return String(this._wrapped)};var rt="[object DataView]";function at(t,e,i,n){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var s=typeof t;return("function"===s||"object"===s||"object"==typeof e)&&ot(t,e,i,n)}function ot(t,e,i,n){t instanceof nt&&(t=t._wrapped),e instanceof nt&&(e=e._wrapped);var s=l.call(t);if(s!==l.call(e))return!1;if(j&&"[object Object]"==s&&H(t)){if(!H(e))return!1;s=rt}switch(s){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return r.valueOf.call(t)===r.valueOf.call(e);case"[object ArrayBuffer]":case rt:return ot(st(t),st(e),i,n)}var a="[object Array]"===s;if(!a&&X(t)){if(J(t)!==J(e))return!1;if(t.buffer===e.buffer&&t.byteOffset===e.byteOffset)return!0;a=!0}if(!a){if("object"!=typeof t||"object"!=typeof e)return!1;var o=t.constructor,c=e.constructor;if(o!==c&&!(L(o)&&o instanceof o&&L(c)&&c instanceof c)&&"constructor"in t&&"constructor"in e)return!1}n=n||[];for(var u=(i=i||[]).length;u--;)if(i[u]===t)return n[u]===e;if(i.push(t),n.push(e),a){if((u=t.length)!==e.length)return!1;for(;u--;)if(!at(t[u],e[u],i,n))return!1}else{var d,h=et(t);if(u=h.length,et(e).length!==u)return!1;for(;u--;)if(!W(e,d=h[u])||!at(t[d],e[d],i,n))return!1}return i.pop(),n.pop(),!0}function lt(t){if(!x(t))return[];var e=[];for(var i in t)e.push(i);return b&&tt(t,e),e}function ct(t){var e=Z(t);return function(i){if(null==i)return!1;var n=lt(i);if(Z(n))return!1;for(var s=0;s<e;s++)if(!L(i[t[s]]))return!1;return t!==ft||!L(i[ut])}}var ut="forEach",dt=["clear","delete"],ht=["get","has","set"],pt=dt.concat(ut,ht),ft=dt.concat(ht),gt=["add"].concat(dt,ut,"has"),mt=$?ct(pt):E("Map"),vt=$?ct(ft):E("WeakMap"),bt=$?ct(gt):E("Set"),yt=E("WeakSet");function wt(t){for(var e=et(t),i=e.length,n=Array(i),s=0;s<i;s++)n[s]=t[e[s]];return n}function _t(t){for(var e={},i=et(t),n=0,s=i.length;n<s;n++)e[t[i[n]]]=i[n];return e}function xt(t){var e=[];for(var i in t)L(t[i])&&e.push(i);return e.sort()}function kt(t,e){return function(i){var n=arguments.length;if(e&&(i=Object(i)),n<2||null==i)return i;for(var s=1;s<n;s++)for(var r=arguments[s],a=t(r),o=a.length,l=0;l<o;l++){var c=a[l];e&&void 0!==i[c]||(i[c]=r[c])}return i}}var Ct=kt(lt),Et=kt(et),Tt=kt(lt,!0);function Dt(t){if(!x(t))return{};if(f)return f(t);var e=function(){};e.prototype=t;var i=new e;return e.prototype=null,i}function St(t){return x(t)?B(t)?t.slice():Ct({},t):t}function At(t){return B(t)?t:[t]}function Ot(t){return nt.toPath(t)}function It(t,e){for(var i=e.length,n=0;n<i;n++){if(null==t)return;t=t[e[n]]}return i?t:void 0}function Nt(t,e,i){var n=It(t,Ot(e));return k(n)?i:n}function Pt(t){return t}function Mt(t){return t=Et({},t),function(e){return it(e,t)}}function Lt(t){return t=Ot(t),function(e){return It(e,t)}}function Rt(t,e,i){if(void 0===e)return t;switch(null==i?3:i){case 1:return function(i){return t.call(e,i)};case 3:return function(i,n,s){return t.call(e,i,n,s)};case 4:return function(i,n,s,r){return t.call(e,i,n,s,r)}}return function(){return t.apply(e,arguments)}}function jt(t,e,i){return null==t?Pt:L(t)?Rt(t,e,i):x(t)&&!B(t)?Mt(t):Lt(t)}function $t(t,e){return jt(t,e,1/0)}function Ft(t,e,i){return nt.iteratee!==$t?nt.iteratee(t,e):jt(t,e,i)}function Ht(){}function Bt(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))}nt.toPath=At,nt.iteratee=$t;var Wt=Date.now||function(){return(new Date).getTime()};function Ut(t){var e=function(e){return t[e]},i="(?:"+et(t).join("|")+")",n=RegExp(i),s=RegExp(i,"g");return function(t){return t=null==t?"":""+t,n.test(t)?t.replace(s,e):t}}var Vt={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},zt=Ut(Vt),qt=Ut(_t(Vt)),Yt=nt.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Kt=/(.)^/,Jt={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Gt=/\\|'|\r|\n|\u2028|\u2029/g;function Qt(t){return"\\"+Jt[t]}var Xt=0;function Zt(t,e,i,n,s){if(!(n instanceof e))return t.apply(i,s);var r=Dt(t.prototype),a=t.apply(r,s);return x(a)?a:r}var te=_((function(t,e){var i=te.placeholder,n=function(){for(var s=0,r=e.length,a=Array(r),o=0;o<r;o++)a[o]=e[o]===i?arguments[s++]:e[o];for(;s<arguments.length;)a.push(arguments[s++]);return Zt(t,n,this,this,a)};return n}));te.placeholder=nt;var ee=_((function(t,e,i){if(!L(t))throw new TypeError("Bind must be called on a function");var n=_((function(s){return Zt(t,n,e,this,i.concat(s))}));return n})),ie=Y(Z);function ne(t,e,i,n){if(n=n||[],e||0===e){if(e<=0)return n.concat(t)}else e=1/0;for(var s=n.length,r=0,a=Z(t);r<a;r++){var o=t[r];if(ie(o)&&(B(o)||V(o)))if(e>1)ne(o,e-1,i,n),s=n.length;else for(var l=0,c=o.length;l<c;)n[s++]=o[l++];else i||(n[s++]=o)}return n}var se=_((function(t,e){var i=(e=ne(e,!1,!1)).length;if(i<1)throw new Error("bindAll must be passed function names");for(;i--;){var n=e[i];t[n]=ee(t[n],t)}return t})),re=_((function(t,e,i){return setTimeout((function(){return t.apply(null,i)}),e)})),ae=te(re,nt,1);function oe(t){return function(){return!t.apply(this,arguments)}}function le(t,e){var i;return function(){return--t>0&&(i=e.apply(this,arguments)),t<=1&&(e=null),i}}var ce=te(le,2);function ue(t,e,i){e=Ft(e,i);for(var n,s=et(t),r=0,a=s.length;r<a;r++)if(e(t[n=s[r]],n,t))return n}function de(t){return function(e,i,n){i=Ft(i,n);for(var s=Z(e),r=t>0?0:s-1;r>=0&&r<s;r+=t)if(i(e[r],r,e))return r;return-1}}var he=de(1),pe=de(-1);function fe(t,e,i,n){for(var s=(i=Ft(i,n,1))(e),r=0,a=Z(t);r<a;){var o=Math.floor((r+a)/2);i(t[o])<s?r=o+1:a=o}return r}function ge(t,e,i){return function(n,s,r){var a=0,l=Z(n);if("number"==typeof r)t>0?a=r>=0?r:Math.max(r+l,a):l=r>=0?Math.min(r+1,l):r+l+1;else if(i&&r&&l)return n[r=i(n,s)]===s?r:-1;if(s!=s)return(r=e(o.call(n,a,l),z))>=0?r+a:-1;for(r=t>0?a:l-1;r>=0&&r<l;r+=t)if(n[r]===s)return r;return-1}}var me=ge(1,he,fe),ve=ge(-1,pe);function be(t,e,i){var n=(ie(t)?he:ue)(t,e,i);if(void 0!==n&&-1!==n)return t[n]}function ye(t,e,i){var n,s;if(e=Rt(e,i),ie(t))for(n=0,s=t.length;n<s;n++)e(t[n],n,t);else{var r=et(t);for(n=0,s=r.length;n<s;n++)e(t[r[n]],r[n],t)}return t}function we(t,e,i){e=Ft(e,i);for(var n=!ie(t)&&et(t),s=(n||t).length,r=Array(s),a=0;a<s;a++){var o=n?n[a]:a;r[a]=e(t[o],o,t)}return r}function _e(t){var e=function(e,i,n,s){var r=!ie(e)&&et(e),a=(r||e).length,o=t>0?0:a-1;for(s||(n=e[r?r[o]:o],o+=t);o>=0&&o<a;o+=t){var l=r?r[o]:o;n=i(n,e[l],l,e)}return n};return function(t,i,n,s){var r=arguments.length>=3;return e(t,Rt(i,s,4),n,r)}}var xe=_e(1),ke=_e(-1);function Ce(t,e,i){var n=[];return e=Ft(e,i),ye(t,(function(t,i,s){e(t,i,s)&&n.push(t)})),n}function Ee(t,e,i){e=Ft(e,i);for(var n=!ie(t)&&et(t),s=(n||t).length,r=0;r<s;r++){var a=n?n[r]:r;if(!e(t[a],a,t))return!1}return!0}function Te(t,e,i){e=Ft(e,i);for(var n=!ie(t)&&et(t),s=(n||t).length,r=0;r<s;r++){var a=n?n[r]:r;if(e(t[a],a,t))return!0}return!1}function De(t,e,i,n){return ie(t)||(t=wt(t)),("number"!=typeof i||n)&&(i=0),me(t,e,i)>=0}var Se=_((function(t,e,i){var n,s;return L(e)?s=e:(e=Ot(e),n=e.slice(0,-1),e=e[e.length-1]),we(t,(function(t){var r=s;if(!r){if(n&&n.length&&(t=It(t,n)),null==t)return;r=t[e]}return null==r?r:r.apply(t,i)}))}));function Ae(t,e){return we(t,Lt(e))}function Oe(t,e,i){var n,s,r=-1/0,a=-1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var o=0,l=(t=ie(t)?t:wt(t)).length;o<l;o++)null!=(n=t[o])&&n>r&&(r=n);else e=Ft(e,i),ye(t,(function(t,i,n){((s=e(t,i,n))>a||s===-1/0&&r===-1/0)&&(r=t,a=s)}));return r}function Ie(t,e,i){if(null==e||i)return ie(t)||(t=wt(t)),t[Bt(t.length-1)];var n=ie(t)?St(t):wt(t),s=Z(n);e=Math.max(Math.min(e,s),0);for(var r=s-1,a=0;a<e;a++){var o=Bt(a,r),l=n[a];n[a]=n[o],n[o]=l}return n.slice(0,e)}function Ne(t,e){return function(i,n,s){var r=e?[[],[]]:{};return n=Ft(n,s),ye(i,(function(e,s){var a=n(e,s,i);t(r,e,a)})),r}}var Pe=Ne((function(t,e,i){W(t,i)?t[i].push(e):t[i]=[e]})),Me=Ne((function(t,e,i){t[i]=e})),Le=Ne((function(t,e,i){W(t,i)?t[i]++:t[i]=1})),Re=Ne((function(t,e,i){t[i?0:1].push(e)}),!0),je=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function $e(t,e,i){return e in i}var Fe=_((function(t,e){var i={},n=e[0];if(null==t)return i;L(n)?(e.length>1&&(n=Rt(n,e[1])),e=lt(t)):(n=$e,e=ne(e,!1,!1),t=Object(t));for(var s=0,r=e.length;s<r;s++){var a=e[s],o=t[a];n(o,a,t)&&(i[a]=o)}return i})),He=_((function(t,e){var i,n=e[0];return L(n)?(n=oe(n),e.length>1&&(i=e[1])):(e=we(ne(e,!1,!1),String),n=function(t,i){return!De(e,i)}),Fe(t,n,i)}));function Be(t,e,i){return o.call(t,0,Math.max(0,t.length-(null==e||i?1:e)))}function We(t,e,i){return null==t||t.length<1?null==e||i?void 0:[]:null==e||i?t[0]:Be(t,t.length-e)}function Ue(t,e,i){return o.call(t,null==e||i?1:e)}var Ve=_((function(t,e){return e=ne(e,!0,!0),Ce(t,(function(t){return!De(e,t)}))})),ze=_((function(t,e){return Ve(t,e)}));function qe(t,e,i,n){C(e)||(n=i,i=e,e=!1),null!=i&&(i=Ft(i,n));for(var s=[],r=[],a=0,o=Z(t);a<o;a++){var l=t[a],c=i?i(l,a,t):l;e&&!i?(a&&r===c||s.push(l),r=c):i?De(r,c)||(r.push(c),s.push(l)):De(s,l)||s.push(l)}return s}var Ye=_((function(t){return qe(ne(t,!0,!0))}));function Ke(t){for(var e=t&&Oe(t,Z).length||0,i=Array(e),n=0;n<e;n++)i[n]=Ae(t,n);return i}var Je=_(Ke);function Ge(t,e){return t._chain?nt(e).chain():e}function Qe(t){return ye(xt(t),(function(e){var i=nt[e]=t[e];nt.prototype[e]=function(){var t=[this._wrapped];return a.apply(t,arguments),Ge(this,i.apply(nt,t))}})),nt}ye(["pop","push","reverse","shift","sort","splice","unshift"],(function(t){var e=n[t];nt.prototype[t]=function(){var i=this._wrapped;return null!=i&&(e.apply(i,arguments),"shift"!==t&&"splice"!==t||0!==i.length||delete i[0]),Ge(this,i)}})),ye(["concat","join","slice"],(function(t){var e=n[t];nt.prototype[t]=function(){var t=this._wrapped;return null!=t&&(t=e.apply(t,arguments)),Ge(this,t)}}));var Xe=Qe({__proto__:null,VERSION:t,restArguments:_,isObject:x,isNull:function(t){return null===t},isUndefined:k,isBoolean:C,isElement:function(t){return!(!t||1!==t.nodeType)},isString:T,isNumber:D,isDate:S,isRegExp:A,isError:O,isSymbol:I,isArrayBuffer:N,isDataView:H,isArray:B,isFunction:L,isArguments:V,isFinite:function(t){return!I(t)&&v(t)&&!isNaN(parseFloat(t))},isNaN:z,isTypedArray:X,isEmpty:function(t){if(null==t)return!0;var e=Z(t);return"number"==typeof e&&(B(t)||T(t)||V(t))?0===e:0===Z(et(t))},isMatch:it,isEqual:function(t,e){return at(t,e)},isMap:mt,isWeakMap:vt,isSet:bt,isWeakSet:yt,keys:et,allKeys:lt,values:wt,pairs:function(t){for(var e=et(t),i=e.length,n=Array(i),s=0;s<i;s++)n[s]=[e[s],t[e[s]]];return n},invert:_t,functions:xt,methods:xt,extend:Ct,extendOwn:Et,assign:Et,defaults:Tt,create:function(t,e){var i=Dt(t);return e&&Et(i,e),i},clone:St,tap:function(t,e){return e(t),t},get:Nt,has:function(t,e){for(var i=(e=Ot(e)).length,n=0;n<i;n++){var s=e[n];if(!W(t,s))return!1;t=t[s]}return!!i},mapObject:function(t,e,i){e=Ft(e,i);for(var n=et(t),s=n.length,r={},a=0;a<s;a++){var o=n[a];r[o]=e(t[o],o,t)}return r},identity:Pt,constant:q,noop:Ht,toPath:At,property:Lt,propertyOf:function(t){return null==t?Ht:function(e){return Nt(t,e)}},matcher:Mt,matches:Mt,times:function(t,e,i){var n=Array(Math.max(0,t));e=Rt(e,i,1);for(var s=0;s<t;s++)n[s]=e(s);return n},random:Bt,now:Wt,escape:zt,unescape:qt,templateSettings:Yt,template:function(t,e,i){!e&&i&&(e=i),e=Tt({},e,nt.templateSettings);var n,s=RegExp([(e.escape||Kt).source,(e.interpolate||Kt).source,(e.evaluate||Kt).source].join("|")+"|$","g"),r=0,a="__p+='";t.replace(s,(function(e,i,n,s,o){return a+=t.slice(r,o).replace(Gt,Qt),r=o+e.length,i?a+="'+\n((__t=("+i+"))==null?'':_.escape(__t))+\n'":n?a+="'+\n((__t=("+n+"))==null?'':__t)+\n'":s&&(a+="';\n"+s+"\n__p+='"),e})),a+="';\n",e.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{n=new Function(e.variable||"obj","_",a)}catch(t){throw t.source=a,t}var o=function(t){return n.call(this,t,nt)},l=e.variable||"obj";return o.source="function("+l+"){\n"+a+"}",o},result:function(t,e,i){var n=(e=Ot(e)).length;if(!n)return L(i)?i.call(t):i;for(var s=0;s<n;s++){var r=null==t?void 0:t[e[s]];void 0===r&&(r=i,s=n),t=L(r)?r.call(t):r}return t},uniqueId:function(t){var e=++Xt+"";return t?t+e:e},chain:function(t){var e=nt(t);return e._chain=!0,e},iteratee:$t,partial:te,bind:ee,bindAll:se,memoize:function(t,e){var i=function(n){var s=i.cache,r=""+(e?e.apply(this,arguments):n);return W(s,r)||(s[r]=t.apply(this,arguments)),s[r]};return i.cache={},i},delay:re,defer:ae,throttle:function(t,e,i){var n,s,r,a,o=0;i||(i={});var l=function(){o=!1===i.leading?0:Wt(),n=null,a=t.apply(s,r),n||(s=r=null)},c=function(){var c=Wt();o||!1!==i.leading||(o=c);var u=e-(c-o);return s=this,r=arguments,u<=0||u>e?(n&&(clearTimeout(n),n=null),o=c,a=t.apply(s,r),n||(s=r=null)):n||!1===i.trailing||(n=setTimeout(l,u)),a};return c.cancel=function(){clearTimeout(n),o=0,n=s=r=null},c},debounce:function(t,e,i){var n,s,r=function(e,i){n=null,i&&(s=t.apply(e,i))},a=_((function(a){if(n&&clearTimeout(n),i){var o=!n;n=setTimeout(r,e),o&&(s=t.apply(this,a))}else n=re(r,e,this,a);return s}));return a.cancel=function(){clearTimeout(n),n=null},a},wrap:function(t,e){return te(e,t)},negate:oe,compose:function(){var t=arguments,e=t.length-1;return function(){for(var i=e,n=t[e].apply(this,arguments);i--;)n=t[i].call(this,n);return n}},after:function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},before:le,once:ce,findKey:ue,findIndex:he,findLastIndex:pe,sortedIndex:fe,indexOf:me,lastIndexOf:ve,find:be,detect:be,findWhere:function(t,e){return be(t,Mt(e))},each:ye,forEach:ye,map:we,collect:we,reduce:xe,foldl:xe,inject:xe,reduceRight:ke,foldr:ke,filter:Ce,select:Ce,reject:function(t,e,i){return Ce(t,oe(Ft(e)),i)},every:Ee,all:Ee,some:Te,any:Te,contains:De,includes:De,include:De,invoke:Se,pluck:Ae,where:function(t,e){return Ce(t,Mt(e))},max:Oe,min:function(t,e,i){var n,s,r=1/0,a=1/0;if(null==e||"number"==typeof e&&"object"!=typeof t[0]&&null!=t)for(var o=0,l=(t=ie(t)?t:wt(t)).length;o<l;o++)null!=(n=t[o])&&n<r&&(r=n);else e=Ft(e,i),ye(t,(function(t,i,n){((s=e(t,i,n))<a||s===1/0&&r===1/0)&&(r=t,a=s)}));return r},shuffle:function(t){return Ie(t,1/0)},sample:Ie,sortBy:function(t,e,i){var n=0;return e=Ft(e,i),Ae(we(t,(function(t,i,s){return{value:t,index:n++,criteria:e(t,i,s)}})).sort((function(t,e){var i=t.criteria,n=e.criteria;if(i!==n){if(i>n||void 0===i)return 1;if(i<n||void 0===n)return-1}return t.index-e.index})),"value")},groupBy:Pe,indexBy:Me,countBy:Le,partition:Re,toArray:function(t){return t?B(t)?o.call(t):T(t)?t.match(je):ie(t)?we(t,Pt):wt(t):[]},size:function(t){return null==t?0:ie(t)?t.length:et(t).length},pick:Fe,omit:He,first:We,head:We,take:We,initial:Be,last:function(t,e,i){return null==t||t.length<1?null==e||i?void 0:[]:null==e||i?t[t.length-1]:Ue(t,Math.max(0,t.length-e))},rest:Ue,tail:Ue,drop:Ue,compact:function(t){return Ce(t,Boolean)},flatten:function(t,e){return ne(t,e,!1)},without:ze,uniq:qe,unique:qe,union:Ye,intersection:function(t){for(var e=[],i=arguments.length,n=0,s=Z(t);n<s;n++){var r=t[n];if(!De(e,r)){var a;for(a=1;a<i&&De(arguments[a],r);a++);a===i&&e.push(r)}}return e},difference:Ve,unzip:Ke,transpose:Ke,zip:Je,object:function(t,e){for(var i={},n=0,s=Z(t);n<s;n++)e?i[t[n]]=e[n]:i[t[n][0]]=t[n][1];return i},range:function(t,e,i){null==e&&(e=t||0,t=0),i||(i=e<t?-1:1);for(var n=Math.max(Math.ceil((e-t)/i),0),s=Array(n),r=0;r<n;r++,t+=i)s[r]=t;return s},chunk:function(t,e){if(null==e||e<1)return[];for(var i=[],n=0,s=t.length;n<s;)i.push(o.call(t,n,n+=e));return i},mixin:Qe,default:nt});return Xe._=Xe,Xe},t.exports=i()}).call(this,i(15))},function(t,e,i){var n;!function(){"use strict";var s=window.DocumentFragment,r=window.HTMLElement.prototype,a=r.matches||r.msMatchesSelector||r.webkitMatchesSelector||r.mozMatchesSelector||r.oMatchesSelector;function o(t,e){if(t.__SKATE_TEMPLATE_HTML_DATA)return t.__SKATE_TEMPLATE_HTML_DATA[e]}function l(t,e,i){return t.__SKATE_TEMPLATE_HTML_DATA||(t.__SKATE_TEMPLATE_HTML_DATA={}),t.__SKATE_TEMPLATE_HTML_DATA[e]=i,t}function c(t){var e=t.match(/\s*<([^\s>]+)/),i=document.createElement(e&&{caption:"table",dd:"dl",dt:"dl",li:"ul",tbody:"table",td:"tr",thead:"table",tr:"tbody"}[e[1]]||"div");return i.innerHTML=t,u(i.childNodes)}function u(t){for(var e=document.createDocumentFragment();t&&t.length;)e.appendChild(t[0]);return e}function d(t,e){for(var i=[],n=t.nextSibling;n!==e;)i.push(n),n=n.nextSibling;return i}function h(t,e){if(e){for(var i=t.querySelectorAll(e),n=i.length,s=[],r=0;r<n;r++){var a=i[r];a.parentNode===t&&s.push(a)}return s}return[].slice.call(t.childNodes)||[]}function p(t){for(var e=t.defaultNodes,i=e.length,n=0;n<i;n++)t.container.insertBefore(e[n],t.endNode);t.isDefault=!0}function f(t){for(var e=t.defaultNodes,i=e.length,n=0;n<i;n++){var s=e[n];s.parentNode.removeChild(s)}t.isDefault=!1}function g(t,e){return{get:function(){var i=t[e];return"function"==typeof i?i.bind(t):i},set:function(i){t[e]=i}}}function m(t){var e=t.getElementsByTagName("content");if(e&&e.length){for(var i=[];e.length;){var n=e[0],s=n.parentNode,r=n.getAttribute("select"),a=document.createComment(" content "),o=document.createComment(" /content ");i.push({container:s,contentNode:n,defaultNodes:[].slice.call(n.childNodes),endNode:o,isDefault:!0,selector:r,startNode:a}),s.replaceChild(o,n),s.insertBefore(a,o),a.textContent+=JSON.stringify({defaultContent:n.innerHTML,selector:r})+" "}l(t,"content",i)}}function v(t){var e,i=t.textContent.match(/^ (\/?)content (.*)/i);if(i){if(i[2])try{e=JSON.parse(i[2])}catch(e){throw new Error('Unable to parse content comment data: "'+e+'" in "\x3c!--'+t.textContent+'--\x3e".')}return{data:e||{defaultContent:void 0,isDefault:void 0,selector:void 0},type:i[1]?"close":"open"}}}function b(t){var e,i,n=t.childNodes,s=n.length,r=[];for(e=0;e<s;e++){var a=n[e];if(8===a.nodeType){var o=v(a);if(o)if("open"===o.type){if(i)throw new Error('Cannot have an opening content placeholder after another content placeholder at the same level in the DOM tree: "'+a.textContent+'" in "'+a.parentNode.innerHTML+'".');i={container:a.parentNode,contentNode:a,defaultNodes:o.data.defaultContent&&c(o.data.defaultContent).childNodes||[],isDefault:o.data.isDefault,selector:o.data.selector,startNode:a}}else if("close"===o.type){if(!i)throw new Error('Unmatched closing content placeholder: "'+a.textContent+'" in "'+a.parentNode.innerHTML+'".');i.endNode=a,r.push(i),i=void 0}}else r=r.concat(b(a))}return r}function y(){var t=[].slice.call(arguments).join("");return function(e){var i=u(e.childNodes);e.innerHTML=t,m(e),i.childNodes.length&&y.wrap(e).appendChild(i)}}y.wrap=function(t){return o(t,"content")||l(t,"content",b(t)),function(t,e){var i={};for(var n in t)n in e?Object.defineProperty(i,n,e[n]):Object.defineProperty(i,n,g(t,n));return i}(t,(i=o(e=t,"content"),n=i.length,{childNodes:{get:function(){for(var t=[],e=0;e<n;e++){var s=i[e];s.isDefault||(t=t.concat(d(s.startNode,s.endNode)))}return t}},firstChild:{get:function(){var t=this.childNodes;return t.length&&t[0]||null}},innerHTML:{get:function(){for(var t="",e=this.childNodes,i=e.length,n=0;n<i;n++){var s=e[n];t+=s.outerHTML||s.textContent}return t},set:function(t){for(var e=c(t),s=0;s<n;s++){for(var r=i[s],a=d(r.startNode,r.endNode),o=0;o<a.length;o++){var l=a[o];l.parentNode.removeChild(l)}for(var u=h(e,r.selector),g=0;g<u.length;g++)r.container.insertBefore(u[g],r.endNode);u.length?f(r):p(r)}}},lastChild:{get:function(){for(var t=n-1;t>-1;t--)if(!i[t].isDefault){var e=this.childNodes;return e[e.length-1]}return null}},outerHTML:{get:function(){var t=this.tagName.toLowerCase(),e="<"+t,i=this.attributes;if(i)for(var n=i.length,s=0;s<n;s++){var r=i[s];e+=" "+r.nodeName+'="'+r.nodeValue+'"'}return e+=">",(e+=this.innerHTML)+"</"+t+">"}},textContent:{get:function(){for(var t="",e=this.childNodes,i=this.childNodes.length,n=0;n<i;n++)t+=e[n].textContent;return t},set:function(t){var e;this.innerHTML="";for(var s=0;s<n;s++){var r=i[s];if(!r.selector){e=r;break}}e&&(t?(f(e),e.container.insertBefore(document.createTextNode(t),e.endNode)):p(e))}},appendChild:{value:function(t){if(t instanceof s){var e=t.childNodes;return[].slice.call(e).forEach(function(t){this.appendChild(t)}.bind(this)),this}for(var r=0;r<n;r++){var o=i[r],l=o.selector;if(!l||t instanceof window.HTMLElement&&a.call(t,l)){f(o),o.endNode.parentNode.insertBefore(t,o.endNode);break}}return this}},insertAdjacentHTML:{value:function(t,i){return"afterbegin"===t?this.insertBefore(c(i),this.childNodes[0]):"beforeend"===t?this.appendChild(c(i)):e.insertAdjacentHTML(t,i),this}},insertBefore:{value:function(t,e){if(!e)return this.appendChild(t);if(t instanceof s){var r=t.childNodes;if(r)for(var o=r.length,l=0;l<o;l++)this.insertBefore(r[l],e);return this}var c=!1;t:for(var u=0;u<n;u++)for(var h=i[u],p=d(h.startNode,h.endNode),f=p.length,g=0;g<f;g++){var m=p[g];if(m===e&&(c=!0),c){var v=h.selector;if(!v||a.call(t,v)){m.parentNode.insertBefore(t,m);break t}}}if(!c)throw new Error("DOMException 8: The node before which the new node is to be inserted is not a child of this node.");return t}},removeChild:{value:function(t){for(var e=!1,s=0;s<n;s++){var r=i[s];if(r.container===t.parentNode){r.container.removeChild(t),e=!0;break}r.startNode.nextSibling===r.endNode&&p(r)}if(!e)throw new Error("DOMException 8: The node in which you are trying to remove is not a child of this node.");return t}},replaceChild:{value:function(t,e){for(var s=0;s<n;s++){var r=i[s