snipe-it/public/js/build/vendor.js

21 lines
607 KiB
JavaScript

if("undefined"==typeof jQuery)throw new Error("AdminLTE requires jQuery");!function(t){"use strict";function e(e,i){if(this.element=e,this.options=i,this.$overlay=t(i.overlayTemplate),""===i.source)throw new Error("Source url was not defined. Please specify a url in your BoxRefresh source option.");this._setUpListeners(),this.load()}function i(i){return this.each(function(){var o=t(this),a=o.data(n);if(!a){var r=t.extend({},s,o.data(),"object"==typeof i&&i);o.data(n,a=new e(o,r))}if("string"==typeof a){if(void 0===a[i])throw new Error("No method named "+i);a[i]()}})}var n="lte.boxrefresh",s={source:"",params:{},trigger:".refresh-btn",content:".box-body",loadInContent:!0,responseType:"",overlayTemplate:'<div class="overlay"><div class="fa fa-refresh fa-spin"></div></div>',onLoadStart:function(){},onLoadDone:function(t){return t}};e.prototype.load=function(){this._addOverlay(),this.options.onLoadStart.call(t(this)),t.get(this.options.source,this.options.params,function(e){this.options.loadInContent&&t(this.element).find(this.options.content).html(e),this.options.onLoadDone.call(t(this),e),this._removeOverlay()}.bind(this),""!==this.options.responseType&&this.options.responseType)},e.prototype._setUpListeners=function(){t(this.element).on("click",this.options.trigger,function(t){t&&t.preventDefault(),this.load()}.bind(this))},e.prototype._addOverlay=function(){t(this.element).append(this.$overlay)},e.prototype._removeOverlay=function(){t(this.$overlay).remove()};var o=t.fn.boxRefresh;t.fn.boxRefresh=i,t.fn.boxRefresh.Constructor=e,t.fn.boxRefresh.noConflict=function(){return t.fn.boxRefresh=o,this},t(window).on("load",function(){t('[data-widget="box-refresh"]').each(function(){i.call(t(this))})})}(jQuery),function(t){"use strict";function e(t,e){this.element=t,this.options=e,this._setUpListeners()}function i(i){return this.each(function(){var o=t(this),a=o.data(n);if(!a){var r=t.extend({},s,o.data(),"object"==typeof i&&i);o.data(n,a=new e(o,r))}if("string"==typeof i){if(void 0===a[i])throw new Error("No method named "+i);a[i]()}})}var n="lte.boxwidget",s={animationSpeed:500,collapseTrigger:'[data-widget="collapse"]',removeTrigger:'[data-widget="remove"]',collapseIcon:"fa-minus",expandIcon:"fa-plus",removeIcon:"fa-times"},o=".box-header",a=".box-body",r=".box-footer",l=".box-tools",h="collapsed-box";e.prototype.toggle=function(){t(this.element).is(".collapsed-box")?this.expand():this.collapse()},e.prototype.expand=function(){var e=t.Event("expanded.boxwidget"),i=t.Event("expanding.boxwidget"),n=this.options.collapseIcon,s=this.options.expandIcon;t(this.element).removeClass(h),t(this.element).children(o+", "+a+", "+r).children(l).find("."+s).removeClass(s).addClass(n),t(this.element).children(a+", "+r).slideDown(this.options.animationSpeed,function(){t(this.element).trigger(e)}.bind(this)).trigger(i)},e.prototype.collapse=function(){var e=t.Event("collapsed.boxwidget"),i=t.Event("collapsing.boxwidget"),n=this.options.collapseIcon,s=this.options.expandIcon;t(this.element).children(o+", "+a+", "+r).children(l).find("."+n).removeClass(n).addClass(s),t(this.element).children(a+", "+r).slideUp(this.options.animationSpeed,function(){t(this.element).addClass(h),t(this.element).trigger(e)}.bind(this)).trigger(i)},e.prototype.remove=function(){var e=t.Event("removed.boxwidget"),i=t.Event("removing.boxwidget");t(this.element).slideUp(this.options.animationSpeed,function(){t(this.element).trigger(e),t(this.element).remove()}.bind(this)).trigger(i)},e.prototype._setUpListeners=function(){var e=this;t(this.element).on("click",this.options.collapseTrigger,function(i){return i&&i.preventDefault(),e.toggle(t(this)),!1}),t(this.element).on("click",this.options.removeTrigger,function(i){return i&&i.preventDefault(),e.remove(t(this)),!1})};var u=t.fn.boxWidget;t.fn.boxWidget=i,t.fn.boxWidget.Constructor=e,t.fn.boxWidget.noConflict=function(){return t.fn.boxWidget=u,this},t(window).on("load",function(){t(".box").each(function(){i.call(t(this))})})}(jQuery),function(t){"use strict";function e(t,e){this.element=t,this.options=e,this.hasBindedResize=!1,this.init()}function i(i){return this.each(function(){var o=t(this),a=o.data(n);if(!a){var r=t.extend({},s,o.data(),"object"==typeof i&&i);o.data(n,a=new e(o,r))}"string"==typeof i&&a.toggle()})}var n="lte.controlsidebar",s={controlsidebarSlide:!0},o=".control-sidebar",a='[data-toggle="control-sidebar"]',r=".control-sidebar-open",l="control-sidebar-open",h="control-sidebar-hold-transition";e.prototype.init=function(){t(this.element).is(a)||t(this).on("click",this.toggle),this.fix(),t(window).resize(function(){this.fix()}.bind(this))},e.prototype.toggle=function(e){e&&e.preventDefault(),this.fix(),t(o).is(r)||t("body").is(r)?this.collapse():this.expand()},e.prototype.expand=function(){t(o).show(),this.options.controlsidebarSlide?t(o).addClass(l):t("body").addClass(h).addClass(l).delay(50).queue(function(){t("body").removeClass(h),t(this).dequeue()}),t(this.element).trigger(t.Event("expanded.controlsidebar"))},e.prototype.collapse=function(){this.options.controlsidebarSlide?t(o).removeClass(l):t("body").addClass(h).removeClass(l).delay(50).queue(function(){t("body").removeClass(h),t(this).dequeue()}),t(o).fadeOut(),t(this.element).trigger(t.Event("collapsed.controlsidebar"))},e.prototype.fix=function(){t("body").is(".layout-boxed")&&this._fixForBoxed(t(".control-sidebar-bg"))},e.prototype._fixForBoxed=function(e){e.css({position:"absolute",height:t(".wrapper").height()})};var u=t.fn.controlSidebar;t.fn.controlSidebar=i,t.fn.controlSidebar.Constructor=e,t.fn.controlSidebar.noConflict=function(){return t.fn.controlSidebar=u,this},t(document).on("click",a,function(e){e&&e.preventDefault(),i.call(t(this),"toggle")})}(jQuery),function(t){"use strict";function e(t){this.element=t}function i(i){return this.each(function(){var s=t(this),o=s.data(n);o||s.data(n,o=new e(s)),"string"==typeof i&&o.toggle(s)})}var n="lte.directchat";e.prototype.toggle=function(t){t.parents(".direct-chat").first().toggleClass("direct-chat-contacts-open")};var s=t.fn.directChat;t.fn.directChat=i,t.fn.directChat.Constructor=e,t.fn.directChat.noConflict=function(){return t.fn.directChat=s,this},t(document).on("click",'[data-widget="chat-pane-toggle"]',function(e){e&&e.preventDefault(),i.call(t(this),"toggle")})}(jQuery),function(t){"use strict";function e(t){this.options=t,this.init()}function i(i){return this.each(function(){var o=t(this),a=o.data(n);if(!a){var r=t.extend({},s,o.data(),"object"==typeof i&&i);o.data(n,a=new e(r))}"toggle"===i&&a.toggle()})}var n="lte.pushmenu",s={collapseScreenSize:767,expandOnHover:!1,expandTransitionDelay:200},o='[data-toggle="push-menu"]',a=".sidebar-mini",r="sidebar-collapse",l="sidebar-open",h="sidebar-expanded-on-hover",u="expanded.pushMenu",c="collapsed.pushMenu";e.prototype.init=function(){(this.options.expandOnHover||t("body").is(a+".fixed"))&&(this.expandOnHover(),t("body").addClass("sidebar-mini-expand-feature")),t(".content-wrapper").click(function(){t(window).width()<=this.options.collapseScreenSize&&t("body").hasClass(l)&&this.close()}.bind(this)),t(".sidebar-form .form-control").click(function(t){t.stopPropagation()})},e.prototype.toggle=function(){var e=t(window).width(),i=!t("body").hasClass(r);e<=this.options.collapseScreenSize&&(i=t("body").hasClass(l)),i?this.close():this.open()},e.prototype.open=function(){t(window).width()>this.options.collapseScreenSize?t("body").removeClass(r).trigger(t.Event(u)):t("body").addClass(l).trigger(t.Event(u))},e.prototype.close=function(){t(window).width()>this.options.collapseScreenSize?t("body").addClass(r).trigger(t.Event(c)):t("body").removeClass(l+" "+r).trigger(t.Event(c))},e.prototype.expandOnHover=function(){t(".main-sidebar").hover(function(){t("body").is(a+".sidebar-collapse")&&t(window).width()>this.options.collapseScreenSize&&this.expand()}.bind(this),function(){t("body").is(".sidebar-expanded-on-hover")&&this.collapse()}.bind(this))},e.prototype.expand=function(){setTimeout(function(){t("body").removeClass(r).addClass(h)},this.options.expandTransitionDelay)},e.prototype.collapse=function(){setTimeout(function(){t("body").removeClass(h).addClass(r)},this.options.expandTransitionDelay)};var d=t.fn.pushMenu;t.fn.pushMenu=i,t.fn.pushMenu.Constructor=e,t.fn.pushMenu.noConflict=function(){return t.fn.pushMenu=d,this},t(document).on("click",o,function(e){e.preventDefault(),i.call(t(this),"toggle")}),t(window).on("load",function(){i.call(t(o))})}(jQuery),function(t){"use strict";function e(t,e){this.element=t,this.options=e,this._setUpListeners()}function i(i){return this.each(function(){var o=t(this),a=o.data(n);if(!a){var r=t.extend({},s,o.data(),"object"==typeof i&&i);o.data(n,a=new e(o,r))}if("string"==typeof a){if(void 0===a[i])throw new Error("No method named "+i);a[i]()}})}var n="lte.todolist",s={onCheck:function(t){return t},onUnCheck:function(t){return t}},o={data:'[data-widget="todo-list"]'};e.prototype.toggle=function(t){t.parents(o.li).first().toggleClass("done"),t.prop("checked")?this.check(t):this.unCheck(t)},e.prototype.check=function(t){this.options.onCheck.call(t)},e.prototype.unCheck=function(t){this.options.onUnCheck.call(t)},e.prototype._setUpListeners=function(){var e=this;t(this.element).on("change ifChanged","input:checkbox",function(){e.toggle(t(this))})};var a=t.fn.todoList;t.fn.todoList=i,t.fn.todoList.Constructor=e,t.fn.todoList.noConflict=function(){return t.fn.todoList=a,this},t(window).on("load",function(){t(o.data).each(function(){i.call(t(this))})})}(jQuery),function(t){"use strict";function e(e,i){this.element=e,this.options=i,t(this.element).addClass(h),t(o+r,this.element).addClass(l),this._setUpListeners()}function i(i){return this.each(function(){var o=t(this);if(!o.data(n)){var a=t.extend({},s,o.data(),"object"==typeof i&&i);o.data(n,new e(o,a))}})}var n="lte.tree",s={animationSpeed:500,accordion:!0,followLink:!1,trigger:".treeview a"},o=".treeview",a=".treeview-menu",r=".active",l="menu-open",h="tree";e.prototype.toggle=function(t,e){var i=t.next(a),n=t.parent(),s=n.hasClass(l);n.is(o)&&(this.options.followLink&&"#"!==t.attr("href")||e.preventDefault(),s?this.collapse(i,n):this.expand(i,n))},e.prototype.expand=function(e,i){var n=t.Event("expanded.tree");if(this.options.accordion){var s=i.siblings(".menu-open, .active"),o=s.children(a);this.collapse(o,s)}i.addClass(l),e.stop().slideDown(this.options.animationSpeed,function(){t(this.element).trigger(n),i.height("auto")}.bind(this))},e.prototype.collapse=function(e,i){var n=t.Event("collapsed.tree");i.removeClass(l),e.stop().slideUp(this.options.animationSpeed,function(){t(this.element).trigger(n),i.find(o).removeClass(l).find(a).hide()}.bind(this))},e.prototype._setUpListeners=function(){var e=this;t(this.element).on("click",this.options.trigger,function(i){e.toggle(t(this),i)})};var u=t.fn.tree;t.fn.tree=i,t.fn.tree.Constructor=e,t.fn.tree.noConflict=function(){return t.fn.tree=u,this},t(window).on("load",function(){t('[data-widget="tree"]').each(function(){i.call(t(this))})})}(jQuery),function(t){"use strict";function e(t){this.options=t,this.bindedResize=!1,this.activate()}function i(i){return this.each(function(){var o=t(this),a=o.data(n);if(!a){var r=t.extend({},s,o.data(),"object"==typeof i&&i);o.data(n,a=new e(r))}if("string"==typeof i){if(void 0===a[i])throw new Error("No method named "+i);a[i]()}})}var n="lte.layout",s={slimscroll:!0,resetHeight:!0},o=".wrapper",a=".content-wrapper",r=".main-header",l=".sidebar",h=".sidebar-menu",u="fixed";e.prototype.activate=function(){this.fix(),this.fixSidebar(),t("body").removeClass("hold-transition"),this.options.resetHeight&&t("body, html, "+o).css({height:"auto","min-height":"100%"}),this.bindedResize||(t(window).resize(function(){this.fix(),this.fixSidebar(),t(".main-header .logo, "+l).one("webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",function(){this.fix(),this.fixSidebar()}.bind(this))}.bind(this)),this.bindedResize=!0),t(h).on("expanded.tree",function(){this.fix(),this.fixSidebar()}.bind(this)),t(h).on("collapsed.tree",function(){this.fix(),this.fixSidebar()}.bind(this))},e.prototype.fix=function(){t(".layout-boxed > "+o).css("overflow","hidden");var e=t(".main-footer").outerHeight()||0,i=t(r).outerHeight()||0,n=i+e,s=t(window).height(),h=t(l).outerHeight()||0;if(t("body").hasClass(u))t(a).css("min-height",s-e);else{var c;c=h+i<=s?(t(a).css("min-height",s-n),s-n):(t(a).css("min-height",h),h);var d=t(".control-sidebar");void 0!==d&&d.height()>c&&t(a).css("min-height",d.height())}},e.prototype.fixSidebar=function(){t("body").hasClass(u)?this.options.slimscroll&&void 0!==t.fn.slimScroll&&0===t(".main-sidebar").find("slimScrollDiv").length&&t(l).slimScroll({height:t(window).height()-t(r).height()+"px"}):void 0!==t.fn.slimScroll&&t(l).slimScroll({destroy:!0}).height("auto")};var c=t.fn.layout;t.fn.layout=i,t.fn.layout.Constuctor=e,t.fn.layout.noConflict=function(){return t.fn.layout=c,this},t(window).on("load",function(){i.call(t("body"))})}(jQuery),function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.Tether=e()}(this,function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t){var i=t.getBoundingClientRect(),n={};for(var s in i)n[s]=i[s];try{if(t.ownerDocument!==document){var o=t.ownerDocument.defaultView.frameElement;if(o){var a=e(o);n.top+=a.top,n.bottom+=a.top,n.left+=a.left,n.right+=a.left}}}catch(t){}return n}function i(t){var e=getComputedStyle(t)||{},i=e.position,n=[];if("fixed"===i)return[t];for(var s=t;(s=s.parentNode)&&s&&1===s.nodeType;){var o=void 0;try{o=getComputedStyle(s)}catch(t){}if(void 0===o||null===o)return n.push(s),n;var a=o,r=a.overflow,l=a.overflowX;/(auto|scroll|overlay)/.test(r+a.overflowY+l)&&("absolute"!==i||["relative","absolute","fixed"].indexOf(o.position)>=0)&&n.push(s)}return n.push(t.ownerDocument.body),t.ownerDocument!==document&&n.push(t.ownerDocument.defaultView),n}function n(){w&&document.body.removeChild(w),w=null}function s(t){var i=void 0;t===document?(i=document,t=document.documentElement):i=t.ownerDocument;var n=i.documentElement,s=e(t),o=D();return s.top-=o.top,s.left-=o.left,void 0===s.width&&(s.width=document.body.scrollWidth-s.left-s.right),void 0===s.height&&(s.height=document.body.scrollHeight-s.top-s.bottom),s.top=s.top-n.clientTop,s.left=s.left-n.clientLeft,s.right=i.body.clientWidth-s.width-s.left,s.bottom=i.body.clientHeight-s.height-s.top,s}function o(t){return t.offsetParent||document.documentElement}function a(){if(M)return M;var t=document.createElement("div");t.style.width="100%",t.style.height="200px";var e=document.createElement("div");r(e.style,{position:"absolute",top:0,left:0,pointerEvents:"none",visibility:"hidden",width:"200px",height:"150px",overflow:"hidden"}),e.appendChild(t),document.body.appendChild(e);var i=t.offsetWidth;e.style.overflow="scroll";var n=t.offsetWidth;i===n&&(n=e.clientWidth),document.body.removeChild(e);var s=i-n;return M={width:s,height:s}}function r(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],e=[];return Array.prototype.push.apply(e,arguments),e.slice(1).forEach(function(e){if(e)for(var i in e)({}).hasOwnProperty.call(e,i)&&(t[i]=e[i])}),t}function l(t,e){if(void 0!==t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.remove(e)});else{var i=new RegExp("(^| )"+e.split(" ").join("|")+"( |$)","gi"),n=c(t).replace(i," ");d(t,n)}}function h(t,e){if(void 0!==t.classList)e.split(" ").forEach(function(e){e.trim()&&t.classList.add(e)});else{l(t,e);var i=c(t)+" "+e;d(t,i)}}function u(t,e){if(void 0!==t.classList)return t.classList.contains(e);var i=c(t);return new RegExp("(^| )"+e+"( |$)","gi").test(i)}function c(t){return t.className instanceof t.ownerDocument.defaultView.SVGAnimatedString?t.className.baseVal:t.className}function d(t,e){t.setAttribute("class",e)}function f(t,e,i){i.forEach(function(i){-1===e.indexOf(i)&&u(t,i)&&l(t,i)}),e.forEach(function(e){u(t,e)||h(t,e)})}function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function g(t,e){var i=arguments.length<=2||void 0===arguments[2]?1:arguments[2];return t+i>=e&&e>=t-i}function m(){return"object"==typeof performance&&"function"==typeof performance.now?performance.now():+new Date}function v(){for(var t={top:0,left:0},e=arguments.length,i=Array(e),n=0;n<e;n++)i[n]=arguments[n];return i.forEach(function(e){var i=e.top,n=e.left;"string"==typeof i&&(i=parseFloat(i,10)),"string"==typeof n&&(n=parseFloat(n,10)),t.top+=i,t.left+=n}),t}function b(t,e){return"string"==typeof t.left&&-1!==t.left.indexOf("%")&&(t.left=parseFloat(t.left,10)/100*e.width),"string"==typeof t.top&&-1!==t.top.indexOf("%")&&(t.top=parseFloat(t.top,10)/100*e.height),t}function _(t,e){return"scrollParent"===e?e=t.scrollParents[0]:"window"===e&&(e=[pageXOffset,pageYOffset,innerWidth+pageXOffset,innerHeight+pageYOffset]),e===document&&(e=e.documentElement),void 0!==e.nodeType&&function(){var t=e,i=s(e),n=i,o=getComputedStyle(e);if(e=[n.left,n.top,i.width+n.left,i.height+n.top],t.ownerDocument!==document){var a=t.ownerDocument.defaultView;e[0]+=a.pageXOffset,e[1]+=a.pageYOffset,e[2]+=a.pageXOffset,e[3]+=a.pageYOffset}q.forEach(function(t,i){t=t[0].toUpperCase()+t.substr(1),"Top"===t||"Left"===t?e[i]+=parseFloat(o["border"+t+"Width"]):e[i]-=parseFloat(o["border"+t+"Width"])})}(),e}var y=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),x=void 0;void 0===x&&(x={modules:[]});var w=null,k=function(){var t=0;return function(){return++t}}(),C={},D=function(){var t=w;t&&document.body.contains(t)||(t=document.createElement("div"),t.setAttribute("data-tether-id",k()),r(t.style,{top:0,left:0,position:"absolute"}),document.body.appendChild(t),w=t);var i=t.getAttribute("data-tether-id");return void 0===C[i]&&(C[i]=e(t),T(function(){delete C[i]})),C[i]},M=null,S=[],T=function(t){S.push(t)},I=function(){for(var t=void 0;t=S.pop();)t()},P=function(){function e(){t(this,e)}return y(e,[{key:"on",value:function(t,e,i){var n=!(arguments.length<=3||void 0===arguments[3])&&arguments[3];void 0===this.bindings&&(this.bindings={}),void 0===this.bindings[t]&&(this.bindings[t]=[]),this.bindings[t].push({handler:e,ctx:i,once:n})}},{key:"once",value:function(t,e,i){this.on(t,e,i,!0)}},{key:"off",value:function(t,e){if(void 0!==this.bindings&&void 0!==this.bindings[t])if(void 0===e)delete this.bindings[t];else for(var i=0;i<this.bindings[t].length;)this.bindings[t][i].handler===e?this.bindings[t].splice(i,1):++i}},{key:"trigger",value:function(t){if(void 0!==this.bindings&&this.bindings[t]){for(var e=0,i=arguments.length,n=Array(i>1?i-1:0),s=1;s<i;s++)n[s-1]=arguments[s];for(;e<this.bindings[t].length;){var o=this.bindings[t][e],a=o.handler,r=o.ctx,l=o.once,h=r;void 0===h&&(h=this),a.apply(h,n),l?this.bindings[t].splice(e,1):++e}}}}]),e}();x.Utils={getActualBoundingClientRect:e,getScrollParents:i,getBounds:s,getOffsetParent:o,extend:r,addClass:h,removeClass:l,hasClass:u,updateClasses:f,defer:T,flush:I,uniqueId:k,Evented:P,getScrollBarSize:a,removeUtilElements:n};var A=function(){function t(t,e){var i=[],n=!0,s=!1,o=void 0;try{for(var a,r=t[Symbol.iterator]();!(n=(a=r.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){s=!0,o=t}finally{try{!n&&r.return&&r.return()}finally{if(s)throw o}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),y=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}(),F=function(t,e,i){for(var n=!0;n;){var s=t,o=e,a=i;n=!1,null===s&&(s=Function.prototype);var r=Object.getOwnPropertyDescriptor(s,o);if(void 0!==r){if("value"in r)return r.value;var l=r.get;if(void 0===l)return;return l.call(a)}var h=Object.getPrototypeOf(s);if(null===h)return;t=h,e=o,i=a,n=!0,r=h=void 0}};if(void 0===x)throw new Error("You must include the utils.js file before tether.js");var O=x.Utils,i=O.getScrollParents,s=O.getBounds,o=O.getOffsetParent,r=O.extend,h=O.addClass,l=O.removeClass,f=O.updateClasses,T=O.defer,I=O.flush,a=O.getScrollBarSize,n=O.removeUtilElements,E=function(){if("undefined"==typeof document)return"";for(var t=document.createElement("div"),e=["transform","WebkitTransform","OTransform","MozTransform","msTransform"],i=0;i<e.length;++i){var n=e[i];if(void 0!==t.style[n])return n}}(),N=[],z=function(){N.forEach(function(t){t.position(!1)}),I()};!function(){var t=null,e=null,i=null,n=function n(){if(void 0!==e&&e>16)return e=Math.min(e-16,250),void(i=setTimeout(n,250));void 0!==t&&m()-t<10||(null!=i&&(clearTimeout(i),i=null),t=m(),z(),e=m()-t)};"undefined"!=typeof window&&void 0!==window.addEventListener&&["resize","scroll","touchmove"].forEach(function(t){window.addEventListener(t,n)})}();var L={center:"center",left:"right",right:"left"},H={middle:"middle",top:"bottom",bottom:"top"},R={top:0,left:0,middle:"50%",center:"50%",bottom:"100%",right:"100%"},W=function(t,e){var i=t.left,n=t.top;return"auto"===i&&(i=L[e.left]),"auto"===n&&(n=H[e.top]),{left:i,top:n}},B=function(t){var e=t.left,i=t.top;return void 0!==R[t.left]&&(e=R[t.left]),void 0!==R[t.top]&&(i=R[t.top]),{left:e,top:i}},V=function(t){var e=t.split(" "),i=A(e,2);return{top:i[0],left:i[1]}},U=V,j=function(e){function u(e){var i=this;t(this,u),F(Object.getPrototypeOf(u.prototype),"constructor",this).call(this),this.position=this.position.bind(this),N.push(this),this.history=[],this.setOptions(e,!1),x.modules.forEach(function(t){void 0!==t.initialize&&t.initialize.call(i)}),this.position()}return p(u,e),y(u,[{key:"getClass",value:function(){var t=arguments.length<=0||void 0===arguments[0]?"":arguments[0],e=this.options.classes;return void 0!==e&&e[t]?this.options.classes[t]:this.options.classPrefix?this.options.classPrefix+"-"+t:t}},{key:"setOptions",value:function(t){var e=this,n=arguments.length<=1||void 0===arguments[1]||arguments[1],s={offset:"0 0",targetOffset:"0 0",targetAttachment:"auto auto",classPrefix:"tether"};this.options=r(s,t);var o=this.options,a=o.element,l=o.target,u=o.targetModifier;if(this.element=a,this.target=l,this.targetModifier=u,"viewport"===this.target?(this.target=document.body,this.targetModifier="visible"):"scroll-handle"===this.target&&(this.target=document.body,this.targetModifier="scroll-handle"),["element","target"].forEach(function(t){if(void 0===e[t])throw new Error("Tether Error: Both element and target must be defined");void 0!==e[t].jquery?e[t]=e[t][0]:"string"==typeof e[t]&&(e[t]=document.querySelector(e[t]))}),h(this.element,this.getClass("element")),!1!==this.options.addTargetClasses&&h(this.target,this.getClass("target")),!this.options.attachment)throw new Error("Tether Error: You must provide an attachment");this.targetAttachment=U(this.options.targetAttachment),this.attachment=U(this.options.attachment),this.offset=V(this.options.offset),this.targetOffset=V(this.options.targetOffset),void 0!==this.scrollParents&&this.disable(),"scroll-handle"===this.targetModifier?this.scrollParents=[this.target]:this.scrollParents=i(this.target),!1!==this.options.enabled&&this.enable(n)}},{key:"getTargetBounds",value:function(){if(void 0===this.targetModifier)return s(this.target);if("visible"===this.targetModifier){if(this.target===document.body)return{top:pageYOffset,left:pageXOffset,height:innerHeight,width:innerWidth};var t=s(this.target),e={height:t.height,width:t.width,top:t.top,left:t.left};return e.height=Math.min(e.height,t.height-(pageYOffset-t.top)),e.height=Math.min(e.height,t.height-(t.top+t.height-(pageYOffset+innerHeight))),e.height=Math.min(innerHeight,e.height),e.height-=2,e.width=Math.min(e.width,t.width-(pageXOffset-t.left)),e.width=Math.min(e.width,t.width-(t.left+t.width-(pageXOffset+innerWidth))),e.width=Math.min(innerWidth,e.width),e.width-=2,e.top<pageYOffset&&(e.top=pageYOffset),e.left<pageXOffset&&(e.left=pageXOffset),e}if("scroll-handle"===this.targetModifier){var t=void 0,i=this.target;i===document.body?(i=document.documentElement,t={left:pageXOffset,top:pageYOffset,height:innerHeight,width:innerWidth}):t=s(i);var n=getComputedStyle(i),o=i.scrollWidth>i.clientWidth||[n.overflow,n.overflowX].indexOf("scroll")>=0||this.target!==document.body,a=0;o&&(a=15);var r=t.height-parseFloat(n.borderTopWidth)-parseFloat(n.borderBottomWidth)-a,e={width:15,height:.975*r*(r/i.scrollHeight),left:t.left+t.width-parseFloat(n.borderLeftWidth)-15},l=0;r<408&&this.target===document.body&&(l=-11e-5*Math.pow(r,2)-.00727*r+22.58),this.target!==document.body&&(e.height=Math.max(e.height,24));var h=this.target.scrollTop/(i.scrollHeight-r);return e.top=h*(r-e.height-l)+t.top+parseFloat(n.borderTopWidth),this.target===document.body&&(e.height=Math.max(e.height,24)),e}}},{key:"clearCache",value:function(){this._cache={}}},{key:"cache",value:function(t,e){return void 0===this._cache&&(this._cache={}),void 0===this._cache[t]&&(this._cache[t]=e.call(this)),this._cache[t]}},{key:"enable",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];!1!==this.options.addTargetClasses&&h(this.target,this.getClass("enabled")),h(this.element,this.getClass("enabled")),this.enabled=!0,this.scrollParents.forEach(function(e){e!==t.target.ownerDocument&&e.addEventListener("scroll",t.position)}),e&&this.position()}},{key:"disable",value:function(){var t=this;l(this.target,this.getClass("enabled")),l(this.element,this.getClass("enabled")),this.enabled=!1,void 0!==this.scrollParents&&this.scrollParents.forEach(function(e){e.removeEventListener("scroll",t.position)})}},{key:"destroy",value:function(){var t=this;this.disable(),N.forEach(function(e,i){e===t&&N.splice(i,1)}),0===N.length&&n()}},{key:"updateAttachClasses",value:function(t,e){var i=this;t=t||this.attachment,e=e||this.targetAttachment;var n=["left","top","bottom","right","middle","center"];void 0!==this._addAttachClasses&&this._addAttachClasses.length&&this._addAttachClasses.splice(0,this._addAttachClasses.length),void 0===this._addAttachClasses&&(this._addAttachClasses=[]);var s=this._addAttachClasses;t.top&&s.push(this.getClass("element-attached")+"-"+t.top),t.left&&s.push(this.getClass("element-attached")+"-"+t.left),e.top&&s.push(this.getClass("target-attached")+"-"+e.top),e.left&&s.push(this.getClass("target-attached")+"-"+e.left);var o=[];n.forEach(function(t){o.push(i.getClass("element-attached")+"-"+t),o.push(i.getClass("target-attached")+"-"+t)}),T(function(){void 0!==i._addAttachClasses&&(f(i.element,i._addAttachClasses,o),!1!==i.options.addTargetClasses&&f(i.target,i._addAttachClasses,o),delete i._addAttachClasses)})}},{key:"position",value:function(){var t=this,e=arguments.length<=0||void 0===arguments[0]||arguments[0];if(this.enabled){this.clearCache();var i=W(this.targetAttachment,this.attachment);this.updateAttachClasses(this.attachment,i);var n=this.cache("element-bounds",function(){return s(t.element)}),r=n.width,l=n.height;if(0===r&&0===l&&void 0!==this.lastSize){var h=this.lastSize;r=h.width,l=h.height}else this.lastSize={width:r,height:l};var u=this.cache("target-bounds",function(){return t.getTargetBounds()}),c=u,d=b(B(this.attachment),{width:r,height:l}),f=b(B(i),c),p=b(this.offset,{width:r,height:l}),g=b(this.targetOffset,c);d=v(d,p),f=v(f,g);for(var m=u.left+f.left-d.left,_=u.top+f.top-d.top,y=0;y<x.modules.length;++y){var w=x.modules[y],k=w.position.call(this,{left:m,top:_,targetAttachment:i,targetPos:u,elementPos:n,offset:d,targetOffset:f,manualOffset:p,manualTargetOffset:g,scrollbarSize:S,attachment:this.attachment});if(!1===k)return!1;void 0!==k&&"object"==typeof k&&(_=k.top,m=k.left)}var C={page:{top:_,left:m},viewport:{top:_-pageYOffset,bottom:pageYOffset-_-l+innerHeight,left:m-pageXOffset,right:pageXOffset-m-r+innerWidth}},D=this.target.ownerDocument,M=D.defaultView,S=void 0;return M.innerHeight>D.documentElement.clientHeight&&(S=this.cache("scrollbar-size",a),C.viewport.bottom-=S.height),M.innerWidth>D.documentElement.clientWidth&&(S=this.cache("scrollbar-size",a),C.viewport.right-=S.width),-1!==["","static"].indexOf(D.body.style.position)&&-1!==["","static"].indexOf(D.body.parentElement.style.position)||(C.page.bottom=D.body.scrollHeight-_-l,C.page.right=D.body.scrollWidth-m-r),void 0!==this.options.optimizations&&!1!==this.options.optimizations.moveElement&&void 0===this.targetModifier&&function(){var e=t.cache("target-offsetparent",function(){return o(t.target)}),i=t.cache("target-offsetparent-bounds",function(){return s(e)}),n=getComputedStyle(e),a=i,r={};if(["Top","Left","Bottom","Right"].forEach(function(t){r[t.toLowerCase()]=parseFloat(n["border"+t+"Width"])}),i.right=D.body.scrollWidth-i.left-a.width+r.right,i.bottom=D.body.scrollHeight-i.top-a.height+r.bottom,C.page.top>=i.top+r.top&&C.page.bottom>=i.bottom&&C.page.left>=i.left+r.left&&C.page.right>=i.right){var l=e.scrollTop,h=e.scrollLeft;C.offset={top:C.page.top-i.top+l-r.top,left:C.page.left-i.left+h-r.left}}}(),this.move(C),this.history.unshift(C),this.history.length>3&&this.history.pop(),e&&I(),!0}}},{key:"move",value:function(t){var e=this;if(void 0!==this.element.parentNode){var i={};for(var n in t){i[n]={};for(var s in t[n]){for(var a=!1,l=0;l<this.history.length;++l){var h=this.history[l];if(void 0!==h[n]&&!g(h[n][s],t[n][s])){a=!0;break}}a||(i[n][s]=!0)}}var u={top:"",left:"",right:"",bottom:""},c=function(t,i){if(!1!==(void 0!==e.options.optimizations?e.options.optimizations.gpu:null)){var n=void 0,s=void 0;t.top?(u.top=0,n=i.top):(u.bottom=0,n=-i.bottom),t.left?(u.left=0,s=i.left):(u.right=0,s=-i.right),"number"==typeof window.devicePixelRatio&&devicePixelRatio%1==0&&(s=Math.round(s*devicePixelRatio)/devicePixelRatio,n=Math.round(n*devicePixelRatio)/devicePixelRatio),u[E]="translateX("+s+"px) translateY("+n+"px)","msTransform"!==E&&(u[E]+=" translateZ(0)")}else t.top?u.top=i.top+"px":u.bottom=i.bottom+"px",t.left?u.left=i.left+"px":u.right=i.right+"px"},d=!1;if((i.page.top||i.page.bottom)&&(i.page.left||i.page.right)?(u.position="absolute",c(i.page,t.page)):(i.viewport.top||i.viewport.bottom)&&(i.viewport.left||i.viewport.right)?(u.position="fixed",c(i.viewport,t.viewport)):void 0!==i.offset&&i.offset.top&&i.offset.left?function(){u.position="absolute";var n=e.cache("target-offsetparent",function(){return o(e.target)});o(e.element)!==n&&T(function(){e.element.parentNode.removeChild(e.element),n.appendChild(e.element)}),c(i.offset,t.offset),d=!0}():(u.position="absolute",c({top:!0,left:!0},t.page)),!d)if(this.options.bodyElement)this.element.parentNode!==this.options.bodyElement&&this.options.bodyElement.appendChild(this.element);else{for(var f=!0,p=this.element.parentNode;p&&1===p.nodeType&&"BODY"!==p.tagName&&!function(t){var e=t.ownerDocument;return(e.fullscreenElement||e.webkitFullscreenElement||e.mozFullScreenElement||e.msFullscreenElement)===t}(p);){if("static"!==getComputedStyle(p).position){f=!1;break}p=p.parentNode}f||(this.element.parentNode.removeChild(this.element),this.element.ownerDocument.body.appendChild(this.element))}var m={},v=!1;for(var s in u){var b=u[s];this.element.style[s]!==b&&(v=!0,m[s]=b)}v&&T(function(){r(e.element.style,m),e.trigger("repositioned")})}}}]),u}(P);j.modules=[],x.position=z;var Y=r(j,x),A=function(){function t(t,e){
var i=[],n=!0,s=!1,o=void 0;try{for(var a,r=t[Symbol.iterator]();!(n=(a=r.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){s=!0,o=t}finally{try{!n&&r.return&&r.return()}finally{if(s)throw o}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),O=x.Utils,s=O.getBounds,r=O.extend,f=O.updateClasses,T=O.defer,q=["left","top","right","bottom"];x.modules.push({position:function(t){var e=this,i=t.top,n=t.left,o=t.targetAttachment;if(!this.options.constraints)return!0;var a=this.cache("element-bounds",function(){return s(e.element)}),l=a.height,h=a.width;if(0===h&&0===l&&void 0!==this.lastSize){var u=this.lastSize;h=u.width,l=u.height}var c=this.cache("target-bounds",function(){return e.getTargetBounds()}),d=c.height,p=c.width,g=[this.getClass("pinned"),this.getClass("out-of-bounds")];this.options.constraints.forEach(function(t){var e=t.outOfBoundsClass,i=t.pinnedClass;e&&g.push(e),i&&g.push(i)}),g.forEach(function(t){["left","top","right","bottom"].forEach(function(e){g.push(t+"-"+e)})});var m=[],v=r({},o),b=r({},this.attachment);return this.options.constraints.forEach(function(t){var s=t.to,a=t.attachment,r=t.pin;void 0===a&&(a="");var u=void 0,c=void 0;if(a.indexOf(" ")>=0){var f=a.split(" "),g=A(f,2);c=g[0],u=g[1]}else u=c=a;var y=_(e,s);"target"!==c&&"both"!==c||(i<y[1]&&"top"===v.top&&(i+=d,v.top="bottom"),i+l>y[3]&&"bottom"===v.top&&(i-=d,v.top="top")),"together"===c&&("top"===v.top&&("bottom"===b.top&&i<y[1]?(i+=d,v.top="bottom",i+=l,b.top="top"):"top"===b.top&&i+l>y[3]&&i-(l-d)>=y[1]&&(i-=l-d,v.top="bottom",b.top="bottom")),"bottom"===v.top&&("top"===b.top&&i+l>y[3]?(i-=d,v.top="top",i-=l,b.top="bottom"):"bottom"===b.top&&i<y[1]&&i+(2*l-d)<=y[3]&&(i+=l-d,v.top="top",b.top="top")),"middle"===v.top&&(i+l>y[3]&&"top"===b.top?(i-=l,b.top="bottom"):i<y[1]&&"bottom"===b.top&&(i+=l,b.top="top"))),"target"!==u&&"both"!==u||(n<y[0]&&"left"===v.left&&(n+=p,v.left="right"),n+h>y[2]&&"right"===v.left&&(n-=p,v.left="left")),"together"===u&&(n<y[0]&&"left"===v.left?"right"===b.left?(n+=p,v.left="right",n+=h,b.left="left"):"left"===b.left&&(n+=p,v.left="right",n-=h,b.left="right"):n+h>y[2]&&"right"===v.left?"left"===b.left?(n-=p,v.left="left",n-=h,b.left="right"):"right"===b.left&&(n-=p,v.left="left",n+=h,b.left="left"):"center"===v.left&&(n+h>y[2]&&"left"===b.left?(n-=h,b.left="right"):n<y[0]&&"right"===b.left&&(n+=h,b.left="left"))),"element"!==c&&"both"!==c||(i<y[1]&&"bottom"===b.top&&(i+=l,b.top="top"),i+l>y[3]&&"top"===b.top&&(i-=l,b.top="bottom")),"element"!==u&&"both"!==u||(n<y[0]&&("right"===b.left?(n+=h,b.left="left"):"center"===b.left&&(n+=h/2,b.left="left")),n+h>y[2]&&("left"===b.left?(n-=h,b.left="right"):"center"===b.left&&(n-=h/2,b.left="right"))),"string"==typeof r?r=r.split(",").map(function(t){return t.trim()}):!0===r&&(r=["top","left","right","bottom"]),r=r||[];var x=[],w=[];i<y[1]&&(r.indexOf("top")>=0?(i=y[1],x.push("top")):w.push("top")),i+l>y[3]&&(r.indexOf("bottom")>=0?(i=y[3]-l,x.push("bottom")):w.push("bottom")),n<y[0]&&(r.indexOf("left")>=0?(n=y[0],x.push("left")):w.push("left")),n+h>y[2]&&(r.indexOf("right")>=0?(n=y[2]-h,x.push("right")):w.push("right")),x.length&&function(){var t=void 0;t=void 0!==e.options.pinnedClass?e.options.pinnedClass:e.getClass("pinned"),m.push(t),x.forEach(function(e){m.push(t+"-"+e)})}(),w.length&&function(){var t=void 0;t=void 0!==e.options.outOfBoundsClass?e.options.outOfBoundsClass:e.getClass("out-of-bounds"),m.push(t),w.forEach(function(e){m.push(t+"-"+e)})}(),(x.indexOf("left")>=0||x.indexOf("right")>=0)&&(b.left=v.left=!1),(x.indexOf("top")>=0||x.indexOf("bottom")>=0)&&(b.top=v.top=!1),v.top===o.top&&v.left===o.left&&b.top===e.attachment.top&&b.left===e.attachment.left||(e.updateAttachClasses(b,v),e.trigger("update",{attachment:b,targetAttachment:v}))}),T(function(){!1!==e.options.addTargetClasses&&f(e.target,m,g),f(e.element,m,g)}),{top:i,left:n}}});var O=x.Utils,s=O.getBounds,f=O.updateClasses,T=O.defer;x.modules.push({position:function(t){var e=this,i=t.top,n=t.left,o=this.cache("element-bounds",function(){return s(e.element)}),a=o.height,r=o.width,l=this.getTargetBounds(),h=i+a,u=n+r,c=[];i<=l.bottom&&h>=l.top&&["left","right"].forEach(function(t){var e=l[t];e!==n&&e!==u||c.push(t)}),n<=l.right&&u>=l.left&&["top","bottom"].forEach(function(t){var e=l[t];e!==i&&e!==h||c.push(t)});var d=[],p=[],g=["left","top","right","bottom"];return d.push(this.getClass("abutted")),g.forEach(function(t){d.push(e.getClass("abutted")+"-"+t)}),c.length&&p.push(this.getClass("abutted")),c.forEach(function(t){p.push(e.getClass("abutted")+"-"+t)}),T(function(){!1!==e.options.addTargetClasses&&f(e.target,p,d),f(e.element,p,d)}),!0}});var A=function(){function t(t,e){var i=[],n=!0,s=!1,o=void 0;try{for(var a,r=t[Symbol.iterator]();!(n=(a=r.next()).done)&&(i.push(a.value),!e||i.length!==e);n=!0);}catch(t){s=!0,o=t}finally{try{!n&&r.return&&r.return()}finally{if(s)throw o}}return i}return function(e,i){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,i);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();return x.modules.push({position:function(t){var e=t.top,i=t.left;if(this.options.shift){var n=this.options.shift;"function"==typeof this.options.shift&&(n=this.options.shift.call(this,{top:e,left:i}));var s=void 0,o=void 0;if("string"==typeof n){n=n.split(" "),n[1]=n[1]||n[0];var a=n,r=A(a,2);s=r[0],o=r[1],s=parseFloat(s,10),o=parseFloat(o,10)}else s=n.top,o=n.left;return e+=s,i+=o,{top:e,left:i}}}}),Y}),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(t){function e(t){for(var e=t.css("visibility");"inherit"===e;)t=t.parent(),e=t.css("visibility");return"hidden"!==e}function i(t){for(var e,i;t.length&&t[0]!==document;){if(("absolute"===(e=t.css("position"))||"relative"===e||"fixed"===e)&&(i=parseInt(t.css("zIndex"),10),!isNaN(i)&&0!==i))return i;t=t.parent()}return 0}function n(){this._curInst=null,this._keyEvent=!1,this._disabledInputs=[],this._datepickerShowing=!1,this._inDialog=!1,this._mainDivId="ui-datepicker-div",this._inlineClass="ui-datepicker-inline",this._appendClass="ui-datepicker-append",this._triggerClass="ui-datepicker-trigger",this._dialogClass="ui-datepicker-dialog",this._disableClass="ui-datepicker-disabled",this._unselectableClass="ui-datepicker-unselectable",this._currentClass="ui-datepicker-current-day",this._dayOverClass="ui-datepicker-days-cell-over",this.regional=[],this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su","Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:!1,showMonthAfterYear:!1,yearSuffix:""},this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:!1,hideIfNoPrevNext:!1,navigationAsDateFormat:!1,gotoCurrent:!1,changeMonth:!1,changeYear:!1,yearRange:"c-10:c+10",showOtherMonths:!1,selectOtherMonths:!1,showWeek:!1,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:!0,showButtonPanel:!1,autoSize:!1,disabled:!1},t.extend(this._defaults,this.regional[""]),this.regional.en=t.extend(!0,{},this.regional[""]),this.regional["en-US"]=t.extend(!0,{},this.regional.en),this.dpDiv=s(t("<div id='"+this._mainDivId+"' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))}function s(e){var i="button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";return e.on("mouseout",i,function(){t(this).removeClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).removeClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).removeClass("ui-datepicker-next-hover")}).on("mouseover",i,o)}function o(){t.datepicker._isDisabledDatepicker(f.inline?f.dpDiv.parent()[0]:f.input[0])||(t(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"),t(this).addClass("ui-state-hover"),-1!==this.className.indexOf("ui-datepicker-prev")&&t(this).addClass("ui-datepicker-prev-hover"),-1!==this.className.indexOf("ui-datepicker-next")&&t(this).addClass("ui-datepicker-next-hover"))}function a(e,i){t.extend(e,i);for(var n in i)null==i[n]&&(e[n]=i[n]);return e}function r(t){return function(){var e=this.element.val();t.apply(this,arguments),this._refresh(),e!==this.element.val()&&this._trigger("change")}}t.ui=t.ui||{};var l=(t.ui.version="1.12.1",0),h=Array.prototype.slice;t.cleanData=function(e){return function(i){var n,s,o;for(o=0;null!=(s=i[o]);o++)try{n=t._data(s,"events"),n&&n.remove&&t(s).triggerHandler("remove")}catch(t){}e(i)}}(t.cleanData),t.widget=function(e,i,n){var s,o,a,r={},l=e.split(".")[0];e=e.split(".")[1];var h=l+"-"+e;return n||(n=i,i=t.Widget),t.isArray(n)&&(n=t.extend.apply(null,[{}].concat(n))),t.expr[":"][h.toLowerCase()]=function(e){return!!t.data(e,h)},t[l]=t[l]||{},s=t[l][e],o=t[l][e]=function(t,e){if(!this._createWidget)return new o(t,e);arguments.length&&this._createWidget(t,e)},t.extend(o,s,{version:n.version,_proto:t.extend({},n),_childConstructors:[]}),a=new i,a.options=t.widget.extend({},a.options),t.each(n,function(e,n){if(!t.isFunction(n))return void(r[e]=n);r[e]=function(){function t(){return i.prototype[e].apply(this,arguments)}function s(t){return i.prototype[e].apply(this,t)}return function(){var e,i=this._super,o=this._superApply;return this._super=t,this._superApply=s,e=n.apply(this,arguments),this._super=i,this._superApply=o,e}}()}),o.prototype=t.widget.extend(a,{widgetEventPrefix:s?a.widgetEventPrefix||e:e},r,{constructor:o,namespace:l,widgetName:e,widgetFullName:h}),s?(t.each(s._childConstructors,function(e,i){var n=i.prototype;t.widget(n.namespace+"."+n.widgetName,o,i._proto)}),delete s._childConstructors):i._childConstructors.push(o),t.widget.bridge(e,o),o},t.widget.extend=function(e){for(var i,n,s=h.call(arguments,1),o=0,a=s.length;o<a;o++)for(i in s[o])n=s[o][i],s[o].hasOwnProperty(i)&&void 0!==n&&(t.isPlainObject(n)?e[i]=t.isPlainObject(e[i])?t.widget.extend({},e[i],n):t.widget.extend({},n):e[i]=n);return e},t.widget.bridge=function(e,i){var n=i.prototype.widgetFullName||e;t.fn[e]=function(s){var o="string"==typeof s,a=h.call(arguments,1),r=this;return o?this.length||"instance"!==s?this.each(function(){var i,o=t.data(this,n);return"instance"===s?(r=o,!1):o?t.isFunction(o[s])&&"_"!==s.charAt(0)?(i=o[s].apply(o,a),i!==o&&void 0!==i?(r=i&&i.jquery?r.pushStack(i.get()):i,!1):void 0):t.error("no such method '"+s+"' for "+e+" widget instance"):t.error("cannot call methods on "+e+" prior to initialization; attempted to call method '"+s+"'")}):r=void 0:(a.length&&(s=t.widget.extend.apply(null,[s].concat(a))),this.each(function(){var e=t.data(this,n);e?(e.option(s||{}),e._init&&e._init()):t.data(this,n,new i(s,this))})),r}},t.Widget=function(){},t.Widget._childConstructors=[],t.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,i){i=t(i||this.defaultElement||this)[0],this.element=t(i),this.uuid=l++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=t(),this.hoverable=t(),this.focusable=t(),this.classesElementLookup={},i!==this&&(t.data(i,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===i&&this.destroy()}}),this.document=t(i.style?i.ownerDocument:i.document||i),this.window=t(this.document[0].defaultView||this.document[0].parentWindow)),this.options=t.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:t.noop,_create:t.noop,_init:t.noop,destroy:function(){var e=this;this._destroy(),t.each(this.classesElementLookup,function(t,i){e._removeClass(i,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:t.noop,widget:function(){return this.element},option:function(e,i){var n,s,o,a=e;if(0===arguments.length)return t.widget.extend({},this.options);if("string"==typeof e)if(a={},n=e.split("."),e=n.shift(),n.length){for(s=a[e]=t.widget.extend({},this.options[e]),o=0;o<n.length-1;o++)s[n[o]]=s[n[o]]||{},s=s[n[o]];if(e=n.pop(),1===arguments.length)return void 0===s[e]?null:s[e];s[e]=i}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];a[e]=i}return this._setOptions(a),this},_setOptions:function(t){var e;for(e in t)this._setOption(e,t[e]);return this},_setOption:function(t,e){return"classes"===t&&this._setOptionClasses(e),this.options[t]=e,"disabled"===t&&this._setOptionDisabled(e),this},_setOptionClasses:function(e){var i,n,s;for(i in e)s=this.classesElementLookup[i],e[i]!==this.options.classes[i]&&s&&s.length&&(n=t(s.get()),this._removeClass(s,i),n.addClass(this._classes({element:n,keys:i,classes:e,add:!0})))},_setOptionDisabled:function(t){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!t),t&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(e){function i(i,o){var a,r;for(r=0;r<i.length;r++)a=s.classesElementLookup[i[r]]||t(),a=t(e.add?t.unique(a.get().concat(e.element.get())):a.not(e.element).get()),s.classesElementLookup[i[r]]=a,n.push(i[r]),o&&e.classes[i[r]]&&n.push(e.classes[i[r]])}var n=[],s=this;return e=t.extend({element:this.element,classes:this.options.classes||{}},e),this._on(e.element,{remove:"_untrackClassesElement"}),e.keys&&i(e.keys.match(/\S+/g)||[],!0),e.extra&&i(e.extra.match(/\S+/g)||[]),n.join(" ")},_untrackClassesElement:function(e){var i=this;t.each(i.classesElementLookup,function(n,s){-1!==t.inArray(e.target,s)&&(i.classesElementLookup[n]=t(s.not(e.target).get()))})},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,n){n="boolean"==typeof n?n:i;var s="string"==typeof t||null===t,o={extra:s?e:i,keys:s?t:e,element:s?this.element:t,add:n};return o.element.toggleClass(this._classes(o),n),this},_on:function(e,i,n){var s,o=this;"boolean"!=typeof e&&(n=i,i=e,e=!1),n?(i=s=t(i),this.bindings=this.bindings.add(i)):(n=i,i=this.element,s=this.widget()),t.each(n,function(n,a){function r(){if(e||!0!==o.options.disabled&&!t(this).hasClass("ui-state-disabled"))return("string"==typeof a?o[a]:a).apply(o,arguments)}"string"!=typeof a&&(r.guid=a.guid=a.guid||r.guid||t.guid++);var l=n.match(/^([\w:-]*)\s*(.*)$/),h=l[1]+o.eventNamespace,u=l[2];u?s.on(h,u,r):i.on(h,r)})},_off:function(e,i){i=(i||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(i).off(i),this.bindings=t(this.bindings.not(e).get()),this.focusable=t(this.focusable.not(e).get()),this.hoverable=t(this.hoverable.not(e).get())},_delay:function(t,e){function i(){return("string"==typeof t?n[t]:t).apply(n,arguments)}var n=this;return setTimeout(i,e||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(t(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(t(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(t(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,i,n){var s,o,a=this.options[e];if(n=n||{},i=t.Event(i),i.type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),i.target=this.element[0],o=i.originalEvent)for(s in o)s in i||(i[s]=o[s]);return this.element.trigger(i,n),!(t.isFunction(a)&&!1===a.apply(this.element[0],[i].concat(n))||i.isDefaultPrevented())}},t.each({show:"fadeIn",hide:"fadeOut"},function(e,i){t.Widget.prototype["_"+e]=function(n,s,o){"string"==typeof s&&(s={effect:s});var a,r=s?!0===s||"number"==typeof s?i:s.effect||i:e;s=s||{},"number"==typeof s&&(s={duration:s}),a=!t.isEmptyObject(s),s.complete=o,s.delay&&n.delay(s.delay),a&&t.effects&&t.effects.effect[r]?n[e](s):r!==e&&n[r]?n[r](s.duration,s.easing,o):n.queue(function(i){t(this)[e](),o&&o.call(n[0]),i()})}});t.widget;!function(){function e(t,e,i){return[parseFloat(t[0])*(c.test(t[0])?e/100:1),parseFloat(t[1])*(c.test(t[1])?i/100:1)]}function i(e,i){return parseInt(t.css(e,i),10)||0}function n(e){var i=e[0];return 9===i.nodeType?{width:e.width(),height:e.height(),offset:{top:0,left:0}}:t.isWindow(i)?{width:e.width(),height:e.height(),offset:{top:e.scrollTop(),left:e.scrollLeft()}}:i.preventDefault?{width:0,height:0,offset:{top:i.pageY,left:i.pageX}}:{width:e.outerWidth(),height:e.outerHeight(),offset:e.offset()}}var s,o=Math.max,a=Math.abs,r=/left|center|right/,l=/top|center|bottom/,h=/[\+\-]\d+(\.[\d]+)?%?/,u=/^\w+/,c=/%$/,d=t.fn.position;t.position={scrollbarWidth:function(){if(void 0!==s)return s;var e,i,n=t("<div style='display:block;position:absolute;width:50px;height:50px;overflow:hidden;'><div style='height:100px;width:auto;'></div></div>"),o=n.children()[0];return t("body").append(n),e=o.offsetWidth,n.css("overflow","scroll"),i=o.offsetWidth,e===i&&(i=n[0].clientWidth),n.remove(),s=e-i},getScrollInfo:function(e){var i=e.isWindow||e.isDocument?"":e.element.css("overflow-x"),n=e.isWindow||e.isDocument?"":e.element.css("overflow-y"),s="scroll"===i||"auto"===i&&e.width<e.element[0].scrollWidth;return{width:"scroll"===n||"auto"===n&&e.height<e.element[0].scrollHeight?t.position.scrollbarWidth():0,height:s?t.position.scrollbarWidth():0}},getWithinInfo:function(e){var i=t(e||window),n=t.isWindow(i[0]),s=!!i[0]&&9===i[0].nodeType;return{element:i,isWindow:n,isDocument:s,offset:n||s?{left:0,top:0}:t(e).offset(),scrollLeft:i.scrollLeft(),scrollTop:i.scrollTop(),width:i.outerWidth(),height:i.outerHeight()}}},t.fn.position=function(s){if(!s||!s.of)return d.apply(this,arguments);s=t.extend({},s);var c,f,p,g,m,v,b=t(s.of),_=t.position.getWithinInfo(s.within),y=t.position.getScrollInfo(_),x=(s.collision||"flip").split(" "),w={};return v=n(b),b[0].preventDefault&&(s.at="left top"),f=v.width,p=v.height,g=v.offset,m=t.extend({},g),t.each(["my","at"],function(){var t,e,i=(s[this]||"").split(" ");1===i.length&&(i=r.test(i[0])?i.concat(["center"]):l.test(i[0])?["center"].concat(i):["center","center"]),i[0]=r.test(i[0])?i[0]:"center",i[1]=l.test(i[1])?i[1]:"center",t=h.exec(i[0]),e=h.exec(i[1]),w[this]=[t?t[0]:0,e?e[0]:0],s[this]=[u.exec(i[0])[0],u.exec(i[1])[0]]}),1===x.length&&(x[1]=x[0]),"right"===s.at[0]?m.left+=f:"center"===s.at[0]&&(m.left+=f/2),"bottom"===s.at[1]?m.top+=p:"center"===s.at[1]&&(m.top+=p/2),c=e(w.at,f,p),m.left+=c[0],m.top+=c[1],this.each(function(){var n,r,l=t(this),h=l.outerWidth(),u=l.outerHeight(),d=i(this,"marginLeft"),v=i(this,"marginTop"),k=h+d+i(this,"marginRight")+y.width,C=u+v+i(this,"marginBottom")+y.height,D=t.extend({},m),M=e(w.my,l.outerWidth(),l.outerHeight());"right"===s.my[0]?D.left-=h:"center"===s.my[0]&&(D.left-=h/2),"bottom"===s.my[1]?D.top-=u:"center"===s.my[1]&&(D.top-=u/2),D.left+=M[0],D.top+=M[1],n={marginLeft:d,marginTop:v},t.each(["left","top"],function(e,i){t.ui.position[x[e]]&&t.ui.position[x[e]][i](D,{targetWidth:f,targetHeight:p,elemWidth:h,elemHeight:u,collisionPosition:n,collisionWidth:k,collisionHeight:C,offset:[c[0]+M[0],c[1]+M[1]],my:s.my,at:s.at,within:_,elem:l})}),s.using&&(r=function(t){var e=g.left-D.left,i=e+f-h,n=g.top-D.top,r=n+p-u,c={target:{element:b,left:g.left,top:g.top,width:f,height:p},element:{element:l,left:D.left,top:D.top,width:h,height:u},horizontal:i<0?"left":e>0?"right":"center",vertical:r<0?"top":n>0?"bottom":"middle"};f<h&&a(e+i)<f&&(c.horizontal="center"),p<u&&a(n+r)<p&&(c.vertical="middle"),o(a(e),a(i))>o(a(n),a(r))?c.important="horizontal":c.important="vertical",s.using.call(this,t,c)}),l.offset(t.extend(D,{using:r}))})},t.ui.position={fit:{left:function(t,e){var i,n=e.within,s=n.isWindow?n.scrollLeft:n.offset.left,a=n.width,r=t.left-e.collisionPosition.marginLeft,l=s-r,h=r+e.collisionWidth-a-s;e.collisionWidth>a?l>0&&h<=0?(i=t.left+l+e.collisionWidth-a-s,t.left+=l-i):t.left=h>0&&l<=0?s:l>h?s+a-e.collisionWidth:s:l>0?t.left+=l:h>0?t.left-=h:t.left=o(t.left-r,t.left)},top:function(t,e){var i,n=e.within,s=n.isWindow?n.scrollTop:n.offset.top,a=e.within.height,r=t.top-e.collisionPosition.marginTop,l=s-r,h=r+e.collisionHeight-a-s;e.collisionHeight>a?l>0&&h<=0?(i=t.top+l+e.collisionHeight-a-s,t.top+=l-i):t.top=h>0&&l<=0?s:l>h?s+a-e.collisionHeight:s:l>0?t.top+=l:h>0?t.top-=h:t.top=o(t.top-r,t.top)}},flip:{left:function(t,e){var i,n,s=e.within,o=s.offset.left+s.scrollLeft,r=s.width,l=s.isWindow?s.scrollLeft:s.offset.left,h=t.left-e.collisionPosition.marginLeft,u=h-l,c=h+e.collisionWidth-r-l,d="left"===e.my[0]?-e.elemWidth:"right"===e.my[0]?e.elemWidth:0,f="left"===e.at[0]?e.targetWidth:"right"===e.at[0]?-e.targetWidth:0,p=-2*e.offset[0];u<0?((i=t.left+d+f+p+e.collisionWidth-r-o)<0||i<a(u))&&(t.left+=d+f+p):c>0&&((n=t.left-e.collisionPosition.marginLeft+d+f+p-l)>0||a(n)<c)&&(t.left+=d+f+p)},top:function(t,e){var i,n,s=e.within,o=s.offset.top+s.scrollTop,r=s.height,l=s.isWindow?s.scrollTop:s.offset.top,h=t.top-e.collisionPosition.marginTop,u=h-l,c=h+e.collisionHeight-r-l,d="top"===e.my[1],f=d?-e.elemHeight:"bottom"===e.my[1]?e.elemHeight:0,p="top"===e.at[1]?e.targetHeight:"bottom"===e.at[1]?-e.targetHeight:0,g=-2*e.offset[1];u<0?((n=t.top+f+p+g+e.collisionHeight-r-o)<0||n<a(u))&&(t.top+=f+p+g):c>0&&((i=t.top-e.collisionPosition.marginTop+f+p+g-l)>0||a(i)<c)&&(t.top+=f+p+g)}},flipfit:{left:function(){t.ui.position.flip.left.apply(this,arguments),t.ui.position.fit.left.apply(this,arguments)},top:function(){t.ui.position.flip.top.apply(this,arguments),t.ui.position.fit.top.apply(this,arguments)}}}}();t.ui.position,t.extend(t.expr[":"],{data:t.expr.createPseudo?t.expr.createPseudo(function(e){return function(i){return!!t.data(i,e)}}):function(e,i,n){return!!t.data(e,n[3])}}),t.fn.extend({disableSelection:function(){var t="onselectstart"in document.createElement("div")?"selectstart":"mousedown";return function(){return this.on(t+".ui-disableSelection",function(t){t.preventDefault()})}}(),enableSelection:function(){return this.off(".ui-disableSelection")}});t.ui.focusable=function(i,n){var s,o,a,r,l,h=i.nodeName.toLowerCase();return"area"===h?(s=i.parentNode,o=s.name,!(!i.href||!o||"map"!==s.nodeName.toLowerCase())&&(a=t("img[usemap='#"+o+"']"),a.length>0&&a.is(":visible"))):(/^(input|select|textarea|button|object)$/.test(h)?(r=!i.disabled)&&(l=t(i).closest("fieldset")[0])&&(r=!l.disabled):r="a"===h?i.href||n:n,r&&t(i).is(":visible")&&e(t(i)))},t.extend(t.expr[":"],{focusable:function(e){return t.ui.focusable(e,null!=t.attr(e,"tabindex"))}});t.ui.focusable,t.fn.form=function(){return"string"==typeof this[0].form?this.closest("form"):t(this[0].form)},t.ui.formResetMixin={_formResetHandler:function(){var e=t(this);setTimeout(function(){var i=e.data("ui-form-reset-instances");t.each(i,function(){this.refresh()})})},_bindFormResetHandler:function(){if(this.form=this.element.form(),this.form.length){var t=this.form.data("ui-form-reset-instances")||[];t.length||this.form.on("reset.ui-form-reset",this._formResetHandler),t.push(this),this.form.data("ui-form-reset-instances",t)}},_unbindFormResetHandler:function(){if(this.form.length){var e=this.form.data("ui-form-reset-instances");e.splice(t.inArray(this,e),1),e.length?this.form.data("ui-form-reset-instances",e):this.form.removeData("ui-form-reset-instances").off("reset.ui-form-reset")}}};"1.7"===t.fn.jquery.substring(0,3)&&(t.each(["Width","Height"],function(e,i){function n(e,i,n,o){return t.each(s,function(){i-=parseFloat(t.css(e,"padding"+this))||0,n&&(i-=parseFloat(t.css(e,"border"+this+"Width"))||0),o&&(i-=parseFloat(t.css(e,"margin"+this))||0)}),i}var s="Width"===i?["Left","Right"]:["Top","Bottom"],o=i.toLowerCase(),a={innerWidth:t.fn.innerWidth,innerHeight:t.fn.innerHeight,outerWidth:t.fn.outerWidth,outerHeight:t.fn.outerHeight};t.fn["inner"+i]=function(e){return void 0===e?a["inner"+i].call(this):this.each(function(){t(this).css(o,n(this,e)+"px")})},t.fn["outer"+i]=function(e,s){return"number"!=typeof e?a["outer"+i].call(this,e):this.each(function(){t(this).css(o,n(this,e,!0,s)+"px")})}}),t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))});var u=(t.ui.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},t.ui.escapeSelector=function(){var t=/([!"#$%&'()*+,.\/:;<=>?@[\]^`{|}~])/g;return function(e){return e.replace(t,"\\$1")}}(),t.fn.labels=function(){var e,i,n,s,o;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(s=this.eq(0).parents("label"),n=this.attr("id"),n&&(e=this.eq(0).parents().last(),o=e.add(e.length?e.siblings():this.siblings()),i="label[for='"+t.ui.escapeSelector(n)+"']",s=s.add(o.find(i).addBack(i))),this.pushStack(s))},t.fn.scrollParent=function(e){var i=this.css("position"),n="absolute"===i,s=e?/(auto|scroll|hidden)/:/(auto|scroll)/,o=this.parents().filter(function(){var e=t(this);return(!n||"static"!==e.css("position"))&&s.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==i&&o.length?o:t(this[0].ownerDocument||document)},t.extend(t.expr[":"],{tabbable:function(e){var i=t.attr(e,"tabindex"),n=null!=i;return(!n||i>=0)&&t.ui.focusable(e,n)}}),t.fn.extend({uniqueId:function(){var t=0;return function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++t)})}}(),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&t(this).removeAttr("id")})}}),t.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),!1);t(document).on("mouseup",function(){u=!1});t.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(i){if(!0===t.data(i.target,e.widgetName+".preventClickEvent"))return t.removeData(i.target,e.widgetName+".preventClickEvent"),i.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(e){if(!u){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(e),this._mouseDownEvent=e;var i=this,n=1===e.which,s=!("string"!=typeof this.options.cancel||!e.target.nodeName)&&t(e.target).closest(this.options.cancel).length;return!(n&&!s&&this._mouseCapture(e))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){i.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(e),!this._mouseStarted)?(e.preventDefault(),!0):(!0===t.data(e.target,this.widgetName+".preventClickEvent")&&t.removeData(e.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return i._mouseMove(t)},this._mouseUpDelegate=function(t){return i._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),e.preventDefault(),u=!0,!0))}},_mouseMove:function(e){if(this._mouseMoved){if(t.ui.ie&&(!document.documentMode||document.documentMode<9)&&!e.button)return this._mouseUp(e);if(!e.which)if(e.originalEvent.altKey||e.originalEvent.ctrlKey||e.originalEvent.metaKey||e.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(e)}return(e.which||e.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(e),e.preventDefault()):(this._mouseDistanceMet(e)&&this._mouseDelayMet(e)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,e),this._mouseStarted?this._mouseDrag(e):this._mouseUp(e)),!this._mouseStarted)},_mouseUp:function(e){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,e.target===this._mouseDownEvent.target&&t.data(e.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(e)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,u=!1,e.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),t.ui.plugin={add:function(e,i,n){var s,o=t.ui[e].prototype;for(s in n)o.plugins[s]=o.plugins[s]||[],o.plugins[s].push([i,n[s]])},call:function(t,e,i,n){var s,o=t.plugins[e];if(o&&(n||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(s=0;s<o.length;s++)t.options[o[s][0]]&&o[s][1].apply(t.element,i)}},t.ui.safeActiveElement=function(t){var e;try{e=t.activeElement}catch(i){e=t.body}return e||(e=t.body),e.nodeName||(e=t.body),e},t.ui.safeBlur=function(e){e&&"body"!==e.nodeName.toLowerCase()&&t(e).trigger("blur")};t.widget("ui.draggable",t.ui.mouse,{version:"1.12.1",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(){"original"===this.options.helper&&this._setPositionRelative(),this.options.addClasses&&this._addClass("ui-draggable"),this._setHandleClassName(),this._mouseInit()},_setOption:function(t,e){this._super(t,e),"handle"===t&&(this._removeHandleClassName(),this._setHandleClassName())},_destroy:function(){if((this.helper||this.element).is(".ui-draggable-dragging"))return void(this.destroyOnClear=!0);this._removeHandleClassName(),this._mouseDestroy()},_mouseCapture:function(e){var i=this.options;return!(this.helper||i.disabled||t(e.target).closest(".ui-resizable-handle").length>0)&&(this.handle=this._getHandle(e),!!this.handle&&(this._blurActiveElement(e),this._blockFrames(!0===i.iframeFix?"iframe":i.iframeFix),!0))},_blockFrames:function(e){this.iframeBlocks=this.document.find(e).map(function(){var e=t(this);return t("<div>").css("position","absolute").appendTo(e.parent()).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(e){var i=t.ui.safeActiveElement(this.document[0])
;t(e.target).closest(i).length||t.ui.safeBlur(i)},_mouseStart:function(e){var i=this.options;return this.helper=this._createHelper(e),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),t.ui.ddmanager&&(t.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=this.helper.parents().filter(function(){return"fixed"===t(this).css("position")}).length>0,this.positionAbs=this.element.offset(),this._refreshOffsets(e),this.originalPosition=this.position=this._generatePosition(e,!1),this.originalPageX=e.pageX,this.originalPageY=e.pageY,i.cursorAt&&this._adjustOffsetFromHelper(i.cursorAt),this._setContainment(),!1===this._trigger("start",e)?(this._clear(),!1):(this._cacheHelperProportions(),t.ui.ddmanager&&!i.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this._mouseDrag(e,!0),t.ui.ddmanager&&t.ui.ddmanager.dragStart(this,e),!0)},_refreshOffsets:function(t){this.offset={top:this.positionAbs.top-this.margins.top,left:this.positionAbs.left-this.margins.left,scroll:!1,parent:this._getParentOffset(),relative:this._getRelativeOffset()},this.offset.click={left:t.pageX-this.offset.left,top:t.pageY-this.offset.top}},_mouseDrag:function(e,i){if(this.hasFixedAncestor&&(this.offset.parent=this._getParentOffset()),this.position=this._generatePosition(e,!0),this.positionAbs=this._convertPositionTo("absolute"),!i){var n=this._uiHash();if(!1===this._trigger("drag",e,n))return this._mouseUp(new t.Event("mouseup",e)),!1;this.position=n.position}return this.helper[0].style.left=this.position.left+"px",this.helper[0].style.top=this.position.top+"px",t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),!1},_mouseStop:function(e){var i=this,n=!1;return t.ui.ddmanager&&!this.options.dropBehaviour&&(n=t.ui.ddmanager.drop(this,e)),this.dropped&&(n=this.dropped,this.dropped=!1),"invalid"===this.options.revert&&!n||"valid"===this.options.revert&&n||!0===this.options.revert||t.isFunction(this.options.revert)&&this.options.revert.call(this.element,n)?t(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){!1!==i._trigger("stop",e)&&i._clear()}):!1!==this._trigger("stop",e)&&this._clear(),!1},_mouseUp:function(e){return this._unblockFrames(),t.ui.ddmanager&&t.ui.ddmanager.dragStop(this,e),this.handleElement.is(e.target)&&this.element.trigger("focus"),t.ui.mouse.prototype._mouseUp.call(this,e)},cancel:function(){return this.helper.is(".ui-draggable-dragging")?this._mouseUp(new t.Event("mouseup",{target:this.element[0]})):this._clear(),this},_getHandle:function(e){return!this.options.handle||!!t(e.target).closest(this.element.find(this.options.handle)).length},_setHandleClassName:function(){this.handleElement=this.options.handle?this.element.find(this.options.handle):this.element,this._addClass(this.handleElement,"ui-draggable-handle")},_removeHandleClassName:function(){this._removeClass(this.handleElement,"ui-draggable-handle")},_createHelper:function(e){var i=this.options,n=t.isFunction(i.helper),s=n?t(i.helper.apply(this.element[0],[e])):"clone"===i.helper?this.element.clone().removeAttr("id"):this.element;return s.parents("body").length||s.appendTo("parent"===i.appendTo?this.element[0].parentNode:i.appendTo),n&&s[0]===this.element[0]&&this._setPositionRelative(),s[0]===this.element[0]||/(fixed|absolute)/.test(s.css("position"))||s.css("position","absolute"),s},_setPositionRelative:function(){/^(?:r|a|f)/.test(this.element.css("position"))||(this.element[0].style.position="relative")},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_isRootNode:function(t){return/(html|body)/i.test(t.tagName)||t===this.document[0]},_getParentOffset:function(){var e=this.offsetParent.offset(),i=this.document[0];return"absolute"===this.cssPosition&&this.scrollParent[0]!==i&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),this._isRootNode(this.offsetParent[0])&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"!==this.cssPosition)return{top:0,left:0};var t=this.element.position(),e=this._isRootNode(this.scrollParent[0]);return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+(e?0:this.scrollParent.scrollTop()),left:t.left-(parseInt(this.helper.css("left"),10)||0)+(e?0:this.scrollParent.scrollLeft())}},_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 e,i,n,s=this.options,o=this.document[0];return this.relativeContainer=null,s.containment?"window"===s.containment?void(this.containment=[t(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,t(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,t(window).scrollLeft()+t(window).width()-this.helperProportions.width-this.margins.left,t(window).scrollTop()+(t(window).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):"document"===s.containment?void(this.containment=[0,0,t(o).width()-this.helperProportions.width-this.margins.left,(t(o).height()||o.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]):s.containment.constructor===Array?void(this.containment=s.containment):("parent"===s.containment&&(s.containment=this.helper[0].parentNode),i=t(s.containment),void((n=i[0])&&(e=/(scroll|auto)/.test(i.css("overflow")),this.containment=[(parseInt(i.css("borderLeftWidth"),10)||0)+(parseInt(i.css("paddingLeft"),10)||0),(parseInt(i.css("borderTopWidth"),10)||0)+(parseInt(i.css("paddingTop"),10)||0),(e?Math.max(n.scrollWidth,n.offsetWidth):n.offsetWidth)-(parseInt(i.css("borderRightWidth"),10)||0)-(parseInt(i.css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(e?Math.max(n.scrollHeight,n.offsetHeight):n.offsetHeight)-(parseInt(i.css("borderBottomWidth"),10)||0)-(parseInt(i.css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom],this.relativeContainer=i))):void(this.containment=null)},_convertPositionTo:function(t,e){e||(e=this.position);var i="absolute"===t?1:-1,n=this._isRootNode(this.scrollParent[0]);return{top:e.top+this.offset.relative.top*i+this.offset.parent.top*i-("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top)*i,left:e.left+this.offset.relative.left*i+this.offset.parent.left*i-("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)*i}},_generatePosition:function(t,e){var i,n,s,o,a=this.options,r=this._isRootNode(this.scrollParent[0]),l=t.pageX,h=t.pageY;return r&&this.offset.scroll||(this.offset.scroll={top:this.scrollParent.scrollTop(),left:this.scrollParent.scrollLeft()}),e&&(this.containment&&(this.relativeContainer?(n=this.relativeContainer.offset(),i=[this.containment[0]+n.left,this.containment[1]+n.top,this.containment[2]+n.left,this.containment[3]+n.top]):i=this.containment,t.pageX-this.offset.click.left<i[0]&&(l=i[0]+this.offset.click.left),t.pageY-this.offset.click.top<i[1]&&(h=i[1]+this.offset.click.top),t.pageX-this.offset.click.left>i[2]&&(l=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(h=i[3]+this.offset.click.top)),a.grid&&(s=a.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,h=i?s-this.offset.click.top>=i[1]||s-this.offset.click.top>i[3]?s:s-this.offset.click.top>=i[1]?s-a.grid[1]:s+a.grid[1]:s,o=a.grid[0]?this.originalPageX+Math.round((l-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,l=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(l=this.originalPageX),"x"===a.axis&&(h=this.originalPageY)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:l-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"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(e,i,n){return n=n||this._uiHash(),t.ui.plugin.call(this,e,[i,n,this],!0),/^(drag|start|stop)/.test(e)&&(this.positionAbs=this._convertPositionTo("absolute"),n.offset=this.positionAbs),t.Widget.prototype._trigger.call(this,e,i,n)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),t.ui.plugin.add("draggable","connectToSortable",{start:function(e,i,n){var s=t.extend({},i,{item:n.element});n.sortables=[],t(n.options.connectToSortable).each(function(){var i=t(this).sortable("instance");i&&!i.options.disabled&&(n.sortables.push(i),i.refreshPositions(),i._trigger("activate",e,s))})},stop:function(e,i,n){var s=t.extend({},i,{item:n.element});n.cancelHelperRemoval=!1,t.each(n.sortables,function(){var t=this;t.isOver?(t.isOver=0,n.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(e,i,n){t.each(n.sortables,function(){var s=!1,o=this;o.positionAbs=n.positionAbs,o.helperProportions=n.helperProportions,o.offset.click=n.offset.click,o._intersectsWith(o.containerCache)&&(s=!0,t.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,this!==o&&this._intersectsWith(this.containerCache)&&t.contains(o.element[0],this.element[0])&&(s=!1),s})),s?(o.isOver||(o.isOver=1,n._parent=i.helper.parent(),o.currentItem=i.helper.appendTo(o.element).data("ui-sortable-item",!0),o.options._helper=o.options.helper,o.options.helper=function(){return i.helper[0]},e.target=o.currentItem[0],o._mouseCapture(e,!0),o._mouseStart(e,!0,!0),o.offset.click.top=n.offset.click.top,o.offset.click.left=n.offset.click.left,o.offset.parent.left-=n.offset.parent.left-o.offset.parent.left,o.offset.parent.top-=n.offset.parent.top-o.offset.parent.top,n._trigger("toSortable",e),n.dropped=o.element,t.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,o.fromOutside=n),o.currentItem&&(o._mouseDrag(e),i.position=o.position)):o.isOver&&(o.isOver=0,o.cancelHelperRemoval=!0,o.options._revert=o.options.revert,o.options.revert=!1,o._trigger("out",e,o._uiHash(o)),o._mouseStop(e,!0),o.options.revert=o.options._revert,o.options.helper=o.options._helper,o.placeholder&&o.placeholder.remove(),i.helper.appendTo(n._parent),n._refreshOffsets(e),i.position=n._generatePosition(e,!0),n._trigger("fromSortable",e),n.dropped=!1,t.each(n.sortables,function(){this.refreshPositions()}))})}}),t.ui.plugin.add("draggable","cursor",{start:function(e,i,n){var s=t("body"),o=n.options;s.css("cursor")&&(o._cursor=s.css("cursor")),s.css("cursor",o.cursor)},stop:function(e,i,n){var s=n.options;s._cursor&&t("body").css("cursor",s._cursor)}}),t.ui.plugin.add("draggable","opacity",{start:function(e,i,n){var s=t(i.helper),o=n.options;s.css("opacity")&&(o._opacity=s.css("opacity")),s.css("opacity",o.opacity)},stop:function(e,i,n){var s=n.options;s._opacity&&t(i.helper).css("opacity",s._opacity)}}),t.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(e,i,n){var s=n.options,o=!1,a=n.scrollParentNotHidden[0],r=n.document[0];a!==r&&"HTML"!==a.tagName?(s.axis&&"x"===s.axis||(n.overflowOffset.top+a.offsetHeight-e.pageY<s.scrollSensitivity?a.scrollTop=o=a.scrollTop+s.scrollSpeed:e.pageY-n.overflowOffset.top<s.scrollSensitivity&&(a.scrollTop=o=a.scrollTop-s.scrollSpeed)),s.axis&&"y"===s.axis||(n.overflowOffset.left+a.offsetWidth-e.pageX<s.scrollSensitivity?a.scrollLeft=o=a.scrollLeft+s.scrollSpeed:e.pageX-n.overflowOffset.left<s.scrollSensitivity&&(a.scrollLeft=o=a.scrollLeft-s.scrollSpeed))):(s.axis&&"x"===s.axis||(e.pageY-t(r).scrollTop()<s.scrollSensitivity?o=t(r).scrollTop(t(r).scrollTop()-s.scrollSpeed):t(window).height()-(e.pageY-t(r).scrollTop())<s.scrollSensitivity&&(o=t(r).scrollTop(t(r).scrollTop()+s.scrollSpeed))),s.axis&&"y"===s.axis||(e.pageX-t(r).scrollLeft()<s.scrollSensitivity?o=t(r).scrollLeft(t(r).scrollLeft()-s.scrollSpeed):t(window).width()-(e.pageX-t(r).scrollLeft())<s.scrollSensitivity&&(o=t(r).scrollLeft(t(r).scrollLeft()+s.scrollSpeed)))),!1!==o&&t.ui.ddmanager&&!s.dropBehaviour&&t.ui.ddmanager.prepareOffsets(n,e)}}),t.ui.plugin.add("draggable","snap",{start:function(e,i,n){var s=n.options;n.snapElements=[],t(s.snap.constructor!==String?s.snap.items||":data(ui-draggable)":s.snap).each(function(){var e=t(this),i=e.offset();this!==n.element[0]&&n.snapElements.push({item:this,width:e.outerWidth(),height:e.outerHeight(),top:i.top,left:i.left})})},drag:function(e,i,n){var s,o,a,r,l,h,u,c,d,f,p=n.options,g=p.snapTolerance,m=i.offset.left,v=m+n.helperProportions.width,b=i.offset.top,_=b+n.helperProportions.height;for(d=n.snapElements.length-1;d>=0;d--)l=n.snapElements[d].left-n.margins.left,h=l+n.snapElements[d].width,u=n.snapElements[d].top-n.margins.top,c=u+n.snapElements[d].height,v<l-g||m>h+g||_<u-g||b>c+g||!t.contains(n.snapElements[d].item.ownerDocument,n.snapElements[d].item)?(n.snapElements[d].snapping&&n.options.snap.release&&n.options.snap.release.call(n.element,e,t.extend(n._uiHash(),{snapItem:n.snapElements[d].item})),n.snapElements[d].snapping=!1):("inner"!==p.snapMode&&(s=Math.abs(u-_)<=g,o=Math.abs(c-b)<=g,a=Math.abs(l-v)<=g,r=Math.abs(h-m)<=g,s&&(i.position.top=n._convertPositionTo("relative",{top:u-n.helperProportions.height,left:0}).top),o&&(i.position.top=n._convertPositionTo("relative",{top:c,left:0}).top),a&&(i.position.left=n._convertPositionTo("relative",{top:0,left:l-n.helperProportions.width}).left),r&&(i.position.left=n._convertPositionTo("relative",{top:0,left:h}).left)),f=s||o||a||r,"outer"!==p.snapMode&&(s=Math.abs(u-b)<=g,o=Math.abs(c-_)<=g,a=Math.abs(l-m)<=g,r=Math.abs(h-v)<=g,s&&(i.position.top=n._convertPositionTo("relative",{top:u,left:0}).top),o&&(i.position.top=n._convertPositionTo("relative",{top:c-n.helperProportions.height,left:0}).top),a&&(i.position.left=n._convertPositionTo("relative",{top:0,left:l}).left),r&&(i.position.left=n._convertPositionTo("relative",{top:0,left:h-n.helperProportions.width}).left)),!n.snapElements[d].snapping&&(s||o||a||r||f)&&n.options.snap.snap&&n.options.snap.snap.call(n.element,e,t.extend(n._uiHash(),{snapItem:n.snapElements[d].item})),n.snapElements[d].snapping=s||o||a||r||f)}}),t.ui.plugin.add("draggable","stack",{start:function(e,i,n){var s,o=n.options,a=t.makeArray(t(o.stack)).sort(function(e,i){return(parseInt(t(e).css("zIndex"),10)||0)-(parseInt(t(i).css("zIndex"),10)||0)});a.length&&(s=parseInt(t(a[0]).css("zIndex"),10)||0,t(a).each(function(e){t(this).css("zIndex",s+e)}),this.css("zIndex",s+a.length))}}),t.ui.plugin.add("draggable","zIndex",{start:function(e,i,n){var s=t(i.helper),o=n.options;s.css("zIndex")&&(o._zIndex=s.css("zIndex")),s.css("zIndex",o.zIndex)},stop:function(e,i,n){var s=n.options;s._zIndex&&t(i.helper).css("zIndex",s._zIndex)}});t.ui.draggable;t.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var e,i=this.options,n=i.accept;this.isover=!1,this.isout=!0,this.accept=t.isFunction(n)?n:function(t){return t.is(n)},this.proportions=function(){if(!arguments.length)return e||(e={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight});e=arguments[0]},this._addToManager(i.scope),i.addClasses&&this._addClass("ui-droppable")},_addToManager:function(e){t.ui.ddmanager.droppables[e]=t.ui.ddmanager.droppables[e]||[],t.ui.ddmanager.droppables[e].push(this)},_splice:function(t){for(var e=0;e<t.length;e++)t[e]===this&&t.splice(e,1)},_destroy:function(){var e=t.ui.ddmanager.droppables[this.options.scope];this._splice(e)},_setOption:function(e,i){if("accept"===e)this.accept=t.isFunction(i)?i:function(t){return t.is(i)};else if("scope"===e){var n=t.ui.ddmanager.droppables[this.options.scope];this._splice(n),this._addToManager(i)}this._super(e,i)},_activate:function(e){var i=t.ui.ddmanager.current;this._addActiveClass(),i&&this._trigger("activate",e,this.ui(i))},_deactivate:function(e){var i=t.ui.ddmanager.current;this._removeActiveClass(),i&&this._trigger("deactivate",e,this.ui(i))},_over:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._addHoverClass(),this._trigger("over",e,this.ui(i)))},_out:function(e){var i=t.ui.ddmanager.current;i&&(i.currentItem||i.element)[0]!==this.element[0]&&this.accept.call(this.element[0],i.currentItem||i.element)&&(this._removeHoverClass(),this._trigger("out",e,this.ui(i)))},_drop:function(e,i){var n=i||t.ui.ddmanager.current,s=!1;return!(!n||(n.currentItem||n.element)[0]===this.element[0])&&(this.element.find(":data(ui-droppable)").not(".ui-draggable-dragging").each(function(){var i=t(this).droppable("instance");if(i.options.greedy&&!i.options.disabled&&i.options.scope===n.options.scope&&i.accept.call(i.element[0],n.currentItem||n.element)&&c(n,t.extend(i,{offset:i.element.offset()}),i.options.tolerance,e))return s=!0,!1}),!s&&(!!this.accept.call(this.element[0],n.currentItem||n.element)&&(this._removeActiveClass(),this._removeHoverClass(),this._trigger("drop",e,this.ui(n)),this.element)))},ui:function(t){return{draggable:t.currentItem||t.element,helper:t.helper,position:t.position,offset:t.positionAbs}},_addHoverClass:function(){this._addClass("ui-droppable-hover")},_removeHoverClass:function(){this._removeClass("ui-droppable-hover")},_addActiveClass:function(){this._addClass("ui-droppable-active")},_removeActiveClass:function(){this._removeClass("ui-droppable-active")}});var c=t.ui.intersect=function(){function t(t,e,i){return t>=e&&t<e+i}return function(e,i,n,s){if(!i.offset)return!1;var o=(e.positionAbs||e.position.absolute).left+e.margins.left,a=(e.positionAbs||e.position.absolute).top+e.margins.top,r=o+e.helperProportions.width,l=a+e.helperProportions.height,h=i.offset.left,u=i.offset.top,c=h+i.proportions().width,d=u+i.proportions().height;switch(n){case"fit":return h<=o&&r<=c&&u<=a&&l<=d;case"intersect":return h<o+e.helperProportions.width/2&&r-e.helperProportions.width/2<c&&u<a+e.helperProportions.height/2&&l-e.helperProportions.height/2<d;case"pointer":return t(s.pageY,u,i.proportions().height)&&t(s.pageX,h,i.proportions().width);case"touch":return(a>=u&&a<=d||l>=u&&l<=d||a<u&&l>d)&&(o>=h&&o<=c||r>=h&&r<=c||o<h&&r>c);default:return!1}}}();t.ui.ddmanager={current:null,droppables:{default:[]},prepareOffsets:function(e,i){var n,s,o=t.ui.ddmanager.droppables[e.options.scope]||[],a=i?i.type:null,r=(e.currentItem||e.element).find(":data(ui-droppable)").addBack();t:for(n=0;n<o.length;n++)if(!(o[n].options.disabled||e&&!o[n].accept.call(o[n].element[0],e.currentItem||e.element))){for(s=0;s<r.length;s++)if(r[s]===o[n].element[0]){o[n].proportions().height=0;continue t}o[n].visible="none"!==o[n].element.css("display"),o[n].visible&&("mousedown"===a&&o[n]._activate.call(o[n],i),o[n].offset=o[n].element.offset(),o[n].proportions({width:o[n].element[0].offsetWidth,height:o[n].element[0].offsetHeight}))}},drop:function(e,i){var n=!1;return t.each((t.ui.ddmanager.droppables[e.options.scope]||[]).slice(),function(){this.options&&(!this.options.disabled&&this.visible&&c(e,this,this.options.tolerance,i)&&(n=this._drop.call(this,i)||n),!this.options.disabled&&this.visible&&this.accept.call(this.element[0],e.currentItem||e.element)&&(this.isout=!0,this.isover=!1,this._deactivate.call(this,i)))}),n},dragStart:function(e,i){e.element.parentsUntil("body").on("scroll.droppable",function(){e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)})},drag:function(e,i){e.options.refreshPositions&&t.ui.ddmanager.prepareOffsets(e,i),t.each(t.ui.ddmanager.droppables[e.options.scope]||[],function(){if(!this.options.disabled&&!this.greedyChild&&this.visible){var n,s,o,a=c(e,this,this.options.tolerance,i),r=!a&&this.isover?"isout":a&&!this.isover?"isover":null;r&&(this.options.greedy&&(s=this.options.scope,o=this.element.parents(":data(ui-droppable)").filter(function(){return t(this).droppable("instance").options.scope===s}),o.length&&(n=t(o[0]).droppable("instance"),n.greedyChild="isover"===r)),n&&"isover"===r&&(n.isover=!1,n.isout=!0,n._out.call(n,i)),this[r]=!0,this["isout"===r?"isover":"isout"]=!1,this["isover"===r?"_over":"_out"].call(this,i),n&&"isout"===r&&(n.isout=!1,n.isover=!0,n._over.call(n,i)))}})},dragStop:function(e,i){e.element.parentsUntil("body").off("scroll.droppable"),e.options.refreshPositions||t.ui.ddmanager.prepareOffsets(e,i)}},!1!==t.uiBackCompat&&t.widget("ui.droppable",t.ui.droppable,{options:{hoverClass:!1,activeClass:!1},_addActiveClass:function(){this._super(),this.options.activeClass&&this.element.addClass(this.options.activeClass)},_removeActiveClass:function(){this._super(),this.options.activeClass&&this.element.removeClass(this.options.activeClass)},_addHoverClass:function(){this._super(),this.options.hoverClass&&this.element.addClass(this.options.hoverClass)},_removeHoverClass:function(){this._super(),this.options.hoverClass&&this.element.removeClass(this.options.hoverClass)}});t.ui.droppable;t.widget("ui.resizable",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"resize",options:{alsoResize:!1,animate:!1,animateDuration:"slow",animateEasing:"swing",aspectRatio:!1,autoHide:!1,classes:{"ui-resizable-se":"ui-icon ui-icon-gripsmall-diagonal-se"},containment:!1,ghost:!1,grid:!1,handles:"e,s,se",helper:!1,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:90,resize:null,start:null,stop:null},_num:function(t){return parseFloat(t)||0},_isNumber:function(t){return!isNaN(parseFloat(t))},_hasScroll:function(e,i){if("hidden"===t(e).css("overflow"))return!1;var n=i&&"left"===i?"scrollLeft":"scrollTop",s=!1;return e[n]>0||(e[n]=1,s=e[n]>0,e[n]=0,s)},_create:function(){var e,i=this.options,n=this;this._addClass("ui-resizable"),t.extend(this,{_aspectRatio:!!i.aspectRatio,aspectRatio:i.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:i.helper||i.ghost||i.animate?i.helper||"ui-resizable-helper":null}),this.element[0].nodeName.match(/^(canvas|textarea|input|select|button|img)$/i)&&(this.element.wrap(t("<div class='ui-wrapper' style='overflow: hidden;'></div>").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,e={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(e),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(e),this._proportionallyResize()),this._setupHandles(),i.autoHide&&t(this.element).on("mouseenter",function(){i.disabled||(n._removeClass("ui-resizable-autohide"),n._handles.show())}).on("mouseleave",function(){i.disabled||n.resizing||(n._addClass("ui-resizable-autohide"),n._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var e,i=function(e){t(e).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(i(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),i(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles()}},_setupHandles:function(){var e,i,n,s,o,a=this.options,r=this;if(this.handles=a.handles||(t(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=t(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),n=this.handles.split(","),this.handles={},i=0;i<n.length;i++)e=t.trim(n[i]),s="ui-resizable-"+e,o=t("<div>"),this._addClass(o,"ui-resizable-handle "+s),o.css({zIndex:a.zIndex}),this.handles[e]=".ui-resizable-"+e,this.element.append(o);this._renderAxis=function(e){var i,n,s,o;e=e||this.element;for(i in this.handles)this.handles[i].constructor===String?this.handles[i]=this.element.children(this.handles[i]).first().show():(this.handles[i].jquery||this.handles[i].nodeType)&&(this.handles[i]=t(this.handles[i]),this._on(this.handles[i],{mousedown:r._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(n=t(this.handles[i],this.element),o=/sw|ne|nw|se|n|s/.test(i)?n.outerHeight():n.outerWidth(),s=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join(""),e.css(s,o),this._proportionallyResize()),this._handles=this._handles.add(this.handles[i])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){r.resizing||(this.className&&(o=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),r.axis=o&&o[1]?o[1]:"se")}),a.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(e){var i,n,s=!1;for(i in this.handles)((n=t(this.handles[i])[0])===e.target||t.contains(n,e.target))&&(s=!0);return!this.options.disabled&&s},_mouseStart:function(e){var i,n,s,o=this.options,a=this.element;return this.resizing=!0,this._renderProxy(),i=this._num(this.helper.css("left")),n=this._num(this.helper.css("top")),o.containment&&(i+=t(o.containment).scrollLeft()||0,n+=t(o.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:i,top:n},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:a.width(),height:a.height()},this.originalSize=this._helper?{width:a.outerWidth(),height:a.outerHeight()}:{width:a.width(),height:a.height()},this.sizeDiff={width:a.outerWidth()-a.width(),height:a.outerHeight()-a.height()},this.originalPosition={left:i,top:n},this.originalMousePosition={left:e.pageX,top:e.pageY},this.aspectRatio="number"==typeof o.aspectRatio?o.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=t(".ui-resizable-"+this.axis).css("cursor"),t("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",e),!0},_mouseDrag:function(e){var i,n,s=this.originalMousePosition,o=this.axis,a=e.pageX-s.left||0,r=e.pageY-s.top||0,l=this._change[o];return this._updatePrevProperties(),!!l&&(i=l.apply(this,[e,a,r]),this._updateVirtualBoundaries(e.shiftKey),(this._aspectRatio||e.shiftKey)&&(i=this._updateRatio(i,e)),i=this._respectSize(i,e),this._updateCache(i),this._propagate("resize",e),n=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),t.isEmptyObject(n)||(this._updatePrevProperties(),this._trigger("resize",e,this.ui()),this._applyChanges()),!1)},_mouseStop:function(e){this.resizing=!1;var i,n,s,o,a,r,l,h=this.options,u=this;return this._helper&&(i=this._proportionallyResizeElements,n=i.length&&/textarea/i.test(i[0].nodeName),s=n&&this._hasScroll(i[0],"left")?0:u.sizeDiff.height,o=n?0:u.sizeDiff.width,a={width:u.helper.width()-o,height:u.helper.height()-s},r=parseFloat(u.element.css("left"))+(u.position.left-u.originalPosition.left)||null,l=parseFloat(u.element.css("top"))+(u.position.top-u.originalPosition.top)||null,h.animate||this.element.css(t.extend(a,{top:l,left:r})),u.helper.height(u.size.height),u.helper.width(u.size.width),this._helper&&!h.animate&&this._proportionallyResize()),t("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",e),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,n,s,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,n=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,s=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),n>o.minHeight&&(o.minHeight=n),i<o.maxWidth&&(o.maxWidth=i),s<o.maxHeight&&(o.maxHeight=s)),this._vBoundaries=o},_updateCache:function(t){this.offset=this.helper.offset(),this._isNumber(t.left)&&(this.position.left=t.left),this._isNumber(t.top)&&(this.position.top=t.top),this._isNumber(t.height)&&(this.size.height=t.height),this._isNumber(t.width)&&(this.size.width=t.width)},_updateRatio:function(t){var e=this.position,i=this.size,n=this.axis;return this._isNumber(t.height)?t.width=t.height*this.aspectRatio:this._isNumber(t.width)&&(t.height=t.width/this.aspectRatio),"sw"===n&&(t.left=e.left+(i.width-t.width),t.top=null),"nw"===n&&(t.top=e.top+(i.height-t.height),t.left=e.left+(i.width-t.width)),t},_respectSize:function(t){
var e=this._vBoundaries,i=this.axis,n=this._isNumber(t.width)&&e.maxWidth&&e.maxWidth<t.width,s=this._isNumber(t.height)&&e.maxHeight&&e.maxHeight<t.height,o=this._isNumber(t.width)&&e.minWidth&&e.minWidth>t.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),u=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),n&&(t.width=e.maxWidth),s&&(t.height=e.maxHeight),o&&h&&(t.left=r-e.minWidth),n&&h&&(t.left=r-e.maxWidth),a&&u&&(t.top=l-e.minHeight),s&&u&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],n=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],s=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(n[e])||0,i[e]+=parseFloat(s[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e<this._proportionallyResizeElements.length;e++)t=this._proportionallyResizeElements[e],this.outerDimensions||(this.outerDimensions=this._getPaddingPlusBorderDimensions(t)),t.css({height:i.height()-this.outerDimensions.height||0,width:i.width()-this.outerDimensions.width||0})},_renderProxy:function(){var e=this.element,i=this.options;this.elementOffset=e.offset(),this._helper?(this.helper=this.helper||t("<div style='overflow:hidden;'></div>"),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++i.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var n=this.originalSize;return{top:this.originalPosition.top+i,height:n.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(e,i,n){return t.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[e,i,n]))},sw:function(e,i,n){return t.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[e,i,n]))},ne:function(e,i,n){return t.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[e,i,n]))},nw:function(e,i,n){return t.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[e,i,n]))}},_propagate:function(e,i){t.ui.plugin.call(this,e,[i,this.ui()]),"resize"!==e&&this._trigger(e,i,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),t.ui.plugin.add("resizable","animate",{stop:function(e){var i=t(this).resizable("instance"),n=i.options,s=i._proportionallyResizeElements,o=s.length&&/textarea/i.test(s[0].nodeName),a=o&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,r=o?0:i.sizeDiff.width,l={width:i.size.width-r,height:i.size.height-a},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,u=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(t.extend(l,u&&h?{top:u,left:h}:{}),{duration:n.animateDuration,easing:n.animateEasing,step:function(){var n={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&t(s[0]).css({width:n.width,height:n.height}),i._updateCache(n),i._propagate("resize",e)}})}}),t.ui.plugin.add("resizable","containment",{start:function(){var e,i,n,s,o,a,r,l=t(this).resizable("instance"),h=l.options,u=l.element,c=h.containment,d=c instanceof t?c.get(0):/parent/.test(c)?u.parent().get(0):c;d&&(l.containerElement=t(d),/document/.test(c)||c===document?(l.containerOffset={left:0,top:0},l.containerPosition={left:0,top:0},l.parentData={element:t(document),left:0,top:0,width:t(document).width(),height:t(document).height()||document.body.parentNode.scrollHeight}):(e=t(d),i=[],t(["Top","Right","Left","Bottom"]).each(function(t,n){i[t]=l._num(e.css("padding"+n))}),l.containerOffset=e.offset(),l.containerPosition=e.position(),l.containerSize={height:e.innerHeight()-i[3],width:e.innerWidth()-i[1]},n=l.containerOffset,s=l.containerSize.height,o=l.containerSize.width,a=l._hasScroll(d,"left")?d.scrollWidth:o,r=l._hasScroll(d)?d.scrollHeight:s,l.parentData={element:d,left:n.left,top:n.top,width:a,height:r}))},resize:function(e){var i,n,s,o,a=t(this).resizable("instance"),r=a.options,l=a.containerOffset,h=a.position,u=a._aspectRatio||e.shiftKey,c={top:0,left:0},d=a.containerElement,f=!0;d[0]!==document&&/static/.test(d.css("position"))&&(c=l),h.left<(a._helper?l.left:0)&&(a.size.width=a.size.width+(a._helper?a.position.left-l.left:a.position.left-c.left),u&&(a.size.height=a.size.width/a.aspectRatio,f=!1),a.position.left=r.helper?l.left:0),h.top<(a._helper?l.top:0)&&(a.size.height=a.size.height+(a._helper?a.position.top-l.top:a.position.top),u&&(a.size.width=a.size.height*a.aspectRatio,f=!1),a.position.top=a._helper?l.top:0),s=a.containerElement.get(0)===a.element.parent().get(0),o=/relative|absolute/.test(a.containerElement.css("position")),s&&o?(a.offset.left=a.parentData.left+a.position.left,a.offset.top=a.parentData.top+a.position.top):(a.offset.left=a.element.offset().left,a.offset.top=a.element.offset().top),i=Math.abs(a.sizeDiff.width+(a._helper?a.offset.left-c.left:a.offset.left-l.left)),n=Math.abs(a.sizeDiff.height+(a._helper?a.offset.top-c.top:a.offset.top-l.top)),i+a.size.width>=a.parentData.width&&(a.size.width=a.parentData.width-i,u&&(a.size.height=a.size.width/a.aspectRatio,f=!1)),n+a.size.height>=a.parentData.height&&(a.size.height=a.parentData.height-n,u&&(a.size.width=a.size.height*a.aspectRatio,f=!1)),f||(a.position.left=a.prevPosition.left,a.position.top=a.prevPosition.top,a.size.width=a.prevSize.width,a.size.height=a.prevSize.height)},stop:function(){var e=t(this).resizable("instance"),i=e.options,n=e.containerOffset,s=e.containerPosition,o=e.containerElement,a=t(e.helper),r=a.offset(),l=a.outerWidth()-e.sizeDiff.width,h=a.outerHeight()-e.sizeDiff.height;e._helper&&!i.animate&&/relative/.test(o.css("position"))&&t(this).css({left:r.left-s.left-n.left,width:l,height:h}),e._helper&&!i.animate&&/static/.test(o.css("position"))&&t(this).css({left:r.left-s.left-n.left,width:l,height:h})}}),t.ui.plugin.add("resizable","alsoResize",{start:function(){var e=t(this).resizable("instance"),i=e.options;t(i.alsoResize).each(function(){var e=t(this);e.data("ui-resizable-alsoresize",{width:parseFloat(e.width()),height:parseFloat(e.height()),left:parseFloat(e.css("left")),top:parseFloat(e.css("top"))})})},resize:function(e,i){var n=t(this).resizable("instance"),s=n.options,o=n.originalSize,a=n.originalPosition,r={height:n.size.height-o.height||0,width:n.size.width-o.width||0,top:n.position.top-a.top||0,left:n.position.left-a.left||0};t(s.alsoResize).each(function(){var e=t(this),n=t(this).data("ui-resizable-alsoresize"),s={},o=e.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];t.each(o,function(t,e){var i=(n[e]||0)+(r[e]||0);i&&i>=0&&(s[e]=i||null)}),e.css(s)})},stop:function(){t(this).removeData("ui-resizable-alsoresize")}}),t.ui.plugin.add("resizable","ghost",{start:function(){var e=t(this).resizable("instance"),i=e.size;e.ghost=e.originalElement.clone(),e.ghost.css({opacity:.25,display:"block",position:"relative",height:i.height,width:i.width,margin:0,left:0,top:0}),e._addClass(e.ghost,"ui-resizable-ghost"),!1!==t.uiBackCompat&&"string"==typeof e.options.ghost&&e.ghost.addClass(this.options.ghost),e.ghost.appendTo(e.helper)},resize:function(){var e=t(this).resizable("instance");e.ghost&&e.ghost.css({position:"relative",height:e.size.height,width:e.size.width})},stop:function(){var e=t(this).resizable("instance");e.ghost&&e.helper&&e.helper.get(0).removeChild(e.ghost.get(0))}}),t.ui.plugin.add("resizable","grid",{resize:function(){var e,i=t(this).resizable("instance"),n=i.options,s=i.size,o=i.originalSize,a=i.originalPosition,r=i.axis,l="number"==typeof n.grid?[n.grid,n.grid]:n.grid,h=l[0]||1,u=l[1]||1,c=Math.round((s.width-o.width)/h)*h,d=Math.round((s.height-o.height)/u)*u,f=o.width+c,p=o.height+d,g=n.maxWidth&&n.maxWidth<f,m=n.maxHeight&&n.maxHeight<p,v=n.minWidth&&n.minWidth>f,b=n.minHeight&&n.minHeight>p;n.grid=l,v&&(f+=h),b&&(p+=u),g&&(f-=h),m&&(p-=u),/^(se|s|e)$/.test(r)?(i.size.width=f,i.size.height=p):/^(ne)$/.test(r)?(i.size.width=f,i.size.height=p,i.position.top=a.top-d):/^(sw)$/.test(r)?(i.size.width=f,i.size.height=p,i.position.left=a.left-c):((p-u<=0||f-h<=0)&&(e=i._getPaddingPlusBorderDimensions(this)),p-u>0?(i.size.height=p,i.position.top=a.top-d):(p=u-e.height,i.size.height=p,i.position.top=a.top+o.height-p),f-h>0?(i.size.width=f,i.position.left=a.left-c):(f=h-e.width,i.size.width=f,i.position.left=a.left+o.width-f))}});t.ui.resizable,t.widget("ui.selectable",t.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var e=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){e.elementPos=t(e.element[0]).offset(),e.selectees=t(e.options.filter,e.element[0]),e._addClass(e.selectees,"ui-selectee"),e.selectees.each(function(){var i=t(this),n=i.offset(),s={left:n.left-e.elementPos.left,top:n.top-e.elementPos.top};t.data(this,"selectable-item",{element:this,$element:i,left:s.left,top:s.top,right:s.left+i.outerWidth(),bottom:s.top+i.outerHeight(),startselected:!1,selected:i.hasClass("ui-selected"),selecting:i.hasClass("ui-selecting"),unselecting:i.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=t("<div>"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(e){var i=this,n=this.options;this.opos=[e.pageX,e.pageY],this.elementPos=t(this.element[0]).offset(),this.options.disabled||(this.selectees=t(n.filter,this.element[0]),this._trigger("start",e),t(n.appendTo).append(this.helper),this.helper.css({left:e.pageX,top:e.pageY,width:0,height:0}),n.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var n=t.data(this,"selectable-item");n.startselected=!0,e.metaKey||e.ctrlKey||(i._removeClass(n.$element,"ui-selected"),n.selected=!1,i._addClass(n.$element,"ui-unselecting"),n.unselecting=!0,i._trigger("unselecting",e,{unselecting:n.element}))}),t(e.target).parents().addBack().each(function(){var n,s=t.data(this,"selectable-item");if(s)return n=!e.metaKey&&!e.ctrlKey||!s.$element.hasClass("ui-selected"),i._removeClass(s.$element,n?"ui-unselecting":"ui-selected")._addClass(s.$element,n?"ui-selecting":"ui-unselecting"),s.unselecting=!n,s.selecting=n,s.selected=n,n?i._trigger("selecting",e,{selecting:s.element}):i._trigger("unselecting",e,{unselecting:s.element}),!1}))},_mouseDrag:function(e){if(this.dragged=!0,!this.options.disabled){var i,n=this,s=this.options,o=this.opos[0],a=this.opos[1],r=e.pageX,l=e.pageY;return o>r&&(i=r,r=o,o=i),a>l&&(i=l,l=a,a=i),this.helper.css({left:o,top:a,width:r-o,height:l-a}),this.selectees.each(function(){var i=t.data(this,"selectable-item"),h=!1,u={};i&&i.element!==n.element[0]&&(u.left=i.left+n.elementPos.left,u.right=i.right+n.elementPos.left,u.top=i.top+n.elementPos.top,u.bottom=i.bottom+n.elementPos.top,"touch"===s.tolerance?h=!(u.left>r||u.right<o||u.top>l||u.bottom<a):"fit"===s.tolerance&&(h=u.left>o&&u.right<r&&u.top>a&&u.bottom<l),h?(i.selected&&(n._removeClass(i.$element,"ui-selected"),i.selected=!1),i.unselecting&&(n._removeClass(i.$element,"ui-unselecting"),i.unselecting=!1),i.selecting||(n._addClass(i.$element,"ui-selecting"),i.selecting=!0,n._trigger("selecting",e,{selecting:i.element}))):(i.selecting&&((e.metaKey||e.ctrlKey)&&i.startselected?(n._removeClass(i.$element,"ui-selecting"),i.selecting=!1,n._addClass(i.$element,"ui-selected"),i.selected=!0):(n._removeClass(i.$element,"ui-selecting"),i.selecting=!1,i.startselected&&(n._addClass(i.$element,"ui-unselecting"),i.unselecting=!0),n._trigger("unselecting",e,{unselecting:i.element}))),i.selected&&(e.metaKey||e.ctrlKey||i.startselected||(n._removeClass(i.$element,"ui-selected"),i.selected=!1,n._addClass(i.$element,"ui-unselecting"),i.unselecting=!0,n._trigger("unselecting",e,{unselecting:i.element})))))}),!1}},_mouseStop:function(e){var i=this;return this.dragged=!1,t(".ui-unselecting",this.element[0]).each(function(){var n=t.data(this,"selectable-item");i._removeClass(n.$element,"ui-unselecting"),n.unselecting=!1,n.startselected=!1,i._trigger("unselected",e,{unselected:n.element})}),t(".ui-selecting",this.element[0]).each(function(){var n=t.data(this,"selectable-item");i._removeClass(n.$element,"ui-selecting")._addClass(n.$element,"ui-selected"),n.selecting=!1,n.selected=!0,n.startselected=!0,i._trigger("selected",e,{selected:n.element})}),this._trigger("stop",e),this.helper.remove(),!1}}),t.widget("ui.sortable",t.ui.mouse,{version:"1.12.1",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},_isOverAxis:function(t,e,i){return t>=e&&t<e+i},_isFloating:function(t){return/left|right/.test(t.css("float"))||/inline|table-cell/.test(t.css("display"))},_create:function(){this.containerCache={},this._addClass("ui-sortable"),this.refresh(),this.offset=this.element.offset(),this._mouseInit(),this._setHandleClassName(),this.ready=!0},_setOption:function(t,e){this._super(t,e),"handle"===t&&this._setHandleClassName()},_setHandleClassName:function(){var e=this;this._removeClass(this.element.find(".ui-sortable-handle"),"ui-sortable-handle"),t.each(this.items,function(){e._addClass(this.instance.options.handle?this.item.find(this.instance.options.handle):this.item,"ui-sortable-handle")})},_destroy:function(){this._mouseDestroy();for(var t=this.items.length-1;t>=0;t--)this.items[t].item.removeData(this.widgetName+"-item");return this},_mouseCapture:function(e,i){var n=null,s=!1,o=this;return!this.reverting&&(!this.options.disabled&&"static"!==this.options.type&&(this._refreshItems(e),t(e.target).parents().each(function(){if(t.data(this,o.widgetName+"-item")===o)return n=t(this),!1}),t.data(e.target,o.widgetName+"-item")===o&&(n=t(e.target)),!!n&&(!(this.options.handle&&!i&&(t(this.options.handle,n).find("*").addBack().each(function(){this===e.target&&(s=!0)}),!s))&&(this.currentItem=n,this._removeCurrentsFromItems(),!0))))},_mouseStart:function(e,i,n){var s,o,a=this.options;if(this.currentContainer=this,this.refreshPositions(),this.helper=this._createHelper(e),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},t.extend(this.offset,{click:{left:e.pageX-this.offset.left,top:e.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(e),this.originalPageX=e.pageX,this.originalPageY=e.pageY,a.cursorAt&&this._adjustOffsetFromHelper(a.cursorAt),this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]},this.helper[0]!==this.currentItem[0]&&this.currentItem.hide(),this._createPlaceholder(),a.containment&&this._setContainment(),a.cursor&&"auto"!==a.cursor&&(o=this.document.find("body"),this.storedCursor=o.css("cursor"),o.css("cursor",a.cursor),this.storedStylesheet=t("<style>*{ cursor: "+a.cursor+" !important; }</style>").appendTo(o)),a.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",a.opacity)),a.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",a.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",e,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!n)for(s=this.containers.length-1;s>=0;s--)this.containers[s]._trigger("activate",e,this._uiHash(this));return t.ui.ddmanager&&(t.ui.ddmanager.current=this),t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(e),!0},_mouseDrag:function(e){var i,n,s,o,a=this.options,r=!1;for(this.position=this._generatePosition(e),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-e.pageY<a.scrollSensitivity?this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop+a.scrollSpeed:e.pageY-this.overflowOffset.top<a.scrollSensitivity&&(this.scrollParent[0].scrollTop=r=this.scrollParent[0].scrollTop-a.scrollSpeed),this.overflowOffset.left+this.scrollParent[0].offsetWidth-e.pageX<a.scrollSensitivity?this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft+a.scrollSpeed:e.pageX-this.overflowOffset.left<a.scrollSensitivity&&(this.scrollParent[0].scrollLeft=r=this.scrollParent[0].scrollLeft-a.scrollSpeed)):(e.pageY-this.document.scrollTop()<a.scrollSensitivity?r=this.document.scrollTop(this.document.scrollTop()-a.scrollSpeed):this.window.height()-(e.pageY-this.document.scrollTop())<a.scrollSensitivity&&(r=this.document.scrollTop(this.document.scrollTop()+a.scrollSpeed)),e.pageX-this.document.scrollLeft()<a.scrollSensitivity?r=this.document.scrollLeft(this.document.scrollLeft()-a.scrollSpeed):this.window.width()-(e.pageX-this.document.scrollLeft())<a.scrollSensitivity&&(r=this.document.scrollLeft(this.document.scrollLeft()+a.scrollSpeed))),!1!==r&&t.ui.ddmanager&&!a.dropBehaviour&&t.ui.ddmanager.prepareOffsets(this,e)),this.positionAbs=this._convertPositionTo("absolute"),this.options.axis&&"y"===this.options.axis||(this.helper[0].style.left=this.position.left+"px"),this.options.axis&&"x"===this.options.axis||(this.helper[0].style.top=this.position.top+"px"),i=this.items.length-1;i>=0;i--)if(n=this.items[i],s=n.item[0],(o=this._intersectsWithPointer(n))&&n.instance===this.currentContainer&&!(s===this.currentItem[0]||this.placeholder[1===o?"next":"prev"]()[0]===s||t.contains(this.placeholder[0],s)||"semi-dynamic"===this.options.type&&t.contains(this.element[0],s))){if(this.direction=1===o?"down":"up","pointer"!==this.options.tolerance&&!this._intersectsWithSides(n))break;this._rearrange(e,n),this._trigger("change",e,this._uiHash());break}return this._contactContainers(e),t.ui.ddmanager&&t.ui.ddmanager.drag(this,e),this._trigger("sort",e,this._uiHash()),this.lastPositionAbs=this.positionAbs,!1},_mouseStop:function(e,i){if(e){if(t.ui.ddmanager&&!this.options.dropBehaviour&&t.ui.ddmanager.drop(this,e),this.options.revert){var n=this,s=this.placeholder.offset(),o=this.options.axis,a={};o&&"x"!==o||(a.left=s.left-this.offset.parent.left-this.margins.left+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollLeft)),o&&"y"!==o||(a.top=s.top-this.offset.parent.top-this.margins.top+(this.offsetParent[0]===this.document[0].body?0:this.offsetParent[0].scrollTop)),this.reverting=!0,t(this.helper).animate(a,parseInt(this.options.revert,10)||500,function(){n._clear(e)})}else this._clear(e,i);return!1}},cancel:function(){if(this.dragging){this._mouseUp(new t.Event("mouseup",{target:null})),"original"===this.options.helper?(this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")):this.currentItem.show();for(var e=this.containers.length-1;e>=0;e--)this.containers[e]._trigger("deactivate",null,this._uiHash(this)),this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",null,this._uiHash(this)),this.containers[e].containerCache.over=0)}return this.placeholder&&(this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]),"original"!==this.options.helper&&this.helper&&this.helper[0].parentNode&&this.helper.remove(),t.extend(this,{helper:null,dragging:!1,reverting:!1,_noFinalSort:null}),this.domPosition.prev?t(this.domPosition.prev).after(this.currentItem):t(this.domPosition.parent).prepend(this.currentItem)),this},serialize:function(e){var i=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},t(i).each(function(){var i=(t(e.item||this).attr(e.attribute||"id")||"").match(e.expression||/(.+)[\-=_](.+)/);i&&n.push((e.key||i[1]+"[]")+"="+(e.key&&e.expression?i[1]:i[2]))}),!n.length&&e.key&&n.push(e.key+"="),n.join("&")},toArray:function(e){var i=this._getItemsAsjQuery(e&&e.connected),n=[];return e=e||{},i.each(function(){n.push(t(e.item||this).attr(e.attribute||"id")||"")}),n},_intersectsWith:function(t){var e=this.positionAbs.left,i=e+this.helperProportions.width,n=this.positionAbs.top,s=n+this.helperProportions.height,o=t.left,a=o+t.width,r=t.top,l=r+t.height,h=this.offset.click.top,u=this.offset.click.left,c="x"===this.options.axis||n+h>r&&n+h<l,d="y"===this.options.axis||e+u>o&&e+u<a,f=c&&d;return"pointer"===this.options.tolerance||this.options.forcePointerForContainers||"pointer"!==this.options.tolerance&&this.helperProportions[this.floating?"width":"height"]>t[this.floating?"width":"height"]?f:o<e+this.helperProportions.width/2&&i-this.helperProportions.width/2<a&&r<n+this.helperProportions.height/2&&s-this.helperProportions.height/2<l},_intersectsWithPointer:function(t){var e,i,n="x"===this.options.axis||this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top,t.height),s="y"===this.options.axis||this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left,t.width);return!(!n||!s)&&(e=this._getDragVerticalDirection(),i=this._getDragHorizontalDirection(),this.floating?"right"===i||"down"===e?2:1:e&&("down"===e?2:1))},_intersectsWithSides:function(t){var e=this._isOverAxis(this.positionAbs.top+this.offset.click.top,t.top+t.height/2,t.height),i=this._isOverAxis(this.positionAbs.left+this.offset.click.left,t.left+t.width/2,t.width),n=this._getDragVerticalDirection(),s=this._getDragHorizontalDirection();return this.floating&&s?"right"===s&&i||"left"===s&&!i:n&&("down"===n&&e||"up"===n&&!e)},_getDragVerticalDirection:function(){var t=this.positionAbs.top-this.lastPositionAbs.top;return 0!==t&&(t>0?"down":"up")},_getDragHorizontalDirection:function(){var t=this.positionAbs.left-this.lastPositionAbs.left;return 0!==t&&(t>0?"right":"left")},refresh:function(t){return this._refreshItems(t),this._setHandleClassName(),this.refreshPositions(),this},_connectWith:function(){var t=this.options;return t.connectWith.constructor===String?[t.connectWith]:t.connectWith},_getItemsAsjQuery:function(e){function i(){r.push(this)}var n,s,o,a,r=[],l=[],h=this._connectWith();if(h&&e)for(n=h.length-1;n>=0;n--)for(o=t(h[n],this.document[0]),s=o.length-1;s>=0;s--)(a=t.data(o[s],this.widgetFullName))&&a!==this&&!a.options.disabled&&l.push([t.isFunction(a.options.items)?a.options.items.call(a.element):t(a.options.items,a.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),a]);for(l.push([t.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):t(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]),n=l.length-1;n>=0;n--)l[n][0].each(i);return t(r)},_removeCurrentsFromItems:function(){var e=this.currentItem.find(":data("+this.widgetName+"-item)");this.items=t.grep(this.items,function(t){for(var i=0;i<e.length;i++)if(e[i]===t.item[0])return!1;return!0})},_refreshItems:function(e){this.items=[],this.containers=[this];var i,n,s,o,a,r,l,h,u=this.items,c=[[t.isFunction(this.options.items)?this.options.items.call(this.element[0],e,{item:this.currentItem}):t(this.options.items,this.element),this]],d=this._connectWith();if(d&&this.ready)for(i=d.length-1;i>=0;i--)for(s=t(d[i],this.document[0]),n=s.length-1;n>=0;n--)(o=t.data(s[n],this.widgetFullName))&&o!==this&&!o.options.disabled&&(c.push([t.isFunction(o.options.items)?o.options.items.call(o.element[0],e,{item:this.currentItem}):t(o.options.items,o.element),o]),this.containers.push(o));for(i=c.length-1;i>=0;i--)for(a=c[i][1],r=c[i][0],n=0,h=r.length;n<h;n++)l=t(r[n]),l.data(this.widgetName+"-item",a),u.push({item:l,instance:a,width:0,height:0,left:0,top:0})},refreshPositions:function(e){this.floating=!!this.items.length&&("x"===this.options.axis||this._isFloating(this.items[0].item)),this.offsetParent&&this.helper&&(this.offset.parent=this._getParentOffset());var i,n,s,o;for(i=this.items.length-1;i>=0;i--)n=this.items[i],n.instance!==this.currentContainer&&this.currentContainer&&n.item[0]!==this.currentItem[0]||(s=this.options.toleranceElement?t(this.options.toleranceElement,n.item):n.item,e||(n.width=s.outerWidth(),n.height=s.outerHeight()),o=s.offset(),n.left=o.left,n.top=o.top);if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(i=this.containers.length-1;i>=0;i--)o=this.containers[i].element.offset(),this.containers[i].containerCache.left=o.left,this.containers[i].containerCache.top=o.top,this.containers[i].containerCache.width=this.containers[i].element.outerWidth(),this.containers[i].containerCache.height=this.containers[i].element.outerHeight();return this},_createPlaceholder:function(e){e=e||this;var i,n=e.options;n.placeholder&&n.placeholder.constructor!==String||(i=n.placeholder,n.placeholder={element:function(){var n=e.currentItem[0].nodeName.toLowerCase(),s=t("<"+n+">",e.document[0]);return e._addClass(s,"ui-sortable-placeholder",i||e.currentItem[0].className)._removeClass(s,"ui-sortable-helper"),"tbody"===n?e._createTrPlaceholder(e.currentItem.find("tr").eq(0),t("<tr>",e.document[0]).appendTo(s)):"tr"===n?e._createTrPlaceholder(e.currentItem,s):"img"===n&&s.attr("src",e.currentItem.attr("src")),i||s.css("visibility","hidden"),s},update:function(t,s){i&&!n.forcePlaceholderSize||(s.height()||s.height(e.currentItem.innerHeight()-parseInt(e.currentItem.css("paddingTop")||0,10)-parseInt(e.currentItem.css("paddingBottom")||0,10)),s.width()||s.width(e.currentItem.innerWidth()-parseInt(e.currentItem.css("paddingLeft")||0,10)-parseInt(e.currentItem.css("paddingRight")||0,10)))}}),e.placeholder=t(n.placeholder.element.call(e.element,e.currentItem)),e.currentItem.after(e.placeholder),n.placeholder.update(e,e.placeholder)},_createTrPlaceholder:function(e,i){var n=this;e.children().each(function(){t("<td>&#160;</td>",n.document[0]).attr("colspan",t(this).attr("colspan")||1).appendTo(i)})},_contactContainers:function(e){var i,n,s,o,a,r,l,h,u,c,d=null,f=null;for(i=this.containers.length-1;i>=0;i--)if(!t.contains(this.currentItem[0],this.containers[i].element[0]))if(this._intersectsWith(this.containers[i].containerCache)){if(d&&t.contains(this.containers[i].element[0],d.element[0]))continue;d=this.containers[i],f=i}else this.containers[i].containerCache.over&&(this.containers[i]._trigger("out",e,this._uiHash(this)),this.containers[i].containerCache.over=0);if(d)if(1===this.containers.length)this.containers[f].containerCache.over||(this.containers[f]._trigger("over",e,this._uiHash(this)),this.containers[f].containerCache.over=1);else{for(s=1e4,o=null,u=d.floating||this._isFloating(this.currentItem),a=u?"left":"top",r=u?"width":"height",c=u?"pageX":"pageY",n=this.items.length-1;n>=0;n--)t.contains(this.containers[f].element[0],this.items[n].item[0])&&this.items[n].item[0]!==this.currentItem[0]&&(l=this.items[n].item.offset()[a],h=!1,e[c]-l>this.items[n][r]/2&&(h=!0),Math.abs(e[c]-l)<s&&(s=Math.abs(e[c]-l),o=this.items[n],this.direction=h?"up":"down"));if(!o&&!this.options.dropOnEmpty)return;if(this.currentContainer===this.containers[f])return void(this.currentContainer.containerCache.over||(this.containers[f]._trigger("over",e,this._uiHash()),this.currentContainer.containerCache.over=1));o?this._rearrange(e,o,null,!0):this._rearrange(e,null,this.containers[f].element,!0),this._trigger("change",e,this._uiHash()),this.containers[f]._trigger("change",e,this._uiHash(this)),this.currentContainer=this.containers[f],this.options.placeholder.update(this.currentContainer,this.placeholder),this.containers[f]._trigger("over",e,this._uiHash(this)),this.containers[f].containerCache.over=1}},_createHelper:function(e){var i=this.options,n=t.isFunction(i.helper)?t(i.helper.apply(this.element[0],[e,this.currentItem])):"clone"===i.helper?this.currentItem.clone():this.currentItem;return n.parents("body").length||t("parent"!==i.appendTo?i.appendTo:this.currentItem[0].parentNode)[0].appendChild(n[0]),n[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")}),n[0].style.width&&!i.forceHelperSize||n.width(this.currentItem.width()),n[0].style.height&&!i.forceHelperSize||n.height(this.currentItem.height()),n},_adjustOffsetFromHelper:function(e){"string"==typeof e&&(e=e.split(" ")),t.isArray(e)&&(e={left:+e[0],top:+e[1]||0}),"left"in e&&(this.offset.click.left=e.left+this.margins.left),"right"in e&&(this.offset.click.left=this.helperProportions.width-e.right+this.margins.left),"top"in e&&(this.offset.click.top=e.top+this.margins.top),"bottom"in e&&(this.offset.click.top=this.helperProportions.height-e.bottom+this.margins.top)},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var e=this.offsetParent.offset();return"absolute"===this.cssPosition&&this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])&&(e.left+=this.scrollParent.scrollLeft(),e.top+=this.scrollParent.scrollTop()),(this.offsetParent[0]===this.document[0].body||this.offsetParent[0].tagName&&"html"===this.offsetParent[0].tagName.toLowerCase()&&t.ui.ie)&&(e={top:0,left:0}),{top:e.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:e.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if("relative"===this.cssPosition){var t=this.currentItem.position();return{top:t.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:t.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 e,i,n,s=this.options;"parent"===s.containment&&(s.containment=this.helper[0].parentNode),
"document"!==s.containment&&"window"!==s.containment||(this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,"document"===s.containment?this.document.width():this.window.width()-this.helperProportions.width-this.margins.left,("document"===s.containment?this.document.height()||document.body.parentNode.scrollHeight:this.window.height()||this.document[0].body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top]),/^(document|window|parent)$/.test(s.containment)||(e=t(s.containment)[0],i=t(s.containment).offset(),n="hidden"!==t(e).css("overflow"),this.containment=[i.left+(parseInt(t(e).css("borderLeftWidth"),10)||0)+(parseInt(t(e).css("paddingLeft"),10)||0)-this.margins.left,i.top+(parseInt(t(e).css("borderTopWidth"),10)||0)+(parseInt(t(e).css("paddingTop"),10)||0)-this.margins.top,i.left+(n?Math.max(e.scrollWidth,e.offsetWidth):e.offsetWidth)-(parseInt(t(e).css("borderLeftWidth"),10)||0)-(parseInt(t(e).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,i.top+(n?Math.max(e.scrollHeight,e.offsetHeight):e.offsetHeight)-(parseInt(t(e).css("borderTopWidth"),10)||0)-(parseInt(t(e).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top])},_convertPositionTo:function(e,i){i||(i=this.position);var n="absolute"===e?1:-1,s="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:i.top+this.offset.relative.top*n+this.offset.parent.top*n-("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:s.scrollTop())*n,left:i.left+this.offset.relative.left*n+this.offset.parent.left*n-("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*n}},_generatePosition:function(e){var i,n,s=this.options,o=e.pageX,a=e.pageY,r="absolute"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&t.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,l=/(html|body)/i.test(r[0].tagName);return"relative"!==this.cssPosition||this.scrollParent[0]!==this.document[0]&&this.scrollParent[0]!==this.offsetParent[0]||(this.offset.relative=this._getRelativeOffset()),this.originalPosition&&(this.containment&&(e.pageX-this.offset.click.left<this.containment[0]&&(o=this.containment[0]+this.offset.click.left),e.pageY-this.offset.click.top<this.containment[1]&&(a=this.containment[1]+this.offset.click.top),e.pageX-this.offset.click.left>this.containment[2]&&(o=this.containment[2]+this.offset.click.left),e.pageY-this.offset.click.top>this.containment[3]&&(a=this.containment[3]+this.offset.click.top)),s.grid&&(i=this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1],a=this.containment?i-this.offset.click.top>=this.containment[1]&&i-this.offset.click.top<=this.containment[3]?i:i-this.offset.click.top>=this.containment[1]?i-s.grid[1]:i+s.grid[1]:i,n=this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0],o=this.containment?n-this.offset.click.left>=this.containment[0]&&n-this.offset.click.left<=this.containment[2]?n:n-this.offset.click.left>=this.containment[0]?n-s.grid[0]:n+s.grid[0]:n)),{top:a-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():l?0:r.scrollTop()),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():l?0:r.scrollLeft())}},_rearrange:function(t,e,i,n){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var s=this.counter;this._delay(function(){s===this.counter&&this.refreshPositions(!n)})},_clear:function(t,e){function i(t,e,i){return function(n){i._trigger(t,n,e._uiHash(e))}}this.reverting=!1;var n,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(n in this._storedCSS)"auto"!==this._storedCSS[n]&&"static"!==this._storedCSS[n]||(this._storedCSS[n]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(t){return function(e){t._trigger("receive",e,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(t){return function(e){t._trigger("update",e,this._uiHash(this))}}.call(this,this.currentContainer)))),n=this.containers.length-1;n>=0;n--)e||s.push(i("deactivate",this,this.containers[n])),this.containers[n].containerCache.over&&(s.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","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(n=0;n<s.length;n++)s[n].call(this,t);this._trigger("stop",t,this._uiHash())}return this.fromOutside=!1,!this.cancelHelperRemoval},_trigger:function(){!1===t.Widget.prototype._trigger.apply(this,arguments)&&this.cancel()},_uiHash:function(e){var i=e||this;return{helper:i.helper,placeholder:i.placeholder||t([]),position:i.position,originalPosition:i.originalPosition,offset:i.positionAbs,item:i.currentItem,sender:e?e.element:null}}}),t.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var e=this.options;this.prevShow=this.prevHide=t(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),e.collapsible||!1!==e.active&&null!=e.active||(e.active=0),this._processPanels(),e.active<0&&(e.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():t()}},_createIcons:function(){var e,i,n=this.options.icons;n&&(e=t("<span>"),this._addClass(e,"ui-accordion-header-icon","ui-icon "+n.header),e.prependTo(this.headers),i=this.active.children(".ui-accordion-header-icon"),this._removeClass(i,n.header)._addClass(i,null,n.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){if("active"===t)return void this._activate(e);"event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons())},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(e){if(!e.altKey&&!e.ctrlKey){var i=t.ui.keyCode,n=this.headers.length,s=this.headers.index(e.target),o=!1;switch(e.keyCode){case i.RIGHT:case i.DOWN:o=this.headers[(s+1)%n];break;case i.LEFT:case i.UP:o=this.headers[(s-1+n)%n];break;case i.SPACE:case i.ENTER:this._eventHandler(e);break;case i.HOME:o=this.headers[0];break;case i.END:o=this.headers[n-1]}o&&(t(e.target).attr("tabIndex",-1),t(o).attr("tabIndex",0),t(o).trigger("focus"),e.preventDefault())}},_panelKeyDown:function(e){e.keyCode===t.ui.keyCode.UP&&e.ctrlKey&&t(e.currentTarget).prev().trigger("focus")},refresh:function(){var e=this.options;this._processPanels(),!1===e.active&&!0===e.collapsible||!this.headers.length?(e.active=!1,this.active=t()):!1===e.active?this._activate(0):this.active.length&&!t.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(e.active=!1,this.active=t()):this._activate(Math.max(0,e.active-1)):e.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var e,i=this.options,n=i.heightStyle,s=this.element.parent();this.active=this._findActive(i.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var e=t(this),i=e.uniqueId().attr("id"),n=e.next(),s=n.uniqueId().attr("id");e.attr("aria-controls",s),n.attr("aria-labelledby",i)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(i.event),"fill"===n?(e=s.height(),this.element.siblings(":visible").each(function(){var i=t(this),n=i.css("position");"absolute"!==n&&"fixed"!==n&&(e-=i.outerHeight(!0))}),this.headers.each(function(){e-=t(this).outerHeight(!0)}),this.headers.next().each(function(){t(this).height(Math.max(0,e-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===n&&(e=0,this.headers.next().each(function(){var i=t(this).is(":visible");i||t(this).show(),e=Math.max(e,t(this).css("height","").height()),i||t(this).hide()}).height(e))},_activate:function(e){var i=this._findActive(e)[0];i!==this.active[0]&&(i=i||this.active[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return"number"==typeof e?this.headers.eq(e):t()},_setupEvents:function(e){var i={keydown:"_keydown"};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(e){var i,n,s=this.options,o=this.active,a=t(e.currentTarget),r=a[0]===o[0],l=r&&s.collapsible,h=l?t():a.next(),u=o.next(),c={oldHeader:o,oldPanel:u,newHeader:l?t():a,newPanel:h};e.preventDefault(),r&&!s.collapsible||!1===this._trigger("beforeActivate",e,c)||(s.active=!l&&this.headers.index(a),this.active=r?t():a,this._toggle(c),this._removeClass(o,"ui-accordion-header-active","ui-state-active"),s.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,s.icons.activeHeader)._addClass(i,null,s.icons.header)),r||(this._removeClass(a,"ui-accordion-header-collapsed")._addClass(a,"ui-accordion-header-active","ui-state-active"),s.icons&&(n=a.children(".ui-accordion-header-icon"),this._removeClass(n,null,s.icons.header)._addClass(n,null,s.icons.activeHeader)),this._addClass(a.next(),"ui-accordion-content-active")))},_toggle:function(e){var i=e.newPanel,n=this.prevShow.length?this.prevShow:e.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=i,this.prevHide=n,this.options.animate?this._animate(i,n,e):(n.hide(),i.show(),this._toggleComplete(e)),n.attr({"aria-hidden":"true"}),n.prev().attr({"aria-selected":"false","aria-expanded":"false"}),i.length&&n.length?n.prev().attr({tabIndex:-1,"aria-expanded":"false"}):i.length&&this.headers.filter(function(){return 0===parseInt(t(this).attr("tabIndex"),10)}).attr("tabIndex",-1),i.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,e,i){var n,s,o,a=this,r=0,l=t.css("box-sizing"),h=t.length&&(!e.length||t.index()<e.index()),u=this.options.animate||{},c=h&&u.down||u,d=function(){a._toggleComplete(i)};return"number"==typeof c&&(o=c),"string"==typeof c&&(s=c),s=s||c.easing||u.easing,o=o||c.duration||u.duration,e.length?t.length?(n=t.show().outerHeight(),e.animate(this.hideProps,{duration:o,easing:s,step:function(t,e){e.now=Math.round(t)}}),void t.hide().animate(this.showProps,{duration:o,easing:s,complete:d,step:function(t,i){i.now=Math.round(t),"height"!==i.prop?"content-box"===l&&(r+=i.now):"content"!==a.options.heightStyle&&(i.now=Math.round(n-e.outerHeight()-r),r=0)}})):e.animate(this.hideProps,o,s,d):t.animate(this.showProps,o,s,d)},_toggleComplete:function(t){var e=t.oldPanel,i=e.prev();this._removeClass(e,"ui-accordion-content-active"),this._removeClass(i,"ui-accordion-header-active")._addClass(i,"ui-accordion-header-collapsed"),e.length&&(e.parent()[0].className=e.parent()[0].className),this._trigger("activate",null,t)}}),t.widget("ui.menu",{version:"1.12.1",defaultElement:"<ul>",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(e){var i=t(e.target),n=t(t.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&i.not(".ui-state-disabled").length&&(this.select(e),e.isPropagationStopped()||(this.mouseHandled=!0),i.has(".ui-menu").length?this.expand(e):!this.element.is(":focus")&&n.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(e){if(!this.previousFilter){var i=t(e.target).closest(".ui-menu-item"),n=t(e.currentTarget);i[0]===n[0]&&(this._removeClass(n.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(e,n))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(e){this._delay(function(){!t.contains(this.element[0],t.ui.safeActiveElement(this.document[0]))&&this.collapseAll(e)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var e=this.element.find(".ui-menu-item").removeAttr("role aria-disabled"),i=e.children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),i.children().each(function(){var e=t(this);e.data("ui-menu-submenu-caret")&&e.remove()})},_keydown:function(e){var i,n,s,o,a=!0;switch(e.keyCode){case t.ui.keyCode.PAGE_UP:this.previousPage(e);break;case t.ui.keyCode.PAGE_DOWN:this.nextPage(e);break;case t.ui.keyCode.HOME:this._move("first","first",e);break;case t.ui.keyCode.END:this._move("last","last",e);break;case t.ui.keyCode.UP:this.previous(e);break;case t.ui.keyCode.DOWN:this.next(e);break;case t.ui.keyCode.LEFT:this.collapse(e);break;case t.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(e);break;case t.ui.keyCode.ENTER:case t.ui.keyCode.SPACE:this._activate(e);break;case t.ui.keyCode.ESCAPE:this.collapse(e);break;default:a=!1,n=this.previousFilter||"",o=!1,s=e.keyCode>=96&&e.keyCode<=105?(e.keyCode-96).toString():String.fromCharCode(e.keyCode),clearTimeout(this.filterTimer),s===n?o=!0:s=n+s,i=this._filterMenuItems(s),i=o&&-1!==i.index(this.active.next())?this.active.nextAll(".ui-menu-item"):i,i.length||(s=String.fromCharCode(e.keyCode),i=this._filterMenuItems(s)),i.length?(this.focus(e,i),this.previousFilter=s,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}a&&e.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var e,i,n,s,o,a=this,r=this.options.icons.submenu,l=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),n=l.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var e=t(this),i=e.prev(),n=t("<span>").data("ui-menu-submenu-caret",!0);a._addClass(n,"ui-menu-icon","ui-icon "+r),i.attr("aria-haspopup","true").prepend(n),e.attr("aria-labelledby",i.attr("id"))}),this._addClass(n,"ui-menu","ui-widget ui-widget-content ui-front"),e=l.add(this.element),i=e.find(this.options.items),i.not(".ui-menu-item").each(function(){var e=t(this);a._isDivider(e)&&a._addClass(e,"ui-menu-divider","ui-widget-content")}),s=i.not(".ui-menu-item, .ui-menu-divider"),o=s.children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(s,"ui-menu-item")._addClass(o,"ui-menu-item-wrapper"),i.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!t.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,n,s;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),n=this.active.children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",n.attr("id")),s=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),i=e.children(".ui-menu"),i.length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(e){var i,n,s,o,a,r;this._hasScroll()&&(i=parseFloat(t.css(this.activeMenu[0],"borderTopWidth"))||0,n=parseFloat(t.css(this.activeMenu[0],"paddingTop"))||0,s=e.offset().top-this.activeMenu.offset().top-i-n,o=this.activeMenu.scrollTop(),a=this.activeMenu.height(),r=e.outerHeight(),s<0?this.activeMenu.scrollTop(o+s):s+r>a&&this.activeMenu.scrollTop(o+s-a+r))},blur:function(t,e){e||clearTimeout(this.timer),this.active&&(this._removeClass(this.active.children(".ui-menu-item-wrapper"),null,"ui-state-active"),this._trigger("blur",t,{item:this.active}),this.active=null)},_startOpening:function(t){clearTimeout(this.timer),"true"===t.attr("aria-hidden")&&(this.timer=this._delay(function(){this._close(),this._open(t)},this.delay))},_open:function(e){var i=t.extend({of:this.active},this.options.position);clearTimeout(this.timer),this.element.find(".ui-menu").not(e.parents(".ui-menu")).hide().attr("aria-hidden","true"),e.show().removeAttr("aria-hidden").attr("aria-expanded","true").position(i)},collapseAll:function(e,i){clearTimeout(this.timer),this.timer=this._delay(function(){var n=i?this.element:t(e&&e.target).closest(this.element.find(".ui-menu"));n.length||(n=this.element),this._close(n),this.blur(e),this._removeClass(n.find(".ui-state-active"),null,"ui-state-active"),this.activeMenu=n},this.delay)},_close:function(t){t||(t=this.active?this.active.parent():this.element),t.find(".ui-menu").hide().attr("aria-hidden","true").attr("aria-expanded","false")},_closeOnDocumentClick:function(e){return!t(e.target).closest(".ui-menu").length},_isDivider:function(t){return!/[^\-\u2014\u2013\s]/.test(t.text())},collapse:function(t){var e=this.active&&this.active.parent().closest(".ui-menu-item",this.element);e&&e.length&&(this._close(),this.focus(t,e))},expand:function(t){var e=this.active&&this.active.children(".ui-menu ").find(this.options.items).first();e&&e.length&&(this._open(e.parent()),this._delay(function(){this.focus(t,e)}))},next:function(t){this._move("next","first",t)},previous:function(t){this._move("prev","last",t)},isFirstItem:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},isLastItem:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},_move:function(t,e,i){var n;this.active&&(n="first"===t||"last"===t?this.active["first"===t?"prevAll":"nextAll"](".ui-menu-item").eq(-1):this.active[t+"All"](".ui-menu-item").eq(0)),n&&n.length&&this.active||(n=this.activeMenu.find(this.options.items)[e]()),this.focus(i,n)},nextPage:function(e){var i,n,s;if(!this.active)return void this.next(e);this.isLastItem()||(this._hasScroll()?(n=this.active.offset().top,s=this.element.height(),this.active.nextAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-n-s<0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items)[this.active?"last":"first"]()))},previousPage:function(e){var i,n,s;if(!this.active)return void this.next(e);this.isFirstItem()||(this._hasScroll()?(n=this.active.offset().top,s=this.element.height(),this.active.prevAll(".ui-menu-item").each(function(){return i=t(this),i.offset().top-n+s>0}),this.focus(e,i)):this.focus(e,this.activeMenu.find(this.options.items).first()))},_hasScroll:function(){return this.element.outerHeight()<this.element.prop("scrollHeight")},select:function(e){this.active=this.active||t(e.target).closest(".ui-menu-item");var i={item:this.active};this.active.has(".ui-menu").length||this.collapseAll(e,!0),this._trigger("select",e,i)},_filterMenuItems:function(e){var i=e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"),n=new RegExp("^"+i,"i");return this.activeMenu.find(this.options.items).filter(".ui-menu-item").filter(function(){return n.test(t.trim(t(this).children(".ui-menu-item-wrapper").text()))})}});t.widget("ui.autocomplete",{version:"1.12.1",defaultElement:"<input>",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var e,i,n,s=this.element[0].nodeName.toLowerCase(),o="textarea"===s,a="input"===s;this.isMultiLine=o||!a&&this._isContentEditable(this.element),this.valueMethod=this.element[o||a?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(s){if(this.element.prop("readOnly"))return e=!0,n=!0,void(i=!0);e=!1,n=!1,i=!1;var o=t.ui.keyCode;switch(s.keyCode){case o.PAGE_UP:e=!0,this._move("previousPage",s);break;case o.PAGE_DOWN:e=!0,this._move("nextPage",s);break;case o.UP:e=!0,this._keyEvent("previous",s);break;case o.DOWN:e=!0,this._keyEvent("next",s);break;case o.ENTER:this.menu.active&&(e=!0,s.preventDefault(),this.menu.select(s));break;case o.TAB:this.menu.active&&this.menu.select(s);break;case o.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(s),s.preventDefault());break;default:i=!0,this._searchTimeout(s)}},keypress:function(n){if(e)return e=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||n.preventDefault());if(!i){var s=t.ui.keyCode;switch(n.keyCode){case s.PAGE_UP:this._move("previousPage",n);break;case s.PAGE_DOWN:this._move("nextPage",n);break;case s.UP:this._keyEvent("previous",n);break;case s.DOWN:this._keyEvent("next",n)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){if(this.cancelBlur)return void delete this.cancelBlur;clearTimeout(this.searching),this.close(t),this._change(t)}}),this._initSource(),this.menu=t("<ul>").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(e){e.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==t.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(e,i){var n,s;if(this.isNewMenu&&(this.isNewMenu=!1,e.originalEvent&&/^mouse/.test(e.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){t(e.target).trigger(e.originalEvent)});s=i.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",e,{item:s})&&e.originalEvent&&/^key/.test(e.originalEvent.type)&&this._value(s.value),(n=i.item.attr("aria-label")||s.value)&&t.trim(n).length&&(this.liveRegion.children().hide(),t("<div>").text(n).appendTo(this.liveRegion))},menuselect:function(e,i){var n=i.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==t.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=n})),!1!==this._trigger("select",e,{item:n})&&this._value(n.value),this.term=this._value(),this.close(e),this.selectedItem=n}}),this.liveRegion=t("<div>",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(e){var i=this.menu.element[0];return e.target===this.element[0]||e.target===i||t.contains(i,e.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_initSource:function(){var e,i,n=this;t.isArray(this.options.source)?(e=this.options.source,this.source=function(i,n){n(t.ui.autocomplete.filter(e,i.term))}):"string"==typeof this.options.source?(i=this.options.source,this.source=function(e,s){n.xhr&&n.xhr.abort(),n.xhr=t.ajax({url:i,data:e,dataType:"json",success:function(t){s(t)},error:function(){s([])}})}):this.source=this.options.source},_searchTimeout:function(t){clearTimeout(this.searching),this.searching=this._delay(function(){var e=this.term===this._value(),i=this.menu.element.is(":visible"),n=t.altKey||t.ctrlKey||t.metaKey||t.shiftKey;e&&(!e||i||n)||(this.selectedItem=null,this.search(null,t))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length<this.options.minLength?this.close(e):!1!==this._trigger("search",e)?this._search(t):void 0},_search:function(t){this.pending++,this._addClass("ui-autocomplete-loading"),this.cancelSearch=!1,this.source({term:t},this._response())},_response:function(){var e=++this.requestIndex;return t.proxy(function(t){e===this.requestIndex&&this.__response(t),--this.pending||this._removeClass("ui-autocomplete-loading")},this)},__response:function(t){t&&(t=this._normalize(t)),this._trigger("response",null,{content:t}),!this.options.disabled&&t&&t.length&&!this.cancelSearch?(this._suggest(t),this._trigger("open")):this._close()},close:function(t){this.cancelSearch=!0,this._close(t)},_close:function(t){this._off(this.document,"mousedown"),this.menu.element.is(":visible")&&(this.menu.element.hide(),this.menu.blur(),this.isNewMenu=!0,this._trigger("close",t))},_change:function(t){this.previous!==this._value()&&this._trigger("change",t,{item:this.selectedItem})},_normalize:function(e){return e.length&&e[0].label&&e[0].value?e:t.map(e,function(e){return"string"==typeof e?{label:e,value:e}:t.extend({},e,{label:e.label||e.value,value:e.value||e.label})})},_suggest:function(e){var i=this.menu.element.empty();this._renderMenu(i,e),this.isNewMenu=!0,this.menu.refresh(),i.show(),this._resizeMenu(),i.position(t.extend({of:this.element},this.options.position)),this.options.autoFocus&&this.menu.next(),this._on(this.document,{mousedown:"_closeOnClickOutside"})},_resizeMenu:function(){var t=this.menu.element;t.outerWidth(Math.max(t.width("").outerWidth()+1,this.element.outerWidth()))},_renderMenu:function(e,i){var n=this;t.each(i,function(t,i){n._renderItemData(e,i)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-autocomplete-item",e)},_renderItem:function(e,i){return t("<li>").append(t("<div>").text(i.label)).appendTo(e)},_move:function(t,e){return this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e):void this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),t.extend(t.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(e,i){var n=new RegExp(t.ui.autocomplete.escapeRegex(i),"i");return t.grep(e,function(t){return n.test(t.label||t.value||t)})}}),t.widget("ui.autocomplete",t.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(t>1?" results are":" result is")+" available, use up and down arrow keys to navigate."}}},__response:function(e){var i;this._superApply(arguments),
this.options.disabled||this.cancelSearch||(i=e&&e.length?this.options.messages.results(e.length):this.options.messages.noResults,this.liveRegion.children().hide(),t("<div>").text(i).appendTo(this.liveRegion))}});var d=(t.ui.autocomplete,/ui-corner-([a-z]){2,6}/g);t.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"<div>",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var e=this,i=[];t.each(this.options.items,function(n,s){var o,a={};if(s)return"controlgroupLabel"===n?(o=e.element.find(s),o.each(function(){var e=t(this);e.children(".ui-controlgroup-label-contents").length||e.contents().wrapAll("<span class='ui-controlgroup-label-contents'></span>")}),e._addClass(o,null,"ui-widget ui-widget-content ui-state-default"),void(i=i.concat(o.get()))):void(t.fn[n]&&(a=e["_"+n+"Options"]?e["_"+n+"Options"]("middle"):{classes:{}},e.element.find(s).each(function(){var s=t(this),o=s[n]("instance"),r=t.widget.extend({},a);if("button"!==n||!s.parent(".ui-spinner").length){o||(o=s[n]()[n]("instance")),o&&(r.classes=e._resolveClassesValues(r.classes,o)),s[n](r);var l=s[n]("widget");t.data(l[0],"ui-controlgroup-data",o||s[n]("instance")),i.push(l[0])}})))}),this.childWidgets=t(t.unique(i)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var i=t(this),n=i.data("ui-controlgroup-data");n&&n[e]&&n[e]()})},_updateCornerClass:function(t,e){var i=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,i)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,n={classes:{}};return n.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],n},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:!!e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(e,i){var n={};return t.each(e,function(s){var o=i.options.classes[s]||"";o=t.trim(o.replace(d,"")),n[s]=(o+" "+e[s]).replace(/\s+/g," ")}),n},_setOption:function(t,e){if("direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t)return void this._callChildMethod(e?"disable":"enable");this.refresh()},refresh:function(){var e,i=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),e=this.childWidgets,this.options.onlyVisible&&(e=e.filter(":visible")),e.length&&(t.each(["first","last"],function(t,n){var s=e[n]().data("ui-controlgroup-data");if(s&&i["_"+s.widgetName+"Options"]){var o=i["_"+s.widgetName+"Options"](1===e.length?"only":n);o.classes=i._resolveClassesValues(o.classes,s),s.element[s.widgetName](o)}else i._updateCornerClass(e[n](),n)}),this._callChildMethod("refresh"))}});t.widget("ui.checkboxradio",[t.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var e,i,n=this,s=this._super()||{};return this._readType(),i=this.element.labels(),this.label=t(i[i.length-1]),this.label.length||t.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){n.originalLabel+=3===this.nodeType?t(this).text():this.outerHTML}),this.originalLabel&&(s.label=this.originalLabel),e=this.element[0].disabled,null!=e&&(s.disabled=e),s},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var e=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===e&&/radio|checkbox/.test(this.type)||t.error("Can't create checkboxradio on element.nodeName="+e+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var e,i=this.element[0].name,n="input[name='"+t.ui.escapeSelector(i)+"']";return i?(e=this.form.length?t(this.form[0].elements).filter(n):t(n).filter(function(){return 0===t(this).form().length}),e.not(this.element)):t([])},_toggleClasses:function(){var e=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",e),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",e)._toggleClass(this.icon,null,"ui-icon-blank",!e),"radio"===this.type&&this._getRadioGroup().each(function(){var e=t(this).checkboxradio("instance");e&&e._removeClass(e.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(e){var i="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=t("<span>"),this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(i+=e?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,e?"ui-icon-blank":"ui-icon-check")):i+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",i),e||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);t.ui.checkboxradio;t.widget("ui.button",{version:"1.12.1",defaultElement:"<button>",options:{classes:{"ui-button":"ui-corner-all"},disabled:null,icon:null,iconPosition:"beginning",label:null,showLabel:!0},_getCreateOptions:function(){var t,e=this._super()||{};return this.isInput=this.element.is("input"),t=this.element[0].disabled,null!=t&&(e.disabled=t),this.originalLabel=this.isInput?this.element.val():this.element.html(),this.originalLabel&&(e.label=this.originalLabel),e},_create:function(){!this.option.showLabel&!this.options.icon&&(this.options.showLabel=!0),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled||!1),this.hasTitle=!!this.element.attr("title"),this.options.label&&this.options.label!==this.originalLabel&&(this.isInput?this.element.val(this.options.label):this.element.html(this.options.label)),this._addClass("ui-button","ui-widget"),this._setOption("disabled",this.options.disabled),this._enhance(),this.element.is("a")&&this._on({keyup:function(e){e.keyCode===t.ui.keyCode.SPACE&&(e.preventDefault(),this.element[0].click?this.element[0].click():this.element.trigger("click"))}})},_enhance:function(){this.element.is("button")||this.element.attr("role","button"),this.options.icon&&(this._updateIcon("icon",this.options.icon),this._updateTooltip())},_updateTooltip:function(){this.title=this.element.attr("title"),this.options.showLabel||this.title||this.element.attr("title",this.options.label)},_updateIcon:function(e,i){var n="iconPosition"!==e,s=n?this.options.iconPosition:i,o="top"===s||"bottom"===s;this.icon?n&&this._removeClass(this.icon,null,this.options.icon):(this.icon=t("<span>"),this._addClass(this.icon,"ui-button-icon","ui-icon"),this.options.showLabel||this._addClass("ui-button-icon-only")),n&&this._addClass(this.icon,null,i),this._attachIcon(s),o?(this._addClass(this.icon,null,"ui-widget-icon-block"),this.iconSpace&&this.iconSpace.remove()):(this.iconSpace||(this.iconSpace=t("<span> </span>"),this._addClass(this.iconSpace,"ui-button-icon-space")),this._removeClass(this.icon,null,"ui-wiget-icon-block"),this._attachIconSpace(s))},_destroy:function(){this.element.removeAttr("role"),this.icon&&this.icon.remove(),this.iconSpace&&this.iconSpace.remove(),this.hasTitle||this.element.removeAttr("title")},_attachIconSpace:function(t){this.icon[/^(?:end|bottom)/.test(t)?"before":"after"](this.iconSpace)},_attachIcon:function(t){this.element[/^(?:end|bottom)/.test(t)?"append":"prepend"](this.icon)},_setOptions:function(t){var e=void 0===t.showLabel?this.options.showLabel:t.showLabel,i=void 0===t.icon?this.options.icon:t.icon;e||i||(t.showLabel=!0),this._super(t)},_setOption:function(t,e){"icon"===t&&(e?this._updateIcon(t,e):this.icon&&(this.icon.remove(),this.iconSpace&&this.iconSpace.remove())),"iconPosition"===t&&this._updateIcon(t,e),"showLabel"===t&&(this._toggleClass("ui-button-icon-only",null,!e),this._updateTooltip()),"label"===t&&(this.isInput?this.element.val(e):(this.element.html(e),this.icon&&(this._attachIcon(this.options.iconPosition),this._attachIconSpace(this.options.iconPosition)))),this._super(t,e),"disabled"===t&&(this._toggleClass(null,"ui-state-disabled",e),this.element[0].disabled=e,e&&this.element.blur())},refresh:function(){var t=this.element.is("input, button")?this.element[0].disabled:this.element.hasClass("ui-button-disabled");t!==this.options.disabled&&this._setOptions({disabled:t}),this._updateTooltip()}}),!1!==t.uiBackCompat&&(t.widget("ui.button",t.ui.button,{options:{text:!0,icons:{primary:null,secondary:null}},_create:function(){this.options.showLabel&&!this.options.text&&(this.options.showLabel=this.options.text),!this.options.showLabel&&this.options.text&&(this.options.text=this.options.showLabel),this.options.icon||!this.options.icons.primary&&!this.options.icons.secondary?this.options.icon&&(this.options.icons.primary=this.options.icon):this.options.icons.primary?this.options.icon=this.options.icons.primary:(this.options.icon=this.options.icons.secondary,this.options.iconPosition="end"),this._super()},_setOption:function(t,e){if("text"===t)return void this._super("showLabel",e);"showLabel"===t&&(this.options.text=e),"icon"===t&&(this.options.icons.primary=e),"icons"===t&&(e.primary?(this._super("icon",e.primary),this._super("iconPosition","beginning")):e.secondary&&(this._super("icon",e.secondary),this._super("iconPosition","end"))),this._superApply(arguments)}}),t.fn.button=function(e){return function(){return!this.length||this.length&&"INPUT"!==this[0].tagName||this.length&&"INPUT"===this[0].tagName&&"checkbox"!==this.attr("type")&&"radio"!==this.attr("type")?e.apply(this,arguments):(t.ui.checkboxradio||t.error("Checkboxradio widget missing"),0===arguments.length?this.checkboxradio({icon:!1}):this.checkboxradio.apply(this,arguments))}}(t.fn.button),t.fn.buttonset=function(){return t.ui.controlgroup||t.error("Controlgroup widget missing"),"option"===arguments[0]&&"items"===arguments[1]&&arguments[2]?this.controlgroup.apply(this,[arguments[0],"items.button",arguments[2]]):"option"===arguments[0]&&"items"===arguments[1]?this.controlgroup.apply(this,[arguments[0],"items.button"]):("object"==typeof arguments[0]&&arguments[0].items&&(arguments[0].items={button:arguments[0].items}),this.controlgroup.apply(this,arguments))});t.ui.button;t.extend(t.ui,{datepicker:{version:"1.12.1"}});var f;t.extend(n.prototype,{markerClassName:"hasDatepicker",maxRows:4,_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(t){return a(this._defaults,t||{}),this},_attachDatepicker:function(e,i){var n,s,o;n=e.nodeName.toLowerCase(),s="div"===n||"span"===n,e.id||(this.uuid+=1,e.id="dp"+this.uuid),o=this._newInst(t(e),s),o.settings=t.extend({},i||{}),"input"===n?this._connectDatepicker(e,o):s&&this._inlineDatepicker(e,o)},_newInst:function(e,i){return{id:e[0].id.replace(/([^A-Za-z0-9_\-])/g,"\\\\$1"),input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:i,dpDiv:i?s(t("<div class='"+this._inlineClass+" ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")):this.dpDiv}},_connectDatepicker:function(e,i){var n=t(e);i.append=t([]),i.trigger=t([]),n.hasClass(this.markerClassName)||(this._attachments(n,i),n.addClass(this.markerClassName).on("keydown",this._doKeyDown).on("keypress",this._doKeyPress).on("keyup",this._doKeyUp),this._autoSize(i),t.data(e,"datepicker",i),i.settings.disabled&&this._disableDatepicker(e))},_attachments:function(e,i){var n,s,o,a=this._get(i,"appendText"),r=this._get(i,"isRTL");i.append&&i.append.remove(),a&&(i.append=t("<span class='"+this._appendClass+"'>"+a+"</span>"),e[r?"before":"after"](i.append)),e.off("focus",this._showDatepicker),i.trigger&&i.trigger.remove(),n=this._get(i,"showOn"),"focus"!==n&&"both"!==n||e.on("focus",this._showDatepicker),"button"!==n&&"both"!==n||(s=this._get(i,"buttonText"),o=this._get(i,"buttonImage"),i.trigger=t(this._get(i,"buttonImageOnly")?t("<img/>").addClass(this._triggerClass).attr({src:o,alt:s,title:s}):t("<button type='button'></button>").addClass(this._triggerClass).html(o?t("<img/>").attr({src:o,alt:s,title:s}):s)),e[r?"before":"after"](i.trigger),i.trigger.on("click",function(){return t.datepicker._datepickerShowing&&t.datepicker._lastInput===e[0]?t.datepicker._hideDatepicker():t.datepicker._datepickerShowing&&t.datepicker._lastInput!==e[0]?(t.datepicker._hideDatepicker(),t.datepicker._showDatepicker(e[0])):t.datepicker._showDatepicker(e[0]),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,n,s,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(i=0,n=0,s=0;s<t.length;s++)t[s].length>i&&(i=t[s].length,n=s);return n},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(e,i){var n=t(e);n.hasClass(this.markerClassName)||(n.addClass(this.markerClassName).append(i.dpDiv),t.data(e,"datepicker",i),this._setDate(i,this._getDefaultDate(i),!0),this._updateDatepicker(i),this._updateAlternate(i),i.settings.disabled&&this._disableDatepicker(e),i.dpDiv.css("display","block"))},_dialogDatepicker:function(e,i,n,s,o){var r,l,h,u,c,d=this._dialogInst;return d||(this.uuid+=1,r="dp"+this.uuid,this._dialogInput=t("<input type='text' id='"+r+"' style='position: absolute; top: -100px; width: 0px;'/>"),this._dialogInput.on("keydown",this._doKeyDown),t("body").append(this._dialogInput),d=this._dialogInst=this._newInst(this._dialogInput,!1),d.settings={},t.data(this._dialogInput[0],"datepicker",d)),a(d.settings,s||{}),i=i&&i.constructor===Date?this._formatDate(d,i):i,this._dialogInput.val(i),this._pos=o?o.length?o:[o.pageX,o.pageY]:null,this._pos||(l=document.documentElement.clientWidth,h=document.documentElement.clientHeight,u=document.documentElement.scrollLeft||document.body.scrollLeft,c=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[l/2-100+u,h/2-150+c]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),d.settings.onSelect=n,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),t.blockUI&&t.blockUI(this.dpDiv),t.data(this._dialogInput[0],"datepicker",d),this},_destroyDatepicker:function(e){var i,n=t(e),s=t.data(e,"datepicker");n.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),t.removeData(e,"datepicker"),"input"===i?(s.append.remove(),s.trigger.remove(),n.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==i&&"span"!==i||n.removeClass(this.markerClassName).empty(),f===s&&(f=null))},_enableDatepicker:function(e){var i,n,s=t(e),o=t.data(e,"datepicker");s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!1,o.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==i&&"span"!==i||(n=s.children("."+this._inlineClass),n.children().removeClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var i,n,s=t(e),o=t.data(e,"datepicker");s.hasClass(this.markerClassName)&&(i=e.nodeName.toLowerCase(),"input"===i?(e.disabled=!0,o.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==i&&"span"!==i||(n=s.children("."+this._inlineClass),n.children().addClass("ui-state-disabled"),n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=t.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;e<this._disabledInputs.length;e++)if(this._disabledInputs[e]===t)return!0;return!1},_getInst:function(e){try{return t.data(e,"datepicker")}catch(t){throw"Missing instance data for this datepicker"}},_optionDatepicker:function(e,i,n){var s,o,r,l,h=this._getInst(e);if(2===arguments.length&&"string"==typeof i)return"defaults"===i?t.extend({},t.datepicker._defaults):h?"all"===i?t.extend({},h.settings):this._get(h,i):null;s=i||{},"string"==typeof i&&(s={},s[i]=n),h&&(this._curInst===h&&this._hideDatepicker(),o=this._getDateDatepicker(e,!0),r=this._getMinMaxDate(h,"min"),l=this._getMinMaxDate(h,"max"),a(h.settings,s),null!==r&&void 0!==s.dateFormat&&void 0===s.minDate&&(h.settings.minDate=this._formatDate(h,r)),null!==l&&void 0!==s.dateFormat&&void 0===s.maxDate&&(h.settings.maxDate=this._formatDate(h,l)),"disabled"in s&&(s.disabled?this._disableDatepicker(e):this._enableDatepicker(e)),this._attachments(t(e),h),this._autoSize(h),this._setDate(h,o),this._updateAlternate(h),this._updateDatepicker(h))},_changeDatepicker:function(t,e,i){this._optionDatepicker(t,e,i)},_refreshDatepicker:function(t){var e=this._getInst(t);e&&this._updateDatepicker(e)},_setDateDatepicker:function(t,e){var i=this._getInst(t);i&&(this._setDate(i,e),this._updateDatepicker(i),this._updateAlternate(i))},_getDateDatepicker:function(t,e){var i=this._getInst(t);return i&&!i.inline&&this._setDateFromField(i,e),i?this._getDate(i):null},_doKeyDown:function(e){var i,n,s,o=t.datepicker._getInst(e.target),a=!0,r=o.dpDiv.is(".ui-datepicker-rtl");if(o._keyEvent=!0,t.datepicker._datepickerShowing)switch(e.keyCode){case 9:t.datepicker._hideDatepicker(),a=!1;break;case 13:return s=t("td."+t.datepicker._dayOverClass+":not(."+t.datepicker._currentClass+")",o.dpDiv),s[0]&&t.datepicker._selectDay(e.target,o.selectedMonth,o.selectedYear,s[0]),i=t.datepicker._get(o,"onSelect"),i?(n=t.datepicker._formatDate(o),i.apply(o.input?o.input[0]:null,[n,o])):t.datepicker._hideDatepicker(),!1;case 27:t.datepicker._hideDatepicker();break;case 33:t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 34:t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 35:(e.ctrlKey||e.metaKey)&&t.datepicker._clearDate(e.target),a=e.ctrlKey||e.metaKey;break;case 36:(e.ctrlKey||e.metaKey)&&t.datepicker._gotoToday(e.target),a=e.ctrlKey||e.metaKey;break;case 37:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?1:-1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?-t.datepicker._get(o,"stepBigMonths"):-t.datepicker._get(o,"stepMonths"),"M");break;case 38:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,-7,"D"),a=e.ctrlKey||e.metaKey;break;case 39:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,r?-1:1,"D"),a=e.ctrlKey||e.metaKey,e.originalEvent.altKey&&t.datepicker._adjustDate(e.target,e.ctrlKey?+t.datepicker._get(o,"stepBigMonths"):+t.datepicker._get(o,"stepMonths"),"M");break;case 40:(e.ctrlKey||e.metaKey)&&t.datepicker._adjustDate(e.target,7,"D"),a=e.ctrlKey||e.metaKey;break;default:a=!1}else 36===e.keyCode&&e.ctrlKey?t.datepicker._showDatepicker(this):a=!1;a&&(e.preventDefault(),e.stopPropagation())},_doKeyPress:function(e){var i,n,s=t.datepicker._getInst(e.target);if(t.datepicker._get(s,"constrainInput"))return i=t.datepicker._possibleChars(t.datepicker._get(s,"dateFormat")),n=String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),e.ctrlKey||e.metaKey||n<" "||!i||i.indexOf(n)>-1},_doKeyUp:function(e){var i,n=t.datepicker._getInst(e.target);if(n.input.val()!==n.lastVal)try{i=t.datepicker.parseDate(t.datepicker._get(n,"dateFormat"),n.input?n.input.val():null,t.datepicker._getFormatConfig(n)),i&&(t.datepicker._setDateFromField(n),t.datepicker._updateAlternate(n),t.datepicker._updateDatepicker(n))}catch(t){}return!0},_showDatepicker:function(e){if(e=e.target||e,"input"!==e.nodeName.toLowerCase()&&(e=t("input",e.parentNode)[0]),!t.datepicker._isDisabledDatepicker(e)&&t.datepicker._lastInput!==e){var n,s,o,r,l,h,u;n=t.datepicker._getInst(e),t.datepicker._curInst&&t.datepicker._curInst!==n&&(t.datepicker._curInst.dpDiv.stop(!0,!0),n&&t.datepicker._datepickerShowing&&t.datepicker._hideDatepicker(t.datepicker._curInst.input[0])),s=t.datepicker._get(n,"beforeShow"),o=s?s.apply(e,[e,n]):{},!1!==o&&(a(n.settings,o),n.lastVal=null,t.datepicker._lastInput=e,t.datepicker._setDateFromField(n),t.datepicker._inDialog&&(e.value=""),t.datepicker._pos||(t.datepicker._pos=t.datepicker._findPos(e),t.datepicker._pos[1]+=e.offsetHeight),r=!1,t(e).parents().each(function(){return!(r|="fixed"===t(this).css("position"))}),l={left:t.datepicker._pos[0],top:t.datepicker._pos[1]},t.datepicker._pos=null,n.dpDiv.empty(),n.dpDiv.css({position:"absolute",display:"block",top:"-1000px"}),t.datepicker._updateDatepicker(n),l=t.datepicker._checkOffset(n,l,r),n.dpDiv.css({position:t.datepicker._inDialog&&t.blockUI?"static":r?"fixed":"absolute",display:"none",left:l.left+"px",top:l.top+"px"}),n.inline||(h=t.datepicker._get(n,"showAnim"),u=t.datepicker._get(n,"duration"),n.dpDiv.css("z-index",i(t(e))+1),t.datepicker._datepickerShowing=!0,t.effects&&t.effects.effect[h]?n.dpDiv.show(h,t.datepicker._get(n,"showOptions"),u):n.dpDiv[h||"show"](h?u:null),t.datepicker._shouldFocusInput(n)&&n.input.trigger("focus"),t.datepicker._curInst=n))}},_updateDatepicker:function(e){this.maxRows=4,f=e,e.dpDiv.empty().append(this._generateHTML(e)),this._attachHandlers(e);var i,n=this._getNumberOfMonths(e),s=n[1],a=e.dpDiv.find("."+this._dayOverClass+" a");a.length>0&&o.apply(a.get(0)),e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""),s>1&&e.dpDiv.addClass("ui-datepicker-multi-"+s).css("width",17*s+"em"),e.dpDiv[(1!==n[0]||1!==n[1]?"add":"remove")+"Class"]("ui-datepicker-multi"),e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl"),e===t.datepicker._curInst&&t.datepicker._datepickerShowing&&t.datepicker._shouldFocusInput(e)&&e.input.trigger("focus"),e.yearshtml&&(i=e.yearshtml,setTimeout(function(){i===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml),i=e.yearshtml=null},0))},_shouldFocusInput:function(t){return t.input&&t.input.is(":visible")&&!t.input.is(":disabled")&&!t.input.is(":focus")},_checkOffset:function(e,i,n){var s=e.dpDiv.outerWidth(),o=e.dpDiv.outerHeight(),a=e.input?e.input.outerWidth():0,r=e.input?e.input.outerHeight():0,l=document.documentElement.clientWidth+(n?0:t(document).scrollLeft()),h=document.documentElement.clientHeight+(n?0:t(document).scrollTop());return i.left-=this._get(e,"isRTL")?s-a:0,i.left-=n&&i.left===e.input.offset().left?t(document).scrollLeft():0,i.top-=n&&i.top===e.input.offset().top+r?t(document).scrollTop():0,i.left-=Math.min(i.left,i.left+s>l&&l>s?Math.abs(i.left+s-l):0),i.top-=Math.min(i.top,i.top+o>h&&h>o?Math.abs(o+r):0),i},_findPos:function(e){for(var i,n=this._getInst(e),s=this._get(n,"isRTL");e&&("hidden"===e.type||1!==e.nodeType||t.expr.filters.hidden(e));)e=e[s?"previousSibling":"nextSibling"];return i=t(e).offset(),[i.left,i.top]},_hideDatepicker:function(e){var i,n,s,o,a=this._curInst;!a||e&&a!==t.data(e,"datepicker")||this._datepickerShowing&&(i=this._get(a,"showAnim"),n=this._get(a,"duration"),s=function(){t.datepicker._tidyDialog(a)},t.effects&&(t.effects.effect[i]||t.effects[i])?a.dpDiv.hide(i,t.datepicker._get(a,"showOptions"),n,s):a.dpDiv["slideDown"===i?"slideUp":"fadeIn"===i?"fadeOut":"hide"](i?n:null,s),i||s(),this._datepickerShowing=!1,o=this._get(a,"onClose"),o&&o.apply(a.input?a.input[0]:null,[a.input?a.input.val():"",a]),this._lastInput=null,this._inDialog&&(this._dialogInput.css({position:"absolute",left:"0",top:"-100px"}),t.blockUI&&(t.unblockUI(),t("body").append(this.dpDiv))),this._inDialog=!1)},_tidyDialog:function(t){t.dpDiv.removeClass(this._dialogClass).off(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(t.datepicker._curInst){var i=t(e.target),n=t.datepicker._getInst(i[0]);(i[0].id===t.datepicker._mainDivId||0!==i.parents("#"+t.datepicker._mainDivId).length||i.hasClass(t.datepicker.markerClassName)||i.closest("."+t.datepicker._triggerClass).length||!t.datepicker._datepickerShowing||t.datepicker._inDialog&&t.blockUI)&&(!i.hasClass(t.datepicker.markerClassName)||t.datepicker._curInst===n)||t.datepicker._hideDatepicker()}},_adjustDate:function(e,i,n){var s=t(e),o=this._getInst(s[0]);this._isDisabledDatepicker(s[0])||(this._adjustInstDate(o,i+("M"===n?this._get(o,"showCurrentAtPos"):0),n),this._updateDatepicker(o))},_gotoToday:function(e){var i,n=t(e),s=this._getInst(n[0]);this._get(s,"gotoCurrent")&&s.currentDay?(s.selectedDay=s.currentDay,s.drawMonth=s.selectedMonth=s.currentMonth,s.drawYear=s.selectedYear=s.currentYear):(i=new Date,s.selectedDay=i.getDate(),s.drawMonth=s.selectedMonth=i.getMonth(),s.drawYear=s.selectedYear=i.getFullYear()),this._notifyChange(s),this._adjustDate(n)},_selectMonthYear:function(e,i,n){var s=t(e),o=this._getInst(s[0]);o["selected"+("M"===n?"Month":"Year")]=o["draw"+("M"===n?"Month":"Year")]=parseInt(i.options[i.selectedIndex].value,10),this._notifyChange(o),this._adjustDate(s)},_selectDay:function(e,i,n,s){var o,a=t(e);t(s).hasClass(this._unselectableClass)||this._isDisabledDatepicker(a[0])||(o=this._getInst(a[0]),o.selectedDay=o.currentDay=t("a",s).html(),o.selectedMonth=o.currentMonth=i,o.selectedYear=o.currentYear=n,this._selectDate(e,this._formatDate(o,o.currentDay,o.currentMonth,o.currentYear)))},_clearDate:function(e){var i=t(e);this._selectDate(i,"")},_selectDate:function(e,i){var n,s=t(e),o=this._getInst(s[0]);i=null!=i?i:this._formatDate(o),o.input&&o.input.val(i),this._updateAlternate(o),n=this._get(o,"onSelect"),n?n.apply(o.input?o.input[0]:null,[i,o]):o.input&&o.input.trigger("change"),o.inline?this._updateDatepicker(o):(this._hideDatepicker(),this._lastInput=o.input[0],"object"!=typeof o.input[0]&&o.input.trigger("focus"),this._lastInput=null)},_updateAlternate:function(e){var i,n,s,o=this._get(e,"altField");o&&(i=this._get(e,"altFormat")||this._get(e,"dateFormat"),n=this._getDate(e),s=this.formatDate(i,n,this._getFormatConfig(e)),t(o).val(s))},noWeekends:function(t){var e=t.getDay();return[e>0&&e<6,""]},iso8601Week:function(t){var e,i=new Date(t.getTime());return i.setDate(i.getDate()+4-(i.getDay()||7)),e=i.getTime(),i.setMonth(0),i.setDate(1),Math.floor(Math.round((e-i)/864e5)/7)+1},parseDate:function(e,i,n){if(null==e||null==i)throw"Invalid arguments";if(""===(i="object"==typeof i?i.toString():i+""))return null;var s,o,a,r,l=0,h=(n?n.shortYearCutoff:null)||this._defaults.shortYearCutoff,u="string"!=typeof h?h:(new Date).getFullYear()%100+parseInt(h,10),c=(n?n.dayNamesShort:null)||this._defaults.dayNamesShort,d=(n?n.dayNames:null)||this._defaults.dayNames,f=(n?n.monthNamesShort:null)||this._defaults.monthNamesShort,p=(n?n.monthNames:null)||this._defaults.monthNames,g=-1,m=-1,v=-1,b=-1,_=!1,y=function(t){var i=s+1<e.length&&e.charAt(s+1)===t;return i&&s++,i},x=function(t){var e=y(t),n="@"===t?14:"!"===t?20:"y"===t&&e?4:"o"===t?3:2,s="y"===t?n:1,o=new RegExp("^\\d{"+s+","+n+"}"),a=i.substring(l).match(o);if(!a)throw"Missing number at position "+l;return l+=a[0].length,parseInt(a[0],10)},w=function(e,n,s){var o=-1,a=t.map(y(e)?s:n,function(t,e){return[[e,t]]}).sort(function(t,e){return-(t[1].length-e[1].length)});if(t.each(a,function(t,e){var n=e[1];if(i.substr(l,n.length).toLowerCase()===n.toLowerCase())return o=e[0],l+=n.length,!1}),-1!==o)return o+1;throw"Unknown name at position "+l},k=function(){if(i.charAt(l)!==e.charAt(s))throw"Unexpected literal at position "+l;l++};for(s=0;s<e.length;s++)if(_)"'"!==e.charAt(s)||y("'")?k():_=!1;else switch(e.charAt(s)){case"d":v=x("d");break;case"D":w("D",c,d);break;case"o":b=x("o");break;case"m":m=x("m");break;case"M":m=w("M",f,p);break;case"y":g=x("y");break;case"@":r=new Date(x("@")),g=r.getFullYear(),m=r.getMonth()+1,v=r.getDate();break;case"!":r=new Date((x("!")-this._ticksTo1970)/1e4),g=r.getFullYear(),m=r.getMonth()+1,v=r.getDate();break;case"'":y("'")?k():_=!0;break;default:k()}if(l<i.length&&(a=i.substr(l),!/^\s+/.test(a)))throw"Extra/unparsed characters found in date: "+a;if(-1===g?g=(new Date).getFullYear():g<100&&(g+=(new Date).getFullYear()-(new Date).getFullYear()%100+(g<=u?0:-100)),b>-1)for(m=1,v=b;;){if(o=this._getDaysInMonth(g,m-1),v<=o)break;m++,v-=o}if(r=this._daylightSavingAdjust(new Date(g,m-1,v)),
r.getFullYear()!==g||r.getMonth()+1!==m||r.getDate()!==v)throw"Invalid date";return r},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:24*(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*60*60*1e7,formatDate:function(t,e,i){if(!e)return"";var n,s=(i?i.dayNamesShort:null)||this._defaults.dayNamesShort,o=(i?i.dayNames:null)||this._defaults.dayNames,a=(i?i.monthNamesShort:null)||this._defaults.monthNamesShort,r=(i?i.monthNames:null)||this._defaults.monthNames,l=function(e){var i=n+1<t.length&&t.charAt(n+1)===e;return i&&n++,i},h=function(t,e,i){var n=""+e;if(l(t))for(;n.length<i;)n="0"+n;return n},u=function(t,e,i,n){return l(t)?n[e]:i[e]},c="",d=!1;if(e)for(n=0;n<t.length;n++)if(d)"'"!==t.charAt(n)||l("'")?c+=t.charAt(n):d=!1;else switch(t.charAt(n)){case"d":c+=h("d",e.getDate(),2);break;case"D":c+=u("D",e.getDay(),s,o);break;case"o":c+=h("o",Math.round((new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()-new Date(e.getFullYear(),0,0).getTime())/864e5),3);break;case"m":c+=h("m",e.getMonth()+1,2);break;case"M":c+=u("M",e.getMonth(),a,r);break;case"y":c+=l("y")?e.getFullYear():(e.getFullYear()%100<10?"0":"")+e.getFullYear()%100;break;case"@":c+=e.getTime();break;case"!":c+=1e4*e.getTime()+this._ticksTo1970;break;case"'":l("'")?c+="'":d=!0;break;default:c+=t.charAt(n)}return c},_possibleChars:function(t){var e,i="",n=!1,s=function(i){var n=e+1<t.length&&t.charAt(e+1)===i;return n&&e++,n};for(e=0;e<t.length;e++)if(n)"'"!==t.charAt(e)||s("'")?i+=t.charAt(e):n=!1;else switch(t.charAt(e)){case"d":case"m":case"y":case"@":i+="0123456789";break;case"D":case"M":return null;case"'":s("'")?i+="'":n=!0;break;default:i+=t.charAt(e)}return i},_get:function(t,e){return void 0!==t.settings[e]?t.settings[e]:this._defaults[e]},_setDateFromField:function(t,e){if(t.input.val()!==t.lastVal){var i=this._get(t,"dateFormat"),n=t.lastVal=t.input?t.input.val():null,s=this._getDefaultDate(t),o=s,a=this._getFormatConfig(t);try{o=this.parseDate(i,n,a)||s}catch(t){n=e?"":n}t.selectedDay=o.getDate(),t.drawMonth=t.selectedMonth=o.getMonth(),t.drawYear=t.selectedYear=o.getFullYear(),t.currentDay=n?o.getDate():0,t.currentMonth=n?o.getMonth():0,t.currentYear=n?o.getFullYear():0,this._adjustInstDate(t)}},_getDefaultDate:function(t){return this._restrictMinMax(t,this._determineDate(t,this._get(t,"defaultDate"),new Date))},_determineDate:function(e,i,n){var s=null==i||""===i?n:"string"==typeof i?function(i){try{return t.datepicker.parseDate(t.datepicker._get(e,"dateFormat"),i,t.datepicker._getFormatConfig(e))}catch(t){}for(var n=(i.toLowerCase().match(/^c/)?t.datepicker._getDate(e):null)||new Date,s=n.getFullYear(),o=n.getMonth(),a=n.getDate(),r=/([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,l=r.exec(i);l;){switch(l[2]||"d"){case"d":case"D":a+=parseInt(l[1],10);break;case"w":case"W":a+=7*parseInt(l[1],10);break;case"m":case"M":o+=parseInt(l[1],10),a=Math.min(a,t.datepicker._getDaysInMonth(s,o));break;case"y":case"Y":s+=parseInt(l[1],10),a=Math.min(a,t.datepicker._getDaysInMonth(s,o))}l=r.exec(i)}return new Date(s,o,a)}(i):"number"==typeof i?isNaN(i)?n:function(t){var e=new Date;return e.setDate(e.getDate()+t),e}(i):new Date(i.getTime());return s=s&&"Invalid Date"===s.toString()?n:s,s&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},_daylightSavingAdjust:function(t){return t?(t.setHours(t.getHours()>12?t.getHours()+2:0),t):null},_setDate:function(t,e,i){var n=!e,s=t.selectedMonth,o=t.selectedYear,a=this._restrictMinMax(t,this._determineDate(t,e,new Date));t.selectedDay=t.currentDay=a.getDate(),t.drawMonth=t.selectedMonth=t.currentMonth=a.getMonth(),t.drawYear=t.selectedYear=t.currentYear=a.getFullYear(),s===t.selectedMonth&&o===t.selectedYear||i||this._notifyChange(t),this._adjustInstDate(t),t.input&&t.input.val(n?"":this._formatDate(t))},_getDate:function(t){return!t.currentYear||t.input&&""===t.input.val()?null:this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay))},_attachHandlers:function(e){var i=this._get(e,"stepMonths"),n="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){t.datepicker._adjustDate(n,-i,"M")},next:function(){t.datepicker._adjustDate(n,+i,"M")},hide:function(){t.datepicker._hideDatepicker()},today:function(){t.datepicker._gotoToday(n)},selectDay:function(){return t.datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return t.datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return t.datepicker._selectMonthYear(n,this,"Y"),!1}};t(this).on(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(t){var e,i,n,s,o,a,r,l,h,u,c,d,f,p,g,m,v,b,_,y,x,w,k,C,D,M,S,T,I,P,A,F,O,E,N,z,L,H,R,W=new Date,B=this._daylightSavingAdjust(new Date(W.getFullYear(),W.getMonth(),W.getDate())),V=this._get(t,"isRTL"),U=this._get(t,"showButtonPanel"),j=this._get(t,"hideIfNoPrevNext"),Y=this._get(t,"navigationAsDateFormat"),q=this._getNumberOfMonths(t),$=this._get(t,"showCurrentAtPos"),K=this._get(t,"stepMonths"),X=1!==q[0]||1!==q[1],G=this._daylightSavingAdjust(t.currentDay?new Date(t.currentYear,t.currentMonth,t.currentDay):new Date(9999,9,9)),Q=this._getMinMaxDate(t,"min"),Z=this._getMinMaxDate(t,"max"),J=t.drawMonth-$,tt=t.drawYear;if(J<0&&(J+=12,tt--),Z)for(e=this._daylightSavingAdjust(new Date(Z.getFullYear(),Z.getMonth()-q[0]*q[1]+1,Z.getDate())),e=Q&&e<Q?Q:e;this._daylightSavingAdjust(new Date(tt,J,1))>e;)--J<0&&(J=11,tt--);for(t.drawMonth=J,t.drawYear=tt,i=this._get(t,"prevText"),i=Y?this.formatDate(i,this._daylightSavingAdjust(new Date(tt,J-K,1)),this._getFormatConfig(t)):i,n=this._canAdjustMonth(t,-1,tt,J)?"<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(V?"e":"w")+"'>"+i+"</span></a>":j?"":"<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='"+i+"'><span class='ui-icon ui-icon-circle-triangle-"+(V?"e":"w")+"'>"+i+"</span></a>",s=this._get(t,"nextText"),s=Y?this.formatDate(s,this._daylightSavingAdjust(new Date(tt,J+K,1)),this._getFormatConfig(t)):s,o=this._canAdjustMonth(t,1,tt,J)?"<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(V?"w":"e")+"'>"+s+"</span></a>":j?"":"<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='"+s+"'><span class='ui-icon ui-icon-circle-triangle-"+(V?"w":"e")+"'>"+s+"</span></a>",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?G:B,a=Y?this.formatDate(a,r,this._getFormatConfig(t)):a,l=t.inline?"":"<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>"+this._get(t,"closeText")+"</button>",h=U?"<div class='ui-datepicker-buttonpane ui-widget-content'>"+(V?l:"")+(this._isInRange(t,r)?"<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>"+a+"</button>":"")+(V?"":l)+"</div>":"",u=parseInt(this._get(t,"firstDay"),10),u=isNaN(u)?0:u,c=this._get(t,"showWeek"),d=this._get(t,"dayNames"),f=this._get(t,"dayNamesMin"),p=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),v=this._get(t,"showOtherMonths"),b=this._get(t,"selectOtherMonths"),_=this._getDefaultDate(t),y="",w=0;w<q[0];w++){for(k="",this.maxRows=4,C=0;C<q[1];C++){if(D=this._daylightSavingAdjust(new Date(tt,J,t.selectedDay)),M=" ui-corner-all",S="",X){if(S+="<div class='ui-datepicker-group",q[1]>1)switch(C){case 0:S+=" ui-datepicker-group-first",M=" ui-corner-"+(V?"right":"left");break;case q[1]-1:S+=" ui-datepicker-group-last",M=" ui-corner-"+(V?"left":"right");break;default:S+=" ui-datepicker-group-middle",M=""}S+="'>"}for(S+="<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix"+M+"'>"+(/all|left/.test(M)&&0===w?V?o:n:"")+(/all|right/.test(M)&&0===w?V?n:o:"")+this._generateMonthYearHeader(t,J,tt,Q,Z,w>0||C>0,p,g)+"</div><table class='ui-datepicker-calendar'><thead><tr>",T=c?"<th class='ui-datepicker-week-col'>"+this._get(t,"weekHeader")+"</th>":"",x=0;x<7;x++)I=(x+u)%7,T+="<th scope='col'"+((x+u+6)%7>=5?" class='ui-datepicker-week-end'":"")+"><span title='"+d[I]+"'>"+f[I]+"</span></th>";for(S+=T+"</tr></thead><tbody>",P=this._getDaysInMonth(tt,J),tt===t.selectedYear&&J===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,P)),A=(this._getFirstDayOfMonth(tt,J)-u+7)%7,F=Math.ceil((A+P)/7),O=X&&this.maxRows>F?this.maxRows:F,this.maxRows=O,E=this._daylightSavingAdjust(new Date(tt,J,1-A)),N=0;N<O;N++){for(S+="<tr>",z=c?"<td class='ui-datepicker-week-col'>"+this._get(t,"calculateWeek")(E)+"</td>":"",x=0;x<7;x++)L=m?m.apply(t.input?t.input[0]:null,[E]):[!0,""],H=E.getMonth()!==J,R=H&&!b||!L[0]||Q&&E<Q||Z&&E>Z,z+="<td class='"+((x+u+6)%7>=5?" ui-datepicker-week-end":"")+(H?" ui-datepicker-other-month":"")+(E.getTime()===D.getTime()&&J===t.selectedMonth&&t._keyEvent||_.getTime()===E.getTime()&&_.getTime()===D.getTime()?" "+this._dayOverClass:"")+(R?" "+this._unselectableClass+" ui-state-disabled":"")+(H&&!v?"":" "+L[1]+(E.getTime()===G.getTime()?" "+this._currentClass:"")+(E.getTime()===B.getTime()?" ui-datepicker-today":""))+"'"+(H&&!v||!L[2]?"":" title='"+L[2].replace(/'/g,"&#39;")+"'")+(R?"":" data-handler='selectDay' data-event='click' data-month='"+E.getMonth()+"' data-year='"+E.getFullYear()+"'")+">"+(H&&!v?"&#xa0;":R?"<span class='ui-state-default'>"+E.getDate()+"</span>":"<a class='ui-state-default"+(E.getTime()===B.getTime()?" ui-state-highlight":"")+(E.getTime()===G.getTime()?" ui-state-active":"")+(H?" ui-priority-secondary":"")+"' href='#'>"+E.getDate()+"</a>")+"</td>",E.setDate(E.getDate()+1),E=this._daylightSavingAdjust(E);S+=z+"</tr>"}J++,J>11&&(J=0,tt++),S+="</tbody></table>"+(X?"</div>"+(q[0]>0&&C===q[1]-1?"<div class='ui-datepicker-row-break'></div>":""):""),k+=S}y+=k}return y+=h,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,n,s,o,a,r){var l,h,u,c,d,f,p,g,m=this._get(t,"changeMonth"),v=this._get(t,"changeYear"),b=this._get(t,"showMonthAfterYear"),_="<div class='ui-datepicker-title'>",y="";if(o||!m)y+="<span class='ui-datepicker-month'>"+a[e]+"</span>";else{for(l=n&&n.getFullYear()===i,h=s&&s.getFullYear()===i,y+="<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>",u=0;u<12;u++)(!l||u>=n.getMonth())&&(!h||u<=s.getMonth())&&(y+="<option value='"+u+"'"+(u===e?" selected='selected'":"")+">"+r[u]+"</option>");y+="</select>"}if(b||(_+=y+(!o&&m&&v?"":"&#xa0;")),!t.yearshtml)if(t.yearshtml="",o||!v)_+="<span class='ui-datepicker-year'>"+i+"</span>";else{for(c=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),f=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e},p=f(c[0]),g=Math.max(p,f(c[1]||"")),p=n?Math.max(p,n.getFullYear()):p,g=s?Math.min(g,s.getFullYear()):g,t.yearshtml+="<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>";p<=g;p++)t.yearshtml+="<option value='"+p+"'"+(p===i?" selected='selected'":"")+">"+p+"</option>";t.yearshtml+="</select>",_+=t.yearshtml,t.yearshtml=null}return _+=this._get(t,"yearSuffix"),b&&(_+=(!o&&m&&v?"":"&#xa0;")+y),_+="</div>"},_adjustInstDate:function(t,e,i){var n=t.selectedYear+("Y"===i?e:0),s=t.selectedMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(n,s))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(n,s,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),n=this._getMinMaxDate(t,"max"),s=i&&e<i?i:e;return n&&s>n?n:s},_notifyChange:function(t){var e=this._get(t,"onChangeMonthYear");e&&e.apply(t.input?t.input[0]:null,[t.selectedYear,t.selectedMonth+1,t])},_getNumberOfMonths:function(t){var e=this._get(t,"numberOfMonths");return null==e?[1,1]:"number"==typeof e?[1,e]:e},_getMinMaxDate:function(t,e){return this._determineDate(t,this._get(t,e+"Date"),null)},_getDaysInMonth:function(t,e){return 32-this._daylightSavingAdjust(new Date(t,e,32)).getDate()},_getFirstDayOfMonth:function(t,e){return new Date(t,e,1).getDay()},_canAdjustMonth:function(t,e,i,n){var s=this._getNumberOfMonths(t),o=this._daylightSavingAdjust(new Date(i,n+(e<0?e:s[0]*s[1]),1));return e<0&&o.setDate(this._getDaysInMonth(o.getFullYear(),o.getMonth())),this._isInRange(t,o)},_isInRange:function(t,e){var i,n,s=this._getMinMaxDate(t,"min"),o=this._getMinMaxDate(t,"max"),a=null,r=null,l=this._get(t,"yearRange");return l&&(i=l.split(":"),n=(new Date).getFullYear(),a=parseInt(i[0],10),r=parseInt(i[1],10),i[0].match(/[+\-].*/)&&(a+=n),i[1].match(/[+\-].*/)&&(r+=n)),(!s||e.getTime()>=s.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||e.getFullYear()<=r)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),{shortYearCutoff:e,dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,n){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var s=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(n,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),s,this._getFormatConfig(t))}}),t.fn.datepicker=function(e){if(!this.length)return this;t.datepicker.initialized||(t(document).on("mousedown",t.datepicker._checkExternalClick),t.datepicker.initialized=!0),0===t("#"+t.datepicker._mainDivId).length&&t("body").append(t.datepicker.dpDiv);var i=Array.prototype.slice.call(arguments,1);return"string"!=typeof e||"isDisabled"!==e&&"getDate"!==e&&"widget"!==e?"option"===e&&2===arguments.length&&"string"==typeof arguments[1]?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i)):this.each(function(){"string"==typeof e?t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this].concat(i)):t.datepicker._attachDatepicker(this,e)}):t.datepicker["_"+e+"Datepicker"].apply(t.datepicker,[this[0]].concat(i))},t.datepicker=new n,t.datepicker.initialized=!1,t.datepicker.uuid=(new Date).getTime(),t.datepicker.version="1.12.1";t.datepicker;t.widget("ui.dialog",{version:"1.12.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(e){var i=t(this).css(e).offset().top;i<0&&t(this).css("top",e.top-i)}},resizable:!0,show:null,title:null,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&t.fn.draggable&&this._makeDraggable(),this.options.resizable&&t.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var e=this.options.appendTo;return e&&(e.jquery||e.nodeType)?t(e):this.document.find(e||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),t=e.parent.children().eq(e.index),t.length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:t.noop,enable:t.noop,close:function(e){var i=this;this._isOpen&&!1!==this._trigger("beforeClose",e)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||t.ui.safeBlur(t.ui.safeActiveElement(this.document[0])),this._hide(this.uiDialog,this.options.hide,function(){i._trigger("close",e)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(e,i){var n=!1,s=this.uiDialog.siblings(".ui-front:visible").map(function(){return+t(this).css("z-index")}).get(),o=Math.max.apply(null,s);return o>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",o+1),n=!0),n&&!i&&this._trigger("focus",e),n},open:function(){var e=this;if(this._isOpen)return void(this._moveToTop()&&this._focusTabbable());this._isOpen=!0,this.opener=t(t.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){e._focusTabbable(),e._trigger("focus")}),this._makeFocusTarget(),this._trigger("open")},_focusTabbable:function(){var t=this._focusedElement;t||(t=this.element.find("[autofocus]")),t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_keepFocus:function(e){function i(){var e=t.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===e||t.contains(this.uiDialog[0],e)||this._focusTabbable()}e.preventDefault(),i.call(this),this._delay(i)},_createWrapper:function(){this.uiDialog=t("<div>").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(e){if(this.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===t.ui.keyCode.ESCAPE)return e.preventDefault(),void this.close(e);if(e.keyCode===t.ui.keyCode.TAB&&!e.isDefaultPrevented()){var i=this.uiDialog.find(":tabbable"),n=i.filter(":first"),s=i.filter(":last");e.target!==s[0]&&e.target!==this.uiDialog[0]||e.shiftKey?e.target!==n[0]&&e.target!==this.uiDialog[0]||!e.shiftKey||(this._delay(function(){s.trigger("focus")}),e.preventDefault()):(this._delay(function(){n.trigger("focus")}),e.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var e;this.uiDialogTitlebar=t("<div>"),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(e){t(e.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=t("<button type='button'></button>").button({label:t("<a>").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),e=t("<span>").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(e,"ui-dialog-title"),this._title(e),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":e.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html("&#160;")},_createButtonPane:function(){this.uiDialogButtonPane=t("<div>"),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=t("<div>").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var e=this,i=this.options.buttons;if(this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),t.isEmptyObject(i)||t.isArray(i)&&!i.length)return void this._removeClass(this.uiDialog,"ui-dialog-buttons");t.each(i,function(i,n){var s,o;n=t.isFunction(n)?{click:n,text:i}:n,n=t.extend({type:"button"},n),s=n.click,o={icon:n.icon,iconPosition:n.iconPosition,showLabel:n.showLabel,icons:n.icons,text:n.text},delete n.click,delete n.icon,delete n.iconPosition,delete n.showLabel,delete n.icons,"boolean"==typeof n.text&&delete n.text,t("<button></button>",n).button(o).appendTo(e.uiButtonSet).on("click",function(){s.apply(e.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog)},_makeDraggable:function(){function e(t){return{position:t.position,offset:t.offset}}var i=this,n=this.options;this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(n,s){i._addClass(t(this),"ui-dialog-dragging"),i._blockFrames(),i._trigger("dragStart",n,e(s))},drag:function(t,n){i._trigger("drag",t,e(n))},stop:function(s,o){var a=o.offset.left-i.document.scrollLeft(),r=o.offset.top-i.document.scrollTop();n.position={my:"left top",at:"left"+(a>=0?"+":"")+a+" top"+(r>=0?"+":"")+r,of:i.window},i._removeClass(t(this),"ui-dialog-dragging"),i._unblockFrames(),i._trigger("dragStop",s,e(o))}})},_makeResizable:function(){function e(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}var i=this,n=this.options,s=n.resizable,o=this.uiDialog.css("position"),a="string"==typeof s?s:"n,e,s,w,se,sw,ne,nw";this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:n.maxWidth,maxHeight:n.maxHeight,minWidth:n.minWidth,minHeight:this._minHeight(),handles:a,start:function(n,s){i._addClass(t(this),"ui-dialog-resizing"),i._blockFrames(),i._trigger("resizeStart",n,e(s))},resize:function(t,n){i._trigger("resize",t,e(n))},stop:function(s,o){var a=i.uiDialog.offset(),r=a.left-i.document.scrollLeft(),l=a.top-i.document.scrollTop();n.height=i.uiDialog.height(),n.width=i.uiDialog.width(),n.position={my:"left top",at:"left"+(r>=0?"+":"")+r+" top"+(l>=0?"+":"")+l,of:i.window},i._removeClass(t(this),"ui-dialog-resizing"),i._unblockFrames(),i._trigger("resizeStop",s,e(o))}}).css("position",o)},_trackFocus:function(){this._on(this.widget(),{focusin:function(e){this._makeFocusTarget(),this._focusedElement=t(e.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var e=this._trackingInstances(),i=t.inArray(this,e);-1!==i&&e.splice(i,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(e){var i=this,n=!1,s={};t.each(e,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(n=!0),t in i.resizableRelatedOptions&&(s[t]=e)}),n&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",s)},_setOption:function(e,i){var n,s,o=this.uiDialog;"disabled"!==e&&(this._super(e,i),"appendTo"===e&&this.uiDialog.appendTo(this._appendTo()),"buttons"===e&&this._createButtons(),"closeText"===e&&this.uiDialogTitlebarClose.button({label:t("<a>").text(""+this.options.closeText).html()}),"draggable"===e&&(n=o.is(":data(ui-draggable)"),n&&!i&&o.draggable("destroy"),!n&&i&&this._makeDraggable()),"position"===e&&this._position(),"resizable"===e&&(s=o.is(":data(ui-resizable)"),s&&!i&&o.resizable("destroy"),s&&"string"==typeof i&&o.resizable("option","handles",i),s||!1===i||this._makeResizable()),"title"===e&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,n=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),n.minWidth>n.width&&(n.width=n.minWidth),t=this.uiDialog.css({height:"auto",width:n.width}).outerHeight(),e=Math.max(0,n.minHeight-t),i="number"==typeof n.maxHeight?Math.max(0,n.maxHeight-t):"none","auto"===n.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,n.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var e=t(this);return t("<div>").css({position:"absolute",width:e.outerWidth(),height:e.outerHeight()}).appendTo(e.parent()).offset(e.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(e){return!!t(e.target).closest(".ui-dialog").length||!!t(e.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=t("<div>").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),!1!==t.uiBackCompat&&t.widget("ui.dialog",t.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});t.ui.dialog,t.widget("ui.progressbar",{version:"1.12.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=t("<div>").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){if(void 0===t)return this.options.value;this.options.value=this._constrainedValue(t),this._refreshValue()},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var e=this.options.value,i=this._percentage();this.valueDiv.toggle(this.indeterminate||e>this.min).width(i.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,e===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=t("<div>").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":e}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==e&&(this.oldValue=e,this._trigger("change")),e===this.options.max&&this._trigger("complete")}}),t.widget("ui.selectmenu",[t.ui.formResetMixin,{version:"1.12.1",defaultElement:"<select>",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var e=this.element.uniqueId().attr("id");this.ids={element:e,button:e+"-button",menu:e+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=t()},_drawButton:function(){var e,i=this,n=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=t("<span>",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),e=t("<span>").appendTo(this.button),this._addClass(e,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(n).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){i._rendered||i._refreshMenu()})},_drawMenu:function(){var e=this;this.menu=t("<ul>",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=t("<div>").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,i){t.preventDefault(),e._setSelection(),e._select(i.item.data("ui-selectmenu-item"),t)},focus:function(t,i){var n=i.item.data("ui-selectmenu-item");null!=e.focusIndex&&n.index!==e.focusIndex&&(e._trigger("focus",t,{item:n}),e.isOpen||e._select(n,t)),e.focusIndex=n.index,e.button.attr("aria-activedescendant",e.menuItems.eq(n.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){
this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t,e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(t.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(e){var i=t("<span>");return this._setText(i,e.label),this._addClass(i,"ui-selectmenu-text"),i},_renderMenu:function(e,i){var n=this,s="";t.each(i,function(i,o){var a;o.optgroup!==s&&(a=t("<li>",{text:o.optgroup}),n._addClass(a,"ui-selectmenu-optgroup","ui-menu-divider"+(o.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),a.appendTo(e),s=o.optgroup),n._renderItemData(e,o)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(e,i){var n=t("<li>"),s=t("<div>",{title:i.element.attr("title")});return i.disabled&&this._addClass(n,null,"ui-state-disabled"),this._setText(s,i.label),n.append(s).appendTo(e)},_setText:function(t,e){e?t.text(e):t.html("&#160;")},_move:function(t,e){var i,n,s=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),s+=":not(.ui-state-disabled)"),n="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](s).eq(-1):i[t+"All"](s).eq(0),n.length&&this.menuInstance.focus(e,n)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?(t=window.getSelection(),t.removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(e){this.isOpen&&(t(e.target).closest(".ui-selectmenu-menu, #"+t.ui.escapeSelector(this.ids.button)).length||this.close(e))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection(),t.rangeCount&&(this.range=t.getRangeAt(0))):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(e){var i=!0;switch(e.keyCode){case t.ui.keyCode.TAB:case t.ui.keyCode.ESCAPE:this.close(e),i=!1;break;case t.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(e);break;case t.ui.keyCode.UP:e.altKey?this._toggle(e):this._move("prev",e);break;case t.ui.keyCode.DOWN:e.altKey?this._toggle(e):this._move("next",e);break;case t.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(e):this._toggle(e);break;case t.ui.keyCode.LEFT:this._move("prev",e);break;case t.ui.keyCode.RIGHT:this._move("next",e);break;case t.ui.keyCode.HOME:case t.ui.keyCode.PAGE_UP:this._move("first",e);break;case t.ui.keyCode.END:case t.ui.keyCode.PAGE_DOWN:this._move("last",e);break;default:this.menu.trigger(e),i=!1}i&&e.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){var e=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(t,e){if("icons"===t){var i=this.button.find("span.ui-icon");this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)}this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var e=this.options.appendTo;return e&&(e=e.jquery||e.nodeType?t(e):this.document.find(e).eq(0)),e&&e[0]||(e=this.element.closest(".ui-front, dialog")),e.length||(e=this.document[0].body),e},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;if(!1===t)return void this.button.css("width","");null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t)},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(e){var i=this,n=[];e.each(function(e,s){n.push(i._parseOption(t(s),e))}),this.items=n},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),t.widget("ui.slider",t.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,i,n=this.options,s=this.element.find(".ui-slider-handle"),o=[];for(i=n.values&&n.values.length||1,s.length>i&&(s.slice(i).remove(),s=s.slice(0,i)),e=s.length;e<i;e++)o.push("<span tabindex='0'></span>");this.handles=s.add(t(o.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(e){t(this).data("ui-slider-handle-index",e).attr("tabIndex",0)})},_createRange:function(){var e=this.options;e.range?(!0===e.range&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:t.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=t("<div>").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==e.range&&"max"!==e.range||this._addClass(this.range,"ui-slider-range-"+e.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(e){var i,n,s,o,a,r,l,h=this,u=this.options;return!u.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),i={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(i),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var i=Math.abs(n-h.values(e));(s>i||s===i&&(e===h._lastChangedValue||h.values(e)===u.min))&&(s=i,o=t(this),a=e)}),!1!==this._start(e,a)&&(this._mouseSliding=!0,this._handleIndex=a,this._addClass(o,null,"ui-state-active"),o.trigger("focus"),r=o.offset(),l=!t(e.target).parents().addBack().is(".ui-slider-handle"),this._clickOffset=l?{left:0,top:0}:{left:e.pageX-r.left-o.width()/2,top:e.pageY-r.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(e,a,n),this._animateOff=!0,!0))},_mouseStart:function(){return!0},_mouseDrag:function(t){var e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e);return this._slide(t,this._handleIndex,i),!1},_mouseStop:function(t){return this._removeClass(this.handles,null,"ui-state-active"),this._mouseSliding=!1,this._stop(t,this._handleIndex),this._change(t,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation="vertical"===this.options.orientation?"vertical":"horizontal"},_normValueFromMouse:function(t){var e,i,n,s,o;return"horizontal"===this.orientation?(e=this.elementSize.width,i=t.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(e=this.elementSize.height,i=t.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),n=i/e,n>1&&(n=1),n<0&&(n=0),"vertical"===this.orientation&&(n=1-n),s=this._valueMax()-this._valueMin(),o=this._valueMin()+n*s,this._trimAlignValue(o)},_uiHash:function(t,e,i){var n={handle:this.handles[t],handleIndex:t,value:void 0!==e?e:this.value()};return this._hasMultipleValues()&&(n.value=void 0!==e?e:this.values(t),n.values=i||this.values()),n},_hasMultipleValues:function(){return this.options.values&&this.options.values.length},_start:function(t,e){return this._trigger("start",t,this._uiHash(e))},_slide:function(t,e,i){var n,s=this.value(),o=this.values();this._hasMultipleValues()&&(n=this.values(e?0:1),s=this.values(e),2===this.options.values.length&&!0===this.options.range&&(i=0===e?Math.min(n,i):Math.max(n,i)),o[e]=i),i!==s&&!1!==this._trigger("slide",t,this._uiHash(e,i,o))&&(this._hasMultipleValues()?this.values(e,i):this.value(i))},_stop:function(t,e){this._trigger("stop",t,this._uiHash(e))},_change:function(t,e){this._keySliding||this._mouseSliding||(this._lastChangedValue=e,this._trigger("change",t,this._uiHash(e)))},value:function(t){return arguments.length?(this.options.value=this._trimAlignValue(t),this._refreshValue(),void this._change(null,0)):this._value()},values:function(e,i){var n,s,o;if(arguments.length>1)return this.options.values[e]=this._trimAlignValue(i),this._refreshValue(),void this._change(null,e);if(!arguments.length)return this._values();if(!t.isArray(arguments[0]))return this._hasMultipleValues()?this._values(e):this.value();for(n=this.options.values,s=arguments[0],o=0;o<n.length;o+=1)n[o]=this._trimAlignValue(s[o]),this._change(null,o);this._refreshValue()},_setOption:function(e,i){var n,s=0;switch("range"===e&&!0===this.options.range&&("min"===i?(this.options.value=this._values(0),this.options.values=null):"max"===i&&(this.options.value=this._values(this.options.values.length-1),this.options.values=null)),t.isArray(this.options.values)&&(s=this.options.values.length),this._super(e,i),e){case"orientation":this._detectOrientation(),this._removeClass("ui-slider-horizontal ui-slider-vertical")._addClass("ui-slider-"+this.orientation),this._refreshValue(),this.options.range&&this._refreshRange(i),this.handles.css("horizontal"===i?"bottom":"left","");break;case"value":this._animateOff=!0,this._refreshValue(),this._change(null,0),this._animateOff=!1;break;case"values":for(this._animateOff=!0,this._refreshValue(),n=s-1;n>=0;n--)this._change(null,n);this._animateOff=!1;break;case"step":case"min":case"max":this._animateOff=!0,this._calculateNewMax(),this._refreshValue(),this._animateOff=!1;break;case"range":this._animateOff=!0,this._refresh(),this._animateOff=!1}},_setOptionDisabled:function(t){this._super(t),this._toggleClass(null,"ui-state-disabled",!!t)},_value:function(){var t=this.options.value;return t=this._trimAlignValue(t)},_values:function(t){var e,i,n;if(arguments.length)return e=this.options.values[t],e=this._trimAlignValue(e);if(this._hasMultipleValues()){for(i=this.options.values.slice(),n=0;n<i.length;n+=1)i[n]=this._trimAlignValue(i[n]);return i}return[]},_trimAlignValue:function(t){if(t<=this._valueMin())return this._valueMin();if(t>=this._valueMax())return this._valueMax();var e=this.options.step>0?this.options.step:1,i=(t-this._valueMin())%e,n=t-i;return 2*Math.abs(i)>=e&&(n+=i>0?e:-e),parseFloat(n.toFixed(5))},_calculateNewMax:function(){var t=this.options.max,e=this._valueMin(),i=this.options.step;t=Math.round((t-e)/i)*i+e,t>this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,n,s,o,a=this.options.range,r=this.options,l=this,h=!this._animateOff&&r.animate,u={};this._hasMultipleValues()?this.handles.each(function(n){i=(l.values(n)-l._valueMin())/(l._valueMax()-l._valueMin())*100,u["horizontal"===l.orientation?"left":"bottom"]=i+"%",t(this).stop(1,1)[h?"animate":"css"](u,r.animate),!0===l.options.range&&("horizontal"===l.orientation?(0===n&&l.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},r.animate),1===n&&l.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:r.animate})):(0===n&&l.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},r.animate),1===n&&l.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:r.animate}))),e=i}):(n=this.value(),s=this._valueMin(),o=this._valueMax(),i=o!==s?(n-s)/(o-s)*100:0,u["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](u,r.animate),"min"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},r.animate),"max"===a&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:100-i+"%"},r.animate),"min"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},r.animate),"max"===a&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:100-i+"%"},r.animate))},_handleEvents:{keydown:function(e){var i,n,s,o=t(e.target).data("ui-slider-handle-index");switch(e.keyCode){case t.ui.keyCode.HOME:case t.ui.keyCode.END:case t.ui.keyCode.PAGE_UP:case t.ui.keyCode.PAGE_DOWN:case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(e.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(t(e.target),null,"ui-state-active"),!1===this._start(e,o)))return}switch(s=this.options.step,i=n=this._hasMultipleValues()?this.values(o):this.value(),e.keyCode){case t.ui.keyCode.HOME:n=this._valueMin();break;case t.ui.keyCode.END:n=this._valueMax();break;case t.ui.keyCode.PAGE_UP:n=this._trimAlignValue(i+(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.PAGE_DOWN:n=this._trimAlignValue(i-(this._valueMax()-this._valueMin())/this.numPages);break;case t.ui.keyCode.UP:case t.ui.keyCode.RIGHT:if(i===this._valueMax())return;n=this._trimAlignValue(i+s);break;case t.ui.keyCode.DOWN:case t.ui.keyCode.LEFT:if(i===this._valueMin())return;n=this._trimAlignValue(i-s)}this._slide(e,o,n)},keyup:function(e){var i=t(e.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(e,i),this._change(e,i),this._removeClass(t(e.target),null,"ui-state-active"))}}});t.widget("ui.spinner",{version:"1.12.1",defaultElement:"<input>",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var e=this._super(),i=this.element;return t.each(["min","max","step"],function(t,n){var s=i.attr(n);null!=s&&s.length&&(e[n]=s)}),e},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){if(this.cancelBlur)return void delete this.cancelBlur;this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t)},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((e>0?1:-1)*this.options.step,t),clearTimeout(this.mousewheelTimer),this.mousewheelTimer=this._delay(function(){this.spinning&&this._stop(t)},100),t.preventDefault()}},"mousedown .ui-spinner-button":function(e){function i(){this.element[0]===t.ui.safeActiveElement(this.document[0])||(this.element.trigger("focus"),this.previous=n,this._delay(function(){this.previous=n}))}var n;n=this.element[0]===t.ui.safeActiveElement(this.document[0])?this.previous:this.element.val(),e.preventDefault(),i.call(this),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,i.call(this)}),!1!==this._start(e)&&this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseup .ui-spinner-button":"_stop","mouseenter .ui-spinner-button":function(e){if(t(e.currentTarget).hasClass("ui-state-active"))return!1!==this._start(e)&&void this._repeat(null,t(e.currentTarget).hasClass("ui-spinner-up")?1:-1,e)},"mouseleave .ui-spinner-button":"_stop"},_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap("<span>").parent().append("<a></a><a></a>")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&this.uiSpinner.height()>0&&this.uiSpinner.height(this.uiSpinner.height())},_keydown:function(e){var i=this.options,n=t.ui.keyCode;switch(e.keyCode){case n.UP:return this._repeat(null,1,e),!0;case n.DOWN:return this._repeat(null,-1,e),!0;case n.PAGE_UP:return this._repeat(null,i.page,e),!0;case n.PAGE_DOWN:return this._repeat(null,-i.page,e),!0}return!1},_start:function(t){return!(!this.spinning&&!1===this._trigger("start",t))&&(this.counter||(this.counter=1),this.spinning=!0,!0)},_repeat:function(t,e,i){t=t||500,clearTimeout(this.timer),this.timer=this._delay(function(){this._repeat(40,e,i)},t),this._spin(e*this.options.step,i)},_spin:function(t,e){var i=this.value()||0;this.counter||(this.counter=1),i=this._adjustValue(i+t*this._increment(this.counter)),this.spinning&&!1===this._trigger("spin",e,{value:i})||(this._value(i),this.counter++)},_increment:function(e){var i=this.options.incremental;return i?t.isFunction(i)?i(e):Math.floor(e*e*e/5e4-e*e/500+17*e/200+1):1},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),i=e.indexOf(".");return-1===i?0:e.length-i-1},_adjustValue:function(t){var e,i,n=this.options;return e=null!==n.min?n.min:0,i=t-e,i=Math.round(i/n.step)*n.step,t=e+i,t=parseFloat(t.toFixed(this._precision())),null!==n.max&&t>n.max?n.max:null!==n.min&&t<n.min?n.min:t},_stop:function(t){this.spinning&&(clearTimeout(this.timer),clearTimeout(this.mousewheelTimer),this.counter=0,this.spinning=!1,this._trigger("stop",t))},_setOption:function(t,e){var i,n,s;if("culture"===t||"numberFormat"===t)return i=this._parse(this.element.val()),this.options[t]=e,void this.element.val(this._format(i));"max"!==t&&"min"!==t&&"step"!==t||"string"==typeof e&&(e=this._parse(e)),"icons"===t&&(n=this.buttons.first().find(".ui-icon"),this._removeClass(n,null,this.options.icons.up),this._addClass(n,null,e.up),s=this.buttons.last().find(".ui-icon"),this._removeClass(s,null,this.options.icons.down),this._addClass(s,null,e.down)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this._toggleClass(this.uiSpinner,null,"ui-state-disabled",!!t),this.element.prop("disabled",!!t),this.buttons.button(t?"disable":"enable")},_setOptions:r(function(t){this._super(t)}),_parse:function(t){return"string"==typeof t&&""!==t&&(t=window.Globalize&&this.options.numberFormat?Globalize.parseFloat(t,10,this.options.culture):+t),""===t||isNaN(t)?null:t},_format:function(t){return""===t?"":window.Globalize&&this.options.numberFormat?Globalize.format(t,this.options.numberFormat,this.options.culture):t},_refresh:function(){this.element.attr({"aria-valuemin":this.options.min,"aria-valuemax":this.options.max,"aria-valuenow":this._parse(this.element.val())})},isValid:function(){var t=this.value();return null!==t&&t===this._adjustValue(t)},_value:function(t,e){var i;""!==t&&null!==(i=this._parse(t))&&(e||(i=this._adjustValue(i)),t=this._format(i)),this.element.val(t),this._refresh()},_destroy:function(){this.element.prop("disabled",!1).removeAttr("autocomplete role aria-valuemin aria-valuemax aria-valuenow"),this.uiSpinner.replaceWith(this.element)},stepUp:r(function(t){this._stepUp(t)}),_stepUp:function(t){this._start()&&(this._spin((t||1)*this.options.step),this._stop())},stepDown:r(function(t){this._stepDown(t)}),_stepDown:function(t){this._start()&&(this._spin((t||1)*-this.options.step),this._stop())},pageUp:r(function(t){this._stepUp((t||1)*this.options.page)}),pageDown:r(function(t){this._stepDown((t||1)*this.options.page)}),value:function(t){if(!arguments.length)return this._parse(this.element.val());r(this._value).call(this,t)},widget:function(){return this.uiSpinner}}),!1!==t.uiBackCompat&&t.widget("ui.spinner",t.ui.spinner,{_enhance:function(){this.uiSpinner=this.element.attr("autocomplete","off").wrap(this._uiSpinnerHtml()).parent().append(this._buttonHtml())},_uiSpinnerHtml:function(){return"<span>"},_buttonHtml:function(){return"<a></a><a></a>"}});t.ui.spinner;t.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:function(){var t=/#.*$/;return function(e){var i,n;i=e.href.replace(t,""),n=location.href.replace(t,"");try{i=decodeURIComponent(i)}catch(t){}try{n=decodeURIComponent(n)}catch(t){}return e.hash.length>1&&i===n}}(),_create:function(){var e=this,i=this.options;this.running=!1,this._addClass("ui-tabs","ui-widget ui-widget-content"),this._toggleClass("ui-tabs-collapsible",null,i.collapsible),this._processTabs(),i.active=this._initialActive(),t.isArray(i.disabled)&&(i.disabled=t.unique(i.disabled.concat(t.map(this.tabs.filter(".ui-state-disabled"),function(t){return e.tabs.index(t)}))).sort()),!1!==this.options.active&&this.anchors.length?this.active=this._findActive(i.active):this.active=t(),this._refresh(),this.active.length&&this.load(i.active)},_initialActive:function(){var e=this.options.active,i=this.options.collapsible,n=location.hash.substring(1);return null===e&&(n&&this.tabs.each(function(i,s){if(t(s).attr("aria-controls")===n)return e=i,!1}),null===e&&(e=this.tabs.index(this.tabs.filter(".ui-tabs-active"))),null!==e&&-1!==e||(e=!!this.tabs.length&&0)),!1!==e&&-1===(e=this.tabs.index(this.tabs.eq(e)))&&(e=!i&&0),!i&&!1===e&&this.anchors.length&&(e=0),e},_getCreateEventData:function(){return{tab:this.active,panel:this.active.length?this._getPanelForTab(this.active):t()}},_tabKeydown:function(e){var i=t(t.ui.safeActiveElement(this.document[0])).closest("li"),n=this.tabs.index(i),s=!0;if(!this._handlePageNav(e)){switch(e.keyCode){case t.ui.keyCode.RIGHT:case t.ui.keyCode.DOWN:n++;break;case t.ui.keyCode.UP:case t.ui.keyCode.LEFT:s=!1,n--;break;case t.ui.keyCode.END:n=this.anchors.length-1;break;case t.ui.keyCode.HOME:n=0;break;case t.ui.keyCode.SPACE:return e.preventDefault(),clearTimeout(this.activating),void this._activate(n);case t.ui.keyCode.ENTER:return e.preventDefault(),clearTimeout(this.activating),void this._activate(n!==this.options.active&&n);default:return}e.preventDefault(),clearTimeout(this.activating),n=this._focusNextTab(n,s),e.ctrlKey||e.metaKey||(i.attr("aria-selected","false"),this.tabs.eq(n).attr("aria-selected","true"),this.activating=this._delay(function(){this.option("active",n)},this.delay))}},_panelKeydown:function(e){this._handlePageNav(e)||e.ctrlKey&&e.keyCode===t.ui.keyCode.UP&&(e.preventDefault(),this.active.trigger("focus"))},_handlePageNav:function(e){return e.altKey&&e.keyCode===t.ui.keyCode.PAGE_UP?(this._activate(this._focusNextTab(this.options.active-1,!1)),!0):e.altKey&&e.keyCode===t.ui.keyCode.PAGE_DOWN?(this._activate(this._focusNextTab(this.options.active+1,!0)),!0):void 0},_findNextTab:function(e,i){for(var n=this.tabs.length-1;-1!==t.inArray(function(){return e>n&&(e=0),e<0&&(e=n),e}(),this.options.disabled);)e=i?e+1:e-1;return e},_focusNextTab:function(t,e){return t=this._findNextTab(t,e),this.tabs.eq(t).trigger("focus"),t},_setOption:function(t,e){if("active"===t)return void this._activate(e);this._super(t,e),"collapsible"===t&&(this._toggleClass("ui-tabs-collapsible",null,e),e||!1!==this.options.active||this._activate(0)),"event"===t&&this._setupEvents(e),"heightStyle"===t&&this._setupHeightStyle(e)},_sanitizeSelector:function(t){return t?t.replace(/[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var e=this.options,i=this.tablist.children(":has(a[href])");e.disabled=t.map(i.filter(".ui-state-disabled"),function(t){return i.index(t)}),this._processTabs(),!1!==e.active&&this.anchors.length?this.active.length&&!t.contains(this.tablist[0],this.active[0])?this.tabs.length===e.disabled.length?(e.active=!1,this.active=t()):this._activate(this._findNextTab(Math.max(0,e.active-1),!1)):e.active=this.tabs.index(this.active):(e.active=!1,this.active=t()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var e=this,i=this.tabs,n=this.anchors,s=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(e){t(this).is(".ui-state-disabled")&&e.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){t(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return t("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=t(),this.anchors.each(function(i,n){var s,o,a,r=t(n).uniqueId().attr("id"),l=t(n).closest("li"),h=l.attr("aria-controls");e._isLocal(n)?(s=n.hash,a=s.substring(1),o=e.element.find(e._sanitizeSelector(s))):(a=l.attr("aria-controls")||t({}).uniqueId()[0].id,s="#"+a,o=e.element.find(s),o.length||(o=e._createPanel(a),o.insertAfter(e.panels[i-1]||e.tablist)),o.attr("aria-live","polite")),o.length&&(e.panels=e.panels.add(o)),h&&l.data("ui-tabs-aria-controls",h),l.attr({"aria-controls":a,"aria-labelledby":r}),o.attr("aria-labelledby",r)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),i&&(this._off(i.not(this.tabs)),this._off(n.not(this.anchors)),this._off(s.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(e){return t("<div>").attr("id",e).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(e){var i,n,s;for(t.isArray(e)&&(e.length?e.length===this.anchors.length&&(e=!0):e=!1),s=0;n=this.tabs[s];s++)i=t(n),!0===e||-1!==t.inArray(s,e)?(i.attr("aria-disabled","true"),this._addClass(i,null,"ui-state-disabled")):(i.removeAttr("aria-disabled"),this._removeClass(i,null,"ui-state-disabled"));this.options.disabled=e,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===e)},_setupEvents:function(e){var i={};e&&t.each(e.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(e){var i,n=this.element.parent();"fill"===e?(i=n.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var e=t(this),n=e.css("position");"absolute"!==n&&"fixed"!==n&&(i-=e.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=t(this).outerHeight(!0)}),this.panels.each(function(){t(this).height(Math.max(0,i-t(this).innerHeight()+t(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.panels.each(function(){i=Math.max(i,t(this).height("").height())}).height(i))},_eventHandler:function(e){var i=this.options,n=this.active,s=t(e.currentTarget),o=s.closest("li"),a=o[0]===n[0],r=a&&i.collapsible,l=r?t():this._getPanelForTab(o),h=n.length?this._getPanelForTab(n):t(),u={oldTab:n,
oldPanel:h,newTab:r?t():o,newPanel:l};e.preventDefault(),o.hasClass("ui-state-disabled")||o.hasClass("ui-tabs-loading")||this.running||a&&!i.collapsible||!1===this._trigger("beforeActivate",e,u)||(i.active=!r&&this.tabs.index(o),this.active=a?t():o,this.xhr&&this.xhr.abort(),h.length||l.length||t.error("jQuery UI Tabs: Mismatching fragment identifier."),l.length&&this.load(this.tabs.index(o),e),this._toggle(e,u))},_toggle:function(e,i){function n(){o.running=!1,o._trigger("activate",e,i)}function s(){o._addClass(i.newTab.closest("li"),"ui-tabs-active","ui-state-active"),a.length&&o.options.show?o._show(a,o.options.show,n):(a.show(),n())}var o=this,a=i.newPanel,r=i.oldPanel;this.running=!0,r.length&&this.options.hide?this._hide(r,this.options.hide,function(){o._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),s()}):(this._removeClass(i.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),r.hide(),s()),r.attr("aria-hidden","true"),i.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),a.length&&r.length?i.oldTab.attr("tabIndex",-1):a.length&&this.tabs.filter(function(){return 0===t(this).attr("tabIndex")}).attr("tabIndex",-1),a.attr("aria-hidden","false"),i.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(e){var i,n=this._findActive(e);n[0]!==this.active[0]&&(n.length||(n=this.active),i=n.find(".ui-tabs-anchor")[0],this._eventHandler({target:i,currentTarget:i,preventDefault:t.noop}))},_findActive:function(e){return!1===e?t():this.tabs.eq(e)},_getIndex:function(e){return"string"==typeof e&&(e=this.anchors.index(this.anchors.filter("[href$='"+t.ui.escapeSelector(e)+"']"))),e},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){t.data(this,"ui-tabs-destroy")?t(this).remove():t(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var e=t(this),i=e.data("ui-tabs-aria-controls");i?e.attr("aria-controls",i).removeData("ui-tabs-aria-controls"):e.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(e){var i=this.options.disabled;!1!==i&&(void 0===e?i=!1:(e=this._getIndex(e),i=t.isArray(i)?t.map(i,function(t){return t!==e?t:null}):t.map(this.tabs,function(t,i){return i!==e?i:null})),this._setOptionDisabled(i))},disable:function(e){var i=this.options.disabled;if(!0!==i){if(void 0===e)i=!0;else{if(e=this._getIndex(e),-1!==t.inArray(e,i))return;i=t.isArray(i)?t.merge([e],i).sort():[e]}this._setOptionDisabled(i)}},load:function(e,i){e=this._getIndex(e);var n=this,s=this.tabs.eq(e),o=s.find(".ui-tabs-anchor"),a=this._getPanelForTab(s),r={tab:s,panel:a},l=function(t,e){"abort"===e&&n.panels.stop(!1,!0),n._removeClass(s,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr};this._isLocal(o[0])||(this.xhr=t.ajax(this._ajaxSettings(o,i,r)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(s,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,s){setTimeout(function(){a.html(t),n._trigger("load",i,r),l(s,e)},1)}).fail(function(t,e){setTimeout(function(){l(t,e)},1)})))},_ajaxSettings:function(e,i,n){var s=this;return{url:e.attr("href").replace(/#.*$/,""),beforeSend:function(e,o){return s._trigger("beforeLoad",i,t.extend({jqXHR:e,ajaxSettings:o},n))}}},_getPanelForTab:function(e){var i=t(e).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+i))}}),!1!==t.uiBackCompat&&t.widget("ui.tabs",t.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});t.ui.tabs;t.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var e=t(this).attr("title")||"";return t("<a>").text(e).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(e,i){var n=(e.attr("aria-describedby")||"").split(/\s+/);n.push(i),e.data("ui-tooltip-id",i).attr("aria-describedby",t.trim(n.join(" ")))},_removeDescribedBy:function(e){var i=e.data("ui-tooltip-id"),n=(e.attr("aria-describedby")||"").split(/\s+/),s=t.inArray(i,n);-1!==s&&n.splice(s,1),e.removeData("ui-tooltip-id"),n=t.trim(n.join(" ")),n?e.attr("aria-describedby",n):e.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=t("<div>").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=t([])},_setOption:function(e,i){var n=this;this._super(e,i),"content"===e&&t.each(this.tooltips,function(t,e){n._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var e=this;t.each(this.tooltips,function(i,n){var s=t.Event("blur");s.target=s.currentTarget=n.element[0],e.close(s,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var e=t(this);if(e.is("[title]"))return e.data("ui-tooltip-title",e.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var e=t(this);e.data("ui-tooltip-title")&&e.attr("title",e.data("ui-tooltip-title"))}),this.disabledTitles=t([])},open:function(e){var i=this,n=t(e?e.target:this.element).closest(this.options.items);n.length&&!n.data("ui-tooltip-id")&&(n.attr("title")&&n.data("ui-tooltip-title",n.attr("title")),n.data("ui-tooltip-open",!0),e&&"mouseover"===e.type&&n.parents().each(function(){var e,n=t(this);n.data("ui-tooltip-open")&&(e=t.Event("blur"),e.target=e.currentTarget=this,i.close(e,!0)),n.attr("title")&&(n.uniqueId(),i.parents[this.id]={element:this,title:n.attr("title")},n.attr("title",""))}),this._registerCloseHandlers(e,n),this._updateContent(n,e))},_updateContent:function(t,e){var i,n=this.options.content,s=this,o=e?e.type:null;if("string"==typeof n||n.nodeType||n.jquery)return this._open(e,t,n);(i=n.call(t[0],function(i){s._delay(function(){t.data("ui-tooltip-open")&&(e&&(e.type=o),this._open(e,t,i))})}))&&this._open(e,t,i)},_open:function(e,i,n){function s(t){h.of=t,a.is(":hidden")||a.position(h)}var o,a,r,l,h=t.extend({},this.options.position);if(n){if(o=this._find(i))return void o.tooltip.find(".ui-tooltip-content").html(n);i.is("[title]")&&(e&&"mouseover"===e.type?i.attr("title",""):i.removeAttr("title")),o=this._tooltip(i),a=o.tooltip,this._addDescribedBy(i,a.attr("id")),a.find(".ui-tooltip-content").html(n),this.liveRegion.children().hide(),l=t("<div>").html(a.find(".ui-tooltip-content").html()),l.removeAttr("name").find("[name]").removeAttr("name"),l.removeAttr("id").find("[id]").removeAttr("id"),l.appendTo(this.liveRegion),this.options.track&&e&&/^mouse/.test(e.type)?(this._on(this.document,{mousemove:s}),s(e)):a.position(t.extend({of:i},this.options.position)),a.hide(),this._show(a,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(r=this.delayedShow=setInterval(function(){a.is(":visible")&&(s(h.of),clearInterval(r))},t.fx.interval)),this._trigger("open",e,{tooltip:a})}},_registerCloseHandlers:function(e,i){var n={keyup:function(e){if(e.keyCode===t.ui.keyCode.ESCAPE){var n=t.Event(e);n.currentTarget=i[0],this.close(n,!0)}}};i[0]!==this.element[0]&&(n.remove=function(){this._removeTooltip(this._find(i).tooltip)}),e&&"mouseover"!==e.type||(n.mouseleave="close"),e&&"focusin"!==e.type||(n.focusout="close"),this._on(!0,i,n)},close:function(e){var i,n=this,s=t(e?e.currentTarget:this.element),o=this._find(s);if(!o)return void s.removeData("ui-tooltip-open");i=o.tooltip,o.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),o.hiding=!0,i.stop(!0),this._hide(i,this.options.hide,function(){n._removeTooltip(t(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),e&&"mouseleave"===e.type&&t.each(this.parents,function(e,i){t(i.element).attr("title",i.title),delete n.parents[e]}),o.closing=!0,this._trigger("close",e,{tooltip:i}),o.hiding||(o.closing=!1))},_tooltip:function(e){var i=t("<div>").attr("role","tooltip"),n=t("<div>").appendTo(i),s=i.uniqueId().attr("id");return this._addClass(n,"ui-tooltip-content"),this._addClass(i,"ui-tooltip","ui-widget ui-widget-content"),i.appendTo(this._appendTo(e)),this.tooltips[s]={element:e,tooltip:i}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var e=this;t.each(this.tooltips,function(i,n){var s=t.Event("blur"),o=n.element;s.target=s.currentTarget=o[0],e.close(s,!0),t("#"+i).remove(),o.data("ui-tooltip-title")&&(o.attr("title")||o.attr("title",o.data("ui-tooltip-title")),o.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==t.uiBackCompat&&t.widget("ui.tooltip",t.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}});var p=(t.ui.tooltip,"ui-effects-animated"),g=t;t.effects={effect:{}},function(t,e){function i(t,e,i){var n=u[e.type]||{};return null==t?i||!e.def?null:e.def:(t=n.floor?~~t:parseFloat(t),isNaN(t)?e.def:n.mod?(t+n.mod)%n.mod:0>t?0:n.max<t?n.max:t)}function n(e){var i=l(),n=i._rgba=[];return e=e.toLowerCase(),f(r,function(t,s){var o,a=s.re.exec(e),r=a&&s.parse(a),l=s.space||"rgba";if(r)return o=i[l](r),i[h[l].cache]=o[h[l].cache],n=i._rgba=o._rgba,!1}),n.length?("0,0,0,0"===n.join()&&t.extend(n,o.transparent),i):o[e]}function s(t,e,i){return i=(i+1)%1,6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}var o,a=/^([\-+])=\s*(\d+\.?\d*)/,r=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16)]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16)]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],l=t.Color=function(e,i,n,s){return new t.Color.fn.parse(e,i,n,s)},h={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},u={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},c=l.support={},d=t("<p>")[0],f=t.each;d.style.cssText="background-color:rgba(1,1,1,.5)",c.rgba=d.style.backgroundColor.indexOf("rgba")>-1,f(h,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),l.fn=t.extend(l.prototype,{parse:function(e,s,a,r){if(void 0===e)return this._rgba=[null,null,null,null],this;(e.jquery||e.nodeType)&&(e=t(e).css(s),s=void 0);var u=this,c=t.type(e),d=this._rgba=[];return void 0!==s&&(e=[e,s,a,r],c="array"),"string"===c?this.parse(n(e)||o._default):"array"===c?(f(h.rgba.props,function(t,n){d[n.idx]=i(e[n.idx],n)}),this):"object"===c?(e instanceof l?f(h,function(t,i){e[i.cache]&&(u[i.cache]=e[i.cache].slice())}):f(h,function(n,s){var o=s.cache;f(s.props,function(t,n){if(!u[o]&&s.to){if("alpha"===t||null==e[t])return;u[o]=s.to(u._rgba)}u[o][n.idx]=i(e[t],n,!0)}),u[o]&&t.inArray(null,u[o].slice(0,3))<0&&(u[o][3]=1,s.from&&(u._rgba=s.from(u[o])))}),this):void 0},is:function(t){var e=l(t),i=!0,n=this;return f(h,function(t,s){var o,a=e[s.cache];return a&&(o=n[s.cache]||s.to&&s.to(n._rgba)||[],f(s.props,function(t,e){if(null!=a[e.idx])return i=a[e.idx]===o[e.idx]})),i}),i},_space:function(){var t=[],e=this;return f(h,function(i,n){e[n.cache]&&t.push(i)}),t.pop()},transition:function(t,e){var n=l(t),s=n._space(),o=h[s],a=0===this.alpha()?l("transparent"):this,r=a[o.cache]||o.to(a._rgba),c=r.slice();return n=n[o.cache],f(o.props,function(t,s){var o=s.idx,a=r[o],l=n[o],h=u[s.type]||{};null!==l&&(null===a?c[o]=l:(h.mod&&(l-a>h.mod/2?a+=h.mod:a-l>h.mod/2&&(a-=h.mod)),c[o]=i((l-a)*e+a,s)))}),this[s](c)},blend:function(e){if(1===this._rgba[3])return this;var i=this._rgba.slice(),n=i.pop(),s=l(e)._rgba;return l(t.map(i,function(t,e){return(1-n)*s[e]+n*t}))},toRgbaString:function(){var e="rgba(",i=t.map(this._rgba,function(t,e){return null==t?e>2?1:0:t});return 1===i[3]&&(i.pop(),e="rgb("),e+i.join()+")"},toHslaString:function(){var e="hsla(",i=t.map(this.hsla(),function(t,e){return null==t&&(t=e>2?1:0),e&&e<3&&(t=Math.round(100*t)+"%"),t});return 1===i[3]&&(i.pop(),e="hsl("),e+i.join()+")"},toHexString:function(e){var i=this._rgba.slice(),n=i.pop();return e&&i.push(~~(255*n)),"#"+t.map(i,function(t){return t=(t||0).toString(16),1===t.length?"0"+t:t}).join("")},toString:function(){return 0===this._rgba[3]?"transparent":this.toRgbaString()}}),l.fn.parse.prototype=l.fn,h.hsla.to=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e,i,n=t[0]/255,s=t[1]/255,o=t[2]/255,a=t[3],r=Math.max(n,s,o),l=Math.min(n,s,o),h=r-l,u=r+l,c=.5*u;return e=l===r?0:n===r?60*(s-o)/h+360:s===r?60*(o-n)/h+120:60*(n-s)/h+240,i=0===h?0:c<=.5?h/u:h/(2-u),[Math.round(e)%360,i,c,null==a?1:a]},h.hsla.from=function(t){if(null==t[0]||null==t[1]||null==t[2])return[null,null,null,t[3]];var e=t[0]/360,i=t[1],n=t[2],o=t[3],a=n<=.5?n*(1+i):n+i-n*i,r=2*n-a;return[Math.round(255*s(r,a,e+1/3)),Math.round(255*s(r,a,e)),Math.round(255*s(r,a,e-1/3)),o]},f(h,function(e,n){var s=n.props,o=n.cache,r=n.to,h=n.from;l.fn[e]=function(e){if(r&&!this[o]&&(this[o]=r(this._rgba)),void 0===e)return this[o].slice();var n,a=t.type(e),u="array"===a||"object"===a?e:arguments,c=this[o].slice();return f(s,function(t,e){var n=u["object"===a?t:e.idx];null==n&&(n=c[e.idx]),c[e.idx]=i(n,e)}),h?(n=l(h(c)),n[o]=c,n):l(c)},f(s,function(i,n){l.fn[i]||(l.fn[i]=function(s){var o,r=t.type(s),l="alpha"===i?this._hsla?"hsla":"rgba":e,h=this[l](),u=h[n.idx];return"undefined"===r?u:("function"===r&&(s=s.call(this,u),r=t.type(s)),null==s&&n.empty?this:("string"===r&&(o=a.exec(s))&&(s=u+parseFloat(o[2])*("+"===o[1]?1:-1)),h[n.idx]=s,this[l](h)))})})}),l.hook=function(e){var i=e.split(" ");f(i,function(e,i){t.cssHooks[i]={set:function(e,s){var o,a,r="";if("transparent"!==s&&("string"!==t.type(s)||(o=n(s)))){if(s=l(o||s),!c.rgba&&1!==s._rgba[3]){for(a="backgroundColor"===i?e.parentNode:e;(""===r||"transparent"===r)&&a&&a.style;)try{r=t.css(a,"backgroundColor"),a=a.parentNode}catch(t){}s=s.blend(r&&"transparent"!==r?r:"_default")}s=s.toRgbaString()}try{e.style[i]=s}catch(t){}}},t.fx.step[i]=function(e){e.colorInit||(e.start=l(e.elem,i),e.end=l(e.end),e.colorInit=!0),t.cssHooks[i].set(e.elem,e.start.transition(e.end,e.pos))}})},l.hook("backgroundColor borderBottomColor borderLeftColor borderRightColor borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor"),t.cssHooks.borderColor={expand:function(t){var e={};return f(["Top","Right","Bottom","Left"],function(i,n){e["border"+n+"Color"]=t}),e}},o=t.Color.names={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00",transparent:[null,null,null,0],_default:"#ffffff"}}(g),function(){function e(e){var i,n,s=e.ownerDocument.defaultView?e.ownerDocument.defaultView.getComputedStyle(e,null):e.currentStyle,o={};if(s&&s.length&&s[0]&&s[s[0]])for(n=s.length;n--;)i=s[n],"string"==typeof s[i]&&(o[t.camelCase(i)]=s[i]);else for(i in s)"string"==typeof s[i]&&(o[i]=s[i]);return o}function i(e,i){var n,o,a={};for(n in i)o=i[n],e[n]!==o&&(s[n]||!t.fx.step[n]&&isNaN(parseFloat(o))||(a[n]=o));return a}var n=["add","remove","toggle"],s={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};t.each(["borderLeftStyle","borderRightStyle","borderBottomStyle","borderTopStyle"],function(e,i){t.fx.step[i]=function(t){("none"!==t.end&&!t.setAttr||1===t.pos&&!t.setAttr)&&(g.style(t.elem,i,t.end),t.setAttr=!0)}}),t.fn.addBack||(t.fn.addBack=function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}),t.effects.animateClass=function(s,o,a,r){var l=t.speed(o,a,r);return this.queue(function(){var o,a=t(this),r=a.attr("class")||"",h=l.children?a.find("*").addBack():a;h=h.map(function(){return{el:t(this),start:e(this)}}),o=function(){t.each(n,function(t,e){s[e]&&a[e+"Class"](s[e])})},o(),h=h.map(function(){return this.end=e(this.el[0]),this.diff=i(this.start,this.end),this}),a.attr("class",r),h=h.map(function(){var e=this,i=t.Deferred(),n=t.extend({},l,{queue:!1,complete:function(){i.resolve(e)}});return this.el.animate(this.diff,n),i.promise()}),t.when.apply(t,h.get()).done(function(){o(),t.each(arguments,function(){var e=this.el;t.each(this.diff,function(t){e.css(t,"")})}),l.complete.call(a[0])})})},t.fn.extend({addClass:function(e){return function(i,n,s,o){return n?t.effects.animateClass.call(this,{add:i},n,s,o):e.apply(this,arguments)}}(t.fn.addClass),removeClass:function(e){return function(i,n,s,o){return arguments.length>1?t.effects.animateClass.call(this,{remove:i},n,s,o):e.apply(this,arguments)}}(t.fn.removeClass),toggleClass:function(e){return function(i,n,s,o,a){return"boolean"==typeof n||void 0===n?s?t.effects.animateClass.call(this,n?{add:i}:{remove:i},s,o,a):e.apply(this,arguments):t.effects.animateClass.call(this,{toggle:i},n,s,o)}}(t.fn.toggleClass),switchClass:function(e,i,n,s,o){return t.effects.animateClass.call(this,{add:i,remove:e},n,s,o)}})}(),function(){function e(e,i,n,s){return t.isPlainObject(e)&&(i=e,e=e.effect),e={effect:e},null==i&&(i={}),t.isFunction(i)&&(s=i,n=null,i={}),("number"==typeof i||t.fx.speeds[i])&&(s=n,n=i,i={}),t.isFunction(n)&&(s=n,n=null),i&&t.extend(e,i),n=n||i.duration,e.duration=t.fx.off?0:"number"==typeof n?n:n in t.fx.speeds?t.fx.speeds[n]:t.fx.speeds._default,e.complete=s||i.complete,e}function i(e){return!(e&&"number"!=typeof e&&!t.fx.speeds[e])||("string"==typeof e&&!t.effects.effect[e]||(!!t.isFunction(e)||"object"==typeof e&&!e.effect))}function n(t,e){var i=e.outerWidth(),n=e.outerHeight(),s=/^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/,o=s.exec(t)||["",0,i,n,0];return{top:parseFloat(o[1])||0,right:"auto"===o[2]?i:parseFloat(o[2]),bottom:"auto"===o[3]?n:parseFloat(o[3]),left:parseFloat(o[4])||0}}t.expr&&t.expr.filters&&t.expr.filters.animated&&(t.expr.filters.animated=function(e){return function(i){return!!t(i).data(p)||e(i)}}(t.expr.filters.animated)),!1!==t.uiBackCompat&&t.extend(t.effects,{save:function(t,e){for(var i=0,n=e.length;i<n;i++)null!==e[i]&&t.data("ui-effects-"+e[i],t[0].style[e[i]])},restore:function(t,e){for(var i,n=0,s=e.length;n<s;n++)null!==e[n]&&(i=t.data("ui-effects-"+e[n]),t.css(e[n],i))},setMode:function(t,e){return"toggle"===e&&(e=t.is(":hidden")?"show":"hide"),e},createWrapper:function(e){if(e.parent().is(".ui-effects-wrapper"))return e.parent();var i={width:e.outerWidth(!0),height:e.outerHeight(!0),float:e.css("float")},n=t("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),s={width:e.width(),height:e.height()},o=document.activeElement;try{o.id}catch(t){o=document.body}return e.wrap(n),(e[0]===o||t.contains(e[0],o))&&t(o).trigger("focus"),n=e.parent(),"static"===e.css("position")?(n.css({position:"relative"}),e.css({position:"relative"})):(t.extend(i,{position:e.css("position"),zIndex:e.css("z-index")}),t.each(["top","left","bottom","right"],function(t,n){i[n]=e.css(n),isNaN(parseInt(i[n],10))&&(i[n]="auto")}),e.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),e.css(s),n.css(i).show()},removeWrapper:function(e){var i=document.activeElement;return e.parent().is(".ui-effects-wrapper")&&(e.parent().replaceWith(e),(e[0]===i||t.contains(e[0],i))&&t(i).trigger("focus")),e}}),t.extend(t.effects,{version:"1.12.1",define:function(e,i,n){return n||(n=i,i="effect"),t.effects.effect[e]=n,t.effects.effect[e].mode=i,n},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var n="horizontal"!==i?(e||100)/100:1,s="vertical"!==i?(e||100)/100:1;return{height:t.height()*s,width:t.width()*n,outerHeight:t.outerHeight()*s,outerWidth:t.outerWidth()*n}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var n=t.queue();e>1&&n.splice.apply(n,[1,0].concat(n.splice(e,i))),t.dequeue()},saveStyle:function(t){t.data("ui-effects-style",t[0].style.cssText)},restoreStyle:function(t){t[0].style.cssText=t.data("ui-effects-style")||"",t.removeData("ui-effects-style")},mode:function(t,e){var i=t.is(":hidden");return"toggle"===e&&(e=i?"show":"hide"),(i?"hide"===e:"show"===e)&&(e="none"),e},getBaseline:function(t,e){var i,n;switch(t[0]){case"top":i=0;break;case"middle":i=.5;break;case"bottom":i=1;break;default:i=t[0]/e.height}switch(t[1]){case"left":n=0;break;case"center":n=.5;break;case"right":n=1;break;default:n=t[1]/e.width}return{x:n,y:i}},createPlaceholder:function(e){var i,n=e.css("position"),s=e.position();return e.css({marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()),/^(static|relative)/.test(n)&&(n="absolute",i=t("<"+e[0].nodeName+">").insertAfter(e).css({display:/^(inline|ruby)/.test(e.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:e.css("marginTop"),marginBottom:e.css("marginBottom"),marginLeft:e.css("marginLeft"),marginRight:e.css("marginRight"),float:e.css("float")}).outerWidth(e.outerWidth()).outerHeight(e.outerHeight()).addClass("ui-effects-placeholder"),e.data("ui-effects-placeholder",i)),e.css({position:n,left:s.left,top:s.top}),i},removePlaceholder:function(t){var e="ui-effects-placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(e){t.effects.restoreStyle(e),t.effects.removePlaceholder(e)},setTransition:function(e,i,n,s){return s=s||{},t.each(i,function(t,i){var o=e.cssUnit(i);o[0]>0&&(s[i]=o[0]*n+o[1])}),s}}),t.fn.extend({effect:function(){function i(e){function i(){r.removeData(p),t.effects.cleanUp(r),"hide"===n.mode&&r.hide(),a()}function a(){t.isFunction(l)&&l.call(r[0]),t.isFunction(e)&&e()}var r=t(this);n.mode=u.shift(),!1===t.uiBackCompat||o?"none"===n.mode?(r[h](),a()):s.call(r[0],n,i):(r.is(":hidden")?"hide"===h:"show"===h)?(r[h](),a()):s.call(r[0],n,a)}var n=e.apply(this,arguments),s=t.effects.effect[n.effect],o=s.mode,a=n.queue,r=a||"fx",l=n.complete,h=n.mode,u=[],c=function(e){var i=t(this),n=t.effects.mode(i,h)||o;i.data(p,!0),u.push(n),o&&("show"===n||n===o&&"hide"===n)&&i.show(),o&&"none"===n||t.effects.saveStyle(i),t.isFunction(e)&&e()};return t.fx.off||!s?h?this[h](n.duration,l):this.each(function(){l&&l.call(this)}):!1===a?this.each(c).each(i):this.queue(r,c).queue(r,i)},show:function(t){return function(n){if(i(n))return t.apply(this,arguments);var s=e.apply(this,arguments);return s.mode="show",this.effect.call(this,s)}}(t.fn.show),hide:function(t){return function(n){if(i(n))return t.apply(this,arguments);var s=e.apply(this,arguments);return s.mode="hide",this.effect.call(this,s)}}(t.fn.hide),toggle:function(t){return function(n){if(i(n)||"boolean"==typeof n)return t.apply(this,arguments);var s=e.apply(this,arguments);return s.mode="toggle",this.effect.call(this,s)}}(t.fn.toggle),cssUnit:function(e){var i=this.css(e),n=[];return t.each(["em","px","%","pt"],function(t,e){i.indexOf(e)>0&&(n=[parseFloat(i),e])}),n},cssClip:function(t){return t?this.css("clip","rect("+t.top+"px "+t.right+"px "+t.bottom+"px "+t.left+"px)"):n(this.css("clip"),this)},transfer:function(e,i){var n=t(this),s=t(e.to),o="fixed"===s.css("position"),a=t("body"),r=o?a.scrollTop():0,l=o?a.scrollLeft():0,h=s.offset(),u={top:h.top-r,left:h.left-l,height:s.innerHeight(),width:s.innerWidth()},c=n.offset(),d=t("<div class='ui-effects-transfer'></div>").appendTo("body").addClass(e.className).css({top:c.top-r,left:c.left-l,height:n.innerHeight(),width:n.innerWidth(),position:o?"fixed":"absolute"}).animate(u,e.duration,e.easing,function(){d.remove(),t.isFunction(i)&&i()})}}),t.fx.step.clip=function(e){e.clipInit||(e.start=t(e.elem).cssClip(),"string"==typeof e.end&&(e.end=n(e.end,e.elem)),e.clipInit=!0),t(e.elem).cssClip({top:e.pos*(e.end.top-e.start.top)+e.start.top,right:e.pos*(e.end.right-e.start.right)+e.start.right,bottom:e.pos*(e.end.bottom-e.start.bottom)+e.start.bottom,left:e.pos*(e.end.left-e.start.left)+e.start.left})}}(),function(){var e={};t.each(["Quad","Cubic","Quart","Quint","Expo"],function(t,i){e[i]=function(e){return Math.pow(e,t+2)}}),t.extend(e,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),t.each(e,function(e,i){t.easing["easeIn"+e]=i,t.easing["easeOut"+e]=function(t){return 1-i(1-t)},t.easing["easeInOut"+e]=function(t){return t<.5?i(2*t)/2:1-i(-2*t+2)/2}})}();t.effects,t.effects.define("blind","hide",function(e,i){var n={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},s=t(this),o=e.direction||"up",a=s.cssClip(),r={clip:t.extend({},a)},l=t.effects.createPlaceholder(s);r.clip[n[o][0]]=r.clip[n[o][1]],"show"===e.mode&&(s.cssClip(r.clip),l&&l.css(t.effects.clipToBox(r)),r.clip=a),l&&l.animate(t.effects.clipToBox(r),e.duration,e.easing),s.animate(r,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("bounce",function(e,i){var n,s,o,a=t(this),r=e.mode,l="hide"===r,h="show"===r,u=e.direction||"up",c=e.distance,d=e.times||5,f=2*d+(h||l?1:0),p=e.duration/f,g=e.easing,m="up"===u||"down"===u?"top":"left",v="up"===u||"left"===u,b=0,_=a.queue().length;for(t.effects.createPlaceholder(a),o=a.css(m),c||(c=a["top"===m?"outerHeight":"outerWidth"]()/3),h&&(s={opacity:1},s[m]=o,a.css("opacity",0).css(m,v?2*-c:2*c).animate(s,p,g)),l&&(c/=Math.pow(2,d-1)),s={},s[m]=o;b<d;b++)n={},n[m]=(v?"-=":"+=")+c,a.animate(n,p,g).animate(s,p,g),c=l?2*c:c/2;l&&(n={opacity:0},n[m]=(v?"-=":"+=")+c,a.animate(n,p,g)),a.queue(i),t.effects.unshift(a,_,f+1)}),t.effects.define("clip","hide",function(e,i){var n,s={},o=t(this),a=e.direction||"vertical",r="both"===a,l=r||"horizontal"===a,h=r||"vertical"===a;n=o.cssClip(),s.clip={top:h?(n.bottom-n.top)/2:n.top,right:l?(n.right-n.left)/2:n.right,bottom:h?(n.bottom-n.top)/2:n.bottom,left:l?(n.right-n.left)/2:n.left},t.effects.createPlaceholder(o),"show"===e.mode&&(o.cssClip(s.clip),s.clip=n),o.animate(s,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("drop","hide",function(e,i){var n,s=t(this),o=e.mode,a="show"===o,r=e.direction||"left",l="up"===r||"down"===r?"top":"left",h="up"===r||"left"===r?"-=":"+=",u="+="===h?"-=":"+=",c={opacity:0};t.effects.createPlaceholder(s),n=e.distance||s["top"===l?"outerHeight":"outerWidth"](!0)/2,c[l]=h+n,a&&(s.css(c),c[l]=u+n,c.opacity=1),s.animate(c,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("explode","hide",function(e,i){function n(){_.push(this),_.length===c*d&&s()}function s(){f.css({visibility:"visible"}),t(_).remove(),i()}var o,a,r,l,h,u,c=e.pieces?Math.round(Math.sqrt(e.pieces)):3,d=c,f=t(this),p=e.mode,g="show"===p,m=f.show().css("visibility","hidden").offset(),v=Math.ceil(f.outerWidth()/d),b=Math.ceil(f.outerHeight()/c),_=[];for(o=0;o<c;o++)for(l=m.top+o*b,u=o-(c-1)/2,a=0;a<d;a++)r=m.left+a*v,h=a-(d-1)/2,f.clone().appendTo("body").wrap("<div></div>").css({position:"absolute",visibility:"visible",left:-a*v,top:-o*b}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:v,height:b,left:r+(g?h*v:0),top:l+(g?u*b:0),opacity:g?0:1}).animate({left:r+(g?0:h*v),top:l+(g?0:u*b),opacity:g?1:0},e.duration||500,e.easing,n)}),t.effects.define("fade","toggle",function(e,i){var n="show"===e.mode;t(this).css("opacity",n?0:1).animate({opacity:n?1:0},{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("fold","hide",function(e,i){var n=t(this),s=e.mode,o="show"===s,a="hide"===s,r=e.size||15,l=/([0-9]+)%/.exec(r),h=!!e.horizFirst,u=h?["right","bottom"]:["bottom","right"],c=e.duration/2,d=t.effects.createPlaceholder(n),f=n.cssClip(),p={clip:t.extend({},f)},g={clip:t.extend({},f)},m=[f[u[0]],f[u[1]]],v=n.queue().length;l&&(r=parseInt(l[1],10)/100*m[a?0:1]),p.clip[u[0]]=r,g.clip[u[0]]=r,g.clip[u[1]]=0,o&&(n.cssClip(g.clip),d&&d.css(t.effects.clipToBox(g)),g.clip=f),n.queue(function(i){d&&d.animate(t.effects.clipToBox(p),c,e.easing).animate(t.effects.clipToBox(g),c,e.easing),i()}).animate(p,c,e.easing).animate(g,c,e.easing).queue(i),t.effects.unshift(n,v,4)}),t.effects.define("highlight","show",function(e,i){var n=t(this),s={backgroundColor:n.css("backgroundColor")};"hide"===e.mode&&(s.opacity=0),t.effects.saveStyle(n),n.css({backgroundImage:"none",backgroundColor:e.color||"#ffff99"}).animate(s,{queue:!1,duration:e.duration,easing:e.easing,complete:i})}),t.effects.define("size",function(e,i){var n,s,o,a=t(this),r=["fontSize"],l=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],u=e.mode,c="effect"!==u,d=e.scale||"both",f=e.origin||["middle","center"],p=a.css("position"),g=a.position(),m=t.effects.scaledDimensions(a),v=e.from||m,b=e.to||t.effects.scaledDimensions(a,0);t.effects.createPlaceholder(a),"show"===u&&(o=v,v=b,b=o),s={from:{y:v.height/m.height,x:v.width/m.width},to:{y:b.height/m.height,x:b.width/m.width}},"box"!==d&&"both"!==d||(s.from.y!==s.to.y&&(v=t.effects.setTransition(a,l,s.from.y,v),b=t.effects.setTransition(a,l,s.to.y,b)),s.from.x!==s.to.x&&(v=t.effects.setTransition(a,h,s.from.x,v),b=t.effects.setTransition(a,h,s.to.x,b))),"content"!==d&&"both"!==d||s.from.y!==s.to.y&&(v=t.effects.setTransition(a,r,s.from.y,v),b=t.effects.setTransition(a,r,s.to.y,b)),f&&(n=t.effects.getBaseline(f,m),v.top=(m.outerHeight-v.outerHeight)*n.y+g.top,v.left=(m.outerWidth-v.outerWidth)*n.x+g.left,b.top=(m.outerHeight-b.outerHeight)*n.y+g.top,b.left=(m.outerWidth-b.outerWidth)*n.x+g.left),a.css(v),"content"!==d&&"both"!==d||(l=l.concat(["marginTop","marginBottom"]).concat(r),h=h.concat(["marginLeft","marginRight"]),a.find("*[width]").each(function(){var i=t(this),n=t.effects.scaledDimensions(i),o={height:n.height*s.from.y,width:n.width*s.from.x,outerHeight:n.outerHeight*s.from.y,outerWidth:n.outerWidth*s.from.x},a={height:n.height*s.to.y,width:n.width*s.to.x,outerHeight:n.height*s.to.y,outerWidth:n.width*s.to.x};s.from.y!==s.to.y&&(o=t.effects.setTransition(i,l,s.from.y,o),a=t.effects.setTransition(i,l,s.to.y,a)),
s.from.x!==s.to.x&&(o=t.effects.setTransition(i,h,s.from.x,o),a=t.effects.setTransition(i,h,s.to.x,a)),c&&t.effects.saveStyle(i),i.css(o),i.animate(a,e.duration,e.easing,function(){c&&t.effects.restoreStyle(i)})})),a.animate(b,{queue:!1,duration:e.duration,easing:e.easing,complete:function(){var e=a.offset();0===b.opacity&&a.css("opacity",v.opacity),c||(a.css("position","static"===p?"relative":p).offset(e),t.effects.saveStyle(a)),i()}})}),t.effects.define("scale",function(e,i){var n=t(this),s=e.mode,o=parseInt(e.percent,10)||(0===parseInt(e.percent,10)?0:"effect"!==s?0:100),a=t.extend(!0,{from:t.effects.scaledDimensions(n),to:t.effects.scaledDimensions(n,o,e.direction||"both"),origin:e.origin||["middle","center"]},e);e.fade&&(a.from.opacity=1,a.to.opacity=0),t.effects.effect.size.call(this,a,i)}),t.effects.define("puff","hide",function(e,i){var n=t.extend(!0,{},e,{fade:!0,percent:parseInt(e.percent,10)||150});t.effects.effect.scale.call(this,n,i)}),t.effects.define("pulsate","show",function(e,i){var n=t(this),s=e.mode,o="show"===s,a="hide"===s,r=o||a,l=2*(e.times||5)+(r?1:0),h=e.duration/l,u=0,c=1,d=n.queue().length;for(!o&&n.is(":visible")||(n.css("opacity",0).show(),u=1);c<l;c++)n.animate({opacity:u},h,e.easing),u=1-u;n.animate({opacity:u},h,e.easing),n.queue(i),t.effects.unshift(n,d,l+1)}),t.effects.define("shake",function(e,i){var n=1,s=t(this),o=e.direction||"left",a=e.distance||20,r=e.times||3,l=2*r+1,h=Math.round(e.duration/l),u="up"===o||"down"===o?"top":"left",c="up"===o||"left"===o,d={},f={},p={},g=s.queue().length;for(t.effects.createPlaceholder(s),d[u]=(c?"-=":"+=")+a,f[u]=(c?"+=":"-=")+2*a,p[u]=(c?"-=":"+=")+2*a,s.animate(d,h,e.easing);n<r;n++)s.animate(f,h,e.easing).animate(p,h,e.easing);s.animate(f,h,e.easing).animate(d,h/2,e.easing).queue(i),t.effects.unshift(s,g,l+1)}),t.effects.define("slide","show",function(e,i){var n,s,o=t(this),a={up:["bottom","top"],down:["top","bottom"],left:["right","left"],right:["left","right"]},r=e.mode,l=e.direction||"left",h="up"===l||"down"===l?"top":"left",u="up"===l||"left"===l,c=e.distance||o["top"===h?"outerHeight":"outerWidth"](!0),d={};t.effects.createPlaceholder(o),n=o.cssClip(),s=o.position()[h],d[h]=(u?-1:1)*c+s,d.clip=o.cssClip(),d.clip[a[l][1]]=d.clip[a[l][0]],"show"===r&&(o.cssClip(d.clip),o.css(h,d[h]),d.clip=n,d[h]=s),o.animate(d,{queue:!1,duration:e.duration,easing:e.easing,complete:i})});!1!==t.uiBackCompat&&t.effects.define("transfer",function(e,i){t(this).transfer(e,i)})}),function(e){e.fn.extend({slimScroll:function(i){var n={width:"auto",height:"250px",size:"7px",color:"#000",position:"right",distance:"1px",start:"top",opacity:.4,alwaysVisible:!1,disableFadeOut:!1,railVisible:!1,railColor:"#333",railOpacity:.2,railDraggable:!0,railClass:"slimScrollRail",barClass:"slimScrollBar",wrapperClass:"slimScrollDiv",allowPageScroll:!1,wheelStep:20,touchScrollStep:200,borderRadius:"7px",railBorderRadius:"7px"},s=e.extend(n,i);return this.each(function(){function n(t){if(h){var t=t||window.event,i=0;t.wheelDelta&&(i=-t.wheelDelta/120),t.detail&&(i=t.detail/3);var n=t.target||t.srcTarget||t.srcElement;e(n).closest("."+s.wrapperClass).is(y.parent())&&o(i,!0),t.preventDefault&&!_&&t.preventDefault(),_||(t.returnValue=!1)}}function o(t,e,i){_=!1;var n=t,o=y.outerHeight()-M.outerHeight();if(e&&(n=parseInt(M.css("top"))+t*parseInt(s.wheelStep)/100*M.outerHeight(),n=Math.min(Math.max(n,0),o),n=t>0?Math.ceil(n):Math.floor(n),M.css({top:n+"px"})),g=parseInt(M.css("top"))/(y.outerHeight()-M.outerHeight()),n=g*(y[0].scrollHeight-y.outerHeight()),i){n=t;var a=n/y[0].scrollHeight*y.outerHeight();a=Math.min(Math.max(a,0),o),M.css({top:a+"px"})}y.scrollTop(n),y.trigger("slimscrolling",~~n),r(),l()}function a(){p=Math.max(y.outerHeight()/y[0].scrollHeight*y.outerHeight(),b),M.css({height:p+"px"});var t=p==y.outerHeight()?"none":"block";M.css({display:t})}function r(){if(a(),clearTimeout(d),g==~~g){if(_=s.allowPageScroll,m!=g){var t=0==~~g?"top":"bottom";y.trigger("slimscroll",t)}}else _=!1;if(m=g,p>=y.outerHeight())return void(_=!0);M.stop(!0,!0).fadeIn("fast"),s.railVisible&&D.stop(!0,!0).fadeIn("fast")}function l(){s.alwaysVisible||(d=setTimeout(function(){s.disableFadeOut&&h||u||c||(M.fadeOut("slow"),D.fadeOut("slow"))},1e3))}var h,u,c,d,f,p,g,m,v="<div></div>",b=30,_=!1,y=e(this);if(y.parent().hasClass(s.wrapperClass)){var x=y.scrollTop();if(M=y.siblings("."+s.barClass),D=y.siblings("."+s.railClass),a(),e.isPlainObject(i)){if("height"in i&&"auto"==i.height){y.parent().css("height","auto"),y.css("height","auto");var w=y.parent().parent().height();y.parent().css("height",w),y.css("height",w)}else if("height"in i){var k=i.height;y.parent().css("height",k),y.css("height",k)}if("scrollTo"in i)x=parseInt(s.scrollTo);else if("scrollBy"in i)x+=parseInt(s.scrollBy);else if("destroy"in i)return M.remove(),D.remove(),void y.unwrap();o(x,!1,!0)}}else if(!(e.isPlainObject(i)&&"destroy"in i)){s.height="auto"==s.height?y.parent().height():s.height;var C=e(v).addClass(s.wrapperClass).css({position:"relative",overflow:"hidden",width:s.width,height:s.height});y.css({overflow:"hidden",width:s.width,height:s.height});var D=e(v).addClass(s.railClass).css({width:s.size,height:"100%",position:"absolute",top:0,display:s.alwaysVisible&&s.railVisible?"block":"none","border-radius":s.railBorderRadius,background:s.railColor,opacity:s.railOpacity,zIndex:90}),M=e(v).addClass(s.barClass).css({background:s.color,width:s.size,position:"absolute",top:0,opacity:s.opacity,display:s.alwaysVisible?"block":"none","border-radius":s.borderRadius,BorderRadius:s.borderRadius,MozBorderRadius:s.borderRadius,WebkitBorderRadius:s.borderRadius,zIndex:99}),S="right"==s.position?{right:s.distance}:{left:s.distance};D.css(S),M.css(S),y.wrap(C),y.parent().append(M),y.parent().append(D),s.railDraggable&&M.bind("mousedown",function(i){var n=e(document);return c=!0,t=parseFloat(M.css("top")),pageY=i.pageY,n.bind("mousemove.slimscroll",function(e){currTop=t+e.pageY-pageY,M.css("top",currTop),o(0,M.position().top,!1)}),n.bind("mouseup.slimscroll",function(t){c=!1,l(),n.unbind(".slimscroll")}),!1}).bind("selectstart.slimscroll",function(t){return t.stopPropagation(),t.preventDefault(),!1}),D.hover(function(){r()},function(){l()}),M.hover(function(){u=!0},function(){u=!1}),y.hover(function(){h=!0,r(),l()},function(){h=!1,l()}),y.bind("touchstart",function(t,e){t.originalEvent.touches.length&&(f=t.originalEvent.touches[0].pageY)}),y.bind("touchmove",function(t){if(_||t.originalEvent.preventDefault(),t.originalEvent.touches.length){o((f-t.originalEvent.touches[0].pageY)/s.touchScrollStep,!0),f=t.originalEvent.touches[0].pageY}}),a(),"bottom"===s.start?(M.css({top:y.outerHeight()-M.outerHeight()}),o(0,!0)):"top"!==s.start&&(o(e(s.start).position().top,null,!0),s.alwaysVisible||M.hide()),function(t){window.addEventListener?(t.addEventListener("DOMMouseScroll",n,!1),t.addEventListener("mousewheel",n,!1)):document.attachEvent("onmousewheel",n)}(this)}}),this}}),e.fn.extend({slimscroll:e.fn.slimScroll})}(jQuery),function(t,e){"use strict";t.ajaxPrefilter(function(t,e,i){if(t.iframe)return t.originalURL=t.url,"iframe"}),t.ajaxTransport("iframe",function(e,i,n){function s(){l.each(function(e,i){var n=t(i);n.data("clone").replaceWith(n)}),o.remove(),a.one("load",function(){a.remove()}),a.attr("src","javascript:false;")}var o=null,a=null,r="iframe-"+t.now(),l=t(e.files).filter(":file:enabled"),h=null;if(e.dataTypes.shift(),e.data=i.data,l.length)return o=t("<form enctype='multipart/form-data' method='post'></form>").hide().attr({action:e.originalURL,target:r}),"string"==typeof e.data&&e.data.length>0&&t.error("data must not be serialized"),t.each(e.data||{},function(e,i){t.isPlainObject(i)&&(e=i.name,i=i.value),t("<input type='hidden' />").attr({name:e,value:i}).appendTo(o)}),t("<input type='hidden' value='IFrame' name='X-Requested-With' />").appendTo(o),h=e.dataTypes[0]&&e.accepts[e.dataTypes[0]]?e.accepts[e.dataTypes[0]]+("*"!==e.dataTypes[0]?", */*; q=0.01":""):e.accepts["*"],t("<input type='hidden' name='X-HTTP-Accept'>").attr("value",h).appendTo(o),l.after(function(e){var i=t(this),n=i.clone().prop("disabled",!0);return i.data("clone",n),n}).next(),l.appendTo(o),{send:function(e,i){a=t("<iframe src='javascript:false;' name='"+r+"' id='"+r+"' style='display:none'></iframe>"),a.one("load",function(){a.one("load",function(){var t=this.contentWindow?this.contentWindow.document:this.contentDocument?this.contentDocument:this.document,e=t.documentElement?t.documentElement:t.body,n=e.getElementsByTagName("textarea")[0],o=n&&n.getAttribute("data-type")||null,a=n&&n.getAttribute("data-status")||200,r=n&&n.getAttribute("data-statusText")||"OK",l={html:e.innerHTML,text:o?n.value:e?e.textContent||e.innerText:null};s(),i(a,r,l,o?"Content-Type: "+o:null)}),o[0].submit()}),t("body").append(o,a)},abort:function(){null!==a&&(a.unbind("load").attr("src","javascript:false;"),s())}}})}(jQuery),function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery-ui/ui/widget"],t):"object"==typeof exports?t(require("jquery"),require("./vendor/jquery.ui.widget")):t(window.jQuery)}(function(t){"use strict";function e(e){var i="dragover"===e;return function(n){n.dataTransfer=n.originalEvent&&n.originalEvent.dataTransfer;var s=n.dataTransfer;s&&-1!==t.inArray("Files",s.types)&&!1!==this._trigger(e,t.Event(e,{delegatedEvent:n}))&&(n.preventDefault(),i&&(s.dropEffect="copy"))}}t.support.fileInput=!(new RegExp("(Android (1\\.[0156]|2\\.[01]))|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle/(1\\.0|2\\.[05]|3\\.0))").test(window.navigator.userAgent)||t('<input type="file"/>').prop("disabled")),t.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),t.support.xhrFormDataFileUpload=!!window.FormData,t.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),t.widget("blueimp.fileupload",{options:{dropZone:t(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,uniqueFilenames:void 0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(e,i){return e=this.messages[e]||e.toString(),i&&t.each(i,function(t,i){e=e.replace("{"+t+"}",i)}),e},formData:function(t){return t.serializeArray()},add:function(e,i){if(e.isDefaultPrevented())return!1;(i.autoUpload||!1!==i.autoUpload&&t(this).fileupload("option","autoUpload"))&&i.process().done(function(){i.submit()})},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:t.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(t,e,i){var n=t-this.timestamp;return(!this.bitrate||!i||n>i)&&(this.bitrate=(e-this.loaded)*(1e3/n)*8,this.loaded=e,this.timestamp=t),this.bitrate}},_isXHRUpload:function(e){return!e.forceIframeTransport&&(!e.multipart&&t.support.xhrFileUpload||t.support.xhrFormDataFileUpload)},_getFormData:function(e){var i;return"function"===t.type(e.formData)?e.formData(e.form):t.isArray(e.formData)?e.formData:"object"===t.type(e.formData)?(i=[],t.each(e.formData,function(t,e){i.push({name:t,value:e})}),i):[]},_getTotal:function(e){var i=0;return t.each(e,function(t,e){i+=e.size||1}),i},_initProgressObject:function(e){var i={loaded:0,total:0,bitrate:0};e._progress?t.extend(e._progress,i):e._progress=i},_initResponseObject:function(t){var e;if(t._response)for(e in t._response)t._response.hasOwnProperty(e)&&delete t._response[e];else t._response={}},_onProgress:function(e,i){if(e.lengthComputable){var n,s=Date.now?Date.now():(new Date).getTime();if(i._time&&i.progressInterval&&s-i._time<i.progressInterval&&e.loaded!==e.total)return;i._time=s,n=Math.floor(e.loaded/e.total*(i.chunkSize||i._progress.total))+(i.uploadedBytes||0),this._progress.loaded+=n-i._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(s,this._progress.loaded,i.bitrateInterval),i._progress.loaded=i.loaded=n,i._progress.bitrate=i.bitrate=i._bitrateTimer.getBitrate(s,n,i.bitrateInterval),this._trigger("progress",t.Event("progress",{delegatedEvent:e}),i),this._trigger("progressall",t.Event("progressall",{delegatedEvent:e}),this._progress)}},_initProgressListener:function(e){var i=this,n=e.xhr?e.xhr():t.ajaxSettings.xhr();n.upload&&(t(n.upload).bind("progress",function(t){var n=t.originalEvent;t.lengthComputable=n.lengthComputable,t.loaded=n.loaded,t.total=n.total,i._onProgress(t,e)}),e.xhr=function(){return n})},_deinitProgressListener:function(e){var i=e.xhr?e.xhr():t.ajaxSettings.xhr();i.upload&&t(i.upload).unbind("progress")},_isInstanceOf:function(t,e){return Object.prototype.toString.call(e)==="[object "+t+"]"},_getUniqueFilename:function(t,e){return t=String(t),e[t]?(t=t.replace(/(?: \(([\d]+)\))?(\.[^.]+)?$/,function(t,e,i){return" ("+(e?Number(e)+1:1)+")"+(i||"")}),this._getUniqueFilename(t,e)):(e[t]=!0,t)},_initXHRData:function(e){var i,n=this,s=e.files[0],o=e.multipart||!t.support.xhrFileUpload,a="array"===t.type(e.paramName)?e.paramName[0]:e.paramName;e.headers=t.extend({},e.headers),e.contentRange&&(e.headers["Content-Range"]=e.contentRange),o&&!e.blob&&this._isInstanceOf("File",s)||(e.headers["Content-Disposition"]='attachment; filename="'+encodeURI(s.uploadName||s.name)+'"'),o?t.support.xhrFormDataFileUpload&&(e.postMessage?(i=this._getFormData(e),e.blob?i.push({name:a,value:e.blob}):t.each(e.files,function(n,s){i.push({name:"array"===t.type(e.paramName)&&e.paramName[n]||a,value:s})})):(n._isInstanceOf("FormData",e.formData)?i=e.formData:(i=new FormData,t.each(this._getFormData(e),function(t,e){i.append(e.name,e.value)})),e.blob?i.append(a,e.blob,s.uploadName||s.name):t.each(e.files,function(s,o){if(n._isInstanceOf("File",o)||n._isInstanceOf("Blob",o)){var r=o.uploadName||o.name;e.uniqueFilenames&&(r=n._getUniqueFilename(r,e.uniqueFilenames)),i.append("array"===t.type(e.paramName)&&e.paramName[s]||a,o,r)}})),e.data=i):(e.contentType=s.type||"application/octet-stream",e.data=e.blob||s),e.blob=null},_initIframeSettings:function(e){var i=t("<a></a>").prop("href",e.url).prop("host");e.dataType="iframe "+(e.dataType||""),e.formData=this._getFormData(e),e.redirect&&i&&i!==location.host&&e.formData.push({name:e.redirectParamName||"redirect",value:e.redirect})},_initDataSettings:function(t){this._isXHRUpload(t)?(this._chunkedUpload(t,!0)||(t.data||this._initXHRData(t),this._initProgressListener(t)),t.postMessage&&(t.dataType="postmessage "+(t.dataType||""))):this._initIframeSettings(t)},_getParamName:function(e){var i=t(e.fileInput),n=e.paramName;return n?t.isArray(n)||(n=[n]):(n=[],i.each(function(){for(var e=t(this),i=e.prop("name")||"files[]",s=(e.prop("files")||[1]).length;s;)n.push(i),s-=1}),n.length||(n=[i.prop("name")||"files[]"])),n},_initFormSettings:function(e){e.form&&e.form.length||(e.form=t(e.fileInput.prop("form")),e.form.length||(e.form=t(this.options.fileInput.prop("form")))),e.paramName=this._getParamName(e),e.url||(e.url=e.form.prop("action")||location.href),e.type=(e.type||"string"===t.type(e.form.prop("method"))&&e.form.prop("method")||"").toUpperCase(),"POST"!==e.type&&"PUT"!==e.type&&"PATCH"!==e.type&&(e.type="POST"),e.formAcceptCharset||(e.formAcceptCharset=e.form.attr("accept-charset"))},_getAJAXSettings:function(e){var i=t.extend({},this.options,e);return this._initFormSettings(i),this._initDataSettings(i),i},_getDeferredState:function(t){return t.state?t.state():t.isResolved()?"resolved":t.isRejected()?"rejected":"pending"},_enhancePromise:function(t){return t.success=t.done,t.error=t.fail,t.complete=t.always,t},_getXHRPromise:function(e,i,n){var s=t.Deferred(),o=s.promise();return i=i||this.options.context||o,!0===e?s.resolveWith(i,n):!1===e&&s.rejectWith(i,n),o.abort=s.promise,this._enhancePromise(o)},_addConvenienceMethods:function(e,i){var n=this,s=function(e){return t.Deferred().resolveWith(n,e).promise()};i.process=function(e,o){return(e||o)&&(i._processQueue=this._processQueue=(this._processQueue||s([this])).then(function(){return i.errorThrown?t.Deferred().rejectWith(n,[i]).promise():s(arguments)}).then(e,o)),this._processQueue||s([this])},i.submit=function(){return"pending"!==this.state()&&(i.jqXHR=this.jqXHR=!1!==n._trigger("submit",t.Event("submit",{delegatedEvent:e}),this)&&n._onSend(e,this)),this.jqXHR||n._getXHRPromise()},i.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",n._trigger("fail",null,this),n._getXHRPromise(!1))},i.state=function(){return this.jqXHR?n._getDeferredState(this.jqXHR):this._processQueue?n._getDeferredState(this._processQueue):void 0},i.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===n._getDeferredState(this._processQueue)},i.progress=function(){return this._progress},i.response=function(){return this._response}},_getUploadedBytes:function(t){var e=t.getResponseHeader("Range"),i=e&&e.split("-"),n=i&&i.length>1&&parseInt(i[1],10);return n&&n+1},_chunkedUpload:function(e,i){e.uploadedBytes=e.uploadedBytes||0;var n,s,o=this,a=e.files[0],r=a.size,l=e.uploadedBytes,h=e.maxChunkSize||r,u=this._blobSlice,c=t.Deferred(),d=c.promise();return!(!(this._isXHRUpload(e)&&u&&(l||("function"===t.type(h)?h(e):h)<r))||e.data)&&(!!i||(l>=r?(a.error=e.i18n("uploadedBytes"),this._getXHRPromise(!1,e.context,[null,"error",a.error])):(s=function(){var i=t.extend({},e),d=i._progress.loaded;i.blob=u.call(a,l,l+("function"===t.type(h)?h(i):h),a.type),i.chunkSize=i.blob.size,i.contentRange="bytes "+l+"-"+(l+i.chunkSize-1)+"/"+r,o._trigger("chunkbeforesend",null,i),o._initXHRData(i),o._initProgressListener(i),n=(!1!==o._trigger("chunksend",null,i)&&t.ajax(i)||o._getXHRPromise(!1,i.context)).done(function(n,a,h){l=o._getUploadedBytes(h)||l+i.chunkSize,d+i.chunkSize-i._progress.loaded&&o._onProgress(t.Event("progress",{lengthComputable:!0,loaded:l-i.uploadedBytes,total:l-i.uploadedBytes}),i),e.uploadedBytes=i.uploadedBytes=l,i.result=n,i.textStatus=a,i.jqXHR=h,o._trigger("chunkdone",null,i),o._trigger("chunkalways",null,i),l<r?s():c.resolveWith(i.context,[n,a,h])}).fail(function(t,e,n){i.jqXHR=t,i.textStatus=e,i.errorThrown=n,o._trigger("chunkfail",null,i),o._trigger("chunkalways",null,i),c.rejectWith(i.context,[t,e,n])}).always(function(){o._deinitProgressListener(i)})},this._enhancePromise(d),d.abort=function(){return n.abort()},s(),d)))},_beforeSend:function(t,e){0===this._active&&(this._trigger("start"),this._bitrateTimer=new this._BitrateTimer,this._progress.loaded=this._progress.total=0,this._progress.bitrate=0),this._initResponseObject(e),this._initProgressObject(e),e._progress.loaded=e.loaded=e.uploadedBytes||0,e._progress.total=e.total=this._getTotal(e.files)||1,e._progress.bitrate=e.bitrate=0,this._active+=1,this._progress.loaded+=e.loaded,this._progress.total+=e.total},_onDone:function(e,i,n,s){var o=s._progress.total,a=s._response;s._progress.loaded<o&&this._onProgress(t.Event("progress",{lengthComputable:!0,loaded:o,total:o}),s),a.result=s.result=e,a.textStatus=s.textStatus=i,a.jqXHR=s.jqXHR=n,this._trigger("done",null,s)},_onFail:function(t,e,i,n){var s=n._response;n.recalculateProgress&&(this._progress.loaded-=n._progress.loaded,this._progress.total-=n._progress.total),s.jqXHR=n.jqXHR=t,s.textStatus=n.textStatus=e,s.errorThrown=n.errorThrown=i,this._trigger("fail",null,n)},_onAlways:function(t,e,i,n){this._trigger("always",null,n)},_onSend:function(e,i){i.submit||this._addConvenienceMethods(e,i);var n,s,o,a,r=this,l=r._getAJAXSettings(i),h=function(){return r._sending+=1,l._bitrateTimer=new r._BitrateTimer,n=n||((s||!1===r._trigger("send",t.Event("send",{delegatedEvent:e}),l))&&r._getXHRPromise(!1,l.context,s)||r._chunkedUpload(l)||t.ajax(l)).done(function(t,e,i){r._onDone(t,e,i,l)}).fail(function(t,e,i){r._onFail(t,e,i,l)}).always(function(t,e,i){if(r._deinitProgressListener(l),r._onAlways(t,e,i,l),r._sending-=1,r._active-=1,l.limitConcurrentUploads&&l.limitConcurrentUploads>r._sending)for(var n=r._slots.shift();n;){if("pending"===r._getDeferredState(n)){n.resolve();break}n=r._slots.shift()}0===r._active&&r._trigger("stop")})};return this._beforeSend(e,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(o=t.Deferred(),this._slots.push(o),a=o.then(h)):(this._sequence=this._sequence.then(h,h),a=this._sequence),a.abort=function(){return s=[void 0,"abort","abort"],n?n.abort():(o&&o.rejectWith(l.context,s),h())},this._enhancePromise(a)):h()},_onAdd:function(e,i){var n,s,o,a,r=this,l=!0,h=t.extend({},this.options,i),u=i.files,c=u.length,d=h.limitMultiFileUploads,f=h.limitMultiFileUploadSize,p=h.limitMultiFileUploadSizeOverhead,g=0,m=this._getParamName(h),v=0;if(!c)return!1;if(f&&void 0===u[0].size&&(f=void 0),(h.singleFileUploads||d||f)&&this._isXHRUpload(h))if(h.singleFileUploads||f||!d)if(!h.singleFileUploads&&f)for(o=[],n=[],a=0;a<c;a+=1)g+=u[a].size+p,(a+1===c||g+u[a+1].size+p>f||d&&a+1-v>=d)&&(o.push(u.slice(v,a+1)),s=m.slice(v,a+1),s.length||(s=m),n.push(s),v=a+1,g=0);else n=m;else for(o=[],n=[],a=0;a<c;a+=d)o.push(u.slice(a,a+d)),s=m.slice(a,a+d),s.length||(s=m),n.push(s);else o=[u],n=[m];return i.originalFiles=u,t.each(o||u,function(s,a){var h=t.extend({},i);return h.files=o?a:[a],h.paramName=n[s],r._initResponseObject(h),r._initProgressObject(h),r._addConvenienceMethods(e,h),l=r._trigger("add",t.Event("add",{delegatedEvent:e}),h)}),l},_replaceFileInput:function(e){var i=e.fileInput,n=i.clone(!0),s=i.is(document.activeElement);e.fileInputClone=n,t("<form></form>").append(n)[0].reset(),i.after(n).detach(),s&&n.focus(),t.cleanData(i.unbind("remove")),this.options.fileInput=this.options.fileInput.map(function(t,e){return e===i[0]?n[0]:e}),i[0]===this.element[0]&&(this.element=n)},_handleFileTreeEntry:function(e,i){var n,s=this,o=t.Deferred(),a=[],r=function(t){t&&!t.entry&&(t.entry=e),o.resolve([t])},l=function(t){s._handleFileTreeEntries(t,i+e.name+"/").done(function(t){o.resolve(t)}).fail(r)},h=function(){n.readEntries(function(t){t.length?(a=a.concat(t),h()):l(a)},r)};return i=i||"",e.isFile?e._file?(e._file.relativePath=i,o.resolve(e._file)):e.file(function(t){t.relativePath=i,o.resolve(t)},r):e.isDirectory?(n=e.createReader(),h()):o.resolve([]),o.promise()},_handleFileTreeEntries:function(e,i){var n=this;return t.when.apply(t,t.map(e,function(t){return n._handleFileTreeEntry(t,i)})).then(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(e){e=e||{};var i=e.items;return i&&i.length&&(i[0].webkitGetAsEntry||i[0].getAsEntry)?this._handleFileTreeEntries(t.map(i,function(t){var e;return t.webkitGetAsEntry?(e=t.webkitGetAsEntry(),e&&(e._file=t.getAsFile()),e):t.getAsEntry()})):t.Deferred().resolve(t.makeArray(e.files)).promise()},_getSingleFileInputFiles:function(e){e=t(e);var i,n,s=e.prop("webkitEntries")||e.prop("entries");if(s&&s.length)return this._handleFileTreeEntries(s);if(i=t.makeArray(e.prop("files")),i.length)void 0===i[0].name&&i[0].fileName&&t.each(i,function(t,e){e.name=e.fileName,e.size=e.fileSize});else{if(!(n=e.prop("value")))return t.Deferred().resolve([]).promise();i=[{name:n.replace(/^.*\\/,"")}]}return t.Deferred().resolve(i).promise()},_getFileInputFiles:function(e){return e instanceof t&&1!==e.length?t.when.apply(t,t.map(e,this._getSingleFileInputFiles)).then(function(){return Array.prototype.concat.apply([],arguments)}):this._getSingleFileInputFiles(e)},_onChange:function(e){var i=this,n={fileInput:t(e.target),form:t(e.target.form)};this._getFileInputFiles(n.fileInput).always(function(s){n.files=s,i.options.replaceFileInput&&i._replaceFileInput(n),!1!==i._trigger("change",t.Event("change",{delegatedEvent:e}),n)&&i._onAdd(e,n)})},_onPaste:function(e){var i=e.originalEvent&&e.originalEvent.clipboardData&&e.originalEvent.clipboardData.items,n={files:[]};i&&i.length&&(t.each(i,function(t,e){var i=e.getAsFile&&e.getAsFile();i&&n.files.push(i)}),!1!==this._trigger("paste",t.Event("paste",{delegatedEvent:e}),n)&&this._onAdd(e,n))},_onDrop:function(e){e.dataTransfer=e.originalEvent&&e.originalEvent.dataTransfer;var i=this,n=e.dataTransfer,s={};n&&n.files&&n.files.length&&(e.preventDefault(),this._getDroppedFiles(n).always(function(n){s.files=n,!1!==i._trigger("drop",t.Event("drop",{delegatedEvent:e}),s)&&i._onAdd(e,s)}))},_onDragOver:e("dragover"),_onDragEnter:e("dragenter"),_onDragLeave:e("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),t.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_destroy:function(){this._destroyEventHandlers()},_setOption:function(e,i){var n=-1!==t.inArray(e,this._specialOptions);n&&this._destroyEventHandlers(),this._super(e,i),n&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var e=this.options;void 0===e.fileInput?e.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):e.fileInput instanceof t||(e.fileInput=t(e.fileInput)),e.dropZone instanceof t||(e.dropZone=t(e.dropZone)),e.pasteZone instanceof t||(e.pasteZone=t(e.pasteZone))},_getRegExp:function(t){var e=t.split("/"),i=e.pop();return e.shift(),new RegExp(e.join("/"),i)},_isRegExpOption:function(e,i){return"url"!==e&&"string"===t.type(i)&&/^\/.*\/[igm]{0,3}$/.test(i)},_initDataAttributes:function(){var e=this,i=this.options,n=this.element.data();t.each(this.element[0].attributes,function(t,s){var o,a=s.name.toLowerCase();/^data-/.test(a)&&(a=a.slice(5).replace(/-[a-z]/g,function(t){return t.charAt(1).toUpperCase()}),o=n[a],e._isRegExpOption(a,o)&&(o=e._getRegExp(o)),i[a]=o)})},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(e){var i=this;e&&!this.options.disabled&&(e.fileInput&&!e.files?this._getFileInputFiles(e.fileInput).always(function(t){e.files=t,i._onAdd(null,e)}):(e.files=t.makeArray(e.files),this._onAdd(null,e)))},send:function(e){if(e&&!this.options.disabled){if(e.fileInput&&!e.files){var i,n,s=this,o=t.Deferred(),a=o.promise();return a.abort=function(){return n=!0,i?i.abort():(o.reject(null,"abort","abort"),a)},this._getFileInputFiles(e.fileInput).always(function(t){if(!n){if(!t.length)return void o.reject();e.files=t,i=s._onSend(null,e),i.then(function(t,e,i){o.resolve(t,e,i)},function(t,e,i){o.reject(t,e,i)})}}),this._enhancePromise(a)}if(e.files=t.makeArray(e.files),e.files.length)return this._onSend(null,e)}return this._getXHRPromise(!1,e&&e.context)}})}),function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof exports?module.exports=e(require("jquery")):jQuery&&!jQuery.fn.colorpicker&&e(jQuery)}(0,function(t){"use strict";var e=function(i,n,s,o,a){this.fallbackValue=s?"string"==typeof s?this.parse(s):s:null,this.fallbackFormat=o||"rgba",this.hexNumberSignPrefix=!0===a,this.value=this.fallbackValue,this.origFormat=null,this.predefinedColors=n||{},this.colors=t.extend({},e.webColors,this.predefinedColors),i&&(void 0!==i.h?this.value=i:this.setColor(String(i))),this.value||(this.value={h:0,s:0,b:0,a:1})};e.webColors={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32",transparent:"transparent"},e.prototype={constructor:e,colors:{},predefinedColors:{},getValue:function(){return this.value},setValue:function(t){this.value=t},_sanitizeNumber:function(t){return"number"==typeof t?t:isNaN(t)||null===t||""===t||void 0===t?1:""===t?0:void 0!==t.toLowerCase?(t.match(/^\./)&&(t="0"+t),Math.ceil(100*parseFloat(t))/100):1},isTransparent:function(t){return!(!t||!("string"==typeof t||t instanceof String))&&("transparent"===(t=t.toLowerCase().trim())||t.match(/#?00000000/)||t.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/))},rgbaIsTransparent:function(t){return 0===t.r&&0===t.g&&0===t.b&&0===t.a},setColor:function(t){if(t=t.toLowerCase().trim()){if(this.isTransparent(t))return this.value={h:0,s:0,b:0,a:0},!0;var e=this.parse(t);e?(this.value=this.value={h:e.h,s:e.s,b:e.b,a:e.a},this.origFormat||(this.origFormat=e.format)):this.fallbackValue&&(this.value=this.fallbackValue)}return!1},setHue:function(t){this.value.h=1-t},setSaturation:function(t){this.value.s=t},setBrightness:function(t){this.value.b=1-t},setAlpha:function(t){this.value.a=Math.round(parseInt(100*(1-t),10)/100*100)/100},
toRGB:function(t,e,i,n){0===arguments.length&&(t=this.value.h,e=this.value.s,i=this.value.b,n=this.value.a),t*=360;var s,o,a,r,l;return t=t%360/60,l=i*e,r=l*(1-Math.abs(t%2-1)),s=o=a=i-l,t=~~t,s+=[l,r,0,0,r,l][t],o+=[r,l,l,r,0,0][t],a+=[0,0,r,l,l,r][t],{r:Math.round(255*s),g:Math.round(255*o),b:Math.round(255*a),a:n}},toHex:function(t,e,i,n,s){arguments.length<=1&&(e=this.value.h,i=this.value.s,n=this.value.b,s=this.value.a);var o="#",a=this.toRGB(e,i,n,s);return this.rgbaIsTransparent(a)?"transparent":(t||(o=this.hexNumberSignPrefix?"#":""),o+((1<<24)+(parseInt(a.r)<<16)+(parseInt(a.g)<<8)+parseInt(a.b)).toString(16).slice(1))},toHSL:function(t,e,i,n){0===arguments.length&&(t=this.value.h,e=this.value.s,i=this.value.b,n=this.value.a);var s=t,o=(2-e)*i,a=e*i;return a/=o>0&&o<=1?o:2-o,o/=2,a>1&&(a=1),{h:isNaN(s)?0:s,s:isNaN(a)?0:a,l:isNaN(o)?0:o,a:isNaN(n)?0:n}},toAlias:function(t,e,i,n){var s,o=0===arguments.length?this.toHex(!0):this.toHex(!0,t,e,i,n),a="alias"===this.origFormat?o:this.toString(!1,this.origFormat);for(var r in this.colors)if((s=this.colors[r].toLowerCase().trim())===o||s===a)return r;return!1},RGBtoHSB:function(t,e,i,n){t/=255,e/=255,i/=255;var s,o,a,r;return a=Math.max(t,e,i),r=a-Math.min(t,e,i),s=0===r?null:a===t?(e-i)/r:a===e?(i-t)/r+2:(t-e)/r+4,s=(s+360)%6*60/360,o=0===r?0:r/a,{h:this._sanitizeNumber(s),s:o,b:a,a:this._sanitizeNumber(n)}},HueToRGB:function(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t},HSLtoRGB:function(t,e,i,n){e<0&&(e=0);var s;s=i<=.5?i*(1+e):i+e-i*e;var o=2*i-s,a=t+1/3,r=t,l=t-1/3;return[Math.round(255*this.HueToRGB(o,s,a)),Math.round(255*this.HueToRGB(o,s,r)),Math.round(255*this.HueToRGB(o,s,l)),this._sanitizeNumber(n)]},parse:function(e){if("string"!=typeof e)return this.fallbackValue;if(0===arguments.length)return!1;var i,n,s=this,o=!1,a=void 0!==this.colors[e];return a&&(e=this.colors[e].toLowerCase().trim()),t.each(this.stringParsers,function(t,r){var l=r.re.exec(e);return!(i=l&&r.parse.apply(s,[l]))||(o={},n=a?"alias":r.format?r.format:s.getValidFallbackFormat(),o=n.match(/hsla?/)?s.RGBtoHSB.apply(s,s.HSLtoRGB.apply(s,i)):s.RGBtoHSB.apply(s,i),o instanceof Object&&(o.format=n),!1)}),o},getValidFallbackFormat:function(){var t=["rgba","rgb","hex","hsla","hsl"];return this.origFormat&&-1!==t.indexOf(this.origFormat)?this.origFormat:this.fallbackFormat&&-1!==t.indexOf(this.fallbackFormat)?this.fallbackFormat:"rgba"},toString:function(t,i,n){i=i||this.origFormat||this.fallbackFormat,n=n||!1;var s=!1;switch(i){case"rgb":return s=this.toRGB(),this.rgbaIsTransparent(s)?"transparent":"rgb("+s.r+","+s.g+","+s.b+")";case"rgba":return s=this.toRGB(),"rgba("+s.r+","+s.g+","+s.b+","+s.a+")";case"hsl":return s=this.toHSL(),"hsl("+Math.round(360*s.h)+","+Math.round(100*s.s)+"%,"+Math.round(100*s.l)+"%)";case"hsla":return s=this.toHSL(),"hsla("+Math.round(360*s.h)+","+Math.round(100*s.s)+"%,"+Math.round(100*s.l)+"%,"+s.a+")";case"hex":return this.toHex(t);case"alias":return s=this.toAlias(),!1===s?this.toString(t,this.getValidFallbackFormat()):n&&!(s in e.webColors)&&s in this.predefinedColors?this.predefinedColors[s]:s;default:return s}},stringParsers:[{re:/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/,format:"rgb",parse:function(t){return[t[1],t[2],t[3],1]}},{re:/rgb\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,format:"rgb",parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],1]}},{re:/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba\(\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/hsl\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*?\)/,format:"hsl",parse:function(t){return[t[1]/360,t[2]/100,t[3]/100,t[4]]}},{re:/hsla\(\s*(\d*(?:\.\d+)?)\s*,\s*(\d*(?:\.\d+)?)\%\s*,\s*(\d*(?:\.\d+)?)\%\s*(?:,\s*(\d*(?:\.\d+)?)\s*)?\)/,format:"hsla",parse:function(t){return[t[1]/360,t[2]/100,t[3]/100,t[4]]}},{re:/#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,format:"hex",parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),1]}},{re:/#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,format:"hex",parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),1]}}],colorNameToHex:function(t){return void 0!==this.colors[t.toLowerCase()]&&this.colors[t.toLowerCase()]}};var i={horizontal:!1,inline:!1,color:!1,format:!1,input:"input",container:!1,component:".add-on, .input-group-addon",fallbackColor:!1,fallbackFormat:"hex",hexNumberSignPrefix:!0,sliders:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setHue"},alpha:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setAlpha"}},slidersHorz:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:100,maxTop:0,callLeft:"setHue",callTop:!1},alpha:{maxLeft:100,maxTop:0,callLeft:"setAlpha",callTop:!1}},template:'<div class="colorpicker dropdown-menu"><div class="colorpicker-saturation"><i><b></b></i></div><div class="colorpicker-hue"><i></i></div><div class="colorpicker-alpha"><i></i></div><div class="colorpicker-color"><div /></div><div class="colorpicker-selectors"></div></div>',align:"right",customClass:null,colorSelectors:null},n=function(e,n){this.element=t(e).addClass("colorpicker-element"),this.options=t.extend(!0,{},i,this.element.data(),n),this.component=this.options.component,this.component=!1!==this.component&&this.element.find(this.component),this.component&&0===this.component.length&&(this.component=!1),this.container=!0===this.options.container?this.element:this.options.container,this.container=!1!==this.container&&t(this.container),this.input=this.element.is("input")?this.element:!!this.options.input&&this.element.find(this.options.input),this.input&&0===this.input.length&&(this.input=!1),this.color=this.createColor(!1!==this.options.color?this.options.color:this.getValue()),this.format=!1!==this.options.format?this.options.format:this.color.origFormat,!1!==this.options.color&&(this.updateInput(this.color),this.updateData(this.color)),this.disabled=!1;var s=this.picker=t(this.options.template);if(this.options.customClass&&s.addClass(this.options.customClass),this.options.inline?s.addClass("colorpicker-inline colorpicker-visible"):s.addClass("colorpicker-hidden"),this.options.horizontal&&s.addClass("colorpicker-horizontal"),-1===["rgba","hsla","alias"].indexOf(this.format)&&!1!==this.options.format&&"transparent"!==this.getValue()||s.addClass("colorpicker-with-alpha"),"right"===this.options.align&&s.addClass("colorpicker-right"),!0===this.options.inline&&s.addClass("colorpicker-no-arrow"),this.options.colorSelectors){var o=this,a=o.picker.find(".colorpicker-selectors");a.length>0&&(t.each(this.options.colorSelectors,function(e,i){var n=t("<i />").addClass("colorpicker-selectors-color").css("background-color",i).data("class",e).data("alias",e);n.on("mousedown.colorpicker touchstart.colorpicker",function(e){e.preventDefault(),o.setValue("alias"===o.format?t(this).data("alias"):t(this).css("background-color"))}),a.append(n)}),a.show().addClass("colorpicker-visible"))}s.on("mousedown.colorpicker touchstart.colorpicker",t.proxy(function(t){t.target===t.currentTarget&&t.preventDefault()},this)),s.find(".colorpicker-saturation, .colorpicker-hue, .colorpicker-alpha").on("mousedown.colorpicker touchstart.colorpicker",t.proxy(this.mousedown,this)),s.appendTo(this.container?this.container:t("body")),!1!==this.input&&(this.input.on({"keyup.colorpicker":t.proxy(this.keyup,this)}),this.input.on({"input.colorpicker":t.proxy(this.change,this)}),!1===this.component&&this.element.on({"focus.colorpicker":t.proxy(this.show,this)}),!1===this.options.inline&&this.element.on({"focusout.colorpicker":t.proxy(this.hide,this)})),!1!==this.component&&this.component.on({"click.colorpicker":t.proxy(this.show,this)}),!1===this.input&&!1===this.component&&this.element.on({"click.colorpicker":t.proxy(this.show,this)}),!1!==this.input&&!1!==this.component&&"color"===this.input.attr("type")&&this.input.on({"click.colorpicker":t.proxy(this.show,this),"focus.colorpicker":t.proxy(this.show,this)}),this.update(),t(t.proxy(function(){this.element.trigger("create")},this))};n.Color=e,n.prototype={constructor:n,destroy:function(){this.picker.remove(),this.element.removeData("colorpicker","color").off(".colorpicker"),!1!==this.input&&this.input.off(".colorpicker"),!1!==this.component&&this.component.off(".colorpicker"),this.element.removeClass("colorpicker-element"),this.element.trigger({type:"destroy"})},reposition:function(){if(!1!==this.options.inline||this.options.container)return!1;var t=this.container&&this.container[0]!==window.document.body?"position":"offset",e=this.component||this.element,i=e[t]();"right"===this.options.align&&(i.left-=this.picker.outerWidth()-e.outerWidth()),this.picker.css({top:i.top+e.outerHeight(),left:i.left})},show:function(e){this.isDisabled()||(this.picker.addClass("colorpicker-visible").removeClass("colorpicker-hidden"),this.reposition(),t(window).on("resize.colorpicker",t.proxy(this.reposition,this)),!e||this.hasInput()&&"color"!==this.input.attr("type")||e.stopPropagation&&e.preventDefault&&(e.stopPropagation(),e.preventDefault()),!this.component&&this.input||!1!==this.options.inline||t(window.document).on({"mousedown.colorpicker":t.proxy(this.hide,this)}),this.element.trigger({type:"showPicker",color:this.color}))},hide:function(e){if(void 0!==e&&e.target&&(t(e.currentTarget).parents(".colorpicker").length>0||t(e.target).parents(".colorpicker").length>0))return!1;this.picker.addClass("colorpicker-hidden").removeClass("colorpicker-visible"),t(window).off("resize.colorpicker",this.reposition),t(window.document).off({"mousedown.colorpicker":this.hide}),this.update(),this.element.trigger({type:"hidePicker",color:this.color})},updateData:function(t){return t=t||this.color.toString(!1,this.format),this.element.data("color",t),t},updateInput:function(t){return t=t||this.color.toString(!1,this.format),!1!==this.input&&(this.input.prop("value",t),this.input.trigger("change")),t},updatePicker:function(t){void 0!==t&&(this.color=this.createColor(t));var e=!1===this.options.horizontal?this.options.sliders:this.options.slidersHorz,i=this.picker.find("i");if(0!==i.length)return!1===this.options.horizontal?(e=this.options.sliders,i.eq(1).css("top",e.hue.maxTop*(1-this.color.value.h)).end().eq(2).css("top",e.alpha.maxTop*(1-this.color.value.a))):(e=this.options.slidersHorz,i.eq(1).css("left",e.hue.maxLeft*(1-this.color.value.h)).end().eq(2).css("left",e.alpha.maxLeft*(1-this.color.value.a))),i.eq(0).css({top:e.saturation.maxTop-this.color.value.b*e.saturation.maxTop,left:this.color.value.s*e.saturation.maxLeft}),this.picker.find(".colorpicker-saturation").css("backgroundColor",this.color.toHex(!0,this.color.value.h,1,1,1)),this.picker.find(".colorpicker-alpha").css("backgroundColor",this.color.toHex(!0)),this.picker.find(".colorpicker-color, .colorpicker-color div").css("backgroundColor",this.color.toString(!0,this.format)),t},updateComponent:function(t){var e;if(e=void 0!==t?this.createColor(t):this.color,!1!==this.component){var i=this.component.find("i").eq(0);i.length>0?i.css({backgroundColor:e.toString(!0,this.format)}):this.component.css({backgroundColor:e.toString(!0,this.format)})}return e.toString(!1,this.format)},update:function(t){var e;return!1===this.getValue(!1)&&!0!==t||(e=this.updateComponent(),this.updateInput(e),this.updateData(e),this.updatePicker()),e},setValue:function(t){this.color=this.createColor(t),this.update(!0),this.element.trigger({type:"changeColor",color:this.color,value:t})},createColor:function(t){return new e(t||null,this.options.colorSelectors,this.options.fallbackColor?this.options.fallbackColor:this.color,this.options.fallbackFormat,this.options.hexNumberSignPrefix)},getValue:function(t){t=void 0===t?this.options.fallbackColor:t;var e;return e=this.hasInput()?this.input.val():this.element.data("color"),void 0!==e&&""!==e&&null!==e||(e=t),e},hasInput:function(){return!1!==this.input},isDisabled:function(){return this.disabled},disable:function(){return this.hasInput()&&this.input.prop("disabled",!0),this.disabled=!0,this.element.trigger({type:"disable",color:this.color,value:this.getValue()}),!0},enable:function(){return this.hasInput()&&this.input.prop("disabled",!1),this.disabled=!1,this.element.trigger({type:"enable",color:this.color,value:this.getValue()}),!0},currentSlider:null,mousePointer:{left:0,top:0},mousedown:function(e){!e.pageX&&!e.pageY&&e.originalEvent&&e.originalEvent.touches&&(e.pageX=e.originalEvent.touches[0].pageX,e.pageY=e.originalEvent.touches[0].pageY),e.stopPropagation(),e.preventDefault();var i=t(e.target),n=i.closest("div"),s=this.options.horizontal?this.options.slidersHorz:this.options.sliders;if(!n.is(".colorpicker")){if(n.is(".colorpicker-saturation"))this.currentSlider=t.extend({},s.saturation);else if(n.is(".colorpicker-hue"))this.currentSlider=t.extend({},s.hue);else{if(!n.is(".colorpicker-alpha"))return!1;this.currentSlider=t.extend({},s.alpha)}var o=n.offset();this.currentSlider.guide=n.find("i")[0].style,this.currentSlider.left=e.pageX-o.left,this.currentSlider.top=e.pageY-o.top,this.mousePointer={left:e.pageX,top:e.pageY},t(window.document).on({"mousemove.colorpicker":t.proxy(this.mousemove,this),"touchmove.colorpicker":t.proxy(this.mousemove,this),"mouseup.colorpicker":t.proxy(this.mouseup,this),"touchend.colorpicker":t.proxy(this.mouseup,this)}).trigger("mousemove")}return!1},mousemove:function(t){!t.pageX&&!t.pageY&&t.originalEvent&&t.originalEvent.touches&&(t.pageX=t.originalEvent.touches[0].pageX,t.pageY=t.originalEvent.touches[0].pageY),t.stopPropagation(),t.preventDefault();var e=Math.max(0,Math.min(this.currentSlider.maxLeft,this.currentSlider.left+((t.pageX||this.mousePointer.left)-this.mousePointer.left))),i=Math.max(0,Math.min(this.currentSlider.maxTop,this.currentSlider.top+((t.pageY||this.mousePointer.top)-this.mousePointer.top)));return this.currentSlider.guide.left=e+"px",this.currentSlider.guide.top=i+"px",this.currentSlider.callLeft&&this.color[this.currentSlider.callLeft].call(this.color,e/this.currentSlider.maxLeft),this.currentSlider.callTop&&this.color[this.currentSlider.callTop].call(this.color,i/this.currentSlider.maxTop),!1!==this.options.format||"setAlpha"!==this.currentSlider.callTop&&"setAlpha"!==this.currentSlider.callLeft||(1!==this.color.value.a?(this.format="rgba",this.color.origFormat="rgba"):(this.format="hex",this.color.origFormat="hex")),this.update(!0),this.element.trigger({type:"changeColor",color:this.color}),!1},mouseup:function(e){return e.stopPropagation(),e.preventDefault(),t(window.document).off({"mousemove.colorpicker":this.mousemove,"touchmove.colorpicker":this.mousemove,"mouseup.colorpicker":this.mouseup,"touchend.colorpicker":this.mouseup}),!1},change:function(t){this.color=this.createColor(this.input.val()),this.color.origFormat&&!1===this.options.format&&(this.format=this.color.origFormat),!1!==this.getValue(!1)&&(this.updateData(),this.updateComponent(),this.updatePicker()),this.element.trigger({type:"changeColor",color:this.color,value:this.input.val()})},keyup:function(t){38===t.keyCode?(this.color.value.a<1&&(this.color.value.a=Math.round(100*(this.color.value.a+.01))/100),this.update(!0)):40===t.keyCode&&(this.color.value.a>0&&(this.color.value.a=Math.round(100*(this.color.value.a-.01))/100),this.update(!0)),this.element.trigger({type:"changeColor",color:this.color,value:this.input.val()})}},t.colorpicker=n,t.fn.colorpicker=function(e){var i=Array.prototype.slice.call(arguments,1),s=1===this.length,o=null,a=this.each(function(){var s=t(this),a=s.data("colorpicker"),r="object"==typeof e?e:{};a||(a=new n(this,r),s.data("colorpicker",a)),"string"==typeof e?t.isFunction(a[e])?o=a[e].apply(a,i):(i.length&&(a[e]=i[0]),o=a[e]):o=s});return s?o:a},t.fn.colorpicker.constructor=n}),function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t("object"==typeof exports?require("jquery"):jQuery)}(function(t,e){function i(){return new Date(Date.UTC.apply(Date,arguments))}function n(){var t=new Date;return i(t.getFullYear(),t.getMonth(),t.getDate())}function s(t,e){return t.getUTCFullYear()===e.getUTCFullYear()&&t.getUTCMonth()===e.getUTCMonth()&&t.getUTCDate()===e.getUTCDate()}function o(i,n){return function(){return n!==e&&t.fn.datepicker.deprecated(n),this[i].apply(this,arguments)}}function a(t){return t&&!isNaN(t.getTime())}function r(e,i){function n(t,e){return e.toLowerCase()}var s,o=t(e).data(),a={},r=new RegExp("^"+i.toLowerCase()+"([A-Z])");i=new RegExp("^"+i.toLowerCase());for(var l in o)i.test(l)&&(s=l.replace(r,n),a[s]=o[l]);return a}function l(e){var i={};if(m[e]||(e=e.split("-")[0],m[e])){var n=m[e];return t.each(g,function(t,e){e in n&&(i[e]=n[e])}),i}}var h=function(){var e={get:function(t){return this.slice(t)[0]},contains:function(t){for(var e=t&&t.valueOf(),i=0,n=this.length;i<n;i++)if(0<=this[i].valueOf()-e&&this[i].valueOf()-e<864e5)return i;return-1},remove:function(t){this.splice(t,1)},replace:function(e){e&&(t.isArray(e)||(e=[e]),this.clear(),this.push.apply(this,e))},clear:function(){this.length=0},copy:function(){var t=new h;return t.replace(this),t}};return function(){var i=[];return i.push.apply(i,arguments),t.extend(i,e),i}}(),u=function(e,i){t.data(e,"datepicker",this),this._events=[],this._secondaryEvents=[],this._process_options(i),this.dates=new h,this.viewDate=this.o.defaultViewDate,this.focusDate=null,this.element=t(e),this.isInput=this.element.is("input"),this.inputField=this.isInput?this.element:this.element.find("input"),this.component=!!this.element.hasClass("date")&&this.element.find(".add-on, .input-group-addon, .input-group-append, .input-group-prepend, .btn"),this.component&&0===this.component.length&&(this.component=!1),this.isInline=!this.component&&this.element.is("div"),this.picker=t(v.template),this._check_template(this.o.templates.leftArrow)&&this.picker.find(".prev").html(this.o.templates.leftArrow),this._check_template(this.o.templates.rightArrow)&&this.picker.find(".next").html(this.o.templates.rightArrow),this._buildEvents(),this._attachEvents(),this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu"),this.o.rtl&&this.picker.addClass("datepicker-rtl"),this.o.calendarWeeks&&this.picker.find(".datepicker-days .datepicker-switch, thead .datepicker-title, tfoot .today, tfoot .clear").attr("colspan",function(t,e){return Number(e)+1}),this._process_options({startDate:this._o.startDate,endDate:this._o.endDate,daysOfWeekDisabled:this.o.daysOfWeekDisabled,daysOfWeekHighlighted:this.o.daysOfWeekHighlighted,datesDisabled:this.o.datesDisabled}),this._allow_update=!1,this.setViewMode(this.o.startView),this._allow_update=!0,this.fillDow(),this.fillMonths(),this.update(),this.isInline&&this.show()};u.prototype={constructor:u,_resolveViewName:function(e){return t.each(v.viewModes,function(i,n){if(e===i||-1!==t.inArray(e,n.names))return e=i,!1}),e},_resolveDaysOfWeek:function(e){return t.isArray(e)||(e=e.split(/[,\s]*/)),t.map(e,Number)},_check_template:function(i){try{if(i===e||""===i)return!1;if((i.match(/[<>]/g)||[]).length<=0)return!0;return t(i).length>0}catch(t){return!1}},_process_options:function(e){this._o=t.extend({},this._o,e);var s=this.o=t.extend({},this._o),o=s.language;m[o]||(o=o.split("-")[0],m[o]||(o=p.language)),s.language=o,s.startView=this._resolveViewName(s.startView),s.minViewMode=this._resolveViewName(s.minViewMode),s.maxViewMode=this._resolveViewName(s.maxViewMode),s.startView=Math.max(this.o.minViewMode,Math.min(this.o.maxViewMode,s.startView)),!0!==s.multidate&&(s.multidate=Number(s.multidate)||!1,!1!==s.multidate&&(s.multidate=Math.max(0,s.multidate))),s.multidateSeparator=String(s.multidateSeparator),s.weekStart%=7,s.weekEnd=(s.weekStart+6)%7;var a=v.parseFormat(s.format);s.startDate!==-1/0&&(s.startDate?s.startDate instanceof Date?s.startDate=this._local_to_utc(this._zero_time(s.startDate)):s.startDate=v.parseDate(s.startDate,a,s.language,s.assumeNearbyYear):s.startDate=-1/0),s.endDate!==1/0&&(s.endDate?s.endDate instanceof Date?s.endDate=this._local_to_utc(this._zero_time(s.endDate)):s.endDate=v.parseDate(s.endDate,a,s.language,s.assumeNearbyYear):s.endDate=1/0),s.daysOfWeekDisabled=this._resolveDaysOfWeek(s.daysOfWeekDisabled||[]),s.daysOfWeekHighlighted=this._resolveDaysOfWeek(s.daysOfWeekHighlighted||[]),s.datesDisabled=s.datesDisabled||[],t.isArray(s.datesDisabled)||(s.datesDisabled=s.datesDisabled.split(",")),s.datesDisabled=t.map(s.datesDisabled,function(t){return v.parseDate(t,a,s.language,s.assumeNearbyYear)});var r=String(s.orientation).toLowerCase().split(/\s+/g),l=s.orientation.toLowerCase();if(r=t.grep(r,function(t){return/^auto|left|right|top|bottom$/.test(t)}),s.orientation={x:"auto",y:"auto"},l&&"auto"!==l)if(1===r.length)switch(r[0]){case"top":case"bottom":s.orientation.y=r[0];break;case"left":case"right":s.orientation.x=r[0]}else l=t.grep(r,function(t){return/^left|right$/.test(t)}),s.orientation.x=l[0]||"auto",l=t.grep(r,function(t){return/^top|bottom$/.test(t)}),s.orientation.y=l[0]||"auto";else;if(s.defaultViewDate instanceof Date||"string"==typeof s.defaultViewDate)s.defaultViewDate=v.parseDate(s.defaultViewDate,a,s.language,s.assumeNearbyYear);else if(s.defaultViewDate){var h=s.defaultViewDate.year||(new Date).getFullYear(),u=s.defaultViewDate.month||0,c=s.defaultViewDate.day||1;s.defaultViewDate=i(h,u,c)}else s.defaultViewDate=n()},_applyEvents:function(t){for(var i,n,s,o=0;o<t.length;o++)i=t[o][0],2===t[o].length?(n=e,s=t[o][1]):3===t[o].length&&(n=t[o][1],s=t[o][2]),i.on(s,n)},_unapplyEvents:function(t){for(var i,n,s,o=0;o<t.length;o++)i=t[o][0],2===t[o].length?(s=e,n=t[o][1]):3===t[o].length&&(s=t[o][1],n=t[o][2]),i.off(n,s)},_buildEvents:function(){var e={keyup:t.proxy(function(e){-1===t.inArray(e.keyCode,[27,37,39,38,40,32,13,9])&&this.update()},this),keydown:t.proxy(this.keydown,this),paste:t.proxy(this.paste,this)};!0===this.o.showOnFocus&&(e.focus=t.proxy(this.show,this)),this.isInput?this._events=[[this.element,e]]:this.component&&this.inputField.length?this._events=[[this.inputField,e],[this.component,{click:t.proxy(this.show,this)}]]:this._events=[[this.element,{click:t.proxy(this.show,this),keydown:t.proxy(this.keydown,this)}]],this._events.push([this.element,"*",{blur:t.proxy(function(t){this._focused_from=t.target},this)}],[this.element,{blur:t.proxy(function(t){this._focused_from=t.target},this)}]),this.o.immediateUpdates&&this._events.push([this.element,{"changeYear changeMonth":t.proxy(function(t){this.update(t.date)},this)}]),this._secondaryEvents=[[this.picker,{click:t.proxy(this.click,this)}],[this.picker,".prev, .next",{click:t.proxy(this.navArrowsClick,this)}],[this.picker,".day:not(.disabled)",{click:t.proxy(this.dayCellClick,this)}],[t(window),{resize:t.proxy(this.place,this)}],[t(document),{"mousedown touchstart":t.proxy(function(t){this.element.is(t.target)||this.element.find(t.target).length||this.picker.is(t.target)||this.picker.find(t.target).length||this.isInline||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents(),this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents(),this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(e,i){var n=i||this.dates.get(-1),s=this._utc_to_local(n);this.element.trigger({type:e,date:s,viewMode:this.viewMode,dates:t.map(this.dates,this._utc_to_local),format:t.proxy(function(t,e){0===arguments.length?(t=this.dates.length-1,e=this.o.format):"string"==typeof t&&(e=t,t=this.dates.length-1),e=e||this.o.format;var i=this.dates.get(t);return v.formatDate(i,e,this.o.language)},this)})},show:function(){if(!(this.inputField.is(":disabled")||this.inputField.prop("readonly")&&!1===this.o.enableOnReadonly))return this.isInline||this.picker.appendTo(this.o.container),this.place(),this.picker.show(),this._attachSecondaryEvents(),this._trigger("show"),(window.navigator.msMaxTouchPoints||"ontouchstart"in document)&&this.o.disableTouchKeyboard&&t(this.element).blur(),this},hide:function(){return this.isInline||!this.picker.is(":visible")?this:(this.focusDate=null,this.picker.hide().detach(),this._detachSecondaryEvents(),this.setViewMode(this.o.startView),this.o.forceParse&&this.inputField.val()&&this.setValue(),this._trigger("hide"),this)},destroy:function(){return this.hide(),this._detachEvents(),this._detachSecondaryEvents(),this.picker.remove(),delete this.element.data().datepicker,this.isInput||delete this.element.data().date,this},paste:function(e){var i;if(e.originalEvent.clipboardData&&e.originalEvent.clipboardData.types&&-1!==t.inArray("text/plain",e.originalEvent.clipboardData.types))i=e.originalEvent.clipboardData.getData("text/plain");else{if(!window.clipboardData)return;i=window.clipboardData.getData("Text")}this.setDate(i),this.update(),e.preventDefault()},_utc_to_local:function(t){if(!t)return t;var e=new Date(t.getTime()+6e4*t.getTimezoneOffset());return e.getTimezoneOffset()!==t.getTimezoneOffset()&&(e=new Date(t.getTime()+6e4*e.getTimezoneOffset())),e},_local_to_utc:function(t){return t&&new Date(t.getTime()-6e4*t.getTimezoneOffset())},_zero_time:function(t){return t&&new Date(t.getFullYear(),t.getMonth(),t.getDate())},_zero_utc_time:function(t){return t&&i(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate())},getDates:function(){return t.map(this.dates,this._utc_to_local)},getUTCDates:function(){return t.map(this.dates,function(t){return new Date(t)})},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){var t=this.dates.get(-1);return t!==e?new Date(t):null},clearDates:function(){this.inputField.val(""),this.update(),this._trigger("changeDate"),this.o.autoclose&&this.hide()},setDates:function(){var e=t.isArray(arguments[0])?arguments[0]:arguments;return this.update.apply(this,e),this._trigger("changeDate"),this.setValue(),this},setUTCDates:function(){var e=t.isArray(arguments[0])?arguments[0]:arguments;return this.setDates.apply(this,t.map(e,this._utc_to_local)),this},setDate:o("setDates"),setUTCDate:o("setUTCDates"),remove:o("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead"),setValue:function(){var t=this.getFormattedDate();return this.inputField.val(t),this},getFormattedDate:function(i){i===e&&(i=this.o.format);var n=this.o.language;return t.map(this.dates,function(t){return v.formatDate(t,i,n)}).join(this.o.multidateSeparator)},getStartDate:function(){return this.o.startDate},setStartDate:function(t){return this._process_options({startDate:t}),this.update(),this.updateNavArrows(),this},getEndDate:function(){return this.o.endDate},setEndDate:function(t){return this._process_options({endDate:t}),this.update(),this.updateNavArrows(),this},setDaysOfWeekDisabled:function(t){return this._process_options({daysOfWeekDisabled:t}),this.update(),this},setDaysOfWeekHighlighted:function(t){return this._process_options({daysOfWeekHighlighted:t}),this.update(),this},setDatesDisabled:function(t){return this._process_options({datesDisabled:t}),this.update(),this},place:function(){if(this.isInline)return this;var e=this.picker.outerWidth(),i=this.picker.outerHeight(),n=t(this.o.container),s=n.width(),o="body"===this.o.container?t(document).scrollTop():n.scrollTop(),a=n.offset(),r=[0];this.element.parents().each(function(){var e=t(this).css("z-index");"auto"!==e&&0!==Number(e)&&r.push(Number(e))});var l=Math.max.apply(Math,r)+this.o.zIndexOffset,h=this.component?this.component.parent().offset():this.element.offset(),u=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),c=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),d=h.left-a.left,f=h.top-a.top;"body"!==this.o.container&&(f+=o),this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left"),"auto"!==this.o.orientation.x?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),"right"===this.o.orientation.x&&(d-=e-c)):h.left<0?(this.picker.addClass("datepicker-orient-left"),d-=h.left-10):d+e>s?(this.picker.addClass("datepicker-orient-right"),d+=c-e):this.o.rtl?this.picker.addClass("datepicker-orient-right"):this.picker.addClass("datepicker-orient-left");var p,g=this.o.orientation.y;if("auto"===g&&(p=-o+f-i,g=p<0?"bottom":"top"),this.picker.addClass("datepicker-orient-"+g),"top"===g?f-=i+parseInt(this.picker.css("padding-top")):f+=u,this.o.rtl){var m=s-(d+c);this.picker.css({top:f,right:m,zIndex:l})}else this.picker.css({top:f,left:d,zIndex:l});return this},_allow_update:!0,update:function(){if(!this._allow_update)return this;var e=this.dates.copy(),i=[],n=!1;return arguments.length?(t.each(arguments,t.proxy(function(t,e){e instanceof Date&&(e=this._local_to_utc(e)),i.push(e)},this)),n=!0):(i=this.isInput?this.element.val():this.element.data("date")||this.inputField.val(),i=i&&this.o.multidate?i.split(this.o.multidateSeparator):[i],delete this.element.data().date),i=t.map(i,t.proxy(function(t){return v.parseDate(t,this.o.format,this.o.language,this.o.assumeNearbyYear)},this)),i=t.grep(i,t.proxy(function(t){return!this.dateWithinRange(t)||!t},this),!0),this.dates.replace(i),this.o.updateViewDate&&(this.dates.length?this.viewDate=new Date(this.dates.get(-1)):this.viewDate<this.o.startDate?this.viewDate=new Date(this.o.startDate):this.viewDate>this.o.endDate?this.viewDate=new Date(this.o.endDate):this.viewDate=this.o.defaultViewDate),n?(this.setValue(),this.element.change()):this.dates.length&&String(e)!==String(this.dates)&&n&&(this._trigger("changeDate"),this.element.change()),!this.dates.length&&e.length&&(this._trigger("clearDate"),this.element.change()),this.fill(),this},fillDow:function(){if(this.o.showWeekDays){var e=this.o.weekStart,i="<tr>";for(this.o.calendarWeeks&&(i+='<th class="cw">&#160;</th>');e<this.o.weekStart+7;)i+='<th class="dow',-1!==t.inArray(e,this.o.daysOfWeekDisabled)&&(i+=" disabled"),i+='">'+m[this.o.language].daysMin[e++%7]+"</th>";i+="</tr>",this.picker.find(".datepicker-days thead").append(i)}},fillMonths:function(){for(var t,e=this._utc_to_local(this.viewDate),i="",n=0;n<12;n++)t=e&&e.getMonth()===n?" focused":"",i+='<span class="month'+t+'">'+m[this.o.language].monthsShort[n]+"</span>";this.picker.find(".datepicker-months td").html(i)},setRange:function(e){e&&e.length?this.range=t.map(e,function(t){return t.valueOf()}):delete this.range,this.fill()},getClassNames:function(e){var i=[],o=this.viewDate.getUTCFullYear(),a=this.viewDate.getUTCMonth(),r=n();return e.getUTCFullYear()<o||e.getUTCFullYear()===o&&e.getUTCMonth()<a?i.push("old"):(e.getUTCFullYear()>o||e.getUTCFullYear()===o&&e.getUTCMonth()>a)&&i.push("new"),this.focusDate&&e.valueOf()===this.focusDate.valueOf()&&i.push("focused"),this.o.todayHighlight&&s(e,r)&&i.push("today"),-1!==this.dates.contains(e)&&i.push("active"),this.dateWithinRange(e)||i.push("disabled"),this.dateIsDisabled(e)&&i.push("disabled","disabled-date"),-1!==t.inArray(e.getUTCDay(),this.o.daysOfWeekHighlighted)&&i.push("highlighted"),this.range&&(e>this.range[0]&&e<this.range[this.range.length-1]&&i.push("range"),-1!==t.inArray(e.valueOf(),this.range)&&i.push("selected"),e.valueOf()===this.range[0]&&i.push("range-start"),e.valueOf()===this.range[this.range.length-1]&&i.push("range-end")),i},_fill_yearsView:function(i,n,s,o,a,r,l){for(var h,u,c,d="",f=s/10,p=this.picker.find(i),g=Math.floor(o/s)*s,m=g+9*f,v=Math.floor(this.viewDate.getFullYear()/f)*f,b=t.map(this.dates,function(t){
return Math.floor(t.getUTCFullYear()/f)*f}),_=g-f;_<=m+f;_+=f)h=[n],u=null,_===g-f?h.push("old"):_===m+f&&h.push("new"),-1!==t.inArray(_,b)&&h.push("active"),(_<a||_>r)&&h.push("disabled"),_===v&&h.push("focused"),l!==t.noop&&(c=l(new Date(_,0,1)),c===e?c={}:"boolean"==typeof c?c={enabled:c}:"string"==typeof c&&(c={classes:c}),!1===c.enabled&&h.push("disabled"),c.classes&&(h=h.concat(c.classes.split(/\s+/))),c.tooltip&&(u=c.tooltip)),d+='<span class="'+h.join(" ")+'"'+(u?' title="'+u+'"':"")+">"+_+"</span>";p.find(".datepicker-switch").text(g+"-"+m),p.find("td").html(d)},fill:function(){var s,o,a=new Date(this.viewDate),r=a.getUTCFullYear(),l=a.getUTCMonth(),h=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,u=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,c=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,d=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,f=m[this.o.language].today||m.en.today||"",p=m[this.o.language].clear||m.en.clear||"",g=m[this.o.language].titleFormat||m.en.titleFormat,b=n(),_=(!0===this.o.todayBtn||"linked"===this.o.todayBtn)&&b>=this.o.startDate&&b<=this.o.endDate&&!this.weekOfDateIsDisabled(b);if(!isNaN(r)&&!isNaN(l)){this.picker.find(".datepicker-days .datepicker-switch").text(v.formatDate(a,g,this.o.language)),this.picker.find("tfoot .today").text(f).css("display",_?"table-cell":"none"),this.picker.find("tfoot .clear").text(p).css("display",!0===this.o.clearBtn?"table-cell":"none"),this.picker.find("thead .datepicker-title").text(this.o.title).css("display","string"==typeof this.o.title&&""!==this.o.title?"table-cell":"none"),this.updateNavArrows(),this.fillMonths();var y=i(r,l,0),x=y.getUTCDate();y.setUTCDate(x-(y.getUTCDay()-this.o.weekStart+7)%7);var w=new Date(y);y.getUTCFullYear()<100&&w.setUTCFullYear(y.getUTCFullYear()),w.setUTCDate(w.getUTCDate()+42),w=w.valueOf();for(var k,C,D=[];y.valueOf()<w;){if((k=y.getUTCDay())===this.o.weekStart&&(D.push("<tr>"),this.o.calendarWeeks)){var M=new Date(+y+(this.o.weekStart-k-7)%7*864e5),S=new Date(Number(M)+(11-M.getUTCDay())%7*864e5),T=new Date(Number(T=i(S.getUTCFullYear(),0,1))+(11-T.getUTCDay())%7*864e5),I=(S-T)/864e5/7+1;D.push('<td class="cw">'+I+"</td>")}C=this.getClassNames(y),C.push("day");var P=y.getUTCDate();this.o.beforeShowDay!==t.noop&&(o=this.o.beforeShowDay(this._utc_to_local(y)),o===e?o={}:"boolean"==typeof o?o={enabled:o}:"string"==typeof o&&(o={classes:o}),!1===o.enabled&&C.push("disabled"),o.classes&&(C=C.concat(o.classes.split(/\s+/))),o.tooltip&&(s=o.tooltip),o.content&&(P=o.content)),C=t.isFunction(t.uniqueSort)?t.uniqueSort(C):t.unique(C),D.push('<td class="'+C.join(" ")+'"'+(s?' title="'+s+'"':"")+' data-date="'+y.getTime().toString()+'">'+P+"</td>"),s=null,k===this.o.weekEnd&&D.push("</tr>"),y.setUTCDate(y.getUTCDate()+1)}this.picker.find(".datepicker-days tbody").html(D.join(""));var A=m[this.o.language].monthsTitle||m.en.monthsTitle||"Months",F=this.picker.find(".datepicker-months").find(".datepicker-switch").text(this.o.maxViewMode<2?A:r).end().find("tbody span").removeClass("active");if(t.each(this.dates,function(t,e){e.getUTCFullYear()===r&&F.eq(e.getUTCMonth()).addClass("active")}),(r<h||r>c)&&F.addClass("disabled"),r===h&&F.slice(0,u).addClass("disabled"),r===c&&F.slice(d+1).addClass("disabled"),this.o.beforeShowMonth!==t.noop){var O=this;t.each(F,function(i,n){var s=new Date(r,i,1),o=O.o.beforeShowMonth(s);o===e?o={}:"boolean"==typeof o?o={enabled:o}:"string"==typeof o&&(o={classes:o}),!1!==o.enabled||t(n).hasClass("disabled")||t(n).addClass("disabled"),o.classes&&t(n).addClass(o.classes),o.tooltip&&t(n).prop("title",o.tooltip)})}this._fill_yearsView(".datepicker-years","year",10,r,h,c,this.o.beforeShowYear),this._fill_yearsView(".datepicker-decades","decade",100,r,h,c,this.o.beforeShowDecade),this._fill_yearsView(".datepicker-centuries","century",1e3,r,h,c,this.o.beforeShowCentury)}},updateNavArrows:function(){if(this._allow_update){var t,e,i=new Date(this.viewDate),n=i.getUTCFullYear(),s=i.getUTCMonth(),o=this.o.startDate!==-1/0?this.o.startDate.getUTCFullYear():-1/0,a=this.o.startDate!==-1/0?this.o.startDate.getUTCMonth():-1/0,r=this.o.endDate!==1/0?this.o.endDate.getUTCFullYear():1/0,l=this.o.endDate!==1/0?this.o.endDate.getUTCMonth():1/0,h=1;switch(this.viewMode){case 4:h*=10;case 3:h*=10;case 2:h*=10;case 1:t=Math.floor(n/h)*h<=o,e=Math.floor(n/h)*h+h>r;break;case 0:t=n<=o&&s<=a,e=n>=r&&s>=l}this.picker.find(".prev").toggleClass("disabled",t),this.picker.find(".next").toggleClass("disabled",e)}},click:function(e){e.preventDefault(),e.stopPropagation();var s,o,a,r;s=t(e.target),s.hasClass("datepicker-switch")&&this.viewMode!==this.o.maxViewMode&&this.setViewMode(this.viewMode+1),s.hasClass("today")&&!s.hasClass("day")&&(this.setViewMode(0),this._setDate(n(),"linked"===this.o.todayBtn?null:"view")),s.hasClass("clear")&&this.clearDates(),s.hasClass("disabled")||(s.hasClass("month")||s.hasClass("year")||s.hasClass("decade")||s.hasClass("century"))&&(this.viewDate.setUTCDate(1),o=1,1===this.viewMode?(r=s.parent().find("span").index(s),a=this.viewDate.getUTCFullYear(),this.viewDate.setUTCMonth(r)):(r=0,a=Number(s.text()),this.viewDate.setUTCFullYear(a)),this._trigger(v.viewModes[this.viewMode-1].e,this.viewDate),this.viewMode===this.o.minViewMode?this._setDate(i(a,r,o)):(this.setViewMode(this.viewMode-1),this.fill())),this.picker.is(":visible")&&this._focused_from&&this._focused_from.focus(),delete this._focused_from},dayCellClick:function(e){var i=t(e.currentTarget),n=i.data("date"),s=new Date(n);this.o.updateViewDate&&(s.getUTCFullYear()!==this.viewDate.getUTCFullYear()&&this._trigger("changeYear",this.viewDate),s.getUTCMonth()!==this.viewDate.getUTCMonth()&&this._trigger("changeMonth",this.viewDate)),this._setDate(s)},navArrowsClick:function(e){var i=t(e.currentTarget),n=i.hasClass("prev")?-1:1;0!==this.viewMode&&(n*=12*v.viewModes[this.viewMode].navStep),this.viewDate=this.moveMonth(this.viewDate,n),this._trigger(v.viewModes[this.viewMode].e,this.viewDate),this.fill()},_toggle_multidate:function(t){var e=this.dates.contains(t);if(t||this.dates.clear(),-1!==e?(!0===this.o.multidate||this.o.multidate>1||this.o.toggleActive)&&this.dates.remove(e):!1===this.o.multidate?(this.dates.clear(),this.dates.push(t)):this.dates.push(t),"number"==typeof this.o.multidate)for(;this.dates.length>this.o.multidate;)this.dates.remove(0)},_setDate:function(t,e){e&&"date"!==e||this._toggle_multidate(t&&new Date(t)),(!e&&this.o.updateViewDate||"view"===e)&&(this.viewDate=t&&new Date(t)),this.fill(),this.setValue(),e&&"view"===e||this._trigger("changeDate"),this.inputField.trigger("change"),!this.o.autoclose||e&&"date"!==e||this.hide()},moveDay:function(t,e){var i=new Date(t);return i.setUTCDate(t.getUTCDate()+e),i},moveWeek:function(t,e){return this.moveDay(t,7*e)},moveMonth:function(t,e){if(!a(t))return this.o.defaultViewDate;if(!e)return t;var i,n,s=new Date(t.valueOf()),o=s.getUTCDate(),r=s.getUTCMonth(),l=Math.abs(e);if(e=e>0?1:-1,1===l)n=-1===e?function(){return s.getUTCMonth()===r}:function(){return s.getUTCMonth()!==i},i=r+e,s.setUTCMonth(i),i=(i+12)%12;else{for(var h=0;h<l;h++)s=this.moveMonth(s,e);i=s.getUTCMonth(),s.setUTCDate(o),n=function(){return i!==s.getUTCMonth()}}for(;n();)s.setUTCDate(--o),s.setUTCMonth(i);return s},moveYear:function(t,e){return this.moveMonth(t,12*e)},moveAvailableDate:function(t,e,i){do{if(t=this[i](t,e),!this.dateWithinRange(t))return!1;i="moveDay"}while(this.dateIsDisabled(t));return t},weekOfDateIsDisabled:function(e){return-1!==t.inArray(e.getUTCDay(),this.o.daysOfWeekDisabled)},dateIsDisabled:function(e){return this.weekOfDateIsDisabled(e)||t.grep(this.o.datesDisabled,function(t){return s(e,t)}).length>0},dateWithinRange:function(t){return t>=this.o.startDate&&t<=this.o.endDate},keydown:function(t){if(!this.picker.is(":visible"))return void(40!==t.keyCode&&27!==t.keyCode||(this.show(),t.stopPropagation()));var e,i,n=!1,s=this.focusDate||this.viewDate;switch(t.keyCode){case 27:this.focusDate?(this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill()):this.hide(),t.preventDefault(),t.stopPropagation();break;case 37:case 38:case 39:case 40:if(!this.o.keyboardNavigation||7===this.o.daysOfWeekDisabled.length)break;e=37===t.keyCode||38===t.keyCode?-1:1,0===this.viewMode?t.ctrlKey?(i=this.moveAvailableDate(s,e,"moveYear"))&&this._trigger("changeYear",this.viewDate):t.shiftKey?(i=this.moveAvailableDate(s,e,"moveMonth"))&&this._trigger("changeMonth",this.viewDate):37===t.keyCode||39===t.keyCode?i=this.moveAvailableDate(s,e,"moveDay"):this.weekOfDateIsDisabled(s)||(i=this.moveAvailableDate(s,e,"moveWeek")):1===this.viewMode?(38!==t.keyCode&&40!==t.keyCode||(e*=4),i=this.moveAvailableDate(s,e,"moveMonth")):2===this.viewMode&&(38!==t.keyCode&&40!==t.keyCode||(e*=4),i=this.moveAvailableDate(s,e,"moveYear")),i&&(this.focusDate=this.viewDate=i,this.setValue(),this.fill(),t.preventDefault());break;case 13:if(!this.o.forceParse)break;s=this.focusDate||this.dates.get(-1)||this.viewDate,this.o.keyboardNavigation&&(this._toggle_multidate(s),n=!0),this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.setValue(),this.fill(),this.picker.is(":visible")&&(t.preventDefault(),t.stopPropagation(),this.o.autoclose&&this.hide());break;case 9:this.focusDate=null,this.viewDate=this.dates.get(-1)||this.viewDate,this.fill(),this.hide()}n&&(this.dates.length?this._trigger("changeDate"):this._trigger("clearDate"),this.inputField.trigger("change"))},setViewMode:function(t){this.viewMode=t,this.picker.children("div").hide().filter(".datepicker-"+v.viewModes[this.viewMode].clsName).show(),this.updateNavArrows(),this._trigger("changeViewMode",new Date(this.viewDate))}};var c=function(e,i){t.data(e,"datepicker",this),this.element=t(e),this.inputs=t.map(i.inputs,function(t){return t.jquery?t[0]:t}),delete i.inputs,this.keepEmptyValues=i.keepEmptyValues,delete i.keepEmptyValues,f.call(t(this.inputs),i).on("changeDate",t.proxy(this.dateUpdated,this)),this.pickers=t.map(this.inputs,function(e){return t.data(e,"datepicker")}),this.updateDates()};c.prototype={updateDates:function(){this.dates=t.map(this.pickers,function(t){return t.getUTCDate()}),this.updateRanges()},updateRanges:function(){var e=t.map(this.dates,function(t){return t.valueOf()});t.each(this.pickers,function(t,i){i.setRange(e)})},clearDates:function(){t.each(this.pickers,function(t,e){e.clearDates()})},dateUpdated:function(i){if(!this.updating){this.updating=!0;var n=t.data(i.target,"datepicker");if(n!==e){var s=n.getUTCDate(),o=this.keepEmptyValues,a=t.inArray(i.target,this.inputs),r=a-1,l=a+1,h=this.inputs.length;if(-1!==a){if(t.each(this.pickers,function(t,e){e.getUTCDate()||e!==n&&o||e.setUTCDate(s)}),s<this.dates[r])for(;r>=0&&s<this.dates[r];)this.pickers[r--].setUTCDate(s);else if(s>this.dates[l])for(;l<h&&s>this.dates[l];)this.pickers[l++].setUTCDate(s);this.updateDates(),delete this.updating}}}},destroy:function(){t.map(this.pickers,function(t){t.destroy()}),t(this.inputs).off("changeDate",this.dateUpdated),delete this.element.data().datepicker},remove:o("destroy","Method `remove` is deprecated and will be removed in version 2.0. Use `destroy` instead")};var d=t.fn.datepicker,f=function(i){var n=Array.apply(null,arguments);n.shift();var s;if(this.each(function(){var e=t(this),o=e.data("datepicker"),a="object"==typeof i&&i;if(!o){var h=r(this,"date"),d=t.extend({},p,h,a),f=l(d.language),g=t.extend({},p,f,h,a);e.hasClass("input-daterange")||g.inputs?(t.extend(g,{inputs:g.inputs||e.find("input").toArray()}),o=new c(this,g)):o=new u(this,g),e.data("datepicker",o)}"string"==typeof i&&"function"==typeof o[i]&&(s=o[i].apply(o,n))}),s===e||s instanceof u||s instanceof c)return this;if(this.length>1)throw new Error("Using only allowed for the collection of a single element ("+i+" function)");return s};t.fn.datepicker=f;var p=t.fn.datepicker.defaults={assumeNearbyYear:!1,autoclose:!1,beforeShowDay:t.noop,beforeShowMonth:t.noop,beforeShowYear:t.noop,beforeShowDecade:t.noop,beforeShowCentury:t.noop,calendarWeeks:!1,clearBtn:!1,toggleActive:!1,daysOfWeekDisabled:[],daysOfWeekHighlighted:[],datesDisabled:[],endDate:1/0,forceParse:!0,format:"mm/dd/yyyy",keepEmptyValues:!1,keyboardNavigation:!0,language:"en",minViewMode:0,maxViewMode:4,multidate:!1,multidateSeparator:",",orientation:"auto",rtl:!1,startDate:-1/0,startView:0,todayBtn:!1,todayHighlight:!1,updateViewDate:!0,weekStart:0,disableTouchKeyboard:!1,enableOnReadonly:!0,showOnFocus:!0,zIndexOffset:10,container:"body",immediateUpdates:!1,title:"",templates:{leftArrow:"&#x00AB;",rightArrow:"&#x00BB;"},showWeekDays:!0},g=t.fn.datepicker.locale_opts=["format","rtl","weekStart"];t.fn.datepicker.Constructor=u;var m=t.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",titleFormat:"MM yyyy"}},v={viewModes:[{names:["days","month"],clsName:"days",e:"changeMonth"},{names:["months","year"],clsName:"months",e:"changeYear",navStep:1},{names:["years","decade"],clsName:"years",e:"changeDecade",navStep:10},{names:["decades","century"],clsName:"decades",e:"changeCentury",navStep:100},{names:["centuries","millennium"],clsName:"centuries",e:"changeMillennium",navStep:1e3}],validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\u5e74\u6708\u65e5\[-`{-~\t\n\r]+/g,parseFormat:function(t){if("function"==typeof t.toValue&&"function"==typeof t.toDisplay)return t;var e=t.replace(this.validParts,"\0").split("\0"),i=t.match(this.validParts);if(!e||!e.length||!i||0===i.length)throw new Error("Invalid date format.");return{separators:e,parts:i}},parseDate:function(i,s,o,a){function r(t,e){return!0===e&&(e=10),t<100&&(t+=2e3)>(new Date).getFullYear()+e&&(t-=100),t}function l(){var t=this.slice(0,h[f].length),e=h[f].slice(0,t.length);return t.toLowerCase()===e.toLowerCase()}if(!i)return e;if(i instanceof Date)return i;if("string"==typeof s&&(s=v.parseFormat(s)),s.toValue)return s.toValue(i,s,o);var h,c,d,f,p,g={d:"moveDay",m:"moveMonth",w:"moveWeek",y:"moveYear"},b={yesterday:"-1d",today:"+0d",tomorrow:"+1d"};if(i in b&&(i=b[i]),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/i.test(i)){for(h=i.match(/([\-+]\d+)([dmwy])/gi),i=new Date,f=0;f<h.length;f++)c=h[f].match(/([\-+]\d+)([dmwy])/i),d=Number(c[1]),p=g[c[2].toLowerCase()],i=u.prototype[p](i,d);return u.prototype._zero_utc_time(i)}h=i&&i.match(this.nonpunctuation)||[];var _,y,x={},w=["yyyy","yy","M","MM","m","mm","d","dd"],k={yyyy:function(t,e){return t.setUTCFullYear(a?r(e,a):e)},m:function(t,e){if(isNaN(t))return t;for(e-=1;e<0;)e+=12;for(e%=12,t.setUTCMonth(e);t.getUTCMonth()!==e;)t.setUTCDate(t.getUTCDate()-1);return t},d:function(t,e){return t.setUTCDate(e)}};k.yy=k.yyyy,k.M=k.MM=k.mm=k.m,k.dd=k.d,i=n();var C=s.parts.slice();if(h.length!==C.length&&(C=t(C).filter(function(e,i){return-1!==t.inArray(i,w)}).toArray()),h.length===C.length){var D;for(f=0,D=C.length;f<D;f++){if(_=parseInt(h[f],10),c=C[f],isNaN(_))switch(c){case"MM":y=t(m[o].months).filter(l),_=t.inArray(y[0],m[o].months)+1;break;case"M":y=t(m[o].monthsShort).filter(l),_=t.inArray(y[0],m[o].monthsShort)+1}x[c]=_}var M,S;for(f=0;f<w.length;f++)(S=w[f])in x&&!isNaN(x[S])&&(M=new Date(i),k[S](M,x[S]),isNaN(M)||(i=M))}return i},formatDate:function(e,i,n){if(!e)return"";if("string"==typeof i&&(i=v.parseFormat(i)),i.toDisplay)return i.toDisplay(e,i,n);var s={d:e.getUTCDate(),D:m[n].daysShort[e.getUTCDay()],DD:m[n].days[e.getUTCDay()],m:e.getUTCMonth()+1,M:m[n].monthsShort[e.getUTCMonth()],MM:m[n].months[e.getUTCMonth()],yy:e.getUTCFullYear().toString().substring(2),yyyy:e.getUTCFullYear()};s.dd=(s.d<10?"0":"")+s.d,s.mm=(s.m<10?"0":"")+s.m,e=[];for(var o=t.extend([],i.separators),a=0,r=i.parts.length;a<=r;a++)o.length&&e.push(o.shift()),e.push(s[i.parts[a]]);return e.join("")},headTemplate:'<thead><tr><th colspan="7" class="datepicker-title"></th></tr><tr><th class="prev">'+p.templates.leftArrow+'</th><th colspan="5" class="datepicker-switch"></th><th class="next">'+p.templates.rightArrow+"</th></tr></thead>",contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr><tr><th colspan="7" class="clear"></th></tr></tfoot>'};v.template='<div class="datepicker"><div class="datepicker-days"><table class="table-condensed">'+v.headTemplate+"<tbody></tbody>"+v.footTemplate+'</table></div><div class="datepicker-months"><table class="table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+'</table></div><div class="datepicker-years"><table class="table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+'</table></div><div class="datepicker-decades"><table class="table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+'</table></div><div class="datepicker-centuries"><table class="table-condensed">'+v.headTemplate+v.contTemplate+v.footTemplate+"</table></div></div>",t.fn.datepicker.DPGlobal=v,t.fn.datepicker.noConflict=function(){return t.fn.datepicker=d,this},t.fn.datepicker.version="1.9.0",t.fn.datepicker.deprecated=function(t){var e=window.console;e&&e.warn&&e.warn("DEPRECATED: "+t)},t(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(e){var i=t(this);i.data("datepicker")||(e.preventDefault(),f.call(i,"show"))}),t(function(){f.call(t('[data-provide="datepicker-inline"]'))})}),function(t){"use strict";function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=function(){function t(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}return function(e,i,n){return i&&t(e.prototype,i),n&&t(e,n),e}}();!function(t){var n="ekkoLightbox",s=t.fn[n],o={title:"",footer:"",maxWidth:9999,maxHeight:9999,showArrows:!0,wrapping:!0,type:null,alwaysShowClose:!1,loadingMessage:'<div class="ekko-lightbox-loader"><div><div></div><div></div></div></div>',leftArrow:"<span>&#10094;</span>",rightArrow:"<span>&#10095;</span>",strings:{close:"Close",fail:"Failed to load image:",type:"Could not detect remote target type. Force the type using data-type"},doc:document,onShow:function(){},onShown:function(){},onHide:function(){},onHidden:function(){},onNavigate:function(){},onContentLoaded:function(){}},a=function(){function n(i,s){var a=this;e(this,n),this._config=t.extend({},o,s),this._$modalArrows=null,this._galleryIndex=0,this._galleryName=null,this._padding=null,this._border=null,this._titleIsShown=!1,this._footerIsShown=!1,this._wantedWidth=0,this._wantedHeight=0,this._touchstartX=0,this._touchendX=0,this._modalId="ekkoLightbox-"+Math.floor(1e3*Math.random()+1),this._$element=i instanceof jQuery?i:t(i),this._isBootstrap3=3==t.fn.modal.Constructor.VERSION[0];var r='<h4 class="modal-title">'+(this._config.title||"&nbsp;")+"</h4>",l='<button type="button" class="close" data-dismiss="modal" aria-label="'+this._config.strings.close+'"><span aria-hidden="true">&times;</span></button>',h='<div class="modal-header'+(this._config.title||this._config.alwaysShowClose?"":" hide")+'">'+(this._isBootstrap3?l+r:r+l)+"</div>",u='<div class="modal-footer'+(this._config.footer?"":" hide")+'">'+(this._config.footer||"&nbsp;")+"</div>",c='<div class="modal-dialog" role="document"><div class="modal-content">'+h+'<div class="modal-body"><div class="ekko-lightbox-container"><div class="ekko-lightbox-item fade in show"></div><div class="ekko-lightbox-item fade"></div></div></div>'+u+"</div></div>";t(this._config.doc.body).append('<div id="'+this._modalId+'" class="ekko-lightbox modal fade" tabindex="-1" tabindex="-1" role="dialog" aria-hidden="true">'+c+"</div>"),this._$modal=t("#"+this._modalId,this._config.doc),this._$modalDialog=this._$modal.find(".modal-dialog").first(),this._$modalContent=this._$modal.find(".modal-content").first(),this._$modalBody=this._$modal.find(".modal-body").first(),this._$modalHeader=this._$modal.find(".modal-header").first(),this._$modalFooter=this._$modal.find(".modal-footer").first(),this._$lightboxContainer=this._$modalBody.find(".ekko-lightbox-container").first(),this._$lightboxBodyOne=this._$lightboxContainer.find("> div:first-child").first(),this._$lightboxBodyTwo=this._$lightboxContainer.find("> div:last-child").first(),this._border=this._calculateBorders(),this._padding=this._calculatePadding(),this._galleryName=this._$element.data("gallery"),this._galleryName&&(this._$galleryItems=t(document.body).find('*[data-gallery="'+this._galleryName+'"]'),this._galleryIndex=this._$galleryItems.index(this._$element),t(document).on("keydown.ekkoLightbox",this._navigationalBinder.bind(this)),this._config.showArrows&&this._$galleryItems.length>1&&(this._$lightboxContainer.append('<div class="ekko-lightbox-nav-overlay"><a href="#">'+this._config.leftArrow+'</a><a href="#">'+this._config.rightArrow+"</a></div>"),this._$modalArrows=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay").first(),this._$lightboxContainer.on("click","a:first-child",function(t){return t.preventDefault(),a.navigateLeft()}),this._$lightboxContainer.on("click","a:last-child",function(t){return t.preventDefault(),a.navigateRight()}),this.updateNavigation())),this._$modal.on("show.bs.modal",this._config.onShow.bind(this)).on("shown.bs.modal",function(){return a._toggleLoading(!0),a._handle(),a._config.onShown.call(a)}).on("hide.bs.modal",this._config.onHide.bind(this)).on("hidden.bs.modal",function(){return a._galleryName&&(t(document).off("keydown.ekkoLightbox"),t(window).off("resize.ekkoLightbox")),a._$modal.remove(),a._config.onHidden.call(a)}).modal(this._config),t(window).on("resize.ekkoLightbox",function(){a._resize(a._wantedWidth,a._wantedHeight)}),this._$lightboxContainer.on("touchstart",function(){a._touchstartX=event.changedTouches[0].screenX}).on("touchend",function(){a._touchendX=event.changedTouches[0].screenX,a._swipeGesure()})}return i(n,null,[{key:"Default",get:function(){return o}}]),i(n,[{key:"element",value:function(){return this._$element}},{key:"modal",value:function(){return this._$modal}},{key:"navigateTo",value:function(e){if(e<0||e>this._$galleryItems.length-1)return this;this._galleryIndex=e,this.updateNavigation(),this._$element=t(this._$galleryItems.get(this._galleryIndex)),this._handle()}},{key:"navigateLeft",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(0===this._galleryIndex){if(!this._config.wrapping)return;this._galleryIndex=this._$galleryItems.length-1}else this._galleryIndex--;return this._config.onNavigate.call(this,"left",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"navigateRight",value:function(){if(this._$galleryItems&&1!==this._$galleryItems.length){if(this._galleryIndex===this._$galleryItems.length-1){if(!this._config.wrapping)return;this._galleryIndex=0}else this._galleryIndex++;return this._config.onNavigate.call(this,"right",this._galleryIndex),this.navigateTo(this._galleryIndex)}}},{key:"updateNavigation",value:function(){if(!this._config.wrapping){var t=this._$lightboxContainer.find("div.ekko-lightbox-nav-overlay");0===this._galleryIndex?t.find("a:first-child").addClass("disabled"):t.find("a:first-child").removeClass("disabled"),this._galleryIndex===this._$galleryItems.length-1?t.find("a:last-child").addClass("disabled"):t.find("a:last-child").removeClass("disabled")}}},{key:"close",value:function(){return this._$modal.modal("hide")}},{key:"_navigationalBinder",value:function(t){return t=t||window.event,39===t.keyCode?this.navigateRight():37===t.keyCode?this.navigateLeft():void 0}},{key:"_detectRemoteType",value:function(t,e){return e=e||!1,!e&&this._isImage(t)&&(e="image"),!e&&this._getYoutubeId(t)&&(e="youtube"),!e&&this._getVimeoId(t)&&(e="vimeo"),!e&&this._getInstagramId(t)&&(e="instagram"),(!e||["image","youtube","vimeo","instagram","video","url"].indexOf(e)<0)&&(e="url"),e}},{key:"_isImage",value:function(t){return t&&t.match(/(^data:image\/.*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg)((\?|#).*)?$)/i)}},{key:"_containerToUse",value:function(){var t=this,e=this._$lightboxBodyTwo,i=this._$lightboxBodyOne;return this._$lightboxBodyTwo.hasClass("in")&&(e=this._$lightboxBodyOne,i=this._$lightboxBodyTwo),i.removeClass("in show"),setTimeout(function(){t._$lightboxBodyTwo.hasClass("in")||t._$lightboxBodyTwo.empty(),t._$lightboxBodyOne.hasClass("in")||t._$lightboxBodyOne.empty()},500),e.addClass("in show"),e}},{key:"_handle",value:function(){var t=this._containerToUse();this._updateTitleAndFooter();var e=this._$element.attr("data-remote")||this._$element.attr("href"),i=this._detectRemoteType(e,this._$element.attr("data-type")||!1);if(["image","youtube","vimeo","instagram","video","url"].indexOf(i)<0)return this._error(this._config.strings.type);switch(i){case"image":this._preloadImage(e,t),this._preloadImageByIndex(this._galleryIndex,3);break;case"youtube":this._showYoutubeVideo(e,t);break;case"vimeo":this._showVimeoVideo(this._getVimeoId(e),t);break;case"instagram":this._showInstagramVideo(this._getInstagramId(e),t);break;case"video":this._showHtml5Video(e,t);break;default:this._loadRemoteContent(e,t)}return this}},{key:"_getYoutubeId",value:function(t){if(!t)return!1;var e=t.match(/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|\&v=)([^#\&\?]*).*/);return!(!e||11!==e[2].length)&&e[2]}},{key:"_getVimeoId",value:function(t){return!!(t&&t.indexOf("vimeo")>0)&&t}},{key:"_getInstagramId",value:function(t){return!!(t&&t.indexOf("instagram")>0)&&t}},{key:"_toggleLoading",value:function(e){return e=e||!1,e?(this._$modalDialog.css("display","none"),this._$modal.removeClass("in show"),t(".modal-backdrop").append(this._config.loadingMessage)):(this._$modalDialog.css("display","block"),this._$modal.addClass("in show"),t(".modal-backdrop").find(".ekko-lightbox-loader").remove()),this}},{key:"_calculateBorders",value:function(){return{top:this._totalCssByAttribute("border-top-width"),right:this._totalCssByAttribute("border-right-width"),bottom:this._totalCssByAttribute("border-bottom-width"),left:this._totalCssByAttribute("border-left-width")}}},{key:"_calculatePadding",value:function(){return{top:this._totalCssByAttribute("padding-top"),right:this._totalCssByAttribute("padding-right"),bottom:this._totalCssByAttribute("padding-bottom"),left:this._totalCssByAttribute("padding-left")}}},{key:"_totalCssByAttribute",value:function(t){return parseInt(this._$modalDialog.css(t),10)+parseInt(this._$modalContent.css(t),10)+parseInt(this._$modalBody.css(t),10)}},{key:"_updateTitleAndFooter",value:function(){var t=this._$element.data("title")||"",e=this._$element.data("footer")||"";return this._titleIsShown=!1,t||this._config.alwaysShowClose?(this._titleIsShown=!0,this._$modalHeader.css("display","").find(".modal-title").html(t||"&nbsp;")):this._$modalHeader.css("display","none"),this._footerIsShown=!1,e?(this._footerIsShown=!0,this._$modalFooter.css("display","").html(e)):this._$modalFooter.css("display","none"),this}},{key:"_showYoutubeVideo",value:function(t,e){var i=this._getYoutubeId(t),n=t.indexOf("&")>0?t.substr(t.indexOf("&")):"",s=this._$element.data("width")||560,o=this._$element.data("height")||s/(560/315);return this._showVideoIframe("//www.youtube.com/embed/"+i+"?badge=0&autoplay=1&html5=1"+n,s,o,e)}},{key:"_showVimeoVideo",value:function(t,e){var i=this._$element.data("width")||500,n=this._$element.data("height")||i/(560/315);return this._showVideoIframe(t+"?autoplay=1",i,n,e)}},{key:"_showInstagramVideo",value:function(t,e){var i=this._$element.data("width")||612,n=i+80;return t="/"!==t.substr(-1)?t+"/":t,e.html('<iframe width="'+i+'" height="'+n+'" src="'+t+'embed/" frameborder="0" allowfullscreen></iframe>'),this._resize(i,n),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showVideoIframe",value:function(t,e,i,n){return i=i||e,n.html('<div class="embed-responsive embed-responsive-16by9"><iframe width="'+e+'" height="'+i+'" src="'+t+'" frameborder="0" allowfullscreen class="embed-responsive-item"></iframe></div>'),this._resize(e,i),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_showHtml5Video",value:function(t,e){var i=this._$element.data("width")||560,n=this._$element.data("height")||i/(560/315);return e.html('<div class="embed-responsive embed-responsive-16by9"><video width="'+i+'" height="'+n+'" src="'+t+'" preload="auto" autoplay controls class="embed-responsive-item"></video></div>'),this._resize(i,n),this._config.onContentLoaded.call(this),this._$modalArrows&&this._$modalArrows.css("display","none"),this._toggleLoading(!1),this}},{key:"_loadRemoteContent",value:function(e,i){var n=this,s=this._$element.data("width")||560,o=this._$element.data("height")||560,a=this._$element.data("disableExternalCheck")||!1;return this._toggleLoading(!1),a||this._isExternal(e)?(i.html('<iframe src="'+e+'" frameborder="0" allowfullscreen></iframe>'),this._config.onContentLoaded.call(this)):i.load(e,t.proxy(function(){return n._$element.trigger("loaded.bs.modal")})),this._$modalArrows&&this._$modalArrows.css("display","none"),this._resize(s,o),this}},{key:"_isExternal",value:function(t){var e=t.match(/^([^:\/?#]+:)?(?:\/\/([^\/?#]*))?([^?#]+)?(\?[^#]*)?(#.*)?/);return"string"==typeof e[1]&&e[1].length>0&&e[1].toLowerCase()!==location.protocol||"string"==typeof e[2]&&e[2].length>0&&e[2].replace(new RegExp(":("+{"http:":80,"https:":443}[location.protocol]+")?$"),"")!==location.host}},{key:"_error",value:function(t){return console.error(t),this._containerToUse().html(t),this._resize(300,300),this}},{key:"_preloadImageByIndex",value:function(e,i){if(this._$galleryItems){var n=t(this._$galleryItems.get(e),!1);if(void 0!==n){var s=n.attr("data-remote")||n.attr("href");return("image"===n.attr("data-type")||this._isImage(s))&&this._preloadImage(s,!1),i>0?this._preloadImageByIndex(e+1,i-1):void 0}}}},{key:"_preloadImage",value:function(e,i){var n=this;i=i||!1;var s=new Image;return i&&function(){var o=setTimeout(function(){i.append(n._config.loadingMessage)},200);s.onload=function(){o&&clearTimeout(o),o=null;var e=t("<img />");return e.attr("src",s.src),e.addClass("img-fluid"),e.css("width","100%"),i.html(e),n._$modalArrows&&n._$modalArrows.css("display",""),n._resize(s.width,s.height),n._toggleLoading(!1),n._config.onContentLoaded.call(n)},s.onerror=function(){return n._toggleLoading(!1),n._error(n._config.strings.fail+" "+e)}}(),s.src=e,s}},{key:"_swipeGesure",value:function(){return this._touchendX<this._touchstartX?this.navigateRight():this._touchendX>this._touchstartX?this.navigateLeft():void 0}},{key:"_resize",value:function(e,i){i=i||e,this._wantedWidth=e,this._wantedHeight=i;var n=e/i,s=this._padding.left+this._padding.right+this._border.left+this._border.right,o=this._config.doc.body.clientWidth>575?20:0,a=this._config.doc.body.clientWidth>575?0:20,r=Math.min(e+s,this._config.doc.body.clientWidth-o,this._config.maxWidth);e+s>r?(i=(r-s-a)/n,e=r):e+=s;var l=0,h=0;this._footerIsShown&&(h=this._$modalFooter.outerHeight(!0)||55),this._titleIsShown&&(l=this._$modalHeader.outerHeight(!0)||67);var u=this._padding.top+this._padding.bottom+this._border.bottom+this._border.top,c=parseFloat(this._$modalDialog.css("margin-top"))+parseFloat(this._$modalDialog.css("margin-bottom")),d=Math.min(i,t(window).height()-u-c-l-h,this._config.maxHeight-u-l-h);i>d&&(e=Math.ceil(d*n)+s),this._$lightboxContainer.css("height",d),this._$modalDialog.css("flex",1).css("maxWidth",e);var f=this._$modal.data("bs.modal");if(f)try{f._handleUpdate()}catch(t){f.handleUpdate()}return this}}],[{
key:"_jQueryInterface",value:function(e){var i=this;return e=e||{},this.each(function(){var s=t(i),o=t.extend({},n.Default,s.data(),"object"==typeof e&&e);new n(i,o)})}}]),n}();t.fn[n]=a._jQueryInterface,t.fn[n].Constructor=a,t.fn[n].noConflict=function(){return t.fn[n]=s,a._jQueryInterface}}(jQuery)}(jQuery),function(t){function e(t,e,s){var o=t[0],a=/er/.test(s)?g:/bl/.test(s)?f:c,r=s==m?{checked:o[c],disabled:o[f],indeterminate:"true"==t.attr(g)||"false"==t.attr(p)}:o[a];if(/^(ch|di|in)/.test(s)&&!r)i(t,a);else if(/^(un|en|de)/.test(s)&&r)n(t,a);else if(s==m)for(var l in r)r[l]?i(t,l,!0):n(t,l,!0);else e&&"toggle"!=s||(e||t[x]("ifClicked"),r?o[v]!==u&&n(t,a):i(t,a))}function i(e,i,s){var m=e[0],b=e.parent(),x=i==c,w=i==g,C=i==f,D=w?p:x?d:"enabled",M=o(e,D+a(m[v])),S=o(e,i+a(m[v]));if(!0!==m[i]){if(!s&&i==c&&m[v]==u&&m.name){var T=e.closest("form"),I='input[name="'+m.name+'"]';I=T.length?T.find(I):t(I),I.each(function(){this!==m&&t(this).data(l)&&n(t(this),i)})}w?(m[i]=!0,m[c]&&n(e,c,"force")):(s||(m[i]=!0),x&&m[g]&&n(e,g,!1)),r(e,x,i,s)}m[f]&&o(e,k,!0)&&b.find("."+h).css(k,"default"),b[_](S||o(e,i)||""),b.attr("role")&&!w&&b.attr("aria-"+(C?f:c),"true"),b[y](M||o(e,D)||"")}function n(t,e,i){var n=t[0],s=t.parent(),l=e==c,u=e==g,m=e==f,b=u?p:l?d:"enabled",x=o(t,b+a(n[v])),w=o(t,e+a(n[v]));!1!==n[e]&&(!u&&i&&"force"!=i||(n[e]=!1),r(t,l,b,i)),!n[f]&&o(t,k,!0)&&s.find("."+h).css(k,"pointer"),s[y](w||o(t,e)||""),s.attr("role")&&!u&&s.attr("aria-"+(m?f:c),"false"),s[_](x||o(t,b)||"")}function s(e,i){e.data(l)&&(e.parent().html(e.attr("style",e.data(l).s||"")),i&&e[x](i),e.off(".i").unwrap(),t(w+'[for="'+e[0].id+'"]').add(e.closest(w)).off(".i"))}function o(t,e,i){if(t.data(l))return t.data(l).o[e+(i?"":"Class")]}function a(t){return t.charAt(0).toUpperCase()+t.slice(1)}function r(t,e,i,n){n||(e&&t[x]("ifToggled"),t[x]("ifChanged")[x]("if"+a(i)))}var l="iCheck",h=l+"-helper",u="radio",c="checked",d="un"+c,f="disabled",p="determinate",g="in"+p,m="update",v="type",b="touchbegin.i touchend.i",_="addClass",y="removeClass",x="trigger",w="label",k="cursor",C=/ipad|iphone|ipod|android|blackberry|windows phone|opera mini|silk/i.test(navigator.userAgent);t.fn[l]=function(o,a){var r='input[type="checkbox"], input[type="'+u+'"]',d=t(),p=function(e){e.each(function(){var e=t(this);d=e.is(r)?d.add(e):d.add(e.find(r))})};if(/^(check|uncheck|toggle|indeterminate|determinate|disable|enable|update|destroy)$/i.test(o))return o=o.toLowerCase(),p(this),d.each(function(){var i=t(this);"destroy"==o?s(i,"ifDestroyed"):e(i,!0,o),t.isFunction(a)&&a()});if("object"!=typeof o&&o)return this;var k=t.extend({checkedClass:c,disabledClass:f,indeterminateClass:g,labelHover:!0},o),D=k.handle,M=k.hoverClass||"hover",S=k.focusClass||"focus",T=k.activeClass||"active",I=!!k.labelHover,P=k.labelHoverClass||"hover",A=0|(""+k.increaseArea).replace("%","");return"checkbox"!=D&&D!=u||(r='input[type="'+D+'"]'),A<-50&&(A=-50),p(this),d.each(function(){var o=t(this);s(o);var a,r=this,d=r.id,p=-A+"%",g=100+2*A+"%",D={position:"absolute",top:p,left:p,display:"block",width:g,height:g,margin:0,padding:0,background:"#fff",border:0,opacity:0},F=C?{position:"absolute",visibility:"hidden"}:A?D:{position:"absolute",opacity:0},O="checkbox"==r[v]?k.checkboxClass||"icheckbox":k.radioClass||"i"+u,E=t(w+'[for="'+d+'"]').add(o.closest(w)),N=!!k.aria,z=l+"-"+Math.random().toString(36).substr(2,6),L='<div class="'+O+'" '+(N?'role="'+r[v]+'" ':"");N&&E.each(function(){L+='aria-labelledby="',this.id?L+=this.id:(this.id=z,L+=z),L+='"'}),L=o.wrap(L+"/>")[x]("ifCreated").parent().append(k.insert),a=t('<ins class="'+h+'"/>').css(D).appendTo(L),o.data(l,{o:k,s:o.attr("style")}).css(F),!!k.inheritClass&&L[_](r.className||""),!!k.inheritID&&d&&L.attr("id",l+"-"+d),"static"==L.css("position")&&L.css("position","relative"),e(o,!0,m),E.length&&E.on("click.i mouseover.i mouseout.i "+b,function(i){var n=i[v],s=t(this);if(!r[f]){if("click"==n){if(t(i.target).is("a"))return;e(o,!1,!0)}else I&&(/ut|nd/.test(n)?(L[y](M),s[y](P)):(L[_](M),s[_](P)));if(!C)return!1;i.stopPropagation()}}),o.on("click.i focus.i blur.i keyup.i keydown.i keypress.i",function(t){var e=t[v],s=t.keyCode;return"click"!=e&&("keydown"==e&&32==s?(r[v]==u&&r[c]||(r[c]?n(o,c):i(o,c)),!1):void("keyup"==e&&r[v]==u?!r[c]&&i(o,c):/us|ur/.test(e)&&L["blur"==e?y:_](S)))}),a.on("click mousedown mouseup mouseover mouseout "+b,function(t){var i=t[v],n=/wn|up/.test(i)?T:M;if(!r[f]){if("click"==i?e(o,!1,!0):(/wn|er|in/.test(i)?L[_](n):L[y](n+" "+T),E.length&&I&&n==M&&E[/ut|nd/.test(i)?y:_](P)),!C)return!1;t.stopPropagation()}})})}}(window.jQuery||window.Zepto),function(t){function e(t){for(var e,i,n=t.length;n;e=parseInt(Math.random()*n),i=t[--n],t[n]=t[e],t[e]=i);return t}function i(t,e){return Math.floor(Math.random()*(e-t+1)+t)}var n=[],s=[],o=[],a=[],r=null,l={init:function(e,i){for(var h=t.extend({bind:"click",passwordElement:null,displayElement:null,passwordLength:16,uppercase:!0,lowercase:!0,numbers:!0,specialChars:!0,additionalSpecialChars:[],onPasswordGenerated:function(t){}},e),u=48;u<58;u++)n.push(u);for(u=65;u<91;u++)s.push(u);for(u=97;u<123;u++)o.push(u);return a=[33,35,64,36,38,42,91,93,123,125,92,47,63,58,59,95,45].concat(h.additionalSpecialChars),this.each(function(){r=t(this),r.bind(h.bind,function(t){t.preventDefault(),l.generatePassword(h)})})},generatePassword:function(r){var l=new Array,h=r.uppercase+r.lowercase+r.numbers+r.specialChars,u=0,c=new Array,d=Math.floor(r.passwordLength/h);if(r.uppercase){for(var f=0;f<d;f++)l.push(String.fromCharCode(s[i(0,s.length-1)]));c=c.concat(s),u++}if(r.numbers){for(var f=0;f<d;f++)l.push(String.fromCharCode(n[i(0,n.length-1)]));c=c.concat(n),u++}if(r.specialChars){for(var f=0;f<d;f++)l.push(String.fromCharCode(a[i(0,a.length-1)]));c=c.concat(a),u++}var p=r.passwordLength-u*d;if(r.lowercase)for(var f=0;f<p;f++)l.push(String.fromCharCode(o[i(0,o.length-1)]));else for(var f=0;f<p;f++)l.push(String.fromCharCode(c[i(0,c.length-1)]));l=e(l).join(""),null!==r.passwordElement&&t(r.passwordElement).val(l),null!==r.displayElement&&(t(r.displayElement).is("input")?t(r.displayElement).val(l):t(r.displayElement).text(l)),r.onPasswordGenerated(l)}};t.fn.pGenerator=function(e){return l[e]?l[e].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof e&&e?void t.error("Method "+e+" does not exist on jQuery.pGenerator"):l.init.apply(this,arguments)}}(jQuery),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(function(){try{return require("moment")}catch(t){}}()):"function"==typeof define&&define.amd?define(["require"],function(t){return e(function(){try{return t("moment")}catch(t){}}())}):(t=t||self,t.Chart=e(t.moment))}(this,function(t){"use strict";function e(){for(var t={},e=Object.keys($e),i=e.length,n=0;n<i;n++)t[e[n]]={distance:-1,parent:null};return t}function i(t){var i=e(),n=[t];for(i[t].distance=0;n.length;)for(var s=n.pop(),o=Object.keys($e[s]),a=o.length,r=0;r<a;r++){var l=o[r],h=i[l];-1===h.distance&&(h.distance=i[s].distance+1,h.parent=s,n.unshift(l))}return i}function n(t,e){return function(i){return e(t(i))}}function s(t,e){for(var i=[e[t].parent,t],s=$e[e[t].parent][t],o=e[t].parent;e[o].parent;)i.unshift(e[o].parent),s=n($e[e[o].parent][o],s),o=e[o].parent;return s.conversion=i,s}function o(t){var e=function(e){return void 0===e||null===e?e:(arguments.length>1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}function a(t){var e=function(e){if(void 0===e||null===e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var i=t(e);if("object"==typeof i)for(var n=i.length,s=0;s<n;s++)i[s]=Math.round(i[s]);return i};return"conversion"in t&&(e.conversion=t.conversion),e}function r(t){if(t){var e=/^#([a-fA-F0-9]{3,4})$/i,i=/^#([a-fA-F0-9]{6}([a-fA-F0-9]{2})?)$/i,n=/^rgba?\(\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*,\s*([+-]?\d+)\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,s=/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*,\s*([+-]?[\d\.]+)\%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)$/i,o=/(\w+)/,a=[0,0,0],r=1,l=t.match(e),h="";if(l){l=l[1],h=l[3];for(var u=0;u<a.length;u++)a[u]=parseInt(l[u]+l[u],16);h&&(r=Math.round(parseInt(h+h,16)/255*100)/100)}else if(l=t.match(i)){h=l[2],l=l[1];for(var u=0;u<a.length;u++)a[u]=parseInt(l.slice(2*u,2*u+2),16);h&&(r=Math.round(parseInt(h,16)/255*100)/100)}else if(l=t.match(n)){for(var u=0;u<a.length;u++)a[u]=parseInt(l[u+1]);r=parseFloat(l[4])}else if(l=t.match(s)){for(var u=0;u<a.length;u++)a[u]=Math.round(2.55*parseFloat(l[u+1]));r=parseFloat(l[4])}else if(l=t.match(o)){if("transparent"==l[1])return[0,0,0,0];if(!(a=Qe[l[1]]))return}for(var u=0;u<a.length;u++)a[u]=w(a[u],0,255);return r=r||0==r?w(r,0,1):1,a[3]=r,a}}function l(t){if(t){var e=/^hsla?\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,i=t.match(e);if(i){var n=parseFloat(i[4]);return[w(parseInt(i[1]),0,360),w(parseFloat(i[2]),0,100),w(parseFloat(i[3]),0,100),w(isNaN(n)?1:n,0,1)]}}}function h(t){if(t){var e=/^hwb\(\s*([+-]?\d+)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?[\d\.]+)\s*)?\)/,i=t.match(e);if(i){var n=parseFloat(i[4]);return[w(parseInt(i[1]),0,360),w(parseFloat(i[2]),0,100),w(parseFloat(i[3]),0,100),w(isNaN(n)?1:n,0,1)]}}}function u(t){var e=r(t);return e&&e.slice(0,3)}function c(t){var e=l(t);return e&&e.slice(0,3)}function d(t){var e=r(t);return e?e[3]:(e=l(t))?e[3]:(e=h(t))?e[3]:void 0}function f(t,e){var e=void 0!==e&&3===t.length?e:t[3];return"#"+k(t[0])+k(t[1])+k(t[2])+(e>=0&&e<1?k(Math.round(255*e)):"")}function p(t,e){return e<1||t[3]&&t[3]<1?g(t,e):"rgb("+t[0]+", "+t[1]+", "+t[2]+")"}function g(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"rgba("+t[0]+", "+t[1]+", "+t[2]+", "+e+")"}function m(t,e){return e<1||t[3]&&t[3]<1?v(t,e):"rgb("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%)"}function v(t,e){return"rgba("+Math.round(t[0]/255*100)+"%, "+Math.round(t[1]/255*100)+"%, "+Math.round(t[2]/255*100)+"%, "+(e||t[3]||1)+")"}function b(t,e){return e<1||t[3]&&t[3]<1?_(t,e):"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)"}function _(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+e+")"}function y(t,e){return void 0===e&&(e=void 0!==t[3]?t[3]:1),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+(void 0!==e&&1!==e?", "+e:"")+")"}function x(t){return Je[t.slice(0,3)]}function w(t,e,i){return Math.min(Math.max(e,t),i)}function k(t){var e=t.toString(16).toUpperCase();return e.length<2?"0"+e:e}function C(t){return-1===["__proto__","prototype","constructor"].indexOf(t)}function D(t){return!t||si.isNullOrUndef(t.size)||si.isNullOrUndef(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function M(t,e,i,n){var s,o,a,r,l,h,u,c,d,f=Object.keys(i);for(s=0,o=f.length;s<o;++s)if(a=f[s],h=i[a],e.hasOwnProperty(a)||(e[a]=h),(r=e[a])!==h&&"_"!==a[0]){if(t.hasOwnProperty(a)||(t[a]=r),l=t[a],(u=typeof h)===typeof l)if("string"===u){if(c=ii(l),c.valid&&(d=ii(h),d.valid)){e[a]=d.mix(c,n).rgbString();continue}}else if(Si.isFinite(l)&&Si.isFinite(h)){e[a]=l+(h-l)*n;continue}e[a]=h}}function S(t,e){if(t._chartjs)return void t._chartjs.listeners.push(e);Object.defineProperty(t,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),Ri.forEach(function(e){var i="onData"+e.charAt(0).toUpperCase()+e.slice(1),n=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value:function(){var e=Array.prototype.slice.call(arguments),s=n.apply(this,e);return Si.each(t._chartjs.listeners,function(t){"function"==typeof t[i]&&t[i].apply(t,e)}),s}})})}function T(t,e){var i=t._chartjs;if(i){var n=i.listeners,s=n.indexOf(e);-1!==s&&n.splice(s,1),n.length>0||(Ri.forEach(function(e){delete t[e]}),delete t._chartjs)}}function I(t,e){var i=e.startAngle,n=e.endAngle,s=e.pixelMargin,o=s/e.outerRadius,a=e.x,r=e.y;t.beginPath(),t.arc(a,r,e.outerRadius,i-o,n+o),e.innerRadius>s?(o=s/e.innerRadius,t.arc(a,r,e.innerRadius-s,n+o,i-o,!0)):t.arc(a,r,s,n+Math.PI/2,i-Math.PI/2),t.closePath(),t.clip()}function P(t,e,i,n){var s,o=i.endAngle;for(n&&(i.endAngle=i.startAngle+Vi,I(t,i),i.endAngle=o,i.endAngle===i.startAngle&&i.fullCircles&&(i.endAngle+=Vi,i.fullCircles--)),t.beginPath(),t.arc(i.x,i.y,i.innerRadius,i.startAngle+Vi,i.startAngle,!0),s=0;s<i.fullCircles;++s)t.stroke();for(t.beginPath(),t.arc(i.x,i.y,e.outerRadius,i.startAngle,i.startAngle+Vi),s=0;s<i.fullCircles;++s)t.stroke()}function A(t,e,i){var n="inner"===e.borderAlign;n?(t.lineWidth=2*e.borderWidth,t.lineJoin="round"):(t.lineWidth=e.borderWidth,t.lineJoin="bevel"),i.fullCircles&&P(t,e,i,n),n&&I(t,i),t.beginPath(),t.arc(i.x,i.y,e.outerRadius,i.startAngle,i.endAngle),t.arc(i.x,i.y,i.innerRadius,i.endAngle,i.startAngle,!0),t.closePath(),t.stroke()}function F(t){var e=this._view;return!!e&&Math.abs(t-e.x)<e.radius+e.hitRadius}function O(t){var e=this._view;return!!e&&Math.abs(t-e.y)<e.radius+e.hitRadius}function E(t){return t&&void 0!==t.width}function N(t){var e,i,n,s,o;return E(t)?(o=t.width/2,e=t.x-o,i=t.x+o,n=Math.min(t.y,t.base),s=Math.max(t.y,t.base)):(o=t.height/2,e=Math.min(t.x,t.base),i=Math.max(t.x,t.base),n=t.y-o,s=t.y+o),{left:e,top:n,right:i,bottom:s}}function z(t,e,i){return t===e?i:t===i?e:t}function L(t){var e=t.borderSkipped,i={};return e?(t.horizontal?t.base>t.x&&(e=z(e,"left","right")):t.base<t.y&&(e=z(e,"bottom","top")),i[e]=!0,i):i}function H(t,e,i){var n,s,o,a,r=t.borderWidth,l=L(t);return Si.isObject(r)?(n=+r.top||0,s=+r.right||0,o=+r.bottom||0,a=+r.left||0):n=s=o=a=+r||0,{t:l.top||n<0?0:n>i?i:n,r:l.right||s<0?0:s>e?e:s,b:l.bottom||o<0?0:o>i?i:o,l:l.left||a<0?0:a>e?e:a}}function R(t){var e=N(t),i=e.right-e.left,n=e.bottom-e.top,s=H(t,i/2,n/2);return{outer:{x:e.left,y:e.top,w:i,h:n},inner:{x:e.left+s.l,y:e.top+s.t,w:i-s.l-s.r,h:n-s.t-s.b}}}function W(t,e,i){var n=null===e,s=null===i,o=!(!t||n&&s)&&N(t);return o&&(n||e>=o.left&&e<=o.right)&&(s||i>=o.top&&i<=o.bottom)}function B(t,e){var i,n,s,o,a=t._length;for(s=1,o=e.length;s<o;++s)a=Math.min(a,Math.abs(e[s]-e[s-1]));for(s=0,o=t.getTicks().length;s<o;++s)n=t.getPixelForTick(s),a=s>0?Math.min(a,Math.abs(n-i)):a,i=n;return a}function V(t,e,i){var n,s,o=i.barThickness,a=e.stackCount,r=e.pixels[t],l=Si.isNullOrUndef(o)?B(e.scale,e.pixels):-1;return Si.isNullOrUndef(o)?(n=l*i.categoryPercentage,s=i.barPercentage):(n=o*a,s=1),{chunk:n/a,ratio:s,start:r-n/2}}function U(t,e,i){var n,s,o=e.pixels,a=o[t],r=t>0?o[t-1]:null,l=t<o.length-1?o[t+1]:null,h=i.categoryPercentage;return null===r&&(r=a-(null===l?e.end-e.start:l-a)),null===l&&(l=a+a-r),n=a-(a-Math.min(r,l))/2*h,s=Math.abs(l-r)/2*h,{chunk:s/e.stackCount,ratio:i.barPercentage,start:n}}function j(t,e){var i=t&&t.options.ticks||{},n=i.reverse,s=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:n?o:s,end:n?s:o}}function Y(t,e,i){var n=i/2,s=j(t,n),o=j(e,n);return{top:o.end,right:s.end,bottom:o.start,left:s.start}}function q(t){var e,i,n,s;return Si.isObject(t)?(e=t.top,i=t.right,n=t.bottom,s=t.left):e=i=n=s=t,{top:e,right:i,bottom:n,left:s}}function $(t,e){return t.native?{x:t.x,y:t.y}:Si.getRelativePosition(t,e)}function K(t,e){var i,n,s,o,a,r,l=t._getSortedVisibleDatasetMetas();for(n=0,o=l.length;n<o;++n)for(i=l[n].data,s=0,a=i.length;s<a;++s)r=i[s],r._view.skip||e(r)}function X(t,e){var i=[];return K(t,function(t){t.inRange(e.x,e.y)&&i.push(t)}),i}function G(t,e,i,n){var s=Number.POSITIVE_INFINITY,o=[];return K(t,function(t){if(!i||t.inRange(e.x,e.y)){var a=t.getCenterPoint(),r=n(e,a);r<s?(o=[t],s=r):r===s&&o.push(t)}}),o}function Q(t){var e=-1!==t.indexOf("x"),i=-1!==t.indexOf("y");return function(t,n){var s=e?Math.abs(t.x-n.x):0,o=i?Math.abs(t.y-n.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function Z(t,e,i){var n=$(e,t);i.axis=i.axis||"x";var s=Q(i.axis),o=i.intersect?X(t,n):G(t,n,!1,s),a=[];return o.length?(t._getSortedVisibleDatasetMetas().forEach(function(t){var e=t.data[o[0]._index];e&&!e._view.skip&&a.push(e)}),a):[]}function J(t,e){return Si.where(t,function(t){return t.pos===e})}function tt(t,e){return t.sort(function(t,i){var n=e?i:t,s=e?t:i;return n.weight===s.weight?n.index-s.index:n.weight-s.weight})}function et(t){var e,i,n,s=[];for(e=0,i=(t||[]).length;e<i;++e)n=t[e],s.push({index:e,box:n,pos:n.position,horizontal:n.isHorizontal(),weight:n.weight});return s}function it(t,e){var i,n,s;for(i=0,n=t.length;i<n;++i)s=t[i],s.width=s.horizontal?s.box.fullWidth&&e.availableWidth:e.vBoxMaxWidth,s.height=s.horizontal&&e.hBoxMaxHeight}function nt(t){var e=et(t),i=tt(J(e,"left"),!0),n=tt(J(e,"right")),s=tt(J(e,"top"),!0),o=tt(J(e,"bottom"));return{leftAndTop:i.concat(s),rightAndBottom:n.concat(o),chartArea:J(e,"chartArea"),vertical:i.concat(n),horizontal:s.concat(o)}}function st(t,e,i,n){return Math.max(t[i],e[i])+Math.max(t[n],e[n])}function ot(t,e,i){var n,s,o=i.box,a=t.maxPadding;if(i.size&&(t[i.pos]-=i.size),i.size=i.horizontal?o.height:o.width,t[i.pos]+=i.size,o.getPadding){var r=o.getPadding();a.top=Math.max(a.top,r.top),a.left=Math.max(a.left,r.left),a.bottom=Math.max(a.bottom,r.bottom),a.right=Math.max(a.right,r.right)}if(n=e.outerWidth-st(a,t,"left","right"),s=e.outerHeight-st(a,t,"top","bottom"),n!==t.w||s!==t.h){t.w=n,t.h=s;var l=i.horizontal?[n,t.w]:[s,t.h];return!(l[0]===l[1]||isNaN(l[0])&&isNaN(l[1]))}}function at(t){function e(e){var n=Math.max(i[e]-t[e],0);return t[e]+=n,n}var i=t.maxPadding;t.y+=e("top"),t.x+=e("left"),e("right"),e("bottom")}function rt(t,e){function i(t){var i={left:0,top:0,right:0,bottom:0};return t.forEach(function(t){i[t]=Math.max(e[t],n[t])}),i}var n=e.maxPadding;return i(t?["left","right"]:["top","bottom"])}function lt(t,e,i){var n,s,o,a,r,l,h=[];for(n=0,s=t.length;n<s;++n)o=t[n],a=o.box,a.update(o.width||e.w,o.height||e.h,rt(o.horizontal,e)),ot(e,i,o)&&(l=!0,h.length&&(r=!0)),a.fullWidth||h.push(o);return r?lt(h,e,i)||l:l}function ht(t,e,i){var n,s,o,a,r=i.padding,l=e.x,h=e.y;for(n=0,s=t.length;n<s;++n)o=t[n],a=o.box,o.horizontal?(a.left=a.fullWidth?r.left:e.left,a.right=a.fullWidth?i.outerWidth-r.right:e.left+e.w,a.top=h,a.bottom=h+a.height,a.width=a.right-a.left,h=a.bottom):(a.left=l,a.right=l+a.width,a.top=e.top,a.bottom=e.top+e.h,a.height=a.bottom-a.top,l=a.right);e.x=l,e.y=h}function ut(t,e){var i=Si.getStyle(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?Number(n[1]):void 0}function ct(t,e){var i=t.style,n=t.getAttribute("height"),s=t.getAttribute("width");if(t[On]={initial:{height:n,width:s,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",null===s||""===s){var o=ut(t,"width");void 0!==o&&(t.width=o)}if(null===n||""===n)if(""===t.style.height)t.height=t.width/(e.options.aspectRatio||2);else{var a=ut(t,"height");void 0!==o&&(t.height=a)}return t}function dt(t,e,i){t.addEventListener(e,i,Wn)}function ft(t,e,i){t.removeEventListener(e,i,Wn)}function pt(t,e,i,n,s){return{type:t,chart:e,native:s||null,x:void 0!==i?i:null,y:void 0!==n?n:null}}function gt(t,e){var i=Hn[t.type]||t.type,n=Si.getRelativePosition(t,e);return pt(i,e,n.x,n.y,t)}function mt(t,e){var i=!1,n=[];return function(){n=Array.prototype.slice.call(arguments),e=e||this,i||(i=!0,Si.requestAnimFrame.call(window,function(){i=!1,t.apply(e,n)}))}}function vt(t){var e=document.createElement("div");return e.className=t||"",e}function bt(t){var e=vt(En),i=vt(En+"-expand"),n=vt(En+"-shrink");i.appendChild(vt()),n.appendChild(vt()),e.appendChild(i),e.appendChild(n),e._reset=function(){i.scrollLeft=1e6,i.scrollTop=1e6,n.scrollLeft=1e6,n.scrollTop=1e6};var s=function(){e._reset(),t()};return dt(i,"scroll",s.bind(i,"expand")),dt(n,"scroll",s.bind(n,"shrink")),e}function _t(t,e){var i=t[On]||(t[On]={}),n=i.renderProxy=function(t){t.animationName===zn&&e()};Si.each(Ln,function(e){dt(t,e,n)}),i.reflow=!!t.offsetParent,t.classList.add(Nn)}function yt(t){var e=t[On]||{},i=e.renderProxy;i&&(Si.each(Ln,function(e){ft(t,e,i)}),delete e.renderProxy),t.classList.remove(Nn)}function xt(t,e,i){var n=t[On]||(t[On]={}),s=n.resizer=bt(mt(function(){if(n.resizer){var s=i.options.maintainAspectRatio&&t.parentNode,o=s?s.clientWidth:0;e(pt("resize",i)),s&&s.clientWidth<o&&i.canvas&&e(pt("resize",i))}}));_t(t,function(){if(n.resizer){var e=t.parentNode;e&&e!==s.parentNode&&e.insertBefore(s,e.firstChild),s._reset()}})}function wt(t){var e=t[On]||{},i=e.resizer;delete e.resizer,yt(t),i&&i.parentNode&&i.parentNode.removeChild(i)}function kt(t,e){var i=t[On]||(t[On]={});if(!i.containsStyles){i.containsStyles=!0,e="/* Chart.js */\n"+e;var n=document.createElement("style");n.setAttribute("type","text/css"),n.appendChild(document.createTextNode(e)),t.appendChild(n)}}function Ct(t,e){return e&&(Si.isArray(e)?Array.prototype.push.apply(t,e):t.push(e)),t}function Dt(t){return("string"==typeof t||t instanceof String)&&t.indexOf("\n")>-1?t.split("\n"):t}function Mt(t){var e=t._xScale,i=t._yScale||t._scale,n=t._index,s=t._datasetIndex,o=t._chart.getDatasetMeta(s).controller,a=o._getIndexScale(),r=o._getValueScale();return{xLabel:e?e.getLabelForIndex(n,s):"",yLabel:i?i.getLabelForIndex(n,s):"",label:a?""+a.getLabelForIndex(n,s):"",value:r?""+r.getLabelForIndex(n,s):"",index:n,datasetIndex:s,x:t._model.x,y:t._model.y}}function St(t){var e=mi.global;return{xPadding:t.xPadding,yPadding:t.yPadding,xAlign:t.xAlign,yAlign:t.yAlign,rtl:t.rtl,textDirection:t.textDirection,bodyFontColor:t.bodyFontColor,_bodyFontFamily:qn(t.bodyFontFamily,e.defaultFontFamily),_bodyFontStyle:qn(t.bodyFontStyle,e.defaultFontStyle),_bodyAlign:t.bodyAlign,bodyFontSize:qn(t.bodyFontSize,e.defaultFontSize),bodySpacing:t.bodySpacing,titleFontColor:t.titleFontColor,_titleFontFamily:qn(t.titleFontFamily,e.defaultFontFamily),_titleFontStyle:qn(t.titleFontStyle,e.defaultFontStyle),titleFontSize:qn(t.titleFontSize,e.defaultFontSize),_titleAlign:t.titleAlign,titleSpacing:t.titleSpacing,titleMarginBottom:t.titleMarginBottom,footerFontColor:t.footerFontColor,_footerFontFamily:qn(t.footerFontFamily,e.defaultFontFamily),_footerFontStyle:qn(t.footerFontStyle,e.defaultFontStyle),footerFontSize:qn(t.footerFontSize,e.defaultFontSize),_footerAlign:t.footerAlign,footerSpacing:t.footerSpacing,footerMarginTop:t.footerMarginTop,caretSize:t.caretSize,cornerRadius:t.cornerRadius,backgroundColor:t.backgroundColor,opacity:0,legendColorBackground:t.multiKeyBackground,displayColors:t.displayColors,borderColor:t.borderColor,borderWidth:t.borderWidth}}function Tt(t,e){var i=t._chart.ctx,n=2*e.yPadding,s=0,o=e.body,a=o.reduce(function(t,e){return t+e.before.length+e.lines.length+e.after.length},0);a+=e.beforeBody.length+e.afterBody.length;var r=e.title.length,l=e.footer.length,h=e.titleFontSize,u=e.bodyFontSize,c=e.footerFontSize;n+=r*h,n+=r?(r-1)*e.titleSpacing:0,n+=r?e.titleMarginBottom:0,n+=a*u,n+=a?(a-1)*e.bodySpacing:0,n+=l?e.footerMarginTop:0,n+=l*c,n+=l?(l-1)*e.footerSpacing:0;var d=0,f=function(t){s=Math.max(s,i.measureText(t).width+d)};return i.font=Si.fontString(h,e._titleFontStyle,e._titleFontFamily),Si.each(e.title,f),i.font=Si.fontString(u,e._bodyFontStyle,e._bodyFontFamily),Si.each(e.beforeBody.concat(e.afterBody),f),d=e.displayColors?u+2:0,Si.each(o,function(t){Si.each(t.before,f),Si.each(t.lines,f),Si.each(t.after,f)}),d=0,i.font=Si.fontString(c,e._footerFontStyle,e._footerFontFamily),Si.each(e.footer,f),s+=2*e.xPadding,{width:s,height:n}}function It(t,e){var i=t._model,n=t._chart,s=t._chart.chartArea,o="center",a="center";i.y<e.height?a="top":i.y>n.height-e.height&&(a="bottom");var r,l,h,u,c,d=(s.left+s.right)/2,f=(s.top+s.bottom)/2;"center"===a?(r=function(t){return t<=d},l=function(t){return t>d}):(r=function(t){return t<=e.width/2},l=function(t){return t>=n.width-e.width/2}),h=function(t){return t+e.width+i.caretSize+i.caretPadding>n.width},u=function(t){return t-e.width-i.caretSize-i.caretPadding<0},c=function(t){return t<=f?"top":"bottom"},r(i.x)?(o="left",h(i.x)&&(o="center",a=c(i.y))):l(i.x)&&(o="right",u(i.x)&&(o="center",a=c(i.y)));var p=t._options;return{xAlign:p.xAlign?p.xAlign:o,yAlign:p.yAlign?p.yAlign:a}}function Pt(t,e,i,n){var s=t.x,o=t.y,a=t.caretSize,r=t.caretPadding,l=t.cornerRadius,h=i.xAlign,u=i.yAlign,c=a+r,d=l+r;return"right"===h?s-=e.width:"center"===h&&(s-=e.width/2,s+e.width>n.width&&(s=n.width-e.width),s<0&&(s=0)),"top"===u?o+=c:o-="bottom"===u?e.height+c:e.height/2,"center"===u?"left"===h?s+=c:"right"===h&&(s-=c):"left"===h?s-=d:"right"===h&&(s+=d),{x:s,y:o}}function At(t,e){return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-t.xPadding:t.x+t.xPadding}function Ft(t){return Ct([],Dt(t))}function Ot(){return Si.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,i,n){if("xAxes"===t||"yAxes"===t){var s,o,a,r=i[t].length;for(e[t]||(e[t]=[]),s=0;s<r;++s)a=i[t][s],o=Zn(a.type,"xAxes"===t?"category":"linear"),s>=e[t].length&&e[t].push({}),!e[t][s].type||a.type&&a.type!==e[t][s].type?Si.merge(e[t][s],[Yn.getScaleDefaults(o),a]):Si.merge(e[t][s],a)}else Si._merger(t,e,i,n)}})}function Et(){return Si.merge(Object.create(null),[].slice.call(arguments),{merger:function(t,e,i,n){var s=e[t]||Object.create(null),o=i[t];"scales"===t?e[t]=Ot(s,o):"scale"===t?e[t]=Si.merge(s,[Yn.getScaleDefaults(o.type),o]):Si._merger(t,e,i,n)}})}function Nt(t){t=t||Object.create(null);var e=t.data=t.data||{};return e.datasets=e.datasets||[],e.labels=e.labels||[],t.options=Et(mi.global,mi[t.type],t.options||{}),t}function zt(t){var e=t.options;Si.each(t.scales,function(e){In.removeBox(t,e)}),e=Et(mi.global,mi[t.config.type],e),t.options=t.config.options=e,t.ensureScalesHaveIDs(),t.buildOrUpdateScales(),t.tooltip._options=e.tooltips,t.tooltip.initialize()}function Lt(t,e,i){var n,s=function(t){return t.id===n};do{n=e+i++}while(Si.findIndex(t,s)>=0);return n}function Ht(t){return"top"===t||"bottom"===t}function Rt(t,e){return function(i,n){return i[t]===n[t]?i[e]-n[e]:i[t]-n[t]}}function Wt(){throw new Error("This method is not implemented: either no adapter can be found or an incomplete integration was provided.")}function Bt(t){this.options=t||{}}function Vt(t,e){for(var i=[],n=t.length/e,s=0,o=t.length;s<o;s+=n)i.push(t[Math.floor(s)]);return i}function Ut(t,e,i){var n,s=t.getTicks().length,o=Math.min(e,s-1),a=t.getPixelForTick(o),r=t._startPixel,l=t._endPixel;if(!(i&&(n=1===s?Math.max(a-r,l-a):0===e?(t.getPixelForTick(1)-a)/2:(a-t.getPixelForTick(o-1))/2,(a+=o<e?n:-n)<r-1e-6||a>l+1e-6)))return a}function jt(t,e){Si.each(t,function(t){var i,n=t.gc,s=n.length/2;if(s>e){for(i=0;i<s;++i)delete t.data[n[i]];n.splice(0,s)}})}function Yt(t,e,i,n){function s(t){return{width:_[t]||0,height:y[t]||0,offset:x[t]||0}}var o,a,r,l,h,u,c,d,f,p,g,m,v,b=i.length,_=[],y=[],x=[],w=0,k=0;for(o=0;o<b;++o){if(l=i[o].label,h=i[o].major?e.major:e.minor,t.font=u=h.string,c=n[u]=n[u]||{data:{},gc:[]},d=h.lineHeight,f=p=0,os(l)||ss(l)){if(ss(l))for(a=0,r=l.length;a<r;++a)g=l[a],os(g)||ss(g)||(f=Si.measureText(t,c.data,c.gc,f,g),p+=d)}else f=Si.measureText(t,c.data,c.gc,f,l),p=d;_.push(f),y.push(p),x.push(d/2),w=Math.max(f,w),k=Math.max(p,k)}return jt(n,b),m=_.indexOf(w),v=y.indexOf(k),{first:s(0),last:s(b-1),widest:s(m),highest:s(v)}}function qt(t){return t.drawTicks?t.tickMarkLength:0}function $t(t){var e,i;return t.display?(e=Si.options._parseFont(t),i=Si.options.toPadding(t.padding),e.lineHeight+i.height):0}function Kt(t,e){return Si.extend(Si.options._parseFont({fontFamily:as(e.fontFamily,t.fontFamily),fontSize:as(e.fontSize,t.fontSize),fontStyle:as(e.fontStyle,t.fontStyle),lineHeight:as(e.lineHeight,t.lineHeight)}),{color:Si.options.resolve([e.fontColor,t.fontColor,mi.global.defaultFontColor])})}function Xt(t){var e=Kt(t,t.minor);return{minor:e,major:t.major.enabled?Kt(t,t.major):e}}function Gt(t){var e,i,n,s=[];for(i=0,n=t.length;i<n;++i)e=t[i],void 0!==e._index&&s.push(e);return s}function Qt(t){var e,i,n=t.length;if(n<2)return!1;for(i=t[0],e=1;e<n;++e)if(t[e]-t[e-1]!==i)return!1;return i}function Zt(t,e,i,n){var s,o,a,r,l=Qt(t),h=(e.length-1)/n;if(!l)return Math.max(h,1);for(s=Si.math._factorize(l),a=0,r=s.length-1;a<r;a++)if((o=s[a])>h)return o;return Math.max(h,1)}function Jt(t){var e,i,n=[];for(e=0,i=t.length;e<i;e++)t[e].major&&n.push(e);return n}function te(t,e,i){var n,s,o=0,a=e[0];for(i=Math.ceil(i),n=0;n<t.length;n++)s=t[n],n===a?(s._index=n,o++,a=e[o*i]):delete s.label}function ee(t,e,i,n){var s,o,a,r,l=as(i,0),h=Math.min(as(n,t.length),t.length),u=0;for(e=Math.ceil(e),n&&(s=n-i,e=s/Math.floor(s/e)),r=l;r<0;)u++,r=Math.round(l+u*e);for(o=Math.max(l,0);o<h;o++)a=t[o],o===r?(a._index=o,u++,r=Math.round(l+u*e)):delete a.label}function ie(t,e){var i,n,s,o,a=[],r=t.stepSize,l=r||1,h=t.maxTicks-1,u=t.min,c=t.max,d=t.precision,f=e.min,p=e.max,g=Si.niceNum((p-f)/h/l)*l;if(g<1e-14&&gs(u)&&gs(c))return[f,p];o=Math.ceil(p/g)-Math.floor(f/g),o>h&&(g=Si.niceNum(o*g/h/l)*l),r||gs(d)?i=Math.pow(10,Si._decimalPlaces(g)):(i=Math.pow(10,d),g=Math.ceil(g*i)/i),n=Math.floor(f/g)*g,s=Math.ceil(p/g)*g,r&&(!gs(u)&&Si.almostWhole(u/g,g/1e3)&&(n=u),!gs(c)&&Si.almostWhole(c/g,g/1e3)&&(s=c)),o=(s-n)/g,o=Si.almostEquals(o,Math.round(o),g/1e3)?Math.round(o):Math.ceil(o),n=Math.round(n*i)/i,s=Math.round(s*i)/i,a.push(gs(u)?n:u);for(var m=1;m<o;++m)a.push(Math.round((n+m*g)*i)/i);return a.push(gs(c)?s:c),a}function ne(t,e,i){var n=[i.type,void 0===e&&void 0===i.stack?i.index:"",i.stack].join(".");return void 0===t[n]&&(t[n]={pos:[],neg:[]}),t[n]}function se(t,e,i,n){var s,o,a=t.options,r=a.stacked,l=ne(e,r,i),h=l.pos,u=l.neg,c=n.length;for(s=0;s<c;++s)o=t._parseValue(n[s]),isNaN(o.min)||isNaN(o.max)||i.data[s].hidden||(h[s]=h[s]||0,u[s]=u[s]||0,a.relativePoints?h[s]=100:o.min<0||o.max<0?u[s]+=o.min:h[s]+=o.max)}function oe(t,e,i){var n,s,o=i.length;for(n=0;n<o;++n)s=t._parseValue(i[n]),isNaN(s.min)||isNaN(s.max)||e.data[n].hidden||(t.min=Math.min(t.min,s.min),t.max=Math.max(t.max,s.max))}function ae(t,e){var i,n,s=[],o=ys(t.min,Math.pow(10,Math.floor(xs(e.min)))),a=Math.floor(xs(e.max)),r=Math.ceil(e.max/Math.pow(10,a));0===o?(i=Math.floor(xs(e.minNotZero)),n=Math.floor(e.minNotZero/Math.pow(10,i)),s.push(o),o=n*Math.pow(10,i)):(i=Math.floor(xs(o)),n=Math.floor(o/Math.pow(10,i)));var l=i<0?Math.pow(10,Math.abs(i)):1;do{s.push(o),++n,10===n&&(n=1,++i,l=i>=0?1:l),o=Math.round(n*Math.pow(10,i)*l)/l}while(i<a||i===a&&n<r);var h=ys(t.max,o);return s.push(h),s}function re(t,e){return Si.isFinite(t)&&t>=0?t:e}function le(t){var e=t.ticks;return e.display&&t.display?Ds(e.fontSize,mi.global.defaultFontSize)+2*e.backdropPaddingY:0}function he(t,e,i){return Si.isArray(i)?{w:Si.longestText(t,t.font,i),h:i.length*e}:{w:t.measureText(i).width,h:e}}function ue(t,e,i,n,s){return t===n||t===s?{start:e-i/2,end:e+i/2}:t<n||t>s?{start:e-i,end:e}:{start:e,end:e+i}}function ce(t){var e,i,n,s=Si.options._parseFont(t.options.pointLabels),o={l:0,r:t.width,t:0,b:t.height-t.paddingTop},a={};t.ctx.font=s.string,t._pointLabelSizes=[];var r=t.chart.data.labels.length;for(e=0;e<r;e++){n=t.getPointPosition(e,t.drawingArea+5),i=he(t.ctx,s.lineHeight,t.pointLabels[e]),t._pointLabelSizes[e]=i;var l=t.getIndexAngle(e),h=Si.toDegrees(l)%360,u=ue(h,n.x,i.w,0,180),c=ue(h,n.y,i.h,90,270);u.start<o.l&&(o.l=u.start,a.l=l),u.end>o.r&&(o.r=u.end,a.r=l),c.start<o.t&&(o.t=c.start,a.t=l),c.end>o.b&&(o.b=c.end,a.b=l)}t.setReductions(t.drawingArea,o,a)}function de(t){return 0===t||180===t?"center":t<180?"left":"right"}function fe(t,e,i,n){var s,o,a=i.y+n/2;if(Si.isArray(e))for(s=0,o=e.length;s<o;++s)t.fillText(e[s],i.x,a),a+=n;else t.fillText(e,i.x,a)}function pe(t,e,i){90===t||270===t?i.y-=e.h/2:(t>270||t<90)&&(i.y-=e.h)}function ge(t){var e=t.ctx,i=t.options,n=i.pointLabels,s=le(i),o=t.getDistanceFromCenterForValue(i.ticks.reverse?t.min:t.max),a=Si.options._parseFont(n);e.save(),e.font=a.string,e.textBaseline="middle";for(var r=t.chart.data.labels.length-1;r>=0;r--){var l=0===r?s/2:0,h=t.getPointPosition(r,o+l+5),u=Ms(n.fontColor,r,mi.global.defaultFontColor);e.fillStyle=u;var c=t.getIndexAngle(r),d=Si.toDegrees(c);e.textAlign=de(d),pe(d,t._pointLabelSizes[r],h),fe(e,t.pointLabels[r],h,a.lineHeight)}e.restore()}function me(t,e,i,n){
var s,o=t.ctx,a=e.circular,r=t.chart.data.labels.length,l=Ms(e.color,n-1),h=Ms(e.lineWidth,n-1);if((a||r)&&l&&h){if(o.save(),o.strokeStyle=l,o.lineWidth=h,o.setLineDash&&(o.setLineDash(e.borderDash||[]),o.lineDashOffset=e.borderDashOffset||0),o.beginPath(),a)o.arc(t.xCenter,t.yCenter,i,0,2*Math.PI);else{s=t.getPointPosition(0,i),o.moveTo(s.x,s.y);for(var u=1;u<r;u++)s=t.getPointPosition(u,i),o.lineTo(s.x,s.y)}o.closePath(),o.stroke(),o.restore()}}function ve(t){return Si.isNumber(t)?t:0}function be(t,e){return t-e}function _e(t){var e,i,n,s={},o=[];for(e=0,i=t.length;e<i;++e)n=t[e],s[n]||(s[n]=!0,o.push(n));return o}function ye(t){return Si.valueOrDefault(t.time.min,t.ticks.min)}function xe(t){return Si.valueOrDefault(t.time.max,t.ticks.max)}function we(t,e,i,n){if("linear"===n||!t.length)return[{time:e,pos:0},{time:i,pos:1}];var s,o,a,r,l,h=[],u=[e];for(s=0,o=t.length;s<o;++s)(r=t[s])>e&&r<i&&u.push(r);for(u.push(i),s=0,o=u.length;s<o;++s)l=u[s+1],a=u[s-1],r=u[s],void 0!==a&&void 0!==l&&Math.round((l+a)/2)===r||h.push({time:r,pos:s/(o-1)});return h}function ke(t,e,i){for(var n,s,o,a=0,r=t.length-1;a>=0&&a<=r;){if(n=a+r>>1,s=t[n-1]||null,o=t[n],!s)return{lo:null,hi:o};if(o[e]<i)a=n+1;else{if(!(s[e]>i))return{lo:s,hi:o};r=n-1}}return{lo:o,hi:null}}function Ce(t,e,i,n){var s=ke(t,e,i),o=s.lo?s.hi?s.lo:t[t.length-2]:t[0],a=s.lo?s.hi?s.hi:t[t.length-1]:t[1],r=a[e]-o[e],l=r?(i-o[e])/r:0,h=(a[n]-o[n])*l;return o[n]+h}function De(t,e){var i=t._adapter,n=t.options.time,s=n.parser,o=s||n.format,a=e;return"function"==typeof s&&(a=s(a)),Si.isFinite(a)||(a="string"==typeof o?i.parse(a,o):i.parse(a)),null!==a?+a:(s||"function"!=typeof o||(a=o(e),Si.isFinite(a)||(a=i.parse(a))),a)}function Me(t,e){if(Si.isNullOrUndef(e))return null;var i=t.options.time,n=De(t,t.getRightValue(e));return null===n?n:(i.round&&(n=+t._adapter.startOf(n,i.round)),n)}function Se(t,e,i,n){var s,o,a,r=Ls.length;for(s=Ls.indexOf(t);s<r-1;++s)if(o=zs[Ls[s]],a=o.steps?o.steps:Ns,o.common&&Math.ceil((i-e)/(a*o.size))<=n)return Ls[s];return Ls[r-1]}function Te(t,e,i,n,s){var o,a;for(o=Ls.length-1;o>=Ls.indexOf(i);o--)if(a=Ls[o],zs[a].common&&t._adapter.diff(s,n,a)>=e-1)return a;return Ls[i?Ls.indexOf(i):0]}function Ie(t){for(var e=Ls.indexOf(t)+1,i=Ls.length;e<i;++e)if(zs[Ls[e]].common)return Ls[e]}function Pe(t,e,i,n){var s,o=t._adapter,a=t.options,r=a.time,l=r.unit||Se(r.minUnit,e,i,n),h=Fs([r.stepSize,r.unitStepSize,1]),u="week"===l&&r.isoWeekday,c=e,d=[];if(u&&(c=+o.startOf(c,"isoWeek",u)),c=+o.startOf(c,u?"day":l),o.diff(i,e,l)>1e5*h)throw e+" and "+i+" are too far apart with stepSize of "+h+" "+l;for(s=c;s<i;s=+o.add(s,h,l))d.push(s);return s!==i&&"ticks"!==a.bounds||d.push(s),d}function Ae(t,e,i,n,s){var o,a,r=0,l=0;return s.offset&&e.length&&(o=Ce(t,"time",e[0],"pos"),r=1===e.length?1-o:(Ce(t,"time",e[1],"pos")-o)/2,a=Ce(t,"time",e[e.length-1],"pos"),l=1===e.length?a:(a-Ce(t,"time",e[e.length-2],"pos"))/2),{start:r,end:l,factor:1/(r+1+l)}}function Fe(t,e,i,n){var s,o,a=t._adapter,r=+a.startOf(e[0].value,n),l=e[e.length-1].value;for(s=r;s<=l;s=+a.add(s,1,n))(o=i[s])>=0&&(e[o].major=!0);return e}function Oe(t,e,i){var n,s,o=[],a={},r=e.length;for(n=0;n<r;++n)s=e[n],a[s]=n,o.push({value:s,major:!1});return 0!==r&&i?Fe(t,o,a,i):o}function Ee(t,e,i){var n,s=t._model||{},o=s.fill;if(void 0===o&&(o=!!s.backgroundColor),!1===o||null===o)return!1;if(!0===o)return"origin";if(n=parseFloat(o,10),isFinite(n)&&Math.floor(n)===n)return"-"!==o[0]&&"+"!==o[0]||(n=e+n),!(n===e||n<0||n>=i)&&n;switch(o){case"bottom":return"start";case"top":return"end";case"zero":return"origin";case"origin":case"start":case"end":return o;default:return!1}}function Ne(t){var e,i=t.el._model||{},n=t.el._scale||{},s=t.fill,o=null;if(isFinite(s))return null;if("start"===s?o=void 0===i.scaleBottom?n.bottom:i.scaleBottom:"end"===s?o=void 0===i.scaleTop?n.top:i.scaleTop:void 0!==i.scaleZero?o=i.scaleZero:n.getBasePixel&&(o=n.getBasePixel()),void 0!==o&&null!==o){if(void 0!==o.x&&void 0!==o.y)return o;if(Si.isFinite(o))return e=n.isHorizontal(),{x:e?o:null,y:e?null:o}}return null}function ze(t){var e,i,n,s,o,a=t.el._scale,r=a.options,l=a.chart.data.labels.length,h=t.fill,u=[];if(!l)return null;for(e=r.ticks.reverse?a.max:a.min,i=r.ticks.reverse?a.min:a.max,n=a.getPointPositionForValue(0,e),s=0;s<l;++s)o="start"===h||"end"===h?a.getPointPositionForValue(s,"start"===h?e:i):a.getBasePosition(s),r.gridLines.circular&&(o.cx=n.x,o.cy=n.y,o.angle=a.getIndexAngle(s)-Math.PI/2),u.push(o);return u}function Le(t){return(t.el._scale||{}).getPointPositionForValue?ze(t):Ne(t)}function He(t,e,i){var n,s=t[e],o=s.fill,a=[e];if(!i)return o;for(;!1!==o&&-1===a.indexOf(o);){if(!isFinite(o))return o;if(!(n=t[o]))return!1;if(n.visible)return o;a.push(o),o=n.fill}return!1}function Re(t){var e=t.fill,i="dataset";return!1===e?null:(isFinite(e)||(i="boundary"),Us[i](t))}function We(t){return t&&!t.skip}function Be(t,e,i,n,s){var o,a,r,l;if(n&&s){for(t.moveTo(e[0].x,e[0].y),o=1;o<n;++o)Si.canvas.lineTo(t,e[o-1],e[o]);if(void 0===i[0].angle)for(t.lineTo(i[s-1].x,i[s-1].y),o=s-1;o>0;--o)Si.canvas.lineTo(t,i[o],i[o-1],!0);else for(a=i[0].cx,r=i[0].cy,l=Math.sqrt(Math.pow(i[0].x-a,2)+Math.pow(i[0].y-r,2)),o=s-1;o>0;--o)t.arc(a,r,l,i[o].angle,i[o-1].angle,!0)}}function Ve(t,e,i,n,s,o){var a,r,l,h,u,c,d,f,p=e.length,g=n.spanGaps,m=[],v=[],b=0,_=0;for(t.beginPath(),a=0,r=p;a<r;++a)l=a%p,h=e[l]._view,u=i(h,l,n),c=We(h),d=We(u),o&&void 0===f&&c&&(f=a+1,r=p+f),c&&d?(b=m.push(h),_=v.push(u)):b&&_&&(g?(c&&m.push(h),d&&v.push(u)):(Be(t,m,v,b,_),b=_=0,m=[],v=[]));Be(t,m,v,b,_),t.closePath(),t.fillStyle=s,t.fill()}function Ue(t,e){return t.usePointStyle&&t.boxWidth>e?e:t.boxWidth}function je(t,e){var i=new Ks({ctx:t.ctx,options:e,chart:t});In.configure(t,i,e),In.addBox(t,i),t.legend=i}function Ye(t,e){var i=new Qs({ctx:t.ctx,options:e,chart:t});In.configure(t,i,e),In.addBox(t,i),t.titleBlock=i}t=t&&t.hasOwnProperty("default")?t.default:t;var qe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},$e=function(t,e){return e={exports:{}},t(e,e.exports),e.exports}(function(t){function e(t,e){return Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2)}var i={};for(var n in qe)qe.hasOwnProperty(n)&&(i[qe[n]]=n);var s=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var o in s)if(s.hasOwnProperty(o)){if(!("channels"in s[o]))throw new Error("missing channels property: "+o);if(!("labels"in s[o]))throw new Error("missing channel labels property: "+o);if(s[o].labels.length!==s[o].channels)throw new Error("channel and label counts mismatch: "+o);var a=s[o].channels,r=s[o].labels;delete s[o].channels,delete s[o].labels,Object.defineProperty(s[o],"channels",{value:a}),Object.defineProperty(s[o],"labels",{value:r})}s.rgb.hsl=function(t){var e,i,n,s=t[0]/255,o=t[1]/255,a=t[2]/255,r=Math.min(s,o,a),l=Math.max(s,o,a),h=l-r;return l===r?e=0:s===l?e=(o-a)/h:o===l?e=2+(a-s)/h:a===l&&(e=4+(s-o)/h),e=Math.min(60*e,360),e<0&&(e+=360),n=(r+l)/2,i=l===r?0:n<=.5?h/(l+r):h/(2-l-r),[e,100*i,100*n]},s.rgb.hsv=function(t){var e,i,n,s,o,a=t[0]/255,r=t[1]/255,l=t[2]/255,h=Math.max(a,r,l),u=h-Math.min(a,r,l),c=function(t){return(h-t)/6/u+.5};return 0===u?s=o=0:(o=u/h,e=c(a),i=c(r),n=c(l),a===h?s=n-i:r===h?s=1/3+e-n:l===h&&(s=2/3+i-e),s<0?s+=1:s>1&&(s-=1)),[360*s,100*o,100*h]},s.rgb.hwb=function(t){var e=t[0],i=t[1],n=t[2],o=s.rgb.hsl(t)[0],a=1/255*Math.min(e,Math.min(i,n));return n=1-1/255*Math.max(e,Math.max(i,n)),[o,100*a,100*n]},s.rgb.cmyk=function(t){var e,i,n,s,o=t[0]/255,a=t[1]/255,r=t[2]/255;return s=Math.min(1-o,1-a,1-r),e=(1-o-s)/(1-s)||0,i=(1-a-s)/(1-s)||0,n=(1-r-s)/(1-s)||0,[100*e,100*i,100*n,100*s]},s.rgb.keyword=function(t){var n=i[t];if(n)return n;var s,o=1/0;for(var a in qe)if(qe.hasOwnProperty(a)){var r=qe[a],l=e(t,r);l<o&&(o=l,s=a)}return s},s.keyword.rgb=function(t){return qe[t]},s.rgb.xyz=function(t){var e=t[0]/255,i=t[1]/255,n=t[2]/255;return e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,n=n>.04045?Math.pow((n+.055)/1.055,2.4):n/12.92,[100*(.4124*e+.3576*i+.1805*n),100*(.2126*e+.7152*i+.0722*n),100*(.0193*e+.1192*i+.9505*n)]},s.rgb.lab=function(t){var e,i,n,o=s.rgb.xyz(t),a=o[0],r=o[1],l=o[2];return a/=95.047,r/=100,l/=108.883,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,r=r>.008856?Math.pow(r,1/3):7.787*r+16/116,l=l>.008856?Math.pow(l,1/3):7.787*l+16/116,e=116*r-16,i=500*(a-r),n=200*(r-l),[e,i,n]},s.hsl.rgb=function(t){var e,i,n,s,o,a=t[0]/360,r=t[1]/100,l=t[2]/100;if(0===r)return o=255*l,[o,o,o];i=l<.5?l*(1+r):l+r-l*r,e=2*l-i,s=[0,0,0];for(var h=0;h<3;h++)n=a+1/3*-(h-1),n<0&&n++,n>1&&n--,o=6*n<1?e+6*(i-e)*n:2*n<1?i:3*n<2?e+(i-e)*(2/3-n)*6:e,s[h]=255*o;return s},s.hsl.hsv=function(t){var e,i,n=t[0],s=t[1]/100,o=t[2]/100,a=s,r=Math.max(o,.01);return o*=2,s*=o<=1?o:2-o,a*=r<=1?r:2-r,i=(o+s)/2,e=0===o?2*a/(r+a):2*s/(o+s),[n,100*e,100*i]},s.hsv.rgb=function(t){var e=t[0]/60,i=t[1]/100,n=t[2]/100,s=Math.floor(e)%6,o=e-Math.floor(e),a=255*n*(1-i),r=255*n*(1-i*o),l=255*n*(1-i*(1-o));switch(n*=255,s){case 0:return[n,l,a];case 1:return[r,n,a];case 2:return[a,n,l];case 3:return[a,r,n];case 4:return[l,a,n];case 5:return[n,a,r]}},s.hsv.hsl=function(t){var e,i,n,s=t[0],o=t[1]/100,a=t[2]/100,r=Math.max(a,.01);return n=(2-o)*a,e=(2-o)*r,i=o*r,i/=e<=1?e:2-e,i=i||0,n/=2,[s,100*i,100*n]},s.hwb.rgb=function(t){var e,i,n,s,o=t[0]/360,a=t[1]/100,r=t[2]/100,l=a+r;l>1&&(a/=l,r/=l),e=Math.floor(6*o),i=1-r,n=6*o-e,0!=(1&e)&&(n=1-n),s=a+n*(i-a);var h,u,c;switch(e){default:case 6:case 0:h=i,u=s,c=a;break;case 1:h=s,u=i,c=a;break;case 2:h=a,u=i,c=s;break;case 3:h=a,u=s,c=i;break;case 4:h=s,u=a,c=i;break;case 5:h=i,u=a,c=s}return[255*h,255*u,255*c]},s.cmyk.rgb=function(t){var e,i,n,s=t[0]/100,o=t[1]/100,a=t[2]/100,r=t[3]/100;return e=1-Math.min(1,s*(1-r)+r),i=1-Math.min(1,o*(1-r)+r),n=1-Math.min(1,a*(1-r)+r),[255*e,255*i,255*n]},s.xyz.rgb=function(t){var e,i,n,s=t[0]/100,o=t[1]/100,a=t[2]/100;return e=3.2406*s+-1.5372*o+-.4986*a,i=-.9689*s+1.8758*o+.0415*a,n=.0557*s+-.204*o+1.057*a,e=e>.0031308?1.055*Math.pow(e,1/2.4)-.055:12.92*e,i=i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i,n=n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n,e=Math.min(Math.max(0,e),1),i=Math.min(Math.max(0,i),1),n=Math.min(Math.max(0,n),1),[255*e,255*i,255*n]},s.xyz.lab=function(t){var e,i,n,s=t[0],o=t[1],a=t[2];return s/=95.047,o/=100,a/=108.883,s=s>.008856?Math.pow(s,1/3):7.787*s+16/116,o=o>.008856?Math.pow(o,1/3):7.787*o+16/116,a=a>.008856?Math.pow(a,1/3):7.787*a+16/116,e=116*o-16,i=500*(s-o),n=200*(o-a),[e,i,n]},s.lab.xyz=function(t){var e,i,n,s=t[0],o=t[1],a=t[2];i=(s+16)/116,e=o/500+i,n=i-a/200;var r=Math.pow(i,3),l=Math.pow(e,3),h=Math.pow(n,3);return i=r>.008856?r:(i-16/116)/7.787,e=l>.008856?l:(e-16/116)/7.787,n=h>.008856?h:(n-16/116)/7.787,e*=95.047,i*=100,n*=108.883,[e,i,n]},s.lab.lch=function(t){var e,i,n,s=t[0],o=t[1],a=t[2];return e=Math.atan2(a,o),i=360*e/2/Math.PI,i<0&&(i+=360),n=Math.sqrt(o*o+a*a),[s,n,i]},s.lch.lab=function(t){var e,i,n,s=t[0],o=t[1],a=t[2];return n=a/360*2*Math.PI,e=o*Math.cos(n),i=o*Math.sin(n),[s,e,i]},s.rgb.ansi16=function(t){var e=t[0],i=t[1],n=t[2],o=1 in arguments?arguments[1]:s.rgb.hsv(t)[2];if(0===(o=Math.round(o/50)))return 30;var a=30+(Math.round(n/255)<<2|Math.round(i/255)<<1|Math.round(e/255));return 2===o&&(a+=60),a},s.hsv.ansi16=function(t){return s.rgb.ansi16(s.hsv.rgb(t),t[2])},s.rgb.ansi256=function(t){var e=t[0],i=t[1],n=t[2];return e===i&&i===n?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(i/255*5)+Math.round(n/255*5)},s.ansi16.rgb=function(t){var e=t%10;if(0===e||7===e)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];var i=.5*(1+~~(t>50));return[(1&e)*i*255,(e>>1&1)*i*255,(e>>2&1)*i*255]},s.ansi256.rgb=function(t){if(t>=232){var e=10*(t-232)+8;return[e,e,e]}t-=16;var i;return[Math.floor(t/36)/5*255,Math.floor((i=t%36)/6)/5*255,i%6/5*255]},s.rgb.hex=function(t){var e=((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2])),i=e.toString(16).toUpperCase();return"000000".substring(i.length)+i},s.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var i=e[0];3===e[0].length&&(i=i.split("").map(function(t){return t+t}).join(""));var n=parseInt(i,16);return[n>>16&255,n>>8&255,255&n]},s.rgb.hcg=function(t){var e,i,n=t[0]/255,s=t[1]/255,o=t[2]/255,a=Math.max(Math.max(n,s),o),r=Math.min(Math.min(n,s),o),l=a-r;return e=l<1?r/(1-l):0,i=l<=0?0:a===n?(s-o)/l%6:a===s?2+(o-n)/l:4+(n-s)/l+4,i/=6,i%=1,[360*i,100*l,100*e]},s.hsl.hcg=function(t){var e=t[1]/100,i=t[2]/100,n=1,s=0;return n=i<.5?2*e*i:2*e*(1-i),n<1&&(s=(i-.5*n)/(1-n)),[t[0],100*n,100*s]},s.hsv.hcg=function(t){var e=t[1]/100,i=t[2]/100,n=e*i,s=0;return n<1&&(s=(i-n)/(1-n)),[t[0],100*n,100*s]},s.hcg.rgb=function(t){var e=t[0]/360,i=t[1]/100,n=t[2]/100;if(0===i)return[255*n,255*n,255*n];var s=[0,0,0],o=e%1*6,a=o%1,r=1-a,l=0;switch(Math.floor(o)){case 0:s[0]=1,s[1]=a,s[2]=0;break;case 1:s[0]=r,s[1]=1,s[2]=0;break;case 2:s[0]=0,s[1]=1,s[2]=a;break;case 3:s[0]=0,s[1]=r,s[2]=1;break;case 4:s[0]=a,s[1]=0,s[2]=1;break;default:s[0]=1,s[1]=0,s[2]=r}return l=(1-i)*n,[255*(i*s[0]+l),255*(i*s[1]+l),255*(i*s[2]+l)]},s.hcg.hsv=function(t){var e=t[1]/100,i=t[2]/100,n=e+i*(1-e),s=0;return n>0&&(s=e/n),[t[0],100*s,100*n]},s.hcg.hsl=function(t){var e=t[1]/100,i=t[2]/100,n=i*(1-e)+.5*e,s=0;return n>0&&n<.5?s=e/(2*n):n>=.5&&n<1&&(s=e/(2*(1-n))),[t[0],100*s,100*n]},s.hcg.hwb=function(t){var e=t[1]/100,i=t[2]/100,n=e+i*(1-e);return[t[0],100*(n-e),100*(1-n)]},s.hwb.hcg=function(t){var e=t[1]/100,i=t[2]/100,n=1-i,s=n-e,o=0;return s<1&&(o=(n-s)/(1-s)),[t[0],100*s,100*o]},s.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]},s.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]},s.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]},s.gray.hsl=s.gray.hsv=function(t){return[0,0,t[0]]},s.gray.hwb=function(t){return[0,100,t[0]]},s.gray.cmyk=function(t){return[0,0,0,t[0]]},s.gray.lab=function(t){return[t[0],0,0]},s.gray.hex=function(t){var e=255&Math.round(t[0]/100*255),i=(e<<16)+(e<<8)+e,n=i.toString(16).toUpperCase();return"000000".substring(n.length)+n},s.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}}),Ke=($e.rgb,$e.hsl,$e.hsv,$e.hwb,$e.cmyk,$e.xyz,$e.lab,$e.lch,$e.hex,$e.keyword,$e.ansi16,$e.ansi256,$e.hcg,$e.apple,$e.gray,function(t){for(var e=i(t),n={},o=Object.keys(e),a=o.length,r=0;r<a;r++){var l=o[r];null!==e[l].parent&&(n[l]=s(l,e))}return n}),Xe={};Object.keys($e).forEach(function(t){Xe[t]={},Object.defineProperty(Xe[t],"channels",{value:$e[t].channels}),Object.defineProperty(Xe[t],"labels",{value:$e[t].labels});var e=Ke(t);Object.keys(e).forEach(function(i){var n=e[i];Xe[t][i]=a(n),Xe[t][i].raw=o(n)})});var Ge=Xe,Qe={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},Ze={getRgba:r,getHsla:l,getRgb:u,getHsl:c,getHwb:h,getAlpha:d,hexString:f,rgbString:p,rgbaString:g,percentString:m,percentaString:v,hslString:b,hslaString:_,hwbString:y,keyword:x},Je={};for(var ti in Qe)Je[Qe[ti]]=ti;var ei=function(t){if(t instanceof ei)return t;if(!(this instanceof ei))return new ei(t);this.valid=!1,this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1};var e;"string"==typeof t?(e=Ze.getRgba(t),e?this.setValues("rgb",e):(e=Ze.getHsla(t))?this.setValues("hsl",e):(e=Ze.getHwb(t))&&this.setValues("hwb",e)):"object"==typeof t&&(e=t,void 0!==e.r||void 0!==e.red?this.setValues("rgb",e):void 0!==e.l||void 0!==e.lightness?this.setValues("hsl",e):void 0!==e.v||void 0!==e.value?this.setValues("hsv",e):void 0!==e.w||void 0!==e.whiteness?this.setValues("hwb",e):void 0===e.c&&void 0===e.cyan||this.setValues("cmyk",e))};ei.prototype={isValid:function(){return this.valid},rgb:function(){return this.setSpace("rgb",arguments)},hsl:function(){return this.setSpace("hsl",arguments)},hsv:function(){return this.setSpace("hsv",arguments)},hwb:function(){return this.setSpace("hwb",arguments)},cmyk:function(){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){var t=this.values;return 1!==t.alpha?t.hwb.concat([t.alpha]):t.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values;return t.rgb.concat([t.alpha])},hslaArray:function(){var t=this.values;return t.hsl.concat([t.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return t&&(t%=360,t=t<0?360+t:t),this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return Ze.hexString(this.values.rgb)},rgbString:function(){return Ze.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return Ze.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return Ze.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return Ze.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return Ze.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return Ze.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return Ze.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){var t=this.values.rgb;return t[0]<<16|t[1]<<8|t[2]},luminosity:function(){for(var t=this.values.rgb,e=[],i=0;i<t.length;i++){var n=t[i]/255;e[i]=n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}return.2126*e[0]+.7152*e[1]+.0722*e[2]},contrast:function(t){var e=this.luminosity(),i=t.luminosity();return e>i?(e+.05)/(i+.05):(i+.05)/(e+.05)},level:function(t){var e=this.contrast(t);return e>=7.1?"AAA":e>=4.5?"AA":""},dark:function(){var t=this.values.rgb;return(299*t[0]+587*t[1]+114*t[2])/1e3<128},light:function(){return!this.dark()},negate:function(){for(var t=[],e=0;e<3;e++)t[e]=255-this.values.rgb[e];return this.setValues("rgb",t),this},lighten:function(t){var e=this.values.hsl;return e[2]+=e[2]*t,this.setValues("hsl",e),this},darken:function(t){var e=this.values.hsl;return e[2]-=e[2]*t,this.setValues("hsl",e),this},saturate:function(t){var e=this.values.hsl;return e[1]+=e[1]*t,this.setValues("hsl",e),this},desaturate:function(t){var e=this.values.hsl;return e[1]-=e[1]*t,this.setValues("hsl",e),this},whiten:function(t){var e=this.values.hwb;return e[1]+=e[1]*t,this.setValues("hwb",e),this},blacken:function(t){var e=this.values.hwb;return e[2]+=e[2]*t,this.setValues("hwb",e),this},greyscale:function(){var t=this.values.rgb,e=.3*t[0]+.59*t[1]+.11*t[2];return this.setValues("rgb",[e,e,e]),this},clearer:function(t){var e=this.values.alpha;return this.setValues("alpha",e-e*t),this},opaquer:function(t){var e=this.values.alpha;return this.setValues("alpha",e+e*t),this},rotate:function(t){var e=this.values.hsl,i=(e[0]+t)%360;return e[0]=i<0?360+i:i,this.setValues("hsl",e),this},mix:function(t,e){var i=this,n=t,s=void 0===e?.5:e,o=2*s-1,a=i.alpha()-n.alpha(),r=((o*a==-1?o:(o+a)/(1+o*a))+1)/2,l=1-r;return this.rgb(r*i.red()+l*n.red(),r*i.green()+l*n.green(),r*i.blue()+l*n.blue()).alpha(i.alpha()*s+n.alpha()*(1-s))},toJSON:function(){return this.rgb()},clone:function(){var t,e,i=new ei,n=this.values,s=i.values;for(var o in n)n.hasOwnProperty(o)&&(t=n[o],e={}.toString.call(t),"[object Array]"===e?s[o]=t.slice(0):"[object Number]"===e?s[o]=t:console.error("unexpected color value:",t));return i}},ei.prototype.spaces={rgb:["red","green","blue"],hsl:["hue","saturation","lightness"],hsv:["hue","saturation","value"],hwb:["hue","whiteness","blackness"],cmyk:["cyan","magenta","yellow","black"]},ei.prototype.maxes={rgb:[255,255,255],hsl:[360,100,100],hsv:[360,100,100],hwb:[360,100,100],cmyk:[100,100,100,100]},ei.prototype.getValues=function(t){for(var e=this.values,i={},n=0;n<t.length;n++)i[t.charAt(n)]=e[t][n];return 1!==e.alpha&&(i.a=e.alpha),i},ei.prototype.setValues=function(t,e){var i,n=this.values,s=this.spaces,o=this.maxes,a=1;if(this.valid=!0,"alpha"===t)a=e;else if(e.length)n[t]=e.slice(0,t.length),a=e[t.length];else if(void 0!==e[t.charAt(0)]){for(i=0;i<t.length;i++)n[t][i]=e[t.charAt(i)];a=e.a}else if(void 0!==e[s[t][0]]){var r=s[t];for(i=0;i<t.length;i++)n[t][i]=e[r[i]];a=e.alpha}if(n.alpha=Math.max(0,Math.min(1,void 0===a?n.alpha:a)),"alpha"===t)return!1;var l;for(i=0;i<t.length;i++)l=Math.max(0,Math.min(o[t][i],n[t][i])),n[t][i]=Math.round(l);for(var h in s)h!==t&&(n[h]=Ge[t][h](n[t]));return!0},ei.prototype.setSpace=function(t,e){var i=e[0];return void 0===i?this.getValues(t):("number"==typeof i&&(i=Array.prototype.slice.call(e)),this.setValues(t,i),this)},ei.prototype.setChannel=function(t,e,i){var n=this.values[t];return void 0===i?n[e]:i===n[e]?this:(n[e]=i,this.setValues(t,n),this)},"undefined"!=typeof window&&(window.Color=ei);var ii=ei,ni={noop:function(){},uid:function(){var t=0;return function(){return t++}}(),isNullOrUndef:function(t){return null===t||void 0===t},isArray:function(t){if(Array.isArray&&Array.isArray(t))return!0;var e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)},isObject:function(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)},isFinite:function(t){return("number"==typeof t||t instanceof Number)&&isFinite(t)},valueOrDefault:function(t,e){return void 0===t?e:t},valueAtIndexOrDefault:function(t,e,i){return ni.valueOrDefault(ni.isArray(t)?t[e]:t,i)},callback:function(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)},each:function(t,e,i,n){var s,o,a;if(ni.isArray(t))if(o=t.length,n)for(s=o-1;s>=0;s--)e.call(i,t[s],s);else for(s=0;s<o;s++)e.call(i,t[s],s);else if(ni.isObject(t))for(a=Object.keys(t),o=a.length,s=0;s<o;s++)e.call(i,t[a[s]],a[s])},arrayEquals:function(t,e){var i,n,s,o;if(!t||!e||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;++i)if(s=t[i],o=e[i],s instanceof Array&&o instanceof Array){if(!ni.arrayEquals(s,o))return!1}else if(s!==o)return!1;return!0},clone:function(t){if(ni.isArray(t))return t.map(ni.clone);if(ni.isObject(t)){for(var e=Object.create(t),i=Object.keys(t),n=i.length,s=0;s<n;++s)e[i[s]]=ni.clone(t[i[s]]);return e}return t},_merger:function(t,e,i,n){if(C(t)){var s=e[t],o=i[t];ni.isObject(s)&&ni.isObject(o)?ni.merge(s,o,n):e[t]=ni.clone(o)}},_mergerIf:function(t,e,i){if(C(t)){var n=e[t],s=i[t];ni.isObject(n)&&ni.isObject(s)?ni.mergeIf(n,s):e.hasOwnProperty(t)||(e[t]=ni.clone(s))}},merge:function(t,e,i){var n,s,o,a,r,l=ni.isArray(e)?e:[e],h=l.length;if(!ni.isObject(t))return t;for(i=i||{},n=i.merger||ni._merger,s=0;s<h;++s)if(e=l[s],ni.isObject(e))for(o=Object.keys(e),r=0,a=o.length;r<a;++r)n(o[r],t,e,i);return t},mergeIf:function(t,e){return ni.merge(t,e,{merger:ni._mergerIf})},extend:Object.assign||function(t){return ni.merge(t,[].slice.call(arguments,1),{merger:function(t,e,i){e[t]=i[t]}})},inherits:function(t){var e=this,i=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return e.apply(this,arguments)},n=function(){this.constructor=i};return n.prototype=e.prototype,i.prototype=new n,i.extend=ni.inherits,t&&ni.extend(i.prototype,t),i.__super__=e.prototype,i},_deprecated:function(t,e,i,n){void 0!==e&&console.warn(t+': "'+i+'" is deprecated. Please use "'+n+'" instead')}},si=ni;ni.callCallback=ni.callback,ni.indexOf=function(t,e,i){return Array.prototype.indexOf.call(t,e,i)},ni.getValueOrDefault=ni.valueOrDefault,ni.getValueAtIndexOrDefault=ni.valueAtIndexOrDefault;var oi={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return(t-=1)*t*t+1},easeInOutCubic:function(t){return(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},easeInQuart:function(t){return t*t*t*t},easeOutQuart:function(t){return-((t-=1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return t*t*t*t*t},easeOutQuint:function(t){return(t-=1)*t*t*t*t+1},easeInOutQuint:function(t){return(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},easeInSine:function(t){return 1-Math.cos(t*(Math.PI/2))},easeOutSine:function(t){return Math.sin(t*(Math.PI/2))},easeInOutSine:function(t){return-.5*(Math.cos(Math.PI*t)-1)},
easeInExpo:function(t){return 0===t?0:Math.pow(2,10*(t-1))},easeOutExpo:function(t){return 1===t?1:1-Math.pow(2,-10*t)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(2-Math.pow(2,-10*--t))},easeInCirc:function(t){return t>=1?t:-(Math.sqrt(1-t*t)-1)},easeOutCirc:function(t){return Math.sqrt(1-(t-=1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:1===t?1:(i||(i=.3),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),-n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i))},easeOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:1===t?1:(i||(i=.3),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),n*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/i)+1)},easeInOutElastic:function(t){var e=1.70158,i=0,n=1;return 0===t?0:2==(t/=.5)?1:(i||(i=.45),n<1?(n=1,e=i/4):e=i/(2*Math.PI)*Math.asin(1/n),t<1?n*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*-.5:n*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/i)*.5+1)},easeInBack:function(t){var e=1.70158;return t*t*((e+1)*t-e)},easeOutBack:function(t){var e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack:function(t){var e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:function(t){return 1-oi.easeOutBounce(1-t)},easeOutBounce:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},easeInOutBounce:function(t){return t<.5?.5*oi.easeInBounce(2*t):.5*oi.easeOutBounce(2*t-1)+.5}},ai={effects:oi};si.easingEffects=oi;var ri=Math.PI,li=ri/180,hi=2*ri,ui=ri/2,ci=ri/4,di=2*ri/3,fi={clear:function(t){t.ctx.clearRect(0,0,t.width,t.height)},roundedRect:function(t,e,i,n,s,o){if(o){var a=Math.min(o,s/2,n/2),r=e+a,l=i+a,h=e+n-a,u=i+s-a;t.moveTo(e,l),r<h&&l<u?(t.arc(r,l,a,-ri,-ui),t.arc(h,l,a,-ui,0),t.arc(h,u,a,0,ui),t.arc(r,u,a,ui,ri)):r<h?(t.moveTo(r,i),t.arc(h,l,a,-ui,ui),t.arc(r,l,a,ui,ri+ui)):l<u?(t.arc(r,l,a,-ri,0),t.arc(r,u,a,0,ri)):t.arc(r,l,a,-ri,ri),t.closePath(),t.moveTo(e,i)}else t.rect(e,i,n,s)},drawPoint:function(t,e,i,n,s,o){var a,r,l,h,u,c=(o||0)*li;if(e&&"object"==typeof e&&("[object HTMLImageElement]"===(a=e.toString())||"[object HTMLCanvasElement]"===a))return t.save(),t.translate(n,s),t.rotate(c),t.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),void t.restore();if(!(isNaN(i)||i<=0)){switch(t.beginPath(),e){default:t.arc(n,s,i,0,hi),t.closePath();break;case"triangle":t.moveTo(n+Math.sin(c)*i,s-Math.cos(c)*i),c+=di,t.lineTo(n+Math.sin(c)*i,s-Math.cos(c)*i),c+=di,t.lineTo(n+Math.sin(c)*i,s-Math.cos(c)*i),t.closePath();break;case"rectRounded":u=.516*i,h=i-u,r=Math.cos(c+ci)*h,l=Math.sin(c+ci)*h,t.arc(n-r,s-l,u,c-ri,c-ui),t.arc(n+l,s-r,u,c-ui,c),t.arc(n+r,s+l,u,c,c+ui),t.arc(n-l,s+r,u,c+ui,c+ri),t.closePath();break;case"rect":if(!o){h=Math.SQRT1_2*i,t.rect(n-h,s-h,2*h,2*h);break}c+=ci;case"rectRot":r=Math.cos(c)*i,l=Math.sin(c)*i,t.moveTo(n-r,s-l),t.lineTo(n+l,s-r),t.lineTo(n+r,s+l),t.lineTo(n-l,s+r),t.closePath();break;case"crossRot":c+=ci;case"cross":r=Math.cos(c)*i,l=Math.sin(c)*i,t.moveTo(n-r,s-l),t.lineTo(n+r,s+l),t.moveTo(n+l,s-r),t.lineTo(n-l,s+r);break;case"star":r=Math.cos(c)*i,l=Math.sin(c)*i,t.moveTo(n-r,s-l),t.lineTo(n+r,s+l),t.moveTo(n+l,s-r),t.lineTo(n-l,s+r),c+=ci,r=Math.cos(c)*i,l=Math.sin(c)*i,t.moveTo(n-r,s-l),t.lineTo(n+r,s+l),t.moveTo(n+l,s-r),t.lineTo(n-l,s+r);break;case"line":r=Math.cos(c)*i,l=Math.sin(c)*i,t.moveTo(n-r,s-l),t.lineTo(n+r,s+l);break;case"dash":t.moveTo(n,s),t.lineTo(n+Math.cos(c)*i,s+Math.sin(c)*i)}t.fill(),t.stroke()}},_isPointInArea:function(t,e){return t.x>e.left-1e-6&&t.x<e.right+1e-6&&t.y>e.top-1e-6&&t.y<e.bottom+1e-6},clipArea:function(t,e){t.save(),t.beginPath(),t.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),t.clip()},unclipArea:function(t){t.restore()},lineTo:function(t,e,i,n){var s=i.steppedLine;if(s){if("middle"===s){var o=(e.x+i.x)/2;t.lineTo(o,n?i.y:e.y),t.lineTo(o,n?e.y:i.y)}else"after"===s&&!n||"after"!==s&&n?t.lineTo(e.x,i.y):t.lineTo(i.x,e.y);return void t.lineTo(i.x,i.y)}if(!i.tension)return void t.lineTo(i.x,i.y);t.bezierCurveTo(n?e.controlPointPreviousX:e.controlPointNextX,n?e.controlPointPreviousY:e.controlPointNextY,n?i.controlPointNextX:i.controlPointPreviousX,n?i.controlPointNextY:i.controlPointPreviousY,i.x,i.y)}},pi=fi;si.clear=fi.clear,si.drawRoundedRectangle=function(t){t.beginPath(),fi.roundedRect.apply(fi,arguments)};var gi={_set:function(t,e){return si.merge(this[t]||(this[t]={}),e)}};gi._set("global",{defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFontStyle:"normal",defaultLineHeight:1.2,showLines:!0});var mi=gi,vi=si.valueOrDefault,bi={toLineHeight:function(t,e){var i=(""+t).match(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t},toPadding:function(t){var e,i,n,s;return si.isObject(t)?(e=+t.top||0,i=+t.right||0,n=+t.bottom||0,s=+t.left||0):e=i=n=s=+t||0,{top:e,right:i,bottom:n,left:s,height:e+n,width:s+i}},_parseFont:function(t){var e=mi.global,i=vi(t.fontSize,e.defaultFontSize),n={family:vi(t.fontFamily,e.defaultFontFamily),lineHeight:si.options.toLineHeight(vi(t.lineHeight,e.defaultLineHeight),i),size:i,style:vi(t.fontStyle,e.defaultFontStyle),weight:null,string:""};return n.string=D(n),n},resolve:function(t,e,i,n){var s,o,a,r=!0;for(s=0,o=t.length;s<o;++s)if(void 0!==(a=t[s])&&(void 0!==e&&"function"==typeof a&&(a=a(e),r=!1),void 0!==i&&si.isArray(a)&&(a=a[i],r=!1),void 0!==a))return n&&!r&&(n.cacheable=!1),a}},_i={_factorize:function(t){var e,i=[],n=Math.sqrt(t);for(e=1;e<n;e++)t%e==0&&(i.push(e),i.push(t/e));return n===(0|n)&&i.push(n),i.sort(function(t,e){return t-e}).pop(),i},log10:Math.log10||function(t){var e=Math.log(t)*Math.LOG10E,i=Math.round(e);return t===Math.pow(10,i)?i:e}},yi=_i;si.log10=_i.log10;var xi=function(t,e){return{x:function(i){return t+t+e-i},setWidth:function(t){e=t},textAlign:function(t){return"center"===t?t:"right"===t?"left":"right"},xPlus:function(t,e){return t-e},leftForLtr:function(t,e){return t-e}}},wi=function(){return{x:function(t){return t},setWidth:function(t){},textAlign:function(t){return t},xPlus:function(t,e){return t+e},leftForLtr:function(t,e){return t}}},ki=function(t,e,i){return t?xi(e,i):wi()},Ci=function(t,e){var i,n;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,n=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=n)},Di=function(t){var e=t.prevTextDirection;void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))},Mi={getRtlAdapter:ki,overrideTextDirection:Ci,restoreTextDirection:Di},Si=si,Ti=ai,Ii=pi,Pi=bi,Ai=yi,Fi=Mi;Si.easing=Ti,Si.canvas=Ii,Si.options=Pi,Si.math=Ai,Si.rtl=Fi;var Oi=function(t){Si.extend(this,t),this.initialize.apply(this,arguments)};Si.extend(Oi.prototype,{_type:void 0,initialize:function(){this.hidden=!1},pivot:function(){var t=this;return t._view||(t._view=Si.extend({},t._model)),t._start={},t},transition:function(t){var e=this,i=e._model,n=e._start,s=e._view;return i&&1!==t?(s||(s=e._view={}),n||(n=e._start={}),M(n,s,i,t),e):(e._view=Si.extend({},i),e._start=null,e)},tooltipPosition:function(){return{x:this._model.x,y:this._model.y}},hasValue:function(){return Si.isNumber(this._model.x)&&Si.isNumber(this._model.y)}}),Oi.extend=Si.inherits;var Ei=Oi,Ni=Ei.extend({chart:null,currentStep:0,numSteps:60,easing:"",render:null,onAnimationProgress:null,onAnimationComplete:null}),zi=Ni;Object.defineProperty(Ni.prototype,"animationObject",{get:function(){return this}}),Object.defineProperty(Ni.prototype,"chartInstance",{get:function(){return this.chart},set:function(t){this.chart=t}}),mi._set("global",{animation:{duration:1e3,easing:"easeOutQuart",onProgress:Si.noop,onComplete:Si.noop}});var Li={animations:[],request:null,addAnimation:function(t,e,i,n){var s,o,a=this.animations;for(e.chart=t,e.startTime=Date.now(),e.duration=i,n||(t.animating=!0),s=0,o=a.length;s<o;++s)if(a[s].chart===t)return void(a[s]=e);a.push(e),1===a.length&&this.requestAnimationFrame()},cancelAnimation:function(t){var e=Si.findIndex(this.animations,function(e){return e.chart===t});-1!==e&&(this.animations.splice(e,1),t.animating=!1)},requestAnimationFrame:function(){var t=this;null===t.request&&(t.request=Si.requestAnimFrame.call(window,function(){t.request=null,t.startDigest()}))},startDigest:function(){var t=this;t.advance(),t.animations.length>0&&t.requestAnimationFrame()},advance:function(){for(var t,e,i,n,s=this.animations,o=0;o<s.length;)t=s[o],e=t.chart,i=t.numSteps,n=Math.floor((Date.now()-t.startTime)/t.duration*i)+1,t.currentStep=Math.min(n,i),Si.callback(t.render,[e,t],e),Si.callback(t.onAnimationProgress,[t],e),t.currentStep>=i?(Si.callback(t.onAnimationComplete,[t],e),e.animating=!1,s.splice(o,1)):++o}},Hi=Si.options.resolve,Ri=["push","pop","shift","splice","unshift"],Wi=function(t,e){this.initialize(t,e)};Si.extend(Wi.prototype,{datasetElementType:null,dataElementType:null,_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth"],_dataElementOptions:["backgroundColor","borderColor","borderWidth","pointStyle"],initialize:function(t,e){var i=this;i.chart=t,i.index=e,i.linkScales(),i.addElements(),i._type=i.getMeta().type},updateIndex:function(t){this.index=t},linkScales:function(){var t=this,e=t.getMeta(),i=t.chart,n=i.scales,s=t.getDataset(),o=i.options.scales;null!==e.xAxisID&&e.xAxisID in n&&!s.xAxisID||(e.xAxisID=s.xAxisID||o.xAxes[0].id),null!==e.yAxisID&&e.yAxisID in n&&!s.yAxisID||(e.yAxisID=s.yAxisID||o.yAxes[0].id)},getDataset:function(){return this.chart.data.datasets[this.index]},getMeta:function(){return this.chart.getDatasetMeta(this.index)},getScaleForId:function(t){return this.chart.scales[t]},_getValueScaleId:function(){return this.getMeta().yAxisID},_getIndexScaleId:function(){return this.getMeta().xAxisID},_getValueScale:function(){return this.getScaleForId(this._getValueScaleId())},_getIndexScale:function(){return this.getScaleForId(this._getIndexScaleId())},reset:function(){this._update(!0)},destroy:function(){this._data&&T(this._data,this)},createMetaDataset:function(){var t=this,e=t.datasetElementType;return e&&new e({_chart:t.chart,_datasetIndex:t.index})},createMetaData:function(t){var e=this,i=e.dataElementType;return i&&new i({_chart:e.chart,_datasetIndex:e.index,_index:t})},addElements:function(){var t,e,i=this,n=i.getMeta(),s=i.getDataset().data||[],o=n.data;for(t=0,e=s.length;t<e;++t)o[t]=o[t]||i.createMetaData(t);n.dataset=n.dataset||i.createMetaDataset()},addElementAndReset:function(t){var e=this.createMetaData(t);this.getMeta().data.splice(t,0,e),this.updateElement(e,t,!0)},buildOrUpdateElements:function(){var t=this,e=t.getDataset(),i=e.data||(e.data=[]);t._data!==i&&(t._data&&T(t._data,t),i&&Object.isExtensible(i)&&S(i,t),t._data=i),t.resyncElements()},_configure:function(){var t=this;t._config=Si.merge(Object.create(null),[t.chart.options.datasets[t._type],t.getDataset()],{merger:function(t,e,i){"_meta"!==t&&"data"!==t&&Si._merger(t,e,i)}})},_update:function(t){var e=this;e._configure(),e._cachedDataOpts=null,e.update(t)},update:Si.noop,transition:function(t){for(var e=this.getMeta(),i=e.data||[],n=i.length,s=0;s<n;++s)i[s].transition(t);e.dataset&&e.dataset.transition(t)},draw:function(){var t=this.getMeta(),e=t.data||[],i=e.length,n=0;for(t.dataset&&t.dataset.draw();n<i;++n)e[n].draw()},getStyle:function(t){var e,i=this,n=i.getMeta(),s=n.dataset;return i._configure(),s&&void 0===t?e=i._resolveDatasetElementOptions(s||{}):(t=t||0,e=i._resolveDataElementOptions(n.data[t]||{},t)),!1!==e.fill&&null!==e.fill||(e.backgroundColor=e.borderColor),e},_resolveDatasetElementOptions:function(t,e){var i,n,s,o,a=this,r=a.chart,l=a._config,h=t.custom||{},u=r.options.elements[a.datasetElementType.prototype._type]||{},c=a._datasetElementOptions,d={},f={chart:r,dataset:a.getDataset(),datasetIndex:a.index,hover:e};for(i=0,n=c.length;i<n;++i)s=c[i],o=e?"hover"+s.charAt(0).toUpperCase()+s.slice(1):s,d[s]=Hi([h[o],l[o],u[o]],f);return d},_resolveDataElementOptions:function(t,e){var i=this,n=t&&t.custom,s=i._cachedDataOpts;if(s&&!n)return s;var o,a,r,l,h=i.chart,u=i._config,c=h.options.elements[i.dataElementType.prototype._type]||{},d=i._dataElementOptions,f={},p={chart:h,dataIndex:e,dataset:i.getDataset(),datasetIndex:i.index},g={cacheable:!n};if(n=n||{},Si.isArray(d))for(a=0,r=d.length;a<r;++a)l=d[a],f[l]=Hi([n[l],u[l],c[l]],p,e,g);else for(o=Object.keys(d),a=0,r=o.length;a<r;++a)l=o[a],f[l]=Hi([n[l],u[d[l]],u[l],c[l]],p,e,g);return g.cacheable&&(i._cachedDataOpts=Object.freeze(f)),f},removeHoverStyle:function(t){Si.merge(t._model,t.$previousStyle||{}),delete t.$previousStyle},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],i=t._index,n=t.custom||{},s=t._model,o=Si.getHoverColor;t.$previousStyle={backgroundColor:s.backgroundColor,borderColor:s.borderColor,borderWidth:s.borderWidth},s.backgroundColor=Hi([n.hoverBackgroundColor,e.hoverBackgroundColor,o(s.backgroundColor)],void 0,i),s.borderColor=Hi([n.hoverBorderColor,e.hoverBorderColor,o(s.borderColor)],void 0,i),s.borderWidth=Hi([n.hoverBorderWidth,e.hoverBorderWidth,s.borderWidth],void 0,i)},_removeDatasetHoverStyle:function(){var t=this.getMeta().dataset;t&&this.removeHoverStyle(t)},_setDatasetHoverStyle:function(){var t,e,i,n,s,o,a=this.getMeta().dataset,r={};if(a){for(o=a._model,s=this._resolveDatasetElementOptions(a,!0),n=Object.keys(s),t=0,e=n.length;t<e;++t)i=n[t],r[i]=o[i],o[i]=s[i];a.$previousStyle=r}},resyncElements:function(){var t=this,e=t.getMeta(),i=t.getDataset().data,n=e.data.length,s=i.length;s<n?e.data.splice(s,n-s):s>n&&t.insertElements(n,s-n)},insertElements:function(t,e){for(var i=0;i<e;++i)this.addElementAndReset(t+i)},onDataPush:function(){var t=arguments.length;this.insertElements(this.getDataset().data.length-t,t)},onDataPop:function(){this.getMeta().data.pop()},onDataShift:function(){this.getMeta().data.shift()},onDataSplice:function(t,e){this.getMeta().data.splice(t,e),this.insertElements(t,arguments.length-2)},onDataUnshift:function(){this.insertElements(0,arguments.length)}}),Wi.extend=Si.inherits;var Bi=Wi,Vi=2*Math.PI;mi._set("global",{elements:{arc:{backgroundColor:mi.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var Ui=Ei.extend({_type:"arc",inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)<Math.pow(e.radius+e.hoverRadius,2)},inRange:function(t,e){var i=this._view;if(i){for(var n=Si.getAngleFromPoint(i,{x:t,y:e}),s=n.angle,o=n.distance,a=i.startAngle,r=i.endAngle;r<a;)r+=Vi;for(;s>r;)s-=Vi;for(;s<a;)s+=Vi;var l=s>=a&&s<=r,h=o>=i.innerRadius&&o<=i.outerRadius;return l&&h}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,i=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,i=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},draw:function(){var t,e=this._chart.ctx,i=this._view,n="inner"===i.borderAlign?.33:0,s={x:i.x,y:i.y,innerRadius:i.innerRadius,outerRadius:Math.max(i.outerRadius-n,0),pixelMargin:n,startAngle:i.startAngle,endAngle:i.endAngle,fullCircles:Math.floor(i.circumference/Vi)};if(e.save(),e.fillStyle=i.backgroundColor,e.strokeStyle=i.borderColor,s.fullCircles){for(s.endAngle=s.startAngle+Vi,e.beginPath(),e.arc(s.x,s.y,s.outerRadius,s.startAngle,s.endAngle),e.arc(s.x,s.y,s.innerRadius,s.endAngle,s.startAngle,!0),e.closePath(),t=0;t<s.fullCircles;++t)e.fill();s.endAngle=s.startAngle+i.circumference%Vi}e.beginPath(),e.arc(s.x,s.y,s.outerRadius,s.startAngle,s.endAngle),e.arc(s.x,s.y,s.innerRadius,s.endAngle,s.startAngle,!0),e.closePath(),e.fill(),i.borderWidth&&A(e,i,s),e.restore()}}),ji=Si.valueOrDefault,Yi=mi.global.defaultColor;mi._set("global",{elements:{line:{tension:.4,backgroundColor:Yi,borderWidth:3,borderColor:Yi,borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",capBezierPoints:!0,fill:!0}}});var qi=Ei.extend({_type:"line",draw:function(){var t,e,i,n=this,s=n._view,o=n._chart.ctx,a=s.spanGaps,r=n._children.slice(),l=mi.global,h=l.elements.line,u=-1,c=n._loop;if(r.length){if(n._loop){for(t=0;t<r.length;++t)if(e=Si.previousItem(r,t),!r[t]._view.skip&&e._view.skip){r=r.slice(t).concat(r.slice(0,t)),c=a;break}c&&r.push(r[0])}for(o.save(),o.lineCap=s.borderCapStyle||h.borderCapStyle,o.setLineDash&&o.setLineDash(s.borderDash||h.borderDash),o.lineDashOffset=ji(s.borderDashOffset,h.borderDashOffset),o.lineJoin=s.borderJoinStyle||h.borderJoinStyle,o.lineWidth=ji(s.borderWidth,h.borderWidth),o.strokeStyle=s.borderColor||l.defaultColor,o.beginPath(),i=r[0]._view,i.skip||(o.moveTo(i.x,i.y),u=0),t=1;t<r.length;++t)i=r[t]._view,e=-1===u?Si.previousItem(r,t):r[u],i.skip||(u!==t-1&&!a||-1===u?o.moveTo(i.x,i.y):Si.canvas.lineTo(o,e._view,i),u=t);c&&o.closePath(),o.stroke(),o.restore()}}}),$i=Si.valueOrDefault,Ki=mi.global.defaultColor;mi._set("global",{elements:{point:{radius:3,pointStyle:"circle",backgroundColor:Ki,borderColor:Ki,borderWidth:1,hitRadius:1,hoverRadius:4,hoverBorderWidth:1}}});var Xi=Ei.extend({_type:"point",inRange:function(t,e){var i=this._view;return!!i&&Math.pow(t-i.x,2)+Math.pow(e-i.y,2)<Math.pow(i.hitRadius+i.radius,2)},inLabelRange:F,inXRange:F,inYRange:O,getCenterPoint:function(){var t=this._view;return{x:t.x,y:t.y}},getArea:function(){return Math.PI*Math.pow(this._view.radius,2)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y,padding:t.radius+t.borderWidth}},draw:function(t){var e=this._view,i=this._chart.ctx,n=e.pointStyle,s=e.rotation,o=e.radius,a=e.x,r=e.y,l=mi.global,h=l.defaultColor;e.skip||(void 0===t||Si.canvas._isPointInArea(e,t))&&(i.strokeStyle=e.borderColor||h,i.lineWidth=$i(e.borderWidth,l.elements.point.borderWidth),i.fillStyle=e.backgroundColor||h,Si.canvas.drawPoint(i,n,o,a,r,s))}}),Gi=mi.global.defaultColor;mi._set("global",{elements:{rectangle:{backgroundColor:Gi,borderColor:Gi,borderSkipped:"bottom",borderWidth:0}}});var Qi=Ei.extend({_type:"rectangle",draw:function(){var t=this._chart.ctx,e=this._view,i=R(e),n=i.outer,s=i.inner;t.fillStyle=e.backgroundColor,t.fillRect(n.x,n.y,n.w,n.h),n.w===s.w&&n.h===s.h||(t.save(),t.beginPath(),t.rect(n.x,n.y,n.w,n.h),t.clip(),t.fillStyle=e.borderColor,t.rect(s.x,s.y,s.w,s.h),t.fill("evenodd"),t.restore())},height:function(){var t=this._view;return t.base-t.y},inRange:function(t,e){return W(this._view,t,e)},inLabelRange:function(t,e){var i=this._view;return E(i)?W(i,t,null):W(i,null,e)},inXRange:function(t){return W(this._view,t,null)},inYRange:function(t){return W(this._view,null,t)},getCenterPoint:function(){var t,e,i=this._view;return E(i)?(t=i.x,e=(i.y+i.base)/2):(t=(i.x+i.base)/2,e=i.y),{x:t,y:e}},getArea:function(){var t=this._view;return E(t)?t.width*Math.abs(t.y-t.base):t.height*Math.abs(t.x-t.base)},tooltipPosition:function(){var t=this._view;return{x:t.x,y:t.y}}}),Zi={},Ji=Ui,tn=qi,en=Xi,nn=Qi;Zi.Arc=Ji,Zi.Line=tn,Zi.Point=en,Zi.Rectangle=nn;var sn=Si._deprecated,on=Si.valueOrDefault;mi._set("bar",{hover:{mode:"label"},scales:{xAxes:[{type:"category",offset:!0,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}}),mi._set("global",{datasets:{bar:{categoryPercentage:.8,barPercentage:.9}}});var an=Bi.extend({dataElementType:Zi.Rectangle,_dataElementOptions:["backgroundColor","borderColor","borderSkipped","borderWidth","barPercentage","barThickness","categoryPercentage","maxBarThickness","minBarLength"],initialize:function(){var t,e,i=this;Bi.prototype.initialize.apply(i,arguments),t=i.getMeta(),t.stack=i.getDataset().stack,t.bar=!0,e=i._getIndexScale().options,sn("bar chart",e.barPercentage,"scales.[x/y]Axes.barPercentage","dataset.barPercentage"),sn("bar chart",e.barThickness,"scales.[x/y]Axes.barThickness","dataset.barThickness"),sn("bar chart",e.categoryPercentage,"scales.[x/y]Axes.categoryPercentage","dataset.categoryPercentage"),sn("bar chart",i._getValueScale().options.minBarLength,"scales.[x/y]Axes.minBarLength","dataset.minBarLength"),sn("bar chart",e.maxBarThickness,"scales.[x/y]Axes.maxBarThickness","dataset.maxBarThickness")},update:function(t){var e,i,n=this,s=n.getMeta().data;for(n._ruler=n.getRuler(),e=0,i=s.length;e<i;++e)n.updateElement(s[e],e,t)},updateElement:function(t,e,i){var n=this,s=n.getMeta(),o=n.getDataset(),a=n._resolveDataElementOptions(t,e);t._xScale=n.getScaleForId(s.xAxisID),t._yScale=n.getScaleForId(s.yAxisID),t._datasetIndex=n.index,t._index=e,t._model={backgroundColor:a.backgroundColor,borderColor:a.borderColor,borderSkipped:a.borderSkipped,borderWidth:a.borderWidth,datasetLabel:o.label,label:n.chart.data.labels[e]},Si.isArray(o.data[e])&&(t._model.borderSkipped=null),n._updateElementGeometry(t,e,i,a),t.pivot()},_updateElementGeometry:function(t,e,i,n){var s=this,o=t._model,a=s._getValueScale(),r=a.getBasePixel(),l=a.isHorizontal(),h=s._ruler||s.getRuler(),u=s.calculateBarValuePixels(s.index,e,n),c=s.calculateBarIndexPixels(s.index,e,h,n);o.horizontal=l,o.base=i?r:u.base,o.x=l?i?r:u.head:c.center,o.y=l?c.center:i?r:u.head,o.height=l?c.size:void 0,o.width=l?void 0:c.size},_getStacks:function(t){var e,i,n=this,s=n._getIndexScale(),o=s._getMatchingVisibleMetas(n._type),a=s.options.stacked,r=o.length,l=[];for(e=0;e<r&&(i=o[e],(!1===a||-1===l.indexOf(i.stack)||void 0===a&&void 0===i.stack)&&l.push(i.stack),i.index!==t);++e);return l},getStackCount:function(){return this._getStacks().length},getStackIndex:function(t,e){var i=this._getStacks(t),n=void 0!==e?i.indexOf(e):-1;return-1===n?i.length-1:n},getRuler:function(){var t,e,i=this,n=i._getIndexScale(),s=[];for(t=0,e=i.getMeta().data.length;t<e;++t)s.push(n.getPixelForValue(null,t,i.index));return{pixels:s,start:n._startPixel,end:n._endPixel,stackCount:i.getStackCount(),scale:n}},calculateBarValuePixels:function(t,e,i){var n,s,o,a,r,l,h,u=this,c=u.chart,d=u._getValueScale(),f=d.isHorizontal(),p=c.data.datasets,g=d._getMatchingVisibleMetas(u._type),m=d._parseValue(p[t].data[e]),v=i.minBarLength,b=d.options.stacked,_=u.getMeta().stack,y=void 0===m.start?0:m.max>=0&&m.min>=0?m.min:m.max,x=void 0===m.start?m.end:m.max>=0&&m.min>=0?m.max-m.min:m.min-m.max,w=g.length;if(b||void 0===b&&void 0!==_)for(n=0;n<w&&(s=g[n],s.index!==t);++n)s.stack===_&&(h=d._parseValue(p[s.index].data[e]),o=void 0===h.start?h.end:h.min>=0&&h.max>=0?h.max:h.min,(m.min<0&&o<0||m.max>=0&&o>0)&&(y+=o));return a=d.getPixelForValue(y),r=d.getPixelForValue(y+x),l=r-a,void 0!==v&&Math.abs(l)<v&&(l=v,r=x>=0&&!f||x<0&&f?a-v:a+v),{size:l,base:a,head:r,center:r+l/2}},calculateBarIndexPixels:function(t,e,i,n){var s=this,o="flex"===n.barThickness?U(e,i,n):V(e,i,n),a=s.getStackIndex(t,s.getMeta().stack),r=o.start+o.chunk*a+o.chunk/2,l=Math.min(on(n.maxBarThickness,1/0),o.chunk*o.ratio);return{base:r-l/2,head:r+l/2,center:r,size:l}},draw:function(){var t=this,e=t.chart,i=t._getValueScale(),n=t.getMeta().data,s=t.getDataset(),o=n.length,a=0;for(Si.canvas.clipArea(e.ctx,e.chartArea);a<o;++a){var r=i._parseValue(s.data[a]);isNaN(r.min)||isNaN(r.max)||n[a].draw()}Si.canvas.unclipArea(e.ctx)},_resolveDataElementOptions:function(){var t=this,e=Si.extend({},Bi.prototype._resolveDataElementOptions.apply(t,arguments)),i=t._getIndexScale().options,n=t._getValueScale().options;return e.barPercentage=on(i.barPercentage,e.barPercentage),e.barThickness=on(i.barThickness,e.barThickness),e.categoryPercentage=on(i.categoryPercentage,e.categoryPercentage),e.maxBarThickness=on(i.maxBarThickness,e.maxBarThickness),e.minBarLength=on(n.minBarLength,e.minBarLength),e}}),rn=Si.valueOrDefault,ln=Si.options.resolve;mi._set("bubble",{hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-0"}],yAxes:[{type:"linear",position:"left",id:"y-axis-0"}]},tooltips:{callbacks:{title:function(){return""},label:function(t,e){var i=e.datasets[t.datasetIndex].label||"",n=e.datasets[t.datasetIndex].data[t.index];return i+": ("+t.xLabel+", "+t.yLabel+", "+n.r+")"}}}});var hn=Bi.extend({dataElementType:Zi.Point,_dataElementOptions:["backgroundColor","borderColor","borderWidth","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth","hoverRadius","hitRadius","pointStyle","rotation"],update:function(t){var e=this,i=e.getMeta(),n=i.data;Si.each(n,function(i,n){e.updateElement(i,n,t)})},updateElement:function(t,e,i){var n=this,s=n.getMeta(),o=t.custom||{},a=n.getScaleForId(s.xAxisID),r=n.getScaleForId(s.yAxisID),l=n._resolveDataElementOptions(t,e),h=n.getDataset().data[e],u=n.index,c=i?a.getPixelForDecimal(.5):a.getPixelForValue("object"==typeof h?h:NaN,e,u),d=i?r.getBasePixel():r.getPixelForValue(h,e,u);t._xScale=a,t._yScale=r,t._options=l,t._datasetIndex=u,t._index=e,t._model={backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,hitRadius:l.hitRadius,pointStyle:l.pointStyle,rotation:l.rotation,radius:i?0:l.radius,skip:o.skip||isNaN(c)||isNaN(d),x:c,y:d},t.pivot()},setHoverStyle:function(t){var e=t._model,i=t._options,n=Si.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=rn(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=rn(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=rn(i.hoverBorderWidth,i.borderWidth),e.radius=i.radius+i.hoverRadius},_resolveDataElementOptions:function(t,e){var i=this,n=i.chart,s=i.getDataset(),o=t.custom||{},a=s.data[e]||{},r=Bi.prototype._resolveDataElementOptions.apply(i,arguments),l={chart:n,dataIndex:e,dataset:s,datasetIndex:i.index};return i._cachedDataOpts===r&&(r=Si.extend({},r)),r.radius=ln([o.radius,a.r,i._config.radius,n.options.elements.point.radius],l,e),r}}),un=Si.valueOrDefault,cn=Math.PI,dn=2*cn,fn=cn/2;mi._set("doughnut",{animation:{animateRotate:!0,animateScale:!1},hover:{mode:"single"},legendCallback:function(t){var e,i,n,s,o=document.createElement("ul"),a=t.data,r=a.datasets,l=a.labels;if(o.setAttribute("class",t.id+"-legend"),r.length)for(e=0,i=r[0].data.length;e<i;++e)n=o.appendChild(document.createElement("li")),s=n.appendChild(document.createElement("span")),s.style.backgroundColor=r[0].backgroundColor[e],l[e]&&n.appendChild(document.createTextNode(l[e]));return o.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(i,n){var s=t.getDatasetMeta(0),o=s.controller.getStyle(n);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,hidden:isNaN(e.datasets[0].data[n])||s.data[n].hidden,index:n}}):[]}},onClick:function(t,e){var i,n,s,o=e.index,a=this.chart;for(i=0,n=(a.data.datasets||[]).length;i<n;++i)s=a.getDatasetMeta(i),s.data[o]&&(s.data[o].hidden=!s.data[o].hidden);a.update()}},cutoutPercentage:50,rotation:-fn,circumference:dn,tooltips:{callbacks:{title:function(){return""},label:function(t,e){var i=e.labels[t.index],n=": "+e.datasets[t.datasetIndex].data[t.index];return Si.isArray(i)?(i=i.slice(),i[0]+=n):i+=n,i}}}});var pn=Bi.extend({dataElementType:Zi.Arc,linkScales:Si.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],getRingIndex:function(t){for(var e=0,i=0;i<t;++i)this.chart.isDatasetVisible(i)&&++e;return e},update:function(t){var e,i,n,s,o=this,a=o.chart,r=a.chartArea,l=a.options,h=1,u=1,c=0,d=0,f=o.getMeta(),p=f.data,g=l.cutoutPercentage/100||0,m=l.circumference,v=o._getRingWeight(o.index);if(m<dn){var b=l.rotation%dn;b+=b>=cn?-dn:b<-cn?dn:0;var _=b+m,y=Math.cos(b),x=Math.sin(b),w=Math.cos(_),k=Math.sin(_),C=b<=0&&_>=0||_>=dn,D=b<=fn&&_>=fn||_>=dn+fn,M=b===-cn||_>=cn,S=b<=-fn&&_>=-fn||_>=cn+fn,T=M?-1:Math.min(y,y*g,w,w*g),I=S?-1:Math.min(x,x*g,k,k*g),P=C?1:Math.max(y,y*g,w,w*g),A=D?1:Math.max(x,x*g,k,k*g);h=(P-T)/2,u=(A-I)/2,c=-(P+T)/2,d=-(A+I)/2}for(n=0,s=p.length;n<s;++n)p[n]._options=o._resolveDataElementOptions(p[n],n);for(a.borderWidth=o.getMaxBorderWidth(),e=(r.right-r.left-a.borderWidth)/h,i=(r.bottom-r.top-a.borderWidth)/u,a.outerRadius=Math.max(Math.min(e,i)/2,0),a.innerRadius=Math.max(a.outerRadius*g,0),a.radiusLength=(a.outerRadius-a.innerRadius)/(o._getVisibleDatasetWeightTotal()||1),a.offsetX=c*a.outerRadius,a.offsetY=d*a.outerRadius,f.total=o.calculateTotal(),o.outerRadius=a.outerRadius-a.radiusLength*o._getRingWeightOffset(o.index),o.innerRadius=Math.max(o.outerRadius-a.radiusLength*v,0),n=0,s=p.length;n<s;++n)o.updateElement(p[n],n,t)},updateElement:function(t,e,i){var n=this,s=n.chart,o=s.chartArea,a=s.options,r=a.animation,l=(o.left+o.right)/2,h=(o.top+o.bottom)/2,u=a.rotation,c=a.rotation,d=n.getDataset(),f=i&&r.animateRotate?0:t.hidden?0:n.calculateCircumference(d.data[e])*(a.circumference/dn),p=i&&r.animateScale?0:n.innerRadius,g=i&&r.animateScale?0:n.outerRadius,m=t._options||{};Si.extend(t,{_datasetIndex:n.index,_index:e,_model:{backgroundColor:m.backgroundColor,borderColor:m.borderColor,borderWidth:m.borderWidth,borderAlign:m.borderAlign,x:l+s.offsetX,y:h+s.offsetY,startAngle:u,endAngle:c,circumference:f,outerRadius:g,innerRadius:p,label:Si.valueAtIndexOrDefault(d.label,e,s.data.labels[e])}});var v=t._model;i&&r.animateRotate||(v.startAngle=0===e?a.rotation:n.getMeta().data[e-1]._model.endAngle,v.endAngle=v.startAngle+v.circumference),t.pivot()},calculateTotal:function(){var t,e=this.getDataset(),i=this.getMeta(),n=0;return Si.each(i.data,function(i,s){t=e.data[s],isNaN(t)||i.hidden||(n+=Math.abs(t))}),n},calculateCircumference:function(t){var e=this.getMeta().total;return e>0&&!isNaN(t)?dn*(Math.abs(t)/e):0},getMaxBorderWidth:function(t){var e,i,n,s,o,a,r,l,h=this,u=0,c=h.chart;if(!t)for(e=0,i=c.data.datasets.length;e<i;++e)if(c.isDatasetVisible(e)){n=c.getDatasetMeta(e),t=n.data,e!==h.index&&(o=n.controller);break}if(!t)return 0;for(e=0,i=t.length;e<i;++e)s=t[e],o?(o._configure(),a=o._resolveDataElementOptions(s,e)):a=s._options,"inner"!==a.borderAlign&&(r=a.borderWidth,l=a.hoverBorderWidth,u=r>u?r:u,u=l>u?l:u);return u},setHoverStyle:function(t){var e=t._model,i=t._options,n=Si.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=un(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=un(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=un(i.hoverBorderWidth,i.borderWidth)},_getRingWeightOffset:function(t){for(var e=0,i=0;i<t;++i)this.chart.isDatasetVisible(i)&&(e+=this._getRingWeight(i));return e},_getRingWeight:function(t){return Math.max(un(this.chart.data.datasets[t].weight,1),0)},_getVisibleDatasetWeightTotal:function(){return this._getRingWeightOffset(this.chart.data.datasets.length)}});mi._set("horizontalBar",{hover:{mode:"index",axis:"y"},scales:{xAxes:[{type:"linear",position:"bottom"}],yAxes:[{type:"category",position:"left",offset:!0,gridLines:{offsetGridLines:!0}}]},elements:{rectangle:{borderSkipped:"left"}},tooltips:{mode:"index",axis:"y"}}),mi._set("global",{datasets:{horizontalBar:{categoryPercentage:.8,barPercentage:.9}}});var gn=an.extend({_getValueScaleId:function(){return this.getMeta().xAxisID},_getIndexScaleId:function(){return this.getMeta().yAxisID}}),mn=Si.valueOrDefault,vn=Si.options.resolve,bn=Si.canvas._isPointInArea;mi._set("line",{showLines:!0,spanGaps:!1,hover:{mode:"label"},scales:{xAxes:[{type:"category",id:"x-axis-0"}],yAxes:[{type:"linear",id:"y-axis-0"}]}});var _n=Bi.extend({datasetElementType:Zi.Line,dataElementType:Zi.Point,
_datasetElementOptions:["backgroundColor","borderCapStyle","borderColor","borderDash","borderDashOffset","borderJoinStyle","borderWidth","cubicInterpolationMode","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},update:function(t){var e,i,n=this,s=n.getMeta(),o=s.dataset,a=s.data||[],r=n.chart.options,l=n._config,h=n._showLine=mn(l.showLine,r.showLines);for(n._xScale=n.getScaleForId(s.xAxisID),n._yScale=n.getScaleForId(s.yAxisID),h&&(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),o._scale=n._yScale,o._datasetIndex=n.index,o._children=a,o._model=n._resolveDatasetElementOptions(o),o.pivot()),e=0,i=a.length;e<i;++e)n.updateElement(a[e],e,t);for(h&&0!==o._model.tension&&n.updateBezierControlPoints(),e=0,i=a.length;e<i;++e)a[e].pivot()},updateElement:function(t,e,i){var n,s,o=this,a=o.getMeta(),r=t.custom||{},l=o.getDataset(),h=o.index,u=l.data[e],c=o._xScale,d=o._yScale,f=a.dataset._model,p=o._resolveDataElementOptions(t,e);n=c.getPixelForValue("object"==typeof u?u:NaN,e,h),s=i?d.getBasePixel():o.calculatePointY(u,e,h),t._xScale=c,t._yScale=d,t._options=p,t._datasetIndex=h,t._index=e,t._model={x:n,y:s,skip:r.skip||isNaN(n)||isNaN(s),radius:p.radius,pointStyle:p.pointStyle,rotation:p.rotation,backgroundColor:p.backgroundColor,borderColor:p.borderColor,borderWidth:p.borderWidth,tension:mn(r.tension,f?f.tension:0),steppedLine:!!f&&f.steppedLine,hitRadius:p.hitRadius}},_resolveDatasetElementOptions:function(t){var e=this,i=e._config,n=t.custom||{},s=e.chart.options,o=s.elements.line,a=Bi.prototype._resolveDatasetElementOptions.apply(e,arguments);return a.spanGaps=mn(i.spanGaps,s.spanGaps),a.tension=mn(i.lineTension,o.tension),a.steppedLine=vn([n.steppedLine,i.steppedLine,o.stepped]),a.clip=q(mn(i.clip,Y(e._xScale,e._yScale,a.borderWidth))),a},calculatePointY:function(t,e,i){var n,s,o,a,r,l,h,u=this,c=u.chart,d=u._yScale,f=0,p=0;if(d.options.stacked){for(r=+d.getRightValue(t),l=c._getSortedVisibleDatasetMetas(),h=l.length,n=0;n<h&&(o=l[n],o.index!==i);++n)s=c.data.datasets[o.index],"line"===o.type&&o.yAxisID===d.id&&(a=+d.getRightValue(s.data[e]),a<0?p+=a||0:f+=a||0);return r<0?d.getPixelForValue(p+r):d.getPixelForValue(f+r)}return d.getPixelForValue(t)},updateBezierControlPoints:function(){function t(t,e,i){return Math.max(Math.min(t,i),e)}var e,i,n,s,o=this,a=o.chart,r=o.getMeta(),l=r.dataset._model,h=a.chartArea,u=r.data||[];if(l.spanGaps&&(u=u.filter(function(t){return!t._model.skip})),"monotone"===l.cubicInterpolationMode)Si.splineCurveMonotone(u);else for(e=0,i=u.length;e<i;++e)n=u[e]._model,s=Si.splineCurve(Si.previousItem(u,e)._model,n,Si.nextItem(u,e)._model,l.tension),n.controlPointPreviousX=s.previous.x,n.controlPointPreviousY=s.previous.y,n.controlPointNextX=s.next.x,n.controlPointNextY=s.next.y;if(a.options.elements.line.capBezierPoints)for(e=0,i=u.length;e<i;++e)n=u[e]._model,bn(n,h)&&(e>0&&bn(u[e-1]._model,h)&&(n.controlPointPreviousX=t(n.controlPointPreviousX,h.left,h.right),n.controlPointPreviousY=t(n.controlPointPreviousY,h.top,h.bottom)),e<u.length-1&&bn(u[e+1]._model,h)&&(n.controlPointNextX=t(n.controlPointNextX,h.left,h.right),n.controlPointNextY=t(n.controlPointNextY,h.top,h.bottom)))},draw:function(){var t,e=this,i=e.chart,n=e.getMeta(),s=n.data||[],o=i.chartArea,a=i.canvas,r=0,l=s.length;for(e._showLine&&(t=n.dataset._model.clip,Si.canvas.clipArea(i.ctx,{left:!1===t.left?0:o.left-t.left,right:!1===t.right?a.width:o.right+t.right,top:!1===t.top?0:o.top-t.top,bottom:!1===t.bottom?a.height:o.bottom+t.bottom}),n.dataset.draw(),Si.canvas.unclipArea(i.ctx));r<l;++r)s[r].draw(o)},setHoverStyle:function(t){var e=t._model,i=t._options,n=Si.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=mn(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=mn(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=mn(i.hoverBorderWidth,i.borderWidth),e.radius=mn(i.hoverRadius,i.radius)}}),yn=Si.options.resolve;mi._set("polarArea",{scale:{type:"radialLinear",angleLines:{display:!1},gridLines:{circular:!0},pointLabels:{display:!1},ticks:{beginAtZero:!0}},animation:{animateRotate:!0,animateScale:!0},startAngle:-.5*Math.PI,legendCallback:function(t){var e,i,n,s,o=document.createElement("ul"),a=t.data,r=a.datasets,l=a.labels;if(o.setAttribute("class",t.id+"-legend"),r.length)for(e=0,i=r[0].data.length;e<i;++e)n=o.appendChild(document.createElement("li")),s=n.appendChild(document.createElement("span")),s.style.backgroundColor=r[0].backgroundColor[e],l[e]&&n.appendChild(document.createTextNode(l[e]));return o.outerHTML},legend:{labels:{generateLabels:function(t){var e=t.data;return e.labels.length&&e.datasets.length?e.labels.map(function(i,n){var s=t.getDatasetMeta(0),o=s.controller.getStyle(n);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,hidden:isNaN(e.datasets[0].data[n])||s.data[n].hidden,index:n}}):[]}},onClick:function(t,e){var i,n,s,o=e.index,a=this.chart;for(i=0,n=(a.data.datasets||[]).length;i<n;++i)s=a.getDatasetMeta(i),s.data[o].hidden=!s.data[o].hidden;a.update()}},tooltips:{callbacks:{title:function(){return""},label:function(t,e){return e.labels[t.index]+": "+t.yLabel}}}});var xn=Bi.extend({dataElementType:Zi.Arc,linkScales:Si.noop,_dataElementOptions:["backgroundColor","borderColor","borderWidth","borderAlign","hoverBackgroundColor","hoverBorderColor","hoverBorderWidth"],_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,i,n,s=this,o=s.getDataset(),a=s.getMeta(),r=s.chart.options.startAngle||0,l=s._starts=[],h=s._angles=[],u=a.data;for(s._updateRadius(),a.count=s.countVisibleElements(),e=0,i=o.data.length;e<i;e++)l[e]=r,n=s._computeAngle(e),h[e]=n,r+=n;for(e=0,i=u.length;e<i;++e)u[e]._options=s._resolveDataElementOptions(u[e],e),s.updateElement(u[e],e,t)},_updateRadius:function(){var t=this,e=t.chart,i=e.chartArea,n=e.options,s=Math.min(i.right-i.left,i.bottom-i.top);e.outerRadius=Math.max(s/2,0),e.innerRadius=Math.max(n.cutoutPercentage?e.outerRadius/100*n.cutoutPercentage:1,0),e.radiusLength=(e.outerRadius-e.innerRadius)/e.getVisibleDatasetCount(),t.outerRadius=e.outerRadius-e.radiusLength*t.index,t.innerRadius=t.outerRadius-e.radiusLength},updateElement:function(t,e,i){var n=this,s=n.chart,o=n.getDataset(),a=s.options,r=a.animation,l=s.scale,h=s.data.labels,u=l.xCenter,c=l.yCenter,d=a.startAngle,f=t.hidden?0:l.getDistanceFromCenterForValue(o.data[e]),p=n._starts[e],g=p+(t.hidden?0:n._angles[e]),m=r.animateScale?0:l.getDistanceFromCenterForValue(o.data[e]),v=t._options||{};Si.extend(t,{_datasetIndex:n.index,_index:e,_scale:l,_model:{backgroundColor:v.backgroundColor,borderColor:v.borderColor,borderWidth:v.borderWidth,borderAlign:v.borderAlign,x:u,y:c,innerRadius:0,outerRadius:i?m:f,startAngle:i&&r.animateRotate?d:p,endAngle:i&&r.animateRotate?d:g,label:Si.valueAtIndexOrDefault(h,e,h[e])}}),t.pivot()},countVisibleElements:function(){var t=this.getDataset(),e=this.getMeta(),i=0;return Si.each(e.data,function(e,n){isNaN(t.data[n])||e.hidden||i++}),i},setHoverStyle:function(t){var e=t._model,i=t._options,n=Si.getHoverColor,s=Si.valueOrDefault;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth},e.backgroundColor=s(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=s(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=s(i.hoverBorderWidth,i.borderWidth)},_computeAngle:function(t){var e=this,i=this.getMeta().count,n=e.getDataset(),s=e.getMeta();if(isNaN(n.data[t])||s.data[t].hidden)return 0;var o={chart:e.chart,dataIndex:t,dataset:n,datasetIndex:e.index};return yn([e.chart.options.elements.arc.angle,2*Math.PI/i],o,t)}});mi._set("pie",Si.clone(mi.doughnut)),mi._set("pie",{cutoutPercentage:0});var wn=pn,kn=Si.valueOrDefault;mi._set("radar",{spanGaps:!1,scale:{type:"radialLinear"},elements:{line:{fill:"start",tension:0}}});var Cn=Bi.extend({datasetElementType:Zi.Line,dataElementType:Zi.Point,linkScales:Si.noop,_datasetElementOptions:["backgroundColor","borderWidth","borderColor","borderCapStyle","borderDash","borderDashOffset","borderJoinStyle","fill"],_dataElementOptions:{backgroundColor:"pointBackgroundColor",borderColor:"pointBorderColor",borderWidth:"pointBorderWidth",hitRadius:"pointHitRadius",hoverBackgroundColor:"pointHoverBackgroundColor",hoverBorderColor:"pointHoverBorderColor",hoverBorderWidth:"pointHoverBorderWidth",hoverRadius:"pointHoverRadius",pointStyle:"pointStyle",radius:"pointRadius",rotation:"pointRotation"},_getIndexScaleId:function(){return this.chart.scale.id},_getValueScaleId:function(){return this.chart.scale.id},update:function(t){var e,i,n=this,s=n.getMeta(),o=s.dataset,a=s.data||[],r=n.chart.scale,l=n._config;for(void 0!==l.tension&&void 0===l.lineTension&&(l.lineTension=l.tension),o._scale=r,o._datasetIndex=n.index,o._children=a,o._loop=!0,o._model=n._resolveDatasetElementOptions(o),o.pivot(),e=0,i=a.length;e<i;++e)n.updateElement(a[e],e,t);for(n.updateBezierControlPoints(),e=0,i=a.length;e<i;++e)a[e].pivot()},updateElement:function(t,e,i){var n=this,s=t.custom||{},o=n.getDataset(),a=n.chart.scale,r=a.getPointPositionForValue(e,o.data[e]),l=n._resolveDataElementOptions(t,e),h=n.getMeta().dataset._model,u=i?a.xCenter:r.x,c=i?a.yCenter:r.y;t._scale=a,t._options=l,t._datasetIndex=n.index,t._index=e,t._model={x:u,y:c,skip:s.skip||isNaN(u)||isNaN(c),radius:l.radius,pointStyle:l.pointStyle,rotation:l.rotation,backgroundColor:l.backgroundColor,borderColor:l.borderColor,borderWidth:l.borderWidth,tension:kn(s.tension,h?h.tension:0),hitRadius:l.hitRadius}},_resolveDatasetElementOptions:function(){var t=this,e=t._config,i=t.chart.options,n=Bi.prototype._resolveDatasetElementOptions.apply(t,arguments);return n.spanGaps=kn(e.spanGaps,i.spanGaps),n.tension=kn(e.lineTension,i.elements.line.tension),n},updateBezierControlPoints:function(){function t(t,e,i){return Math.max(Math.min(t,i),e)}var e,i,n,s,o=this,a=o.getMeta(),r=o.chart.chartArea,l=a.data||[];for(a.dataset._model.spanGaps&&(l=l.filter(function(t){return!t._model.skip})),e=0,i=l.length;e<i;++e)n=l[e]._model,s=Si.splineCurve(Si.previousItem(l,e,!0)._model,n,Si.nextItem(l,e,!0)._model,n.tension),n.controlPointPreviousX=t(s.previous.x,r.left,r.right),n.controlPointPreviousY=t(s.previous.y,r.top,r.bottom),n.controlPointNextX=t(s.next.x,r.left,r.right),n.controlPointNextY=t(s.next.y,r.top,r.bottom)},setHoverStyle:function(t){var e=t._model,i=t._options,n=Si.getHoverColor;t.$previousStyle={backgroundColor:e.backgroundColor,borderColor:e.borderColor,borderWidth:e.borderWidth,radius:e.radius},e.backgroundColor=kn(i.hoverBackgroundColor,n(i.backgroundColor)),e.borderColor=kn(i.hoverBorderColor,n(i.borderColor)),e.borderWidth=kn(i.hoverBorderWidth,i.borderWidth),e.radius=kn(i.hoverRadius,i.radius)}});mi._set("scatter",{hover:{mode:"single"},scales:{xAxes:[{id:"x-axis-1",type:"linear",position:"bottom"}],yAxes:[{id:"y-axis-1",type:"linear",position:"left"}]},tooltips:{callbacks:{title:function(){return""},label:function(t){return"("+t.xLabel+", "+t.yLabel+")"}}}}),mi._set("global",{datasets:{scatter:{showLine:!1}}});var Dn=_n,Mn={bar:an,bubble:hn,doughnut:pn,horizontalBar:gn,line:_n,polarArea:xn,pie:wn,radar:Cn,scatter:Dn},Sn={modes:{single:function(t,e){var i=$(e,t),n=[];return K(t,function(t){if(t.inRange(i.x,i.y))return n.push(t),n}),n.slice(0,1)},label:Z,index:Z,dataset:function(t,e,i){var n=$(e,t);i.axis=i.axis||"xy";var s=Q(i.axis),o=i.intersect?X(t,n):G(t,n,!1,s);return o.length>0&&(o=t.getDatasetMeta(o[0]._datasetIndex).data),o},"x-axis":function(t,e){return Z(t,e,{intersect:!1})},point:function(t,e){return X(t,$(e,t))},nearest:function(t,e,i){var n=$(e,t);i.axis=i.axis||"xy";var s=Q(i.axis);return G(t,n,i.intersect,s)},x:function(t,e,i){var n=$(e,t),s=[],o=!1;return K(t,function(t){t.inXRange(n.x)&&s.push(t),t.inRange(n.x,n.y)&&(o=!0)}),i.intersect&&!o&&(s=[]),s},y:function(t,e,i){var n=$(e,t),s=[],o=!1;return K(t,function(t){t.inYRange(n.y)&&s.push(t),t.inRange(n.x,n.y)&&(o=!0)}),i.intersect&&!o&&(s=[]),s}}},Tn=Si.extend;mi._set("global",{layout:{padding:{top:0,right:0,bottom:0,left:0}}});var In={defaults:{},addBox:function(t,e){t.boxes||(t.boxes=[]),e.fullWidth=e.fullWidth||!1,e.position=e.position||"top",e.weight=e.weight||0,e._layers=e._layers||function(){return[{z:0,draw:function(){e.draw.apply(e,arguments)}}]},t.boxes.push(e)},removeBox:function(t,e){var i=t.boxes?t.boxes.indexOf(e):-1;-1!==i&&t.boxes.splice(i,1)},configure:function(t,e,i){for(var n,s=["fullWidth","position","weight"],o=s.length,a=0;a<o;++a)n=s[a],i.hasOwnProperty(n)&&(e[n]=i[n])},update:function(t,e,i){if(t){var n=t.options.layout||{},s=Si.options.toPadding(n.padding),o=e-s.width,a=i-s.height,r=nt(t.boxes),l=r.vertical,h=r.horizontal,u=Object.freeze({outerWidth:e,outerHeight:i,padding:s,availableWidth:o,vBoxMaxWidth:o/2/l.length,hBoxMaxHeight:a/2}),c=Tn({maxPadding:Tn({},s),w:o,h:a,x:s.left,y:s.top},s);it(l.concat(h),u),lt(l,c,u),lt(h,c,u)&&lt(l,c,u),at(c),ht(r.leftAndTop,c,u),c.x+=c.w,c.y+=c.h,ht(r.rightAndBottom,c,u),t.chartArea={left:c.left,top:c.top,right:c.left+c.w,bottom:c.top+c.h},Si.each(r.chartArea,function(e){var i=e.box;Tn(i,t.chartArea),i.update(c.w,c.h)})}}},Pn={acquireContext:function(t){return t&&t.canvas&&(t=t.canvas),t&&t.getContext("2d")||null}},An=Object.freeze({__proto__:null,default:"/*\r\n * DOM element rendering detection\r\n * https://davidwalsh.name/detect-node-insertion\r\n */\r\n@keyframes chartjs-render-animation {\r\n\tfrom { opacity: 0.99; }\r\n\tto { opacity: 1; }\r\n}\r\n\r\n.chartjs-render-monitor {\r\n\tanimation: chartjs-render-animation 0.001s;\r\n}\r\n\r\n/*\r\n * DOM element resizing detection\r\n * https://github.com/marcj/css-element-queries\r\n */\r\n.chartjs-size-monitor,\r\n.chartjs-size-monitor-expand,\r\n.chartjs-size-monitor-shrink {\r\n\tposition: absolute;\r\n\tdirection: ltr;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\tright: 0;\r\n\tbottom: 0;\r\n\toverflow: hidden;\r\n\tpointer-events: none;\r\n\tvisibility: hidden;\r\n\tz-index: -1;\r\n}\r\n\r\n.chartjs-size-monitor-expand > div {\r\n\tposition: absolute;\r\n\twidth: 1000000px;\r\n\theight: 1000000px;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n\r\n.chartjs-size-monitor-shrink > div {\r\n\tposition: absolute;\r\n\twidth: 200%;\r\n\theight: 200%;\r\n\tleft: 0;\r\n\ttop: 0;\r\n}\r\n"}),Fn=function(t){return t&&t.default||t}(An),On="$chartjs",En="chartjs-size-monitor",Nn="chartjs-render-monitor",zn="chartjs-render-animation",Ln=["animationstart","webkitAnimationStart"],Hn={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Rn=function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}(),Wn=!!Rn&&{passive:!0},Bn={disableCSSInjection:!1,_enabled:"undefined"!=typeof window&&"undefined"!=typeof document,_ensureLoaded:function(t){if(!this.disableCSSInjection){var e=t.getRootNode?t.getRootNode():document;kt(e.host?e:document.head,Fn)}},acquireContext:function(t,e){"string"==typeof t?t=document.getElementById(t):t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas);var i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(this._ensureLoaded(t),ct(t,e),i):null},releaseContext:function(t){var e=t.canvas;if(e[On]){var i=e[On].initial;["height","width"].forEach(function(t){var n=i[t];Si.isNullOrUndef(n)?e.removeAttribute(t):e.setAttribute(t,n)}),Si.each(i.style||{},function(t,i){e.style[i]=t}),e.width=e.width,delete e[On]}},addEventListener:function(t,e,i){var n=t.canvas;if("resize"===e)return void xt(n,i,t);var s=i[On]||(i[On]={});dt(n,e,(s.proxies||(s.proxies={}))[t.id+"_"+e]=function(e){i(gt(e,t))})},removeEventListener:function(t,e,i){var n=t.canvas;if("resize"===e)return void wt(n);var s=i[On]||{},o=s.proxies||{},a=o[t.id+"_"+e];a&&ft(n,e,a)}};Si.addEvent=dt,Si.removeEvent=ft;var Vn=Bn._enabled?Bn:Pn,Un=Si.extend({initialize:function(){},acquireContext:function(){},releaseContext:function(){},addEventListener:function(){},removeEventListener:function(){}},Vn);mi._set("global",{plugins:{}});var jn={_plugins:[],_cacheId:0,register:function(t){var e=this._plugins;[].concat(t).forEach(function(t){-1===e.indexOf(t)&&e.push(t)}),this._cacheId++},unregister:function(t){var e=this._plugins;[].concat(t).forEach(function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)}),this._cacheId++},clear:function(){this._plugins=[],this._cacheId++},count:function(){return this._plugins.length},getAll:function(){return this._plugins},notify:function(t,e,i){var n,s,o,a,r,l=this.descriptors(t),h=l.length;for(n=0;n<h;++n)if(s=l[n],o=s.plugin,"function"==typeof(r=o[e])&&(a=[t].concat(i||[]),a.push(s.options),!1===r.apply(o,a)))return!1;return!0},descriptors:function(t){var e=t.$plugins||(t.$plugins={});if(e.id===this._cacheId)return e.descriptors;var i=[],n=[],s=t&&t.config||{},o=s.options&&s.options.plugins||{};return this._plugins.concat(s.plugins||[]).forEach(function(t){if(-1===i.indexOf(t)){var e=t.id,s=o[e];!1!==s&&(!0===s&&(s=Si.clone(mi.global.plugins[e])),i.push(t),n.push({plugin:t,options:s||{}}))}}),e.descriptors=n,e.id=this._cacheId,n},_invalidate:function(t){delete t.$plugins}},Yn={constructors:{},defaults:{},registerScaleType:function(t,e,i){this.constructors[t]=e,this.defaults[t]=Si.clone(i)},getScaleConstructor:function(t){return this.constructors.hasOwnProperty(t)?this.constructors[t]:void 0},getScaleDefaults:function(t){return this.defaults.hasOwnProperty(t)?Si.merge(Object.create(null),[mi.scale,this.defaults[t]]):{}},updateScaleDefaults:function(t,e){var i=this;i.defaults.hasOwnProperty(t)&&(i.defaults[t]=Si.extend(i.defaults[t],e))},addScalesToLayout:function(t){Si.each(t.scales,function(e){e.fullWidth=e.options.fullWidth,e.position=e.options.position,e.weight=e.options.weight,In.addBox(t,e)})}},qn=Si.valueOrDefault,$n=Si.rtl.getRtlAdapter;mi._set("global",{tooltips:{enabled:!0,custom:null,mode:"nearest",position:"average",intersect:!0,backgroundColor:"rgba(0,0,0,0.8)",titleFontStyle:"bold",titleSpacing:2,titleMarginBottom:6,titleFontColor:"#fff",titleAlign:"left",bodySpacing:2,bodyFontColor:"#fff",bodyAlign:"left",footerFontStyle:"bold",footerSpacing:2,footerMarginTop:6,footerFontColor:"#fff",footerAlign:"left",yPadding:6,xPadding:6,caretPadding:2,caretSize:5,cornerRadius:6,multiKeyBackground:"#fff",displayColors:!0,borderColor:"rgba(0,0,0,0)",borderWidth:0,callbacks:{beforeTitle:Si.noop,title:function(t,e){var i="",n=e.labels,s=n?n.length:0;if(t.length>0){var o=t[0];o.label?i=o.label:o.xLabel?i=o.xLabel:s>0&&o.index<s&&(i=n[o.index])}return i},afterTitle:Si.noop,beforeBody:Si.noop,beforeLabel:Si.noop,label:function(t,e){var i=e.datasets[t.datasetIndex].label||"";return i&&(i+=": "),Si.isNullOrUndef(t.value)?i+=t.yLabel:i+=t.value,i},labelColor:function(t,e){var i=e.getDatasetMeta(t.datasetIndex),n=i.data[t.index],s=n._view;return{borderColor:s.borderColor,backgroundColor:s.backgroundColor}},labelTextColor:function(){return this._options.bodyFontColor},afterLabel:Si.noop,afterBody:Si.noop,beforeFooter:Si.noop,footer:Si.noop,afterFooter:Si.noop}}});var Kn={average:function(t){if(!t.length)return!1;var e,i,n=0,s=0,o=0;for(e=0,i=t.length;e<i;++e){var a=t[e];if(a&&a.hasValue()){var r=a.tooltipPosition();n+=r.x,s+=r.y,++o}}return{x:n/o,y:s/o}},nearest:function(t,e){var i,n,s,o=e.x,a=e.y,r=Number.POSITIVE_INFINITY;for(i=0,n=t.length;i<n;++i){var l=t[i];if(l&&l.hasValue()){var h=l.getCenterPoint(),u=Si.distanceBetweenPoints(e,h);u<r&&(r=u,s=l)}}if(s){var c=s.tooltipPosition();o=c.x,a=c.y}return{x:o,y:a}}},Xn=Ei.extend({initialize:function(){this._model=St(this._options),this._lastActive=[]},getTitle:function(){var t=this,e=t._options,i=e.callbacks,n=i.beforeTitle.apply(t,arguments),s=i.title.apply(t,arguments),o=i.afterTitle.apply(t,arguments),a=[];return a=Ct(a,Dt(n)),a=Ct(a,Dt(s)),a=Ct(a,Dt(o))},getBeforeBody:function(){return Ft(this._options.callbacks.beforeBody.apply(this,arguments))},getBody:function(t,e){var i=this,n=i._options.callbacks,s=[];return Si.each(t,function(t){var o={before:[],lines:[],after:[]};Ct(o.before,Dt(n.beforeLabel.call(i,t,e))),Ct(o.lines,n.label.call(i,t,e)),Ct(o.after,Dt(n.afterLabel.call(i,t,e))),s.push(o)}),s},getAfterBody:function(){return Ft(this._options.callbacks.afterBody.apply(this,arguments))},getFooter:function(){var t=this,e=t._options.callbacks,i=e.beforeFooter.apply(t,arguments),n=e.footer.apply(t,arguments),s=e.afterFooter.apply(t,arguments),o=[];return o=Ct(o,Dt(i)),o=Ct(o,Dt(n)),o=Ct(o,Dt(s))},update:function(t){var e,i,n=this,s=n._options,o=n._model,a=n._model=St(s),r=n._active,l=n._data,h={xAlign:o.xAlign,yAlign:o.yAlign},u={x:o.x,y:o.y},c={width:o.width,height:o.height},d={x:o.caretX,y:o.caretY};if(r.length){a.opacity=1;var f=[],p=[];d=Kn[s.position].call(n,r,n._eventPosition);var g=[];for(e=0,i=r.length;e<i;++e)g.push(Mt(r[e]));s.filter&&(g=g.filter(function(t){return s.filter(t,l)})),s.itemSort&&(g=g.sort(function(t,e){return s.itemSort(t,e,l)})),Si.each(g,function(t){f.push(s.callbacks.labelColor.call(n,t,n._chart)),p.push(s.callbacks.labelTextColor.call(n,t,n._chart))}),a.title=n.getTitle(g,l),a.beforeBody=n.getBeforeBody(g,l),a.body=n.getBody(g,l),a.afterBody=n.getAfterBody(g,l),a.footer=n.getFooter(g,l),a.x=d.x,a.y=d.y,a.caretPadding=s.caretPadding,a.labelColors=f,a.labelTextColors=p,a.dataPoints=g,c=Tt(this,a),h=It(this,c),u=Pt(a,c,h,n._chart)}else a.opacity=0;return a.xAlign=h.xAlign,a.yAlign=h.yAlign,a.x=u.x,a.y=u.y,a.width=c.width,a.height=c.height,a.caretX=d.x,a.caretY=d.y,n._model=a,t&&s.custom&&s.custom.call(n,a),n},drawCaret:function(t,e){var i=this._chart.ctx,n=this._view,s=this.getCaretPosition(t,e,n);i.lineTo(s.x1,s.y1),i.lineTo(s.x2,s.y2),i.lineTo(s.x3,s.y3)},getCaretPosition:function(t,e,i){var n,s,o,a,r,l,h=i.caretSize,u=i.cornerRadius,c=i.xAlign,d=i.yAlign,f=t.x,p=t.y,g=e.width,m=e.height;if("center"===d)r=p+m/2,"left"===c?(n=f,s=n-h,o=n,a=r+h,l=r-h):(n=f+g,s=n+h,o=n,a=r-h,l=r+h);else if("left"===c?(s=f+u+h,n=s-h,o=s+h):"right"===c?(s=f+g-u-h,n=s-h,o=s+h):(s=i.caretX,n=s-h,o=s+h),"top"===d)a=p,r=a-h,l=a;else{a=p+m,r=a+h,l=a;var v=o;o=n,n=v}return{x1:n,x2:s,x3:o,y1:a,y2:r,y3:l}},drawTitle:function(t,e,i){var n,s,o,a=e.title,r=a.length;if(r){var l=$n(e.rtl,e.x,e.width);for(t.x=At(e,e._titleAlign),i.textAlign=l.textAlign(e._titleAlign),i.textBaseline="middle",n=e.titleFontSize,s=e.titleSpacing,i.fillStyle=e.titleFontColor,i.font=Si.fontString(n,e._titleFontStyle,e._titleFontFamily),o=0;o<r;++o)i.fillText(a[o],l.x(t.x),t.y+n/2),t.y+=n+s,o+1===r&&(t.y+=e.titleMarginBottom-s)}},drawBody:function(t,e,i){var n,s,o,a,r,l,h,u,c=e.bodyFontSize,d=e.bodySpacing,f=e._bodyAlign,p=e.body,g=e.displayColors,m=0,v=g?At(e,"left"):0,b=$n(e.rtl,e.x,e.width),_=function(e){i.fillText(e,b.x(t.x+m),t.y+c/2),t.y+=c+d},y=b.textAlign(f);for(i.textAlign=f,i.textBaseline="middle",i.font=Si.fontString(c,e._bodyFontStyle,e._bodyFontFamily),t.x=At(e,y),i.fillStyle=e.bodyFontColor,Si.each(e.beforeBody,_),m=g&&"right"!==y?"center"===f?c/2+1:c+2:0,r=0,h=p.length;r<h;++r){for(n=p[r],s=e.labelTextColors[r],o=e.labelColors[r],i.fillStyle=s,Si.each(n.before,_),a=n.lines,l=0,u=a.length;l<u;++l){if(g){var x=b.x(v);i.fillStyle=e.legendColorBackground,i.fillRect(b.leftForLtr(x,c),t.y,c,c),i.lineWidth=1,i.strokeStyle=o.borderColor,i.strokeRect(b.leftForLtr(x,c),t.y,c,c),i.fillStyle=o.backgroundColor,i.fillRect(b.leftForLtr(b.xPlus(x,1),c-2),t.y+1,c-2,c-2),i.fillStyle=s}_(a[l])}Si.each(n.after,_)}m=0,Si.each(e.afterBody,_),t.y-=d},drawFooter:function(t,e,i){var n,s,o=e.footer,a=o.length;if(a){var r=$n(e.rtl,e.x,e.width);for(t.x=At(e,e._footerAlign),t.y+=e.footerMarginTop,i.textAlign=r.textAlign(e._footerAlign),i.textBaseline="middle",n=e.footerFontSize,i.fillStyle=e.footerFontColor,i.font=Si.fontString(n,e._footerFontStyle,e._footerFontFamily),s=0;s<a;++s)i.fillText(o[s],r.x(t.x),t.y+n/2),t.y+=n+e.footerSpacing}},drawBackground:function(t,e,i,n){i.fillStyle=e.backgroundColor,i.strokeStyle=e.borderColor,i.lineWidth=e.borderWidth;var s=e.xAlign,o=e.yAlign,a=t.x,r=t.y,l=n.width,h=n.height,u=e.cornerRadius;i.beginPath(),i.moveTo(a+u,r),"top"===o&&this.drawCaret(t,n),i.lineTo(a+l-u,r),i.quadraticCurveTo(a+l,r,a+l,r+u),"center"===o&&"right"===s&&this.drawCaret(t,n),i.lineTo(a+l,r+h-u),i.quadraticCurveTo(a+l,r+h,a+l-u,r+h),"bottom"===o&&this.drawCaret(t,n),i.lineTo(a+u,r+h),i.quadraticCurveTo(a,r+h,a,r+h-u),"center"===o&&"left"===s&&this.drawCaret(t,n),i.lineTo(a,r+u),i.quadraticCurveTo(a,r,a+u,r),i.closePath(),i.fill(),e.borderWidth>0&&i.stroke()},draw:function(){var t=this._chart.ctx,e=this._view;if(0!==e.opacity){var i={width:e.width,height:e.height},n={x:e.x,y:e.y},s=Math.abs(e.opacity<.001)?0:e.opacity,o=e.title.length||e.beforeBody.length||e.body.length||e.afterBody.length||e.footer.length;this._options.enabled&&o&&(t.save(),t.globalAlpha=s,this.drawBackground(n,e,t,i),n.y+=e.yPadding,Si.rtl.overrideTextDirection(t,e.textDirection),this.drawTitle(n,e,t),this.drawBody(n,e,t),this.drawFooter(n,e,t),Si.rtl.restoreTextDirection(t,e.textDirection),t.restore())}},handleEvent:function(t){var e=this,i=e._options,n=!1;return e._lastActive=e._lastActive||[],"mouseout"===t.type?e._active=[]:(e._active=e._chart.getElementsAtEventForMode(t,i.mode,i),i.reverse&&e._active.reverse()),n=!Si.arrayEquals(e._active,e._lastActive),n&&(e._lastActive=e._active,(i.enabled||i.custom)&&(e._eventPosition={x:t.x,y:t.y},e.update(!0),e.pivot())),n}}),Gn=Kn,Qn=Xn;Qn.positioners=Gn;var Zn=Si.valueOrDefault;mi._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var Jn=function(t,e){return this.construct(t,e),this};Si.extend(Jn.prototype,{construct:function(t,e){var i=this;e=Nt(e);var n=Un.acquireContext(t,e),s=n&&n.canvas,o=s&&s.height,a=s&&s.width;if(i.id=Si.uid(),i.ctx=n,i.canvas=s,i.config=e,i.width=a,i.height=o,i.aspectRatio=o?a/o:null,i.options=e.options,i._bufferedRender=!1,i._layers=[],i.chart=i,i.controller=i,Jn.instances[i.id]=i,Object.defineProperty(i,"data",{get:function(){return i.config.data},set:function(t){i.config.data=t}}),!n||!s)return void console.error("Failed to create chart: can't acquire context from the given item");i.initialize(),i.update()},initialize:function(){var t=this;return jn.notify(t,"beforeInit"),Si.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),jn.notify(t,"afterInit"),t},clear:function(){return Si.canvas.clear(this),this},stop:function(){return Li.cancelAnimation(this),this},resize:function(t){var e=this,i=e.options,n=e.canvas,s=i.maintainAspectRatio&&e.aspectRatio||null,o=Math.max(0,Math.floor(Si.getMaximumWidth(n))),a=Math.max(0,Math.floor(s?o/s:Si.getMaximumHeight(n)));if((e.width!==o||e.height!==a)&&(n.width=e.width=o,n.height=e.height=a,n.style.width=o+"px",n.style.height=a+"px",Si.retinaScale(e,i.devicePixelRatio),!t)){var r={width:o,height:a};jn.notify(e,"resize",[r]),i.onResize&&i.onResize(e,r),e.stop(),e.update({duration:i.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,e=t.scales||{},i=t.scale;Si.each(e.xAxes,function(t,i){t.id||(t.id=Lt(e.xAxes,"x-axis-",i))}),Si.each(e.yAxes,function(t,i){t.id||(t.id=Lt(e.yAxes,"y-axis-",i))}),i&&(i.id=i.id||"scale")},buildOrUpdateScales:function(){var t=this,e=t.options,i=t.scales||{},n=[],s=Object.keys(i).reduce(function(t,e){return t[e]=!1,t},{});e.scales&&(n=n.concat((e.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(e.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),e.scale&&n.push({options:e.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),Si.each(n,function(e){var n=e.options,o=n.id,a=Zn(n.type,e.dtype);Ht(n.position)!==Ht(e.dposition)&&(n.position=e.dposition),s[o]=!0;var r=null;if(o in i&&i[o].type===a)r=i[o],r.options=n,r.ctx=t.ctx,r.chart=t;else{var l=Yn.getScaleConstructor(a);if(!l)return;r=new l({id:o,type:a,options:n,ctx:t.ctx,chart:t}),i[r.id]=r}r.mergeTicksOptions(),e.isDefault&&(t.scale=r)}),Si.each(s,function(t,e){t||delete i[e]}),t.scales=i,Yn.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,i=this,n=[],s=i.data.datasets;for(t=0,e=s.length;t<e;t++){var o=s[t],a=i.getDatasetMeta(t),r=o.type||i.config.type;if(a.type&&a.type!==r&&(i.destroyDatasetMeta(t),a=i.getDatasetMeta(t)),a.type=r,a.order=o.order||0,a.index=t,a.controller)a.controller.updateIndex(t),a.controller.linkScales();else{var l=Mn[a.type];if(void 0===l)throw new Error('"'+a.type+'" is not a chart type.');a.controller=new l(i,t),n.push(a.controller)}}return n},resetElements:function(){var t=this;Si.each(t.data.datasets,function(e,i){t.getDatasetMeta(i).controller.reset()},t)},reset:function(){this.resetElements(),this.tooltip.initialize()},update:function(t){var e,i,n=this;if(t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]}),zt(n),jn._invalidate(n),!1!==jn.notify(n,"beforeUpdate")){n.tooltip._data=n.data;var s=n.buildOrUpdateControllers();for(e=0,i=n.data.datasets.length;e<i;e++)n.getDatasetMeta(e).controller.buildOrUpdateElements();n.updateLayout(),n.options.animation&&n.options.animation.duration&&Si.each(s,function(t){t.reset()}),n.updateDatasets(),n.tooltip.initialize(),n.lastActive=[],jn.notify(n,"afterUpdate"),n._layers.sort(Rt("z","_idx")),n._bufferedRender?n._bufferedRequest={duration:t.duration,easing:t.easing,lazy:t.lazy}:n.render(t)}},updateLayout:function(){var t=this;!1!==jn.notify(t,"beforeLayout")&&(In.update(this,this.width,this.height),t._layers=[],Si.each(t.boxes,function(e){e._configure&&e._configure(),t._layers.push.apply(t._layers,e._layers())},t),t._layers.forEach(function(t,e){t._idx=e}),jn.notify(t,"afterScaleUpdate"),jn.notify(t,"afterLayout"))},updateDatasets:function(){var t=this;if(!1!==jn.notify(t,"beforeDatasetsUpdate")){for(var e=0,i=t.data.datasets.length;e<i;++e)t.updateDataset(e);jn.notify(t,"afterDatasetsUpdate")}},updateDataset:function(t){var e=this,i=e.getDatasetMeta(t),n={meta:i,index:t};!1!==jn.notify(e,"beforeDatasetUpdate",[n])&&(i.controller._update(),jn.notify(e,"afterDatasetUpdate",[n]))},render:function(t){var e=this;t&&"object"==typeof t||(t={duration:t,lazy:arguments[1]});var i=e.options.animation,n=Zn(t.duration,i&&i.duration),s=t.lazy;if(!1!==jn.notify(e,"beforeRender")){var o=function(t){jn.notify(e,"afterRender"),Si.callback(i&&i.onComplete,[t],e)};if(i&&n){var a=new zi({numSteps:n/16.66,easing:t.easing||i.easing,render:function(t,e){var i=Si.easing.effects[e.easing],n=e.currentStep,s=n/e.numSteps;t.draw(i(s),s,n)},onAnimationProgress:i.onProgress,onAnimationComplete:o});Li.addAnimation(e,a,n,s)}else e.draw(),o(new zi({numSteps:0,chart:e}));return e}},draw:function(t){var e,i,n=this;if(n.clear(),Si.isNullOrUndef(t)&&(t=1),n.transition(t),!(n.width<=0||n.height<=0)&&!1!==jn.notify(n,"beforeDraw",[t])){for(i=n._layers,e=0;e<i.length&&i[e].z<=0;++e)i[e].draw(n.chartArea);for(n.drawDatasets(t);e<i.length;++e)i[e].draw(n.chartArea);n._drawTooltip(t),jn.notify(n,"afterDraw",[t])}},transition:function(t){for(var e=this,i=0,n=(e.data.datasets||[]).length;i<n;++i)e.isDatasetVisible(i)&&e.getDatasetMeta(i).controller.transition(t);e.tooltip.transition(t)},_getSortedDatasetMetas:function(t){var e,i,n=this,s=n.data.datasets||[],o=[];for(e=0,i=s.length;e<i;++e)t&&!n.isDatasetVisible(e)||o.push(n.getDatasetMeta(e))
;return o.sort(Rt("order","index")),o},_getSortedVisibleDatasetMetas:function(){return this._getSortedDatasetMetas(!0)},drawDatasets:function(t){var e,i,n=this;if(!1!==jn.notify(n,"beforeDatasetsDraw",[t])){for(e=n._getSortedVisibleDatasetMetas(),i=e.length-1;i>=0;--i)n.drawDataset(e[i],t);jn.notify(n,"afterDatasetsDraw",[t])}},drawDataset:function(t,e){var i=this,n={meta:t,index:t.index,easingValue:e};!1!==jn.notify(i,"beforeDatasetDraw",[n])&&(t.controller.draw(e),jn.notify(i,"afterDatasetDraw",[n]))},_drawTooltip:function(t){var e=this,i=e.tooltip,n={tooltip:i,easingValue:t};!1!==jn.notify(e,"beforeTooltipDraw",[n])&&(i.draw(),jn.notify(e,"afterTooltipDraw",[n]))},getElementAtEvent:function(t){return Sn.modes.single(this,t)},getElementsAtEvent:function(t){return Sn.modes.label(this,t,{intersect:!0})},getElementsAtXAxis:function(t){return Sn.modes["x-axis"](this,t,{intersect:!0})},getElementsAtEventForMode:function(t,e,i){var n=Sn.modes[e];return"function"==typeof n?n(this,t,i):[]},getDatasetAtEvent:function(t){return Sn.modes.dataset(this,t,{intersect:!0})},getDatasetMeta:function(t){var e=this,i=e.data.datasets[t];i._meta||(i._meta={});var n=i._meta[e.id];return n||(n=i._meta[e.id]={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:i.order||0,index:t}),n},getVisibleDatasetCount:function(){for(var t=0,e=0,i=this.data.datasets.length;e<i;++e)this.isDatasetVisible(e)&&t++;return t},isDatasetVisible:function(t){var e=this.getDatasetMeta(t);return"boolean"==typeof e.hidden?!e.hidden:!this.data.datasets[t].hidden},generateLegend:function(){return this.options.legendCallback(this)},destroyDatasetMeta:function(t){var e=this.id,i=this.data.datasets[t],n=i._meta&&i._meta[e];n&&(n.controller.destroy(),delete i._meta[e])},destroy:function(){var t,e,i=this,n=i.canvas;for(i.stop(),t=0,e=i.data.datasets.length;t<e;++t)i.destroyDatasetMeta(t);n&&(i.unbindEvents(),Si.canvas.clear(i),Un.releaseContext(i.ctx),i.canvas=null,i.ctx=null),jn.notify(i,"destroy"),delete Jn.instances[i.id]},toBase64Image:function(){return this.canvas.toDataURL.apply(this.canvas,arguments)},initToolTip:function(){var t=this;t.tooltip=new Qn({_chart:t,_chartInstance:t,_data:t.data,_options:t.options.tooltips},t)},bindEvents:function(){var t=this,e=t._listeners={},i=function(){t.eventHandler.apply(t,arguments)};Si.each(t.options.events,function(n){Un.addEventListener(t,n,i),e[n]=i}),t.options.responsive&&(i=function(){t.resize()},Un.addEventListener(t,"resize",i),e.resize=i)},unbindEvents:function(){var t=this,e=t._listeners;e&&(delete t._listeners,Si.each(e,function(e,i){Un.removeEventListener(t,i,e)}))},updateHoverStyle:function(t,e,i){var n,s,o,a=i?"set":"remove";for(s=0,o=t.length;s<o;++s)(n=t[s])&&this.getDatasetMeta(n._datasetIndex).controller[a+"HoverStyle"](n);"dataset"===e&&this.getDatasetMeta(t[0]._datasetIndex).controller["_"+a+"DatasetHoverStyle"]()},eventHandler:function(t){var e=this,i=e.tooltip;if(!1!==jn.notify(e,"beforeEvent",[t])){e._bufferedRender=!0,e._bufferedRequest=null;var n=e.handleEvent(t);i&&(n=i._start?i.handleEvent(t):n|i.handleEvent(t)),jn.notify(e,"afterEvent",[t]);var s=e._bufferedRequest;return s?e.render(s):n&&!e.animating&&(e.stop(),e.render({duration:e.options.hover.animationDuration,lazy:!0})),e._bufferedRender=!1,e._bufferedRequest=null,e}},handleEvent:function(t){var e=this,i=e.options||{},n=i.hover,s=!1;return e.lastActive=e.lastActive||[],"mouseout"===t.type?e.active=[]:e.active=e.getElementsAtEventForMode(t,n.mode,n),Si.callback(i.onHover||i.hover.onHover,[t.native,e.active],e),"mouseup"!==t.type&&"click"!==t.type||i.onClick&&i.onClick.call(e,t.native,e.active),e.lastActive.length&&e.updateHoverStyle(e.lastActive,n.mode,!1),e.active.length&&n.mode&&e.updateHoverStyle(e.active,n.mode,!0),s=!Si.arrayEquals(e.active,e.lastActive),e.lastActive=e.active,s}}),Jn.instances={};var ts=Jn;Jn.Controller=Jn,Jn.types={},Si.configMerge=Et,Si.scaleMerge=Ot;Si.extend(Bt.prototype,{formats:Wt,parse:Wt,format:Wt,add:Wt,diff:Wt,startOf:Wt,endOf:Wt,_create:function(t){return t}}),Bt.override=function(t){Si.extend(Bt.prototype,t)};var es=Bt,is={_date:es},ns={formatters:{values:function(t){return Si.isArray(t)?t:""+t},linear:function(t,e,i){var n=i.length>3?i[2]-i[1]:i[1]-i[0];Math.abs(n)>1&&t!==Math.floor(t)&&(n=t-Math.floor(t));var s=Si.log10(Math.abs(n)),o="";if(0!==t){if(Math.max(Math.abs(i[0]),Math.abs(i[i.length-1]))<1e-4){var a=Si.log10(Math.abs(t)),r=Math.floor(a)-Math.floor(s);r=Math.max(Math.min(r,20),0),o=t.toExponential(r)}else{var l=-1*Math.floor(s);l=Math.max(Math.min(l,20),0),o=t.toFixed(l)}}else o="0";return o},logarithmic:function(t,e,i){var n=t/Math.pow(10,Math.floor(Si.log10(t)));return 0===t?"0":1===n||2===n||5===n||0===e||e===i.length-1?t.toExponential():""}}},ss=Si.isArray,os=Si.isNullOrUndef,as=Si.valueOrDefault,rs=Si.valueAtIndexOrDefault;mi._set("scale",{display:!0,position:"left",offset:!1,gridLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickMarkLength:10,zeroLineWidth:1,zeroLineColor:"rgba(0,0,0,0.25)",zeroLineBorderDash:[],zeroLineBorderDashOffset:0,offsetGridLines:!1,borderDash:[],borderDashOffset:0},scaleLabel:{display:!1,labelString:"",padding:{top:4,bottom:4}},ticks:{beginAtZero:!1,minRotation:0,maxRotation:50,mirror:!1,padding:0,reverse:!1,display:!0,autoSkip:!0,autoSkipPadding:0,labelOffset:0,callback:ns.formatters.values,minor:{},major:{}}});var ls=Ei.extend({zeroLineIndex:0,getPadding:function(){var t=this;return{left:t.paddingLeft||0,top:t.paddingTop||0,right:t.paddingRight||0,bottom:t.paddingBottom||0}},getTicks:function(){return this._ticks},_getLabels:function(){var t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]},mergeTicksOptions:function(){},beforeUpdate:function(){Si.callback(this.options.beforeUpdate,[this])},update:function(t,e,i){var n,s,o,a,r,l=this,h=l.options.ticks,u=h.sampleSize;if(l.beforeUpdate(),l.maxWidth=t,l.maxHeight=e,l.margins=Si.extend({left:0,right:0,top:0,bottom:0},i),l._ticks=null,l.ticks=null,l._labelSizes=null,l._maxLabelLines=0,l.longestLabelWidth=0,l.longestTextCache=l.longestTextCache||{},l._gridLineItems=null,l._labelItems=null,l.beforeSetDimensions(),l.setDimensions(),l.afterSetDimensions(),l.beforeDataLimits(),l.determineDataLimits(),l.afterDataLimits(),l.beforeBuildTicks(),a=l.buildTicks()||[],(!(a=l.afterBuildTicks(a)||a)||!a.length)&&l.ticks)for(a=[],n=0,s=l.ticks.length;n<s;++n)a.push({value:l.ticks[n],major:!1});return l._ticks=a,r=u<a.length,o=l._convertTicksToLabels(r?Vt(a,u):a),l._configure(),l.beforeCalculateTickRotation(),l.calculateTickRotation(),l.afterCalculateTickRotation(),l.beforeFit(),l.fit(),l.afterFit(),l._ticksToDraw=h.display&&(h.autoSkip||"auto"===h.source)?l._autoSkip(a):a,r&&(o=l._convertTicksToLabels(l._ticksToDraw)),l.ticks=o,l.afterUpdate(),l.minSize},_configure:function(){var t,e,i=this,n=i.options.ticks.reverse;i.isHorizontal()?(t=i.left,e=i.right):(t=i.top,e=i.bottom,n=!n),i._startPixel=t,i._endPixel=e,i._reversePixels=n,i._length=e-t},afterUpdate:function(){Si.callback(this.options.afterUpdate,[this])},beforeSetDimensions:function(){Si.callback(this.options.beforeSetDimensions,[this])},setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0},afterSetDimensions:function(){Si.callback(this.options.afterSetDimensions,[this])},beforeDataLimits:function(){Si.callback(this.options.beforeDataLimits,[this])},determineDataLimits:Si.noop,afterDataLimits:function(){Si.callback(this.options.afterDataLimits,[this])},beforeBuildTicks:function(){Si.callback(this.options.beforeBuildTicks,[this])},buildTicks:Si.noop,afterBuildTicks:function(t){var e=this;return ss(t)&&t.length?Si.callback(e.options.afterBuildTicks,[e,t]):(e.ticks=Si.callback(e.options.afterBuildTicks,[e,e.ticks])||e.ticks,t)},beforeTickToLabelConversion:function(){Si.callback(this.options.beforeTickToLabelConversion,[this])},convertTicksToLabels:function(){var t=this,e=t.options.ticks;t.ticks=t.ticks.map(e.userCallback||e.callback,this)},afterTickToLabelConversion:function(){Si.callback(this.options.afterTickToLabelConversion,[this])},beforeCalculateTickRotation:function(){Si.callback(this.options.beforeCalculateTickRotation,[this])},calculateTickRotation:function(){var t,e,i,n,s,o,a,r=this,l=r.options,h=l.ticks,u=r.getTicks().length,c=h.minRotation||0,d=h.maxRotation,f=c;if(!r._isVisible()||!h.display||c>=d||u<=1||!r.isHorizontal())return void(r.labelRotation=c);t=r._getLabelSizes(),e=t.widest.width,i=t.highest.height-t.highest.offset,n=Math.min(r.maxWidth,r.chart.width-e),s=l.offset?r.maxWidth/u:n/(u-1),e+6>s&&(s=n/(u-(l.offset?.5:1)),o=r.maxHeight-qt(l.gridLines)-h.padding-$t(l.scaleLabel),a=Math.sqrt(e*e+i*i),f=Si.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/s,1)),Math.asin(Math.min(o/a,1))-Math.asin(i/a))),f=Math.max(c,Math.min(d,f))),r.labelRotation=f},afterCalculateTickRotation:function(){Si.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){Si.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},i=t.chart,n=t.options,s=n.ticks,o=n.scaleLabel,a=n.gridLines,r=t._isVisible(),l="bottom"===n.position,h=t.isHorizontal();if(h?e.width=t.maxWidth:r&&(e.width=qt(a)+$t(o)),h?r&&(e.height=qt(a)+$t(o)):e.height=t.maxHeight,s.display&&r){var u=Xt(s),c=t._getLabelSizes(),d=c.first,f=c.last,p=c.widest,g=c.highest,m=.4*u.minor.lineHeight,v=s.padding;if(h){var b=0!==t.labelRotation,_=Si.toRadians(t.labelRotation),y=Math.cos(_),x=Math.sin(_),w=x*p.width+y*(g.height-(b?g.offset:0))+(b?0:m);e.height=Math.min(t.maxHeight,e.height+w+v);var k,C,D=t.getPixelForTick(0)-t.left,M=t.right-t.getPixelForTick(t.getTicks().length-1);b?(k=l?y*d.width+x*d.offset:x*(d.height-d.offset),C=l?x*(f.height-f.offset):y*f.width+x*f.offset):(k=d.width/2,C=f.width/2),t.paddingLeft=Math.max((k-D)*t.width/(t.width-D),0)+3,t.paddingRight=Math.max((C-M)*t.width/(t.width-M),0)+3}else{var S=s.mirror?0:p.width+v+m;e.width=Math.min(t.maxWidth,e.width+S),t.paddingTop=d.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),h?(t.width=t._length=i.width-t.margins.left-t.margins.right,t.height=e.height):(t.width=e.width,t.height=t._length=i.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){Si.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if(os(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,i,n,s=this;for(s.ticks=t.map(function(t){return t.value}),s.beforeTickToLabelConversion(),e=s.convertTicksToLabels(t)||s.ticks,s.afterTickToLabelConversion(),i=0,n=t.length;i<n;++i)t[i].label=e[i];return e},_getLabelSizes:function(){var t=this,e=t._labelSizes;return e||(t._labelSizes=e=Yt(t.ctx,Xt(t.options.ticks),t.getTicks(),t.longestTextCache),t.longestLabelWidth=e.widest.width),e},_parseValue:function(t){var e,i,n,s;return ss(t)?(e=+this.getRightValue(t[0]),i=+this.getRightValue(t[1]),n=Math.min(e,i),s=Math.max(e,i)):(t=+this.getRightValue(t),e=void 0,i=t,n=t,s=t),{min:n,max:s,start:e,end:i}},_getScaleLabel:function(t){var e=this._parseValue(t);return void 0!==e.start?"["+e.start+", "+e.end+"]":+this.getRightValue(t)},getLabelForIndex:Si.noop,getPixelForValue:Si.noop,getValueForPixel:Si.noop,getPixelForTick:function(t){var e=this,i=e.options.offset,n=e._ticks.length,s=1/Math.max(n-(i?0:1),1);return t<0||t>n-1?null:e.getPixelForDecimal(t*s+(i?s/2:0))},getPixelForDecimal:function(t){var e=this;return e._reversePixels&&(t=1-t),e._startPixel+t*e._length},getDecimalForPixel:function(t){var e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e},getBasePixel:function(){return this.getPixelForValue(this.getBaseValue())},getBaseValue:function(){var t=this,e=t.min,i=t.max;return t.beginAtZero?0:e<0&&i<0?i:e>0&&i>0?e:0},_autoSkip:function(t){var e,i,n,s,o=this,a=o.options.ticks,r=o._length,l=a.maxTicksLimit||r/o._tickSize()+1,h=a.major.enabled?Jt(t):[],u=h.length,c=h[0],d=h[u-1];if(u>l)return te(t,h,u/l),Gt(t);if(n=Zt(h,t,r,l),u>0){for(e=0,i=u-1;e<i;e++)ee(t,n,h[e],h[e+1]);return s=u>1?(d-c)/(u-1):null,ee(t,n,Si.isNullOrUndef(s)?0:c-s,c),ee(t,n,d,Si.isNullOrUndef(s)?t.length:d+s),Gt(t)}return ee(t,n),Gt(t)},_tickSize:function(){var t=this,e=t.options.ticks,i=Si.toRadians(t.labelRotation),n=Math.abs(Math.cos(i)),s=Math.abs(Math.sin(i)),o=t._getLabelSizes(),a=e.autoSkipPadding||0,r=o?o.widest.width+a:0,l=o?o.highest.height+a:0;return t.isHorizontal()?l*n>r*s?r/n:l/s:l*s<r*n?l/n:r/s},_isVisible:function(){var t,e,i,n=this,s=n.chart,o=n.options.display;if("auto"!==o)return!!o;for(t=0,e=s.data.datasets.length;t<e;++t)if(s.isDatasetVisible(t)&&(i=s.getDatasetMeta(t),i.xAxisID===n.id||i.yAxisID===n.id))return!0;return!1},_computeGridLineItems:function(t){var e,i,n,s,o,a,r,l,h,u,c,d,f,p,g,m,v,b=this,_=b.chart,y=b.options,x=y.gridLines,w=y.position,k=x.offsetGridLines,C=b.isHorizontal(),D=b._ticksToDraw,M=D.length+(k?1:0),S=qt(x),T=[],I=x.drawBorder?rs(x.lineWidth,0,0):0,P=I/2,A=Si._alignPixel,F=function(t){return A(_,t,I)};for("top"===w?(e=F(b.bottom),r=b.bottom-S,h=e-P,c=F(t.top)+P,f=t.bottom):"bottom"===w?(e=F(b.top),c=t.top,f=F(t.bottom)-P,r=e+P,h=b.top+S):"left"===w?(e=F(b.right),a=b.right-S,l=e-P,u=F(t.left)+P,d=t.right):(e=F(b.left),u=t.left,d=F(t.right)-P,a=e+P,l=b.left+S),i=0;i<M;++i)n=D[i]||{},os(n.label)&&i<D.length||(i===b.zeroLineIndex&&y.offset===k?(p=x.zeroLineWidth,g=x.zeroLineColor,m=x.zeroLineBorderDash||[],v=x.zeroLineBorderDashOffset||0):(p=rs(x.lineWidth,i,1),g=rs(x.color,i,"rgba(0,0,0,0.1)"),m=x.borderDash||[],v=x.borderDashOffset||0),void 0!==(s=Ut(b,n._index||i,k))&&(o=A(_,s,p),C?a=l=u=d=o:r=h=c=f=o,T.push({tx1:a,ty1:r,tx2:l,ty2:h,x1:u,y1:c,x2:d,y2:f,width:p,color:g,borderDash:m,borderDashOffset:v})));return T.ticksLength=M,T.borderValue=e,T},_computeLabelItems:function(){var t,e,i,n,s,o,a,r,l,h,u,c,d=this,f=d.options,p=f.ticks,g=f.position,m=p.mirror,v=d.isHorizontal(),b=d._ticksToDraw,_=Xt(p),y=p.padding,x=qt(f.gridLines),w=-Si.toRadians(d.labelRotation),k=[];for("top"===g?(o=d.bottom-x-y,a=w?"left":"center"):"bottom"===g?(o=d.top+x+y,a=w?"right":"center"):"left"===g?(s=d.right-(m?0:x)-y,a=m?"left":"right"):(s=d.left+(m?0:x)+y,a=m?"right":"left"),t=0,e=b.length;t<e;++t)i=b[t],n=i.label,os(n)||(r=d.getPixelForTick(i._index||t)+p.labelOffset,l=i.major?_.major:_.minor,h=l.lineHeight,u=ss(n)?n.length:1,v?(s=r,c="top"===g?((w?1:.5)-u)*h:(w?0:.5)*h):(o=r,c=(1-u)*h/2),k.push({x:s,y:o,rotation:w,label:n,font:l,textOffset:c,textAlign:a}));return k},_drawGrid:function(t){var e=this,i=e.options.gridLines;if(i.display){var n,s,o,a,r,l=e.ctx,h=e.chart,u=Si._alignPixel,c=i.drawBorder?rs(i.lineWidth,0,0):0,d=e._gridLineItems||(e._gridLineItems=e._computeGridLineItems(t));for(o=0,a=d.length;o<a;++o)r=d[o],n=r.width,s=r.color,n&&s&&(l.save(),l.lineWidth=n,l.strokeStyle=s,l.setLineDash&&(l.setLineDash(r.borderDash),l.lineDashOffset=r.borderDashOffset),l.beginPath(),i.drawTicks&&(l.moveTo(r.tx1,r.ty1),l.lineTo(r.tx2,r.ty2)),i.drawOnChartArea&&(l.moveTo(r.x1,r.y1),l.lineTo(r.x2,r.y2)),l.stroke(),l.restore());if(c){var f,p,g,m,v=c,b=rs(i.lineWidth,d.ticksLength-1,1),_=d.borderValue;e.isHorizontal()?(f=u(h,e.left,v)-v/2,p=u(h,e.right,b)+b/2,g=m=_):(g=u(h,e.top,v)-v/2,m=u(h,e.bottom,b)+b/2,f=p=_),l.lineWidth=c,l.strokeStyle=rs(i.color,0),l.beginPath(),l.moveTo(f,g),l.lineTo(p,m),l.stroke()}}},_drawLabels:function(){var t=this;if(t.options.ticks.display){var e,i,n,s,o,a,r,l,h=t.ctx,u=t._labelItems||(t._labelItems=t._computeLabelItems());for(e=0,n=u.length;e<n;++e){if(o=u[e],a=o.font,h.save(),h.translate(o.x,o.y),h.rotate(o.rotation),h.font=a.string,h.fillStyle=a.color,h.textBaseline="middle",h.textAlign=o.textAlign,r=o.label,l=o.textOffset,ss(r))for(i=0,s=r.length;i<s;++i)h.fillText(""+r[i],0,l),l+=a.lineHeight;else h.fillText(r,0,l);h.restore()}}},_drawTitle:function(){var t=this,e=t.ctx,i=t.options,n=i.scaleLabel;if(n.display){var s,o,a=as(n.fontColor,mi.global.defaultFontColor),r=Si.options._parseFont(n),l=Si.options.toPadding(n.padding),h=r.lineHeight/2,u=i.position,c=0;if(t.isHorizontal())s=t.left+t.width/2,o="bottom"===u?t.bottom-h-l.bottom:t.top+h+l.top;else{var d="left"===u;s=d?t.left+h+l.top:t.right-h-l.top,o=t.top+t.height/2,c=d?-.5*Math.PI:.5*Math.PI}e.save(),e.translate(s,o),e.rotate(c),e.textAlign="center",e.textBaseline="middle",e.fillStyle=a,e.font=r.string,e.fillText(n.labelString,0,0),e.restore()}},draw:function(t){var e=this;e._isVisible()&&(e._drawGrid(t),e._drawTitle(),e._drawLabels())},_layers:function(){var t=this,e=t.options,i=e.ticks&&e.ticks.z||0,n=e.gridLines&&e.gridLines.z||0;return t._isVisible()&&i!==n&&t.draw===t._draw?[{z:n,draw:function(){t._drawGrid.apply(t,arguments),t._drawTitle.apply(t,arguments)}},{z:i,draw:function(){t._drawLabels.apply(t,arguments)}}]:[{z:i,draw:function(){t.draw.apply(t,arguments)}}]},_getMatchingVisibleMetas:function(t){var e=this,i=e.isHorizontal();return e.chart._getSortedVisibleDatasetMetas().filter(function(n){return(!t||n.type===t)&&(i?n.xAxisID===e.id:n.yAxisID===e.id)})}});ls.prototype._draw=ls.prototype.draw;var hs=ls,us=Si.isNullOrUndef,cs={position:"bottom"},ds=hs.extend({determineDataLimits:function(){var t,e=this,i=e._getLabels(),n=e.options.ticks,s=n.min,o=n.max,a=0,r=i.length-1;void 0!==s&&(t=i.indexOf(s))>=0&&(a=t),void 0!==o&&(t=i.indexOf(o))>=0&&(r=t),e.minIndex=a,e.maxIndex=r,e.min=i[a],e.max=i[r]},buildTicks:function(){var t=this,e=t._getLabels(),i=t.minIndex,n=t.maxIndex;t.ticks=0===i&&n===e.length-1?e:e.slice(i,n+1)},getLabelForIndex:function(t,e){var i=this,n=i.chart;return n.getDatasetMeta(e).controller._getValueScaleId()===i.id?i.getRightValue(n.data.datasets[e].data[t]):i._getLabels()[t]},_configure:function(){var t=this,e=t.options.offset,i=t.ticks;hs.prototype._configure.call(t),t.isHorizontal()||(t._reversePixels=!t._reversePixels),i&&(t._startValue=t.minIndex-(e?.5:0),t._valueRange=Math.max(i.length-(e?0:1),1))},getPixelForValue:function(t,e,i){var n,s,o,a=this;return us(e)||us(i)||(t=a.chart.data.datasets[i].data[e]),us(t)||(n=a.isHorizontal()?t.x:t.y),(void 0!==n||void 0!==t&&isNaN(e))&&(s=a._getLabels(),t=Si.valueOrDefault(n,t),o=s.indexOf(t),e=-1!==o?o:e,isNaN(e)&&(e=t)),a.getPixelForDecimal((e-a._startValue)/a._valueRange)},getPixelForTick:function(t){var e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=this,i=Math.round(e._startValue+e.getDecimalForPixel(t)*e._valueRange);return Math.min(Math.max(i,0),e.ticks.length-1)},getBasePixel:function(){return this.bottom}}),fs=cs;ds._defaults=fs;var ps=Si.noop,gs=Si.isNullOrUndef,ms=hs.extend({getRightValue:function(t){return"string"==typeof t?+t:hs.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options,i=e.ticks;if(i.beginAtZero){var n=Si.sign(t.min),s=Si.sign(t.max);n<0&&s<0?t.max=0:n>0&&s>0&&(t.min=0)}var o=void 0!==i.min||void 0!==i.suggestedMin,a=void 0!==i.max||void 0!==i.suggestedMax;void 0!==i.min?t.min=i.min:void 0!==i.suggestedMin&&(null===t.min?t.min=i.suggestedMin:t.min=Math.min(t.min,i.suggestedMin)),void 0!==i.max?t.max=i.max:void 0!==i.suggestedMax&&(null===t.max?t.max=i.suggestedMax:t.max=Math.max(t.max,i.suggestedMax)),o!==a&&t.min>=t.max&&(o?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,i.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this,i=e.options.ticks,n=i.stepSize,s=i.maxTicksLimit;return n?t=Math.ceil(e.max/n)-Math.floor(e.min/n)+1:(t=e._computeTickLimit(),s=s||11),s&&(t=Math.min(s,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:ps,buildTicks:function(){var t=this,e=t.options,i=e.ticks,n=t.getTickLimit();n=Math.max(2,n);var s={maxTicks:n,min:i.min,max:i.max,precision:i.precision,stepSize:Si.valueOrDefault(i.fixedStepSize,i.stepSize)},o=t.ticks=ie(s,t);t.handleDirectionalChanges(),t.max=Si.max(o),t.min=Si.min(o),i.reverse?(o.reverse(),t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max)},convertTicksToLabels:function(){var t=this;t.ticksAsNumbers=t.ticks.slice(),t.zeroLineIndex=t.ticks.indexOf(0),hs.prototype.convertTicksToLabels.call(t)},_configure:function(){var t,e=this,i=e.getTicks(),n=e.min,s=e.max;hs.prototype._configure.call(e),e.options.offset&&i.length&&(t=(s-n)/Math.max(i.length-1,1)/2,n-=t,s+=t),e._startValue=n,e._endValue=s,e._valueRange=s-n}}),vs={position:"left",ticks:{callback:ns.formatters.linear}},bs=ms.extend({determineDataLimits:function(){var t,e,i,n,s=this,o=s.options,a=s.chart,r=a.data.datasets,l=s._getMatchingVisibleMetas(),h=o.stacked,u={},c=l.length;if(s.min=Number.POSITIVE_INFINITY,s.max=Number.NEGATIVE_INFINITY,void 0===h)for(t=0;!h&&t<c;++t)e=l[t],h=void 0!==e.stack;for(t=0;t<c;++t)e=l[t],i=r[e.index].data,h?se(s,u,e,i):oe(s,e,i);Si.each(u,function(t){n=t.pos.concat(t.neg),s.min=Math.min(s.min,Si.min(n)),s.max=Math.max(s.max,Si.max(n))}),s.min=Si.isFinite(s.min)&&!isNaN(s.min)?s.min:0,s.max=Si.isFinite(s.max)&&!isNaN(s.max)?s.max:1,s.handleTickRangeOptions()},_computeTickLimit:function(){var t,e=this;return e.isHorizontal()?Math.ceil(e.width/40):(t=Si.options._parseFont(e.options.ticks),Math.ceil(e.height/t.lineHeight))},handleDirectionalChanges:function(){this.isHorizontal()||this.ticks.reverse()},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForValue:function(t){var e=this;return e.getPixelForDecimal((+e.getRightValue(t)-e._startValue)/e._valueRange)},getValueForPixel:function(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange},getPixelForTick:function(t){var e=this.ticksAsNumbers;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])}}),_s=vs;bs._defaults=_s;var ys=Si.valueOrDefault,xs=Si.math.log10,ws={position:"left",ticks:{callback:ns.formatters.logarithmic}},ks=hs.extend({determineDataLimits:function(){function t(t){return c?t.xAxisID===r.id:t.yAxisID===r.id}var e,i,n,s,o,a,r=this,l=r.options,h=r.chart,u=h.data.datasets,c=r.isHorizontal();r.min=Number.POSITIVE_INFINITY,r.max=Number.NEGATIVE_INFINITY,r.minNotZero=Number.POSITIVE_INFINITY;var d=l.stacked;if(void 0===d)for(e=0;e<u.length;e++)if(i=h.getDatasetMeta(e),h.isDatasetVisible(e)&&t(i)&&void 0!==i.stack){d=!0;break}if(l.stacked||d){var f={};for(e=0;e<u.length;e++){i=h.getDatasetMeta(e);var p=[i.type,void 0===l.stacked&&void 0===i.stack?e:"",i.stack].join(".");if(h.isDatasetVisible(e)&&t(i))for(void 0===f[p]&&(f[p]=[]),s=u[e].data,o=0,a=s.length;o<a;o++){var g=f[p];n=r._parseValue(s[o]),isNaN(n.min)||isNaN(n.max)||i.data[o].hidden||n.min<0||n.max<0||(g[o]=g[o]||0,g[o]+=n.max)}}Si.each(f,function(t){if(t.length>0){var e=Si.min(t),i=Si.max(t);r.min=Math.min(r.min,e),r.max=Math.max(r.max,i)}})}else for(e=0;e<u.length;e++)if(i=h.getDatasetMeta(e),h.isDatasetVisible(e)&&t(i))for(s=u[e].data,o=0,a=s.length;o<a;o++)n=r._parseValue(s[o]),isNaN(n.min)||isNaN(n.max)||i.data[o].hidden||n.min<0||n.max<0||(r.min=Math.min(n.min,r.min),r.max=Math.max(n.max,r.max),0!==n.min&&(r.minNotZero=Math.min(n.min,r.minNotZero)));r.min=Si.isFinite(r.min)?r.min:null,r.max=Si.isFinite(r.max)?r.max:null,r.minNotZero=Si.isFinite(r.minNotZero)?r.minNotZero:null,this.handleTickRangeOptions()},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;t.min=re(e.min,t.min),t.max=re(e.max,t.max),t.min===t.max&&(0!==t.min&&null!==t.min?(t.min=Math.pow(10,Math.floor(xs(t.min))-1),t.max=Math.pow(10,Math.floor(xs(t.max))+1)):(t.min=1,t.max=10)),null===t.min&&(t.min=Math.pow(10,Math.floor(xs(t.max))-1)),null===t.max&&(t.max=0!==t.min?Math.pow(10,Math.floor(xs(t.min))+1):10),null===t.minNotZero&&(t.min>0?t.minNotZero=t.min:t.max<1?t.minNotZero=Math.pow(10,Math.floor(xs(t.max))):t.minNotZero=1)},buildTicks:function(){var t=this,e=t.options.ticks,i=!t.isHorizontal(),n={min:re(e.min),max:re(e.max)},s=t.ticks=ae(n,t);t.max=Si.max(s),t.min=Si.min(s),e.reverse?(i=!i,t.start=t.max,t.end=t.min):(t.start=t.min,t.end=t.max),i&&s.reverse()},convertTicksToLabels:function(){this.tickValues=this.ticks.slice(),hs.prototype.convertTicksToLabels.call(this)},getLabelForIndex:function(t,e){return this._getScaleLabel(this.chart.data.datasets[e].data[t])},getPixelForTick:function(t){var e=this.tickValues;return t<0||t>e.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(xs(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,i=0;hs.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),i=ys(t.options.ticks.fontSize,mi.global.defaultFontSize)/t._length),t._startValue=xs(e),t._valueOffset=i,t._valueRange=(xs(t.max)-xs(e))/(1-i)},getPixelForValue:function(t){var e=this,i=0;return t=+e.getRightValue(t),t>e.min&&t>0&&(i=(xs(t)-e._startValue)/e._valueRange+e._valueOffset),e.getPixelForDecimal(i)},getValueForPixel:function(t){var e=this,i=e.getDecimalForPixel(t);return 0===i&&0===e.min?0:Math.pow(10,e._startValue+(i-e._valueOffset)*e._valueRange)}}),Cs=ws;ks._defaults=Cs;var Ds=Si.valueOrDefault,Ms=Si.valueAtIndexOrDefault,Ss=Si.options.resolve,Ts={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,color:"rgba(0,0,0,0.1)",lineWidth:1,borderDash:[],borderDashOffset:0},gridLines:{circular:!1},ticks:{showLabelBackdrop:!0,backdropColor:"rgba(255,255,255,0.75)",backdropPaddingY:2,backdropPaddingX:2,callback:ns.formatters.linear},pointLabels:{display:!0,fontSize:10,callback:function(t){return t}}},Is=ms.extend({setDimensions:function(){var t=this;t.width=t.maxWidth,t.height=t.maxHeight,t.paddingTop=le(t.options)/2,t.xCenter=Math.floor(t.width/2),t.yCenter=Math.floor((t.height-t.paddingTop)/2),t.drawingArea=Math.min(t.height-t.paddingTop,t.width)/2},determineDataLimits:function(){var t=this,e=t.chart,i=Number.POSITIVE_INFINITY,n=Number.NEGATIVE_INFINITY;Si.each(e.data.datasets,function(s,o){if(e.isDatasetVisible(o)){var a=e.getDatasetMeta(o);Si.each(s.data,function(e,s){var o=+t.getRightValue(e);isNaN(o)||a.data[s].hidden||(i=Math.min(o,i),n=Math.max(o,n))})}}),t.min=i===Number.POSITIVE_INFINITY?0:i,t.max=n===Number.NEGATIVE_INFINITY?0:n,t.handleTickRangeOptions()},_computeTickLimit:function(){return Math.ceil(this.drawingArea/le(this.options))},convertTicksToLabels:function(){var t=this;ms.prototype.convertTicksToLabels.call(t),t.pointLabels=t.chart.data.labels.map(function(){var e=Si.callback(t.options.pointLabels.callback,arguments,t);return e||0===e?e:""})},getLabelForIndex:function(t,e){return+this.getRightValue(this.chart.data.datasets[e].data[t])},fit:function(){var t=this,e=t.options;e.display&&e.pointLabels.display?ce(t):t.setCenterPoint(0,0,0,0)},setReductions:function(t,e,i){var n=this,s=e.l/Math.sin(i.l),o=Math.max(e.r-n.width,0)/Math.sin(i.r),a=-e.t/Math.cos(i.t),r=-Math.max(e.b-(n.height-n.paddingTop),0)/Math.cos(i.b);s=ve(s),o=ve(o),a=ve(a),r=ve(r),n.drawingArea=Math.min(Math.floor(t-(s+o)/2),Math.floor(t-(a+r)/2)),n.setCenterPoint(s,o,a,r)},setCenterPoint:function(t,e,i,n){var s=this,o=s.width-e-s.drawingArea,a=t+s.drawingArea,r=i+s.drawingArea,l=s.height-s.paddingTop-n-s.drawingArea;s.xCenter=Math.floor((a+o)/2+s.left),s.yCenter=Math.floor((r+l)/2+s.top+s.paddingTop)},getIndexAngle:function(t){var e=this.chart,i=360/e.data.labels.length,n=e.options||{},s=n.startAngle||0,o=(t*i+s)%360;return(o<0?o+360:o)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(Si.isNullOrUndef(t))return NaN;var i=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*i:(t-e.min)*i},getPointPosition:function(t,e){var i=this,n=i.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(n)*e+i.xCenter,y:Math.sin(n)*e+i.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this,i=e.min,n=e.max;return e.getPointPositionForValue(t||0,e.beginAtZero?0:i<0&&n<0?n:i>0&&n>0?i:0)},_drawGrid:function(){var t,e,i,n=this,s=n.ctx,o=n.options,a=o.gridLines,r=o.angleLines,l=Ds(r.lineWidth,a.lineWidth),h=Ds(r.color,a.color);if(o.pointLabels.display&&ge(n),a.display&&Si.each(n.ticks,function(t,i){0!==i&&(e=n.getDistanceFromCenterForValue(n.ticksAsNumbers[i]),me(n,a,e,i))}),r.display&&l&&h){for(s.save(),s.lineWidth=l,s.strokeStyle=h,s.setLineDash&&(s.setLineDash(Ss([r.borderDash,a.borderDash,[]])),s.lineDashOffset=Ss([r.borderDashOffset,a.borderDashOffset,0])),t=n.chart.data.labels.length-1;t>=0;t--)e=n.getDistanceFromCenterForValue(o.ticks.reverse?n.min:n.max),i=n.getPointPosition(t,e),s.beginPath(),s.moveTo(n.xCenter,n.yCenter),s.lineTo(i.x,i.y),s.stroke();s.restore()}},_drawLabels:function(){var t=this,e=t.ctx,i=t.options,n=i.ticks;if(n.display){var s,o,a=t.getIndexAngle(0),r=Si.options._parseFont(n),l=Ds(n.fontColor,mi.global.defaultFontColor);e.save(),e.font=r.string,e.translate(t.xCenter,t.yCenter),e.rotate(a),e.textAlign="center",e.textBaseline="middle",Si.each(t.ticks,function(i,a){(0!==a||n.reverse)&&(s=t.getDistanceFromCenterForValue(t.ticksAsNumbers[a]),n.showLabelBackdrop&&(o=e.measureText(i).width,e.fillStyle=n.backdropColor,e.fillRect(-o/2-n.backdropPaddingX,-s-r.size/2-n.backdropPaddingY,o+2*n.backdropPaddingX,r.size+2*n.backdropPaddingY)),e.fillStyle=l,e.fillText(i,0,-s))}),e.restore()}},_drawTitle:Si.noop}),Ps=Ts;Is._defaults=Ps;var As=Si._deprecated,Fs=Si.options.resolve,Os=Si.valueOrDefault,Es=Number.MIN_SAFE_INTEGER||-9007199254740991,Ns=Number.MAX_SAFE_INTEGER||9007199254740991,zs={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},Ls=Object.keys(zs),Hs={position:"bottom",distribution:"linear",bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,displayFormat:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{autoSkip:!1,source:"auto",major:{enabled:!1}}},Rs=hs.extend({initialize:function(){this.mergeTicksOptions(),hs.prototype.initialize.call(this)},update:function(){var t=this,e=t.options,i=e.time||(e.time={}),n=t._adapter=new is._date(e.adapters.date);return As("time scale",i.format,"time.format","time.parser"),As("time scale",i.min,"time.min","ticks.min"),As("time scale",i.max,"time.max","ticks.max"),Si.mergeIf(i.displayFormats,n.formats()),hs.prototype.update.apply(t,arguments)},getRightValue:function(t){return t&&void 0!==t.t&&(t=t.t),hs.prototype.getRightValue.call(this,t)},determineDataLimits:function(){var t,e,i,n,s,o,a,r=this,l=r.chart,h=r._adapter,u=r.options,c=u.time.unit||"day",d=Ns,f=Es,p=[],g=[],m=[],v=r._getLabels();for(t=0,i=v.length;t<i;++t)m.push(Me(r,v[t]));for(t=0,i=(l.data.datasets||[]).length;t<i;++t)if(l.isDatasetVisible(t))if(s=l.data.datasets[t].data,Si.isObject(s[0]))for(g[t]=[],e=0,n=s.length;e<n;++e)o=Me(r,s[e]),p.push(o),g[t][e]=o;else g[t]=m.slice(0),a||(p=p.concat(m),a=!0);else g[t]=[];m.length&&(d=Math.min(d,m[0]),f=Math.max(f,m[m.length-1])),p.length&&(p=i>1?_e(p).sort(be):p.sort(be),d=Math.min(d,p[0]),f=Math.max(f,p[p.length-1])),d=Me(r,ye(u))||d,f=Me(r,xe(u))||f,d=d===Ns?+h.startOf(Date.now(),c):d,f=f===Es?+h.endOf(Date.now(),c)+1:f,r.min=Math.min(d,f),r.max=Math.max(d+1,f),r._table=[],
r._timestamps={data:p,datasets:g,labels:m}},buildTicks:function(){var t,e,i,n=this,s=n.min,o=n.max,a=n.options,r=a.ticks,l=a.time,h=n._timestamps,u=[],c=n.getLabelCapacity(s),d=r.source,f=a.distribution;for(h="data"===d||"auto"===d&&"series"===f?h.data:"labels"===d?h.labels:Pe(n,s,o,c),"ticks"===a.bounds&&h.length&&(s=h[0],o=h[h.length-1]),s=Me(n,ye(a))||s,o=Me(n,xe(a))||o,t=0,e=h.length;t<e;++t)(i=h[t])>=s&&i<=o&&u.push(i);return n.min=s,n.max=o,n._unit=l.unit||(r.autoSkip?Se(l.minUnit,n.min,n.max,c):Te(n,u.length,l.minUnit,n.min,n.max)),n._majorUnit=r.major.enabled&&"year"!==n._unit?Ie(n._unit):void 0,n._table=we(n._timestamps.data,s,o,f),n._offsets=Ae(n._table,u,s,o,a),r.reverse&&u.reverse(),Oe(n,u,n._majorUnit)},getLabelForIndex:function(t,e){var i=this,n=i._adapter,s=i.chart.data,o=i.options.time,a=s.labels&&t<s.labels.length?s.labels[t]:"",r=s.datasets[e].data[t];return Si.isObject(r)&&(a=i.getRightValue(r)),o.tooltipFormat?n.format(De(i,a),o.tooltipFormat):"string"==typeof a?a:n.format(De(i,a),o.displayFormats.datetime)},tickFormatFunction:function(t,e,i,n){var s=this,o=s._adapter,a=s.options,r=a.time.displayFormats,l=r[s._unit],h=s._majorUnit,u=r[h],c=i[e],d=a.ticks,f=h&&u&&c&&c.major,p=o.format(t,n||(f?u:l)),g=f?d.major:d.minor,m=Fs([g.callback,g.userCallback,d.callback,d.userCallback]);return m?m(p,e,i):p},convertTicksToLabels:function(t){var e,i,n=[];for(e=0,i=t.length;e<i;++e)n.push(this.tickFormatFunction(t[e].value,e,t));return n},getPixelForOffset:function(t){var e=this,i=e._offsets,n=Ce(e._table,"time",t,"pos");return e.getPixelForDecimal((i.start+n)*i.factor)},getPixelForValue:function(t,e,i){var n=this,s=null;if(void 0!==e&&void 0!==i&&(s=n._timestamps.datasets[i][e]),null===s&&(s=Me(n,t)),null!==s)return n.getPixelForOffset(s)},getPixelForTick:function(t){var e=this.getTicks();return t>=0&&t<e.length?this.getPixelForOffset(e[t].value):null},getValueForPixel:function(t){var e=this,i=e._offsets,n=e.getDecimalForPixel(t)/i.factor-i.end,s=Ce(e._table,"pos",n,"time");return e._adapter._create(s)},_getLabelSize:function(t){var e=this,i=e.options.ticks,n=e.ctx.measureText(t).width,s=Si.toRadians(e.isHorizontal()?i.maxRotation:i.minRotation),o=Math.cos(s),a=Math.sin(s),r=Os(i.fontSize,mi.global.defaultFontSize);return{w:n*o+r*a,h:n*a+r*o}},getLabelWidth:function(t){return this._getLabelSize(t).w},getLabelCapacity:function(t){var e=this,i=e.options.time,n=i.displayFormats,s=n[i.unit]||n.millisecond,o=e.tickFormatFunction(t,0,Oe(e,[t],e._majorUnit),s),a=e._getLabelSize(o),r=Math.floor(e.isHorizontal()?e.width/a.w:e.height/a.h);return e.options.offset&&r--,r>0?r:1}}),Ws=Hs;Rs._defaults=Ws;var Bs={category:ds,linear:bs,logarithmic:ks,radialLinear:Is,time:Rs},Vs={datetime:"MMM D, YYYY, h:mm:ss a",millisecond:"h:mm:ss.SSS a",second:"h:mm:ss a",minute:"h:mm a",hour:"hA",day:"MMM D",week:"ll",month:"MMM YYYY",quarter:"[Q]Q - YYYY",year:"YYYY"};is._date.override("function"==typeof t?{_id:"moment",formats:function(){return Vs},parse:function(e,i){return"string"==typeof e&&"string"==typeof i?e=t(e,i):e instanceof t||(e=t(e)),e.isValid()?e.valueOf():null},format:function(e,i){return t(e).format(i)},add:function(e,i,n){return t(e).add(i,n).valueOf()},diff:function(e,i,n){return t(e).diff(t(i),n)},startOf:function(e,i,n){return e=t(e),"isoWeek"===i?e.isoWeekday(n).valueOf():e.startOf(i).valueOf()},endOf:function(e,i){return t(e).endOf(i).valueOf()},_create:function(e){return t(e)}}:{}),mi._set("global",{plugins:{filler:{propagate:!0}}});var Us={dataset:function(t){var e=t.fill,i=t.chart,n=i.getDatasetMeta(e),s=n&&i.isDatasetVisible(e),o=s&&n.dataset._children||[],a=o.length||0;return a?function(t,e){return e<a&&o[e]._view||null}:null},boundary:function(t){var e=t.boundary,i=e?e.x:null,n=e?e.y:null;return Si.isArray(e)?function(t,i){return e[i]}:function(t){return{x:null===i?t.x:i,y:null===n?t.y:n}}}},js={id:"filler",afterDatasetsUpdate:function(t,e){var i,n,s,o,a=(t.data.datasets||[]).length,r=e.propagate,l=[];for(n=0;n<a;++n)i=t.getDatasetMeta(n),s=i.dataset,o=null,s&&s._model&&s instanceof Zi.Line&&(o={visible:t.isDatasetVisible(n),fill:Ee(s,n,a),chart:t,el:s}),i.$filler=o,l.push(o);for(n=0;n<a;++n)(o=l[n])&&(o.fill=He(l,n,r),o.boundary=Le(o),o.mapper=Re(o))},beforeDatasetsDraw:function(t){var e,i,n,s,o,a,r,l=t._getSortedVisibleDatasetMetas(),h=t.ctx;for(i=l.length-1;i>=0;--i)(e=l[i].$filler)&&e.visible&&(n=e.el,s=n._view,o=n._children||[],a=e.mapper,r=s.backgroundColor||mi.global.defaultColor,a&&r&&o.length&&(Si.canvas.clipArea(h,t.chartArea),Ve(h,o,a,s,r,n._loop),Si.canvas.unclipArea(h)))}},Ys=Si.rtl.getRtlAdapter,qs=Si.noop,$s=Si.valueOrDefault;mi._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var i=e.datasetIndex,n=this.chart,s=n.getDatasetMeta(i);s.hidden=null===s.hidden?!n.data.datasets[i].hidden:null,n.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(t){var e=t.data.datasets,i=t.options.legend||{},n=i.labels&&i.labels.usePointStyle;return t._getSortedDatasetMetas().map(function(i){var s=i.controller.getStyle(n?0:void 0);return{text:e[i.index].label,fillStyle:s.backgroundColor,hidden:!t.isDatasetVisible(i.index),lineCap:s.borderCapStyle,lineDash:s.borderDash,lineDashOffset:s.borderDashOffset,lineJoin:s.borderJoinStyle,lineWidth:s.borderWidth,strokeStyle:s.borderColor,pointStyle:s.pointStyle,rotation:s.rotation,datasetIndex:i.index}},this)}}},legendCallback:function(t){var e,i,n,s,o=document.createElement("ul"),a=t.data.datasets;for(o.setAttribute("class",t.id+"-legend"),e=0,i=a.length;e<i;e++)n=o.appendChild(document.createElement("li")),s=n.appendChild(document.createElement("span")),s.style.backgroundColor=a[e].backgroundColor,a[e].label&&n.appendChild(document.createTextNode(a[e].label));return o.outerHTML}});var Ks=Ei.extend({initialize:function(t){var e=this;Si.extend(e,t),e.legendHitBoxes=[],e._hoveredItem=null,e.doughnutMode=!1},beforeUpdate:qs,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:qs,beforeSetDimensions:qs,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:qs,beforeBuildLabels:qs,buildLabels:function(){var t=this,e=t.options.labels||{},i=Si.callback(e.generateLabels,[t.chart],t)||[];e.filter&&(i=i.filter(function(i){return e.filter(i,t.chart.data)})),t.options.reverse&&i.reverse(),t.legendItems=i},afterBuildLabels:qs,beforeFit:qs,fit:function(){var t=this,e=t.options,i=e.labels,n=e.display,s=t.ctx,o=Si.options._parseFont(i),a=o.size,r=t.legendHitBoxes=[],l=t.minSize,h=t.isHorizontal();if(h?(l.width=t.maxWidth,l.height=n?10:0):(l.width=n?10:0,l.height=t.maxHeight),!n)return void(t.width=l.width=t.height=l.height=0);if(s.font=o.string,h){var u=t.lineWidths=[0],c=0;s.textAlign="left",s.textBaseline="middle",Si.each(t.legendItems,function(t,e){var n=Ue(i,a),o=n+a/2+s.measureText(t.text).width;(0===e||u[u.length-1]+o+2*i.padding>l.width)&&(c+=a+i.padding,u[u.length-(e>0?0:1)]=0),r[e]={left:0,top:0,width:o,height:a},u[u.length-1]+=o+i.padding}),l.height+=c}else{var d=i.padding,f=t.columnWidths=[],p=t.columnHeights=[],g=i.padding,m=0,v=0;Si.each(t.legendItems,function(t,e){var n=Ue(i,a),o=n+a/2+s.measureText(t.text).width;e>0&&v+a+2*d>l.height&&(g+=m+i.padding,f.push(m),p.push(v),m=0,v=0),m=Math.max(m,o),v+=a+d,r[e]={left:0,top:0,width:o,height:a}}),g+=m,f.push(m),p.push(v),l.width+=g}t.width=l.width,t.height=l.height},afterFit:qs,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var t=this,e=t.options,i=e.labels,n=mi.global,s=n.defaultColor,o=n.elements.line,a=t.height,r=t.columnHeights,l=t.width,h=t.lineWidths;if(e.display){var u,c=Ys(e.rtl,t.left,t.minSize.width),d=t.ctx,f=$s(i.fontColor,n.defaultFontColor),p=Si.options._parseFont(i),g=p.size;d.textAlign=c.textAlign("left"),d.textBaseline="middle",d.lineWidth=.5,d.strokeStyle=f,d.fillStyle=f,d.font=p.string;var m=Ue(i,g),v=t.legendHitBoxes,b=function(t,e,n){if(!(isNaN(m)||m<=0)){d.save();var a=$s(n.lineWidth,o.borderWidth);if(d.fillStyle=$s(n.fillStyle,s),d.lineCap=$s(n.lineCap,o.borderCapStyle),d.lineDashOffset=$s(n.lineDashOffset,o.borderDashOffset),d.lineJoin=$s(n.lineJoin,o.borderJoinStyle),d.lineWidth=a,d.strokeStyle=$s(n.strokeStyle,s),d.setLineDash&&d.setLineDash($s(n.lineDash,o.borderDash)),i&&i.usePointStyle){var r=m*Math.SQRT2/2,l=c.xPlus(t,m/2),h=e+g/2;Si.canvas.drawPoint(d,n.pointStyle,r,l,h,n.rotation)}else d.fillRect(c.leftForLtr(t,m),e,m,g),0!==a&&d.strokeRect(c.leftForLtr(t,m),e,m,g);d.restore()}},_=function(t,e,i,n){var s=g/2,o=c.xPlus(t,m+s),a=e+s;d.fillText(i.text,o,a),i.hidden&&(d.beginPath(),d.lineWidth=2,d.moveTo(o,a),d.lineTo(c.xPlus(o,n),a),d.stroke())},y=function(t,n){switch(e.align){case"start":return i.padding;case"end":return t-n;default:return(t-n+i.padding)/2}},x=t.isHorizontal();u=x?{x:t.left+y(l,h[0]),y:t.top+i.padding,line:0}:{x:t.left+i.padding,y:t.top+y(a,r[0]),line:0},Si.rtl.overrideTextDirection(t.ctx,e.textDirection);var w=g+i.padding;Si.each(t.legendItems,function(e,n){var s=d.measureText(e.text).width,o=m+g/2+s,f=u.x,p=u.y;c.setWidth(t.minSize.width),x?n>0&&f+o+i.padding>t.left+t.minSize.width&&(p=u.y+=w,u.line++,f=u.x=t.left+y(l,h[u.line])):n>0&&p+w>t.top+t.minSize.height&&(f=u.x=f+t.columnWidths[u.line]+i.padding,u.line++,p=u.y=t.top+y(a,r[u.line]));var k=c.x(f);b(k,p,e),v[n].left=c.leftForLtr(k,v[n].width),v[n].top=p,_(k,p,e,s),x?u.x+=o+i.padding:u.y+=w}),Si.rtl.restoreTextDirection(t.ctx,e.textDirection)}},_getLegendItemAt:function(t,e){var i,n,s,o=this;if(t>=o.left&&t<=o.right&&e>=o.top&&e<=o.bottom)for(s=o.legendHitBoxes,i=0;i<s.length;++i)if(n=s[i],t>=n.left&&t<=n.left+n.width&&e>=n.top&&e<=n.top+n.height)return o.legendItems[i];return null},handleEvent:function(t){var e,i=this,n=i.options,s="mouseup"===t.type?"click":t.type;if("mousemove"===s){if(!n.onHover&&!n.onLeave)return}else{if("click"!==s)return;if(!n.onClick)return}e=i._getLegendItemAt(t.x,t.y),"click"===s?e&&n.onClick&&n.onClick.call(i,t.native,e):(n.onLeave&&e!==i._hoveredItem&&(i._hoveredItem&&n.onLeave.call(i,t.native,i._hoveredItem),i._hoveredItem=e),n.onHover&&e&&n.onHover.call(i,t.native,e))}}),Xs={id:"legend",_element:Ks,beforeInit:function(t){var e=t.options.legend;e&&je(t,e)},beforeUpdate:function(t){var e=t.options.legend,i=t.legend;e?(Si.mergeIf(e,mi.global.legend),i?(In.configure(t,i,e),i.options=e):je(t,e)):i&&(In.removeBox(t,i),delete t.legend)},afterEvent:function(t,e){var i=t.legend;i&&i.handleEvent(e)}},Gs=Si.noop;mi._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var Qs=Ei.extend({initialize:function(t){var e=this;Si.extend(e,t),e.legendHitBoxes=[]},beforeUpdate:Gs,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:Gs,beforeSetDimensions:Gs,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:Gs,beforeBuildLabels:Gs,buildLabels:Gs,afterBuildLabels:Gs,beforeFit:Gs,fit:function(){var t,e,i=this,n=i.options,s=i.minSize={},o=i.isHorizontal();if(!n.display)return void(i.width=s.width=i.height=s.height=0);t=Si.isArray(n.text)?n.text.length:1,e=t*Si.options._parseFont(n).lineHeight+2*n.padding,i.width=s.width=o?i.maxWidth:e,i.height=s.height=o?e:i.maxHeight},afterFit:Gs,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this,e=t.ctx,i=t.options;if(i.display){var n,s,o,a=Si.options._parseFont(i),r=a.lineHeight,l=r/2+i.padding,h=0,u=t.top,c=t.left,d=t.bottom,f=t.right;e.fillStyle=Si.valueOrDefault(i.fontColor,mi.global.defaultFontColor),e.font=a.string,t.isHorizontal()?(s=c+(f-c)/2,o=u+l,n=f-c):(s="left"===i.position?c+l:f-l,o=u+(d-u)/2,n=d-u,h=Math.PI*("left"===i.position?-.5:.5)),e.save(),e.translate(s,o),e.rotate(h),e.textAlign="center",e.textBaseline="middle";var p=i.text;if(Si.isArray(p))for(var g=0,m=0;m<p.length;++m)e.fillText(p[m],0,g,n),g+=r;else e.fillText(p,0,0,n);e.restore()}}}),Zs={id:"title",_element:Qs,beforeInit:function(t){var e=t.options.title;e&&Ye(t,e)},beforeUpdate:function(t){var e=t.options.title,i=t.titleBlock;e?(Si.mergeIf(e,mi.global.title),i?(In.configure(t,i,e),i.options=e):Ye(t,e)):i&&(In.removeBox(t,i),delete t.titleBlock)}},Js={},to=js,eo=Xs,io=Zs;Js.filler=to,Js.legend=eo,Js.title=io,ts.helpers=Si,function(){function t(t,e,i){var n;return"string"==typeof t?(n=parseInt(t,10),-1!==t.indexOf("%")&&(n=n/100*e.parentNode[i])):n=t,n}function e(t){return void 0!==t&&null!==t&&"none"!==t}function i(i,n,s){var o=document.defaultView,a=Si._getParentNode(i),r=o.getComputedStyle(i)[n],l=o.getComputedStyle(a)[n],h=e(r),u=e(l),c=Number.POSITIVE_INFINITY;return h||u?Math.min(h?t(r,i,s):c,u?t(l,a,s):c):"none"}Si.where=function(t,e){if(Si.isArray(t)&&Array.prototype.filter)return t.filter(e);var i=[];return Si.each(t,function(t){e(t)&&i.push(t)}),i},Si.findIndex=Array.prototype.findIndex?function(t,e,i){return t.findIndex(e,i)}:function(t,e,i){i=void 0===i?t:i;for(var n=0,s=t.length;n<s;++n)if(e.call(i,t[n],n,t))return n;return-1},Si.findNextWhere=function(t,e,i){Si.isNullOrUndef(i)&&(i=-1);for(var n=i+1;n<t.length;n++){var s=t[n];if(e(s))return s}},Si.findPreviousWhere=function(t,e,i){Si.isNullOrUndef(i)&&(i=t.length);for(var n=i-1;n>=0;n--){var s=t[n];if(e(s))return s}},Si.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},Si.almostEquals=function(t,e,i){return Math.abs(t-e)<i},Si.almostWhole=function(t,e){var i=Math.round(t);return i-e<=t&&i+e>=t},Si.max=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.max(t,e)},Number.NEGATIVE_INFINITY)},Si.min=function(t){return t.reduce(function(t,e){return isNaN(e)?t:Math.min(t,e)},Number.POSITIVE_INFINITY)},Si.sign=Math.sign?function(t){return Math.sign(t)}:function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1},Si.toRadians=function(t){return t*(Math.PI/180)},Si.toDegrees=function(t){return t*(180/Math.PI)},Si._decimalPlaces=function(t){if(Si.isFinite(t)){for(var e=1,i=0;Math.round(t*e)/e!==t;)e*=10,i++;return i}},Si.getAngleFromPoint=function(t,e){var i=e.x-t.x,n=e.y-t.y,s=Math.sqrt(i*i+n*n),o=Math.atan2(n,i);return o<-.5*Math.PI&&(o+=2*Math.PI),{angle:o,distance:s}},Si.distanceBetweenPoints=function(t,e){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},Si.aliasPixel=function(t){return t%2==0?0:.5},Si._alignPixel=function(t,e,i){var n=t.currentDevicePixelRatio,s=i/2;return Math.round((e-s)*n)/n+s},Si.splineCurve=function(t,e,i,n){var s=t.skip?e:t,o=e,a=i.skip?e:i,r=Math.sqrt(Math.pow(o.x-s.x,2)+Math.pow(o.y-s.y,2)),l=Math.sqrt(Math.pow(a.x-o.x,2)+Math.pow(a.y-o.y,2)),h=r/(r+l),u=l/(r+l);h=isNaN(h)?0:h,u=isNaN(u)?0:u;var c=n*h,d=n*u;return{previous:{x:o.x-c*(a.x-s.x),y:o.y-c*(a.y-s.y)},next:{x:o.x+d*(a.x-s.x),y:o.y+d*(a.y-s.y)}}},Si.EPSILON=Number.EPSILON||1e-14,Si.splineCurveMonotone=function(t){var e,i,n,s,o=(t||[]).map(function(t){return{model:t._model,deltaK:0,mK:0}}),a=o.length;for(e=0;e<a;++e)if(n=o[e],!n.model.skip){if(i=e>0?o[e-1]:null,(s=e<a-1?o[e+1]:null)&&!s.model.skip){var r=s.model.x-n.model.x;n.deltaK=0!==r?(s.model.y-n.model.y)/r:0}!i||i.model.skip?n.mK=n.deltaK:!s||s.model.skip?n.mK=i.deltaK:this.sign(i.deltaK)!==this.sign(n.deltaK)?n.mK=0:n.mK=(i.deltaK+n.deltaK)/2}var l,h,u,c;for(e=0;e<a-1;++e)n=o[e],s=o[e+1],n.model.skip||s.model.skip||(Si.almostEquals(n.deltaK,0,this.EPSILON)?n.mK=s.mK=0:(l=n.mK/n.deltaK,h=s.mK/n.deltaK,(c=Math.pow(l,2)+Math.pow(h,2))<=9||(u=3/Math.sqrt(c),n.mK=l*u*n.deltaK,s.mK=h*u*n.deltaK)));var d;for(e=0;e<a;++e)n=o[e],n.model.skip||(i=e>0?o[e-1]:null,s=e<a-1?o[e+1]:null,i&&!i.model.skip&&(d=(n.model.x-i.model.x)/3,n.model.controlPointPreviousX=n.model.x-d,n.model.controlPointPreviousY=n.model.y-d*n.mK),s&&!s.model.skip&&(d=(s.model.x-n.model.x)/3,n.model.controlPointNextX=n.model.x+d,n.model.controlPointNextY=n.model.y+d*n.mK))},Si.nextItem=function(t,e,i){return i?e>=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},Si.previousItem=function(t,e,i){return i?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},Si.niceNum=function(t,e){var i=Math.floor(Si.log10(t)),n=t/Math.pow(10,i);return(e?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,i)},Si.requestAnimFrame=function(){return"undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),Si.getRelativePosition=function(t,e){var i,n,s=t.originalEvent||t,o=t.target||t.srcElement,a=o.getBoundingClientRect(),r=s.touches;r&&r.length>0?(i=r[0].clientX,n=r[0].clientY):(i=s.clientX,n=s.clientY);var l=parseFloat(Si.getStyle(o,"padding-left")),h=parseFloat(Si.getStyle(o,"padding-top")),u=parseFloat(Si.getStyle(o,"padding-right")),c=parseFloat(Si.getStyle(o,"padding-bottom")),d=a.right-a.left-l-u,f=a.bottom-a.top-h-c;return i=Math.round((i-a.left-l)/d*o.width/e.currentDevicePixelRatio),n=Math.round((n-a.top-h)/f*o.height/e.currentDevicePixelRatio),{x:i,y:n}},Si.getConstraintWidth=function(t){return i(t,"max-width","clientWidth")},Si.getConstraintHeight=function(t){return i(t,"max-height","clientHeight")},Si._calculatePadding=function(t,e,i){return e=Si.getStyle(t,e),e.indexOf("%")>-1?i*parseInt(e,10)/100:parseInt(e,10)},Si._getParentNode=function(t){var e=t.parentNode;return e&&"[object ShadowRoot]"===e.toString()&&(e=e.host),e},Si.getMaximumWidth=function(t){var e=Si._getParentNode(t);if(!e)return t.clientWidth;var i=e.clientWidth,n=Si._calculatePadding(e,"padding-left",i),s=Si._calculatePadding(e,"padding-right",i),o=i-n-s,a=Si.getConstraintWidth(t);return isNaN(a)?o:Math.min(o,a)},Si.getMaximumHeight=function(t){var e=Si._getParentNode(t);if(!e)return t.clientHeight;var i=e.clientHeight,n=Si._calculatePadding(e,"padding-top",i),s=Si._calculatePadding(e,"padding-bottom",i),o=i-n-s,a=Si.getConstraintHeight(t);return isNaN(a)?o:Math.min(o,a)},Si.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},Si.retinaScale=function(t,e){var i=t.currentDevicePixelRatio=e||"undefined"!=typeof window&&window.devicePixelRatio||1;if(1!==i){var n=t.canvas,s=t.height,o=t.width;n.height=s*i,n.width=o*i,t.ctx.scale(i,i),n.style.height||n.style.width||(n.style.height=s+"px",n.style.width=o+"px")}},Si.fontString=function(t,e,i){return e+" "+t+"px "+i},Si.longestText=function(t,e,i,n){n=n||{};var s=n.data=n.data||{},o=n.garbageCollect=n.garbageCollect||[];n.font!==e&&(s=n.data={},o=n.garbageCollect=[],n.font=e),t.font=e;var a,r,l,h,u,c=0,d=i.length;for(a=0;a<d;a++)if(void 0!==(h=i[a])&&null!==h&&!0!==Si.isArray(h))c=Si.measureText(t,s,o,c,h);else if(Si.isArray(h))for(r=0,l=h.length;r<l;r++)void 0===(u=h[r])||null===u||Si.isArray(u)||(c=Si.measureText(t,s,o,c,u));var f=o.length/2;if(f>i.length){for(a=0;a<f;a++)delete s[o[a]];o.splice(0,f)}return c},Si.measureText=function(t,e,i,n,s){var o=e[s];return o||(o=e[s]=t.measureText(s).width,i.push(s)),o>n&&(n=o),n},Si.numberOfLabelLines=function(t){var e=1;return Si.each(t,function(t){Si.isArray(t)&&t.length>e&&(e=t.length)}),e},Si.color=ii?function(t){return t instanceof CanvasGradient&&(t=mi.global.defaultColor),ii(t)}:function(t){return console.error("Color.js not found!"),t},Si.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:Si.color(t).saturate(.5).darken(.1).rgbString()}}(),ts._adapters=is,ts.Animation=zi,ts.animationService=Li,ts.controllers=Mn,ts.DatasetController=Bi,ts.defaults=mi,ts.Element=Ei,ts.elements=Zi,ts.Interaction=Sn,ts.layouts=In,ts.platform=Un,ts.plugins=jn,ts.Scale=hs,ts.scaleService=Yn,ts.Ticks=ns,ts.Tooltip=Qn,ts.helpers.each(Bs,function(t,e){ts.scaleService.registerScaleType(e,t,t._defaults)});for(var no in Js)Js.hasOwnProperty(no)&&ts.plugins.register(Js[no]);ts.platform.initialize();var so=ts;return"undefined"!=typeof window&&(window.Chart=ts),ts.Chart=ts,ts.Legend=Js.legend._element,ts.Title=Js.title._element,ts.pluginService=ts.plugins,ts.PluginBase=ts.Element.extend({}),ts.canvasHelpers=ts.helpers.canvas,ts.layoutService=ts.layouts,ts.LinearScaleBase=ms,ts.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(t){ts[t]=function(e,i){return new ts(e,ts.helpers.merge(i||{},{type:t.charAt(0).toLowerCase()+t.slice(1)}))}}),so}),function(t,e){"function"==typeof define&&define.amd?define([],function(){return t.SignaturePad=e()}):"object"==typeof exports?module.exports=e():t.SignaturePad=e()}(this,function(){return function(t){"use strict";var e=function(t,e){var i=this,n=e||{};this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.dotSize=n.dotSize||function(){return(this.minWidth+this.maxWidth)/2},this.penColor=n.penColor||"black",this.backgroundColor=n.backgroundColor||"rgba(0,0,0,0)",this.onEnd=n.onEnd,this.onBegin=n.onBegin,this._canvas=t,this._ctx=t.getContext("2d"),this.clear(),this._handleMouseDown=function(t){1===t.which&&(i._mouseButtonDown=!0,i._strokeBegin(t))},this._handleMouseMove=function(t){i._mouseButtonDown&&i._strokeUpdate(t)},this._handleMouseUp=function(t){1===t.which&&i._mouseButtonDown&&(i._mouseButtonDown=!1,i._strokeEnd(t))},this._handleTouchStart=function(t){if(1==t.targetTouches.length){var e=t.changedTouches[0];i._strokeBegin(e)}},this._handleTouchMove=function(t){t.preventDefault();var e=t.targetTouches[0];i._strokeUpdate(e)},this._handleTouchEnd=function(t){t.target===i._canvas&&(t.preventDefault(),i._strokeEnd(t))},this._handleMouseEvents(),this._handleTouchEvents()};e.prototype.clear=function(){var t=this._ctx,e=this._canvas;t.fillStyle=this.backgroundColor,t.clearRect(0,0,e.width,e.height),t.fillRect(0,0,e.width,e.height),this._reset()},e.prototype.toDataURL=function(t,e){var i=this._canvas;return i.toDataURL.apply(i,arguments)},e.prototype.fromDataURL=function(t){var e=this,i=new Image,n=window.devicePixelRatio||1,s=this._canvas.width/n,o=this._canvas.height/n;this._reset(),i.src=t,i.onload=function(){e._ctx.drawImage(i,0,0,s,o)},this._isEmpty=!1},e.prototype._strokeUpdate=function(t){var e=this._createPoint(t);this._addPoint(e)},e.prototype._strokeBegin=function(t){this._reset(),this._strokeUpdate(t),"function"==typeof this.onBegin&&this.onBegin(t)},e.prototype._strokeDraw=function(t){var e=this._ctx,i="function"==typeof this.dotSize?this.dotSize():this.dotSize;e.beginPath(),this._drawPoint(t.x,t.y,i),e.closePath(),e.fill()},e.prototype._strokeEnd=function(t){var e=this.points.length>2,i=this.points[0];!e&&i&&this._strokeDraw(i),"function"==typeof this.onEnd&&this.onEnd(t)},e.prototype._handleMouseEvents=function(){this._mouseButtonDown=!1,this._canvas.addEventListener("mousedown",this._handleMouseDown),this._canvas.addEventListener("mousemove",this._handleMouseMove),t.addEventListener("mouseup",this._handleMouseUp)},e.prototype._handleTouchEvents=function(){this._canvas.style.msTouchAction="none",this._canvas.style.touchAction="none",this._canvas.addEventListener("touchstart",this._handleTouchStart),this._canvas.addEventListener("touchmove",this._handleTouchMove),this._canvas.addEventListener("touchend",this._handleTouchEnd)},e.prototype.on=function(){this._handleMouseEvents(),this._handleTouchEvents()},e.prototype.off=function(){this._canvas.removeEventListener("mousedown",this._handleMouseDown),this._canvas.removeEventListener("mousemove",this._handleMouseMove),t.removeEventListener("mouseup",this._handleMouseUp),this._canvas.removeEventListener("touchstart",this._handleTouchStart),this._canvas.removeEventListener("touchmove",this._handleTouchMove),this._canvas.removeEventListener("touchend",this._handleTouchEnd)},e.prototype.isEmpty=function(){return this._isEmpty},e.prototype._reset=function(){this.points=[],this._lastVelocity=0,this._lastWidth=(this.minWidth+this.maxWidth)/2,this._isEmpty=!0,this._ctx.fillStyle=this.penColor},e.prototype._createPoint=function(t){var e=this._canvas.getBoundingClientRect();return new i(t.clientX-e.left,t.clientY-e.top)},e.prototype._addPoint=function(t){var e,i,s,o,a=this.points;a.push(t),a.length>2&&(3===a.length&&a.unshift(a[0]),o=this._calculateCurveControlPoints(a[0],a[1],a[2]),e=o.c2,o=this._calculateCurveControlPoints(a[1],a[2],a[3]),i=o.c1,s=new n(a[1],e,i,a[2]),this._addCurve(s),a.shift())},e.prototype._calculateCurveControlPoints=function(t,e,n){var s=t.x-e.x,o=t.y-e.y,a=e.x-n.x,r=e.y-n.y,l={x:(t.x+e.x)/2,y:(t.y+e.y)/2},h={x:(e.x+n.x)/2,y:(e.y+n.y)/2},u=Math.sqrt(s*s+o*o),c=Math.sqrt(a*a+r*r),d=l.x-h.x,f=l.y-h.y,p=c/(u+c),g={x:h.x+d*p,y:h.y+f*p},m=e.x-g.x,v=e.y-g.y;return{c1:new i(l.x+m,l.y+v),c2:new i(h.x+m,h.y+v)}},e.prototype._addCurve=function(t){var e,i,n=t.startPoint,s=t.endPoint;e=s.velocityFrom(n),e=this.velocityFilterWeight*e+(1-this.velocityFilterWeight)*this._lastVelocity,i=this._strokeWidth(e),this._drawCurve(t,this._lastWidth,i),this._lastVelocity=e,this._lastWidth=i},e.prototype._drawPoint=function(t,e,i){var n=this._ctx;n.moveTo(t,e),n.arc(t,e,i,0,2*Math.PI,!1),this._isEmpty=!1},e.prototype._drawCurve=function(t,e,i){var n,s,o,a,r,l,h,u,c,d,f,p=this._ctx,g=i-e;for(n=Math.floor(t.length()),p.beginPath(),o=0;o<n;o++)a=o/n,r=a*a,l=r*a,h=1-a,u=h*h,c=u*h,d=c*t.startPoint.x,d+=3*u*a*t.control1.x,d+=3*h*r*t.control2.x,d+=l*t.endPoint.x,f=c*t.startPoint.y,f+=3*u*a*t.control1.y,f+=3*h*r*t.control2.y,f+=l*t.endPoint.y,s=e+l*g,this._drawPoint(d,f,s);p.closePath(),p.fill()},e.prototype._strokeWidth=function(t){return Math.max(this.maxWidth/(t+1),this.minWidth)};var i=function(t,e,i){this.x=t,this.y=e,this.time=i||(new Date).getTime()};i.prototype.velocityFrom=function(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):1},i.prototype.distanceTo=function(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))};var n=function(t,e,i,n){this.startPoint=t,this.control1=e,this.control2=i,this.endPoint=n};return n.prototype.length=function(){var t,e,i,n,s,o,a,r,l=0;for(t=0;t<=10;t++)e=t/10,i=this._point(e,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),n=this._point(e,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y),t>0&&(a=i-s,r=n-o,l+=Math.sqrt(a*a+r*r)),s=i,o=n;return l},n.prototype._point=function(t,e,i,n,s){return e*(1-t)*(1-t)*(1-t)+3*i*(1-t)*(1-t)*t+3*n*(1-t)*t*t+s*t*t*t},e}(document)}),function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(t){return e(t)}):"object"==typeof module&&module.exports?module.exports=e(require("jquery")):e(t.jQuery)}(this,function(t){!function(t,e,i){function n(t,e){this.$form=t,this.$input=e,this.reset(),e.on("change paste",this.reset.bind(this))}var s=function(){return!1},o=null,a={numHalted:0,haltValidation:function(e){this.numHalted++,t.formUtils.haltValidation=!0,e.unbind("submit",s).bind("submit",s).find('*[type="submit"]').addClass("disabled").attr("disabled","disabled")},unHaltValidation:function(e){0===--this.numHalted&&(t.formUtils.haltValidation=!1,e.unbind("submit",s).find('*[type="submit"]').removeClass("disabled").removeAttr("disabled","disabled"))}};n.prototype.reset=function(){this.haltedFormValidation=!1,this.hasRun=!1,this.isRunning=!1,this.result=void 0},n.prototype.run=function(t,e){return"keyup"===t?null:this.isRunning?(o=t,this.haltedFormValidation||(a.haltValidation(),this.haltedFormValidation=!0),null):this.hasRun?this.result:(o=t,a.haltValidation(this.$form),this.haltedFormValidation=!0,this.isRunning=!0,this.$input.attr("disabled","disabled").addClass("async-validation"),this.$form.addClass("async-validation"),e(function(t){this.done(t)}.bind(this)),null)},n.prototype.done=function(t){this.result=t,this.hasRun=!0,this.isRunning=!1,this.$input.removeAttr("disabled").removeClass("async-validation"),this.$form.removeClass("async-validation"),this.haltedFormValidation&&(a.unHaltValidation(this.$form),"submit"===o?this.$form.trigger("submit"):this.$input.trigger("validation.revalidate"))},n.loadInstance=function(t,e,i){var s,o=e.get(0);return o.asyncValidators||(o.asyncValidators={}),o.asyncValidators[t]?s=o.asyncValidators[t]:(s=new n(i,e),o.asyncValidators[t]=s),s},t.formUtils=t.extend(t.formUtils||{},{asyncValidation:function(t,e,i){return this.warn("Use of deprecated function $.formUtils.asyncValidation, use $.formUtils.addAsyncValidator() instead"),n.loadInstance(t,e,i)},addAsyncValidator:function(e){var i=t.extend({},e),s=i.validatorFunction;i.async=!0,i.validatorFunction=function(t,e,o,a,r,l){return n.loadInstance(this.name,e,r).run(l,function(n){s.apply(i,[n,t,e,o,a,r,l])})},this.addValidator(i)}}),t(e).bind("validatorsLoaded formValidationSetup",function(e,i){i||(i=t("form")),i.find("[data-validation]").each(function(){var e=t(this);e.valAttr("async",!1),t.each(t.split(e.attr("data-validation")),function(i,n){var s=t.formUtils.validators["validate_"+n];s&&s.async&&e.valAttr("async","yes")})})})}(t,window),function(t,e){"use strict";function i(e){e&&"custom"===e.errorMessagePosition&&"function"==typeof e.errorMessageCustom&&(t.formUtils.warn("Use of deprecated function errorMessageCustom, use config.submitErrorMessageCallback instead"),e.submitErrorMessageCallback=function(t,i){e.errorMessageCustom(t,e.language.errorTitle,i,e)})}function n(e){if(e.errorMessagePosition&&"object"==typeof e.errorMessagePosition){t.formUtils.warn("Deprecated use of config parameter errorMessagePosition, use config.submitErrorMessageCallback instead");var i=e.errorMessagePosition;e.errorMessagePosition="top",e.submitErrorMessageCallback=function(){return i}}}function s(e){var i=e.find("[data-validation-if-checked]");i.length&&t.formUtils.warn('Detected use of attribute "data-validation-if-checked" which is deprecated. Use "data-validation-depends-on" provided by module "logic"'),i.on("beforeValidation",function(){var i=t(this),n=i.valAttr("if-checked"),s=t('input[name="'+n+'"]',e),o=s.is(":checked"),a=(t.formUtils.getValue(s)||"").toString(),r=i.valAttr("if-checked-value");(!o||r&&r!==a)&&i.valAttr("skipped",!0)})}function o(e){var i={se:"sv",cz:"cs",dk:"da"};if(e.lang in i){var n=i[e.lang];t.formUtils.warn('Deprecated use of lang code "'+e.lang+'" use "'+n+'" instead'),e.lang=n}}t.fn.validateForm=function(e,i){return t.formUtils.warn("Use of deprecated function $.validateForm, use $.isValid instead"),this.isValid(e,i,!0)},t(window).on("formValidationPluginInit",function(t,e){o(e),i(e),n(e)}).on("validatorsLoaded formValidationSetup",function(e,i){i||(i=t("form")),s(i)})}(t),function(t){"use strict";var e={resolveErrorMessage:function(t,e,i,n,s){var o=n.validationErrorMsgAttribute+"-"+i.replace("validate_",""),a=t.attr(o);return a||(a=t.attr(n.validationErrorMsgAttribute))||(a="function"!=typeof e.errorMessageKey?s[e.errorMessageKey]:s[e.errorMessageKey(n)])||(a=e.errorMessage),a},getParentContainer:function(e){if(e.valAttr("error-msg-container"))return t(e.valAttr("error-msg-container"));var i=e.parent();return"checkbox"===e.attr("type")&&e.closest(".checkbox").length?i=e.closest(".checkbox").parent():"radio"===e.attr("type")&&e.closest(".radio").length&&(i=e.closest(".radio").parent()),i.closest(".input-group").length&&(i=i.closest(".input-group").parent()),i},
applyInputErrorStyling:function(t,e){t.addClass(e.errorElementClass).removeClass(e.successElementClass),this.getParentContainer(t).addClass(e.inputParentClassOnError).removeClass(e.inputParentClassOnSuccess),""!==e.borderColorOnError&&t.css("border-color",e.borderColorOnError)},applyInputSuccessStyling:function(t,e){t.addClass(e.successElementClass),this.getParentContainer(t).addClass(e.inputParentClassOnSuccess)},removeInputStylingAndMessage:function(t,i){t.removeClass(i.successElementClass).removeClass(i.errorElementClass).css("border-color","");var n=e.getParentContainer(t);if(n.removeClass(i.inputParentClassOnError).removeClass(i.inputParentClassOnSuccess),"function"==typeof i.inlineErrorMessageCallback){var s=i.inlineErrorMessageCallback(t,!1,i);s&&s.html("")}else n.find("."+i.errorMessageClass).remove()},removeAllMessagesAndStyling:function(i,n){if("function"==typeof n.submitErrorMessageCallback){var s=n.submitErrorMessageCallback(i,!1,n);s&&s.html("")}else i.find("."+n.errorMessageClass+".alert").remove();i.find("."+n.errorElementClass+",."+n.successElementClass).each(function(){e.removeInputStylingAndMessage(t(this),n)})},setInlineMessage:function(e,i,n){this.applyInputErrorStyling(e,n);var s,o=document.getElementById(e.attr("name")+"_err_msg"),a=!1,r=function(n){t.formUtils.$win.trigger("validationErrorDisplay",[e,n]),n.html(i)},l=function(){var o=!1;a.find("."+n.errorMessageClass).each(function(){if(this.inputReferer===e[0])return o=t(this),!1}),o?i?r(o):o.remove():""!==i&&(s=t('<div class="'+n.errorMessageClass+' alert"></div>'),r(s),s[0].inputReferer=e[0],a.prepend(s))};if(o)t.formUtils.warn("Using deprecated element reference "+o.id),a=t(o),l();else if("function"==typeof n.inlineErrorMessageCallback){if(!(a=n.inlineErrorMessageCallback(e,i,n)))return;l()}else{var h=this.getParentContainer(e);s=h.find("."+n.errorMessageClass+".help-block"),0===s.length&&(s=t("<span></span>").addClass("help-block").addClass(n.errorMessageClass),s.appendTo(h)),r(s)}},setMessageInTopOfForm:function(e,i,n,s){var o='<div class="{errorMessageClass} alert alert-danger"><strong>{errorTitle}</strong><ul>{fields}</ul></div>',a=!1;if("function"!=typeof n.submitErrorMessageCallback||(a=n.submitErrorMessageCallback(e,i,n))){var r={errorTitle:s.errorTitle,fields:"",errorMessageClass:n.errorMessageClass};t.each(i,function(t,e){r.fields+="<li>"+e+"</li>"}),t.each(r,function(t,e){o=o.replace("{"+t+"}",e)}),a?a.html(o):e.children().eq(0).before(t(o))}}};t.formUtils=t.extend(t.formUtils||{},{dialogs:e})}(t),function(t,e,i){"use strict";var n=0;t.fn.validateOnBlur=function(e,i){var n=this,s=this.find("*[data-validation]");return s.each(function(){var s=t(this);if(s.is("[type=radio]")){var o=n.find('[type=radio][name="'+s.attr("name")+'"]');o.bind("blur.validation",function(){s.validateInputOnBlur(e,i,!0,"blur")}),i.validateCheckboxRadioOnClick&&o.bind("click.validation",function(){s.validateInputOnBlur(e,i,!0,"click")})}}),s.bind("blur.validation",function(){t(this).validateInputOnBlur(e,i,!0,"blur")}),i.validateCheckboxRadioOnClick&&this.find("input[type=checkbox][data-validation],input[type=radio][data-validation]").bind("click.validation",function(){t(this).validateInputOnBlur(e,i,!0,"click")}),this},t.fn.validateOnEvent=function(e,i){if(0!==this.length){return("FORM"===this[0].nodeName?this.find("*[data-validation-event]"):this).each(function(){var n=t(this),s=n.valAttr("event");s&&n.unbind(s+".validation").bind(s+".validation",function(n){9!==(n||{}).keyCode&&t(this).validateInputOnBlur(e,i,!0,s)})}),this}},t.fn.showHelpOnFocus=function(e){return e||(e="data-validation-help"),this.find("textarea,input").each(function(){var i=t(this),s="jquery_form_help_"+ ++n,o=i.attr(e);i.removeClass("has-help-text").unbind("focus.help").unbind("blur.help"),o&&i.addClass("has-help-txt").bind("focus.help",function(){var e=i.parent().find("."+s);0===e.length&&(e=t("<span />").addClass(s).addClass("help").addClass("help-block").text(o).hide(),i.after(e)),e.fadeIn()}).bind("blur.help",function(){t(this).parent().find("."+s).fadeOut("slow")})}),this},t.fn.validate=function(e,i,n){var s=t.extend({},t.formUtils.LANG,n||{});this.each(function(){var n=t(this),o=n.closest("form").get(0)||{},a=o.validationConfig||t.formUtils.defaultConfig();n.one("validation",function(t,i){"function"==typeof e&&e(i,this,t)}),n.validateInputOnBlur(s,t.extend({},a,i||{}),!0)})},t.fn.willPostponeValidation=function(){return(this.valAttr("suggestion-nr")||this.valAttr("postpone")||this.hasClass("hasDatepicker"))&&!e.postponedValidation},t.fn.validateInputOnBlur=function(i,n,s,o){if(t.formUtils.eventType=o,this.willPostponeValidation()){var a=this,r=this.valAttr("postpone")||200;return e.postponedValidation=function(){a.validateInputOnBlur(i,n,s,o),e.postponedValidation=!1},setTimeout(function(){e.postponedValidation&&e.postponedValidation()},r),this}i=t.extend({},t.formUtils.LANG,i||{}),t.formUtils.dialogs.removeInputStylingAndMessage(this,n);var l=this,h=l.closest("form"),u=t.formUtils.validateInput(l,i,n,h,o),c=function(){l.validateInputOnBlur(i,n,!1,"blur.revalidated")};return"blur"===o&&l.unbind("validation.revalidate",c).one("validation.revalidate",c),s&&l.removeKeyUpValidation(),u.shouldChangeDisplay&&(u.isValid?t.formUtils.dialogs.applyInputSuccessStyling(l,n):t.formUtils.dialogs.setInlineMessage(l,u.errorMsg,n)),!u.isValid&&s&&l.validateOnKeyUp(i,n),this},t.fn.validateOnKeyUp=function(e,i){return this.each(function(){var n=t(this);n.valAttr("has-keyup-event")||n.valAttr("has-keyup-event","true").bind("keyup.validation",function(t){9!==t.keyCode&&n.validateInputOnBlur(e,i,!1,"keyup")})}),this},t.fn.removeKeyUpValidation=function(){return this.each(function(){t(this).valAttr("has-keyup-event",!1).unbind("keyup.validation")}),this},t.fn.valAttr=function(t,e){return void 0===e?this.attr("data-validation-"+t):!1===e||null===e?this.removeAttr("data-validation-"+t):(t=t.length>0?"-"+t:"",this.attr("data-validation"+t,e))},t.fn.isValid=function(e,i,n){if(t.formUtils.isLoadingModules){var s=this;return setTimeout(function(){s.isValid(e,i,n)},200),null}i=t.extend({},t.formUtils.defaultConfig(),i||{}),e=t.extend({},t.formUtils.LANG,e||{}),n=!1!==n,t.formUtils.errorDisplayPreventedWhenHalted&&(delete t.formUtils.errorDisplayPreventedWhenHalted,n=!1);var o=function(e,s){t.inArray(e,r)<0&&r.push(e),l.push(s),s.valAttr("current-error",e),n&&t.formUtils.dialogs.applyInputErrorStyling(s,i)},a=[],r=[],l=[],h=this,u=function(e,n){return"submit"===n||"button"===n||"reset"===n||t.inArray(e,i.ignore||[])>-1};if(n&&t.formUtils.dialogs.removeAllMessagesAndStyling(h,i),h.find("input,textarea,select").filter(':not([type="submit"],[type="button"])').each(function(){var n=t(this),s=n.attr("type"),r="radio"===s||"checkbox"===s,l=n.attr("name");if(!u(l,s)&&(!r||t.inArray(l,a)<0)){r&&a.push(l);var c=t.formUtils.validateInput(n,e,i,h,"submit");c.isValid?c.isValid&&c.shouldChangeDisplay&&(n.valAttr("current-error",!1),t.formUtils.dialogs.applyInputSuccessStyling(n,i)):o(c.errorMsg,n)}}),"function"==typeof i.onValidate){var c=i.onValidate(h);t.isArray(c)?t.each(c,function(t,e){o(e.message,e.element)}):c&&c.element&&c.message&&o(c.message,c.element)}return t.formUtils.isValidatingEntireForm=!1,l.length>0&&n&&("top"===i.errorMessagePosition?t.formUtils.dialogs.setMessageInTopOfForm(h,r,i,e):t.each(l,function(e,n){t.formUtils.dialogs.setInlineMessage(n,n.valAttr("current-error"),i)}),i.scrollToTopOnError&&t.formUtils.$win.scrollTop(h.offset().top-20)),!n&&t.formUtils.haltValidation&&(t.formUtils.errorDisplayPreventedWhenHalted=!0),0===l.length&&!t.formUtils.haltValidation},t.fn.restrictLength=function(e){return new t.formUtils.lengthRestriction(this,e),this},t.fn.addSuggestions=function(e){var i=!1;return this.find("input").each(function(){var n=t(this);i=t.split(n.attr("data-suggestions")),i.length>0&&!n.hasClass("has-suggestions")&&(t.formUtils.suggest(n,i,e),n.addClass("has-suggestions"))}),this}}(t,window),function(t){"use strict";t.formUtils=t.extend(t.formUtils||{},{isLoadingModules:!1,loadedModules:{},registerLoadedModule:function(e){this.loadedModules[t.trim(e).toLowerCase()]=!0},hasLoadedModule:function(e){return t.trim(e).toLowerCase()in this.loadedModules},loadModules:function(e,i,n){if(t.formUtils.isLoadingModules)return void setTimeout(function(){t.formUtils.loadModules(e,i,n)},100);var s=function(e,i){var s=t.split(e),o=s.length,a=function(){0===--o&&(t.formUtils.isLoadingModules=!1,"function"==typeof n&&n())};o>0&&(t.formUtils.isLoadingModules=!0);var r="?_="+(new Date).getTime(),l=document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0];t.each(s,function(e,n){if(n=t.trim(n),0===n.length||t.formUtils.hasLoadedModule(n))a();else{var s=i+n+(".js"===n.slice(-3)?"":".js"),o=document.createElement("SCRIPT");"function"==typeof define&&define.amd?require([s+(".dev.js"===s.slice(-7)?r:"")],a):(o.type="text/javascript",o.onload=a,o.src=s+(".dev.js"===s.slice(-7)?r:""),o.onerror=function(){t.formUtils.warn("Unable to load form validation module "+s,!0),a()},o.onreadystatechange=function(){"complete"!==this.readyState&&"loaded"!==this.readyState||(a(),this.onload=null,this.onreadystatechange=null)},l.appendChild(o))}})};if(i)s(e,i);else{var o=function(){var i=!1;return t('script[src*="form-validator"]').each(function(){if(!(this.src.split("form-validator")[1].split("node_modules").length>1))return i=this.src.substr(0,this.src.lastIndexOf("/"))+"/","/"===i&&(i=""),!1}),!1!==i&&(s(e,i),!0)};o()||t(function(){o()||"function"==typeof n&&n()})}}})}(t),function(t){"use strict";t.split=function(e,i,n){n=void 0===n||!0===n;var s="[,|"+(n?"\\s":"")+"-]\\s*",o=new RegExp(s,"g");if("function"!=typeof i){if(!e)return[];var a=[];return t.each(e.split(i||o),function(e,i){i=t.trim(i),i.length&&a.push(i)}),a}e&&t.each(e.split(o),function(e,n){if(n=t.trim(n),n.length)return i(n,e)})},t.validate=function(e){var i=t.extend(t.formUtils.defaultConfig(),{form:"form",validateOnEvent:!1,validateOnBlur:!0,validateCheckboxRadioOnClick:!0,showHelpOnFocus:!0,addSuggestions:!0,modules:"",onModulesLoaded:null,language:!1,onSuccess:!1,onError:!1,onElementValidate:!1});if(e=t.extend(i,e||{}),t(window).trigger("formValidationPluginInit",[e]),e.lang&&"en"!==e.lang){var n="lang/"+e.lang+".js";e.modules+=e.modules.length?","+n:n}t(e.form).each(function(i,n){n.validationConfig=e;var s=t(n);s.trigger("formValidationSetup",[s,e]),s.find(".has-help-txt").unbind("focus.validation").unbind("blur.validation"),s.removeClass("has-validation-callback").unbind("submit.validation").unbind("reset.validation").find("input[data-validation],textarea[data-validation]").unbind("blur.validation"),s.bind("submit.validation",function(i){var n=t(this),s=function(){return i.stopImmediatePropagation(),!1};if(t.formUtils.haltValidation)return s();if(t.formUtils.isLoadingModules)return setTimeout(function(){n.trigger("submit.validation")},200),s();var o=n.isValid(e.language,e);return t.formUtils.haltValidation?s():o&&"function"==typeof e.onSuccess?!1===e.onSuccess(n)?s():void 0:o||"function"!=typeof e.onError?!!o||s():(e.onError(n),s())}).bind("reset.validation",function(){t.formUtils.dialogs.removeAllMessagesAndStyling(s,e)}).addClass("has-validation-callback"),e.showHelpOnFocus&&s.showHelpOnFocus(),e.addSuggestions&&s.addSuggestions(),e.validateOnBlur&&(s.validateOnBlur(e.language,e),s.bind("html5ValidationAttrsFound",function(){s.validateOnBlur(e.language,e)})),e.validateOnEvent&&s.validateOnEvent(e.language,e)}),""!==e.modules&&t.formUtils.loadModules(e.modules,null,function(){"function"==typeof e.onModulesLoaded&&e.onModulesLoaded();var i="string"==typeof e.form?t(e.form):e.form;t.formUtils.$win.trigger("validatorsLoaded",[i,e])})}}(t),function(t,e){"use strict";var i=t(e);t.formUtils=t.extend(t.formUtils||{},{$win:i,defaultConfig:function(){return{ignore:[],errorElementClass:"error",successElementClass:"valid",borderColorOnError:"#b94a48",errorMessageClass:"form-error",validationRuleAttribute:"data-validation",validationErrorMsgAttribute:"data-validation-error-msg",errorMessagePosition:"inline",errorMessageTemplate:{container:'<div class="{errorMessageClass} alert alert-danger">{messages}</div>',messages:"<strong>{errorTitle}</strong><ul>{fields}</ul>",field:"<li>{msg}</li>"},scrollToTopOnError:!0,dateFormat:"yyyy-mm-dd",addValidClassOnAll:!1,decimalSeparator:".",inputParentClassOnError:"has-error",inputParentClassOnSuccess:"has-success",validateHiddenInputs:!1,inlineErrorMessageCallback:!1,submitErrorMessageCallback:!1}},validators:{},sanitizers:{},_events:{load:[],valid:[],invalid:[]},haltValidation:!1,addValidator:function(t){var e=0===t.name.indexOf("validate_")?t.name:"validate_"+t.name;void 0===t.validateOnKeyUp&&(t.validateOnKeyUp=!0),this.validators[e]=t},addSanitizer:function(t){this.sanitizers[t.name]=t},warn:function(t,i){"console"in e?"function"==typeof e.console.warn?e.console.warn(t):"function"==typeof e.console.log&&e.console.log(t):i&&alert(t)},getValue:function(t,e){var i=e?e.find(t):t;if(i.length>0){var n=i.eq(0).attr("type");return"radio"===n||"checkbox"===n?i.filter(":checked").val()||"":i.val()||""}return!1},validateInput:function(e,i,n,s,o){n=n||t.formUtils.defaultConfig(),i=i||t.formUtils.LANG,s.length||(s=e.parent());var a=this.getValue(e);e.valAttr("skipped",!1).one("beforeValidation",function(){(e.attr("disabled")||!e.is(":visible")&&!n.validateHiddenInputs)&&e.valAttr("skipped",1)}).trigger("beforeValidation",[a,i,n]);var r="true"===e.valAttr("optional"),l=!a&&r,h=e.attr(n.validationRuleAttribute),u=!0,c="",d={isValid:!0,shouldChangeDisplay:!0,errorMsg:""};if(!h||l||e.valAttr("skipped"))return d.shouldChangeDisplay=n.addValidClassOnAll,d;var f=e.valAttr("ignore");return f&&t.each(f.split(""),function(t,e){a=a.replace(new RegExp("\\"+e,"g"),"")}),t.split(h,function(r){0!==r.indexOf("validate_")&&(r="validate_"+r);var l=t.formUtils.validators[r];if(!l)throw new Error('Using undefined validator "'+r+'". Maybe you have forgotten to load the module that "'+r+'" belongs to?');if("validate_checkbox_group"===r&&(e=s.find('[name="'+e.attr("name")+'"]:eq(0)')),("keyup"!==o||l.validateOnKeyUp)&&(u=l.validatorFunction(a,e,n,i,s,o)),!u)return n.validateOnBlur&&e.validateOnKeyUp(i,n),c=t.formUtils.dialogs.resolveErrorMessage(e,l,r,n,i),!1}),!1===u?(e.trigger("validation",!1),d.errorMsg=c,d.isValid=!1,d.shouldChangeDisplay=!0):null===u?d.shouldChangeDisplay=!1:(e.trigger("validation",!0),d.shouldChangeDisplay=!0),"function"==typeof n.onElementValidate&&null!==c&&n.onElementValidate(d.isValid,e,s,c),e.trigger("afterValidation",[d,o]),d},parseDate:function(e,i,n){var s,o,a,r,l=i.replace(/[a-zA-Z]/gi,"").substring(0,1),h="^",u=i.split(l||null);if(t.each(u,function(t,e){h+=(t>0?"\\"+l:"")+"(\\d{"+e.length+"})"}),h+="$",n){var c=[];t.each(e.split(l),function(t,e){1===e.length&&(e="0"+e),c.push(e)}),e=c.join(l)}if(null===(s=e.match(new RegExp(h))))return!1;var d=function(e,i,n){for(var s=0;s<i.length;s++)if(i[s].substring(0,1)===e)return t.formUtils.parseDateInt(n[s+1]);return-1};return a=d("m",u,s),o=d("d",u,s),r=d("y",u,s),!(2===a&&o>28&&(r%4!=0||r%100==0&&r%400!=0)||2===a&&o>29&&(r%4==0||r%100!=0&&r%400==0)||a>12||0===a)&&(!(this.isShortMonth(a)&&o>30||!this.isShortMonth(a)&&o>31||0===o)&&[r,a,o])},parseDateInt:function(t){return 0===t.indexOf("0")&&(t=t.replace("0","")),parseInt(t,10)},isShortMonth:function(t){return t%2==0&&t<7||t%2!=0&&t>7},lengthRestriction:function(e,i){var n=parseInt(i.text(),10),s=0,o=function(){var t=e.val().length;if(t>n){var o=e.scrollTop();e.val(e.val().substring(0,n)),e.scrollTop(o)}s=n-t,s<0&&(s=0),i.text(s)};t(e).bind("keydown keyup keypress focus blur",o).bind("cut paste",function(){setTimeout(o,100)}),t(document).bind("ready",o)},numericRangeCheck:function(e,i){var n=t.split(i),s=parseInt(i.substr(3),10);return 1===n.length&&-1===i.indexOf("min")&&-1===i.indexOf("max")&&(n=[i,i]),2===n.length&&(e<parseInt(n[0],10)||e>parseInt(n[1],10))?["out",n[0],n[1]]:0===i.indexOf("min")&&e<s?["min",s]:0===i.indexOf("max")&&e>s?["max",s]:["ok"]},_numSuggestionElements:0,_selectedSuggestion:null,_previousTypedVal:null,suggest:function(e,n,s){var o={css:{maxHeight:"150px",background:"#FFF",lineHeight:"150%",textDecoration:"underline",overflowX:"hidden",overflowY:"auto",border:"#CCC solid 1px",borderTop:"none",cursor:"pointer"},activeSuggestionCSS:{background:"#E9E9E9"}},a=function(t,e){var i=e.offset();t.css({width:e.outerWidth(),left:i.left+"px",top:i.top+e.outerHeight()+"px"})};s&&t.extend(o,s),o.css.position="absolute",o.css["z-index"]=9999,e.attr("autocomplete","off"),0===this._numSuggestionElements&&i.bind("resize",function(){t(".jquery-form-suggestions").each(function(){var e=t(this),i=e.attr("data-suggest-container");a(e,t(".suggestions-"+i).eq(0))})}),this._numSuggestionElements++;var r=function(e){var i=e.valAttr("suggestion-nr");t.formUtils._selectedSuggestion=null,t.formUtils._previousTypedVal=null,t(".jquery-form-suggestion-"+i).fadeOut("fast")};return e.data("suggestions",n).valAttr("suggestion-nr",this._numSuggestionElements).unbind("focus.suggest").bind("focus.suggest",function(){t(this).trigger("keyup"),t.formUtils._selectedSuggestion=null}).unbind("keyup.suggest").bind("keyup.suggest",function(){var i=t(this),n=[],s=t.trim(i.val()).toLocaleLowerCase();if(s!==t.formUtils._previousTypedVal){t.formUtils._previousTypedVal=s;var l=!1,h=i.valAttr("suggestion-nr"),u=t(".jquery-form-suggestion-"+h);if(u.scrollTop(0),""!==s){var c=s.length>2;t.each(i.data("suggestions"),function(t,e){var i=e.toLocaleLowerCase();if(i===s)return n.push("<strong>"+e+"</strong>"),l=!0,!1;(0===i.indexOf(s)||c&&i.indexOf(s)>-1)&&n.push(e.replace(new RegExp(s,"gi"),"<strong>$&</strong>"))})}l||0===n.length&&u.length>0?u.hide():n.length>0&&0===u.length?(u=t("<div></div>").css(o.css).appendTo("body"),e.addClass("suggestions-"+h),u.attr("data-suggest-container",h).addClass("jquery-form-suggestions").addClass("jquery-form-suggestion-"+h)):n.length>0&&!u.is(":visible")&&u.show(),n.length>0&&s.length!==n[0].length&&(a(u,i),u.html(""),t.each(n,function(e,n){t("<div></div>").append(n).css({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:"5px"}).addClass("form-suggest-element").appendTo(u).click(function(){i.focus(),i.val(t(this).text()),i.trigger("change"),r(i)})}))}}).unbind("keydown.validation").bind("keydown.validation",function(e){var i,n,s=e.keyCode?e.keyCode:e.which,a=t(this);if(13===s&&null!==t.formUtils._selectedSuggestion){if(i=a.valAttr("suggestion-nr"),n=t(".jquery-form-suggestion-"+i),n.length>0){var l=n.find("div").eq(t.formUtils._selectedSuggestion).text();a.val(l),a.trigger("change"),r(a),e.preventDefault()}}else{i=a.valAttr("suggestion-nr"),n=t(".jquery-form-suggestion-"+i);var h=n.children();if(h.length>0&&t.inArray(s,[38,40])>-1){38===s?(null===t.formUtils._selectedSuggestion?t.formUtils._selectedSuggestion=h.length-1:t.formUtils._selectedSuggestion--,t.formUtils._selectedSuggestion<0&&(t.formUtils._selectedSuggestion=h.length-1)):40===s&&(null===t.formUtils._selectedSuggestion?t.formUtils._selectedSuggestion=0:t.formUtils._selectedSuggestion++,t.formUtils._selectedSuggestion>h.length-1&&(t.formUtils._selectedSuggestion=0));var u=n.innerHeight(),c=n.scrollTop(),d=n.children().eq(0).outerHeight(),f=d*t.formUtils._selectedSuggestion;return(f<c||f>c+u)&&n.scrollTop(f),h.removeClass("active-suggestion").css("background","none").eq(t.formUtils._selectedSuggestion).addClass("active-suggestion").css(o.activeSuggestionCSS),e.preventDefault(),!1}}}).unbind("blur.suggest").bind("blur.suggest",function(){r(t(this))}),e},LANG:{errorTitle:"Form submission failed!",requiredField:"This is a required field",requiredFields:"You have not answered all required fields",badTime:"You have not given a correct time",badEmail:"You have not given a correct e-mail address",badTelephone:"You have not given a correct phone number",badSecurityAnswer:"You have not given a correct answer to the security question",badDate:"You have not given a correct date",lengthBadStart:"The input value must be between ",lengthBadEnd:" characters",lengthTooLongStart:"The input value is longer than ",lengthTooShortStart:"The input value is shorter than ",notConfirmed:"Input values could not be confirmed",badDomain:"Incorrect domain value",badUrl:"The input value is not a correct URL",badCustomVal:"The input value is incorrect",andSpaces:" and spaces ",badInt:"The input value was not a correct number",badSecurityNumber:"Your social security number was incorrect",badUKVatAnswer:"Incorrect UK VAT Number",badUKNin:"Incorrect UK NIN",badUKUtr:"Incorrect UK UTR Number",badStrength:"The password isn't strong enough",badNumberOfSelectedOptionsStart:"You have to choose at least ",badNumberOfSelectedOptionsEnd:" answers",badAlphaNumeric:"The input value can only contain alphanumeric characters ",badAlphaNumericExtra:" and ",wrongFileSize:"The file you are trying to upload is too large (max %s)",wrongFileType:"Only files of type %s is allowed",groupCheckedRangeStart:"Please choose between ",groupCheckedTooFewStart:"Please choose at least ",groupCheckedTooManyStart:"Please choose a maximum of ",groupCheckedEnd:" item(s)",badCreditCard:"The credit card number is not correct",badCVV:"The CVV number was not correct",wrongFileDim:"Incorrect image dimensions,",imageTooTall:"the image can not be taller than",imageTooWide:"the image can not be wider than",imageTooSmall:"the image was too small",min:"min",max:"max",imageRatioNotAccepted:"Image ratio is not be accepted",badBrazilTelephoneAnswer:"The phone number entered is invalid",badBrazilCEPAnswer:"The CEP entered is invalid",badBrazilCPFAnswer:"The CPF entered is invalid",badPlPesel:"The PESEL entered is invalid",badPlNip:"The NIP entered is invalid",badPlRegon:"The REGON entered is invalid",badreCaptcha:"Please confirm that you are not a bot",passwordComplexityStart:"Password must contain at least ",passwordComplexitySeparator:", ",passwordComplexityUppercaseInfo:" uppercase letter(s)",passwordComplexityLowercaseInfo:" lowercase letter(s)",passwordComplexitySpecialCharsInfo:" special character(s)",passwordComplexityNumericCharsInfo:" numeric character(s)",passwordComplexityEnd:"."}})}(t,window),function(t){t.formUtils.addValidator({name:"email",validatorFunction:function(e){var i=e.toLowerCase().split("@"),n=i[0],s=i[1];if(n&&s){if(0===n.indexOf('"')){var o=n.length;if(n=n.replace(/\"/g,""),n.length!==o-2)return!1}return t.formUtils.validators.validate_domain.validatorFunction(i[1])&&0!==n.indexOf(".")&&"."!==n.substring(n.length-1,n.length)&&-1===n.indexOf("..")&&!/[^\w\+\.\-\#\-\_\~\!\$\&\'\(\)\*\+\,\;\=\:]/.test(n)}return!1},errorMessage:"",errorMessageKey:"badEmail"}),t.formUtils.addValidator({name:"domain",validatorFunction:function(t){return t.length>0&&t.length<=253&&!/[^a-zA-Z0-9]/.test(t.slice(-2))&&!/[^a-zA-Z0-9]/.test(t.substr(0,1))&&!/[^a-zA-Z0-9\.\-]/.test(t)&&1===t.split("..").length&&t.split(".").length>1},errorMessage:"",errorMessageKey:"badDomain"}),t.formUtils.addValidator({name:"required",validatorFunction:function(e,i,n,s,o){switch(i.attr("type")){case"checkbox":return i.is(":checked");case"radio":return o.find('input[name="'+i.attr("name")+'"]').filter(":checked").length>0;default:return""!==t.trim(e)}},errorMessage:"",errorMessageKey:function(t){return"top"===t.errorMessagePosition||"function"==typeof t.errorMessagePosition?"requiredFields":"requiredField"}}),t.formUtils.addValidator({name:"length",validatorFunction:function(e,i,n,s){var o=i.valAttr("length"),a=i.attr("type");if(void 0===o)return alert('Please add attribute "data-validation-length" to '+i[0].nodeName+" named "+i.attr("name")),!0;var r,l="file"===a&&void 0!==i.get(0).files?i.get(0).files.length:e.length,h=t.formUtils.numericRangeCheck(l,o);switch(h[0]){case"out":this.errorMessage=s.lengthBadStart+o+s.lengthBadEnd,r=!1;break;case"min":this.errorMessage=s.lengthTooShortStart+h[1]+s.lengthBadEnd,r=!1;break;case"max":this.errorMessage=s.lengthTooLongStart+h[1]+s.lengthBadEnd,r=!1;break;default:r=!0}return r},errorMessage:"",errorMessageKey:""}),t.formUtils.addValidator({name:"url",validatorFunction:function(e){if(/^(https?|ftp):\/\/((((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])(\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])(\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|\[|\]|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#(((\w|-|\.|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(e)){var i=e.split("://")[1],n=i.indexOf("/");return n>-1&&(i=i.substr(0,n)),t.formUtils.validators.validate_domain.validatorFunction(i)}return!1},errorMessage:"",errorMessageKey:"badUrl"}),t.formUtils.addValidator({name:"number",validatorFunction:function(t,e,i){if(""!==t){var n,s,o=e.valAttr("allowing")||"",a=e.valAttr("decimal-separator")||i.decimalSeparator,r=!1,l=e.valAttr("step")||"",h=!1;if((e.attr("data-sanitize")||"").match(/(^|[\s])numberFormat([\s]|$)/i)){if(!window.numeral)throw new ReferenceError("The data-sanitize value numberFormat cannot be used without the numeral library. Please see Data Validation in http://www.formvalidator.net for more information.");t.length&&(t=String(numeral().unformat(t)))}if(-1===o.indexOf("number")&&(o+=",number"),-1===o.indexOf("negative")&&0===t.indexOf("-"))return!1;if(o.indexOf("range")>-1&&(n=parseFloat(o.substring(o.indexOf("[")+1,o.indexOf(";"))),s=parseFloat(o.substring(o.indexOf(";")+1,o.indexOf("]"))),r=!0),""!==l&&(h=!0),","===a){if(t.indexOf(".")>-1)return!1;t=t.replace(",",".")}if(""===t.replace(/[0-9-]/g,"")&&(!r||t>=n&&t<=s)&&(!h||t%l==0))return!0;if(o.indexOf("float")>-1&&null!==t.match(new RegExp("^([0-9-]+)\\.([0-9]+)$"))&&(!r||t>=n&&t<=s)&&(!h||t%l==0))return!0}return!1},errorMessage:"",errorMessageKey:"badInt"}),t.formUtils.addValidator({name:"alphanumeric",validatorFunction:function(e,i,n,s){var o=i.valAttr("allowing"),a="",r=!1;if(o){a="^([a-zA-Z0-9"+o+"]+)$";var l=o.replace(/\\/g,"");l.indexOf(" ")>-1&&(r=!0,l=l.replace(" ",""),l+=s.andSpaces||t.formUtils.LANG.andSpaces),s.badAlphaNumericAndExtraAndSpaces&&s.badAlphaNumericAndExtra?this.errorMessage=r?s.badAlphaNumericAndExtraAndSpaces+l:s.badAlphaNumericAndExtra+l+s.badAlphaNumericExtra:this.errorMessage=s.badAlphaNumeric+s.badAlphaNumericExtra+l}else a="^([a-zA-Z0-9]+)$",this.errorMessage=s.badAlphaNumeric;return new RegExp(a).test(e)},errorMessage:"",errorMessageKey:""}),t.formUtils.addValidator({name:"custom",validatorFunction:function(t,e){return new RegExp(e.valAttr("regexp")).test(t)},errorMessage:"",errorMessageKey:"badCustomVal"}),t.formUtils.addValidator({name:"date",validatorFunction:function(e,i,n){var s=i.valAttr("format")||n.dateFormat||"yyyy-mm-dd",o="false"===i.valAttr("require-leading-zero");return!1!==t.formUtils.parseDate(e,s,o)},errorMessage:"",errorMessageKey:"badDate"}),t.formUtils.addValidator({name:"checkbox_group",validatorFunction:function(e,i,n,s,o){var a=!0,r=i.attr("name"),l=t('input[type=checkbox][name^="'+r+'"]',o),h=l.filter(":checked").length,u=i.valAttr("qty");if(void 0===u){var c=i.get(0).nodeName;alert('Attribute "data-validation-qty" is missing from '+c+" named "+i.attr("name"))}var d=t.formUtils.numericRangeCheck(h,u);switch(d[0]){case"out":this.errorMessage=s.groupCheckedRangeStart+u+s.groupCheckedEnd,a=!1;break;case"min":this.errorMessage=s.groupCheckedTooFewStart+d[1]+(s.groupCheckedTooFewEnd||s.groupCheckedEnd),a=!1;break;case"max":this.errorMessage=s.groupCheckedTooManyStart+d[1]+(s.groupCheckedTooManyEnd||s.groupCheckedEnd),a=!1;break;default:a=!0}if(!a){var f=function(){l.unbind("click",f),l.filter("*[data-validation]").validateInputOnBlur(s,n,!1,"blur")};l.bind("click",f)}return a}})}(t)});var List=function(t){function e(n){if(i[n])return i[n].exports;var s=i[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=11)}([function(t,e,i){function n(t){if(!t||!t.nodeType)throw new Error("A DOM element reference is required");this.el=t,this.list=t.classList}var s=i(4),o=/\s+/;Object.prototype.toString;t.exports=function(t){return new n(t)},n.prototype.add=function(t){if(this.list)return this.list.add(t),this;var e=this.array();return~s(e,t)||e.push(t),this.el.className=e.join(" "),this},n.prototype.remove=function(t){if(this.list)return this.list.remove(t),this;var e=this.array(),i=s(e,t);return~i&&e.splice(i,1),this.el.className=e.join(" "),this},n.prototype.toggle=function(t,e){return this.list?(void 0!==e?e!==this.list.toggle(t,e)&&this.list.toggle(t):this.list.toggle(t),this):(void 0!==e?e?this.add(t):this.remove(t):this.has(t)?this.remove(t):this.add(t),this)},n.prototype.array=function(){var t=this.el.getAttribute("class")||"",e=t.replace(/^\s+|\s+$/g,""),i=e.split(o);return""===i[0]&&i.shift(),i},n.prototype.has=n.prototype.contains=function(t){return this.list?this.list.contains(t):!!~s(this.array(),t)}},function(t,e,i){var n=window.addEventListener?"addEventListener":"attachEvent",s=window.removeEventListener?"removeEventListener":"detachEvent",o="addEventListener"!==n?"on":"",a=i(5);e.bind=function(t,e,i,s){t=a(t);for(var r=0;r<t.length;r++)t[r][n](o+e,i,s||!1)},e.unbind=function(t,e,i,n){t=a(t);for(var r=0;r<t.length;r++)t[r][s](o+e,i,n||!1)}},function(t,e){t.exports=function(t){return function(e,i,n){var s=this;this._values={},this.found=!1,this.filtered=!1;this.values=function(e,i){if(void 0===e)return s._values;for(var n in e)s._values[n]=e[n];!0!==i&&t.templater.set(s,s.values())},this.show=function(){t.templater.show(s)},this.hide=function(){t.templater.hide(s)},this.matching=function(){return t.filtered&&t.searched&&s.found&&s.filtered||t.filtered&&!t.searched&&s.filtered||!t.filtered&&t.searched&&s.found||!t.filtered&&!t.searched},this.visible=function(){return!(!s.elm||s.elm.parentNode!=t.list)},function(e,i,n){if(void 0===i)n?s.values(e,n):s.values(e);else{s.elm=i;var o=t.templater.get(s,e);s.values(o)}}(e,i,n)}}},function(t,e){var i=function(t,e,i){return i?t.getElementsByClassName(e)[0]:t.getElementsByClassName(e)},n=function(t,e,i){return e="."+e,i?t.querySelector(e):t.querySelectorAll(e)},s=function(t,e,i){for(var n=[],s=t.getElementsByTagName("*"),o=s.length,a=new RegExp("(^|\\s)"+e+"(\\s|$)"),r=0,l=0;r<o;r++)if(a.test(s[r].className)){if(i)return s[r];n[l]=s[r],l++}return n};t.exports=function(){return function(t,e,o,a){return a=a||{},a.test&&a.getElementsByClassName||!a.test&&document.getElementsByClassName?i(t,e,o):a.test&&a.querySelector||!a.test&&document.querySelector?n(t,e,o):s(t,e,o)}}()},function(t,e){var i=[].indexOf;t.exports=function(t,e){if(i)return t.indexOf(e);for(var n=0;n<t.length;++n)if(t[n]===e)return n;return-1}},function(t,e){function i(t){return"[object Array]"===Object.prototype.toString.call(t)}t.exports=function(t){if(void 0===t)return[];if(null===t)return[null]
;if(t===window)return[window];if("string"==typeof t)return[t];if(i(t))return t;if("number"!=typeof t.length)return[t];if("function"==typeof t&&t instanceof Function)return[t];for(var e=[],n=0;n<t.length;n++)(Object.prototype.hasOwnProperty.call(t,n)||n in t)&&e.push(t[n]);return e.length?e:[]}},function(t,e){t.exports=function(t){return t=void 0===t?"":t,t=null===t?"":t,t=t.toString()}},function(t,e){t.exports=function(t){for(var e,i=Array.prototype.slice.call(arguments,1),n=0;e=i[n];n++)if(e)for(var s in e)t[s]=e[s];return t}},function(t,e){t.exports=function(t){var e=function(i,n,s){var o=i.splice(0,50);s=s||[],s=s.concat(t.add(o)),i.length>0?setTimeout(function(){e(i,n,s)},1):(t.update(),n(s))};return e}},function(t,e){t.exports=function(t){return t.handlers.filterStart=t.handlers.filterStart||[],t.handlers.filterComplete=t.handlers.filterComplete||[],function(e){if(t.trigger("filterStart"),t.i=1,t.reset.filter(),void 0===e)t.filtered=!1;else{t.filtered=!0;for(var i=t.items,n=0,s=i.length;n<s;n++){var o=i[n];e(o)?o.filtered=!0:o.filtered=!1}}return t.update(),t.trigger("filterComplete"),t.visibleItems}}},function(t,e,i){var n=(i(0),i(1)),s=i(7),o=i(6),a=i(3),r=i(19);t.exports=function(t,e){e=e||{},e=s({location:0,distance:100,threshold:.4,multiSearch:!0,searchClass:"fuzzy-search"},e);var i={search:function(n,s){for(var o=e.multiSearch?n.replace(/ +$/,"").split(/ +/):[n],a=0,r=t.items.length;a<r;a++)i.item(t.items[a],s,o)},item:function(t,e,n){for(var s=!0,o=0;o<n.length;o++){for(var a=!1,r=0,l=e.length;r<l;r++)i.values(t.values(),e[r],n[o])&&(a=!0);a||(s=!1)}t.found=s},values:function(t,i,n){if(t.hasOwnProperty(i)){var s=o(t[i]).toLowerCase();if(r(s,n,e))return!0}return!1}};return n.bind(a(t.listContainer,e.searchClass),"keyup",function(e){var n=e.target||e.srcElement;t.search(n.value,i.search)}),function(e,n){t.search(e,n,i.search)}}},function(t,e,i){var n=i(18),s=i(3),o=i(7),a=i(4),r=i(1),l=i(6),h=i(0),u=i(17),c=i(5);t.exports=function(t,e,d){var f,p=this,g=i(2)(p),m=i(8)(p),v=i(12)(p);f={start:function(){p.listClass="list",p.searchClass="search",p.sortClass="sort",p.page=1e4,p.i=1,p.items=[],p.visibleItems=[],p.matchingItems=[],p.searched=!1,p.filtered=!1,p.searchColumns=void 0,p.handlers={updated:[]},p.valueNames=[],p.utils={getByClass:s,extend:o,indexOf:a,events:r,toString:l,naturalSort:n,classes:h,getAttribute:u,toArray:c},p.utils.extend(p,e),p.listContainer="string"==typeof t?document.getElementById(t):t,p.listContainer&&(p.list=s(p.listContainer,p.listClass,!0),p.parse=i(13)(p),p.templater=i(16)(p),p.search=i(14)(p),p.filter=i(9)(p),p.sort=i(15)(p),p.fuzzySearch=i(10)(p,e.fuzzySearch),this.handlers(),this.items(),this.pagination(),p.update())},handlers:function(){for(var t in p.handlers)p[t]&&p.on(t,p[t])},items:function(){p.parse(p.list),void 0!==d&&p.add(d)},pagination:function(){if(void 0!==e.pagination){!0===e.pagination&&(e.pagination=[{}]),void 0===e.pagination[0]&&(e.pagination=[e.pagination]);for(var t=0,i=e.pagination.length;t<i;t++)v(e.pagination[t])}}},this.reIndex=function(){p.items=[],p.visibleItems=[],p.matchingItems=[],p.searched=!1,p.filtered=!1,p.parse(p.list)},this.toJSON=function(){for(var t=[],e=0,i=p.items.length;e<i;e++)t.push(p.items[e].values());return t},this.add=function(t,e){if(0!==t.length){if(e)return void m(t,e);var i=[],n=!1;void 0===t[0]&&(t=[t]);for(var s=0,o=t.length;s<o;s++){var a=null;n=p.items.length>p.page,a=new g(t[s],void 0,n),p.items.push(a),i.push(a)}return p.update(),i}},this.show=function(t,e){return this.i=t,this.page=e,p.update(),p},this.remove=function(t,e,i){for(var n=0,s=0,o=p.items.length;s<o;s++)p.items[s].values()[t]==e&&(p.templater.remove(p.items[s],i),p.items.splice(s,1),o--,s--,n++);return p.update(),n},this.get=function(t,e){for(var i=[],n=0,s=p.items.length;n<s;n++){var o=p.items[n];o.values()[t]==e&&i.push(o)}return i},this.size=function(){return p.items.length},this.clear=function(){return p.templater.clear(),p.items=[],p},this.on=function(t,e){return p.handlers[t].push(e),p},this.off=function(t,e){var i=p.handlers[t],n=a(i,e);return n>-1&&i.splice(n,1),p},this.trigger=function(t){for(var e=p.handlers[t].length;e--;)p.handlers[t][e](p);return p},this.reset={filter:function(){for(var t=p.items,e=t.length;e--;)t[e].filtered=!1;return p},search:function(){for(var t=p.items,e=t.length;e--;)t[e].found=!1;return p}},this.update=function(){var t=p.items,e=t.length;p.visibleItems=[],p.matchingItems=[],p.templater.clear();for(var i=0;i<e;i++)t[i].matching()&&p.matchingItems.length+1>=p.i&&p.visibleItems.length<p.page?(t[i].show(),p.visibleItems.push(t[i]),p.matchingItems.push(t[i])):t[i].matching()?(p.matchingItems.push(t[i]),t[i].hide()):t[i].hide();return p.trigger("updated"),p},f.start()}},function(t,e,i){var n=i(0),s=i(1),o=i(11);t.exports=function(t){var e=function(e,s){var o,r=t.matchingItems.length,l=t.i,h=t.page,u=Math.ceil(r/h),c=Math.ceil(l/h),d=s.innerWindow||2,f=s.left||s.outerWindow||0,p=s.right||s.outerWindow||0;p=u-p,e.clear();for(var g=1;g<=u;g++){var m=c===g?"active":"";i.number(g,f,p,c,d)?(o=e.add({page:g,dotted:!1})[0],m&&n(o.elm).add(m),a(o.elm,g,h)):i.dotted(e,g,f,p,c,d,e.size())&&(o=e.add({page:"...",dotted:!0})[0],n(o.elm).add("disabled"))}},i={number:function(t,e,i,n,s){return this.left(t,e)||this.right(t,i)||this.innerWindow(t,n,s)},left:function(t,e){return t<=e},right:function(t,e){return t>e},innerWindow:function(t,e,i){return t>=e-i&&t<=e+i},dotted:function(t,e,i,n,s,o,a){return this.dottedLeft(t,e,i,n,s,o)||this.dottedRight(t,e,i,n,s,o,a)},dottedLeft:function(t,e,i,n,s,o){return e==i+1&&!this.innerWindow(e,s,o)&&!this.right(e,n)},dottedRight:function(t,e,i,n,s,o,a){return!t.items[a-1].values().dotted&&(e==n&&!this.innerWindow(e,s,o)&&!this.right(e,n))}},a=function(e,i,n){s.bind(e,"click",function(){t.show((i-1)*n+1,n)})};return function(i){var n=new o(t.listContainer.id,{listClass:i.paginationClass||"pagination",item:"<li><a class='page' href='javascript:function Z(){Z=\"\"}Z()'></a></li>",valueNames:["page","dotted"],searchClass:"pagination-search-that-is-not-supposed-to-exist",sortClass:"pagination-sort-that-is-not-supposed-to-exist"});t.on("updated",function(){e(n,i)}),e(n,i)}}},function(t,e,i){t.exports=function(t){var e=i(2)(t),n=function(t){for(var e=t.childNodes,i=[],n=0,s=e.length;n<s;n++)void 0===e[n].data&&i.push(e[n]);return i},s=function(i,n){for(var s=0,o=i.length;s<o;s++)t.items.push(new e(n,i[s]))},o=function(e,i){var n=e.splice(0,50);s(n,i),e.length>0?setTimeout(function(){o(e,i)},1):(t.update(),t.trigger("parseComplete"))};return t.handlers.parseComplete=t.handlers.parseComplete||[],function(){var e=n(t.list),i=t.valueNames;t.indexAsync?o(e,i):s(e,i)}}},function(t,e){t.exports=function(t){var e,i,n,s,o={resetList:function(){t.i=1,t.templater.clear(),s=void 0},setOptions:function(t){2==t.length&&t[1]instanceof Array?i=t[1]:2==t.length&&"function"==typeof t[1]?(i=void 0,s=t[1]):3==t.length?(i=t[1],s=t[2]):i=void 0},setColumns:function(){0!==t.items.length&&void 0===i&&(i=void 0===t.searchColumns?o.toArray(t.items[0].values()):t.searchColumns)},setSearchString:function(e){e=t.utils.toString(e).toLowerCase(),e=e.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),n=e},toArray:function(t){var e=[];for(var i in t)e.push(i);return e}},a={list:function(){for(var e=0,i=t.items.length;e<i;e++)a.item(t.items[e])},item:function(t){t.found=!1;for(var e=0,n=i.length;e<n;e++)if(a.values(t.values(),i[e]))return void(t.found=!0)},values:function(i,s){return!!(i.hasOwnProperty(s)&&(e=t.utils.toString(i[s]).toLowerCase(),""!==n&&e.search(n)>-1))},reset:function(){t.reset.search(),t.searched=!1}},r=function(e){return t.trigger("searchStart"),o.resetList(),o.setSearchString(e),o.setOptions(arguments),o.setColumns(),""===n?a.reset():(t.searched=!0,s?s(n,i):a.list()),t.update(),t.trigger("searchComplete"),t.visibleItems};return t.handlers.searchStart=t.handlers.searchStart||[],t.handlers.searchComplete=t.handlers.searchComplete||[],t.utils.events.bind(t.utils.getByClass(t.listContainer,t.searchClass),"keyup",function(e){var i=e.target||e.srcElement;""===i.value&&!t.searched||r(i.value)}),t.utils.events.bind(t.utils.getByClass(t.listContainer,t.searchClass),"input",function(t){""===(t.target||t.srcElement).value&&r("")}),r}},function(t,e){t.exports=function(t){var e={els:void 0,clear:function(){for(var i=0,n=e.els.length;i<n;i++)t.utils.classes(e.els[i]).remove("asc"),t.utils.classes(e.els[i]).remove("desc")},getOrder:function(e){var i=t.utils.getAttribute(e,"data-order");return"asc"==i||"desc"==i?i:t.utils.classes(e).has("desc")?"asc":t.utils.classes(e).has("asc")?"desc":"asc"},getInSensitive:function(e,i){var n=t.utils.getAttribute(e,"data-insensitive");i.insensitive="false"!==n},setOrder:function(i){for(var n=0,s=e.els.length;n<s;n++){var o=e.els[n];if(t.utils.getAttribute(o,"data-sort")===i.valueName){var a=t.utils.getAttribute(o,"data-order");"asc"==a||"desc"==a?a==i.order&&t.utils.classes(o).add(i.order):t.utils.classes(o).add(i.order)}}}},i=function(){t.trigger("sortStart");var i={},n=arguments[0].currentTarget||arguments[0].srcElement||void 0;n?(i.valueName=t.utils.getAttribute(n,"data-sort"),e.getInSensitive(n,i),i.order=e.getOrder(n)):(i=arguments[1]||i,i.valueName=arguments[0],i.order=i.order||"asc",i.insensitive=void 0===i.insensitive||i.insensitive),e.clear(),e.setOrder(i);var s,o=i.sortFunction||t.sortFunction||null,a="desc"===i.order?-1:1;s=o?function(t,e){return o(t,e,i)*a}:function(e,n){var s=t.utils.naturalSort;return s.alphabet=t.alphabet||i.alphabet||void 0,!s.alphabet&&i.insensitive&&(s=t.utils.naturalSort.caseInsensitive),s(e.values()[i.valueName],n.values()[i.valueName])*a},t.items.sort(s),t.update(),t.trigger("sortComplete")};return t.handlers.sortStart=t.handlers.sortStart||[],t.handlers.sortComplete=t.handlers.sortComplete||[],e.els=t.utils.getByClass(t.listContainer,t.sortClass),t.utils.events.bind(e.els,"click",i),t.on("searchStart",e.clear),t.on("filterStart",e.clear),i}},function(t,e){var i=function(t){var e,i=this;this.clearSourceItem=function(e,i){for(var n=0,s=i.length;n<s;n++){var o;if(i[n].data)for(var a=0,r=i[n].data.length;a<r;a++)e.setAttribute("data-"+i[n].data[a],"");else i[n].attr&&i[n].name?(o=t.utils.getByClass(e,i[n].name,!0))&&o.setAttribute(i[n].attr,""):(o=t.utils.getByClass(e,i[n],!0))&&(o.innerHTML="");o=void 0}return e},this.getItemSource=function(e){if(void 0===e){for(var i=t.list.childNodes,n=0,s=i.length;n<s;n++)if(void 0===i[n].data)return i[n].cloneNode(!0)}else{if(/<tr[\s>]/g.exec(e)){var o=document.createElement("tbody");return o.innerHTML=e,o.firstChild}if(-1!==e.indexOf("<")){var a=document.createElement("div");return a.innerHTML=e,a.firstChild}var r=document.getElementById(t.item);if(r)return r}},this.get=function(e,n){i.create(e);for(var s={},o=0,a=n.length;o<a;o++){var r;if(n[o].data)for(var l=0,h=n[o].data.length;l<h;l++)s[n[o].data[l]]=t.utils.getAttribute(e.elm,"data-"+n[o].data[l]);else n[o].attr&&n[o].name?(r=t.utils.getByClass(e.elm,n[o].name,!0),s[n[o].name]=r?t.utils.getAttribute(r,n[o].attr):""):(r=t.utils.getByClass(e.elm,n[o],!0),s[n[o]]=r?r.innerHTML:"");r=void 0}return s},this.set=function(e,n){var s=function(e){for(var i=0,n=t.valueNames.length;i<n;i++)if(t.valueNames[i].data){for(var s=t.valueNames[i].data,o=0,a=s.length;o<a;o++)if(s[o]===e)return{data:e}}else{if(t.valueNames[i].attr&&t.valueNames[i].name&&t.valueNames[i].name==e)return t.valueNames[i];if(t.valueNames[i]===e)return e}};if(!i.create(e))for(var o in n)n.hasOwnProperty(o)&&function(i,n){var o,a=s(i);a&&(a.data?e.elm.setAttribute("data-"+a.data,n):a.attr&&a.name?(o=t.utils.getByClass(e.elm,a.name,!0))&&o.setAttribute(a.attr,n):(o=t.utils.getByClass(e.elm,a,!0))&&(o.innerHTML=n),o=void 0)}(o,n[o])},this.create=function(t){if(void 0!==t.elm)return!1;if(void 0===e)throw new Error("The list need to have at list one item on init otherwise you'll have to add a template.");var n=e.cloneNode(!0);return n.removeAttribute("id"),t.elm=n,i.set(t,t.values()),!0},this.remove=function(e){e.elm.parentNode===t.list&&t.list.removeChild(e.elm)},this.show=function(e){i.create(e),t.list.appendChild(e.elm)},this.hide=function(e){void 0!==e.elm&&e.elm.parentNode===t.list&&t.list.removeChild(e.elm)},this.clear=function(){if(t.list.hasChildNodes())for(;t.list.childNodes.length>=1;)t.list.removeChild(t.list.firstChild)},function(){(e=i.getItemSource(t.item))&&(e=i.clearSourceItem(e,t.valueNames))}()};t.exports=function(t){return new i(t)}},function(t,e){t.exports=function(t,e){var i=t.getAttribute&&t.getAttribute(e)||null;if(!i)for(var n=t.attributes,s=n.length,o=0;o<s;o++)void 0!==e[o]&&e[o].nodeName===e&&(i=e[o].nodeValue);return i}},function(t,e,i){"use strict";function n(t){return t>=48&&t<=57}function s(t,e){for(var i=(t+="").length,s=(e+="").length,o=0,l=0;o<i&&l<s;){var h=t.charCodeAt(o),u=e.charCodeAt(l);if(n(h)){if(!n(u))return h-u;for(var c=o,d=l;48===h&&++c<i;)h=t.charCodeAt(c);for(;48===u&&++d<s;)u=e.charCodeAt(d);for(var f=c,p=d;f<i&&n(t.charCodeAt(f));)++f;for(;p<s&&n(e.charCodeAt(p));)++p;var g=f-c-p+d;if(g)return g;for(;c<f;)if(g=t.charCodeAt(c++)-e.charCodeAt(d++))return g;o=f,l=p}else{if(h!==u)return h<r&&u<r&&-1!==a[h]&&-1!==a[u]?a[h]-a[u]:h-u;++o,++l}}return i-s}var o,a,r=0;s.caseInsensitive=s.i=function(t,e){return s((""+t).toLowerCase(),(""+e).toLowerCase())},Object.defineProperties(s,{alphabet:{get:function(){return o},set:function(t){o=t,a=[];var e=0;if(o)for(;e<o.length;e++)a[o.charCodeAt(e)]=e;for(r=a.length,e=0;e<r;e++)void 0===a[e]&&(a[e]=-1)}}}),t.exports=s},function(t,e){t.exports=function(t,e,i){function n(t,i){var n=t/e.length,s=Math.abs(r-i);return o?n+s/o:s?1:n}var s=i.location||0,o=i.distance||100,a=i.threshold||.4;if(e===t)return!0;if(e.length>32)return!1;var r=s,l=function(){var t,i={};for(t=0;t<e.length;t++)i[e.charAt(t)]=0;for(t=0;t<e.length;t++)i[e.charAt(t)]|=1<<e.length-t-1;return i}(),h=a,u=t.indexOf(e,r);-1!=u&&(h=Math.min(n(0,u),h),-1!=(u=t.lastIndexOf(e,r+e.length))&&(h=Math.min(n(0,u),h)));var c=1<<e.length-1;u=-1;for(var d,f,p,g=e.length+t.length,m=0;m<e.length;m++){for(d=0,f=g;d<f;)n(m,r+f)<=h?d=f:g=f,f=Math.floor((g-d)/2+d);g=f;var v=Math.max(1,r-f+1),b=Math.min(r+f,t.length)+e.length,_=Array(b+2);_[b+1]=(1<<m)-1;for(var y=b;y>=v;y--){var x=l[t.charAt(y-1)];if(_[y]=0===m?(_[y+1]<<1|1)&x:(_[y+1]<<1|1)&x|(p[y+1]|p[y])<<1|1|p[y+1],_[y]&c){var w=n(m,y-1);if(w<=h){if(h=w,!((u=y-1)>r))break;v=Math.max(1,2*r-u)}}}if(n(m+1,r)>h)break;p=_}return!(u<0)}}]);