LearnPress – WordPress LMS Plugin - Version 4.0.0-beta-1

Version Description

= 0.9.19 = In this version, we have changed a little bit about LearnPress Plugin directory structure and moved all add-ons to become independent plugins. If you face any problems related to add-ons, please completely remove old version and re-install LearnPress. It does not affect your current data. Thank you.

Download this release

Release Info

Developer ThimPress
Plugin Icon 128x128 LearnPress – WordPress LMS Plugin
Version 4.0.0-beta-1
Comparing to
See all releases

Code changes from version 4.0.0-beta-2 to 4.0.0-beta-1

assets/js/admin/admin.min.js CHANGED
@@ -1 +1 @@
1
- !function(e){const t=function(){e.ajax({url:"",data:{"lp-ajax":"toggle_item_preview",item_id:this.value,previewable:this.checked?"yes":"no",nonce:e(this).attr("data-nonce")},dataType:"text",success:function(e){e=LP.parseJSON(e)}})},a=function(t){const a=e(this).addClass("disabled");t.preventDefault(),e.post({url:a.attr("href"),data:{"lp-ajax":"create-pages"},dataType:"text",success:function(e){const t=a.closest(".lp-notice").html("<p>"+e+"</p>");setTimeout((function(){t.fadeOut()}),2e3)}})},n=function(t){t.preventDefault();e(this).closest(".lp-upgrade-notice").fadeOut(),e.post({url:"",data:{"lp-hide-upgrade-message":"yes"},success:function(e){}})},o=function(t){if(e(t.target).hasClass("buy-now"))return;t.preventDefault();const a=e(this).closest(".plugin-card");e(this).hasClass("updating-message")||(e(this).addClass("updating-message button-working disabled"),e.ajax({url:e(this).attr("href"),data:{},success:function(t){e.ajax({url:window.location.href,success:function(t){const n=e(t).find("#"+a.attr("id"));n.length?a.replaceWith(n):a.find(".plugin-action-buttons a").removeClass("updating-message button-working").html(learn_press_admin_localize.plugin_installed)}})}}))},l=function(e){return e.preventDefault(),!1};e.fn._filter_post_by_author=function(){const t=e("#post-search-input");if(!t.length)return;const a=e(t[0].form),n=e('<select name="author" id="author"></select>').insertAfter(t).select2({ajax:{url:window.location.href+"&lp-ajax=search-authors",dataType:"json",s:""},placeholder:"Search by user",minimumInputLength:3,allowClear:!0}).on("select2:select",(function(){e('input[name="author"]').val(n.val())}));a.on("submit",(function(){window.location.href.removeQueryVar("author").addQueryVar("author",n.val())}))};const s=()=>{e(".lp-button-upgrade").each((function(){e(this).on("click",(function(t){t.preventDefault(),e("#lp-update-db-modal").removeClass("lp-update-db-modal__hidden")}))})),e(".lp-update-db-modal__button").on("click",(function(t){t.preventDefault();const a=e(this),n=a.text(),o=a.data("loading"),l=e(".lp-update-db-modal__content-text").data("text");a.addClass("loading"),a.text(o);const s=()=>{e.ajax({url:lpGlobalSettings.ajax+"?action=lp_update_database",method:"GET",success(t){if("success"===t.status)return a.text(n),e(".lp-update-db-modal__content").addClass("lp-update-db-modal__success"),e(".lp-update-db-modal__content-text > h3").text(l),a.removeClass("loading"),!1;s()}})};s()}));e(".lp-update-db-modal__cancel").on("click",(function(t){t.preventDefault(),e("#lp-update-db-modal").addClass("lp-update-db-modal__hidden")}))},i=()=>{e(".lp-meta-box__file").each((t,a)=>{let n;const o=e(a).find(".lp-meta-box__file_input"),l=e(a).find(".lp-meta-box__file_list"),s=e(a).find(".btn-upload"),i=!!e(a).data("multil");e(s).on("click",e=>{e.preventDefault(),n||(n=wp.media({states:[new wp.media.controller.Library({filterable:"all",multiple:i})]}),n.on("select",(function(){const e=n.state().get("selection");let t=o.val();e.forEach((function(e){if((e=e.toJSON()).id)if(i?t=t?t+","+e.id:e.id:(t=e.id,l.empty()),"image"===e.type){const t=e.sizes&&e.sizes.thumbnail?e.sizes.thumbnail.url:e.url;l.append('<li class="lp-meta-box__file_list-item image" data-attachment_id="'+e.id+'"><img src="'+t+'" /><ul class="actions"><li><a href="#" class="delete"></a></li></ul></li>')}else l.append('<li class="lp-meta-box__file_list-item image" data-attachment_id="'+e.id+'"><img class="is_file" src="'+e.icon+'" /><span>'+e.filename+'</span><ul class="actions"><li><a href="#" class="delete"></a></li></ul></li>')})),c(),o.val(t)}))),n.open()}),i&&l.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,placeholder:"lp-metabox-sortable-placeholder",start(e,t){t.item.css("background-color","#f6f6f6")},stop(e,t){t.item.removeAttr("style")},update(){let t="";l.find("li.image").css("cursor","default").each((function(){const a=e(this).attr("data-attachment_id");t=t+a+","})),c(),o.val(t)}});const c=()=>{e(l).find("li.image").each((t,a)=>{e(a).find("a.delete").on("click",(function(){if(e(a).remove(),i){let t="";e(l).find("li.image").css("cursor","default").each((function(){const a=e(this).attr("data-attachment_id");t=t+a+","})),o.val(t)}else o.val("");return!1}))})};c()})};e(document).ready((function(){if(i(),s(),e(".learn-press-dropdown-pages").LP("DropdownPages"),e(".learn-press-advertisement-slider").LP("Advertisement","a","s").appendTo(e("#wpbody-content")),e(".learn-press-toggle-item-preview").on("change",t),e(".learn-press-tip").LP("QuickTip"),e(document).on("click","#learn-press-create-pages",a).on("click",".lp-upgrade-notice .close-notice",n).on("click",".plugin-action-buttons a",o).on("click","[data-remove-confirm]",l).on("mousedown",".lp-sortable-handle",(function(t){e("html, body").addClass("lp-item-moving"),e(t.target).closest(".lp-sortable-handle").css("cursor","inherit")})).on("mouseup",(function(t){e("html, body").removeClass("lp-item-moving"),e(".lp-sortable-handle").css("cursor","")})),e("#order-export__section").length){document.querySelectorAll(".tabs");const t=document.querySelectorAll(".tab"),a=document.querySelectorAll(".panel");function c(e){for(let e=0;e<t.length;e++)t[e].classList.remove("active");for(let e=0;e<a.length;e++)a[e].classList.remove("active");e.target.classList.add("active");const n=e.target.getAttribute("data-target");document.getElementById("panels").getElementsByClassName(n)[0].classList.add("active")}for(let e=0;e<t.length;e++)t[e].addEventListener("click",c,!1);const n=document.getElementById("myModal"),o=document.getElementById("order-export__button"),l=document.getElementsByClassName("close")[0];o.onclick=function(){n.style.display="block"},l.onclick=function(){n.style.display="none"},window.onclick=function(e){e.target==n&&(n.style.display="none")},e("#lp-invoice__content").length&&e("#lp-invoice__export").click((function(){const t=new jsPDF("p","pt","letter"),a={"#bypassme":(e,t)=>!0},n={top:80,bottom:60,left:40,width:522};t.fromHTML(e("#lp-invoice__content")[0],n.left,n.top,{width:n.width,elementHandlers:a},(function(e){const a=t.output("blob");window.open(URL.createObjectURL(a))}),n)})),e("#lp-invoice__update").click((function(){let t=e(this).data("id"),a=e('input[name="site_title"]'),n=e('input[name="order_date"]'),o=e('input[name="invoice_no"]'),l=e('input[name="order_customer"]'),s=e('input[name="order_email"]'),i=e('input[name="order_payment"]');a=a.is(":checked")?"check":"uncheck",n=n.is(":checked")?"check":"uncheck",o=o.is(":checked")?"check":"uncheck",l=l.is(":checked")?"check":"uncheck",s=s.is(":checked")?"check":"uncheck",i=i.is(":checked")?"check":"uncheck",e.ajax({type:"post",dataType:"html",url:"admin-ajax.php",data:{site_title:a,order_date:n,invoice_no:o,order_customer:l,order_email:s,order_id:t,order_payment:i,action:"learnpress_update_order_exports"},beforeSend(){e(".export-options__loading").addClass("active")},success(t){e("#lp-invoice__content").html(""),e("#lp-invoice__content").append(t),e(".export-options__loading").removeClass("active"),e(".options-tab").removeClass("active"),e(".preview-tab").addClass("active"),e("#panels .export-options").removeClass("active"),e("#panels .pdf-preview").addClass("active")},error(e,t,a){console.log("The following error occured: "+t,a)}})}))}if(e.fn._filter_post_by_author(),window.location.hash){const t=window.location.hash;if("#_lp_passing_grade"==t){const a=document.querySelector(t);e("html, body").animate({scrollTop:e(t).offset().top},900,"swing"),a.parentNode.style.border="2px solid orangered"}}}))}(jQuery);
1
+ !function(e){const t=function(){e.ajax({url:"",data:{"lp-ajax":"toggle_item_preview",item_id:this.value,previewable:this.checked?"yes":"no",nonce:e(this).attr("data-nonce")},dataType:"text",success:function(e){e=LP.parseJSON(e)}})},a=function(t){const a=e(this).addClass("disabled");t.preventDefault(),e.post({url:a.attr("href"),data:{"lp-ajax":"create-pages"},dataType:"text",success:function(e){const t=a.closest(".lp-notice").html("<p>"+e+"</p>");setTimeout((function(){t.fadeOut()}),2e3)}})},n=function(t){t.preventDefault();e(this).closest(".lp-upgrade-notice").fadeOut(),e.post({url:"",data:{"lp-hide-upgrade-message":"yes"},success:function(e){}})},o=function(t){if(e(t.target).hasClass("buy-now"))return;t.preventDefault();const a=e(this).closest(".plugin-card");e(this).hasClass("updating-message")||(e(this).addClass("updating-message button-working disabled"),e.ajax({url:e(this).attr("href"),data:{},success:function(t){e.ajax({url:window.location.href,success:function(t){const n=e(t).find("#"+a.attr("id"));if(n.length)a.replaceWith(n);else{if(null==learn_press_admin_localize)return;a.find(".plugin-action-buttons a").removeClass("updating-message button-working").html(learn_press_admin_localize.plugin_installed)}}})}}))},l=function(e){return e.preventDefault(),!1};e.fn._filter_post_by_author=function(){const t=e("#post-search-input");if(!t.length)return;const a=e(t[0].form),n=e('<select name="author" id="author"></select>').insertAfter(t).select2({ajax:{url:window.location.href+"&lp-ajax=search-authors",dataType:"json",s:""},placeholder:"Search by user",minimumInputLength:3,allowClear:!0}).on("select2:select",(function(){e('input[name="author"]').val(n.val())}));a.on("submit",(function(){window.location.href.removeQueryVar("author").addQueryVar("author",n.val())}))};const s=()=>{e(".lp-button-upgrade").each((function(){e(this).on("click",(function(t){t.preventDefault(),e("#lp-update-db-modal").removeClass("lp-update-db-modal__hidden")}))})),e(".lp-update-db-modal__button").on("click",(function(t){t.preventDefault();const a=e(this),n=a.text(),o=a.data("loading"),l=e(".lp-update-db-modal__content-text").data("text");a.addClass("loading"),a.text(o);const s=()=>{e.ajax({url:lpGlobalSettings.ajax+"?action=lp_update_database",method:"GET",success(t){if("success"===t.status)return a.text(n),e(".lp-update-db-modal__content").addClass("lp-update-db-modal__success"),e(".lp-update-db-modal__content-text > h3").text(l),a.removeClass("loading"),!1;s()}})};s()}));e(".lp-update-db-modal__cancel").on("click",(function(t){t.preventDefault(),e("#lp-update-db-modal").addClass("lp-update-db-modal__hidden")}))},i=()=>{e(".lp-meta-box__file").each((t,a)=>{let n;const o=e(a).find(".lp-meta-box__file_input"),l=e(a).find(".lp-meta-box__file_list"),s=e(a).find(".btn-upload"),i=!!e(a).data("multil");e(s).on("click",e=>{e.preventDefault(),n||(n=wp.media({states:[new wp.media.controller.Library({filterable:"all",multiple:i})]}),n.on("select",(function(){const e=n.state().get("selection");let t=o.val();e.forEach((function(e){if((e=e.toJSON()).id)if(i?t=t?t+","+e.id:e.id:(t=e.id,l.empty()),"image"===e.type){const t=e.sizes&&e.sizes.thumbnail?e.sizes.thumbnail.url:e.url;l.append('<li class="lp-meta-box__file_list-item image" data-attachment_id="'+e.id+'"><img src="'+t+'" /><ul class="actions"><li><a href="#" class="delete"></a></li></ul></li>')}else l.append('<li class="lp-meta-box__file_list-item image" data-attachment_id="'+e.id+'"><img class="is_file" src="'+e.icon+'" /><span>'+e.filename+'</span><ul class="actions"><li><a href="#" class="delete"></a></li></ul></li>')})),c(),o.val(t)}))),n.open()}),i&&l.sortable({items:"li.image",cursor:"move",scrollSensitivity:40,forcePlaceholderSize:!0,forceHelperSize:!1,helper:"clone",opacity:.65,placeholder:"lp-metabox-sortable-placeholder",start(e,t){t.item.css("background-color","#f6f6f6")},stop(e,t){t.item.removeAttr("style")},update(){let t="";l.find("li.image").css("cursor","default").each((function(){const a=e(this).attr("data-attachment_id");t=t+a+","})),c(),o.val(t)}});const c=()=>{e(l).find("li.image").each((t,a)=>{e(a).find("a.delete").on("click",(function(){if(e(a).remove(),i){let t="";e(l).find("li.image").css("cursor","default").each((function(){const a=e(this).attr("data-attachment_id");t=t+a+","})),o.val(t)}else o.val("");return!1}))})};c()})};e(document).ready((function(){if(i(),s(),e(".learn-press-dropdown-pages").LP("DropdownPages"),e(".learn-press-advertisement-slider").LP("Advertisement","a","s").appendTo(e("#wpbody-content")),e(".learn-press-toggle-item-preview").on("change",t),e(".learn-press-tip").LP("QuickTip"),e(document).on("click","#learn-press-create-pages",a).on("click",".lp-upgrade-notice .close-notice",n).on("click",".plugin-action-buttons a",o).on("click","[data-remove-confirm]",l).on("mousedown",".lp-sortable-handle",(function(t){e("html, body").addClass("lp-item-moving"),e(t.target).closest(".lp-sortable-handle").css("cursor","inherit")})).on("mouseup",(function(t){e("html, body").removeClass("lp-item-moving"),e(".lp-sortable-handle").css("cursor","")})),e("#order-export__section").length){document.querySelectorAll(".tabs");const t=document.querySelectorAll(".tab"),a=document.querySelectorAll(".panel");function c(e){for(let e=0;e<t.length;e++)t[e].classList.remove("active");for(let e=0;e<a.length;e++)a[e].classList.remove("active");e.target.classList.add("active");const n=e.target.getAttribute("data-target");document.getElementById("panels").getElementsByClassName(n)[0].classList.add("active")}for(let e=0;e<t.length;e++)t[e].addEventListener("click",c,!1);const n=document.getElementById("myModal"),o=document.getElementById("order-export__button"),l=document.getElementsByClassName("close")[0];o.onclick=function(){n.style.display="block"},l.onclick=function(){n.style.display="none"},window.onclick=function(e){e.target==n&&(n.style.display="none")},e("#lp-invoice__content").length&&e("#lp-invoice__export").click((function(){const t=new jsPDF("p","pt","letter"),a={"#bypassme":(e,t)=>!0},n={top:80,bottom:60,left:40,width:522};t.fromHTML(e("#lp-invoice__content")[0],n.left,n.top,{width:n.width,elementHandlers:a},(function(e){const a=t.output("blob");window.open(URL.createObjectURL(a))}),n)})),e("#lp-invoice__update").click((function(){let t=e(this).data("id"),a=e('input[name="site_title"]'),n=e('input[name="order_date"]'),o=e('input[name="invoice_no"]'),l=e('input[name="order_customer"]'),s=e('input[name="order_email"]'),i=e('input[name="order_payment"]');a=a.is(":checked")?"check":"uncheck",n=n.is(":checked")?"check":"uncheck",o=o.is(":checked")?"check":"uncheck",l=l.is(":checked")?"check":"uncheck",s=s.is(":checked")?"check":"uncheck",i=i.is(":checked")?"check":"uncheck",e.ajax({type:"post",dataType:"html",url:"admin-ajax.php",data:{site_title:a,order_date:n,invoice_no:o,order_customer:l,order_email:s,order_id:t,order_payment:i,action:"learnpress_update_order_exports"},beforeSend(){e(".export-options__loading").addClass("active")},success(t){e("#lp-invoice__content").html(""),e("#lp-invoice__content").append(t),e(".export-options__loading").removeClass("active"),e(".options-tab").removeClass("active"),e(".preview-tab").addClass("active"),e("#panels .export-options").removeClass("active"),e("#panels .pdf-preview").addClass("active")},error(e,t,a){console.log("The following error occured: "+t,a)}})}))}if(e.fn._filter_post_by_author(),window.location.hash){const t=window.location.hash;if("#_lp_passing_grade"==t){const a=document.querySelector(t);e("html, body").animate({scrollTop:e(t).offset().top},900,"swing"),a.parentNode.style.border="2px solid orangered"}}}))}(jQuery);
assets/js/dist/utils.js CHANGED
@@ -1384,10 +1384,9 @@ var _localStorage = {
1384
  return !name ? data : value !== undefined ? value : def;
1385
  },
1386
  exists: function exists(name) {
1387
- var data = _localStorage.get(); // return data.hasOwnProperty( name );
1388
-
1389
 
1390
- return name in data;
1391
  },
1392
  remove: function remove(name) {
1393
  var data = _localStorage.get();
1384
  return !name ? data : value !== undefined ? value : def;
1385
  },
1386
  exists: function exists(name) {
1387
+ var data = _localStorage.get();
 
1388
 
1389
+ return data.hasOwnProperty(name);
1390
  },
1391
  remove: function remove(name) {
1392
  var data = _localStorage.get();
assets/js/dist/utils.min.js CHANGED
@@ -1 +1 @@
1
- !function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=9)}([,,,function(t,e){!function(t){function e(e,n){var o=t(e),i=o.attr("data-id")||LP.uniqueId();n=t.extend({event:"hover",autoClose:!0,single:!0,closeInterval:1e3,arrowOffset:null,tipClass:""},n,o.data()),o.attr("data-id",i);var r=o.attr("data-content-tip")||o.html(),a=t('<div class="learn-press-tip-floating">'+r+"</div>"),s=null,c=0,l=!1,u="el"===n.arrowOffset?o.outerWidth()/2:8,f=t("#__"+i);function p(){if(s)clearTimeout(s);else{n.single&&t(".learn-press-tip").not(o).LP("QuickTip","close"),a.appendTo(document.body);var e=o.offset();a.css({top:e.top-a.outerHeight()-8,left:e.left-a.outerWidth()/2+u})}}function d(){s&&clearTimeout(s),s=setTimeout((function(){a.detach(),s=null}),c)}function h(){c=0,d(),c=n.closeInterval}return 0===f.length&&t(document.body).append(t("<div />").attr("id","__"+i).html(r).css("display","none")),r=f.html(),a.addClass(n.tipClass),o.data("content-tip",r),o.attr("data-content-tip")&&(l=!0),c=n.closeInterval,!1===n.autoClose&&(a.append('<a class="close"></a>'),a.on("click",".close",(function(){h()}))),l||o.html(""),"click"===n.event&&o.on("click",(function(t){t.stopPropagation(),p()})),t(document).on("learn-press/close-all-quick-tip",(function(){h()})),o.hover((function(t){t.stopPropagation(),"click"!==n.event&&p()}),(function(t){t.stopPropagation(),n.autoClose&&d()})).addClass("ready"),{close:h,open:function(){p()}}}t.fn.LP("QuickTip",(function(n){return t.each(this,(function(){var o=t(this).data("quick-tip");o||(o=new e(this,n),t(this).data("quick-tip",o)),"string"==typeof n&&o[n]&&o[n].apply(o)}))}))}(jQuery)},function(t,e){var n=jQuery;n((function(){n('.form-field input[type="password"]').wrap('<span class="lp-password-input"></span>'),n(".lp-password-input").append('<span class="lp-show-password-input"></span>'),n(".lp-show-password-input").on("click",(function(){n(this).toggleClass("display-password"),n(this).hasClass("display-password")?n(this).siblings(['input[type="password"]']).prop("type","text"):n(this).siblings('input[type="text"]').prop("type","password")}))}))},,function(module,__webpack_exports__,__webpack_require__){"use strict";var _this=void 0;function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var $=window.jQuery||jQuery,serializeJSON=function serializeJSON(path){var isInput=$(this).is("input")||$(this).is("select")||$(this).is("textarea"),unIndexed=isInput?$(this).serializeArray():$(this).find("input, select, textarea").serializeArray(),indexed={},validate=/(\[([a-zA-Z0-9_-]+)?\]?)/g,arrayKeys={},end=!1;if($.each(unIndexed,(function(){var that=this,match=this.name.match(/^([0-9a-zA-Z_-]+)/);if(match){var keys=this.name.match(validate),objPath="indexed['"+match[0]+"']";keys?("object"!=_typeof(indexed[match[0]])&&(indexed[match[0]]={}),$.each(keys,(function(i,prop){prop=prop.replace(/\]|\[/g,"");var rawPath=objPath.replace(/'|\[|\]/g,""),objExp="",preObjPath=objPath;""==prop?(null==arrayKeys[rawPath]?arrayKeys[rawPath]=0:arrayKeys[rawPath]++,objPath+="['"+arrayKeys[rawPath]+"']"):(isNaN(prop)||(arrayKeys[rawPath]=prop),objPath+="['"+prop+"']");try{i==keys.length-1?(objExp=objPath+"=that.value;",end=!0):(objExp=objPath+"={}",end=!1);var evalString="if( typeof "+objPath+" == 'undefined'){"+objExp+";}else{if(end){if(typeof "+preObjPath+"!='object'){"+preObjPath+"={};}"+objExp+"}}";eval(evalString)}catch(t){console.log("Error:"+t+"\n"+objExp)}}))):indexed[match[0]]=this.value}})),path){path="['"+path.replace(".","']['")+"']";var c="try{indexed = indexed"+path+"}catch(ex){console.log(c, ex);}";eval(c)}return indexed},LP_Tooltip=function(t){return t=$.extend({},{offset:[0,0]},t||{}),$.each(_this,(function(){var e=$(this),n=e.data("content");if(n&&void 0===e.data("LP_Tooltip")){var o=null;e.on("mouseenter",(function(i){o=$('<div class="learn-press-tooltip-bubble"/>').html(n).appendTo($("body")).hide();var r=e.offset();if(Array.isArray(t.offset)){var a=t.offset[1],s=t.offset[0];$.isNumeric(s)&&(r.left+=s),$.isNumeric(a)&&(r.top+=a)}o.css({top:r.top,left:r.left}),o.fadeIn()})),e.on("mouseleave",(function(t){o&&o.remove()})),e.data("tooltip",!0)}}))},hasEvent=function(t){var e=$(this).data("events");if(void 0===e.LP)return!1;for(i=0;i<e.LP.length;i++)if(e.LP[i].namespace==t)return!0;return!1},dataToJSON=function(){var t={};return $.each(this[0].attributes,(function(){var e=this.name.match(/^data-(.*)/);e&&(t[e[1]]=this.value)})),t},rows=function(){var t=$(this).height(),e=$(this).css("line-height").replace("px","");return $(this).attr({height:t,"line-height":e}),Math.floor(t/parseInt(e))},checkLines=function(t){return this.each((function(){var e=$(this).rows();t.call(this,e)}))},findNext=function(t){var e=$(t),n=this.first(),o=e.index(n),i=e.eq(o+1);return!!i.length&&i},findPrev=function(t){var e=$(t),n=this.first(),o=e.index(n),i=e.eq(o-1);return!!i.length&&i},progress=function(t){return this.each((function(){var e=parseInt(t/100*360),n=$(this);e<180?n.find(".progress-circle").removeClass("gt-50"):n.find(".progress-circle").addClass("gt-50"),n.find(".fill").css({transform:"rotate("+e+"deg)"})}))};$.fn.serializeJSON=serializeJSON,$.fn.LP_Tooltip=LP_Tooltip,$.fn.hasEvent=hasEvent,$.fn.dataToJSON=dataToJSON,$.fn.rows=rows,$.fn.checkLines=checkLines,$.fn.findNext=findNext,$.fn.findPrev=findPrev,$.fn.progress=progress;var _unused_webpack_default_export={serializeJSON:serializeJSON,LP_Tooltip:LP_Tooltip,hasEvent:hasEvent,dataToJSON:dataToJSON,rows:rows,checkLines:checkLines,findNext:findNext,findPrev:findPrev,progress:progress}},,,function(t,e,n){"use strict";n.r(e);var o,i=window.jQuery;void 0!==i&&(i.fn.LP=o=function(t,e){if("function"==typeof e)i.fn["LP_"+t]=e;else if(t){var n=[];if(arguments.length>1)for(var o=1;o<arguments.length;o++)n.push(arguments[o]);return"function"==typeof i(this)["LP_"+t]?i(this)["LP_"+t].apply(this,n):this}return this});var r=o,a=n(3),s=n.n(a),c=window.jQuery,l={$block:null,$window:null,events:{},instances:[],instance:null,quickConfirm:function(t,e){var n=c(t);c("[learn-press-quick-confirm]").each((function(){var t;(t=c(this).data("quick-confirm"))&&(console.log(t),t.destroy())})),!n.attr("learn-press-quick-confirm")&&n.attr("learn-press-quick-confirm","true").data("quick-confirm",new function(t,e){var n=c(t),o=c('<span class="learn-press-quick-confirm"></span>').insertAfter(n),i=c(t).position()||{left:0,top:0},r=null,a=null,s=3,l=function(){o.fadeOut("fast",(function(){c(this).remove(),o.parent().css("position","")})),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()},u=function(){a&&clearInterval(a),r&&clearInterval(r)},f=function(){r=setInterval((function(){0==--s&&(l.call(o[0]),"function"==typeof e.onCancel&&e.onCancel(e.data),u()),o.find("span").html(" ("+s+")")}),1e3),a=setInterval((function(){n.is(":visible")&&"hidden"!=n.css("visibility")||(u(),o.remove(),o.parent().css("position",""),"function"==typeof e.onCancel&&e.onCancel(e.data))}),350)};e=c.extend({message:"",data:null,onOk:null,onCancel:null,offset:{top:0,left:0}},e||{}),o.html(e.message||n.attr("data-confirm-remove")||"Are you sure?").append("<span> ("+s+")</span>").css({}),o.click((function(){"function"==typeof e.onOk&&e.onOk(e.data),l()})).hover((function(){u()}),(function(){f()})),o.css({left:i.left+n.outerWidth()-o.outerWidth()+e.offset.left,top:i.top+n.outerHeight()+e.offset.top+5}).hide().fadeIn("fast"),f(),this.destroy=function(){o.remove(),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()}}(t,e))},show:function(t,e){c.proxy((function(){e=c.extend({title:"",buttons:"",events:!1,autohide:!1,message:t,data:!1,id:LP.uniqueId(),onHide:null},e||{}),this.instances.push(e),this.instance=e;c(document);var n=c(document.body);this.$block||(this.$block=c('<div id="learn-press-message-box-block"></div>').appendTo(n)),this.$window||(this.$window=c('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block),this.$window.click((function(){}))),this._createWindow(t,e.title,e.buttons),this.$block.show(),this.$window.show().attr("instance",e.id),c(window).bind("resize.message-box",c.proxy(this.update,this)).bind("scroll.message-box",c.proxy(this.update,this)),this.update(!0),e.autohide&&setTimeout((function(){LP.MessageBox.hide(),"function"==typeof e.onHide&&e.onHide.call(LP.MessageBox,e)}),e.autohide)}),this)()},blockUI:function(t){t=(!1!==t?t||"Wait a moment":"")+'<div class="message-box-animation"></div>',this.show(t)},hide:function(t,e){e?this._removeInstance(e.id):this.instance&&this._removeInstance(this.instance.id),0===this.instances.length?(this.$block&&this.$block.hide(),this.$window&&this.$window.hide(),c(window).unbind("resize.message-box",this.update).unbind("scroll.message-box",this.update)):this.instance&&this._createWindow(this.instance.message,this.instance.title,this.instance.buttons)},update:function(t){var e=this,n=this.$window.find("#message-box-wrap"),o=n.data("timer"),i=function(){LP.Hook.doAction("learn_press_message_box_before_resize",e);var t=n.find(".message-box-content").css("height","").css("overflow","hidden"),o=(n.outerWidth(),n.outerHeight()),i=t.height(),r=c(window).height();n.offset().top;i>r-50?(t.css({height:r-25}),o=n.outerHeight()):t.css("height","").css("overflow",""),n.css({marginTop:(c(window).height()-o)/2}),LP.Hook.doAction("learn_press_message_box_resize",o,e)};t&&i(),o&&clearTimeout(o),o=setTimeout(i,250)},_removeInstance:function(t){for(var e=0;e<this.instances.length;e++)if(this.instances[e].id===t){this.instances.splice(e,1);var n=this.instances.length;n?(this.instance=this.instances[n-1],this.$window.attr("instance",this.instance.id)):(this.instance=!1,this.$window.removeAttr("instance"));break}},_getInstance:function(t){for(var e=0;e<this.instances.length;e++)if(this.instances[e].id===t)return this.instances[e]},_createWindow:function(t,e,n){var o=this.$window.find("#message-box-wrap").html("");if(e&&o.append('<h3 class="message-box-title">'+e+"</h3>"),o.append(c('<div class="message-box-content"></div>').html(t)),n){var i=c('<div class="message-box-buttons"></div>');switch(n){case"yesNo":i.append(this._createButton(LP_Settings.localize.button_yes,"yes")),i.append(this._createButton(LP_Settings.localize.button_no,"no"));break;case"okCancel":i.append(this._createButton(LP_Settings.localize.button_ok,"ok")),i.append(this._createButton(LP_Settings.localize.button_cancel,"cancel"));break;default:i.append(this._createButton(LP_Settings.localize.button_ok,"ok"))}o.append(i)}},_createButton:function(t,e){var n=c('<button type="button" class="button message-box-button message-box-button-'+e+'">'+t+"</button>"),o="on"+(e.substr(0,1).toUpperCase()+e.substr(1));return n.data("callback",o).click((function(){var t=c(this).data("instance"),e=t.events[c(this).data("callback")];"function"===c.type(e)&&!1===e.apply(LP.MessageBox,[t])||LP.MessageBox.hide(null,t)})).data("instance",this.instance),n}},u=function(t){var e={};window.jQuery;this.on=function(n,o){var i=n.split("."),r="";return i.length>1&&(n=i[0],r=i[1]),e[n]||(e[n]=[[],{}]),r?(e[n][1][r]||(e[n][1][r]=[]),e[n][1][r].push(o)):e[n][0].push(o),t},this.off=function(n,o){var i=n.split("."),r="";if(i.length>1&&(n=i[0],r=i[1]),!e[n])return t;var a=-1;if(r){if(!e[n][1][r])return t;if("function"==typeof o){if((a=e[n][1][r].indexOf(o))<0)return t;e[n][1][r].splice(a,1)}else e[n][1][r]=[]}else if("function"==typeof o){if((a=e[n][0].indexOf(o))<0)return t;e[n][0].splice(a,1)}else e[n][0]=[];return t},this.callEvent=function(n,o){if(e[n]){if(e[n][0])for(var i=0;i<e[n][0].length;i++)"function"==typeof e[n][0][i]&&e[n][i][0].apply(t,o);if(e[n][1])for(var i in e[n][1])for(var r=0;r<e[n][1][i].length;r++)"function"==typeof e[n][1][i][r]&&e[n][1][i][r].apply(t,o)}}},f={hooks:{action:{},filter:{}},addAction:function(t,e,n,o){return this.addHook("action",t,e,n,o),this},addFilter:function(t,e,n,o){return this.addHook("filter",t,e,n,o),this},doAction:function(t){return this.doHook("action",t,arguments)},applyFilters:function(t){return this.doHook("filter",t,arguments)},removeAction:function(t,e){return this.removeHook("action",t,e),this},removeFilter:function(t,e,n){return this.removeHook("filter",t,e,n),this},addHook:function(t,e,n,o,i){void 0===this.hooks[t][e]&&(this.hooks[t][e]=[]);var r=this.hooks[t][e];return void 0===i&&(i=e+"_"+r.length),this.hooks[t][e].push({tag:i,callable:n,priority:o}),this},doHook:function(t,e,n){if(n=Array.prototype.slice.call(n,1),void 0!==this.hooks[t][e]){var o,i=this.hooks[t][e];i.sort((function(t,e){return t.priority-e.priority}));for(var r=0;r<i.length;r++)"function"!=typeof(o=i[r].callable)&&(o=window[o]),"action"===t?n[r]=o.apply(null,n):n[0]=o.apply(null,n)}return"filter"===t?n[0]:n},removeHook:function(t,e,n,o){if(void 0!==this.hooks[t][e])for(var i=this.hooks[t][e],r=i.length-1;r>=0;r--)void 0!==o&&o!==i[r].tag||void 0!==n&&n!==i[r].priority||i.splice(r,1);return this}},p={get:function(t,e,n){var o;if(n)o=wpCookies.get(t);else{var i=wpCookies.get("LP");i&&(i=JSON.parse(i),o=t?i[t]:i)}return o||o===e||(o=e),o},set:function(t,e,n,o,i,r){if(arguments.length>2)wpCookies.set(t,e,n,o,i,r);else if(2==arguments.length){var a=wpCookies.get("LP");(a=a?JSON.parse(a):{})[t]=e,wpCookies.set("LP",JSON.stringify(a),"","/")}else wpCookies.set("LP",JSON.stringify(t),"","/")},remove:function(t){var e=p.get(),n=new RegExp(t,"g"),o={},i=t.match(/\*/);for(var r in e)i?r.match(n)||(o[r]=e[r]):t!=r&&(o[r]=e[r]);p.set(o)}},d=p,h={__key:"LP",set:function(t,e){var n=h.get(),o=lodash.set;o(n,t,e),localStorage.setItem(h.__key,JSON.stringify(n))},get:function(t,e){var n=JSON.parse(localStorage.getItem(h.__key)||"{}"),o=lodash.get,i=o(n,t);return t?void 0!==i?i:e:n},exists:function(t){return t in h.get()},remove:function(t){var e=h.get(),n=lodash.omit(e,t);h.__set(n)},__get:function(){return localStorage.getItem(h.__key)},__set:function(t){localStorage.setItem(h.__key,JSON.stringify(t||"{}"))}},v=h,g=(n(6),1),y=window.jQuery||jQuery,m=function(t){var e="ajax-iframe-"+g,n=y('form[name="'+e+'"]');n.length||(n=y("<iframe />").appendTo(document.body).attr({name:e,src:"#"})),y(t).on("submit",(function(){var n=y(t).clone().appendTo(document.body);return n.attr("target",e),n.find("#submit").remove(),!1})),g++},b=n(4),w=n.n(b);function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function x(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var P=jQuery;String.prototype.getQueryVar=function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(this);return null===e?"":decodeURIComponent(e[1].replace(/\+/g," "))},String.prototype.addQueryVar=function(t,e){var n=this,o=n.split("#");return n=o[0],t.match(/\[/)?(n+=n.match(/\?/)?"&":"?",n+=t+"="+e):-1!=n.indexOf("&"+t+"=")||-1!=n.indexOf("?"+t+"=")?n=n.replace(new RegExp(t+"=([^&#]*)","g"),t+"="+e):(n+=n.match(/\?/)?"&":"?",n+=t+"="+e),n+(o[1]?"#"+o[1]:"")},String.prototype.removeQueryVar=function(t){var e=this,n=e.split("#");e=n[0],t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var o=new RegExp("[\\?&]"+t+"([[][^=]*)?=([^&#]*)","g");return(e=e.replace(o,""))+(n[1]?"#"+n[1]:"")};var S={Hook:f,setUrl:function(t,e,n){t&&(history.pushState({},n,t),LP.Hook.doAction("learn_press_set_location_url",t))},toggleGroupSection:function(t,e){var n=P(t);n.hasClass("hide-if-js")&&n.hide().removeClass("hide-if-js"),n.removeClass("hide-if-js").slideToggle((function(){P(this).is(":visible")?P(e).addClass("toggle-on").removeClass("toggle-off"):P(e).addClass("toggle-off").removeClass("toggle-on")}))},overflow:function(t,e){var n=P(t),o=n.css("overflow");e?n.css("overflow",e).data("overflow",o):n.css("overflow",n.data("overflow"))},getUrl:function(){return window.location.href},addQueryVar:function(t,e,n){return(void 0===n?window.location.href:n).addQueryVar(t,e)},removeQueryVar:function(t,e){return(void 0===e?window.location.href:e).removeQueryVar(t)},reload:function(t){t||(t=window.location.href),window.location.href=t},parseResponse:function(t,e){var n=t.match(/<\x2D\x2D LP_AJAX_START \x2D\x2D>([\s\S]*)<\x2D\x2D LP_AJAX_END \x2D\x2D>/);return n&&(t=n[1]),"json"===(e||"json")?this.parseJSON(t):t},parseJSON:function(t){if("string"!=typeof t)return t;var e=String.raw({raw:t}).match(/<\x2D\x2D LP_AJAX_START \x2D\x2D>([\s\S]*)<\x2D\x2D LP_AJAX_END \x2D\x2D>/);try{t=e?JSON.parse(e[1].replace(/(?:\r\n|\r|\n)/g,"")):JSON.parse(t)}catch(e){t={}}return t},ajax:function(t){var e=t.type||"post",n=t.dataType||"json",o=t.action?P.extend(t.data,{"lp-ajax":t.action}):t.data,i=t.beforeSend||function(){},r=t.url||window.location.href;P.ajax({data:o,url:r,type:e,dataType:"html",beforeSend:i.apply(null,t),success:function(e){var o=LP.parseResponse(e,n);"function"==typeof t.success&&t.success(o,e)},error:function(){"function"==typeof t.error&&t.error.apply(null,LP.funcArgs2Array())}})},doAjax:function(t){var e=t.type||"post",n=t.dataType||"json",o=(void 0===t.prefix||"learnpress_")+t.action,i=t.action?P.extend(t.data,{action:o}):t.data;P.ajax({data:i,url:t.url||window.location.href,type:e,dataType:"html",success:function(e){var o=LP.parseResponse(e,n);"function"==typeof t.success&&t.success(o,e)},error:function(){"function"==typeof t.error&&t.error.apply(null,LP.funcArgs2Array())}})},funcArgs2Array:function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e},addFilter:function(t,e){var n=P(document),o="LP."+t;return n.on(o,e),LP.log(n.data("events")),this},applyFilters:function(){var t=P(document),e=arguments[0],n=this.funcArgs2Array(arguments);return t.hasEvent(e)?(n[0]="LP."+e,t.triggerHandler.apply(t,n)):n[1]},addAction:function(t,e){return this.addFilter(t,e)},doAction:function(){var t=P(document),e=arguments[0],n=this.funcArgs2Array(arguments);t.hasEvent(e)&&(n[0]="LP."+e,t.trigger.apply(t,n))},toElement:function(t,e){if(0!==P(t).length){e=P.extend({delay:300,duration:"slow",offset:50,container:null,callback:null,invisible:!1},e||{});var n,o=P(e.container);0===o.length&&(o=P("body, html")),n=o.offset().top;var i=P(t).offset().top+o.scrollTop()-n-e.offset;e.invisible&&function(t,e){var n=o.scrollTop(),i=n+o.height(),r=P(t).offset().top-o.offset().top,a=r+P(t).height();return!0===e?n<r&&i>a:r<=i&&a>=n}(t,!0)||o.fadeIn(10).delay(e.delay).animate({scrollTop:i},e.duration,e.callback)}},uniqueId:function(t,e){var n;void 0===t&&(t="");var o=function(t,e){return e<(t=parseInt(t,10).toString(16)).length?t.slice(t.length-e):e>t.length?new Array(e-t.length+1).join("0")+t:t};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,n=t,n+=o(parseInt((new Date).getTime()/1e3,10),8),n+=o(this.php_js.uniqidSeed,5),e&&(n+=(10*Math.random()).toFixed(8).toString()),n},log:function(){for(var t=0,e=arguments.length;t<e;t++)console.log(arguments[t])},blockContent:function(){0===P("#learn-press-block-content").length&&P(LP.template("learn-press-template-block-content",{})).appendTo(P("body")),LP.hideMainScrollbar().addClass("block-content"),P(document).trigger("learn_press_block_content")},unblockContent:function(){setTimeout((function(){LP.showMainScrollbar().removeClass("block-content"),P(document).trigger("learn_press_unblock_content")}),350)},hideMainScrollbar:function(t){t||(t="html, body");var e=P(t);return e.each((function(){var t=P(this),e=t.css("overflow");t.css("overflow","hidden").attr("overflow",e)})),e},showMainScrollbar:function(t){t||(t="html, body");var e=P(t);return e.each((function(){var t=P(this),e=t.attr("overflow");t.css("overflow",e).removeAttr("overflow")})),e},template:"undefined"!=typeof _?_.memoize((function(t,e){var n,o={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},i=function(e){return(n=n||_.template(P("#"+t).html(),null,o))(e)};return e?i(e):i}),(function(t,e){return t+"-"+JSON.stringify(e)})):function(){return""},alert:function(t,e){var n="",o="";"string"==typeof t?o=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(o=t.message)),P.alerts.alert(o,n,(function(t){LP._on_alert_hide(),e&&e(t)})),this._on_alert_show()},confirm:function(t,e){var n="",o="";"string"==typeof t?o=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(o=t.message)),P.alerts.confirm(o,n,(function(t){LP._on_alert_hide(),e&&e(t)})),this._on_alert_show()},_on_alert_show:function(){var t=P("#popup_container");P('<span id="popup_container_placeholder" />').insertAfter(t).data("xxx",t);t.stop().css("top","-=50").css("opacity","0").animate({top:"+=50",opacity:1},250)},_on_alert_hide:function(){var t=P("#popup_container_placeholder"),e=t.data("xxx");e&&e.replaceWith(t),e.appendTo(P(document.body)),e.stop().animate({top:"+=50",opacity:0},250,(function(){P(this).remove()}))},sendMessage:function(t,e,n,o){P.isPlainObject(t)&&(t=JSON.stringify(t)),n=n||"*",(e=e||window).postMessage(t,n,o)},receiveMessage:function(t,e){var n=t.origin||t.originalEvent.origin,o=t.data||t.originalEvent.data||"";("string"==typeof o||o instanceof String)&&0===o.indexOf("{")&&(o=LP.parseJSON(o)),LP.Hook.doAction("learn_press_receive_message",o,n)},camelCaseDashObjectKeys:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=LP,o=function(t){return Array.isArray(t)},i=function(t){return t===Object(t)&&!o(t)&&"function"!=typeof t},r=function(t){return t.replace(/([-_][a-z])/gi,(function(t){return t.toUpperCase().replace("-","").replace("_","")}))};if(i(t)){var a={};return Object.keys(t).forEach((function(o){a[r(o)]=e?n.camelCaseDashObjectKeys(t[o]):t[o]})),a}return o(t)?t.map((function(t){return n.camelCaseDashObjectKeys(t)})):t},IframeSubmit:m};P(document).ready((function(){var t,e;void 0!==P.alerts&&(P.alerts.overlayColor="#000",P.alerts.overlayOpacity=.5,P.alerts.okButton=lpGlobalSettings.localize.button_ok,P.alerts.cancelButton=lpGlobalSettings.localize.button_cancel),P(".learn-press-message.fixed").each((function(){var t=P(this),e=t.data();!function(t,e){e.delayIn&&setTimeout((function(){t.show().hide().fadeIn()}),e.delayIn),e.delayOut&&setTimeout((function(){t.fadeOut()}),e.delayOut+(e.delayIn||0))}(t,e)})),setTimeout((function(){P(".learn-press-nav-tabs li.active:not(.default) a").trigger("click")}),300),P("body.course-item-popup").parent().css("overflow","hidden"),t=null,e=function(){P(".auto-check-lines").checkLines((function(t){t>1?P(this).removeClass("single-lines"):P(this).addClass("single-lines"),P(this).attr("rows",t)}))},P(window).on("resize.check-lines",(function(){t?(t&&clearTimeout(t),t=setTimeout(e,300)):e()})),P(".learn-press-tooltip, .lp-passing-conditional").LP_Tooltip({offset:[24,24]}),P(".learn-press-icon").LP_Tooltip({offset:[30,30]}),P(".learn-press-message[data-autoclose]").each((function(){var t=P(this),e=parseInt(t.data("autoclose"));e&&setTimeout((function(t){t.fadeOut()}),e,t)})),P(document).on("click",(function(){P(document).trigger("learn-press/close-all-quick-tip")}))})),function(){window.LP=window.LP||{},"string"==typeof arguments[0]?(LP[arguments[0]]=LP[arguments[0]]||{},LP[arguments[0]]=jQuery.extend(LP[arguments[0]],arguments[1])):LP=jQuery.extend(LP,arguments[0])}(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k(Object(n),!0).forEach((function(e){x(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({Event_Callback:u,MessageBox:l,Cookies:d,localStorage:v},S));e.default={fn:r,QuickTip:s.a,Cookies:d,localStorage:v,showPass:w.a}}]);
1
+ !function(t){var e={};function n(o){if(e[o])return e[o].exports;var i=e[o]={i:o,l:!1,exports:{}};return t[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,o){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:o})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=9)}([,,,function(t,e){!function(t){function e(e,n){var o=t(e),i=o.attr("data-id")||LP.uniqueId();n=t.extend({event:"hover",autoClose:!0,single:!0,closeInterval:1e3,arrowOffset:null,tipClass:""},n,o.data()),o.attr("data-id",i);var r=o.attr("data-content-tip")||o.html(),a=t('<div class="learn-press-tip-floating">'+r+"</div>"),s=null,c=0,l=!1,u="el"===n.arrowOffset?o.outerWidth()/2:8,f=t("#__"+i);function p(){if(s)clearTimeout(s);else{n.single&&t(".learn-press-tip").not(o).LP("QuickTip","close"),a.appendTo(document.body);var e=o.offset();a.css({top:e.top-a.outerHeight()-8,left:e.left-a.outerWidth()/2+u})}}function d(){s&&clearTimeout(s),s=setTimeout((function(){a.detach(),s=null}),c)}function h(){c=0,d(),c=n.closeInterval}return 0===f.length&&t(document.body).append(t("<div />").attr("id","__"+i).html(r).css("display","none")),r=f.html(),a.addClass(n.tipClass),o.data("content-tip",r),o.attr("data-content-tip")&&(l=!0),c=n.closeInterval,!1===n.autoClose&&(a.append('<a class="close"></a>'),a.on("click",".close",(function(){h()}))),l||o.html(""),"click"===n.event&&o.on("click",(function(t){t.stopPropagation(),p()})),t(document).on("learn-press/close-all-quick-tip",(function(){h()})),o.hover((function(t){t.stopPropagation(),"click"!==n.event&&p()}),(function(t){t.stopPropagation(),n.autoClose&&d()})).addClass("ready"),{close:h,open:function(){p()}}}t.fn.LP("QuickTip",(function(n){return t.each(this,(function(){var o=t(this).data("quick-tip");o||(o=new e(this,n),t(this).data("quick-tip",o)),"string"==typeof n&&o[n]&&o[n].apply(o)}))}))}(jQuery)},function(t,e){var n=jQuery;n((function(){n('.form-field input[type="password"]').wrap('<span class="lp-password-input"></span>'),n(".lp-password-input").append('<span class="lp-show-password-input"></span>'),n(".lp-show-password-input").on("click",(function(){n(this).toggleClass("display-password"),n(this).hasClass("display-password")?n(this).siblings(['input[type="password"]']).prop("type","text"):n(this).siblings('input[type="text"]').prop("type","password")}))}))},,function(module,__webpack_exports__,__webpack_require__){"use strict";var _this=void 0;function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var $=window.jQuery||jQuery,serializeJSON=function serializeJSON(path){var isInput=$(this).is("input")||$(this).is("select")||$(this).is("textarea"),unIndexed=isInput?$(this).serializeArray():$(this).find("input, select, textarea").serializeArray(),indexed={},validate=/(\[([a-zA-Z0-9_-]+)?\]?)/g,arrayKeys={},end=!1;if($.each(unIndexed,(function(){var that=this,match=this.name.match(/^([0-9a-zA-Z_-]+)/);if(match){var keys=this.name.match(validate),objPath="indexed['"+match[0]+"']";keys?("object"!=_typeof(indexed[match[0]])&&(indexed[match[0]]={}),$.each(keys,(function(i,prop){prop=prop.replace(/\]|\[/g,"");var rawPath=objPath.replace(/'|\[|\]/g,""),objExp="",preObjPath=objPath;""==prop?(null==arrayKeys[rawPath]?arrayKeys[rawPath]=0:arrayKeys[rawPath]++,objPath+="['"+arrayKeys[rawPath]+"']"):(isNaN(prop)||(arrayKeys[rawPath]=prop),objPath+="['"+prop+"']");try{i==keys.length-1?(objExp=objPath+"=that.value;",end=!0):(objExp=objPath+"={}",end=!1);var evalString="if( typeof "+objPath+" == 'undefined'){"+objExp+";}else{if(end){if(typeof "+preObjPath+"!='object'){"+preObjPath+"={};}"+objExp+"}}";eval(evalString)}catch(t){console.log("Error:"+t+"\n"+objExp)}}))):indexed[match[0]]=this.value}})),path){path="['"+path.replace(".","']['")+"']";var c="try{indexed = indexed"+path+"}catch(ex){console.log(c, ex);}";eval(c)}return indexed},LP_Tooltip=function(t){return t=$.extend({},{offset:[0,0]},t||{}),$.each(_this,(function(){var e=$(this),n=e.data("content");if(n&&void 0===e.data("LP_Tooltip")){var o=null;e.on("mouseenter",(function(i){o=$('<div class="learn-press-tooltip-bubble"/>').html(n).appendTo($("body")).hide();var r=e.offset();if(Array.isArray(t.offset)){var a=t.offset[1],s=t.offset[0];$.isNumeric(s)&&(r.left+=s),$.isNumeric(a)&&(r.top+=a)}o.css({top:r.top,left:r.left}),o.fadeIn()})),e.on("mouseleave",(function(t){o&&o.remove()})),e.data("tooltip",!0)}}))},hasEvent=function(t){var e=$(this).data("events");if(void 0===e.LP)return!1;for(i=0;i<e.LP.length;i++)if(e.LP[i].namespace==t)return!0;return!1},dataToJSON=function(){var t={};return $.each(this[0].attributes,(function(){var e=this.name.match(/^data-(.*)/);e&&(t[e[1]]=this.value)})),t},rows=function(){var t=$(this).height(),e=$(this).css("line-height").replace("px","");return $(this).attr({height:t,"line-height":e}),Math.floor(t/parseInt(e))},checkLines=function(t){return this.each((function(){var e=$(this).rows();t.call(this,e)}))},findNext=function(t){var e=$(t),n=this.first(),o=e.index(n),i=e.eq(o+1);return!!i.length&&i},findPrev=function(t){var e=$(t),n=this.first(),o=e.index(n),i=e.eq(o-1);return!!i.length&&i},progress=function(t){return this.each((function(){var e=parseInt(t/100*360),n=$(this);e<180?n.find(".progress-circle").removeClass("gt-50"):n.find(".progress-circle").addClass("gt-50"),n.find(".fill").css({transform:"rotate("+e+"deg)"})}))};$.fn.serializeJSON=serializeJSON,$.fn.LP_Tooltip=LP_Tooltip,$.fn.hasEvent=hasEvent,$.fn.dataToJSON=dataToJSON,$.fn.rows=rows,$.fn.checkLines=checkLines,$.fn.findNext=findNext,$.fn.findPrev=findPrev,$.fn.progress=progress;var _unused_webpack_default_export={serializeJSON:serializeJSON,LP_Tooltip:LP_Tooltip,hasEvent:hasEvent,dataToJSON:dataToJSON,rows:rows,checkLines:checkLines,findNext:findNext,findPrev:findPrev,progress:progress}},,,function(t,e,n){"use strict";n.r(e);var o,i=window.jQuery;void 0!==i&&(i.fn.LP=o=function(t,e){if("function"==typeof e)i.fn["LP_"+t]=e;else if(t){var n=[];if(arguments.length>1)for(var o=1;o<arguments.length;o++)n.push(arguments[o]);return"function"==typeof i(this)["LP_"+t]?i(this)["LP_"+t].apply(this,n):this}return this});var r=o,a=n(3),s=n.n(a),c=window.jQuery,l={$block:null,$window:null,events:{},instances:[],instance:null,quickConfirm:function(t,e){var n=c(t);c("[learn-press-quick-confirm]").each((function(){var t;(t=c(this).data("quick-confirm"))&&(console.log(t),t.destroy())})),!n.attr("learn-press-quick-confirm")&&n.attr("learn-press-quick-confirm","true").data("quick-confirm",new function(t,e){var n=c(t),o=c('<span class="learn-press-quick-confirm"></span>').insertAfter(n),i=c(t).position()||{left:0,top:0},r=null,a=null,s=3,l=function(){o.fadeOut("fast",(function(){c(this).remove(),o.parent().css("position","")})),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()},u=function(){a&&clearInterval(a),r&&clearInterval(r)},f=function(){r=setInterval((function(){0==--s&&(l.call(o[0]),"function"==typeof e.onCancel&&e.onCancel(e.data),u()),o.find("span").html(" ("+s+")")}),1e3),a=setInterval((function(){n.is(":visible")&&"hidden"!=n.css("visibility")||(u(),o.remove(),o.parent().css("position",""),"function"==typeof e.onCancel&&e.onCancel(e.data))}),350)};e=c.extend({message:"",data:null,onOk:null,onCancel:null,offset:{top:0,left:0}},e||{}),o.html(e.message||n.attr("data-confirm-remove")||"Are you sure?").append("<span> ("+s+")</span>").css({}),o.click((function(){"function"==typeof e.onOk&&e.onOk(e.data),l()})).hover((function(){u()}),(function(){f()})),o.css({left:i.left+n.outerWidth()-o.outerWidth()+e.offset.left,top:i.top+n.outerHeight()+e.offset.top+5}).hide().fadeIn("fast"),f(),this.destroy=function(){o.remove(),n.removeAttr("learn-press-quick-confirm").data("quick-confirm",void 0),u()}}(t,e))},show:function(t,e){c.proxy((function(){e=c.extend({title:"",buttons:"",events:!1,autohide:!1,message:t,data:!1,id:LP.uniqueId(),onHide:null},e||{}),this.instances.push(e),this.instance=e;c(document);var n=c(document.body);this.$block||(this.$block=c('<div id="learn-press-message-box-block"></div>').appendTo(n)),this.$window||(this.$window=c('<div id="learn-press-message-box-window"><div id="message-box-wrap"></div> </div>').insertAfter(this.$block),this.$window.click((function(){}))),this._createWindow(t,e.title,e.buttons),this.$block.show(),this.$window.show().attr("instance",e.id),c(window).bind("resize.message-box",c.proxy(this.update,this)).bind("scroll.message-box",c.proxy(this.update,this)),this.update(!0),e.autohide&&setTimeout((function(){LP.MessageBox.hide(),"function"==typeof e.onHide&&e.onHide.call(LP.MessageBox,e)}),e.autohide)}),this)()},blockUI:function(t){t=(!1!==t?t||"Wait a moment":"")+'<div class="message-box-animation"></div>',this.show(t)},hide:function(t,e){e?this._removeInstance(e.id):this.instance&&this._removeInstance(this.instance.id),0===this.instances.length?(this.$block&&this.$block.hide(),this.$window&&this.$window.hide(),c(window).unbind("resize.message-box",this.update).unbind("scroll.message-box",this.update)):this.instance&&this._createWindow(this.instance.message,this.instance.title,this.instance.buttons)},update:function(t){var e=this,n=this.$window.find("#message-box-wrap"),o=n.data("timer"),i=function(){LP.Hook.doAction("learn_press_message_box_before_resize",e);var t=n.find(".message-box-content").css("height","").css("overflow","hidden"),o=(n.outerWidth(),n.outerHeight()),i=t.height(),r=c(window).height();n.offset().top;i>r-50?(t.css({height:r-25}),o=n.outerHeight()):t.css("height","").css("overflow",""),n.css({marginTop:(c(window).height()-o)/2}),LP.Hook.doAction("learn_press_message_box_resize",o,e)};t&&i(),o&&clearTimeout(o),o=setTimeout(i,250)},_removeInstance:function(t){for(var e=0;e<this.instances.length;e++)if(this.instances[e].id===t){this.instances.splice(e,1);var n=this.instances.length;n?(this.instance=this.instances[n-1],this.$window.attr("instance",this.instance.id)):(this.instance=!1,this.$window.removeAttr("instance"));break}},_getInstance:function(t){for(var e=0;e<this.instances.length;e++)if(this.instances[e].id===t)return this.instances[e]},_createWindow:function(t,e,n){var o=this.$window.find("#message-box-wrap").html("");if(e&&o.append('<h3 class="message-box-title">'+e+"</h3>"),o.append(c('<div class="message-box-content"></div>').html(t)),n){var i=c('<div class="message-box-buttons"></div>');switch(n){case"yesNo":i.append(this._createButton(LP_Settings.localize.button_yes,"yes")),i.append(this._createButton(LP_Settings.localize.button_no,"no"));break;case"okCancel":i.append(this._createButton(LP_Settings.localize.button_ok,"ok")),i.append(this._createButton(LP_Settings.localize.button_cancel,"cancel"));break;default:i.append(this._createButton(LP_Settings.localize.button_ok,"ok"))}o.append(i)}},_createButton:function(t,e){var n=c('<button type="button" class="button message-box-button message-box-button-'+e+'">'+t+"</button>"),o="on"+(e.substr(0,1).toUpperCase()+e.substr(1));return n.data("callback",o).click((function(){var t=c(this).data("instance"),e=t.events[c(this).data("callback")];"function"===c.type(e)&&!1===e.apply(LP.MessageBox,[t])||LP.MessageBox.hide(null,t)})).data("instance",this.instance),n}},u=function(t){var e={};window.jQuery;this.on=function(n,o){var i=n.split("."),r="";return i.length>1&&(n=i[0],r=i[1]),e[n]||(e[n]=[[],{}]),r?(e[n][1][r]||(e[n][1][r]=[]),e[n][1][r].push(o)):e[n][0].push(o),t},this.off=function(n,o){var i=n.split("."),r="";if(i.length>1&&(n=i[0],r=i[1]),!e[n])return t;var a=-1;if(r){if(!e[n][1][r])return t;if("function"==typeof o){if((a=e[n][1][r].indexOf(o))<0)return t;e[n][1][r].splice(a,1)}else e[n][1][r]=[]}else if("function"==typeof o){if((a=e[n][0].indexOf(o))<0)return t;e[n][0].splice(a,1)}else e[n][0]=[];return t},this.callEvent=function(n,o){if(e[n]){if(e[n][0])for(var i=0;i<e[n][0].length;i++)"function"==typeof e[n][0][i]&&e[n][i][0].apply(t,o);if(e[n][1])for(var i in e[n][1])for(var r=0;r<e[n][1][i].length;r++)"function"==typeof e[n][1][i][r]&&e[n][1][i][r].apply(t,o)}}},f={hooks:{action:{},filter:{}},addAction:function(t,e,n,o){return this.addHook("action",t,e,n,o),this},addFilter:function(t,e,n,o){return this.addHook("filter",t,e,n,o),this},doAction:function(t){return this.doHook("action",t,arguments)},applyFilters:function(t){return this.doHook("filter",t,arguments)},removeAction:function(t,e){return this.removeHook("action",t,e),this},removeFilter:function(t,e,n){return this.removeHook("filter",t,e,n),this},addHook:function(t,e,n,o,i){void 0===this.hooks[t][e]&&(this.hooks[t][e]=[]);var r=this.hooks[t][e];return void 0===i&&(i=e+"_"+r.length),this.hooks[t][e].push({tag:i,callable:n,priority:o}),this},doHook:function(t,e,n){if(n=Array.prototype.slice.call(n,1),void 0!==this.hooks[t][e]){var o,i=this.hooks[t][e];i.sort((function(t,e){return t.priority-e.priority}));for(var r=0;r<i.length;r++)"function"!=typeof(o=i[r].callable)&&(o=window[o]),"action"===t?n[r]=o.apply(null,n):n[0]=o.apply(null,n)}return"filter"===t?n[0]:n},removeHook:function(t,e,n,o){if(void 0!==this.hooks[t][e])for(var i=this.hooks[t][e],r=i.length-1;r>=0;r--)void 0!==o&&o!==i[r].tag||void 0!==n&&n!==i[r].priority||i.splice(r,1);return this}},p={get:function(t,e,n){var o;if(n)o=wpCookies.get(t);else{var i=wpCookies.get("LP");i&&(i=JSON.parse(i),o=t?i[t]:i)}return o||o===e||(o=e),o},set:function(t,e,n,o,i,r){if(arguments.length>2)wpCookies.set(t,e,n,o,i,r);else if(2==arguments.length){var a=wpCookies.get("LP");(a=a?JSON.parse(a):{})[t]=e,wpCookies.set("LP",JSON.stringify(a),"","/")}else wpCookies.set("LP",JSON.stringify(t),"","/")},remove:function(t){var e=p.get(),n=new RegExp(t,"g"),o={},i=t.match(/\*/);for(var r in e)i?r.match(n)||(o[r]=e[r]):t!=r&&(o[r]=e[r]);p.set(o)}},d=p,h={__key:"LP",set:function(t,e){var n=h.get(),o=lodash.set;o(n,t,e),localStorage.setItem(h.__key,JSON.stringify(n))},get:function(t,e){var n=JSON.parse(localStorage.getItem(h.__key)||"{}"),o=lodash.get,i=o(n,t);return t?void 0!==i?i:e:n},exists:function(t){return h.get().hasOwnProperty(t)},remove:function(t){var e=h.get(),n=lodash.omit(e,t);h.__set(n)},__get:function(){return localStorage.getItem(h.__key)},__set:function(t){localStorage.setItem(h.__key,JSON.stringify(t||"{}"))}},v=h,g=(n(6),1),y=window.jQuery||jQuery,m=function(t){var e="ajax-iframe-"+g,n=y('form[name="'+e+'"]');n.length||(n=y("<iframe />").appendTo(document.body).attr({name:e,src:"#"})),y(t).on("submit",(function(){var n=y(t).clone().appendTo(document.body);return n.attr("target",e),n.find("#submit").remove(),!1})),g++},b=n(4),w=n.n(b);function k(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}function x(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var P=jQuery;String.prototype.getQueryVar=function(t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var e=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(this);return null===e?"":decodeURIComponent(e[1].replace(/\+/g," "))},String.prototype.addQueryVar=function(t,e){var n=this,o=n.split("#");return n=o[0],t.match(/\[/)?(n+=n.match(/\?/)?"&":"?",n+=t+"="+e):-1!=n.indexOf("&"+t+"=")||-1!=n.indexOf("?"+t+"=")?n=n.replace(new RegExp(t+"=([^&#]*)","g"),t+"="+e):(n+=n.match(/\?/)?"&":"?",n+=t+"="+e),n+(o[1]?"#"+o[1]:"")},String.prototype.removeQueryVar=function(t){var e=this,n=e.split("#");e=n[0],t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var o=new RegExp("[\\?&]"+t+"([[][^=]*)?=([^&#]*)","g");return(e=e.replace(o,""))+(n[1]?"#"+n[1]:"")};var S={Hook:f,setUrl:function(t,e,n){t&&(history.pushState({},n,t),LP.Hook.doAction("learn_press_set_location_url",t))},toggleGroupSection:function(t,e){var n=P(t);n.hasClass("hide-if-js")&&n.hide().removeClass("hide-if-js"),n.removeClass("hide-if-js").slideToggle((function(){P(this).is(":visible")?P(e).addClass("toggle-on").removeClass("toggle-off"):P(e).addClass("toggle-off").removeClass("toggle-on")}))},overflow:function(t,e){var n=P(t),o=n.css("overflow");e?n.css("overflow",e).data("overflow",o):n.css("overflow",n.data("overflow"))},getUrl:function(){return window.location.href},addQueryVar:function(t,e,n){return(void 0===n?window.location.href:n).addQueryVar(t,e)},removeQueryVar:function(t,e){return(void 0===e?window.location.href:e).removeQueryVar(t)},reload:function(t){t||(t=window.location.href),window.location.href=t},parseResponse:function(t,e){var n=t.match(/<\x2D\x2D LP_AJAX_START \x2D\x2D>([\s\S]*)<\x2D\x2D LP_AJAX_END \x2D\x2D>/);return n&&(t=n[1]),"json"===(e||"json")?this.parseJSON(t):t},parseJSON:function(t){if("string"!=typeof t)return t;var e=String.raw({raw:t}).match(/<\x2D\x2D LP_AJAX_START \x2D\x2D>([\s\S]*)<\x2D\x2D LP_AJAX_END \x2D\x2D>/);try{t=e?JSON.parse(e[1].replace(/(?:\r\n|\r|\n)/g,"")):JSON.parse(t)}catch(e){t={}}return t},ajax:function(t){var e=t.type||"post",n=t.dataType||"json",o=t.action?P.extend(t.data,{"lp-ajax":t.action}):t.data,i=t.beforeSend||function(){},r=t.url||window.location.href;P.ajax({data:o,url:r,type:e,dataType:"html",beforeSend:i.apply(null,t),success:function(e){var o=LP.parseResponse(e,n);"function"==typeof t.success&&t.success(o,e)},error:function(){"function"==typeof t.error&&t.error.apply(null,LP.funcArgs2Array())}})},doAjax:function(t){var e=t.type||"post",n=t.dataType||"json",o=(void 0===t.prefix||"learnpress_")+t.action,i=t.action?P.extend(t.data,{action:o}):t.data;P.ajax({data:i,url:t.url||window.location.href,type:e,dataType:"html",success:function(e){var o=LP.parseResponse(e,n);"function"==typeof t.success&&t.success(o,e)},error:function(){"function"==typeof t.error&&t.error.apply(null,LP.funcArgs2Array())}})},funcArgs2Array:function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e},addFilter:function(t,e){var n=P(document),o="LP."+t;return n.on(o,e),LP.log(n.data("events")),this},applyFilters:function(){var t=P(document),e=arguments[0],n=this.funcArgs2Array(arguments);return t.hasEvent(e)?(n[0]="LP."+e,t.triggerHandler.apply(t,n)):n[1]},addAction:function(t,e){return this.addFilter(t,e)},doAction:function(){var t=P(document),e=arguments[0],n=this.funcArgs2Array(arguments);t.hasEvent(e)&&(n[0]="LP."+e,t.trigger.apply(t,n))},toElement:function(t,e){if(0!==P(t).length){e=P.extend({delay:300,duration:"slow",offset:50,container:null,callback:null,invisible:!1},e||{});var n,o=P(e.container);0===o.length&&(o=P("body, html")),n=o.offset().top;var i=P(t).offset().top+o.scrollTop()-n-e.offset;e.invisible&&function(t,e){var n=o.scrollTop(),i=n+o.height(),r=P(t).offset().top-o.offset().top,a=r+P(t).height();return!0===e?n<r&&i>a:r<=i&&a>=n}(t,!0)||o.fadeIn(10).delay(e.delay).animate({scrollTop:i},e.duration,e.callback)}},uniqueId:function(t,e){var n;void 0===t&&(t="");var o=function(t,e){return e<(t=parseInt(t,10).toString(16)).length?t.slice(t.length-e):e>t.length?new Array(e-t.length+1).join("0")+t:t};return this.php_js||(this.php_js={}),this.php_js.uniqidSeed||(this.php_js.uniqidSeed=Math.floor(123456789*Math.random())),this.php_js.uniqidSeed++,n=t,n+=o(parseInt((new Date).getTime()/1e3,10),8),n+=o(this.php_js.uniqidSeed,5),e&&(n+=(10*Math.random()).toFixed(8).toString()),n},log:function(){for(var t=0,e=arguments.length;t<e;t++)console.log(arguments[t])},blockContent:function(){0===P("#learn-press-block-content").length&&P(LP.template("learn-press-template-block-content",{})).appendTo(P("body")),LP.hideMainScrollbar().addClass("block-content"),P(document).trigger("learn_press_block_content")},unblockContent:function(){setTimeout((function(){LP.showMainScrollbar().removeClass("block-content"),P(document).trigger("learn_press_unblock_content")}),350)},hideMainScrollbar:function(t){t||(t="html, body");var e=P(t);return e.each((function(){var t=P(this),e=t.css("overflow");t.css("overflow","hidden").attr("overflow",e)})),e},showMainScrollbar:function(t){t||(t="html, body");var e=P(t);return e.each((function(){var t=P(this),e=t.attr("overflow");t.css("overflow",e).removeAttr("overflow")})),e},template:"undefined"!=typeof _?_.memoize((function(t,e){var n,o={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},i=function(e){return(n=n||_.template(P("#"+t).html(),null,o))(e)};return e?i(e):i}),(function(t,e){return t+"-"+JSON.stringify(e)})):function(){return""},alert:function(t,e){var n="",o="";"string"==typeof t?o=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(o=t.message)),P.alerts.alert(o,n,(function(t){LP._on_alert_hide(),e&&e(t)})),this._on_alert_show()},confirm:function(t,e){var n="",o="";"string"==typeof t?o=t:(void 0!==t.title&&(n=t.title),void 0!==t.message&&(o=t.message)),P.alerts.confirm(o,n,(function(t){LP._on_alert_hide(),e&&e(t)})),this._on_alert_show()},_on_alert_show:function(){var t=P("#popup_container");P('<span id="popup_container_placeholder" />').insertAfter(t).data("xxx",t);t.stop().css("top","-=50").css("opacity","0").animate({top:"+=50",opacity:1},250)},_on_alert_hide:function(){var t=P("#popup_container_placeholder"),e=t.data("xxx");e&&e.replaceWith(t),e.appendTo(P(document.body)),e.stop().animate({top:"+=50",opacity:0},250,(function(){P(this).remove()}))},sendMessage:function(t,e,n,o){P.isPlainObject(t)&&(t=JSON.stringify(t)),n=n||"*",(e=e||window).postMessage(t,n,o)},receiveMessage:function(t,e){var n=t.origin||t.originalEvent.origin,o=t.data||t.originalEvent.data||"";("string"==typeof o||o instanceof String)&&0===o.indexOf("{")&&(o=LP.parseJSON(o)),LP.Hook.doAction("learn_press_receive_message",o,n)},camelCaseDashObjectKeys:function(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=LP,o=function(t){return Array.isArray(t)},i=function(t){return t===Object(t)&&!o(t)&&"function"!=typeof t},r=function(t){return t.replace(/([-_][a-z])/gi,(function(t){return t.toUpperCase().replace("-","").replace("_","")}))};if(i(t)){var a={};return Object.keys(t).forEach((function(o){a[r(o)]=e?n.camelCaseDashObjectKeys(t[o]):t[o]})),a}return o(t)?t.map((function(t){return n.camelCaseDashObjectKeys(t)})):t},IframeSubmit:m};P(document).ready((function(){var t,e;void 0!==P.alerts&&(P.alerts.overlayColor="#000",P.alerts.overlayOpacity=.5,P.alerts.okButton=lpGlobalSettings.localize.button_ok,P.alerts.cancelButton=lpGlobalSettings.localize.button_cancel),P(".learn-press-message.fixed").each((function(){var t=P(this),e=t.data();!function(t,e){e.delayIn&&setTimeout((function(){t.show().hide().fadeIn()}),e.delayIn),e.delayOut&&setTimeout((function(){t.fadeOut()}),e.delayOut+(e.delayIn||0))}(t,e)})),setTimeout((function(){P(".learn-press-nav-tabs li.active:not(.default) a").trigger("click")}),300),P("body.course-item-popup").parent().css("overflow","hidden"),t=null,e=function(){P(".auto-check-lines").checkLines((function(t){t>1?P(this).removeClass("single-lines"):P(this).addClass("single-lines"),P(this).attr("rows",t)}))},P(window).on("resize.check-lines",(function(){t?(t&&clearTimeout(t),t=setTimeout(e,300)):e()})),P(".learn-press-tooltip, .lp-passing-conditional").LP_Tooltip({offset:[24,24]}),P(".learn-press-icon").LP_Tooltip({offset:[30,30]}),P(".learn-press-message[data-autoclose]").each((function(){var t=P(this),e=parseInt(t.data("autoclose"));e&&setTimeout((function(t){t.fadeOut()}),e,t)})),P(document).on("click",(function(){P(document).trigger("learn-press/close-all-quick-tip")}))})),function(){window.LP=window.LP||{},"string"==typeof arguments[0]?(LP[arguments[0]]=LP[arguments[0]]||{},LP[arguments[0]]=jQuery.extend(LP[arguments[0]],arguments[1])):LP=jQuery.extend(LP,arguments[0])}(function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?k(Object(n),!0).forEach((function(e){x(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):k(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({Event_Callback:u,MessageBox:l,Cookies:d,localStorage:v},S));e.default={fn:r,QuickTip:s.a,Cookies:d,localStorage:v,showPass:w.a}}]);
assets/js/vendor/chart.js CHANGED
@@ -1,10 +1,10 @@
1
- /*!
2
- * Chart.js
3
- * http://chartjs.org/
4
- * Version: 1.0.2
5
- *
6
- * Copyright 2015 Nick Downie
7
- * Released under the MIT license
8
- * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
9
- */
10
  (function(){"use strict";var t=this,i=t.Chart,e=function(t){this.canvas=t.canvas,this.ctx=t;var i=function(t,i){return t["offset"+i]?t["offset"+i]:document.defaultView.getComputedStyle(t).getPropertyValue(i)},e=this.width=i(t.canvas,"Width"),n=this.height=i(t.canvas,"Height");t.canvas.width=e,t.canvas.height=n;var e=this.width=t.canvas.width,n=this.height=t.canvas.height;return this.aspectRatio=this.width/this.height,s.retinaScale(this),this};e.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,customTooltips:!1,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",onAnimationProgress:function(){},onAnimationComplete:function(){}}},e.types={};var s=e.helpers={},n=s.each=function(t,i,e){var s=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var n;for(n=0;n<t.length;n++)i.apply(e,[t[n],n].concat(s))}else for(var o in t)i.apply(e,[t[o],o].concat(s))},o=s.clone=function(t){var i={};return n(t,function(e,s){t.hasOwnProperty(s)&&(i[s]=e)}),i},a=s.extend=function(t){return n(Array.prototype.slice.call(arguments,1),function(i){n(i,function(e,s){i.hasOwnProperty(s)&&(t[s]=e)})}),t},h=s.merge=function(){var t=Array.prototype.slice.call(arguments,0);return t.unshift({}),a.apply(null,t)},l=s.indexOf=function(t,i){if(Array.prototype.indexOf)return t.indexOf(i);for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1},r=(s.where=function(t,i){var e=[];return s.each(t,function(t){i(t)&&e.push(t)}),e},s.findNextWhere=function(t,i,e){e||(e=-1);for(var s=e+1;s<t.length;s++){var n=t[s];if(i(n))return n}},s.findPreviousWhere=function(t,i,e){e||(e=t.length);for(var s=e-1;s>=0;s--){var n=t[s];if(i(n))return n}},s.inherits=function(t){var i=this,e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return i.apply(this,arguments)},s=function(){this.constructor=e};return s.prototype=i.prototype,e.prototype=new s,e.extend=r,t&&a(e.prototype,t),e.__super__=i.prototype,e}),c=s.noop=function(){},u=s.uid=function(){var t=0;return function(){return"chart-"+t++}}(),d=s.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},p=s.amd="function"==typeof define&&define.amd,f=s.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g=s.max=function(t){return Math.max.apply(Math,t)},m=s.min=function(t){return Math.min.apply(Math,t)},v=(s.cap=function(t,i,e){if(f(i)){if(t>i)return i}else if(f(e)&&e>t)return e;return t},s.getDecimalPlaces=function(t){return t%1!==0&&f(t)?t.toString().split(".")[1].length:0}),S=s.radians=function(t){return t*(Math.PI/180)},x=(s.getAngleFromPoint=function(t,i){var e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s),o=2*Math.PI+Math.atan2(s,e);return 0>e&&0>s&&(o+=2*Math.PI),{angle:o,distance:n}},s.aliasPixel=function(t){return t%2===0?0:.5}),y=(s.splineCurve=function(t,i,e,s){var n=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2)),o=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),a=s*n/(n+o),h=s*o/(n+o);return{inner:{x:i.x-a*(e.x-t.x),y:i.y-a*(e.y-t.y)},outer:{x:i.x+h*(e.x-t.x),y:i.y+h*(e.y-t.y)}}},s.calculateOrderOfMagnitude=function(t){return Math.floor(Math.log(t)/Math.LN10)}),C=(s.calculateScaleRange=function(t,i,e,s,n){var o=2,a=Math.floor(i/(1.5*e)),h=o>=a,l=g(t),r=m(t);l===r&&(l+=.5,r>=.5&&!s?r-=.5:l+=.5);for(var c=Math.abs(l-r),u=y(c),d=Math.ceil(l/(1*Math.pow(10,u)))*Math.pow(10,u),p=s?0:Math.floor(r/(1*Math.pow(10,u)))*Math.pow(10,u),f=d-p,v=Math.pow(10,u),S=Math.round(f/v);(S>a||a>2*S)&&!h;)if(S>a)v*=2,S=Math.round(f/v),S%1!==0&&(h=!0);else if(n&&u>=0){if(v/2%1!==0)break;v/=2,S=Math.round(f/v)}else v/=2,S=Math.round(f/v);return h&&(S=o,v=f/S),{steps:S,stepValue:v,min:p,max:p+S*v}},s.template=function(t,i){function e(t,i){var e=/\W/.test(t)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):s[t]=s[t];return i?e(i):e}if(t instanceof Function)return t(i);var s={};return e(t,i)}),w=(s.generateLabels=function(t,i,e,s){var o=new Array(i);return labelTemplateString&&n(o,function(i,n){o[n]=C(t,{value:e+s*(n+1)})}),o},s.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-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-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-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/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),-(s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)))},easeOutElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),s*Math.pow(2,-10*t)*Math.sin(2*(1*t-i)*Math.PI/e)+1)},easeInOutElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:2==(t/=.5)?1:(e||(e=.3*1.5),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),1>t?-.5*s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e):s*Math.pow(2,-10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)*.5+1)},easeInBack:function(t){var i=1.70158;return 1*(t/=1)*t*((i+1)*t-i)},easeOutBack:function(t){var i=1.70158;return 1*((t=t/1-1)*t*((i+1)*t+i)+1)},easeInOutBack:function(t){var i=1.70158;return(t/=.5)<1?.5*t*t*(((i*=1.525)+1)*t-i):.5*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)},easeInBounce:function(t){return 1-w.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*w.easeInBounce(2*t):.5*w.easeOutBounce(2*t-1)+.5}}),b=s.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),P=s.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),L=(s.animationLoop=function(t,i,e,s,n,o){var a=0,h=w[e]||w.linear,l=function(){a++;var e=a/i,r=h(e);t.call(o,r,e,a),s.call(o,r,e),i>a?o.animationFrame=b(l):n.apply(o)};b(l)},s.getRelativePosition=function(t){var i,e,s=t.originalEvent||t,n=t.currentTarget||t.srcElement,o=n.getBoundingClientRect();return s.touches?(i=s.touches[0].clientX-o.left,e=s.touches[0].clientY-o.top):(i=s.clientX-o.left,e=s.clientY-o.top),{x:i,y:e}},s.addEvent=function(t,i,e){t.addEventListener?t.addEventListener(i,e):t.attachEvent?t.attachEvent("on"+i,e):t["on"+i]=e}),k=s.removeEvent=function(t,i,e){t.removeEventListener?t.removeEventListener(i,e,!1):t.detachEvent?t.detachEvent("on"+i,e):t["on"+i]=c},F=(s.bindEvents=function(t,i,e){t.events||(t.events={}),n(i,function(i){t.events[i]=function(){e.apply(t,arguments)},L(t.chart.canvas,i,t.events[i])})},s.unbindEvents=function(t,i){n(i,function(i,e){k(t.chart.canvas,e,i)})}),R=s.getMaximumWidth=function(t){var i=t.parentNode;return i.clientWidth},T=s.getMaximumHeight=function(t){var i=t.parentNode;return i.clientHeight},A=(s.getMaximumSize=s.getMaximumWidth,s.retinaScale=function(t){var i=t.ctx,e=t.canvas.width,s=t.canvas.height;window.devicePixelRatio&&(i.canvas.style.width=e+"px",i.canvas.style.height=s+"px",i.canvas.height=s*window.devicePixelRatio,i.canvas.width=e*window.devicePixelRatio,i.scale(window.devicePixelRatio,window.devicePixelRatio))}),M=s.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},W=s.fontString=function(t,i,e){return i+" "+t+"px "+e},z=s.longestText=function(t,i,e){t.font=i;var s=0;return n(e,function(i){var e=t.measureText(i).width;s=e>s?e:s}),s},B=s.drawRoundedRectangle=function(t,i,e,s,n,o){t.beginPath(),t.moveTo(i+o,e),t.lineTo(i+s-o,e),t.quadraticCurveTo(i+s,e,i+s,e+o),t.lineTo(i+s,e+n-o),t.quadraticCurveTo(i+s,e+n,i+s-o,e+n),t.lineTo(i+o,e+n),t.quadraticCurveTo(i,e+n,i,e+n-o),t.lineTo(i,e+o),t.quadraticCurveTo(i,e,i+o,e),t.closePath()};e.instances={},e.Type=function(t,i,s){this.options=i,this.chart=s,this.id=u(),e.instances[this.id]=this,i.responsive&&this.resize(),this.initialize.call(this,t)},a(e.Type.prototype,{initialize:function(){return this},clear:function(){return M(this.chart),this},stop:function(){return P(this.animationFrame),this},resize:function(t){this.stop();var i=this.chart.canvas,e=R(this.chart.canvas),s=this.options.maintainAspectRatio?e/this.chart.aspectRatio:T(this.chart.canvas);return i.width=this.chart.width=e,i.height=this.chart.height=s,A(this.chart),"function"==typeof t&&t.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:c,render:function(t){return t&&this.reflow(),this.options.animation&&!t?s.animationLoop(this.draw,this.options.animationSteps,this.options.animationEasing,this.options.onAnimationProgress,this.options.onAnimationComplete,this):(this.draw(),this.options.onAnimationComplete.call(this)),this},generateLegend:function(){return C(this.options.legendTemplate,this)},destroy:function(){this.clear(),F(this,this.events);var t=this.chart.canvas;t.width=this.chart.width,t.height=this.chart.height,t.style.removeProperty?(t.style.removeProperty("width"),t.style.removeProperty("height")):(t.style.removeAttribute("width"),t.style.removeAttribute("height")),delete e.instances[this.id]},showTooltip:function(t,i){"undefined"==typeof this.activeElements&&(this.activeElements=[]);var o=function(t){var i=!1;return t.length!==this.activeElements.length?i=!0:(n(t,function(t,e){t!==this.activeElements[e]&&(i=!0)},this),i)}.call(this,t);if(o||i){if(this.activeElements=t,this.draw(),this.options.customTooltips&&this.options.customTooltips(!1),t.length>0)if(this.datasets&&this.datasets.length>1){for(var a,h,r=this.datasets.length-1;r>=0&&(a=this.datasets[r].points||this.datasets[r].bars||this.datasets[r].segments,h=l(a,t[0]),-1===h);r--);var c=[],u=[],d=function(){var t,i,e,n,o,a=[],l=[],r=[];return s.each(this.datasets,function(i){t=i.points||i.bars||i.segments,t[h]&&t[h].hasValue()&&a.push(t[h])}),s.each(a,function(t){l.push(t.x),r.push(t.y),c.push(s.template(this.options.multiTooltipTemplate,t)),u.push({fill:t._saved.fillColor||t.fillColor,stroke:t._saved.strokeColor||t.strokeColor})},this),o=m(r),e=g(r),n=m(l),i=g(l),{x:n>this.chart.width/2?n:i,y:(o+e)/2}}.call(this,h);new e.MultiTooltip({x:d.x,y:d.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:c,legendColors:u,legendColorBackground:this.options.multiTooltipKeyBackground,title:t[0].label,chart:this.chart,ctx:this.chart.ctx,custom:this.options.customTooltips}).draw()}else n(t,function(t){var i=t.tooltipPosition();new e.Tooltip({x:Math.round(i.x),y:Math.round(i.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:C(this.options.tooltipTemplate,t),chart:this.chart,custom:this.options.customTooltips}).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}),e.Type.extend=function(t){var i=this,s=function(){return i.apply(this,arguments)};if(s.prototype=o(i.prototype),a(s.prototype,t),s.extend=e.Type.extend,t.name||i.prototype.name){var n=t.name||i.prototype.name,l=e.defaults[i.prototype.name]?o(e.defaults[i.prototype.name]):{};e.defaults[n]=a(l,t.defaults),e.types[n]=s,e.prototype[n]=function(t,i){var o=h(e.defaults.global,e.defaults[n],i||{});return new s(t,o,this)}}else d("Name not provided for this chart, so it hasn't been registered");return i},e.Element=function(t){a(this,t),this.initialize.apply(this,arguments),this.save()},a(e.Element.prototype,{initialize:function(){},restore:function(t){return t?n(t,function(t){this[t]=this._saved[t]},this):a(this,this._saved),this},save:function(){return this._saved=o(this),delete this._saved._saved,this},update:function(t){return n(t,function(t,i){this._saved[i]=this[i],this[i]=t},this),this},transition:function(t,i){return n(t,function(t,e){this[e]=(t-this._saved[e])*i+this._saved[e]},this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return f(this.value)}}),e.Element.extend=r,e.Point=e.Element.extend({display:!0,inRange:function(t,i){var e=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(i-this.y,2)<Math.pow(e,2)},draw:function(){if(this.display){var t=this.ctx;t.beginPath(),t.arc(this.x,this.y,this.radius,0,2*Math.PI),t.closePath(),t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.fillStyle=this.fillColor,t.fill(),t.stroke()}}}),e.Arc=e.Element.extend({inRange:function(t,i){var e=s.getAngleFromPoint(this,{x:t,y:i}),n=e.angle>=this.startAngle&&e.angle<=this.endAngle,o=e.distance>=this.innerRadius&&e.distance<=this.outerRadius;return n&&o},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,i=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*i,y:this.y+Math.sin(t)*i}},draw:function(t){var i=this.ctx;i.beginPath(),i.arc(this.x,this.y,this.outerRadius,this.startAngle,this.endAngle),i.arc(this.x,this.y,this.innerRadius,this.endAngle,this.startAngle,!0),i.closePath(),i.strokeStyle=this.strokeColor,i.lineWidth=this.strokeWidth,i.fillStyle=this.fillColor,i.fill(),i.lineJoin="bevel",this.showStroke&&i.stroke()}}),e.Rectangle=e.Element.extend({draw:function(){var t=this.ctx,i=this.width/2,e=this.x-i,s=this.x+i,n=this.base-(this.base-this.y),o=this.strokeWidth/2;this.showStroke&&(e+=o,s-=o,n+=o),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(e,this.base),t.lineTo(e,n),t.lineTo(s,n),t.lineTo(s,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,i){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&i>=this.y&&i<=this.base}}),e.Tooltip=e.Element.extend({draw:function(){var t=this.chart.ctx;t.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign="center",this.yAlign="above";var i=this.caretPadding=2,e=t.measureText(this.text).width+2*this.xPadding,s=this.fontSize+2*this.yPadding,n=s+this.caretHeight+i;this.x+e/2>this.chart.width?this.xAlign="left":this.x-e/2<0&&(this.xAlign="right"),this.y-n<0&&(this.yAlign="below");var o=this.x-e/2,a=this.y-n;if(t.fillStyle=this.fillColor,this.custom)this.custom(this);else{switch(this.yAlign){case"above":t.beginPath(),t.moveTo(this.x,this.y-i),t.lineTo(this.x+this.caretHeight,this.y-(i+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(i+this.caretHeight)),t.closePath(),t.fill();break;case"below":a=this.y+i+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+i),t.lineTo(this.x+this.caretHeight,this.y+i+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+i+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case"left":o=this.x-e+(this.cornerRadius+this.caretHeight);break;case"right":o=this.x-(this.cornerRadius+this.caretHeight)}B(t,o,a,e,s,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign="center",t.textBaseline="middle",t.fillText(this.text,o+e/2,a+s/2)}}}),e.MultiTooltip=e.Element.extend({initialize:function(){this.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=W(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+1.5*this.titleFontSize,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,i=z(this.ctx,this.font,this.labels)+this.fontSize+3,e=g([i,t]);this.width=e+2*this.xPadding;var s=this.height/2;this.y-s<0?this.y=s:this.y+s>this.chart.height&&(this.y=this.chart.height-s),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var i=this.y-this.height/2+this.yPadding,e=t-1;return 0===t?i+this.titleFontSize/2:i+(1.5*this.fontSize*e+this.fontSize/2)+1.5*this.titleFontSize},draw:function(){if(this.custom)this.custom(this);else{B(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var t=this.ctx;t.fillStyle=this.fillColor,t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.titleTextColor,t.font=this.titleFont,t.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0)),t.font=this.font,s.each(this.labels,function(i,e){t.fillStyle=this.textColor,t.fillText(i,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(e+1)),t.fillStyle=this.legendColorBackground,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize),t.fillStyle=this.legendColors[e].fill,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}}),e.Scale=e.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}));this.yLabelWidth=this.display&&this.showLabels?z(this.ctx,this.font,this.yLabels):0},addXLabel:function(t){this.xLabels.push(t),this.valuesCount++,this.fit()},removeXLabel:function(){this.xLabels.shift(),this.valuesCount--,this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0,this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height,this.startPoint+=this.padding,this.endPoint-=this.padding;var t,i=this.endPoint-this.startPoint;for(this.calculateYRange(i),this.buildYLabels(),this.calculateXLabelRotation();i>this.endPoint-this.startPoint;)i=this.endPoint-this.startPoint,t=this.yLabelWidth,this.calculateYRange(i),this.buildYLabels(),t<this.yLabelWidth&&this.calculateXLabelRotation()},calculateXLabelRotation:function(){this.ctx.font=this.font;var t,i,e=this.ctx.measureText(this.xLabels[0]).width,s=this.ctx.measureText(this.xLabels[this.xLabels.length-1]).width;if(this.xScalePaddingRight=s/2+3,this.xScalePaddingLeft=e/2>this.yLabelWidth+10?e/2:this.yLabelWidth+10,this.xLabelRotation=0,this.display){var n,o=z(this.ctx,this.font,this.xLabels);this.xLabelWidth=o;for(var a=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>a&&0===this.xLabelRotation||this.xLabelWidth>a&&this.xLabelRotation<=90&&this.xLabelRotation>0;)n=Math.cos(S(this.xLabelRotation)),t=n*e,i=n*s,t+this.fontSize/2>this.yLabelWidth+8&&(this.xScalePaddingLeft=t+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth=n*o;this.xLabelRotation>0&&(this.endPoint-=Math.sin(S(this.xLabelRotation))*o+3)}else this.xLabelWidth=0,this.xScalePaddingRight=this.padding,this.xScalePaddingLeft=this.padding},calculateYRange:c,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(t){var i=this.drawingArea()/(this.min-this.max);return this.endPoint-i*(t-this.min)},calculateX:function(t){var i=(this.xLabelRotation>0,this.width-(this.xScalePaddingLeft+this.xScalePaddingRight)),e=i/Math.max(this.valuesCount-(this.offsetGridLines?0:1),1),s=e*t+this.xScalePaddingLeft;return this.offsetGridLines&&(s+=e/2),Math.round(s)},update:function(t){s.extend(this,t),this.fit()},draw:function(){var t=this.ctx,i=(this.endPoint-this.startPoint)/this.steps,e=Math.round(this.xScalePaddingLeft);this.display&&(t.fillStyle=this.textColor,t.font=this.font,n(this.yLabels,function(n,o){var a=this.endPoint-i*o,h=Math.round(a),l=this.showHorizontalLines;t.textAlign="right",t.textBaseline="middle",this.showLabels&&t.fillText(n,e-10,a),0!==o||l||(l=!0),l&&t.beginPath(),o>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),h+=s.aliasPixel(t.lineWidth),l&&(t.moveTo(e,h),t.lineTo(this.width,h),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(e-5,h),t.lineTo(e,h),t.stroke(),t.closePath()},this),n(this.xLabels,function(i,e){var s=this.calculateX(e)+x(this.lineWidth),n=this.calculateX(e-(this.offsetGridLines?.5:0))+x(this.lineWidth),o=this.xLabelRotation>0,a=this.showVerticalLines;0!==e||a||(a=!0),a&&t.beginPath(),e>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),a&&(t.moveTo(n,this.endPoint),t.lineTo(n,this.startPoint-3),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(n,this.endPoint),t.lineTo(n,this.endPoint+5),t.stroke(),t.closePath(),t.save(),t.translate(s,o?this.endPoint+12:this.endPoint+8),t.rotate(-1*S(this.xLabelRotation)),t.font=this.font,t.textAlign=o?"right":"center",t.textBaseline=o?"middle":"top",t.fillText(i,0,0),t.restore()},this))}}),e.RadialScale=e.Element.extend({initialize:function(){this.size=m([this.height,this.width]),this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2},calculateCenterOffset:function(t){var i=this.drawingArea/(this.max-this.min);return(t-this.min)*i},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},setScaleSize:function(){var t,i,e,s,n,o,a,h,l,r,c,u,d=m([this.height/2-this.pointLabelFontSize-5,this.width/2]),p=this.width,g=0;for(this.ctx.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),i=0;i<this.valuesCount;i++)t=this.getPointPosition(i,d),e=this.ctx.measureText(C(this.templateString,{value:this.labels[i]})).width+5,0===i||i===this.valuesCount/2?(s=e/2,t.x+s>p&&(p=t.x+s,n=i),t.x-s<g&&(g=t.x-s,a=i)):i<this.valuesCount/2?t.x+e>p&&(p=t.x+e,n=i):i>this.valuesCount/2&&t.x-e<g&&(g=t.x-e,a=i);l=g,r=Math.ceil(p-this.width),o=this.getIndexAngle(n),h=this.getIndexAngle(a),c=r/Math.sin(o+Math.PI/2),u=l/Math.sin(h+Math.PI/2),c=f(c)?c:0,u=f(u)?u:0,this.drawingArea=d-(u+c)/2,this.setCenterPoint(u,c)},setCenterPoint:function(t,i){var e=this.width-i-this.drawingArea,s=t+this.drawingArea;this.xCenter=(s+e)/2,this.yCenter=this.height/2},getIndexAngle:function(t){var i=2*Math.PI/this.valuesCount;return t*i-Math.PI/2},getPointPosition:function(t,i){var e=this.getIndexAngle(t);return{x:Math.cos(e)*i+this.xCenter,y:Math.sin(e)*i+this.yCenter}},draw:function(){if(this.display){var t=this.ctx;if(n(this.yLabels,function(i,e){if(e>0){var s,n=e*(this.drawingArea/this.steps),o=this.yCenter-n;if(this.lineWidth>0)if(t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,this.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,n,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var a=0;a<this.valuesCount;a++)s=this.getPointPosition(a,this.calculateCenterOffset(this.min+e*this.stepValue)),0===a?t.moveTo(s.x,s.y):t.lineTo(s.x,s.y);t.closePath(),t.stroke()}if(this.showLabels){if(t.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.showLabelBackdrop){var h=t.measureText(i).width;t.fillStyle=this.backdropColor,t.fillRect(this.xCenter-h/2-this.backdropPaddingX,o-this.fontSize/2-this.backdropPaddingY,h+2*this.backdropPaddingX,this.fontSize+2*this.backdropPaddingY)}t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.fontColor,t.fillText(i,this.xCenter,o)}}},this),!this.lineArc){t.lineWidth=this.angleLineWidth,t.strokeStyle=this.angleLineColor;for(var i=this.valuesCount-1;i>=0;i--){if(this.angleLineWidth>0){var e=this.getPointPosition(i,this.calculateCenterOffset(this.max));t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(e.x,e.y),t.stroke(),t.closePath()}var s=this.getPointPosition(i,this.calculateCenterOffset(this.max)+5);t.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),t.fillStyle=this.pointLabelFontColor;var o=this.labels.length,a=this.labels.length/2,h=a/2,l=h>i||i>o-h,r=i===h||i===o-h;t.textAlign=0===i?"center":i===a?"center":a>i?"left":"right",t.textBaseline=r?"middle":l?"bottom":"top",t.fillText(this.labels[i],s.x,s.y)}}}}}),s.addEvent(window,"resize",function(){var t;return function(){clearTimeout(t),t=setTimeout(function(){n(e.instances,function(t){t.options.responsive&&t.resize(t.render,!0)})},50)}}()),p?define(function(){return e}):"object"==typeof module&&module.exports&&(module.exports=e),t.Chart=e,e.noConflict=function(){return t.Chart=i,e}}).call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].fillColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"Bar",defaults:s,initialize:function(t){var s=this.options;this.ScaleClass=i.Scale.extend({offsetGridLines:!0,calculateBarX:function(t,i,e){var n=this.calculateBaseWidth(),o=this.calculateX(e)-n/2,a=this.calculateBarWidth(t);return o+a*i+i*s.barDatasetSpacing+a/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*s.barValueSpacing},calculateBarWidth:function(t){var i=this.calculateBaseWidth()-(t-1)*s.barDatasetSpacing;return i/t}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getBarsAtEvent(t):[];this.eachBars(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),this.BarClass=i.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,bars:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.bars.push(new this.BarClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.strokeColor,fillColor:i.fillColor,highlightFill:i.highlightFill||i.fillColor,highlightStroke:i.highlightStroke||i.strokeColor}))},this)},this),this.buildScale(t.labels),this.BarClass.prototype.base=this.scale.endPoint,this.eachBars(function(t,i,s){e.extend(t,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,s,i),y:this.scale.endPoint}),t.save()},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachBars(function(t){t.save()}),this.render()},eachBars:function(t){e.each(this.datasets,function(i,s){e.each(i.bars,t,this,s)},this)},getBarsAtEvent:function(t){for(var i,s=[],n=e.getRelativePosition(t),o=function(t){s.push(t.bars[i])},a=0;a<this.datasets.length;a++)for(i=0;i<this.datasets[a].bars.length;i++)if(this.datasets[a].bars[i].inRange(n.x,n.y))return e.each(this.datasets,o),s;return s},buildScale:function(t){var i=this,s=function(){var t=[];return i.eachBars(function(i){t.push(i.value)}),t},n={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var i=e.calculateScaleRange(s(),t,this.fontSize,this.beginAtZero,this.integersOnly);e.extend(this,i)},xLabels:t,font:e.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,showHorizontalLines:this.options.scaleShowHorizontalLines,showVerticalLines:this.options.scaleShowVerticalLines,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.barShowStroke?this.options.barStrokeWidth:0,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&e.extend(n,{calculateYRange:e.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new this.ScaleClass(n)},addData:function(t,i){e.each(t,function(t,e){this.datasets[e].bars.push(new this.BarClass({value:t,label:i,x:this.scale.calculateBarX(this.datasets.length,e,this.scale.valuesCount+1),y:this.scale.endPoint,width:this.scale.calculateBarWidth(this.datasets.length),base:this.scale.endPoint,strokeColor:this.datasets[e].strokeColor,fillColor:this.datasets[e].fillColor}))},this),this.scale.addXLabel(i),this.update()},removeData:function(){this.scale.removeXLabel(),e.each(this.datasets,function(t){t.bars.shift()},this),this.update()},reflow:function(){e.extend(this.BarClass.prototype,{y:this.scale.endPoint,base:this.scale.endPoint});var t=e.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var i=t||1;this.clear();this.chart.ctx;this.scale.draw(i),e.each(this.datasets,function(t,s){e.each(t.bars,function(t,e){t.hasValue()&&(t.base=this.scale.endPoint,t.transition({x:this.scale.calculateBarX(this.datasets.length,s,e),y:this.scale.calculateY(t.value),width:this.scale.calculateBarWidth(this.datasets.length)},i).draw())},this)},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,percentageInnerCutout:50,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"Doughnut",defaults:s,initialize:function(t){this.segments=[],this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,this.SegmentArc=i.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2}),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.calculateTotal(t),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({value:t.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:t.color,highlightColor:t.highlight||t.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(t.value),label:t.label})),e||(this.reflow(),this.update())},calculateCircumference:function(t){return 2*Math.PI*(Math.abs(t)/this.total)},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=Math.abs(t.value)},this)},update:function(){this.calculateTotal(this.segments),e.each(this.activeElements,function(t){t.restore(["fillColor"])}),e.each(this.segments,function(t){t.save()}),this.render()},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,e.each(this.segments,function(t){t.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})},this)},draw:function(t){var i=t?t:1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.calculateCircumference(t.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},i),t.endAngle=t.startAngle+t.circumference,t.draw(),0===e&&(t.startAngle=1.5*Math.PI),e<this.segments.length-1&&(this.segments[e+1].startAngle=t.endAngle)},this)}}),i.types.Doughnut.extend({name:"Pie",defaults:e.merge(s,{percentageInnerCutout:0})})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,bezierCurve:!0,bezierCurveTension:.4,pointDot:!0,pointDotRadius:4,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"Line",defaults:s,initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(t){return Math.pow(t-this.x,2)<Math.pow(this.radius+this.hitDetectionRadius,2)}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this),this.buildScale(t.labels),this.eachPoints(function(t,i){e.extend(t,{x:this.scale.calculateX(i),y:this.scale.endPoint}),t.save()},this)},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachPoints(function(t){t.save()}),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.datasets,function(t){e.each(t.points,function(t){t.inRange(s.x,s.y)&&i.push(t)})},this),i},buildScale:function(t){var s=this,n=function(){var t=[];return s.eachPoints(function(i){t.push(i.value)}),t},o={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var i=e.calculateScaleRange(n(),t,this.fontSize,this.beginAtZero,this.integersOnly);e.extend(this,i)},xLabels:t,font:e.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,showHorizontalLines:this.options.scaleShowHorizontalLines,showVerticalLines:this.options.scaleShowVerticalLines,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.pointDotRadius+this.options.pointDotStrokeWidth,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&e.extend(o,{calculateYRange:e.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new i.Scale(o)},addData:function(t,i){e.each(t,function(t,e){this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:this.scale.calculateX(this.scale.valuesCount+1),y:this.scale.endPoint,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.addXLabel(i),this.update()},removeData:function(){this.scale.removeXLabel(),e.each(this.datasets,function(t){t.points.shift()},this),this.update()},reflow:function(){var t=e.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var i=t||1;this.clear();var s=this.chart.ctx,n=function(t){return null!==t.value},o=function(t,i,s){return e.findNextWhere(i,n,s)||t},a=function(t,i,s){return e.findPreviousWhere(i,n,s)||t};this.scale.draw(i),e.each(this.datasets,function(t){var h=e.where(t.points,n);e.each(t.points,function(t,e){t.hasValue()&&t.transition({y:this.scale.calculateY(t.value),x:this.scale.calculateX(e)},i)},this),this.options.bezierCurve&&e.each(h,function(t,i){var s=i>0&&i<h.length-1?this.options.bezierCurveTension:0;t.controlPoints=e.splineCurve(a(t,h,i),t,o(t,h,i),s),t.controlPoints.outer.y>this.scale.endPoint?t.controlPoints.outer.y=this.scale.endPoint:t.controlPoints.outer.y<this.scale.startPoint&&(t.controlPoints.outer.y=this.scale.startPoint),t.controlPoints.inner.y>this.scale.endPoint?t.controlPoints.inner.y=this.scale.endPoint:t.controlPoints.inner.y<this.scale.startPoint&&(t.controlPoints.inner.y=this.scale.startPoint)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(h,function(t,i){if(0===i)s.moveTo(t.x,t.y);else if(this.options.bezierCurve){var e=a(t,h,i);s.bezierCurveTo(e.controlPoints.outer.x,e.controlPoints.outer.y,t.controlPoints.inner.x,t.controlPoints.inner.y,t.x,t.y)}else s.lineTo(t.x,t.y)},this),s.stroke(),this.options.datasetFill&&h.length>0&&(s.lineTo(h[h.length-1].x,this.scale.endPoint),s.lineTo(h[0].x,this.scale.endPoint),s.fillStyle=t.fillColor,s.closePath(),s.fill()),e.each(h,function(t){t.draw()})},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"PolarArea",defaults:s,initialize:function(t){this.segments=[],this.SegmentArc=i.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2}),this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:t.length}),this.updateScaleRange(t),this.scale.update(),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({fillColor:t.color,highlightColor:t.highlight||t.color,label:t.label,value:t.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(t.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI})),e||(this.reflow(),this.update())},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=t.value},this),this.scale.valuesCount=this.segments.length},updateScaleRange:function(t){var i=[];e.each(t,function(t){i.push(t.value)});var s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s,{size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments),e.each(this.segments,function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.updateScaleRange(this.segments),this.scale.update(),e.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2}),e.each(this.segments,function(t){t.update({outerRadius:this.scale.calculateCenterOffset(t.value)})},this)},draw:function(t){var i=t||1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(t.value)},i),t.endAngle=t.startAngle+t.circumference,0===e&&(t.startAngle=1.5*Math.PI),e<this.segments.length-1&&(this.segments[e+1].startAngle=t.endAngle),t.draw()},this),this.scale.draw()}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers;i.Type.extend({name:"Radar",defaults:{scaleShowLine:!0,angleShowLineOut:!0,scaleShowLabels:!1,scaleBeginAtZero:!0,angleLineColor:"rgba(0,0,0,.1)",angleLineWidth:1,pointLabelFontFamily:"'Arial'",pointLabelFontStyle:"normal",pointLabelFontSize:10,pointLabelFontColor:"#666",pointDot:!0,pointDotRadius:3,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'},initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(t),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){var o;this.scale.animation||(o=this.scale.getPointPosition(n,this.scale.calculateCenterOffset(e))),s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,x:this.options.animation?this.scale.xCenter:o.x,y:this.options.animation?this.scale.yCenter:o.y,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this)},this),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=e.getRelativePosition(t),s=e.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},i),n=2*Math.PI/this.scale.valuesCount,o=Math.round((s.angle-1.5*Math.PI)/n),a=[];return(o>=this.scale.valuesCount||0>o)&&(o=0),s.distance<=this.scale.drawingArea&&e.each(this.datasets,function(t){a.push(t.points[o])}),a},buildScale:function(t){this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:t.labels,valuesCount:t.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(t.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var i=function(){var i=[];return e.each(t,function(t){t.data?i=i.concat(t.data):e.each(t.points,function(t){i.push(t.value)})}),i}(),s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s)},addData:function(t,i){this.scale.valuesCount++,e.each(t,function(t,e){var s=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:s.x,y:s.y,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.labels.push(i),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),e.each(this.datasets,function(t){t.points.shift()},this),this.reflow(),this.update()},update:function(){this.eachPoints(function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2}),this.updateScaleRange(this.datasets),this.scale.setScaleSize(),this.scale.buildYLabels()},draw:function(t){var i=t||1,s=this.chart.ctx;this.clear(),this.scale.draw(),e.each(this.datasets,function(t){e.each(t.points,function(t,e){t.hasValue()&&t.transition(this.scale.getPointPosition(e,this.scale.calculateCenterOffset(t.value)),i)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(t.points,function(t,i){0===i?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)},this),s.closePath(),s.stroke(),s.fillStyle=t.fillColor,s.fill(),e.each(t.points,function(t){t.hasValue()&&t.draw()})},this)}})}.call(this);
1
+ /*!
2
+ * Chart.js
3
+ * http://chartjs.org/
4
+ * Version: 1.0.2
5
+ *
6
+ * Copyright 2015 Nick Downie
7
+ * Released under the MIT license
8
+ * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
9
+ */
10
  (function(){"use strict";var t=this,i=t.Chart,e=function(t){this.canvas=t.canvas,this.ctx=t;var i=function(t,i){return t["offset"+i]?t["offset"+i]:document.defaultView.getComputedStyle(t).getPropertyValue(i)},e=this.width=i(t.canvas,"Width"),n=this.height=i(t.canvas,"Height");t.canvas.width=e,t.canvas.height=n;var e=this.width=t.canvas.width,n=this.height=t.canvas.height;return this.aspectRatio=this.width/this.height,s.retinaScale(this),this};e.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,customTooltips:!1,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",onAnimationProgress:function(){},onAnimationComplete:function(){}}},e.types={};var s=e.helpers={},n=s.each=function(t,i,e){var s=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var n;for(n=0;n<t.length;n++)i.apply(e,[t[n],n].concat(s))}else for(var o in t)i.apply(e,[t[o],o].concat(s))},o=s.clone=function(t){var i={};return n(t,function(e,s){t.hasOwnProperty(s)&&(i[s]=e)}),i},a=s.extend=function(t){return n(Array.prototype.slice.call(arguments,1),function(i){n(i,function(e,s){i.hasOwnProperty(s)&&(t[s]=e)})}),t},h=s.merge=function(){var t=Array.prototype.slice.call(arguments,0);return t.unshift({}),a.apply(null,t)},l=s.indexOf=function(t,i){if(Array.prototype.indexOf)return t.indexOf(i);for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1},r=(s.where=function(t,i){var e=[];return s.each(t,function(t){i(t)&&e.push(t)}),e},s.findNextWhere=function(t,i,e){e||(e=-1);for(var s=e+1;s<t.length;s++){var n=t[s];if(i(n))return n}},s.findPreviousWhere=function(t,i,e){e||(e=t.length);for(var s=e-1;s>=0;s--){var n=t[s];if(i(n))return n}},s.inherits=function(t){var i=this,e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return i.apply(this,arguments)},s=function(){this.constructor=e};return s.prototype=i.prototype,e.prototype=new s,e.extend=r,t&&a(e.prototype,t),e.__super__=i.prototype,e}),c=s.noop=function(){},u=s.uid=function(){var t=0;return function(){return"chart-"+t++}}(),d=s.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},p=s.amd="function"==typeof define&&define.amd,f=s.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g=s.max=function(t){return Math.max.apply(Math,t)},m=s.min=function(t){return Math.min.apply(Math,t)},v=(s.cap=function(t,i,e){if(f(i)){if(t>i)return i}else if(f(e)&&e>t)return e;return t},s.getDecimalPlaces=function(t){return t%1!==0&&f(t)?t.toString().split(".")[1].length:0}),S=s.radians=function(t){return t*(Math.PI/180)},x=(s.getAngleFromPoint=function(t,i){var e=i.x-t.x,s=i.y-t.y,n=Math.sqrt(e*e+s*s),o=2*Math.PI+Math.atan2(s,e);return 0>e&&0>s&&(o+=2*Math.PI),{angle:o,distance:n}},s.aliasPixel=function(t){return t%2===0?0:.5}),y=(s.splineCurve=function(t,i,e,s){var n=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2)),o=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),a=s*n/(n+o),h=s*o/(n+o);return{inner:{x:i.x-a*(e.x-t.x),y:i.y-a*(e.y-t.y)},outer:{x:i.x+h*(e.x-t.x),y:i.y+h*(e.y-t.y)}}},s.calculateOrderOfMagnitude=function(t){return Math.floor(Math.log(t)/Math.LN10)}),C=(s.calculateScaleRange=function(t,i,e,s,n){var o=2,a=Math.floor(i/(1.5*e)),h=o>=a,l=g(t),r=m(t);l===r&&(l+=.5,r>=.5&&!s?r-=.5:l+=.5);for(var c=Math.abs(l-r),u=y(c),d=Math.ceil(l/(1*Math.pow(10,u)))*Math.pow(10,u),p=s?0:Math.floor(r/(1*Math.pow(10,u)))*Math.pow(10,u),f=d-p,v=Math.pow(10,u),S=Math.round(f/v);(S>a||a>2*S)&&!h;)if(S>a)v*=2,S=Math.round(f/v),S%1!==0&&(h=!0);else if(n&&u>=0){if(v/2%1!==0)break;v/=2,S=Math.round(f/v)}else v/=2,S=Math.round(f/v);return h&&(S=o,v=f/S),{steps:S,stepValue:v,min:p,max:p+S*v}},s.template=function(t,i){function e(t,i){var e=/\W/.test(t)?new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+t.replace(/[\r\t\n]/g," ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');"):s[t]=s[t];return i?e(i):e}if(t instanceof Function)return t(i);var s={};return e(t,i)}),w=(s.generateLabels=function(t,i,e,s){var o=new Array(i);return labelTemplateString&&n(o,function(i,n){o[n]=C(t,{value:e+s*(n+1)})}),o},s.easingEffects={linear:function(t){return t},easeInQuad:function(t){return t*t},easeOutQuad:function(t){return-1*t*(t-2)},easeInOutQuad:function(t){return(t/=.5)<1?.5*t*t:-0.5*(--t*(t-2)-1)},easeInCubic:function(t){return t*t*t},easeOutCubic:function(t){return 1*((t=t/1-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-1*((t=t/1-1)*t*t*t-1)},easeInOutQuart:function(t){return(t/=.5)<1?.5*t*t*t*t:-0.5*((t-=2)*t*t*t-2)},easeInQuint:function(t){return 1*(t/=1)*t*t*t*t},easeOutQuint:function(t){return 1*((t=t/1-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/1*(Math.PI/2))+1},easeOutSine:function(t){return 1*Math.sin(t/1*(Math.PI/2))},easeInOutSine:function(t){return-0.5*(Math.cos(Math.PI*t/1)-1)},easeInExpo:function(t){return 0===t?1:1*Math.pow(2,10*(t/1-1))},easeOutExpo:function(t){return 1===t?1:1*(-Math.pow(2,-10*t/1)+1)},easeInOutExpo:function(t){return 0===t?0:1===t?1:(t/=.5)<1?.5*Math.pow(2,10*(t-1)):.5*(-Math.pow(2,-10*--t)+2)},easeInCirc:function(t){return t>=1?t:-1*(Math.sqrt(1-(t/=1)*t)-1)},easeOutCirc:function(t){return 1*Math.sqrt(1-(t=t/1-1)*t)},easeInOutCirc:function(t){return(t/=.5)<1?-0.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},easeInElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),-(s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)))},easeOutElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:1==(t/=1)?1:(e||(e=.3),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),s*Math.pow(2,-10*t)*Math.sin(2*(1*t-i)*Math.PI/e)+1)},easeInOutElastic:function(t){var i=1.70158,e=0,s=1;return 0===t?0:2==(t/=.5)?1:(e||(e=.3*1.5),s<Math.abs(1)?(s=1,i=e/4):i=e/(2*Math.PI)*Math.asin(1/s),1>t?-.5*s*Math.pow(2,10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e):s*Math.pow(2,-10*(t-=1))*Math.sin(2*(1*t-i)*Math.PI/e)*.5+1)},easeInBack:function(t){var i=1.70158;return 1*(t/=1)*t*((i+1)*t-i)},easeOutBack:function(t){var i=1.70158;return 1*((t=t/1-1)*t*((i+1)*t+i)+1)},easeInOutBack:function(t){var i=1.70158;return(t/=.5)<1?.5*t*t*(((i*=1.525)+1)*t-i):.5*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)},easeInBounce:function(t){return 1-w.easeOutBounce(1-t)},easeOutBounce:function(t){return(t/=1)<1/2.75?7.5625*t*t:2/2.75>t?1*(7.5625*(t-=1.5/2.75)*t+.75):2.5/2.75>t?1*(7.5625*(t-=2.25/2.75)*t+.9375):1*(7.5625*(t-=2.625/2.75)*t+.984375)},easeInOutBounce:function(t){return.5>t?.5*w.easeInBounce(2*t):.5*w.easeOutBounce(2*t-1)+.5}}),b=s.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)}}(),P=s.cancelAnimFrame=function(){return window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){return window.clearTimeout(t,1e3/60)}}(),L=(s.animationLoop=function(t,i,e,s,n,o){var a=0,h=w[e]||w.linear,l=function(){a++;var e=a/i,r=h(e);t.call(o,r,e,a),s.call(o,r,e),i>a?o.animationFrame=b(l):n.apply(o)};b(l)},s.getRelativePosition=function(t){var i,e,s=t.originalEvent||t,n=t.currentTarget||t.srcElement,o=n.getBoundingClientRect();return s.touches?(i=s.touches[0].clientX-o.left,e=s.touches[0].clientY-o.top):(i=s.clientX-o.left,e=s.clientY-o.top),{x:i,y:e}},s.addEvent=function(t,i,e){t.addEventListener?t.addEventListener(i,e):t.attachEvent?t.attachEvent("on"+i,e):t["on"+i]=e}),k=s.removeEvent=function(t,i,e){t.removeEventListener?t.removeEventListener(i,e,!1):t.detachEvent?t.detachEvent("on"+i,e):t["on"+i]=c},F=(s.bindEvents=function(t,i,e){t.events||(t.events={}),n(i,function(i){t.events[i]=function(){e.apply(t,arguments)},L(t.chart.canvas,i,t.events[i])})},s.unbindEvents=function(t,i){n(i,function(i,e){k(t.chart.canvas,e,i)})}),R=s.getMaximumWidth=function(t){var i=t.parentNode;return i.clientWidth},T=s.getMaximumHeight=function(t){var i=t.parentNode;return i.clientHeight},A=(s.getMaximumSize=s.getMaximumWidth,s.retinaScale=function(t){var i=t.ctx,e=t.canvas.width,s=t.canvas.height;window.devicePixelRatio&&(i.canvas.style.width=e+"px",i.canvas.style.height=s+"px",i.canvas.height=s*window.devicePixelRatio,i.canvas.width=e*window.devicePixelRatio,i.scale(window.devicePixelRatio,window.devicePixelRatio))}),M=s.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},W=s.fontString=function(t,i,e){return i+" "+t+"px "+e},z=s.longestText=function(t,i,e){t.font=i;var s=0;return n(e,function(i){var e=t.measureText(i).width;s=e>s?e:s}),s},B=s.drawRoundedRectangle=function(t,i,e,s,n,o){t.beginPath(),t.moveTo(i+o,e),t.lineTo(i+s-o,e),t.quadraticCurveTo(i+s,e,i+s,e+o),t.lineTo(i+s,e+n-o),t.quadraticCurveTo(i+s,e+n,i+s-o,e+n),t.lineTo(i+o,e+n),t.quadraticCurveTo(i,e+n,i,e+n-o),t.lineTo(i,e+o),t.quadraticCurveTo(i,e,i+o,e),t.closePath()};e.instances={},e.Type=function(t,i,s){this.options=i,this.chart=s,this.id=u(),e.instances[this.id]=this,i.responsive&&this.resize(),this.initialize.call(this,t)},a(e.Type.prototype,{initialize:function(){return this},clear:function(){return M(this.chart),this},stop:function(){return P(this.animationFrame),this},resize:function(t){this.stop();var i=this.chart.canvas,e=R(this.chart.canvas),s=this.options.maintainAspectRatio?e/this.chart.aspectRatio:T(this.chart.canvas);return i.width=this.chart.width=e,i.height=this.chart.height=s,A(this.chart),"function"==typeof t&&t.apply(this,Array.prototype.slice.call(arguments,1)),this},reflow:c,render:function(t){return t&&this.reflow(),this.options.animation&&!t?s.animationLoop(this.draw,this.options.animationSteps,this.options.animationEasing,this.options.onAnimationProgress,this.options.onAnimationComplete,this):(this.draw(),this.options.onAnimationComplete.call(this)),this},generateLegend:function(){return C(this.options.legendTemplate,this)},destroy:function(){this.clear(),F(this,this.events);var t=this.chart.canvas;t.width=this.chart.width,t.height=this.chart.height,t.style.removeProperty?(t.style.removeProperty("width"),t.style.removeProperty("height")):(t.style.removeAttribute("width"),t.style.removeAttribute("height")),delete e.instances[this.id]},showTooltip:function(t,i){"undefined"==typeof this.activeElements&&(this.activeElements=[]);var o=function(t){var i=!1;return t.length!==this.activeElements.length?i=!0:(n(t,function(t,e){t!==this.activeElements[e]&&(i=!0)},this),i)}.call(this,t);if(o||i){if(this.activeElements=t,this.draw(),this.options.customTooltips&&this.options.customTooltips(!1),t.length>0)if(this.datasets&&this.datasets.length>1){for(var a,h,r=this.datasets.length-1;r>=0&&(a=this.datasets[r].points||this.datasets[r].bars||this.datasets[r].segments,h=l(a,t[0]),-1===h);r--);var c=[],u=[],d=function(){var t,i,e,n,o,a=[],l=[],r=[];return s.each(this.datasets,function(i){t=i.points||i.bars||i.segments,t[h]&&t[h].hasValue()&&a.push(t[h])}),s.each(a,function(t){l.push(t.x),r.push(t.y),c.push(s.template(this.options.multiTooltipTemplate,t)),u.push({fill:t._saved.fillColor||t.fillColor,stroke:t._saved.strokeColor||t.strokeColor})},this),o=m(r),e=g(r),n=m(l),i=g(l),{x:n>this.chart.width/2?n:i,y:(o+e)/2}}.call(this,h);new e.MultiTooltip({x:d.x,y:d.y,xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,xOffset:this.options.tooltipXOffset,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,titleTextColor:this.options.tooltipTitleFontColor,titleFontFamily:this.options.tooltipTitleFontFamily,titleFontStyle:this.options.tooltipTitleFontStyle,titleFontSize:this.options.tooltipTitleFontSize,cornerRadius:this.options.tooltipCornerRadius,labels:c,legendColors:u,legendColorBackground:this.options.multiTooltipKeyBackground,title:t[0].label,chart:this.chart,ctx:this.chart.ctx,custom:this.options.customTooltips}).draw()}else n(t,function(t){var i=t.tooltipPosition();new e.Tooltip({x:Math.round(i.x),y:Math.round(i.y),xPadding:this.options.tooltipXPadding,yPadding:this.options.tooltipYPadding,fillColor:this.options.tooltipFillColor,textColor:this.options.tooltipFontColor,fontFamily:this.options.tooltipFontFamily,fontStyle:this.options.tooltipFontStyle,fontSize:this.options.tooltipFontSize,caretHeight:this.options.tooltipCaretSize,cornerRadius:this.options.tooltipCornerRadius,text:C(this.options.tooltipTemplate,t),chart:this.chart,custom:this.options.customTooltips}).draw()},this);return this}},toBase64Image:function(){return this.chart.canvas.toDataURL.apply(this.chart.canvas,arguments)}}),e.Type.extend=function(t){var i=this,s=function(){return i.apply(this,arguments)};if(s.prototype=o(i.prototype),a(s.prototype,t),s.extend=e.Type.extend,t.name||i.prototype.name){var n=t.name||i.prototype.name,l=e.defaults[i.prototype.name]?o(e.defaults[i.prototype.name]):{};e.defaults[n]=a(l,t.defaults),e.types[n]=s,e.prototype[n]=function(t,i){var o=h(e.defaults.global,e.defaults[n],i||{});return new s(t,o,this)}}else d("Name not provided for this chart, so it hasn't been registered");return i},e.Element=function(t){a(this,t),this.initialize.apply(this,arguments),this.save()},a(e.Element.prototype,{initialize:function(){},restore:function(t){return t?n(t,function(t){this[t]=this._saved[t]},this):a(this,this._saved),this},save:function(){return this._saved=o(this),delete this._saved._saved,this},update:function(t){return n(t,function(t,i){this._saved[i]=this[i],this[i]=t},this),this},transition:function(t,i){return n(t,function(t,e){this[e]=(t-this._saved[e])*i+this._saved[e]},this),this},tooltipPosition:function(){return{x:this.x,y:this.y}},hasValue:function(){return f(this.value)}}),e.Element.extend=r,e.Point=e.Element.extend({display:!0,inRange:function(t,i){var e=this.hitDetectionRadius+this.radius;return Math.pow(t-this.x,2)+Math.pow(i-this.y,2)<Math.pow(e,2)},draw:function(){if(this.display){var t=this.ctx;t.beginPath(),t.arc(this.x,this.y,this.radius,0,2*Math.PI),t.closePath(),t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.fillStyle=this.fillColor,t.fill(),t.stroke()}}}),e.Arc=e.Element.extend({inRange:function(t,i){var e=s.getAngleFromPoint(this,{x:t,y:i}),n=e.angle>=this.startAngle&&e.angle<=this.endAngle,o=e.distance>=this.innerRadius&&e.distance<=this.outerRadius;return n&&o},tooltipPosition:function(){var t=this.startAngle+(this.endAngle-this.startAngle)/2,i=(this.outerRadius-this.innerRadius)/2+this.innerRadius;return{x:this.x+Math.cos(t)*i,y:this.y+Math.sin(t)*i}},draw:function(t){var i=this.ctx;i.beginPath(),i.arc(this.x,this.y,this.outerRadius,this.startAngle,this.endAngle),i.arc(this.x,this.y,this.innerRadius,this.endAngle,this.startAngle,!0),i.closePath(),i.strokeStyle=this.strokeColor,i.lineWidth=this.strokeWidth,i.fillStyle=this.fillColor,i.fill(),i.lineJoin="bevel",this.showStroke&&i.stroke()}}),e.Rectangle=e.Element.extend({draw:function(){var t=this.ctx,i=this.width/2,e=this.x-i,s=this.x+i,n=this.base-(this.base-this.y),o=this.strokeWidth/2;this.showStroke&&(e+=o,s-=o,n+=o),t.beginPath(),t.fillStyle=this.fillColor,t.strokeStyle=this.strokeColor,t.lineWidth=this.strokeWidth,t.moveTo(e,this.base),t.lineTo(e,n),t.lineTo(s,n),t.lineTo(s,this.base),t.fill(),this.showStroke&&t.stroke()},height:function(){return this.base-this.y},inRange:function(t,i){return t>=this.x-this.width/2&&t<=this.x+this.width/2&&i>=this.y&&i<=this.base}}),e.Tooltip=e.Element.extend({draw:function(){var t=this.chart.ctx;t.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.xAlign="center",this.yAlign="above";var i=this.caretPadding=2,e=t.measureText(this.text).width+2*this.xPadding,s=this.fontSize+2*this.yPadding,n=s+this.caretHeight+i;this.x+e/2>this.chart.width?this.xAlign="left":this.x-e/2<0&&(this.xAlign="right"),this.y-n<0&&(this.yAlign="below");var o=this.x-e/2,a=this.y-n;if(t.fillStyle=this.fillColor,this.custom)this.custom(this);else{switch(this.yAlign){case"above":t.beginPath(),t.moveTo(this.x,this.y-i),t.lineTo(this.x+this.caretHeight,this.y-(i+this.caretHeight)),t.lineTo(this.x-this.caretHeight,this.y-(i+this.caretHeight)),t.closePath(),t.fill();break;case"below":a=this.y+i+this.caretHeight,t.beginPath(),t.moveTo(this.x,this.y+i),t.lineTo(this.x+this.caretHeight,this.y+i+this.caretHeight),t.lineTo(this.x-this.caretHeight,this.y+i+this.caretHeight),t.closePath(),t.fill()}switch(this.xAlign){case"left":o=this.x-e+(this.cornerRadius+this.caretHeight);break;case"right":o=this.x-(this.cornerRadius+this.caretHeight)}B(t,o,a,e,s,this.cornerRadius),t.fill(),t.fillStyle=this.textColor,t.textAlign="center",t.textBaseline="middle",t.fillText(this.text,o+e/2,a+s/2)}}}),e.MultiTooltip=e.Element.extend({initialize:function(){this.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.titleFont=W(this.titleFontSize,this.titleFontStyle,this.titleFontFamily),this.height=this.labels.length*this.fontSize+(this.labels.length-1)*(this.fontSize/2)+2*this.yPadding+1.5*this.titleFontSize,this.ctx.font=this.titleFont;var t=this.ctx.measureText(this.title).width,i=z(this.ctx,this.font,this.labels)+this.fontSize+3,e=g([i,t]);this.width=e+2*this.xPadding;var s=this.height/2;this.y-s<0?this.y=s:this.y+s>this.chart.height&&(this.y=this.chart.height-s),this.x>this.chart.width/2?this.x-=this.xOffset+this.width:this.x+=this.xOffset},getLineHeight:function(t){var i=this.y-this.height/2+this.yPadding,e=t-1;return 0===t?i+this.titleFontSize/2:i+(1.5*this.fontSize*e+this.fontSize/2)+1.5*this.titleFontSize},draw:function(){if(this.custom)this.custom(this);else{B(this.ctx,this.x,this.y-this.height/2,this.width,this.height,this.cornerRadius);var t=this.ctx;t.fillStyle=this.fillColor,t.fill(),t.closePath(),t.textAlign="left",t.textBaseline="middle",t.fillStyle=this.titleTextColor,t.font=this.titleFont,t.fillText(this.title,this.x+this.xPadding,this.getLineHeight(0)),t.font=this.font,s.each(this.labels,function(i,e){t.fillStyle=this.textColor,t.fillText(i,this.x+this.xPadding+this.fontSize+3,this.getLineHeight(e+1)),t.fillStyle=this.legendColorBackground,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize),t.fillStyle=this.legendColors[e].fill,t.fillRect(this.x+this.xPadding,this.getLineHeight(e+1)-this.fontSize/2,this.fontSize,this.fontSize)},this)}}}),e.Scale=e.Element.extend({initialize:function(){this.fit()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}));this.yLabelWidth=this.display&&this.showLabels?z(this.ctx,this.font,this.yLabels):0},addXLabel:function(t){this.xLabels.push(t),this.valuesCount++,this.fit()},removeXLabel:function(){this.xLabels.shift(),this.valuesCount--,this.fit()},fit:function(){this.startPoint=this.display?this.fontSize:0,this.endPoint=this.display?this.height-1.5*this.fontSize-5:this.height,this.startPoint+=this.padding,this.endPoint-=this.padding;var t,i=this.endPoint-this.startPoint;for(this.calculateYRange(i),this.buildYLabels(),this.calculateXLabelRotation();i>this.endPoint-this.startPoint;)i=this.endPoint-this.startPoint,t=this.yLabelWidth,this.calculateYRange(i),this.buildYLabels(),t<this.yLabelWidth&&this.calculateXLabelRotation()},calculateXLabelRotation:function(){this.ctx.font=this.font;var t,i,e=this.ctx.measureText(this.xLabels[0]).width,s=this.ctx.measureText(this.xLabels[this.xLabels.length-1]).width;if(this.xScalePaddingRight=s/2+3,this.xScalePaddingLeft=e/2>this.yLabelWidth+10?e/2:this.yLabelWidth+10,this.xLabelRotation=0,this.display){var n,o=z(this.ctx,this.font,this.xLabels);this.xLabelWidth=o;for(var a=Math.floor(this.calculateX(1)-this.calculateX(0))-6;this.xLabelWidth>a&&0===this.xLabelRotation||this.xLabelWidth>a&&this.xLabelRotation<=90&&this.xLabelRotation>0;)n=Math.cos(S(this.xLabelRotation)),t=n*e,i=n*s,t+this.fontSize/2>this.yLabelWidth+8&&(this.xScalePaddingLeft=t+this.fontSize/2),this.xScalePaddingRight=this.fontSize/2,this.xLabelRotation++,this.xLabelWidth=n*o;this.xLabelRotation>0&&(this.endPoint-=Math.sin(S(this.xLabelRotation))*o+3)}else this.xLabelWidth=0,this.xScalePaddingRight=this.padding,this.xScalePaddingLeft=this.padding},calculateYRange:c,drawingArea:function(){return this.startPoint-this.endPoint},calculateY:function(t){var i=this.drawingArea()/(this.min-this.max);return this.endPoint-i*(t-this.min)},calculateX:function(t){var i=(this.xLabelRotation>0,this.width-(this.xScalePaddingLeft+this.xScalePaddingRight)),e=i/Math.max(this.valuesCount-(this.offsetGridLines?0:1),1),s=e*t+this.xScalePaddingLeft;return this.offsetGridLines&&(s+=e/2),Math.round(s)},update:function(t){s.extend(this,t),this.fit()},draw:function(){var t=this.ctx,i=(this.endPoint-this.startPoint)/this.steps,e=Math.round(this.xScalePaddingLeft);this.display&&(t.fillStyle=this.textColor,t.font=this.font,n(this.yLabels,function(n,o){var a=this.endPoint-i*o,h=Math.round(a),l=this.showHorizontalLines;t.textAlign="right",t.textBaseline="middle",this.showLabels&&t.fillText(n,e-10,a),0!==o||l||(l=!0),l&&t.beginPath(),o>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),h+=s.aliasPixel(t.lineWidth),l&&(t.moveTo(e,h),t.lineTo(this.width,h),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(e-5,h),t.lineTo(e,h),t.stroke(),t.closePath()},this),n(this.xLabels,function(i,e){var s=this.calculateX(e)+x(this.lineWidth),n=this.calculateX(e-(this.offsetGridLines?.5:0))+x(this.lineWidth),o=this.xLabelRotation>0,a=this.showVerticalLines;0!==e||a||(a=!0),a&&t.beginPath(),e>0?(t.lineWidth=this.gridLineWidth,t.strokeStyle=this.gridLineColor):(t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor),a&&(t.moveTo(n,this.endPoint),t.lineTo(n,this.startPoint-3),t.stroke(),t.closePath()),t.lineWidth=this.lineWidth,t.strokeStyle=this.lineColor,t.beginPath(),t.moveTo(n,this.endPoint),t.lineTo(n,this.endPoint+5),t.stroke(),t.closePath(),t.save(),t.translate(s,o?this.endPoint+12:this.endPoint+8),t.rotate(-1*S(this.xLabelRotation)),t.font=this.font,t.textAlign=o?"right":"center",t.textBaseline=o?"middle":"top",t.fillText(i,0,0),t.restore()},this))}}),e.RadialScale=e.Element.extend({initialize:function(){this.size=m([this.height,this.width]),this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2},calculateCenterOffset:function(t){var i=this.drawingArea/(this.max-this.min);return(t-this.min)*i},update:function(){this.lineArc?this.drawingArea=this.display?this.size/2-(this.fontSize/2+this.backdropPaddingY):this.size/2:this.setScaleSize(),this.buildYLabels()},buildYLabels:function(){this.yLabels=[];for(var t=v(this.stepValue),i=0;i<=this.steps;i++)this.yLabels.push(C(this.templateString,{value:(this.min+i*this.stepValue).toFixed(t)}))},getCircumference:function(){return 2*Math.PI/this.valuesCount},setScaleSize:function(){var t,i,e,s,n,o,a,h,l,r,c,u,d=m([this.height/2-this.pointLabelFontSize-5,this.width/2]),p=this.width,g=0;for(this.ctx.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),i=0;i<this.valuesCount;i++)t=this.getPointPosition(i,d),e=this.ctx.measureText(C(this.templateString,{value:this.labels[i]})).width+5,0===i||i===this.valuesCount/2?(s=e/2,t.x+s>p&&(p=t.x+s,n=i),t.x-s<g&&(g=t.x-s,a=i)):i<this.valuesCount/2?t.x+e>p&&(p=t.x+e,n=i):i>this.valuesCount/2&&t.x-e<g&&(g=t.x-e,a=i);l=g,r=Math.ceil(p-this.width),o=this.getIndexAngle(n),h=this.getIndexAngle(a),c=r/Math.sin(o+Math.PI/2),u=l/Math.sin(h+Math.PI/2),c=f(c)?c:0,u=f(u)?u:0,this.drawingArea=d-(u+c)/2,this.setCenterPoint(u,c)},setCenterPoint:function(t,i){var e=this.width-i-this.drawingArea,s=t+this.drawingArea;this.xCenter=(s+e)/2,this.yCenter=this.height/2},getIndexAngle:function(t){var i=2*Math.PI/this.valuesCount;return t*i-Math.PI/2},getPointPosition:function(t,i){var e=this.getIndexAngle(t);return{x:Math.cos(e)*i+this.xCenter,y:Math.sin(e)*i+this.yCenter}},draw:function(){if(this.display){var t=this.ctx;if(n(this.yLabels,function(i,e){if(e>0){var s,n=e*(this.drawingArea/this.steps),o=this.yCenter-n;if(this.lineWidth>0)if(t.strokeStyle=this.lineColor,t.lineWidth=this.lineWidth,this.lineArc)t.beginPath(),t.arc(this.xCenter,this.yCenter,n,0,2*Math.PI),t.closePath(),t.stroke();else{t.beginPath();for(var a=0;a<this.valuesCount;a++)s=this.getPointPosition(a,this.calculateCenterOffset(this.min+e*this.stepValue)),0===a?t.moveTo(s.x,s.y):t.lineTo(s.x,s.y);t.closePath(),t.stroke()}if(this.showLabels){if(t.font=W(this.fontSize,this.fontStyle,this.fontFamily),this.showLabelBackdrop){var h=t.measureText(i).width;t.fillStyle=this.backdropColor,t.fillRect(this.xCenter-h/2-this.backdropPaddingX,o-this.fontSize/2-this.backdropPaddingY,h+2*this.backdropPaddingX,this.fontSize+2*this.backdropPaddingY)}t.textAlign="center",t.textBaseline="middle",t.fillStyle=this.fontColor,t.fillText(i,this.xCenter,o)}}},this),!this.lineArc){t.lineWidth=this.angleLineWidth,t.strokeStyle=this.angleLineColor;for(var i=this.valuesCount-1;i>=0;i--){if(this.angleLineWidth>0){var e=this.getPointPosition(i,this.calculateCenterOffset(this.max));t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(e.x,e.y),t.stroke(),t.closePath()}var s=this.getPointPosition(i,this.calculateCenterOffset(this.max)+5);t.font=W(this.pointLabelFontSize,this.pointLabelFontStyle,this.pointLabelFontFamily),t.fillStyle=this.pointLabelFontColor;var o=this.labels.length,a=this.labels.length/2,h=a/2,l=h>i||i>o-h,r=i===h||i===o-h;t.textAlign=0===i?"center":i===a?"center":a>i?"left":"right",t.textBaseline=r?"middle":l?"bottom":"top",t.fillText(this.labels[i],s.x,s.y)}}}}}),s.addEvent(window,"resize",function(){var t;return function(){clearTimeout(t),t=setTimeout(function(){n(e.instances,function(t){t.options.responsive&&t.resize(t.render,!0)})},50)}}()),p?define(function(){return e}):"object"==typeof module&&module.exports&&(module.exports=e),t.Chart=e,e.noConflict=function(){return t.Chart=i,e}}).call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleBeginAtZero:!0,scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,barShowStroke:!0,barStrokeWidth:2,barValueSpacing:5,barDatasetSpacing:1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].fillColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"Bar",defaults:s,initialize:function(t){var s=this.options;this.ScaleClass=i.Scale.extend({offsetGridLines:!0,calculateBarX:function(t,i,e){var n=this.calculateBaseWidth(),o=this.calculateX(e)-n/2,a=this.calculateBarWidth(t);return o+a*i+i*s.barDatasetSpacing+a/2},calculateBaseWidth:function(){return this.calculateX(1)-this.calculateX(0)-2*s.barValueSpacing},calculateBarWidth:function(t){var i=this.calculateBaseWidth()-(t-1)*s.barDatasetSpacing;return i/t}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getBarsAtEvent(t):[];this.eachBars(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),this.BarClass=i.Rectangle.extend({strokeWidth:this.options.barStrokeWidth,showStroke:this.options.barShowStroke,ctx:this.chart.ctx}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,bars:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.bars.push(new this.BarClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.strokeColor,fillColor:i.fillColor,highlightFill:i.highlightFill||i.fillColor,highlightStroke:i.highlightStroke||i.strokeColor}))},this)},this),this.buildScale(t.labels),this.BarClass.prototype.base=this.scale.endPoint,this.eachBars(function(t,i,s){e.extend(t,{width:this.scale.calculateBarWidth(this.datasets.length),x:this.scale.calculateBarX(this.datasets.length,s,i),y:this.scale.endPoint}),t.save()},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachBars(function(t){t.save()}),this.render()},eachBars:function(t){e.each(this.datasets,function(i,s){e.each(i.bars,t,this,s)},this)},getBarsAtEvent:function(t){for(var i,s=[],n=e.getRelativePosition(t),o=function(t){s.push(t.bars[i])},a=0;a<this.datasets.length;a++)for(i=0;i<this.datasets[a].bars.length;i++)if(this.datasets[a].bars[i].inRange(n.x,n.y))return e.each(this.datasets,o),s;return s},buildScale:function(t){var i=this,s=function(){var t=[];return i.eachBars(function(i){t.push(i.value)}),t},n={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var i=e.calculateScaleRange(s(),t,this.fontSize,this.beginAtZero,this.integersOnly);e.extend(this,i)},xLabels:t,font:e.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,showHorizontalLines:this.options.scaleShowHorizontalLines,showVerticalLines:this.options.scaleShowVerticalLines,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.barShowStroke?this.options.barStrokeWidth:0,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&e.extend(n,{calculateYRange:e.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new this.ScaleClass(n)},addData:function(t,i){e.each(t,function(t,e){this.datasets[e].bars.push(new this.BarClass({value:t,label:i,x:this.scale.calculateBarX(this.datasets.length,e,this.scale.valuesCount+1),y:this.scale.endPoint,width:this.scale.calculateBarWidth(this.datasets.length),base:this.scale.endPoint,strokeColor:this.datasets[e].strokeColor,fillColor:this.datasets[e].fillColor}))},this),this.scale.addXLabel(i),this.update()},removeData:function(){this.scale.removeXLabel(),e.each(this.datasets,function(t){t.bars.shift()},this),this.update()},reflow:function(){e.extend(this.BarClass.prototype,{y:this.scale.endPoint,base:this.scale.endPoint});var t=e.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var i=t||1;this.clear();this.chart.ctx;this.scale.draw(i),e.each(this.datasets,function(t,s){e.each(t.bars,function(t,e){t.hasValue()&&(t.base=this.scale.endPoint,t.transition({x:this.scale.calculateBarX(this.datasets.length,s,e),y:this.scale.calculateY(t.value),width:this.scale.calculateBarWidth(this.datasets.length)},i).draw())},this)},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,percentageInnerCutout:50,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"Doughnut",defaults:s,initialize:function(t){this.segments=[],this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,this.SegmentArc=i.Arc.extend({ctx:this.chart.ctx,x:this.chart.width/2,y:this.chart.height/2}),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.calculateTotal(t),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({value:t.value,outerRadius:this.options.animateScale?0:this.outerRadius,innerRadius:this.options.animateScale?0:this.outerRadius/100*this.options.percentageInnerCutout,fillColor:t.color,highlightColor:t.highlight||t.color,showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,startAngle:1.5*Math.PI,circumference:this.options.animateRotate?0:this.calculateCircumference(t.value),label:t.label})),e||(this.reflow(),this.update())},calculateCircumference:function(t){return 2*Math.PI*(Math.abs(t)/this.total)},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=Math.abs(t.value)},this)},update:function(){this.calculateTotal(this.segments),e.each(this.activeElements,function(t){t.restore(["fillColor"])}),e.each(this.segments,function(t){t.save()}),this.render()},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.outerRadius=(e.min([this.chart.width,this.chart.height])-this.options.segmentStrokeWidth/2)/2,e.each(this.segments,function(t){t.update({outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout})},this)},draw:function(t){var i=t?t:1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.calculateCircumference(t.value),outerRadius:this.outerRadius,innerRadius:this.outerRadius/100*this.options.percentageInnerCutout},i),t.endAngle=t.startAngle+t.circumference,t.draw(),0===e&&(t.startAngle=1.5*Math.PI),e<this.segments.length-1&&(this.segments[e+1].startAngle=t.endAngle)},this)}}),i.types.Doughnut.extend({name:"Pie",defaults:e.merge(s,{percentageInnerCutout:0})})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowGridLines:!0,scaleGridLineColor:"rgba(0,0,0,.05)",scaleGridLineWidth:1,scaleShowHorizontalLines:!0,scaleShowVerticalLines:!0,bezierCurve:!0,bezierCurveTension:.4,pointDot:!0,pointDotRadius:4,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"Line",defaults:s,initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx,inRange:function(t){return Math.pow(t-this.x,2)<Math.pow(this.radius+this.hitDetectionRadius,2)}}),this.datasets=[],this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this),this.buildScale(t.labels),this.eachPoints(function(t,i){e.extend(t,{x:this.scale.calculateX(i),y:this.scale.endPoint}),t.save()},this)},this),this.render()},update:function(){this.scale.update(),e.each(this.activeElements,function(t){t.restore(["fillColor","strokeColor"])}),this.eachPoints(function(t){t.save()}),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.datasets,function(t){e.each(t.points,function(t){t.inRange(s.x,s.y)&&i.push(t)})},this),i},buildScale:function(t){var s=this,n=function(){var t=[];return s.eachPoints(function(i){t.push(i.value)}),t},o={templateString:this.options.scaleLabel,height:this.chart.height,width:this.chart.width,ctx:this.chart.ctx,textColor:this.options.scaleFontColor,fontSize:this.options.scaleFontSize,fontStyle:this.options.scaleFontStyle,fontFamily:this.options.scaleFontFamily,valuesCount:t.length,beginAtZero:this.options.scaleBeginAtZero,integersOnly:this.options.scaleIntegersOnly,calculateYRange:function(t){var i=e.calculateScaleRange(n(),t,this.fontSize,this.beginAtZero,this.integersOnly);e.extend(this,i)},xLabels:t,font:e.fontString(this.options.scaleFontSize,this.options.scaleFontStyle,this.options.scaleFontFamily),lineWidth:this.options.scaleLineWidth,lineColor:this.options.scaleLineColor,showHorizontalLines:this.options.scaleShowHorizontalLines,showVerticalLines:this.options.scaleShowVerticalLines,gridLineWidth:this.options.scaleShowGridLines?this.options.scaleGridLineWidth:0,gridLineColor:this.options.scaleShowGridLines?this.options.scaleGridLineColor:"rgba(0,0,0,0)",padding:this.options.showScale?0:this.options.pointDotRadius+this.options.pointDotStrokeWidth,showLabels:this.options.scaleShowLabels,display:this.options.showScale};this.options.scaleOverride&&e.extend(o,{calculateYRange:e.noop,steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}),this.scale=new i.Scale(o)},addData:function(t,i){e.each(t,function(t,e){this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:this.scale.calculateX(this.scale.valuesCount+1),y:this.scale.endPoint,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.addXLabel(i),this.update()},removeData:function(){this.scale.removeXLabel(),e.each(this.datasets,function(t){t.points.shift()},this),this.update()},reflow:function(){var t=e.extend({height:this.chart.height,width:this.chart.width});this.scale.update(t)},draw:function(t){var i=t||1;this.clear();var s=this.chart.ctx,n=function(t){return null!==t.value},o=function(t,i,s){return e.findNextWhere(i,n,s)||t},a=function(t,i,s){return e.findPreviousWhere(i,n,s)||t};this.scale.draw(i),e.each(this.datasets,function(t){var h=e.where(t.points,n);e.each(t.points,function(t,e){t.hasValue()&&t.transition({y:this.scale.calculateY(t.value),x:this.scale.calculateX(e)},i)},this),this.options.bezierCurve&&e.each(h,function(t,i){var s=i>0&&i<h.length-1?this.options.bezierCurveTension:0;t.controlPoints=e.splineCurve(a(t,h,i),t,o(t,h,i),s),t.controlPoints.outer.y>this.scale.endPoint?t.controlPoints.outer.y=this.scale.endPoint:t.controlPoints.outer.y<this.scale.startPoint&&(t.controlPoints.outer.y=this.scale.startPoint),t.controlPoints.inner.y>this.scale.endPoint?t.controlPoints.inner.y=this.scale.endPoint:t.controlPoints.inner.y<this.scale.startPoint&&(t.controlPoints.inner.y=this.scale.startPoint)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(h,function(t,i){if(0===i)s.moveTo(t.x,t.y);else if(this.options.bezierCurve){var e=a(t,h,i);s.bezierCurveTo(e.controlPoints.outer.x,e.controlPoints.outer.y,t.controlPoints.inner.x,t.controlPoints.inner.y,t.x,t.y)}else s.lineTo(t.x,t.y)},this),s.stroke(),this.options.datasetFill&&h.length>0&&(s.lineTo(h[h.length-1].x,this.scale.endPoint),s.lineTo(h[0].x,this.scale.endPoint),s.fillStyle=t.fillColor,s.closePath(),s.fill()),e.each(h,function(t){t.draw()})},this)}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers,s={scaleShowLabelBackdrop:!0,scaleBackdropColor:"rgba(255,255,255,0.75)",scaleBeginAtZero:!0,scaleBackdropPaddingY:2,scaleBackdropPaddingX:2,scaleShowLine:!0,segmentShowStroke:!0,segmentStrokeColor:"#fff",segmentStrokeWidth:2,animationSteps:100,animationEasing:"easeOutBounce",animateRotate:!0,animateScale:!1,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'};i.Type.extend({name:"PolarArea",defaults:s,initialize:function(t){this.segments=[],this.SegmentArc=i.Arc.extend({showStroke:this.options.segmentShowStroke,strokeWidth:this.options.segmentStrokeWidth,strokeColor:this.options.segmentStrokeColor,ctx:this.chart.ctx,innerRadius:0,x:this.chart.width/2,y:this.chart.height/2}),this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,lineArc:!0,width:this.chart.width,height:this.chart.height,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,valuesCount:t.length}),this.updateScaleRange(t),this.scale.update(),e.each(t,function(t,i){this.addData(t,i,!0)},this),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getSegmentsAtEvent(t):[];e.each(this.segments,function(t){t.restore(["fillColor"])}),e.each(i,function(t){t.fillColor=t.highlightColor}),this.showTooltip(i)}),this.render()},getSegmentsAtEvent:function(t){var i=[],s=e.getRelativePosition(t);return e.each(this.segments,function(t){t.inRange(s.x,s.y)&&i.push(t)},this),i},addData:function(t,i,e){var s=i||this.segments.length;this.segments.splice(s,0,new this.SegmentArc({fillColor:t.color,highlightColor:t.highlight||t.color,label:t.label,value:t.value,outerRadius:this.options.animateScale?0:this.scale.calculateCenterOffset(t.value),circumference:this.options.animateRotate?0:this.scale.getCircumference(),startAngle:1.5*Math.PI})),e||(this.reflow(),this.update())},removeData:function(t){var i=e.isNumber(t)?t:this.segments.length-1;this.segments.splice(i,1),this.reflow(),this.update()},calculateTotal:function(t){this.total=0,e.each(t,function(t){this.total+=t.value},this),this.scale.valuesCount=this.segments.length},updateScaleRange:function(t){var i=[];e.each(t,function(t){i.push(t.value)});var s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s,{size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2})},update:function(){this.calculateTotal(this.segments),e.each(this.segments,function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.SegmentArc.prototype,{x:this.chart.width/2,y:this.chart.height/2}),this.updateScaleRange(this.segments),this.scale.update(),e.extend(this.scale,{xCenter:this.chart.width/2,yCenter:this.chart.height/2}),e.each(this.segments,function(t){t.update({outerRadius:this.scale.calculateCenterOffset(t.value)})},this)},draw:function(t){var i=t||1;this.clear(),e.each(this.segments,function(t,e){t.transition({circumference:this.scale.getCircumference(),outerRadius:this.scale.calculateCenterOffset(t.value)},i),t.endAngle=t.startAngle+t.circumference,0===e&&(t.startAngle=1.5*Math.PI),e<this.segments.length-1&&(this.segments[e+1].startAngle=t.endAngle),t.draw()},this),this.scale.draw()}})}.call(this),function(){"use strict";var t=this,i=t.Chart,e=i.helpers;i.Type.extend({name:"Radar",defaults:{scaleShowLine:!0,angleShowLineOut:!0,scaleShowLabels:!1,scaleBeginAtZero:!0,angleLineColor:"rgba(0,0,0,.1)",angleLineWidth:1,pointLabelFontFamily:"'Arial'",pointLabelFontStyle:"normal",pointLabelFontSize:10,pointLabelFontColor:"#666",pointDot:!0,pointDotRadius:3,pointDotStrokeWidth:1,pointHitDetectionRadius:20,datasetStroke:!0,datasetStrokeWidth:2,datasetFill:!0,legendTemplate:'<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'},initialize:function(t){this.PointClass=i.Point.extend({strokeWidth:this.options.pointDotStrokeWidth,radius:this.options.pointDotRadius,display:this.options.pointDot,hitDetectionRadius:this.options.pointHitDetectionRadius,ctx:this.chart.ctx}),this.datasets=[],this.buildScale(t),this.options.showTooltips&&e.bindEvents(this,this.options.tooltipEvents,function(t){var i="mouseout"!==t.type?this.getPointsAtEvent(t):[];this.eachPoints(function(t){t.restore(["fillColor","strokeColor"])}),e.each(i,function(t){t.fillColor=t.highlightFill,t.strokeColor=t.highlightStroke}),this.showTooltip(i)}),e.each(t.datasets,function(i){var s={label:i.label||null,fillColor:i.fillColor,strokeColor:i.strokeColor,pointColor:i.pointColor,pointStrokeColor:i.pointStrokeColor,points:[]};this.datasets.push(s),e.each(i.data,function(e,n){var o;this.scale.animation||(o=this.scale.getPointPosition(n,this.scale.calculateCenterOffset(e))),s.points.push(new this.PointClass({value:e,label:t.labels[n],datasetLabel:i.label,x:this.options.animation?this.scale.xCenter:o.x,y:this.options.animation?this.scale.yCenter:o.y,strokeColor:i.pointStrokeColor,fillColor:i.pointColor,highlightFill:i.pointHighlightFill||i.pointColor,highlightStroke:i.pointHighlightStroke||i.pointStrokeColor}))},this)},this),this.render()},eachPoints:function(t){e.each(this.datasets,function(i){e.each(i.points,t,this)},this)},getPointsAtEvent:function(t){var i=e.getRelativePosition(t),s=e.getAngleFromPoint({x:this.scale.xCenter,y:this.scale.yCenter},i),n=2*Math.PI/this.scale.valuesCount,o=Math.round((s.angle-1.5*Math.PI)/n),a=[];return(o>=this.scale.valuesCount||0>o)&&(o=0),s.distance<=this.scale.drawingArea&&e.each(this.datasets,function(t){a.push(t.points[o])}),a},buildScale:function(t){this.scale=new i.RadialScale({display:this.options.showScale,fontStyle:this.options.scaleFontStyle,fontSize:this.options.scaleFontSize,fontFamily:this.options.scaleFontFamily,fontColor:this.options.scaleFontColor,showLabels:this.options.scaleShowLabels,showLabelBackdrop:this.options.scaleShowLabelBackdrop,backdropColor:this.options.scaleBackdropColor,backdropPaddingY:this.options.scaleBackdropPaddingY,backdropPaddingX:this.options.scaleBackdropPaddingX,lineWidth:this.options.scaleShowLine?this.options.scaleLineWidth:0,lineColor:this.options.scaleLineColor,angleLineColor:this.options.angleLineColor,angleLineWidth:this.options.angleShowLineOut?this.options.angleLineWidth:0,pointLabelFontColor:this.options.pointLabelFontColor,pointLabelFontSize:this.options.pointLabelFontSize,pointLabelFontFamily:this.options.pointLabelFontFamily,pointLabelFontStyle:this.options.pointLabelFontStyle,height:this.chart.height,width:this.chart.width,xCenter:this.chart.width/2,yCenter:this.chart.height/2,ctx:this.chart.ctx,templateString:this.options.scaleLabel,labels:t.labels,valuesCount:t.datasets[0].data.length}),this.scale.setScaleSize(),this.updateScaleRange(t.datasets),this.scale.buildYLabels()},updateScaleRange:function(t){var i=function(){var i=[];return e.each(t,function(t){t.data?i=i.concat(t.data):e.each(t.points,function(t){i.push(t.value)})}),i}(),s=this.options.scaleOverride?{steps:this.options.scaleSteps,stepValue:this.options.scaleStepWidth,min:this.options.scaleStartValue,max:this.options.scaleStartValue+this.options.scaleSteps*this.options.scaleStepWidth}:e.calculateScaleRange(i,e.min([this.chart.width,this.chart.height])/2,this.options.scaleFontSize,this.options.scaleBeginAtZero,this.options.scaleIntegersOnly);e.extend(this.scale,s)},addData:function(t,i){this.scale.valuesCount++,e.each(t,function(t,e){var s=this.scale.getPointPosition(this.scale.valuesCount,this.scale.calculateCenterOffset(t));this.datasets[e].points.push(new this.PointClass({value:t,label:i,x:s.x,y:s.y,strokeColor:this.datasets[e].pointStrokeColor,fillColor:this.datasets[e].pointColor}))},this),this.scale.labels.push(i),this.reflow(),this.update()},removeData:function(){this.scale.valuesCount--,this.scale.labels.shift(),e.each(this.datasets,function(t){t.points.shift()},this),this.reflow(),this.update()},update:function(){this.eachPoints(function(t){t.save()}),this.reflow(),this.render()},reflow:function(){e.extend(this.scale,{width:this.chart.width,height:this.chart.height,size:e.min([this.chart.width,this.chart.height]),xCenter:this.chart.width/2,yCenter:this.chart.height/2}),this.updateScaleRange(this.datasets),this.scale.setScaleSize(),this.scale.buildYLabels()},draw:function(t){var i=t||1,s=this.chart.ctx;this.clear(),this.scale.draw(),e.each(this.datasets,function(t){e.each(t.points,function(t,e){t.hasValue()&&t.transition(this.scale.getPointPosition(e,this.scale.calculateCenterOffset(t.value)),i)},this),s.lineWidth=this.options.datasetStrokeWidth,s.strokeStyle=t.strokeColor,s.beginPath(),e.each(t.points,function(t,i){0===i?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)},this),s.closePath(),s.stroke(),s.fillStyle=t.fillColor,s.fill(),e.each(t.points,function(t){t.hasValue()&&t.draw()})},this)}})}.call(this);
assets/js/vendor/plugins.all.js CHANGED
@@ -1,359 +1,359 @@
1
- if (!Object.prototype.watchChange) {
2
- var isFunction = function (fn) {
3
- return fn && {}.toString.call(fn) === '[object Function]';
4
- };
5
- Object.defineProperty(
6
- Object.prototype,
7
- 'watchChange',
8
- {
9
- enumerable: false,
10
- configurable: true,
11
- writable: false,
12
- value: function (prop, handler) {
13
- var obj = this;
14
-
15
- function x(prop, handler) {
16
- var oldval = obj[prop],
17
- newval = oldval,
18
- getter = function () {
19
- return newval;
20
- },
21
- setter = function (val) {
22
- return newval = handler.call(obj, prop, oldval, val);
23
- };
24
-
25
- if (delete obj[prop]) {
26
- Object.defineProperty(
27
- obj,
28
- prop,
29
- {
30
- get: getter,
31
- set: setter,
32
- enumerable: true,
33
- configurable: true
34
- }
35
- );
36
- }
37
- }
38
-
39
- if (isFunction(prop)) {
40
- for (var k in this) {
41
- new x(k, prop);
42
- }
43
- } else {
44
- new x(prop, handler)
45
- }
46
- }
47
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
49
-
50
- if (!Object.prototype.unwatchChange) {
51
- Object.defineProperty(
52
- Object.prototype,
53
- 'unwatchChange',
54
- {
55
- enumerable: false,
56
- configurable: true,
57
- writable: false,
58
- value: function (prop) {
59
- var val = this[prop];
60
- delete this[prop];
61
- this[prop] = val;
62
- }
63
- }
64
- );
65
- }
66
- /*!
67
- * jQuery.scrollTo
68
- * Copyright (c) 2007-2015 Ariel Flesler - aflesler ○ gmail • com | http://flesler.blogspot.com
69
- * Licensed under MIT
70
- * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
71
- * @projectDescription Lightweight, cross-browser and highly customizable animated scrolling with jQuery
72
- * @author Ariel Flesler
73
- * @version 2.1.2
74
- */
75
- ;(function(factory) {
76
- 'use strict';
77
- if (typeof define === 'function' && define.amd) {
78
- // AMD
79
- define(['jquery'], factory);
80
- } else if (typeof module !== 'undefined' && module.exports) {
81
- // CommonJS
82
- module.exports = factory(require('jquery'));
83
- } else {
84
- // Global
85
- factory(jQuery);
86
- }
87
- })(function($) {
88
- 'use strict';
89
-
90
- var $scrollTo = $.scrollTo = function(target, duration, settings) {
91
- return $(window).scrollTo(target, duration, settings);
92
- };
93
-
94
- $scrollTo.defaults = {
95
- axis:'xy',
96
- duration: 0,
97
- limit:true
98
- };
99
-
100
- function isWin(elem) {
101
- return !elem.nodeName ||
102
- $.inArray(elem.nodeName.toLowerCase(), ['iframe','#document','html','body']) !== -1;
103
- }
104
-
105
- $.fn.scrollTo = function(target, duration, settings) {
106
- if (typeof duration === 'object') {
107
- settings = duration;
108
- duration = 0;
109
- }
110
- if (typeof settings === 'function') {
111
- settings = { onAfter:settings };
112
- }
113
- if (target === 'max') {
114
- target = 9e9;
115
- }
116
-
117
- settings = $.extend({}, $scrollTo.defaults, settings);
118
- // Speed is still recognized for backwards compatibility
119
- duration = duration || settings.duration;
120
- // Make sure the settings are given right
121
- var queue = settings.queue && settings.axis.length > 1;
122
- if (queue) {
123
- // Let's keep the overall duration
124
- duration /= 2;
125
- }
126
- settings.offset = both(settings.offset);
127
- settings.over = both(settings.over);
128
-
129
- return this.each(function() {
130
- // Null target yields nothing, just like jQuery does
131
- if (target === null) return;
132
-
133
- var win = isWin(this),
134
- elem = win ? this.contentWindow || window : this,
135
- $elem = $(elem),
136
- targ = target,
137
- attr = {},
138
- toff;
139
-
140
- switch (typeof targ) {
141
- // A number will pass the regex
142
- case 'number':
143
- case 'string':
144
- if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) {
145
- targ = both(targ);
146
- // We are done
147
- break;
148
- }
149
- // Relative/Absolute selector
150
- targ = win ? $(targ) : $(targ, elem);
151
- /* falls through */
152
- case 'object':
153
- if (targ.length === 0) return;
154
- // DOMElement / jQuery
155
- if (targ.is || targ.style) {
156
- // Get the real position of the target
157
- toff = (targ = $(targ)).offset();
158
- }
159
- }
160
-
161
- var offset = $.isFunction(settings.offset) && settings.offset(elem, targ) || settings.offset;
162
-
163
- $.each(settings.axis.split(''), function(i, axis) {
164
- var Pos = axis === 'x' ? 'Left' : 'Top',
165
- pos = Pos.toLowerCase(),
166
- key = 'scroll' + Pos,
167
- prev = $elem[key](),
168
- max = $scrollTo.max(elem, axis);
169
-
170
- if (toff) {// jQuery / DOMElement
171
- attr[key] = toff[pos] + (win ? 0 : prev - $elem.offset()[pos]);
172
-
173
- // If it's a dom element, reduce the margin
174
- if (settings.margin) {
175
- attr[key] -= parseInt(targ.css('margin'+Pos), 10) || 0;
176
- attr[key] -= parseInt(targ.css('border'+Pos+'Width'), 10) || 0;
177
- }
178
-
179
- attr[key] += offset[pos] || 0;
180
-
181
- if (settings.over[pos]) {
182
- // Scroll to a fraction of its width/height
183
- attr[key] += targ[axis === 'x'?'width':'height']() * settings.over[pos];
184
- }
185
- } else {
186
- var val = targ[pos];
187
- // Handle percentage values
188
- attr[key] = val.slice && val.slice(-1) === '%' ?
189
- parseFloat(val) / 100 * max
190
- : val;
191
- }
192
-
193
- // Number or 'number'
194
- if (settings.limit && /^\d+$/.test(attr[key])) {
195
- // Check the limits
196
- attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max);
197
- }
198
-
199
- // Don't waste time animating, if there's no need.
200
- if (!i && settings.axis.length > 1) {
201
- if (prev === attr[key]) {
202
- // No animation needed
203
- attr = {};
204
- } else if (queue) {
205
- // Intermediate animation
206
- animate(settings.onAfterFirst);
207
- // Don't animate this axis again in the next iteration.
208
- attr = {};
209
- }
210
- }
211
- });
212
-
213
- animate(settings.onAfter);
214
-
215
- function animate(callback) {
216
- var opts = $.extend({}, settings, {
217
- // The queue setting conflicts with animate()
218
- // Force it to always be true
219
- queue: true,
220
- duration: duration,
221
- complete: callback && function() {
222
- callback.call(elem, targ, settings);
223
- }
224
- });
225
- $elem.animate(attr, opts);
226
- }
227
- });
228
- };
229
-
230
- // Max scrolling position, works on quirks mode
231
- // It only fails (not too badly) on IE, quirks mode.
232
- $scrollTo.max = function(elem, axis) {
233
- var Dim = axis === 'x' ? 'Width' : 'Height',
234
- scroll = 'scroll'+Dim;
235
-
236
- if (!isWin(elem))
237
- return elem[scroll] - $(elem)[Dim.toLowerCase()]();
238
-
239
- var size = 'client' + Dim,
240
- doc = elem.ownerDocument || elem.document,
241
- html = doc.documentElement,
242
- body = doc.body;
243
-
244
- return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]);
245
- };
246
-
247
- function both(val) {
248
- return $.isFunction(val) || $.isPlainObject(val) ? val : { top:val, left:val };
249
- }
250
-
251
- // Add special hooks so that window scroll properties can be animated
252
- $.Tween.propHooks.scrollLeft =
253
- $.Tween.propHooks.scrollTop = {
254
- get: function(t) {
255
- return $(t.elem)[t.prop]();
256
- },
257
- set: function(t) {
258
- var curr = this.get(t);
259
- // If interrupt is true and user scrolled, stop animating
260
- if (t.options.interrupt && t._last && t._last !== curr) {
261
- return $(t.elem).stop();
262
- }
263
- var next = Math.round(t.now);
264
- // Don't waste CPU
265
- // Browsers don't render floating point scroll
266
- if (curr !== next) {
267
- $(t.elem)[t.prop](next);
268
- t._last = this.get(t);
269
- }
270
- }
271
- };
272
-
273
- // AMD requirement
274
- return $scrollTo;
275
  });
276
- (function (e) {
277
- e.backward_timer = function (t) {
278
- var n = {seconds: 5, step: 1, format: "h%:m%:s%", value_setter: undefined, on_exhausted: function (e) {
279
- }, on_tick : function (e) {
280
- }}, r = this;
281
- r.seconds_left = 0;
282
- r.target = e(t);
283
- r.timeout = undefined;
284
- r.settings = {};
285
- r.methods = {init : function (t) {
286
- r.settings = e.extend({}, n, t);
287
- if (r.settings.value_setter == undefined) {
288
- if (r.target.is("input")) {
289
- r.settings.value_setter = "val"
290
- } else {
291
- r.settings.value_setter = "text"
292
- }
293
- }
294
- r.methods.reset()
295
- }, start : function () {
296
- if (r.timeout == undefined) {
297
- var e = r.seconds_left == r.settings.seconds ? 0 : r.settings.step * 1e3;
298
- setTimeout(r.methods._on_tick, e, e)
299
- }
300
- }, cancel : function () {
301
- if (r.timeout != undefined) {
302
- clearTimeout(r.timeout);
303
- r.timeout = undefined
304
- }
305
- }, reset : function () {
306
- r.seconds_left = r.settings.seconds;
307
- r.methods._render_seconds()
308
- }, _on_tick : function (e) {
309
- if (e != 0) {
310
- r.settings.on_tick(r)
311
- }
312
- r.methods._render_seconds();
313
- if (r.seconds_left > 0) {
314
- if (r.seconds_left < r.settings.step) {
315
- var t = r.seconds_left
316
- } else {
317
- var t = r.settings.step
318
- }
319
- r.seconds_left -= t;
320
- var n = t * 1e3;
321
- r.timeout = setTimeout(r.methods._on_tick, n, n)
322
- } else {
323
- r.timeout = undefined;
324
- r.settings.on_exhausted(r)
325
- }
326
- }, _render_seconds : function () {
327
- var e = r.methods._seconds_to_dhms(r.seconds_left), t = r.settings.format;
328
- if (t.indexOf("d%") !== -1) {
329
- t = t.replace("d%", e.d).replace("h%", r.methods._check_leading_zero(e.h))
330
- } else {
331
- t = t.replace("h%", e.d * 24 + e.h)
332
- }
333
- t = t.replace("m%", r.methods._check_leading_zero(e.m)).replace("s%", r.methods._check_leading_zero(e.s));
334
- r.target[r.settings.value_setter](t)
335
- }, _seconds_to_dhms : function (e) {
336
- var t = Math.floor(e / (24 * 3600)), e = e - t * 24 * 3600, n = Math.floor(e / 3600), e = e - n * 3600, r = Math.floor(e / 60), i = Math.floor(e - r * 60);
337
- return{d: t, h: n, m: r, s: i}
338
- }, _check_leading_zero: function (e) {
339
- return e < 10 ? "0" + e : "" + e
340
- }}
341
- };
342
- e.fn.backward_timer = function (t) {
343
- var n = arguments;
344
- return this.each(function () {
345
- var r = e(this).data("backward_timer");
346
- if (r == undefined) {
347
- r = new e.backward_timer(this);
348
- e(this).data("backward_timer", r)
349
- }
350
- if (r.methods[t]) {
351
- return r.methods[t].apply(this, Array.prototype.slice.call(n, 1))
352
- } else if (typeof t === "object" || !t) {
353
- return r.methods.init.apply(this, n)
354
- } else {
355
- e.error("Method " + t + " does not exist on jQuery.backward_timer")
356
- }
357
- })
358
- }
359
- })(jQuery);
1
+ if (!Object.prototype.watchChange) {
2
+ var isFunction = function (fn) {
3
+ return fn && {}.toString.call(fn) === '[object Function]';
4
+ };
5
+ Object.defineProperty(
6
+ Object.prototype,
7
+ 'watchChange',
8
+ {
9
+ enumerable: false,
10
+ configurable: true,
11
+ writable: false,
12
+ value: function (prop, handler) {
13
+ var obj = this;
14
+
15
+ function x(prop, handler) {
16
+ var oldval = obj[prop],
17
+ newval = oldval,
18
+ getter = function () {
19
+ return newval;
20
+ },
21
+ setter = function (val) {
22
+ return newval = handler.call(obj, prop, oldval, val);
23
+ };
24
+
25
+ if (delete obj[prop]) {
26
+ Object.defineProperty(
27
+ obj,
28
+ prop,
29
+ {
30
+ get: getter,
31
+ set: setter,
32
+ enumerable: true,
33
+ configurable: true
34
+ }
35
+ );
36
+ }
37
+ }
38
+
39
+ if (isFunction(prop)) {
40
+ for (var k in this) {
41
+ new x(k, prop);
42
+ }
43
+ } else {
44
+ new x(prop, handler)
45
+ }
46
+ }
47
+ });
48
+ }
49
+
50
+ if (!Object.prototype.unwatchChange) {
51
+ Object.defineProperty(
52
+ Object.prototype,
53
+ 'unwatchChange',
54
+ {
55
+ enumerable: false,
56
+ configurable: true,
57
+ writable: false,
58
+ value: function (prop) {
59
+ var val = this[prop];
60
+ delete this[prop];
61
+ this[prop] = val;
62
+ }
63
+ }
64
+ );
65
  }
66
+ /*!
67
+ * jQuery.scrollTo
68
+ * Copyright (c) 2007-2015 Ariel Flesler - aflesler ○ gmail • com | http://flesler.blogspot.com
69
+ * Licensed under MIT
70
+ * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
71
+ * @projectDescription Lightweight, cross-browser and highly customizable animated scrolling with jQuery
72
+ * @author Ariel Flesler
73
+ * @version 2.1.2
74
+ */
75
+ ;(function(factory) {
76
+ 'use strict';
77
+ if (typeof define === 'function' && define.amd) {
78
+ // AMD
79
+ define(['jquery'], factory);
80
+ } else if (typeof module !== 'undefined' && module.exports) {
81
+ // CommonJS
82
+ module.exports = factory(require('jquery'));
83
+ } else {
84
+ // Global
85
+ factory(jQuery);
86
+ }
87
+ })(function($) {
88
+ 'use strict';
89
+
90
+ var $scrollTo = $.scrollTo = function(target, duration, settings) {
91
+ return $(window).scrollTo(target, duration, settings);
92
+ };
93
+
94
+ $scrollTo.defaults = {
95
+ axis:'xy',
96
+ duration: 0,
97
+ limit:true
98
+ };
99
+
100
+ function isWin(elem) {
101
+ return !elem.nodeName ||
102
+ $.inArray(elem.nodeName.toLowerCase(), ['iframe','#document','html','body']) !== -1;
103
+ }
104
+
105
+ $.fn.scrollTo = function(target, duration, settings) {
106
+ if (typeof duration === 'object') {
107
+ settings = duration;
108
+ duration = 0;
109
+ }
110
+ if (typeof settings === 'function') {
111
+ settings = { onAfter:settings };
112
+ }
113
+ if (target === 'max') {
114
+ target = 9e9;
115
+ }
116
+
117
+ settings = $.extend({}, $scrollTo.defaults, settings);
118
+ // Speed is still recognized for backwards compatibility
119
+ duration = duration || settings.duration;
120
+ // Make sure the settings are given right
121
+ var queue = settings.queue && settings.axis.length > 1;
122
+ if (queue) {
123
+ // Let's keep the overall duration
124
+ duration /= 2;
125
+ }
126
+ settings.offset = both(settings.offset);
127
+ settings.over = both(settings.over);
128
+
129
+ return this.each(function() {
130
+ // Null target yields nothing, just like jQuery does
131
+ if (target === null) return;
132
+
133
+ var win = isWin(this),
134
+ elem = win ? this.contentWindow || window : this,
135
+ $elem = $(elem),
136
+ targ = target,
137
+ attr = {},
138
+ toff;
139
+
140
+ switch (typeof targ) {
141
+ // A number will pass the regex
142
+ case 'number':
143
+ case 'string':
144
+ if (/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(targ)) {
145
+ targ = both(targ);
146
+ // We are done
147
+ break;
148
+ }
149
+ // Relative/Absolute selector
150
+ targ = win ? $(targ) : $(targ, elem);
151
+ /* falls through */
152
+ case 'object':
153
+ if (targ.length === 0) return;
154
+ // DOMElement / jQuery
155
+ if (targ.is || targ.style) {
156
+ // Get the real position of the target
157
+ toff = (targ = $(targ)).offset();
158
+ }
159
+ }
160
+
161
+ var offset = $.isFunction(settings.offset) && settings.offset(elem, targ) || settings.offset;
162
+
163
+ $.each(settings.axis.split(''), function(i, axis) {
164
+ var Pos = axis === 'x' ? 'Left' : 'Top',
165
+ pos = Pos.toLowerCase(),
166
+ key = 'scroll' + Pos,
167
+ prev = $elem[key](),
168
+ max = $scrollTo.max(elem, axis);
169
+
170
+ if (toff) {// jQuery / DOMElement
171
+ attr[key] = toff[pos] + (win ? 0 : prev - $elem.offset()[pos]);
172
+
173
+ // If it's a dom element, reduce the margin
174
+ if (settings.margin) {
175
+ attr[key] -= parseInt(targ.css('margin'+Pos), 10) || 0;
176
+ attr[key] -= parseInt(targ.css('border'+Pos+'Width'), 10) || 0;
177
+ }
178
+
179
+ attr[key] += offset[pos] || 0;
180
+
181
+ if (settings.over[pos]) {
182
+ // Scroll to a fraction of its width/height
183
+ attr[key] += targ[axis === 'x'?'width':'height']() * settings.over[pos];
184
+ }
185
+ } else {
186
+ var val = targ[pos];
187
+ // Handle percentage values
188
+ attr[key] = val.slice && val.slice(-1) === '%' ?
189
+ parseFloat(val) / 100 * max
190
+ : val;
191
+ }
192
+
193
+ // Number or 'number'
194
+ if (settings.limit && /^\d+$/.test(attr[key])) {
195
+ // Check the limits
196
+ attr[key] = attr[key] <= 0 ? 0 : Math.min(attr[key], max);
197
+ }
198
+
199
+ // Don't waste time animating, if there's no need.
200
+ if (!i && settings.axis.length > 1) {
201
+ if (prev === attr[key]) {
202
+ // No animation needed
203
+ attr = {};
204
+ } else if (queue) {
205
+ // Intermediate animation
206
+ animate(settings.onAfterFirst);
207
+ // Don't animate this axis again in the next iteration.
208
+ attr = {};
209
+ }
210
+ }
211
+ });
212
+
213
+ animate(settings.onAfter);
214
+
215
+ function animate(callback) {
216
+ var opts = $.extend({}, settings, {
217
+ // The queue setting conflicts with animate()
218
+ // Force it to always be true
219
+ queue: true,
220
+ duration: duration,
221
+ complete: callback && function() {
222
+ callback.call(elem, targ, settings);
223
+ }
224
+ });
225
+ $elem.animate(attr, opts);
226
+ }
227
+ });
228
+ };
229
+
230
+ // Max scrolling position, works on quirks mode
231
+ // It only fails (not too badly) on IE, quirks mode.
232
+ $scrollTo.max = function(elem, axis) {
233
+ var Dim = axis === 'x' ? 'Width' : 'Height',
234
+ scroll = 'scroll'+Dim;
235
+
236
+ if (!isWin(elem))
237
+ return elem[scroll] - $(elem)[Dim.toLowerCase()]();
238
+
239
+ var size = 'client' + Dim,
240
+ doc = elem.ownerDocument || elem.document,
241
+ html = doc.documentElement,
242
+ body = doc.body;
243
+
244
+ return Math.max(html[scroll], body[scroll]) - Math.min(html[size], body[size]);
245
+ };
246
+
247
+ function both(val) {
248
+ return $.isFunction(val) || $.isPlainObject(val) ? val : { top:val, left:val };
249
+ }
250
+
251
+ // Add special hooks so that window scroll properties can be animated
252
+ $.Tween.propHooks.scrollLeft =
253
+ $.Tween.propHooks.scrollTop = {
254
+ get: function(t) {
255
+ return $(t.elem)[t.prop]();
256
+ },
257
+ set: function(t) {
258
+ var curr = this.get(t);
259
+ // If interrupt is true and user scrolled, stop animating
260
+ if (t.options.interrupt && t._last && t._last !== curr) {
261
+ return $(t.elem).stop();
262
+ }
263
+ var next = Math.round(t.now);
264
+ // Don't waste CPU
265
+ // Browsers don't render floating point scroll
266
+ if (curr !== next) {
267
+ $(t.elem)[t.prop](next);
268
+ t._last = this.get(t);
269
+ }
270
+ }
271
+ };
272
+
273
+ // AMD requirement
274
+ return $scrollTo;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
275
  });
276
+ (function (e) {
277
+ e.backward_timer = function (t) {
278
+ var n = {seconds: 5, step: 1, format: "h%:m%:s%", value_setter: undefined, on_exhausted: function (e) {
279
+ }, on_tick : function (e) {
280
+ }}, r = this;
281
+ r.seconds_left = 0;
282
+ r.target = e(t);
283
+ r.timeout = undefined;
284
+ r.settings = {};
285
+ r.methods = {init : function (t) {
286
+ r.settings = e.extend({}, n, t);
287
+ if (r.settings.value_setter == undefined) {
288
+ if (r.target.is("input")) {
289
+ r.settings.value_setter = "val"
290
+ } else {
291
+ r.settings.value_setter = "text"
292
+ }
293
+ }
294
+ r.methods.reset()
295
+ }, start : function () {
296
+ if (r.timeout == undefined) {
297
+ var e = r.seconds_left == r.settings.seconds ? 0 : r.settings.step * 1e3;
298
+ setTimeout(r.methods._on_tick, e, e)
299
+ }
300
+ }, cancel : function () {
301
+ if (r.timeout != undefined) {
302
+ clearTimeout(r.timeout);
303
+ r.timeout = undefined
304
+ }
305
+ }, reset : function () {
306
+ r.seconds_left = r.settings.seconds;
307
+ r.methods._render_seconds()
308
+ }, _on_tick : function (e) {
309
+ if (e != 0) {
310
+ r.settings.on_tick(r)
311
+ }
312
+ r.methods._render_seconds();
313
+ if (r.seconds_left > 0) {
314
+ if (r.seconds_left < r.settings.step) {
315
+ var t = r.seconds_left
316
+ } else {
317
+ var t = r.settings.step
318
+ }
319
+ r.seconds_left -= t;
320
+ var n = t * 1e3;
321
+ r.timeout = setTimeout(r.methods._on_tick, n, n)
322
+ } else {
323
+ r.timeout = undefined;
324
+ r.settings.on_exhausted(r)
325
+ }
326
+ }, _render_seconds : function () {
327
+ var e = r.methods._seconds_to_dhms(r.seconds_left), t = r.settings.format;
328
+ if (t.indexOf("d%") !== -1) {
329
+ t = t.replace("d%", e.d).replace("h%", r.methods._check_leading_zero(e.h))
330
+ } else {
331
+ t = t.replace("h%", e.d * 24 + e.h)
332
+ }
333
+ t = t.replace("m%", r.methods._check_leading_zero(e.m)).replace("s%", r.methods._check_leading_zero(e.s));
334
+ r.target[r.settings.value_setter](t)
335
+ }, _seconds_to_dhms : function (e) {
336
+ var t = Math.floor(e / (24 * 3600)), e = e - t * 24 * 3600, n = Math.floor(e / 3600), e = e - n * 3600, r = Math.floor(e / 60), i = Math.floor(e - r * 60);
337
+ return{d: t, h: n, m: r, s: i}
338
+ }, _check_leading_zero: function (e) {
339
+ return e < 10 ? "0" + e : "" + e
340
+ }}
341
+ };
342
+ e.fn.backward_timer = function (t) {
343
+ var n = arguments;
344
+ return this.each(function () {
345
+ var r = e(this).data("backward_timer");
346
+ if (r == undefined) {
347
+ r = new e.backward_timer(this);
348
+ e(this).data("backward_timer", r)
349
+ }
350
+ if (r.methods[t]) {
351
+ return r.methods[t].apply(this, Array.prototype.slice.call(n, 1))
352
+ } else if (typeof t === "object" || !t) {
353
+ return r.methods.init.apply(this, n)
354
+ } else {
355
+ e.error("Method " + t + " does not exist on jQuery.backward_timer")
356
+ }
357
+ })
358
+ }
359
+ })(jQuery);
assets/js/vendor/vue/vue_libs.js CHANGED
@@ -1,14524 +1,14524 @@
1
- /*!
2
- * Vue.js v2.6.10
3
- * (c) 2014-2019 Evan You
4
- * Released under the MIT License.
5
- */
6
-
7
- (function (global, factory) {
8
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
9
- typeof define === 'function' && define.amd ? define(factory) :
10
- (global = global || self, global.Vue = factory());
11
- }(this, function () { 'use strict';
12
-
13
- /* */
14
-
15
- var emptyObject = Object.freeze({});
16
-
17
- // These helpers produce better VM code in JS engines due to their
18
- // explicitness and function inlining.
19
- function isUndef (v) {
20
- return v === undefined || v === null
21
- }
22
-
23
- function isDef (v) {
24
- return v !== undefined && v !== null
25
- }
26
-
27
- function isTrue (v) {
28
- return v === true
29
- }
30
-
31
- function isFalse (v) {
32
- return v === false
33
- }
34
-
35
- /**
36
- * Check if value is primitive.
37
- */
38
- function isPrimitive (value) {
39
- return (
40
- typeof value === 'string' ||
41
- typeof value === 'number' ||
42
- // $flow-disable-line
43
- typeof value === 'symbol' ||
44
- typeof value === 'boolean'
45
- )
46
- }
47
-
48
- /**
49
- * Quick object check - this is primarily used to tell
50
- * Objects from primitive values when we know the value
51
- * is a JSON-compliant type.
52
- */
53
- function isObject (obj) {
54
- return obj !== null && typeof obj === 'object'
55
- }
56
-
57
- /**
58
- * Get the raw type string of a value, e.g., [object Object].
59
- */
60
- var _toString = Object.prototype.toString;
61
-
62
- function toRawType (value) {
63
- return _toString.call(value).slice(8, -1)
64
- }
65
-
66
- /**
67
- * Strict object type check. Only returns true
68
- * for plain JavaScript objects.
69
- */
70
- function isPlainObject (obj) {
71
- return _toString.call(obj) === '[object Object]'
72
- }
73
-
74
- function isRegExp (v) {
75
- return _toString.call(v) === '[object RegExp]'
76
- }
77
-
78
- /**
79
- * Check if val is a valid array index.
80
- */
81
- function isValidArrayIndex (val) {
82
- var n = parseFloat(String(val));
83
- return n >= 0 && Math.floor(n) === n && isFinite(val)
84
- }
85
-
86
- function isPromise (val) {
87
- return (
88
- isDef(val) &&
89
- typeof val.then === 'function' &&
90
- typeof val.catch === 'function'
91
- )
92
- }
93
-
94
- /**
95
- * Convert a value to a string that is actually rendered.
96
- */
97
- function toString (val) {
98
- return val == null
99
- ? ''
100
- : Array.isArray(val) || (isPlainObject(val) && val.toString === _toString)
101
- ? JSON.stringify(val, null, 2)
102
- : String(val)
103
- }
104
-
105
- /**
106
- * Convert an input value to a number for persistence.
107
- * If the conversion fails, return original string.
108
- */
109
- function toNumber (val) {
110
- var n = parseFloat(val);
111
- return isNaN(n) ? val : n
112
- }
113
-
114
- /**
115
- * Make a map and return a function for checking if a key
116
- * is in that map.
117
- */
118
- function makeMap (
119
- str,
120
- expectsLowerCase
121
- ) {
122
- var map = Object.create(null);
123
- var list = str.split(',');
124
- for (var i = 0; i < list.length; i++) {
125
- map[list[i]] = true;
126
- }
127
- return expectsLowerCase
128
- ? function (val) { return map[val.toLowerCase()]; }
129
- : function (val) { return map[val]; }
130
- }
131
-
132
- /**
133
- * Check if a tag is a built-in tag.
134
- */
135
- var isBuiltInTag = makeMap('slot,component', true);
136
-
137
- /**
138
- * Check if an attribute is a reserved attribute.
139
- */
140
- var isReservedAttribute = makeMap('key,ref,slot,slot-scope,is');
141
-
142
- /**
143
- * Remove an item from an array.
144
- */
145
- function remove (arr, item) {
146
- if (arr.length) {
147
- var index = arr.indexOf(item);
148
- if (index > -1) {
149
- return arr.splice(index, 1)
150
- }
151
- }
152
- }
153
-
154
- /**
155
- * Check whether an object has the property.
156
- */
157
- var hasOwnProperty = Object.prototype.hasOwnProperty;
158
- function hasOwn (obj, key) {
159
- return hasOwnProperty.call(obj, key)
160
- }
161
-
162
- /**
163
- * Create a cached version of a pure function.
164
- */
165
- function cached (fn) {
166
- var cache = Object.create(null);
167
- return (function cachedFn (str) {
168
- var hit = cache[str];
169
- return hit || (cache[str] = fn(str))
170
- })
171
- }
172
-
173
- /**
174
- * Camelize a hyphen-delimited string.
175
- */
176
- var camelizeRE = /-(\w)/g;
177
- var camelize = cached(function (str) {
178
- return str.replace(camelizeRE, function (_, c) { return c ? c.toUpperCase() : ''; })
179
- });
180
-
181
- /**
182
- * Capitalize a string.
183
- */
184
- var capitalize = cached(function (str) {
185
- return str.charAt(0).toUpperCase() + str.slice(1)
186
- });
187
-
188
- /**
189
- * Hyphenate a camelCase string.
190
- */
191
- var hyphenateRE = /\B([A-Z])/g;
192
- var hyphenate = cached(function (str) {
193
- return str.replace(hyphenateRE, '-$1').toLowerCase()
194
- });
195
-
196
- /**
197
- * Simple bind polyfill for environments that do not support it,
198
- * e.g., PhantomJS 1.x. Technically, we don't need this anymore
199
- * since native bind is now performant enough in most browsers.
200
- * But removing it would mean breaking code that was able to run in
201
- * PhantomJS 1.x, so this must be kept for backward compatibility.
202
- */
203
-
204
- /* istanbul ignore next */
205
- function polyfillBind (fn, ctx) {
206
- function boundFn (a) {
207
- var l = arguments.length;
208
- return l
209
- ? l > 1
210
- ? fn.apply(ctx, arguments)
211
- : fn.call(ctx, a)
212
- : fn.call(ctx)
213
- }
214
-
215
- boundFn._length = fn.length;
216
- return boundFn
217
- }
218
-
219
- function nativeBind (fn, ctx) {
220
- return fn.bind(ctx)
221
- }
222
-
223
- var bind = Function.prototype.bind
224
- ? nativeBind
225
- : polyfillBind;
226
-
227
- /**
228
- * Convert an Array-like object to a real Array.
229
- */
230
- function toArray (list, start) {
231
- start = start || 0;
232
- var i = list.length - start;
233
- var ret = new Array(i);
234
- while (i--) {
235
- ret[i] = list[i + start];
236
- }
237
- return ret
238
- }
239
-
240
- /**
241
- * Mix properties into target object.
242
- */
243
- function extend (to, _from) {
244
- for (var key in _from) {
245
- to[key] = _from[key];
246
- }
247
- return to
248
- }
249
-
250
- /**
251
- * Merge an Array of Objects into a single Object.
252
- */
253
- function toObject (arr) {
254
- var res = {};
255
- for (var i = 0; i < arr.length; i++) {
256
- if (arr[i]) {
257
- extend(res, arr[i]);
258
- }
259
- }
260
- return res
261
- }
262
-
263
- /* eslint-disable no-unused-vars */
264
-
265
- /**
266
- * Perform no operation.
267
- * Stubbing args to make Flow happy without leaving useless transpiled code
268
- * with ...rest (https://flow.org/blog/2017/05/07/Strict-Function-Call-Arity/).
269
- */
270
- function noop (a, b, c) {}
271
-
272
- /**
273
- * Always return false.
274
- */
275
- var no = function (a, b, c) { return false; };
276
-
277
- /* eslint-enable no-unused-vars */
278
-
279
- /**
280
- * Return the same value.
281
- */
282
- var identity = function (_) { return _; };
283
-
284
- /**
285
- * Generate a string containing static keys from compiler modules.
286
- */
287
- function genStaticKeys (modules) {
288
- return modules.reduce(function (keys, m) {
289
- return keys.concat(m.staticKeys || [])
290
- }, []).join(',')
291
- }
292
-
293
- /**
294
- * Check if two values are loosely equal - that is,
295
- * if they are plain objects, do they have the same shape?
296
- */
297
- function looseEqual (a, b) {
298
- if (a === b) { return true }
299
- var isObjectA = isObject(a);
300
- var isObjectB = isObject(b);
301
- if (isObjectA && isObjectB) {
302
- try {
303
- var isArrayA = Array.isArray(a);
304
- var isArrayB = Array.isArray(b);
305
- if (isArrayA && isArrayB) {
306
- return a.length === b.length && a.every(function (e, i) {
307
- return looseEqual(e, b[i])
308
- })
309
- } else if (a instanceof Date && b instanceof Date) {
310
- return a.getTime() === b.getTime()
311
- } else if (!isArrayA && !isArrayB) {
312
- var keysA = Object.keys(a);
313
- var keysB = Object.keys(b);
314
- return keysA.length === keysB.length && keysA.every(function (key) {
315
- return looseEqual(a[key], b[key])
316
- })
317
- } else {
318
- /* istanbul ignore next */
319
- return false
320
- }
321
- } catch (e) {
322
- /* istanbul ignore next */
323
- return false
324
- }
325
- } else if (!isObjectA && !isObjectB) {
326
- return String(a) === String(b)
327
- } else {
328
- return false
329
- }
330
- }
331
-
332
- /**
333
- * Return the first index at which a loosely equal value can be
334
- * found in the array (if value is a plain object, the array must
335
- * contain an object of the same shape), or -1 if it is not present.
336
- */
337
- function looseIndexOf (arr, val) {
338
- for (var i = 0; i < arr.length; i++) {
339
- if (looseEqual(arr[i], val)) { return i }
340
- }
341
- return -1
342
- }
343
-
344
- /**
345
- * Ensure a function is called only once.
346
- */
347
- function once (fn) {
348
- var called = false;
349
- return function () {
350
- if (!called) {
351
- called = true;
352
- fn.apply(this, arguments);
353
- }
354
- }
355
- }
356
-
357
- var SSR_ATTR = 'data-server-rendered';
358
-
359
- var ASSET_TYPES = [
360
- 'component',
361
- 'directive',
362
- 'filter'
363
- ];
364
-
365
- var LIFECYCLE_HOOKS = [
366
- 'beforeCreate',
367
- 'created',
368
- 'beforeMount',
369
- 'mounted',
370
- 'beforeUpdate',
371
- 'updated',
372
- 'beforeDestroy',
373
- 'destroyed',
374
- 'activated',
375
- 'deactivated',
376
- 'errorCaptured',
377
- 'serverPrefetch'
378
- ];
379
-
380
- /* */
381
-
382
-
383
-
384
- var config = ({
385
- /**
386
- * Option merge strategies (used in core/util/options)
387
- */
388
- // $flow-disable-line
389
- optionMergeStrategies: Object.create(null),
390
-
391
- /**
392
- * Whether to suppress warnings.
393
- */
394
- silent: false,
395
-
396
- /**
397
- * Show production mode tip message on boot?
398
- */
399
- productionTip: "development" !== 'production',
400
-
401
- /**
402
- * Whether to enable devtools
403
- */
404
- devtools: "development" !== 'production',
405
-
406
- /**
407
- * Whether to record perf
408
- */
409
- performance: false,
410
-
411
- /**
412
- * Error handler for watcher errors
413
- */
414
- errorHandler: null,
415
-
416
- /**
417
- * Warn handler for watcher warns
418
- */
419
- warnHandler: null,
420
-
421
- /**
422
- * Ignore certain custom elements
423
- */
424
- ignoredElements: [],
425
-
426
- /**
427
- * Custom user key aliases for v-on
428
- */
429
- // $flow-disable-line
430
- keyCodes: Object.create(null),
431
-
432
- /**
433
- * Check if a tag is reserved so that it cannot be registered as a
434
- * component. This is platform-dependent and may be overwritten.
435
- */
436
- isReservedTag: no,
437
-
438
- /**
439
- * Check if an attribute is reserved so that it cannot be used as a component
440
- * prop. This is platform-dependent and may be overwritten.
441
- */
442
- isReservedAttr: no,
443
-
444
- /**
445
- * Check if a tag is an unknown element.
446
- * Platform-dependent.
447
- */
448
- isUnknownElement: no,
449
-
450
- /**
451
- * Get the namespace of an element
452
- */
453
- getTagNamespace: noop,
454
-
455
- /**
456
- * Parse the real tag name for the specific platform.
457
- */
458
- parsePlatformTagName: identity,
459
-
460
- /**
461
- * Check if an attribute must be bound using property, e.g. value
462
- * Platform-dependent.
463
- */
464
- mustUseProp: no,
465
-
466
- /**
467
- * Perform updates asynchronously. Intended to be used by Vue Test Utils
468
- * This will significantly reduce performance if set to false.
469
- */
470
- async: true,
471
-
472
- /**
473
- * Exposed for legacy reasons
474
- */
475
- _lifecycleHooks: LIFECYCLE_HOOKS
476
- });
477
-
478
- /* */
479
-
480
- /**
481
- * unicode letters used for parsing html tags, component names and property paths.
482
- * using https://www.w3.org/TR/html53/semantics-scripting.html#potentialcustomelementname
483
- * skipping \u10000-\uEFFFF due to it freezing up PhantomJS
484
- */
485
- var unicodeRegExp = /a-zA-Z\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD/;
486
-
487
- /**
488
- * Check if a string starts with $ or _
489
- */
490
- function isReserved (str) {
491
- var c = (str + '').charCodeAt(0);
492
- return c === 0x24 || c === 0x5F
493
- }
494
-
495
- /**
496
- * Define a property.
497
- */
498
- function def (obj, key, val, enumerable) {
499
- Object.defineProperty(obj, key, {
500
- value: val,
501
- enumerable: !!enumerable,
502
- writable: true,
503
- configurable: true
504
- });
505
- }
506
-
507
- /**
508
- * Parse simple path.
509
- */
510
- var bailRE = new RegExp(("[^" + (unicodeRegExp.source) + ".$_\\d]"));
511
- function parsePath (path) {
512
- if (bailRE.test(path)) {
513
- return
514
- }
515
- var segments = path.split('.');
516
- return function (obj) {
517
- for (var i = 0; i < segments.length; i++) {
518
- if (!obj) { return }
519
- obj = obj[segments[i]];
520
- }
521
- return obj
522
- }
523
- }
524
-
525
- /* */
526
-
527
- // can we use __proto__?
528
- var hasProto = '__proto__' in {};
529
-
530
- // Browser environment sniffing
531
- var inBrowser = typeof window !== 'undefined';
532
- var inWeex = typeof WXEnvironment !== 'undefined' && !!WXEnvironment.platform;
533
- var weexPlatform = inWeex && WXEnvironment.platform.toLowerCase();
534
- var UA = inBrowser && window.navigator.userAgent.toLowerCase();
535
- var isIE = UA && /msie|trident/.test(UA);
536
- var isIE9 = UA && UA.indexOf('msie 9.0') > 0;
537
- var isEdge = UA && UA.indexOf('edge/') > 0;
538
- var isAndroid = (UA && UA.indexOf('android') > 0) || (weexPlatform === 'android');
539
- var isIOS = (UA && /iphone|ipad|ipod|ios/.test(UA)) || (weexPlatform === 'ios');
540
- var isChrome = UA && /chrome\/\d+/.test(UA) && !isEdge;
541
- var isPhantomJS = UA && /phantomjs/.test(UA);
542
- var isFF = UA && UA.match(/firefox\/(\d+)/);
543
-
544
- // Firefox has a "watch" function on Object.prototype...
545
- var nativeWatch = ({}).watch;
546
-
547
- var supportsPassive = false;
548
- if (inBrowser) {
549
- try {
550
- var opts = {};
551
- Object.defineProperty(opts, 'passive', ({
552
- get: function get () {
553
- /* istanbul ignore next */
554
- supportsPassive = true;
555
- }
556
- })); // https://github.com/facebook/flow/issues/285
557
- window.addEventListener('test-passive', null, opts);
558
- } catch (e) {}
559
- }
560
-
561
- // this needs to be lazy-evaled because vue may be required before
562
- // vue-server-renderer can set VUE_ENV
563
- var _isServer;
564
- var isServerRendering = function () {
565
- if (_isServer === undefined) {
566
- /* istanbul ignore if */
567
- if (!inBrowser && !inWeex && typeof global !== 'undefined') {
568
- // detect presence of vue-server-renderer and avoid
569
- // Webpack shimming the process
570
- _isServer = global['process'] && global['process'].env.VUE_ENV === 'server';
571
- } else {
572
- _isServer = false;
573
- }
574
- }
575
- return _isServer
576
- };
577
-
578
- // detect devtools
579
- var devtools = inBrowser && window.__VUE_DEVTOOLS_GLOBAL_HOOK__;
580
-
581
- /* istanbul ignore next */
582
- function isNative (Ctor) {
583
- return typeof Ctor === 'function' && /native code/.test(Ctor.toString())
584
- }
585
-
586
- var hasSymbol =
587
- typeof Symbol !== 'undefined' && isNative(Symbol) &&
588
- typeof Reflect !== 'undefined' && isNative(Reflect.ownKeys);
589
-
590
- var _Set;
591
- /* istanbul ignore if */ // $flow-disable-line
592
- if (typeof Set !== 'undefined' && isNative(Set)) {
593
- // use native Set when available.
594
- _Set = Set;
595
- } else {
596
- // a non-standard Set polyfill that only works with primitive keys.
597
- _Set = /*@__PURE__*/(function () {
598
- function Set () {
599
- this.set = Object.create(null);
600
- }
601
- Set.prototype.has = function has (key) {
602
- return this.set[key] === true
603
- };
604
- Set.prototype.add = function add (key) {
605
- this.set[key] = true;
606
- };
607
- Set.prototype.clear = function clear () {
608
- this.set = Object.create(null);
609
- };
610
-
611
- return Set;
612
- }());
613
- }
614
-
615
- /* */
616
-
617
- var warn = noop;
618
- var tip = noop;
619
- var generateComponentTrace = (noop); // work around flow check
620
- var formatComponentName = (noop);
621
-
622
- {
623
- var hasConsole = typeof console !== 'undefined';
624
- var classifyRE = /(?:^|[-_])(\w)/g;
625
- var classify = function (str) { return str
626
- .replace(classifyRE, function (c) { return c.toUpperCase(); })
627
- .replace(/[-_]/g, ''); };
628
-
629
- warn = function (msg, vm) {
630
- var trace = vm ? generateComponentTrace(vm) : '';
631
-
632
- if (config.warnHandler) {
633
- config.warnHandler.call(null, msg, vm, trace);
634
- } else if (hasConsole && (!config.silent)) {
635
- console.error(("[Vue warn]: " + msg + trace));
636
- }
637
- };
638
-
639
- tip = function (msg, vm) {
640
- if (hasConsole && (!config.silent)) {
641
- console.warn("[Vue tip]: " + msg + (
642
- vm ? generateComponentTrace(vm) : ''
643
- ));
644
- }
645
- };
646
-
647
- formatComponentName = function (vm, includeFile) {
648
- if (vm.$root === vm) {
649
- return '<Root>'
650
- }
651
- var options = typeof vm === 'function' && vm.cid != null
652
- ? vm.options
653
- : vm._isVue
654
- ? vm.$options || vm.constructor.options
655
- : vm;
656
- var name = options.name || options._componentTag;
657
- var file = options.__file;
658
- if (!name && file) {
659
- var match = file.match(/([^/\\]+)\.vue$/);
660
- name = match && match[1];
661
- }
662
-
663
- return (
664
- (name ? ("<" + (classify(name)) + ">") : "<Anonymous>") +
665
- (file && includeFile !== false ? (" at " + file) : '')
666
- )
667
- };
668
-
669
- var repeat = function (str, n) {
670
- var res = '';
671
- while (n) {
672
- if (n % 2 === 1) { res += str; }
673
- if (n > 1) { str += str; }
674
- n >>= 1;
675
- }
676
- return res
677
- };
678
-
679
- generateComponentTrace = function (vm) {
680
- if (vm._isVue && vm.$parent) {
681
- var tree = [];
682
- var currentRecursiveSequence = 0;
683
- while (vm) {
684
- if (tree.length > 0) {
685
- var last = tree[tree.length - 1];
686
- if (last.constructor === vm.constructor) {
687
- currentRecursiveSequence++;
688
- vm = vm.$parent;
689
- continue
690
- } else if (currentRecursiveSequence > 0) {
691
- tree[tree.length - 1] = [last, currentRecursiveSequence];
692
- currentRecursiveSequence = 0;
693
- }
694
- }
695
- tree.push(vm);
696
- vm = vm.$parent;
697
- }
698
- return '\n\nfound in\n\n' + tree
699
- .map(function (vm, i) { return ("" + (i === 0 ? '---> ' : repeat(' ', 5 + i * 2)) + (Array.isArray(vm)
700
- ? ((formatComponentName(vm[0])) + "... (" + (vm[1]) + " recursive calls)")
701
- : formatComponentName(vm))); })
702
- .join('\n')
703
- } else {
704
- return ("\n\n(found in " + (formatComponentName(vm)) + ")")
705
- }
706
- };
707
- }
708
-
709
- /* */
710
-
711
- var uid = 0;
712
-
713
- /**
714
- * A dep is an observable that can have multiple
715
- * directives subscribing to it.
716
- */
717
- var Dep = function Dep () {
718
- this.id = uid++;
719
- this.subs = [];
720
- };
721
-
722
- Dep.prototype.addSub = function addSub (sub) {
723
- this.subs.push(sub);
724
- };
725
-
726
- Dep.prototype.removeSub = function removeSub (sub) {
727
- remove(this.subs, sub);
728
- };
729
-
730
- Dep.prototype.depend = function depend () {
731
- if (Dep.target) {
732
- Dep.target.addDep(this);
733
- }
734
- };
735
-
736
- Dep.prototype.notify = function notify () {
737
- // stabilize the subscriber list first
738
- var subs = this.subs.slice();
739
- if (!config.async) {
740
- // subs aren't sorted in scheduler if not running async
741
- // we need to sort them now to make sure they fire in correct
742
- // order
743
- subs.sort(function (a, b) { return a.id - b.id; });
744
- }
745
- for (var i = 0, l = subs.length; i < l; i++) {
746
- subs[i].update();
747
- }
748
- };
749
-
750
- // The current target watcher being evaluated.
751
- // This is globally unique because only one watcher
752
- // can be evaluated at a time.
753
- Dep.target = null;
754
- var targetStack = [];
755
-
756
- function pushTarget (target) {
757
- targetStack.push(target);
758
- Dep.target = target;
759
- }
760
-
761
- function popTarget () {
762
- targetStack.pop();
763
- Dep.target = targetStack[targetStack.length - 1];
764
- }
765
-
766
- /* */
767
-
768
- var VNode = function VNode (
769
- tag,
770
- data,
771
- children,
772
- text,
773
- elm,
774
- context,
775
- componentOptions,
776
- asyncFactory
777
- ) {
778
- this.tag = tag;
779
- this.data = data;
780
- this.children = children;
781
- this.text = text;
782
- this.elm = elm;
783
- this.ns = undefined;
784
- this.context = context;
785
- this.fnContext = undefined;
786
- this.fnOptions = undefined;
787
- this.fnScopeId = undefined;
788
- this.key = data && data.key;
789
- this.componentOptions = componentOptions;
790
- this.componentInstance = undefined;
791
- this.parent = undefined;
792
- this.raw = false;
793
- this.isStatic = false;
794
- this.isRootInsert = true;
795
- this.isComment = false;
796
- this.isCloned = false;
797
- this.isOnce = false;
798
- this.asyncFactory = asyncFactory;
799
- this.asyncMeta = undefined;
800
- this.isAsyncPlaceholder = false;
801
- };
802
-
803
- var prototypeAccessors = { child: { configurable: true } };
804
-
805
- // DEPRECATED: alias for componentInstance for backwards compat.
806
- /* istanbul ignore next */
807
- prototypeAccessors.child.get = function () {
808
- return this.componentInstance
809
- };
810
-
811
- Object.defineProperties( VNode.prototype, prototypeAccessors );
812
-
813
- var createEmptyVNode = function (text) {
814
- if ( text === void 0 ) text = '';
815
-
816
- var node = new VNode();
817
- node.text = text;
818
- node.isComment = true;
819
- return node
820
- };
821
-
822
- function createTextVNode (val) {
823
- return new VNode(undefined, undefined, undefined, String(val))
824
- }
825
-
826
- // optimized shallow clone
827
- // used for static nodes and slot nodes because they may be reused across
828
- // multiple renders, cloning them avoids errors when DOM manipulations rely
829
- // on their elm reference.
830
- function cloneVNode (vnode) {
831
- var cloned = new VNode(
832
- vnode.tag,
833
- vnode.data,
834
- // #7975
835
- // clone children array to avoid mutating original in case of cloning
836
- // a child.
837
- vnode.children && vnode.children.slice(),
838
- vnode.text,
839
- vnode.elm,
840
- vnode.context,
841
- vnode.componentOptions,
842
- vnode.asyncFactory
843
- );
844
- cloned.ns = vnode.ns;
845
- cloned.isStatic = vnode.isStatic;
846
- cloned.key = vnode.key;
847
- cloned.isComment = vnode.isComment;
848
- cloned.fnContext = vnode.fnContext;
849
- cloned.fnOptions = vnode.fnOptions;
850
- cloned.fnScopeId = vnode.fnScopeId;
851
- cloned.asyncMeta = vnode.asyncMeta;
852
- cloned.isCloned = true;
853
- return cloned
854
- }
855
-
856
- /*
857
- * not type checking this file because flow doesn't play well with
858
- * dynamically accessing methods on Array prototype
859
- */
860
-
861
- var arrayProto = Array.prototype;
862
- var arrayMethods = Object.create(arrayProto);
863
-
864
- var methodsToPatch = [
865
- 'push',
866
- 'pop',
867
- 'shift',
868
- 'unshift',
869
- 'splice',
870
- 'sort',
871
- 'reverse'
872
- ];
873
-
874
- /**
875
- * Intercept mutating methods and emit events
876
- */
877
- methodsToPatch.forEach(function (method) {
878
- // cache original method
879
- var original = arrayProto[method];
880
- def(arrayMethods, method, function mutator () {
881
- var args = [], len = arguments.length;
882
- while ( len-- ) args[ len ] = arguments[ len ];
883
-
884
- var result = original.apply(this, args);
885
- var ob = this.__ob__;
886
- var inserted;
887
- switch (method) {
888
- case 'push':
889
- case 'unshift':
890
- inserted = args;
891
- break
892
- case 'splice':
893
- inserted = args.slice(2);
894
- break
895
- }
896
- if (inserted) { ob.observeArray(inserted); }
897
- // notify change
898
- ob.dep.notify();
899
- return result
900
- });
901
- });
902
-
903
- /* */
904
-
905
- var arrayKeys = Object.getOwnPropertyNames(arrayMethods);
906
-
907
- /**
908
- * In some cases we may want to disable observation inside a component's
909
- * update computation.
910
- */
911
- var shouldObserve = true;
912
-
913
- function toggleObserving (value) {
914
- shouldObserve = value;
915
- }
916
-
917
- /**
918
- * Observer class that is attached to each observed
919
- * object. Once attached, the observer converts the target
920
- * object's property keys into getter/setters that
921
- * collect dependencies and dispatch updates.
922
- */
923
- var Observer = function Observer (value) {
924
- this.value = value;
925
- this.dep = new Dep();
926
- this.vmCount = 0;
927
- def(value, '__ob__', this);
928
- if (Array.isArray(value)) {
929
- if (hasProto) {
930
- protoAugment(value, arrayMethods);
931
- } else {
932
- copyAugment(value, arrayMethods, arrayKeys);
933
- }
934
- this.observeArray(value);
935
- } else {
936
- this.walk(value);
937
- }
938
- };
939
-
940
- /**
941
- * Walk through all properties and convert them into
942
- * getter/setters. This method should only be called when
943
- * value type is Object.
944
- */
945
- Observer.prototype.walk = function walk (obj) {
946
- var keys = Object.keys(obj);
947
- for (var i = 0; i < keys.length; i++) {
948
- defineReactive$$1(obj, keys[i]);
949
- }
950
- };
951
-
952
- /**
953
- * Observe a list of Array items.
954
- */
955
- Observer.prototype.observeArray = function observeArray (items) {
956
- for (var i = 0, l = items.length; i < l; i++) {
957
- observe(items[i]);
958
- }
959
- };
960
-
961
- // helpers
962
-
963
- /**
964
- * Augment a target Object or Array by intercepting
965
- * the prototype chain using __proto__
966
- */
967
- function protoAugment (target, src) {
968
- /* eslint-disable no-proto */
969
- target.__proto__ = src;
970
- /* eslint-enable no-proto */
971
- }
972
-
973
- /**
974
- * Augment a target Object or Array by defining
975
- * hidden properties.
976
- */
977
- /* istanbul ignore next */
978
- function copyAugment (target, src, keys) {
979
- for (var i = 0, l = keys.length; i < l; i++) {
980
- var key = keys[i];
981
- def(target, key, src[key]);
982
- }
983
- }
984
-
985
- /**
986
- * Attempt to create an observer instance for a value,
987
- * returns the new observer if successfully observed,
988
- * or the existing observer if the value already has one.
989
- */
990
- function observe (value, asRootData) {
991
- if (!isObject(value) || value instanceof VNode) {
992
- return
993
- }
994
- var ob;
995
- if (hasOwn(value, '__ob__') && value.__ob__ instanceof Observer) {
996
- ob = value.__ob__;
997
- } else if (
998
- shouldObserve &&
999
- !isServerRendering() &&
1000
- (Array.isArray(value) || isPlainObject(value)) &&
1001
- Object.isExtensible(value) &&
1002
- !value._isVue
1003
- ) {
1004
- ob = new Observer(value);
1005
- }
1006
- if (asRootData && ob) {
1007
- ob.vmCount++;
1008
- }
1009
- return ob
1010
- }
1011
-
1012
- /**
1013
- * Define a reactive property on an Object.
1014
- */
1015
- function defineReactive$$1 (
1016
- obj,
1017
- key,
1018
- val,
1019
- customSetter,
1020
- shallow
1021
- ) {
1022
- var dep = new Dep();
1023
-
1024
- var property = Object.getOwnPropertyDescriptor(obj, key);
1025
- if (property && property.configurable === false) {
1026
- return
1027
- }
1028
-
1029
- // cater for pre-defined getter/setters
1030
- var getter = property && property.get;
1031
- var setter = property && property.set;
1032
- if ((!getter || setter) && arguments.length === 2) {
1033
- val = obj[key];
1034
- }
1035
-
1036
- var childOb = !shallow && observe(val);
1037
- Object.defineProperty(obj, key, {
1038
- enumerable: true,
1039
- configurable: true,
1040
- get: function reactiveGetter () {
1041
- var value = getter ? getter.call(obj) : val;
1042
- if (Dep.target) {
1043
- dep.depend();
1044
- if (childOb) {
1045
- childOb.dep.depend();
1046
- if (Array.isArray(value)) {
1047
- dependArray(value);
1048
- }
1049
- }
1050
- }
1051
- return value
1052
- },
1053
- set: function reactiveSetter (newVal) {
1054
- var value = getter ? getter.call(obj) : val;
1055
- /* eslint-disable no-self-compare */
1056
- if (newVal === value || (newVal !== newVal && value !== value)) {
1057
- return
1058
- }
1059
- /* eslint-enable no-self-compare */
1060
- if (customSetter) {
1061
- customSetter();
1062
- }
1063
- // #7981: for accessor properties without setter
1064
- if (getter && !setter) { return }
1065
- if (setter) {
1066
- setter.call(obj, newVal);
1067
- } else {
1068
- val = newVal;
1069
- }
1070
- childOb = !shallow && observe(newVal);
1071
- dep.notify();
1072
- }
1073
- });
1074
- }
1075
-
1076
- /**
1077
- * Set a property on an object. Adds the new property and
1078
- * triggers change notification if the property doesn't
1079
- * already exist.
1080
- */
1081
- function set (target, key, val) {
1082
- if (isUndef(target) || isPrimitive(target)
1083
- ) {
1084
- warn(("Cannot set reactive property on undefined, null, or primitive value: " + ((target))));
1085
- }
1086
- if (Array.isArray(target) && isValidArrayIndex(key)) {
1087
- target.length = Math.max(target.length, key);
1088
- target.splice(key, 1, val);
1089
- return val
1090
- }
1091
- if (key in target && !(key in Object.prototype)) {
1092
- target[key] = val;
1093
- return val
1094
- }
1095
- var ob = (target).__ob__;
1096
- if (target._isVue || (ob && ob.vmCount)) {
1097
- warn(
1098
- 'Avoid adding reactive properties to a Vue instance or its root $data ' +
1099
- 'at runtime - declare it upfront in the data option.'
1100
- );
1101
- return val
1102
- }
1103
- if (!ob) {
1104
- target[key] = val;
1105
- return val
1106
- }
1107
- defineReactive$$1(ob.value, key, val);
1108
- ob.dep.notify();
1109
- return val
1110
- }
1111
-
1112
- /**
1113
- * Delete a property and trigger change if necessary.
1114
- */
1115
- function del (target, key) {
1116
- if (isUndef(target) || isPrimitive(target)
1117
- ) {
1118
- warn(("Cannot delete reactive property on undefined, null, or primitive value: " + ((target))));
1119
- }
1120
- if (Array.isArray(target) && isValidArrayIndex(key)) {
1121
- target.splice(key, 1);
1122
- return
1123
- }
1124
- var ob = (target).__ob__;
1125
- if (target._isVue || (ob && ob.vmCount)) {
1126
- warn(
1127
- 'Avoid deleting properties on a Vue instance or its root $data ' +
1128
- '- just set it to null.'
1129
- );
1130
- return
1131
- }
1132
- if (!hasOwn(target, key)) {
1133
- return
1134
- }
1135
- delete target[key];
1136
- if (!ob) {
1137
- return
1138
- }
1139
- ob.dep.notify();
1140
- }
1141
-
1142
- /**
1143
- * Collect dependencies on array elements when the array is touched, since
1144
- * we cannot intercept array element access like property getters.
1145
- */
1146
- function dependArray (value) {
1147
- for (var e = (void 0), i = 0, l = value.length; i < l; i++) {
1148
- e = value[i];
1149
- e && e.__ob__ && e.__ob__.dep.depend();
1150
- if (Array.isArray(e)) {
1151
- dependArray(e);
1152
- }
1153
- }
1154
- }
1155
-
1156
- /* */
1157
-
1158
- /**
1159
- * Option overwriting strategies are functions that handle
1160
- * how to merge a parent option value and a child option
1161
- * value into the final value.
1162
- */
1163
- var strats = config.optionMergeStrategies;
1164
-
1165
- /**
1166
- * Options with restrictions
1167
- */
1168
- {
1169
- strats.el = strats.propsData = function (parent, child, vm, key) {
1170
- if (!vm) {
1171
- warn(
1172
- "option \"" + key + "\" can only be used during instance " +
1173
- 'creation with the `new` keyword.'
1174
- );
1175
- }
1176
- return defaultStrat(parent, child)
1177
- };
1178
- }
1179
-
1180
- /**
1181
- * Helper that recursively merges two data objects together.
1182
- */
1183
- function mergeData (to, from) {
1184
- if (!from) { return to }
1185
- var key, toVal, fromVal;
1186
-
1187
- var keys = hasSymbol
1188
- ? Reflect.ownKeys(from)
1189
- : Object.keys(from);
1190
-
1191
- for (var i = 0; i < keys.length; i++) {
1192
- key = keys[i];
1193
- // in case the object is already observed...
1194
- if (key === '__ob__') { continue }
1195
- toVal = to[key];
1196
- fromVal = from[key];
1197
- if (!hasOwn(to, key)) {
1198
- set(to, key, fromVal);
1199
- } else if (
1200
- toVal !== fromVal &&
1201
- isPlainObject(toVal) &&
1202
- isPlainObject(fromVal)
1203
- ) {
1204
- mergeData(toVal, fromVal);
1205
- }
1206
- }
1207
- return to
1208
- }
1209
-
1210
- /**
1211
- * Data
1212
- */
1213
- function mergeDataOrFn (
1214
- parentVal,
1215
- childVal,
1216
- vm
1217
- ) {
1218
- if (!vm) {
1219
- // in a Vue.extend merge, both should be functions
1220
- if (!childVal) {
1221
- return parentVal
1222
- }
1223
- if (!parentVal) {
1224
- return childVal
1225
- }
1226
- // when parentVal & childVal are both present,
1227
- // we need to return a function that returns the
1228
- // merged result of both functions... no need to
1229
- // check if parentVal is a function here because
1230
- // it has to be a function to pass previous merges.
1231
- return function mergedDataFn () {
1232
- return mergeData(
1233
- typeof childVal === 'function' ? childVal.call(this, this) : childVal,
1234
- typeof parentVal === 'function' ? parentVal.call(this, this) : parentVal
1235
- )
1236
- }
1237
- } else {
1238
- return function mergedInstanceDataFn () {
1239
- // instance merge
1240
- var instanceData = typeof childVal === 'function'
1241
- ? childVal.call(vm, vm)
1242
- : childVal;
1243
- var defaultData = typeof parentVal === 'function'
1244
- ? parentVal.call(vm, vm)
1245
- : parentVal;
1246
- if (instanceData) {
1247
- return mergeData(instanceData, defaultData)
1248
- } else {
1249
- return defaultData
1250
- }
1251
- }
1252
- }
1253
- }
1254
-
1255
- strats.data = function (
1256
- parentVal,
1257
- childVal,
1258
- vm
1259
- ) {
1260
- if (!vm) {
1261
- if (childVal && typeof childVal !== 'function') {
1262
- warn(
1263
- 'The "data" option should be a function ' +
1264
- 'that returns a per-instance value in component ' +
1265
- 'definitions.',
1266
- vm
1267
- );
1268
-
1269
- return parentVal
1270
- }
1271
- return mergeDataOrFn(parentVal, childVal)
1272
- }
1273
-
1274
- return mergeDataOrFn(parentVal, childVal, vm)
1275
- };
1276
-
1277
- /**
1278
- * Hooks and props are merged as arrays.
1279
- */
1280
- function mergeHook (
1281
- parentVal,
1282
- childVal
1283
- ) {
1284
- var res = childVal
1285
- ? parentVal
1286
- ? parentVal.concat(childVal)
1287
- : Array.isArray(childVal)
1288
- ? childVal
1289
- : [childVal]
1290
- : parentVal;
1291
- return res
1292
- ? dedupeHooks(res)
1293
- : res
1294
- }
1295
-
1296
- function dedupeHooks (hooks) {
1297
- var res = [];
1298
- for (var i = 0; i < hooks.length; i++) {
1299
- if (res.indexOf(hooks[i]) === -1) {
1300
- res.push(hooks[i]);
1301
- }
1302
- }
1303
- return res
1304
- }
1305
-
1306
- LIFECYCLE_HOOKS.forEach(function (hook) {
1307
- strats[hook] = mergeHook;
1308
- });
1309
-
1310
- /**
1311
- * Assets
1312
- *
1313
- * When a vm is present (instance creation), we need to do
1314
- * a three-way merge between constructor options, instance
1315
- * options and parent options.
1316
- */
1317
- function mergeAssets (
1318
- parentVal,
1319
- childVal,
1320
- vm,
1321
- key
1322
- ) {
1323
- var res = Object.create(parentVal || null);
1324
- if (childVal) {
1325
- assertObjectType(key, childVal, vm);
1326
- return extend(res, childVal)
1327
- } else {
1328
- return res
1329
- }
1330
- }
1331
-
1332
- ASSET_TYPES.forEach(function (type) {
1333
- strats[type + 's'] = mergeAssets;
1334
- });
1335
-
1336
- /**
1337
- * Watchers.
1338
- *
1339
- * Watchers hashes should not overwrite one
1340
- * another, so we merge them as arrays.
1341
- */
1342
- strats.watch = function (
1343
- parentVal,
1344
- childVal,
1345
- vm,
1346
- key
1347
- ) {
1348
- // work around Firefox's Object.prototype.watch...
1349
- if (parentVal === nativeWatch) { parentVal = undefined; }
1350
- if (childVal === nativeWatch) { childVal = undefined; }
1351
- /* istanbul ignore if */
1352
- if (!childVal) { return Object.create(parentVal || null) }
1353
- {
1354
- assertObjectType(key, childVal, vm);
1355
- }
1356
- if (!parentVal) { return childVal }
1357
- var ret = {};
1358
- extend(ret, parentVal);
1359
- for (var key$1 in childVal) {
1360
- var parent = ret[key$1];
1361
- var child = childVal[key$1];
1362
- if (parent && !Array.isArray(parent)) {
1363
- parent = [parent];
1364
- }
1365
- ret[key$1] = parent
1366
- ? parent.concat(child)
1367
- : Array.isArray(child) ? child : [child];
1368
- }
1369
- return ret
1370
- };
1371
-
1372
- /**
1373
- * Other object hashes.
1374
- */
1375
- strats.props =
1376
- strats.methods =
1377
- strats.inject =
1378
- strats.computed = function (
1379
- parentVal,
1380
- childVal,
1381
- vm,
1382
- key
1383
- ) {
1384
- if (childVal && "development" !== 'production') {
1385
- assertObjectType(key, childVal, vm);
1386
- }
1387
- if (!parentVal) { return childVal }
1388
- var ret = Object.create(null);
1389
- extend(ret, parentVal);
1390
- if (childVal) { extend(ret, childVal); }
1391
- return ret
1392
- };
1393
- strats.provide = mergeDataOrFn;
1394
-
1395
- /**
1396
- * Default strategy.
1397
- */
1398
- var defaultStrat = function (parentVal, childVal) {
1399
- return childVal === undefined
1400
- ? parentVal
1401
- : childVal
1402
- };
1403
-
1404
- /**
1405
- * Validate component names
1406
- */
1407
- function checkComponents (options) {
1408
- for (var key in options.components) {
1409
- validateComponentName(key);
1410
- }
1411
- }
1412
-
1413
- function validateComponentName (name) {
1414
- if (!new RegExp(("^[a-zA-Z][\\-\\.0-9_" + (unicodeRegExp.source) + "]*$")).test(name)) {
1415
- warn(
1416
- 'Invalid component name: "' + name + '". Component names ' +
1417
- 'should conform to valid custom element name in html5 specification.'
1418
- );
1419
- }
1420
- if (isBuiltInTag(name) || config.isReservedTag(name)) {
1421
- warn(
1422
- 'Do not use built-in or reserved HTML elements as component ' +
1423
- 'id: ' + name
1424
- );
1425
- }
1426
- }
1427
-
1428
- /**
1429
- * Ensure all props option syntax are normalized into the
1430
- * Object-based format.
1431
- */
1432
- function normalizeProps (options, vm) {
1433
- var props = options.props;
1434
- if (!props) { return }
1435
- var res = {};
1436
- var i, val, name;
1437
- if (Array.isArray(props)) {
1438
- i = props.length;
1439
- while (i--) {
1440
- val = props[i];
1441
- if (typeof val === 'string') {
1442
- name = camelize(val);
1443
- res[name] = { type: null };
1444
- } else {
1445
- warn('props must be strings when using array syntax.');
1446
- }
1447
- }
1448
- } else if (isPlainObject(props)) {
1449
- for (var key in props) {
1450
- val = props[key];
1451
- name = camelize(key);
1452
- res[name] = isPlainObject(val)
1453
- ? val
1454
- : { type: val };
1455
- }
1456
- } else {
1457
- warn(
1458
- "Invalid value for option \"props\": expected an Array or an Object, " +
1459
- "but got " + (toRawType(props)) + ".",
1460
- vm
1461
- );
1462
- }
1463
- options.props = res;
1464
- }
1465
-
1466
- /**
1467
- * Normalize all injections into Object-based format
1468
- */
1469
- function normalizeInject (options, vm) {
1470
- var inject = options.inject;
1471
- if (!inject) { return }
1472
- var normalized = options.inject = {};
1473
- if (Array.isArray(inject)) {
1474
- for (var i = 0; i < inject.length; i++) {
1475
- normalized[inject[i]] = { from: inject[i] };
1476
- }
1477
- } else if (isPlainObject(inject)) {
1478
- for (var key in inject) {
1479
- var val = inject[key];
1480
- normalized[key] = isPlainObject(val)
1481
- ? extend({ from: key }, val)
1482
- : { from: val };
1483
- }
1484
- } else {
1485
- warn(
1486
- "Invalid value for option \"inject\": expected an Array or an Object, " +
1487
- "but got " + (toRawType(inject)) + ".",
1488
- vm
1489
- );
1490
- }
1491
- }
1492
-
1493
- /**
1494
- * Normalize raw function directives into object format.
1495
- */
1496
- function normalizeDirectives (options) {
1497
- var dirs = options.directives;
1498
- if (dirs) {
1499
- for (var key in dirs) {
1500
- var def$$1 = dirs[key];
1501
- if (typeof def$$1 === 'function') {
1502
- dirs[key] = { bind: def$$1, update: def$$1 };
1503
- }
1504
- }
1505
- }
1506
- }
1507
-
1508
- function assertObjectType (name, value, vm) {
1509
- if (!isPlainObject(value)) {
1510
- warn(
1511
- "Invalid value for option \"" + name + "\": expected an Object, " +
1512
- "but got " + (toRawType(value)) + ".",
1513
- vm
1514
- );
1515
- }
1516
- }
1517
-
1518
- /**
1519
- * Merge two option objects into a new one.
1520
- * Core utility used in both instantiation and inheritance.
1521
- */
1522
- function mergeOptions (
1523
- parent,
1524
- child,
1525
- vm
1526
- ) {
1527
- {
1528
- checkComponents(child);
1529
- }
1530
-
1531
- if (typeof child === 'function') {
1532
- child = child.options;
1533
- }
1534
-
1535
- normalizeProps(child, vm);
1536
- normalizeInject(child, vm);
1537
- normalizeDirectives(child);
1538
-
1539
- // Apply extends and mixins on the child options,
1540
- // but only if it is a raw options object that isn't
1541
- // the result of another mergeOptions call.
1542
- // Only merged options has the _base property.
1543
- if (!child._base) {
1544
- if (child.extends) {
1545
- parent = mergeOptions(parent, child.extends, vm);
1546
- }
1547
- if (child.mixins) {
1548
- for (var i = 0, l = child.mixins.length; i < l; i++) {
1549
- parent = mergeOptions(parent, child.mixins[i], vm);
1550
- }
1551
- }
1552
- }
1553
-
1554
- var options = {};
1555
- var key;
1556