text: /* **********************************************
       Begin underscore.js
  ********************************************** *///     Underscore.js 1.5.2
  //     http://underscorejs.org
  //     (c) 2009-2013 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  //     Underscore may be freely distributed under the MIT license.
  (function(){var e=this,t=e._,n={},r=Array.prototype,i=Object.prototype,s=Function.prototype,o=r.push,u=r.slice,a=r.concat,f=i.toString,l=i.hasOwnProperty,c=r.forEach,h=r.map,p=r.reduce,d=r.reduceRight,v=r.filter,m=r.every,g=r.some,y=r.indexOf,b=r.lastIndexOf,w=Array.isArray,E=Object.keys,S=s.bind,x=function(e){if(e instanceof x)return e;if(!(this instanceof x))return new x(e);this._wrapped=e};if(typeof exports!="undefined"){typeof module!="undefined"&&module.exports&&(exports=module.exports=x);exports._=x}else e._=x;x.VERSION="1.5.2";var T=x.each=x.forEach=function(e,t,r){if(e==null)return;if(c&&e.forEach===c)e.forEach(t,r);else if(e.length===+e.length){for(var i=0,s=e.length;i<s;i++)if(t.call(r,e[i],i,e)===n)return}else{var o=x.keys(e);for(var i=0,s=o.length;i<s;i++)if(t.call(r,e[o[i]],o[i],e)===n)return}};x.map=x.collect=function(e,t,n){var r=[];if(e==null)return r;if(h&&e.map===h)return e.map(t,n);T(e,function(e,i,s){r.push(t.call(n,e,i,s))});return r};var N="Reduce of empty array with no initial value";x.reduce=x.foldl=x.inject=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(p&&e.reduce===p){r&&(t=x.bind(t,r));return i?e.reduce(t,n):e.reduce(t)}T(e,function(e,s,o){if(!i){n=e;i=!0}else n=t.call(r,n,e,s,o)});if(!i)throw new TypeError(N);return n};x.reduceRight=x.foldr=function(e,t,n,r){var i=arguments.length>2;e==null&&(e=[]);if(d&&e.reduceRight===d){r&&(t=x.bind(t,r));return i?e.reduceRight(t,n):e.reduceRight(t)}var s=e.length;if(s!==+s){var o=x.keys(e);s=o.length}T(e,function(u,a,f){a=o?o[--s]:--s;if(!i){n=e[a];i=!0}else n=t.call(r,n,e[a],a,f)});if(!i)throw new TypeError(N);return n};x.find=x.detect=function(e,t,n){var r;C(e,function(e,i,s){if(t.call(n,e,i,s)){r=e;return!0}});return r};x.filter=x.select=function(e,t,n){var r=[];if(e==null)return r;if(v&&e.filter===v)return e.filter(t,n);T(e,function(e,i,s){t.call(n,e,i,s)&&r.push(e)});return r};x.reject=function(e,t,n){return x.filter(e,function(e,r,i){return!t.call(n,e,r,i)},n)};x.every=x.all=function(e,t,r){t||(t=x.identity);var i=!0;if(e==null)return i;if(m&&e.every===m)return e.every(t,r);T(e,function(e,s,o){if(!(i=i&&t.call(r,e,s,o)))return n});return!!i};var C=x.some=x.any=function(e,t,r){t||(t=x.identity);var i=!1;if(e==null)return i;if(g&&e.some===g)return e.some(t,r);T(e,function(e,s,o){if(i||(i=t.call(r,e,s,o)))return n});return!!i};x.contains=x.include=function(e,t){return e==null?!1:y&&e.indexOf===y?e.indexOf(t)!=-1:C(e,function(e){return e===t})};x.invoke=function(e,t){var n=u.call(arguments,2),r=x.isFunction(t);return x.map(e,function(e){return(r?t:e[t]).apply(e,n)})};x.pluck=function(e,t){return x.map(e,function(e){return e[t]})};x.where=function(e,t,n){return x.isEmpty(t)?n?void 0:[]:x[n?"find":"filter"](e,function(e){for(var n in t)if(t[n]!==e[n])return!1;return!0})};x.findWhere=function(e,t){return x.where(e,t,!0)};x.max=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.max.apply(Math,e);if(!t&&x.isEmpty(e))return-Infinity;var r={computed:-Infinity,value:-Infinity};T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o>r.computed&&(r={value:e,computed:o})});return r.value};x.min=function(e,t,n){if(!t&&x.isArray(e)&&e[0]===+e[0]&&e.length<65535)return Math.min.apply(Math,e);if(!t&&x.isEmpty(e))return Infinity;var r={computed:Infinity,value:Infinity};T(e,function(e,i,s){var o=t?t.call(n,e,i,s):e;o<r.computed&&(r={value:e,computed:o})});return r.value};x.shuffle=function(e){var t,n=0,r=[];T(e,function(e){t=x.random(n++);r[n-1]=r[t];r[t]=e});return r};x.sample=function(e,t,n){return arguments.length<2||n?e[x.random(e.length-1)]:x.shuffle(e).slice(0,Math.max(0,t))};var k=function(e){return x.isFunction(e)?e:function(t){return t[e]}};x.sortBy=function(e,t,n){var r=k(t);return x.pluck(x.map(e,function(e,t,i){return{value:e,index:t,criteria:r.call(n,e,t,i)}}).sort(function(e,t){var n=e.criteria,r=t.criteria;if(n!==r){if(n>r||n===void 0)return 1;if(n<r||r===void 0)return-1}return e.index-t.index}),"value")};var L=function(e){return function(t,n,r){var i={},s=n==null?x.identity:k(n);T(t,function(n,o){var u=s.call(r,n,o,t);e(i,u,n)});return i}};x.groupBy=L(function(e,t,n){(x.has(e,t)?e[t]:e[t]=[]).push(n)});x.indexBy=L(function(e,t,n){e[t]=n});x.countBy=L(function(e,t){x.has(e,t)?e[t]++:e[t]=1});x.sortedIndex=function(e,t,n,r){n=n==null?x.identity:k(n);var i=n.call(r,t),s=0,o=e.length;while(s<o){var u=s+o>>>1;n.call(r,e[u])<i?s=u+1:o=u}return s};x.toArray=function(e){return e?x.isArray(e)?u.call(e):e.length===+e.length?x.map(e,x.identity):x.values(e):[]};x.size=function(e){return e==null?0:e.length===+e.length?e.length:x.keys(e).length};x.first=x.head=x.take=function(e,t,n){return e==null?void 0:t==null||n?e[0]:u.call(e,0,t)};x.initial=function(e,t,n){return u.call(e,0,e.length-(t==null||n?1:t))};x.last=function(e,t,n){return e==null?void 0:t==null||n?e[e.length-1]:u.call(e,Math.max(e.length-t,0))};x.rest=x.tail=x.drop=function(e,t,n){return u.call(e,t==null||n?1:t)};x.compact=function(e){return x.filter(e,x.identity)};var A=function(e,t,n){if(t&&x.every(e,x.isArray))return a.apply(n,e);T(e,function(e){x.isArray(e)||x.isArguments(e)?t?o.apply(n,e):A(e,t,n):n.push(e)});return n};x.flatten=function(e,t){return A(e,t,[])};x.without=function(e){return x.difference(e,u.call(arguments,1))};x.uniq=x.unique=function(e,t,n,r){if(x.isFunction(t)){r=n;n=t;t=!1}var i=n?x.map(e,n,r):e,s=[],o=[];T(i,function(n,r){if(t?!r||o[o.length-1]!==n:!x.contains(o,n)){o.push(n);s.push(e[r])}});return s};x.union=function(){return x.uniq(x.flatten(arguments,!0))};x.intersection=function(e){var t=u.call(arguments,1);return x.filter(x.uniq(e),function(e){return x.every(t,function(t){return x.indexOf(t,e)>=0})})};x.difference=function(e){var t=a.apply(r,u.call(arguments,1));return x.filter(e,function(e){return!x.contains(t,e)})};x.zip=function(){var e=x.max(x.pluck(arguments,"length").concat(0)),t=new Array(e);for(var n=0;n<e;n++)t[n]=x.pluck(arguments,""+n);return t};x.object=function(e,t){if(e==null)return{};var n={};for(var r=0,i=e.length;r<i;r++)t?n[e[r]]=t[r]:n[e[r][0]]=e[r][1];return n};x.indexOf=function(e,t,n){if(e==null)return-1;var r=0,i=e.length;if(n){if(typeof n!="number"){r=x.sortedIndex(e,t);return e[r]===t?r:-1}r=n<0?Math.max(0,i+n):n}if(y&&e.indexOf===y)return e.indexOf(t,n);for(;r<i;r++)if(e[r]===t)return r;return-1};x.lastIndexOf=function(e,t,n){if(e==null)return-1;var r=n!=null;if(b&&e.lastIndexOf===b)return r?e.lastIndexOf(t,n):e.lastIndexOf(t);var i=r?n:e.length;while(i--)if(e[i]===t)return i;return-1};x.range=function(e,t,n){if(arguments.length<=1){t=e||0;e=0}n=arguments[2]||1;var r=Math.max(Math.ceil((t-e)/n),0),i=0,s=new Array(r);while(i<r){s[i++]=e;e+=n}return s};var O=function(){};x.bind=function(e,t){var n,r;if(S&&e.bind===S)return S.apply(e,u.call(arguments,1));if(!x.isFunction(e))throw new TypeError;n=u.call(arguments,2);return r=function(){if(this instanceof r){O.prototype=e.prototype;var i=new O;O.prototype=null;var s=e.apply(i,n.concat(u.call(arguments)));return Object(s)===s?s:i}return e.apply(t,n.concat(u.call(arguments)))}};x.partial=function(e){var t=u.call(arguments,1);return function(){return e.apply(this,t.concat(u.call(arguments)))}};x.bindAll=function(e){var t=u.call(arguments,1);if(t.length===0)throw new Error("bindAll must be passed function names");T(t,function(t){e[t]=x.bind(e[t],e)});return e};x.memoize=function(e,t){var n={};t||(t=x.identity);return function(){var r=t.apply(this,arguments);return x.has(n,r)?n[r]:n[r]=e.apply(this,arguments)}};x.delay=function(e,t){var n=u.call(arguments,2);return setTimeout(function(){return e.apply(null,n)},t)};x.defer=function(e){return x.delay.apply(x,[e,1].concat(u.call(arguments,1)))};x.throttle=function(e,t,n){var r,i,s,o=null,u=0;n||(n={});var a=function(){u=n.leading===!1?0:new Date;o=null;s=e.apply(r,i)};return function(){var f=new Date;!u&&n.leading===!1&&(u=f);var l=t-(f-u);r=this;i=arguments;if(l<=0){clearTimeout(o);o=null;u=f;s=e.apply(r,i)}else!o&&n.trailing!==!1&&(o=setTimeout(a,l));return s}};x.debounce=function(e,t,n){var r,i,s,o,u;return function(){s=this;i=arguments;o=new Date;var a=function(){var f=new Date-o;if(f<t)r=setTimeout(a,t-f);else{r=null;n||(u=e.apply(s,i))}},f=n&&!r;r||(r=setTimeout(a,t));f&&(u=e.apply(s,i));return u}};x.once=function(e){var t=!1,n;return function(){if(t)return n;t=!0;n=e.apply(this,arguments);e=null;return n}};x.wrap=function(e,t){return function(){var n=[e];o.apply(n,arguments);return t.apply(this,n)}};x.compose=function(){var e=arguments;return function(){var t=arguments;for(var n=e.length-1;n>=0;n--)t=[e[n].apply(this,t)];return t[0]}};x.after=function(e,t){return function(){if(--e<1)return t.apply(this,arguments)}};x.keys=E||function(e){if(e!==Object(e))throw new TypeError("Invalid object");var t=[];for(var n in e)x.has(e,n)&&t.push(n);return t};x.values=function(e){var t=x.keys(e),n=t.length,r=new Array(n);for(var i=0;i<n;i++)r[i]=e[t[i]];return r};x.pairs=function(e){var t=x.keys(e),n=t.length,r=new Array(n);for(var i=0;i<n;i++)r[i]=[t[i],e[t[i]]];return r};x.invert=function(e){var t={},n=x.keys(e);for(var r=0,i=n.length;r<i;r++)t[e[n[r]]]=n[r];return t};x.functions=x.methods=function(e){var t=[];for(var n in e)x.isFunction(e[n])&&t.push(n);return t.sort()};x.extend=function(e){T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]=t[n]});return e};x.pick=function(e){var t={},n=a.apply(r,u.call(arguments,1));T(n,function(n){n in e&&(t[n]=e[n])});return t};x.omit=function(e){var t={},n=a.apply(r,u.call(arguments,1));for(var i in e)x.contains(n,i)||(t[i]=e[i]);return t};x.defaults=function(e){T(u.call(arguments,1),function(t){if(t)for(var n in t)e[n]===void 0&&(e[n]=t[n])});return e};x.clone=function(e){return x.isObject(e)?x.isArray(e)?e.slice():x.extend({},e):e};x.tap=function(e,t){t(e);return e};var M=function(e,t,n,r){if(e===t)return e!==0||1/e==1/t;if(e==null||t==null)return e===t;e instanceof x&&(e=e._wrapped);t instanceof x&&(t=t._wrapped);var i=f.call(e);if(i!=f.call(t))return!1;switch(i){case"[object String]":return e==String(t);case"[object Number]":return e!=+e?t!=+t:e==0?1/e==1/t:e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object RegExp]":return e.source==t.source&&e.global==t.global&&e.multiline==t.multiline&&e.ignoreCase==t.ignoreCase}if(typeof e!="object"||typeof t!="object")return!1;var s=n.length;while(s--)if(n[s]==e)return r[s]==t;var o=e.constructor,u=t.constructor;if(o!==u&&!(x.isFunction(o)&&o instanceof o&&x.isFunction(u)&&u instanceof u))return!1;n.push(e);r.push(t);var a=0,l=!0;if(i=="[object Array]"){a=e.length;l=a==t.length;if(l)while(a--)if(!(l=M(e[a],t[a],n,r)))break}else{for(var c in e)if(x.has(e,c)){a++;if(!(l=x.has(t,c)&&M(e[c],t[c],n,r)))break}if(l){for(c in t)if(x.has(t,c)&&!(a--))break;l=!a}}n.pop();r.pop();return l};x.isEqual=function(e,t){return M(e,t,[],[])};x.isEmpty=function(e){if(e==null)return!0;if(x.isArray(e)||x.isString(e))return e.length===0;for(var t in e)if(x.has(e,t))return!1;return!0};x.isElement=function(e){return!!e&&e.nodeType===1};x.isArray=w||function(e){return f.call(e)=="[object Array]"};x.isObject=function(e){return e===Object(e)};T(["Arguments","Function","String","Number","Date","RegExp"],function(e){x["is"+e]=function(t){return f.call(t)=="[object "+e+"]"}});x.isArguments(arguments)||(x.isArguments=function(e){return!!e&&!!x.has(e,"callee")});typeof /./!="function"&&(x.isFunction=function(e){return typeof e=="function"});x.isFinite=function(e){return isFinite(e)&&!isNaN(parseFloat(e))};x.isNaN=function(e){return x.isNumber(e)&&e!=+e};x.isBoolean=function(e){return e===!0||e===!1||f.call(e)=="[object Boolean]"};x.isNull=function(e){return e===null};x.isUndefined=function(e){return e===void 0};x.has=function(e,t){return l.call(e,t)};x.noConflict=function(){e._=t;return this};x.identity=function(e){return e};x.times=function(e,t,n){var r=Array(Math.max(0,e));for(var i=0;i<e;i++)r[i]=t.call(n,i);return r};x.random=function(e,t){if(t==null){t=e;e=0}return e+Math.floor(Math.random()*(t-e+1))};var _={escape:{"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;"}};_.unescape=x.invert(_.escape);var D={escape:new RegExp("["+x.keys(_.escape).join("")+"]","g"),unescape:new RegExp("("+x.keys(_.unescape).join("|")+")","g")};x.each(["escape","unescape"],function(e){x[e]=function(t){return t==null?"":(""+t).replace(D[e],function(t){return _[e][t]})}});x.result=function(e,t){if(e==null)return void 0;var n=e[t];return x.isFunction(n)?n.call(e):n};x.mixin=function(e){T(x.functions(e),function(t){var n=x[t]=e[t];x.prototype[t]=function(){var e=[this._wrapped];o.apply(e,arguments);return F.call(this,n.apply(x,e))}})};var P=0;x.uniqueId=function(e){var t=++P+"";return e?e+t:t};x.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var H=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n","	":"t","\u2028":"u2028","\u2029":"u2029"},j=/\\|'|\r|\n|\t|\u2028|\u2029/g;x.template=function(e,t,n){var r;n=x.defaults({},n,x.templateSettings);var i=new RegExp([(n.escape||H).source,(n.interpolate||H).source,(n.evaluate||H).source].join("|")+"|$","g"),s=0,o="__p+='";e.replace(i,function(t,n,r,i,u){o+=e.slice(s,u).replace(j,function(e){return"\\"+B[e]});n&&(o+="'+\n((__t=("+n+"))==null?'':_.escape(__t))+\n'");r&&(o+="'+\n((__t=("+r+"))==null?'':__t)+\n'");i&&(o+="';\n"+i+"\n__p+='");s=u+t.length;return t});o+="';\n";n.variable||(o="with(obj||{}){\n"+o+"}\n");o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{r=new Function(n.variable||"obj","_",o)}catch(u){u.source=o;throw u}if(t)return r(t,x);var a=function(e){return r.call(this,e,x)};a.source="function("+(n.variable||"obj")+"){\n"+o+"}";return a};x.chain=function(e){return x(e).chain()};var F=function(e){return this._chain?x(e).chain():e};x.mixin(x);T(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=r[e];x.prototype[e]=function(){var n=this._wrapped;t.apply(n,arguments);(e=="shift"||e=="splice")&&n.length===0&&delete n[0];return F.call(this,n)}});T(["concat","join","slice"],function(e){var t=r[e];x.prototype[e]=function(){return F.call(this,t.apply(this._wrapped,arguments))}});x.extend(x.prototype,{chain:function(){this._chain=!0;return this},value:function(){return this._wrapped}})}).call(this);(function(e,t){function n(){var e=v.elements;return"string"==typeof e?e.split(" "):e}function r(e){var t=p[e[c]];t||(t={},h++,e[c]=h,p[h]=t);return t}function i(e,n,i){n||(n=t);if(d)return n.createElement(e);i||(i=r(n));n=i.cache[e]?i.cache[e].cloneNode():f.test(e)?(i.cache[e]=i.createElem(e)).cloneNode():i.createElem(e);return n.canHaveChildren&&!a.test(e)?i.frag.appendChild(n):n}function s(e,t){t.cache||(t.cache={},t.createElem=e.createElement,t.createFrag=e.createDocumentFragment,t.frag=t.createFrag());e.createElement=function(n){return v.shivMethods?i(n,e,t):t.createElem(n)};e.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+n().join().replace(/\w+/g,function(e){t.createElem(e);t.frag.createElement(e);return'c("'+e+'")'})+");return n}")(v,t.frag)}function o(e){e||(e=t);var n=r(e);if(v.shivCSS&&!l&&!n.hasCSS){var i,o=e;i=o.createElement("p");o=o.getElementsByTagName("head")[0]||o.documentElement;i.innerHTML="x<style>article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}</style>";i=o.insertBefore(i.lastChild,o.firstChild);n.hasCSS=!!i}d||s(e,n);return e}var u=e.html5||{},a=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,l,c="_html5shiv",h=0,p={},d;(function(){try{var e=t.createElement("a");e.innerHTML="<xyz></xyz>";l="hidden"in e;var n;if(!(n=1==e.childNodes.length)){t.createElement("a");var r=t.createDocumentFragment();n="undefined"==typeof r.cloneNode||"undefined"==typeof r.createDocumentFragment||"undefined"==typeof r.createElement}d=n}catch(i){d=l=!0}})();var v={elements:u.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup main mark meter nav output progress section summary time video",version:"3.6.2pre",shivCSS:!1!==u.shivCSS,supportsUnknownElements:d,shivMethods:!1!==u.shivMethods,type:"default",shivDocument:o,createElement:i,createDocumentFragment:function(e,i){e||(e=t);if(d)return e.createDocumentFragment();for(var i=i||r(e),s=i.frag.cloneNode(),o=0,u=n(),a=u.length;o<a;o++)s.createElement(u[o]);return s}};e.html5=v;o(t)})(this,document);(function(e,t){function i(t,n){var r,i,o,u=t.nodeName.toLowerCase();if("area"===u){r=t.parentNode;i=r.name;if(!t.href||!i||r.nodeName.toLowerCase()!=="map")return!1;o=e("img[usemap=#"+i+"]")[0];return!!o&&s(o)}return(/input|select|textarea|button|object/.test(u)?!t.disabled:"a"===u?t.href||n:n)&&s(t)}function s(t){return e.expr.filters.visible(t)&&!e(t).parents().addBack().filter(function(){return e.css(this,"visibility")==="hidden"}).length}var n=0,r=/^ui-id-\d+$/;e.ui=e.ui||{};e.extend(e.ui,{version:"@VERSION",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}});e.fn.extend({focus:function(t){return function(n,r){return typeof n=="number"?this.each(function(){var t=this;setTimeout(function(){e(t).focus();r&&r.call(t)},n)}):t.apply(this,arguments)}}(e.fn.focus),scrollParent:function(){var t;e.ui.ie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?t=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(e.css(this,"position"))&&/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0):t=this.parents().filter(function(){return/(auto|scroll)/.test(e.css(this,"overflow")+e.css(this,"overflow-y")+e.css(this,"overflow-x"))}).eq(0);return/fixed/.test(this.css("position"))||!t.length?e(this[0].ownerDocument||document):t},uniqueId:function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++n)})},removeUniqueId:function(){return this.each(function(){r.test(this.id)&&e(this).removeAttr("id")})}});e.extend(e.expr[":"],{data:e.expr.createPseudo?e.expr.createPseudo(function(t){return function(n){return!!e.data(n,t)}}):function(t,n,r){return!!e.data(t,r[3])},focusable:function(t){return i(t,!isNaN(e.attr(t,"tabindex")))},tabbable:function(t){var n=e.attr(t,"tabindex"),r=isNaN(n);return(r||n>=0)&&i(t,!r)}});e("<a>").outerWidth(1).jquery||e.each(["Width","Height"],function(n,r){function u(t,n,r,s){e.each(i,function(){n-=parseFloat(e.css(t,"padding"+this))||0;r&&(n-=parseFloat(e.css(t,"border"+this+"Width"))||0);s&&(n-=parseFloat(e.css(t,"margin"+this))||0)});return n}var i=r==="Width"?["Left","Right"]:["Top","Bottom"],s=r.toLowerCase(),o={innerWidth:e.fn.innerWidth,innerHeight:e.fn.innerHeight,outerWidth:e.fn.outerWidth,outerHeight:e.fn.outerHeight};e.fn["inner"+r]=function(n){return n===t?o["inner"+r].call(this):this.each(function(){e(this).css(s,u(this,n)+"px")})};e.fn["outer"+r]=function(t,n){return typeof t!="number"?o["outer"+r].call(this,t):this.each(function(){e(this).css(s,u(this,t,!0,n)+"px")})}});e.fn.addBack||(e.fn.addBack=function(e){return this.add(e==null?this.prevObject:this.prevObject.filter(e))});e("<a>").data("a-b","a").removeData("a-b").data("a-b")&&(e.fn.removeData=function(t){return function(n){return arguments.length?t.call(this,e.camelCase(n)):t.call(this)}}(e.fn.removeData));e.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());e.support.selectstart="onselectstart"in document.createElement("div");e.fn.extend({disableSelection:function(){return this.bind((e.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(e){e.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(n){if(n!==t)return this.css("zIndex",n);if(this.length){var r=e(this[0]),i,s;while(r.length&&r[0]!==document){i=r.css("position");if(i==="absolute"||i==="relative"||i==="fixed"){s=parseInt(r.css("zIndex"),10);if(!isNaN(s)&&s!==0)return s}r=r.parent()}}return 0}});e.ui.plugin={add:function(t,n,r){var i,s=e.ui[t].prototype;for(i in r){s.plugins[i]=s.plugins[i]||[];s.plugins[i].push([n,r[i]])}},call:function(e,t,n,r){var i,s=e.plugins[t];if(!s)return;if(!r&&(!e.element[0].parentNode||e.element[0].parentNode.nodeType===11))return;for(i=0;i<s.length;i++)e.options[s[i][0]]&&s[i][1].apply(e.element,n)}}})(jQuery);(function(e,t){var n=0,r=Array.prototype.slice,i=e.cleanData;e.cleanData=function(t){for(var n=0,r;(r=t[n])!=null;n++)try{e(r).triggerHandler("remove")}catch(s){}i(t)};e.widget=function(t,n,r){var i,s,o,u,a={},f=t.split(".")[0];t=t.split(".")[1];i=f+"-"+t;if(!r){r=n;n=e.Widget}e.expr[":"][i.toLowerCase()]=function(t){return!!e.data(t,i)};e[f]=e[f]||{};s=e[f][t];o=e[f][t]=function(e,t){if(!this._createWidget)return new o(e,t);arguments.length&&this._createWidget(e,t)};e.extend(o,s,{version:r.version,_proto:e.extend({},r),_childConstructors:[]});u=new n;u.options=e.widget.extend({},u.options);e.each(r,function(t,r){if(!e.isFunction(r)){a[t]=r;return}a[t]=function(){var e=function(){return n.prototype[t].apply(this,arguments)},i=function(e){return n.prototype[t].apply(this,e)};return function(){var t=this._super,n=this._superApply,s;this._super=e;this._superApply=i;s=r.apply(this,arguments);this._super=t;this._superApply=n;return s}}()});o.prototype=e.widget.extend(u,{widgetEventPrefix:s?u.widgetEventPrefix||t:t},a,{constructor:o,namespace:f,widgetName:t,widgetFullName:i});if(s){e.each(s._childConstructors,function(t,n){var r=n.prototype;e.widget(r.namespace+"."+r.widgetName,o,n._proto)});delete s._childConstructors}else n._childConstructors.push(o);e.widget.bridge(t,o);return o};e.widget.extend=function(n){var i=r.call(arguments,1),s=0,o=i.length,u,a;for(;s<o;s++)for(u in i[s]){a=i[s][u];i[s].hasOwnProperty(u)&&a!==t&&(e.isPlainObject(a)?n[u]=e.isPlainObject(n[u])?e.widget.extend({},n[u],a):e.widget.extend({},a):n[u]=a)}return n};e.widget.bridge=function(n,i){var s=i.prototype.widgetFullName||n;e.fn[n]=function(o){var u=typeof o=="string",a=r.call(arguments,1),f=this;o=!u&&a.length?e.widget.extend.apply(null,[o].concat(a)):o;u?this.each(function(){var r,i=e.data(this,s);if(o==="instance"){f=i;return!1}if(!i)return e.error("cannot call methods on "+n+" prior to initialization; "+"attempted to call method '"+o+"'");if(!e.isFunction(i[o])||o.charAt(0)==="_")return e.error("no such method '"+o+"' for "+n+" widget instance");r=i[o].apply(i,a);if(r!==i&&r!==t){f=r&&r.jquery?f.pushStack(r.get()):r;return!1}}):this.each(function(){var t=e.data(this,s);if(t){t.option(o||{});t._init&&t._init()}else e.data(this,s,new i(o,this))});return f}};e.Widget=function(){};e.Widget._childConstructors=[];e.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{disabled:!1,create:null},_createWidget:function(t,r){r=e(r||this.defaultElement||this)[0];this.element=e(r);this.uuid=n++;this.eventNamespace="."+this.widgetName+this.uuid;this.options=e.widget.extend({},this.options,this._getCreateOptions(),t);this.bindings=e();this.hoverable=e();this.focusable=e();if(r!==this){e.data(r,this.widgetFullName,this);this._on(!0,this.element,{remove:function(e){e.target===r&&this.destroy()}});this.document=e(r.style?r.ownerDocument:r.document||r);this.window=e(this.document[0].defaultView||this.document[0].parentWindow)}this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:e.noop,_getCreateEventData:e.noop,_create:e.noop,_init:e.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(e.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled "+"ui-state-disabled");this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},_destroy:e.noop,widget:function(){return this.element},option:function(n,r){var i=n,s,o,u;if(arguments.length===0)return e.widget.extend({},this.options);if(typeof n=="string"){i={};s=n.split(".");n=s.shift();if(s.length){o=i[n]=e.widget.extend({},this.options[n]);for(u=0;u<s.length-1;u++){o[s[u]]=o[s[u]]||{};o=o[s[u]]}n=s.pop();if(r===t)return o[n]===t?null:o[n];o[n]=r}else{if(r===t)return this.options[n]===t?null:this.options[n];i[n]=r}}this._setOptions(i);return this},_setOptions:function(e){var t;for(t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){this.options[e]=t;if(e==="disabled"){this.widget().toggleClass(this.widgetFullName+"-disabled",!!t);if(t){this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")}}return this},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_on:function(t,n,r){var i,s=this;if(typeof t!="boolean"){r=n;n=t;t=!1}if(!r){r=n;n=this.element;i=this.widget()}else{n=i=e(n);this.bindings=this.bindings.add(n)}e.each(r,function(r,o){function u(){if(!t&&(s.options.disabled===!0||e(this).hasClass("ui-state-disabled")))return;return(typeof o=="string"?s[o]:o).apply(s,arguments)}typeof o!="string"&&(u.guid=o.guid=o.guid||u.guid||e.guid++);var a=r.match(/^(\w+)\s*(.*)$/),f=a[1]+s.eventNamespace,l=a[2];l?i.delegate(l,f,u):n.bind(f,u)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;e.unbind(t).undelegate(t)},_delay:function(e,t){function n(){return(typeof e=="string"?r[e]:e).apply(r,arguments)}var r=this;return setTimeout(n,t||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t);this._on(t,{mouseenter:function(t){e(t.currentTarget).addClass("ui-state-hover")},mouseleave:function(t){e(t.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t);this._on(t,{focusin:function(t){e(t.currentTarget).addClass("ui-state-focus")},focusout:function(t){e(t.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(t,n,r){var i,s,o=this.options[t];r=r||{};n=e.Event(n);n.type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase();n.target=this.element[0];s=n.originalEvent;if(s)for(i in s)i in n||(n[i]=s[i]);this.element.trigger(n,r);return!(e.isFunction(o)&&o.apply(this.element[0],[n].concat(r))===!1||n.isDefaultPrevented())}};e.each({show:"fadeIn",hide:"fadeOut"},function(t,n){e.Widget.prototype["_"+t]=function(r,i,s){typeof i=="string"&&(i={effect:i});var o,u=i?i===!0||typeof i=="number"?n:i.effect||n:t;i=i||{};typeof i=="number"&&(i={duration:i});o=!e.isEmptyObject(i);i.complete=s;i.delay&&r.delay(i.delay);o&&e.effects&&e.effects.effect[u]?r[t](i):u!==t&&r[u]?r[u](i.duration,i.easing,s):r.queue(function(n){e(this)[t]();s&&s.call(r[0]);n()})}})})(jQuery);(function(e,t){var n=!1;e(document).mouseup(function(){n=!1});e.widget("ui.mouse",{version:"@VERSION",options:{cancel:"input,textarea,button,select,option",distance:1,delay:0},_mouseInit:function(){var t=this;this.element.bind("mousedown."+this.widgetName,function(e){return t._mouseDown(e)}).bind("click."+this.widgetName,function(n){if(!0===e.data(n.target,t.widgetName+".preventClickEvent")){e.removeData(n.target,t.widgetName+".preventClickEvent");n.stopImmediatePropagation();return!1}});this.started=!1},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);this._mouseMoveDelegate&&this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(n)return;this._mouseStarted&&this._mouseUp(t);this._mouseDownEvent=t;var r=this,i=t.which===1,s=typeof this.options.cancel=="string"&&t.target.nodeName?e(t.target).closest(this.options.cancel).length:!1;if(!i||s||!this._mouseCapture(t))return!0;this.mouseDelayMet=!this.options.delay;this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){r.mouseDelayMet=!0},this.options.delay));if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(t)!==!1;if(!this._mouseStarted){t.preventDefault();return!0}}!0===e.data(t.target,this.widgetName+".preventClickEvent")&&e.removeData(t.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(e){return r._mouseMove(e)};this._mouseUpDelegate=function(e){return r._mouseUp(e)};this.document.bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);t.preventDefault();n=!0;return!0},_mouseMove:function(t){if(e.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)return this._mouseUp(t);if(this._mouseStarted){this._mouseDrag(t);return t.preventDefault()}if(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)){this._mouseStarted=this._mouseStart(this._mouseDownEvent,t)!==!1;this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)}return!this._mouseStarted},_mouseUp:function(t){this.document.unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=!1;t.target===this._mouseDownEvent.target&&e.data(t.target,this.widgetName+".preventClickEvent",!0);this._mouseStop(t)}n=!1;return!1},_mouseDistanceMet:function(e){return Math.max(Math.abs(this._mouseDownEvent.pageX-e.pageX),Math.abs(this._mouseDownEvent.pageY-e.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})})(jQuery);(function(e,t){function h(e,t,n){return[parseFloat(e[0])*(l.test(e[0])?t/100:1),parseFloat(e[1])*(l.test(e[1])?n/100:1)]}function p(t,n){return parseInt(e.css(t,n),10)||0}function d(t){var n=t[0];return n.nodeType===9?{width:t.width(),height:t.height(),offset:{top:0,left:0}}:e.isWindow(n)?{width:t.width(),height:t.height(),offset:{top:t.scrollTop(),left:t.scrollLeft()}}:n.preventDefault?{width:0,height:0,offset:{top:n.pageY,left:n.pageX}}:{width:t.outerWidth(),height:t.outerHeight(),offset:t.offset()}}e.ui=e.ui||{};var n,r=Math.max,i=Math.abs,s=Math.round,o=/left|center|right/,u=/top|center|bottom/,a=/[\+\-]\d+(\.[\d]+)?%?/,f=/^\w+/,l=/%$/,c=e.fn.position;e.position={scrollbarWidth:function(){if(n!==t)return n;var r,i,s=e("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=s.children()[0];e("body").append(s);r=o.offsetWidth;s.css("overflow","scroll");i=o.offsetWidth;r===i&&(i=s[0].clientWidth);s.remove();return n=r-i},getScrollInfo:function(t){var n=t.isWindow?"":t.element.css("overflow-x"),r=t.isWindow?"":t.element.css("overflow-y"),i=n==="scroll"||n==="auto"&&t.width<t.element[0].scrollWidth,s=r==="scroll"||r==="auto"&&t.height<t.element[0].scrollHeight;return{width:s?e.position.scrollbarWidth():0,height:i?e.position.scrollbarWidth():0}},getWithinInfo:function(t){var n=e(t||window),r=e.isWindow(n[0]);return{element:n,isWindow:r,offset:n.offset()||{left:0,top:0},scrollLeft:n.scrollLeft(),scrollTop:n.scrollTop(),width:r?n.width():n.outerWidth(),height:r?n.height():n.outerHeight()}}};e.fn.position=function(t){if(!t||!t.of)return c.apply(this,arguments);t=e.extend({},t);var n,l,v,m,g,y,b=e(t.of),w=e.position.getWithinInfo(t.within),E=e.position.getScrollInfo(w),S=(t.collision||"flip").split(" "),x={};y=d(b);b[0].preventDefault&&(t.at="left top");l=y.width;v=y.height;m=y.offset;g=e.extend({},m);e.each(["my","at"],function(){var e=(t[this]||"").split(" "),n,r;e.length===1&&(e=o.test(e[0])?e.concat(["center"]):u.test(e[0])?["center"].concat(e):["center","center"]);e[0]=o.test(e[0])?e[0]:"center";e[1]=u.test(e[1])?e[1]:"center";n=a.exec(e[0]);r=a.exec(e[1]);x[this]=[n?n[0]:0,r?r[0]:0];t[this]=[f.exec(e[0])[0],f.exec(e[1])[0]]});S.length===1&&(S[1]=S[0]);t.at[0]==="right"?g.left+=l:t.at[0]==="center"&&(g.left+=l/2);t.at[1]==="bottom"?g.top+=v:t.at[1]==="center"&&(g.top+=v/2);n=h(x.at,l,v);g.left+=n[0];g.top+=n[1];return this.each(function(){var o,u,a=e(this),f=a.outerWidth(),c=a.outerHeight(),d=p(this,"marginLeft"),y=p(this,"marginTop"),T=f+d+p(this,"marginRight")+E.width,N=c+y+p(this,"marginBottom")+E.height,C=e.extend({},g),k=h(x.my,a.outerWidth
  (),a.outerHeight());t.my[0]==="right"?C.left-=f:t.my[0]==="center"&&(C.left-=f/2);t.my[1]==="bottom"?C.top-=c:t.my[1]==="center"&&(C.top-=c/2);C.left+=k[0];C.top+=k[1];if(!e.support.offsetFractions){C.left=s(C.left);C.top=s(C.top)}o={marginLeft:d,marginTop:y};e.each(["left","top"],function(r,i){e.ui.position[S[r]]&&e.ui.position[S[r]][i](C,{targetWidth:l,targetHeight:v,elemWidth:f,elemHeight:c,collisionPosition:o,collisionWidth:T,collisionHeight:N,offset:[n[0]+k[0],n[1]+k[1]],my:t.my,at:t.at,within:w,elem:a})});t.using&&(u=function(e){var n=m.left-C.left,s=n+l-f,o=m.top-C.top,u=o+v-c,h={target:{element:b,left:m.left,top:m.top,width:l,height:v},element:{element:a,left:C.left,top:C.top,width:f,height:c},horizontal:s<0?"left":n>0?"right":"center",vertical:u<0?"top":o>0?"bottom":"middle"};l<f&&i(n+s)<l&&(h.horizontal="center");v<c&&i(o+u)<v&&(h.vertical="middle");r(i(n),i(s))>r(i(o),i(u))?h.important="horizontal":h.important="vertical";t.using.call(this,e,h)});a.offset(e.extend(C,{using:u}))})};e.ui.position={fit:{left:function(e,t){var n=t.within,i=n.isWindow?n.scrollLeft:n.offset.left,s=n.width,o=e.left-t.collisionPosition.marginLeft,u=i-o,a=o+t.collisionWidth-s-i,f;if(t.collisionWidth>s)if(u>0&&a<=0){f=e.left+u+t.collisionWidth-s-i;e.left+=u-f}else a>0&&u<=0?e.left=i:u>a?e.left=i+s-t.collisionWidth:e.left=i;else u>0?e.left+=u:a>0?e.left-=a:e.left=r(e.left-o,e.left)},top:function(e,t){var n=t.within,i=n.isWindow?n.scrollTop:n.offset.top,s=t.within.height,o=e.top-t.collisionPosition.marginTop,u=i-o,a=o+t.collisionHeight-s-i,f;if(t.collisionHeight>s)if(u>0&&a<=0){f=e.top+u+t.collisionHeight-s-i;e.top+=u-f}else a>0&&u<=0?e.top=i:u>a?e.top=i+s-t.collisionHeight:e.top=i;else u>0?e.top+=u:a>0?e.top-=a:e.top=r(e.top-o,e.top)}},flip:{left:function(e,t){var n=t.within,r=n.offset.left+n.scrollLeft,s=n.width,o=n.isWindow?n.scrollLeft:n.offset.left,u=e.left-t.collisionPosition.marginLeft,a=u-o,f=u+t.collisionWidth-s-o,l=t.my[0]==="left"?-t.elemWidth:t.my[0]==="right"?t.elemWidth:0,c=t.at[0]==="left"?t.targetWidth:t.at[0]==="right"?-t.targetWidth:0,h=-2*t.offset[0],p,d;if(a<0){p=e.left+l+c+h+t.collisionWidth-s-r;if(p<0||p<i(a))e.left+=l+c+h}else if(f>0){d=e.left-t.collisionPosition.marginLeft+l+c+h-o;if(d>0||i(d)<f)e.left+=l+c+h}},top:function(e,t){var n=t.within,r=n.offset.top+n.scrollTop,s=n.height,o=n.isWindow?n.scrollTop:n.offset.top,u=e.top-t.collisionPosition.marginTop,a=u-o,f=u+t.collisionHeight-s-o,l=t.my[1]==="top",c=l?-t.elemHeight:t.my[1]==="bottom"?t.elemHeight:0,h=t.at[1]==="top"?t.targetHeight:t.at[1]==="bottom"?-t.targetHeight:0,p=-2*t.offset[1],d,v;if(a<0){v=e.top+c+h+p+t.collisionHeight-s-r;e.top+c+h+p>a&&(v<0||v<i(a))&&(e.top+=c+h+p)}else if(f>0){d=e.top-t.collisionPosition.marginTop+c+h+p-o;e.top+c+h+p>f&&(d>0||i(d)<f)&&(e.top+=c+h+p)}}},flipfit:{left:function(){e.ui.position.flip.left.apply(this,arguments);e.ui.position.fit.left.apply(this,arguments)},top:function(){e.ui.position.flip.top.apply(this,arguments);e.ui.position.fit.top.apply(this,arguments)}}};(function(){var t,n,r,i,s,o=document.getElementsByTagName("body")[0],u=document.createElement("div");t=document.createElement(o?"div":"body");r={visibility:"hidden",width:0,height:0,border:0,margin:0,background:"none"};o&&e.extend(r,{position:"absolute",left:"-1000px",top:"-1000px"});for(s in r)t.style[s]=r[s];t.appendChild(u);n=o||document.documentElement;n.insertBefore(t,n.firstChild);u.style.cssText="position: absolute; left: 10.7432222px;";i=e(u).offset().left;e.support.offsetFractions=i>10&&i<11;t.innerHTML="";n.removeChild(t)})()})(jQuery);(function(e,t){function n(e,t,n){return e>=t&&e<t+n}function r(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))}e.widget("ui.sortable",e.ui.mouse,{version:"@VERSION",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_create:function(){var e=this.options;this.containerCache={};this.element.addClass("ui-sortable");this.refresh();this.floating=this.items.length?e.axis==="x"||r(this.items[0].item):!1;this.offset=this.element.offset();this._mouseInit();this.ready=!0},_destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled");this._mouseDestroy();for(var e=this.items.length-1;e>=0;e--)this.items[e].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(t,n){var r=null,i=!1,s=this;if(this.reverting)return!1;if(this.options.disabled||this.options.type==="static")return!1;this._refreshItems(t);e(t.target).parents().each(function(){if(e.data(this,s.widgetName+"-item")===s){r=e(this);return!1}});e.data(t.target,s.widgetName+"-item")===s&&(r=e(t.target));if(!r)return!1;if(this.options.handle&&!n){e(this.options.handle,r).find("*").addBack().each(function(){this===t.target&&(i=!0)});if(!i)return!1}this.currentItem=r;this._removeCurrentsFromItems();return!0},_mouseStart:function(t,n,r){var i,s,o=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(t);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");this.originalPosition=this._generatePosition(t);this.originalPageX=t.pageX;this.originalPageY=t.pageY;o.cursorAt&&this._adjustOffsetFromHelper(o.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!==this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();o.containment&&this._setContainment();if(o.cursor&&o.cursor!=="auto"){s=this.document.find("body");this.storedCursor=s.css("cursor");s.css("cursor",o.cursor);this.storedStylesheet=e("<style>*{ cursor: "+o.cursor+" !important; }</style>").appendTo(s)}if(o.opacity){this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity"));this.helper.css("opacity",o.opacity)}if(o.zIndex){this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex"));this.helper.css("zIndex",o.zIndex)}this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"&&(this.overflowOffset=this.scrollParent.offset());this._trigger("start",t,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!r)for(i=this.containers.length-1;i>=0;i--)this.containers[i]._trigger("activate",t,this._uiHash(this));e.ui.ddmanager&&(e.ui.ddmanager.current=this);e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t);this.dragging=!0;this.helper.addClass("ui-sortable-helper");this._mouseDrag(t);return!0},_mouseDrag:function(t){var n,r,i,s,o=this.options,u=!1;this.position=this._generatePosition(t);this.positionAbs=this._convertPositionTo("absolute");this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs);if(this.options.scroll){if(this.scrollParent[0]!==document&&this.scrollParent[0].tagName!=="HTML"){this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageY<o.scrollSensitivity?this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop+o.scrollSpeed:t.pageY-this.overflowOffset.top<o.scrollSensitivity&&(this.scrollParent[0].scrollTop=u=this.scrollParent[0].scrollTop-o.scrollSpeed);this.overflowOffset.left+this.scrollParent[0].offsetWidth-t.pageX<o.scrollSensitivity?this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft+o.scrollSpeed:t.pageX-this.overflowOffset.left<o.scrollSensitivity&&(this.scrollParent[0].scrollLeft=u=this.scrollParent[0].scrollLeft-o.scrollSpeed)}else{t.pageY-e(document).scrollTop()<o.scrollSensitivity?u=e(document).scrollTop(e(document).scrollTop()-o.scrollSpeed):e(window).height()-(t.pageY-e(document).scrollTop())<o.scrollSensitivity&&(u=e(document).scrollTop(e(document).scrollTop()+o.scrollSpeed));t.pageX-e(document).scrollLeft()<o.scrollSensitivity?u=e(document).scrollLeft(e(document).scrollLeft()-o.scrollSpeed):e(window).width()-(t.pageX-e(document).scrollLeft())<o.scrollSensitivity&&(u=e(document).scrollLeft(e(document).scrollLeft()+o.scrollSpeed))}u!==!1&&e.ui.ddmanager&&!o.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!=="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!=="x")this.helper[0].style.top=this.position.top+"px";for(n=this.items.length-1;n>=0;n--){r=this.items[n];i=r.item[0];s=this._intersectsWithPointer(r);if(!s)continue;if(r.instance!==this.currentContainer)continue;if(i!==this.currentItem[0]&&this.placeholder[s===1?"next":"prev"]()[0]!==i&&!e.contains(this.placeholder[0],i)&&(this.options.type==="semi-dynamic"?!e.contains(this.element[0],i):!0)){this.direction=s===1?"down":"up";if(this.options.tolerance!=="pointer"&&!this._intersectsWithSides(r))break;this._rearrange(t,r);this._trigger("change",t,this._uiHash());break}}this._contactContainers(t);e.ui.ddmanager&&e.ui.ddmanager.drag(this,t);this._trigger("sort",t,this._uiHash());this.lastPositionAbs=this.positionAbs;return!1},_mouseStop:function(t,n){if(!t)return;e.ui.ddmanager&&!this.options.dropBehaviour&&e.ui.ddmanager.drop(this,t);if(this.options.revert){var r=this,i=this.placeholder.offset(),s=this.options.axis,o={};if(!s||s==="x")o.left=i.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollLeft);if(!s||s==="y")o.top=i.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===document.body?0:this.offsetParent[0].scrollTop);this.reverting=!0;e(this.helper).animate(o,parseInt(this.options.revert,10)||500,function(){r._clear(t)})}else this._clear(t,n);return!1},cancel:function(){if(this.dragging){this._mouseUp({target:null});this.options.helper==="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var t=this.containers.length-1;t>=0;t--){this.containers[t]._trigger("deactivate",null,this._uiHash(this));if(this.containers[t].containerCache.over){this.containers[t]._trigger("out",null,this._uiHash(this));this.containers[t].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!=="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();e.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null});this.domPosition.prev?e(this.domPosition.prev).after(this.currentItem):e(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];t=t||{};e(n).each(function(){var n=(e(t.item||this).attr(t.attribute||"id")||"").match(t.expression||/(.+)[\-=_](.+)/);n&&r.push((t.key||n[1]+"[]")+"="+(t.key&&t.expression?n[1]:n[2]))});!r.length&&t.key&&r.push(t.key+"=");return r.join("&")},toArray:function(t){var n=this._getItemsAsjQuery(t&&t.connected),r=[];t=t||{};n.each(function(){r.push(e(t.item||this).attr(t.attribute||"id")||"")});return r},_intersectsWith:function(e){var t=this.positionAbs.left,n=t+this.helperProportions.width,r=this.positionAbs.top,i=r+this.helperProportions.height,s=e.left,o=s+e.width,u=e.top,a=u+e.height,f=this.offset.click.top,l=this.offset.click.left,c=this.options.axis==="x"||r+f>u&&r+f<a,h=this.options.axis==="y"||t+l>s&&t+l<o,p=c&&h;return this.options.tolerance==="pointer"||this.options.forcePointerForContainers||this.options.tolerance!=="pointer"&&this.helperProportions[this.floating?"width":"height"]>e[this.floating?"width":"height"]?p:s<t+this.helperProportions.width/2&&n-this.helperProportions.width/2<o&&u<r+this.helperProportions.height/2&&i-this.helperProportions.height/2<a},_intersectsWithPointer:function(e){var t=this.options.axis==="x"||n(this.positionAbs.top+this.offset.click.top,e.top,e.height),r=this.options.axis==="y"||n(this.positionAbs.left+this.offset.click.left,e.left,e.width),i=t&&r,s=this._getDragVerticalDirection(),o=this._getDragHorizontalDirection();return i?this.floating?o&&o==="right"||s==="down"?2:1:s&&(s==="down"?2:1):!1},_intersectsWithSides:function(e){var t=n(this.positionAbs.top+this.offset.click.top,e.top+e.height/2,e.height),r=n(this.positionAbs.left+this.offset.click.left,e.left+e.width/2,e.width),i=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?s==="right"&&r||s==="left"&&!r:i&&(i==="down"&&t||i==="up"&&!t)},_getDragVerticalDirection:function(){var e=this.positionAbs.top-this.lastPositionAbs.top;return e!==0&&(e>0?"down":"up")},_getDragHorizontalDirection:function(){var e=this.positionAbs.left-this.lastPositionAbs.left;return e!==0&&(e>0?"right":"left")},refresh:function(e){this._refreshItems(e);this.refreshPositions();return this},_connectWith:function(){var e=this.options;return e.connectWith.constructor===String?[e.connectWith]:e.connectWith},_getItemsAsjQuery:function(t){function f(){o.push(this)}var n,r,i,s,o=[],u=[],a=this._connectWith();if(a&&t)for(n=a.length-1;n>=0;n--){i=e(a[n]);for(r=i.length-1;r>=0;r--){s=e.data(i[r],this.widgetFullName);s&&s!==this&&!s.options.disabled&&u.push([e.isFunction(s.options.items)?s.options.items.call(s.element):e(s.options.items,s.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),s])}}u.push([e.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):e(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(n=u.length-1;n>=0;n--)u[n][0].each(f);return e(o)},_removeCurrentsFromItems:function(){var t=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=e.grep(this.items,function(e){for(var n=0;n<t.length;n++)if(t[n]===e.item[0])return!1;return!0})},_refreshItems:function(t){this.items=[];this.containers=[this];var n,r,i,s,o,u,a,f,l=this.items,c=[[e.isFunction(this.options.items)?this.options.items.call(this.element[0],t,{item:this.currentItem}):e(this.options.items,this.element),this]],h=this._connectWith();if(h&&this.ready)for(n=h.length-1;n>=0;n--){i=e(h[n]);for(r=i.length-1;r>=0;r--){s=e.data(i[r],this.widgetFullName);if(s&&s!==this&&!s.options.disabled){c.push([e.isFunction(s.options.items)?s.options.items.call(s.element[0],t,{item:this.currentItem}):e(s.options.items,s.element),s]);this.containers.push(s)}}}for(n=c.length-1;n>=0;n--){o=c[n][1];u=c[n][0];for(r=0,f=u.length;r<f;r++){a=e(u[r]);a.data(this.widgetName+"-item",o);l.push({item:a,instance:o,width:0,height:0,left:0,top:0})}}},refreshPositions:function(t){this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var n,r,i,s;for(n=this.items.length-1;n>=0;n--){r=this.items[n];if(r.instance!==this.currentContainer&&this.currentContainer&&r.item[0]!==this.currentItem[0])continue;i=this.options.toleranceElement?e(this.options.toleranceElement,r.item):r.item;if(!t){r.width=i.outerWidth();r.height=i.outerHeight()}s=i.offset();r.left=s.left;r.top=s.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(n=this.containers.length-1;n>=0;n--){s=this.containers[n].element.offset();this.containers[n].containerCache.left=s.left;this.containers[n].containerCache.top=s.top;this.containers[n].containerCache.width=this.containers[n].element.outerWidth();this.containers[n].containerCache.height=this.containers[n].element.outerHeight()}return this},_createPlaceholder:function(t){t=t||this;var n,r=t.options;if(!r.placeholder||r.placeholder.constructor===String){n=r.placeholder;r.placeholder={element:function(){var r=t.currentItem[0].nodeName.toLowerCase(),i=e("<"+r+">",t.document[0]).addClass(n||t.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper");r==="tr"?t.currentItem.children().each(function(){e("<td>&#160;</td>",t.document[0]).attr("colspan",e(this).attr("colspan")||1).appendTo(i)}):r==="img"&&i.attr("src",t.currentItem.attr("src"));n||i.css("visibility","hidden");return i},update:function(e,i){if(n&&!r.forcePlaceholderSize)return;i.height()||i.height(t.currentItem.innerHeight()-parseInt(t.currentItem.css("paddingTop")||0,10)-parseInt(t.currentItem.css("paddingBottom")||0,10));i.width()||i.width(t.currentItem.innerWidth()-parseInt(t.currentItem.css("paddingLeft")||0,10)-parseInt(t.currentItem.css("paddingRight")||0,10))}}}t.placeholder=e(r.placeholder.element.call(t.element,t.currentItem));t.currentItem.after(t.placeholder);r.placeholder.update(t,t.placeholder)},_contactContainers:function(t){var i,s,o,u,a,f,l,c,h,p,d=null,v=null;for(i=this.containers.length-1;i>=0;i--){if(e.contains(this.currentItem[0],this.containers[i].element[0]))continue;if(this._intersectsWith(this.containers[i].containerCache)){if(d&&e.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i];v=i}else if(this.containers[i].containerCache.over){this.containers[i]._trigger("out",t,this._uiHash(this));this.containers[i].containerCache.over=0}}if(!d)return;if(this.containers.length===1){if(!this.containers[v].containerCache.over){this.containers[v]._trigger("over",t,this._uiHash(this));this.containers[v].containerCache.over=1}}else{o=1e4;u=null;p=d.floating||r(this.currentItem);a=p?"left":"top";f=p?"width":"height";l=this.positionAbs[a]+this.offset.click[a];for(s=this.items.length-1;s>=0;s--){if(!e.contains(this.containers[v].element[0],this.items[s].item[0]))continue;if(this.items[s].item[0]===this.currentItem[0])continue;if(p&&!n(this.positionAbs.top+this.offset.click.top,this.items[s].top,this.items[s].height))continue;c=this.items[s].item.offset()[a];h=!1;if(Math.abs(c-l)>Math.abs(c+this.items[s][f]-l)){h=!0;c+=this.items[s][f]}if(Math.abs(c-l)<o){o=Math.abs(c-l);u=this.items[s];this.direction=h?"up":"down"}}if(!u&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[v])return;u?this._rearrange(t,u,null,!0):this._rearrange(t,null,this.containers[v].element,!0);this._trigger("change",t,this._uiHash());this.containers[v]._trigger("change",t,this._uiHash(this));this.currentContainer=this.containers[v];this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[v]._trigger("over",t,this._uiHash(this));this.containers[v].containerCache.over=1}},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t,this.currentItem])):n.helper==="clone"?this.currentItem.clone():this.currentItem;r.parents("body").length||e(n.appendTo!=="parent"?n.appendTo:this.currentItem[0].parentNode)[0].appendChild(r[0]);r[0]===this.currentItem[0]&&(this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")});(!r[0].style.width||n.forceHelperSize)&&r.width(this.currentItem.width());(!r[0].style.height||n.forceHelperSize)&&r.height(this.currentItem.height());return r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" "));e.isArray(t)&&(t={left:+t[0],top:+t[1]||0});"left"in t&&(this.offset.click.left=t.left+this.margins.left);"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left);"top"in t&&(this.offset.click.top=t.top+this.margins.top);"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var t=this.offsetParent.offset();if(this.cssPosition==="absolute"&&this.scrollParent[0]!==document&&e.contains(this.scrollParent[0],this.offsetParent[0])){t.left+=this.scrollParent.scrollLeft();t.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]===document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var e=this.currentItem.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,r,i=this.options;i.containment==="parent"&&(i.containment=this.helper[0].parentNode);if(i.containment==="document"||i.containment==="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,e(i.containment==="document"?document:window).width()-this.helperProportions.width-this.margins.left,(e(i.containment==="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(i.containment)){t=e(i.containment)[0];n=e(i.containment).offset();r=e(t).css("overflow")!=="hidden";this.containment=[n.left+(parseInt(e(t).css("borderLeftWidth"),10)||0)+(parseInt(e(t).css("paddingLeft"),10)||0)-this.margins.left,n.top+(parseInt(e(t).css("borderTopWidth"),10)||0)+(parseInt(e(t).css("paddingTop"),10)||0)-this.margins.top,n.left+(r?Math.max(t.scrollWidth,t.offsetWidth):t.offsetWidth)-(parseInt(e(t).css("borderLeftWidth"),10)||0)-(parseInt(e(t).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,n.top+(r?Math.max(t.scrollHeight,t.offsetHeight):t.offsetHeight)-(parseInt(e(t).css("borderTopWidth"),10)||0)-(parseInt(e(t).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(t,n){n||(n=this.position);var r=t==="absolute"?1:-1,i=this.cssPosition!=="absolute"||this.scrollParent[0]!==document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,s=/(html|body)/i.test(i[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():s?0:i.scrollTop())*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():s?0:i.scrollLeft())*r}},_generatePosition:function(t){var n,r,i=this.options,s=t.pageX,o=t.pageY,u=this.cssPosition!=="absolute"||this.scrollParent[0]!==document&&!!e.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,a=/(html|body)/i.test(u[0].tagName);this.cssPosition==="relative"&&(this.scrollParent[0]===document||this.scrollParent[0]===this.offsetParent[0])&&(this.offset.relative=this._getRelativeOffset());if(this.originalPosition){if(this.containment){t.pageX-this.offset.click.left<this.containment[0]&&(s=this.containment[0]+this.offset.click.left);t.pageY-this.offset.click.top<this.containment[1]&&(o=this.containment[1]+this.offset.click.top);t.pageX-this.offset.click.left>this.containment[2]&&(s=this.containment[2]+this.offset.click.left);t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)}if(i.grid){n=this.originalPageY+Math.round((o-this.originalPageY)/i.grid[1])*i.grid[1];o=this.containment?n-this.offset.click.top>=this.containment[1]&&n-this.offset.click.top<=this.containment[3]?n:n-this.offset.click.top>=this.containment[1]?n-i.grid[1]:n+i.grid[1]:n;r=this.originalPageX+Math.round((s-this.originalPageX)/i.grid[0])*i.grid[0];s=this.containment?r-this.offset.click.left>=this.containment[0]&&r-this.offset.click.left<=this.containment[2]?r:r-this.offset.click.left>=this.containment[0]?r-i.grid[0]:r+i.grid[0]:r}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():a?0:u.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():a?0:u.scrollLeft())}},_rearrange:function(e,t,n,r){n?n[0].appendChild(this.placeholder[0]):t.item[0].parentNode.insertBefore(this.placeholder[0],this.direction==="down"?t.item[0]:t.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var i=this.counter;this._delay(function(){i===this.counter&&this.refreshPositions(!r)})},_clear:function(e,t){function i(e,t,n){return function(r){n._trigger(e,r,t._uiHash(t))}}this.reverting=!1;var n,r=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]===this.currentItem[0]){for(n in this._storedCSS)if(this._storedCSS[n]==="auto"||this._storedCSS[n]==="static")this._storedCSS[n]="";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!t&&r.push(function(e){this._trigger("receive",e,this._uiHash(this.fromOutside))});(this.fromOutside||this.domPosition.prev!==this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!==this.currentItem.parent()[0])&&!t&&r.push(function(e){this._trigger("update",e,this._uiHash())});if(this!==this.currentContainer&&!t){r.push(function(e){this._trigger("remove",e,this._uiHash())});r.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer));r.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))}for(n=this.containers.length-1;n>=0;n--){t||r.push(i("deactivate",this,this.containers[n]));if(this.containers[n].containerCache.over){r.push(i("out",this,this.containers[n]));this.containers[n].containerCache.over=0}}if(this.storedCursor){this.document.find("body").css("cursor",this.storedCursor);this.storedStylesheet.remove()}this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);this._storedZIndex&&this.helper.css("zIndex",this._storedZIndex==="auto"?"":this._storedZIndex);this.dragging=!1;if(this.cancelHelperRemoval){if(!t){this._trigger("beforeStop",e,this._uiHash());for(n=0;n<r.length;n++)r[n].call(this,e);this._trigger("stop",e,this._uiHash())}this.fromOutside=!1;return!1}t||this._trigger("beforeStop",e,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!==this.currentItem[0]&&this.helper.remove();this.helper=null;if(!t){for(n=0;n<r.length;n++)r[n].call(this,e);this._trigger("stop",e,this._uiHash())}this.fromOutside=!1;return!0},_trigger:function(){e.Widget.prototype._trigger.apply(this,arguments)===!1&&this.cancel()},_uiHash:function(t){var n=t||this;return{helper:n.helper,placeholder:n.placeholder||e([]),position:n.position,originalPosition:n.originalPosition,offset:n.positionAbs,item:n.currentItem,sender:t?t.element:null}}})})(jQuery);(function(e,t){function n(e,t,n){return e>=t&&e<t+n}e.widget("ui.droppable",{version:"@VERSION",widgetEventPrefix:"drop",options:{accept:"*",activeClass:!1,addClasses:!0,greedy:!1,hoverClass:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,n=this.options,r=n.accept;this.isover=!1;this.isout=!0;this.accept=e.isFunction(r)?r:function(e){return e.is(r)};this.proportions=function(){if(!arguments.length)return t?t:t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};t=arguments[0]};e.ui.ddmanager.droppables[n.scope]=e.ui.ddmanager.droppables[n.scope]||[];e.ui.ddmanager.droppables[n.scope].push(this);n.addClasses&&this.element.addClass("ui-droppable")},_destroy:function(){var t=0,n=e.ui.ddmanager.droppables[this.options.scope];for(;t<n.length;t++)n[t]===this&&n.splice(t,1);this.element.removeClass("ui-droppable ui-droppable-disabled")},_setOption:function(t,n){t==="accept"&&(this.accept=e.isFunction(n)?n:function(e){return e.is(n)});this._super(t,n)},_activate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.addClass(this.options.activeClass);n&&this._trigger("activate",t,this.ui(n))},_deactivate:function(t){var n=e.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);n&&this._trigger("deactivate",t,this.ui(n))},_over:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]===this.element[0])return;if(this.accept.call(this.element[0],n.currentItem||n.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);this._trigger("over",t,this.ui(n))}},_out:function(t){var n=e.ui.ddmanager.current;if(!n||(n.currentItem||n.element)[0]===this.element[0])return;if(this.accept.call(this.element[0],n.currentItem||n.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",t,this.ui(n))}},_drop:function(t,n){var r=n||e.ui.ddmanager.current,i=!1;if(!r||(r.currentItem||r.element)[0]===this.element[0])return!1;this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var t=e(this).droppable("instance");if(t.options.greedy&&!t.options.disabled&&t.options.scope===r.options.scope&&t.accept.call(t.element[0],r.currentItem||r.element)&&e.ui.intersect(r,e.extend(t,{offset:t.element.offset()}),t.options.tolerance)){i=!0;return!1}});if(i)return!1;if(this.accept.call(this.element[0],r.currentItem||r.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",t,this.ui(r));return this.element}return!1},ui:function(e){return{draggable:e.currentItem||e.element,helper:e.helper,position:e.position,offset:e.positionAbs}}});e.ui.intersect=function(e,t,r){if(!t.offset)return!1;var i,s,o=(e.positionAbs||e.position.absolute).left,u=(e.positionAbs||e.position.absolute).top,a=o+e.helperProportions.width,f=u+e.helperProportions.height,l=t.offset.left,c=t.offset.top,h=l+t.proportions().width,p=c+t.proportions().height;switch(r){case"fit":return l<=o&&a<=h&&c<=u&&f<=p;case"intersect":return l<o+e.helperProportions.width/2&&a-e.helperProportions.width/2<h&&c<u+e.helperProportions.height/2&&f-e.helperProportions.height/2<p;case"pointer":i=(e.positionAbs||e.position.absolute).left+(e.clickOffset||e.offset.click).left;s=(e.positionAbs||e.position.absolute).top+(e.clickOffset||e.offset.click).top;return n(s,c,t.proportions().height)&&n(i,l,t.proportions().width);case"touch":return(u>=c&&u<=p||f>=c&&f<=p||u<c&&f>p)&&(o>=l&&o<=h||a>=l&&a<=h||o<l&&a>h);default:return!1}};e.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(t,n){var r,i,s=e.ui.ddmanager.droppables[t.options.scope]||[],o=n?n.type:null,u=(t.currentItem||t.element).find(":data(ui-droppable)").addBack();e:for(r=0;r<s.length;r++){if(s[r].options.disabled||t&&!s[r].accept.call(s[r].element[0],t.currentItem||t.element))continue;for(i=0;i<u.length;i++)if(u[i]===s[r].element[0]){s[r].proportions().height=0;continue e}s[r].visible=s[r].element.css("display")!=="none";if(!s[r].visible)continue;o==="mousedown"&&s[r]._activate.call(s[r],n);s[r].offset=s[r].element.offset();s[r].proportions({width:s[r].element[0].offsetWidth,height:s[r].element[0].offsetHeight})}},drop:function(t,n){var r=!1;e.each((e.ui.ddmanager.droppables[t.options.scope]||[]).slice(),function(){if(!this.options)return;!this.options.disabled&&this.visible&&e.ui.intersect(t,this,this.options.tolerance)&&(r=this._drop.call(this,n)||r);if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],t.currentItem||t.element)){this.isout=!0;this.isover=!1;this._deactivate.call(this,n)}});return r},dragStart:function(t,n){t.element.parentsUntil("body").bind("scroll.droppable",function(){t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)})},drag:function(t,n){t.options.refreshPositions&&e.ui.ddmanager.prepareOffsets(t,n);e.each(e.ui.ddmanager.droppables[t.options.scope]||[],function(){if(this.options.disabled||this.greedyChild||!this.visible)return;var r,i,s,o=e.ui.intersect(t,this,this.options.tolerance
  ),u=!o&&this.isover?"isout":o&&!this.isover?"isover":null;if(!u)return;if(this.options.greedy){i=this.options.scope;s=this.element.parents(":data(ui-droppable)").filter(function(){return e(this).droppable("instance").options.scope===i});if(s.length){r=e(s[0]).droppable("instance");r.greedyChild=u==="isover"}}if(r&&u==="isover"){r.isover=!1;r.isout=!0;r._out.call(r,n)}this[u]=!0;this[u==="isout"?"isover":"isout"]=!1;this[u==="isover"?"_over":"_out"].call(this,n);if(r&&u==="isout"){r.isout=!1;r.isover=!0;r._over.call(r,n)}})},dragStop:function(t,n){t.element.parentsUntil("body").unbind("scroll.droppable");t.options.refreshPositions||e.ui.ddmanager.prepareOffsets(t,n)}}})(jQuery);(function(e,t){e.widget("ui.draggable",e.ui.mouse,{version:"@VERSION",widgetEventPrefix:"drag",options:{addClasses:!0,appendTo:"parent",axis:!1,connectToSortable:!1,containment:!1,cursor:"auto",cursorAt:!1,grid:!1,handle:!1,helper:"original",iframeFix:!1,opacity:!1,refreshPositions:!1,revert:!1,revertDuration:500,scope:"default",scroll:!0,scrollSensitivity:20,scrollSpeed:20,snap:!1,snapMode:"both",snapTolerance:20,stack:!1,zIndex:!1,drag:null,start:null,stop:null},_create:function(){this.options.helper==="original"&&!/^(?:r|a|f)/.test(this.element.css("position"))&&(this.element[0].style.position="relative");this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging")){this.destroyOnClear=!0;return}this.element.removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy()},_mouseCapture:function(t){var n=this.document[0],r=this.options;try{n.activeElement&&n.activeElement.nodeName.toLowerCase()!=="body"&&e(n.activeElement).blur()}catch(i){}if(this.helper||r.disabled||e(t.target).closest(".ui-resizable-handle").length>0)return!1;this.handle=this._getHandle(t);if(!this.handle)return!1;e(r.iframeFix===!0?"iframe":r.iframeFix).each(function(){e("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>").css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1e3}).css(e(this).offset()).appendTo("body")});return!0},_mouseStart:function(t){var n=this.options;this.helper=this._createHelper(t);this.helper.addClass("ui-draggable-dragging");this._cacheHelperProportions();e.ui.ddmanager&&(e.ui.ddmanager.current=this);this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offsetParent=this.helper.offsetParent();this.offsetParentCssPosition=this.offsetParent.css("position");this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.offset.scroll=!1;e.extend(this.offset,{click:{left:t.pageX-this.offset.left,top:t.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(t);this.originalPageX=t.pageX;this.originalPageY=t.pageY;n.cursorAt&&this._adjustOffsetFromHelper(n.cursorAt);this._setContainment();if(this._trigger("start",t)===!1){this._clear();return!1}this._cacheHelperProportions();e.ui.ddmanager&&!n.dropBehaviour&&e.ui.ddmanager.prepareOffsets(this,t);this._mouseDrag(t,!0);e.ui.ddmanager&&e.ui.ddmanager.dragStart(this,t);return!0},_mouseDrag:function(t,n){this.offsetParentCssPosition==="fixed"&&(this.offset.parent=this._getParentOffset());this.position=this._generatePosition(t);this.positionAbs=this._convertPositionTo("absolute");if(!n){var r=this._uiHash();if(this._trigger("drag",t,r)===!1){this._mouseUp({});return!1}this.position=r.position}if(!this.options.axis||this.options.axis!=="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!=="x")this.helper[0].style.top=this.position.top+"px";e.ui.ddmanager&&e.ui.ddmanager.drag(this,t);return!1},_mouseStop:function(t){var n=this,r=!1;e.ui.ddmanager&&!this.options.dropBehaviour&&(r=e.ui.ddmanager.drop(this,t));if(this.dropped){r=this.dropped;this.dropped=!1}this.options.revert==="invalid"&&!r||this.options.revert==="valid"&&r||this.options.revert===!0||e.isFunction(this.options.revert)&&this.options.revert.call(this.element,r)?e(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){n._trigger("stop",t)!==!1&&n._clear()}):this._trigger("stop",t)!==!1&&this._clear();return!1},_mouseUp:function(t){e("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});e.ui.ddmanager&&e.ui.ddmanager.dragStop(this,t);this.element.focus();return e.ui.mouse.prototype._mouseUp.call(this,t)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(t){return this.options.handle?!!e(t.target).closest(this.element.find(this.options.handle)).length:!0},_createHelper:function(t){var n=this.options,r=e.isFunction(n.helper)?e(n.helper.apply(this.element[0],[t])):n.helper==="clone"?this.element.clone().removeAttr("id"):this.element;r.parents("body").length||r.appendTo(n.appendTo==="parent"?this.element[0].parentNode:n.appendTo);r[0]!==this.element[0]&&!/(fixed|absolute)/.test(r.css("position"))&&r.css("position","absolute");return r},_adjustOffsetFromHelper:function(t){typeof t=="string"&&(t=t.split(" "));e.isArray(t)&&(t={left:+t[0],top:+t[1]||0});"left"in t&&(this.offset.click.left=t.left+this.margins.left);"right"in t&&(this.offset.click.left=this.helperProportions.width-t.right+this.margins.left);"top"in t&&(this.offset.click.top=t.top+this.margins.top);"bottom"in t&&(this.offset.click.top=this.helperProportions.height-t.bottom+this.margins.top)},_getParentOffset:function(){var t=this.offsetParent.offset(),n=this.document[0];if(this.cssPosition==="absolute"&&this.scrollParent[0]!==n&&e.contains(this.scrollParent[0],this.offsetParent[0])){t.left+=this.scrollParent.scrollLeft();t.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]===n.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()==="html"&&e.ui.ie)t={top:0,left:0};return{top:t.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:t.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition==="relative"){var e=this.element.position();return{top:e.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:e.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var t,n,r,i=this.options,s=this.document[0];if(!i.containment){this.containment=null;return}if(i.containment==="window"){this.containment=[e(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,e(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,e(window).scrollLeft()+e(window).width()-this.helperProportions.width-this.margins.left,e(window).scrollTop()+(e(window).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(i.containment==="document"){this.containment=[0,0,e(s).width()-this.helperProportions.width-this.margins.left,(e(s).height()||s.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];return}if(i.containment.constructor===Array){this.containment=i.containment;return}i.containment==="parent"&&(i.containment=this.helper[0].parentNode);n=e(i.containment);r=n[0];if(!r)return;t=n.css("overflow")!=="hidden";this.containment=[(parseInt(n.css("borderLeftWidth"),10)||0)+(parseInt(n.css("paddingLeft"),10)||0),(parseInt(n.css("borderTopWidth"),10)||0)+(parseInt(n.css("paddingTop"),10)||0),(t?Math.max(r.scrollWidth,r.offsetWidth):r.offsetWidth)-(parseInt(n.css("borderRightWidth"),10)||0)-(parseInt(n.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(t?Math.max(r.scrollHeight,r.offsetHeight):r.offsetHeight)-(parseInt(n.css("borderBottomWidth"),10)||0)-(parseInt(n.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=n},_convertPositionTo:function(t,n){n||(n=this.position);var r=t==="absolute"?1:-1,i=this.document[0],s=this.cssPosition==="absolute"&&(this.scrollParent[0]===i||!e.contains(this.scrollParent[0],this.offsetParent[0])),o=s?this.offsetParent:this.scrollParent,u=s&&/(html|body)/i.test(o[0].nodeName);this.offset.scroll||(this.offset.scroll={top:o.scrollTop(),left:o.scrollLeft()});return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():u?0:this.offset.scroll.top)*r,left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():u?0:this.offset.scroll.left)*r}},_generatePosition:function(t){var n,r,i,s,o=this.options,u=this.document[0],a=this.cssPosition==="absolute"&&(this.scrollParent[0]===u||!e.contains(this.scrollParent[0],this.offsetParent[0])),f=a?this.offsetParent:this.scrollParent,l=a&&/(html|body)/i.test(f[0].nodeName),c=t.pageX,h=t.pageY;this.offset.scroll||(this.offset.scroll={top:f.scrollTop(),left:f.scrollLeft()});if(this.originalPosition){if(this.containment){if(this.relative_container){r=this.relative_container.offset();n=[this.containment[0]+r.left,this.containment[1]+r.top,this.containment[2]+r.left,this.containment[3]+r.top]}else n=this.containment;t.pageX-this.offset.click.left<n[0]&&(c=n[0]+this.offset.click.left);t.pageY-this.offset.click.top<n[1]&&(h=n[1]+this.offset.click.top);t.pageX-this.offset.click.left>n[2]&&(c=n[2]+this.offset.click.left);t.pageY-this.offset.click.top>n[3]&&(h=n[3]+this.offset.click.top)}if(o.grid){i=o.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/o.grid[1])*o.grid[1]:this.originalPageY;h=n?i-this.offset.click.top>=n[1]||i-this.offset.click.top>n[3]?i:i-this.offset.click.top>=n[1]?i-o.grid[1]:i+o.grid[1]:i;s=o.grid[0]?this.originalPageX+Math.round((c-this.originalPageX)/o.grid[0])*o.grid[0]:this.originalPageX;c=n?s-this.offset.click.left>=n[0]||s-this.offset.click.left>n[2]?s:s-this.offset.click.left>=n[0]?s-o.grid[0]:s+o.grid[0]:s}}return{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(this.cssPosition==="fixed"?-this.scrollParent.scrollTop():l?0:this.offset.scroll.top),left:c-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(this.cssPosition==="fixed"?-this.scrollParent.scrollLeft():l?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!==this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=!1;this.destroyOnClear&&this.destroy()},_trigger:function(t,n,r){r=r||this._uiHash();e.ui.plugin.call(this,t,[n,r,this],!0);t==="drag"&&(this.positionAbs=this._convertPositionTo("absolute"));return e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n,r){var i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[];e(i.connectToSortable).each(function(){var n=e(this).sortable("instance");if(n&&!n.options.disabled){r.sortables.push({instance:n,shouldRevert:n.options.revert});n.refreshPositions();n._trigger("activate",t,s)}})},stop:function(t,n,r){var i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;r.cancelHelperRemoval=!0;this.instance.cancelHelperRemoval=!1;this.shouldRevert&&(this.instance.options.revert=this.shouldRevert);this.instance._mouseStop(t);this.instance.options.helper=this.instance.options._helper;r.options.helper==="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=!1;this.instance._trigger("deactivate",t,i)}})},drag:function(t,n,r){var i=this;e.each(r.sortables,function(){var s=!1,o=this;this.instance.positionAbs=r.positionAbs;this.instance.helperProportions=r.helperProportions;this.instance.offset.click=r.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){s=!0;e.each(r.sortables,function(){this.instance.positionAbs=r.positionAbs;this.instance.helperProportions=r.helperProportions;this.instance.offset.click=r.offset.click;this!==o&&this.instance._intersectsWith(this.instance.containerCache)&&e.contains(o.instance.element[0],this.instance.element[0])&&(s=!1);return s})}if(s){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=e(i).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item",!0);this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return n.helper[0]};t.target=this.instance.currentItem[0];this.instance._mouseCapture(t,!0);this.instance._mouseStart(t,!0,!0);this.instance.offset.click.top=r.offset.click.top;this.instance.offset.click.left=r.offset.click.left;this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top;r._trigger("toSortable",t);r.dropped=this.instance.element;r.currentItem=r.element;this.instance.fromOutside=r}this.instance.currentItem&&this.instance._mouseDrag(t)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=!0;this.instance.options.revert=!1;this.instance._trigger("out",t,this.instance._uiHash(this.instance));this.instance._mouseStop(t,!0);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&this.instance.placeholder.remove();r._trigger("fromSortable",t);r.dropped=!1}})}});e.ui.plugin.add("draggable","cursor",{start:function(t,n,r){var i=e("body"),s=r.options;i.css("cursor")&&(s._cursor=i.css("cursor"));i.css("cursor",s.cursor)},stop:function(t,n,r){var i=r.options;i._cursor&&e("body").css("cursor",i._cursor)}});e.ui.plugin.add("draggable","opacity",{start:function(t,n,r){var i=e(n.helper),s=r.options;i.css("opacity")&&(s._opacity=i.css("opacity"));i.css("opacity",s.opacity)},stop:function(t,n,r){var i=r.options;i._opacity&&e(n.helper).css("opacity",i._opacity)}});e.ui.plugin.add("draggable","scroll",{start:function(e,t,n){n.scrollParent[0]!==n.document[0]&&n.scrollParent[0].tagName!=="HTML"&&(n.overflowOffset=n.scrollParent.offset())},drag:function(t,n,r){var i=r.options,s=!1,o=r.document[0];if(r.scrollParent[0]!==o&&r.scrollParent[0].tagName!=="HTML"){if(!i.axis||i.axis!=="x")r.overflowOffset.top+r.scrollParent[0].offsetHeight-t.pageY<i.scrollSensitivity?r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop-i.scrollSpeed);if(!i.axis||i.axis!=="y")r.overflowOffset.left+r.scrollParent[0].offsetWidth-t.pageX<i.scrollSensitivity?r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft+i.scrollSpeed:t.pageX-r.overflowOffset.left<i.scrollSensitivity&&(r.scrollParent[0].scrollLeft=s=r.scrollParent[0].scrollLeft-i.scrollSpeed)}else{if(!i.axis||i.axis!=="x")t.pageY-e(o).scrollTop()<i.scrollSensitivity?s=e(o).scrollTop(e(o).scrollTop()-i.scrollSpeed):e(window).height()-(t.pageY-e(o).scrollTop())<i.scrollSensitivity&&(s=e(o).scrollTop(e(o).scrollTop()+i.scrollSpeed));if(!i.axis||i.axis!=="y")t.pageX-e(o).scrollLeft()<i.scrollSensitivity?s=e(o).scrollLeft(e(o).scrollLeft()-i.scrollSpeed):e(window).width()-(t.pageX-e(o).scrollLeft())<i.scrollSensitivity&&(s=e(o).scrollLeft(e(o).scrollLeft()+i.scrollSpeed))}s!==!1&&e.ui.ddmanager&&!i.dropBehaviour&&e.ui.ddmanager.prepareOffsets(r,t)}});e.ui.plugin.add("draggable","snap",{start:function(t,n,r){var i=r.options;r.snapElements=[];e(i.snap.constructor!==String?i.snap.items||":data(ui-draggable)":i.snap).each(function(){var t=e(this),n=t.offset();this!==r.element[0]&&r.snapElements.push({item:this,width:t.outerWidth(),height:t.outerHeight(),top:n.top,left:n.left})})},drag:function(t,n,r){var i,s,o,u,a,f,l,c,h,p,d=r.options,v=d.snapTolerance,m=n.offset.left,g=m+r.helperProportions.width,y=n.offset.top,b=y+r.helperProportions.height;for(h=r.snapElements.length-1;h>=0;h--){a=r.snapElements[h].left;f=a+r.snapElements[h].width;l=r.snapElements[h].top;c=l+r.snapElements[h].height;if(g<a-v||m>f+v||b<l-v||y>c+v||!e.contains(r.snapElements[h].item.ownerDocument,r.snapElements[h].item)){r.snapElements[h].snapping&&r.options.snap.release&&r.options.snap.release.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[h].item}));r.snapElements[h].snapping=!1;continue}if(d.snapMode!=="inner"){i=Math.abs(l-b)<=v;s=Math.abs(c-y)<=v;o=Math.abs(a-g)<=v;u=Math.abs(f-m)<=v;i&&(n.position.top=r._convertPositionTo("relative",{top:l-r.helperProportions.height,left:0}).top-r.margins.top);s&&(n.position.top=r._convertPositionTo("relative",{top:c,left:0}).top-r.margins.top);o&&(n.position.left=r._convertPositionTo("relative",{top:0,left:a-r.helperProportions.width}).left-r.margins.left);u&&(n.position.left=r._convertPositionTo("relative",{top:0,left:f}).left-r.margins.left)}p=i||s||o||u;if(d.snapMode!=="outer"){i=Math.abs(l-y)<=v;s=Math.abs(c-b)<=v;o=Math.abs(a-m)<=v;u=Math.abs(f-g)<=v;i&&(n.position.top=r._convertPositionTo("relative",{top:l,left:0}).top-r.margins.top);s&&(n.position.top=r._convertPositionTo("relative",{top:c-r.helperProportions.height,left:0}).top-r.margins.top);o&&(n.position.left=r._convertPositionTo("relative",{top:0,left:a}).left-r.margins.left);u&&(n.position.left=r._convertPositionTo("relative",{top:0,left:f-r.helperProportions.width}).left-r.margins.left)}!r.snapElements[h].snapping&&(i||s||o||u||p)&&r.options.snap.snap&&r.options.snap.snap.call(r.element,t,e.extend(r._uiHash(),{snapItem:r.snapElements[h].item}));r.snapElements[h].snapping=i||s||o||u||p}}});e.ui.plugin.add("draggable","stack",{start:function(t,n,r){var i,s=r.options,o=e.makeArray(e(s.stack)).sort(function(t,n){return(parseInt(e(t).css("zIndex"),10)||0)-(parseInt(e(n).css("zIndex"),10)||0)});if(!o.length)return;i=parseInt(e(o[0]).css("zIndex"),10)||0;e(o).each(function(t){e(this).css("zIndex",i+t)});this.css("zIndex",i+o.length)}});e.ui.plugin.add("draggable","zIndex",{start:function(t,n,r){var i=e(n.helper),s=r.options;i.css("zIndex")&&(s._zIndex=i.css("zIndex"));i.css("zIndex",s.zIndex)},stop:function(t,n,r){var i=r.options;i._zIndex&&e(n.helper).css("zIndex",i._zIndex)}})})(jQuery);(function(e,t,n){"use strict";var r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S,x;S={paneClass:"pane",sliderClass:"slider",contentClass:"content",iOSNativeScrolling:!1,preventPageScrolling:!1,disableResize:!1,alwaysVisible:!1,flashDelay:1500,sliderMinHeight:20,sliderMaxHeight:null,documentContext:null,windowContext:null};y="scrollbar";g="scroll";l="mousedown";c="mousemove";p="mousewheel";h="mouseup";m="resize";u="drag";w="up";v="panedown";s="DOMMouseScroll";o="down";E="wheel";a="keydown";f="keyup";b="touchmove";r=t.navigator.appName==="Microsoft Internet Explorer"&&/msie 7./i.test(t.navigator.appVersion)&&t.ActiveXObject;i=null;x=function(){var e,t,r;e=n.createElement("div");t=e.style;t.position="absolute";t.width="100px";t.height="100px";t.overflow=g;t.top="-9999px";n.body.appendChild(e);r=e.offsetWidth-e.clientWidth;n.body.removeChild(e);return r};d=function(){function a(r,s){this.el=r;this.options=s;i||(i=x());this.$el=e(this.el);this.doc=e(this.options.documentContext||n);this.win=e(this.options.windowContext||t);this.$content=this.$el.children("."+s.contentClass);this.$content.attr("tabindex",this.options.tabIndex||0);this.content=this.$content[0];this.options.iOSNativeScrolling&&this.el.style.WebkitOverflowScrolling!=null?this.nativeScrolling():this.generate();this.createEvents();this.addEvents();this.reset()}a.prototype.preventScrolling=function(e,t){if(!this.isActive)return;if(e.type===s)(t===o&&e.originalEvent.detail>0||t===w&&e.originalEvent.detail<0)&&e.preventDefault();else if(e.type===p){if(!e.originalEvent||!e.originalEvent.wheelDelta)return;(t===o&&e.originalEvent.wheelDelta<0||t===w&&e.originalEvent.wheelDelta>0)&&e.preventDefault()}};a.prototype.nativeScrolling=function(){this.$content.css({WebkitOverflowScrolling:"touch"});this.iOSNativeScrolling=!0;this.isActive=!0};a.prototype.updateScrollValues=function(){var e;e=this.content;this.maxScrollTop=e.scrollHeight-e.clientHeight;this.prevScrollTop=this.contentScrollTop||0;this.contentScrollTop=e.scrollTop;if(!this.iOSNativeScrolling){this.maxSliderTop=this.paneHeight-this.sliderHeight;this.sliderTop=this.maxScrollTop===0?0:this.contentScrollTop*this.maxSliderTop/this.maxScrollTop}};a.prototype.createEvents=function(){var e=this;this.events={down:function(t){e.isBeingDragged=!0;e.offsetY=t.pageY-e.slider.offset().top;e.pane.addClass("active");e.doc.bind(c,e.events[u]).bind(h,e.events[w]);return!1},drag:function(t){e.sliderY=t.pageY-e.$el.offset().top-e.offsetY;e.scroll();e.updateScrollValues();e.contentScrollTop>=e.maxScrollTop&&e.prevScrollTop!==e.maxScrollTop?e.$el.trigger("scrollend"):e.contentScrollTop===0&&e.prevScrollTop!==0&&e.$el.trigger("scrolltop");return!1},up:function(t){e.isBeingDragged=!1;e.pane.removeClass("active");e.doc.unbind(c,e.events[u]).unbind(h,e.events[w]);return!1},resize:function(t){e.reset()},panedown:function(t){e.sliderY=(t.offsetY||t.originalEvent.layerY)-e.sliderHeight*.5;e.scroll();e.events.down(t);return!1},scroll:function(t){if(e.isBeingDragged)return;e.updateScrollValues();if(!e.iOSNativeScrolling){e.sliderY=e.sliderTop;e.slider.css({top:e.sliderTop})}if(t==null)return;if(e.contentScrollTop>=e.maxScrollTop){e.options.preventPageScrolling&&e.preventScrolling(t,o);e.prevScrollTop!==e.maxScrollTop&&e.$el.trigger("scrollend")}else if(e.contentScrollTop===0){e.options.preventPageScrolling&&e.preventScrolling(t,w);e.prevScrollTop!==0&&e.$el.trigger("scrolltop")}},wheel:function(t){var n;if(t==null)return;n=t.delta||t.wheelDelta||t.originalEvent&&t.originalEvent.wheelDelta||-t.detail||t.originalEvent&&-t.originalEvent.detail;n&&(e.sliderY+=-n/3);e.scroll();return!1}}};a.prototype.addEvents=function(){var e;this.removeEvents();e=this.events;this.options.disableResize||this.win.bind(m,e[m]);if(!this.iOSNativeScrolling){this.slider.bind(l,e[o]);this.pane.bind(l,e[v]).bind(""+p+" "+s,e[E])}this.$content.bind(""+g+" "+p+" "+s+" "+b,e[g])};a.prototype.removeEvents=function(){var e;e=this.events;this.win.unbind(m,e[m]);if(!this.iOSNativeScrolling){this.slider.unbind();this.pane.unbind()}this.$content.unbind(""+g+" "+p+" "+s+" "+b,e[g])};a.prototype.generate=function(){var e,t,n,r,s;n=this.options;r=n.paneClass,s=n.sliderClass,e=n.contentClass;!this.$el.find(""+r).length&&!this.$el.find(""+s).length&&this.$el.append('<div class="'+r+'"><div class="'+s+'" /></div>');this.pane=this.$el.children("."+r);this.slider=this.pane.find("."+s);if(i){t={right:-i};this.$el.addClass("has-scrollbar")}t!=null&&this.$content.css(t);return this};a.prototype.restore=function(){this.stopped=!1;this.pane.show();this.addEvents()};a.prototype.reset=function(){var e,t,n,s,o,u,a,f,l,c;if(this.iOSNativeScrolling){this.contentHeight=this.content.scrollHeight;return}this.$el.find("."+this.options.paneClass).length||this.generate().stop();this.stopped&&this.restore();e=this.content;n=e.style;s=n.overflowY;r&&this.$content.css({height:this.$content.height()});t=e.scrollHeight+i;l=parseInt(this.$el.css("max-height"),10);if(l>0){this.$el.height("");this.$el.height(e.scrollHeight>l?l:e.scrollHeight)}u=this.pane.outerHeight(!1);f=parseInt(this.pane.css("top"),10);o=parseInt(this.pane.css("bottom"),10);a=u+f+o;c=Math.round(a/t*a);c<this.options.sliderMinHeight?c=this.options.sliderMinHeight:this.options.sliderMaxHeight!=null&&c>this.options.sliderMaxHeight&&(c=this.options.sliderMaxHeight);s===g&&n.overflowX!==g&&(c+=i);this.maxSliderTop=a-c;this.contentHeight=t;this.paneHeight=u;this.paneOuterHeight=a;this.sliderHeight=c;this.slider.height(c);this.events.scroll();this.pane.show();this.isActive=!0;if(e.scrollHeight===e.clientHeight||this.pane.outerHeight(!0)>=e.scrollHeight&&s!==g){this.pane.hide();this.isActive=!1}else this.el.clientHeight===e.scrollHeight&&s===g?this.slider.hide():this.slider.show();this.pane.css({opacity:this.options.alwaysVisible?1:"",visibility:this.options.alwaysVisible?"visible":""});return this};a.prototype.scroll=function(){if(!this.isActive)return;this.sliderY=Math.max(0,this.sliderY);this.sliderY=Math.min(this.maxSliderTop,this.sliderY);this.$content.scrollTop((this.paneHeight-this.contentHeight+i)*this.sliderY/this.maxSliderTop*-1);this.iOSNativeScrolling||this.slider.css({top:this.sliderY});return this};a.prototype.scrollBottom=function(e){if(!this.isActive)return;this.reset();this.$content.scrollTop(this.contentHeight-this.$content.height()-e).trigger(p);return this};a.prototype.scrollTop=function(e){if(!this.isActive)return;this.reset();this.$content.scrollTop(+e).trigger(p);return this};a.prototype.scrollTo=function(t){if(!this.isActive)return;this.reset();this.scrollTop(e(t).get(0).offsetTop);return this};a.prototype.stop=function(){this.stopped=!0;this.removeEvents();this.pane.hide();return this};a.prototype.destroy=function(){this.stopped||this.stop();this.pane.length&&this.pane.remove();r&&this.$content.height("");this.$content.removeAttr("tabindex");if(this.$el.hasClass("has-scrollbar")){this.$el.removeClass("has-scrollbar");this.$content.css({right:""})}return this};a.prototype.flash=function(){var e=this;if(!this.isActive)return;this.reset();this.pane.addClass("flashed");setTimeout(function(){e.pane.removeClass("flashed")},this.options.flashDelay);return this};return a}();e.fn.nanoScroller=function(t){return this.each(function(){var n,r;if(!(r=this.nanoscroller)){n=e.extend({},S,t);this.nanoscroller=r=new d(this,n)}if(t&&typeof t=="object"){e.extend(r.options,t);if(t.scrollBottom)return r.scrollBottom(t.scrollBottom);if(t.scrollTop)return r.scrollTop(t.scrollTop);if(t.scrollTo)return r.scrollTo(t.scrollTo);if(t.scroll==="bottom")return r.scrollBottom(0);if(t.scroll==="top")return r.scrollTop(0);if(t.scroll&&t.scroll instanceof e)return r.scrollTo(t.scroll);if(t.stop)return r.stop();if(t.destroy)return r.destroy();if(t.flash)return r.flash()}return r.reset()})};e.fn.nanoScroller.Constructor=d})(jQuery,window,document);jQuery.url=function(){var e={},t={},n={url:window.location,strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},r=function(){str=decodeURI(n.url);var e=n.parser[n.strictMode?"strict":"loose"].exec(str),t={},r=14;while(r--)t[n.key[r]]=e[r]||"";t[n.q.name]={};t[n.key[12]].replace(n.q.parser,function(e,r,i){r&&(t[n.q.name][r]=i)});return t},i=function(e){jQuery.isEmptyObject(t)&&o();return e=="base"?t.port!==null&&t.port!==""?t.protocol+"://"+t.host+":"+t.port+"/":t.protocol+"://"+t.host+"/":t[e]===""?null:t[e]},s=function(e){jQuery.isEmptyObject(t)&&o();return t.queryKey[e]===null?null:t.queryKey[e]},o=function(){t=r();u()},u=function(){var n=t.path;e=[];e=t.path.length==1?{}:(n.charAt(n.length-1)=="/"?n.substring(1,n.length-1):path=n.substring(1)).split("/")};return{setMode:function(e){n.strictMode=e=="strict"?!0:!1;return this},setUrl:function(e){n.url=e===undefined?window.location:e;o();return this},segment:function(n){jQuery.isEmptyObject(t)&&o();return n===undefined?e.length:e[n]===""||e[n]===undefined?null:e[n]},attr:i,param:s}}();!function(e){"undefined"==typeof e.fn.each2&&e.extend(e.fn,{each2:function(t){for(var n=e([0]),r=-1,i=this.length;++r<i&&(n.context=n[0]=this[r])&&t.call(n[0],r,n)!==!1;);return this}})}(jQuery),function(e,t){"use strict";function n(e){var t,n,r,i;if(!e||e.length<1)return e;for(t="",n=0,r=e.length;r>n;n++)i=e.charAt(n),t+=I[i]||i;return t}function r(e,t){for(var n=0,r=t.length;r>n;n+=1)if(s(e,t[n]))return n;return-1}function i(){var t=e(F);t.appendTo("body");var n={width:t.width()-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),n}function s(e,n){return e===n?!0:e===t||n===t?!1:null===e||null===n?!1:e.constructor===String?e+""==n+"":n.constructor===String?n+""==e+"":!1}function o(t,n){var r,i,s;if(null===t||t.length<1)return[];for(r=t.split(n),i=0,s=r.length;s>i;i+=1)r[i]=e.trim(r[i]);return r}function u(e){return e.outerWidth(!1)-e.width()}function a(n){var r="keyup-change-value";n.on("keydown",function(){e.data(n,r)===t&&e.data(n,r,n.val())}),n.on("keyup",function(){var i=e.data(n,r);i!==t&&n.val()!==i&&(e.removeData(n,r),n.trigger("keyup-change"))})}function f(n){n.on("mousemove",function(n){var r=j;(r===t||r.x!==n.pageX||r.y!==n.pageY)&&e(n.target).trigger("mousemove-filtered",n)})}function l(e,n,r){r=r||t;var i;return function(){var t=arguments;window.clearTimeout(i),i=window.setTimeout(function(){n.apply(r,t)},e)}}function c(e){var t,n=!1;return function(){return n===!1&&(t=e(),n=!0),t}}function h(e,t){var n=l(e,function(e){t.trigger("scroll-debounced",e)});t.on("scroll",function(e){r(e.target,t.get())>=0&&n(e)})}function p(e){e[0]!==document.activeElement&&window.setTimeout(function(){var t,n=e[0],r=e.val().length;e.focus(),e.is(":visible")&&n===document.activeElement&&(n.setSelectionRange?n.setSelectionRange(r,r):n.createTextRange&&(t=n.createTextRange(),t.collapse(!1),t.select()))},0)}function d(t){t=e(t)[0];var n=0,r=0;if("selectionStart"in t)n=t.selectionStart,r=t.selectionEnd-n;else if("selection"in document){t.focus();var i=document.selection.createRange();r=document.selection.createRange().text.length,i.moveStart("character",-t.value.length),n=i.text.length-r}return{offset:n,length:r}}function v(e){e.preventDefault(),e.stopPropagation()}function m(e){e.preventDefault(),e.stopImmediatePropagation()}function g(t){if(!P){var n=t[0].currentStyle||window.getComputedStyle(t[0],null);P=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:n.fontSize,fontFamily:n.fontFamily,fontStyle:n.fontStyle,fontWeight:n.fontWeight,letterSpacing:n.letterSpacing,textTransform:n.textTransform,whiteSpace:"nowrap"}),P.attr("class","select2-sizer"),e("body").append(P)}return P.text(t.val()),P.width()}function y(t,n,r){var i,s,o=[];i=t.attr("class"),i&&(i=""+i,e(i.split(" ")).each2(function(){0===this.indexOf("select2-")&&o.push(this)})),i=n.attr("class"),i&&(i=""+i,e(i.split(" ")).each2(function(){0!==this.indexOf("select2-")&&(s=r(this),s&&o.push(this))})),t.attr("class",o.join(" "))}function b(e,t,r,i){var s=n(e.toUpperCase()).indexOf(n(t.toUpperCase())),o=t.length;return 0>s?(r.push(i(e)),void 0):(r.push(i(e.substring(0,s))),r.push("<span class='select2-match'>"),r.push(i(e.substring(s,s+o))),r.push("</span>"),r.push(i(e.substring(s+o,e.length))),void 0)}function w(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})}function E(n){var r,i=null,s=n.quietMillis||100,o=n.url,u=this;return function(a){window.clearTimeout(r),r=window.setTimeout(function(){var r=n.data,s=o,f=n.transport||e.fn.select2.ajaxDefaults.transport,l={type:n.type||"GET",cache:n.cache||!1,jsonpCallback:n.jsonpCallback||t,dataType:n.dataType||"json"},c=e.extend({},e.fn.select2.ajaxDefaults.params,l);r=r?r.call(u,a.term,a.page,a.context):null,s="function"==typeof s?s.call(u,a.term,a.page,a.context):s,i&&i.abort(),n.params&&(e.isFunction(n.params)?e.extend(c,n.params.call(u)):e.extend(c,n.params)),e.extend(c,{url:s,dataType:n.dataType,data:r,success:function(e){var t=n.results(e,a.page);a.callback(t)}}),i=f.call(u,c)},s)}}function S(t){var n,r,i=t,s=function(e){return""+e.text};e.isArray(i)&&(r=i,i={results:r}),e.isFunction(i)===!1&&(r=i,i=function(){return r});var o=i();return o.text&&
  (s=o.text,e.isFunction(s)||(n=o.text,s=function(e){return e[n]})),function(t){var n,r=t.term,o={results:[]};return""===r?(t.callback(i()),void 0):(n=function(i,o){var u,a;if(i=i[0],i.children){u={};for(a in i)i.hasOwnProperty(a)&&(u[a]=i[a]);u.children=[],e(i.children).each2(function(e,t){n(t,u.children)}),(u.children.length||t.matcher(r,s(u),i))&&o.push(u)}else t.matcher(r,s(i),i)&&o.push(i)},e(i().results).each2(function(e,t){n(t,o.results)}),t.callback(o),void 0)}}function x(n){var r=e.isFunction(n);return function(i){var s=i.term,o={results:[]};e(r?n():n).each(function(){var e=this.text!==t,n=e?this.text:this;(""===s||i.matcher(s,n))&&o.results.push(e?this:{id:this,text:this})}),i.callback(o)}}function T(t,n){if(e.isFunction(t))return!0;if(!t)return!1;throw new Error(n+" must be a function or a falsy value")}function N(t){return e.isFunction(t)?t():t}function C(t){var n=0;return e.each(t,function(e,t){t.children?n+=C(t.children):n++}),n}function k(e,n,r,i){var o,u,a,f,l,c=e,h=!1;if(!i.createSearchChoice||!i.tokenSeparators||i.tokenSeparators.length<1)return t;for(;;){for(u=-1,a=0,f=i.tokenSeparators.length;f>a&&(l=i.tokenSeparators[a],u=e.indexOf(l),!(u>=0));a++);if(0>u)break;if(o=e.substring(0,u),e=e.substring(u+l.length),o.length>0&&(o=i.createSearchChoice.call(this,o,n),o!==t&&null!==o&&i.id(o)!==t&&null!==i.id(o))){for(h=!1,a=0,f=n.length;f>a;a++)if(s(i.id(o),i.id(n[a]))){h=!0;break}h||r(o)}}return c!==e?e:void 0}function L(t,n){var r=function(){};return r.prototype=new t,r.prototype.constructor=r,r.prototype.parent=t.prototype,r.prototype=e.extend(r.prototype,n),r}if(window.Select2===t){var A,O,M,_,D,P,H,B,j={x:0,y:0},A={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){switch(e=e.which?e.which:e){case A.LEFT:case A.RIGHT:case A.UP:case A.DOWN:return!0}return!1},isControl:function(e){var t=e.which;switch(t){case A.SHIFT:case A.CTRL:case A.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&123>=e}},F="<div class='select2-measure-scrollbar'></div>",I={"Ⓐ":"A","Ａ":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","Ｂ":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","Ｃ":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","Ｄ":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","Ǳ":"DZ","Ǆ":"DZ","ǲ":"Dz","ǅ":"Dz","Ⓔ":"E","Ｅ":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","Ｆ":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","Ｇ":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","Ｈ":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","Ｉ":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","Ｊ":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","Ｋ":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","Ｌ":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","Ǉ":"LJ","ǈ":"Lj","Ⓜ":"M","Ｍ":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","Ｎ":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","Ǌ":"NJ","ǋ":"Nj","Ⓞ":"O","Ｏ":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","Ｐ":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Ｑ":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","Ｒ":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","Ｓ":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","Ｔ":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","Ｕ":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","Ｖ":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","Ｗ":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","Ｘ":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Ｙ":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Ｚ":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","ａ":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","ｂ":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","ｃ":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","ｄ":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","ǳ":"dz","ǆ":"dz","ⓔ":"e","ｅ":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","ｆ":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","ｇ":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","ｈ":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","ｉ":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","ｊ":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","ｋ":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","ｌ":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","ǉ":"lj","ⓜ":"m","ｍ":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","ｎ":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ŉ":"n","ꞑ":"n","ꞥ":"n","ǌ":"nj","ⓞ":"o","ｏ":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","ｐ":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","ｑ":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","ｒ":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","ｓ":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","ｔ":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","ｕ":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","ｖ":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","ｗ":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","ｘ":"x","ẋ":"x","ẍ":"x","ⓨ":"y","ｙ":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","ｚ":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z"};H=e(document),D=function(){var e=1;return function(){return e++}}(),H.on("mousemove",function(e){j.x=e.pageX,j.y=e.pageY}),O=L(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(n){var r,s,o,u,l=".select2-results";this.opts=n=this.prepareOpts(n),this.id=n.id,n.element.data("select2")!==t&&null!==n.element.data("select2")&&n.element.data("select2").destroy(),this.container=this.createContainer(),this.containerId="s2id_"+(n.element.attr("id")||"autogen"+D()),this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.body=c(function(){return n.element.closest("body")}),y(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",n.element.attr("style")),this.container.css(N(n.containerCss)),this.container.addClass(N(n.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),this.dropdown.addClass(N(n.dropdownCssClass)),this.dropdown.data("select2",this),y(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.results=r=this.container.find(l),this.search=s=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),f(this.results),this.dropdown.on("mousemove-filtered touchstart touchmove touchend",l,this.bind(this.highlightUnderEvent)),h(80,this.results),this.dropdown.on("scroll-debounced",l,this.bind(this.loadMoreIfNeeded)),e(this.container).on("change",".select2-input",function(e){e.stopPropagation()}),e(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()}),e.fn.mousewheel&&r.mousewheel(function(e,t,n,i){var s=r.scrollTop();i>0&&0>=s-i?(r.scrollTop(0),v(e)):0>i&&r.get(0).scrollHeight-r.scrollTop()+i<=r.height()&&(r.scrollTop(r.get(0).scrollHeight-r.height()),v(e))}),a(s),s.on("keyup-change input paste",this.bind(this.updateResults)),s.on("focus",function(){s.addClass("select2-focused")}),s.on("blur",function(){s.removeClass("select2-focused")}),this.dropdown.on("mouseup",l,this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.on("click mouseup mousedown",function(e){e.stopPropagation()}),e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==n.maximumInputLength&&this.search.attr("maxlength",n.maximumInputLength);var o=n.element.prop("disabled");o===t&&(o=!1),this.enable(!o);var u=n.element.prop("readonly");u===t&&(u=!1),this.readonly(u),B=B||i(),this.autofocus=n.element.prop("autofocus"),n.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.nextSearchTerm=t},destroy:function(){var e=this.opts.element,n=e.data("select2");this.close(),this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),n!==t&&(n.container.remove(),n.dropdown.remove(),e.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?e.attr({tabindex:this.elementTabIndex}):e.removeAttr("tabindex"),e.show())},optionToData:function(e){return e.is("option")?{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:s(e.attr("locked"),"locked")||s(e.data("locked"),!0)}:e.is("optgroup")?{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}:void 0},prepareOpts:function(n){var r,i,u,a,f=this;if(r=n.element,"select"===r.get(0).tagName.toLowerCase()&&(this.select=i=n.element),i&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in n)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),n=e.extend({},{populateResults:function(r,i,s){var o,u=this.opts.id;o=function(r,i,a){var l,c,h,p,d,v,m,g,y,b;for(r=n.sortResults(r,i,s),l=0,c=r.length;c>l;l+=1)h=r[l],d=h.disabled===!0,p=!d&&u(h)!==t,v=h.children&&h.children.length>0,m=e("<li></li>"),m.addClass("select2-results-dept-"+a),m.addClass("select2-result"),m.addClass(p?"select2-result-selectable":"select2-result-unselectable"),d&&m.addClass("select2-disabled"),v&&m.addClass("select2-result-with-children"),m.addClass(f.opts.formatResultCssClass(h)),g=e(document.createElement("div")),g.addClass("select2-result-label"),b=n.formatResult(h,g,s,f.opts.escapeMarkup),b!==t&&g.html(b),m.append(g),v&&(y=e("<ul></ul>"),y.addClass("select2-result-sub"),o(h.children,y,a+1),m.append(y)),m.data("select2-data",h),i.append(m)},o(i,r,0)}},e.fn.select2.defaults,n),"function"!=typeof n.id&&(u=n.id,n.id=function(e){return e[u]}),e.isArray(n.element.data("select2Tags"))){if("tags"in n)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+n.element.attr("id");n.tags=n.element.data("select2Tags")}if(i?(n.query=this.bind(function(e){var n,i,s,o={results:[],more:!1},u=e.term;s=function(t,n){var r;t.is("option")?e.matcher(u,t.text(),t)&&n.push(f.optionToData(t)):t.is("optgroup")&&(r=f.optionToData(t),t.children().each2(function(e,t){s(t,r.children)}),r.children.length>0&&n.push(r))},n=r.children(),this.getPlaceholder()!==t&&n.length>0&&(i=this.getPlaceholderOption(),i&&(n=n.not(i))),n.each2(function(e,t){s(t,o.results)}),e.callback(o)}),n.id=function(e){return e.id},n.formatResultCssClass=function(e){return e.css}):"query"in n||("ajax"in n?(a=n.element.data("ajax-url"),a&&a.length>0&&(n.ajax.url=a),n.query=E.call(n.element,n.ajax)):"data"in n?n.query=S(n.data):"tags"in n&&(n.query=x(n.tags),n.createSearchChoice===t&&(n.createSearchChoice=function(t){return{id:e.trim(t),text:e.trim(t)}}),n.initSelection===t&&(n.initSelection=function(t,r){var i=[];e(o(t.val(),n.separator)).each(function(){var t=this,r=this,o=n.tags;e.isFunction(o)&&(o=o()),e(o).each(function(){return s(this.id,t)?(r=this.text,!1):void 0}),i.push({id:t,text:r})}),r(i)}))),"function"!=typeof n.query)throw"query function not defined for Select2 "+n.element.attr("id");return n},monitorSource:function(){var e,n=this.opts.element;n.on("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),e=this.bind(function(){var e,r=n.prop("disabled");r===t&&(r=!1),this.enable(!r);var e=n.prop("readonly");e===t&&(e=!1),this.readonly(e),y(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(N(this.opts.containerCssClass)),y(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(N(this.opts.dropdownCssClass))}),n.on("propertychange.select2 DOMAttrModified.select2",e),this.mutationCallback===t&&(this.mutationCallback=function(t){t.forEach(e)}),"undefined"!=typeof WebKitMutationObserver&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new WebKitMutationObserver(this.mutationCallback),this.propertyObserver.observe(n.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(t){var n=e.Event("select2-selecting",{val:this.id(t),object:t});return this.opts.element.trigger(n),!n.isDefaultPrevented()},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var e=this._enabled&&!this._readonly,t=!e;return e===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",t),this.close(),this.enabledInterface=e,!0)},enable:function(e){e===t&&(e=!0),this._enabled!==e&&(this._enabled=e,this.opts.element.prop("disabled",!e),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(e){return e===t&&(e=!1),this._readonly===e?!1:(this._readonly=e,this.opts.element.prop("readonly",e),this.enableInterface(),!0)},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t,n,r,i,s=this.dropdown,o=this.container.offset(),u=this.container.outerHeight(!1),a=this.container.outerWidth(!1),f=s.outerHeight(!1),l=e(window).scrollLeft()+e(window).width(),c=e(window).scrollTop()+e(window).height(),h=o.top+u,p=o.left,d=c>=h+f,v=o.top-f>=this.body().scrollTop(),m=s.outerWidth(!1),g=l>=p+m,y=s.hasClass("select2-drop-above");this.opts.dropdownAutoWidth?(i=e(".select2-results",s)[0],s.addClass("select2-drop-auto-width"),s.css("width",""),m=s.outerWidth(!1)+(i.scrollHeight===i.clientHeight?0:B.width),m>a?a=m:m=a,g=l>=p+m):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body().css("position")&&(t=this.body().offset(),h-=t.top,p-=t.left),y?(n=!0,!v&&d&&(n=!1)):(n=!1,!d&&v&&(n=!0)),g||(p=o.left+a-m),n?(h=o.top-f,this.container.addClass("select2-drop-above"),s.addClass("select2-drop-above")):(this.container.removeClass("select2-drop-above"),s.removeClass("select2-drop-above")),r=e.extend({top:h,left:p,width:a},N(this.opts.dropdownCss)),s.css(r)},shouldOpen:function(){var t;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(t=e.Event("select2-opening"),this.opts.element.trigger(t),!t.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),!0):!1},opening:function(){var t,n=this.containerId,r="scroll."+n,i="resize."+n,s="orientationchange."+n;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body().children().last()[0]&&this.dropdown.detach().appendTo(this.body()),t=e("#select2-drop-mask"),0==t.length&&(t=e(document.createElement("div")),t.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),t.hide(),t.appendTo(this.body()),t.on("mousedown touchstart click",function(t){var n,r=e("#select2-drop");r.length>0&&(n=r.data("select2"),n.opts.selectOnBlur&&n.selectHighlighted({noFocus:!0}),n.close({focus:!1}),t.preventDefault(),t.stopPropagation())})),this.dropdown.prev()[0]!==t[0]&&this.dropdown.before(t),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),t.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var o=this;this.container.parents().add(window).each(function(){e(this).on(i+" "+r+" "+s,function(){o.positionDropdown()})})},close:function(){if(this.opened()){var t=this.containerId,n="scroll."+t,r="resize."+t,i="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).off(n).off(r).off(i)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open"),this.results.empty(),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(e.Event("select2-close"))}},externalSearch:function(e){this.open(),this.search.val(e),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return N(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t,n,r,i,s,o,u,a=this.results;if(n=this.highlight(),!(0>n)){if(0==n)return a.scrollTop(0),void 0;t=this.findHighlightableChoices().find(".select2-result-label"),r=e(t[n]),i=r.offset().top+r.outerHeight(!0),n===t.length-1&&(u=a.find("li.select2-more-results"),u.length>0&&(i=u.offset().top+u.outerHeight(!0))),s=a.offset().top+a.outerHeight(!0),i>s&&a.scrollTop(a.scrollTop()+(i-s)),o=r.offset().top-a.offset().top,0>o&&"none"!=r.css("display")&&a.scrollTop(a.scrollTop()+o)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-selected):not(.select2-disabled)")},moveHighlight:function(t){for(var n=this.findHighlightableChoices(),r=this.highlight();r>-1&&r<n.length;){r+=t;var i=e(n[r]);if(i.hasClass("select2-result-selectable")&&!i.hasClass("select2-disabled")&&!i.hasClass("select2-selected")){this.highlight(r);break}}},highlight:function(t){var n,i,s=this.findHighlightableChoices();return 0===arguments.length?r(s.filter(".select2-highlighted")[0],s.get()):(t>=s.length&&(t=s.length-1),0>t&&(t=0),this.removeHighlight(),n=e(s[t]),n.addClass("select2-highlighted"),this.ensureHighlightVisible(),i=n.data("select2-data"),i&&this.opts.element.trigger({type:"select2-highlight",val:this.id(i),choice:i}),void 0)},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var n=e(t.target).closest(".select2-result-selectable");if(n.length>0&&!n.is(".select2-highlighted")){var r=this.findHighlightableChoices();this.highlight(r.index(n))}else 0==n.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var e,t=this.results,n=t.find("li.select2-more-results"),r=this.resultsPage+1,i=this,s=this.search.val(),o=this.context;0!==n.length&&(e=n.offset().top-t.offset().top-t.height(),e<=this.opts.loadMorePadding&&(n.addClass("select2-active"),this.opts.query({element:this.opts.element,term:s,page:r,context:o,matcher:this.opts.matcher,callback:this.bind(function(e){i.opened()&&(i.opts.populateResults.call(this,t,e.results,{term:s,page:r,context:o}),i.postprocessResults(e,!1,!1),e.more===!0?(n.detach().appendTo(t).text(i.opts.formatLoadMore(r+1)),window.setTimeout(function(){i.loadMoreIfNeeded()},10)):n.remove(),i.positionDropdown(),i.resultsPage=r,i.context=e.context,this.opts.element.trigger({type:"select2-loaded",items:e}))})})))},tokenize:function(){},updateResults:function(n){function r(){f.removeClass("select2-active"),h.positionDropdown()}function i(e){l.html(e),r()}var o,u,a,f=this.search,l=this.results,c=this.opts,h=this,p=f.val(),d=e.data(this.container,"select2-last-term");if((n===!0||!d||!s(p,d))&&(e.data(this.container,"select2-last-term",p),n===!0||this.showSearchInput!==!1&&this.opened())){a=++this.queryCount;var v=this.getMaximumSelectionSize();if(v>=1&&(o=this.data(),e.isArray(o)&&o.length>=v&&T(c.formatSelectionTooBig,"formatSelectionTooBig")))return i("<li class='select2-selection-limit'>"+c.formatSelectionTooBig(v)+"</li>"),void 0;if(f.val().length<c.minimumInputLength)return T(c.formatInputTooShort,"formatInputTooShort")?i("<li class='select2-no-results'>"+c.formatInputTooShort(f.val(),c.minimumInputLength)+"</li>"):i(""),n&&this.showSearch&&this.showSearch(!0),void 0;if(c.maximumInputLength&&f.val().length>c.maximumInputLength)return T(c.formatInputTooLong,"formatInputTooLong")?i("<li class='select2-no-results'>"+c.formatInputTooLong(f.val(),c.maximumInputLength)+"</li>"):i(""),void 0;c.formatSearching&&0===this.findHighlightableChoices().length&&i("<li class='select2-searching'>"+c.formatSearching()+"</li>"),f.addClass("select2-active"),this.removeHighlight(),u=this.tokenize(),u!=t&&null!=u&&f.val(u),this.resultsPage=1,c.query({element:c.element,term:f.val(),page:this.resultsPage,context:null,matcher:c.matcher,callback:this.bind(function(o){var u;if(a==this.queryCount){if(!this.opened())return this.search.removeClass("select2-active"),void 0;if(this.context=o.context===t?null:o.context,this.opts.createSearchChoice&&""!==f.val()&&(u=this.opts.createSearchChoice.call(h,f.val(),o.results),u!==t&&null!==u&&h.id(u)!==t&&null!==h.id(u)&&0===e(o.results).filter(function(){return s(h.id(this),h.id(u))}).length&&o.results.unshift(u)),0===o.results.length&&T(c.formatNoMatches,"formatNoMatches"))return i("<li class='select2-no-results'>"+c.formatNoMatches(f.val())+"</li>"),void 0;l.empty(),h.opts.populateResults.call(this,l,o.results,{term:f.val(),page:this.resultsPage,context:null}),o.more===!0&&T(c.formatLoadMore,"formatLoadMore")&&(l.append("<li class='select2-more-results'>"+h.opts.escapeMarkup(c.formatLoadMore(this.resultsPage))+"</li>"),window.setTimeout(function(){h.loadMoreIfNeeded()},10)),this.postprocessResults(o,n),r(),this.opts.element.trigger({type:"select2-loaded",items:o})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){p(this.search)},selectHighlighted:function(e){var t=this.highlight(),n=this.results.find(".select2-highlighted"),r=n.closest(".select2-result").data("select2-data");r?(this.highlight(t),this.onSelect(r,e)):e&&e.noFocus&&this.close()},getPlaceholder:function(){var e;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((e=this.getPlaceholderOption())!==t?e.text():t)},getPlaceholderOption:function(){if(this.select){var e=this.select.children().first();if(this.opts.placeholderOption!==t)return"first"===this.opts.placeholderOption&&e||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===e.text()&&""===e.val())return e}},initContainerWidth:function(){function n(){var n,r,i,s,o;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(n=this.opts.element.attr("style"),n!==t)for(r=n.split(";"),s=0,o=r.length;o>s;s+=1)if(i=r[s].replace(/\s/g,"").match(/[^-]width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==i&&i.length>=1)return i[1];return"resolve"===this.opts.width?(n=this.opts.element.css("width"),n.indexOf("%")>0?n:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}var r=n.call(this);null!==r&&this.container.css("width",r)}}),M=L(O,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' onclick='return false;' class='select2-choice' tabindex='-1'>","   <span class='select2-chosen'>&nbsp;</span><abbr class='select2-search-choice-close'></abbr>","   <span class='select2-arrow'><b></b></span>","</a>","<input class='select2-focusser select2-offscreen' type='text'/>","<div class='select2-drop select2-display-none'>","   <div class='select2-search'>","       <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'/>","   </div>","   <ul class='select2-results'>","   </ul>","</div>"].join(""));return t},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var n,r,i;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.search.focus(),n=this.search.get(0),n.createTextRange?(r=n.createTextRange(),r.collapse(!1),r.select()):n.setSelectionRange&&(i=this.search.val().length,n.setSelectionRange(i,i)),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(e.Event("select2-open"))},close:function(e){this.opened()&&(this.parent.close.apply(this,arguments),e=e||{focus:!0},this.focusser.removeAttr("disabled"),e.focus&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.removeAttr("disabled"),this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.removeAttr("disabled"),this.focusser.focus()},destroy:function(){e("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments)},initContainer:function(){var t,n=this.container,r=this.dropdown;this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=t=n.find(".select2-choice"),this.focusser=n.find(".select2-focusser"),this.focusser.attr("id","s2id_autogen"+D()),e("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.focusser.attr("id")),this.focusser.attr("tabindex",this.elementTabIndex),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){if(e.which===A.PAGE_UP||e.which===A.PAGE_DOWN)return v(e),void 0;switch(e.which){case A.UP:case A.DOWN:return this.moveHighlight(e.which===A.UP?-1:1),v(e),void 0;case A.ENTER:return this.selectHighlighted(),v(e),void 0;case A.TAB:return this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),void 0;case A.ESC:return this.cancel(e),v(e),void 0}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body().get(0)&&window.setTimeout(this.bind(function(){this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==A.TAB&&!A.isControl(e)&&!A.isFunctionKey(e)&&e.which!==A.ESC){if(this.opts.openOnEnter===!1&&e.which===A.ENTER)return v(e),void 0;if(e.which==A.DOWN||e.which==A.UP||e.which==A.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;return this.open(),v(e),void 0}return e.which==A.DELETE||e.which==A.BACKSPACE?(this.opts.allowClear&&this.clear(),v(e),void 0):void 0}})),a(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){if(this.opts.minimumResultsForSearch>=0){if(e.stopPropagation(),this.opened())return;this.open()}})),t.on("mousedown","abbr",this.bind(function(e){this.isInterfaceEnabled()&&(this.clear(),m(e),this.close(),this.selection.focus())})),t.on("mousedown",this.bind(function(t){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),v(t)})),r.on("mousedown",this.bind(function(){this.search.focus()})),t.on("focus",this.bind(function(e){v(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(e.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(e){var t=this.selection.data("select2-data");if(t){var n=this.getPlaceholderOption();this.opts.element.val(n?n.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),e!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(t),choice:t}),this.triggerChange({removed:t}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var e=this;this.opts.initSelection.call(null,this.opts.element,function(n){n!==t&&null!==n&&(e.updateSelection(n),e.close(),e.setPlaceholder())})}},isPlaceholderOptionSelected:function(){var e;return this.opts.placeholder?(e=this.getPlaceholderOption())!==t&&e.is(":selected")||""===this.opts.element.val()||this.opts.element
  .val()===t||null===this.opts.element.val():!1},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),n=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var r=e.find(":selected");t(n.optionToData(r))}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=n.val(),o=null;t.query({matcher:function(e,n,r){var u=s(i,t.id(r));return u&&(o=r),u},callback:e.isFunction(r)?function(){r(o)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===t?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&e!==t){if(this.select&&this.getPlaceholderOption()===t)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(e,t,n){var r=0,i=this;if(this.findHighlightableChoices().each2(function(e,t){return s(i.id(t.data("select2-data")),i.opts.element.val())?(r=e,!1):void 0}),n!==!1&&(t===!0&&r>=0?this.highlight(r):this.highlight(0)),t===!0){var o=this.opts.minimumResultsForSearch;o>=0&&this.showSearch(C(e.results)>=o)}},showSearch:function(t){this.showSearchInput!==t&&(this.showSearchInput=t,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!t),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!t),e(this.dropdown,this.container).toggleClass("select2-with-searchbox",t))},onSelect:function(e,t){if(this.triggerSelect(e)){var n=this.opts.element.val(),r=this.data();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"select2-selected",val:this.id(e),choice:e}),this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val()),this.close(),t&&t.noFocus||this.selection.focus(),s(n,this.id(e))||this.triggerChange({added:e,removed:r})}},updateSelection:function(e){var n,r,i=this.selection.find(".select2-chosen");this.selection.data("select2-data",e),i.empty(),null!==e&&(n=this.opts.formatSelection(e,i,this.opts.escapeMarkup)),n!==t&&i.append(n),r=this.opts.formatSelectionCssClass(e,i),r!==t&&i.addClass(r),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.container.addClass("select2-allowclear")},val:function(){var e,n=!1,r=null,i=this,s=this.data();if(0===arguments.length)return this.opts.element.val();if(e=arguments[0],arguments.length>1&&(n=arguments[1]),this.select)this.select.val(e).find(":selected").each2(function(e,t){return r=i.optionToData(t),!1}),this.updateSelection(r),this.setPlaceholder(),n&&this.triggerChange({added:r,removed:s});else{if(!e&&0!==e)return this.clear(n),void 0;if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){i.opts.element.val(e?i.id(e):""),i.updateSelection(e),i.setPlaceholder(),n&&i.triggerChange({added:e,removed:s})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var n,r=!1;return 0===arguments.length?(n=this.selection.data("select2-data"),n==t&&(n=null),n):(arguments.length>1&&(r=arguments[1]),e?(n=this.data(),this.opts.element.val(e?this.id(e):""),this.updateSelection(e),r&&this.triggerChange({added:e,removed:n})):this.clear(r),void 0)}}),_=L(O,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>","  <li class='select2-search-field'>","    <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>","  </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>","   <ul class='select2-results'>","   </ul>","</div>"].join(""));return t},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),n=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var r=[];e.find(":selected").each2(function(e,t){r.push(n.optionToData(t))}),t(r)}:"data"in t&&(t.initSelection=t.initSelection||function(n,r){var i=o(n.val(),t.separator),u=[];t.query({matcher:function(n,r,o){var a=e.grep(i,function(e){return s(e,t.id(o))}).length;return a&&u.push(o),a},callback:e.isFunction(r)?function(){for(var e=[],n=0;n<i.length;n++)for(var o=i[n],a=0;a<u.length;a++){var f=u[a];if(s(o,t.id(f))){e.push(f),u.splice(a,1);break}}r(e)}:e.noop})}),t},selectChoice:function(e){var t=this.container.find(".select2-search-choice-focus");t.length&&e&&e[0]==t[0]||(t.length&&this.opts.element.trigger("choice-deselected",t),t.removeClass("select2-search-choice-focus"),e&&e.length&&(this.close(),e.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",e)))},destroy:function(){e("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments)},initContainer:function(){var t,n=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=t=this.container.find(n);var r=this;this.selection.on("click",".select2-search-choice",function(){r.search[0].focus(),r.selectChoice(e(this))}),this.search.attr("id","s2id_autogen"+D()),e("label[for='"+this.opts.element.attr("id")+"']").attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){++this.keydowns;var n=t.find(".select2-search-choice-focus"),r=n.prev(".select2-search-choice:not(.select2-locked)"),i=n.next(".select2-search-choice:not(.select2-locked)"),s=d(this.search);if(!(!n.length||e.which!=A.LEFT&&e.which!=A.RIGHT&&e.which!=A.BACKSPACE&&e.which!=A.DELETE&&e.which!=A.ENTER)){var o=n;return e.which==A.LEFT&&r.length?o=r:e.which==A.RIGHT?o=i.length?i:null:e.which===A.BACKSPACE?(this.unselect(n.first()),this.search.width(10),o=r.length?r:i):e.which==A.DELETE?(this.unselect(n.first()),this.search.width(10),o=i.length?i:null):e.which==A.ENTER&&(o=null),this.selectChoice(o),v(e),o&&o.length||this.open(),void 0}if((e.which===A.BACKSPACE&&1==this.keydowns||e.which==A.LEFT)&&0==s.offset&&!s.length)return this.selectChoice(t.find(".select2-search-choice:not(.select2-locked)").last()),v(e),void 0;if(this.selectChoice(null),this.opened())switch(e.which){case A.UP:case A.DOWN:return this.moveHighlight(e.which===A.UP?-1:1),v(e),void 0;case A.ENTER:return this.selectHighlighted(),v(e),void 0;case A.TAB:return this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),void 0;case A.ESC:return this.cancel(e),v(e),void 0}if(e.which!==A.TAB&&!A.isControl(e)&&!A.isFunctionKey(e)&&e.which!==A.BACKSPACE&&e.which!==A.ESC){if(e.which===A.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===A.PAGE_UP||e.which===A.PAGE_DOWN)&&v(e),e.which===A.ENTER&&v(e)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(t){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),t.stopImmediatePropagation(),this.opts.element.trigger(e.Event("select2-blur"))})),this.container.on("click",n,this.bind(function(t){this.isInterfaceEnabled()&&(e(t.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.open(),this.focusSearch(),t.preventDefault()))})),this.container.on("focus",n,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var e=this;this.opts.initSelection.call(null,this.opts.element,function(n){n!==t&&null!==n&&(e.updateSelection(n),e.close(),e.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder(),n=this.getMaxSearchWidth();e!==t&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(e).addClass("select2-default"),this.search.width(n>0?n:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),this.updateResults(!0),this.search.focus(),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var n=[],i=[],s=this;e(t).each(function(){r(s.id(this),n)<0&&(n.push(s.id(this)),i.push(this))}),t=i,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){s.addSelectedChoice(this)}),s.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer.call(this,e,this.data(),this.bind(this.onSelect),this.opts),null!=e&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,t){this.triggerSelect(e)&&(this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(e,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()&&this.updateResults(!0),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),t&&t.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(n){var r,i,s=!n.locked,o=e("<li class='select2-search-choice'>    <div></div>    <a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),u=e("<li class='select2-search-choice select2-locked'><div></div></li>"),a=s?o:u,f=this.id(n),l=this.getVal();r=this.opts.formatSelection(n,a.find("div"),this.opts.escapeMarkup),r!=t&&a.find("div").replaceWith("<div>"+r+"</div>"),i=this.opts.formatSelectionCssClass(n,a.find("div")),i!=t&&a.addClass(i),s&&a.find(".select2-search-choice-close").on("mousedown",v).on("click dblclick",this.bind(function(t){this.isInterfaceEnabled()&&(e(t.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),this.close(),this.focusSearch()})).dequeue(),v(t))})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),a.data("select2-data",n),a.insertBefore(this.searchContainer),l.push(f),this.setVal(l)},unselect:function(e){var t,n,i=this.getVal();if(e=e.closest(".select2-search-choice"),0===e.length)throw"Invalid argument: "+e+". Must be .select2-search-choice";t=e.data("select2-data"),t&&(n=r(this.id(t),i),n>=0&&(i.splice(n,1),this.setVal(i),this.select&&this.postprocessResults()),e.remove(),this.opts.element.trigger({type:"removed",val:this.id(t),choice:t}),this.triggerChange({removed:t}))},postprocessResults:function(e,t,n){var i=this.getVal(),s=this.results.find(".select2-result"),o=this.results.find(".select2-result-with-children"),u=this;s.each2(function(e,t){var n=u.id(t.data("select2-data"));r(n,i)>=0&&(t.addClass("select2-selected"),t.find(".select2-result-selectable").addClass("select2-selected"))}),o.each2(function(e,t){t.is(".select2-result-selectable")||0!==t.find(".select2-result-selectable:not(.select2-selected)").length||t.addClass("select2-selected")}),-1==this.highlight()&&n!==!1&&u.highlight(0),!this.opts.createSearchChoice&&!s.filter(".select2-result:not(.select2-selected)").length>0&&(!e||e&&!e.more&&0===this.results.find(".select2-no-results").length)&&T(u.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+u.opts.formatNoMatches(u.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-u(this.search)},resizeSearch:function(){var e,t,n,r,i,s=u(this.search);e=g(this.search)+10,t=this.search.offset().left,n=this.selection.width(),r=this.selection.offset().left,i=n-(t-r)-s,e>i&&(i=n-s),40>i&&(i=n-s),0>=i&&(i=e),this.search.width(i)},getVal:function(){var e;return this.select?(e=this.select.val(),null===e?[]:e):(e=this.opts.element.val(),o(e,this.opts.separator))},setVal:function(t){var n;this.select?this.select.val(t):(n=[],e(t).each(function(){r(this,n)<0&&n.push(this)}),this.opts.element.val(0===n.length?"":n.join(this.opts.separator)))},buildChangeDetails:function(e,t){for(var t=t.slice(0),e=e.slice(0),n=0;n<t.length;n++)for(var r=0;r<e.length;r++)s(this.opts.id(t[n]),this.opts.id(e[r]))&&(t.splice(n,1),n--,e.splice(r,1),r--);return{added:t,removed:e}},val:function(n,r){var i,s=this;if(0===arguments.length)return this.getVal();if(i=this.data(),i.length||(i=[]),!n&&0!==n)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),r&&this.triggerChange({added:this.data(),removed:i}),void 0;if(this.setVal(n),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),r&&this.triggerChange(this.buildChangeDetails(i,this.data()));else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var n=e.map(t,s.id);s.setVal(n),s.updateSelection(t),s.clearSearch(),r&&s.triggerChange(s.buildChangeDetails(i,this.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],n=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(n.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t,n){var r,i,s=this;return 0===arguments.length?this.selection.find(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get():(i=this.data(),t||(t=[]),r=e.map(t,function(e){return s.opts.id(e)}),this.setVal(r),this.updateSelection(t),this.clearSearch(),n&&this.triggerChange(this.buildChangeDetails(i,this.data())),void 0)}}),e.fn.select2=function(){var n,i,s,o,u,a=Array.prototype.slice.call(arguments,0),f=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],l=["opened","isFocused","container","dropdown"],c=["val","data"],h={search:"externalSearch"};return this.each(function(){if(0===a.length||"object"==typeof a[0])n=0===a.length?{}:e.extend({},a[0]),n.element=e(this),"select"===n.element.get(0).tagName.toLowerCase()?u=n.element.prop("multiple"):(u=n.multiple||!1,"tags"in n&&(n.multiple=u=!0)),i=u?new _:new M,i.init(n);else{if("string"!=typeof a[0])throw"Invalid arguments to select2 plugin: "+a;if(r(a[0],f)<0)throw"Unknown method: "+a[0];if(o=t,i=e(this).data("select2"),i===t)return;if(s=a[0],"container"===s?o=i.container:"dropdown"===s?o=i.dropdown:(h[s]&&(s=h[s]),o=i[s].apply(i,a.slice(1))),r(a[0],l)>=0||r(a[0],c)&&1==a.length)return!1}}),o===t?this:o},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,n,r){var i=[];return b(e.text,n.term,i,r),i.join("")},formatSelection:function(e,n,r){return e?r(e.text):t},sortResults:function(e){return e},formatResultCssClass:function(){return t},formatSelectionCssClass:function(){return t},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(e,t){var n=t-e.length;return"Please enter "+n+" more character"+(1==n?"":"s")},formatInputTooLong:function(e,t){var n=e.length-t;return"Please delete "+n+" character"+(1==n?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(1==e?"":"s")},formatLoadMore:function(){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e.id},matcher:function(e,t){return n(""+t).toUpperCase().indexOf(n(""+e).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:k,escapeMarkup:w,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return t}},e.fn.select2.ajaxDefaults={transport:e.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:E,local:S,tags:x},util:{debounce:l,markMatch:b,escapeMarkup:w,stripDiacritics:n},"class":{"abstract":O,single:M,multi:_}}}}(jQuery);(function(){function e(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function t(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);e.shiftKey||(t=t.toLowerCase());return" "==t?"space":t}return c[e.which]?c[e.which]:h[e.which]?h[e.which]:String.fromCharCode(e.which).toLowerCase()}function n(e){e=e||{};var t=!1,n;for(n in y)e[n]?t=!0:y[n]=0;t||(S=!1)}function r(e,t,n,r,i,s){var o,a,f=[],l=n.type;if(!m[e])return[];"keyup"==l&&u(e)&&(t=[e]);for(o=0;o<m[e].length;++o)if(a=m[e][o],!(!r&&a.seq&&y[a.seq]!=a.level||l!=a.action||("keypress"!=l||n.metaKey||n.ctrlKey)&&t.sort().join(",")!==a.modifiers.sort().join(","))){var c=r&&a.seq==r&&a.level==s;(!r&&a.combo==i||c)&&m[e].splice(o,1);f.push(a)}return f}function i(e){var t=[];e.shiftKey&&t.push("shift");e.altKey&&t.push("alt");e.ctrlKey&&t.push("ctrl");e.metaKey&&t.push("meta");return t}function s(e,t,n){T.stopCallback(t,t.target||t.srcElement,n)||!1!==e(t,n)||(t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),t.returnValue=!1,t.cancelBubble=!0)}function o(e){"number"!=typeof e.which&&(e.which=e.keyCode);var n=t(e);n&&("keyup"==e.type&&w===n?w=!1:T.handleKey(n,i(e),e))}function u(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function a(e,r,i,o){function u(t){return function(){S=t;++y[e];clearTimeout(b);b=setTimeout(n,1e3)}}function a(r){s(i,r,e);"keyup"!==o&&(w=t(r));setTimeout(n,10)}for(var c=y[e]=0;c<r.length;++c){var h=c+1===r.length?a:u(o||f(r[c+1]).action);l(r[c],h,o,e,c)}}function f(e,t){var n,r,i,s=[];n="+"===e?["+"]:e.split("+");for(i=0;i<n.length;++i)r=n[i],d[r]&&(r=d[r]),t&&"keypress"!=t&&p[r]&&(r=p[r],s.push("shift")),u(r)&&s.push(r);n=r;i=t;if(!i){if(!v){v={};for(var o in c)95<o&&112>o||c.hasOwnProperty(o)&&(v[c[o]]=o)}i=v[n]?"keydown":"keypress"}"keypress"==i&&s.length&&(i="keydown");return{key:r,modifiers:s,action:i}}function l(e,t,n,i,s){g[e+":"+n]=t;e=e.replace(/\s+/g," ");var o=e.split(" ");1<o.length?a(e,o,t,n):(n=f(e,n),m[n.key]=m[n.key]||[],r(n.key,n.modifiers,{type:n.action},i,e,s),m[n.key][i?"unshift":"push"]({callback:t,modifiers:n.modifiers,action:n.action,seq:i,level:s,combo:e}))}for(var c={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},h={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},p={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},d={option:"alt",command:"meta","return":"enter",escape:"esc",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},v,m={},g={},y={},b,w=!1,E=!1,S=!1,x=1;20>x;++x)c[111+x]="f"+x;for(x=0;9>=x;++x)c[x+96]=x;e(document,"keypress",o);e(document,"keydown",o);e(document,"keyup",o);var T={bind:function(e,t,n){e=e instanceof Array?e:[e];for(var r=0;r<e.length;++r)l(e[r],t,n);return this},unbind:function(e,t){return T.bind(e,function(){},t)},trigger:function(e,t){g[e+":"+t]&&g[e+":"+t]({},e);return this},reset:function(){m={};g={};return this},stopCallback:function(e,t){return-1<(" "+t.className+" ").indexOf(" mousetrap ")?!1:"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.contentEditable&&"true"==t.contentEditable},handleKey:function(e,t,i){var o=r(e,t,i),a;t={};var f=0,l=!1;for(a=0;a<o.length;++a)o[a].seq&&(f=Math.max(f,o[a].level));for(a=0;a<o.length;++a)o[a].seq?o[a].level==f&&(l=!0,t[o[a].seq]=1,s(o[a].callback,i,o[a].combo)):l||s(o[a].callback,i,o[a].combo);o="keypress"==i.type&&E;i.type!=S||u(e)||o||n(t);E=l&&"keydown"==i.type}};window.Mousetrap=T;"function"==typeof define&&define.amd&&define(T)})();Mousetrap=function(e){var t={},n=e.stopCallback;e.stopCallback=function(e,r,i){return t[i]?!1:n(e,r,i)};e.bindGlobal=function(n,r,i){e.bind(n,r,i);if(n instanceof Array)for(r=0;r<n.length;r++)t[n[r]]=!0;else t[n]=!0};return e}(Mousetrap);(function(e,t){"use strict";var n=e.document,r,i=function(e,i,s){var o=this,u,a,f,l,c,p,d={updated:[]};this.listContainer=typeof e=="string"?n.getElementById(e):e;if(!this.listContainer)return;this.items=[];this.visibleItems=[];this.matchingItems=[];this.searched=!1;this.filtered=!1;this.list=null;this.templateEngines={};this.page=i.page||200;this.i=i.i||1;a={start:function(e,t){t.plugins=t.plugins||{};this.classes(t);u=new c(o,t);this.callbacks(t);this.items.start(e,t);o.update();this.plugins(t.plugins)},classes:function(e){e.listClass=e.listClass||"list";e.searchClass=e.searchClass||"search";e.sortClass=e.sortClass||"sort"},callbacks:function(e){o.list=r.getByClass(e.listClass,o.listContainer,!0);r.addEvent(r.getByClass(e.searchClass,o.listContainer),"keyup",o.search);p=r.getByClass(e.sortClass,o.listContainer);r.addEvent(p,"click",o.sort)},items:{start:function(e,n){if(n.valueNames){var r=this.get(),i=n.valueNames;n.indexAsync?this.indexAsync(r,i):this.index(r,i)}e!==t&&o.add(e)},get:function(){var e=o.list.childNodes,n=[];for(var r=0,i=e.length;r<i;r++)e[r].data===t&&n.push(e[r]);return n},index:function(e,t){for(var n=0,r=e.length;n<r;n++)o.items.push(new l(t,e[n]))},indexAsync:function(e,t){var n=e.splice(0,100);this.index(n,t);e.length>0?setTimeout(function(){a.items.indexAsync(e,t)},10):o.update()}},plugins:function(e){var t={templater:u,init:a,initialItems:f,Item:l,Templater:c,sortButtons:p,events:d,reset:g};for(var n=0;n<e.length;n++){e[n][1]=e[n][1]||{};var r=e[n][1].name||e[n][0];o[r]=o.plugins[e[n][0]].call(o,t,e[n][1])}}};this.add=function(e,n){n&&v(e,n);var r=[],i=!1;e[0]===t&&(e=[e]);for(var s=0,u=e.length;s<u;s++){var a=null;if(e[s]instanceof l){a=e[s];a.reload()}else{i=o.items.length>o.page?!0:!1;a=new l(e[s],t,i)}o.items.push(a);r.push(a)}o.update();return r};var v=function(e,t,n){var r=e.splice(0,100);n=n||[];n=n.concat(o.add(r));if(e.length>0)setTimeout(function(){v(e,t,n)},10);else{o.update();t(n)}};this.show=function(e,t){this.i=e;this.page=t;o.update()};this.remove=function(e,t,n){var r=0;for(var i=0,s=o.items.length;i<s;i++)if(o.items[i].values()[e]==t){u.remove(o.items[i],n);o.items.splice(i,1);s--;r++}o.update();return r};this.get=function(e,t){var n=[];for(var r=0,i=o.items.length;r<i;r++){var s=o.items[r];s.values()[e]==t&&n.push(s)}return n.length==0?null:n.length==1?n[0]:n};this.sort=function(e,n){var i=o.items.length,s=null,u=e.target||e.srcElement,a="",f=!1,l="asc",c="desc",n=n||{};if(u===t){s=e;f=n.asc||!1}else{s=r.getAttribute(u,"data-sort");f=r.hasClass(u,l)?!1:!0}for(var d=0,v=p.length;d<v;d++){r.removeClass(p[d],l);r.removeClass(p[d],c)}if(f){u!==t&&r.addClass(u,l);f=!0}else{u!==t&&r.addClass(u,c);f=!1}n.sortFunction?n.sortFunction=n.sortFunction:n.sortFunction=function(e,t){return r.sorter.alphanum(e.values()[s].toLowerCase(),t.values()[s].toLowerCase(),f)};o.items.sort(n.sortFunction);o.update()};this.search=function(e,n){o.i=1;var r=[],i,s,a,f,l,n=n===t?o.items[0].values():n,e=e===t?"":e,c=e.target||e.srcElement;e=c===t?(""+e).toLowerCase():""+c.value.toLowerCase();l=o.items;e=e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");u.clear();if(e===""){g.search();o.searched=!1;o.update()}else{o.searched=!0;for(var h=0,p=l.length;h<p;h++){i=!1;s=l[h];f=s.values();for(var d in n)if(f.hasOwnProperty(d)&&n[d]!==null){a=f[d]!=null?f[d].toString().toLowerCase():"";e!==""&&a.search(e)>-1&&(i=!0)}if(i){s.found=!0;r.push(s)}else s.found=!1}o.update()}return o.visibleItems};this.filter=function(e){o.i=1;g.filter();if(e===t)o.filtered=!1;else{o.filtered=!0;var n=o.items;for(var r=0,i=n.length;r<i;r++){var s=n[r];e(s)?s.filtered=!0:s.filtered=!1}}o.update();return o.visibleItems};this.size=function(){return o.items.length};this.clear=function(){u.clear();o.items=[]};this.on=function(e,t){d[e].push(t)};var m=function(e){var t=d[e].length;while(t--)d[e][t]()},g={filter:function(){var e=o.items,t=e.length;while(t--)e[t].filtered=!1},search:function(){var e=o.items,t=e.length;while(t--)e[t].found=!1}};this.update=function(){var e=o.items,t=e.length;o.visibleItems=[];o.matchingItems=[];u.clear();for(var n=0;n<t;n++)if(e[n].matching()&&o.matchingItems.length+1>=o.i&&o.visibleItems.length<o.page){e[n].show();o.visibleItems.push(e[n]);o.matchingItems.push(e[n])}else if(e[n].matching()){o.matchingItems.push(e[n]);e[n].hide()}else e[n].hide();m("updated")};l=function(e,n,r){var i=this,s={};this.found=!1;this.filtered=!1;var a=function(e,n,r){if(n===t)r?i.values(e,r):i.values(e);else{i.elm=n;var s=u.get(i,e);i.values(s)}};this.values=function(e,n){if(e===t)return s;for(var r in e)s[r]=e[r];n!==!0&&u.set(i,i.values())};this.show=function(){u.show(i)};this.hide=function(){u.hide(i)};this.matching=function(){return o.filtered&&o.searched&&i.found&&i.filtered||o.filtered&&!o.searched&&i.filtered||!o.filtered&&o.searched&&i.found||!o.filtered&&!o.searched};this.visible=function(){return i.elm.parentNode?!0:!1};a(e,n,r)};c=function(e,n){n.engine===t?n.engine="standard":n.engine=n.engine.toLowerCase();return new o.constructor.prototype.templateEngines[n.engine](e,n)};a.start(s,i)};i.prototype.templateEngines={};i.prototype.plugins={};i.prototype.templateEngines.standard=function(e,i){function a(e){if(e===t){var r=s.childNodes,o=[];for(var u=0,a=r.length;u<a;u++)if(r[u].data===t)return r[u];return null}if(e.indexOf("<")!==-1){var f=n.createElement("div");f.innerHTML=e;return f.firstChild}return n.getElementById(i.item)}var s=r.getByClass(i.listClass,e.listContainer,!0),o=a(i.item),u=this,f={created:function(e){e.elm===t&&u.create(e)}};this.get=function(e,t){f.created(e);var n={};for(var i=0,s=t.length;i<s;i++){var o=r.getByClass(t[i],e.elm,!0);n[t[i]]=o?o.innerHTML:""}return n};this.set=function(e,t){f.created(e);for(var n in t)if(t.hasOwnProperty(n)){var i=r.getByClass(n,e.elm,!0);i&&(i.innerHTML=t[n])}};this.create=function(e){if(e.elm!==t)return;var n=o.cloneNode(!0);n.id="";e.elm=n;u.set(e,e.values())};this.remove=function(e){s.removeChild(e.elm)};this.show=function(e){f.created(e);s.appendChild(e.elm)};this.hide=function(e){e.elm!==t&&e.elm.parentNode===s&&s.removeChild(e.elm)};this.clear=function(){if(s.hasChildNodes())while(s.childNodes.length>=1)s.removeChild(s.firstChild)}};r={getByClass:function(){return n.getElementsByClassName?function(e,t,n){return n?t.getElementsByClassName(e)[0]:t.getElementsByClassName(e)}:function(e,t,r){var i=[],s="*";t==null&&(t=n);var o=t.getElementsByTagName(s),u=o.length,a=new RegExp("(^|\\s)"+e+"(\\s|$)");for(var f=0,l=0;f<u;f++)if(a.test(o[f].className)){if(r)return o[f];i[l]=o[f];l++}return i}}(),addEvent:function(e,n){if(n.addEventListener)return function(n,i,s){if(n&&!(n instanceof Array)&&!n.length&&!r.isNodeList(n)&&n.length!==0||n===e)n.addEventListener(i,s,!1);else if(n&&n[0]!==t){var o=n.length;for(var u=0;u<o;u++)r.addEvent(n[u],i,s)}};if(n.attachEvent)return function(n,i,s){if(n&&!(n instanceof Array)&&!n.length&&!r.isNodeList(n)&&n.length!==0||n===e)n.attachEvent("on"+i,function(){return s.call(n,e.event)});else if(n&&n[0]!==t){var o=n.length;for(var u=0;u<o;u++)r.addEvent(n[u],i,s)}}}(this,n),getAttribute:function(e,n){var r=e.getAttribute&&e.getAttribute(n)||null;if(!r){var i=e.attributes,s=i.length;for(var o=0;o<s;o++)n[o]!==t&&n[o].nodeName===n&&(r=n[o].nodeValue)}return r},isNodeList:function(e){var t=Object.prototype.toString.call(e);return typeof e=="object"&&/^\[object (HTMLCollection|NodeList|Object)\]$/.test(t)&&(e.length==0||typeof e[0]=="object"&&e[0].nodeType>0)?!0:!1},hasClass:function(e,t){var n=this.getAttribute(e,"class")||this.getAttribute(e,"className")||"";return n.search(t)>-1},addClass:function(e,t){if(!this.hasClass(e,t)){var n=this.getAttribute(e,"class")||this.getAttribute(e,"className")||"";n=n+" "+t+" ";n=n.replace(/\s{2,}/g," ");e.setAttribute("class",n)}},removeClass:function(e,t){if(this.hasClass(e,t)){var n=this.getAttribute(e,"class")||this.getAttribute(e,"className")||"";n=n.replace(t,"");e.setAttribute("class",n)}},sorter:{alphanum:function(e,t,n){e||(e=" ");t||(t=" ");e=e.toString().replace(/&(lt|gt);/g,function(e,t){return t=="lt"?"<":">"});e=e.replace(/<\/?[^>]+(>|$)/g,"");t=t.toString().replace(/&(lt|gt);/g,function(e,t){return t=="lt"?"<":">"});t=t.replace(/<\/?[^>]+(>|$)/g,"");var r=this.chunkify(e),i=this.chunkify(t);for(var s=0;r[s]&&i[s];s++)if(r[s]!==i[s]){var o=Number(r[s]),u=Number(i[s]);return n?o==r[s]&&u==i[s]?o-u:r[s]>i[s]?1:-1:o==r[s]&&u==i[s]?u-o:r[s]>i[s]?-1:1}return r.length-i.length},chunkify:function(e){var t=[],n=0,r=-1,i=0,s,o;while(s=(o=e.charAt(n++)).charCodeAt(0)){var u=s==45||s==46||s>=48&&s<=57;if(u!==i){t[++r]="";i=u}t[r]+=o}return t}}};e.List=i;e.ListJsHelpers=r})(window);