Current Path : /var/test/www/mainsite/wp-content/plugins/give/assets/dist/js/ |
Current File : /var/test/www/mainsite/wp-content/plugins/give/assets/dist/js/admin.js |
!function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=468)}({100:function(e,t){function i(t,n){return e.exports=i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},i(t,n)}e.exports=i},13:function(e,t,i){"use strict";i.r(t),i.d(t,"GiveModal",(function(){return h})),i.d(t,"GiveErrorAlert",(function(){return p})),i.d(t,"GiveWarningAlert",(function(){return g})),i.d(t,"GiveNoticeAlert",(function(){return m})),i.d(t,"GiveSuccessAlert",(function(){return v})),i.d(t,"GiveConfirmModal",(function(){return _})),i.d(t,"GiveFormModal",(function(){return b}));var n=i(21),o=i.n(n),a=i(22),r=i.n(a),s=i(23),l=i.n(s),c=i(8),d=i.n(c),u=i(19),f=i.n(u),h=(i(98),i(99),function(){function e(t){if(d()(this,e),e===this.constructor)throw new Error("Abstract classes can't be instantiated.");this.config=Object.assign({type:"",triggerSelector:"",externalPlugin:"magnificPopup",classes:{modalWrapper:""},modalContent:{}},t),this.config.mainClass="".concat(this.config.mainClass?this.config.mainClass:""," modal-fade-slide").trim()}return f()(e,[{key:"init",value:function(){this.setupTemplate(),this.popupConfig(),this.__setupClickEvent()}},{key:"getTemplate",value:function(){var e='<div class="give-hidden"></div>';return this.config.type.length&&(e='<div class="give-modal give-modal--zoom '.concat(this.config.classes.modalWrapper?"".concat(this.config.classes.modalWrapper).trim():"",'">\n\n\t\t\t\t<div class="give-modal__body">\n\t\t\t\t\t').concat(this.config.modalContent.title?'<h2 class="give-modal__title">'.concat(this.config.modalContent.title,"</h2>"):"","\n\t\t\t\t\t").concat(this.config.modalContent.desc?'<p class="give-modal__description">'.concat(this.config.modalContent.desc,"</p>"):"",'\n\t\t\t\t</div>\n\t\n\t\t\t\t<div class="give-modal__controls">\n\n\t\t\t\t\t').concat("form"===this.config.type?'<div class="spinner"></div>':"","\n\t\t\t\t\t").concat("form"===this.config.type?'<a class="give-modal--additional-link" href="'.concat(this.config.modalContent.link,'">').concat(this.config.modalContent.link_text,"</a>"):"",'\n\n\t\t\t\t\t<button class="give-button give-button--secondary give-popup-close-button">\n\t\t\t\t\t\t').concat(this.config.modalContent.cancelBtnTitle?this.config.modalContent.cancelBtnTitle:"confirm"===this.config.type?Give.fn.getGlobalVar("cancel"):Give.fn.getGlobalVar("close"),"\n\t\t\t\t\t</button>\n\n\t\t\t\t\t").concat("confirm"!==this.config.type&&"form"!==this.config.type?"":'<button class="give-button give-button--primary give-popup-'.concat(this.config.type,'-button">\n\n\t\t\t\t\t\t').concat(this.config.modalContent.confirmBtnTitle?this.config.modalContent.confirmBtnTitle:Give.fn.getGlobalVar("confirm"),"\n\t\t\t\t\t</button>"),"\n\t\t\t\t</div>\n\t\t\t\t\n\t\t\t</div>")),e}},{key:"setupTemplate",value:function(){this.config.template=this.getTemplate()}},{key:"__setupClickEvent",value:function(){this.config.triggerSelector.length&&jQuery(this.config.triggerSelector).magnificPopup(this.config)}},{key:"popupConfig",value:function(){"magnificPopup"===this.config.externalPlugin&&(this.config.items=this.config.items||{src:this.config.template,type:"inline"},this.config=Object.assign({removalDelay:300,fixedContentPos:!0,fixedBgPos:!0,alignTop:!0,showCloseBtn:!1,closeOnBgClick:!1,enableEscapeKey:!0,focus:".give-popup-close-button"},this.config))}},{key:"render",value:function(){switch(this.config.externalPlugin){case"magnificPopup":this.config.triggerSelector||jQuery.magnificPopup.open(this.config)}return this}}],[{key:"__closePopup",value:function(e){e.preventDefault(),jQuery.magnificPopup.instance.close()}},{key:"__ajaxModalHandle",value:function(e){var t=jQuery(e.target),i=t.attr("data-cache");if(e.preventDefault(),void 0!==i)return i=decodeURI(i),void new Give.modal.GiveSuccessAlert({modalContent:{title:t.attr("title"),desc:i},closeOnBgClick:!0}).render();jQuery.ajax({url:t.attr("href"),method:"GET",beforeSend:function(){new Give.modal.GiveSuccessAlert({modalContent:{desc:Give.fn.loader({},{show:null,loadingText:Give.fn.getGlobalVar("loader_translation").loading})},closeOnBgClick:!0}).render()},success:function(e){e.length&&t.attr("data-cache",encodeURI(e)),jQuery(".mfp-wrap").length&&new Give.modal.GiveSuccessAlert({modalContent:{title:t.attr("title"),desc:e},closeOnBgClick:!0}).render()}})}}]),e}()),p=function(e){function t(e){var i;return d()(this,t),e.type="alert",(i=o()(this,r()(t).call(this,e))).config.classes.modalWrapper="give-modal--error",i.init(),i}return l()(t,e),t}(h),g=function(e){function t(e){var i;return d()(this,t),e.type="alert",(i=o()(this,r()(t).call(this,e))).config.classes.modalWrapper="give-modal--warning",i.init(),i}return l()(t,e),t}(h),m=function(e){function t(e){var i;return d()(this,t),e.type="alert",(i=o()(this,r()(t).call(this,e))).config.classes.modalWrapper="give-modal--notice",i.init(),i}return l()(t,e),t}(h),v=function(e){function t(e){var i;return d()(this,t),e.type="alert",(i=o()(this,r()(t).call(this,e))).config.classes.modalWrapper="give-modal--success",i.init(),i}return l()(t,e),t}(h),_=function(e){function t(e){var i;return d()(this,t),e.type="confirm",i=o()(this,r()(t).call(this,e)),void 0!==e.modalWrapper&&""!==e.modalWrapper&&(i.config.classes.modalWrapper=e.modalWrapper),i.init(),i}return l()(t,e),f()(t,null,[{key:"__confirmPopup",value:function(){"function"==typeof jQuery.magnificPopup.instance.st.successConfirm&&(jQuery.magnificPopup.instance.st.successConfirm({el:jQuery.magnificPopup.instance.st.el}),jQuery.magnificPopup.close())}}]),t}(h),b=function(e){function t(e){var i;return d()(this,t),e.type="form",i=o()(this,r()(t).call(this,e)),void 0!==e.modalWrapper&&""!==e.modalWrapper&&(i.config.classes.modalWrapper=e.modalWrapper),i.init(),i}return l()(t,e),f()(t,null,[{key:"__submitPopup",value:function(){"function"==typeof jQuery.magnificPopup.instance.st.successConfirm&&jQuery.magnificPopup.instance.st.successConfirm({el:jQuery.magnificPopup.instance.st.el})}}]),t}(h);window.addDynamicEventListener(document,"click",".give-popup-close-button",h.__closePopup,{}),window.addDynamicEventListener(document,"click",".give-popup-confirm-button",_.__confirmPopup,{}),window.addDynamicEventListener(document,"click",".give-popup-form-button",b.__submitPopup,{}),window.addDynamicEventListener(document,"click",".give-ajax-modal",h.__ajaxModalHandle,{})},15:function(e,t){function i(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?e.exports=i=function(e){return typeof e}:e.exports=i=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(t)}e.exports=i},16:function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},19:function(e,t){function i(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e}},21:function(e,t,i){var n=i(15),o=i(16);e.exports=function(e,t){return!t||"object"!==n(t)&&"function"!=typeof t?o(e):t}},22:function(e,t){function i(t){return e.exports=i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},i(t)}e.exports=i},23:function(e,t,i){var n=i(100);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&n(e,t)}},275:function(e,t,i){(function(t){e.exports=t.accounting=i(276)}).call(this,i(43))},276:function(e,t,i){ /*! * accounting.js v0.4.1 * Copyright 2014 Open Exchange Rates * * Freely distributable under the MIT license. * Portions of accounting.js are inspired or borrowed from underscore.js * * Full details and documentation: * http://openexchangerates.github.io/accounting.js/ */ !function(i,n){var o={version:"0.4.1",settings:{currency:{symbol:"$",format:"%s%v",decimal:".",thousand:",",precision:2,grouping:3},number:{precision:0,grouping:3,thousand:",",decimal:"."}}},a=Array.prototype.map,r=Array.isArray,s=Object.prototype.toString;function l(e){return!!(""===e||e&&e.charCodeAt&&e.substr)}function c(e){return r?r(e):"[object Array]"===s.call(e)}function d(e){return e&&"[object Object]"===s.call(e)}function u(e,t){var i;for(i in e=e||{},t=t||{})t.hasOwnProperty(i)&&null==e[i]&&(e[i]=t[i]);return e}function f(e,t,i){var n,o,r=[];if(!e)return r;if(a&&e.map===a)return e.map(t,i);for(n=0,o=e.length;n<o;n++)r[n]=t.call(i,e[n],n,e);return r}function h(e,t){return e=Math.round(Math.abs(e)),isNaN(e)?t:e}function p(e){var t=o.settings.currency.format;return"function"==typeof e&&(e=e()),l(e)&&e.match("%v")?{pos:e,neg:e.replace("-","").replace("%v","-%v"),zero:e}:e&&e.pos&&e.pos.match("%v")?e:l(t)?o.settings.currency.format={pos:t,neg:t.replace("%v","-%v"),zero:t}:t}var g=o.unformat=o.parse=function(e,t){if(c(e))return f(e,(function(e){return g(e,t)}));if("number"==typeof(e=e||0))return e;t=t||o.settings.number.decimal;var i=new RegExp("[^0-9-"+t+"]",["g"]),n=parseFloat((""+e).replace(/\((.*)\)/,"-$1").replace(i,"").replace(t,"."));return isNaN(n)?0:n},m=o.toFixed=function(e,t){t=h(t,o.settings.number.precision);var i=Math.pow(10,t);return(Math.round(o.unformat(e)*i)/i).toFixed(t)},v=o.formatNumber=o.format=function(e,t,i,n){if(c(e))return f(e,(function(e){return v(e,t,i,n)}));e=g(e);var a=u(d(t)?t:{precision:t,thousand:i,decimal:n},o.settings.number),r=h(a.precision),s=e<0?"-":"",l=parseInt(m(Math.abs(e||0),r),10)+"",p=l.length>3?l.length%3:0;return s+(p?l.substr(0,p)+a.thousand:"")+l.substr(p).replace(/(\d{3})(?=\d)/g,"$1"+a.thousand)+(r?a.decimal+m(Math.abs(e),r).split(".")[1]:"")},_=o.formatMoney=function(e,t,i,n,a,r){if(c(e))return f(e,(function(e){return _(e,t,i,n,a,r)}));e=g(e);var s=u(d(t)?t:{symbol:t,precision:i,thousand:n,decimal:a,format:r},o.settings.currency),l=p(s.format);return(e>0?l.pos:e<0?l.neg:l.zero).replace("%s",s.symbol).replace("%v",v(Math.abs(e),h(s.precision),s.thousand,s.decimal))};o.formatColumn=function(e,t,i,n,a,r){if(!e)return[];var s=u(d(t)?t:{symbol:t,precision:i,thousand:n,decimal:a,format:r},o.settings.currency),m=p(s.format),_=m.pos.indexOf("%s")<m.pos.indexOf("%v"),b=0,y=f(e,(function(e,t){if(c(e))return o.formatColumn(e,s);var i=((e=g(e))>0?m.pos:e<0?m.neg:m.zero).replace("%s",s.symbol).replace("%v",v(Math.abs(e),h(s.precision),s.thousand,s.decimal));return i.length>b&&(b=i.length),i}));return f(y,(function(e,t){return l(e)&&e.length<b?_?e.replace(s.symbol,s.symbol+new Array(b-e.length+1).join(" ")):new Array(b-e.length+1).join(" ")+e:e}))},e.exports&&(t=e.exports=o),t.accounting=o}()},277:function(e,t){jQuery.fn.giveHintCss=function(e,t){return this.each((function(){var i=jQuery(this);t=jQuery.extend({label:""},t);var n=i.next("span.give-hint-tooltip-js");if(!n.length){var o=t.label.length?t.label:i.data("hint-aria-label");if(!o.length)return;i.after('<span class="give-hint-tooltip-js hint--top hint--medium" aria-label="'+o+'"></span>'),(n=i.next()).css({top:-i.outerHeight(),left:-i.outerWidth()/2})}"show"===e?n.addClass("hint--always"):"hide"===e&&n.removeClass("hint--always")}))},jQuery(document).ready((function(e){var t=e("[data-tooltip]");function i(t){if(!t.is('[class*="hint"]')){var i=t.attr("class"),n=[],o=t.data("tooltip").split(" ").length;i&&(i=i.split(" "),(n=e.grep(i,(function(e){return-1!==e.indexOf("give-icon")}))).length&&(n=n.join(" "),t.removeClass(n),t.append('<i class="'+n+'"></i>'))),t.addClass("hint--top"),15<o?t.addClass("hint--large"):7<o&&t.addClass("hint--medium"),t.attr("aria-label",t.data("tooltip"))}}t.length&&t.each((function(t,n){i(n=n instanceof jQuery?n:e(n))})),e("body").on("hover","[data-tooltip]",(function(){i(e(this))}))}))},278:function(e,t,i){e.exports=i(279)},279:function(e,t,i){var n=i(280),o=i(281),a=/^[0-9a-f]{32}$/;function r(e,t){if(e)return"boolean"==typeof e.protocol?e.protocol:"http"!==e.protocol&&("https"===e.protocol||void 0)}function s(e){return(e="string"==typeof e?e.trim().toLowerCase():"unspecified").match(a)?e:n(e)}function l(e){var t=o.stringify(function(e){var t={},i={protocol:1,format:1};for(var n in e)i[n]||(t[n]=e[n]);return t}(e));return t&&"?"+t||""}e.exports={url:function(e,t,i){var n="//www.gravatar.com/avatar/";t&&t.cdn?(n=t.cdn+"/avatar/",delete t.cdn):(t&&t.protocol&&(i=r(t)),void 0!==i&&(n=i?"https://s.gravatar.com/avatar/":"http://www.gravatar.com/avatar/"));var o=l(t);return n+s(e)+o},profile_url:function(e,t,i){var n=null!=t&&null!=t.format?String(t.format):"json";if(t&&t.cdn)o=t.cdn+"/",delete t.cdn;else{t&&t.protocol&&(i=r(t));var o=i?"https://secure.gravatar.com/":"http://www.gravatar.com/"}var a=l(t);return o+s(e)+"."+n+a}}},280:function(e,t,i){var n;!function(o){"use strict";function a(e,t){var i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function r(e,t,i,n,o,r){return a((s=a(a(t,e),a(n,r)))<<(l=o)|s>>>32-l,i);var s,l}function s(e,t,i,n,o,a,s){return r(t&i|~t&n,e,t,o,a,s)}function l(e,t,i,n,o,a,s){return r(t&n|i&~n,e,t,o,a,s)}function c(e,t,i,n,o,a,s){return r(t^i^n,e,t,o,a,s)}function d(e,t,i,n,o,a,s){return r(i^(t|~n),e,t,o,a,s)}function u(e,t){var i,n,o,r,u;e[t>>5]|=128<<t%32,e[14+(t+64>>>9<<4)]=t;var f=1732584193,h=-271733879,p=-1732584194,g=271733878;for(i=0;i<e.length;i+=16)n=f,o=h,r=p,u=g,f=s(f,h,p,g,e[i],7,-680876936),g=s(g,f,h,p,e[i+1],12,-389564586),p=s(p,g,f,h,e[i+2],17,606105819),h=s(h,p,g,f,e[i+3],22,-1044525330),f=s(f,h,p,g,e[i+4],7,-176418897),g=s(g,f,h,p,e[i+5],12,1200080426),p=s(p,g,f,h,e[i+6],17,-1473231341),h=s(h,p,g,f,e[i+7],22,-45705983),f=s(f,h,p,g,e[i+8],7,1770035416),g=s(g,f,h,p,e[i+9],12,-1958414417),p=s(p,g,f,h,e[i+10],17,-42063),h=s(h,p,g,f,e[i+11],22,-1990404162),f=s(f,h,p,g,e[i+12],7,1804603682),g=s(g,f,h,p,e[i+13],12,-40341101),p=s(p,g,f,h,e[i+14],17,-1502002290),f=l(f,h=s(h,p,g,f,e[i+15],22,1236535329),p,g,e[i+1],5,-165796510),g=l(g,f,h,p,e[i+6],9,-1069501632),p=l(p,g,f,h,e[i+11],14,643717713),h=l(h,p,g,f,e[i],20,-373897302),f=l(f,h,p,g,e[i+5],5,-701558691),g=l(g,f,h,p,e[i+10],9,38016083),p=l(p,g,f,h,e[i+15],14,-660478335),h=l(h,p,g,f,e[i+4],20,-405537848),f=l(f,h,p,g,e[i+9],5,568446438),g=l(g,f,h,p,e[i+14],9,-1019803690),p=l(p,g,f,h,e[i+3],14,-187363961),h=l(h,p,g,f,e[i+8],20,1163531501),f=l(f,h,p,g,e[i+13],5,-1444681467),g=l(g,f,h,p,e[i+2],9,-51403784),p=l(p,g,f,h,e[i+7],14,1735328473),f=c(f,h=l(h,p,g,f,e[i+12],20,-1926607734),p,g,e[i+5],4,-378558),g=c(g,f,h,p,e[i+8],11,-2022574463),p=c(p,g,f,h,e[i+11],16,1839030562),h=c(h,p,g,f,e[i+14],23,-35309556),f=c(f,h,p,g,e[i+1],4,-1530992060),g=c(g,f,h,p,e[i+4],11,1272893353),p=c(p,g,f,h,e[i+7],16,-155497632),h=c(h,p,g,f,e[i+10],23,-1094730640),f=c(f,h,p,g,e[i+13],4,681279174),g=c(g,f,h,p,e[i],11,-358537222),p=c(p,g,f,h,e[i+3],16,-722521979),h=c(h,p,g,f,e[i+6],23,76029189),f=c(f,h,p,g,e[i+9],4,-640364487),g=c(g,f,h,p,e[i+12],11,-421815835),p=c(p,g,f,h,e[i+15],16,530742520),f=d(f,h=c(h,p,g,f,e[i+2],23,-995338651),p,g,e[i],6,-198630844),g=d(g,f,h,p,e[i+7],10,1126891415),p=d(p,g,f,h,e[i+14],15,-1416354905),h=d(h,p,g,f,e[i+5],21,-57434055),f=d(f,h,p,g,e[i+12],6,1700485571),g=d(g,f,h,p,e[i+3],10,-1894986606),p=d(p,g,f,h,e[i+10],15,-1051523),h=d(h,p,g,f,e[i+1],21,-2054922799),f=d(f,h,p,g,e[i+8],6,1873313359),g=d(g,f,h,p,e[i+15],10,-30611744),p=d(p,g,f,h,e[i+6],15,-1560198380),h=d(h,p,g,f,e[i+13],21,1309151649),f=d(f,h,p,g,e[i+4],6,-145523070),g=d(g,f,h,p,e[i+11],10,-1120210379),p=d(p,g,f,h,e[i+2],15,718787259),h=d(h,p,g,f,e[i+9],21,-343485551),f=a(f,n),h=a(h,o),p=a(p,r),g=a(g,u);return[f,h,p,g]}function f(e){var t,i="",n=32*e.length;for(t=0;t<n;t+=8)i+=String.fromCharCode(e[t>>5]>>>t%32&255);return i}function h(e){var t,i=[];for(i[(e.length>>2)-1]=void 0,t=0;t<i.length;t+=1)i[t]=0;var n=8*e.length;for(t=0;t<n;t+=8)i[t>>5]|=(255&e.charCodeAt(t/8))<<t%32;return i}function p(e){var t,i,n="";for(i=0;i<e.length;i+=1)t=e.charCodeAt(i),n+="0123456789abcdef".charAt(t>>>4&15)+"0123456789abcdef".charAt(15&t);return n}function g(e){return unescape(encodeURIComponent(e))}function m(e){return function(e){return f(u(h(e),8*e.length))}(g(e))}function v(e,t){return function(e,t){var i,n,o=h(e),a=[],r=[];for(a[15]=r[15]=void 0,o.length>16&&(o=u(o,8*e.length)),i=0;i<16;i+=1)a[i]=909522486^o[i],r[i]=1549556828^o[i];return n=u(a.concat(h(t)),512+8*t.length),f(u(r.concat(n),640))}(g(e),g(t))}function _(e,t,i){return t?i?v(t,e):p(v(t,e)):i?m(e):p(m(e))}void 0===(n=function(){return _}.call(t,i,t,e))||(e.exports=n)}()},281:function(e,t,i){"use strict";t.decode=t.parse=i(282),t.encode=t.stringify=i(283)},282:function(e,t,i){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,i,a){t=t||"&",i=i||"=";var r={};if("string"!=typeof e||0===e.length)return r;var s=/\+/g;e=e.split(t);var l=1e3;a&&"number"==typeof a.maxKeys&&(l=a.maxKeys);var c=e.length;l>0&&c>l&&(c=l);for(var d=0;d<c;++d){var u,f,h,p,g=e[d].replace(s,"%20"),m=g.indexOf(i);m>=0?(u=g.substr(0,m),f=g.substr(m+1)):(u=g,f=""),h=decodeURIComponent(u),p=decodeURIComponent(f),n(r,h)?o(r[h])?r[h].push(p):r[h]=[r[h],p]:r[h]=p}return r};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},283:function(e,t,i){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,i,s){return t=t||"&",i=i||"=",null===e&&(e=void 0),"object"==typeof e?a(r(e),(function(r){var s=encodeURIComponent(n(r))+i;return o(e[r])?a(e[r],(function(e){return s+encodeURIComponent(n(e))})).join(t):s+encodeURIComponent(n(e[r]))})).join(t):s?encodeURIComponent(n(s))+i+encodeURIComponent(n(e)):""};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function a(e,t){if(e.map)return e.map(t);for(var i=[],n=0;n<e.length;n++)i.push(t(e[n],n));return i}var r=Object.keys||function(e){var t=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.push(i);return t}},36:function(e,t,i){"use strict";var n={fn:{renderNotice:function(e,t){var i;switch(t=void 0!==t?t:{},e){case"bad_minimum":i=jQuery('<div class="give_error give-invalid-minimum give-hidden">'+this.getNotice(e,t)+"</div>");break;case"bad_maximum":i=jQuery('<div class="give_error give-invalid-maximum give-hidden">'+this.getNotice(e,t)+"</div>")}if(!t.length)return"";i.insertBefore(t.find(".give-total-wrap")).show()},getNotice:function(e,t){if(!e.length)return null;var i,n,o;if(i=n=o="",t.length)switch(e){case"bad_minimum":n=Give.fn.getGlobalVar(e),o=Give.form.fn.getMinimumAmount(t);break;case"bad_maximum":n=Give.fn.getGlobalVar(e),o=Give.form.fn.getMaximumAmount(t)}return t.length&&""!==n&&(i=n+" "+Give.fn.formatCurrency(o,{symbol:Give.form.fn.getInfo("currency_symbol",t),position:Give.form.fn.getInfo("currency_position",t)},t)),i},getAdminNoticeHTML:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{dismissible:!0},n=commonL10n.dismiss||"";return'<div class="give-notice notice notice-'.concat(t).concat(i.dismissible?" is-dismissible":"",'"><p>').concat(e).concat(i.dismissible?' <button type="button" class="notice-dismiss"><span class="screen-reader-text">'.concat(n,"</span></button>"):"","</p</div>")}}},o={init:function(){this.fn.field.formatCreditCard(jQuery("form.give-form")),this.fn.__initialize_cache(),window.addEventListener("load",(function(){Give.form.fn.__sendBackToForm()}))},fn:{isFormExist:function(){return!!document.getElementsByName("give-form-hash").length},disable:function(e,t){if(!e.length)return!1;e.find(".give-submit").prop("disabled",t)},formatAmount:function(e,t,i){return t.length?Give.fn.formatCurrency(e,i,t):e},getInfo:function(e,t){var i="";if(t=void 0!==t?t:{},!e.length||!t.length)return i;switch(e){case"gateways":i=[],jQuery.each(t.find('input[name="payment-mode"]'),(function(e,t){t=t instanceof jQuery?t:jQuery(t),i.push(t.val().trim())}));break;case"form-type":t.hasClass("give-form-type-set")?i="set":t.hasClass("give-form-type-multi")&&(i="multi");break;case"form-id":i=t.find('input[name="give-form-id"]').val();break;default:void 0!==(i=t.get(0).hasAttribute("data-"+e)?t.attr("data-"+e):t.attr(e))&&i.trim()}return i},setInfo:function(e,t,i,n){if(!i.length)return!1;switch(e=void 0===e?"data":e){case"nonce":i.find('input[name="give-form-hash"]').val(t)}if(void 0!==n&&!n.length)return!1;switch(e){case"attr":i.attr(n,t);break;default:i.data(n,t)}return!0},getGateway:function(e){var t="";return e.length?void 0!==(t=e.find('input[name="payment-mode"]:checked').val().trim())?t:"":t},getVariablePrices:function(e){var t,i=[];return e.length&&e.hasClass("give-form-type-multi")&&(t=e.find(".give-donation-levels-wrap [data-price-id] "))?(jQuery.each(t,(function(t,n){n=n instanceof jQuery?n:jQuery(n);var o=Give.form.fn.getInfo("decimal_separator",e);i.push({price_id:n.data("price-id"),amount:Give.fn.unFormatCurrency(n.val(),o)})})),i):i},getPriceID:function(e,t){var i=this.getVariablePrices(e),n=Give.fn.unFormatCurrency(e.find('input[name="give-amount"]').val(),this.getInfo("decimal_separator",e)),o=Give.fn.getCache("amount_"+n,e)?Give.fn.getCache("amount_"+n,e):-1;return t=void 0===t||t,i.length&&-1===o&&(t?(jQuery.each(i,(function(e,t){if(t.amount===n)return o=t.price_id,!1})),-1===o&&this.getMinimumAmount(e)<=n&&this.getMaximumAmount(e)>=n&&this.getMinimumAmount(e)<=n&&(o="custom")):o=jQuery('input[name="give-price-id"]',e).val()),o},getMinimumAmount:function(e){return e.find('input[name="give-form-minimum"]').val()},getMaximumAmount:function(e){return e.find('input[name="give-form-maximum"]').val()},getAmount:function(e){if(!e.length)return null;var t=e.find('input[name="give-amount"]').val();return void 0!==t&&t||(t=0),Give.fn.unFormatCurrency(t,this.getInfo("decimal_separator",e))},getNonce:function(e){if(!e.length)return"";var t=e.find('input[name="give-form-hash"]').val();return void 0!==t&&t||(t=""),t},getNonceInfo:function(e){var t={};return e.length?(t.el=e.find('input[name="give-form-hash"]'),t.el.length?(t.value=e.find('input[name="give-form-hash"]').val(),t.value=void 0!==t.value&&t.value?t.value:"",t.createdInDonorSession="1"===t.el.attr("data-donor-session"),t):t):t},resetNonce:function(e){if(!e.length||!jQuery('input[name="give-form-hash"]',e).length)return!1;Give.form.fn.disable(e,!0),jQuery.post(Give.fn.getGlobalVar("ajaxurl"),{action:"give_donation_form_nonce",give_form_id:Give.form.fn.getInfo("form-id",e)},(function(t){Give.form.fn.setInfo("nonce",t.data,e,""),Give.form.fn.disable(e,!1)}))},resetAllNonce:function(e){return!!e.length&&(Give.form.fn.disable(e,!0),new Promise((function(t,i){jQuery.post(Give.fn.getGlobalVar("ajaxurl"),{action:"give_donation_form_reset_all_nonce",give_form_id:Give.form.fn.getInfo("form-id",e)},(function(n){if(!n.success)return i(n);var o=e.find('input[name="give-form-user-register-hash"]');return Give.form.fn.setInfo("nonce",n.data.give_form_hash,e,""),o.length&&o.val(n.data.give_form_user_register_hash),Give.form.fn.disable(e,!1),jQuery(document).trigger("give_reset_all_nonce",[n.data]),t(n)})).done((function(){Give.form.fn.disable(e,!1)}))})))},autoSelectDonationLevel:function(e,t){if(!e.length||"multi"!==this.getInfo("form-type",e))return!1;switch(t=void 0===t?this.getPriceID(e,!1):t,!0){case!!e.find(".give-radio-input").length:e.find(".give-radio-input").prop("checked",!1),e.find('.give-radio-input[data-price-id="'+t+'"]').prop("checked",!0).addClass("give-default-level");break;case!!e.find("button.give-donation-level-btn").length:e.find("button.give-donation-level-btn").blur(),e.find('button.give-donation-level-btn[data-price-id="'+t+'"]').addClass("give-default-level");break;case!!e.find("select.give-select-level").length:e.find("select.give-select-level option").prop("selected",!1),e.find('select.give-select-level option[data-price-id="'+t+'"]').prop("selected",!0).addClass("give-default-level")}},autoSetMultiLevel:function(e){var t=e.parents("form"),i=e.val(),n=e.data("price-id");if(void 0===n&&(n=e.find("option:selected").data("price-id")),"custom"===n)return t.find(".give-amount-top").val("").focus(),!1;t.find(".give-amount-top").val(i),t.find("span.give-amount-top").text(i);var o=Give.form.fn.getInfo("decimal_separator",t);jQuery(".give-donation-amount .give-text-input",t).attr("data-amount",Give.fn.unFormatCurrency(t.find(".give-final-total-amount").attr("data-total"),o)),t.find(".give-donation-amount .give-text-input").trigger("blur",[t,i,n])},__sendBackToForm:function(){var e=Give.fn.getParameterByName("form-id"),t=Give.fn.getParameterByName("payment-mode");if(!e||!t)return!1;var i=jQuery("body").find("#give-form-"+e+"-wrap"),n=i.find("form.give-form"),o=i.hasClass("give-display-modal"),a=i.hasClass("give-display-button"),r=i.hasClass("give-display-reveal");n.find("#give-gateway-radio-list label").removeClass("give-gateway-option-selected"),n.find("input[name=payment-mode][value="+t+"]").prop("checked",!0).parent().addClass("give-gateway-option-selected");var s=Give.fn.getParameterByName("level-id"),l=n.find('*[data-price-id="'+s+'"]');l.length>0&&this.autoSetMultiLevel(l),jQuery(".give-form-wrap").hasClass("give-form-grid-wrap")&&1===jQuery("#give-modal-form-"+e).length?jQuery.magnificPopup.open({items:{type:"inline",src:"#give-modal-form-"+e},fixedContentPos:!0,fixedBgPos:!0,closeBtnInside:!0,midClick:!0,removalDelay:300,mainClass:"modal-fade-slide"}):o||a?give_open_form_modal(i,n):r&&(n.find(".give-btn-reveal").hide(),n.find("#give-payment-mode-select, #give_purchase_form_wrap").slideDown())},isValidDonationAmount:function(e){if(e.find('input[name="give-form-minimum"]').length<=0)return!0;var t=this.getMinimumAmount(e),i=this.getMaximumAmount(e),n=this.getAmount(e),o=this.getPriceID(e,!0);return 0!==n&&(-1<n&&n>=t&&n<=i||-1!==o)},__initialize_cache:function(){jQuery.each(jQuery(".give-form"),(function(e,t){t=t instanceof jQuery?t:jQuery(t),Give.cache["form_"+Give.form.fn.getInfo("form-id",t)]=[]}))},field:{formatCreditCard:function(e){e.each((function(e,t){var i=(t=jQuery(t)).find(".card-number"),n=t.find(".card-cvc"),o=t.find(".card-expiry");i.length&&(i.payment("formatCardNumber"),n.payment("formatCardCVC"),o.payment("formatCardExpiry"))}))}}}},a={fn:{hasSession:function(e){return!!e.length&&!!Give.fn.__getCookie(Give.fn.getGlobalVar("session_cookie_name"))},isLoggedIn:function(){return jQuery("body").hasClass("logged-in")}}},r={init:function(){var e=["form"],t=0;for(jQuery(document).trigger("give:preInit");t<e.length;)r[e[t]].init&&r[e[t]].init(),t++;jQuery(document).trigger("give:postInit")},fn:{formatCurrency:function(e,t,i){var n={symbol:"",decimal:this.getGlobalVar("decimal_separator"),thousand:this.getGlobalVar("thousands_separator"),precision:parseInt(this.getGlobalVar("number_decimals")),currency:this.getGlobalVar("currency")};if(e=e.toString().trim(),(i=void 0===i?{}:i).length&&(n={symbol:"",decimal:r.form.fn.getInfo("decimal_separator",i),thousand:r.form.fn.getInfo("thousands_separator",i),precision:r.form.fn.getInfo("number_decimals",i),currency:r.form.fn.getInfo("currency_code",i)}),(t=jQuery.extend(n,t)).precision=parseInt(t.precision),"INR"===t.currency){var o,a=accounting.formatNumber(e,{precision:n.precision,decimal:"."}),s=t.precision?".0":"",l="",c="",d="";(a=(a=accounting.unformat(a,".").toString()).toString()).indexOf(".")>0&&(s=a.substring(a.indexOf("."),a.length)),l=(a=Math.floor(a).toString()).substring(a.length-3),""!==(c=a.substring(0,a.length-3))&&(l=n.thousand+l),o=(d=c.replace(/\B(?=(\d{2})+(?!\d))/g,n.thousand)+l+s).lastIndexOf("."),e=d=d.slice(0,o)+(d.slice(o)+"000000000000").substr(0,t.precision+1),void 0!==t.symbol&&t.symbol.length&&("after"===t.position?e+=t.symbol:e=t.symbol+e)}else"after"===t.position&&(t.format="%v%s"),e=accounting.formatMoney(e,t);return e},unFormatCurrency:function(e,t){if("string"==typeof e){var i=","===t.trim()?/[^0-9\,-]+/g:/[^0-9\.-]+/g;0===(e=e.replace(i,"")).indexOf(t)?e=e.substr(1):e.length-1===e.indexOf(t)&&(e=e.slice(0,-1))}return Math.abs(parseFloat(accounting.unformat(e,t)))},getParameterByName:function(e,t){t||(t=window.location.href),e=e.replace(/[\[\]]/g,"\\$&");var i=new RegExp("[?&]"+e+"(=([^&#]*)|&|#|$)").exec(t);return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null},getGlobalVar:function(e){var t=this.getGlobal();return void 0===t[e]?"":t[e]},getGlobal:function(){return"undefined"==typeof give_global_vars?give_vars:give_global_vars},setCache:function(e,t,i){i.length?r.cache["form_"+r.form.fn.getInfo("form-id",i)][e]=t:r.cache[e]=t},getCache:function(e,t){var i,n=r.cache["form_"+r.form.fn.getInfo("form-id",t)];return i=void 0===(i=t.length?void 0!==n?n[e]:"":r.cache[e])?"":i},__getCookie:function(e){var t=("; "+document.cookie).split("; "+e+"="),i="";return 2===t.length&&(i=t.pop().split(";").shift()),i},loader:function(e){var t,i,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=(n=Object.assign({show:!0,loadingAnimation:!0,loadingText:null},n)).loadingAnimation?'<span class="is-active spinner"></span>':"",a=null!==n.loadingText?n.loadingText:r.fn.getGlobalVar("loader_translation").updating;return!1===n.show?(jQuery(".give-spinner-wrap",e).remove(),!1):(t=o.length?"give-has-spinner":"",t=(t+=a.length?" give-has-text":"").length?" "+t.trim():"",i='<div class="give-spinner-wrap'.concat(t,'"><div class="give-spinner-inner">').concat((a+o).trim(),"</div></div>"),null===n.show?i:(e.prepend(i),!0))}},cache:{}};r.notice=n,r.form=o,r.donor=a;t.a=r},43:function(e,t){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"==typeof window&&(i=window)}e.exports=i},451:function(e,t,i){ /*! * clipboard.js v2.0.4 * https://zenorocha.github.io/clipboard.js * * Licensed MIT © Zeno Rocha */ var n;n=function(){return function(e){var t={};function i(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=0)}([function(e,t,i){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),a=l(i(1)),r=l(i(3)),s=l(i(4));function l(e){return e&&e.__esModule?e:{default:e}}var c=function(e){function t(e,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);var n=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(t.__proto__||Object.getPrototypeOf(t)).call(this));return n.resolveOptions(i),n.listenClick(e),n}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),o(t,[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===n(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=(0,s.default)(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new a.default({action:this.action(t),target:this.target(t),text:this.text(t),container:this.container,trigger:t,emitter:this})}},{key:"defaultAction",value:function(e){return d("action",e)}},{key:"defaultTarget",value:function(e){var t=d("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return d("text",e)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,i=!!document.queryCommandSupported;return t.forEach((function(e){i=i&&!!document.queryCommandSupported(e)})),i}}]),t}(r.default);function d(e,t){var i="data-clipboard-"+e;if(t.hasAttribute(i))return t.getAttribute(i)}e.exports=c},function(e,t,i){"use strict";var n,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a=function(){function e(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,i,n){return i&&e(t.prototype,i),n&&e(t,n),t}}(),r=i(2),s=(n=r)&&n.__esModule?n:{default:n},l=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.resolveOptions(t),this.initSelection()}return a(e,[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action=e.action,this.container=e.container,this.emitter=e.emitter,this.target=e.target,this.text=e.text,this.trigger=e.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var e=this,t="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return e.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[t?"right":"left"]="-9999px";var i=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=i+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,s.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,s.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(e){this.emitter.emit(e?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=e,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(e){if(void 0!==e){if(!e||"object"!==(void 0===e?"undefined":o(e))||1!==e.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&e.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(e.hasAttribute("readonly")||e.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=e}},get:function(){return this._target}}]),e}();e.exports=l},function(e,t){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var i=e.hasAttribute("readonly");i||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),i||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var n=window.getSelection(),o=document.createRange();o.selectNodeContents(e),n.removeAllRanges(),n.addRange(o),t=n.toString()}return t}},function(e,t){function i(){}i.prototype={on:function(e,t,i){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:i}),this},once:function(e,t,i){var n=this;function o(){n.off(e,o),t.apply(i,arguments)}return o._=t,this.on(e,o,i)},emit:function(e){for(var t=[].slice.call(arguments,1),i=((this.e||(this.e={}))[e]||[]).slice(),n=0,o=i.length;n<o;n++)i[n].fn.apply(i[n].ctx,t);return this},off:function(e,t){var i=this.e||(this.e={}),n=i[e],o=[];if(n&&t)for(var a=0,r=n.length;a<r;a++)n[a].fn!==t&&n[a].fn._!==t&&o.push(n[a]);return o.length?i[e]=o:delete i[e],this}},e.exports=i},function(e,t,i){var n=i(5),o=i(6);e.exports=function(e,t,i){if(!e&&!t&&!i)throw new Error("Missing required arguments");if(!n.string(t))throw new TypeError("Second argument must be a String");if(!n.fn(i))throw new TypeError("Third argument must be a Function");if(n.node(e))return function(e,t,i){return e.addEventListener(t,i),{destroy:function(){e.removeEventListener(t,i)}}}(e,t,i);if(n.nodeList(e))return function(e,t,i){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,i)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,i)}))}}}(e,t,i);if(n.string(e))return function(e,t,i){return o(document.body,e,t,i)}(e,t,i);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var i=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===i||"[object HTMLCollection]"===i)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},function(e,t,i){var n=i(7);function o(e,t,i,n,o){var r=a.apply(this,arguments);return e.addEventListener(i,r,o),{destroy:function(){e.removeEventListener(i,r,o)}}}function a(e,t,i,o){return function(i){i.delegateTarget=n(i.target,t),i.delegateTarget&&o.call(e,i)}}e.exports=function(e,t,i,n,a){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof i?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return o(e,t,i,n,a)})))}},function(e,t){if("undefined"!=typeof Element&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}}])},e.exports=n()},468:function(e,t,i){i(469),e.exports=i(786)},469:function(e,t,i){},470:function(e,t){(function(){var e,t,i,n,o={}.hasOwnProperty;(n=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(e){return"OPTGROUP"===e.nodeName.toUpperCase()?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,i,n,o,a,r;for(t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:e.label,title:e.title?e.title:void 0,children:0,disabled:e.disabled,classes:e.className}),r=[],i=0,n=(a=e.childNodes).length;i<n;i++)o=a[i],r.push(this.add_option(o,t,e.disabled));return r},e.prototype.add_option=function(e,t,i){if("OPTION"===e.nodeName.toUpperCase())return""!==e.text?(null!=t&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,title:e.title?e.title:void 0,selected:e.selected,disabled:!0===i?i:e.disabled,group_array_index:t,group_label:null!=t?this.parsed[t].label:null,classes:e.className,style:e.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},e}()).select_to_array=function(e){var t,i,o,a,r;for(a=new n,i=0,o=(r=e.childNodes).length;i<o;i++)t=r[i],a.add_node(t);return a.parsed},t=function(){function e(t,i){var n,o;this.form_field=t,this.options=null!=i?i:{},this.label_click_handler=(n=this.label_click_handler,o=this,function(){return n.apply(o,arguments)}),e.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return e.prototype.set_default_values=function(){var e;return this.click_test_action=(e=this,function(t){return e.test_active_click(t)}),this.activate_action=function(e){return function(t){return e.activate_field(t)}}(this),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||e.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||e.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||e.default_no_result_text},e.prototype.choice_label=function(e){return this.include_group_label_in_selected&&null!=e.group_label?"<b class='group-name'>"+this.escape_html(e.group_label)+"</b>"+e.html:e.html},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(e){if(this.is_multiple){if(!this.active_field)return setTimeout((t=this,function(){return t.container_mousedown()}),50)}else if(!this.active_field)return this.activate_field();var t},e.prototype.input_blur=function(e){if(!this.mouse_on_container)return this.active_field=!1,setTimeout((t=this,function(){return t.blur_test()}),100);var t},e.prototype.label_click_handler=function(e){return this.is_multiple?this.container_mousedown(e):this.activate_field()},e.prototype.results_option_build=function(e){var t,i,n,o,a,r,s;for(t="",s=0,o=0,a=(r=this.results_data).length;o<a&&(n="",""!==(n=(i=r[o]).group?this.result_add_group(i):this.result_add_option(i))&&(s++,t+=n),(null!=e?e.first:void 0)&&(i.selected&&this.is_multiple?this.choice_build(i):i.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(i))),!(s>=this.max_shown_results));o++);return t},e.prototype.result_add_option=function(e){var t,i;return e.search_match&&this.include_option_in_results(e)?(t=[],e.disabled||e.selected&&this.is_multiple||t.push("active-result"),!e.disabled||e.selected&&this.is_multiple||t.push("disabled-result"),e.selected&&t.push("result-selected"),null!=e.group_array_index&&t.push("group-option"),""!==e.classes&&t.push(e.classes),(i=document.createElement("li")).className=t.join(" "),e.style&&(i.style.cssText=e.style),i.setAttribute("data-option-array-index",e.array_index),i.innerHTML=e.highlighted_html||e.html,e.title&&(i.title=e.title),this.outerHTML(i)):""},e.prototype.result_add_group=function(e){var t,i;return(e.search_match||e.group_match)&&e.active_options>0?((t=[]).push("group-result"),e.classes&&t.push(e.classes),(i=document.createElement("li")).className=t.join(" "),i.innerHTML=e.highlighted_html||this.escape_html(e.label),e.title&&(i.title=e.title),this.outerHTML(i)):""},e.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},e.prototype.reset_single_select_options=function(){var e,t,i,n,o;for(o=[],e=0,t=(i=this.results_data).length;e<t;e++)(n=i[e]).selected?o.push(n.selected=!1):o.push(void 0);return o},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.winnow_results=function(e){var t,i,n,o,a,r,s,l,c,d,u,f,h,p,g;for(this.no_results_clear(),d=0,t=(s=this.get_search_text()).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c=this.get_search_regex(t),n=0,o=(l=this.results_data).length;n<o;n++)(a=l[n]).search_match=!1,u=null,f=null,a.highlighted_html="",this.include_option_in_results(a)&&(a.group&&(a.group_match=!1,a.active_options=0),null!=a.group_array_index&&this.results_data[a.group_array_index]&&(0===(u=this.results_data[a.group_array_index]).active_options&&u.search_match&&(d+=1),u.active_options+=1),g=a.group?a.label:a.text,a.group&&!this.group_search||(f=this.search_string_match(g,c),a.search_match=null!=f,a.search_match&&!a.group&&(d+=1),a.search_match?(s.length&&(h=f.index,r=g.slice(0,h),i=g.slice(h,h+s.length),p=g.slice(h+s.length),a.highlighted_html=this.escape_html(r)+"<em>"+this.escape_html(i)+"</em>"+this.escape_html(p)),null!=u&&(u.group_match=!0)):null!=a.group_array_index&&this.results_data[a.group_array_index].search_match&&(a.search_match=!0)));return this.result_clear_highlight(),d<1&&s.length?(this.update_results_content(""),this.no_results(s)):(this.update_results_content(this.results_option_build()),(null!=e?e.skip_highlight:void 0)?void 0:this.winnow_results_set_highlight())},e.prototype.get_search_regex=function(e){var t,i;return i=this.search_contains?e:"(^|\\s|\\b)"+e+"[^\\s]*",this.enable_split_word_search||this.search_contains||(i="^"+i),t=this.case_sensitive_search?"":"i",new RegExp(i,t)},e.prototype.search_string_match=function(e,t){var i;return i=t.exec(e),!this.search_contains&&(null!=i?i[1]:void 0)&&(i.index+=1),i},e.prototype.choices_count=function(){var e,t,i;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,e=0,t=(i=this.form_field.options).length;e<t;e++)i[e].selected&&(this.selected_option_count+=1);return this.selected_option_count},e.prototype.choices_click=function(e){if(e.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()},e.prototype.keydown_checker=function(e){var t,i;switch(i=null!=(t=e.which)?t:e.keyCode,this.search_field_scale(),8!==i&&this.pending_backstroke&&this.clear_backstroke(),i){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&e.preventDefault();break;case 32:this.disable_search&&e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:e.preventDefault(),this.keydown_arrow()}},e.prototype.keyup_checker=function(e){var t,i;switch(i=null!=(t=e.which)?t:e.keyCode,this.search_field_scale(),i){case 8:this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:e.preventDefault(),this.results_showing&&this.result_select(e);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},e.prototype.clipboard_event_checker=function(e){var t;if(!this.is_disabled)return setTimeout((t=this,function(){return t.results_search()}),50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(e){return!(this.is_multiple&&!this.display_selected_options&&e.selected)&&(!(!this.display_disabled_options&&e.disabled)&&!e.empty)},e.prototype.search_results_touchstart=function(e){return this.touch_started=!0,this.search_results_mouseover(e)},e.prototype.search_results_touchmove=function(e){return this.touch_started=!1,this.search_results_mouseout(e)},e.prototype.search_results_touchend=function(e){if(this.touch_started)return this.search_results_mouseup(e)},e.prototype.outerHTML=function(e){var t;return e.outerHTML?e.outerHTML:((t=document.createElement("div")).appendChild(e),t.innerHTML)},e.prototype.get_single_html=function(){return'<a class="chosen-single chosen-default">\n <span>'+this.default_text+'</span>\n <div><b></b></div>\n</a>\n<div class="chosen-drop">\n <div class="chosen-search">\n <input class="chosen-search-input" type="text" autocomplete="off" />\n </div>\n <ul class="chosen-results"></ul>\n</div>'},e.prototype.get_multi_html=function(){return'<ul class="chosen-choices">\n <li class="search-field">\n <input class="chosen-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n </li>\n</ul>\n<div class="chosen-drop">\n <ul class="chosen-results"></ul>\n</div>'},e.prototype.get_no_results_html=function(e){return'<li class="no-results">\n '+this.results_none_found+" <span>"+this.escape_html(e)+"</span>\n</li>"},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="Select Some Options",e.default_single_text="Select an Option",e.default_no_result_text="No results match",e}(),(e=jQuery).fn.extend({chosen:function(n){return t.browser_is_supported()?this.each((function(t){var o,a;a=(o=e(this)).data("chosen"),"destroy"!==n?a instanceof i||o.data("chosen",new i(this,n)):a instanceof i&&a.destroy()})):this}}),i=function(t){function i(){return i.__super__.constructor.apply(this,arguments)}return function(e,t){for(var i in t)o.call(t,i)&&(e[i]=t[i]);function n(){this.constructor=e}n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype}(i,t),i.prototype.setup=function(){return this.form_field_jq=e(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},i.prototype.set_up_html=function(){var t,i;return(t=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&t.push(this.form_field.className),this.is_rtl&&t.push("chosen-rtl"),i={class:t.join(" "),title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=e("<div />",i),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},i.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var e;return this.container.on("touchstart.chosen",(e=this,function(t){e.container_mousedown(t)})),this.container.on("touchend.chosen",function(e){return function(t){e.container_mouseup(t)}}(this)),this.container.on("mousedown.chosen",function(e){return function(t){e.container_mousedown(t)}}(this)),this.container.on("mouseup.chosen",function(e){return function(t){e.container_mouseup(t)}}(this)),this.container.on("mouseenter.chosen",function(e){return function(t){e.mouse_enter(t)}}(this)),this.container.on("mouseleave.chosen",function(e){return function(t){e.mouse_leave(t)}}(this)),this.search_results.on("mouseup.chosen",function(e){return function(t){e.search_results_mouseup(t)}}(this)),this.search_results.on("mouseover.chosen",function(e){return function(t){e.search_results_mouseover(t)}}(this)),this.search_results.on("mouseout.chosen",function(e){return function(t){e.search_results_mouseout(t)}}(this)),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",function(e){return function(t){e.search_results_mousewheel(t)}}(this)),this.search_results.on("touchstart.chosen",function(e){return function(t){e.search_results_touchstart(t)}}(this)),this.search_results.on("touchmove.chosen",function(e){return function(t){e.search_results_touchmove(t)}}(this)),this.search_results.on("touchend.chosen",function(e){return function(t){e.search_results_touchend(t)}}(this)),this.form_field_jq.on("chosen:updated.chosen",function(e){return function(t){e.results_update_field(t)}}(this)),this.form_field_jq.on("chosen:activate.chosen",function(e){return function(t){e.activate_field(t)}}(this)),this.form_field_jq.on("chosen:open.chosen",function(e){return function(t){e.container_mousedown(t)}}(this)),this.form_field_jq.on("chosen:close.chosen",function(e){return function(t){e.close_field(t)}}(this)),this.search_field.on("blur.chosen",function(e){return function(t){e.input_blur(t)}}(this)),this.search_field.on("keyup.chosen",function(e){return function(t){e.keyup_checker(t)}}(this)),this.search_field.on("keydown.chosen",function(e){return function(t){e.keydown_checker(t)}}(this)),this.search_field.on("focus.chosen",function(e){return function(t){e.input_focus(t)}}(this)),this.search_field.on("cut.chosen",function(e){return function(t){e.clipboard_event_checker(t)}}(this)),this.search_field.on("paste.chosen",function(e){return function(t){e.clipboard_event_checker(t)}}(this)),this.is_multiple?this.search_choices.on("click.chosen",function(e){return function(t){e.choices_click(t)}}(this)):this.container.on("click.chosen",(function(e){e.preventDefault()}))},i.prototype.destroy=function(){return e(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},i.prototype.container_mousedown=function(t){var i;if(!this.is_disabled)return!t||"mousedown"!==(i=t.type)&&"touchstart"!==i||this.results_showing||t.preventDefault(),null!=t&&e(t.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!t||e(t.target)[0]!==this.selected_item[0]&&!e(t.target).parents("a.chosen-single").length||(t.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),e(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},i.prototype.container_mouseup=function(e){if("ABBR"===e.target.nodeName&&!this.is_disabled)return this.results_reset(e)},i.prototype.search_results_mousewheel=function(e){var t;if(e.originalEvent&&(t=e.originalEvent.deltaY||-e.originalEvent.wheelDelta||e.originalEvent.detail),null!=t)return e.preventDefault(),"DOMMouseScroll"===e.type&&(t*=40),this.search_results.scrollTop(t+this.search_results.scrollTop())},i.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return e(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},i.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(t){var i;return(i=e(t.target).closest(".chosen-container")).length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=n.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(e){var t,i,n,o,a;if(e.length){if(this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClass("highlighted"),o=(n=parseInt(this.search_results.css("maxHeight"),10))+(a=this.search_results.scrollTop()),(t=(i=this.result_highlight.position().top+this.search_results.scrollTop())+this.result_highlight.outerHeight())>=o)return this.search_results.scrollTop(t-n>0?t-n:0);if(i<a)return this.search_results.scrollTop(i)}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},i.prototype.update_results_content=function(e){return this.search_results.html(e)},i.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},i.prototype.set_tab_index=function(e){var t;if(this.form_field.tabIndex)return t=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=t},i.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=e("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.on("click.chosen",this.label_click_handler)},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(t){var i;if((i=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first()).length)return this.result_highlight=i,this.result_select(t),this.search_field.focus()},i.prototype.search_results_mouseover=function(t){var i;if(i=e(t.target).hasClass("active-result")?e(t.target):e(t.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(t){if(e(t.target).hasClass("active-result")||e(t.target).parents(".active-result").first())return this.result_clear_highlight()},i.prototype.choice_build=function(t){var i,n,o;return i=e("<li />",{class:"search-choice"}).html("<span>"+this.choice_label(t)+"</span>"),t.disabled?i.addClass("search-choice-disabled"):((n=e("<a />",{class:"search-choice-close","data-option-array-index":t.array_index})).on("click.chosen",(o=this,function(e){return o.choice_destroy_link_click(e)})),i.append(n)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(t){if(t.preventDefault(),t.stopPropagation(),!this.is_disabled)return this.choice_destroy(e(t.target))},i.prototype.choice_destroy=function(e){if(this.result_deselect(e[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),e.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(e){var t,i;if(this.result_highlight)return t=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?t.removeClass("active-result"):this.reset_single_select_options(),t.addClass("result-selected"),(i=this.results_data[t[0].getAttribute("data-option-array-index")]).selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(this.choice_label(i)),this.is_multiple&&(!this.hide_results_on_select||e.metaKey||e.ctrlKey)?e.metaKey||e.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[i.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,e.preventDefault(),this.search_field_scale())},i.prototype.single_set_selected_text=function(e){return null==e&&(e=this.default_text),e===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(e)},i.prototype.result_deselect=function(e){var t;return t=this.results_data[e],!this.form_field.options[t.options_index].disabled&&(t.selected=!1,this.form_field.options[t.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[t.options_index].value}),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_field_value=function(){return this.search_field.val()},i.prototype.get_search_text=function(){return e.trim(this.get_search_field_value())},i.prototype.escape_html=function(t){return e("<div/>").text(t).html()},i.prototype.winnow_results_set_highlight=function(){var e,t;if(null!=(e=(t=this.is_multiple?[]:this.search_results.find(".result-selected.active-result")).length?t.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(e)},i.prototype.no_results=function(e){var t;return t=this.get_no_results_html(e),this.search_results.append(t),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var e;return this.results_showing&&this.result_highlight?(e=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(e):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var e;return this.results_showing||this.is_multiple?this.result_highlight?(e=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(e.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var e;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(e=this.search_container.siblings("li.search-choice").last()).length&&!e.hasClass("search-choice-disabled")?(this.pending_backstroke=e,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.search_field_scale=function(){var t,i,n,o,a,r,s;if(this.is_multiple){for(a={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},i=0,n=(r=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;i<n;i++)a[o=r[i]]=this.search_field.css(o);return(t=e("<div />").css(a)).text(this.get_search_field_value()),e("body").append(t),s=t.width()+25,t.remove(),this.container.is(":visible")&&(s=Math.min(this.container.outerWidth()-10,s)),this.search_field.width(s)}},i.prototype.trigger_form_field_change=function(e){return this.form_field_jq.trigger("input",e),this.form_field_jq.trigger("change",e)},i}(t)}).call(this)},471:function(e,t){!function(e){e.color={},e.color.make=function(t,i,n,o){var a={};return a.r=t||0,a.g=i||0,a.b=n||0,a.a=null!=o?o:1,a.add=function(e,t){for(var i=0;i<e.length;++i)a[e.charAt(i)]+=t;return a.normalize()},a.scale=function(e,t){for(var i=0;i<e.length;++i)a[e.charAt(i)]*=t;return a.normalize()},a.toString=function(){return a.a>=1?"rgb("+[a.r,a.g,a.b].join(",")+")":"rgba("+[a.r,a.g,a.b,a.a].join(",")+")"},a.normalize=function(){function e(e,t,i){return t<e?e:t>i?i:t}return a.r=e(0,parseInt(a.r),255),a.g=e(0,parseInt(a.g),255),a.b=e(0,parseInt(a.b),255),a.a=e(0,a.a,1),a},a.clone=function(){return e.color.make(a.r,a.b,a.g,a.a)},a.normalize()},e.color.extract=function(t,i){var n;do{if(""!=(n=t.css(i).toLowerCase())&&"transparent"!=n)break;t=t.parent()}while(t.length&&!e.nodeName(t.get(0),"body"));return"rgba(0, 0, 0, 0)"==n&&(n="transparent"),e.color.parse(n)},e.color.parse=function(i){var n,o=e.color.make;if(n=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(i))return o(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10));if(n=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(i))return o(parseInt(n[1],10),parseInt(n[2],10),parseInt(n[3],10),parseFloat(n[4]));if(n=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(i))return o(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]));if(n=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(i))return o(2.55*parseFloat(n[1]),2.55*parseFloat(n[2]),2.55*parseFloat(n[3]),parseFloat(n[4]));if(n=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(i))return o(parseInt(n[1],16),parseInt(n[2],16),parseInt(n[3],16));if(n=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(i))return o(parseInt(n[1]+n[1],16),parseInt(n[2]+n[2],16),parseInt(n[3]+n[3],16));var a=e.trim(i).toLowerCase();return"transparent"==a?o(255,255,255,0):o((n=t[a]||[0,0,0])[0],n[1],n[2])};var t={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}}(jQuery),function(e){var t=Object.prototype.hasOwnProperty;function i(t,i){var n=i.children("."+t)[0];if(null==n&&((n=document.createElement("canvas")).className=t,e(n).css({direction:"ltr",position:"absolute",left:0,top:0}).appendTo(i),!n.getContext)){if(!window.G_vmlCanvasManager)throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode.");n=window.G_vmlCanvasManager.initElement(n)}this.element=n;var o=this.context=n.getContext("2d"),a=window.devicePixelRatio||1,r=o.webkitBackingStorePixelRatio||o.mozBackingStorePixelRatio||o.msBackingStorePixelRatio||o.oBackingStorePixelRatio||o.backingStorePixelRatio||1;this.pixelRatio=a/r,this.resize(i.width(),i.height()),this.textContainer=null,this.text={},this._textCache={}}function n(t,n,o,a){var r=[],s={colors:["#edc240","#afd8f8","#cb4b4b","#4da74d","#9440ed"],legend:{show:!0,noColumns:1,labelFormatter:null,labelBoxBorderColor:"#ccc",container:null,position:"ne",margin:5,backgroundColor:null,backgroundOpacity:.85,sorted:null},xaxis:{show:null,position:"bottom",mode:null,font:null,color:null,tickColor:null,transform:null,inverseTransform:null,min:null,max:null,autoscaleMargin:null,ticks:null,tickFormatter:null,labelWidth:null,labelHeight:null,reserveSpace:null,tickLength:null,alignTicksWithAxis:null,tickDecimals:null,tickSize:null,minTickSize:null},yaxis:{autoscaleMargin:.02,position:"left"},xaxes:[],yaxes:[],series:{points:{show:!1,radius:3,lineWidth:2,fill:!0,fillColor:"#ffffff",symbol:"circle"},lines:{lineWidth:2,fill:!1,fillColor:null,steps:!1},bars:{show:!1,lineWidth:2,barWidth:1,fill:!0,fillColor:null,align:"left",horizontal:!1,zero:!0},shadowSize:3,highlightColor:null},grid:{show:!0,aboveData:!1,color:"#545454",backgroundColor:null,borderColor:null,tickColor:null,margin:0,labelMargin:5,axisMargin:8,borderWidth:2,minBorderMargin:null,markings:null,markingsColor:"#f4f4f4",markingsLineWidth:2,clickable:!1,hoverable:!1,autoHighlight:!0,mouseActiveRadius:10},interaction:{redrawOverlayInterval:1e3/60},hooks:{}},l=null,c=null,d=null,u=null,f=null,h=[],p=[],g={left:0,right:0,top:0,bottom:0},m=0,v=0,_={processOptions:[],processRawData:[],processDatapoints:[],processOffset:[],drawBackground:[],drawSeries:[],draw:[],bindEvents:[],drawOverlay:[],shutdown:[]},b=this;function y(e,t){t=[b].concat(t);for(var i=0;i<e.length;++i)e[i].apply(this,t)}function x(t){r=function(t){for(var i=[],n=0;n<t.length;++n){var o=e.extend(!0,{},s.series);null!=t[n].data?(o.data=t[n].data,delete t[n].data,e.extend(!0,o,t[n]),t[n].data=o.data):o.data=t[n],i.push(o)}return i}(t),function(){var t,i=r.length,n=-1;for(t=0;t<r.length;++t){var o=r[t].color;null!=o&&(i--,"number"==typeof o&&o>n&&(n=o))}i<=n&&(i=n+1);var a,l=[],c=s.colors,d=c.length,u=0;for(t=0;t<i;t++)a=e.color.parse(c[t%d]||"#666"),t%d==0&&t&&(u=u>=0?u<.5?-u-.2:0:-u),l[t]=a.scale("rgb",1+u);var f,g=0;for(t=0;t<r.length;++t){if(null==(f=r[t]).color?(f.color=l[g].toString(),++g):"number"==typeof f.color&&(f.color=l[f.color].toString()),null==f.lines.show){var m,v=!0;for(m in f)if(f[m]&&f[m].show){v=!1;break}v&&(f.lines.show=!0)}null==f.lines.zero&&(f.lines.zero=!!f.lines.fill),f.xaxis=j(h,w(f,"x")),f.yaxis=j(p,w(f,"y"))}}(),function(){var t,i,n,o,a,s,l,c,d,u,f,h,p=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,m=Number.MAX_VALUE;function v(e,t,i){t<e.datamin&&t!=-m&&(e.datamin=t),i>e.datamax&&i!=m&&(e.datamax=i)}for(e.each(k(),(function(e,t){t.datamin=p,t.datamax=g,t.used=!1})),t=0;t<r.length;++t)(a=r[t]).datapoints={points:[]},y(_.processRawData,[a,a.data,a.datapoints]);for(t=0;t<r.length;++t){if(a=r[t],f=a.data,!(h=a.datapoints.format)){if((h=[]).push({x:!0,number:!0,required:!0}),h.push({y:!0,number:!0,required:!0}),a.bars.show||a.lines.show&&a.lines.fill){var b=!!(a.bars.show&&a.bars.zero||a.lines.show&&a.lines.zero);h.push({y:!0,number:!0,required:!1,defaultValue:0,autoscale:b}),a.bars.horizontal&&(delete h[h.length-1].y,h[h.length-1].x=!0)}a.datapoints.format=h}if(null==a.datapoints.pointsize){a.datapoints.pointsize=h.length,l=a.datapoints.pointsize,s=a.datapoints.points;var x=a.lines.show&&a.lines.steps;for(a.xaxis.used=a.yaxis.used=!0,i=n=0;i<f.length;++i,n+=l){var w=null==(u=f[i]);if(!w)for(o=0;o<l;++o)c=u[o],(d=h[o])&&(d.number&&null!=c&&(c=+c,isNaN(c)?c=null:c==1/0?c=m:c==-1/0&&(c=-m)),null==c&&(d.required&&(w=!0),null!=d.defaultValue&&(c=d.defaultValue))),s[n+o]=c;if(w)for(o=0;o<l;++o)null!=(c=s[n+o])&&!1!==(d=h[o]).autoscale&&(d.x&&v(a.xaxis,c,c),d.y&&v(a.yaxis,c,c)),s[n+o]=null;else if(x&&n>0&&null!=s[n-l]&&s[n-l]!=s[n]&&s[n-l+1]!=s[n+1]){for(o=0;o<l;++o)s[n+l+o]=s[n+o];s[n+1]=s[n-l+1],n+=l}}}}for(t=0;t<r.length;++t)a=r[t],y(_.processDatapoints,[a,a.datapoints]);for(t=0;t<r.length;++t){a=r[t],s=a.datapoints.points,l=a.datapoints.pointsize,h=a.datapoints.format;var C=p,j=p,S=g,G=g;for(i=0;i<s.length;i+=l)if(null!=s[i])for(o=0;o<l;++o)c=s[i+o],(d=h[o])&&!1!==d.autoscale&&c!=m&&c!=-m&&(d.x&&(c<C&&(C=c),c>S&&(S=c)),d.y&&(c<j&&(j=c),c>G&&(G=c)));if(a.bars.show){var T;switch(a.bars.align){case"left":T=0;break;case"right":T=-a.bars.barWidth;break;default:T=-a.bars.barWidth/2}a.bars.horizontal?(j+=T,G+=T+a.bars.barWidth):(C+=T,S+=T+a.bars.barWidth)}v(a.xaxis,C,S),v(a.yaxis,j,G)}e.each(k(),(function(e,t){t.datamin==p&&(t.datamin=null),t.datamax==g&&(t.datamax=null)}))}()}function w(e,t){var i=e[t+"axis"];return"object"==typeof i&&(i=i.n),"number"!=typeof i&&(i=1),i}function k(){return e.grep(h.concat(p),(function(e){return e}))}function C(e){var t,i,n={};for(t=0;t<h.length;++t)(i=h[t])&&i.used&&(n["x"+i.n]=i.c2p(e.left));for(t=0;t<p.length;++t)(i=p[t])&&i.used&&(n["y"+i.n]=i.c2p(e.top));return void 0!==n.x1&&(n.x=n.x1),void 0!==n.y1&&(n.y=n.y1),n}function j(t,i){return t[i-1]||(t[i-1]={n:i,direction:t==h?"x":"y",options:e.extend(!0,{},t==h?s.xaxis:s.yaxis)}),t[i-1]}function S(){Q&&clearTimeout(Q),d.unbind("mousemove",D),d.unbind("mouseleave",W),d.unbind("click",N),y(_.shutdown,[d])}function G(t){var i=t.labelWidth,n=t.labelHeight,o=t.options.position,a="x"===t.direction,r=t.options.tickLength,c=s.grid.axisMargin,d=s.grid.labelMargin,u=!0,f=!0,m=!0,v=!1;e.each(a?h:p,(function(e,i){i&&(i.show||i.reserveSpace)&&(i===t?v=!0:i.options.position===o&&(v?f=!1:u=!1),v||(m=!1))})),f&&(c=0),null==r&&(r=m?"full":5),isNaN(+r)||(d+=+r),a?(n+=d,"bottom"==o?(g.bottom+=n+c,t.box={top:l.height-g.bottom,height:n}):(t.box={top:g.top+c,height:n},g.top+=n+c)):(i+=d,"left"==o?(t.box={left:g.left+c,width:i},g.left+=i+c):(g.right+=i+c,t.box={left:l.width-g.right,width:i})),t.position=o,t.tickLength=r,t.box.padding=d,t.innermost=u}function T(){var i,n=k(),o=s.grid.show;for(var a in g){var c=s.grid.margin||0;g[a]="number"==typeof c?c:c[a]||0}for(var a in y(_.processOffset,[g]),g)"object"==typeof s.grid.borderWidth?g[a]+=o?s.grid.borderWidth[a]:0:g[a]+=o?s.grid.borderWidth:0;if(e.each(n,(function(e,t){var i=t.options;t.show=null==i.show?t.used:i.show,t.reserveSpace=null==i.reserveSpace?t.show:i.reserveSpace,function(e){var t=e.options,i=+(null!=t.min?t.min:e.datamin),n=+(null!=t.max?t.max:e.datamax),o=n-i;if(0==o){var a=0==n?1:.01;null==t.min&&(i-=a),null!=t.max&&null==t.min||(n+=a)}else{var r=t.autoscaleMargin;null!=r&&(null==t.min&&(i-=o*r)<0&&null!=e.datamin&&e.datamin>=0&&(i=0),null==t.max&&(n+=o*r)>0&&null!=e.datamax&&e.datamax<=0&&(n=0))}e.min=i,e.max=n}(t)})),o){var d=e.grep(n,(function(e){return e.show||e.reserveSpace}));for(e.each(d,(function(t,i){!function(t){var i,n=t.options;i="number"==typeof n.ticks&&n.ticks>0?n.ticks:.3*Math.sqrt("x"==t.direction?l.width:l.height);var o=(t.max-t.min)/i,a=-Math.floor(Math.log(o)/Math.LN10),r=n.tickDecimals;null!=r&&a>r&&(a=r);var s,c=Math.pow(10,-a),d=o/c;d<1.5?s=1:d<3?(s=2,d>2.25&&(null==r||a+1<=r)&&(s=2.5,++a)):s=d<7.5?5:10;s*=c,null!=n.minTickSize&&s<n.minTickSize&&(s=n.minTickSize);if(t.delta=o,t.tickDecimals=Math.max(0,null!=r?r:a),t.tickSize=n.tickSize||s,"time"==n.mode&&!t.tickGenerator)throw new Error("Time mode requires the flot.time plugin.");t.tickGenerator||(t.tickGenerator=function(e){var t,i,n,o=[],a=(i=e.min,(n=e.tickSize)*Math.floor(i/n)),r=0,s=Number.NaN;do{t=s,s=a+r*e.tickSize,o.push(s),++r}while(s<e.max&&s!=t);return o},t.tickFormatter=function(e,t){var i=t.tickDecimals?Math.pow(10,t.tickDecimals):1,n=""+Math.round(e*i)/i;if(null!=t.tickDecimals){var o=n.indexOf("."),a=-1==o?0:n.length-o-1;if(a<t.tickDecimals)return(a?n:n+".")+(""+i).substr(1,t.tickDecimals-a)}return n});e.isFunction(n.tickFormatter)&&(t.tickFormatter=function(e,t){return""+n.tickFormatter(e,t)});if(null!=n.alignTicksWithAxis){var u=("x"==t.direction?h:p)[n.alignTicksWithAxis-1];if(u&&u.used&&u!=t){var f=t.tickGenerator(t);if(f.length>0&&(null==n.min&&(t.min=Math.min(t.min,f[0])),null==n.max&&f.length>1&&(t.max=Math.max(t.max,f[f.length-1]))),t.tickGenerator=function(e){var t,i,n=[];for(i=0;i<u.ticks.length;++i)t=(u.ticks[i].v-u.min)/(u.max-u.min),t=e.min+t*(e.max-e.min),n.push(t);return n},!t.mode&&null==n.tickDecimals){var g=Math.max(0,1-Math.floor(Math.log(t.delta)/Math.LN10)),m=t.tickGenerator(t);m.length>1&&/\..*0$/.test((m[1]-m[0]).toFixed(g))||(t.tickDecimals=g)}}}}(i),function(t){var i,n,o=t.options.ticks,a=[];null==o||"number"==typeof o&&o>0?a=t.tickGenerator(t):o&&(a=e.isFunction(o)?o(t):o);for(t.ticks=[],i=0;i<a.length;++i){var r=null,s=a[i];"object"==typeof s?(n=+s[0],s.length>1&&(r=s[1])):n=+s,null==r&&(r=t.tickFormatter(n,t)),isNaN(n)||t.ticks.push({v:n,label:r})}}(i),function(e,t){e.options.autoscaleMargin&&t.length>0&&(null==e.options.min&&(e.min=Math.min(e.min,t[0].v)),null==e.options.max&&t.length>1&&(e.max=Math.max(e.max,t[t.length-1].v)))}(i,i.ticks),function(e){for(var t=e.options,i=e.ticks||[],n=t.labelWidth||0,o=t.labelHeight||0,a=n||("x"==e.direction?Math.floor(l.width/(i.length||1)):null),r=e.direction+"Axis "+e.direction+e.n+"Axis",s="flot-"+e.direction+"-axis flot-"+e.direction+e.n+"-axis "+r,c=t.font||"flot-tick-label tickLabel",d=0;d<i.length;++d){var u=i[d];if(u.label){var f=l.getTextInfo(s,u.label,c,null,a);n=Math.max(n,f.width),o=Math.max(o,f.height)}}e.labelWidth=t.labelWidth||n,e.labelHeight=t.labelHeight||o}(i)})),i=d.length-1;i>=0;--i)G(d[i]);!function(){var t,i=s.grid.minBorderMargin;if(null==i)for(i=0,t=0;t<r.length;++t)i=Math.max(i,2*(r[t].points.radius+r[t].points.lineWidth/2));var n={left:i,right:i,top:i,bottom:i};e.each(k(),(function(e,t){t.reserveSpace&&t.ticks&&t.ticks.length&&("x"===t.direction?(n.left=Math.max(n.left,t.labelWidth/2),n.right=Math.max(n.right,t.labelWidth/2)):(n.bottom=Math.max(n.bottom,t.labelHeight/2),n.top=Math.max(n.top,t.labelHeight/2)))})),g.left=Math.ceil(Math.max(n.left,g.left)),g.right=Math.ceil(Math.max(n.right,g.right)),g.top=Math.ceil(Math.max(n.top,g.top)),g.bottom=Math.ceil(Math.max(n.bottom,g.bottom))}(),e.each(d,(function(e,t){!function(e){"x"==e.direction?(e.box.left=g.left-e.labelWidth/2,e.box.width=l.width-g.left-g.right+e.labelWidth):(e.box.top=g.top-e.labelHeight/2,e.box.height=l.height-g.bottom-g.top+e.labelHeight)}(t)}))}m=l.width-g.left-g.right,v=l.height-g.bottom-g.top,e.each(n,(function(e,t){!function(e){function t(e){return e}var i,n,o=e.options.transform||t,a=e.options.inverseTransform;"x"==e.direction?(i=e.scale=m/Math.abs(o(e.max)-o(e.min)),n=Math.min(o(e.max),o(e.min))):(i=-(i=e.scale=v/Math.abs(o(e.max)-o(e.min))),n=Math.max(o(e.max),o(e.min))),e.p2c=o==t?function(e){return(e-n)*i}:function(e){return(o(e)-n)*i},e.c2p=a?function(e){return a(n+e/i)}:function(e){return n+e/i}}(t)})),o&&e.each(k(),(function(e,t){var i,n,o,a,r,s=t.box,c=t.direction+"Axis "+t.direction+t.n+"Axis",d="flot-"+t.direction+"-axis flot-"+t.direction+t.n+"-axis "+c,u=t.options.font||"flot-tick-label tickLabel";if(l.removeText(d),t.show&&0!=t.ticks.length)for(var f=0;f<t.ticks.length;++f)!(i=t.ticks[f]).label||i.v<t.min||i.v>t.max||("x"==t.direction?(a="center",n=g.left+t.p2c(i.v),"bottom"==t.position?o=s.top+s.padding:(o=s.top+s.height-s.padding,r="bottom")):(r="middle",o=g.top+t.p2c(i.v),"left"==t.position?(n=s.left+s.width-s.padding,a="right"):n=s.left+s.padding),l.addText(d,n,o,i.label,u,null,null,a,r))})),function(){null!=s.legend.container?e(s.legend.container).html(""):t.find(".legend").remove();if(!s.legend.show)return;for(var i,n,o=[],a=[],l=!1,c=s.legend.labelFormatter,d=0;d<r.length;++d)(i=r[d]).label&&(n=c?c(i.label,i):i.label)&&a.push({label:n,color:i.color});if(s.legend.sorted)if(e.isFunction(s.legend.sorted))a.sort(s.legend.sorted);else if("reverse"==s.legend.sorted)a.reverse();else{var u="descending"!=s.legend.sorted;a.sort((function(e,t){return e.label==t.label?0:e.label<t.label!=u?1:-1}))}for(d=0;d<a.length;++d){var f=a[d];d%s.legend.noColumns==0&&(l&&o.push("</tr>"),o.push("<tr>"),l=!0),o.push('<td class="legendColorBox"><div style="border:1px solid '+s.legend.labelBoxBorderColor+';padding:1px"><div style="width:4px;height:0;border:5px solid '+f.color+';overflow:hidden"></div></div></td><td class="legendLabel">'+f.label+"</td>")}l&&o.push("</tr>");if(0==o.length)return;var h='<table style="font-size:smaller;color:'+s.grid.color+'">'+o.join("")+"</table>";if(null!=s.legend.container)e(s.legend.container).html(h);else{var p="",m=s.legend.position,v=s.legend.margin;null==v[0]&&(v=[v,v]),"n"==m.charAt(0)?p+="top:"+(v[1]+g.top)+"px;":"s"==m.charAt(0)&&(p+="bottom:"+(v[1]+g.bottom)+"px;"),"e"==m.charAt(1)?p+="right:"+(v[0]+g.right)+"px;":"w"==m.charAt(1)&&(p+="left:"+(v[0]+g.left)+"px;");var _=e('<div class="legend">'+h.replace('style="','style="position:absolute;'+p+";")+"</div>").appendTo(t);if(0!=s.legend.backgroundOpacity){var b=s.legend.backgroundColor;null==b&&((b=(b=s.grid.backgroundColor)&&"string"==typeof b?e.color.parse(b):e.color.extract(_,"background-color")).a=1,b=b.toString());var y=_.children();e('<div style="position:absolute;width:'+y.width()+"px;height:"+y.height()+"px;"+p+"background-color:"+b+';"> </div>').prependTo(_).css("opacity",s.legend.backgroundOpacity)}}}()}function M(){l.clear(),y(_.drawBackground,[u]);var e=s.grid;e.show&&e.backgroundColor&&(u.save(),u.translate(g.left,g.top),u.fillStyle=Y(s.grid.backgroundColor,v,0,"rgba(255, 255, 255, 0)"),u.fillRect(0,0,m,v),u.restore()),e.show&&!e.aboveData&&A();for(var t=0;t<r.length;++t)y(_.drawSeries,[u,r[t]]),E(r[t]);y(_.draw,[u]),e.show&&e.aboveData&&A(),l.render(),L()}function I(e,t){for(var i,n,o,a,r=k(),s=0;s<r.length;++s)if((i=r[s]).direction==t&&(e[a=t+i.n+"axis"]||1!=i.n||(a=t+"axis"),e[a])){n=e[a].from,o=e[a].to;break}if(e[a]||(i="x"==t?h[0]:p[0],n=e[t+"1"],o=e[t+"2"]),null!=n&&null!=o&&n>o){var l=n;n=o,o=l}return{from:n,to:o,axis:i}}function A(){var t,i,n,o;u.save(),u.translate(g.left,g.top);var a=s.grid.markings;if(a)for(e.isFunction(a)&&((i=b.getAxes()).xmin=i.xaxis.min,i.xmax=i.xaxis.max,i.ymin=i.yaxis.min,i.ymax=i.yaxis.max,a=a(i)),t=0;t<a.length;++t){var r=a[t],l=I(r,"x"),c=I(r,"y");if(null==l.from&&(l.from=l.axis.min),null==l.to&&(l.to=l.axis.max),null==c.from&&(c.from=c.axis.min),null==c.to&&(c.to=c.axis.max),!(l.to<l.axis.min||l.from>l.axis.max||c.to<c.axis.min||c.from>c.axis.max)){l.from=Math.max(l.from,l.axis.min),l.to=Math.min(l.to,l.axis.max),c.from=Math.max(c.from,c.axis.min),c.to=Math.min(c.to,c.axis.max);var d=l.from===l.to,f=c.from===c.to;if(!d||!f)if(l.from=Math.floor(l.axis.p2c(l.from)),l.to=Math.floor(l.axis.p2c(l.to)),c.from=Math.floor(c.axis.p2c(c.from)),c.to=Math.floor(c.axis.p2c(c.to)),d||f){var h=r.lineWidth||s.grid.markingsLineWidth,p=h%2?.5:0;u.beginPath(),u.strokeStyle=r.color||s.grid.markingsColor,u.lineWidth=h,d?(u.moveTo(l.to+p,c.from),u.lineTo(l.to+p,c.to)):(u.moveTo(l.from,c.to+p),u.lineTo(l.to,c.to+p)),u.stroke()}else u.fillStyle=r.color||s.grid.markingsColor,u.fillRect(l.from,c.to,l.to-l.from,c.from-c.to)}}i=k(),n=s.grid.borderWidth;for(var _=0;_<i.length;++_){var y,x,w,C,j=i[_],S=j.box,G=j.tickLength;if(j.show&&0!=j.ticks.length){for(u.lineWidth=1,"x"==j.direction?(y=0,x="full"==G?"top"==j.position?0:v:S.top-g.top+("top"==j.position?S.height:0)):(x=0,y="full"==G?"left"==j.position?0:m:S.left-g.left+("left"==j.position?S.width:0)),j.innermost||(u.strokeStyle=j.options.color,u.beginPath(),w=C=0,"x"==j.direction?w=m+1:C=v+1,1==u.lineWidth&&("x"==j.direction?x=Math.floor(x)+.5:y=Math.floor(y)+.5),u.moveTo(y,x),u.lineTo(y+w,x+C),u.stroke()),u.strokeStyle=j.options.tickColor,u.beginPath(),t=0;t<j.ticks.length;++t){var T=j.ticks[t].v;w=C=0,isNaN(T)||T<j.min||T>j.max||"full"==G&&("object"==typeof n&&n[j.position]>0||n>0)&&(T==j.min||T==j.max)||("x"==j.direction?(y=j.p2c(T),C="full"==G?-v:G,"top"==j.position&&(C=-C)):(x=j.p2c(T),w="full"==G?-m:G,"left"==j.position&&(w=-w)),1==u.lineWidth&&("x"==j.direction?y=Math.floor(y)+.5:x=Math.floor(x)+.5),u.moveTo(y,x),u.lineTo(y+w,x+C))}u.stroke()}}n&&(o=s.grid.borderColor,"object"==typeof n||"object"==typeof o?("object"!=typeof n&&(n={top:n,right:n,bottom:n,left:n}),"object"!=typeof o&&(o={top:o,right:o,bottom:o,left:o}),n.top>0&&(u.strokeStyle=o.top,u.lineWidth=n.top,u.beginPath(),u.moveTo(0-n.left,0-n.top/2),u.lineTo(m,0-n.top/2),u.stroke()),n.right>0&&(u.strokeStyle=o.right,u.lineWidth=n.right,u.beginPath(),u.moveTo(m+n.right/2,0-n.top),u.lineTo(m+n.right/2,v),u.stroke()),n.bottom>0&&(u.strokeStyle=o.bottom,u.lineWidth=n.bottom,u.beginPath(),u.moveTo(m+n.right,v+n.bottom/2),u.lineTo(0,v+n.bottom/2),u.stroke()),n.left>0&&(u.strokeStyle=o.left,u.lineWidth=n.left,u.beginPath(),u.moveTo(0-n.left/2,v+n.bottom),u.lineTo(0-n.left/2,0),u.stroke())):(u.lineWidth=n,u.strokeStyle=s.grid.borderColor,u.strokeRect(-n/2,-n/2,m+n,v+n))),u.restore()}function E(e){e.lines.show&&function(e){function t(e,t,i,n,o){var a=e.points,r=e.pointsize,s=null,l=null;u.beginPath();for(var c=r;c<a.length;c+=r){var d=a[c-r],f=a[c-r+1],h=a[c],p=a[c+1];if(null!=d&&null!=h){if(f<=p&&f<o.min){if(p<o.min)continue;d=(o.min-f)/(p-f)*(h-d)+d,f=o.min}else if(p<=f&&p<o.min){if(f<o.min)continue;h=(o.min-f)/(p-f)*(h-d)+d,p=o.min}if(f>=p&&f>o.max){if(p>o.max)continue;d=(o.max-f)/(p-f)*(h-d)+d,f=o.max}else if(p>=f&&p>o.max){if(f>o.max)continue;h=(o.max-f)/(p-f)*(h-d)+d,p=o.max}if(d<=h&&d<n.min){if(h<n.min)continue;f=(n.min-d)/(h-d)*(p-f)+f,d=n.min}else if(h<=d&&h<n.min){if(d<n.min)continue;p=(n.min-d)/(h-d)*(p-f)+f,h=n.min}if(d>=h&&d>n.max){if(h>n.max)continue;f=(n.max-d)/(h-d)*(p-f)+f,d=n.max}else if(h>=d&&h>n.max){if(d>n.max)continue;p=(n.max-d)/(h-d)*(p-f)+f,h=n.max}d==s&&f==l||u.moveTo(n.p2c(d)+t,o.p2c(f)+i),s=h,l=p,u.lineTo(n.p2c(h)+t,o.p2c(p)+i)}}u.stroke()}u.save(),u.translate(g.left,g.top),u.lineJoin="round";var i=e.lines.lineWidth,n=e.shadowSize;if(i>0&&n>0){u.lineWidth=n,u.strokeStyle="rgba(0,0,0,0.1)";var o=Math.PI/18;t(e.datapoints,Math.sin(o)*(i/2+n/2),Math.cos(o)*(i/2+n/2),e.xaxis,e.yaxis),u.lineWidth=n/2,t(e.datapoints,Math.sin(o)*(i/2+n/4),Math.cos(o)*(i/2+n/4),e.xaxis,e.yaxis)}u.lineWidth=i,u.strokeStyle=e.color;var a=O(e.lines,e.color,0,v);a&&(u.fillStyle=a,function(e,t,i){for(var n=e.points,o=e.pointsize,a=Math.min(Math.max(0,i.min),i.max),r=0,s=!1,l=1,c=0,d=0;!(o>0&&r>n.length+o);){var f=n[(r+=o)-o],h=n[r-o+l],p=n[r],g=n[r+l];if(s){if(o>0&&null!=f&&null==p){d=r,o=-o,l=2;continue}if(o<0&&r==c+o){u.fill(),s=!1,l=1,r=c=d+(o=-o);continue}}if(null!=f&&null!=p){if(f<=p&&f<t.min){if(p<t.min)continue;h=(t.min-f)/(p-f)*(g-h)+h,f=t.min}else if(p<=f&&p<t.min){if(f<t.min)continue;g=(t.min-f)/(p-f)*(g-h)+h,p=t.min}if(f>=p&&f>t.max){if(p>t.max)continue;h=(t.max-f)/(p-f)*(g-h)+h,f=t.max}else if(p>=f&&p>t.max){if(f>t.max)continue;g=(t.max-f)/(p-f)*(g-h)+h,p=t.max}if(s||(u.beginPath(),u.moveTo(t.p2c(f),i.p2c(a)),s=!0),h>=i.max&&g>=i.max)u.lineTo(t.p2c(f),i.p2c(i.max)),u.lineTo(t.p2c(p),i.p2c(i.max));else if(h<=i.min&&g<=i.min)u.lineTo(t.p2c(f),i.p2c(i.min)),u.lineTo(t.p2c(p),i.p2c(i.min));else{var m=f,v=p;h<=g&&h<i.min&&g>=i.min?(f=(i.min-h)/(g-h)*(p-f)+f,h=i.min):g<=h&&g<i.min&&h>=i.min&&(p=(i.min-h)/(g-h)*(p-f)+f,g=i.min),h>=g&&h>i.max&&g<=i.max?(f=(i.max-h)/(g-h)*(p-f)+f,h=i.max):g>=h&&g>i.max&&h<=i.max&&(p=(i.max-h)/(g-h)*(p-f)+f,g=i.max),f!=m&&u.lineTo(t.p2c(m),i.p2c(h)),u.lineTo(t.p2c(f),i.p2c(h)),u.lineTo(t.p2c(p),i.p2c(g)),p!=v&&(u.lineTo(t.p2c(p),i.p2c(g)),u.lineTo(t.p2c(v),i.p2c(g)))}}}}(e.datapoints,e.xaxis,e.yaxis));i>0&&t(e.datapoints,0,0,e.xaxis,e.yaxis);u.restore()}(e),e.bars.show&&function(e){var t;switch(u.save(),u.translate(g.left,g.top),u.lineWidth=e.bars.lineWidth,u.strokeStyle=e.color,e.bars.align){case"left":t=0;break;case"right":t=-e.bars.barWidth;break;default:t=-e.bars.barWidth/2}var i=e.bars.fill?function(t,i){return O(e.bars,e.color,t,i)}:null;(function(t,i,n,o,a,r){for(var s=t.points,l=t.pointsize,c=0;c<s.length;c+=l)null!=s[c]&&P(s[c],s[c+1],s[c+2],i,n,o,a,r,u,e.bars.horizontal,e.bars.lineWidth)})(e.datapoints,t,t+e.bars.barWidth,i,e.xaxis,e.yaxis),u.restore()}(e),e.points.show&&function(e){function t(e,t,i,n,o,a,r,s){for(var l=e.points,c=e.pointsize,d=0;d<l.length;d+=c){var f=l[d],h=l[d+1];null==f||f<a.min||f>a.max||h<r.min||h>r.max||(u.beginPath(),f=a.p2c(f),h=r.p2c(h)+n,"circle"==s?u.arc(f,h,t,0,o?Math.PI:2*Math.PI,!1):s(u,f,h,t,o),u.closePath(),i&&(u.fillStyle=i,u.fill()),u.stroke())}}u.save(),u.translate(g.left,g.top);var i=e.points.lineWidth,n=e.shadowSize,o=e.points.radius,a=e.points.symbol;0==i&&(i=1e-4);if(i>0&&n>0){var r=n/2;u.lineWidth=r,u.strokeStyle="rgba(0,0,0,0.1)",t(e.datapoints,o,null,r+r/2,!0,e.xaxis,e.yaxis,a),u.strokeStyle="rgba(0,0,0,0.2)",t(e.datapoints,o,null,r/2,!0,e.xaxis,e.yaxis,a)}u.lineWidth=i,u.strokeStyle=e.color,t(e.datapoints,o,O(e.points,e.color),0,!1,e.xaxis,e.yaxis,a),u.restore()}(e)}function P(e,t,i,n,o,a,r,s,l,c,d){var u,f,h,p,g,m,v,_,b;c?(_=m=v=!0,g=!1,p=t+n,h=t+o,(f=e)<(u=i)&&(b=f,f=u,u=b,g=!0,m=!1)):(g=m=v=!0,_=!1,u=e+n,f=e+o,(p=t)<(h=i)&&(b=p,p=h,h=b,_=!0,v=!1)),f<r.min||u>r.max||p<s.min||h>s.max||(u<r.min&&(u=r.min,g=!1),f>r.max&&(f=r.max,m=!1),h<s.min&&(h=s.min,_=!1),p>s.max&&(p=s.max,v=!1),u=r.p2c(u),h=s.p2c(h),f=r.p2c(f),p=s.p2c(p),a&&(l.fillStyle=a(h,p),l.fillRect(u,p,f-u,h-p)),d>0&&(g||m||v||_)&&(l.beginPath(),l.moveTo(u,h),g?l.lineTo(u,p):l.moveTo(u,p),v?l.lineTo(f,p):l.moveTo(f,p),m?l.lineTo(f,h):l.moveTo(f,h),_?l.lineTo(u,h):l.moveTo(u,h),l.stroke()))}function O(t,i,n,o){var a=t.fill;if(!a)return null;if(t.fillColor)return Y(t.fillColor,n,o,i);var r=e.color.parse(i);return r.a="number"==typeof a?a:.4,r.normalize(),r.toString()}b.setData=x,b.setupGrid=T,b.draw=M,b.getPlaceholder=function(){return t},b.getCanvas=function(){return l.element},b.getPlotOffset=function(){return g},b.width=function(){return m},b.height=function(){return v},b.offset=function(){var e=d.offset();return e.left+=g.left,e.top+=g.top,e},b.getData=function(){return r},b.getAxes=function(){var t={};return e.each(h.concat(p),(function(e,i){i&&(t[i.direction+(1!=i.n?i.n:"")+"axis"]=i)})),t},b.getXAxes=function(){return h},b.getYAxes=function(){return p},b.c2p=C,b.p2c=function(e){var t,i,n,o={};for(t=0;t<h.length;++t)if((i=h[t])&&i.used&&(n="x"+i.n,null==e[n]&&1==i.n&&(n="x"),null!=e[n])){o.left=i.p2c(e[n]);break}for(t=0;t<p.length;++t)if((i=p[t])&&i.used&&(n="y"+i.n,null==e[n]&&1==i.n&&(n="y"),null!=e[n])){o.top=i.p2c(e[n]);break}return o},b.getOptions=function(){return s},b.highlight=F,b.unhighlight=B,b.triggerRedrawOverlay=L,b.pointOffset=function(e){return{left:parseInt(h[w(e,"x")-1].p2c(+e.x)+g.left,10),top:parseInt(p[w(e,"y")-1].p2c(+e.y)+g.top,10)}},b.shutdown=S,b.destroy=function(){S(),t.removeData("plot").empty(),r=[],s=null,l=null,c=null,d=null,u=null,f=null,h=[],p=[],_=null,z=[],b=null},b.resize=function(){var e=t.width(),i=t.height();l.resize(e,i),c.resize(e,i)},b.hooks=_,function(){for(var t={Canvas:i},n=0;n<a.length;++n){var o=a[n];o.init(b,t),o.options&&e.extend(!0,s,o.options)}}(),function(i){e.extend(!0,s,i),i&&i.colors&&(s.colors=i.colors);null==s.xaxis.color&&(s.xaxis.color=e.color.parse(s.grid.color).scale("a",.22).toString());null==s.yaxis.color&&(s.yaxis.color=e.color.parse(s.grid.color).scale("a",.22).toString());null==s.xaxis.tickColor&&(s.xaxis.tickColor=s.grid.tickColor||s.xaxis.color);null==s.yaxis.tickColor&&(s.yaxis.tickColor=s.grid.tickColor||s.yaxis.color);null==s.grid.borderColor&&(s.grid.borderColor=s.grid.color);null==s.grid.tickColor&&(s.grid.tickColor=e.color.parse(s.grid.color).scale("a",.22).toString());var n,o,a,r=t.css("font-size"),l=r?+r.replace("px",""):13,c={style:t.css("font-style"),size:Math.round(.8*l),variant:t.css("font-variant"),weight:t.css("font-weight"),family:t.css("font-family")};for(a=s.xaxes.length||1,n=0;n<a;++n)(o=s.xaxes[n])&&!o.tickColor&&(o.tickColor=o.color),o=e.extend(!0,{},s.xaxis,o),s.xaxes[n]=o,o.font&&(o.font=e.extend({},c,o.font),o.font.color||(o.font.color=o.color),o.font.lineHeight||(o.font.lineHeight=Math.round(1.15*o.font.size)));for(a=s.yaxes.length||1,n=0;n<a;++n)(o=s.yaxes[n])&&!o.tickColor&&(o.tickColor=o.color),o=e.extend(!0,{},s.yaxis,o),s.yaxes[n]=o,o.font&&(o.font=e.extend({},c,o.font),o.font.color||(o.font.color=o.color),o.font.lineHeight||(o.font.lineHeight=Math.round(1.15*o.font.size)));s.xaxis.noTicks&&null==s.xaxis.ticks&&(s.xaxis.ticks=s.xaxis.noTicks);s.yaxis.noTicks&&null==s.yaxis.ticks&&(s.yaxis.ticks=s.yaxis.noTicks);s.x2axis&&(s.xaxes[1]=e.extend(!0,{},s.xaxis,s.x2axis),s.xaxes[1].position="top",null==s.x2axis.min&&(s.xaxes[1].min=null),null==s.x2axis.max&&(s.xaxes[1].max=null));s.y2axis&&(s.yaxes[1]=e.extend(!0,{},s.yaxis,s.y2axis),s.yaxes[1].position="right",null==s.y2axis.min&&(s.yaxes[1].min=null),null==s.y2axis.max&&(s.yaxes[1].max=null));s.grid.coloredAreas&&(s.grid.markings=s.grid.coloredAreas);s.grid.coloredAreasColor&&(s.grid.markingsColor=s.grid.coloredAreasColor);s.lines&&e.extend(!0,s.series.lines,s.lines);s.points&&e.extend(!0,s.series.points,s.points);s.bars&&e.extend(!0,s.series.bars,s.bars);null!=s.shadowSize&&(s.series.shadowSize=s.shadowSize);null!=s.highlightColor&&(s.series.highlightColor=s.highlightColor);for(n=0;n<s.xaxes.length;++n)j(h,n+1).options=s.xaxes[n];for(n=0;n<s.yaxes.length;++n)j(p,n+1).options=s.yaxes[n];for(var d in _)s.hooks[d]&&s.hooks[d].length&&(_[d]=_[d].concat(s.hooks[d]));y(_.processOptions,[s])}(o),function(){t.css("padding",0).children().filter((function(){return!e(this).hasClass("flot-overlay")&&!e(this).hasClass("flot-base")})).remove(),"static"==t.css("position")&&t.css("position","relative");l=new i("flot-base",t),c=new i("flot-overlay",t),u=l.context,f=c.context,d=e(c.element).unbind();var n=t.data("plot");n&&(n.shutdown(),c.clear());t.data("plot",b)}(),x(n),T(),M(),function(){s.grid.hoverable&&(d.mousemove(D),d.bind("mouseleave",W));s.grid.clickable&&d.click(N);y(_.bindEvents,[d])}();var z=[],Q=null;function D(e){s.grid.hoverable&&q("plothover",e,(function(e){return 0!=e.hoverable}))}function W(e){s.grid.hoverable&&q("plothover",e,(function(e){return!1}))}function N(e){q("plotclick",e,(function(e){return 0!=e.clickable}))}function q(e,i,n){var o=d.offset(),a=i.pageX-o.left-g.left,l=i.pageY-o.top-g.top,c=C({left:a,top:l});c.pageX=i.pageX,c.pageY=i.pageY;var u=function(e,t,i){var n,o,a,l=s.grid.mouseActiveRadius,c=l*l+1,d=null;for(n=r.length-1;n>=0;--n)if(i(r[n])){var u=r[n],f=u.xaxis,h=u.yaxis,p=u.datapoints.points,g=f.c2p(e),m=h.c2p(t),v=l/f.scale,_=l/h.scale;if(a=u.datapoints.pointsize,f.options.inverseTransform&&(v=Number.MAX_VALUE),h.options.inverseTransform&&(_=Number.MAX_VALUE),u.lines.show||u.points.show)for(o=0;o<p.length;o+=a){var b=p[o],y=p[o+1];if(null!=b&&!(b-g>v||b-g<-v||y-m>_||y-m<-_)){var x=Math.abs(f.p2c(b)-e),w=Math.abs(h.p2c(y)-t),k=x*x+w*w;k<c&&(c=k,d=[n,o/a])}}if(u.bars.show&&!d){var C,j;switch(u.bars.align){case"left":C=0;break;case"right":C=-u.bars.barWidth;break;default:C=-u.bars.barWidth/2}for(j=C+u.bars.barWidth,o=0;o<p.length;o+=a){b=p[o],y=p[o+1];var S=p[o+2];null!=b&&((r[n].bars.horizontal?g<=Math.max(S,b)&&g>=Math.min(S,b)&&m>=y+C&&m<=y+j:g>=b+C&&g<=b+j&&m>=Math.min(S,y)&&m<=Math.max(S,y))&&(d=[n,o/a]))}}}return d?(n=d[0],o=d[1],a=r[n].datapoints.pointsize,{datapoint:r[n].datapoints.points.slice(o*a,(o+1)*a),dataIndex:o,series:r[n],seriesIndex:n}):null}(a,l,n);if(u&&(u.pageX=parseInt(u.series.xaxis.p2c(u.datapoint[0])+o.left+g.left,10),u.pageY=parseInt(u.series.yaxis.p2c(u.datapoint[1])+o.top+g.top,10)),s.grid.autoHighlight){for(var f=0;f<z.length;++f){var h=z[f];h.auto!=e||u&&h.series==u.series&&h.point[0]==u.datapoint[0]&&h.point[1]==u.datapoint[1]||B(h.series,h.point)}u&&F(u.series,u.datapoint,e)}t.trigger(e,[c,u])}function L(){var e=s.interaction.redrawOverlayInterval;-1!=e?Q||(Q=setTimeout(V,e)):V()}function V(){var e,t;for(Q=null,f.save(),c.clear(),f.translate(g.left,g.top),e=0;e<z.length;++e)(t=z[e]).series.bars.show?U(t.series,t.point):R(t.series,t.point);f.restore(),y(_.drawOverlay,[f])}function F(e,t,i){if("number"==typeof e&&(e=r[e]),"number"==typeof t){var n=e.datapoints.pointsize;t=e.datapoints.points.slice(n*t,n*(t+1))}var o=H(e,t);-1==o?(z.push({series:e,point:t,auto:i}),L()):i||(z[o].auto=!1)}function B(e,t){if(null==e&&null==t)return z=[],void L();if("number"==typeof e&&(e=r[e]),"number"==typeof t){var i=e.datapoints.pointsize;t=e.datapoints.points.slice(i*t,i*(t+1))}var n=H(e,t);-1!=n&&(z.splice(n,1),L())}function H(e,t){for(var i=0;i<z.length;++i){var n=z[i];if(n.series==e&&n.point[0]==t[0]&&n.point[1]==t[1])return i}return-1}function R(t,i){var n=i[0],o=i[1],a=t.xaxis,r=t.yaxis,s="string"==typeof t.highlightColor?t.highlightColor:e.color.parse(t.color).scale("a",.5).toString();if(!(n<a.min||n>a.max||o<r.min||o>r.max)){var l=t.points.radius+t.points.lineWidth/2;f.lineWidth=l,f.strokeStyle=s;var c=1.5*l;n=a.p2c(n),o=r.p2c(o),f.beginPath(),"circle"==t.points.symbol?f.arc(n,o,c,0,2*Math.PI,!1):t.points.symbol(f,n,o,c,!1),f.closePath(),f.stroke()}}function U(t,i){var n,o="string"==typeof t.highlightColor?t.highlightColor:e.color.parse(t.color).scale("a",.5).toString(),a=o;switch(t.bars.align){case"left":n=0;break;case"right":n=-t.bars.barWidth;break;default:n=-t.bars.barWidth/2}f.lineWidth=t.bars.lineWidth,f.strokeStyle=o,P(i[0],i[1],i[2]||0,n,n+t.bars.barWidth,(function(){return a}),t.xaxis,t.yaxis,f,t.bars.horizontal,t.bars.lineWidth)}function Y(t,i,n,o){if("string"==typeof t)return t;for(var a=u.createLinearGradient(0,n,0,i),r=0,s=t.colors.length;r<s;++r){var l=t.colors[r];if("string"!=typeof l){var c=e.color.parse(o);null!=l.brightness&&(c=c.scale("rgb",l.brightness)),null!=l.opacity&&(c.a*=l.opacity),l=c.toString()}a.addColorStop(r/(s-1),l)}return a}}e.fn.detach||(e.fn.detach=function(){return this.each((function(){this.parentNode&&this.parentNode.removeChild(this)}))}),i.prototype.resize=function(e,t){if(e<=0||t<=0)throw new Error("Invalid dimensions for plot, width = "+e+", height = "+t);var i=this.element,n=this.context,o=this.pixelRatio;this.width!=e&&(i.width=e*o,i.style.width=e+"px",this.width=e),this.height!=t&&(i.height=t*o,i.style.height=t+"px",this.height=t),n.restore(),n.save(),n.scale(o,o)},i.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},i.prototype.render=function(){var e=this._textCache;for(var i in e)if(t.call(e,i)){var n=this.getTextLayer(i),o=e[i];for(var a in n.hide(),o)if(t.call(o,a)){var r=o[a];for(var s in r)if(t.call(r,s)){for(var l,c=r[s].positions,d=0;l=c[d];d++)l.active?l.rendered||(n.append(l.element),l.rendered=!0):(c.splice(d--,1),l.rendered&&l.element.detach());0==c.length&&delete r[s]}}n.show()}},i.prototype.getTextLayer=function(t){var i=this.text[t];return null==i&&(null==this.textContainer&&(this.textContainer=e("<div class='flot-text'></div>").css({position:"absolute",top:0,left:0,bottom:0,right:0,"font-size":"smaller",color:"#545454"}).insertAfter(this.element)),i=this.text[t]=e("<div></div>").addClass(t).css({position:"absolute",top:0,left:0,bottom:0,right:0}).appendTo(this.textContainer)),i},i.prototype.getTextInfo=function(t,i,n,o,a){var r,s,l,c;if(i=""+i,r="object"==typeof n?n.style+" "+n.variant+" "+n.weight+" "+n.size+"px/"+n.lineHeight+"px "+n.family:n,null==(s=this._textCache[t])&&(s=this._textCache[t]={}),null==(l=s[r])&&(l=s[r]={}),null==(c=l[i])){var d=e("<div></div>").html(i).css({position:"absolute","max-width":a,top:-9999}).appendTo(this.getTextLayer(t));"object"==typeof n?d.css({font:r,color:n.color}):"string"==typeof n&&d.addClass(n),c=l[i]={width:d.outerWidth(!0),height:d.outerHeight(!0),element:d,positions:[]},d.detach()}return c},i.prototype.addText=function(e,t,i,n,o,a,r,s,l){var c=this.getTextInfo(e,n,o,a,r),d=c.positions;"center"==s?t-=c.width/2:"right"==s&&(t-=c.width),"middle"==l?i-=c.height/2:"bottom"==l&&(i-=c.height);for(var u,f=0;u=d[f];f++)if(u.x==t&&u.y==i)return void(u.active=!0);u={active:!0,rendered:!1,element:d.length?c.element.clone():c.element,x:t,y:i},d.push(u),u.element.css({top:Math.round(i),left:Math.round(t),"text-align":s})},i.prototype.removeText=function(e,i,n,o,a,r){if(null==o){var s=this._textCache[e];if(null!=s)for(var l in s)if(t.call(s,l)){var c=s[l];for(var d in c)if(t.call(c,d))for(var u=c[d].positions,f=0;h=u[f];f++)h.active=!1}}else{var h;for(u=this.getTextInfo(e,o,a,r).positions,f=0;h=u[f];f++)h.x==i&&h.y==n&&(h.active=!1)}},e.plot=function(t,i,o){return new n(e(t),i,o,e.plot.plugins)},e.plot.version="0.8.3",e.plot.plugins=[],e.fn.plot=function(t,i){return this.each((function(){e.plot(this,t,i)}))}}(jQuery)},472:function(e,t){jQuery.plot.plugins.push({init:function(e){var t,i,n,o,a=1,r=!1,s={};function l(e,t){for(var i=new Array,n=0;n<e.length;n++)i[0]=e[n].data[0]?e[n].data[0][t]:null,i[1]=e[n].data[e[n].data.length-1]?e[n].data[e[n].data.length-1][t]:null;return i}function c(e,t){var i=e.bars.order,n=t.bars.order;return i<n?-1:i>n?1:0}function d(e,t,i){for(var n=0,a=t;a<=i;a++)n+=e[a].bars.barWidth+2*o;return n}e.hooks.processDatapoints.push((function(e,u,f){var h,p=null;if(function(e){return null!=e.bars&&e.bars.show&&null!=e.bars.order}(u)&&(function(e){e.bars.horizontal&&(r=!0)}(u),function(e){var t=r?e.getPlaceholder().innerHeight():e.getPlaceholder().innerWidth(),i=l(e.getData(),r?1:0),n=i[1]-i[0];a=n/t}(e),function(e){t=function(e){for(var t=new Array,i=[],n=0;n<e.length;n++)null!=e[n].bars.order&&e[n].bars.show&&i.indexOf(e[n].bars.order)<0&&(i.push(e[n].bars.order),t.push(e[n]));return t.sort(c)}(e.getData()),i=t.length}(e),function(e){n=void 0!==e.bars.lineWidth?e.bars.lineWidth:2,o=n*a}(u),i>=2)){var g=function(e){for(var i=0,n=0;n<t.length;++n)if(e==t[n]){i=n;break}return i+1}(u),m=(h=0,i%2!=0&&(h=t[Math.ceil(i/2)].bars.barWidth/2),h);void 0===s[u.bars.order]&&(function(e){return e<=Math.ceil(i/2)}(g)?s[u.bars.order]=-1*d(t,g-1,Math.floor(i/2)-1)-m:s[u.bars.order]=d(t,Math.ceil(i/2),g-2)+m+2*o),p=function(e,t,i){for(var n=e.pointsize,o=e.points,a=0,s=r?1:0;s<o.length;s+=n)o[s]+=i,t.data[a][3]=o[s],a++;return o}(f,u,s[u.bars.order]),f.points=p}return p}))},options:{series:{bars:{order:null}}},name:"orderBars",version:"0.2"})},473:function(e,t){!function(e){function t(e,t){return t*Math.floor(e/t)}function i(e,t,i,n){if("function"==typeof e.strftime)return e.strftime(t);var o,a=function(e,t){return t=""+(null==t?"0":t),1==(e=""+e).length?t+e:e},r=[],s=!1,l=e.getHours(),c=l<12;null==i&&(i=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]),null==n&&(n=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]),o=l>12?l-12:0==l?12:l;for(var d=0;d<t.length;++d){var u=t.charAt(d);if(s){switch(u){case"a":u=""+n[e.getDay()];break;case"b":u=""+i[e.getMonth()];break;case"d":u=a(e.getDate());break;case"e":u=a(e.getDate()," ");break;case"h":case"H":u=a(l);break;case"I":u=a(o);break;case"l":u=a(o," ");break;case"m":u=a(e.getMonth()+1);break;case"M":u=a(e.getMinutes());break;case"q":u=""+(Math.floor(e.getMonth()/3)+1);break;case"S":u=a(e.getSeconds());break;case"y":u=a(e.getFullYear()%100);break;case"Y":u=""+e.getFullYear();break;case"p":u=c?"am":"pm";break;case"P":u=c?"AM":"PM";break;case"w":u=""+e.getDay()}r.push(u),s=!1}else"%"==u?s=!0:r.push(u)}return r.join("")}function n(e){function t(e,t,i,n){e[t]=function(){return i[n].apply(i,arguments)}}var i={date:e};null!=e.strftime&&t(i,"strftime",e,"strftime"),t(i,"getTime",e,"getTime"),t(i,"setTime",e,"setTime");for(var n=["Date","Day","FullYear","Hours","Milliseconds","Minutes","Month","Seconds"],o=0;o<n.length;o++)t(i,"get"+n[o],e,"getUTC"+n[o]),t(i,"set"+n[o],e,"setUTC"+n[o]);return i}function o(e,t){if("browser"==t.timezone)return new Date(e);if(t.timezone&&"utc"!=t.timezone){if("undefined"!=typeof timezoneJS&&void 0!==timezoneJS.Date){var i=new timezoneJS.Date;return i.setTimezone(t.timezone),i.setTime(e),i}return n(new Date(e))}return n(new Date(e))}var a={second:1e3,minute:6e4,hour:36e5,day:864e5,month:2592e6,quarter:7776e6,year:525949.2*60*1e3},r=[[1,"second"],[2,"second"],[5,"second"],[10,"second"],[30,"second"],[1,"minute"],[2,"minute"],[5,"minute"],[10,"minute"],[30,"minute"],[1,"hour"],[2,"hour"],[4,"hour"],[8,"hour"],[12,"hour"],[1,"day"],[2,"day"],[3,"day"],[.25,"month"],[.5,"month"],[1,"month"],[2,"month"]],s=r.concat([[3,"month"],[6,"month"],[1,"year"]]),l=r.concat([[1,"quarter"],[2,"quarter"],[1,"year"]]);e.plot.plugins.push({init:function(n){n.hooks.processOptions.push((function(n,r){e.each(n.getAxes(),(function(e,n){var r=n.options;"time"==r.mode&&(n.tickGenerator=function(e){var i=[],n=o(e.min,r),c=0,d=r.tickSize&&"quarter"===r.tickSize[1]||r.minTickSize&&"quarter"===r.minTickSize[1]?l:s;null!=r.minTickSize&&(c="number"==typeof r.tickSize?r.tickSize:r.minTickSize[0]*a[r.minTickSize[1]]);for(var u=0;u<d.length-1&&!(e.delta<(d[u][0]*a[d[u][1]]+d[u+1][0]*a[d[u+1][1]])/2&&d[u][0]*a[d[u][1]]>=c);++u);var f=d[u][0],h=d[u][1];if("year"==h){if(null!=r.minTickSize&&"year"==r.minTickSize[1])f=Math.floor(r.minTickSize[0]);else{var p=Math.pow(10,Math.floor(Math.log(e.delta/a.year)/Math.LN10)),g=e.delta/a.year/p;f=g<1.5?1:g<3?2:g<7.5?5:10,f*=p}f<1&&(f=1)}e.tickSize=r.tickSize||[f,h];var m=e.tickSize[0];h=e.tickSize[1];var v=m*a[h];"second"==h?n.setSeconds(t(n.getSeconds(),m)):"minute"==h?n.setMinutes(t(n.getMinutes(),m)):"hour"==h?n.setHours(t(n.getHours(),m)):"month"==h?n.setMonth(t(n.getMonth(),m)):"quarter"==h?n.setMonth(3*t(n.getMonth()/3,m)):"year"==h&&n.setFullYear(t(n.getFullYear(),m)),n.setMilliseconds(0),v>=a.minute&&n.setSeconds(0),v>=a.hour&&n.setMinutes(0),v>=a.day&&n.setHours(0),v>=4*a.day&&n.setDate(1),v>=2*a.month&&n.setMonth(t(n.getMonth(),3)),v>=2*a.quarter&&n.setMonth(t(n.getMonth(),6)),v>=a.year&&n.setMonth(0);var _,b=0,y=Number.NaN;do{if(_=y,y=n.getTime(),i.push(y),"month"==h||"quarter"==h)if(m<1){n.setDate(1);var x=n.getTime();n.setMonth(n.getMonth()+("quarter"==h?3:1));var w=n.getTime();n.setTime(y+b*a.hour+(w-x)*m),b=n.getHours(),n.setHours(0)}else n.setMonth(n.getMonth()+m*("quarter"==h?3:1));else"year"==h?n.setFullYear(n.getFullYear()+m):n.setTime(y+v)}while(y<e.max&&y!=_);return i},n.tickFormatter=function(e,t){var n=o(e,t.options);if(null!=r.timeformat)return i(n,r.timeformat,r.monthNames,r.dayNames);var s=t.options.tickSize&&"quarter"==t.options.tickSize[1]||t.options.minTickSize&&"quarter"==t.options.minTickSize[1],l=t.tickSize[0]*a[t.tickSize[1]],c=t.max-t.min,d=r.twelveHourClock?" %p":"",u=r.twelveHourClock?"%I":"%H";return i(n,l<a.minute?u+":%M:%S"+d:l<a.day?c<2*a.day?u+":%M"+d:"%b %d "+u+":%M"+d:l<a.month?"%b %d":s&&l<a.quarter||!s&&l<a.year?c<a.year?"%b":"%b %Y":s&&l<a.year?c<a.year?"Q%q":"Q%q %Y":"%Y",r.monthNames,r.dayNames)})}))}))},options:{xaxis:{timezone:null,timeformat:null,twelveHourClock:!1,monthNames:null}},name:"time",version:"1.0"}),e.plot.formatDate=i,e.plot.dateGenerator=o}(jQuery)},474:function(e,t){var i={collection:{},get:function(e,t,i){return jQuery?(t=void 0!==t?t:void 0,i=!0===i,(void 0===this.collection[e]||i)&&(this.collection[e]=void 0!==t?jQuery(e,t):jQuery(e)),this.collection[e]):-1}};window.Give_Selector_Cache=i},475:function(e,t){jQuery(document).ready((function(e){e("body").on("click",".notice-dismiss",(function(t){var i=e(this).parent().parent();i.hasClass("give-notice")&&(t.preventDefault(),i.fadeTo(100,0,(function(){i.slideUp(100,(function(){i.remove()}))})))}))}))},476:function(e,t){ /*! * Give Admin Forms JS * * @description: The Give Admin Forms scripts. Only enqueued on the give_forms CPT; used to validate fields, show/hide, and other functions * @package: Give * @subpackage: Assets/JS * @copyright: Copyright (c) 2016, GiveWP * @license: http://opensource.org/licenses/gpl-2.0.php GNU Public License */ var i,n;i=jQuery,n=function(){""===i(".give-level-id").text()&&i(".cmb-repeatable-grouping").each((function(e,t){var n=i(t).data("iterator")+1;i(t).find(".give-level-id").text(n),i(t).find(".give-level-id-input").val(n)})),i("body").on("cmb2_add_row",(function(e,t){!function(e){var t,n,o,a=(t=0,n=0,o=0,i("#_give_donation_levels_repeat > .cmb-repeatable-grouping").each((function(e,a){(o=i(this).find("input.give-level-id-input").val())>n&&(n=o),t++})),void 0!==n&&n>=t?parseInt(n)+1:t);i(e).find("input.give-level-id-input").val(a),i(e).find(".give-level-id").text(a)}(t)})),i("body").on("cmb2_shift_rows_complete",(function(e,t){i(".cmb-repeatable-grouping").each((function(e,t){var n=i(t).find("input.give-level-id-input").val();i(t).find(".give-level-id").text(n)}))}))},i((function(){i("body").on("change",".give-give_default_radio_inline",(function(){i(".give-give_default_radio_inline").prop("checked",!1),i(this).prop("checked",!0)})),function(){i("._give_price_option_field input:radio").on("change",(function(){"set"===i("._give_price_option_field input:radio:checked").val()?(i("._give_set_price_field").show(),i("#_give_donation_levels_field").hide(),i("._give_display_style_field").hide()):(i("._give_set_price_field").hide(),i("#_give_donation_levels_field").show(),i("._give_display_style_field").show())})).change(),i("._give_display_content_field input:radio").on("change",(function(){"enabled"===i("._give_display_content_field input:radio:checked").val()?(i("._give_content_placement_field").show(),i("._give_form_content_field").show()):(i("._give_content_placement_field").hide(),i("._give_form_content_field").hide())})).change(),i("._give_terms_option_field input:radio").on("change",(function(){"enabled"===i("._give_terms_option_field input:radio:checked").val()?(i("._give_agree_label_field").show(),i("._give_agree_text_field").show()):(i("._give_agree_label_field").hide(),i("._give_agree_text_field").hide())})).change(),i("._give_payment_display_field input:radio").on("change",(function(){"onpage"===i("._give_payment_display_field input:radio:checked").val()?i("._give_reveal_label_field").hide():i("._give_reveal_label_field").show()})).change(),i("._give_custom_amount_field input:radio").on("change",(function(){"disabled"===i("._give_custom_amount_field input:radio:checked").val()?(i("._give_custom_amount_range_field ").hide(),i("._give_custom_amount_text_field").hide()):(i("._give_custom_amount_range_field ").show(),i("._give_custom_amount_text_field").show())})).change();var e=i("._give_goal_option_field"),t=i("._give_goal_format_field input:radio");i("._give_close_form_when_goal_achieved_field input:radio").on("change",(function(){"disabled"===i("._give_close_form_when_goal_achieved_field input:radio:checked").val()?i("._give_form_goal_achieved_message_field").hide():i("._give_form_goal_achieved_message_field").show()})).change(),e.on("change",(function(){"disabled"===i("._give_goal_option_field input:radio:checked").val()?(i("._give_set_goal_field").hide(),i("._give_goal_format_field").hide(),i("._give_goal_color_field").hide(),i("._give_close_form_when_goal_achieved_field").hide(),i("._give_form_goal_achieved_message_field").hide(),i("._give_number_of_donation_goal_field").hide(),i("._give_number_of_donor_goal_field").hide()):(i("._give_set_goal_field").show(),i("._give_goal_format_field").show(),i("._give_goal_color_field").show(),i("._give_close_form_when_goal_achieved_field").show(),"enabled"===i("._give_close_form_when_goal_achieved_field input:radio:checked").val()&&i("._give_form_goal_achieved_message_field").show(),t.change())})).change(),t.on("change",(function(){var e=i("._give_goal_format_field input:radio:checked").val(),t=i("._give_goal_option_field input:radio:checked").val();"donation"===e?(i("._give_set_goal_field, ._give_number_of_donor_goal_field,._give_number_of_donation_goal_field").hide(),"disabled"!==t&&i("._give_number_of_donation_goal_field").show()):"donors"===e?(i("._give_set_goal_field, ._give_number_of_donation_goal_field, ._give_number_of_donor_goal_field").hide(),"disabled"!==t&&i("._give_number_of_donor_goal_field").show()):("disabled"===t?i("._give_set_goal_field").hide():i("._give_set_goal_field").show(),i("._give_number_of_donation_goal_field, ._give_number_of_donor_goal_field").hide())})).change(),i("._give_customize_offline_donations_field input:radio").on("change",(function(){"enabled"===i("._give_customize_offline_donations_field input:radio:checked").val()?(i("._give_offline_checkout_notes_field").show(),i("._give_offline_donation_enable_billing_fields_single_field").show(),i("._give_offline_donation_subject_field").show(),i("._give_offline_donation_email_field").show()):(i("._give_offline_checkout_notes_field").hide(),i("._give_offline_donation_enable_billing_fields_single_field").hide(),i("._give_offline_donation_subject_field").hide(),i("._give_offline_donation_email_field").hide())})).change(),i("._give_email_options_field input:radio").on("change",(function(){"enabled"===i("._give_email_options_field input:radio:checked").val()?i("#email_notification_options .give-field-wrap:not(._give_email_options_field)").show():i("#email_notification_options .give-field-wrap:not(._give_email_options_field)").hide()})).change();var n=i('input[name="_give_name_title_prefix"]:checked').val();"required"!==n&&"optional"!==n||i(".give-title-prefixes-wrap").show(),i('input[name="_give_name_title_prefix"]').on("change",(function(){var e=i('input[name="_give_name_title_prefix"]:checked').val();"required"===e||"optional"===e?i(".give-title-prefixes-wrap").show():i(".give-title-prefixes-wrap").hide()}))}(),n(),i(".cmb2-text-money").each((function(e,t){parseInt(i(t).val())||i(t).removeAttr("value")}))}))},477:function(e,t){ /*! * Give Admin Forms JS * * @description: The Give Admin Settings scripts. Only enqueued on the give-settings page; used for tabs and other show/hide functionality * @package: Give * @since: 1.5 * @subpackage: Assets/JS * @copyright: Copyright (c) 2016, GiveWP * @license: http://opensource.org/licenses/gpl-2.0.php GNU Public License */ jQuery(document).ready((function(e){var t=jQuery("ul.give-payment-gatways-list");t.length&&t.sortable();e("body").on("change","#give-mainform #currency",(function(){var t=e("#give-mainform #currency option:selected").val(),i=JSON.parse(e(this).attr("data-formatting-setting")),n=afterText={},o=i[t],a=e("#thousands_separator","#give-mainform"),r=e("#decimal_separator","#give-mainform"),s=e("#number_decimals","#give-mainform");n=e("#give-mainform #currency_position").data("before-template").replace("{currency_pos}",o.symbol),e('#give-mainform #currency_position option[value="before"]').text(n),afterText=e("#give-mainform #currency_position").data("after-template").replace("{currency_pos}",o.symbol),e('#give-mainform #currency_position option[value="after"]').text(afterText),a.val(o.setting.thousands_separator).trigger("blur"),r.val(o.setting.decimal_separator).trigger("blur"),s.val(o.setting.number_decimals).trigger("blur")})),"disabled"!==e('input[name="name_title_prefix"]:checked').val()&&e(".give-title-prefixes-settings-wrap").show(),e('input[name="name_title_prefix"]').on("change",(function(){"disabled"!==e(this).val()?e(".give-title-prefixes-settings-wrap").show():e(".give-title-prefixes-settings-wrap").hide()})),e("a.give-repeat-setting-field").on("click",(function(t){t.preventDefault();var i=e(this).parents("td"),n=e("p:first-child",i).clone(),o=e("p",i).not(".give-field-description").length,a=e(this).data("id")+"_"+ ++o,r=e(this).prev();return e("input",r).val()&&(e(this).before(n),r=e(this).prev(),e("input",r).attr("id",a),e("input",r).val("")),!1})),e(".give-settings-page").on("click","span.give-remove-setting-field",(function(t){e(this).parents("p").remove()})),e(".give-email-notification-status","table.giveemailnotifications").on("click",(function(){var t=e(this),i=e("i",t),n=e(this).next(),o=e(this).hasClass("give-email-notification-enabled")?"disabled":"enabled",a=e(this).data("id");if(!parseInt(t.data("edit")))return e("div.give-email-notification-status-notice").remove(),e("hr.wp-header-end").after('<div class="updated error give-email-notification-status-notice"><p>'+e(this).closest(".give-email-notification-status").data("notice")+"</p></div>"),e("html, body").animate({scrollTop:e("div.give-email-notification-status-notice").position().top},"slow"),!1;e.ajax({url:ajaxurl,method:"POST",data:{action:"give_set_notification_status",status:o,notification_id:a},beforeSend:function(){t.hide(),n.addClass("is-active")},success:function(e){e.success&&(t.removeClass("give-email-notification-"+t.data("status")),t.addClass("give-email-notification-"+o),t.data("status",o),"enabled"===o?(i.removeClass("dashicons-no-alt"),i.addClass("dashicons-yes")):(i.removeClass("dashicons-yes"),i.addClass("dashicons-no-alt")),n.removeClass("is-active"),t.show())}})})),e("#give-clear-cache").on("click",(function(){e.ajax({url:ajaxurl,type:"GET",data:{action:"give_cache_flush"}}).done((function(e){e.success?new Give.modal.GiveSuccessAlert({modalContent:{title:Give.fn.getGlobalVar("flush_success"),desc:e.data.message,cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render():new Give.modal.GiveErrorAlert({modalContent:{title:Give.fn.getGlobalVar("flush_error"),desc:e.data.message,cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render()}))}));var i=Give.fn.getGlobalVar("decimal_separator"),n=Give.fn.getGlobalVar("thousands_separator"),o=/\(([^)]+)\)/,a={position:Give.fn.getGlobalVar("currency_pos"),symbol:Give.fn.getGlobalVar("currency_sign"),precision:Give.fn.getGlobalVar("number_decimals"),decimal:Give.fn.getGlobalVar("decimal_separator"),thousand:Give.fn.getGlobalVar("thousands_separator")};e("#number_decimals, #decimal_separator, #thousands_separator, #currency_position, #currency").on("input blur change",(function(t){var r=e("#currency_preview"),s=e("#decimal_separator"),l=e("#thousands_separator"),c=t.target.name,d=t.target.value;if("number_decimals"!==c||"input"!==t.type&&"blur"!==t.type||(d&&!isNaN(d)||"blur"!==t.type||(t.target.value=Give.fn.getGlobalVar("number_decimals")),a.precision=isNaN(parseInt(d))?Give.fn.getGlobalVar("number_decimals"):parseInt(d)),"decimal_separator"!==c||"input"!==t.type&&"blur"!==t.type||(d||"blur"!==t.type||(t.target.value=i),a.decimal=d,a.hasOwnProperty("thousand")&&"input"===t.type?a.decimal===a.thousand&&(a.thousand=i,l.val(i),i=d,n=l.val()):a.decimal===Give.fn.getGlobalVar("thousands_separator")&&"input"===t.type&&(a.thousand=i,l.val(i),i=d,n=l.val())),"thousands_separator"!==c||"input"!==t.type&&"blur"!==t.type||(d||"blur"!==t.type||(t.target.value=n),a.thousand=d,a.hasOwnProperty("decimal")&&"input"===t.type?a.decimal===a.thousand&&(a.decimal=n,s.val(n),n=d,i=s.val()):a.thousand===Give.fn.getGlobalVar("decimal_separator")&&"input"===t.type&&(a.decimal=n,s.val(n),n=d,i=s.val())),"currency_position"===c&&"change"===t.type&&(a.position=d),"currency"===c&&"change"===t.type){a.currency=d;var u=o.exec(t.target[t.target.selectedIndex].text);a.symbol=u[1]}r.val(Give.fn.formatCurrency("123456.12345",a,{}))}))})),document.addEventListener("DOMContentLoaded",(function(){window.location.href.split("#")[1];var e=document.querySelector(".give-settings-section-content");if(null!==e){var t=e.querySelector(".give-settings-section-group-menu"),i=Array.prototype.slice.call(e.querySelectorAll(".give-settings-section-group"));if(null!==t){var n=Array.prototype.slice.call(t.querySelectorAll("ul li a"));null!==n&&n.forEach((function(t){t.addEventListener("click",(function(t){var o=t.target.getAttribute("data-group"),a=e.querySelector("#give-settings-section-group-"+o);return n.forEach((function(e){e.classList.remove("active")})),i.map((function(e){return e.classList.add("give-hidden")})),t.target.classList.add("active"),a.classList.remove("give-hidden"),history.pushState({urlPath:t.target.getAttribute("href")},"",t.target.getAttribute("href")),t.preventDefault(),!1}))}))}}}))},478:function(e,t){ /*! * Give Admin Export JS * * @description: The Give Admin Settings scripts. Only enqueued on the give-settings and give-tools page; used for exporting CSV * @package: Give * @since: 2.1 * @subpackage: Assets/JS * @copyright: Copyright (c) 2016, GiveWP * @license: http://opensource.org/licenses/gpl-2.0.php GNU Public License */ jQuery(document).ready((function(e){function t(t){var i=void 0!==t.standard_fields&&null!==t.standard_fields?t.standard_fields:"",n=e(".give-export-donations-standard-fields ul");i.length>0&&(n.closest("tr").removeClass("give-hidden"),e(i).each((function(e,t){n.append('<li class="give-export-donation-checkbox-remove"><label for="give-give-donations-standard-field-'+t+'"><input type="checkbox" name="give_give_donations_export_option['+t+']" id="give-give-donations-standard-field-'+t+'">'+t+"</label> </li>")})));var o=void 0!==t.hidden_fields&&null!==t.hidden_fields?t.hidden_fields:"",a=e(".give-export-donations-hidden-fields ul");o&&(a.closest("tr").removeClass("give-hidden"),e(o).each((function(e,t){a.append('<li class="give-export-donation-checkbox-remove"><label for="give-give-donations-hidden-field-'+t+'"><input type="checkbox" name="give_give_donations_export_option['+t+']" id="give-give-donations-hidden-field-'+t+'">'+t+"</label> </li>")})))}e(".give-export_donations #give-export_donations-form .give_forms_categories , .give-export_donations #give-export_donations-form .give_forms_tags").change((function(){var i,n,o;i=e("form#give-export_donations-form"),n=e(i).find("tr.give-export-donation-form .give-select-chosen"),o=n.prev(),n.find('input[type="text"]'),n.hasClass("variations"),e(".give-export-donations-hide").addClass("give-hidden"),e("li.give-export-donation-checkbox-remove").remove(),e.ajax({type:"POST",url:ajaxurl,data:{action:"give_form_search",s:"",fields:e(i).serialize()},beforeSend:function(){o.closest("ul.chosen-results").empty()},success:function(a){e("option",o).remove();var r=[];a.length?(i.find(".give-export-donation-button").prop("disabled",!1),e.each(a,(function(e,t){o.prepend('<option value="'+t.id+'">'+t.name+"</option>"),r.push(t.id)})),o.prepend('<option value="0" selected>'+o.data("placeholder")+"</option>")):(o.prepend('<option value="0">'+o.data("no-form")+"</option>"),i.find(".give-export-donation-button").prop("disabled",!0)),i.find(".form_ids").val(r.join()),n.prev("select.give-select-chosen").trigger("chosen:updated"),t("")}})})),e(".give-export_donations #give-export_donations-form #give_payment_form_select").change((function(){var i;if(e(".give-export-donations-hide").addClass("give-hidden"),e("li.give-export-donation-checkbox-remove").remove(),jQuery(document).trigger("give_export_donations_form_change"),!(i=e(this).val()))return!1;e.ajax({type:"POST",url:ajaxurl,data:{form_id:i,action:"give_export_donations_get_custom_fields"},success:function(e){e?t(e):alert(Give.fn.getGlobalVar("error_message")),jQuery(document).trigger("give_export_donations_form_response",e)}})}));var i=e('.give-export-option-fields input[type="checkbox"]');function n(t){var i=e(t).val(),n=e(t).attr("data-value"),o=[n,i];i=o[0],n=o[1],e(t).attr("value",i),e(t).attr("data-value",n)}e(".give-toggle-checkbox-selection").toggle((function(){i.removeAttr("checked"),n(this)}),(function(){i.attr("checked",!0),n(this)}))}))},479:function(e,t){ /*! * Give Admin Widgets JS * * @description: The Give Admin Widget scripts. Only enqueued on the admin widgets screen; used to validate fields, show/hide, and other functions * @package: Give * @subpackage: Assets/JS * @copyright: Copyright (c) 2016, GiveWP * @license: http://opensource.org/licenses/gpl-2.0.php GNU Public License */ var i,n;i=jQuery,n=function(){i(".widget-liquid-right").on("change",".give_forms_display_style_setting_row input",(function(){var e=i(this).parents("p"),t=e.next();"onpage"===i("input:checked",e).val()?t.hide():t.show()}))},i((function(){n(),i(".give_forms_display_style_setting_row input",".widget-liquid-right").trigger("change")})),i(document).ajaxSuccess((function(e,t,o){n(),i(".give_forms_display_style_setting_row input",".widget-liquid-right").trigger("change")}))},480:function(e,t){function i(e,t){var i="",n=document.querySelector(".give-save-button");try{i=JSON.parse(t),e.value=JSON.stringify(i,void 0,2),e.style.border="none",n.removeAttribute("disabled")}catch(t){e.style.border="1px solid red",n.setAttribute("disabled","disabled")}}function n(e){null!==e&&(i(e,e.value),e.addEventListener("blur",(function(t){i(e,t.target.value)})))}window.addEventListener("DOMContentLoaded",(function(){document.querySelector(".stripe-cc-field-format-settings");var e=document.querySelectorAll('input[name="stripe_fonts"]'),t=document.getElementById("stripe_styles_base"),i=document.getElementById("stripe_styles_empty"),o=document.getElementById("stripe_styles_invalid"),a=document.getElementById("stripe_styles_complete"),r=document.getElementById("stripe_custom_fonts"),s=document.getElementById("give-payment-status"),l=document.querySelector(".give-stripe-disconnect"),c=document.querySelectorAll('input[name="stripe_checkout_type"]'),d=Array.from(document.querySelectorAll(".stripe-checkout-field"));n(t),n(i),n(o),n(a),n(r),null!==c&&c.forEach((function(e){e.addEventListener("change",(function(e){"modal"===e.target.value?d.map((function(e){return e.classList.remove("give-hidden")})):d.map((function(e){return e.classList.add("give-hidden")}))}))})),null!==l&&document.querySelector(".give-stripe-disconnect").addEventListener("click",(function(e){e.preventDefault(),new Give.modal.GiveConfirmModal({type:"alert",classes:{modalWrapper:"give-modal--warning"},modalContent:{title:Give.fn.getGlobalVar("disconnect_stripe_title"),desc:Give.fn.getGlobalVar("disconnect_stripe_message")},successConfirm:function(){window.location.href=e.target.getAttribute("href")}}).render()})),null!==s&&s.addEventListener("change",(function(e){var t=document.getElementById("give-stripe-opt-refund");null!==t&&(t.checked=!1,"refunded"===e.target.value?document.getElementById("give-stripe-opt-refund-wrap").style.display="block":document.getElementById("give-stripe-opt-refund-wrap").style.display="none")})),null!==e&&e.forEach((function(e){var t=document.querySelector(".give-stripe-google-fonts-wrap"),i=document.querySelector(".give-stripe-custom-fonts-wrap");e.addEventListener("change",(function(e){"custom_fonts"===e.target.value?(t.style.display="none",i.style.display="table-row"):"google_fonts"===e.target.value&&(t.style.display="table-row",i.style.display="none")}))}))}))},69:function(e,t){e.exports=jQuery},786:function(e,t,i){"use strict";i.r(t);i(470),i(275),i(471),i(472),i(473);var n,o=i(15),a=i.n(o);(n=jQuery).extend({giveAjaxifyFields:function(e){var t,i,o=n.extend({},{type:"",parentWrapper:"form",countryFieldName:"country",stateFieldName:"state",stateFieldWrapper:".give-field-wrap",chosenState:!0},e||{});switch(o.type){case"country_state":if(t=n('select[name="'+o.countryFieldName+'"]'),i=t.closest(o.parentWrapper),!t.length||"Country_state"===t.data("give-ajaxify-field"))return;t.data("give-ajaxify-field","country_state"),t.change((function(){var e=n(this),t=e.closest(o.parentWrapper).find('[name="'+o.stateFieldName+'"]'),r=t.closest(o.stateFieldWrapper),s=n("label",r);o.stateFieldWrapper||(s=n('label[for="'+o.stateFieldName+'"]',i),r=t.parent());var l={action:"give_get_states",country:e.val(),field_name:o.stateFieldName};n.post(ajaxurl,l,(function(e){e.show_field?(s.length&&s.text(e.states_label),o.chosenState&&t.chosen("destroy"),o.stateFieldWrapper?r.removeClass("give-hidden"):t.removeClass("give-hidden"),void 0!==a()(e.states_found)&&!0===e.states_found?(t.replaceWith(e.data),t=n('[name="'+o.stateFieldName+'"]',r),o.chosenState&&t.chosen()):(t.replaceWith('<input type="text" name="'+o.stateFieldName+'" value="'+e.default_state+'" class="medium-text"/>'),t=n('[name="'+o.stateFieldName+'"]',r))):o.stateFieldWrapper?r.addClass("give-hidden"):t.addClass("give-hidden")}))}))}return this}});i(474);var r=i(13);!function(e){e.fn.repeatable_fields=function(t){var i={wrapper:".wrapper",container:".container",row:".row",add:".add",remove:".remove",confirm_before_remove_row:!1,confirm_before_remove_row_text:"",move:".move",template:".template",is_sortable:!0,before_add:null,after_add:a,before_remove:null,after_remove:null,sortable_options:null,row_count_placeholder:"{{row-count-placeholder}}"},n=e.extend({},i,t);function o(e,t){var i=e.parents(n.row).first();"function"==typeof n.before_remove&&n.before_remove(t,i),i.remove(),"function"==typeof n.after_remove&&n.after_remove(t)}function a(t,i){var o=e(t).attr("data-rf-row-count");o++,e("*",i).each((function(){e.each(this.attributes,(function(e,t){this.value=this.value.replace(n.row_count_placeholder,o-1)}))})),e(t).attr("data-rf-row-count",o)}!function t(i){e(n.wrapper,i).each((function(i,s){var l=e(this).children(n.container);e(l).children(n.template).hide().find(":input").each((function(){e(this).prop("disabled",!0)}));var c=e(l).children(n.row).filter((function(){return!e(this).hasClass(n.template.replace(".",""))})).length;if(e(l).attr("data-rf-row-count",c),e(this).on("click",n.add,(function(i){i.stopImmediatePropagation();var o=e(e(l).children(n.template).clone().removeClass(n.template.replace(".",""))[0].outerHTML);e(o).find(":input").each((function(){e(this).prop("disabled",!1)})),"function"==typeof n.before_add&&n.before_add(l);var r=e(o).show().appendTo(l);"function"==typeof n.after_add&&n.after_add(l,r,a),t(r)})),e(this).on("click",n.remove,(function(t){t.stopImmediatePropagation();var i=e(this);return n.confirm_before_remove_row&&n.confirm_before_remove_row_text||o(i,l),new r.GiveConfirmModal({modalWrapper:"give-modal--warning",modalContent:{desc:n.confirm_before_remove_row_text},successConfirm:function(){o(i,l)}}).render(),!1})),!0===n.is_sortable&&void 0!==e.ui&&void 0!==e.ui.sortable){var d=null!==n.sortable_options?n.sortable_options:{};d.handle=n.move,e(this).find(n.container).sortable(d)}}))}(this)}}(jQuery);i(277),i(475);var s=i(36),l=(i(476),i(477),i(478),i(479),i(8)),c=i.n(l),d=i(19),u=i.n(d),f=i(21),h=i.n(f),p=i(22),g=i.n(p),m=i(16),v=i.n(m),_=i(23),b=i.n(_),y=function(){function e(t){c()(this,e),this.root=t,this.buttonText=this.root.textContent.trim(),this.iconPosition="before",this._buttonTextWithWrapper=this.root.querySelector(".give-button-text")?'<span class="give-button-text">'.concat(this.buttonText,"</span>"):this.buttonText;var i=this.root.querySelector(".dashicons");i&&(this.iconClassName=i.className)}return u()(e,[{key:"enable",value:function(){this.root.disabled=!1}},{key:"disable",value:function(){this.root.disabled=!0}},{key:"setBusyState",value:function(){this.root.innerHTML="".concat('<span class="dashicons dashicons-marker"></span>'," ").concat(this._buttonTextWithWrapper),this.disable()}},{key:"removeBusyState",value:function(){this.enable(),this.iconClassName&&this.updateIcon(this.iconClassName)}},{key:"updateIcon",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"before",i='<span class="'.concat(e,'"></span>');this.root.innerHTML="after"===t?"".concat(this._buttonTextWithWrapper," ").concat(i):"".concat(i," ").concat(this._buttonTextWithWrapper),this.iconClassName=e,this.iconPosition=t}},{key:"updateButtonText",value:function(e){this.buttonText=e,this.iconClassName?this.updateIcon(this.iconClassName,this.iconPosition):this.root.textContent=e}}]),e}(),x=i(451),w=i.n(x),k=function(e){function t(e){var i;return c()(this,t),(i=h()(this,g()(t).call(this,e))).shortcode=i.root.dataset.giveShortcode,i.clipboard=new w.a(i.root,{text:function(e){return e.dataset.giveShortcode}}),i.reset=i.reset.bind(v()(i)),i}return b()(t,e),u()(t,[{key:"init",value:function(){this.registerEventHandlers()}},{key:"registerEventHandlers",value:function(){var e=this;this.clipboard.on("success",(function(){return e.handleSuccessClick()})),this.clipboard.on("error",(function(){return e.handleErrorClick()}))}},{key:"handleSuccessClick",value:function(e){this.updateIcon("dashicons dashicons-yes"),this.root.setAttribute("aria-label",give_vars.copied),this.root.addEventListener("mouseout",this.reset)}},{key:"handleErrorClick",value:function(e){this.updateIcon("dashicons dashicons-warning"),this.root.setAttribute("aria-label","Shortcode could not be copied.")}},{key:"reset",value:function(e){this.updateIcon("dashicons dashicons-admin-page"),this.root.setAttribute("aria-label",this.shortcode),this.root.removeEventListener("mouseout",this.reset)}}]),t}(y),C=!1,j=i(278);function S(){var e=jQuery(".give-settings-page"),t=jQuery(".give-nav-tab-wrapper"),i=e.width(),n=jQuery(".give-sub-nav-tab-wrapper"),o=jQuery("nav",n),a=jQuery(".give-nav-tab-wrapper > a:not(give-not-tab)"),r=[],s=[],l=0;if(600<jQuery(window).outerWidth()&&(l=200),!e.length)return!1;t.css({height:"auto",overflow:"visible"}),a.removeClass("give-hidden"),new Promise((function(e,t){jQuery.each(a,(function(e,t){t=jQuery(t),(l+=parseInt(t.outerWidth()))<i?r.push(t):s.push(t)})),e(!0)})).then((function(e){if(s.length&&-1!==window.location.search.indexOf("&tab=")){var i={},a=function(){for(var e,t=[],i=window.location.href.slice(window.location.href.indexOf("?")+1).split("&"),n=0;n<i.length;n++)e=i[n].split("="),t[e[0]]=e[1];return t} /** * Give Admin JS * * @package: Give * @subpackage: Assets/JS * @copyright: Copyright (c) 2016, GiveWP * @license: http://opensource.org/licenses/gpl-2.0.php GNU Public License */();s=s.filter((function(e){var t=-1!==parseInt(e.attr("href").indexOf("&tab="+a.tab));return t&&(i=e),!t})),i.length&&(s.unshift(r.pop()),r.push(i))}new Promise((function(e,t){r.length&&jQuery.each(r,(function(e,t){(t=jQuery(t)).hasClass("give-hidden")&&t.removeClass("give-hidden")})),e(!0)})).then((function(e){s.length?(o.html(""),jQuery.each(s,(function(e,t){(t=jQuery(t)).hasClass("nav-tab-active")||t.addClass("give-hidden"),t.clone().removeClass().appendTo(o)})),jQuery(".give-sub-nav-tab-wrapper",t).length||t.append(n),n.show()):n.hide()}))}))}!function(e){var t=function(t,i){var n=(i=jQuery.extend({wrapper:!0,show:!1},i)).wrapper?e(".give-spinner-wrapper",t):{},o=e(".give-spinner",t);if(i.show)return n.length&&n.addClass("is-active"),void o.addClass("is-active");n.length&&n.removeClass("is-active"),o.removeClass("is-active")},i=function(e){var t=document.location.href,i=t.split("?");e=void 0===e?"":e.replace("give-","");if(i.length>=2){for(var n=i.shift(),o=i.join("?"),a=encodeURIComponent("give-message")+"=",r=o.split(/[&;]/g),s=r.length;s-- >0;)(-1!==r[s].lastIndexOf(a,0)||""!==e&&-1!==r[s].lastIndexOf("give-messages",0)&&r[s].match(e+"$"))&&r.splice(s,1);t=n+"?"+r.join("&"),window.history.pushState("",document.title,t)}return t};function n(e,t){return e=accounting.unformat(e,Give.fn.getGlobalVar("decimal_separator")).toString(),e=!1!==(t="undefined"!==t&&t)?parseFloat(e).toFixed(t):parseFloat(e).toFixed(Give.fn.getGlobalVar("currency_decimals"))}var o={init:function(){this.deleteSingleDonation(),this.resendSingleDonationReceipt()},deleteSingleDonation:function(){new r.GiveConfirmModal({triggerSelector:".delete-single-donation",modalWrapper:"give-modal--warning",modalContent:{title:Give.fn.getGlobalVar("confirm_delete_donation"),desc:Give.fn.getGlobalVar("delete_payment")},successConfirm:function(e){window.location.assign(e.el.attr("href"))}})},resendSingleDonationReceipt:function(){new r.GiveConfirmModal({triggerSelector:".resend-single-donation-receipt",modalContent:{title:Give.fn.getGlobalVar("confirm_resend"),desc:Give.fn.getGlobalVar("resend_receipt")},successConfirm:function(e){window.location.assign(e.el.attr("href"))}})}},s={init:function(){this.edit_address(),this.add_note(),this.remove_note(),this.new_donor(),this.resend_receipt(),this.variable_price_list()},edit_address:function(){e('select[name="give-payment-address[0][country]"]').change((function(){var t=e(this),i={action:"give_get_states",country:t.val(),field_name:"give-payment-address[0][state]"};return e.post(ajaxurl,i,(function(i){t.closest(".column-container").find("#give-order-address-state-wrap").removeClass("give-hidden"),t.closest(".column-container").find(".give-column").removeClass("column-full"),t.closest(".column-container").find(".give-column").addClass("column");var n=e("#give-order-address-state-wrap");n.find("*").not(".order-data-address-line").remove(),void 0!==a()(i.states_found)&&!0===i.states_found?(n.append(i.data),n.find("select").chosen()):(n.append('<input type="text" name="give-payment-address[0][state]" value="'+i.default_state+'" class="give-edit-toggles medium-text"/>'),void 0!==a()(i.show_field)&&!1===i.show_field&&(t.closest(".column-container").find("#give-order-address-state-wrap").addClass("give-hidden"),t.closest(".column-container").find(".give-column").addClass("column-full"),t.closest(".column-container").find(".give-column").removeClass("column")))})),!1}))},add_note:function(){e("#give-add-payment-note").on("click",(function(t){function i(){e.ajax({type:"POST",data:r,url:ajaxurl,beforeSend:function(){o.prop("disabled",!0),n.prop("disabled",!0)},success:function(t){e("#give-payment-notes-inner").append(t),e(".give-no-payment-notes").hide(),e("#give-payment-note").val("")}}).fail((function(e){window.console&&window.console.log&&console.log(e)})).always((function(){o.prop("disabled",!1),n.prop("disabled",!1)}))}t.preventDefault();var n=e(this),o=e("#give-payment-note"),a=e("#donation_note_type"),r={action:"give_insert_payment_note",payment_id:e(this).data("payment-id"),note:o.val(),type:a.val()};if(r.note)"donor"===r.type&&give_vars.email_notification.donor_note.status?new Give.modal.GiveConfirmModal({successConfirm:function(){i()},modalContent:{desc:give_vars.donor_note_confirm_msg}}).render():i();else{var s=o.css("border-color");o.css("border-color","red"),setTimeout((function(){o.css("border-color",s)}),500)}}))},remove_note:function(){e("body").on("click",".give-delete-payment-note",(function(t){t.preventDefault();var i=this;new r.GiveConfirmModal({modalContent:{title:Give.fn.getGlobalVar("confirm_deletion"),desc:Give.fn.getGlobalVar("delete_payment_note")},successConfirm:function(t){var n={action:"give_delete_payment_note",payment_id:e(i).data("payment-id"),note_id:e(i).data("note-id")};e.ajax({type:"POST",data:n,url:ajaxurl,success:function(t){return e("#give-payment-note-"+n.note_id).remove(),e(".give-payment-note").length||e(".give-no-payment-notes").show(),!1}}).fail((function(e){window.console&&window.console.log&&console.log(e)}))}}).render()}))},new_donor:function(){e("#give-donor-details").on("click",".give-payment-new-donor, .give-payment-new-donor-cancel",(function(t){t.preventDefault(),e(".donor-info").toggle(),e(".new-donor").toggle(),e(".new-donor").is(":visible")?e("#give-new-donor").val(1):e("#give-new-donor").val(0)}))},resend_receipt:function(){e("body").on("click","#give-resend-receipt",(function(t){var i=this;t.preventDefault(),new r.GiveConfirmModal({modalContent:{title:Give.fn.getGlobalVar("confirm_action"),desc:Give.fn.getGlobalVar("resend_receipt")},successConfirm:function(){window.location.assign(e(i).attr("href"))}}).render()}))},variable_price_list:function(){e("#give_payment_form_select").chosen().change((function(){var t,i=e(".give-donation-level");return!!(t=e(this).val())&&(!!i.length&&void e.ajax({type:"POST",url:ajaxurl,data:{form_id:t,payment_id:e('input[name="give_payment_id"]').val(),action:"give_check_for_form_price_variations_html"},success:function(t){(t=t.trim())?(i.html(t),e('select[name="give-variable-price"]').chosen().change()):i.html("")}}))})),e("#give-donation-overview").on("change",'select[name="give-variable-price"]',(function(){var t=jQuery(this).data("prices"),i=e("#give-payment-total");""!==t&&e(this).val()in t&&(i.val(t[e(this).val()]).css("background-color","yellow"),window.setTimeout((function(){i.css("background-color","white")}),1e3))}))}},l={init:function(){this.toggle_gateways(),this.setting_change_country(),this.toggle_options(),this.main_setting_update_notice(),this.verify_settings(),this.saveButtonTriggered(),this.changeAlert(),this.detectSettingsChange(),this.sequentialDonationIDPreview()},toggle_gateways:function(){e(".gateways-checkbox").on("click",(function(){var t=e(this).prev(".gateways-radio"),i=(this.checked,e(".gateways-checkbox:checked"));1===i.length?(i.prev(".gateways-radio").attr("checked","checked"),this.checked?t.removeAttr("disabled"):t.attr("disabled","disabled")):this.checked?(t.removeAttr("disabled"),t.removeAttr("checked")):t.attr("disabled","disabled")}))},setting_change_country:function(){e('select[name="base_country"]').change((function(){var t=e(this),i={action:"give_get_states",country:t.val(),field_name:"base_state"};return e.post(ajaxurl,i,(function(n){t.closest("tr").next().show(),e("#base_state_chosen").remove(),null!=a()(n.states_found)&&1==n.states_found?(e(':input[name="base_state"]').replaceWith(n.data).addClass("give-select-chosen"),e(':input[name="base_state"]').chosen()):(null!=a()(n.show_field)&&0==n.show_field&&t.closest("tr").next().hide(),e(':input[name="base_state"]').replaceWith('<input type="text" name="'+i.field_name+'" value="'+n.default_state+'" class="give-edit-toggles medium-text"/>'))})),!1}))},toggle_options:function(){e('input[name="email_access"]',".give-setting-tab-body-general").on("change",(function(){var t=e('input[name="email_access"]:checked',".give-setting-tab-body-general").val(),i=e('input[name="enable_recaptcha"]:checked',".give-setting-tab-body-general").val();"enabled"===t?(e('input[name="enable_recaptcha"]').parents("tr").show(),"enabled"===i?(e("#recaptcha_key").parents("tr").show(),e("#recaptcha_secret").parents("tr").show()):(e("#recaptcha_key").parents("tr").hide(),e("#recaptcha_secret").parents("tr").hide())):(e("#recaptcha_key").parents("tr").hide(),e("#recaptcha_secret").parents("tr").hide(),e('input[name="enable_recaptcha"]').parents("tr").hide())})).change(),e('input[name="enable_recaptcha"]',".give-setting-tab-body-general").on("change",(function(){var t=e('input[name="email_access"]:checked',".give-setting-tab-body-general").val(),i=e('input[name="enable_recaptcha"]:checked',".give-setting-tab-body-general").val();"enabled"===t&&"enabled"===i?(e("#recaptcha_key").parents("tr").show(),e("#recaptcha_secret").parents("tr").show()):(e("#recaptcha_key").parents("tr").hide(),e("#recaptcha_secret").parents("tr").hide())})).change(),e('input[name="form_featured_img"]',".give-setting-tab-body-display").on("change",(function(){"enabled"===e('input[name="form_featured_img"]:checked',".give-setting-tab-body-display").val()?e("#featured_image_size").parents("tr").show():e("#featured_image_size").parents("tr").hide()})).change(),e('input[name="terms"]',".give-setting-tab-body-display").on("change",(function(){"enabled"===e('input[name="terms"]:checked',".give-setting-tab-body-display").val()?(e("#agree_to_terms_label").parents("tr").show(),e("#wp-agreement_text-wrap").parents("tr").show()):(e("#agree_to_terms_label").parents("tr").hide(),e("#wp-agreement_text-wrap").parents("tr").hide())})).change(),e('input[name="admin_notices"]',".give-setting-tab-body-emails").on("change",(function(){"enabled"===e('input[name="admin_notices"]:checked',".give-setting-tab-body-emails").val()?(e("#donation_notification_subject").parents("tr").show(),e("#wp-donation_notification-wrap").parents("tr").show(),e("#admin_notice_emails").parents("tr").show()):(e("#donation_notification_subject").parents("tr").hide(),e("#wp-donation_notification-wrap").parents("tr").hide(),e("#admin_notice_emails").parents("tr").hide())})).change(),e('input[name="sequential-ordering_status"]',".give-setting-tab-body-general").on("change",(function(){var t=e('input[name="sequential-ordering_status"]:checked',".give-setting-tab-body-general").val(),i=e(this).closest("table");"enabled"===t?e("input",i).not('input[name="sequential-ordering_status"]').parents("tr").show():e("input",i).not('input[name="sequential-ordering_status"]').parents("tr").hide()})).change()},main_setting_update_notice:function(){var t=e("#setting-error-give-setting-updated");t.length&&window.setTimeout((function(){t.slideUp()}),5e3)},verify_settings:function(){var t=e("#success_page"),i=e("#failure_page");t.add(i).change((function(){if(t.val()===i.val()){var n='<div id="setting-error-give-matched-success-failure-page" class="updated settings-error notice is-dismissible"> <p><strong>'+Give.fn.getGlobalVar("matched_success_failure_page")+'</strong></p> <button type="button" class="notice-dismiss"><span class="screen-reader-text">'+Give.fn.getGlobalVar("dismiss_notice_text")+"</span></button> </div>",o=e("#setting-error-give-matched-success-failure-page");if(e(this).val(""),o.length)return!1;e("h1","#give-mainform").after(n),o=e("#setting-error-give-matched-success-failure-page"),e(".notice-dismiss",o).click((function(){o.remove()}))}})).change()},saveButtonTriggered:function(){e(".give-settings-setting-page").on("click",".give-save-button",(function(){e(window).unbind("beforeunload")}))},changeAlert:function(){e(window).bind("beforeunload",(function(e){var t=Give.fn.getGlobalVar("setting_not_save_message");if(C)return(e||window.event).returnValue=t,t}))},detectSettingsChange:function(){var t=e(".give-settings-setting-page");if(t.length>0){var i=e("#give-mainform").serialize();t.on("change keyup blur","form",(function(){var t=e("#give-mainform").serialize();C=i!==t}))}},sequentialDonationIDPreview:function(){var t=jQuery("#sequential-ordering_preview");t.length&&(jQuery("#sequential-ordering_number_prefix, #sequential-ordering_number, #sequential-ordering_number_padding, #sequential-ordering_number_suffix").on("keyup change",(function(){var e=jQuery("#sequential-ordering_number_prefix").val(),i=jQuery("#sequential-ordering_number").val().trim()||"1",n=jQuery("#sequential-ordering_number_padding").val().trim(),o=jQuery("#sequential-ordering_number_suffix").val(),a="".concat(e).concat(i.padStart(n,"0")).concat(o);t.val(a)})),jQuery("#sequential-ordering_number_prefix").trigger("keyup"),jQuery("#sequential-ordering_number_prefix, #sequential-ordering_number_suffix").on("blur",(function(){e(this).val(e(this).val().replace(new RegExp(" ","g"),"-"))})))}},c={init:function(){this.date_options(),this.donors_export(),this.recount_stats()},date_options:function(){e("#give-graphs-date-options").change((function(){"other"===e(this).val()?e("#give-date-range-options").show():e("#give-date-range-options").hide()}))},donors_export:function(){e("#give_donor_export_form").change((function(){var t=e(this),i=e("option:selected",t).val(),n=e("#give_customer_export_option");"0"===t.val()?n.show():n.hide();var o=e(".give_price_options_select");if(0!=parseInt(i)){var a={action:"give_check_for_form_price_variations",form_id:i,all_prices:!0};e.post(ajaxurl,a,(function(t){o.remove(),e("#give_donor_export_form_chosen").after(t)}))}else o.remove()}))},recount_stats:function(){e("body").on("change","#recount-stats-type",(function(){var t=e("#give-tools-recount-form"),i=e("option:selected",this).data("type"),n=e("#recount-stats-submit"),o=e(".tools-form-dropdown"),a=e(".tools-date-dropdown-delete-donations");if(t.find(".notice-wrap").remove(),n.removeClass("button-disabled").attr("disabled",!1),o.hide(),a.hide(),e(".give-recount-stats-descriptions span").hide(),"reset-stats"===i)t.append('<div class="notice-wrap"></div>'),t.find(".notice-wrap").html('<div class="notice notice-warning"><p><input type="checkbox" id="confirm-reset" name="confirm_reset_store" value="1" /> <label for="confirm-reset">'+Give.fn.getGlobalVar("reset_stats_warn")+"</label></p></div>"),n.addClass("button-disabled").attr("disabled","disabled");else if("delete-test-donors"===i){t.append('<div class="notice-wrap"></div>'),t.find(".notice-wrap").html('<div class="notice notice-warning"><p><input type="checkbox" id="confirm-reset" name="confirm_reset_store" value="1" /> <label for="confirm-reset">'+Give.fn.getGlobalVar("delete_test_donor")+"</label></p></div>"),n.addClass("button-disabled").attr("disabled","disabled")}else if("delete-import-donors"===i){t.append('<div class="notice-wrap"></div>'),t.find(".notice-wrap").html('<div class="notice notice-warning"><p><input type="checkbox" id="confirm-reset" name="confirm_reset_store" value="1" /> <label for="confirm-reset">'+Give.fn.getGlobalVar("delete_import_donor")+"</label></p></div>"),n.addClass("button-disabled").attr("disabled","disabled")}else if("delete-donations"===i){a.show(),t.append('<div class="notice-wrap"></div>'),t.find(".notice-wrap").html('<div class="notice notice-warning"><p><input type="checkbox" id="confirm-reset" name="confirm_reset_store" value="1" /> <label for="confirm-reset">'+Give.fn.getGlobalVar("delete_donations_only")+"</label></p></div>"),n.addClass("button-disabled").attr("disabled","disabled")}else o.hide(),o.val(0);var r=e(".tools-form-dropdown-"+i);r.show(),r.find(".give-select-chosen").css({width:"auto","min-width":"250px"}),e("#"+i).show()})),e("body").on("change","#confirm-reset",(function(){e(this).is(":checked")?e("#recount-stats-submit").removeClass("button-disabled").removeAttr("disabled"):e("#recount-stats-submit").addClass("button-disabled").attr("disabled","disabled")})),e("#give-tools-recount-form").submit((function(t){var i=e("#recount-stats-type").val(),n=e(this),o=e("option:selected",this).data("type");if("reset-stats"===o){if(e("#confirm-reset").is(":checked"))return!0;r=!0}n.find(".notice-wrap").remove(),n.append('<div class="notice-wrap"></div>');var a=n.find(".notice-wrap"),r=!1;(null!==i&&0!==i||(a.html('<div class="updated error"><p>'+Give.fn.getGlobalVar("batch_export_no_class")+"</p></div>"),r=!0),"recount-form"===o)&&(0==e('select[name="form_id"]').val()&&(a.html('<div class="updated error"><p>'+Give.fn.getGlobalVar("batch_export_no_reqs")+"</p></div>"),r=!0));if(r)return n.find(".button-disabled").removeClass("button-disabled"),!1}))}},d={init:function(){this.submit(),this.dismiss_message()},submit:function(){var t=this;e(document.body).on("submit",".give-export-form",(function(i){i.preventDefault();var n=e(this).find('input[type="submit"]');if(!n.hasClass("button-disabled")){var o=e(this).serialize();n.addClass("button-disabled"),e("form.give-export-form select").attr("disabled",!0).trigger("chosen:updated");var a=e(this);e(this).find(".add-notices").length>0&&(a=e(this).find(".add-notices")),a.find(".notice-wrap").remove(),a.append('<div class="notice-wrap give-clearfix"><span class="spinner is-active"></span><div class="give-progress"><div></div></div></div>'),t.process_step(1,o,t,this)}}))},process_step:function(t,i,n,o){C=!0;var a=!1;e.ajax({type:"POST",url:ajaxurl,data:{form:i,action:"give_do_ajax_export",step:t},dataType:"json",success:function(t){if("done"==t.step||t.error||t.success){C=!1,a=!0;var r=e(o).parent().find(".notice-wrap");r.find(".give-progress");if(e(o).find(".button-disabled").removeClass("button-disabled"),e(o).find("select").attr("disabled",!1).trigger("chosen:updated"),t.error){var s=t.message;r.html('<div class="updated error"><p>'+s+"</p></div>")}else if(t.success){var l=t.message;r.html('<div id="give-batch-success" class="updated notice is-dismissible"><p>'+l+'<span class="notice-dismiss"></span></p></div>')}else r.remove(),window.location=t.url}else e(".give-progress div").animate({width:t.percentage+"%"},50,(function(){})),n.process_step(parseInt(t.step),i,n,o);!0===a&&e("#give-tools-recount-form").length>0&&(e("#give-tools-recount-form")[0].reset(),e("#give-tools-recount-form .tools-form-dropdown").hide(),e("#give-tools-recount-form .tools-date-dropdown").hide(),e("#give-tools-recount-form .tools-form-dropdown-recount-form-select").val("0").trigger("chosen:updated"))}}).fail((function(t){C=!1,window.console&&window.console.log&&console.log(t),e(".notice-wrap").append(t.responseText)}))},dismiss_message:function(){e("body").on("click","#give-batch-success .notice-dismiss",(function(){e("#give-batch-success").parent().slideUp("fast")}))}},u={el:{},init:function(){this.submit(),this.dismiss_message()},submit:function(){var t=this;t.el.main_container=Give_Selector_Cache.get("#give-db-updates"),t.el.update_link=Give_Selector_Cache.get(".give-update-now",t.el.main_container),t.el.run_upload_container=Give_Selector_Cache.get(".give-run-database-update",t.el.progress_main_container),t.el.progress_main_container=Give_Selector_Cache.get(".progress-container",t.el.main_container),t.el.heading=Give_Selector_Cache.get(".update-message",t.el.progress_main_container),t.el.progress_container=Give_Selector_Cache.get(".progress-content",t.el.progress_main_container),t.el.update_progress_counter=Give_Selector_Cache.get(e(".give-update-progress-count")),t.el.main_container.data("resume-update")&&(t.el.update_link.addClass("active").hide().removeClass("give-hidden"),e("#give-restart-upgrades").length||(Give.fn.getGlobalVar("ajax").length||window.setTimeout(u.start_db_update,1e3),window.setTimeout(u.get_db_updates_info,1e3,t))),t.el.update_link.hasClass("active")||(t.el.update_link.on("click","",(function(e){e.preventDefault(),t.el.run_upload_container.find(".notice").remove(),t.el.run_upload_container.append('<div class="notice notice-error non-dismissible give-run-update-containt"><p> <a href="#" class="give-run-update-button button">'+Give.fn.getGlobalVar("db_update_confirmation_msg_button")+"</a> "+Give.fn.getGlobalVar("db_update_confirmation_msg")+"</p></div>")})),e("#give-db-updates").on("click","a.give-run-update-button",(function(i){return i.preventDefault(),!e(this).hasClass("active")&&(e(this).addClass("active").fadeOut(),t.el.update_link.addClass("active").fadeOut(),e("#give-db-updates .give-run-update-containt").slideUp(),t.el.progress_container.find(".notice-wrap").remove(),t.el.progress_container.append('<div class="notice-wrap give-clearfix"><span class="spinner is-active"></span><div class="give-progress"><div></div></div></div>'),t.el.progress_main_container.removeClass("give-hidden"),u.start_db_update(),window.setTimeout(u.get_db_updates_info,500,t),!1)})))},start_db_update:function(){e.ajax({type:"POST",url:ajaxurl,data:{action:"give_run_db_updates",run_db_update:1,nonce:Give.fn.getGlobalVar("db_update_nonce")},dataType:"json",success:function(e){}}).always((function(){Give.fn.getGlobalVar("ajax").length||window.setTimeout(u.start_db_update,1e3)}))},get_db_updates_info:function(t){e.ajax({type:"POST",url:ajaxurl,data:{action:"give_db_updates_info"},dataType:"json",success:function(i){var n=Give_Selector_Cache.get(".notice-wrap",t.el.progress_container,!0);-1!==e.inArray("success",Object.keys(i))?i.success?(t.el.update_progress_counter.length&&t.el.update_progress_counter.text("100%"),-1!==e.inArray("heading",Object.keys(i.data))&&t.el.heading.html("<strong>"+i.data.heading+"</strong>"),t.el.update_link.closest("p").remove(),n.html('<div class="notice notice-success is-dismissible"><p>'+i.data.message+'</p><button type="button" class="notice-dismiss"></button></div>')):(-1!==e.inArray("heading",Object.keys(i.data))&&t.el.heading.html("<strong>"+i.data.heading+"</strong>"),i.data.message?(t.el.update_link.closest("p").remove(),n.html('<div class="notice notice-error is-dismissible"><p>'+i.data.message+'</p><button type="button" class="notice-dismiss"></button></div>')):setTimeout((function(){t.el.update_link.removeClass("active").show(),t.el.progress_main_container.addClass("give-hidden")}),1e3)):i&&-1!==e.inArray("percentage",Object.keys(i.data))?(t.el.update_progress_counter.length&&t.el.update_progress_counter.text(i.data.total_percentage+"%"),-1!==e.inArray("heading",Object.keys(i.data))&&t.el.heading.html("<strong>"+i.data.heading+"</strong>"),e(".give-progress div","#give-db-updates").animate({width:i.data.percentage+"%"},50,(function(){})),window.setTimeout(u.get_db_updates_info,1e3,t)):(n.html('<div class="notice notice-error"><p>'+Give.fn.getGlobal().updates.ajax_error+"</p></div>"),setTimeout((function(){t.el.update_link.removeClass("active").show(),t.el.progress_main_container.addClass("give-hidden")}),1e3))}})},process_step:function(t,i,n){C=!0,e.ajax({type:"POST",url:ajaxurl,data:{action:"give_do_ajax_updates",step:parseInt(t),update:parseInt(i)},dataType:"json",success:function(t){C=!1;var i=Give_Selector_Cache.get(".notice-wrap",n.el.progress_container,!0);-1!==e.inArray("success",Object.keys(t))?t.success?(-1!==e.inArray("heading",Object.keys(t.data))&&n.el.heading.html("<strong>"+t.data.heading+"</strong>"),n.el.update_link.closest("p").remove(),i.html('<div class="notice notice-success is-dismissible"><p>'+t.data.message+'</p><button type="button" class="notice-dismiss"></button></div>')):(-1!==e.inArray("heading",Object.keys(t.data))&&n.el.heading.html("<strong>"+t.data.heading+"</strong>"),i.html('<div class="notice notice-error"><p>'+t.data.message+"</p></div>"),setTimeout((function(){n.el.update_link.removeClass("active").show(),n.el.progress_main_container.addClass("give-hidden")}),5e3)):t&&-1!==e.inArray("percentage",Object.keys(t.data))?(e(".give-progress div","#give-db-updates").animate({width:t.data.percentage+"%"},50,(function(){})),-1!==e.inArray("heading",Object.keys(t.data))&&n.el.heading.html("<strong>"+t.data.heading.replace("{update_count}",n.el.heading.data("update-count"))+"</strong>"),n.process_step(parseInt(t.data.step),t.data.update,n)):(i.html('<div class="notice notice-error"><p>'+Give.fn.getGlobal().updates.ajax_error+"</p></div>"),setTimeout((function(){n.el.update_link.removeClass("active").show(),n.el.progress_main_container.addClass("give-hidden")}),5e3))}}).fail((function(e){C=!1,window.console&&window.console.log&&console.log(e),Give_Selector_Cache.get(".notice-wrap",self.el.progress_container).append(e.responseText)})).always((function(){}))},dismiss_message:function(){e("body").on("click","#poststuff .notice-dismiss",(function(){e(this).parent().slideUp("fast")}))}},f={init:function(){this.restartUpgrade(),this.stopUpgrade(),this.restartUpdater()},restartUpgrade:function(){jQuery("#give-restart-upgrades").click("click",(function(e){var t=this;e.preventDefault(),jQuery(".give-doing-update-text-p").show(),jQuery(".give-update-paused-text-p").hide(),new r.GiveConfirmModal({modalContent:{title:Give.fn.getGlobalVar("confirm_action"),desc:Give.fn.getGlobalVar("restart_upgrade")},successConfirm:function(){window.location.assign(jQuery(t).data("redirect-url"))}}).render()}))},stopUpgrade:function(){jQuery("#give-pause-upgrades").click("click",(function(e){var t=this;e.preventDefault(),jQuery(".give-doing-update-text-p").hide(),jQuery(".give-update-paused-text-p").show(),new r.GiveConfirmModal({modalContent:{title:Give.fn.getGlobalVar("confirm_action"),desc:Give.fn.getGlobalVar("stop_upgrade")},successConfirm:function(){window.location.assign(jQuery(t).data("redirect-url"))}}).render()}))},restartUpdater:function(){jQuery(".give-restart-updater-btn,.give-run-update-now").click("click",(function(e){var t=this;e.preventDefault(),new r.GiveConfirmModal({modalContent:{title:Give.fn.getGlobalVar("confirm_action"),desc:Give.fn.getGlobalVar("restart_update")},successConfirm:function(){window.location.assign(jQuery(t).attr("href"))}}).render()}))}},h={onLoadPageNumber:"",init:function(){this.loadGravatar(),this.unlockDonorFields(),this.editDonor(),this.add_email(),this.removeUser(),this.cancelEdit(),this.add_note(),this.delete_checked(),this.addressesAction(),this.bulkDeleteDonor(),h.onLoadPageNumber=e("#current-page-selector").val(),e("body").on("click",'#give-donors-filter .bulkactions input[type="submit"]',this.handleBulkActions)},loadGravatar:function(){var t,i;e(".give-donor-name").each((function(){if(!(t=e(this).find(".give-donor__image")).hasClass("gravatar-loaded")){if(i=t.attr("data-donor_email"),"1"===t.attr("data-has-valid-gravatar")){var n=e("<img>");n.attr("src",j.url(i)),n.attr("width","60"),n.attr("height","60"),e(this).find(".give-donor__image").html(n)}t.addClass("gravatar-loaded")}}))},unlockDonorFields:function(t){e("body").on("click",".give-lock-block",(function(e){new r.GiveErrorAlert({modalContent:{title:Give.fn.getGlobalVar("unlock_donor_fields_title"),desc:Give.fn.getGlobalVar("unlock_donor_fields_message"),cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render(),e.preventDefault()}))},editDonor:function(){e("body").on("click","#edit-donor",(function(t){t.preventDefault(),e("#give-donor-card-wrapper .editable").hide(),e("#give-donor-card-wrapper .edit-item").fadeIn().css("display","block")}))},removeUser:function(){e("body").on("click","#disconnect-donor",(function(t){return t.preventDefault(),new r.GiveConfirmModal({modalWrapper:"give-modal--warning",modalContent:{desc:Give.fn.getGlobalVar("disconnect_user")},successConfirm:function(){var t={give_action:"disconnect-userid",customer_id:e('input[name="donor_info[id]"]').val(),_wpnonce:e("#edit-donor-info #_wpnonce").val()};e.post(ajaxurl,t,(function(e){window.location.href=e.redirect}),"json")}}).render(),!1}))},cancelEdit:function(){e("body").on("click","#give-edit-donor-cancel",(function(t){t.preventDefault(),e("#give-donor-card-wrapper .edit-item").hide(),e("#give-donor-card-wrapper .editable").show(),e(".give_user_search_results").html("")}))},add_note:function(){e("body").on("click","#add-donor-note",(function(t){t.preventDefault();var i={give_action:"add-donor-note",customer_id:e("#donor-id").val(),donor_note:e("#donor-note").val(),add_donor_note_nonce:e("#add_donor_note_nonce").val()};if(i.donor_note)e.ajax({type:"POST",data:i,url:ajaxurl,success:function(t){e("#give-donor-notes").prepend(t),e(".give-no-donor-notes").hide(),e("#donor-note").val("")}}).fail((function(e){window.console&&window.console.log&&console.log(e)}));else{var n=e("#donor-note").css("border-color");e("#donor-note").css("border-color","red"),setTimeout((function(){e("#donor-note").css("border-color",n)}),500)}}))},delete_checked:function(){e("#give-donor-delete-confirm").change((function(){var t=e("#give-donor-delete-records"),i=e("#give-delete-donor");e(this).prop("checked")?(t.attr("disabled",!1),i.attr("disabled",!1)):(t.attr("disabled",!0),t.prop("checked",!1),i.attr("disabled",!0))}))},add_email:function(){e("#add-donor-email").length&&e(document.body).on("click","#add-donor-email",(function(t){t.preventDefault();var i=e(this),n=i.parent();n.parent().find(".notice-wrap").remove(),n.find(".spinner").css("visibility","visible"),i.attr("disabled",!0);var o={give_action:"add_donor_email",customer_id:n.find('input[name="donor-id"]').val(),email:n.find('input[name="additional-email"]').val(),primary:n.find('input[name="make-additional-primary"]').is(":checked"),_wpnonce:n.find('input[name="add_email_nonce"]').val()};e.post(ajaxurl,o,(function(e){!0===e.success?window.location.href=e.redirect:(i.attr("disabled",!1),n.after('<div class="notice-wrap"><div class="notice notice-error inline"><p>'+e.message+"</p></div></div>"),n.find(".spinner").css("visibility","hidden"))}),"json")}))},addressesAction:function(){var i=this,n=e("#donor-address-wrapper"),o=e(".all-address",n),a=e(".give-no-address-message",n),r=e(o).parent(),s=e(".address-form",n),l=e(".js-cancel",s),c=e('select[name="country"]',s),d=e(".add-new-address",n),u=parseInt(e('input[name="donor-id"]').val());c.on("change",(function(){e(this).trigger("chosen:updated")})),o.on("click",".js-edit",(function(t){var n=e(this).closest(".address");t.preventDefault(),e(".notice",r).remove(),i.__set_address_form_val(n),i.__set_address_form_action("update",n.data("address-id")),d.hide(),o.addClass("give-hidden"),s.removeClass("add-new-address-form-hidden"),s.data("process","update")})),o.on("click",".js-remove",(function(t){t.preventDefault();var n=e(this).closest(".address");e(".notice",r).remove(),s.data("changed",!0),i.__set_address_form_val(n),i.__set_address_form_action("remove",n.data("address-id")),s.trigger("submit")})),d.on("click",(function(t){t.preventDefault(),e(".notice",r).remove(),e(this).hide(),o.addClass("give-hidden"),s.removeClass("add-new-address-form-hidden"),i.__set_address_form_action("add"),i.__set_address_form_action()})),l.on("click",(function(e){e.preventDefault(),s.find('input[type="text"]').val(""),d.show(),o.removeClass("give-hidden"),s.addClass("add-new-address-form-hidden")})),s.on("change",(function(){e(this).data("changed",!0)})).on("submit",(function(i){i.preventDefault();var l=e(this);return e(".notice",r).remove(),e(this).data("changed")?(e.ajax({type:"POST",url:ajaxurl,data:{action:"donor_manage_addresses",donorID:u,form:e("form",s).serialize()},beforeSend:function(){t(n,{show:!0})},success:function(i){if(t(n),i.success){var s;switch(i.data.action){case"add":e(".give-grid-row",o).append(i.data.address_html),!a.hasClass("give-hidden")&&e("div.give-grid-col-4",o).length&&a.addClass("give-hidden");break;case"remove":(s=o.find('div[data-address-id*="'+i.data.id+'"]').parent()).length&&s.animate({"margin-left":"-999"},1e3,(function(){s.remove(),a.hasClass("give-hidden")&&!e("div.give-grid-col-4",o).length&&a.removeClass("give-hidden")}));break;case"update":var l=(s=o.find('div[data-address-id*="'+i.data.id+'"]').parent()).prev(),c={},d=!1;parseInt(e(".give-grid-row>div",o).length)<2?e(".give-grid-row",o).append(i.data.address_html):(l.length&&(l.after(i.data.address_html),d=!0),d||(c=s.next()).length&&c.before(i.data.address_html)),s.remove()}r.prepend(i.data.success_msg)}else r.prepend(i.data.error_msg)},dataType:"json"}).always((function(){l.data("changed",!1),s.find('input[type="text"]').val(""),d.show(),o.removeClass("give-hidden"),s.addClass("add-new-address-form-hidden")})),!1):(d.show(),o.removeClass("give-hidden"),s.addClass("add-new-address-form-hidden"),!1)}))},__set_address_form_action:function(t,i){var n=e("#donor-address-wrapper"),o=e(".address-form",n),a=e('input[name="address-action"]',o),r=e('input[name="address-id"]',o);t=t||"add",i=i||"billing",a.val(t),r.val(i)},__set_address_form_val:function(t){var i=e("#donor-address-wrapper"),n=e(".address-form",i),o=e('[data-address-type="state"]',t).text().substr(2).trim();e('select[name="country"]',n).val().trim()!==e('[data-address-type="country"]',t).text().trim()?(e('select[name="country"]',n).val(e('[data-address-type="country"]',t).text().trim()).trigger("chosen:updated").change(),window.setTimeout((function(){e('[name="state"]',n).val(o).trigger("chosen:updated")}),500)):e('[name="state"]',n).val(o).trigger("chosen:updated"),e('input[name="line1"]',n).val(e('[data-address-type="line1"]',t).text().trim()),e('input[name="line2"]',n).val(e('[data-address-type="line2"]',t).text().trim()),e('input[name="city"]',n).val(e('[data-address-type="city"]',t).text().trim()),e('input[name="zip"]',n).val(e('[data-address-type="zip"]',t).text().trim())},bulkDeleteDonor:function(){var t=e("body");t.on("click","#give-bulk-delete-cancel",(function(t){e(this).closest("tr").hide(),e(".give-skip-donor").trigger("click"),t.preventDefault()})),t.on("click","#cb-select-all-1, #cb-select-all-2",(function(){var t=e(this);e.each(e(".donor-selector"),(function(){var i=e(this).val(),n=e(this).data("name"),o='<div id="give-donor-'+i+'" data-id="'+i+'"><a class="give-skip-donor" title="'+Give.fn.getGlobalVar("remove_from_bulk_delete")+'">X</a>'+n+"</div>";t.is(":checked")&&!e(this).is(":checked")?e("#give-bulk-donors").append(o):t.is(":checked")||e("#give-bulk-donors").find("#give-donor-"+i).remove()}))})),t.on("click",".donor-selector",(function(){var t=e(this).val(),i=e(this).data("name"),n='<div id="give-donor-'+t+'" data-id="'+t+'"><a class="give-skip-donor" title="'+Give.fn.getGlobalVar("remove_from_bulk_delete")+'">X</a>'+i+"</div>";e(this).is(":checked")?e("#give-bulk-donors").prepend(n):e("#give-bulk-donors").find("#give-donor-"+t).remove()})),t.on("click","#give-bulk-delete .give-donor-delete-confirm",(function(){e(this).is(":checked")?e("#give-bulk-delete-button").removeAttr("disabled"):(e("#give-bulk-delete-button").attr("disabled",!0),e("#give-bulk-delete .give-donor-delete-records").removeAttr("checked"))})),t.on("click","#give-bulk-delete .give-donor-delete-records",(function(){e(this).is(":checked")&&(e("#give-bulk-delete .give-donor-delete-confirm").attr("checked","checked"),e("#give-bulk-delete-button").removeAttr("disabled"))})),t.on("click",".give-skip-donor",(function(){var t=e(this).closest("div").data("id");e("#give-donor-"+t).remove(),e("#donor-"+t).find('input[type="checkbox"]').removeAttr("checked")})),t.on("click",".give-single-donor-delete",(function(t){var i=e(this).data("id"),n=e("tr#donor-"+i).find(".donor-selector"),o=e('[id^="cb-select-all-"]'),a=e("#give-bulk-donors"),r=n.data("name"),s='<div id="give-donor-'+i+'" data-id="'+i+'"><a class="give-skip-donor" title="'+Give.fn.getGlobalVar("remove_from_bulk_delete")+'">X</a>'+r+"</div>";a.html(""),o.is(":checked")&&o.removeAttr("checked"),e(".donor-selector").removeAttr("checked"),n.attr("checked","checked"),0===e("#give-donor-"+i).length&&(a.prepend(s),e("#give-bulk-delete").slideDown()),t.preventDefault()}))},handleBulkActions:function(t){var i=e(this).closest(".tablenav").find("select").val(),n=[],o=e("#current-page-selector").val(),a=h.onLoadPageNumber!==o,s=Give.fn.getGlobalVar("donors_bulk_action.no_action_selected"),l=Give.fn.getGlobalVar("donors_bulk_action.no_donor_selected");return!!a||(e.each(e(".donor-selector:checked"),(function(){n.push(e(this).val())})),"-1"===i?(new r.GiveWarningAlert({modalContent:{title:s.title,desc:s.desc,cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render(),!1):parseInt(n)?("delete"===i&&e("#give-bulk-delete").slideDown(),void t.preventDefault()):(new r.GiveWarningAlert({modalContent:{title:l.title,desc:l.desc,cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render(),!1))}},p={init:function(){this.revoke_api_key(),this.regenerate_api_key()},revoke_api_key:function(){e("body").on("click",".give-revoke-api-key",(function(t){t.preventDefault();var i=e(this).attr("href");return new r.GiveConfirmModal({modalWrapper:"give-modal--warning",modalContent:{desc:Give.fn.getGlobalVar("revoke_api_key")},successConfirm:function(){window.location.assign(i)}}).render(),!1}))},regenerate_api_key:function(){e("body").on("click",".give-regenerate-api-key",(function(t){var i=e(this).attr("href");return new r.GiveConfirmModal({modalWrapper:"give-modal--warning",modalContent:{desc:Give.fn.getGlobalVar("regenerate_api_key")},successConfirm:function(){window.location.assign(i)}}).render(),!1}))}},g={init:function(){var t=e.query.get("give_tab").length?e.query.get("give_tab"):"form_field_options";this.handle_metabox_tab_click(),this.setup_colorpicker_fields(),this.setup_media_fields(),this.setup_repeatable_fields(),this.handle_repeater_group_events(),this.handle_multi_levels_repeater_group_events(),this.activate_tab(e('a[href="#'+t+'"]'))},handle_metabox_tab_click:function(){var t=this;e(".give-metabox-tabs a").on("click",(function(i){i.preventDefault();var n=e(this);t.activate_tab(n),t.update_query(n)}))},activate_tab:function(t){var i=t.data("tab-id"),n=t.parent(),o=e("ul.give-metabox-sub-tabs",n),a=o.length,r=e(".give-metabox-tabs a").parents("li"),s=e("ul.give-metabox-sub-tabs"),l=t.parents("ul.give-metabox-sub-tabs").length;if(e("#give_form_active_tab").val(i),a){n.toggleClass("active"),o.removeClass("give-hidden");var c=e("li.active","ul.give-metabox-sub-tabs");s.not(o).addClass("give-hidden"),r.not(n).removeClass("active"),c.addClass("active")}else l?l&&(e("ul.give-metabox-sub-tabs").addClass("give-hidden"),r.removeClass("active"),t.parents("ul.give-metabox-sub-tabs").removeClass("give-hidden").children("li").removeClass("active"),t.parents("li.has-sub-fields").addClass("active")):r.each((function(t,i){(i=e(i)).removeClass("active"),i.hasClass("has-sub-fields")&&e("ul.give-metabox-sub-tabs",i).addClass("give-hidden")}));t.parent().addClass("active"),e(".give_options_panel").removeClass("active"),e(t.attr("href")).addClass("active")},update_query:function(t){var i=t.data("tab-id"),n=e.query.set("give_tab",i).remove("message").toString();history.replaceState&&history.replaceState(null,null,n)},setup_colorpicker_fields:function(){e(document).ready((function(){var t=e(".give-colorpicker");t.length&&t.each((function(t,i){var n=e(i);n.parents(".give-template").length||n.wpColorPicker()}))}))},setup_media_fields:function(){var t,i,n=e("body");n.on("click",".give-upload-button",(function(o){o.preventDefault();var a={};switch(i=e(this),e(this).data("field-type")){case"media":a={title:Give.fn.getGlobal().metabox_fields.media.button_title,button:{text:Give.fn.getGlobal().metabox_fields.media.button_title},multiple:!1,library:{type:"image"}};break;default:a={title:Give.fn.getGlobal().metabox_fields.file.button_title,button:{text:Give.fn.getGlobal().metabox_fields.file.button_title},multiple:!1}}void 0!==jQuery(this).closest(".give-field-wrap").find(".give-input-field").attr("editing")&&(wp.media.controller.Library.prototype.defaults.contentUserSetting=!1);var r=jQuery(this).closest(".give-field-wrap").find(".give-input-field").attr("library");void 0!==r&&""!==r&&(a.library={type:r}),(t=wp.media(a)).on("select",(function(){var e=t.state().get("selection").first().toJSON(),o=i.prev(),a="id"===i.data("fvalue")?e.id:e.url;if(n.trigger("give_media_inserted",[e,o]),o.val(a),"id"!==i.data("fvalue")){var r='input[name="'+o.attr("name")+'_id"]';o.closest("tr").next("tr").find(r).length&&o.closest("tr").next("tr").find(r).val(e.id)}})),t.open()})),n.on("give_media_inserted",(function(t,n){var o=i.parents(".give-field-wrap"),a=e(".give-image-thumb",o);return!!a.length&&("image"!==n.type?(a.addClass("give-hidden"),e("img",a).attr("src",""),!1):(a.find("img").attr("src",n.url),void a.removeClass("give-hidden")))})),e("span.give-delete-image-thumb",".give-image-thumb").on("click",(function(t){t.preventDefault();var i=e(this).parents(".give-field-wrap"),n=e(this).parent(),o=e('input[type="text"]',i);n.addClass("give-hidden"),o.val(""),e("img",n).attr("src","")}))},setup_repeatable_fields:function(){jQuery((function(){jQuery(".give-repeatable-field-section").each((function(){var t=e(this),i={wrapper:".give-repeatable-fields-section-wrapper",container:".container",row:".give-row",add:".give-add-repeater-field-section-row",remove:".give-remove",move:".give-move",template:".give-template",confirm_before_remove_row:!0,confirm_before_remove_row_text:Give.fn.getGlobalVar("confirm_before_remove_row_text"),is_sortable:!0,before_add:null,after_add:m,before_remove:null,after_remove:v,sortable_options:{placeholder:"give-ui-placeholder-state-highlight",start:function(i,n){n.item.next().hasClass("give-template")&&n.item.next().after(n.item);var o=e(".give-row",t).not(".give-template");o.length&&o.each((function(t,i){var n=e('input[type="radio"].give-field',e(i));n.length&&n.each((function(){e(this).attr("data-give-checked",e(this).is(":checked"))}))})),e("body").trigger("repeater_field_sorting_start",[n.item])},stop:function(t,i){i.item.next().hasClass("give-template")&&i.item.next().after(i.item),e("body").trigger("repeater_field_sorting_stop",[i.item])},update:function(i,n){n.item.next().hasClass("give-template")&&n.item.next().after(n.item);var o=e(".give-row",t).not(".give-template"),a=e(this).closest(".give-repeatable-fields-section-wrapper");if(o.length){var r=1;o.each((function(t,i){var n=e(".give-field, label",e(i));n.length&&n.each((function(){var t=e(this).parents(".give-field-wrap"),i=e(this);e.each(this.attributes,(function(e,n){var o,a=this.value.replace(/\[/g,"_").replace(/]/g,""),s=a+"_field",l="";this.value&&(this.value=this.value.replace(/\[\d+\]/g,"["+(r-1)+"]"),o=this.value.replace(/\[/g,"_").replace(/]/g,""),t.hasClass(s)&&(l=o+"_field",t.removeClass(s).addClass(l)),a==i.attr("id")&&i.attr("id",o))}))})),r++})),window.setTimeout((function(){e("input[data-give-checked]",a).each((function(t,i){(i=e(i)).prop("checked","true"===i.attr("data-give-checked"))}))}),100),t.trigger("repeater_field_row_reordered",[n.item])}}}};jQuery(this).repeatable_fields(i)}))}))},handle_repeater_group_events:function(){var t=e(".give-repeatable-field-section"),i=e("body");i.on("click",".give-row-head button",(function(){var t=e(this).closest("tr");t.toggleClass("closed"),e(".give-row-body",t).toggle()})),t.on("repeater_field_new_row_added repeater_field_row_deleted repeater_field_row_reordered",(function(){_(e(this))})),i.on("repeater_field_sorting_start",(function(t,i){var n=e(".wp-editor-area",i);n.length&&n.each((function(t,i){window.setTimeout((function(){tinyMCE.execCommand("mceRemoveEditor",!0,e(i).attr("id"))}),300)}))})),i.on("repeater_field_sorting_stop",(function(t,i){var n=e(".wp-editor-area",i);n.length&&n.each((function(t,i){window.setTimeout((function(){var t=e(i).attr("id");tinyMCE.execCommand("mceAddEditor",!0,t),window.setTimeout((function(){switchEditors.go(t,"html"),e("#"+t+"-tmce").trigger("click")}),100)}),300)}))})),t.each((function(t,i){var n=e(i);_(n),parseInt(n.data("close-tabs"))&&(e(".give-row-head button",n).trigger("click"),e(".give-template",n).removeClass("closed"),e(".give-template .give-row-body",n).show())})),t.on("repeater_field_new_row_added",(function(t,i,n){e(".give-colorpicker",e(this)).each((function(t,i){var n=e(i);n.parents(".wp-picker-container").length||n.parents(".give-template").length||n.wpColorPicker()}));var o=e("div[data-wp-editor]",n);o.length&&o.each((function(t,i){var n=e(i),o=e(".wp-editor-wrap",n),a=e("textarea",n),r="give_wysiwyg_unique_"+Math.random().toString().replace(".","_"),s=o.prev();a.attr("id",r),e.post(ajaxurl,{action:"give_load_wp_editor",wp_editor:n.data("wp-editor"),wp_editor_id:r,textarea_name:e("textarea",n).attr("name")},(function(t){o.remove(),s.after(t),tinyMCEPreInit.qtInit[a.attr("id")]=e.extend(!0,tinyMCEPreInit.qtInit._give_agree_text,{id:r}),tinyMCEPreInit.mceInit[r]=e.extend(!0,tinyMCEPreInit.mceInit._give_agree_text,{body_class:r+" post-type-give_forms post-status-publish locale-"+tinyMCEPreInit.mceInit._give_agree_text.wp_lang_attr.toLowerCase(),selector:"#"+r}),tinymce.init(tinyMCEPreInit.mceInit[r]),quicktags(tinyMCEPreInit.qtInit[r]),QTags._buttonsInit(),window.setTimeout((function(){switchEditors.go(r,"html"),e("#"+r+"-tmce").trigger("click")}),100),window.wpActiveEditor||(window.wpActiveEditor=r)}))}))}))},handle_multi_levels_repeater_group_events:function(){var t=e("#_give_donation_levels_field");e("body").on("keyup",".give-multilevel-text-field",(function(){var t=e(this).closest("tr"),i=e(".give-row-head h2 span",t),n=i.data("header-title");if(e(this).val()&&e(this).val()===i.html())return!1;e(this).val()?i.html(n+": "+e(this).val()):i.html(n)})),e(".give-multilevel-text-field").each((function(t,i){if(t){var n=e(i),o=n.closest("tr"),a=e(".give-row-head h2 span",o),r=a.data("header-title");if(n.val()&&n.val()===a.html())return!1;n.val()?a.html(r+": "+n.val()):a.html(r)}})),t.on("repeater_field_row_deleted",(function(){var t=e(this);window.setTimeout((function(){var i=e(".give-row",t).not(".give-template"),n=e(".give-give_default_radio_inline",i);1===i.length&&n.prop("checked",!0)}),200)})),t.on("repeater_field_new_row_added",(function(t,i,n){var o=e(this),a=0;window.setTimeout((function(){!1===e(".give-give_default_radio_inline",o).is(":checked")&&e(".give-row",o).not(".give-template").first().find(".give-give_default_radio_inline").prop("checked",!0)}),200),e('input[type="hidden"].give-levels_id',o).each((function(t,i){var n=e(i),o=parseInt(n.val());a<o&&(a=o)})),e('input[type="hidden"].give-levels_id',n).val(++a)}))}},m=function(t,i){var n=e(t).attr("data-rf-row-count"),o=e(t).parents(".give-repeatable-field-section");n++,e("*",i).each((function(){e.each(this.attributes,(function(e,t){this.value=this.value.replace("{{row-count-placeholder}}",n-1)}))})),e(t).attr("data-rf-row-count",n),o.trigger("repeater_field_new_row_added",[t,i])},v=function(t){var i=e(t),n=i.parents(".give-repeatable-field-section"),o=e(t).attr("data-rf-row-count");i.attr("data-rf-row-count",--o),n.trigger("repeater_field_row_deleted")},_=function(t){if(parseInt(t.data("group-numbering"))){var i=e(".give-row-head h2 span",t),n=i.data("header-title");i.each((function(t,i){var o=e(i);o.parents(".give-template").length||o.html(n+": "+t)}))}},b={onLoadPageNumber:"",init:function(){b.onLoadPageNumber=e("#current-page-selector").val(),e("body").on("click",'#give-payments-filter input[type="submit"]',this.handleBulkActions)},handleBulkActions:function(t){var i=e(this).closest(".tablenav").find("select").val(),n=e(this).closest(".tablenav").find('option[value="'+i+'"]').text(),o=e('input[name="payment[]"]:checked').length,a=-1!==i.indexOf("set-status-"),s="",l="",c=e("#current-page-selector").val();if(b.onLoadPageNumber!==c)return!0;if("-1"===(i=a?"set-to-status":i))return new r.GiveWarningAlert({modalContent:{title:Give.fn.getGlobal().donors_bulk_action.no_action_selected.title,desc:Give.fn.getGlobal().donors_bulk_action.no_action_selected.desc,cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render(),!1;if(Object.keys(Give.fn.getGlobalVar("donations_bulk_action")).length)for(l in Give.fn.getGlobalVar("donations_bulk_action"))if(l===i){if(s=a?Give.fn.getGlobal().donations_bulk_action[i].zero.replace("{status}",n.replace("Set To ","")):Give.fn.getGlobal().donations_bulk_action[i].zero,!parseInt(o))return new r.GiveWarningAlert({modalContent:{title:Give.fn.getGlobal().donations_bulk_action.titles.zero,desc:s,cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render(),!1;s=1<o?Give.fn.getGlobal().donations_bulk_action[i].multiple:Give.fn.getGlobal().donations_bulk_action[i].single,t.preventDefault(),new r.GiveConfirmModal({modalContent:{title:Give.fn.getGlobalVar("confirm_bulk_action"),desc:s.replace("{payment_count}",o).replace("{status}",n.replace("Set To ",""))},successConfirm:function(t){e("#give-payments-filter").submit()}}).render()}return!0}},y=function(){var e=document.querySelectorAll(".js-give-shortcode-button");if(e){var t=!0,i=!1,n=void 0;try{for(var o,a=e[Symbol.iterator]();!(t=(o=a.next()).done);t=!0){var r=o.value;new k(r).init()}}catch(e){i=!0,n=e}finally{try{t||null==a.return||a.return()}finally{if(i)throw n}}}};e((function(){var t;e("body").on("click","button.notice-dismiss",(function(){"give-invalid-license"!==jQuery(this).closest("div.give-notice").data("notice-id")&&i(jQuery(this).closest("div.give-notice").attr("id"))})),function(){var t,i=e(".give_datepicker");if(i.length){var n={},o={altFormat:"yy-mm-dd",onClose:function(e,t){e.length||t.input.next().val("")}};e.each(i,(function(o,a){a=e(a),t=void 0!==a.attr("data-standard-date")?a.attr("data-standard-date"):a.attr("value"),a.attr("name").length&&(n=a.clone(),i[o]=n,n.attr("name",""),a.before(n),a.hide(),a.attr("class",""),a.attr("id",""),a.val(t),a.prop("readonly",!0))})),i.length>0&&e.each(i,(function(t,i){i=e(i),o.altField=i.next(),i.datepicker(o)}))}}(),e('select[name="give-payment-status"]').on("change",(function(){var t=e(this).val();e(".give-donation-status").removeClass((function(e,t){return(t.match(/\bstatus-\S+/g)||[]).join(" ")})).addClass("status-"+t)})),(t=e(".give-select-chosen")).hasClass("give-chosen-settings")?t.chosen({no_results_text:Give.fn.getGlobalVar("chosen_add_title_prefix")+" ",width:"30%"}).on("chosen:no_results",(function(t,i){e(i.chosen.container).on("keydown",(function(n){var o=i.chosen.get_search_text();13!==n.keyCode||jQuery(i.chosen.form_field).find('option[value="'+o+'"]').length||(e(i.chosen.form_field).append('<option value="'+o+'" selected>'+o+"</option>").trigger("chosen:updated"),i.chosen.result_highlight=i.chosen.search_results.find("li.active-result").lasteturn,i.chosen.result_select(t))}))})):(t.on("chosen:ready",(function(){e(this).next(".chosen-container").find("input.chosen-search-input").after('<span class="spinner"></span>')})),t.chosen({inherit_select_classes:!0,placeholder_text_single:Give.fn.getGlobalVar("one_option"),placeholder_text_multiple:Give.fn.getGlobalVar("one_or_more_option")}),t.on("chosen:no_results",(function(){var t=e(this).next(".chosen-container"),i=t.find("li.no-results"),n="",o=Give.fn.getGlobalVar("chosen");n=t.hasClass("give-select-chosen-ajax")&&i.length?o.ajax_search_msg.replace("{search_term}",'"'+e("input",t).val()+'"'):o.no_results_msg.replace("{search_term}",'"'+e("input",t).val()+'"'),i.html(n),e(document.body).on("keyup",".give-select.chosen-container .chosen-search input, .give-select.chosen-container .search-field input",(function(t){var i=e(this).val(),n=e(this).closest(".give-select-chosen"),o=n.prev(),a=n.find('input[type="text"]'),r=(n.hasClass("variations"),t.which),s="give_form_search",l=this;if(n.prev().data("search-type")){if("no_ajax"===o.data("search-type"))return;s="give_"+o.data("search-type")+"_search"}i.length>0&&i.length<=3||!s.length||9===r||13===r||16===r||17===r||18===r||19===r||20===r||27===r||33===r||34===r||35===r||36===r||37===r||38===r||39===r||40===r||44===r||45===r||144===r||145===r||91===r||93===r||224===r||112<=r&&123>=r||(clearTimeout(Give.cache.chosenSearchTypingTimer),n.addClass("give-select-chosen-ajax"),Give.cache.chosenSearchTypingTimer=setTimeout((function(){e.ajax({type:"POST",url:ajaxurl,data:{action:s,s:i,fields:e(l).closest("form").serialize()},dataType:"json",beforeSend:function(){o.closest("ul.chosen-results").empty(),a.prop("disabled",!0)},success:function(t){n.removeClass("give-select-chosen-ajax"),e("option:not(:selected)",o).remove(),t.length?(e.each(t,(function(t,n){e('option[value="'+n.id+'"]',o).length||(0===i.length?o.append('<option value="'.concat(n.id,'">').concat(n.name,"</option>")):o.prepend('<option value="'.concat(n.id,'">').concat(n.name,"</option>")))})),n.prev("select.give-select-chosen").trigger("chosen:updated")):n.prev("select.give-select-chosen").trigger("chosen:no_results"),a.prop("disabled",!1),a.val(i).focus()}}).fail((function(e){window.console&&window.console.log&&console.log(e)})).done((function(e){a.prop("disabled",!1)}))}),342))})),e(".give-select-chosen .chosen-search input").each((function(){var t=e(this).parent().parent().parent().prev("select.give-select-chosen").data("search-type"),i="";"form"===t?i=Give.fn.getGlobalVar("search_placeholder"):(t="search_placeholder_"+t,Give.fn.getGlobalVar(t)&&(i=Give.fn.getGlobalVar(t))),e(this).attr("placeholder",i)}))}))),e(".chosen-container").each((function(){0===e(this).width()&&e(this).css("width","100%")})),e("#post").on("click",".give-thickbox",(function(){e(".give-select-chosen","#choose-give-form").css("width","100%")})),e.giveAjaxifyFields({type:"country_state",debug:!0}),o.init(),s.init(),l.init(),c.init(),h.init(),p.init(),d.init(),u.init(),f.init(),g.init(),b.init(),y(),e("a.give-rating-link").click((function(){jQuery(this).parent().text(jQuery(this).data("rated"))})),e(".give-ajax-user-search").on("keyup",(function(){var t=e(this).val(),i="";e(this).data("exclude")&&(i=e(this).data("exclude")),e(".give-ajax").show(),data={action:"give_search_users",user_name:t,exclude:i},document.body.style.cursor="wait",e.ajax({type:"POST",data:data,dataType:"json",url:ajaxurl,success:function(t){e(".give-ajax").hide(),e(".give_user_search_results").removeClass("hidden"),e(".give_user_search_results span").html(""),e(t.results).appendTo(".give_user_search_results span"),document.body.style.cursor="default"}})})),e("body").on("click.giveSelectUser",".give_user_search_results span a",(function(t){t.preventDefault();var i=e(this).data("login");e(".give-ajax-user-search").val(i),e(".give_user_search_results").addClass("hidden"),e(".give_user_search_results span").html("")})),e("body").on("click.giveCancelUserSearch",".give_user_search_results a.give-ajax-user-cancel",(function(t){t.preventDefault(),e(".give-ajax-user-search").val(""),e(".give_user_search_results").addClass("hidden"),e(".give_user_search_results span").html("")}));var a=e("#poststuff"),r=Give.fn.getGlobalVar("thousands_separator"),m=Give.fn.getGlobalVar("decimal_separator"),v="",_="",x="",w=m===r?1:0;a.on("keyup","input.give-money-field, input.give-price-field",(function(){var t={label:Give.fn.getGlobalVar("price_format_guide").trim()};v=(e(this).val().match(new RegExp(r,"g"))||[]).length,_=(e(this).val().match(new RegExp("[a-z]","g"))||[]).length,-1!==e(this).val().indexOf(r)&&w<v?e(this).giveHintCss("show",t):_?e(this).giveHintCss("show",t):e(this).giveHintCss("hide",t),v=_=""})),a.on("focusout","input.give-money-field, input.give-price-field",(function(){if(x=n(e(this).val(),!1),e(this).giveHintCss("hide",{label:Give.fn.getGlobalVar("price_format_guide").trim()}),n("0",!1)===n(e(this).val(),!1)){var t=e(this).attr("placeholder");return t=t||"0",e(this).val(t),!1}-1!==(x=x.replace(".",m)).indexOf("-")&&(x=x.replace("-","")),e(this).val(x)})),a.on("focusout","#_give_number_of_donation_goal",(function(){1>e(this).val()&&e(this).val(1)})),e(".give-settings-page").on("click","#give-show-sub-nav",(function(t){t.preventDefault();var i=e(this).next();return i.is(":hover")||i.toggleClass("give-hidden"),!1})).on("blur","#give-show-sub-nav",(function(){var t=e(this).next();t.is(":hover")||t.addClass("give-hidden")})),e(".give_email_api_notification_status_setting input").change((function(){var t=e(this).val(),i="enabled"===t,n={};return e(this).closest(".give_options_panel").length?n=e(this).closest(".give_options_panel").children(".give-field-wrap:not(.give_email_api_notification_status_setting), .give-repeatable-field-section"):e(this).closest("table").length&&(n=e(this).closest("table").find("tr:not(.give_email_api_notification_status_setting)")),-1!==jQuery.inArray(t,["enabled","disabled","global"])&&(!!n.length&&void(i?n.show():n.hide()))})),e(".give_email_api_notification_status_setting input:checked").change(),S()}))}(jQuery),jQuery(window).resize((function(){S()}));function G(){var e=document.querySelector(".give-tools-setting-page-import table.step-2 .give-import-donation-required-fields");if("undefined"!==e&&null!==e){var t=!0,i=!1,n=!1,o=!1,a=!1;document.querySelectorAll(".give-import-donation-required-fields li").forEach((function(e){e.querySelector(".dashicons").classList.remove("dashicons-yes"),e.querySelector(".dashicons").classList.add("dashicons-no-alt")}));var r=Array.from(document.querySelectorAll("table.step-2 tbody select")).map((function(e){return e.value}));r.includes("email")&&(i=!0,document.querySelector(".give-import-donation-required-email .dashicons").classList.remove("dashicons-no-alt"),document.querySelector(".give-import-donation-required-email .dashicons").classList.add("dashicons-yes")),r.includes("first_name")&&(n=!0,document.querySelector(".give-import-donation-required-first .dashicons").classList.remove("dashicons-no-alt"),document.querySelector(".give-import-donation-required-first .dashicons").classList.add("dashicons-yes")),r.includes("amount")&&(o=!0,document.querySelector(".give-import-donation-required-amount .dashicons").classList.remove("dashicons-no-alt"),document.querySelector(".give-import-donation-required-amount .dashicons").classList.add("dashicons-yes")),(r.includes("form_id")||r.includes("form_title"))&&(a=!0,document.querySelector(".give-import-donation-required-form .dashicons").classList.remove("dashicons-no-alt"),document.querySelector(".give-import-donation-required-form .dashicons").classList.add("dashicons-yes")),i&&n&&o&&a&&(t=!1),document.getElementById("recount-stats-submit").disabled=t}}jQuery((function(){window.onload=function(){var e,t;G(),"undefined"!==(e=document.querySelector(".give-tools-setting-page-import table.step-2 tbody select"))&&null!==e&&jQuery(".give-tools-setting-page-import table.step-2 tbody").on("change","select",(function(){G()})),jQuery("body.give_forms_page_give-tools .give-tools-import-tab #give-import-donations-form table.step-3").length>0&&function e(){var t=jQuery("form.tools-setting-page-import");!0;var i=t.find(".give-progress"),n=jQuery(i).data("total_ajax"),o=jQuery(i).data("current"),a=jQuery(i).data("start"),s=jQuery(i).data("end"),l=jQuery(i).data("next"),c=jQuery(i).data("total"),d=jQuery(i).data("per_page");jQuery.ajax({type:"POST",url:ajaxurl,data:{action:Give.fn.getGlobalVar("give_donation_import"),total_ajax:n,current:o,start:a,end:s,next:l,total:c,per_page:d,fields:t.serialize()},dataType:"json",success:function(t){jQuery(i).data("current",t.current),jQuery(i).find("div").width(t.percentage+"%"),1==t.next?(jQuery(i).data("start",t.start),jQuery(i).data("end",t.end),1==t.last&&jQuery(i).data("next",!1),e()):(!1,window.location=t.url)},error:function(){!1,new r.GiveErrorAlert({modalContent:{title:Give.fn.getGlobalVar("import_failed"),desc:Give.fn.getGlobalVar("error_message"),cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render()}})}(),t="body.give_forms_page_give-tools .give-tools-import-tab #give-import-donations-form table.step-1 .is_csv_valid",jQuery(t).length>0&&(window.location=jQuery(t).val()),function(){var e="body.give_forms_page_give-tools .give-tools-import-tab #give-import-donations-form table.step-2 .csv_not_valid";jQuery(e).length>0&&(window.location=jQuery(e).val())}(),function(){if(jQuery("body.give_forms_page_give-tools .give-tools-import-tab #give-import-core-settings-form table.step-2").length>0){var e=jQuery("form.tools-setting-page-import"),t=e.find(".give-progress");!0,jQuery.ajax({type:"POST",url:ajaxurl,data:{action:Give.fn.getGlobalVar("core_settings_import"),fields:e.serialize()},dataType:"json",success:function(e){!1,!0===e.success?(jQuery(t).find("div").width(e.percentage+"%"),window.location=e.url):new r.GiveErrorAlert({modalContent:{title:Give.fn.getGlobalVar("import_failed"),desc:Give.fn.getGlobalVar("error_message"),cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render()},error:function(){!1,new r.GiveErrorAlert({modalContent:{title:Give.fn.getGlobalVar("import_failed"),desc:Give.fn.getGlobalVar("error_message"),cancelBtnTitle:Give.fn.getGlobalVar("ok")}}).render()}})}}(),function(){var e="body.give_forms_page_give-tools .give-tools-import-tab #give-import-core-settings-form table.step-1 .is_json_valid";jQuery(e).length>0&&(window.location=jQuery(e).val())}()}}));i(480);s.a.modal=r;var T=s.a.init,M=s.a.fn,I=s.a.cache,A=s.a.modal,E=s.a.notice;window.Give={init:T,fn:M,cache:I,modal:A,notice:E}},8:function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},98:function(e,t,i){var n,o,a; /*! Magnific Popup - v1.1.0 - 2016-02-20 * http://dimsemenov.com/plugins/magnific-popup/ * Copyright (c) 2016 Dmitry Semenov; */o=[i(69)],void 0===(a="function"==typeof(n=function(e){var t,i,n,o,a,r,s=function(){},l=!!window.jQuery,c=e(window),d=function(e,i){t.ev.on("mfp"+e+".mfp",i)},u=function(t,i,n,o){var a=document.createElement("div");return a.className="mfp-"+t,n&&(a.innerHTML=n),o?i&&i.appendChild(a):(a=e(a),i&&a.appendTo(i)),a},f=function(i,n){t.ev.triggerHandler("mfp"+i,n),t.st.callbacks&&(i=i.charAt(0).toLowerCase()+i.slice(1),t.st.callbacks[i]&&t.st.callbacks[i].apply(t,e.isArray(n)?n:[n]))},h=function(i){return i===r&&t.currTemplate.closeBtn||(t.currTemplate.closeBtn=e(t.st.closeMarkup.replace("%title%",t.st.tClose)),r=i),t.currTemplate.closeBtn},p=function(){e.magnificPopup.instance||((t=new s).init(),e.magnificPopup.instance=t)};s.prototype={constructor:s,init:function(){var i=navigator.appVersion;t.isLowIE=t.isIE8=document.all&&!document.addEventListener,t.isAndroid=/android/gi.test(i),t.isIOS=/iphone|ipad|ipod/gi.test(i),t.supportsTransition=function(){var e=document.createElement("p").style,t=["ms","O","Moz","Webkit"];if(void 0!==e.transition)return!0;for(;t.length;)if(t.pop()+"Transition"in e)return!0;return!1}(),t.probablyMobile=t.isAndroid||t.isIOS||/(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent),n=e(document),t.popupsCache={}},open:function(i){var o;if(!1===i.isObj){t.items=i.items.toArray(),t.index=0;var r,s=i.items;for(o=0;o<s.length;o++)if((r=s[o]).parsed&&(r=r.el[0]),r===i.el[0]){t.index=o;break}}else t.items=e.isArray(i.items)?i.items:[i.items],t.index=i.index||0;if(!t.isOpen){t.types=[],a="",i.mainEl&&i.mainEl.length?t.ev=i.mainEl.eq(0):t.ev=n,i.key?(t.popupsCache[i.key]||(t.popupsCache[i.key]={}),t.currTemplate=t.popupsCache[i.key]):t.currTemplate={},t.st=e.extend(!0,{},e.magnificPopup.defaults,i),t.fixedContentPos="auto"===t.st.fixedContentPos?!t.probablyMobile:t.st.fixedContentPos,t.st.modal&&(t.st.closeOnContentClick=!1,t.st.closeOnBgClick=!1,t.st.showCloseBtn=!1,t.st.enableEscapeKey=!1),t.bgOverlay||(t.bgOverlay=u("bg").on("click.mfp",(function(){t.close()})),t.wrap=u("wrap").attr("tabindex",-1).on("click.mfp",(function(e){t._checkIfClose(e.target)&&t.close()})),t.container=u("container",t.wrap)),t.contentContainer=u("content"),t.st.preloader&&(t.preloader=u("preloader",t.container,t.st.tLoading));var l=e.magnificPopup.modules;for(o=0;o<l.length;o++){var p=l[o];p=p.charAt(0).toUpperCase()+p.slice(1),t["init"+p].call(t)}f("BeforeOpen"),t.st.showCloseBtn&&(t.st.closeBtnInside?(d("MarkupParse",(function(e,t,i,n){i.close_replaceWith=h(n.type)})),a+=" mfp-close-btn-in"):t.wrap.append(h())),t.st.alignTop&&(a+=" mfp-align-top"),t.fixedContentPos?t.wrap.css({overflow:t.st.overflowY,overflowX:"hidden",overflowY:t.st.overflowY}):t.wrap.css({top:c.scrollTop(),position:"absolute"}),(!1===t.st.fixedBgPos||"auto"===t.st.fixedBgPos&&!t.fixedContentPos)&&t.bgOverlay.css({height:n.height(),position:"absolute"}),t.st.enableEscapeKey&&n.on("keyup.mfp",(function(e){27===e.keyCode&&t.close()})),c.on("resize.mfp",(function(){t.updateSize()})),t.st.closeOnContentClick||(a+=" mfp-auto-cursor"),a&&t.wrap.addClass(a);var g=t.wH=c.height(),m={};if(t.fixedContentPos&&t._hasScrollBar(g)){var v=t._getScrollbarSize();v&&(m.marginRight=v)}t.fixedContentPos&&(t.isIE7?e("body, html").css("overflow","hidden"):m.overflow="hidden");var _=t.st.mainClass;return t.isIE7&&(_+=" mfp-ie7"),_&&t._addClassToMFP(_),t.updateItemHTML(),f("BuildControls"),e("html").css(m),t.bgOverlay.add(t.wrap).prependTo(t.st.prependTo||e(document.body)),t._lastFocusedEl=document.activeElement,setTimeout((function(){t.content?(t._addClassToMFP("mfp-ready"),t._setFocus()):t.bgOverlay.addClass("mfp-ready"),n.on("focusin.mfp",t._onFocusIn)}),16),t.isOpen=!0,t.updateSize(g),f("Open"),i}t.updateItemHTML()},close:function(){t.isOpen&&(f("BeforeClose"),t.isOpen=!1,t.st.removalDelay&&!t.isLowIE&&t.supportsTransition?(t._addClassToMFP("mfp-removing"),setTimeout((function(){t._close()}),t.st.removalDelay)):t._close())},_close:function(){f("Close");var i="mfp-removing mfp-ready ";if(t.bgOverlay.detach(),t.wrap.detach(),t.container.empty(),t.st.mainClass&&(i+=t.st.mainClass+" "),t._removeClassFromMFP(i),t.fixedContentPos){var o={marginRight:""};t.isIE7?e("body, html").css("overflow",""):o.overflow="",e("html").css(o)}n.off("keyup.mfp focusin.mfp"),t.ev.off(".mfp"),t.wrap.attr("class","mfp-wrap").removeAttr("style"),t.bgOverlay.attr("class","mfp-bg"),t.container.attr("class","mfp-container"),!t.st.showCloseBtn||t.st.closeBtnInside&&!0!==t.currTemplate[t.currItem.type]||t.currTemplate.closeBtn&&t.currTemplate.closeBtn.detach(),t.st.autoFocusLast&&t._lastFocusedEl&&e(t._lastFocusedEl).focus(),t.currItem=null,t.content=null,t.currTemplate=null,t.prevHeight=0,f("AfterClose")},updateSize:function(e){if(t.isIOS){var i=document.documentElement.clientWidth/window.innerWidth,n=window.innerHeight*i;t.wrap.css("height",n),t.wH=n}else t.wH=e||c.height();t.fixedContentPos||t.wrap.css("height",t.wH),f("Resize")},updateItemHTML:function(){var i=t.items[t.index];t.contentContainer.detach(),t.content&&t.content.detach(),i.parsed||(i=t.parseEl(t.index));var n=i.type;if(f("BeforeChange",[t.currItem?t.currItem.type:"",n]),t.currItem=i,!t.currTemplate[n]){var a=!!t.st[n]&&t.st[n].markup;f("FirstMarkupParse",a),t.currTemplate[n]=!a||e(a)}o&&o!==i.type&&t.container.removeClass("mfp-"+o+"-holder");var r=t["get"+n.charAt(0).toUpperCase()+n.slice(1)](i,t.currTemplate[n]);t.appendContent(r,n),i.preloaded=!0,f("Change",i),o=i.type,t.container.prepend(t.contentContainer),f("AfterChange")},appendContent:function(e,i){t.content=e,e?t.st.showCloseBtn&&t.st.closeBtnInside&&!0===t.currTemplate[i]?t.content.find(".mfp-close").length||t.content.append(h()):t.content=e:t.content="",f("BeforeAppend"),t.container.addClass("mfp-"+i+"-holder"),t.contentContainer.append(t.content)},parseEl:function(i){var n,o=t.items[i];if(o.tagName?o={el:e(o)}:(n=o.type,o={data:o,src:o.src}),o.el){for(var a=t.types,r=0;r<a.length;r++)if(o.el.hasClass("mfp-"+a[r])){n=a[r];break}o.src=o.el.attr("data-mfp-src"),o.src||(o.src=o.el.attr("href"))}return o.type=n||t.st.type||"inline",o.index=i,o.parsed=!0,t.items[i]=o,f("ElementParse",o),t.items[i]},addGroup:function(e,i){var n=function(n){n.mfpEl=this,t._openClick(n,e,i)};i||(i={});var o="click.magnificPopup";i.mainEl=e,i.items?(i.isObj=!0,e.off(o).on(o,n)):(i.isObj=!1,i.delegate?e.off(o).on(o,i.delegate,n):(i.items=e,e.off(o).on(o,n)))},_openClick:function(i,n,o){if((void 0!==o.midClick?o.midClick:e.magnificPopup.defaults.midClick)||!(2===i.which||i.ctrlKey||i.metaKey||i.altKey||i.shiftKey)){var a=void 0!==o.disableOn?o.disableOn:e.magnificPopup.defaults.disableOn;if(a)if(e.isFunction(a)){if(!a.call(t))return!0}else if(c.width()<a)return!0;i.type&&(i.preventDefault(),t.isOpen&&i.stopPropagation()),o.el=e(i.mfpEl),o.delegate&&(o.items=n.find(o.delegate)),t.open(o)}},updateStatus:function(e,n){if(t.preloader){i!==e&&t.container.removeClass("mfp-s-"+i),n||"loading"!==e||(n=t.st.tLoading);var o={status:e,text:n};f("UpdateStatus",o),e=o.status,n=o.text,t.preloader.html(n),t.preloader.find("a").on("click",(function(e){e.stopImmediatePropagation()})),t.container.addClass("mfp-s-"+e),i=e}},_checkIfClose:function(i){if(!e(i).hasClass("mfp-prevent-close")){var n=t.st.closeOnContentClick,o=t.st.closeOnBgClick;if(n&&o)return!0;if(!t.content||e(i).hasClass("mfp-close")||t.preloader&&i===t.preloader[0])return!0;if(i===t.content[0]||e.contains(t.content[0],i)){if(n)return!0}else if(o&&e.contains(document,i))return!0;return!1}},_addClassToMFP:function(e){t.bgOverlay.addClass(e),t.wrap.addClass(e)},_removeClassFromMFP:function(e){this.bgOverlay.removeClass(e),t.wrap.removeClass(e)},_hasScrollBar:function(e){return(t.isIE7?n.height():document.body.scrollHeight)>(e||c.height())},_setFocus:function(){(t.st.focus?t.content.find(t.st.focus).eq(0):t.wrap).focus()},_onFocusIn:function(i){if(i.target!==t.wrap[0]&&!e.contains(t.wrap[0],i.target))return t._setFocus(),!1},_parseMarkup:function(t,i,n){var o;n.data&&(i=e.extend(n.data,i)),f("MarkupParse",[t,i,n]),e.each(i,(function(i,n){if(void 0===n||!1===n)return!0;if((o=i.split("_")).length>1){var a=t.find(".mfp-"+o[0]);if(a.length>0){var r=o[1];"replaceWith"===r?a[0]!==n[0]&&a.replaceWith(n):"img"===r?a.is("img")?a.attr("src",n):a.replaceWith(e("<img>").attr("src",n).attr("class",a.attr("class"))):a.attr(o[1],n)}}else t.find(".mfp-"+i).html(n)}))},_getScrollbarSize:function(){if(void 0===t.scrollbarSize){var e=document.createElement("div");e.style.cssText="width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;",document.body.appendChild(e),t.scrollbarSize=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return t.scrollbarSize}},e.magnificPopup={instance:null,proto:s.prototype,modules:[],open:function(t,i){return p(),(t=t?e.extend(!0,{},t):{}).isObj=!0,t.index=i||0,this.instance.open(t)},close:function(){return e.magnificPopup.instance&&e.magnificPopup.instance.close()},registerModule:function(t,i){i.options&&(e.magnificPopup.defaults[t]=i.options),e.extend(this.proto,i.proto),this.modules.push(t)},defaults:{disableOn:0,key:null,midClick:!1,mainClass:"",preloader:!0,focus:"",closeOnContentClick:!1,closeOnBgClick:!0,closeBtnInside:!0,showCloseBtn:!0,enableEscapeKey:!0,modal:!1,alignTop:!1,removalDelay:0,prependTo:null,fixedContentPos:"auto",fixedBgPos:"auto",overflowY:"auto",closeMarkup:'<button title="%title%" type="button" class="mfp-close">×</button>',tClose:"Close (Esc)",tLoading:"Loading...",autoFocusLast:!0}},e.fn.magnificPopup=function(i){p();var n=e(this);if("string"==typeof i)if("open"===i){var o,a=l?n.data("magnificPopup"):n[0].magnificPopup,r=parseInt(arguments[1],10)||0;a.items?o=a.items[r]:(o=n,a.delegate&&(o=o.find(a.delegate)),o=o.eq(r)),t._openClick({mfpEl:o},n,a)}else t.isOpen&&t[i].apply(t,Array.prototype.slice.call(arguments,1));else i=e.extend(!0,{},i),l?n.data("magnificPopup",i):n[0].magnificPopup=i,t.addGroup(n,i);return n};var g,m,v,_=function(){v&&(m.after(v.addClass(g)).detach(),v=null)};e.magnificPopup.registerModule("inline",{options:{hiddenClass:"hide",markup:"",tNotFound:"Content not found"},proto:{initInline:function(){t.types.push("inline"),d("Close.inline",(function(){_()}))},getInline:function(i,n){if(_(),i.src){var o=t.st.inline,a=e(i.src);if(a.length){var r=a[0].parentNode;r&&r.tagName&&(m||(g=o.hiddenClass,m=u(g),g="mfp-"+g),v=a.after(m).detach().removeClass(g)),t.updateStatus("ready")}else t.updateStatus("error",o.tNotFound),a=e("<div>");return i.inlineElement=a,a}return t.updateStatus("ready"),t._parseMarkup(n,{},i),n}}});var b,y=function(){b&&e(document.body).removeClass(b)},x=function(){y(),t.req&&t.req.abort()};e.magnificPopup.registerModule("ajax",{options:{settings:null,cursor:"mfp-ajax-cur",tError:'<a href="%url%">The content</a> could not be loaded.'},proto:{initAjax:function(){t.types.push("ajax"),b=t.st.ajax.cursor,d("Close.ajax",x),d("BeforeChange.ajax",x)},getAjax:function(i){b&&e(document.body).addClass(b),t.updateStatus("loading");var n=e.extend({url:i.src,success:function(n,o,a){var r={data:n,xhr:a};f("ParseAjax",r),t.appendContent(e(r.data),"ajax"),i.finished=!0,y(),t._setFocus(),setTimeout((function(){t.wrap.addClass("mfp-ready")}),16),t.updateStatus("ready"),f("AjaxContentAdded")},error:function(){y(),i.finished=i.loadError=!0,t.updateStatus("error",t.st.ajax.tError.replace("%url%",i.src))}},t.st.ajax.settings);return t.req=e.ajax(n),""}}});var w,k,C=function(i){if(i.data&&void 0!==i.data.title)return i.data.title;var n=t.st.image.titleSrc;if(n){if(e.isFunction(n))return n.call(t,i);if(i.el)return i.el.attr(n)||""}return""};e.magnificPopup.registerModule("image",{options:{markup:'<div class="mfp-figure"><div class="mfp-close"></div><figure><div class="mfp-img"></div><figcaption><div class="mfp-bottom-bar"><div class="mfp-title"></div><div class="mfp-counter"></div></div></figcaption></figure></div>',cursor:"mfp-zoom-out-cur",titleSrc:"title",verticalFit:!0,tError:'<a href="%url%">The image</a> could not be loaded.'},proto:{initImage:function(){var i=t.st.image,n=".image";t.types.push("image"),d("Open"+n,(function(){"image"===t.currItem.type&&i.cursor&&e(document.body).addClass(i.cursor)})),d("Close"+n,(function(){i.cursor&&e(document.body).removeClass(i.cursor),c.off("resize.mfp")})),d("Resize"+n,t.resizeImage),t.isLowIE&&d("AfterChange",t.resizeImage)},resizeImage:function(){var e=t.currItem;if(e&&e.img&&t.st.image.verticalFit){var i=0;t.isLowIE&&(i=parseInt(e.img.css("padding-top"),10)+parseInt(e.img.css("padding-bottom"),10)),e.img.css("max-height",t.wH-i)}},_onImageHasSize:function(e){e.img&&(e.hasSize=!0,w&&clearInterval(w),e.isCheckingImgSize=!1,f("ImageHasSize",e),e.imgHidden&&(t.content&&t.content.removeClass("mfp-loading"),e.imgHidden=!1))},findImageSize:function(e){var i=0,n=e.img[0],o=function(a){w&&clearInterval(w),w=setInterval((function(){n.naturalWidth>0?t._onImageHasSize(e):(i>200&&clearInterval(w),3==++i?o(10):40===i?o(50):100===i&&o(500))}),a)};o(1)},getImage:function(i,n){var o=0,a=function(){i&&(i.img[0].complete?(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("ready")),i.hasSize=!0,i.loaded=!0,f("ImageLoadComplete")):++o<200?setTimeout(a,100):r())},r=function(){i&&(i.img.off(".mfploader"),i===t.currItem&&(t._onImageHasSize(i),t.updateStatus("error",s.tError.replace("%url%",i.src))),i.hasSize=!0,i.loaded=!0,i.loadError=!0)},s=t.st.image,l=n.find(".mfp-img");if(l.length){var c=document.createElement("img");c.className="mfp-img",i.el&&i.el.find("img").length&&(c.alt=i.el.find("img").attr("alt")),i.img=e(c).on("load.mfploader",a).on("error.mfploader",r),c.src=i.src,l.is("img")&&(i.img=i.img.clone()),(c=i.img[0]).naturalWidth>0?i.hasSize=!0:c.width||(i.hasSize=!1)}return t._parseMarkup(n,{title:C(i),img_replaceWith:i.img},i),t.resizeImage(),i.hasSize?(w&&clearInterval(w),i.loadError?(n.addClass("mfp-loading"),t.updateStatus("error",s.tError.replace("%url%",i.src))):(n.removeClass("mfp-loading"),t.updateStatus("ready")),n):(t.updateStatus("loading"),i.loading=!0,i.hasSize||(i.imgHidden=!0,n.addClass("mfp-loading"),t.findImageSize(i)),n)}}}),e.magnificPopup.registerModule("zoom",{options:{enabled:!1,easing:"ease-in-out",duration:300,opener:function(e){return e.is("img")?e:e.find("img")}},proto:{initZoom:function(){var e,i=t.st.zoom,n=".zoom";if(i.enabled&&t.supportsTransition){var o,a,r=i.duration,s=function(e){var t=e.clone().removeAttr("style").removeAttr("class").addClass("mfp-animated-image"),n="all "+i.duration/1e3+"s "+i.easing,o={position:"fixed",zIndex:9999,left:0,top:0,"-webkit-backface-visibility":"hidden"},a="transition";return o["-webkit-"+a]=o["-moz-"+a]=o["-o-"+a]=o[a]=n,t.css(o),t},l=function(){t.content.css("visibility","visible")};d("BuildControls"+n,(function(){if(t._allowZoom()){if(clearTimeout(o),t.content.css("visibility","hidden"),!(e=t._getItemToZoom()))return void l();(a=s(e)).css(t._getOffset()),t.wrap.append(a),o=setTimeout((function(){a.css(t._getOffset(!0)),o=setTimeout((function(){l(),setTimeout((function(){a.remove(),e=a=null,f("ZoomAnimationEnded")}),16)}),r)}),16)}})),d("BeforeClose"+n,(function(){if(t._allowZoom()){if(clearTimeout(o),t.st.removalDelay=r,!e){if(!(e=t._getItemToZoom()))return;a=s(e)}a.css(t._getOffset(!0)),t.wrap.append(a),t.content.css("visibility","hidden"),setTimeout((function(){a.css(t._getOffset())}),16)}})),d("Close"+n,(function(){t._allowZoom()&&(l(),a&&a.remove(),e=null)}))}},_allowZoom:function(){return"image"===t.currItem.type},_getItemToZoom:function(){return!!t.currItem.hasSize&&t.currItem.img},_getOffset:function(i){var n,o=(n=i?t.currItem.img:t.st.zoom.opener(t.currItem.el||t.currItem)).offset(),a=parseInt(n.css("padding-top"),10),r=parseInt(n.css("padding-bottom"),10);o.top-=e(window).scrollTop()-a;var s={width:n.width(),height:(l?n.innerHeight():n[0].offsetHeight)-r-a};return void 0===k&&(k=void 0!==document.createElement("p").style.MozTransform),k?s["-moz-transform"]=s.transform="translate("+o.left+"px,"+o.top+"px)":(s.left=o.left,s.top=o.top),s}}});var j=function(e){if(t.currTemplate.iframe){var i=t.currTemplate.iframe.find("iframe");i.length&&(e||(i[0].src="//about:blank"),t.isIE8&&i.css("display",e?"block":"none"))}};e.magnificPopup.registerModule("iframe",{options:{markup:'<div class="mfp-iframe-scaler"><div class="mfp-close"></div><iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe></div>',srcAction:"iframe_src",patterns:{youtube:{index:"youtube.com",id:"v=",src:"//www.youtube.com/embed/%id%?autoplay=1"},vimeo:{index:"vimeo.com/",id:"/",src:"//player.vimeo.com/video/%id%?autoplay=1"},gmaps:{index:"//maps.google.",src:"%id%&output=embed"}}},proto:{initIframe:function(){t.types.push("iframe"),d("BeforeChange",(function(e,t,i){t!==i&&("iframe"===t?j():"iframe"===i&&j(!0))})),d("Close.iframe",(function(){j()}))},getIframe:function(i,n){var o=i.src,a=t.st.iframe;e.each(a.patterns,(function(){if(o.indexOf(this.index)>-1)return this.id&&(o="string"==typeof this.id?o.substr(o.lastIndexOf(this.id)+this.id.length,o.length):this.id.call(this,o)),o=this.src.replace("%id%",o),!1}));var r={};return a.srcAction&&(r[a.srcAction]=o),t._parseMarkup(n,r,i),t.updateStatus("ready"),n}}});var S=function(e){var i=t.items.length;return e>i-1?e-i:e<0?i+e:e},G=function(e,t,i){return e.replace(/%curr%/gi,t+1).replace(/%total%/gi,i)};e.magnificPopup.registerModule("gallery",{options:{enabled:!1,arrowMarkup:'<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>',preload:[0,2],navigateByImgClick:!0,arrows:!0,tPrev:"Previous (Left arrow key)",tNext:"Next (Right arrow key)",tCounter:"%curr% of %total%"},proto:{initGallery:function(){var i=t.st.gallery,o=".mfp-gallery";if(t.direction=!0,!i||!i.enabled)return!1;a+=" mfp-gallery",d("Open"+o,(function(){i.navigateByImgClick&&t.wrap.on("click"+o,".mfp-img",(function(){if(t.items.length>1)return t.next(),!1})),n.on("keydown"+o,(function(e){37===e.keyCode?t.prev():39===e.keyCode&&t.next()}))})),d("UpdateStatus"+o,(function(e,i){i.text&&(i.text=G(i.text,t.currItem.index,t.items.length))})),d("MarkupParse"+o,(function(e,n,o,a){var r=t.items.length;o.counter=r>1?G(i.tCounter,a.index,r):""})),d("BuildControls"+o,(function(){if(t.items.length>1&&i.arrows&&!t.arrowLeft){var n=i.arrowMarkup,o=t.arrowLeft=e(n.replace(/%title%/gi,i.tPrev).replace(/%dir%/gi,"left")).addClass("mfp-prevent-close"),a=t.arrowRight=e(n.replace(/%title%/gi,i.tNext).replace(/%dir%/gi,"right")).addClass("mfp-prevent-close");o.click((function(){t.prev()})),a.click((function(){t.next()})),t.container.append(o.add(a))}})),d("Change"+o,(function(){t._preloadTimeout&&clearTimeout(t._preloadTimeout),t._preloadTimeout=setTimeout((function(){t.preloadNearbyImages(),t._preloadTimeout=null}),16)})),d("Close"+o,(function(){n.off(o),t.wrap.off("click"+o),t.arrowRight=t.arrowLeft=null}))},next:function(){t.direction=!0,t.index=S(t.index+1),t.updateItemHTML()},prev:function(){t.direction=!1,t.index=S(t.index-1),t.updateItemHTML()},goTo:function(e){t.direction=e>=t.index,t.index=e,t.updateItemHTML()},preloadNearbyImages:function(){var e,i=t.st.gallery.preload,n=Math.min(i[0],t.items.length),o=Math.min(i[1],t.items.length);for(e=1;e<=(t.direction?o:n);e++)t._preloadItem(t.index+e);for(e=1;e<=(t.direction?n:o);e++)t._preloadItem(t.index-e)},_preloadItem:function(i){if(i=S(i),!t.items[i].preloaded){var n=t.items[i];n.parsed||(n=t.parseEl(i)),f("LazyLoad",n),"image"===n.type&&(n.img=e('<img class="mfp-img" />').on("load.mfploader",(function(){n.hasSize=!0})).on("error.mfploader",(function(){n.hasSize=!0,n.loadError=!0,f("LazyLoadError",n)})).attr("src",n.src)),n.preloaded=!0}}}}),e.magnificPopup.registerModule("retina",{options:{replaceSrc:function(e){return e.src.replace(/\.\w+$/,(function(e){return"@2x"+e}))},ratio:1},proto:{initRetina:function(){if(window.devicePixelRatio>1){var e=t.st.retina,i=e.ratio;(i=isNaN(i)?i():i)>1&&(d("ImageHasSize.retina",(function(e,t){t.img.css({"max-width":t.img[0].naturalWidth/i,width:"100%"})})),d("ElementParse.retina",(function(t,n){n.src=e.replaceSrc(n,i)})))}}}}),p()})?n.apply(t,o):n)||(e.exports=a)},99:function(e,t){!function(e){"use strict";Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),i=t.length;--i>=0&&t.item(i)!==this;);return i>-1}),e.addDynamicEventListener=function(e,t,i,n,o){e.addEventListener(t,function(e,t){return function(i){i.target&&i.target.matches(e)&&t.apply(this,arguments)}}(i,n),o)}}(window)}});