Ultimate Member – User Profile & Membership Plugin - Version 1.3.67

Version Description

Download this release

Release Info

Developer champsupertramp
Plugin Icon 128x128 Ultimate Member – User Profile & Membership Plugin
Version 1.3.67
Comparing to
See all releases

Code changes from version 1.3.66 to 1.3.67

admin/assets/js/um-admin-scripts.js CHANGED
@@ -71,7 +71,7 @@ jQuery(document).ready(function() {
71
Select Dropdowns
72
**/
73
74
- jQuery(".umaf-selectjs").select2({
75
allowClear: false,
76
minimumResultsForSearch: 10
77
});
71
Select Dropdowns
72
**/
73
74
+ jQuery(".umaf-selectjs, .ultimate-member_page_um_options .redux-select-item ").select2({
75
allowClear: false,
76
minimumResultsForSearch: 10
77
});
admin/core/lib/ReduxFramework/ReduxCore/core/enqueue.php CHANGED
@@ -218,13 +218,13 @@
218
}
219
220
221
- Redux_CDN::register_script(
222
'select2-js',
223
'//cdn.jsdelivr.net/select2/4.0.2/js/select2.full.min.js',
224
array( 'jquery', 'redux-select2-sortable-js' ),
225
'4.0.2',
226
true
227
- );
228
229
//*****************************************************************
230
// QTip JS
218
}
219
220
221
+ /*Redux_CDN::register_script(
222
'select2-js',
223
'//cdn.jsdelivr.net/select2/4.0.2/js/select2.full.min.js',
224
array( 'jquery', 'redux-select2-sortable-js' ),
225
'4.0.2',
226
true
227
+ );*/
228
229
//*****************************************************************
230
// QTip JS
assets/js/um-functions.js CHANGED
@@ -990,7 +990,7 @@ jQuery(function(){
990
991
// Fixed touchscreen sensitivity
992
jQuery(document).on('touchend', function(){
993
- jQuery(".select2-search, .select2-focusser").remove();
994
})
995
996
});
990
991
// Fixed touchscreen sensitivity
992
jQuery(document).on('touchend', function(){
993
+ //jQuery(".select2-search, .select2-focusser").remove();
994
})
995
996
});
assets/js/um.min.js CHANGED
@@ -4,5 +4,5 @@ var n=this,r=(e.id+"-container",e.id+"-results");this.container=e,this.$selectio
4
}}var r={};r.fileapi=void 0!==e("<input type='file'/>").get(0).files,r.formdata=void 0!==window.FormData;var a=!!e.fn.prop;e.fn.attr2=function(){if(!a)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function i(i){var n,r,a=e.param(i,t.traditional).split("&"),o=a.length,s=[];for(n=0;o>n;n++)a[n]=a[n].replace(/\+/g," "),r=a[n].split("="),s.push([decodeURIComponent(r[0]),decodeURIComponent(r[1])]);return s}function o(n){for(var r=new FormData,a=0;a<n.length;a++)r.append(n[a].name,n[a].value);if(t.extraData){var o=i(t.extraData);for(a=0;a<o.length;a++)o[a]&&r.append(o[a][0],o[a][1])}t.data=null;var s=e.extend(!0,{},e.ajaxSettings,t,{contentType:!1,processData:!1,cache:!1,type:l||"POST"});t.uploadProgress&&(s.xhr=function(){var i=e.ajaxSettings.xhr();return i.upload&&i.upload.addEventListener("progress",function(e){var i=0,n=e.loaded||e.position,r=e.total;e.lengthComputable&&(i=Math.ceil(n/r*100)),t.uploadProgress(e,n,r,i)},!1),i}),s.data=null;var u=s.beforeSend;return s.beforeSend=function(e,i){t.formData?i.data=t.formData:i.data=r,u&&u.call(this,e,i)},e.ajax(s)}function s(i){function r(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(i){n("cannot get iframe.contentWindow document: "+i)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(i){n("cannot get iframe.contentDocument: "+i),t=e.document}return t}function o(){function t(){try{var e=r(v).readyState;n("state = "+e),e&&"uninitialized"==e.toLowerCase()&&setTimeout(t,50)}catch(i){n("Server abort: ",i," (",i.name,")"),s(k),x&&clearTimeout(x),x=void 0}}var i=d.attr2("target"),a=d.attr2("action"),o="multipart/form-data",u=d.attr("enctype")||d.attr("encoding")||o;j.setAttribute("target",f),(!l||/post/i.test(l))&&j.setAttribute("method","POST"),a!=h.url&&j.setAttribute("action",h.url),h.skipEncodingOverride||l&&!/post/i.test(l)||d.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),h.timeout&&(x=setTimeout(function(){_=!0,s(S)},h.timeout));var c=[];try{if(h.extraData)for(var p in h.extraData)h.extraData.hasOwnProperty(p)&&(e.isPlainObject(h.extraData[p])&&h.extraData[p].hasOwnProperty("name")&&h.extraData[p].hasOwnProperty("value")?c.push(e('<input type="hidden" name="'+h.extraData[p].name+'">').val(h.extraData[p].value).appendTo(j)[0]):c.push(e('<input type="hidden" name="'+p+'">').val(h.extraData[p]).appendTo(j)[0]));h.iframeTarget||g.appendTo("body"),v.attachEvent?v.attachEvent("onload",s):v.addEventListener("load",s,!1),setTimeout(t,15);try{j.submit()}catch(m){var y=document.createElement("form").submit;y.apply(j)}}finally{j.setAttribute("action",a),j.setAttribute("enctype",u),i?j.setAttribute("target",i):d.removeAttr("target"),e(c).remove()}}function s(t){if(!y.aborted&&!O){if(T=r(v),T||(n("cannot access response document"),t=k),t===S&&y)return y.abort("timeout"),void C.reject(y,"timeout");if(t==k&&y)return y.abort("server abort"),void C.reject(y,"error","server abort");if(T&&T.location.href!=h.iframeSrc||_){v.detachEvent?v.detachEvent("onload",s):v.removeEventListener("load",s,!1);var i,a="success";try{if(_)throw"timeout";var o="xml"==h.dataType||T.XMLDocument||e.isXMLDoc(T);if(n("isXml="+o),!o&&window.opera&&(null===T.body||!T.body.innerHTML)&&--A)return n("requeing onLoad callback, DOM not available"),void setTimeout(s,250);var l=T.body?T.body:T.documentElement;y.responseText=l?l.innerHTML:null,y.responseXML=T.XMLDocument?T.XMLDocument:T,o&&(h.dataType="xml"),y.getResponseHeader=function(e){var t={"content-type":h.dataType};return t[e.toLowerCase()]},l&&(y.status=Number(l.getAttribute("status"))||y.status,y.statusText=l.getAttribute("statusText")||y.statusText);var u=(h.dataType||"").toLowerCase(),c=/(json|script|text)/.test(u);if(c||h.textarea){var d=T.getElementsByTagName("textarea")[0];if(d)y.responseText=d.value,y.status=Number(d.getAttribute("status"))||y.status,y.statusText=d.getAttribute("statusText")||y.statusText;else if(c){var f=T.getElementsByTagName("pre")[0],m=T.getElementsByTagName("body")[0];f?y.responseText=f.textContent?f.textContent:f.innerText:m&&(y.responseText=m.textContent?m.textContent:m.innerText)}}else"xml"==u&&!y.responseXML&&y.responseText&&(y.responseXML=M(y.responseText));try{D=I(y,u,h)}catch(b){a="parsererror",y.error=i=b||a}}catch(b){n("error caught: ",b),a="error",y.error=i=b||a}y.aborted&&(n("upload aborted"),a=null),y.status&&(a=y.status>=200&&y.status<300||304===y.status?"success":"error"),"success"===a?(h.success&&h.success.call(h.context,D,"success",y),C.resolve(y.responseText,"success",y),p&&e.event.trigger("ajaxSuccess",[y,h])):a&&(void 0===i&&(i=y.statusText),h.error&&h.error.call(h.context,y,a,i),C.reject(y,"error",i),p&&e.event.trigger("ajaxError",[y,h,i])),p&&e.event.trigger("ajaxComplete",[y,h]),p&&!--e.active&&e.event.trigger("ajaxStop"),h.complete&&h.complete.call(h.context,y,a),O=!0,h.timeout&&clearTimeout(x),setTimeout(function(){h.iframeTarget?g.attr("src",h.iframeSrc):g.remove(),y.responseXML=null},100)}}}var u,c,h,p,f,g,v,y,b,w,_,x,j=d[0],C=e.Deferred();if(C.abort=function(e){y.abort(e)},i)for(c=0;c<m.length;c++)u=e(m[c]),a?u.prop("disabled",!1):u.removeAttr("disabled");if(h=e.extend(!0,{},e.ajaxSettings,t),h.context=h.context||h,f="jqFormIO"+(new Date).getTime(),h.iframeTarget?(g=e(h.iframeTarget),w=g.attr2("name"),w?f=w:g.attr2("name",f)):(g=e('<iframe name="'+f+'" src="'+h.iframeSrc+'" />'),g.css({position:"absolute",top:"-1000px",left:"-1000px"})),v=g[0],y={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var i="timeout"===t?"timeout":"aborted";n("aborting upload... "+i),this.aborted=1;try{v.contentWindow.document.execCommand&&v.contentWindow.document.execCommand("Stop")}catch(r){}g.attr("src",h.iframeSrc),y.error=i,h.error&&h.error.call(h.context,y,i,t),p&&e.event.trigger("ajaxError",[y,h,i]),h.complete&&h.complete.call(h.context,y,i)}},p=h.global,p&&0===e.active++&&e.event.trigger("ajaxStart"),p&&e.event.trigger("ajaxSend",[y,h]),h.beforeSend&&h.beforeSend.call(h.context,y,h)===!1)return h.global&&e.active--,C.reject(),C;if(y.aborted)return C.reject(),C;b=j.clk,b&&(w=b.name,w&&!b.disabled&&(h.extraData=h.extraData||{},h.extraData[w]=b.value,"image"==b.type&&(h.extraData[w+".x"]=j.clk_x,h.extraData[w+".y"]=j.clk_y)));var S=1,k=2,Q=e("meta[name=csrf-token]").attr("content"),$=e("meta[name=csrf-param]").attr("content");amp;&Q&&(h.extraData=h.extraData||{},h.extraData[$]=Q),h.forceSync?o():setTimeout(o,10);var D,T,O,A=50,M=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},E=e.parseJSON||function(e){return window.eval("("+e+")")},I=function(t,i,n){var r=t.getResponseHeader("content-type")||"",a="xml"===i||!i&&r.indexOf("xml")>=0,o=a?t.responseXML:t.responseText;return a&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),n&&n.dataFilter&&(o=n.dataFilter(o,i)),"string"==typeof o&&("json"===i||!i&&r.indexOf("json")>=0?o=E(o):("script"===i||!i&&r.indexOf("javascript")>=0)&&e.globalEval(o)),o};return C}if(!this.length)return n("ajaxSubmit: skipping submit process - no element selected"),this;var l,u,c,d=this;"function"==typeof t?t={success:t}:void 0===t&&(t={}),l=t.type||this.attr2("method"),u=t.url||this.attr2("action"),c="string"==typeof u?e.trim(u):"",c=c||window.location.href||"",c&&(c=(c.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:c,success:e.ajaxSettings.success,type:l||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var h={};if(this.trigger("form-pre-serialize",[this,t,h]),h.veto)return n("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return n("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var p=t.traditional;void 0===p&&(p=e.ajaxSettings.traditional);var f,m=[],g=this.formToArray(t.semantic,m);if(t.data&&(t.extraData=t.data,f=e.param(t.data,p)),t.beforeSubmit&&t.beforeSubmit(g,this,t)===!1)return n("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[g,this,t,h]),h.veto)return n("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var v=e.param(g,p);f&&(v=v?v+"&"+f:f),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+v,t.data=null):t.data=v;var y=[];if(t.resetForm&&y.push(function(){d.resetForm()}),t.clearForm&&y.push(function(){d.clearForm(t.includeHidden)}),!t.dataType&&t.target){var b=t.success||function(){};y.push(function(i){var n=t.replaceTarget?"replaceWith":"html";e(t.target)[n](i).each(b,arguments)})}else t.success&&y.push(t.success);if(t.success=function(e,i,n){for(var r=t.context||this,a=0,o=y.length;o>a;a++)y[a].apply(r,[e,i,n||d,d])},t.error){var w=t.error;t.error=function(e,i,n){var r=t.context||this;w.apply(r,[e,i,n,d])}}if(t.complete){var _=t.complete;t.complete=function(e,i){var n=t.context||this;_.apply(n,[e,i,d])}}var x=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}),j=x.length>0,C="multipart/form-data",S=d.attr("enctype")==C||d.attr("encoding")==C,k=r.fileapi&&r.formdata;n("fileAPI :"+k);var Q,$=(j||S)&&!k;t.iframe!==!1&&(t.iframe||$)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){Q=s(g)}):Q=s(g):Q=(j||S)&&k?o(g):e.ajax(t),d.removeData("jqxhr").data("jqxhr",Q);for(var D=0;D<m.length;D++)m[D]=null;return this.trigger("form-submit-notify",[this,t]),this},e.fn.ajaxForm=function(r){if(r=r||{},r.delegation=r.delegation&&e.isFunction(e.fn.on),!r.delegation&&0===this.length){var a={s:this.selector,c:this.context};return!e.isReady&&a.s?(n("DOM not ready, queuing ajaxForm"),e(function(){e(a.s,a.c).ajaxForm(r)}),this):(n("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return r.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,i).on("submit.form-plugin",this.selector,r,t).on("click.form-plugin",this.selector,r,i),this):this.ajaxFormUnbind().bind("submit.form-plugin",r,t).bind("click.form-plugin",r,i)},e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t,i){var n=[];if(0===this.length)return n;var a,o=this[0],s=this.attr("id"),l=t?o.getElementsByTagName("*"):o.elements;if(l&&!/MSIE [678]/.test(navigator.userAgent)&&(l=e(l).get()),s&&(a=e(':input[form="'+s+'"]').get(),a.length&&(l=(l||[]).concat(a))),!l||!l.length)return n;var u,c,d,h,p,f,m;for(u=0,f=l.length;f>u;u++)if(p=l[u],d=p.name,d&&!p.disabled)if(t&&o.clk&&"image"==p.type)o.clk==p&&(n.push({name:d,value:e(p).val(),type:p.type}),n.push({name:d+".x",value:o.clk_x},{name:d+".y",value:o.clk_y}));else if(h=e.fieldValue(p,!0),h&&h.constructor==Array)for(i&&i.push(p),c=0,m=h.length;m>c;c++)n.push({name:d,value:h[c]});else if(r.fileapi&&"file"==p.type){i&&i.push(p);var g=p.files;if(g.length)for(c=0;c<g.length;c++)n.push({name:d,value:g[c],type:p.type});else n.push({name:d,value:"",type:p.type})}else null!==h&&"undefined"!=typeof h&&(i&&i.push(p),n.push({name:d,value:h,type:p.type,required:p.required}));if(!t&&o.clk){var v=e(o.clk),y=v[0];d=y.name,d&&!y.disabled&&"image"==y.type&&(n.push({name:d,value:v.val()}),n.push({name:d+".x",value:o.clk_x},{name:d+".y",value:o.clk_y}))}return n},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var i=[];return this.each(function(){var n=this.name;if(n){var r=e.fieldValue(this,t);if(r&&r.constructor==Array)for(var a=0,o=r.length;o>a;a++)i.push({name:n,value:r[a]});else null!==r&&"undefined"!=typeof r&&i.push({name:this.name,value:r})}}),e.param(i)},e.fn.fieldValue=function(t){for(var i=[],n=0,r=this.length;r>n;n++){var a=this[n],o=e.fieldValue(a,t);null===o||"undefined"==typeof o||o.constructor==Array&&!o.length||(o.constructor==Array?e.merge(i,o):i.push(o))}return i},e.fieldValue=function(t,i){var n=t.name,r=t.type,a=t.tagName.toLowerCase();if(void 0===i&&(i=!0),i&&(!n||t.disabled||"reset"==r||"button"==r||("checkbox"==r||"radio"==r)&&!t.checked||("submit"==r||"image"==r)&&t.form&&t.form.clk!=t||"select"==a&&-1==t.selectedIndex))return null;if("select"==a){var o=t.selectedIndex;if(0>o)return null;for(var s=[],l=t.options,u="select-one"==r,c=u?o+1:l.length,d=u?o:0;c>d;d++){var h=l[d];if(h.selected){var p=h.value;if(p||(p=h.attributes&&h.attributes.value&&!h.attributes.value.specified?h.text:h.value),u)return p;s.push(p)}}return s}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var i=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)#x2F;i;return this.each(function(){var n=this.type,r=this.tagName.toLowerCase();i.test(n)||"textarea"==r?this.value="":"checkbox"==n||"radio"==n?this.checked=!1:"select"==r?this.selectedIndex=-1:"file"==n?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(t===!0&&/hidden/.test(n)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var i=this.type;if("checkbox"==i||"radio"==i)this.checked=t;else if("option"==this.tagName.toLowerCase()){var n=e(this).parent("select");t&&n[0]&&"select-one"==n[0].type&&n.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1}),function(e){void 0==e.fn.ajaxForm;var t={};t.fileapi=void 0!==e("<input type='file'/>").get(0).files,t.formdata=void 0!==window.FormData,e.fn.uploadFile=function(i){function n(){h.afterUploadAll&&!g&&(g=!0,function e(){0!=f.sCounter&&f.sCounter+f.fCounter==f.tCounter?(h.afterUploadAll(f),g=!1):window.setTimeout(e,100)}())}function r(t,i,n){n.on("dragenter",function(t){t.stopPropagation(),t.preventDefault(),e(this).css("border","2px dashed #ddd")}),n.on("dragover",function(e){e.stopPropagation(),e.preventDefault()}),n.on("drop",function(n){e(this).css("border","2px dashed #ddd"),n.preventDefault(),t.errorLog.html("");var r=n.originalEvent.dataTransfer.files;return!i.multiple&&r.length>1?void(i.showError&&e("<div class='um-error-block'>"+i.multiDragErrorStr+"</div>").appendTo(t.errorLog)):void(0!=i.onSelect(r)&&o(i,t,r))}),e(document).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}),e(document).on("dragover",function(e){e.stopPropagation(),e.preventDefault(),n.css("border","2px dashed #ddd")}),e(document).on("drop",function(e){e.stopPropagation(),e.preventDefault(),n.css("border","2px dashed #ddd")})}function a(t){var i=[];i="string"==jQuery.type(t)?t.split("&"):e.param(t).split("&");var n,r,a=i.length,o=[];for(n=0;a>n;n++)i[n]=i[n].replace(/\+/g," "),r=i[n].split("="),o.push([decodeURIComponent(r[0]),decodeURIComponent(r[1])]);return o}function o(t,i,n){for(var r=0;r<n.length;r++)if(s(i,t,n[r].name))if(-1!=t.maxFileSize&&n[r].size>t.maxFileSize)t.showError&&e("<div class='um-error-block'>"+t.sizeErrorStr+"</div>").appendTo(i.errorLog);else if(-1!=t.maxFileCount&&i.selectedFiles>=t.maxFileCount)t.showError&&e("<div class='um-error-block'>"+t.maxFileCountErrorStr+"</div>").appendTo(i.errorLog);else{i.selectedFiles++;var o=t,l=new FormData,u=t.fileName.replace("[]","");l.append(u,n[r]);var h=t.formData;if(h)for(var p=a(h),f=0;f<p.length;f++)p[f]&&l.append(p[f][0],p[f][1]);o.fileData=l;var m=new c(i,t),g="";g=t.showFileCounter?i.fileCounter+t.fileCounterStyle+n[r].name:n[r].name,m.filename.html(g);var v=e("<form style='display:block; position:absolute;left: 150px;' class='"+i.formGroup+"' method='"+t.method+"' action='"+t.url+"' enctype='"+t.enctype+"'></form>");v.appendTo("body");var y=[];y.push(n[r].name),d(v,o,m,y,i),i.fileCounter++}else t.showError&&e("<div class='um-error-block'>"+t.extErrorStr+"</div>").appendTo(i.errorLog)}function s(e,t,i){var n=t.allowedTypes.toLowerCase().split(","),r=i.split(".").pop().toLowerCase();return"*"!=t.allowedTypes&&jQuery.inArray(r,n)<0?!1:!0}function l(t,i){if(t.showFileCounter){var n=e(".upload-filename").length;i.fileCounter=n+1,e(".upload-filename").each(function(i,r){var a=e(this).html().split(t.fileCounterStyle),o=(parseInt(a[0])-1,n+t.fileCounterStyle+a[1]);e(this).html(o),n--})}}function u(i,n,r,a){var h="ajax-upload-id-"+(new Date).getTime(),p=e("<form method='"+r.method+"' action='"+r.url+"' enctype='"+r.enctype+"'></form>"),f="<input type='file' id='"+h+"' name='"+r.fileName+"'/>";r.multiple&&(r.fileName.indexOf("[]")!=r.fileName.length-2&&(r.fileName+="[]"),f="<input type='file' id='"+h+"' name='"+r.fileName+"' multiple/>");var m=e(f).appendTo(p);m.change(function(){i.errorLog.html("");var h=(r.allowedTypes.toLowerCase().split(","),[]);if(this.files){for(y=0;y<this.files.length;y++)h.push(this.files[y].name);if(0==r.onSelect(this.files))return}else{var f=e(this).val(),m=[];if(h.push(f),!s(i,r,f))return void(r.showError&&e("<div class='um-error-block'>"+r.extErrorStr+"</div>").appendTo(i.errorLog));if(m.push({name:f,size:"NA"}),0==r.onSelect(m))return}if(l(r,i),a.unbind("click"),p.hide(),u(i,n,r,a),p.addClass(n),t.fileapi&&t.formdata){p.removeClass(n);var g=this.files;o(r,i,g)}else{for(var v="",y=0;y<h.length;y++)v+=r.showFileCounter?i.fileCounter+r.fileCounterStyle+h[y]+"<br>":h[y]+"<br>",i.fileCounter++;if(-1!=r.maxFileCount&&i.selectedFiles+h.length>r.maxFileCount)return void(r.showError&&e("<div class='um-error-block'>"+r.maxFileCountErrorStr+"</div>").appendTo(i.errorLog));i.selectedFiles+=h.length;var b=new c(i,r);b.filename.html(v),d(p,r,b,h,i)}}),p.css({margin:0,padding:0});var g=e(a).width()+10;10==g&&(g=120);var v=a.height()+10;10==v&&(v=35),a.css({position:"relative",overflow:"hidden",cursor:"default"}),m.css({position:"absolute",cursor:"pointer",top:"0px",width:"100%",height:"34px",left:"0px","z-index":"100",opacity:"0.0",filter:"alpha(opacity=0)","-ms-filter":"alpha(opacity=0)","-khtml-opacity":"0.0","-moz-opacity":"0.0"}),p.appendTo(a)}function c(t,i){return this.statusbar=e("<div class='upload-statusbar'></div>"),this.filename=e("<div class='upload-filename'></div>").appendTo(this.statusbar),this.progressDiv=e("<div class='upload-progress'>").appendTo(this.statusbar).hide(),this.progressbar=e("<div class='upload-bar "+t.formGroup+"'></div>").appendTo(this.progressDiv),this.abort=e("<div class='upload-red "+t.formGroup+"'>"+i.abortStr+"</div>").appendTo(this.statusbar).hide(),this.cancel=e("<div class='upload-red'>"+i.cancelStr+"</div>").appendTo(this.statusbar).hide(),this.done=e("<div class='upload-green'>"+i.doneStr+"</div>").appendTo(this.statusbar).hide(),this.del=e("<div class='upload-red'>"+i.deletelStr+"</div>").appendTo(this.statusbar).hide(),t.errorLog.after(this.statusbar),this}function d(e,i,r,o,s){var u={cache:!1,contentType:!1,processData:!1,forceSync:!1,data:i.formData,formData:i.fileData,dataType:i.returnType,beforeSubmit:function(t,l,u){if(0!=i.onSubmit.call(this,o)){var c=i.dynamicFormData();if(c){var d=a(c);if(d)for(var h=0;h<d.length;h++)d[h]&&(void 0!=i.fileData?u.formData.append(d[h][0],d[h][1]):u.data[d[h][0]]=d[h][1])}return s.tCounter+=o.length,n(),!0}return r.statusbar.append("<div class='um-error-block'>"+i.uploadErrorStr+"</div>"),r.cancel.show(),e.remove(),r.cancel.click(function(){r.statusbar.remove()}),!1},beforeSend:function(e,n){r.progressDiv.show(),r.cancel.hide(),r.done.hide(),i.showAbort&&(r.abort.show(),r.abort.click(function(){e.abort(),s.selectedFiles-=o.length})),t.formdata?r.progressbar.width("1%"):r.progressbar.width("5%")},uploadProgress:function(e,t,n,a){a>98&&(a=98);var o=a+"%";a>1&&r.progressbar.width(o),i.showProgress&&(r.progressbar.html(o),r.progressbar.css("text-align","center"))},success:function(t,n,a){s.responses.push(t),r.progressbar.width("100%"),i.showProgress&&(r.progressbar.html("100%"),r.progressbar.css("text-align","center")),r.abort.hide(),i.onSuccess.call(this,o,t,a),i.showStatusAfterSuccess?(i.showDone?(r.done.show(),r.done.click(function(){r.statusbar.hide("slow"),r.statusbar.remove()})):r.done.hide(),i.showDelete?(r.del.show(),r.del.click(function(){r.statusbar.hide().remove(),i.deleteCallback&&i.deleteCallback.call(this,t,r),s.selectedFiles-=o.length,l(i,s)})):r.del.hide()):(r.statusbar.hide("slow"),r.statusbar.remove()),e.remove(),s.sCounter+=o.length},error:function(t,n,a){r.abort.hide(),"abort"==t.statusText?(r.statusbar.hide("slow").remove(),l(i,s)):(i.onError.call(this,o,n,a),i.showStatusAfterError?(r.progressDiv.hide(),r.statusbar.append("<span class='um-error-block'>ERROR: "+a+"</span>")):(r.statusbar.hide(),r.statusbar.remove()),s.selectedFiles-=o.length),e.remove(),s.fCounter+=o.length}};i.autoSubmit?e.ajaxSubmit(u):(i.showCancel&&(r.cancel.show(),r.cancel.click(function(){e.remove(),r.statusbar.remove(),s.selectedFiles-=o.length,l(i,s)})),e.ajaxForm(u))}var h=e.extend({url:"",method:"POST",enctype:"multipart/form-data",formData:null,returnType:null,allowedTypes:"*",fileName:"file",formData:{},dynamicFormData:function(){return{}},maxFileSize:-1,maxFileCount:-1,multiple:!0,dragDrop:!0,autoSubmit:!0,showCancel:!0,showAbort:!0,showDone:!0,showDelete:!1,showError:!0,showStatusAfterSuccess:!0,showStatusAfterError:!0,showFileCounter:!0,fileCounterStyle:"). ",showProgress:!1,onSelect:function(e){return!0},onSubmit:function(e,t){},onSuccess:function(e,t,i){},onError:function(e,t,i){},deleteCallback:!1,afterUploadAll:!1,uploadButtonClass:"upload",dragDropStr:"",abortStr:"Abort",cancelStr:"Cancel",deletelStr:"Delete",doneStr:"Done",multiDragErrorStr:"Multiple File Drag &amp; Drop is not allowed.",extErrorStr:"",sizeErrorStr:"",uploadErrorStr:"Upload is not allowed",maxFileCountErrorStr:""},i);this.fileCounter=1,this.selectedFiles=0,this.fCounter=0,this.sCounter=0,this.tCounter=0;var p="upload-"+(new Date).getTime();this.formGroup=p,this.hide(),this.errorLog=e("<div></div>"),this.after(this.errorLog),this.responses=[],t.formdata||(h.dragDrop=!1),t.formdata||(h.multiple=!1);var f=this,m=e("<div>"+e(this).html()+"</div>");e(m).addClass(h.uploadButtonClass),function v(){if(e.fn.ajaxForm){if(h.dragDrop){var t=e('<div class="ajax-upload-dragdrop" style="vertical-align:top;"></div>');e(f).before(t),e(t).append(m),e(t).prepend(e(h.dragDropStr)),r(f,h,t)}else e(f).before(m);u(f,p,h,m)}else window.setTimeout(v,10)}(),this.startUpload=function(){e("."+this.formGroup).each(function(t,i){e(this).is("form")&&e(this).submit()})},this.stopUpload=function(){e(".upload-red").each(function(t,i){e(this).hasClass(f.formGroup)&&e(this).click()})},this.getResponses=function(){return this.responses};var g=!1;return this}}(jQuery),function(e){"function"==typeof define&&define.amd?define("picker",["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):this.Picker=e(jQuery)}(function(e){function t(a,o,l,h){function p(){return t._.node("div",t._.node("div",t._.node("div",t._.node("div",Q.component.nodes(x.open),C.box),C.wrap),C.frame),C.holder,'tabindex="-1"')}function f(){S.data(o,Q).addClass(C.input).val(S.data("value")?Q.get("select",j.format):a.value),j.editable||S.on("focus."+x.id+" click."+x.id,function(e){e.preventDefault(),Q.open()}).on("keydown."+x.id,w),r(a,{haspopup:!0,expanded:!1,readonly:!1,owns:a.id+"_root"})}function m(){r(Q.$root[0],"hidden",!0)}function g(){Q.$holder.on({keydown:w,"focus.toOpen":b,blur:function(){S.removeClass(C.target)},focusin:function(e){Q.$root.removeClass(C.focused),e.stopPropagation()},"mousedown click":function(t){var i=t.target;i!=Q.$holder[0]&&(t.stopPropagation(),"mousedown"!=t.type||e(i).is("input, select, textarea, button, option")||(t.preventDefault(),Q.$holder[0].focus()))}}).on("click","[data-pick], [data-nav], [data-clear], [data-close]",function(){var t=e(this),i=t.data(),n=t.hasClass(C.navDisabled)||t.hasClass(C.disabled),r=s();r=r&&(r.type||r.href),(n||r&&!e.contains(Q.$root[0],r))&&Q.$holder[0].focus(),!n&&i.nav?Q.set("highlight",Q.component.item.highlight,{nav:i.nav}):!n&&"pick"in i?(Q.set("select",i.pick),j.closeOnSelect&&Q.close(!0)):i.clear?(Q.clear(),j.closeOnClear&&Q.close(!0)):i.close&&Q.close(!0)})}function v(){var t;j.hiddenName===!0?(t=a.name,a.name=""):(t=["string"==typeof j.hiddenPrefix?j.hiddenPrefix:"","string"==typeof j.hiddenSuffix?j.hiddenSuffix:"_submit"],t=t[0]+a.name+t[1]),Q._hidden=e('<input type=hidden name="'+t+'"'+(S.data("value")||a.value?' value="'+Q.get("select",j.formatSubmit)+'"':"")+">")[0],S.on("change."+x.id,function(){Q._hidden.value=a.value?Q.get("select",j.formatSubmit):""})}function y(){_&&d?Q.$holder.find("."+C.frame).one("transitionend",function(){Q.$holder[0].focus()}):Q.$holder[0].focus()}function b(e){e.stopPropagation(),S.addClass(C.target),Q.$root.addClass(C.focused),Q.open()}function w(e){var t=e.keyCode,i=/^(8|46)#x2F;.test(t);return 27==t?(Q.close(!0),!1):void((32==t||i||!x.open&&Q.component.key[t])&&(e.preventDefault(),e.stopPropagation(),i?Q.clear().close():Q.open()))}if(!a)return t;var _=!1,x={id:a.id||"P"+Math.abs(~~(Math.random()*new Date))},j=l?e.extend(!0,{},l.defaults,h):h||{},C=e.extend({},t.klasses(),j.klass),S=e(a),k=function(){return this.start()},Q=k.prototype={constructor:k,$node:S,start:function(){return x&&x.start?Q:(x.methods={},x.start=!0,x.open=!1,x.type=a.type,a.autofocus=a==s(),a.readOnly=!j.editable,a.id=a.id||x.id,"text"!=a.type&&(a.type="text"),Q.component=new l(Q,j),Q.$root=e('<div class="'+C.picker+'" id="'+a.id+'_root" />'),m(),Q.$holder=e(p()).appendTo(Q.$root),g(),j.formatSubmit&&v(),f(),j.containerHidden?e(j.containerHidden).append(Q._hidden):S.after(Q._hidden),j.container?e(j.container).append(Q.$root):S.after(Q.$root),Q.on({start:Q.component.onStart,render:Q.component.onRender,stop:Q.component.onStop,open:Q.component.onOpen,close:Q.component.onClose,set:Q.component.onSet}).on({start:j.onStart,render:j.onRender,stop:j.onStop,open:j.onOpen,close:j.onClose,set:j.onSet}),_=i(Q.$holder[0]),a.autofocus&&Q.open(),Q.trigger("start").trigger("render"))},render:function(t){return t?(Q.$holder=e(p()),g(),Q.$root.html(Q.$holder)):Q.$root.find("."+C.box).html(Q.component.nodes(x.open)),Q.trigger("render")},stop:function(){return x.start?(Q.close(),Q._hidden&&Q._hidden.parentNode.removeChild(Q._hidden),Q.$root.remove(),S.removeClass(C.input).removeData(o),setTimeout(function(){S.off("."+x.id)},0),a.type=x.type,a.readOnly=!1,Q.trigger("stop"),x.methods={},x.start=!1,Q):Q},open:function(i){return x.open?Q:(S.addClass(C.active),r(a,"expanded",!0),setTimeout(function(){Q.$root.addClass(C.opened),r(Q.$root[0],"hidden",!1)},0),i!==!1&&(x.open=!0,_&&c.css("overflow","hidden").css("padding-right","+="+n()),y(),u.on("click."+x.id+" focusin."+x.id,function(e){var t=e.target;t!=a&&t!=document&&3!=e.which&&Q.close(t===Q.$holder[0])}).on("keydown."+x.id,function(i){var n=i.keyCode,r=Q.component.key[n],a=i.target;27==n?Q.close(!0):a!=Q.$holder[0]||!r&&13!=n?e.contains(Q.$root[0],a)&&13==n&&(i.preventDefault(),a.click()):(i.preventDefault(),r?t._.trigger(Q.component.key.go,Q,[t._.trigger(r)]):Q.$root.find("."+C.highlighted).hasClass(C.disabled)||(Q.set("select",Q.component.item.highlight),j.closeOnSelect&&Q.close(!0)))})),Q.trigger("open"))},close:function(e){return e&&(j.editable?a.focus():(Q.$holder.off("focus.toOpen").focus(),setTimeout(function(){Q.$holder.on("focus.toOpen",b)},0))),S.removeClass(C.active),r(a,"expanded",!1),setTimeout(function(){Q.$root.removeClass(C.opened+" "+C.focused),r(Q.$root[0],"hidden",!0)},0),x.open?(x.open=!1,_&&c.css("overflow","").css("padding-right","-="+n()),u.off("."+x.id),Q.trigger("close")):Q},clear:function(e){return Q.set("clear",null,e)},set:function(t,i,n){var r,a,o=e.isPlainObject(t),s=o?t:{};if(n=o&&e.isPlainObject(i)?i:n||{},t){o||(s[t]=i);for(r in s)a=s[r],r in Q.component.item&&(void 0===a&&(a=null),Q.component.set(r,a,n)),("select"==r||"clear"==r)&&S.val("clear"==r?"":Q.get(r,j.format)).trigger("change");Q.render()}return n.muted?Q:Q.trigger("set",s)},get:function(e,i){if(e=e||"value",null!=x[e])return x[e];if("valueSubmit"==e){if(Q._hidden)return Q._hidden.value;e="value"}if("value"==e)return a.value;if(e in Q.component.item){if("string"==typeof i){var n=Q.component.get(e);return n?t._.trigger(Q.component.formats.toString,Q.component,[i,n]):""}return Q.component.get(e)}},on:function(t,i,n){var r,a,o=e.isPlainObject(t),s=o?t:{};if(t){o||(s[t]=i);for(r in s)a=s[r],n&&(r="_"+r),x.methods[r]=x.methods[r]||[],x.methods[r].push(a)}return Q},off:function(){var e,t,i=arguments;for(e=0,namesCount=i.length;e<namesCount;e+=1)t=i[e],t in x.methods&&delete x.methods[t];return Q},trigger:function(e,i){var n=function(e){var n=x.methods[e];n&&n.map(function(e){t._.trigger(e,Q,[i])})};return n("_"+e),n(e),Q}};return new k}function i(e){var t,i="position";return e.currentStyle?t=e.currentStyle[i]:window.getComputedStyle&&(t=getComputedStyle(e)[i]),"fixed"==t}function n(){if(c.height()<=l.height())return 0;var t=e('<div style="visibility:hidden;width:100px" />').appendTo("body"),i=t[0].offsetWidth;t.css("overflow","scroll");var n=e('<div style="width:100%" />').appendTo(t),r=n[0].offsetWidth;return t.remove(),i-r}function r(t,i,n){if(e.isPlainObject(i))for(var r in i)a(t,r,i[r]);else a(t,i,n)}function a(e,t,i){e.setAttribute(("role"==t?"":"aria-")+t,i)}function o(t,i){e.isPlainObject(t)||(t={attribute:i}),i="";for(var n in t){var r=("role"==n?"":"aria-")+n,a=t[n];i+=null==a?"":r+'="'+t[n]+'"'}return i}function s(){try{return document.activeElement}catch(e){}}var l=e(window),u=e(document),c=e(document.documentElement),d=null!=document.documentElement.style.transition;return t.klasses=function(e){return e=e||"picker",{picker:e,opened:e+"--opened",focused:e+"--focused",input:e+"__input",active:e+"__input--active",target:e+"__input--target",holder:e+"__holder",frame:e+"__frame",wrap:e+"__wrap",box:e+"__box"}},t._={group:function(e){for(var i,n="",r=t._.trigger(e.min,e);r<=t._.trigger(e.max,e,[r]);r+=e.i)i=t._.trigger(e.item,e,[r]),n+=t._.node(e.node,i[0],i[1],i[2]);return n},node:function(t,i,n,r){return i?(i=e.isArray(i)?i.join(""):i,n=n?' class="'+n+'"':"",r=r?" "+r:"","<"+t+n+r+">"+i+"</"+t+">"):""},lead:function(e){return(10>e?"0":"")+e},trigger:function(e,t,i){return"function"==typeof e?e.apply(t,i||[]):e},digits:function(e){return/\d/.test(e[1])?2:1},isDate:function(e){return{}.toString.call(e).indexOf("Date")>-1&&this.isInteger(e.getDate())},isInteger:function(e){return{}.toString.call(e).indexOf("Number")>-1&&e%1===0},ariaAttr:o},t.extend=function(i,n){e.fn[i]=function(r,a){var o=this.data(i);return"picker"==r?o:o&&"string"==typeof r?t._.trigger(o[r],o,[a]):this.each(function(){var a=e(this);a.data(i)||new t(this,i,n,r)})},e.fn[i].defaults=n.defaults},t}),function(e){"function"==typeof define&&define.amd?define(["picker","jquery"],e):"object"==typeof exports?module.exports=e(require("./picker.js"),require("jquery")):e(Picker,jQuery)}(function(e,t){function i(e,t){var i=this,n=e.$node[0],r=n.value,a=e.$node.data("value"),o=a||r,s=a?t.formatSubmit:t.format,l=function(){return n.currentStyle?"rtl"==n.currentStyle.direction:"rtl"==getComputedStyle(e.$root[0]).direction};i.settings=t,i.$node=e.$node,i.queue={min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse navigate create validate",view:"parse create validate viewset",disable:"deactivate",enable:"activate"},i.item={},i.item.clear=null,i.item.disable=(t.disable||[]).slice(0),i.item.enable=-function(e){return e[0]===!0?e.shift():-1}(i.item.disable),i.set("min",t.min).set("max",t.max).set("now"),o?i.set("select",o,{
5
format:s,defaultValue:!0}):i.set("select",null).set("highlight",i.item.now),i.key={40:7,38:-7,39:function(){return l()?-1:1},37:function(){return l()?1:-1},go:function(e){var t=i.item.highlight,n=new Date(t.year,t.month,t.date+e);i.set("highlight",n,{interval:e}),this.render()}},e.on("render",function(){e.$root.find("."+t.klass.selectMonth).on("change",function(){var i=this.value;i&&(e.set("highlight",[e.get("view").year,i,e.get("highlight").date]),e.$root.find("."+t.klass.selectMonth).trigger("focus"))}),e.$root.find("."+t.klass.selectYear).on("change",function(){var i=this.value;i&&(e.set("highlight",[i,e.get("view").month,e.get("highlight").date]),e.$root.find("."+t.klass.selectYear).trigger("focus"))})},1).on("open",function(){var n="";i.disabled(i.get("now"))&&(n=":not(."+t.klass.buttonToday+")"),e.$root.find("button"+n+", select").attr("disabled",!1)},1).on("close",function(){e.$root.find("button, select").attr("disabled",!0)},1)}var n=7,r=6,a=e._;i.prototype.set=function(e,t,i){var n=this,r=n.item;return null===t?("clear"==e&&(e="select"),r[e]=t,n):(r["enable"==e?"disable":"flip"==e?"enable":e]=n.queue[e].split(" ").map(function(r){return t=n[r](e,t,i)}).pop(),"select"==e?n.set("highlight",r.select,i):"highlight"==e?n.set("view",r.highlight,i):e.match(/^(flip|min|max|disable|enable)#x2F;)&&(r.select&&n.disabled(r.select)&&n.set("select",r.select,i),r.highlight&&n.disabled(r.highlight)&&n.set("highlight",r.highlight,i)),n)},i.prototype.get=function(e){return this.item[e]},i.prototype.create=function(e,i,n){var r,o=this;return i=void 0===i?e:i,i==-(1/0)||i==1/0?r=i:t.isPlainObject(i)&&a.isInteger(i.pick)?i=i.obj:t.isArray(i)?(i=new Date(i[0],i[1],i[2]),i=a.isDate(i)?i:o.create().obj):i=a.isInteger(i)||a.isDate(i)?o.normalize(new Date(i),n):o.now(e,i,n),{year:r||i.getFullYear(),month:r||i.getMonth(),date:r||i.getDate(),day:r||i.getDay(),obj:r||i,pick:r||i.getTime()}},i.prototype.createRange=function(e,i){var n=this,r=function(e){return e===!0||t.isArray(e)||a.isDate(e)?n.create(e):e};return a.isInteger(e)||(e=r(e)),a.isInteger(i)||(i=r(i)),a.isInteger(e)&&t.isPlainObject(i)?e=[i.year,i.month,i.date+e]:a.isInteger(i)&&t.isPlainObject(e)&&(i=[e.year,e.month,e.date+i]),{from:r(e),to:r(i)}},i.prototype.withinRange=function(e,t){return e=this.createRange(e.from,e.to),t.pick>=e.from.pick&&t.pick<=e.to.pick},i.prototype.overlapRanges=function(e,t){var i=this;return e=i.createRange(e.from,e.to),t=i.createRange(t.from,t.to),i.withinRange(e,t.from)||i.withinRange(e,t.to)||i.withinRange(t,e.from)||i.withinRange(t,e.to)},i.prototype.now=function(e,t,i){return t=new Date,i&&i.rel&&t.setDate(t.getDate()+i.rel),this.normalize(t,i)},i.prototype.navigate=function(e,i,n){var r,a,o,s,l=t.isArray(i),u=t.isPlainObject(i),c=this.item.view;if(l||u){for(u?(a=i.year,o=i.month,s=i.date):(a=+i[0],o=+i[1],s=+i[2]),n&&n.nav&&c&&c.month!==o&&(a=c.year,o=c.month),r=new Date(a,o+(n&&n.nav?n.nav:0),1),a=r.getFullYear(),o=r.getMonth();new Date(a,o,s).getMonth()!==o;)s-=1;i=[a,o,s]}return i},i.prototype.normalize=function(e){return e.setHours(0,0,0,0),e},i.prototype.measure=function(e,t){var i=this;return t?"string"==typeof t?t=i.parse(e,t):a.isInteger(t)&&(t=i.now(e,t,{rel:t})):t="min"==e?-(1/0):1/0,t},i.prototype.viewset=function(e,t){return this.create([t.year,t.month,1])},i.prototype.validate=function(e,i,n){var r,o,s,l,u=this,c=i,d=n&&n.interval?n.interval:1,h=-1===u.item.enable,p=u.item.min,f=u.item.max,m=h&&u.item.disable.filter(function(e){if(t.isArray(e)){var n=u.create(e).pick;n<i.pick?r=!0:n>i.pick&&(o=!0)}return a.isInteger(e)}).length;if((!n||!n.nav&&!n.defaultValue)&&(!h&&u.disabled(i)||h&&u.disabled(i)&&(m||r||o)||!h&&(i.pick<=p.pick||i.pick>=f.pick)))for(h&&!m&&(!o&&d>0||!r&&0>d)&&(d*=-1);u.disabled(i)&&(Math.abs(d)>1&&(i.month<c.month||i.month>c.month)&&(i=c,d=d>0?1:-1),i.pick<=p.pick?(s=!0,d=1,i=u.create([p.year,p.month,p.date+(i.pick===p.pick?0:-1)])):i.pick>=f.pick&&(l=!0,d=-1,i=u.create([f.year,f.month,f.date+(i.pick===f.pick?0:1)])),!s||!l);)i=u.create([i.year,i.month,i.date+d]);return i},i.prototype.disabled=function(e){var i=this,n=i.item.disable.filter(function(n){return a.isInteger(n)?e.day===(i.settings.firstDay?n:n-1)%7:t.isArray(n)||a.isDate(n)?e.pick===i.create(n).pick:t.isPlainObject(n)?i.withinRange(n,e):void 0});return n=n.length&&!n.filter(function(e){return t.isArray(e)&&"inverted"==e[3]||t.isPlainObject(e)&&e.inverted}).length,-1===i.item.enable?!n:n||e.pick<i.item.min.pick||e.pick>i.item.max.pick},i.prototype.parse=function(e,t,i){var n=this,r={};return t&&"string"==typeof t?(i&&i.format||(i=i||{},i.format=n.settings.format),n.formats.toArray(i.format).map(function(e){var i=n.formats[e],o=i?a.trigger(i,n,[t,r]):e.replace(/^!/,"").length;i&&(r[e]=t.substr(0,o)),t=t.substr(o)}),[r.yyyy||r.yy,+(r.mm||r.m)-1,r.dd||r.d]):t},i.prototype.formats=function(){function e(e,t,i){var n=e.match(/[^\x00-\x7F]+|\w+/)[0];return i.mm||i.m||(i.m=t.indexOf(n)+1),n.length}function t(e){return e.match(/\w+/)[0].length}return{d:function(e,t){return e?a.digits(e):t.date},dd:function(e,t){return e?2:a.lead(t.date)},ddd:function(e,i){return e?t(e):this.settings.weekdaysShort[i.day]},dddd:function(e,i){return e?t(e):this.settings.weekdaysFull[i.day]},m:function(e,t){return e?a.digits(e):t.month+1},mm:function(e,t){return e?2:a.lead(t.month+1)},mmm:function(t,i){var n=this.settings.monthsShort;return t?e(t,n,i):n[i.month]},mmmm:function(t,i){var n=this.settings.monthsFull;return t?e(t,n,i):n[i.month]},yy:function(e,t){return e?2:(""+t.year).slice(2)},yyyy:function(e,t){return e?4:t.year},toArray:function(e){return e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(e,t){var i=this;return i.formats.toArray(e).map(function(e){return a.trigger(i.formats[e],i,[0,t])||e.replace(/^!/,"")}).join("")}}}(),i.prototype.isDateExact=function(e,i){var n=this;return a.isInteger(e)&&a.isInteger(i)||"boolean"==typeof e&&"boolean"==typeof i?e===i:(a.isDate(e)||t.isArray(e))&&(a.isDate(i)||t.isArray(i))?n.create(e).pick===n.create(i).pick:t.isPlainObject(e)&&t.isPlainObject(i)?n.isDateExact(e.from,i.from)&&n.isDateExact(e.to,i.to):!1},i.prototype.isDateOverlap=function(e,i){var n=this,r=n.settings.firstDay?1:0;return a.isInteger(e)&&(a.isDate(i)||t.isArray(i))?(e=e%7+r,e===n.create(i).day+1):a.isInteger(i)&&(a.isDate(e)||t.isArray(e))?(i=i%7+r,i===n.create(e).day+1):t.isPlainObject(e)&&t.isPlainObject(i)?n.overlapRanges(e,i):!1},i.prototype.flipEnable=function(e){var t=this.item;t.enable=e||(-1==t.enable?1:-1)},i.prototype.deactivate=function(e,i){var n=this,r=n.item.disable.slice(0);return"flip"==i?n.flipEnable():i===!1?(n.flipEnable(1),r=[]):i===!0?(n.flipEnable(-1),r=[]):i.map(function(e){for(var i,o=0;o<r.length;o+=1)if(n.isDateExact(e,r[o])){i=!0;break}i||(a.isInteger(e)||a.isDate(e)||t.isArray(e)||t.isPlainObject(e)&&e.from&&e.to)&&r.push(e)}),r},i.prototype.activate=function(e,i){var n=this,r=n.item.disable,o=r.length;return"flip"==i?n.flipEnable():i===!0?(n.flipEnable(1),r=[]):i===!1?(n.flipEnable(-1),r=[]):i.map(function(e){var i,s,l,u;for(l=0;o>l;l+=1){if(s=r[l],n.isDateExact(s,e)){i=r[l]=null,u=!0;break}if(n.isDateOverlap(s,e)){t.isPlainObject(e)?(e.inverted=!0,i=e):t.isArray(e)?(i=e,i[3]||i.push("inverted")):a.isDate(e)&&(i=[e.getFullYear(),e.getMonth(),e.getDate(),"inverted"]);break}}if(i)for(l=0;o>l;l+=1)if(n.isDateExact(r[l],e)){r[l]=null;break}if(u)for(l=0;o>l;l+=1)if(n.isDateOverlap(r[l],e)){r[l]=null;break}i&&r.push(i)}),r.filter(function(e){return null!=e})},i.prototype.nodes=function(e){var t=this,i=t.settings,o=t.item,s=o.now,l=o.select,u=o.highlight,c=o.view,d=o.disable,h=o.min,p=o.max,f=function(e,t){return i.firstDay&&(e.push(e.shift()),t.push(t.shift())),a.node("thead",a.node("tr",a.group({min:0,max:n-1,i:1,node:"th",item:function(n){return[e[n],i.klass.weekdays,'scope=col title="'+t[n]+'"']}})))}((i.showWeekdaysFull?i.weekdaysFull:i.weekdaysShort).slice(0),i.weekdaysFull.slice(0)),m=function(e){return a.node("div"," ",i.klass["nav"+(e?"Next":"Prev")]+(e&&c.year>=p.year&&c.month>=p.month||!e&&c.year<=h.year&&c.month<=h.month?" "+i.klass.navDisabled:""),"data-nav="+(e||-1)+" "+a.ariaAttr({role:"button",controls:t.$node[0].id+"_table"})+' title="'+(e?i.labelMonthNext:i.labelMonthPrev)+'"')},g=function(){var n=i.showMonthsShort?i.monthsShort:i.monthsFull;return i.selectMonths?a.node("select",a.group({min:0,max:11,i:1,node:"option",item:function(e){return[n[e],0,"value="+e+(c.month==e?" selected":"")+(c.year==h.year&&e<h.month||c.year==p.year&&e>p.month?" disabled":"")]}}),i.klass.selectMonth,(e?"":"disabled")+" "+a.ariaAttr({controls:t.$node[0].id+"_table"})+' title="'+i.labelMonthSelect+'"'):a.node("div",n[c.month],i.klass.month)},v=function(){var n=c.year,r=i.selectYears===!0?5:~~(i.selectYears/2);if(r){var o=h.year,s=p.year,l=n-r,u=n+r;if(o>l&&(u+=o-l,l=o),u>s){var d=l-o,f=u-s;l-=d>f?f:d,u=s}return a.node("select",a.group({min:l,max:u,i:1,node:"option",item:function(e){return[e,0,"value="+e+(n==e?" selected":"")]}}),i.klass.selectYear,(e?"":"disabled")+" "+a.ariaAttr({controls:t.$node[0].id+"_table"})+' title="'+i.labelYearSelect+'"')}return a.node("div",n,i.klass.year)};return a.node("div",(i.selectYears?v()+g():g()+v())+m()+m(1),i.klass.header)+a.node("table",f+a.node("tbody",a.group({min:0,max:r-1,i:1,node:"tr",item:function(e){var r=i.firstDay&&0===t.create([c.year,c.month,1]).day?-7:0;return[a.group({min:n*e-c.day+r+1,max:function(){return this.min+n-1},i:1,node:"td",item:function(e){e=t.create([c.year,c.month,e+(i.firstDay?1:0)]);var n=l&&l.pick==e.pick,r=u&&u.pick==e.pick,o=d&&t.disabled(e)||e.pick<h.pick||e.pick>p.pick,f=a.trigger(t.formats.toString,t,[i.format,e]);return[a.node("div",e.date,function(t){return t.push(c.month==e.month?i.klass.infocus:i.klass.outfocus),s.pick==e.pick&&t.push(i.klass.now),n&&t.push(i.klass.selected),r&&t.push(i.klass.highlighted),o&&t.push(i.klass.disabled),t.join(" ")}([i.klass.day]),"data-pick="+e.pick+" "+a.ariaAttr({role:"gridcell",label:f,selected:n&&t.$node.val()===f?!0:null,activedescendant:r?!0:null,disabled:o?!0:null})),"",a.ariaAttr({role:"presentation"})]}})]}})),i.klass.table,'id="'+t.$node[0].id+'_table" '+a.ariaAttr({role:"grid",controls:t.$node[0].id,readonly:!0}))+a.node("div",a.node("button",i.today,i.klass.buttonToday,"type=button data-pick="+s.pick+(e&&!t.disabled(s)?"":" disabled")+" "+a.ariaAttr({controls:t.$node[0].id}))+a.node("button",i.clear,i.klass.buttonClear,"type=button data-clear=1"+(e?"":" disabled")+" "+a.ariaAttr({controls:t.$node[0].id}))+a.node("button",i.close,i.klass.buttonClose,"type=button data-close=true "+(e?"":" disabled")+" "+a.ariaAttr({controls:t.$node[0].id})),i.klass.footer)},i.defaults=function(e){return{labelMonthNext:"Next month",labelMonthPrev:"Previous month",labelMonthSelect:"Select a month",labelYearSelect:"Select a year",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],today:"Today",clear:"Clear",close:"Close",closeOnSelect:!0,closeOnClear:!0,format:"d mmmm, yyyy",klass:{table:e+"table",header:e+"header",navPrev:e+"nav--prev",navNext:e+"nav--next",navDisabled:e+"nav--disabled",month:e+"month",year:e+"year",selectMonth:e+"select--month",selectYear:e+"select--year",weekdays:e+"weekday",day:e+"day",disabled:e+"day--disabled",selected:e+"day--selected",highlighted:e+"day--highlighted",now:e+"day--today",infocus:e+"day--infocus",outfocus:e+"day--outfocus",footer:e+"footer",buttonClear:e+"button--clear",buttonToday:e+"button--today",buttonClose:e+"button--close"}}}(e.klasses().picker+"__"),e.extend("pickadate",i)}),function(e){"function"==typeof define&&define.amd?define(["picker","jquery"],e):"object"==typeof exports?module.exports=e(require("./picker.js"),require("jquery")):e(Picker,jQuery)}(function(e,t){function i(e,t){var i=this,n=e.$node[0].value,r=e.$node.data("value"),a=r||n,o=r?t.formatSubmit:t.format;i.settings=t,i.$node=e.$node,i.queue={interval:"i",min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse create validate",view:"parse create validate",disable:"deactivate",enable:"activate"},i.item={},i.item.clear=null,i.item.interval=t.interval||30,i.item.disable=(t.disable||[]).slice(0),i.item.enable=-function(e){return e[0]===!0?e.shift():-1}(i.item.disable),i.set("min",t.min).set("max",t.max).set("now"),a?i.set("select",a,{format:o}):i.set("select",null).set("highlight",i.item.now),i.key={40:1,38:-1,39:1,37:-1,go:function(e){i.set("highlight",i.item.highlight.pick+e*i.item.interval,{interval:e*i.item.interval}),this.render()}},e.on("render",function(){var i=e.$root.children(),n=i.find("."+t.klass.viewset),r=function(e){return["webkit","moz","ms","o",""].map(function(t){return(t?"-"+t+"-":"")+e})},a=function(e,t){r("transform").map(function(i){e.css(i,t)}),r("transition").map(function(i){e.css(i,t)})};n.length&&(a(i,"none"),i[0].scrollTop=~~n.position().top-2*n[0].clientHeight,a(i,""))},1).on("open",function(){e.$root.find("button").attr("disabled",!1)},1).on("close",function(){e.$root.find("button").attr("disabled",!0)},1)}var n=24,r=60,a=12,o=n*r,s=e._;i.prototype.set=function(e,t,i){var n=this,r=n.item;return null===t?("clear"==e&&(e="select"),r[e]=t,n):(r["enable"==e?"disable":"flip"==e?"enable":e]=n.queue[e].split(" ").map(function(r){return t=n[r](e,t,i)}).pop(),"select"==e?n.set("highlight",r.select,i):"highlight"==e?n.set("view",r.highlight,i):"interval"==e?n.set("min",r.min,i).set("max",r.max,i):e.match(/^(flip|min|max|disable|enable)#x2F;)&&(r.select&&n.disabled(r.select)&&n.set("select",t,i),r.highlight&&n.disabled(r.highlight)&&n.set("highlight",t,i),"min"==e&&n.set("max",r.max,i)),n)},i.prototype.get=function(e){return this.item[e]},i.prototype.create=function(e,i,a){var l=this;return i=void 0===i?e:i,s.isDate(i)&&(i=[i.getHours(),i.getMinutes()]),t.isPlainObject(i)&&s.isInteger(i.pick)?i=i.pick:t.isArray(i)?i=+i[0]*r+ +i[1]:s.isInteger(i)||(i=l.now(e,i,a)),"max"==e&&i<l.item.min.pick&&(i+=o),"min"!=e&&"max"!=e&&(i-l.item.min.pick)%l.item.interval!==0&&(i+=l.item.interval),i=l.normalize(e,i,a),{hour:~~(n+i/r)%n,mins:(r+i%r)%r,time:(o+i)%o,pick:i%o}},i.prototype.createRange=function(e,i){var n=this,r=function(e){return e===!0||t.isArray(e)||s.isDate(e)?n.create(e):e};return s.isInteger(e)||(e=r(e)),s.isInteger(i)||(i=r(i)),s.isInteger(e)&&t.isPlainObject(i)?e=[i.hour,i.mins+e*n.settings.interval]:s.isInteger(i)&&t.isPlainObject(e)&&(i=[e.hour,e.mins+i*n.settings.interval]),{from:r(e),to:r(i)}},i.prototype.withinRange=function(e,t){return e=this.createRange(e.from,e.to),t.pick>=e.from.pick&&t.pick<=e.to.pick},i.prototype.overlapRanges=function(e,t){var i=this;return e=i.createRange(e.from,e.to),t=i.createRange(t.from,t.to),i.withinRange(e,t.from)||i.withinRange(e,t.to)||i.withinRange(t,e.from)||i.withinRange(t,e.to)},i.prototype.now=function(e,t){var i,n=this.item.interval,a=new Date,o=a.getHours()*r+a.getMinutes(),l=s.isInteger(t);return o-=o%n,i=0>t&&-n>=n*t+o,o+="min"==e&&i?0:n,l&&(o+=n*(i&&"max"!=e?t+1:t)),o},i.prototype.normalize=function(e,t){var i=this.item.interval,n=this.item.min&&this.item.min.pick||0;return t-="min"==e?0:(t-n)%i},i.prototype.measure=function(e,i,a){var o=this;return i||(i="min"==e?[0,0]:[n-1,r-1]),"string"==typeof i?i=o.parse(e,i):i===!0||s.isInteger(i)?i=o.now(e,i,a):t.isPlainObject(i)&&s.isInteger(i.pick)&&(i=o.normalize(e,i.pick,a)),i},i.prototype.validate=function(e,t,i){var n=this,r=i&&i.interval?i.interval:n.item.interval;return n.disabled(t)&&(t=n.shift(t,r)),t=n.scope(t),n.disabled(t)&&(t=n.shift(t,-1*r)),t},i.prototype.disabled=function(e){var i=this,n=i.item.disable.filter(function(n){return s.isInteger(n)?e.hour==n:t.isArray(n)||s.isDate(n)?e.pick==i.create(n).pick:t.isPlainObject(n)?i.withinRange(n,e):void 0});return n=n.length&&!n.filter(function(e){return t.isArray(e)&&"inverted"==e[2]||t.isPlainObject(e)&&e.inverted}).length,-1===i.item.enable?!n:n||e.pick<i.item.min.pick||e.pick>i.item.max.pick},i.prototype.shift=function(e,t){var i=this,n=i.item.min.pick,r=i.item.max.pick;for(t=t||i.item.interval;i.disabled(e)&&(e=i.create(e.pick+=t),!(e.pick<=n||e.pick>=r)););return e},i.prototype.scope=function(e){var t=this.item.min.pick,i=this.item.max.pick;return this.create(e.pick>i?i:e.pick<t?t:e)},i.prototype.parse=function(e,t,i){var n,a,o,l,u,c=this,d={};if(!t||"string"!=typeof t)return t;i&&i.format||(i=i||{},i.format=c.settings.format),c.formats.toArray(i.format).map(function(e){var i,n=c.formats[e],r=n?s.trigger(n,c,[t,d]):e.replace(/^!/,"").length;n&&(i=t.substr(0,r),d[e]=i.match(/^\d+#x2F;)?+i:i),t=t.substr(r)});for(l in d)u=d[l],s.isInteger(u)?l.match(/^(h|hh)#x2F;i)?(n=u,("h"==l||"hh"==l)&&(n%=12)):"i"==l&&(a=u):l.match(/^a#x2F;i)&&u.match(/^p/i)&&("h"in d||"hh"in d)&&(o=!0);return(o?n+12:n)*r+a},i.prototype.formats={h:function(e,t){return e?s.digits(e):t.hour%a||a},hh:function(e,t){return e?2:s.lead(t.hour%a||a)},H:function(e,t){return e?s.digits(e):""+t.hour%24},HH:function(e,t){return e?s.digits(e):s.lead(t.hour%24)},i:function(e,t){return e?2:s.lead(t.mins)},a:function(e,t){return e?4:o/2>t.time%o?"a.m.":"p.m."},A:function(e,t){return e?2:o/2>t.time%o?"AM":"PM"},toArray:function(e){return e.split(/(h{1,2}|H{1,2}|i|a|A|!.)/g)},toString:function(e,t){var i=this;return i.formats.toArray(e).map(function(e){return s.trigger(i.formats[e],i,[0,t])||e.replace(/^!/,"")}).join("")}},i.prototype.isTimeExact=function(e,i){var n=this;return s.isInteger(e)&&s.isInteger(i)||"boolean"==typeof e&&"boolean"==typeof i?e===i:(s.isDate(e)||t.isArray(e))&&(s.isDate(i)||t.isArray(i))?n.create(e).pick===n.create(i).pick:t.isPlainObject(e)&&t.isPlainObject(i)?n.isTimeExact(e.from,i.from)&&n.isTimeExact(e.to,i.to):!1},i.prototype.isTimeOverlap=function(e,i){var n=this;return s.isInteger(e)&&(s.isDate(i)||t.isArray(i))?e===n.create(i).hour:s.isInteger(i)&&(s.isDate(e)||t.isArray(e))?i===n.create(e).hour:t.isPlainObject(e)&&t.isPlainObject(i)?n.overlapRanges(e,i):!1},i.prototype.flipEnable=function(e){var t=this.item;t.enable=e||(-1==t.enable?1:-1)},i.prototype.deactivate=function(e,i){var n=this,r=n.item.disable.slice(0);return"flip"==i?n.flipEnable():i===!1?(n.flipEnable(1),r=[]):i===!0?(n.flipEnable(-1),r=[]):i.map(function(e){for(var i,a=0;a<r.length;a+=1)if(n.isTimeExact(e,r[a])){i=!0;break}i||(s.isInteger(e)||s.isDate(e)||t.isArray(e)||t.isPlainObject(e)&&e.from&&e.to)&&r.push(e)}),r},i.prototype.activate=function(e,i){var n=this,r=n.item.disable,a=r.length;return"flip"==i?n.flipEnable():i===!0?(n.flipEnable(1),r=[]):i===!1?(n.flipEnable(-1),r=[]):i.map(function(e){var i,o,l,u;for(l=0;a>l;l+=1){if(o=r[l],n.isTimeExact(o,e)){i=r[l]=null,u=!0;break}if(n.isTimeOverlap(o,e)){t.isPlainObject(e)?(e.inverted=!0,i=e):t.isArray(e)?(i=e,i[2]||i.push("inverted")):s.isDate(e)&&(i=[e.getFullYear(),e.getMonth(),e.getDate(),"inverted"]);break}}if(i)for(l=0;a>l;l+=1)if(n.isTimeExact(r[l],e)){r[l]=null;break}if(u)for(l=0;a>l;l+=1)if(n.isTimeOverlap(r[l],e)){r[l]=null;break}i&&r.push(i)}),r.filter(function(e){return null!=e})},i.prototype.i=function(e,t){return s.isInteger(t)&&t>0?t:this.item.interval},i.prototype.nodes=function(e){var t=this,i=t.settings,n=t.item.select,r=t.item.highlight,a=t.item.view,o=t.item.disable;return s.node("ul",s.group({min:t.item.min.pick,max:t.item.max.pick,i:t.item.interval,node:"li",item:function(e){e=t.create(e);var l=e.pick,u=n&&n.pick==l,c=r&&r.pick==l,d=o&&t.disabled(e),h=s.trigger(t.formats.toString,t,[i.format,e]);return[s.trigger(t.formats.toString,t,[s.trigger(i.formatLabel,t,[e])||i.format,e]),function(e){return u&&e.push(i.klass.selected),c&&e.push(i.klass.highlighted),a&&a.pick==l&&e.push(i.klass.viewset),d&&e.push(i.klass.disabled),e.join(" ")}([i.klass.listItem]),"data-pick="+e.pick+" "+s.ariaAttr({role:"option",label:h,selected:u&&t.$node.val()===h?!0:null,activedescendant:c?!0:null,disabled:d?!0:null})]}})+s.node("li",s.node("button",i.clear,i.klass.buttonClear,"type=button data-clear=1"+(e?"":" disabled")+" "+s.ariaAttr({controls:t.$node[0].id})),"",s.ariaAttr({role:"presentation"})),i.klass.list,s.ariaAttr({role:"listbox",controls:t.$node[0].id}))},i.defaults=function(e){return{clear:"Clear",format:"h:i A",interval:30,closeOnSelect:!0,closeOnClear:!0,klass:{picker:e+" "+e+"--time",holder:e+"__holder",list:e+"__list",listItem:e+"__list-item",disabled:e+"__list-item--disabled",selected:e+"__list-item--selected",highlighted:e+"__list-item--highlighted",viewset:e+"__list-item--viewset",now:e+"__list-item--now",buttonClear:e+"__button--clear"}}}(e.klasses().picker),e.extend("pickatime",i)}),[].map||(Array.prototype.map=function(e,t){for(var i=this,n=i.length,r=new Array(n),a=0;n>a;a++)a in i&&(r[a]=e.call(t,i[a],a,i));return r}),[].filter||(Array.prototype.filter=function(e){if(null==this)throw new TypeError;var t=Object(this),i=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=[],r=arguments[1],a=0;i>a;a++)if(a in t){var o=t[a];e.call(r,o,a,t)&&n.push(o)}return n}),[].indexOf||(Array.prototype.indexOf=function(e){if(null==this)throw new TypeError;var t=Object(this),i=t.length>>>0;if(0===i)return-1;var n=0;if(arguments.length>1&&(n=Number(arguments[1]),n!=n?n=0:0!==n&&n!=1/0&&n!=-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),n>=i)return-1;for(var r=n>=0?n:Math.max(i-Math.abs(n),0);i>r;r++)if(r in t&&t[r]===e)return r;return-1});var nativeSplit=String.prototype.split,compliantExecNpcg=void 0===/()??/.exec("")[1];String.prototype.split=function(e,t){var i=this;if("[object RegExp]"!==Object.prototype.toString.call(e))return nativeSplit.call(i,e,t);var n,r,a,o,s=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),u=0;for(e=new RegExp(e.source,l+"g"),i+="",compliantExecNpcg||(n=new RegExp("^"+e.source+"$(?!\\s)",l)),t=void 0===t?-1>>>0:t>>>0;(r=e.exec(i))&&(a=r.index+r[0].length,!(a>u&&(s.push(i.slice(u,r.index)),!compliantExecNpcg&&r.length>1&&r[0].replace(n,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(r[e]=void 0)}),r.length>1&&r.index<i.length&&Array.prototype.push.apply(s,r.slice(1)),o=r[0].length,u=a,s.length>=t)));)e.lastIndex===r.index&&e.lastIndex++;return u===i.length?(o||!e.test(""))&&s.push(""):s.push(i.slice(u)),s.length>t?s.slice(0,t):s},function(e){"use strict";var t={init:function(i){return this.each(function(){this.self=e(this),t.destroy.call(this.self),this.opt=e.extend(!0,{},e.fn.raty.defaults,i),t._adjustCallback.call(this),t._adjustNumber.call(this),"img"!==this.opt.starType&&t._adjustStarType.call(this),t._adjustPath.call(this),t._createStars.call(this),this.opt.cancel&&t._createCancel.call(this),this.opt.precision&&t._adjustPrecision.call(this),t._createScore.call(this),t._apply.call(this,this.opt.score),t._target.call(this,this.opt.score),this.opt.readOnly?t._lock.call(this):(this.style.cursor="pointer",t._binds.call(this)),this.self.data("options",this.opt)})},_adjustCallback:function(){for(var e=["number","readOnly","score","scoreName","target"],t=0;t<e.length;t++)"function"==typeof this.opt[e[t]]&&(this.opt[e[t]]=this.opt[e[t]].call(this))},_adjustNumber:function(){this.opt.number=t._between(this.opt.number,1,this.opt.numberMax)},_adjustPath:function(){this.opt.path=this.opt.path||"",this.opt.path&&"/"!==this.opt.path.charAt(this.opt.path.length-1)&&(this.opt.path+="/")},_adjustPrecision:function(){this.opt.half=!0,this.opt.targetType="score"},_adjustStarType:function(){this.opt.path="";for(var e=["cancelOff","cancelOn","starHalf","starOff","starOn"],t=0;t<e.length;t++)this.opt[e[t]]=this.opt[e[t]].replace(".","-")},_apply:function(e){t._fill.call(this,e),e&&(e>0&&this.score.val(t._between(e,0,this.opt.number)),t._roundStars.call(this,e))},_between:function(e,t,i){return Math.min(Math.max(parseFloat(e),t),i)},_binds:function(){this.cancel&&(t._bindOverCancel.call(this),t._bindClickCancel.call(this),t._bindOutCancel.call(this)),t._bindOver.call(this),t._bindClick.call(this),t._bindOut.call(this)},_bindClick:function(){var t=this;t.stars.on("click.raty",function(i){var n=e(this);t.score.val(t.opt.half||t.opt.precision?t.self.data("score"):this.alt||n.data("alt")),t.opt.click&&t.opt.click.call(t,+t.score.val(),i)})},_bindClickCancel:function(){var e=this;e.cancel.on("click.raty",function(t){e.score.removeAttr("value"),e.opt.click&&e.opt.click.call(e,null,t)})},_bindOut:function(){var e=this;e.self.on("mouseleave.raty",function(i){var n=+e.score.val()||void 0;t._apply.call(e,n),t._target.call(e,n,i),e.opt.mouseout&&e.opt.mouseout.call(e,n,i)})},_bindOutCancel:function(){var e=this;e.cancel.on("mouseleave.raty",function(i){var n=e.opt.cancelOff;if("img"!==e.opt.starType&&(n=e.opt.cancelClass+" "+n),t._setIcon.call(e,this,n),e.opt.mouseout){var r=+e.score.val()||void 0;e.opt.mouseout.call(e,r,i)}})},_bindOver:function(){var e=this,i=e.opt.half?"mousemove.raty":"mouseover.raty";e.stars.on(i,function(i){var n=t._getScoreByPosition.call(e,i,this);t._fill.call(e,n),e.opt.half&&(t._roundStars.call(e,n),e.self.data("score",n)),t._target.call(e,n,i),e.opt.mouseover&&e.opt.mouseover.call(e,n,i)})},_bindOverCancel:function(){var e=this;e.cancel.on("mouseover.raty",function(i){var n=e.opt.path+e.opt.starOff,r=e.opt.cancelOn;"img"===e.opt.starType?e.stars.attr("src",n):(r=e.opt.cancelClass+" "+r,e.stars.attr("class",n)),t._setIcon.call(e,this,r),t._target.call(e,null,i),e.opt.mouseover&&e.opt.mouseover.call(e,null)})},_buildScoreField:function(){return e("<input />",{name:this.opt.scoreName,type:"hidden"}).appendTo(this)},_createCancel:function(){var t=this.opt.path+this.opt.cancelOff,i=e("<"+this.opt.starType+" />",{title:this.opt.cancelHint,"class":this.opt.cancelClass});"img"===this.opt.starType?i.attr({src:t,alt:"x"}):i.attr("data-alt","x").addClass(t),"left"===this.opt.cancelPlace?this.self.prepend("&#160;").prepend(i):this.self.append("&#160;").append(i),this.cancel=i},_createScore:function(){var i=e(this.opt.targetScore);this.score=i.length?i:t._buildScoreField.call(this)},_createStars:function(){for(var i=1;i<=this.opt.number;i++){var n=t._nameForIndex.call(this,i),r={alt:i,src:this.opt.path+this.opt[n]};"img"!==this.opt.starType&&(r={"data-alt":i,"class":r.src}),r.title=t._getHint.call(this,i),e("<"+this.opt.starType+" />",r).appendTo(this),this.opt.space&&this.self.append(i<this.opt.number?"&#160;":"")}this.stars=this.self.children(this.opt.starType)},_error:function(t){e(this).text(t),e.error(t)},_fill:function(e){for(var i=0,n=1;n<=this.stars.length;n++){var r,a=this.stars[n-1],o=t._turnOn.call(this,n,e);if(this.opt.iconRange&&this.opt.iconRange.length>i){var s=this.opt.iconRange[i];r=t._getRangeIcon.call(this,s,o),n<=s.range&&t._setIcon.call(this,a,r),n===s.range&&i++}else r=this.opt[o?"starOn":"starOff"],t._setIcon.call(this,a,r)}},_getRangeIcon:function(e,t){return t?e.on||this.opt.starOn:e.off||this.opt.starOff},_getScoreByPosition:function(i,n){var r=parseInt(n.alt||n.getAttribute("data-alt"),10);if(this.opt.half){var a=t._getSize.call(this),o=parseFloat((i.pageX-e(n).offset().left)/a);r=this.opt.precision?r-1+o:r-1+(o>.5?1:.5)}return r},_getSize:function(){var e;return e="img"===this.opt.starType?this.stars[0].width:parseFloat(this.stars.eq(0).css("font-size")),e||t._error.call(this,"Could not be possible get the icon size!"),e},_turnOn:function(e,t){return this.opt.single?e===t:t>=e},_getHint:function(e){var t=this.opt.hints[e-1];return""===t?"":t||e},_lock:function(){var e=parseInt(this.score.val(),10),i=e?t._getHint.call(this,e):this.opt.noRatedMsg;this.style.cursor="",this.title=i,this.score.prop("readonly",!0),this.stars.prop("title",i),this.cancel&&this.cancel.hide(),this.self.data("readonly",!0)},_nameForIndex:function(e){return this.opt.score&&this.opt.score>=e?"starOn":"starOff"},_roundStars:function(e){var i=(e%1).toFixed(2);if(i>this.opt.round.down){var n="starOn";this.opt.halfShow&&i<this.opt.round.up?n="starHalf":i<this.opt.round.full&&(n="starOff");var r=this.opt[n],a=this.stars[Math.ceil(e)-1];t._setIcon.call(this,a,r)}},_setIcon:function(e,t){e["img"===this.opt.starType?"src":"className"]=this.opt.path+t},_setTarget:function(e,t){t&&(t=this.opt.targetFormat.toString().replace("{score}",t)),e.is(":input")?e.val(t):e.html(t)},_target:function(i,n){if(this.opt.target){var r=e(this.opt.target);r.length||t._error.call(this,"Target selector invalid or missing!");var a=n&&"mouseover"===n.type;if(void 0===i)i=this.opt.targetText;else if(null===i)i=a?this.opt.cancelHint:this.opt.targetText;else{"hint"===this.opt.targetType?i=t._getHint.call(this,Math.ceil(i)):this.opt.precision&&(i=parseFloat(i).toFixed(1));var o=n&&"mousemove"===n.type;a||o||this.opt.targetKeep||(i=this.opt.targetText)}t._setTarget.call(this,r,i)}},_unlock:function(){this.style.cursor="pointer",this.removeAttribute("title"),this.score.removeAttr("readonly"),this.self.data("readonly",!1);for(var e=0;e<this.opt.number;e++)this.stars[e].title=t._getHint.call(this,e+1);this.cancel&&this.cancel.css("display","")},cancel:function(i){return this.each(function(){var n=e(this);n.data("readonly")!==!0&&(t[i?"click":"score"].call(n,null),this.score.removeAttr("value"))})},click:function(i){return this.each(function(){e(this).data("readonly")!==!0&&(t._apply.call(this,i),this.opt.click&&this.opt.click.call(this,i,e.Event("click")),t._target.call(this,i))})},destroy:function(){return this.each(function(){var t=e(this),i=t.data("raw");i?t.off(".raty").empty().css({cursor:i.style.cursor}).removeData("readonly"):t.data("raw",t.clone()[0])})},getScore:function(){var e,t=[];return this.each(function(){e=this.score.val(),t.push(e?+e:void 0)}),t.length>1?t:t[0]},move:function(i){return this.each(function(){var n=parseInt(i,10),r=e(this).data("options"),a=(+i).toFixed(1).split(".")[1];n>=r.number&&(n=r.number-1,a=10);var o=t._getSize.call(this),s=o/10,l=e(this.stars[n]),u=l.offset().left+s*parseInt(a,10),c=e.Event("mousemove",{pageX:u});l.trigger(c)})},readOnly:function(i){return this.each(function(){var n=e(this);n.data("readonly")!==i&&(i?(n.off(".raty").children("img").off(".raty"),t._lock.call(this)):(t._binds.call(this),t._unlock.call(this)),n.data("readonly",i))})},reload:function(){return t.set.call(this,{})},score:function(){var i=e(this);return arguments.length?t.setScore.apply(i,arguments):t.getScore.call(i)},set:function(t){return this.each(function(){var i=e(this),n=i.data("options"),r=e.extend({},n,t);i.raty(r)})},setScore:function(i){return this.each(function(){e(this).data("readonly")!==!0&&(t._apply.call(this,i),t._target.call(this,i))})}};e.fn.raty=function(i){return t[i]?t[i].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof i&&i?void e.error("Method "+i+" does not exist!"):t.init.apply(this,arguments)},e.fn.raty.defaults={cancel:!1,cancelClass:"raty-cancel",cancelHint:"Cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:void 0,half:!1,halfShow:!0,hints:["bad","poor","regular","good","gorgeous"],iconRange:void 0,mouseout:void 0,mouseover:void 0,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:void 0,precision:!1,readOnly:!1,round:{down:.25,full:.6,up:.76},score:void 0,scoreName:"score",single:!1,space:!0,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",starType:"img",target:void 0,targetFormat:"{score}",targetKeep:!1,targetScore:void 0,targetText:"",targetType:"hint"}}(jQuery),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){"use strict";function t(t){return!t.nodeName||-1!==e.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])}function i(t){return e.isFunction(t)||e.isPlainObject(t)?t:{top:t,left:t}}var n=e.scrollTo=function(t,i,n){return e(window).scrollTo(t,i,n)};return n.defaults={
6
axis:"xy",duration:0,limit:!0},e.fn.scrollTo=function(r,a,o){"object"==typeof a&&(o=a,a=0),"function"==typeof o&&(o={onAfter:o}),"max"===r&&(r=9e9),o=e.extend({},n.defaults,o),a=a||o.duration;var s=o.queue&&o.axis.length>1;return s&&(a/=2),o.offset=i(o.offset),o.over=i(o.over),this.each(function(){function l(t){var i=e.extend({},o,{queue:!0,duration:a,complete:t&&function(){t.call(d,p,o)}});h.animate(f,i)}if(null!==r){var u,c=t(this),d=c?this.contentWindow||window:this,h=e(d),p=r,f={};switch(typeof p){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?#x2F;.test(p)){p=i(p);break}if(p=c?e(p):e(p,d),!p.length)return;case"object":(p.is||p.style)&&(u=(p=e(p)).offset())}var m=e.isFunction(o.offset)&&o.offset(d,p)||o.offset;e.each(o.axis.split(""),function(e,t){var i="x"===t?"Left":"Top",r=i.toLowerCase(),a="scroll"+i,g=h[a](),v=n.max(d,t);if(u)f[a]=u[r]+(c?0:g-h.offset()[r]),o.margin&&(f[a]-=parseInt(p.css("margin"+i),10)||0,f[a]-=parseInt(p.css("border"+i+"Width"),10)||0),f[a]+=m[r]||0,o.over[r]&&(f[a]+=p["x"===t?"width":"height"]()*o.over[r]);else{var y=p[r];f[a]=y.slice&&"%"===y.slice(-1)?parseFloat(y)/100*v:y}o.limit&&/^\d+#x2F;.test(f[a])&&(f[a]=f[a]<=0?0:Math.min(f[a],v)),!e&&o.axis.length>1&&(g===f[a]?f={}:s&&(l(o.onAfterFirst),f={}))}),l(o.onAfter)}})},n.max=function(i,n){var r="x"===n?"Width":"Height",a="scroll"+r;if(!t(i))return i[a]-e(i)[r.toLowerCase()]();var o="client"+r,s=i.ownerDocument||i.document,l=s.documentElement,u=s.body;return Math.max(l[a],u[a])-Math.min(l[o],u[o])},e.Tween.propHooks.scrollLeft=e.Tween.propHooks.scrollTop={get:function(t){return e(t.elem)[t.prop]()},set:function(t){var i=this.get(t);if(t.options.interrupt&&t._last&&t._last!==i)return e(t.elem).stop();var n=Math.round(t.now);i!==n&&(e(t.elem)[t.prop](n),t._last=this.get(t))}},n}),!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){function t(t){var o=t||window.event,s=l.call(arguments,1),u=0,d=0,h=0,p=0,f=0,m=0;if(t=e.event.fix(o),t.type="mousewheel","detail"in o&&(h=-1*o.detail),"wheelDelta"in o&&(h=o.wheelDelta),"wheelDeltaY"in o&&(h=o.wheelDeltaY),"wheelDeltaX"in o&&(d=-1*o.wheelDeltaX),"axis"in o&&o.axis===o.HORIZONTAL_AXIS&&(d=-1*h,h=0),u=0===h?d:h,"deltaY"in o&&(h=-1*o.deltaY,u=h),"deltaX"in o&&(d=o.deltaX,0===h&&(u=-1*d)),0!==h||0!==d){if(1===o.deltaMode){var g=e.data(this,"mousewheel-line-height");u*=g,h*=g,d*=g}else if(2===o.deltaMode){var v=e.data(this,"mousewheel-page-height");u*=v,h*=v,d*=v}if(p=Math.max(Math.abs(h),Math.abs(d)),(!a||a>p)&&(a=p,n(o,p)&&(a/=40)),n(o,p)&&(u/=40,d/=40,h/=40),u=Math[u>=1?"floor":"ceil"](u/a),d=Math[d>=1?"floor":"ceil"](d/a),h=Math[h>=1?"floor":"ceil"](h/a),c.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();f=t.clientX-y.left,m=t.clientY-y.top}return t.deltaX=d,t.deltaY=h,t.deltaFactor=a,t.offsetX=f,t.offsetY=m,t.deltaMode=0,s.unshift(t,u,d,h),r&&clearTimeout(r),r=setTimeout(i,200),(e.event.dispatch||e.event.handle).apply(this,s)}}function i(){a=null}function n(e,t){return c.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120===0}var r,a,o=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],s="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(e.event.fixHooks)for(var u=o.length;u;)e.event.fixHooks[o[--u]]=e.event.mouseHooks;var c=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var i=s.length;i;)this.addEventListener(s[--i],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",c.getLineHeight(this)),e.data(this,"mousewheel-page-height",c.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var i=s.length;i;)this.removeEventListener(s[--i],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var i=e(t),n=i["offsetParent"in e.fn?"offsetParent":"parent"]();return n.length||(n=e("body")),parseInt(n.css("fontSize"),10)||parseInt(i.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),!function(e){"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){!function(t){var i="function"==typeof define&&define.amd,n="undefined"!=typeof module&&module.exports,r="https:"==document.location.protocol?"https:":"http:",a="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js";i||(n?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+r+"//"+a+"%3E%3C/script%3E"))),t()}(function(){var t,i="mCustomScrollbar",n="mCS",r=".mCustomScrollbar",a={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:!0},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},o=0,s={},l=window.attachEvent&&!window.addEventListener?1:0,u=!1,c=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],d={init:function(t){var t=e.extend(!0,{},a,t),i=h.call(this);if(t.live){var l=t.liveSelector||this.selector||r,u=e(l);if("off"===t.live)return void f(l);s[l]=setTimeout(function(){u.mCustomScrollbar(t),"once"===t.live&&u.length&&f(l)},500)}else f(l);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":m(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=g(t.scrollButtons.scrollType),p(t),e(i).each(function(){var i=e(this);if(!i.data(n)){i.data(n,{idx:++o,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:i.css("direction"),cbOffsets:null,trigger:null});var r=i.data(n),a=r.opt,s=i.data("mcs-axis"),l=i.data("mcs-scrollbar-position"),u=i.data("mcs-theme");s&&(a.axis=s),l&&(a.scrollbarPosition=l),u&&(a.theme=u,p(a)),v.call(this),e("#mCSB_"+r.idx+"_container img:not(."+c[2]+")").addClass(c[2]),d.update.call(null,i)}})},update:function(t,i){var r=t||h.call(this);return e(r).each(function(){var t=e(this);if(t.data(n)){var r=t.data(n),a=r.opt,o=e("#mCSB_"+r.idx+"_container"),s=[e("#mCSB_"+r.idx+"_dragger_vertical"),e("#mCSB_"+r.idx+"_dragger_horizontal")];if(!o.length)return;r.tweenRunning&&Y(t),t.hasClass(c[3])&&t.removeClass(c[3]),t.hasClass(c[4])&&t.removeClass(c[4]),_.call(this),b.call(this),"y"===a.axis||a.advanced.autoExpandHorizontalScroll||o.css("width",y(o.children())),r.overflowed=S.call(this),D.call(this),a.autoDraggerLength&&x.call(this),j.call(this),Q.call(this);var l=[Math.abs(o[0].offsetTop),Math.abs(o[0].offsetLeft)];"x"!==a.axis&&(r.overflowed[0]?s[0].height()>s[0].parent().height()?k.call(this):(X(t,l[0].toString(),{dir:"y",dur:0,overwrite:"none"}),r.contentReset.y=null):(k.call(this),"y"===a.axis?$.call(this):"yx"===a.axis&&r.overflowed[1]&&X(t,l[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==a.axis&&(r.overflowed[1]?s[1].width()>s[1].parent().width()?k.call(this):(X(t,l[1].toString(),{dir:"x",dur:0,overwrite:"none"}),r.contentReset.x=null):(k.call(this),"x"===a.axis?$.call(this):"yx"===a.axis&&r.overflowed[0]&&X(t,l[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),i&&r&&(2===i&&a.callbacks.onImageLoad&&"function"==typeof a.callbacks.onImageLoad?a.callbacks.onImageLoad.call(this):3===i&&a.callbacks.onSelectorChange&&"function"==typeof a.callbacks.onSelectorChange?a.callbacks.onSelectorChange.call(this):a.callbacks.onUpdate&&"function"==typeof a.callbacks.onUpdate&&a.callbacks.onUpdate.call(this)),U.call(this)}})},scrollTo:function(t,i){if("undefined"!=typeof t&&null!=t){var r=h.call(this);return e(r).each(function(){var r=e(this);if(r.data(n)){var a=r.data(n),o=a.opt,s={trigger:"external",scrollInertia:o.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},l=e.extend(!0,{},s,i),u=F.call(this,t),c=l.scrollInertia>0&&l.scrollInertia<17?17:l.scrollInertia;u[0]=W.call(this,u[0],"y"),u[1]=W.call(this,u[1],"x"),l.moveDragger&&(u[0]*=a.scrollRatio.y,u[1]*=a.scrollRatio.x),l.dur=c,setTimeout(function(){null!==u[0]&&"undefined"!=typeof u[0]&&"x"!==o.axis&&a.overflowed[0]&&(l.dir="y",l.overwrite="all",X(r,u[0].toString(),l)),null!==u[1]&&"undefined"!=typeof u[1]&&"y"!==o.axis&&a.overflowed[1]&&(l.dir="x",l.overwrite="none",X(r,u[1].toString(),l))},l.timeout)}})}},stop:function(){var t=h.call(this);return e(t).each(function(){var t=e(this);t.data(n)&&Y(t)})},disable:function(t){var i=h.call(this);return e(i).each(function(){var i=e(this);i.data(n)&&(i.data(n),U.call(this,"remove"),$.call(this),t&&k.call(this),D.call(this,!0),i.addClass(c[3]))})},destroy:function(){var t=h.call(this);return e(t).each(function(){var r=e(this);if(r.data(n)){var a=r.data(n),o=a.opt,s=e("#mCSB_"+a.idx),l=e("#mCSB_"+a.idx+"_container"),u=e(".mCSB_"+a.idx+"_scrollbar");o.live&&f(o.liveSelector||e(t).selector),U.call(this,"remove"),$.call(this),k.call(this),r.removeData(n),Z(this,"mcs"),u.remove(),l.find("img."+c[2]).removeClass(c[2]),s.replaceWith(l.contents()),r.removeClass(i+" _"+n+"_"+a.idx+" "+c[6]+" "+c[7]+" "+c[5]+" "+c[3]).addClass(c[4])}})}},h=function(){return"object"!=typeof e(this)||e(this).length<1?r:this},p=function(t){var i=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],n=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],r=["minimal","minimal-dark"],a=["minimal","minimal-dark"],o=["minimal","minimal-dark"];t.autoDraggerLength=e.inArray(t.theme,i)>-1?!1:t.autoDraggerLength,t.autoExpandScrollbar=e.inArray(t.theme,n)>-1?!1:t.autoExpandScrollbar,t.scrollButtons.enable=e.inArray(t.theme,r)>-1?!1:t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,a)>-1?!0:t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,o)>-1?"outside":t.scrollbarPosition},f=function(e){s[e]&&(clearTimeout(s[e]),Z(s,e))},m=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},g=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},v=function(){var t=e(this),r=t.data(n),a=r.opt,o=a.autoExpandScrollbar?" "+c[1]+"_expand":"",s=["<div id='mCSB_"+r.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+r.idx+"_scrollbar mCS-"+a.theme+" mCSB_scrollTools_vertical"+o+"'><div class='"+c[12]+"'><div id='mCSB_"+r.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>","<div id='mCSB_"+r.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+r.idx+"_scrollbar mCS-"+a.theme+" mCSB_scrollTools_horizontal"+o+"'><div class='"+c[12]+"'><div id='mCSB_"+r.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>"],l="yx"===a.axis?"mCSB_vertical_horizontal":"x"===a.axis?"mCSB_horizontal":"mCSB_vertical",u="yx"===a.axis?s[0]+s[1]:"x"===a.axis?s[1]:s[0],d="yx"===a.axis?"<div id='mCSB_"+r.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",h=a.autoHideScrollbar?" "+c[6]:"",p="x"!==a.axis&&"rtl"===r.langDir?" "+c[7]:"";a.setWidth&&t.css("width",a.setWidth),a.setHeight&&t.css("height",a.setHeight),a.setLeft="y"!==a.axis&&"rtl"===r.langDir?"989999px":a.setLeft,t.addClass(i+" _"+n+"_"+r.idx+h+p).wrapInner("<div id='mCSB_"+r.idx+"' class='mCustomScrollBox mCS-"+a.theme+" "+l+"'><div id='mCSB_"+r.idx+"_container' class='mCSB_container' style='position:relative; top:"+a.setTop+"; left:"+a.setLeft+";' dir="+r.langDir+" /></div>");var f=e("#mCSB_"+r.idx),m=e("#mCSB_"+r.idx+"_container");"y"===a.axis||a.advanced.autoExpandHorizontalScroll||m.css("width",y(m.children())),"outside"===a.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),f.addClass("mCSB_outside").after(u)):(f.addClass("mCSB_inside").append(u),m.wrap(d)),w.call(this);var g=[e("#mCSB_"+r.idx+"_dragger_vertical"),e("#mCSB_"+r.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},y=function(t){return Math.max.apply(Math,t.map(function(){return e(this).outerWidth(!0)}).get())},b=function(){var t=e(this),i=t.data(n),r=i.opt,a=e("#mCSB_"+i.idx+"_container");r.advanced.autoExpandHorizontalScroll&&"y"!==r.axis&&a.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(a[0].getBoundingClientRect().right+.4)-Math.floor(a[0].getBoundingClientRect().left),position:"relative"}).unwrap()},w=function(){var t=e(this),i=t.data(n),r=i.opt,a=e(".mCSB_"+i.idx+"_scrollbar:first"),o=te(r.scrollButtons.tabindex)?"tabindex='"+r.scrollButtons.tabindex+"'":"",s=["<a href='#' class='"+c[13]+"' oncontextmenu='return false;' "+o+" />","<a href='#' class='"+c[14]+"' oncontextmenu='return false;' "+o+" />","<a href='#' class='"+c[15]+"' oncontextmenu='return false;' "+o+" />","<a href='#' class='"+c[16]+"' oncontextmenu='return false;' "+o+" />"],l=["x"===r.axis?s[2]:s[0],"x"===r.axis?s[3]:s[1],s[2],s[3]];r.scrollButtons.enable&&a.prepend(l[0]).append(l[1]).next(".mCSB_scrollTools").prepend(l[2]).append(l[3])},_=function(){var t=e(this),i=t.data(n),r=e("#mCSB_"+i.idx),a=t.css("max-height")||"none",o=-1!==a.indexOf("%"),s=t.css("box-sizing");if("none"!==a){var l=o?t.parent().height()*parseInt(a)/100:parseInt(a);"border-box"===s&&(l-=t.innerHeight()-t.height()+(t.outerHeight()-t.innerHeight())),r.css("max-height",Math.round(l))}},x=function(){var t=e(this),i=t.data(n),r=e("#mCSB_"+i.idx),a=e("#mCSB_"+i.idx+"_container"),o=[e("#mCSB_"+i.idx+"_dragger_vertical"),e("#mCSB_"+i.idx+"_dragger_horizontal")],s=[r.height()/a.outerHeight(!1),r.width()/a.outerWidth(!1)],u=[parseInt(o[0].css("min-height")),Math.round(s[0]*o[0].parent().height()),parseInt(o[1].css("min-width")),Math.round(s[1]*o[1].parent().width())],c=l&&u[1]<u[0]?u[0]:u[1],d=l&&u[3]<u[2]?u[2]:u[3];o[0].css({height:c,"max-height":o[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":u[0]+"px"}),o[1].css({width:d,"max-width":o[1].parent().width()-10})},j=function(){var t=e(this),i=t.data(n),r=e("#mCSB_"+i.idx),a=e("#mCSB_"+i.idx+"_container"),o=[e("#mCSB_"+i.idx+"_dragger_vertical"),e("#mCSB_"+i.idx+"_dragger_horizontal")],s=[a.outerHeight(!1)-r.height(),a.outerWidth(!1)-r.width()],l=[s[0]/(o[0].parent().height()-o[0].height()),s[1]/(o[1].parent().width()-o[1].width())];i.scrollRatio={y:l[0],x:l[1]}},C=function(e,t,i){var n=i?c[0]+"_expanded":"",r=e.closest(".mCSB_scrollTools");"active"===t?(e.toggleClass(c[0]+" "+n),r.toggleClass(c[1]),e[0]._draggable=e[0]._draggable?0:1):e[0]._draggable||("hide"===t?(e.removeClass(c[0]),r.removeClass(c[1])):(e.addClass(c[0]),r.addClass(c[1])))},S=function(){var t=e(this),i=t.data(n),r=e("#mCSB_"+i.idx),a=e("#mCSB_"+i.idx+"_container"),o=null==i.overflowed?a.height():a.outerHeight(!1),s=null==i.overflowed?a.width():a.outerWidth(!1);return[o>r.height(),s>r.width()]},k=function(){var t=e(this),i=t.data(n),r=i.opt,a=e("#mCSB_"+i.idx),o=e("#mCSB_"+i.idx+"_container"),s=[e("#mCSB_"+i.idx+"_dragger_vertical"),e("#mCSB_"+i.idx+"_dragger_horizontal")];if(Y(t),("x"!==r.axis&&!i.overflowed[0]||"y"===r.axis&&i.overflowed[0])&&(s[0].add(o).css("top",0),X(t,"_resetY")),"y"!==r.axis&&!i.overflowed[1]||"x"===r.axis&&i.overflowed[1]){var l=dx=0;"rtl"===i.langDir&&(l=a.width()-o.outerWidth(!1),dx=Math.abs(l/i.scrollRatio.x)),o.css("left",l),s[1].css("left",dx),X(t,"_resetX")}},Q=function(){function t(){o=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(o),E.call(i[0])):t()},100)}var i=e(this),r=i.data(n),a=r.opt;if(!r.bindEvents){if(O.call(this),a.contentTouchScroll&&A.call(this),M.call(this),a.mouseWheel.enable){var o;t()}L.call(this),H.call(this),a.advanced.autoScrollOnFocus&&R.call(this),a.scrollButtons.enable&&B.call(this),a.keyboard.enable&&z.call(this),r.bindEvents=!0}},$=function(){var t=e(this),i=t.data(n),r=i.opt,a=n+"_"+i.idx,o=".mCSB_"+i.idx+"_scrollbar",s=e("#mCSB_"+i.idx+",#mCSB_"+i.idx+"_container,#mCSB_"+i.idx+"_container_wrapper,"+o+" ."+c[12]+",#mCSB_"+i.idx+"_dragger_vertical,#mCSB_"+i.idx+"_dragger_horizontal,"+o+">a"),l=e("#mCSB_"+i.idx+"_container");r.advanced.releaseDraggableSelectors&&s.add(e(r.advanced.releaseDraggableSelectors)),i.bindEvents&&(e(document).unbind("."+a),s.each(function(){e(this).unbind("."+a)}),clearTimeout(t[0]._focusTimeout),Z(t[0],"_focusTimeout"),clearTimeout(i.sequential.step),Z(i.sequential,"step"),clearTimeout(l[0].onCompleteTimeout),Z(l[0],"onCompleteTimeout"),i.bindEvents=!1)},D=function(t){var i=e(this),r=i.data(n),a=r.opt,o=e("#mCSB_"+r.idx+"_container_wrapper"),s=o.length?o:e("#mCSB_"+r.idx+"_container"),l=[e("#mCSB_"+r.idx+"_scrollbar_vertical"),e("#mCSB_"+r.idx+"_scrollbar_horizontal")],u=[l[0].find(".mCSB_dragger"),l[1].find(".mCSB_dragger")];"x"!==a.axis&&(r.overflowed[0]&&!t?(l[0].add(u[0]).add(l[0].children("a")).css("display","block"),s.removeClass(c[8]+" "+c[10])):(a.alwaysShowScrollbar?(2!==a.alwaysShowScrollbar&&u[0].css("display","none"),s.removeClass(c[10])):(l[0].css("display","none"),s.addClass(c[10])),s.addClass(c[8]))),"y"!==a.axis&&(r.overflowed[1]&&!t?(l[1].add(u[1]).add(l[1].children("a")).css("display","block"),s.removeClass(c[9]+" "+c[11])):(a.alwaysShowScrollbar?(2!==a.alwaysShowScrollbar&&u[1].css("display","none"),s.removeClass(c[11])):(l[1].css("display","none"),s.addClass(c[11])),s.addClass(c[9]))),r.overflowed[0]||r.overflowed[1]?i.removeClass(c[5]):i.addClass(c[5])},T=function(e){var t=e.type;switch(t){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return e.target.ownerDocument!==document?[e.originalEvent.screenY,e.originalEvent.screenX,!1]:[e.originalEvent.pageY,e.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var i=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],n=e.originalEvent.touches.length||e.originalEvent.changedTouches.length;return e.target.ownerDocument!==document?[i.screenY,i.screenX,n>1]:[i.pageY,i.pageX,n>1];default:return[e.pageY,e.pageX,!1]}},O=function(){function t(e){var t=f.find("iframe");if(t.length){var i=e?"auto":"none";t.css("pointer-events",i)}}function i(e,t,i,n){if(f[0].idleTimer=d.scrollInertia<233?250:0,r.attr("id")===p[1])var a="x",o=(r[0].offsetLeft-t+n)*c.scrollRatio.x;else var a="y",o=(r[0].offsetTop-e+i)*c.scrollRatio.y;X(s,o.toString(),{dir:a,drag:!0})}var r,a,o,s=e(this),c=s.data(n),d=c.opt,h=n+"_"+c.idx,p=["mCSB_"+c.idx+"_dragger_vertical","mCSB_"+c.idx+"_dragger_horizontal"],f=e("#mCSB_"+c.idx+"_container"),m=e("#"+p[0]+",#"+p[1]),g=d.advanced.releaseDraggableSelectors?m.add(e(d.advanced.releaseDraggableSelectors)):m;m.bind("mousedown."+h+" touchstart."+h+" pointerdown."+h+" MSPointerDown."+h,function(i){if(i.stopImmediatePropagation(),i.preventDefault(),J(i)){u=!0,l&&(document.onselectstart=function(){return!1}),t(!1),Y(s),r=e(this);var n=r.offset(),c=T(i)[0]-n.top,h=T(i)[1]-n.left,p=r.height()+n.top,f=r.width()+n.left;p>c&&c>0&&f>h&&h>0&&(a=c,o=h),C(r,"active",d.autoExpandScrollbar)}}).bind("touchmove."+h,function(e){e.stopImmediatePropagation(),e.preventDefault();var t=r.offset(),n=T(e)[0]-t.top,s=T(e)[1]-t.left;i(a,o,n,s)}),e(document).bind("mousemove."+h+" pointermove."+h+" MSPointerMove."+h,function(e){if(r){var t=r.offset(),n=T(e)[0]-t.top,s=T(e)[1]-t.left;if(a===n)return;i(a,o,n,s)}}).add(g).bind("mouseup."+h+" touchend."+h+" pointerup."+h+" MSPointerUp."+h,function(){r&&(C(r,"active",d.autoExpandScrollbar),r=null),u=!1,l&&(document.onselectstart=null),t(!0)})},A=function(){function i(e){if(!ee(e)||u||T(e)[2])return void(t=0);t=1,_=0,x=0;var i=$.offset();c=T(e)[0]-i.top,d=T(e)[1]-i.left,P=[T(e)[0],T(e)[1]]}function r(e){if(ee(e)&&!u&&!T(e)[2]&&(e.stopImmediatePropagation(),!x||_)){m=K();var t=Q.offset(),i=T(e)[0]-t.top,n=T(e)[1]-t.left,r="mcsLinearOut";if(O.push(i),A.push(n),P[2]=Math.abs(T(e)[0]-P[0]),P[3]=Math.abs(T(e)[1]-P[1]),C.overflowed[0])var a=D[0].parent().height()-D[0].height(),o=c-i>0&&i-c>-(a*C.scrollRatio.y)&&(2*P[3]<P[2]||"yx"===S.axis);if(C.overflowed[1])var s=D[1].parent().width()-D[1].width(),h=d-n>0&&n-d>-(s*C.scrollRatio.x)&&(2*P[2]<P[3]||"yx"===S.axis);o||h?(e.preventDefault(),_=1):x=1,b="yx"===S.axis?[c-i,d-n]:"x"===S.axis?[null,d-n]:[c-i,null],$[0].idleTimer=250,C.overflowed[0]&&l(b[0],M,r,"y","all",!0),C.overflowed[1]&&l(b[1],M,r,"x",E,!0)}}function a(e){if(!ee(e)||u||T(e)[2])return void(t=0);t=1,e.stopImmediatePropagation(),Y(j),f=K();var i=Q.offset();h=T(e)[0]-i.top,p=T(e)[1]-i.left,O=[],A=[]}function o(e){if(ee(e)&&!u&&!T(e)[2]){e.stopImmediatePropagation(),_=0,x=0,g=K();var t=Q.offset(),i=T(e)[0]-t.top,n=T(e)[1]-t.left;if(!(g-m>30)){y=1e3/(g-f);var r="mcsEaseOut",a=2.5>y,o=a?[O[O.length-2],A[A.length-2]]:[0,0];v=a?[i-o[0],n-o[1]]:[i-h,n-p];var c=[Math.abs(v[0]),Math.abs(v[1])];y=a?[Math.abs(v[0]/4),Math.abs(v[1]/4)]:[y,y];var d=[Math.abs($[0].offsetTop)-v[0]*s(c[0]/y[0],y[0]),Math.abs($[0].offsetLeft)-v[1]*s(c[1]/y[1],y[1])];b="yx"===S.axis?[d[0],d[1]]:"x"===S.axis?[null,d[1]]:[d[0],null],w=[4*c[0]+S.scrollInertia,4*c[1]+S.scrollInertia];var j=parseInt(S.contentTouchScroll)||0;b[0]=c[0]>j?b[0]:0,b[1]=c[1]>j?b[1]:0,C.overflowed[0]&&l(b[0],w[0],r,"y",E,!1),C.overflowed[1]&&l(b[1],w[1],r,"x",E,!1)}}}function s(e,t){var i=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?i[0]:i[3]:e>60?t>3?i[3]:i[2]:e>30?t>8?i[1]:t>6?i[0]:t>4?t:i[2]:t>8?t:i[3]}function l(e,t,i,n,r,a){e&&X(j,e.toString(),{dur:t,scrollEasing:i,dir:n,overwrite:r,drag:a})}var c,d,h,p,f,m,g,v,y,b,w,_,x,j=e(this),C=j.data(n),S=C.opt,k=n+"_"+C.idx,Q=e("#mCSB_"+C.idx),$=e("#mCSB_"+C.idx+"_container"),D=[e("#mCSB_"+C.idx+"_dragger_vertical"),e("#mCSB_"+C.idx+"_dragger_horizontal")],O=[],A=[],M=0,E="yx"===S.axis?"none":"all",P=[],L=$.find("iframe"),R=["touchstart."+k+" pointerdown."+k+" MSPointerDown."+k,"touchmove."+k+" pointermove."+k+" MSPointerMove."+k,"touchend."+k+" pointerup."+k+" MSPointerUp."+k];$.bind(R[0],function(e){i(e)}).bind(R[1],function(e){r(e)}),Q.bind(R[0],function(e){a(e)}).bind(R[2],function(e){o(e)}),L.length&&L.each(function(){e(this).load(function(){I(this)&&e(this.contentDocument||this.contentWindow.document).bind(R[0],function(e){i(e),a(e)}).bind(R[1],function(e){r(e)}).bind(R[2],function(e){o(e)})})})},M=function(){function i(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function r(e,t,i){c.type=i&&a?"stepped":"stepless",c.scrollAmount=10,q(o,e,t,"mcsLinearOut",i?60:null)}var a,o=e(this),s=o.data(n),l=s.opt,c=s.sequential,d=n+"_"+s.idx,h=e("#mCSB_"+s.idx+"_container"),p=h.parent();h.bind("mousedown."+d,function(){t||a||(a=1,u=!0)}).add(document).bind("mousemove."+d,function(e){if(!t&&a&&i()){var n=h.offset(),o=T(e)[0]-n.top+h[0].offsetTop,u=T(e)[1]-n.left+h[0].offsetLeft;o>0&&o<p.height()&&u>0&&u<p.width()?c.step&&r("off",null,"stepped"):("x"!==l.axis&&s.overflowed[0]&&(0>o?r("on",38):o>p.height()&&r("on",40)),"y"!==l.axis&&s.overflowed[1]&&(0>u?r("on",37):u>p.width()&&r("on",39)))}}).bind("mouseup."+d,function(){t||(a&&(a=0,r("off",null)),u=!1)})},E=function(){function t(t,n){if(Y(i),!P(i,t.target)){var o="auto"!==a.mouseWheel.deltaFactor?parseInt(a.mouseWheel.deltaFactor):l&&t.deltaFactor<100?100:t.deltaFactor||100;if("x"===a.axis||"x"===a.mouseWheel.axis)var c="x",d=[Math.round(o*r.scrollRatio.x),parseInt(a.mouseWheel.scrollAmount)],h="auto"!==a.mouseWheel.scrollAmount?d[1]:d[0]>=s.width()?.9*s.width():d[0],p=Math.abs(e("#mCSB_"+r.idx+"_container")[0].offsetLeft),f=u[1][0].offsetLeft,m=u[1].parent().width()-u[1].width(),g=t.deltaX||t.deltaY||n;else var c="y",d=[Math.round(o*r.scrollRatio.y),parseInt(a.mouseWheel.scrollAmount)],h="auto"!==a.mouseWheel.scrollAmount?d[1]:d[0]>=s.height()?.9*s.height():d[0],p=Math.abs(e("#mCSB_"+r.idx+"_container")[0].offsetTop),f=u[0][0].offsetTop,m=u[0].parent().height()-u[0].height(),g=t.deltaY||n;"y"===c&&!r.overflowed[0]||"x"===c&&!r.overflowed[1]||(a.mouseWheel.invert&&(g=-g),a.mouseWheel.normalizeDelta&&(g=0>g?-1:1),(g>0&&0!==f||0>g&&f!==m||a.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),X(i,(p-g*h).toString(),{dir:c}))}}var i=e(this),r=i.data(n),a=r.opt,o=n+"_"+r.idx,s=e("#mCSB_"+r.idx),u=[e("#mCSB_"+r.idx+"_dragger_vertical"),e("#mCSB_"+r.idx+"_dragger_horizontal")],c=e("#mCSB_"+r.idx+"_container").find("iframe");r&&(c.length&&c.each(function(){e(this).load(function(){I(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+o,function(e,i){t(e,i)})})}),s.bind("mousewheel."+o,function(e,i){t(e,i)}))},I=function(e){var t=null;try{var i=e.contentDocument||e.contentWindow.document;t=i.body.innerHTML}catch(n){}return null!==t},P=function(t,i){var r=i.nodeName.toLowerCase(),a=t.data(n).opt.mouseWheel.disableOver,o=["select","textarea"];return e.inArray(r,a)>-1&&!(e.inArray(r,o)>-1&&!e(i).is(":focus"))},L=function(){var t=e(this),i=t.data(n),r=n+"_"+i.idx,a=e("#mCSB_"+i.idx+"_container"),o=a.parent(),s=e(".mCSB_"+i.idx+"_scrollbar ."+c[12]);s.bind("touchstart."+r+" pointerdown."+r+" MSPointerDown."+r,function(){u=!0}).bind("touchend."+r+" pointerup."+r+" MSPointerUp."+r,function(){u=!1}).bind("click."+r,function(n){if(e(n.target).hasClass(c[12])||e(n.target).hasClass("mCSB_draggerRail")){Y(t);var r=e(this),s=r.find(".mCSB_dragger");if(r.parent(".mCSB_scrollTools_horizontal").length>0){if(!i.overflowed[1])return;var l="x",u=n.pageX>s.offset().left?-1:1,d=Math.abs(a[0].offsetLeft)-.9*u*o.width()}else{if(!i.overflowed[0])return;var l="y",u=n.pageY>s.offset().top?-1:1,d=Math.abs(a[0].offsetTop)-.9*u*o.height()}X(t,d.toString(),{dir:l,scrollEasing:"mcsEaseInOut"})}})},R=function(){var t=e(this),i=t.data(n),r=i.opt,a=n+"_"+i.idx,o=e("#mCSB_"+i.idx+"_container"),s=o.parent();o.bind("focusin."+a,function(){var i=e(document.activeElement),n=o.find(".mCustomScrollBox").length,a=0;i.is(r.advanced.autoScrollOnFocus)&&(Y(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=n?(a+17)*n:0,t[0]._focusTimeout=setTimeout(function(){var e=[ie(i)[0],ie(i)[1]],n=[o[0].offsetTop,o[0].offsetLeft],l=[n[0]+e[0]>=0&&n[0]+e[0]<s.height()-i.outerHeight(!1),n[1]+e[1]>=0&&n[0]+e[1]<s.width()-i.outerWidth(!1)],u="yx"!==r.axis||l[0]||l[1]?"all":"none";"x"===r.axis||l[0]||X(t,e[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:u,dur:a}),"y"===r.axis||l[1]||X(t,e[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:u,dur:a})},t[0]._focusTimer))})},H=function(){var t=e(this),i=t.data(n),r=n+"_"+i.idx,a=e("#mCSB_"+i.idx+"_container").parent();a.bind("scroll."+r,function(){(0!==a.scrollTop()||0!==a.scrollLeft())&&e(".mCSB_"+i.idx+"_scrollbar").css("visibility","hidden")})},B=function(){var t=e(this),i=t.data(n),r=i.opt,a=i.sequential,o=n+"_"+i.idx,s=".mCSB_"+i.idx+"_scrollbar",l=e(s+">a");l.bind("mousedown."+o+" touchstart."+o+" pointerdown."+o+" MSPointerDown."+o+" mouseup."+o+" touchend."+o+" pointerup."+o+" MSPointerUp."+o+" mouseout."+o+" pointerout."+o+" MSPointerOut."+o+" click."+o,function(n){function o(e,i){a.scrollAmount=r.snapAmount||r.scrollButtons.scrollAmount,q(t,e,i)}if(n.preventDefault(),J(n)){var s=e(this).attr("class");switch(a.type=r.scrollButtons.scrollType,n.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===a.type)return;u=!0,i.tweenRunning=!1,o("on",s);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===a.type)return;u=!1,a.dir&&o("off",s);break;case"click":if("stepped"!==a.type||i.tweenRunning)return;o("on",s)}}})},z=function(){function t(t){function n(e,t){o.type=a.keyboard.scrollType,o.scrollAmount=a.snapAmount||a.keyboard.scrollAmount,"stepped"===o.type&&r.tweenRunning||q(i,e,t)}switch(t.type){case"blur":r.tweenRunning&&o.dir&&n("off",null);break;case"keydown":case"keyup":var s=t.keyCode?t.keyCode:t.which,l="on";if("x"!==a.axis&&(38===s||40===s)||"y"!==a.axis&&(37===s||39===s)){if((38===s||40===s)&&!r.overflowed[0]||(37===s||39===s)&&!r.overflowed[1])return;"keyup"===t.type&&(l="off"),e(document.activeElement).is(d)||(t.preventDefault(),t.stopImmediatePropagation(),n(l,s))}else if(33===s||34===s){if((r.overflowed[0]||r.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){Y(i);var h=34===s?-1:1;if("x"===a.axis||"yx"===a.axis&&r.overflowed[1]&&!r.overflowed[0])var p="x",f=Math.abs(u[0].offsetLeft)-.9*h*c.width();else var p="y",f=Math.abs(u[0].offsetTop)-.9*h*c.height();X(i,f.toString(),{dir:p,scrollEasing:"mcsEaseInOut"})}}else if((35===s||36===s)&&!e(document.activeElement).is(d)&&((r.overflowed[0]||r.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===a.axis||"yx"===a.axis&&r.overflowed[1]&&!r.overflowed[0])var p="x",f=35===s?Math.abs(c.width()-u.outerWidth(!1)):0;else var p="y",f=35===s?Math.abs(c.height()-u.outerHeight(!1)):0;X(i,f.toString(),{dir:p,scrollEasing:"mcsEaseInOut"})}}}var i=e(this),r=i.data(n),a=r.opt,o=r.sequential,s=n+"_"+r.idx,l=e("#mCSB_"+r.idx),u=e("#mCSB_"+r.idx+"_container"),c=u.parent(),d="input,textarea,select,datalist,keygen,[contenteditable='true']",h=u.find("iframe"),p=["blur."+s+" keydown."+s+" keyup."+s];h.length&&h.each(function(){e(this).load(function(){I(this)&&e(this.contentDocument||this.contentWindow.document).bind(p[0],function(e){t(e)})})}),l.attr("tabindex","0").bind(p[0],function(e){t(e)})},q=function(t,i,r,a,o){function s(e){var i="stepped"!==h.type,n=o?o:e?i?m/1.5:g:1e3/60,r=e?i?7.5:40:2.5,l=[Math.abs(p[0].offsetTop),Math.abs(p[0].offsetLeft)],c=[u.scrollRatio.y>10?10:u.scrollRatio.y,u.scrollRatio.x>10?10:u.scrollRatio.x],d="x"===h.dir[0]?l[1]+h.dir[1]*c[1]*r:l[0]+h.dir[1]*c[0]*r,f="x"===h.dir[0]?l[1]+h.dir[1]*parseInt(h.scrollAmount):l[0]+h.dir[1]*parseInt(h.scrollAmount),v="auto"!==h.scrollAmount?f:d,y=a?a:e?i?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",b=e?!0:!1;return e&&17>n&&(v="x"===h.dir[0]?l[1]:l[0]),X(t,v.toString(),{dir:h.dir[0],scrollEasing:y,dur:n,onComplete:b}),e?void(h.dir=!1):(clearTimeout(h.step),void(h.step=setTimeout(function(){s()},n)))}function l(){clearTimeout(h.step),Z(h,"step"),Y(t)}var u=t.data(n),d=u.opt,h=u.sequential,p=e("#mCSB_"+u.idx+"_container"),f="stepped"===h.type?!0:!1,m=d.scrollInertia<26?26:d.scrollInertia,g=d.scrollInertia<1?17:d.scrollInertia;switch(i){case"on":if(h.dir=[r===c[16]||r===c[15]||39===r||37===r?"x":"y",r===c[13]||r===c[15]||38===r||37===r?-1:1],
7
- Y(t),te(r)&&"stepped"===h.type)return;s(f);break;case"off":l(),(f||u.tweenRunning&&h.dir)&&s(!0)}},F=function(t){var i=e(this).data(n).opt,r=[];return"function"==typeof t&&(t=t()),t instanceof Array?r=t.length>1?[t[0],t[1]]:"x"===i.axis?[null,t[0]]:[t[0],null]:(r[0]=t.y?t.y:t.x||"x"===i.axis?null:t,r[1]=t.x?t.x:t.y||"y"===i.axis?null:t),"function"==typeof r[0]&&(r[0]=r[0]()),"function"==typeof r[1]&&(r[1]=r[1]()),r},W=function(t,i){if(null!=t&&"undefined"!=typeof t){var r=e(this),a=r.data(n),o=a.opt,s=e("#mCSB_"+a.idx+"_container"),l=s.parent(),u=typeof t;i||(i="x"===o.axis?"x":"y");var c="x"===i?s.outerWidth(!1):s.outerHeight(!1),h="x"===i?s[0].offsetLeft:s[0].offsetTop,p="x"===i?"left":"top";switch(u){case"function":return t();case"object":var f=t.jquery?t:e(t);if(!f.length)return;return"x"===i?ie(f)[1]:ie(f)[0];case"string":case"number":if(te(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(c*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(h-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var m=h+parseInt(t.split("+=")[1]);return m>=0?0:Math.abs(m)}if(-1!==t.indexOf("px")&&te(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(l.height()-s.outerHeight(!1));if("right"===t)return Math.abs(l.width()-s.outerWidth(!1));if("first"===t||"last"===t){var f=s.find(":"+t);return"x"===i?ie(f)[1]:ie(f)[0]}return e(t).length?"x"===i?ie(e(t))[1]:ie(e(t))[0]:(s.css(p,t),void d.update.call(null,r[0]))}}},U=function(t){function i(){clearTimeout(p[0].autoUpdate),p[0].autoUpdate=setTimeout(function(){return h.advanced.updateOnSelectorChange&&(f=o(),f!==w)?(s(3),void(w=f)):(h.advanced.updateOnContentResize&&(m=[p.outerHeight(!1),p.outerWidth(!1),v.height(),v.width(),b()[0],b()[1]],(m[0]!==_[0]||m[1]!==_[1]||m[2]!==_[2]||m[3]!==_[3]||m[4]!==_[4]||m[5]!==_[5])&&(s(m[0]!==_[0]||m[1]!==_[1]),_=m)),h.advanced.updateOnImageLoad&&(g=r(),g!==x&&(p.find("img").each(function(){a(this)}),x=g)),void((h.advanced.updateOnSelectorChange||h.advanced.updateOnContentResize||h.advanced.updateOnImageLoad)&&i()))},60)}function r(){var e=0;return h.advanced.updateOnImageLoad&&(e=p.find("img").length),e}function a(t){function i(e,t){return function(){return t.apply(e,arguments)}}function n(){this.onload=null,e(t).addClass(c[2]),s(2)}if(e(t).hasClass(c[2]))return void s();var r=new Image;r.onload=i(r,n),r.src=t.src}function o(){h.advanced.updateOnSelectorChange===!0&&(h.advanced.updateOnSelectorChange="*");var t=0,i=p.find(h.advanced.updateOnSelectorChange);return h.advanced.updateOnSelectorChange&&i.length>0&&i.each(function(){t+=e(this).height()+e(this).width()}),t}function s(e){clearTimeout(p[0].autoUpdate),d.update.call(null,l[0],e)}var l=e(this),u=l.data(n),h=u.opt,p=e("#mCSB_"+u.idx+"_container");if(t)return clearTimeout(p[0].autoUpdate),void Z(p[0],"autoUpdate");var f,m,g,v=p.parent(),y=[e("#mCSB_"+u.idx+"_scrollbar_vertical"),e("#mCSB_"+u.idx+"_scrollbar_horizontal")],b=function(){return[y[0].is(":visible")?y[0].outerHeight(!0):0,y[1].is(":visible")?y[1].outerWidth(!0):0]},w=o(),_=[p.outerHeight(!1),p.outerWidth(!1),v.height(),v.width(),b()[0],b()[1]],x=r();i()},N=function(e,t,i){return Math.round(e/t)*t-i},Y=function(t){var i=t.data(n),r=e("#mCSB_"+i.idx+"_container,#mCSB_"+i.idx+"_container_wrapper,#mCSB_"+i.idx+"_dragger_vertical,#mCSB_"+i.idx+"_dragger_horizontal");r.each(function(){V.call(this)})},X=function(t,i,r){function a(e){return l&&u.callbacks[e]&&"function"==typeof u.callbacks[e]}function o(){return[u.callbacks.alwaysTriggerOffsets||b>=w[0]+x,u.callbacks.alwaysTriggerOffsets||-j>=b]}function s(){var e=[p[0].offsetTop,p[0].offsetLeft],i=[v[0].offsetTop,v[0].offsetLeft],n=[p.outerHeight(!1),p.outerWidth(!1)],a=[h.height(),h.width()];t[0].mcs={content:p,top:e[0],left:e[1],draggerTop:i[0],draggerLeft:i[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(n[0])-a[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(n[1])-a[1])),direction:r.dir}}var l=t.data(n),u=l.opt,c={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:u.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},r=e.extend(c,r),d=[r.dur,r.drag?0:r.dur],h=e("#mCSB_"+l.idx),p=e("#mCSB_"+l.idx+"_container"),f=p.parent(),m=u.callbacks.onTotalScrollOffset?F.call(t,u.callbacks.onTotalScrollOffset):[0,0],g=u.callbacks.onTotalScrollBackOffset?F.call(t,u.callbacks.onTotalScrollBackOffset):[0,0];if(l.trigger=r.trigger,(0!==f.scrollTop()||0!==f.scrollLeft())&&(e(".mCSB_"+l.idx+"_scrollbar").css("visibility","visible"),f.scrollTop(0).scrollLeft(0)),"_resetY"!==i||l.contentReset.y||(a("onOverflowYNone")&&u.callbacks.onOverflowYNone.call(t[0]),l.contentReset.y=1),"_resetX"!==i||l.contentReset.x||(a("onOverflowXNone")&&u.callbacks.onOverflowXNone.call(t[0]),l.contentReset.x=1),"_resetY"!==i&&"_resetX"!==i){switch(!l.contentReset.y&&t[0].mcs||!l.overflowed[0]||(a("onOverflowY")&&u.callbacks.onOverflowY.call(t[0]),l.contentReset.x=null),!l.contentReset.x&&t[0].mcs||!l.overflowed[1]||(a("onOverflowX")&&u.callbacks.onOverflowX.call(t[0]),l.contentReset.x=null),u.snapAmount&&(i=N(i,u.snapAmount,u.snapOffset)),r.dir){case"x":var v=e("#mCSB_"+l.idx+"_dragger_horizontal"),y="left",b=p[0].offsetLeft,w=[h.width()-p.outerWidth(!1),v.parent().width()-v.width()],_=[i,0===i?0:i/l.scrollRatio.x],x=m[1],j=g[1],S=x>0?x/l.scrollRatio.x:0,k=j>0?j/l.scrollRatio.x:0;break;case"y":var v=e("#mCSB_"+l.idx+"_dragger_vertical"),y="top",b=p[0].offsetTop,w=[h.height()-p.outerHeight(!1),v.parent().height()-v.height()],_=[i,0===i?0:i/l.scrollRatio.y],x=m[0],j=g[0],S=x>0?x/l.scrollRatio.y:0,k=j>0?j/l.scrollRatio.y:0}_[1]<0||0===_[0]&&0===_[1]?_=[0,0]:_[1]>=w[1]?_=[w[0],w[1]]:_[0]=-_[0],t[0].mcs||(s(),a("onInit")&&u.callbacks.onInit.call(t[0])),clearTimeout(p[0].onCompleteTimeout),(l.tweenRunning||!(0===b&&_[0]>=0||b===w[0]&&_[0]<=w[0]))&&(G(v[0],y,Math.round(_[1]),d[1],r.scrollEasing),G(p[0],y,Math.round(_[0]),d[0],r.scrollEasing,r.overwrite,{onStart:function(){r.callbacks&&r.onStart&&!l.tweenRunning&&(a("onScrollStart")&&(s(),u.callbacks.onScrollStart.call(t[0])),l.tweenRunning=!0,C(v),l.cbOffsets=o())},onUpdate:function(){r.callbacks&&r.onUpdate&&a("whileScrolling")&&(s(),u.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(r.callbacks&&r.onComplete){"yx"===u.axis&&clearTimeout(p[0].onCompleteTimeout);var e=p[0].idleTimer||0;p[0].onCompleteTimeout=setTimeout(function(){a("onScroll")&&(s(),u.callbacks.onScroll.call(t[0])),a("onTotalScroll")&&_[1]>=w[1]-S&&l.cbOffsets[0]&&(s(),u.callbacks.onTotalScroll.call(t[0])),a("onTotalScrollBack")&&_[1]<=k&&l.cbOffsets[1]&&(s(),u.callbacks.onTotalScrollBack.call(t[0])),l.tweenRunning=!1,p[0].idleTimer=0,C(v,"hide")},e)}}}))}},G=function(e,t,i,n,r,a,o){function s(){_.stop||(y||f.call(),y=K()-v,l(),y>=_.time&&(_.time=y>_.time?y+h-(y-_.time):y+h-1,_.time<y+1&&(_.time=y+1)),_.time<n?_.id=p(s):g.call())}function l(){n>0?(_.currVal=d(_.time,b,x,n,r),w[t]=Math.round(_.currVal)+"px"):w[t]=i+"px",m.call()}function u(){h=1e3/60,_.time=y+h,p=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return l(),setTimeout(e,.01)},_.id=p(s)}function c(){null!=_.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(_.id):clearTimeout(_.id),_.id=null)}function d(e,t,i,n,r){switch(r){case"linear":case"mcsLinear":return i*e/n+t;case"mcsLinearOut":return e/=n,e--,i*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=n/2,1>e?i/2*e*e+t:(e--,-i/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=n/2,1>e?i/2*Math.pow(2,10*(e-1))+t:(e--,i/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=n/2,1>e?i/2*e*e*e+t:(e-=2,i/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=n,e--,-i*(e*e*e*e-1)+t;case"easeOutStrong":return i*(-Math.pow(2,-10*e/n)+1)+t;case"easeOut":case"mcsEaseOut":default:var a=(e/=n)*e,o=a*e;return t+i*(.499999999999997*o*a+-2.5*a*a+5.5*o+-6.5*a+4*e)}}e._mTween||(e._mTween={top:{},left:{}});var h,p,o=o||{},f=o.onStart||function(){},m=o.onUpdate||function(){},g=o.onComplete||function(){},v=K(),y=0,b=e.offsetTop,w=e.style,_=e._mTween[t];"left"===t&&(b=e.offsetLeft);var x=i-b;_.stop=0,"none"!==a&&c(),u()},K=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},V=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],i=0;i<t.length;i++){var n=t[i];e._mTween[n].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(e._mTween[n].id):clearTimeout(e._mTween[n].id),e._mTween[n].id=null,e._mTween[n].stop=1)}},Z=function(e,t){try{delete e[t]}catch(i){e[t]=null}},J=function(e){return!(e.which&&1!==e.which)},ee=function(e){var t=e.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},te=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ie=function(e){var t=e.parents(".mCSB_container");return[e.offset().top-t.offset().top,e.offset().left-t.offset().left]};e.fn[i]=function(t){return d[t]?d[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):d.init.apply(this,arguments)},e[i]=function(t){return d[t]?d[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):d.init.apply(this,arguments)},e[i].defaults=a,window[i]=!0,e(window).load(function(){e(r)[i](),e.extend(e.expr[":"],{mcsInView:e.expr[":"].mcsInView||function(t){var i,n,r=e(t),a=r.parents(".mCSB_container");return a.length?(i=a.parent(),n=[a[0].offsetTop,a[0].offsetLeft],n[0]+ie(r)[0]>=0&&n[0]+ie(r)[0]<i.height()-r.outerHeight(!1)&&n[1]+ie(r)[1]>=0&&n[1]+ie(r)[1]<i.width()-r.outerWidth(!1)):void 0},mcsOverflow:e.expr[":"].mcsOverflow||function(t){var i=e(t).data(n);return i?i.overflowed[0]||i.overflowed[1]:void 0}})})})}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){"use strict";var t=e(window),i=e(document),n=window.location,r=!0,a=!1,o=null,s=NaN,l=1/0,u="undefined",c="directive",d=".cropper",h=/^(e|n|w|s|ne|nw|sw|se|all|crop|move|zoom)#x2F;,p=/^(x|y|width|height)#x2F;,f=/^(naturalWidth|naturalHeight|width|height|aspectRatio|ratio|rotate)#x2F;,m="cropper-modal",g="cropper-hidden",v="cropper-invisible",y="cropper-move",b="cropper-crop",w="cropper-disabled",_="mousedown touchstart",x="mousemove touchmove",j="mouseup mouseleave touchend touchleave touchcancel",C="wheel mousewheel DOMMouseScroll",S="resize"+d,k="dblclick",Q="build"+d,$="built"+d,D="dragstart"+d,T="dragmove"+d,O="dragend"+d,A=function(e){return"number"==typeof e},M=function(e,t){var i=[];return"number"==typeof t&&i.push(t),i.slice.apply(e,i)},E=function(e,t){var i=M(arguments,2);return function(){return e.apply(t,i.concat(M(arguments)))}},I=function(t,i){this.element=t,this.$element=e(t),this.defaults=e.extend({},I.DEFAULTS,e.isPlainObject(i)?i:{}),this.$original=o,this.ready=a,this.built=a,this.cropped=a,this.rotated=a,this.disabled=a,this.replaced=a,this.init()},P=Math.sqrt,L=Math.min,R=Math.max,H=Math.abs,B=Math.sin,z=Math.cos,q=parseFloat;I.prototype={constructor:I,support:{canvas:e.isFunction(e("<canvas>")[0].getContext)},init:function(){var t=this.defaults;e.each(t,function(e,i){switch(e){case"aspectRatio":t[e]=H(q(i))||s;break;case"autoCropArea":t[e]=H(q(i))||.8;break;case"minWidth":case"minHeight":t[e]=H(q(i))||0;break;case"maxWidth":case"maxHeight":t[e]=H(q(i))||l}}),this.image={rotate:0},this.load()},load:function(){var t,i,n=this,a=this.$element,o=this.element,s=this.image,l="";a.is("img")?i=a.prop("src"):a.is("canvas")&&this.support.canvas&&(i=o.toDataURL()),i&&(this.replaced&&(s.rotate=0),this.defaults.checkImageOrigin&&(a.prop("crossOrigin")||this.isCrossOriginURL(i))&&(l=" crossOrigin"),this.$clone=t=e("<img"+l+' src="'+i+'">'),t.one("load",function(){s.naturalWidth=this.naturalWidth||t.width(),s.naturalHeight=this.naturalHeight||t.height(),s.aspectRatio=s.naturalWidth/s.naturalHeight,n.url=i,n.ready=r,n.build()}),t.addClass(v).prependTo("body"))},isCrossOriginURL:function(e){var t=e.match(/^(https?:)\/\/([^\:\/\?#]+):?(\d*)/i);return!t||t[1]===n.protocol&&t[2]===n.hostname&&t[3]===n.port?a:r},build:function(){var t,i,n=this.$element,o=this.defaults;this.ready&&(this.built&&this.unbuild(),n.one(Q,o.build),t=e.Event(Q),n.trigger(t),t.isDefaultPrevented()||(this.$cropper=i=e(I.TEMPLATE),n.addClass(g),this.$clone.removeClass(v).prependTo(i),this.rotated||(this.$original=this.$clone.clone(),this.$original.addClass(g).prependTo(this.$cropper),this.originalImage=e.extend({},this.image)),this.$container=n.parent(),this.$container.append(i),this.$canvas=i.find(".cropper-canvas"),this.$dragger=i.find(".cropper-dragger"),this.$viewer=i.find(".cropper-viewer"),o.autoCrop?this.cropped=r:this.$dragger.addClass(g),o.dragCrop&&this.setDragMode("crop"),o.modal&&this.$canvas.addClass(m),!o.dashed&&this.$dragger.find(".cropper-dashed").addClass(g),!o.movable&&this.$dragger.find(".cropper-face").data(c,"move"),!o.resizable&&this.$dragger.find(".cropper-line, .cropper-point").addClass(g),this.addListeners(),this.initPreview(),this.built=r,this.update(),this.replaced=a,n.one($,o.built),n.trigger($)))},unbuild:function(){this.built&&(this.built=a,this.removeListeners(),this.$preview.empty(),this.$preview=o,this.$dragger=o,this.$canvas=o,this.$container=o,this.$cropper.remove(),this.$cropper=o)},update:function(e){this.initContainer(),this.initCropper(),this.initImage(),this.initDragger(),e?(this.setData(e,r),this.setDragMode("crop")):this.setData(this.defaults.data)},resize:function(){clearTimeout(this.resizing),this.resizing=setTimeout(e.proxy(this.update,this,this.getData()),200)},preview:function(){var t=this.image,i=this.dragger,n=t.width,r=t.height,a=i.left-t.left,o=i.top-t.top;this.$viewer.find("img").css({width:n,height:r,marginLeft:-a,marginTop:-o}),this.$preview.each(function(){var t=e(this),s=t.width()/i.width;t.find("img").css({width:n*s,height:r*s,marginLeft:-a*s,marginTop:-o*s})})},addListeners:function(){var n=this.defaults;this.$element.on(D,n.dragstart).on(T,n.dragmove).on(O,n.dragend),this.$cropper.on(_,e.proxy(this.dragstart,this)).on(k,e.proxy(this.dblclick,this)),n.zoomable&&this.$cropper.on(C,e.proxy(this.wheel,this)),n.multiple?this.$cropper.on(x,e.proxy(this.dragmove,this)).on(j,e.proxy(this.dragend,this)):i.on(x,this._dragmove=E(this.dragmove,this)).on(j,this._dragend=E(this.dragend,this)),t.on(S,this._resize=E(this.resize,this))},removeListeners:function(){var e=this.defaults;this.$element.off(D,e.dragstart).off(T,e.dragmove).off(O,e.dragend),this.$cropper.off(_,this.dragstart).off(k,this.dblclick),e.zoomable&&this.$cropper.off(C,this.wheel),e.multiple?this.$cropper.off(x,this.dragmove).off(j,this.dragend):i.off(x,this._dragmove).off(j,this._dragend),t.off(S,this._resize)},initPreview:function(){var t='<img src="'+this.url+'">';this.$preview=e(this.defaults.preview),this.$viewer.html(t),this.$preview.html(t).find("img").css("cssText","min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;")},initContainer:function(){var e=this.$container;e!==o&&(this.container={width:R(e.width(),300),height:R(e.height(),150)})},initCropper:function(){var e,t=this.container,i=this.image;i.naturalWidth*t.height/i.naturalHeight-t.width>=0?(e={width:t.width,height:t.width/i.aspectRatio,left:0},e.top=(t.height-e.height)/2):(e={width:t.height*i.aspectRatio,height:t.height,top:0},e.left=(t.width-e.width)/2),this.$cropper.css({width:e.width,height:e.height,left:e.left,top:e.top}),this.cropper=e},initImage:function(){var t=this.image,i=this.cropper,n={_width:i.width,_height:i.height,width:i.width,height:i.height,left:0,top:0,ratio:i.width/t.naturalWidth};this.defaultImage=e.extend({},t,n),t._width!==i.width||t._height!==i.height?e.extend(t,n):(t=e.extend({},n,t),this.replaced&&(t.ratio=n.ratio)),this.image=t,this.renderImage()},renderImage:function(e){var t=this.image;"zoom"===e&&(t.left-=(t.width-t.oldWidth)/2,t.top-=(t.height-t.oldHeight)/2),t.left=L(R(t.left,t._width-t.width),0),t.top=L(R(t.top,t._height-t.height),0),this.$clone.css({width:t.width,height:t.height,marginLeft:t.left,marginTop:t.top}),e&&(this.defaults.done(this.getData()),this.preview())},initDragger:function(){var t,i=this.defaults,n=this.cropper,r=i.aspectRatio||this.image.aspectRatio,a=this.image.ratio;t=n.height*r-n.width>=0?{height:n.width/r,width:n.width,left:0,top:(n.height-n.width/r)/2,maxWidth:n.width,maxHeight:n.width/r}:{height:n.height,width:n.height*r,left:(n.width-n.height*r)/2,top:0,maxWidth:n.height*r,maxHeight:n.height},t.minWidth=0,t.minHeight=0,i.aspectRatio?(isFinite(i.maxWidth)?(t.maxWidth=L(t.maxWidth,i.maxWidth*a),t.maxHeight=t.maxWidth/r):isFinite(i.maxHeight)&&(t.maxHeight=L(t.maxHeight,i.maxHeight*a),t.maxWidth=t.maxHeight*r),i.minWidth>0?(t.minWidth=R(0,i.minWidth*a),t.minHeight=t.minWidth/r):i.minHeight>0&&(t.minHeight=R(0,i.minHeight*a),t.minWidth=t.minHeight*r)):(t.maxWidth=L(t.maxWidth,i.maxWidth*a),t.maxHeight=L(t.maxHeight,i.maxHeight*a),t.minWidth=R(0,i.minWidth*a),t.minHeight=R(0,i.minHeight*a)),t.minWidth=L(t.maxWidth,t.minWidth),t.minHeight=L(t.maxHeight,t.minHeight),t.height*=i.autoCropArea,t.width*=i.autoCropArea,t.left=(n.width-t.width)/2,t.top=(n.height-t.height)/2,t.oldLeft=t.left,t.oldTop=t.top,this.defaultDragger=t,this.dragger=e.extend({},t)},renderDragger:function(){var e=this.dragger,t=this.cropper;e.width>e.maxWidth?(e.width=e.maxWidth,e.left=e.oldLeft):e.width<e.minWidth&&(e.width=e.minWidth,e.left=e.oldLeft),e.height>e.maxHeight?(e.height=e.maxHeight,e.top=e.oldTop):e.height<e.minHeight&&(e.height=e.minHeight,e.top=e.oldTop),e.left=L(R(e.left,0),t.width-e.width),e.top=L(R(e.top,0),t.height-e.height),e.oldLeft=e.left,e.oldTop=e.top,this.dragger=e,this.disabled||this.defaults.done(this.getData()),this.$dragger.css({width:e.width,height:e.height,left:e.left,top:e.top}),this.preview()},reset:function(t){this.cropped&&(t&&(this.defaults.data={}),this.image=e.extend({},this.defaultImage),this.renderImage(),this.dragger=e.extend({},this.defaultDragger),this.setData(this.defaults.data))},clear:function(){this.cropped&&(this.cropped=a,this.setData({x:0,y:0,width:0,height:0}),this.$canvas.removeClass(m),this.$dragger.addClass(g))},destroy:function(){var e=this.$element;this.ready&&(this.unbuild(),e.removeClass(g).removeData("cropper"),this.rotated&&e.attr("src",this.$original.attr("src")))},replace:function(t,i){var n,o=this,s=this.$element,l=this.element;t&&t!==this.url&&t!==s.attr("src")&&(i||(this.rotated=a,this.replaced=r),s.is("img")?(s.attr("src",t),this.load()):s.is("canvas")&&this.support.canvas&&(n=l.getContext("2d"),e('<img src="'+t+'">').one("load",function(){l.width=this.width,l.height=this.height,n.clearRect(0,0,l.width,l.height),n.drawImage(this,0,0),o.load()})))},setData:function(t,i){var n=this.cropper,r=this.dragger,a=this.image,s=this.defaults.aspectRatio;this.built&&typeof t!==u&&((t===o||e.isEmptyObject(t))&&(r=e.extend({},this.defaultDragger)),e.isPlainObject(t)&&!e.isEmptyObject(t)&&(i||(this.defaults.data=t),t=this.transformData(t),A(t.x)&&t.x<=n.width-a.left&&(r.left=t.x+a.left),A(t.y)&&t.y<=n.height-a.top&&(r.top=t.y+a.top),s?A(t.width)&&t.width<=r.maxWidth&&t.width>=r.minWidth?(r.width=t.width,r.height=r.width/s):A(t.height)&&t.height<=r.maxHeight&&t.height>=r.minHeight&&(r.height=t.height,r.width=r.height*s):(A(t.width)&&t.width<=r.maxWidth&&t.width>=r.minWidth&&(r.width=t.width),A(t.height)&&t.height<=r.maxHeight&&t.height>=r.minHeight&&(r.height=t.height))),this.dragger=r,this.renderDragger())},getData:function(e){var t=this.dragger,i=this.image,n={};return this.built&&(n={x:t.left-i.left,y:t.top-i.top,width:t.width,height:t.height},n=this.transformData(n,r,e)),n},transformData:function(t,i,n){var r=this.image.ratio,a={};return e.each(t,function(e,t){t=q(t),p.test(e)&&!isNaN(t)&&(a[e]=i?n?Math.round(t/r):t/r:t*r)}),a},setAspectRatio:function(e){var t="auto"===e;e=q(e),(t||!isNaN(e)&&e>0)&&(this.defaults.aspectRatio=t?s:e,this.built&&(this.initDragger(),this.renderDragger()))},getImageData:function(){var t={};return this.ready&&e.each(this.image,function(e,i){f.test(e)&&(t[e]=i)}),t},getDataURL:function(t,i,n){var r,a=e("<canvas>")[0],o=this.getData(),s="";return e.isPlainObject(t)||(n=i,i=t,t={}),t=e.extend({width:o.width,height:o.height},t),this.cropped&&this.support.canvas&&(a.width=t.width,a.height=t.height,r=a.getContext("2d"),"image/jpeg"===i&&(r.fillStyle="#fff",r.fillRect(0,0,t.width,t.height)),r.drawImage(this.$clone[0],o.x,o.y,o.width,o.height,0,0,t.width,t.height),s=a.toDataURL(i,n)),s},setDragMode:function(e){var t=this.$canvas,i=this.defaults,n=a,o=a;if(this.built&&!this.disabled){switch(e){case"crop":i.dragCrop&&(n=r,t.data(c,e));break;case"move":o=r,t.data(c,e);break;default:t.removeData(c)}t.toggleClass(b,n).toggleClass(y,o)}},enable:function(){this.built&&(this.disabled=a,this.$cropper.removeClass(w))},disable:function(){this.built&&(this.disabled=r,this.$cropper.addClass(w))},rotate:function(e){var t=this.image;e=q(e)||0,this.built&&0!==e&&!this.disabled&&this.defaults.rotatable&&this.support.canvas&&(this.rotated=r,e=t.rotate=(t.rotate+e)%360,this.replace(this.getRotatedDataURL(e),!0))},getRotatedDataURL:function(t){var i=e("<canvas>")[0],n=i.getContext("2d"),r=t*Math.PI/180,a=H(t)%180,o=a>90?180-a:a,s=o*Math.PI/180,l=this.originalImage,u=l.naturalWidth,c=l.naturalHeight,d=H(u*z(s)+c*B(s)),h=H(u*B(s)+c*z(s));return i.width=d,i.height=h,n.save(),n.translate(d/2,h/2),n.rotate(r),n.drawImage(this.$original[0],-u/2,-c/2,u,c),n.restore(),i.toDataURL()},zoom:function(e){var t,i,n,r=this.image;e=q(e),this.built&&e&&!this.disabled&&this.defaults.zoomable&&(t=r.width*(1+e),i=r.height*(1+e),n=t/r._width,n>10||(1>n&&(t=r._width,i=r._height),1>=n?this.setDragMode("crop"):this.setDragMode("move"),r.oldWidth=r.width,r.oldHeight=r.height,r.width=t,r.height=i,r.ratio=r.width/r.naturalWidth,this.renderImage("zoom")))},dblclick:function(){this.disabled||(this.$canvas.hasClass(b)?this.setDragMode("move"):this.setDragMode("crop"))},wheel:function(e){var t,i=e.originalEvent,n=117.25,r=5,a=166.66665649414062,o=.1;this.disabled||(e.preventDefault(),i.deltaY?(t=i.deltaY,t=t%r===0?t/r:t%n===0?t/n:t/a):t=i.wheelDelta?-i.wheelDelta/120:i.detail?i.detail/3:0,this.zoom(t*o))},dragstart:function(t){var i,n,o,s=t.originalEvent.touches,l=t;if(!this.disabled){if(s){if(o=s.length,o>1){if(!this.defaults.zoomable||2!==o)return;l=s[1],this.startX2=l.pageX,this.startY2=l.pageY,i="zoom"}l=s[0]}if(i=i||e(l.target).data(c),h.test(i)){if(t.preventDefault(),n=e.Event(D),this.$element.trigger(n),n.isDefaultPrevented())return;this.directive=i,this.cropping=a,this.startX=l.pageX,this.startY=l.pageY,"crop"===i&&(this.cropping=r,this.$canvas.addClass(m))}}},dragmove:function(t){var i,n,r=t.originalEvent.touches,a=t;if(!this.disabled){if(r){if(n=r.length,n>1){if(!this.defaults.zoomable||2!==n)return;a=r[1],this.endX2=a.pageX,this.endY2=a.pageY}a=r[0]}if(this.directive){if(t.preventDefault(),i=e.Event(T),this.$element.trigger(i),i.isDefaultPrevented())return;this.endX=a.pageX,this.endY=a.pageY,this.dragging()}}},dragend:function(t){var i;if(!this.disabled&&this.directive){if(t.preventDefault(),i=e.Event(O),this.$element.trigger(i),i.isDefaultPrevented())return;this.cropping&&(this.cropping=a,this.$canvas.toggleClass(m,this.cropped&&this.defaults.modal)),this.directive=""}},dragging:function(){var e,t=this.directive,i=this.image,n=this.cropper,o=n.width,s=n.height,l=this.dragger,u=l.width,c=l.height,d=l.left,h=l.top,p=d+u,f=h+c,m=r,v=this.defaults,y=v.aspectRatio,b={x:this.endX-this.startX,y:this.endY-this.startY};switch(y&&(b.X=b.y*y,b.Y=b.x/y),t){case"all":d+=b.x,h+=b.y;break;case"e":if(b.x>=0&&(p>=o||y&&(0>=h||f>=s))){m=a;break}u+=b.x,y&&(c=u/y,h-=b.Y/2),0>u&&(t="w",u=0);break;case"n":if(b.y<=0&&(0>=h||y&&(0>=d||p>=o))){m=a;break}c-=b.y,h+=b.y,y&&(u=c*y,d+=b.X/2),0>c&&(t="s",c=0);break;case"w":if(b.x<=0&&(0>=d||y&&(0>=h||f>=s))){m=a;break}u-=b.x,d+=b.x,y&&(c=u/y,h+=b.Y/2),0>u&&(t="e",u=0);break;case"s":if(b.y>=0&&(f>=s||y&&(0>=d||p>=o))){m=a;break}c+=b.y,y&&(u=c*y,d-=b.X/2),0>c&&(t="n",c=0);break;case"ne":if(y){if(b.y<=0&&(0>=h||p>=o)){m=a;break}c-=b.y,h+=b.y,u=c*y}else b.x>=0?o>p?u+=b.x:b.y<=0&&0>=h&&(m=a):u+=b.x,b.y<=0?h>0&&(c-=b.y,h+=b.y):(c-=b.y,h+=b.y);0>c&&(t="sw",c=0,u=0);break;case"nw":if(y){if(b.y<=0&&(0>=h||0>=d)){m=a;break}c-=b.y,h+=b.y,u=c*y,d+=b.X}else b.x<=0?d>0?(u-=b.x,d+=b.x):b.y<=0&&0>=h&&(m=a):(u-=b.x,d+=b.x),b.y<=0?h>0&&(c-=b.y,h+=b.y):(c-=b.y,h+=b.y);0>c&&(t="se",c=0,u=0);break;case"sw":if(y){if(b.x<=0&&(0>=d||f>=s)){m=a;break}u-=b.x,d+=b.x,c=u/y}else b.x<=0?d>0?(u-=b.x,d+=b.x):b.y>=0&&f>=s&&(m=a):(u-=b.x,d+=b.x),b.y>=0?s>f&&(c+=b.y):c+=b.y;0>u&&(t="ne",c=0,u=0);break;case"se":if(y){if(b.x>=0&&(p>=o||f>=s)){m=a;break}u+=b.x,c=u/y}else b.x>=0?o>p?u+=b.x:b.y>=0&&f>=s&&(m=a):u+=b.x,b.y>=0?s>f&&(c+=b.y):c+=b.y;0>u&&(t="nw",c=0,u=0);break;case"move":i.left+=b.x,i.top+=b.y,this.renderImage("move"),m=a;break;case"zoom":v.zoomable&&(this.zoom(function(e,t,i,n,r,a){return(P(r*r+a*a)-P(i*i+n*n))/P(e*e+t*t)}(i.width,i.height,H(this.startX-this.startX2),H(this.startY-this.startY2),H(this.endX-this.endX2),H(this.endY-this.endY2))),this.endX2=this.startX2,this.endY2=this.startY2);break;case"crop":b.x&&b.y&&(e=this.$cropper.offset(),d=this.startX-e.left,h=this.startY-e.top,u=l.minWidth,c=l.minHeight,b.x>0?b.y>0?t="se":(t="ne",h-=c):b.y>0?(t="sw",d-=u):(t="nw",d-=u,h-=c),this.cropped||(this.cropped=r,this.$dragger.removeClass(g)))}m&&(l.width=u,l.height=c,l.left=d,l.top=h,this.directive=t,this.renderDragger()),this.startX=this.endX,this.startY=this.endY}},I.TEMPLATE=function(e,t){return t=t.split(","),e.replace(/\d+/g,function(e){return t[e]})}('<0 6="5-container"><0 6="5-canvas"></0><0 6="5-dragger"><1 6="5-viewer"></1><1 6="5-8 8-h"></1><1 6="5-8 8-v"></1><1 6="5-face" 3-2="all"></1><1 6="5-7 7-e" 3-2="e"></1><1 6="5-7 7-n" 3-2="n"></1><1 6="5-7 7-w" 3-2="w"></1><1 6="5-7 7-s" 3-2="s"></1><1 6="5-4 4-e" 3-2="e"></1><1 6="5-4 4-n" 3-2="n"></1><1 6="5-4 4-w" 3-2="w"></1><1 6="5-4 4-s" 3-2="s"></1><1 6="5-4 4-ne" 3-2="ne"></1><1 6="5-4 4-nw" 3-2="nw"></1><1 6="5-4 4-sw" 3-2="sw"></1><1 6="5-4 4-se" 3-2="se"></1></0></0>',"div,span,directive,data,point,cropper,class,line,dashed"),I.DEFAULTS={aspectRatio:"auto",autoCropArea:.8,data:{},done:e.noop,preview:"",multiple:a,autoCrop:r,dragCrop:r,dashed:r,modal:r,movable:r,resizable:r,zoomable:r,rotatable:r,checkImageOrigin:r,minWidth:0,minHeight:0,maxWidth:l,maxHeight:l,build:o,built:o,dragstart:o,dragmove:o,dragend:o},I.setDefaults=function(t){e.extend(I.DEFAULTS,t)},I.other=e.fn.cropper,e.fn.cropper=function(t){var i,n=M(arguments,1);return this.each(function(){var r,a=e(this),o=a.data("cropper");o||a.data("cropper",o=new I(this,t)),"string"==typeof t&&e.isFunction(r=o[t])&&(i=r.apply(o,n))}),typeof i!==u?i:this},e.fn.cropper.Constructor=I,e.fn.cropper.setDefaults=I.setDefaults,e.fn.cropper.noConflict=function(){return e.fn.cropper=I.other,this}}),function(e){function t(e,t){return"function"==typeof e?e.call(t):e}function i(e){for(;e=e.parentNode;)if(e==document)return!0;return!1}function n(t,i){this.$element=e(t),this.options=i,this.enabled=!0,this.fixTitle()}n.prototype={show:function(){var i=this.getTitle();if(i&&this.enabled){var n=this.tip();n.find(".tipsy-inner")[this.options.html?"html":"text"](i),n[0].className="tipsy",n.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var r,a=e.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}),o=n[0].offsetWidth,s=n[0].offsetHeight,l=t(this.options.gravity,this.$element[0]);switch(l.charAt(0)){case"n":r={top:a.top+a.height+this.options.offset,left:a.left+a.width/2-o/2};break;case"s":r={top:a.top-s-this.options.offset,left:a.left+a.width/2-o/2};break;case"e":r={top:a.top+a.height/2-s/2,left:a.left-o-this.options.offset};break;case"w":extra_gap=0,e("body").css("position").length>0&&"relative"==e("body").css("position")&&e("#wpadminbar").length&&(extra_gap=e("#wpadminbar").height()),r={top:a.top+a.height/2-s/2-extra_gap,left:a.left+a.width+this.options.offset}}2==l.length&&("w"==l.charAt(1)?r.left=a.left+a.width/2-15:r.left=a.left+a.width/2-o+15),n.css(r).addClass("tipsy-"+l),n.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+l.charAt(0),this.options.className&&n.addClass(t(this.options.className,this.$element[0])),this.options.fade?n.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity}):n.css({visibility:"visible",opacity:this.options.opacity})}},hide:function(){this.options.fade?this.tip().stop().fadeOut(function(){e(this).remove()}):this.tip().remove()},fixTitle:function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("original-title"))&&e.attr("original-title",e.attr("title")||"").removeAttr("title")},getTitle:function(){var e,t=this.$element,i=this.options;this.fixTitle();var e,i=this.options;return"string"==typeof i.title?e=t.attr("title"==i.title?"original-title":i.title):"function"==typeof i.title&&(e=i.title.call(t[0])),e=(""+e).replace(/(^\s*|\s*$)/,""),e||i.fallback},tip:function(){return this.$tip||(this.$tip=e('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>'),this.$tip.data("tipsy-pointee",this.$element[0])),this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled}},e.fn.tipsy=function(t){function i(i){var r=e.data(i,"tipsy");return r||(r=new n(i,e.fn.tipsy.elementOptions(i,t)),e.data(i,"tipsy",r)),r}function r(){var e=i(this);e.hoverState="in",0==t.delayIn?e.show():(e.fixTitle(),setTimeout(function(){"in"==e.hoverState&&e.show()},t.delayIn))}function a(){var e=i(this);e.hoverState="out",0==t.delayOut?e.hide():setTimeout(function(){"out"==e.hoverState&&e.hide()},t.delayOut)}if(t===!0)return this.data("tipsy");if("string"==typeof t){var o=this.data("tipsy");return o&&o[t](),this}if(t=e.extend({},e.fn.tipsy.defaults,t),t.live||this.each(function(){i(this)}),"manual"!=t.trigger){var s="hover"==t.trigger?"mouseenter":"focus",l="hover"==t.trigger?"mouseleave":"blur";t.live?e(document).on(s,this.selector,r).on(l,this.selector,a):this.bind(s,r).bind(l,a)}return this},e.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:.8,title:"title",trigger:"hover"},e.fn.tipsy.revalidate=function(){e(".tipsy").each(function(){var t=e.data(this,"tipsy-pointee");t&&i(t)||e(this).remove()})},e.fn.tipsy.elementOptions=function(t,i){return e.metadata?e.extend({},i,e(t).metadata()):i},e.fn.tipsy.autoNS=function(){return e(this).offset().top>e(document).scrollTop()+e(window).height()/2?"s":"n"},e.fn.tipsy.autoWE=function(){return e(this).offset().left>e(document).scrollLeft()+e(window).width()/2?"e":"w"},e.fn.tipsy.autoBounds=function(t,i){return function(){var n={ns:i[0],ew:i.length>1?i[1]:!1},r=e(document).scrollTop()+t,a=e(document).scrollLeft()+t,o=e(this);return o.offset().top<r&&(n.ns="n"),o.offset().left<a&&(n.ew="w"),e(window).width()+e(document).scrollLeft()-o.offset().left<t&&(n.ew="e"),e(window).height()+e(document).scrollTop()-o.offset().top<t&&(n.ns="s"),n.ns+(n.ew?n.ew:"")}}}(jQuery);var live_field,live_value,xhrValidateUsername=!1;jQuery(document).ready(function(){2==jQuery("input[data-key=user_password],input[data-key=confirm_user_password]").length&&UM_check_password_matched()}),jQuery(function(){jQuery(".um-search form *").keypress(function(e){return 13==e.which?(jQuery(".um-search form").submit(),!1):void 0}),jQuery(document).on("touchend",function(){jQuery(".select2-search, .select2-focusser").remove()})}),jQuery(window).load(function(){um_responsive(),um_modal_responsive()}),jQuery(window).resize(function(){
8
- responsive_Modal(),jQuery("img.cropper-hidden").cropper("destroy"),um_responsive(),um_modal_responsive()}),jQuery(document).ready(function(){jQuery(document).on("input change",".um-field input[type=text]",function(){live_field=jQuery(this).parents(".um-field").data("key"),live_value=jQuery(this).val(),um_conditional()}),jQuery(".um-field input[type=text]").trigger("input"),jQuery(document).on("change",".um-field select, .um-field input[type=radio], .um-field input[type=checkbox]",function(){live_field=jQuery(this).parents(".um-field").data("key"),live_value=jQuery(this).val(),jQuery(this).is(":checkbox")&&(jQuery(this).parents(".um-field").find("input:checked").length>1?(live_value="",jQuery(this).parents(".um-field").find("input:checked").each(function(){live_value=live_value+jQuery(this).val()+" "})):live_value=jQuery(this).parents(".um-field").find("input:checked").val()),jQuery(this).is(":radio")&&(live_value=jQuery(this).parents(".um-field").find("input[type=radio]:checked").val()),um_conditional()}),jQuery(".um-field select, .um-field input[type=radio], .um-field input[type=checkbox]").trigger("change")}),jQuery(document).ready(function(){jQuery(document).on("click",".um-dropdown a",function(e){return!1}),jQuery(document).on("click",".um-dropdown a.real_url",function(e){window.location=jQuery(this).attr("href")}),jQuery(document).on("click",".um-trigger-menu-on-click",function(e){return jQuery(".um-dropdown").hide(),menu=jQuery(this).find(".um-dropdown"),menu.show(),!1}),jQuery(document).on("click",".um-dropdown-hide",function(e){UM_hide_menus()}),jQuery(document).on("click","a.um-manual-trigger",function(){var e=jQuery(this).attr("data-child"),t=jQuery(this).attr("data-parent");jQuery(this).parents(t).find(e).trigger("click")}),jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,live:"a.live",offset:3}),jQuery(document).on("change",".um-field-area input[type=radio]",function(){var e=jQuery(this).parents(".um-field-area"),t=jQuery(this).parents("label");e.find(".um-field-radio").removeClass("active"),e.find(".um-field-radio").find("i").removeClass().addClass("um-icon-android-radio-button-off"),t.addClass("active"),t.find("i").removeClass().addClass("um-icon-android-radio-button-on")}),jQuery(document).on("change",".um-field-area input[type=checkbox]",function(){var e=(jQuery(this).parents(".um-field-area"),jQuery(this).parents("label"));e.hasClass("active")?(e.removeClass("active"),e.find("i").removeClass().addClass("um-icon-android-checkbox-outline-blank")):(e.addClass("active"),e.find("i").removeClass().addClass("um-icon-android-checkbox-outline"))}),jQuery(".um-datepicker").each(function(){if(elem=jQuery(this),""!=elem.attr("data-disabled_weekdays"))var e=JSON.parse(elem.attr("data-disabled_weekdays"));else var e=!1;var t=elem.attr("data-years"),i=elem.attr("data-date_min"),n=elem.attr("data-date_max"),r=i.split(","),a=n.split(","),o=r.length?new Date(r):null,s=r.length?new Date(a):null;if(o&&"Invalid Date"==o.toString()&&3==r.length){var l=r[1]+"/"+r[2]+"/"+r[0];o=new Date(Date.parse(l))}if(s&&"Invalid Date"==s.toString()&&3==a.length){var u=a[1]+"/"+a[2]+"/"+a[0];s=new Date(Date.parse(u))}elem.pickadate({selectYears:t,min:o,max:s,disable:e,format:elem.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})}),jQuery(".um-timepicker").each(function(){elem=jQuery(this),elem.pickatime({format:elem.attr("data-format"),interval:parseInt(elem.attr("data-intervals")),formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})}),jQuery(".um-rating").raty({half:!1,starType:"i",number:function(){return jQuery(this).attr("data-number")},score:function(){return jQuery(this).attr("data-score")},scoreName:function(){return jQuery(this).attr("data-key")},hints:!1,click:function(e,t){live_field=this.id,live_value=e,um_conditional()}}),jQuery(".um-rating-readonly").raty({half:!1,starType:"i",number:function(){return jQuery(this).attr("data-number")},score:function(){return jQuery(this).attr("data-score")},scoreName:function(){return jQuery(this).attr("data-key")},hints:!1,readOnly:!0}),jQuery(document).on("click",".um .um-single-image-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field"),i=jQuery(this).parents(".um-field").find(".um-single-image-preview img").attr("src");return t.find(".um-single-image-preview img").attr("src",""),t.find(".um-single-image-preview").hide(),t.find(".um-btn-auto-width").html("Upload"),t.find("input[type=hidden]").val(""),jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_remove_file",src:i}}),!1}),jQuery(document).on("click",".um .um-single-file-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field"),i=jQuery(this).parents(".um-field").find(".um-single-fileinfo a").attr("href");return t.find(".um-single-file-preview").hide(),t.find(".um-btn-auto-width").html("Upload"),t.find("input[type=hidden]").val(""),jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_remove_file",src:i}}),!1}),jQuery(".um-s1,.um-s2").css({display:"block"}),jQuery(".um-s1").select2({allowClear:!0}),jQuery(".um-s2").select2({allowClear:!1,minimumResultsForSearch:10}),jQuery(document).on("click",".um-field-group-head:not(.disabled)",function(){var e=jQuery(this).parents(".um-field-group"),t=e.data("max_entries");e.find(".um-field-group-body").is(":hidden")?e.find(".um-field-group-body").show():e.find(".um-field-group-body:first").clone().appendTo(e),increase_id=0,e.find(".um-field-group-body").each(function(){increase_id++,jQuery(this).find("input").each(function(){var e=jQuery(this);e.attr("id",e.data("key")+"-"+increase_id),e.attr("name",e.data("key")+"-"+increase_id),e.parent().parent().find("label").attr("for",e.data("key")+"-"+increase_id)})}),t>0&&e.find(".um-field-group-body").length==t&&jQuery(this).addClass("disabled")}),jQuery(document).on("click",".um-field-group-cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field-group"),i=t.data("max_entries");return t.find(".um-field-group-body").length>1?jQuery(this).parents(".um-field-group-body").remove():jQuery(this).parents(".um-field-group-body").hide(),i>0&&t.find(".um-field-group-body").length<i&&t.find(".um-field-group-head").removeClass("disabled"),!1}),jQuery(document).on("click",".um-ajax-paginate",function(e){e.preventDefault();var t=jQuery(this).parent();t.addClass("loading");var i=jQuery(this).data("args"),n=jQuery(this).data("hook"),r=jQuery(this).parents(".um").find(".um-ajax-items");return jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_ajax_paginate",hook:n,args:i},complete:function(){t.removeClass("loading")},success:function(e){t.remove(),r.append(e)}}),!1}),jQuery(document).on("click",".um-ajax-action",function(e){e.preventDefault();var t=jQuery(this).data("hook"),i=jQuery(this).data("user_id"),n=jQuery(this).data("arguments");return jQuery(this).data("js-remove")&&jQuery(this).parents("."+jQuery(this).data("js-remove")).fadeOut("fast"),jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_muted_action",hook:t,user_id:i,arguments:n},success:function(e){}}),!1}),jQuery(document).on("click","#um-search-button",function(){jQuery(this).parents("form").submit()})}),jQuery(document).ready(function(){jQuery(".um-members").each(function(){UM_Member_Grid(jQuery(this))}),jQuery(".um-member-connect").each(function(){0==jQuery(this).find("a").length&&jQuery(this).remove()}),jQuery(".um-member-meta-main").each(function(){0==jQuery(this).find(".um-member-metaline").length&&0==jQuery(this).find(".um-member-connect").find("a").length&&jQuery(this).remove()}),jQuery(document).on("click",".um-member-more a",function(e){e.preventDefault();var t=jQuery(this).parents(".um-member"),i=jQuery(this).parents(".um-members");return t.find(".um-member-more").hide(),t.find(".um-member-meta").slideDown(function(){UM_Member_Grid(i)}),t.find(".um-member-less").fadeIn(),setTimeout(function(){UM_Member_Grid(i)},100),!1}),jQuery(document).on("click",".um-member-less a",function(e){e.preventDefault();var t=jQuery(this).parents(".um-member"),i=jQuery(this).parents(".um-members");return t.find(".um-member-less").hide(),t.find(".um-member-meta").slideUp(function(){t.find(".um-member-more").fadeIn(),UM_Member_Grid(i)}),!1}),jQuery(document).on("click",".um-do-search",function(e){return e.preventDefault(),jQuery(this).parents("form").submit(),!1})}),jQuery(document).ready(function(){function e(){if("undefined"!=typeof jQuery("textarea[id=um-meta-bio]").val()){var e=jQuery("textarea[id=um-meta-bio]").attr("data-character-limit"),t=e-jQuery("textarea[id=um-meta-bio]").val().length;jQuery("span.um-meta-bio-character span.um-bio-limit").text(t),5>t?jQuery("span.um-meta-bio-character").css("color","red"):jQuery("span.um-meta-bio-character").css("color","")}}jQuery(".um-profile.um-viewing .um-profile-body .um-row").each(function(){var e=jQuery(this);0==e.find(".um-field").length&&(e.prev(".um-row-heading").remove(),e.remove())}),jQuery(".um-profile.um-viewing .um-profile-body").length&&0==jQuery(".um-profile.um-viewing .um-profile-body").find(".um-field").length&&(jQuery(".um-row-heading,.um-row").remove(),jQuery(".um-profile-note").show()),jQuery(document).on("click",".um-profile-save",function(e){return e.preventDefault(),jQuery(this).parents(".um").find("form").submit(),!1}),jQuery(document).on("click",".um-profile-edit-a",function(e){jQuery(this).addClass("active")}),jQuery(document).on("click",".um-cover a, .um-photo a",function(e){return e.preventDefault(),!1}),jQuery(document).on("click",".um-photo-modal",function(e){e.preventDefault();var t=jQuery(this).attr("data-src");return um_new_modal("um_view_photo","fit",!0,t),!1}),jQuery(document).on("click",".um-reset-profile-photo",function(e){jQuery(".um-profile-photo-img img").attr("src",jQuery(this).attr("data-default_src")),user_id=jQuery(this).attr("data-user_id"),metakey="profile_photo",jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_delete_profile_photo",metakey:metakey,user_id:user_id}})}),jQuery(document).on("click",".um-reset-cover-photo",function(e){jQuery(".um-cover-overlay").hide(),jQuery(".um-cover-e").html('<a href="#" class="um-cover-add um-manual-trigger" data-parent=".um-cover" data-child=".um-btn-auto-width"><span class="um-cover-add-i"><i class="um-icon-plus um-tip-n" title="Upload a cover photo"></i></span></a>'),jQuery(".um-dropdown").hide(),um_responsive(),user_id=jQuery(this).attr("data-user_id"),metakey="cover_photo",jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_delete_cover_photo",metakey:metakey,user_id:user_id}})}),e(),jQuery("textarea[id=um-meta-bio]").change(e),jQuery("textarea[id=um-meta-bio]").keyup(e)}),jQuery(document).ready(function(){var e=jQuery(".um-account-main").attr("data-current_tab");e&&jQuery(".um-account-tab[data-tab="+e+"]").show(),jQuery(document).on("click",".um-account-side li a",function(e){e.preventDefault();var t=jQuery(this);t.parents("ul").find("li a").removeClass("current"),t.addClass("current");var i=jQuery(this).attr("href"),n=jQuery(this).attr("data-tab");return jQuery("#_um_account_tab").val(n),window.history.pushState("","",i),jQuery(".um-account-tab").hide(),jQuery(".um-account-tab[data-tab="+n+"]").fadeIn(),jQuery(".um-account-nav a").removeClass("current"),jQuery(".um-account-nav a[data-tab="+n+"]").addClass("current"),!1}),jQuery(document).on("click",".um-account-nav a",function(e){e.preventDefault();var t=jQuery(this).attr("data-tab"),i=jQuery(this).parents("div"),n=jQuery(this);return jQuery(".um-account-tab").hide(),n.hasClass("current")?(i.next(".um-account-tab").slideUp(),n.removeClass("current")):(i.next(".um-account-tab").slideDown(),n.parents("div").find("a").removeClass("current"),n.addClass("current")),jQuery(".um-account-side li a").removeClass("current"),jQuery(".um-account-side li a[data-tab="+t+"]").addClass("current"),!1})});
4
}}var r={};r.fileapi=void 0!==e("<input type='file'/>").get(0).files,r.formdata=void 0!==window.FormData;var a=!!e.fn.prop;e.fn.attr2=function(){if(!a)return this.attr.apply(this,arguments);var e=this.prop.apply(this,arguments);return e&&e.jquery||"string"==typeof e?e:this.attr.apply(this,arguments)},e.fn.ajaxSubmit=function(t){function i(i){var n,r,a=e.param(i,t.traditional).split("&"),o=a.length,s=[];for(n=0;o>n;n++)a[n]=a[n].replace(/\+/g," "),r=a[n].split("="),s.push([decodeURIComponent(r[0]),decodeURIComponent(r[1])]);return s}function o(n){for(var r=new FormData,a=0;a<n.length;a++)r.append(n[a].name,n[a].value);if(t.extraData){var o=i(t.extraData);for(a=0;a<o.length;a++)o[a]&&r.append(o[a][0],o[a][1])}t.data=null;var s=e.extend(!0,{},e.ajaxSettings,t,{contentType:!1,processData:!1,cache:!1,type:l||"POST"});t.uploadProgress&&(s.xhr=function(){var i=e.ajaxSettings.xhr();return i.upload&&i.upload.addEventListener("progress",function(e){var i=0,n=e.loaded||e.position,r=e.total;e.lengthComputable&&(i=Math.ceil(n/r*100)),t.uploadProgress(e,n,r,i)},!1),i}),s.data=null;var u=s.beforeSend;return s.beforeSend=function(e,i){t.formData?i.data=t.formData:i.data=r,u&&u.call(this,e,i)},e.ajax(s)}function s(i){function r(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(i){n("cannot get iframe.contentWindow document: "+i)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(i){n("cannot get iframe.contentDocument: "+i),t=e.document}return t}function o(){function t(){try{var e=r(v).readyState;n("state = "+e),e&&"uninitialized"==e.toLowerCase()&&setTimeout(t,50)}catch(i){n("Server abort: ",i," (",i.name,")"),s(k),x&&clearTimeout(x),x=void 0}}var i=d.attr2("target"),a=d.attr2("action"),o="multipart/form-data",u=d.attr("enctype")||d.attr("encoding")||o;j.setAttribute("target",f),(!l||/post/i.test(l))&&j.setAttribute("method","POST"),a!=h.url&&j.setAttribute("action",h.url),h.skipEncodingOverride||l&&!/post/i.test(l)||d.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),h.timeout&&(x=setTimeout(function(){_=!0,s(S)},h.timeout));var c=[];try{if(h.extraData)for(var p in h.extraData)h.extraData.hasOwnProperty(p)&&(e.isPlainObject(h.extraData[p])&&h.extraData[p].hasOwnProperty("name")&&h.extraData[p].hasOwnProperty("value")?c.push(e('<input type="hidden" name="'+h.extraData[p].name+'">').val(h.extraData[p].value).appendTo(j)[0]):c.push(e('<input type="hidden" name="'+p+'">').val(h.extraData[p]).appendTo(j)[0]));h.iframeTarget||g.appendTo("body"),v.attachEvent?v.attachEvent("onload",s):v.addEventListener("load",s,!1),setTimeout(t,15);try{j.submit()}catch(m){var y=document.createElement("form").submit;y.apply(j)}}finally{j.setAttribute("action",a),j.setAttribute("enctype",u),i?j.setAttribute("target",i):d.removeAttr("target"),e(c).remove()}}function s(t){if(!y.aborted&&!O){if(T=r(v),T||(n("cannot access response document"),t=k),t===S&&y)return y.abort("timeout"),void C.reject(y,"timeout");if(t==k&&y)return y.abort("server abort"),void C.reject(y,"error","server abort");if(T&&T.location.href!=h.iframeSrc||_){v.detachEvent?v.detachEvent("onload",s):v.removeEventListener("load",s,!1);var i,a="success";try{if(_)throw"timeout";var o="xml"==h.dataType||T.XMLDocument||e.isXMLDoc(T);if(n("isXml="+o),!o&&window.opera&&(null===T.body||!T.body.innerHTML)&&--A)return n("requeing onLoad callback, DOM not available"),void setTimeout(s,250);var l=T.body?T.body:T.documentElement;y.responseText=l?l.innerHTML:null,y.responseXML=T.XMLDocument?T.XMLDocument:T,o&&(h.dataType="xml"),y.getResponseHeader=function(e){var t={"content-type":h.dataType};return t[e.toLowerCase()]},l&&(y.status=Number(l.getAttribute("status"))||y.status,y.statusText=l.getAttribute("statusText")||y.statusText);var u=(h.dataType||"").toLowerCase(),c=/(json|script|text)/.test(u);if(c||h.textarea){var d=T.getElementsByTagName("textarea")[0];if(d)y.responseText=d.value,y.status=Number(d.getAttribute("status"))||y.status,y.statusText=d.getAttribute("statusText")||y.statusText;else if(c){var f=T.getElementsByTagName("pre")[0],m=T.getElementsByTagName("body")[0];f?y.responseText=f.textContent?f.textContent:f.innerText:m&&(y.responseText=m.textContent?m.textContent:m.innerText)}}else"xml"==u&&!y.responseXML&&y.responseText&&(y.responseXML=M(y.responseText));try{D=I(y,u,h)}catch(b){a="parsererror",y.error=i=b||a}}catch(b){n("error caught: ",b),a="error",y.error=i=b||a}y.aborted&&(n("upload aborted"),a=null),y.status&&(a=y.status>=200&&y.status<300||304===y.status?"success":"error"),"success"===a?(h.success&&h.success.call(h.context,D,"success",y),C.resolve(y.responseText,"success",y),p&&e.event.trigger("ajaxSuccess",[y,h])):a&&(void 0===i&&(i=y.statusText),h.error&&h.error.call(h.context,y,a,i),C.reject(y,"error",i),p&&e.event.trigger("ajaxError",[y,h,i])),p&&e.event.trigger("ajaxComplete",[y,h]),p&&!--e.active&&e.event.trigger("ajaxStop"),h.complete&&h.complete.call(h.context,y,a),O=!0,h.timeout&&clearTimeout(x),setTimeout(function(){h.iframeTarget?g.attr("src",h.iframeSrc):g.remove(),y.responseXML=null},100)}}}var u,c,h,p,f,g,v,y,b,w,_,x,j=d[0],C=e.Deferred();if(C.abort=function(e){y.abort(e)},i)for(c=0;c<m.length;c++)u=e(m[c]),a?u.prop("disabled",!1):u.removeAttr("disabled");if(h=e.extend(!0,{},e.ajaxSettings,t),h.context=h.context||h,f="jqFormIO"+(new Date).getTime(),h.iframeTarget?(g=e(h.iframeTarget),w=g.attr2("name"),w?f=w:g.attr2("name",f)):(g=e('<iframe name="'+f+'" src="'+h.iframeSrc+'" />'),g.css({position:"absolute",top:"-1000px",left:"-1000px"})),v=g[0],y={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(t){var i="timeout"===t?"timeout":"aborted";n("aborting upload... "+i),this.aborted=1;try{v.contentWindow.document.execCommand&&v.contentWindow.document.execCommand("Stop")}catch(r){}g.attr("src",h.iframeSrc),y.error=i,h.error&&h.error.call(h.context,y,i,t),p&&e.event.trigger("ajaxError",[y,h,i]),h.complete&&h.complete.call(h.context,y,i)}},p=h.global,p&&0===e.active++&&e.event.trigger("ajaxStart"),p&&e.event.trigger("ajaxSend",[y,h]),h.beforeSend&&h.beforeSend.call(h.context,y,h)===!1)return h.global&&e.active--,C.reject(),C;if(y.aborted)return C.reject(),C;b=j.clk,b&&(w=b.name,w&&!b.disabled&&(h.extraData=h.extraData||{},h.extraData[w]=b.value,"image"==b.type&&(h.extraData[w+".x"]=j.clk_x,h.extraData[w+".y"]=j.clk_y)));var S=1,k=2,Q=e("meta[name=csrf-token]").attr("content"),$=e("meta[name=csrf-param]").attr("content");amp;&Q&&(h.extraData=h.extraData||{},h.extraData[$]=Q),h.forceSync?o():setTimeout(o,10);var D,T,O,A=50,M=e.parseXML||function(e,t){return window.ActiveXObject?(t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e)):t=(new DOMParser).parseFromString(e,"text/xml"),t&&t.documentElement&&"parsererror"!=t.documentElement.nodeName?t:null},E=e.parseJSON||function(e){return window.eval("("+e+")")},I=function(t,i,n){var r=t.getResponseHeader("content-type")||"",a="xml"===i||!i&&r.indexOf("xml")>=0,o=a?t.responseXML:t.responseText;return a&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),n&&n.dataFilter&&(o=n.dataFilter(o,i)),"string"==typeof o&&("json"===i||!i&&r.indexOf("json")>=0?o=E(o):("script"===i||!i&&r.indexOf("javascript")>=0)&&e.globalEval(o)),o};return C}if(!this.length)return n("ajaxSubmit: skipping submit process - no element selected"),this;var l,u,c,d=this;"function"==typeof t?t={success:t}:void 0===t&&(t={}),l=t.type||this.attr2("method"),u=t.url||this.attr2("action"),c="string"==typeof u?e.trim(u):"",c=c||window.location.href||"",c&&(c=(c.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:c,success:e.ajaxSettings.success,type:l||e.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},t);var h={};if(this.trigger("form-pre-serialize",[this,t,h]),h.veto)return n("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return n("ajaxSubmit: submit aborted via beforeSerialize callback"),this;var p=t.traditional;void 0===p&&(p=e.ajaxSettings.traditional);var f,m=[],g=this.formToArray(t.semantic,m);if(t.data&&(t.extraData=t.data,f=e.param(t.data,p)),t.beforeSubmit&&t.beforeSubmit(g,this,t)===!1)return n("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[g,this,t,h]),h.veto)return n("ajaxSubmit: submit vetoed via form-submit-validate trigger"),this;var v=e.param(g,p);f&&(v=v?v+"&"+f:f),"GET"==t.type.toUpperCase()?(t.url+=(t.url.indexOf("?")>=0?"&":"?")+v,t.data=null):t.data=v;var y=[];if(t.resetForm&&y.push(function(){d.resetForm()}),t.clearForm&&y.push(function(){d.clearForm(t.includeHidden)}),!t.dataType&&t.target){var b=t.success||function(){};y.push(function(i){var n=t.replaceTarget?"replaceWith":"html";e(t.target)[n](i).each(b,arguments)})}else t.success&&y.push(t.success);if(t.success=function(e,i,n){for(var r=t.context||this,a=0,o=y.length;o>a;a++)y[a].apply(r,[e,i,n||d,d])},t.error){var w=t.error;t.error=function(e,i,n){var r=t.context||this;w.apply(r,[e,i,n,d])}}if(t.complete){var _=t.complete;t.complete=function(e,i){var n=t.context||this;_.apply(n,[e,i,d])}}var x=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}),j=x.length>0,C="multipart/form-data",S=d.attr("enctype")==C||d.attr("encoding")==C,k=r.fileapi&&r.formdata;n("fileAPI :"+k);var Q,$=(j||S)&&!k;t.iframe!==!1&&(t.iframe||$)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){Q=s(g)}):Q=s(g):Q=(j||S)&&k?o(g):e.ajax(t),d.removeData("jqxhr").data("jqxhr",Q);for(var D=0;D<m.length;D++)m[D]=null;return this.trigger("form-submit-notify",[this,t]),this},e.fn.ajaxForm=function(r){if(r=r||{},r.delegation=r.delegation&&e.isFunction(e.fn.on),!r.delegation&&0===this.length){var a={s:this.selector,c:this.context};return!e.isReady&&a.s?(n("DOM not ready, queuing ajaxForm"),e(function(){e(a.s,a.c).ajaxForm(r)}),this):(n("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return r.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,i).on("submit.form-plugin",this.selector,r,t).on("click.form-plugin",this.selector,r,i),this):this.ajaxFormUnbind().bind("submit.form-plugin",r,t).bind("click.form-plugin",r,i)},e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t,i){var n=[];if(0===this.length)return n;var a,o=this[0],s=this.attr("id"),l=t?o.getElementsByTagName("*"):o.elements;if(l&&!/MSIE [678]/.test(navigator.userAgent)&&(l=e(l).get()),s&&(a=e(':input[form="'+s+'"]').get(),a.length&&(l=(l||[]).concat(a))),!l||!l.length)return n;var u,c,d,h,p,f,m;for(u=0,f=l.length;f>u;u++)if(p=l[u],d=p.name,d&&!p.disabled)if(t&&o.clk&&"image"==p.type)o.clk==p&&(n.push({name:d,value:e(p).val(),type:p.type}),n.push({name:d+".x",value:o.clk_x},{name:d+".y",value:o.clk_y}));else if(h=e.fieldValue(p,!0),h&&h.constructor==Array)for(i&&i.push(p),c=0,m=h.length;m>c;c++)n.push({name:d,value:h[c]});else if(r.fileapi&&"file"==p.type){i&&i.push(p);var g=p.files;if(g.length)for(c=0;c<g.length;c++)n.push({name:d,value:g[c],type:p.type});else n.push({name:d,value:"",type:p.type})}else null!==h&&"undefined"!=typeof h&&(i&&i.push(p),n.push({name:d,value:h,type:p.type,required:p.required}));if(!t&&o.clk){var v=e(o.clk),y=v[0];d=y.name,d&&!y.disabled&&"image"==y.type&&(n.push({name:d,value:v.val()}),n.push({name:d+".x",value:o.clk_x},{name:d+".y",value:o.clk_y}))}return n},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var i=[];return this.each(function(){var n=this.name;if(n){var r=e.fieldValue(this,t);if(r&&r.constructor==Array)for(var a=0,o=r.length;o>a;a++)i.push({name:n,value:r[a]});else null!==r&&"undefined"!=typeof r&&i.push({name:this.name,value:r})}}),e.param(i)},e.fn.fieldValue=function(t){for(var i=[],n=0,r=this.length;r>n;n++){var a=this[n],o=e.fieldValue(a,t);null===o||"undefined"==typeof o||o.constructor==Array&&!o.length||(o.constructor==Array?e.merge(i,o):i.push(o))}return i},e.fieldValue=function(t,i){var n=t.name,r=t.type,a=t.tagName.toLowerCase();if(void 0===i&&(i=!0),i&&(!n||t.disabled||"reset"==r||"button"==r||("checkbox"==r||"radio"==r)&&!t.checked||("submit"==r||"image"==r)&&t.form&&t.form.clk!=t||"select"==a&&-1==t.selectedIndex))return null;if("select"==a){var o=t.selectedIndex;if(0>o)return null;for(var s=[],l=t.options,u="select-one"==r,c=u?o+1:l.length,d=u?o:0;c>d;d++){var h=l[d];if(h.selected){var p=h.value;if(p||(p=h.attributes&&h.attributes.value&&!h.attributes.value.specified?h.text:h.value),u)return p;s.push(p)}}return s}return e(t).val()},e.fn.clearForm=function(t){return this.each(function(){e("input,select,textarea",this).clearFields(t)})},e.fn.clearFields=e.fn.clearInputs=function(t){var i=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)#x2F;i;return this.each(function(){var n=this.type,r=this.tagName.toLowerCase();i.test(n)||"textarea"==r?this.value="":"checkbox"==n||"radio"==n?this.checked=!1:"select"==r?this.selectedIndex=-1:"file"==n?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(t===!0&&/hidden/.test(n)||"string"==typeof t&&e(this).is(t))&&(this.value="")})},e.fn.resetForm=function(){return this.each(function(){("function"==typeof this.reset||"object"==typeof this.reset&&!this.reset.nodeType)&&this.reset()})},e.fn.enable=function(e){return void 0===e&&(e=!0),this.each(function(){this.disabled=!e})},e.fn.selected=function(t){return void 0===t&&(t=!0),this.each(function(){var i=this.type;if("checkbox"==i||"radio"==i)this.checked=t;else if("option"==this.tagName.toLowerCase()){var n=e(this).parent("select");t&&n[0]&&"select-one"==n[0].type&&n.find("option").selected(!1),this.selected=t}})},e.fn.ajaxSubmit.debug=!1}),function(e){void 0==e.fn.ajaxForm;var t={};t.fileapi=void 0!==e("<input type='file'/>").get(0).files,t.formdata=void 0!==window.FormData,e.fn.uploadFile=function(i){function n(){h.afterUploadAll&&!g&&(g=!0,function e(){0!=f.sCounter&&f.sCounter+f.fCounter==f.tCounter?(h.afterUploadAll(f),g=!1):window.setTimeout(e,100)}())}function r(t,i,n){n.on("dragenter",function(t){t.stopPropagation(),t.preventDefault(),e(this).css("border","2px dashed #ddd")}),n.on("dragover",function(e){e.stopPropagation(),e.preventDefault()}),n.on("drop",function(n){e(this).css("border","2px dashed #ddd"),n.preventDefault(),t.errorLog.html("");var r=n.originalEvent.dataTransfer.files;return!i.multiple&&r.length>1?void(i.showError&&e("<div class='um-error-block'>"+i.multiDragErrorStr+"</div>").appendTo(t.errorLog)):void(0!=i.onSelect(r)&&o(i,t,r))}),e(document).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}),e(document).on("dragover",function(e){e.stopPropagation(),e.preventDefault(),n.css("border","2px dashed #ddd")}),e(document).on("drop",function(e){e.stopPropagation(),e.preventDefault(),n.css("border","2px dashed #ddd")})}function a(t){var i=[];i="string"==jQuery.type(t)?t.split("&"):e.param(t).split("&");var n,r,a=i.length,o=[];for(n=0;a>n;n++)i[n]=i[n].replace(/\+/g," "),r=i[n].split("="),o.push([decodeURIComponent(r[0]),decodeURIComponent(r[1])]);return o}function o(t,i,n){for(var r=0;r<n.length;r++)if(s(i,t,n[r].name))if(-1!=t.maxFileSize&&n[r].size>t.maxFileSize)t.showError&&e("<div class='um-error-block'>"+t.sizeErrorStr+"</div>").appendTo(i.errorLog);else if(-1!=t.maxFileCount&&i.selectedFiles>=t.maxFileCount)t.showError&&e("<div class='um-error-block'>"+t.maxFileCountErrorStr+"</div>").appendTo(i.errorLog);else{i.selectedFiles++;var o=t,l=new FormData,u=t.fileName.replace("[]","");l.append(u,n[r]);var h=t.formData;if(h)for(var p=a(h),f=0;f<p.length;f++)p[f]&&l.append(p[f][0],p[f][1]);o.fileData=l;var m=new c(i,t),g="";g=t.showFileCounter?i.fileCounter+t.fileCounterStyle+n[r].name:n[r].name,m.filename.html(g);var v=e("<form style='display:block; position:absolute;left: 150px;' class='"+i.formGroup+"' method='"+t.method+"' action='"+t.url+"' enctype='"+t.enctype+"'></form>");v.appendTo("body");var y=[];y.push(n[r].name),d(v,o,m,y,i),i.fileCounter++}else t.showError&&e("<div class='um-error-block'>"+t.extErrorStr+"</div>").appendTo(i.errorLog)}function s(e,t,i){var n=t.allowedTypes.toLowerCase().split(","),r=i.split(".").pop().toLowerCase();return"*"!=t.allowedTypes&&jQuery.inArray(r,n)<0?!1:!0}function l(t,i){if(t.showFileCounter){var n=e(".upload-filename").length;i.fileCounter=n+1,e(".upload-filename").each(function(i,r){var a=e(this).html().split(t.fileCounterStyle),o=(parseInt(a[0])-1,n+t.fileCounterStyle+a[1]);e(this).html(o),n--})}}function u(i,n,r,a){var h="ajax-upload-id-"+(new Date).getTime(),p=e("<form method='"+r.method+"' action='"+r.url+"' enctype='"+r.enctype+"'></form>"),f="<input type='file' id='"+h+"' name='"+r.fileName+"'/>";r.multiple&&(r.fileName.indexOf("[]")!=r.fileName.length-2&&(r.fileName+="[]"),f="<input type='file' id='"+h+"' name='"+r.fileName+"' multiple/>");var m=e(f).appendTo(p);m.change(function(){i.errorLog.html("");var h=(r.allowedTypes.toLowerCase().split(","),[]);if(this.files){for(y=0;y<this.files.length;y++)h.push(this.files[y].name);if(0==r.onSelect(this.files))return}else{var f=e(this).val(),m=[];if(h.push(f),!s(i,r,f))return void(r.showError&&e("<div class='um-error-block'>"+r.extErrorStr+"</div>").appendTo(i.errorLog));if(m.push({name:f,size:"NA"}),0==r.onSelect(m))return}if(l(r,i),a.unbind("click"),p.hide(),u(i,n,r,a),p.addClass(n),t.fileapi&&t.formdata){p.removeClass(n);var g=this.files;o(r,i,g)}else{for(var v="",y=0;y<h.length;y++)v+=r.showFileCounter?i.fileCounter+r.fileCounterStyle+h[y]+"<br>":h[y]+"<br>",i.fileCounter++;if(-1!=r.maxFileCount&&i.selectedFiles+h.length>r.maxFileCount)return void(r.showError&&e("<div class='um-error-block'>"+r.maxFileCountErrorStr+"</div>").appendTo(i.errorLog));i.selectedFiles+=h.length;var b=new c(i,r);b.filename.html(v),d(p,r,b,h,i)}}),p.css({margin:0,padding:0});var g=e(a).width()+10;10==g&&(g=120);var v=a.height()+10;10==v&&(v=35),a.css({position:"relative",overflow:"hidden",cursor:"default"}),m.css({position:"absolute",cursor:"pointer",top:"0px",width:"100%",height:"34px",left:"0px","z-index":"100",opacity:"0.0",filter:"alpha(opacity=0)","-ms-filter":"alpha(opacity=0)","-khtml-opacity":"0.0","-moz-opacity":"0.0"}),p.appendTo(a)}function c(t,i){return this.statusbar=e("<div class='upload-statusbar'></div>"),this.filename=e("<div class='upload-filename'></div>").appendTo(this.statusbar),this.progressDiv=e("<div class='upload-progress'>").appendTo(this.statusbar).hide(),this.progressbar=e("<div class='upload-bar "+t.formGroup+"'></div>").appendTo(this.progressDiv),this.abort=e("<div class='upload-red "+t.formGroup+"'>"+i.abortStr+"</div>").appendTo(this.statusbar).hide(),this.cancel=e("<div class='upload-red'>"+i.cancelStr+"</div>").appendTo(this.statusbar).hide(),this.done=e("<div class='upload-green'>"+i.doneStr+"</div>").appendTo(this.statusbar).hide(),this.del=e("<div class='upload-red'>"+i.deletelStr+"</div>").appendTo(this.statusbar).hide(),t.errorLog.after(this.statusbar),this}function d(e,i,r,o,s){var u={cache:!1,contentType:!1,processData:!1,forceSync:!1,data:i.formData,formData:i.fileData,dataType:i.returnType,beforeSubmit:function(t,l,u){if(0!=i.onSubmit.call(this,o)){var c=i.dynamicFormData();if(c){var d=a(c);if(d)for(var h=0;h<d.length;h++)d[h]&&(void 0!=i.fileData?u.formData.append(d[h][0],d[h][1]):u.data[d[h][0]]=d[h][1])}return s.tCounter+=o.length,n(),!0}return r.statusbar.append("<div class='um-error-block'>"+i.uploadErrorStr+"</div>"),r.cancel.show(),e.remove(),r.cancel.click(function(){r.statusbar.remove()}),!1},beforeSend:function(e,n){r.progressDiv.show(),r.cancel.hide(),r.done.hide(),i.showAbort&&(r.abort.show(),r.abort.click(function(){e.abort(),s.selectedFiles-=o.length})),t.formdata?r.progressbar.width("1%"):r.progressbar.width("5%")},uploadProgress:function(e,t,n,a){a>98&&(a=98);var o=a+"%";a>1&&r.progressbar.width(o),i.showProgress&&(r.progressbar.html(o),r.progressbar.css("text-align","center"))},success:function(t,n,a){s.responses.push(t),r.progressbar.width("100%"),i.showProgress&&(r.progressbar.html("100%"),r.progressbar.css("text-align","center")),r.abort.hide(),i.onSuccess.call(this,o,t,a),i.showStatusAfterSuccess?(i.showDone?(r.done.show(),r.done.click(function(){r.statusbar.hide("slow"),r.statusbar.remove()})):r.done.hide(),i.showDelete?(r.del.show(),r.del.click(function(){r.statusbar.hide().remove(),i.deleteCallback&&i.deleteCallback.call(this,t,r),s.selectedFiles-=o.length,l(i,s)})):r.del.hide()):(r.statusbar.hide("slow"),r.statusbar.remove()),e.remove(),s.sCounter+=o.length},error:function(t,n,a){r.abort.hide(),"abort"==t.statusText?(r.statusbar.hide("slow").remove(),l(i,s)):(i.onError.call(this,o,n,a),i.showStatusAfterError?(r.progressDiv.hide(),r.statusbar.append("<span class='um-error-block'>ERROR: "+a+"</span>")):(r.statusbar.hide(),r.statusbar.remove()),s.selectedFiles-=o.length),e.remove(),s.fCounter+=o.length}};i.autoSubmit?e.ajaxSubmit(u):(i.showCancel&&(r.cancel.show(),r.cancel.click(function(){e.remove(),r.statusbar.remove(),s.selectedFiles-=o.length,l(i,s)})),e.ajaxForm(u))}var h=e.extend({url:"",method:"POST",enctype:"multipart/form-data",formData:null,returnType:null,allowedTypes:"*",fileName:"file",formData:{},dynamicFormData:function(){return{}},maxFileSize:-1,maxFileCount:-1,multiple:!0,dragDrop:!0,autoSubmit:!0,showCancel:!0,showAbort:!0,showDone:!0,showDelete:!1,showError:!0,showStatusAfterSuccess:!0,showStatusAfterError:!0,showFileCounter:!0,fileCounterStyle:"). ",showProgress:!1,onSelect:function(e){return!0},onSubmit:function(e,t){},onSuccess:function(e,t,i){},onError:function(e,t,i){},deleteCallback:!1,afterUploadAll:!1,uploadButtonClass:"upload",dragDropStr:"",abortStr:"Abort",cancelStr:"Cancel",deletelStr:"Delete",doneStr:"Done",multiDragErrorStr:"Multiple File Drag &amp; Drop is not allowed.",extErrorStr:"",sizeErrorStr:"",uploadErrorStr:"Upload is not allowed",maxFileCountErrorStr:""},i);this.fileCounter=1,this.selectedFiles=0,this.fCounter=0,this.sCounter=0,this.tCounter=0;var p="upload-"+(new Date).getTime();this.formGroup=p,this.hide(),this.errorLog=e("<div></div>"),this.after(this.errorLog),this.responses=[],t.formdata||(h.dragDrop=!1),t.formdata||(h.multiple=!1);var f=this,m=e("<div>"+e(this).html()+"</div>");e(m).addClass(h.uploadButtonClass),function v(){if(e.fn.ajaxForm){if(h.dragDrop){var t=e('<div class="ajax-upload-dragdrop" style="vertical-align:top;"></div>');e(f).before(t),e(t).append(m),e(t).prepend(e(h.dragDropStr)),r(f,h,t)}else e(f).before(m);u(f,p,h,m)}else window.setTimeout(v,10)}(),this.startUpload=function(){e("."+this.formGroup).each(function(t,i){e(this).is("form")&&e(this).submit()})},this.stopUpload=function(){e(".upload-red").each(function(t,i){e(this).hasClass(f.formGroup)&&e(this).click()})},this.getResponses=function(){return this.responses};var g=!1;return this}}(jQuery),function(e){"function"==typeof define&&define.amd?define("picker",["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):this.Picker=e(jQuery)}(function(e){function t(a,o,l,h){function p(){return t._.node("div",t._.node("div",t._.node("div",t._.node("div",Q.component.nodes(x.open),C.box),C.wrap),C.frame),C.holder,'tabindex="-1"')}function f(){S.data(o,Q).addClass(C.input).val(S.data("value")?Q.get("select",j.format):a.value),j.editable||S.on("focus."+x.id+" click."+x.id,function(e){e.preventDefault(),Q.open()}).on("keydown."+x.id,w),r(a,{haspopup:!0,expanded:!1,readonly:!1,owns:a.id+"_root"})}function m(){r(Q.$root[0],"hidden",!0)}function g(){Q.$holder.on({keydown:w,"focus.toOpen":b,blur:function(){S.removeClass(C.target)},focusin:function(e){Q.$root.removeClass(C.focused),e.stopPropagation()},"mousedown click":function(t){var i=t.target;i!=Q.$holder[0]&&(t.stopPropagation(),"mousedown"!=t.type||e(i).is("input, select, textarea, button, option")||(t.preventDefault(),Q.$holder[0].focus()))}}).on("click","[data-pick], [data-nav], [data-clear], [data-close]",function(){var t=e(this),i=t.data(),n=t.hasClass(C.navDisabled)||t.hasClass(C.disabled),r=s();r=r&&(r.type||r.href),(n||r&&!e.contains(Q.$root[0],r))&&Q.$holder[0].focus(),!n&&i.nav?Q.set("highlight",Q.component.item.highlight,{nav:i.nav}):!n&&"pick"in i?(Q.set("select",i.pick),j.closeOnSelect&&Q.close(!0)):i.clear?(Q.clear(),j.closeOnClear&&Q.close(!0)):i.close&&Q.close(!0)})}function v(){var t;j.hiddenName===!0?(t=a.name,a.name=""):(t=["string"==typeof j.hiddenPrefix?j.hiddenPrefix:"","string"==typeof j.hiddenSuffix?j.hiddenSuffix:"_submit"],t=t[0]+a.name+t[1]),Q._hidden=e('<input type=hidden name="'+t+'"'+(S.data("value")||a.value?' value="'+Q.get("select",j.formatSubmit)+'"':"")+">")[0],S.on("change."+x.id,function(){Q._hidden.value=a.value?Q.get("select",j.formatSubmit):""})}function y(){_&&d?Q.$holder.find("."+C.frame).one("transitionend",function(){Q.$holder[0].focus()}):Q.$holder[0].focus()}function b(e){e.stopPropagation(),S.addClass(C.target),Q.$root.addClass(C.focused),Q.open()}function w(e){var t=e.keyCode,i=/^(8|46)#x2F;.test(t);return 27==t?(Q.close(!0),!1):void((32==t||i||!x.open&&Q.component.key[t])&&(e.preventDefault(),e.stopPropagation(),i?Q.clear().close():Q.open()))}if(!a)return t;var _=!1,x={id:a.id||"P"+Math.abs(~~(Math.random()*new Date))},j=l?e.extend(!0,{},l.defaults,h):h||{},C=e.extend({},t.klasses(),j.klass),S=e(a),k=function(){return this.start()},Q=k.prototype={constructor:k,$node:S,start:function(){return x&&x.start?Q:(x.methods={},x.start=!0,x.open=!1,x.type=a.type,a.autofocus=a==s(),a.readOnly=!j.editable,a.id=a.id||x.id,"text"!=a.type&&(a.type="text"),Q.component=new l(Q,j),Q.$root=e('<div class="'+C.picker+'" id="'+a.id+'_root" />'),m(),Q.$holder=e(p()).appendTo(Q.$root),g(),j.formatSubmit&&v(),f(),j.containerHidden?e(j.containerHidden).append(Q._hidden):S.after(Q._hidden),j.container?e(j.container).append(Q.$root):S.after(Q.$root),Q.on({start:Q.component.onStart,render:Q.component.onRender,stop:Q.component.onStop,open:Q.component.onOpen,close:Q.component.onClose,set:Q.component.onSet}).on({start:j.onStart,render:j.onRender,stop:j.onStop,open:j.onOpen,close:j.onClose,set:j.onSet}),_=i(Q.$holder[0]),a.autofocus&&Q.open(),Q.trigger("start").trigger("render"))},render:function(t){return t?(Q.$holder=e(p()),g(),Q.$root.html(Q.$holder)):Q.$root.find("."+C.box).html(Q.component.nodes(x.open)),Q.trigger("render")},stop:function(){return x.start?(Q.close(),Q._hidden&&Q._hidden.parentNode.removeChild(Q._hidden),Q.$root.remove(),S.removeClass(C.input).removeData(o),setTimeout(function(){S.off("."+x.id)},0),a.type=x.type,a.readOnly=!1,Q.trigger("stop"),x.methods={},x.start=!1,Q):Q},open:function(i){return x.open?Q:(S.addClass(C.active),r(a,"expanded",!0),setTimeout(function(){Q.$root.addClass(C.opened),r(Q.$root[0],"hidden",!1)},0),i!==!1&&(x.open=!0,_&&c.css("overflow","hidden").css("padding-right","+="+n()),y(),u.on("click."+x.id+" focusin."+x.id,function(e){var t=e.target;t!=a&&t!=document&&3!=e.which&&Q.close(t===Q.$holder[0])}).on("keydown."+x.id,function(i){var n=i.keyCode,r=Q.component.key[n],a=i.target;27==n?Q.close(!0):a!=Q.$holder[0]||!r&&13!=n?e.contains(Q.$root[0],a)&&13==n&&(i.preventDefault(),a.click()):(i.preventDefault(),r?t._.trigger(Q.component.key.go,Q,[t._.trigger(r)]):Q.$root.find("."+C.highlighted).hasClass(C.disabled)||(Q.set("select",Q.component.item.highlight),j.closeOnSelect&&Q.close(!0)))})),Q.trigger("open"))},close:function(e){return e&&(j.editable?a.focus():(Q.$holder.off("focus.toOpen").focus(),setTimeout(function(){Q.$holder.on("focus.toOpen",b)},0))),S.removeClass(C.active),r(a,"expanded",!1),setTimeout(function(){Q.$root.removeClass(C.opened+" "+C.focused),r(Q.$root[0],"hidden",!0)},0),x.open?(x.open=!1,_&&c.css("overflow","").css("padding-right","-="+n()),u.off("."+x.id),Q.trigger("close")):Q},clear:function(e){return Q.set("clear",null,e)},set:function(t,i,n){var r,a,o=e.isPlainObject(t),s=o?t:{};if(n=o&&e.isPlainObject(i)?i:n||{},t){o||(s[t]=i);for(r in s)a=s[r],r in Q.component.item&&(void 0===a&&(a=null),Q.component.set(r,a,n)),("select"==r||"clear"==r)&&S.val("clear"==r?"":Q.get(r,j.format)).trigger("change");Q.render()}return n.muted?Q:Q.trigger("set",s)},get:function(e,i){if(e=e||"value",null!=x[e])return x[e];if("valueSubmit"==e){if(Q._hidden)return Q._hidden.value;e="value"}if("value"==e)return a.value;if(e in Q.component.item){if("string"==typeof i){var n=Q.component.get(e);return n?t._.trigger(Q.component.formats.toString,Q.component,[i,n]):""}return Q.component.get(e)}},on:function(t,i,n){var r,a,o=e.isPlainObject(t),s=o?t:{};if(t){o||(s[t]=i);for(r in s)a=s[r],n&&(r="_"+r),x.methods[r]=x.methods[r]||[],x.methods[r].push(a)}return Q},off:function(){var e,t,i=arguments;for(e=0,namesCount=i.length;e<namesCount;e+=1)t=i[e],t in x.methods&&delete x.methods[t];return Q},trigger:function(e,i){var n=function(e){var n=x.methods[e];n&&n.map(function(e){t._.trigger(e,Q,[i])})};return n("_"+e),n(e),Q}};return new k}function i(e){var t,i="position";return e.currentStyle?t=e.currentStyle[i]:window.getComputedStyle&&(t=getComputedStyle(e)[i]),"fixed"==t}function n(){if(c.height()<=l.height())return 0;var t=e('<div style="visibility:hidden;width:100px" />').appendTo("body"),i=t[0].offsetWidth;t.css("overflow","scroll");var n=e('<div style="width:100%" />').appendTo(t),r=n[0].offsetWidth;return t.remove(),i-r}function r(t,i,n){if(e.isPlainObject(i))for(var r in i)a(t,r,i[r]);else a(t,i,n)}function a(e,t,i){e.setAttribute(("role"==t?"":"aria-")+t,i)}function o(t,i){e.isPlainObject(t)||(t={attribute:i}),i="";for(var n in t){var r=("role"==n?"":"aria-")+n,a=t[n];i+=null==a?"":r+'="'+t[n]+'"'}return i}function s(){try{return document.activeElement}catch(e){}}var l=e(window),u=e(document),c=e(document.documentElement),d=null!=document.documentElement.style.transition;return t.klasses=function(e){return e=e||"picker",{picker:e,opened:e+"--opened",focused:e+"--focused",input:e+"__input",active:e+"__input--active",target:e+"__input--target",holder:e+"__holder",frame:e+"__frame",wrap:e+"__wrap",box:e+"__box"}},t._={group:function(e){for(var i,n="",r=t._.trigger(e.min,e);r<=t._.trigger(e.max,e,[r]);r+=e.i)i=t._.trigger(e.item,e,[r]),n+=t._.node(e.node,i[0],i[1],i[2]);return n},node:function(t,i,n,r){return i?(i=e.isArray(i)?i.join(""):i,n=n?' class="'+n+'"':"",r=r?" "+r:"","<"+t+n+r+">"+i+"</"+t+">"):""},lead:function(e){return(10>e?"0":"")+e},trigger:function(e,t,i){return"function"==typeof e?e.apply(t,i||[]):e},digits:function(e){return/\d/.test(e[1])?2:1},isDate:function(e){return{}.toString.call(e).indexOf("Date")>-1&&this.isInteger(e.getDate())},isInteger:function(e){return{}.toString.call(e).indexOf("Number")>-1&&e%1===0},ariaAttr:o},t.extend=function(i,n){e.fn[i]=function(r,a){var o=this.data(i);return"picker"==r?o:o&&"string"==typeof r?t._.trigger(o[r],o,[a]):this.each(function(){var a=e(this);a.data(i)||new t(this,i,n,r)})},e.fn[i].defaults=n.defaults},t}),function(e){"function"==typeof define&&define.amd?define(["picker","jquery"],e):"object"==typeof exports?module.exports=e(require("./picker.js"),require("jquery")):e(Picker,jQuery)}(function(e,t){function i(e,t){var i=this,n=e.$node[0],r=n.value,a=e.$node.data("value"),o=a||r,s=a?t.formatSubmit:t.format,l=function(){return n.currentStyle?"rtl"==n.currentStyle.direction:"rtl"==getComputedStyle(e.$root[0]).direction};i.settings=t,i.$node=e.$node,i.queue={min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse navigate create validate",view:"parse create validate viewset",disable:"deactivate",enable:"activate"},i.item={},i.item.clear=null,i.item.disable=(t.disable||[]).slice(0),i.item.enable=-function(e){return e[0]===!0?e.shift():-1}(i.item.disable),i.set("min",t.min).set("max",t.max).set("now"),o?i.set("select",o,{
5
format:s,defaultValue:!0}):i.set("select",null).set("highlight",i.item.now),i.key={40:7,38:-7,39:function(){return l()?-1:1},37:function(){return l()?1:-1},go:function(e){var t=i.item.highlight,n=new Date(t.year,t.month,t.date+e);i.set("highlight",n,{interval:e}),this.render()}},e.on("render",function(){e.$root.find("."+t.klass.selectMonth).on("change",function(){var i=this.value;i&&(e.set("highlight",[e.get("view").year,i,e.get("highlight").date]),e.$root.find("."+t.klass.selectMonth).trigger("focus"))}),e.$root.find("."+t.klass.selectYear).on("change",function(){var i=this.value;i&&(e.set("highlight",[i,e.get("view").month,e.get("highlight").date]),e.$root.find("."+t.klass.selectYear).trigger("focus"))})},1).on("open",function(){var n="";i.disabled(i.get("now"))&&(n=":not(."+t.klass.buttonToday+")"),e.$root.find("button"+n+", select").attr("disabled",!1)},1).on("close",function(){e.$root.find("button, select").attr("disabled",!0)},1)}var n=7,r=6,a=e._;i.prototype.set=function(e,t,i){var n=this,r=n.item;return null===t?("clear"==e&&(e="select"),r[e]=t,n):(r["enable"==e?"disable":"flip"==e?"enable":e]=n.queue[e].split(" ").map(function(r){return t=n[r](e,t,i)}).pop(),"select"==e?n.set("highlight",r.select,i):"highlight"==e?n.set("view",r.highlight,i):e.match(/^(flip|min|max|disable|enable)#x2F;)&&(r.select&&n.disabled(r.select)&&n.set("select",r.select,i),r.highlight&&n.disabled(r.highlight)&&n.set("highlight",r.highlight,i)),n)},i.prototype.get=function(e){return this.item[e]},i.prototype.create=function(e,i,n){var r,o=this;return i=void 0===i?e:i,i==-(1/0)||i==1/0?r=i:t.isPlainObject(i)&&a.isInteger(i.pick)?i=i.obj:t.isArray(i)?(i=new Date(i[0],i[1],i[2]),i=a.isDate(i)?i:o.create().obj):i=a.isInteger(i)||a.isDate(i)?o.normalize(new Date(i),n):o.now(e,i,n),{year:r||i.getFullYear(),month:r||i.getMonth(),date:r||i.getDate(),day:r||i.getDay(),obj:r||i,pick:r||i.getTime()}},i.prototype.createRange=function(e,i){var n=this,r=function(e){return e===!0||t.isArray(e)||a.isDate(e)?n.create(e):e};return a.isInteger(e)||(e=r(e)),a.isInteger(i)||(i=r(i)),a.isInteger(e)&&t.isPlainObject(i)?e=[i.year,i.month,i.date+e]:a.isInteger(i)&&t.isPlainObject(e)&&(i=[e.year,e.month,e.date+i]),{from:r(e),to:r(i)}},i.prototype.withinRange=function(e,t){return e=this.createRange(e.from,e.to),t.pick>=e.from.pick&&t.pick<=e.to.pick},i.prototype.overlapRanges=function(e,t){var i=this;return e=i.createRange(e.from,e.to),t=i.createRange(t.from,t.to),i.withinRange(e,t.from)||i.withinRange(e,t.to)||i.withinRange(t,e.from)||i.withinRange(t,e.to)},i.prototype.now=function(e,t,i){return t=new Date,i&&i.rel&&t.setDate(t.getDate()+i.rel),this.normalize(t,i)},i.prototype.navigate=function(e,i,n){var r,a,o,s,l=t.isArray(i),u=t.isPlainObject(i),c=this.item.view;if(l||u){for(u?(a=i.year,o=i.month,s=i.date):(a=+i[0],o=+i[1],s=+i[2]),n&&n.nav&&c&&c.month!==o&&(a=c.year,o=c.month),r=new Date(a,o+(n&&n.nav?n.nav:0),1),a=r.getFullYear(),o=r.getMonth();new Date(a,o,s).getMonth()!==o;)s-=1;i=[a,o,s]}return i},i.prototype.normalize=function(e){return e.setHours(0,0,0,0),e},i.prototype.measure=function(e,t){var i=this;return t?"string"==typeof t?t=i.parse(e,t):a.isInteger(t)&&(t=i.now(e,t,{rel:t})):t="min"==e?-(1/0):1/0,t},i.prototype.viewset=function(e,t){return this.create([t.year,t.month,1])},i.prototype.validate=function(e,i,n){var r,o,s,l,u=this,c=i,d=n&&n.interval?n.interval:1,h=-1===u.item.enable,p=u.item.min,f=u.item.max,m=h&&u.item.disable.filter(function(e){if(t.isArray(e)){var n=u.create(e).pick;n<i.pick?r=!0:n>i.pick&&(o=!0)}return a.isInteger(e)}).length;if((!n||!n.nav&&!n.defaultValue)&&(!h&&u.disabled(i)||h&&u.disabled(i)&&(m||r||o)||!h&&(i.pick<=p.pick||i.pick>=f.pick)))for(h&&!m&&(!o&&d>0||!r&&0>d)&&(d*=-1);u.disabled(i)&&(Math.abs(d)>1&&(i.month<c.month||i.month>c.month)&&(i=c,d=d>0?1:-1),i.pick<=p.pick?(s=!0,d=1,i=u.create([p.year,p.month,p.date+(i.pick===p.pick?0:-1)])):i.pick>=f.pick&&(l=!0,d=-1,i=u.create([f.year,f.month,f.date+(i.pick===f.pick?0:1)])),!s||!l);)i=u.create([i.year,i.month,i.date+d]);return i},i.prototype.disabled=function(e){var i=this,n=i.item.disable.filter(function(n){return a.isInteger(n)?e.day===(i.settings.firstDay?n:n-1)%7:t.isArray(n)||a.isDate(n)?e.pick===i.create(n).pick:t.isPlainObject(n)?i.withinRange(n,e):void 0});return n=n.length&&!n.filter(function(e){return t.isArray(e)&&"inverted"==e[3]||t.isPlainObject(e)&&e.inverted}).length,-1===i.item.enable?!n:n||e.pick<i.item.min.pick||e.pick>i.item.max.pick},i.prototype.parse=function(e,t,i){var n=this,r={};return t&&"string"==typeof t?(i&&i.format||(i=i||{},i.format=n.settings.format),n.formats.toArray(i.format).map(function(e){var i=n.formats[e],o=i?a.trigger(i,n,[t,r]):e.replace(/^!/,"").length;i&&(r[e]=t.substr(0,o)),t=t.substr(o)}),[r.yyyy||r.yy,+(r.mm||r.m)-1,r.dd||r.d]):t},i.prototype.formats=function(){function e(e,t,i){var n=e.match(/[^\x00-\x7F]+|\w+/)[0];return i.mm||i.m||(i.m=t.indexOf(n)+1),n.length}function t(e){return e.match(/\w+/)[0].length}return{d:function(e,t){return e?a.digits(e):t.date},dd:function(e,t){return e?2:a.lead(t.date)},ddd:function(e,i){return e?t(e):this.settings.weekdaysShort[i.day]},dddd:function(e,i){return e?t(e):this.settings.weekdaysFull[i.day]},m:function(e,t){return e?a.digits(e):t.month+1},mm:function(e,t){return e?2:a.lead(t.month+1)},mmm:function(t,i){var n=this.settings.monthsShort;return t?e(t,n,i):n[i.month]},mmmm:function(t,i){var n=this.settings.monthsFull;return t?e(t,n,i):n[i.month]},yy:function(e,t){return e?2:(""+t.year).slice(2)},yyyy:function(e,t){return e?4:t.year},toArray:function(e){return e.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(e,t){var i=this;return i.formats.toArray(e).map(function(e){return a.trigger(i.formats[e],i,[0,t])||e.replace(/^!/,"")}).join("")}}}(),i.prototype.isDateExact=function(e,i){var n=this;return a.isInteger(e)&&a.isInteger(i)||"boolean"==typeof e&&"boolean"==typeof i?e===i:(a.isDate(e)||t.isArray(e))&&(a.isDate(i)||t.isArray(i))?n.create(e).pick===n.create(i).pick:t.isPlainObject(e)&&t.isPlainObject(i)?n.isDateExact(e.from,i.from)&&n.isDateExact(e.to,i.to):!1},i.prototype.isDateOverlap=function(e,i){var n=this,r=n.settings.firstDay?1:0;return a.isInteger(e)&&(a.isDate(i)||t.isArray(i))?(e=e%7+r,e===n.create(i).day+1):a.isInteger(i)&&(a.isDate(e)||t.isArray(e))?(i=i%7+r,i===n.create(e).day+1):t.isPlainObject(e)&&t.isPlainObject(i)?n.overlapRanges(e,i):!1},i.prototype.flipEnable=function(e){var t=this.item;t.enable=e||(-1==t.enable?1:-1)},i.prototype.deactivate=function(e,i){var n=this,r=n.item.disable.slice(0);return"flip"==i?n.flipEnable():i===!1?(n.flipEnable(1),r=[]):i===!0?(n.flipEnable(-1),r=[]):i.map(function(e){for(var i,o=0;o<r.length;o+=1)if(n.isDateExact(e,r[o])){i=!0;break}i||(a.isInteger(e)||a.isDate(e)||t.isArray(e)||t.isPlainObject(e)&&e.from&&e.to)&&r.push(e)}),r},i.prototype.activate=function(e,i){var n=this,r=n.item.disable,o=r.length;return"flip"==i?n.flipEnable():i===!0?(n.flipEnable(1),r=[]):i===!1?(n.flipEnable(-1),r=[]):i.map(function(e){var i,s,l,u;for(l=0;o>l;l+=1){if(s=r[l],n.isDateExact(s,e)){i=r[l]=null,u=!0;break}if(n.isDateOverlap(s,e)){t.isPlainObject(e)?(e.inverted=!0,i=e):t.isArray(e)?(i=e,i[3]||i.push("inverted")):a.isDate(e)&&(i=[e.getFullYear(),e.getMonth(),e.getDate(),"inverted"]);break}}if(i)for(l=0;o>l;l+=1)if(n.isDateExact(r[l],e)){r[l]=null;break}if(u)for(l=0;o>l;l+=1)if(n.isDateOverlap(r[l],e)){r[l]=null;break}i&&r.push(i)}),r.filter(function(e){return null!=e})},i.prototype.nodes=function(e){var t=this,i=t.settings,o=t.item,s=o.now,l=o.select,u=o.highlight,c=o.view,d=o.disable,h=o.min,p=o.max,f=function(e,t){return i.firstDay&&(e.push(e.shift()),t.push(t.shift())),a.node("thead",a.node("tr",a.group({min:0,max:n-1,i:1,node:"th",item:function(n){return[e[n],i.klass.weekdays,'scope=col title="'+t[n]+'"']}})))}((i.showWeekdaysFull?i.weekdaysFull:i.weekdaysShort).slice(0),i.weekdaysFull.slice(0)),m=function(e){return a.node("div"," ",i.klass["nav"+(e?"Next":"Prev")]+(e&&c.year>=p.year&&c.month>=p.month||!e&&c.year<=h.year&&c.month<=h.month?" "+i.klass.navDisabled:""),"data-nav="+(e||-1)+" "+a.ariaAttr({role:"button",controls:t.$node[0].id+"_table"})+' title="'+(e?i.labelMonthNext:i.labelMonthPrev)+'"')},g=function(){var n=i.showMonthsShort?i.monthsShort:i.monthsFull;return i.selectMonths?a.node("select",a.group({min:0,max:11,i:1,node:"option",item:function(e){return[n[e],0,"value="+e+(c.month==e?" selected":"")+(c.year==h.year&&e<h.month||c.year==p.year&&e>p.month?" disabled":"")]}}),i.klass.selectMonth,(e?"":"disabled")+" "+a.ariaAttr({controls:t.$node[0].id+"_table"})+' title="'+i.labelMonthSelect+'"'):a.node("div",n[c.month],i.klass.month)},v=function(){var n=c.year,r=i.selectYears===!0?5:~~(i.selectYears/2);if(r){var o=h.year,s=p.year,l=n-r,u=n+r;if(o>l&&(u+=o-l,l=o),u>s){var d=l-o,f=u-s;l-=d>f?f:d,u=s}return a.node("select",a.group({min:l,max:u,i:1,node:"option",item:function(e){return[e,0,"value="+e+(n==e?" selected":"")]}}),i.klass.selectYear,(e?"":"disabled")+" "+a.ariaAttr({controls:t.$node[0].id+"_table"})+' title="'+i.labelYearSelect+'"')}return a.node("div",n,i.klass.year)};return a.node("div",(i.selectYears?v()+g():g()+v())+m()+m(1),i.klass.header)+a.node("table",f+a.node("tbody",a.group({min:0,max:r-1,i:1,node:"tr",item:function(e){var r=i.firstDay&&0===t.create([c.year,c.month,1]).day?-7:0;return[a.group({min:n*e-c.day+r+1,max:function(){return this.min+n-1},i:1,node:"td",item:function(e){e=t.create([c.year,c.month,e+(i.firstDay?1:0)]);var n=l&&l.pick==e.pick,r=u&&u.pick==e.pick,o=d&&t.disabled(e)||e.pick<h.pick||e.pick>p.pick,f=a.trigger(t.formats.toString,t,[i.format,e]);return[a.node("div",e.date,function(t){return t.push(c.month==e.month?i.klass.infocus:i.klass.outfocus),s.pick==e.pick&&t.push(i.klass.now),n&&t.push(i.klass.selected),r&&t.push(i.klass.highlighted),o&&t.push(i.klass.disabled),t.join(" ")}([i.klass.day]),"data-pick="+e.pick+" "+a.ariaAttr({role:"gridcell",label:f,selected:n&&t.$node.val()===f?!0:null,activedescendant:r?!0:null,disabled:o?!0:null})),"",a.ariaAttr({role:"presentation"})]}})]}})),i.klass.table,'id="'+t.$node[0].id+'_table" '+a.ariaAttr({role:"grid",controls:t.$node[0].id,readonly:!0}))+a.node("div",a.node("button",i.today,i.klass.buttonToday,"type=button data-pick="+s.pick+(e&&!t.disabled(s)?"":" disabled")+" "+a.ariaAttr({controls:t.$node[0].id}))+a.node("button",i.clear,i.klass.buttonClear,"type=button data-clear=1"+(e?"":" disabled")+" "+a.ariaAttr({controls:t.$node[0].id}))+a.node("button",i.close,i.klass.buttonClose,"type=button data-close=true "+(e?"":" disabled")+" "+a.ariaAttr({controls:t.$node[0].id})),i.klass.footer)},i.defaults=function(e){return{labelMonthNext:"Next month",labelMonthPrev:"Previous month",labelMonthSelect:"Select a month",labelYearSelect:"Select a year",monthsFull:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],weekdaysFull:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekdaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],today:"Today",clear:"Clear",close:"Close",closeOnSelect:!0,closeOnClear:!0,format:"d mmmm, yyyy",klass:{table:e+"table",header:e+"header",navPrev:e+"nav--prev",navNext:e+"nav--next",navDisabled:e+"nav--disabled",month:e+"month",year:e+"year",selectMonth:e+"select--month",selectYear:e+"select--year",weekdays:e+"weekday",day:e+"day",disabled:e+"day--disabled",selected:e+"day--selected",highlighted:e+"day--highlighted",now:e+"day--today",infocus:e+"day--infocus",outfocus:e+"day--outfocus",footer:e+"footer",buttonClear:e+"button--clear",buttonToday:e+"button--today",buttonClose:e+"button--close"}}}(e.klasses().picker+"__"),e.extend("pickadate",i)}),function(e){"function"==typeof define&&define.amd?define(["picker","jquery"],e):"object"==typeof exports?module.exports=e(require("./picker.js"),require("jquery")):e(Picker,jQuery)}(function(e,t){function i(e,t){var i=this,n=e.$node[0].value,r=e.$node.data("value"),a=r||n,o=r?t.formatSubmit:t.format;i.settings=t,i.$node=e.$node,i.queue={interval:"i",min:"measure create",max:"measure create",now:"now create",select:"parse create validate",highlight:"parse create validate",view:"parse create validate",disable:"deactivate",enable:"activate"},i.item={},i.item.clear=null,i.item.interval=t.interval||30,i.item.disable=(t.disable||[]).slice(0),i.item.enable=-function(e){return e[0]===!0?e.shift():-1}(i.item.disable),i.set("min",t.min).set("max",t.max).set("now"),a?i.set("select",a,{format:o}):i.set("select",null).set("highlight",i.item.now),i.key={40:1,38:-1,39:1,37:-1,go:function(e){i.set("highlight",i.item.highlight.pick+e*i.item.interval,{interval:e*i.item.interval}),this.render()}},e.on("render",function(){var i=e.$root.children(),n=i.find("."+t.klass.viewset),r=function(e){return["webkit","moz","ms","o",""].map(function(t){return(t?"-"+t+"-":"")+e})},a=function(e,t){r("transform").map(function(i){e.css(i,t)}),r("transition").map(function(i){e.css(i,t)})};n.length&&(a(i,"none"),i[0].scrollTop=~~n.position().top-2*n[0].clientHeight,a(i,""))},1).on("open",function(){e.$root.find("button").attr("disabled",!1)},1).on("close",function(){e.$root.find("button").attr("disabled",!0)},1)}var n=24,r=60,a=12,o=n*r,s=e._;i.prototype.set=function(e,t,i){var n=this,r=n.item;return null===t?("clear"==e&&(e="select"),r[e]=t,n):(r["enable"==e?"disable":"flip"==e?"enable":e]=n.queue[e].split(" ").map(function(r){return t=n[r](e,t,i)}).pop(),"select"==e?n.set("highlight",r.select,i):"highlight"==e?n.set("view",r.highlight,i):"interval"==e?n.set("min",r.min,i).set("max",r.max,i):e.match(/^(flip|min|max|disable|enable)#x2F;)&&(r.select&&n.disabled(r.select)&&n.set("select",t,i),r.highlight&&n.disabled(r.highlight)&&n.set("highlight",t,i),"min"==e&&n.set("max",r.max,i)),n)},i.prototype.get=function(e){return this.item[e]},i.prototype.create=function(e,i,a){var l=this;return i=void 0===i?e:i,s.isDate(i)&&(i=[i.getHours(),i.getMinutes()]),t.isPlainObject(i)&&s.isInteger(i.pick)?i=i.pick:t.isArray(i)?i=+i[0]*r+ +i[1]:s.isInteger(i)||(i=l.now(e,i,a)),"max"==e&&i<l.item.min.pick&&(i+=o),"min"!=e&&"max"!=e&&(i-l.item.min.pick)%l.item.interval!==0&&(i+=l.item.interval),i=l.normalize(e,i,a),{hour:~~(n+i/r)%n,mins:(r+i%r)%r,time:(o+i)%o,pick:i%o}},i.prototype.createRange=function(e,i){var n=this,r=function(e){return e===!0||t.isArray(e)||s.isDate(e)?n.create(e):e};return s.isInteger(e)||(e=r(e)),s.isInteger(i)||(i=r(i)),s.isInteger(e)&&t.isPlainObject(i)?e=[i.hour,i.mins+e*n.settings.interval]:s.isInteger(i)&&t.isPlainObject(e)&&(i=[e.hour,e.mins+i*n.settings.interval]),{from:r(e),to:r(i)}},i.prototype.withinRange=function(e,t){return e=this.createRange(e.from,e.to),t.pick>=e.from.pick&&t.pick<=e.to.pick},i.prototype.overlapRanges=function(e,t){var i=this;return e=i.createRange(e.from,e.to),t=i.createRange(t.from,t.to),i.withinRange(e,t.from)||i.withinRange(e,t.to)||i.withinRange(t,e.from)||i.withinRange(t,e.to)},i.prototype.now=function(e,t){var i,n=this.item.interval,a=new Date,o=a.getHours()*r+a.getMinutes(),l=s.isInteger(t);return o-=o%n,i=0>t&&-n>=n*t+o,o+="min"==e&&i?0:n,l&&(o+=n*(i&&"max"!=e?t+1:t)),o},i.prototype.normalize=function(e,t){var i=this.item.interval,n=this.item.min&&this.item.min.pick||0;return t-="min"==e?0:(t-n)%i},i.prototype.measure=function(e,i,a){var o=this;return i||(i="min"==e?[0,0]:[n-1,r-1]),"string"==typeof i?i=o.parse(e,i):i===!0||s.isInteger(i)?i=o.now(e,i,a):t.isPlainObject(i)&&s.isInteger(i.pick)&&(i=o.normalize(e,i.pick,a)),i},i.prototype.validate=function(e,t,i){var n=this,r=i&&i.interval?i.interval:n.item.interval;return n.disabled(t)&&(t=n.shift(t,r)),t=n.scope(t),n.disabled(t)&&(t=n.shift(t,-1*r)),t},i.prototype.disabled=function(e){var i=this,n=i.item.disable.filter(function(n){return s.isInteger(n)?e.hour==n:t.isArray(n)||s.isDate(n)?e.pick==i.create(n).pick:t.isPlainObject(n)?i.withinRange(n,e):void 0});return n=n.length&&!n.filter(function(e){return t.isArray(e)&&"inverted"==e[2]||t.isPlainObject(e)&&e.inverted}).length,-1===i.item.enable?!n:n||e.pick<i.item.min.pick||e.pick>i.item.max.pick},i.prototype.shift=function(e,t){var i=this,n=i.item.min.pick,r=i.item.max.pick;for(t=t||i.item.interval;i.disabled(e)&&(e=i.create(e.pick+=t),!(e.pick<=n||e.pick>=r)););return e},i.prototype.scope=function(e){var t=this.item.min.pick,i=this.item.max.pick;return this.create(e.pick>i?i:e.pick<t?t:e)},i.prototype.parse=function(e,t,i){var n,a,o,l,u,c=this,d={};if(!t||"string"!=typeof t)return t;i&&i.format||(i=i||{},i.format=c.settings.format),c.formats.toArray(i.format).map(function(e){var i,n=c.formats[e],r=n?s.trigger(n,c,[t,d]):e.replace(/^!/,"").length;n&&(i=t.substr(0,r),d[e]=i.match(/^\d+#x2F;)?+i:i),t=t.substr(r)});for(l in d)u=d[l],s.isInteger(u)?l.match(/^(h|hh)#x2F;i)?(n=u,("h"==l||"hh"==l)&&(n%=12)):"i"==l&&(a=u):l.match(/^a#x2F;i)&&u.match(/^p/i)&&("h"in d||"hh"in d)&&(o=!0);return(o?n+12:n)*r+a},i.prototype.formats={h:function(e,t){return e?s.digits(e):t.hour%a||a},hh:function(e,t){return e?2:s.lead(t.hour%a||a)},H:function(e,t){return e?s.digits(e):""+t.hour%24},HH:function(e,t){return e?s.digits(e):s.lead(t.hour%24)},i:function(e,t){return e?2:s.lead(t.mins)},a:function(e,t){return e?4:o/2>t.time%o?"a.m.":"p.m."},A:function(e,t){return e?2:o/2>t.time%o?"AM":"PM"},toArray:function(e){return e.split(/(h{1,2}|H{1,2}|i|a|A|!.)/g)},toString:function(e,t){var i=this;return i.formats.toArray(e).map(function(e){return s.trigger(i.formats[e],i,[0,t])||e.replace(/^!/,"")}).join("")}},i.prototype.isTimeExact=function(e,i){var n=this;return s.isInteger(e)&&s.isInteger(i)||"boolean"==typeof e&&"boolean"==typeof i?e===i:(s.isDate(e)||t.isArray(e))&&(s.isDate(i)||t.isArray(i))?n.create(e).pick===n.create(i).pick:t.isPlainObject(e)&&t.isPlainObject(i)?n.isTimeExact(e.from,i.from)&&n.isTimeExact(e.to,i.to):!1},i.prototype.isTimeOverlap=function(e,i){var n=this;return s.isInteger(e)&&(s.isDate(i)||t.isArray(i))?e===n.create(i).hour:s.isInteger(i)&&(s.isDate(e)||t.isArray(e))?i===n.create(e).hour:t.isPlainObject(e)&&t.isPlainObject(i)?n.overlapRanges(e,i):!1},i.prototype.flipEnable=function(e){var t=this.item;t.enable=e||(-1==t.enable?1:-1)},i.prototype.deactivate=function(e,i){var n=this,r=n.item.disable.slice(0);return"flip"==i?n.flipEnable():i===!1?(n.flipEnable(1),r=[]):i===!0?(n.flipEnable(-1),r=[]):i.map(function(e){for(var i,a=0;a<r.length;a+=1)if(n.isTimeExact(e,r[a])){i=!0;break}i||(s.isInteger(e)||s.isDate(e)||t.isArray(e)||t.isPlainObject(e)&&e.from&&e.to)&&r.push(e)}),r},i.prototype.activate=function(e,i){var n=this,r=n.item.disable,a=r.length;return"flip"==i?n.flipEnable():i===!0?(n.flipEnable(1),r=[]):i===!1?(n.flipEnable(-1),r=[]):i.map(function(e){var i,o,l,u;for(l=0;a>l;l+=1){if(o=r[l],n.isTimeExact(o,e)){i=r[l]=null,u=!0;break}if(n.isTimeOverlap(o,e)){t.isPlainObject(e)?(e.inverted=!0,i=e):t.isArray(e)?(i=e,i[2]||i.push("inverted")):s.isDate(e)&&(i=[e.getFullYear(),e.getMonth(),e.getDate(),"inverted"]);break}}if(i)for(l=0;a>l;l+=1)if(n.isTimeExact(r[l],e)){r[l]=null;break}if(u)for(l=0;a>l;l+=1)if(n.isTimeOverlap(r[l],e)){r[l]=null;break}i&&r.push(i)}),r.filter(function(e){return null!=e})},i.prototype.i=function(e,t){return s.isInteger(t)&&t>0?t:this.item.interval},i.prototype.nodes=function(e){var t=this,i=t.settings,n=t.item.select,r=t.item.highlight,a=t.item.view,o=t.item.disable;return s.node("ul",s.group({min:t.item.min.pick,max:t.item.max.pick,i:t.item.interval,node:"li",item:function(e){e=t.create(e);var l=e.pick,u=n&&n.pick==l,c=r&&r.pick==l,d=o&&t.disabled(e),h=s.trigger(t.formats.toString,t,[i.format,e]);return[s.trigger(t.formats.toString,t,[s.trigger(i.formatLabel,t,[e])||i.format,e]),function(e){return u&&e.push(i.klass.selected),c&&e.push(i.klass.highlighted),a&&a.pick==l&&e.push(i.klass.viewset),d&&e.push(i.klass.disabled),e.join(" ")}([i.klass.listItem]),"data-pick="+e.pick+" "+s.ariaAttr({role:"option",label:h,selected:u&&t.$node.val()===h?!0:null,activedescendant:c?!0:null,disabled:d?!0:null})]}})+s.node("li",s.node("button",i.clear,i.klass.buttonClear,"type=button data-clear=1"+(e?"":" disabled")+" "+s.ariaAttr({controls:t.$node[0].id})),"",s.ariaAttr({role:"presentation"})),i.klass.list,s.ariaAttr({role:"listbox",controls:t.$node[0].id}))},i.defaults=function(e){return{clear:"Clear",format:"h:i A",interval:30,closeOnSelect:!0,closeOnClear:!0,klass:{picker:e+" "+e+"--time",holder:e+"__holder",list:e+"__list",listItem:e+"__list-item",disabled:e+"__list-item--disabled",selected:e+"__list-item--selected",highlighted:e+"__list-item--highlighted",viewset:e+"__list-item--viewset",now:e+"__list-item--now",buttonClear:e+"__button--clear"}}}(e.klasses().picker),e.extend("pickatime",i)}),[].map||(Array.prototype.map=function(e,t){for(var i=this,n=i.length,r=new Array(n),a=0;n>a;a++)a in i&&(r[a]=e.call(t,i[a],a,i));return r}),[].filter||(Array.prototype.filter=function(e){if(null==this)throw new TypeError;var t=Object(this),i=t.length>>>0;if("function"!=typeof e)throw new TypeError;for(var n=[],r=arguments[1],a=0;i>a;a++)if(a in t){var o=t[a];e.call(r,o,a,t)&&n.push(o)}return n}),[].indexOf||(Array.prototype.indexOf=function(e){if(null==this)throw new TypeError;var t=Object(this),i=t.length>>>0;if(0===i)return-1;var n=0;if(arguments.length>1&&(n=Number(arguments[1]),n!=n?n=0:0!==n&&n!=1/0&&n!=-(1/0)&&(n=(n>0||-1)*Math.floor(Math.abs(n)))),n>=i)return-1;for(var r=n>=0?n:Math.max(i-Math.abs(n),0);i>r;r++)if(r in t&&t[r]===e)return r;return-1});var nativeSplit=String.prototype.split,compliantExecNpcg=void 0===/()??/.exec("")[1];String.prototype.split=function(e,t){var i=this;if("[object RegExp]"!==Object.prototype.toString.call(e))return nativeSplit.call(i,e,t);var n,r,a,o,s=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),u=0;for(e=new RegExp(e.source,l+"g"),i+="",compliantExecNpcg||(n=new RegExp("^"+e.source+"$(?!\\s)",l)),t=void 0===t?-1>>>0:t>>>0;(r=e.exec(i))&&(a=r.index+r[0].length,!(a>u&&(s.push(i.slice(u,r.index)),!compliantExecNpcg&&r.length>1&&r[0].replace(n,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(r[e]=void 0)}),r.length>1&&r.index<i.length&&Array.prototype.push.apply(s,r.slice(1)),o=r[0].length,u=a,s.length>=t)));)e.lastIndex===r.index&&e.lastIndex++;return u===i.length?(o||!e.test(""))&&s.push(""):s.push(i.slice(u)),s.length>t?s.slice(0,t):s},function(e){"use strict";var t={init:function(i){return this.each(function(){this.self=e(this),t.destroy.call(this.self),this.opt=e.extend(!0,{},e.fn.raty.defaults,i),t._adjustCallback.call(this),t._adjustNumber.call(this),"img"!==this.opt.starType&&t._adjustStarType.call(this),t._adjustPath.call(this),t._createStars.call(this),this.opt.cancel&&t._createCancel.call(this),this.opt.precision&&t._adjustPrecision.call(this),t._createScore.call(this),t._apply.call(this,this.opt.score),t._target.call(this,this.opt.score),this.opt.readOnly?t._lock.call(this):(this.style.cursor="pointer",t._binds.call(this)),this.self.data("options",this.opt)})},_adjustCallback:function(){for(var e=["number","readOnly","score","scoreName","target"],t=0;t<e.length;t++)"function"==typeof this.opt[e[t]]&&(this.opt[e[t]]=this.opt[e[t]].call(this))},_adjustNumber:function(){this.opt.number=t._between(this.opt.number,1,this.opt.numberMax)},_adjustPath:function(){this.opt.path=this.opt.path||"",this.opt.path&&"/"!==this.opt.path.charAt(this.opt.path.length-1)&&(this.opt.path+="/")},_adjustPrecision:function(){this.opt.half=!0,this.opt.targetType="score"},_adjustStarType:function(){this.opt.path="";for(var e=["cancelOff","cancelOn","starHalf","starOff","starOn"],t=0;t<e.length;t++)this.opt[e[t]]=this.opt[e[t]].replace(".","-")},_apply:function(e){t._fill.call(this,e),e&&(e>0&&this.score.val(t._between(e,0,this.opt.number)),t._roundStars.call(this,e))},_between:function(e,t,i){return Math.min(Math.max(parseFloat(e),t),i)},_binds:function(){this.cancel&&(t._bindOverCancel.call(this),t._bindClickCancel.call(this),t._bindOutCancel.call(this)),t._bindOver.call(this),t._bindClick.call(this),t._bindOut.call(this)},_bindClick:function(){var t=this;t.stars.on("click.raty",function(i){var n=e(this);t.score.val(t.opt.half||t.opt.precision?t.self.data("score"):this.alt||n.data("alt")),t.opt.click&&t.opt.click.call(t,+t.score.val(),i)})},_bindClickCancel:function(){var e=this;e.cancel.on("click.raty",function(t){e.score.removeAttr("value"),e.opt.click&&e.opt.click.call(e,null,t)})},_bindOut:function(){var e=this;e.self.on("mouseleave.raty",function(i){var n=+e.score.val()||void 0;t._apply.call(e,n),t._target.call(e,n,i),e.opt.mouseout&&e.opt.mouseout.call(e,n,i)})},_bindOutCancel:function(){var e=this;e.cancel.on("mouseleave.raty",function(i){var n=e.opt.cancelOff;if("img"!==e.opt.starType&&(n=e.opt.cancelClass+" "+n),t._setIcon.call(e,this,n),e.opt.mouseout){var r=+e.score.val()||void 0;e.opt.mouseout.call(e,r,i)}})},_bindOver:function(){var e=this,i=e.opt.half?"mousemove.raty":"mouseover.raty";e.stars.on(i,function(i){var n=t._getScoreByPosition.call(e,i,this);t._fill.call(e,n),e.opt.half&&(t._roundStars.call(e,n),e.self.data("score",n)),t._target.call(e,n,i),e.opt.mouseover&&e.opt.mouseover.call(e,n,i)})},_bindOverCancel:function(){var e=this;e.cancel.on("mouseover.raty",function(i){var n=e.opt.path+e.opt.starOff,r=e.opt.cancelOn;"img"===e.opt.starType?e.stars.attr("src",n):(r=e.opt.cancelClass+" "+r,e.stars.attr("class",n)),t._setIcon.call(e,this,r),t._target.call(e,null,i),e.opt.mouseover&&e.opt.mouseover.call(e,null)})},_buildScoreField:function(){return e("<input />",{name:this.opt.scoreName,type:"hidden"}).appendTo(this)},_createCancel:function(){var t=this.opt.path+this.opt.cancelOff,i=e("<"+this.opt.starType+" />",{title:this.opt.cancelHint,"class":this.opt.cancelClass});"img"===this.opt.starType?i.attr({src:t,alt:"x"}):i.attr("data-alt","x").addClass(t),"left"===this.opt.cancelPlace?this.self.prepend("&#160;").prepend(i):this.self.append("&#160;").append(i),this.cancel=i},_createScore:function(){var i=e(this.opt.targetScore);this.score=i.length?i:t._buildScoreField.call(this)},_createStars:function(){for(var i=1;i<=this.opt.number;i++){var n=t._nameForIndex.call(this,i),r={alt:i,src:this.opt.path+this.opt[n]};"img"!==this.opt.starType&&(r={"data-alt":i,"class":r.src}),r.title=t._getHint.call(this,i),e("<"+this.opt.starType+" />",r).appendTo(this),this.opt.space&&this.self.append(i<this.opt.number?"&#160;":"")}this.stars=this.self.children(this.opt.starType)},_error:function(t){e(this).text(t),e.error(t)},_fill:function(e){for(var i=0,n=1;n<=this.stars.length;n++){var r,a=this.stars[n-1],o=t._turnOn.call(this,n,e);if(this.opt.iconRange&&this.opt.iconRange.length>i){var s=this.opt.iconRange[i];r=t._getRangeIcon.call(this,s,o),n<=s.range&&t._setIcon.call(this,a,r),n===s.range&&i++}else r=this.opt[o?"starOn":"starOff"],t._setIcon.call(this,a,r)}},_getRangeIcon:function(e,t){return t?e.on||this.opt.starOn:e.off||this.opt.starOff},_getScoreByPosition:function(i,n){var r=parseInt(n.alt||n.getAttribute("data-alt"),10);if(this.opt.half){var a=t._getSize.call(this),o=parseFloat((i.pageX-e(n).offset().left)/a);r=this.opt.precision?r-1+o:r-1+(o>.5?1:.5)}return r},_getSize:function(){var e;return e="img"===this.opt.starType?this.stars[0].width:parseFloat(this.stars.eq(0).css("font-size")),e||t._error.call(this,"Could not be possible get the icon size!"),e},_turnOn:function(e,t){return this.opt.single?e===t:t>=e},_getHint:function(e){var t=this.opt.hints[e-1];return""===t?"":t||e},_lock:function(){var e=parseInt(this.score.val(),10),i=e?t._getHint.call(this,e):this.opt.noRatedMsg;this.style.cursor="",this.title=i,this.score.prop("readonly",!0),this.stars.prop("title",i),this.cancel&&this.cancel.hide(),this.self.data("readonly",!0)},_nameForIndex:function(e){return this.opt.score&&this.opt.score>=e?"starOn":"starOff"},_roundStars:function(e){var i=(e%1).toFixed(2);if(i>this.opt.round.down){var n="starOn";this.opt.halfShow&&i<this.opt.round.up?n="starHalf":i<this.opt.round.full&&(n="starOff");var r=this.opt[n],a=this.stars[Math.ceil(e)-1];t._setIcon.call(this,a,r)}},_setIcon:function(e,t){e["img"===this.opt.starType?"src":"className"]=this.opt.path+t},_setTarget:function(e,t){t&&(t=this.opt.targetFormat.toString().replace("{score}",t)),e.is(":input")?e.val(t):e.html(t)},_target:function(i,n){if(this.opt.target){var r=e(this.opt.target);r.length||t._error.call(this,"Target selector invalid or missing!");var a=n&&"mouseover"===n.type;if(void 0===i)i=this.opt.targetText;else if(null===i)i=a?this.opt.cancelHint:this.opt.targetText;else{"hint"===this.opt.targetType?i=t._getHint.call(this,Math.ceil(i)):this.opt.precision&&(i=parseFloat(i).toFixed(1));var o=n&&"mousemove"===n.type;a||o||this.opt.targetKeep||(i=this.opt.targetText)}t._setTarget.call(this,r,i)}},_unlock:function(){this.style.cursor="pointer",this.removeAttribute("title"),this.score.removeAttr("readonly"),this.self.data("readonly",!1);for(var e=0;e<this.opt.number;e++)this.stars[e].title=t._getHint.call(this,e+1);this.cancel&&this.cancel.css("display","")},cancel:function(i){return this.each(function(){var n=e(this);n.data("readonly")!==!0&&(t[i?"click":"score"].call(n,null),this.score.removeAttr("value"))})},click:function(i){return this.each(function(){e(this).data("readonly")!==!0&&(t._apply.call(this,i),this.opt.click&&this.opt.click.call(this,i,e.Event("click")),t._target.call(this,i))})},destroy:function(){return this.each(function(){var t=e(this),i=t.data("raw");i?t.off(".raty").empty().css({cursor:i.style.cursor}).removeData("readonly"):t.data("raw",t.clone()[0])})},getScore:function(){var e,t=[];return this.each(function(){e=this.score.val(),t.push(e?+e:void 0)}),t.length>1?t:t[0]},move:function(i){return this.each(function(){var n=parseInt(i,10),r=e(this).data("options"),a=(+i).toFixed(1).split(".")[1];n>=r.number&&(n=r.number-1,a=10);var o=t._getSize.call(this),s=o/10,l=e(this.stars[n]),u=l.offset().left+s*parseInt(a,10),c=e.Event("mousemove",{pageX:u});l.trigger(c)})},readOnly:function(i){return this.each(function(){var n=e(this);n.data("readonly")!==i&&(i?(n.off(".raty").children("img").off(".raty"),t._lock.call(this)):(t._binds.call(this),t._unlock.call(this)),n.data("readonly",i))})},reload:function(){return t.set.call(this,{})},score:function(){var i=e(this);return arguments.length?t.setScore.apply(i,arguments):t.getScore.call(i)},set:function(t){return this.each(function(){var i=e(this),n=i.data("options"),r=e.extend({},n,t);i.raty(r)})},setScore:function(i){return this.each(function(){e(this).data("readonly")!==!0&&(t._apply.call(this,i),t._target.call(this,i))})}};e.fn.raty=function(i){return t[i]?t[i].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof i&&i?void e.error("Method "+i+" does not exist!"):t.init.apply(this,arguments)},e.fn.raty.defaults={cancel:!1,cancelClass:"raty-cancel",cancelHint:"Cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:void 0,half:!1,halfShow:!0,hints:["bad","poor","regular","good","gorgeous"],iconRange:void 0,mouseout:void 0,mouseover:void 0,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:void 0,precision:!1,readOnly:!1,round:{down:.25,full:.6,up:.76},score:void 0,scoreName:"score",single:!1,space:!0,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",starType:"img",target:void 0,targetFormat:"{score}",targetKeep:!1,targetScore:void 0,targetText:"",targetType:"hint"}}(jQuery),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"undefined"!=typeof module&&module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(e){"use strict";function t(t){return!t.nodeName||-1!==e.inArray(t.nodeName.toLowerCase(),["iframe","#document","html","body"])}function i(t){return e.isFunction(t)||e.isPlainObject(t)?t:{top:t,left:t}}var n=e.scrollTo=function(t,i,n){return e(window).scrollTo(t,i,n)};return n.defaults={
6
axis:"xy",duration:0,limit:!0},e.fn.scrollTo=function(r,a,o){"object"==typeof a&&(o=a,a=0),"function"==typeof o&&(o={onAfter:o}),"max"===r&&(r=9e9),o=e.extend({},n.defaults,o),a=a||o.duration;var s=o.queue&&o.axis.length>1;return s&&(a/=2),o.offset=i(o.offset),o.over=i(o.over),this.each(function(){function l(t){var i=e.extend({},o,{queue:!0,duration:a,complete:t&&function(){t.call(d,p,o)}});h.animate(f,i)}if(null!==r){var u,c=t(this),d=c?this.contentWindow||window:this,h=e(d),p=r,f={};switch(typeof p){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?#x2F;.test(p)){p=i(p);break}if(p=c?e(p):e(p,d),!p.length)return;case"object":(p.is||p.style)&&(u=(p=e(p)).offset())}var m=e.isFunction(o.offset)&&o.offset(d,p)||o.offset;e.each(o.axis.split(""),function(e,t){var i="x"===t?"Left":"Top",r=i.toLowerCase(),a="scroll"+i,g=h[a](),v=n.max(d,t);if(u)f[a]=u[r]+(c?0:g-h.offset()[r]),o.margin&&(f[a]-=parseInt(p.css("margin"+i),10)||0,f[a]-=parseInt(p.css("border"+i+"Width"),10)||0),f[a]+=m[r]||0,o.over[r]&&(f[a]+=p["x"===t?"width":"height"]()*o.over[r]);else{var y=p[r];f[a]=y.slice&&"%"===y.slice(-1)?parseFloat(y)/100*v:y}o.limit&&/^\d+#x2F;.test(f[a])&&(f[a]=f[a]<=0?0:Math.min(f[a],v)),!e&&o.axis.length>1&&(g===f[a]?f={}:s&&(l(o.onAfterFirst),f={}))}),l(o.onAfter)}})},n.max=function(i,n){var r="x"===n?"Width":"Height",a="scroll"+r;if(!t(i))return i[a]-e(i)[r.toLowerCase()]();var o="client"+r,s=i.ownerDocument||i.document,l=s.documentElement,u=s.body;return Math.max(l[a],u[a])-Math.min(l[o],u[o])},e.Tween.propHooks.scrollLeft=e.Tween.propHooks.scrollTop={get:function(t){return e(t.elem)[t.prop]()},set:function(t){var i=this.get(t);if(t.options.interrupt&&t._last&&t._last!==i)return e(t.elem).stop();var n=Math.round(t.now);i!==n&&(e(t.elem)[t.prop](n),t._last=this.get(t))}},n}),!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e:e(jQuery)}(function(e){function t(t){var o=t||window.event,s=l.call(arguments,1),u=0,d=0,h=0,p=0,f=0,m=0;if(t=e.event.fix(o),t.type="mousewheel","detail"in o&&(h=-1*o.detail),"wheelDelta"in o&&(h=o.wheelDelta),"wheelDeltaY"in o&&(h=o.wheelDeltaY),"wheelDeltaX"in o&&(d=-1*o.wheelDeltaX),"axis"in o&&o.axis===o.HORIZONTAL_AXIS&&(d=-1*h,h=0),u=0===h?d:h,"deltaY"in o&&(h=-1*o.deltaY,u=h),"deltaX"in o&&(d=o.deltaX,0===h&&(u=-1*d)),0!==h||0!==d){if(1===o.deltaMode){var g=e.data(this,"mousewheel-line-height");u*=g,h*=g,d*=g}else if(2===o.deltaMode){var v=e.data(this,"mousewheel-page-height");u*=v,h*=v,d*=v}if(p=Math.max(Math.abs(h),Math.abs(d)),(!a||a>p)&&(a=p,n(o,p)&&(a/=40)),n(o,p)&&(u/=40,d/=40,h/=40),u=Math[u>=1?"floor":"ceil"](u/a),d=Math[d>=1?"floor":"ceil"](d/a),h=Math[h>=1?"floor":"ceil"](h/a),c.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();f=t.clientX-y.left,m=t.clientY-y.top}return t.deltaX=d,t.deltaY=h,t.deltaFactor=a,t.offsetX=f,t.offsetY=m,t.deltaMode=0,s.unshift(t,u,d,h),r&&clearTimeout(r),r=setTimeout(i,200),(e.event.dispatch||e.event.handle).apply(this,s)}}function i(){a=null}function n(e,t){return c.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120===0}var r,a,o=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],s="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(e.event.fixHooks)for(var u=o.length;u;)e.event.fixHooks[o[--u]]=e.event.mouseHooks;var c=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var i=s.length;i;)this.addEventListener(s[--i],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",c.getLineHeight(this)),e.data(this,"mousewheel-page-height",c.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var i=s.length;i;)this.removeEventListener(s[--i],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var i=e(t),n=i["offsetParent"in e.fn?"offsetParent":"parent"]();return n.length||(n=e("body")),parseInt(n.css("fontSize"),10)||parseInt(i.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),!function(e){"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){!function(t){var i="function"==typeof define&&define.amd,n="undefined"!=typeof module&&module.exports,r="https:"==document.location.protocol?"https:":"http:",a="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js";i||(n?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+r+"//"+a+"%3E%3C/script%3E"))),t()}(function(){var t,i="mCustomScrollbar",n="mCS",r=".mCustomScrollbar",a={setTop:0,setLeft:0,axis:"y",scrollbarPosition:"inside",scrollInertia:950,autoDraggerLength:!0,alwaysShowScrollbar:0,snapOffset:0,mouseWheel:{enable:!0,scrollAmount:"auto",axis:"y",deltaFactor:"auto",disableOver:["select","option","keygen","datalist","textarea"]},scrollButtons:{scrollType:"stepless",scrollAmount:"auto"},keyboard:{enable:!0,scrollType:"stepless",scrollAmount:"auto"},contentTouchScroll:25,advanced:{autoScrollOnFocus:"input,textarea,select,button,datalist,keygen,a[tabindex],area,object,[contenteditable='true']",updateOnContentResize:!0,updateOnImageLoad:!0},theme:"light",callbacks:{onTotalScrollOffset:0,onTotalScrollBackOffset:0,alwaysTriggerOffsets:!0}},o=0,s={},l=window.attachEvent&&!window.addEventListener?1:0,u=!1,c=["mCSB_dragger_onDrag","mCSB_scrollTools_onDrag","mCS_img_loaded","mCS_disabled","mCS_destroyed","mCS_no_scrollbar","mCS-autoHide","mCS-dir-rtl","mCS_no_scrollbar_y","mCS_no_scrollbar_x","mCS_y_hidden","mCS_x_hidden","mCSB_draggerContainer","mCSB_buttonUp","mCSB_buttonDown","mCSB_buttonLeft","mCSB_buttonRight"],d={init:function(t){var t=e.extend(!0,{},a,t),i=h.call(this);if(t.live){var l=t.liveSelector||this.selector||r,u=e(l);if("off"===t.live)return void f(l);s[l]=setTimeout(function(){u.mCustomScrollbar(t),"once"===t.live&&u.length&&f(l)},500)}else f(l);return t.setWidth=t.set_width?t.set_width:t.setWidth,t.setHeight=t.set_height?t.set_height:t.setHeight,t.axis=t.horizontalScroll?"x":m(t.axis),t.scrollInertia=t.scrollInertia>0&&t.scrollInertia<17?17:t.scrollInertia,"object"!=typeof t.mouseWheel&&1==t.mouseWheel&&(t.mouseWheel={enable:!0,scrollAmount:"auto",axis:"y",preventDefault:!1,deltaFactor:"auto",normalizeDelta:!1,invert:!1}),t.mouseWheel.scrollAmount=t.mouseWheelPixels?t.mouseWheelPixels:t.mouseWheel.scrollAmount,t.mouseWheel.normalizeDelta=t.advanced.normalizeMouseWheelDelta?t.advanced.normalizeMouseWheelDelta:t.mouseWheel.normalizeDelta,t.scrollButtons.scrollType=g(t.scrollButtons.scrollType),p(t),e(i).each(function(){var i=e(this);if(!i.data(n)){i.data(n,{idx:++o,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:i.css("direction"),cbOffsets:null,trigger:null});var r=i.data(n),a=r.opt,s=i.data("mcs-axis"),l=i.data("mcs-scrollbar-position"),u=i.data("mcs-theme");s&&(a.axis=s),l&&(a.scrollbarPosition=l),u&&(a.theme=u,p(a)),v.call(this),e("#mCSB_"+r.idx+"_container img:not(."+c[2]+")").addClass(c[2]),d.update.call(null,i)}})},update:function(t,i){var r=t||h.call(this);return e(r).each(function(){var t=e(this);if(t.data(n)){var r=t.data(n),a=r.opt,o=e("#mCSB_"+r.idx+"_container"),s=[e("#mCSB_"+r.idx+"_dragger_vertical"),e("#mCSB_"+r.idx+"_dragger_horizontal")];if(!o.length)return;r.tweenRunning&&Y(t),t.hasClass(c[3])&&t.removeClass(c[3]),t.hasClass(c[4])&&t.removeClass(c[4]),_.call(this),b.call(this),"y"===a.axis||a.advanced.autoExpandHorizontalScroll||o.css("width",y(o.children())),r.overflowed=S.call(this),D.call(this),a.autoDraggerLength&&x.call(this),j.call(this),Q.call(this);var l=[Math.abs(o[0].offsetTop),Math.abs(o[0].offsetLeft)];"x"!==a.axis&&(r.overflowed[0]?s[0].height()>s[0].parent().height()?k.call(this):(X(t,l[0].toString(),{dir:"y",dur:0,overwrite:"none"}),r.contentReset.y=null):(k.call(this),"y"===a.axis?$.call(this):"yx"===a.axis&&r.overflowed[1]&&X(t,l[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==a.axis&&(r.overflowed[1]?s[1].width()>s[1].parent().width()?k.call(this):(X(t,l[1].toString(),{dir:"x",dur:0,overwrite:"none"}),r.contentReset.x=null):(k.call(this),"x"===a.axis?$.call(this):"yx"===a.axis&&r.overflowed[0]&&X(t,l[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),i&&r&&(2===i&&a.callbacks.onImageLoad&&"function"==typeof a.callbacks.onImageLoad?a.callbacks.onImageLoad.call(this):3===i&&a.callbacks.onSelectorChange&&"function"==typeof a.callbacks.onSelectorChange?a.callbacks.onSelectorChange.call(this):a.callbacks.onUpdate&&"function"==typeof a.callbacks.onUpdate&&a.callbacks.onUpdate.call(this)),U.call(this)}})},scrollTo:function(t,i){if("undefined"!=typeof t&&null!=t){var r=h.call(this);return e(r).each(function(){var r=e(this);if(r.data(n)){var a=r.data(n),o=a.opt,s={trigger:"external",scrollInertia:o.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},l=e.extend(!0,{},s,i),u=F.call(this,t),c=l.scrollInertia>0&&l.scrollInertia<17?17:l.scrollInertia;u[0]=W.call(this,u[0],"y"),u[1]=W.call(this,u[1],"x"),l.moveDragger&&(u[0]*=a.scrollRatio.y,u[1]*=a.scrollRatio.x),l.dur=c,setTimeout(function(){null!==u[0]&&"undefined"!=typeof u[0]&&"x"!==o.axis&&a.overflowed[0]&&(l.dir="y",l.overwrite="all",X(r,u[0].toString(),l)),null!==u[1]&&"undefined"!=typeof u[1]&&"y"!==o.axis&&a.overflowed[1]&&(l.dir="x",l.overwrite="none",X(r,u[1].toString(),l))},l.timeout)}})}},stop:function(){var t=h.call(this);return e(t).each(function(){var t=e(this);t.data(n)&&Y(t)})},disable:function(t){var i=h.call(this);return e(i).each(function(){var i=e(this);i.data(n)&&(i.data(n),U.call(this,"remove"),$.call(this),t&&k.call(this),D.call(this,!0),i.addClass(c[3]))})},destroy:function(){var t=h.call(this);return e(t).each(function(){var r=e(this);if(r.data(n)){var a=r.data(n),o=a.opt,s=e("#mCSB_"+a.idx),l=e("#mCSB_"+a.idx+"_container"),u=e(".mCSB_"+a.idx+"_scrollbar");o.live&&f(o.liveSelector||e(t).selector),U.call(this,"remove"),$.call(this),k.call(this),r.removeData(n),Z(this,"mcs"),u.remove(),l.find("img."+c[2]).removeClass(c[2]),s.replaceWith(l.contents()),r.removeClass(i+" _"+n+"_"+a.idx+" "+c[6]+" "+c[7]+" "+c[5]+" "+c[3]).addClass(c[4])}})}},h=function(){return"object"!=typeof e(this)||e(this).length<1?r:this},p=function(t){var i=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],n=["rounded-dots","rounded-dots-dark","3d","3d-dark","3d-thick","3d-thick-dark","inset","inset-dark","inset-2","inset-2-dark","inset-3","inset-3-dark"],r=["minimal","minimal-dark"],a=["minimal","minimal-dark"],o=["minimal","minimal-dark"];t.autoDraggerLength=e.inArray(t.theme,i)>-1?!1:t.autoDraggerLength,t.autoExpandScrollbar=e.inArray(t.theme,n)>-1?!1:t.autoExpandScrollbar,t.scrollButtons.enable=e.inArray(t.theme,r)>-1?!1:t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,a)>-1?!0:t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,o)>-1?"outside":t.scrollbarPosition},f=function(e){s[e]&&(clearTimeout(s[e]),Z(s,e))},m=function(e){return"yx"===e||"xy"===e||"auto"===e?"yx":"x"===e||"horizontal"===e?"x":"y"},g=function(e){return"stepped"===e||"pixels"===e||"step"===e||"click"===e?"stepped":"stepless"},v=function(){var t=e(this),r=t.data(n),a=r.opt,o=a.autoExpandScrollbar?" "+c[1]+"_expand":"",s=["<div id='mCSB_"+r.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+r.idx+"_scrollbar mCS-"+a.theme+" mCSB_scrollTools_vertical"+o+"'><div class='"+c[12]+"'><div id='mCSB_"+r.idx+"_dragger_vertical' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>","<div id='mCSB_"+r.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+r.idx+"_scrollbar mCS-"+a.theme+" mCSB_scrollTools_horizontal"+o+"'><div class='"+c[12]+"'><div id='mCSB_"+r.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>"],l="yx"===a.axis?"mCSB_vertical_horizontal":"x"===a.axis?"mCSB_horizontal":"mCSB_vertical",u="yx"===a.axis?s[0]+s[1]:"x"===a.axis?s[1]:s[0],d="yx"===a.axis?"<div id='mCSB_"+r.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",h=a.autoHideScrollbar?" "+c[6]:"",p="x"!==a.axis&&"rtl"===r.langDir?" "+c[7]:"";a.setWidth&&t.css("width",a.setWidth),a.setHeight&&t.css("height",a.setHeight),a.setLeft="y"!==a.axis&&"rtl"===r.langDir?"989999px":a.setLeft,t.addClass(i+" _"+n+"_"+r.idx+h+p).wrapInner("<div id='mCSB_"+r.idx+"' class='mCustomScrollBox mCS-"+a.theme+" "+l+"'><div id='mCSB_"+r.idx+"_container' class='mCSB_container' style='position:relative; top:"+a.setTop+"; left:"+a.setLeft+";' dir="+r.langDir+" /></div>");var f=e("#mCSB_"+r.idx),m=e("#mCSB_"+r.idx+"_container");"y"===a.axis||a.advanced.autoExpandHorizontalScroll||m.css("width",y(m.children())),"outside"===a.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),f.addClass("mCSB_outside").after(u)):(f.addClass("mCSB_inside").append(u),m.wrap(d)),w.call(this);var g=[e("#mCSB_"+r.idx+"_dragger_vertical"),e("#mCSB_"+r.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},y=function(t){return Math.max.apply(Math,t.map(function(){return e(this).outerWidth(!0)}).get())},b=function(){var t=e(this),i=t.data(n),r=i.opt,a=e("#mCSB_"+i.idx+"_container");r.advanced.autoExpandHorizontalScroll&&"y"!==r.axis&&a.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(a[0].getBoundingClientRect().right+.4)-Math.floor(a[0].getBoundingClientRect().left),position:"relative"}).unwrap()},w=function(){var t=e(this),i=t.data(n),r=i.opt,a=e(".mCSB_"+i.idx+"_scrollbar:first"),o=te(r.scrollButtons.tabindex)?"tabindex='"+r.scrollButtons.tabindex+"'":"",s=["<a href='#' class='"+c[13]+"' oncontextmenu='return false;' "+o+" />","<a href='#' class='"+c[14]+"' oncontextmenu='return false;' "+o+" />","<a href='#' class='"+c[15]+"' oncontextmenu='return false;' "+o+" />","<a href='#' class='"+c[16]+"' oncontextmenu='return false;' "+o+" />"],l=["x"===r.axis?s[2]:s[0],"x"===r.axis?s[3]:s[1],s[2],s[3]];r.scrollButtons.enable&&a.prepend(l[0]).append(l[1]).next(".mCSB_scrollTools").prepend(l[2]).append(l[3])},_=function(){var t=e(this),i=t.data(n),r=e("#mCSB_"+i.idx),a=t.css("max-height")||"none",o=-1!==a.indexOf("%"),s=t.css("box-sizing");if("none"!==a){var l=o?t.parent().height()*parseInt(a)/100:parseInt(a);"border-box"===s&&(l-=t.innerHeight()-t.height()+(t.outerHeight()-t.innerHeight())),r.css("max-height",Math.round(l))}},x=function(){var t=e(this),i=t.data(n),r=e("#mCSB_"+i.idx),a=e("#mCSB_"+i.idx+"_container"),o=[e("#mCSB_"+i.idx+"_dragger_vertical"),e("#mCSB_"+i.idx+"_dragger_horizontal")],s=[r.height()/a.outerHeight(!1),r.width()/a.outerWidth(!1)],u=[parseInt(o[0].css("min-height")),Math.round(s[0]*o[0].parent().height()),parseInt(o[1].css("min-width")),Math.round(s[1]*o[1].parent().width())],c=l&&u[1]<u[0]?u[0]:u[1],d=l&&u[3]<u[2]?u[2]:u[3];o[0].css({height:c,"max-height":o[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":u[0]+"px"}),o[1].css({width:d,"max-width":o[1].parent().width()-10})},j=function(){var t=e(this),i=t.data(n),r=e("#mCSB_"+i.idx),a=e("#mCSB_"+i.idx+"_container"),o=[e("#mCSB_"+i.idx+"_dragger_vertical"),e("#mCSB_"+i.idx+"_dragger_horizontal")],s=[a.outerHeight(!1)-r.height(),a.outerWidth(!1)-r.width()],l=[s[0]/(o[0].parent().height()-o[0].height()),s[1]/(o[1].parent().width()-o[1].width())];i.scrollRatio={y:l[0],x:l[1]}},C=function(e,t,i){var n=i?c[0]+"_expanded":"",r=e.closest(".mCSB_scrollTools");"active"===t?(e.toggleClass(c[0]+" "+n),r.toggleClass(c[1]),e[0]._draggable=e[0]._draggable?0:1):e[0]._draggable||("hide"===t?(e.removeClass(c[0]),r.removeClass(c[1])):(e.addClass(c[0]),r.addClass(c[1])))},S=function(){var t=e(this),i=t.data(n),r=e("#mCSB_"+i.idx),a=e("#mCSB_"+i.idx+"_container"),o=null==i.overflowed?a.height():a.outerHeight(!1),s=null==i.overflowed?a.width():a.outerWidth(!1);return[o>r.height(),s>r.width()]},k=function(){var t=e(this),i=t.data(n),r=i.opt,a=e("#mCSB_"+i.idx),o=e("#mCSB_"+i.idx+"_container"),s=[e("#mCSB_"+i.idx+"_dragger_vertical"),e("#mCSB_"+i.idx+"_dragger_horizontal")];if(Y(t),("x"!==r.axis&&!i.overflowed[0]||"y"===r.axis&&i.overflowed[0])&&(s[0].add(o).css("top",0),X(t,"_resetY")),"y"!==r.axis&&!i.overflowed[1]||"x"===r.axis&&i.overflowed[1]){var l=dx=0;"rtl"===i.langDir&&(l=a.width()-o.outerWidth(!1),dx=Math.abs(l/i.scrollRatio.x)),o.css("left",l),s[1].css("left",dx),X(t,"_resetX")}},Q=function(){function t(){o=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(o),E.call(i[0])):t()},100)}var i=e(this),r=i.data(n),a=r.opt;if(!r.bindEvents){if(O.call(this),a.contentTouchScroll&&A.call(this),M.call(this),a.mouseWheel.enable){var o;t()}L.call(this),H.call(this),a.advanced.autoScrollOnFocus&&R.call(this),a.scrollButtons.enable&&B.call(this),a.keyboard.enable&&z.call(this),r.bindEvents=!0}},$=function(){var t=e(this),i=t.data(n),r=i.opt,a=n+"_"+i.idx,o=".mCSB_"+i.idx+"_scrollbar",s=e("#mCSB_"+i.idx+",#mCSB_"+i.idx+"_container,#mCSB_"+i.idx+"_container_wrapper,"+o+" ."+c[12]+",#mCSB_"+i.idx+"_dragger_vertical,#mCSB_"+i.idx+"_dragger_horizontal,"+o+">a"),l=e("#mCSB_"+i.idx+"_container");r.advanced.releaseDraggableSelectors&&s.add(e(r.advanced.releaseDraggableSelectors)),i.bindEvents&&(e(document).unbind("."+a),s.each(function(){e(this).unbind("."+a)}),clearTimeout(t[0]._focusTimeout),Z(t[0],"_focusTimeout"),clearTimeout(i.sequential.step),Z(i.sequential,"step"),clearTimeout(l[0].onCompleteTimeout),Z(l[0],"onCompleteTimeout"),i.bindEvents=!1)},D=function(t){var i=e(this),r=i.data(n),a=r.opt,o=e("#mCSB_"+r.idx+"_container_wrapper"),s=o.length?o:e("#mCSB_"+r.idx+"_container"),l=[e("#mCSB_"+r.idx+"_scrollbar_vertical"),e("#mCSB_"+r.idx+"_scrollbar_horizontal")],u=[l[0].find(".mCSB_dragger"),l[1].find(".mCSB_dragger")];"x"!==a.axis&&(r.overflowed[0]&&!t?(l[0].add(u[0]).add(l[0].children("a")).css("display","block"),s.removeClass(c[8]+" "+c[10])):(a.alwaysShowScrollbar?(2!==a.alwaysShowScrollbar&&u[0].css("display","none"),s.removeClass(c[10])):(l[0].css("display","none"),s.addClass(c[10])),s.addClass(c[8]))),"y"!==a.axis&&(r.overflowed[1]&&!t?(l[1].add(u[1]).add(l[1].children("a")).css("display","block"),s.removeClass(c[9]+" "+c[11])):(a.alwaysShowScrollbar?(2!==a.alwaysShowScrollbar&&u[1].css("display","none"),s.removeClass(c[11])):(l[1].css("display","none"),s.addClass(c[11])),s.addClass(c[9]))),r.overflowed[0]||r.overflowed[1]?i.removeClass(c[5]):i.addClass(c[5])},T=function(e){var t=e.type;switch(t){case"pointerdown":case"MSPointerDown":case"pointermove":case"MSPointerMove":case"pointerup":case"MSPointerUp":return e.target.ownerDocument!==document?[e.originalEvent.screenY,e.originalEvent.screenX,!1]:[e.originalEvent.pageY,e.originalEvent.pageX,!1];case"touchstart":case"touchmove":case"touchend":var i=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],n=e.originalEvent.touches.length||e.originalEvent.changedTouches.length;return e.target.ownerDocument!==document?[i.screenY,i.screenX,n>1]:[i.pageY,i.pageX,n>1];default:return[e.pageY,e.pageX,!1]}},O=function(){function t(e){var t=f.find("iframe");if(t.length){var i=e?"auto":"none";t.css("pointer-events",i)}}function i(e,t,i,n){if(f[0].idleTimer=d.scrollInertia<233?250:0,r.attr("id")===p[1])var a="x",o=(r[0].offsetLeft-t+n)*c.scrollRatio.x;else var a="y",o=(r[0].offsetTop-e+i)*c.scrollRatio.y;X(s,o.toString(),{dir:a,drag:!0})}var r,a,o,s=e(this),c=s.data(n),d=c.opt,h=n+"_"+c.idx,p=["mCSB_"+c.idx+"_dragger_vertical","mCSB_"+c.idx+"_dragger_horizontal"],f=e("#mCSB_"+c.idx+"_container"),m=e("#"+p[0]+",#"+p[1]),g=d.advanced.releaseDraggableSelectors?m.add(e(d.advanced.releaseDraggableSelectors)):m;m.bind("mousedown."+h+" touchstart."+h+" pointerdown."+h+" MSPointerDown."+h,function(i){if(i.stopImmediatePropagation(),i.preventDefault(),J(i)){u=!0,l&&(document.onselectstart=function(){return!1}),t(!1),Y(s),r=e(this);var n=r.offset(),c=T(i)[0]-n.top,h=T(i)[1]-n.left,p=r.height()+n.top,f=r.width()+n.left;p>c&&c>0&&f>h&&h>0&&(a=c,o=h),C(r,"active",d.autoExpandScrollbar)}}).bind("touchmove."+h,function(e){e.stopImmediatePropagation(),e.preventDefault();var t=r.offset(),n=T(e)[0]-t.top,s=T(e)[1]-t.left;i(a,o,n,s)}),e(document).bind("mousemove."+h+" pointermove."+h+" MSPointerMove."+h,function(e){if(r){var t=r.offset(),n=T(e)[0]-t.top,s=T(e)[1]-t.left;if(a===n)return;i(a,o,n,s)}}).add(g).bind("mouseup."+h+" touchend."+h+" pointerup."+h+" MSPointerUp."+h,function(){r&&(C(r,"active",d.autoExpandScrollbar),r=null),u=!1,l&&(document.onselectstart=null),t(!0)})},A=function(){function i(e){if(!ee(e)||u||T(e)[2])return void(t=0);t=1,_=0,x=0;var i=$.offset();c=T(e)[0]-i.top,d=T(e)[1]-i.left,P=[T(e)[0],T(e)[1]]}function r(e){if(ee(e)&&!u&&!T(e)[2]&&(e.stopImmediatePropagation(),!x||_)){m=K();var t=Q.offset(),i=T(e)[0]-t.top,n=T(e)[1]-t.left,r="mcsLinearOut";if(O.push(i),A.push(n),P[2]=Math.abs(T(e)[0]-P[0]),P[3]=Math.abs(T(e)[1]-P[1]),C.overflowed[0])var a=D[0].parent().height()-D[0].height(),o=c-i>0&&i-c>-(a*C.scrollRatio.y)&&(2*P[3]<P[2]||"yx"===S.axis);if(C.overflowed[1])var s=D[1].parent().width()-D[1].width(),h=d-n>0&&n-d>-(s*C.scrollRatio.x)&&(2*P[2]<P[3]||"yx"===S.axis);o||h?(e.preventDefault(),_=1):x=1,b="yx"===S.axis?[c-i,d-n]:"x"===S.axis?[null,d-n]:[c-i,null],$[0].idleTimer=250,C.overflowed[0]&&l(b[0],M,r,"y","all",!0),C.overflowed[1]&&l(b[1],M,r,"x",E,!0)}}function a(e){if(!ee(e)||u||T(e)[2])return void(t=0);t=1,e.stopImmediatePropagation(),Y(j),f=K();var i=Q.offset();h=T(e)[0]-i.top,p=T(e)[1]-i.left,O=[],A=[]}function o(e){if(ee(e)&&!u&&!T(e)[2]){e.stopImmediatePropagation(),_=0,x=0,g=K();var t=Q.offset(),i=T(e)[0]-t.top,n=T(e)[1]-t.left;if(!(g-m>30)){y=1e3/(g-f);var r="mcsEaseOut",a=2.5>y,o=a?[O[O.length-2],A[A.length-2]]:[0,0];v=a?[i-o[0],n-o[1]]:[i-h,n-p];var c=[Math.abs(v[0]),Math.abs(v[1])];y=a?[Math.abs(v[0]/4),Math.abs(v[1]/4)]:[y,y];var d=[Math.abs($[0].offsetTop)-v[0]*s(c[0]/y[0],y[0]),Math.abs($[0].offsetLeft)-v[1]*s(c[1]/y[1],y[1])];b="yx"===S.axis?[d[0],d[1]]:"x"===S.axis?[null,d[1]]:[d[0],null],w=[4*c[0]+S.scrollInertia,4*c[1]+S.scrollInertia];var j=parseInt(S.contentTouchScroll)||0;b[0]=c[0]>j?b[0]:0,b[1]=c[1]>j?b[1]:0,C.overflowed[0]&&l(b[0],w[0],r,"y",E,!1),C.overflowed[1]&&l(b[1],w[1],r,"x",E,!1)}}}function s(e,t){var i=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?i[0]:i[3]:e>60?t>3?i[3]:i[2]:e>30?t>8?i[1]:t>6?i[0]:t>4?t:i[2]:t>8?t:i[3]}function l(e,t,i,n,r,a){e&&X(j,e.toString(),{dur:t,scrollEasing:i,dir:n,overwrite:r,drag:a})}var c,d,h,p,f,m,g,v,y,b,w,_,x,j=e(this),C=j.data(n),S=C.opt,k=n+"_"+C.idx,Q=e("#mCSB_"+C.idx),$=e("#mCSB_"+C.idx+"_container"),D=[e("#mCSB_"+C.idx+"_dragger_vertical"),e("#mCSB_"+C.idx+"_dragger_horizontal")],O=[],A=[],M=0,E="yx"===S.axis?"none":"all",P=[],L=$.find("iframe"),R=["touchstart."+k+" pointerdown."+k+" MSPointerDown."+k,"touchmove."+k+" pointermove."+k+" MSPointerMove."+k,"touchend."+k+" pointerup."+k+" MSPointerUp."+k];$.bind(R[0],function(e){i(e)}).bind(R[1],function(e){r(e)}),Q.bind(R[0],function(e){a(e)}).bind(R[2],function(e){o(e)}),L.length&&L.each(function(){e(this).load(function(){I(this)&&e(this.contentDocument||this.contentWindow.document).bind(R[0],function(e){i(e),a(e)}).bind(R[1],function(e){r(e)}).bind(R[2],function(e){o(e)})})})},M=function(){function i(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function r(e,t,i){c.type=i&&a?"stepped":"stepless",c.scrollAmount=10,q(o,e,t,"mcsLinearOut",i?60:null)}var a,o=e(this),s=o.data(n),l=s.opt,c=s.sequential,d=n+"_"+s.idx,h=e("#mCSB_"+s.idx+"_container"),p=h.parent();h.bind("mousedown."+d,function(){t||a||(a=1,u=!0)}).add(document).bind("mousemove."+d,function(e){if(!t&&a&&i()){var n=h.offset(),o=T(e)[0]-n.top+h[0].offsetTop,u=T(e)[1]-n.left+h[0].offsetLeft;o>0&&o<p.height()&&u>0&&u<p.width()?c.step&&r("off",null,"stepped"):("x"!==l.axis&&s.overflowed[0]&&(0>o?r("on",38):o>p.height()&&r("on",40)),"y"!==l.axis&&s.overflowed[1]&&(0>u?r("on",37):u>p.width()&&r("on",39)))}}).bind("mouseup."+d,function(){t||(a&&(a=0,r("off",null)),u=!1)})},E=function(){function t(t,n){if(Y(i),!P(i,t.target)){var o="auto"!==a.mouseWheel.deltaFactor?parseInt(a.mouseWheel.deltaFactor):l&&t.deltaFactor<100?100:t.deltaFactor||100;if("x"===a.axis||"x"===a.mouseWheel.axis)var c="x",d=[Math.round(o*r.scrollRatio.x),parseInt(a.mouseWheel.scrollAmount)],h="auto"!==a.mouseWheel.scrollAmount?d[1]:d[0]>=s.width()?.9*s.width():d[0],p=Math.abs(e("#mCSB_"+r.idx+"_container")[0].offsetLeft),f=u[1][0].offsetLeft,m=u[1].parent().width()-u[1].width(),g=t.deltaX||t.deltaY||n;else var c="y",d=[Math.round(o*r.scrollRatio.y),parseInt(a.mouseWheel.scrollAmount)],h="auto"!==a.mouseWheel.scrollAmount?d[1]:d[0]>=s.height()?.9*s.height():d[0],p=Math.abs(e("#mCSB_"+r.idx+"_container")[0].offsetTop),f=u[0][0].offsetTop,m=u[0].parent().height()-u[0].height(),g=t.deltaY||n;"y"===c&&!r.overflowed[0]||"x"===c&&!r.overflowed[1]||(a.mouseWheel.invert&&(g=-g),a.mouseWheel.normalizeDelta&&(g=0>g?-1:1),(g>0&&0!==f||0>g&&f!==m||a.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),X(i,(p-g*h).toString(),{dir:c}))}}var i=e(this),r=i.data(n),a=r.opt,o=n+"_"+r.idx,s=e("#mCSB_"+r.idx),u=[e("#mCSB_"+r.idx+"_dragger_vertical"),e("#mCSB_"+r.idx+"_dragger_horizontal")],c=e("#mCSB_"+r.idx+"_container").find("iframe");r&&(c.length&&c.each(function(){e(this).load(function(){I(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+o,function(e,i){t(e,i)})})}),s.bind("mousewheel."+o,function(e,i){t(e,i)}))},I=function(e){var t=null;try{var i=e.contentDocument||e.contentWindow.document;t=i.body.innerHTML}catch(n){}return null!==t},P=function(t,i){var r=i.nodeName.toLowerCase(),a=t.data(n).opt.mouseWheel.disableOver,o=["select","textarea"];return e.inArray(r,a)>-1&&!(e.inArray(r,o)>-1&&!e(i).is(":focus"))},L=function(){var t=e(this),i=t.data(n),r=n+"_"+i.idx,a=e("#mCSB_"+i.idx+"_container"),o=a.parent(),s=e(".mCSB_"+i.idx+"_scrollbar ."+c[12]);s.bind("touchstart."+r+" pointerdown."+r+" MSPointerDown."+r,function(){u=!0}).bind("touchend."+r+" pointerup."+r+" MSPointerUp."+r,function(){u=!1}).bind("click."+r,function(n){if(e(n.target).hasClass(c[12])||e(n.target).hasClass("mCSB_draggerRail")){Y(t);var r=e(this),s=r.find(".mCSB_dragger");if(r.parent(".mCSB_scrollTools_horizontal").length>0){if(!i.overflowed[1])return;var l="x",u=n.pageX>s.offset().left?-1:1,d=Math.abs(a[0].offsetLeft)-.9*u*o.width()}else{if(!i.overflowed[0])return;var l="y",u=n.pageY>s.offset().top?-1:1,d=Math.abs(a[0].offsetTop)-.9*u*o.height()}X(t,d.toString(),{dir:l,scrollEasing:"mcsEaseInOut"})}})},R=function(){var t=e(this),i=t.data(n),r=i.opt,a=n+"_"+i.idx,o=e("#mCSB_"+i.idx+"_container"),s=o.parent();o.bind("focusin."+a,function(){var i=e(document.activeElement),n=o.find(".mCustomScrollBox").length,a=0;i.is(r.advanced.autoScrollOnFocus)&&(Y(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=n?(a+17)*n:0,t[0]._focusTimeout=setTimeout(function(){var e=[ie(i)[0],ie(i)[1]],n=[o[0].offsetTop,o[0].offsetLeft],l=[n[0]+e[0]>=0&&n[0]+e[0]<s.height()-i.outerHeight(!1),n[1]+e[1]>=0&&n[0]+e[1]<s.width()-i.outerWidth(!1)],u="yx"!==r.axis||l[0]||l[1]?"all":"none";"x"===r.axis||l[0]||X(t,e[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:u,dur:a}),"y"===r.axis||l[1]||X(t,e[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:u,dur:a})},t[0]._focusTimer))})},H=function(){var t=e(this),i=t.data(n),r=n+"_"+i.idx,a=e("#mCSB_"+i.idx+"_container").parent();a.bind("scroll."+r,function(){(0!==a.scrollTop()||0!==a.scrollLeft())&&e(".mCSB_"+i.idx+"_scrollbar").css("visibility","hidden")})},B=function(){var t=e(this),i=t.data(n),r=i.opt,a=i.sequential,o=n+"_"+i.idx,s=".mCSB_"+i.idx+"_scrollbar",l=e(s+">a");l.bind("mousedown."+o+" touchstart."+o+" pointerdown."+o+" MSPointerDown."+o+" mouseup."+o+" touchend."+o+" pointerup."+o+" MSPointerUp."+o+" mouseout."+o+" pointerout."+o+" MSPointerOut."+o+" click."+o,function(n){function o(e,i){a.scrollAmount=r.snapAmount||r.scrollButtons.scrollAmount,q(t,e,i)}if(n.preventDefault(),J(n)){var s=e(this).attr("class");switch(a.type=r.scrollButtons.scrollType,n.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===a.type)return;u=!0,i.tweenRunning=!1,o("on",s);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===a.type)return;u=!1,a.dir&&o("off",s);break;case"click":if("stepped"!==a.type||i.tweenRunning)return;o("on",s)}}})},z=function(){function t(t){function n(e,t){o.type=a.keyboard.scrollType,o.scrollAmount=a.snapAmount||a.keyboard.scrollAmount,"stepped"===o.type&&r.tweenRunning||q(i,e,t)}switch(t.type){case"blur":r.tweenRunning&&o.dir&&n("off",null);break;case"keydown":case"keyup":var s=t.keyCode?t.keyCode:t.which,l="on";if("x"!==a.axis&&(38===s||40===s)||"y"!==a.axis&&(37===s||39===s)){if((38===s||40===s)&&!r.overflowed[0]||(37===s||39===s)&&!r.overflowed[1])return;"keyup"===t.type&&(l="off"),e(document.activeElement).is(d)||(t.preventDefault(),t.stopImmediatePropagation(),n(l,s))}else if(33===s||34===s){if((r.overflowed[0]||r.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){Y(i);var h=34===s?-1:1;if("x"===a.axis||"yx"===a.axis&&r.overflowed[1]&&!r.overflowed[0])var p="x",f=Math.abs(u[0].offsetLeft)-.9*h*c.width();else var p="y",f=Math.abs(u[0].offsetTop)-.9*h*c.height();X(i,f.toString(),{dir:p,scrollEasing:"mcsEaseInOut"})}}else if((35===s||36===s)&&!e(document.activeElement).is(d)&&((r.overflowed[0]||r.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===a.axis||"yx"===a.axis&&r.overflowed[1]&&!r.overflowed[0])var p="x",f=35===s?Math.abs(c.width()-u.outerWidth(!1)):0;else var p="y",f=35===s?Math.abs(c.height()-u.outerHeight(!1)):0;X(i,f.toString(),{dir:p,scrollEasing:"mcsEaseInOut"})}}}var i=e(this),r=i.data(n),a=r.opt,o=r.sequential,s=n+"_"+r.idx,l=e("#mCSB_"+r.idx),u=e("#mCSB_"+r.idx+"_container"),c=u.parent(),d="input,textarea,select,datalist,keygen,[contenteditable='true']",h=u.find("iframe"),p=["blur."+s+" keydown."+s+" keyup."+s];h.length&&h.each(function(){e(this).load(function(){I(this)&&e(this.contentDocument||this.contentWindow.document).bind(p[0],function(e){t(e)})})}),l.attr("tabindex","0").bind(p[0],function(e){t(e)})},q=function(t,i,r,a,o){function s(e){var i="stepped"!==h.type,n=o?o:e?i?m/1.5:g:1e3/60,r=e?i?7.5:40:2.5,l=[Math.abs(p[0].offsetTop),Math.abs(p[0].offsetLeft)],c=[u.scrollRatio.y>10?10:u.scrollRatio.y,u.scrollRatio.x>10?10:u.scrollRatio.x],d="x"===h.dir[0]?l[1]+h.dir[1]*c[1]*r:l[0]+h.dir[1]*c[0]*r,f="x"===h.dir[0]?l[1]+h.dir[1]*parseInt(h.scrollAmount):l[0]+h.dir[1]*parseInt(h.scrollAmount),v="auto"!==h.scrollAmount?f:d,y=a?a:e?i?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",b=e?!0:!1;return e&&17>n&&(v="x"===h.dir[0]?l[1]:l[0]),X(t,v.toString(),{dir:h.dir[0],scrollEasing:y,dur:n,onComplete:b}),e?void(h.dir=!1):(clearTimeout(h.step),void(h.step=setTimeout(function(){s()},n)))}function l(){clearTimeout(h.step),Z(h,"step"),Y(t)}var u=t.data(n),d=u.opt,h=u.sequential,p=e("#mCSB_"+u.idx+"_container"),f="stepped"===h.type?!0:!1,m=d.scrollInertia<26?26:d.scrollInertia,g=d.scrollInertia<1?17:d.scrollInertia;switch(i){case"on":if(h.dir=[r===c[16]||r===c[15]||39===r||37===r?"x":"y",r===c[13]||r===c[15]||38===r||37===r?-1:1],
7
+ Y(t),te(r)&&"stepped"===h.type)return;s(f);break;case"off":l(),(f||u.tweenRunning&&h.dir)&&s(!0)}},F=function(t){var i=e(this).data(n).opt,r=[];return"function"==typeof t&&(t=t()),t instanceof Array?r=t.length>1?[t[0],t[1]]:"x"===i.axis?[null,t[0]]:[t[0],null]:(r[0]=t.y?t.y:t.x||"x"===i.axis?null:t,r[1]=t.x?t.x:t.y||"y"===i.axis?null:t),"function"==typeof r[0]&&(r[0]=r[0]()),"function"==typeof r[1]&&(r[1]=r[1]()),r},W=function(t,i){if(null!=t&&"undefined"!=typeof t){var r=e(this),a=r.data(n),o=a.opt,s=e("#mCSB_"+a.idx+"_container"),l=s.parent(),u=typeof t;i||(i="x"===o.axis?"x":"y");var c="x"===i?s.outerWidth(!1):s.outerHeight(!1),h="x"===i?s[0].offsetLeft:s[0].offsetTop,p="x"===i?"left":"top";switch(u){case"function":return t();case"object":var f=t.jquery?t:e(t);if(!f.length)return;return"x"===i?ie(f)[1]:ie(f)[0];case"string":case"number":if(te(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(c*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(h-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var m=h+parseInt(t.split("+=")[1]);return m>=0?0:Math.abs(m)}if(-1!==t.indexOf("px")&&te(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(l.height()-s.outerHeight(!1));if("right"===t)return Math.abs(l.width()-s.outerWidth(!1));if("first"===t||"last"===t){var f=s.find(":"+t);return"x"===i?ie(f)[1]:ie(f)[0]}return e(t).length?"x"===i?ie(e(t))[1]:ie(e(t))[0]:(s.css(p,t),void d.update.call(null,r[0]))}}},U=function(t){function i(){clearTimeout(p[0].autoUpdate),p[0].autoUpdate=setTimeout(function(){return h.advanced.updateOnSelectorChange&&(f=o(),f!==w)?(s(3),void(w=f)):(h.advanced.updateOnContentResize&&(m=[p.outerHeight(!1),p.outerWidth(!1),v.height(),v.width(),b()[0],b()[1]],(m[0]!==_[0]||m[1]!==_[1]||m[2]!==_[2]||m[3]!==_[3]||m[4]!==_[4]||m[5]!==_[5])&&(s(m[0]!==_[0]||m[1]!==_[1]),_=m)),h.advanced.updateOnImageLoad&&(g=r(),g!==x&&(p.find("img").each(function(){a(this)}),x=g)),void((h.advanced.updateOnSelectorChange||h.advanced.updateOnContentResize||h.advanced.updateOnImageLoad)&&i()))},60)}function r(){var e=0;return h.advanced.updateOnImageLoad&&(e=p.find("img").length),e}function a(t){function i(e,t){return function(){return t.apply(e,arguments)}}function n(){this.onload=null,e(t).addClass(c[2]),s(2)}if(e(t).hasClass(c[2]))return void s();var r=new Image;r.onload=i(r,n),r.src=t.src}function o(){h.advanced.updateOnSelectorChange===!0&&(h.advanced.updateOnSelectorChange="*");var t=0,i=p.find(h.advanced.updateOnSelectorChange);return h.advanced.updateOnSelectorChange&&i.length>0&&i.each(function(){t+=e(this).height()+e(this).width()}),t}function s(e){clearTimeout(p[0].autoUpdate),d.update.call(null,l[0],e)}var l=e(this),u=l.data(n),h=u.opt,p=e("#mCSB_"+u.idx+"_container");if(t)return clearTimeout(p[0].autoUpdate),void Z(p[0],"autoUpdate");var f,m,g,v=p.parent(),y=[e("#mCSB_"+u.idx+"_scrollbar_vertical"),e("#mCSB_"+u.idx+"_scrollbar_horizontal")],b=function(){return[y[0].is(":visible")?y[0].outerHeight(!0):0,y[1].is(":visible")?y[1].outerWidth(!0):0]},w=o(),_=[p.outerHeight(!1),p.outerWidth(!1),v.height(),v.width(),b()[0],b()[1]],x=r();i()},N=function(e,t,i){return Math.round(e/t)*t-i},Y=function(t){var i=t.data(n),r=e("#mCSB_"+i.idx+"_container,#mCSB_"+i.idx+"_container_wrapper,#mCSB_"+i.idx+"_dragger_vertical,#mCSB_"+i.idx+"_dragger_horizontal");r.each(function(){V.call(this)})},X=function(t,i,r){function a(e){return l&&u.callbacks[e]&&"function"==typeof u.callbacks[e]}function o(){return[u.callbacks.alwaysTriggerOffsets||b>=w[0]+x,u.callbacks.alwaysTriggerOffsets||-j>=b]}function s(){var e=[p[0].offsetTop,p[0].offsetLeft],i=[v[0].offsetTop,v[0].offsetLeft],n=[p.outerHeight(!1),p.outerWidth(!1)],a=[h.height(),h.width()];t[0].mcs={content:p,top:e[0],left:e[1],draggerTop:i[0],draggerLeft:i[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(n[0])-a[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(n[1])-a[1])),direction:r.dir}}var l=t.data(n),u=l.opt,c={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:u.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},r=e.extend(c,r),d=[r.dur,r.drag?0:r.dur],h=e("#mCSB_"+l.idx),p=e("#mCSB_"+l.idx+"_container"),f=p.parent(),m=u.callbacks.onTotalScrollOffset?F.call(t,u.callbacks.onTotalScrollOffset):[0,0],g=u.callbacks.onTotalScrollBackOffset?F.call(t,u.callbacks.onTotalScrollBackOffset):[0,0];if(l.trigger=r.trigger,(0!==f.scrollTop()||0!==f.scrollLeft())&&(e(".mCSB_"+l.idx+"_scrollbar").css("visibility","visible"),f.scrollTop(0).scrollLeft(0)),"_resetY"!==i||l.contentReset.y||(a("onOverflowYNone")&&u.callbacks.onOverflowYNone.call(t[0]),l.contentReset.y=1),"_resetX"!==i||l.contentReset.x||(a("onOverflowXNone")&&u.callbacks.onOverflowXNone.call(t[0]),l.contentReset.x=1),"_resetY"!==i&&"_resetX"!==i){switch(!l.contentReset.y&&t[0].mcs||!l.overflowed[0]||(a("onOverflowY")&&u.callbacks.onOverflowY.call(t[0]),l.contentReset.x=null),!l.contentReset.x&&t[0].mcs||!l.overflowed[1]||(a("onOverflowX")&&u.callbacks.onOverflowX.call(t[0]),l.contentReset.x=null),u.snapAmount&&(i=N(i,u.snapAmount,u.snapOffset)),r.dir){case"x":var v=e("#mCSB_"+l.idx+"_dragger_horizontal"),y="left",b=p[0].offsetLeft,w=[h.width()-p.outerWidth(!1),v.parent().width()-v.width()],_=[i,0===i?0:i/l.scrollRatio.x],x=m[1],j=g[1],S=x>0?x/l.scrollRatio.x:0,k=j>0?j/l.scrollRatio.x:0;break;case"y":var v=e("#mCSB_"+l.idx+"_dragger_vertical"),y="top",b=p[0].offsetTop,w=[h.height()-p.outerHeight(!1),v.parent().height()-v.height()],_=[i,0===i?0:i/l.scrollRatio.y],x=m[0],j=g[0],S=x>0?x/l.scrollRatio.y:0,k=j>0?j/l.scrollRatio.y:0}_[1]<0||0===_[0]&&0===_[1]?_=[0,0]:_[1]>=w[1]?_=[w[0],w[1]]:_[0]=-_[0],t[0].mcs||(s(),a("onInit")&&u.callbacks.onInit.call(t[0])),clearTimeout(p[0].onCompleteTimeout),(l.tweenRunning||!(0===b&&_[0]>=0||b===w[0]&&_[0]<=w[0]))&&(G(v[0],y,Math.round(_[1]),d[1],r.scrollEasing),G(p[0],y,Math.round(_[0]),d[0],r.scrollEasing,r.overwrite,{onStart:function(){r.callbacks&&r.onStart&&!l.tweenRunning&&(a("onScrollStart")&&(s(),u.callbacks.onScrollStart.call(t[0])),l.tweenRunning=!0,C(v),l.cbOffsets=o())},onUpdate:function(){r.callbacks&&r.onUpdate&&a("whileScrolling")&&(s(),u.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(r.callbacks&&r.onComplete){"yx"===u.axis&&clearTimeout(p[0].onCompleteTimeout);var e=p[0].idleTimer||0;p[0].onCompleteTimeout=setTimeout(function(){a("onScroll")&&(s(),u.callbacks.onScroll.call(t[0])),a("onTotalScroll")&&_[1]>=w[1]-S&&l.cbOffsets[0]&&(s(),u.callbacks.onTotalScroll.call(t[0])),a("onTotalScrollBack")&&_[1]<=k&&l.cbOffsets[1]&&(s(),u.callbacks.onTotalScrollBack.call(t[0])),l.tweenRunning=!1,p[0].idleTimer=0,C(v,"hide")},e)}}}))}},G=function(e,t,i,n,r,a,o){function s(){_.stop||(y||f.call(),y=K()-v,l(),y>=_.time&&(_.time=y>_.time?y+h-(y-_.time):y+h-1,_.time<y+1&&(_.time=y+1)),_.time<n?_.id=p(s):g.call())}function l(){n>0?(_.currVal=d(_.time,b,x,n,r),w[t]=Math.round(_.currVal)+"px"):w[t]=i+"px",m.call()}function u(){h=1e3/60,_.time=y+h,p=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return l(),setTimeout(e,.01)},_.id=p(s)}function c(){null!=_.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(_.id):clearTimeout(_.id),_.id=null)}function d(e,t,i,n,r){switch(r){case"linear":case"mcsLinear":return i*e/n+t;case"mcsLinearOut":return e/=n,e--,i*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=n/2,1>e?i/2*e*e+t:(e--,-i/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=n/2,1>e?i/2*Math.pow(2,10*(e-1))+t:(e--,i/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=n/2,1>e?i/2*e*e*e+t:(e-=2,i/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=n,e--,-i*(e*e*e*e-1)+t;case"easeOutStrong":return i*(-Math.pow(2,-10*e/n)+1)+t;case"easeOut":case"mcsEaseOut":default:var a=(e/=n)*e,o=a*e;return t+i*(.499999999999997*o*a+-2.5*a*a+5.5*o+-6.5*a+4*e)}}e._mTween||(e._mTween={top:{},left:{}});var h,p,o=o||{},f=o.onStart||function(){},m=o.onUpdate||function(){},g=o.onComplete||function(){},v=K(),y=0,b=e.offsetTop,w=e.style,_=e._mTween[t];"left"===t&&(b=e.offsetLeft);var x=i-b;_.stop=0,"none"!==a&&c(),u()},K=function(){return window.performance&&window.performance.now?window.performance.now():window.performance&&window.performance.webkitNow?window.performance.webkitNow():Date.now?Date.now():(new Date).getTime()},V=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],i=0;i<t.length;i++){var n=t[i];e._mTween[n].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(e._mTween[n].id):clearTimeout(e._mTween[n].id),e._mTween[n].id=null,e._mTween[n].stop=1)}},Z=function(e,t){try{delete e[t]}catch(i){e[t]=null}},J=function(e){return!(e.which&&1!==e.which)},ee=function(e){var t=e.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},te=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ie=function(e){var t=e.parents(".mCSB_container");return[e.offset().top-t.offset().top,e.offset().left-t.offset().left]};e.fn[i]=function(t){return d[t]?d[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):d.init.apply(this,arguments)},e[i]=function(t){return d[t]?d[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):d.init.apply(this,arguments)},e[i].defaults=a,window[i]=!0,e(window).load(function(){e(r)[i](),e.extend(e.expr[":"],{mcsInView:e.expr[":"].mcsInView||function(t){var i,n,r=e(t),a=r.parents(".mCSB_container");return a.length?(i=a.parent(),n=[a[0].offsetTop,a[0].offsetLeft],n[0]+ie(r)[0]>=0&&n[0]+ie(r)[0]<i.height()-r.outerHeight(!1)&&n[1]+ie(r)[1]>=0&&n[1]+ie(r)[1]<i.width()-r.outerWidth(!1)):void 0},mcsOverflow:e.expr[":"].mcsOverflow||function(t){var i=e(t).data(n);return i?i.overflowed[0]||i.overflowed[1]:void 0}})})})}),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){"use strict";var t=e(window),i=e(document),n=window.location,r=!0,a=!1,o=null,s=NaN,l=1/0,u="undefined",c="directive",d=".cropper",h=/^(e|n|w|s|ne|nw|sw|se|all|crop|move|zoom)#x2F;,p=/^(x|y|width|height)#x2F;,f=/^(naturalWidth|naturalHeight|width|height|aspectRatio|ratio|rotate)#x2F;,m="cropper-modal",g="cropper-hidden",v="cropper-invisible",y="cropper-move",b="cropper-crop",w="cropper-disabled",_="mousedown touchstart",x="mousemove touchmove",j="mouseup mouseleave touchend touchleave touchcancel",C="wheel mousewheel DOMMouseScroll",S="resize"+d,k="dblclick",Q="build"+d,$="built"+d,D="dragstart"+d,T="dragmove"+d,O="dragend"+d,A=function(e){return"number"==typeof e},M=function(e,t){var i=[];return"number"==typeof t&&i.push(t),i.slice.apply(e,i)},E=function(e,t){var i=M(arguments,2);return function(){return e.apply(t,i.concat(M(arguments)))}},I=function(t,i){this.element=t,this.$element=e(t),this.defaults=e.extend({},I.DEFAULTS,e.isPlainObject(i)?i:{}),this.$original=o,this.ready=a,this.built=a,this.cropped=a,this.rotated=a,this.disabled=a,this.replaced=a,this.init()},P=Math.sqrt,L=Math.min,R=Math.max,H=Math.abs,B=Math.sin,z=Math.cos,q=parseFloat;I.prototype={constructor:I,support:{canvas:e.isFunction(e("<canvas>")[0].getContext)},init:function(){var t=this.defaults;e.each(t,function(e,i){switch(e){case"aspectRatio":t[e]=H(q(i))||s;break;case"autoCropArea":t[e]=H(q(i))||.8;break;case"minWidth":case"minHeight":t[e]=H(q(i))||0;break;case"maxWidth":case"maxHeight":t[e]=H(q(i))||l}}),this.image={rotate:0},this.load()},load:function(){var t,i,n=this,a=this.$element,o=this.element,s=this.image,l="";a.is("img")?i=a.prop("src"):a.is("canvas")&&this.support.canvas&&(i=o.toDataURL()),i&&(this.replaced&&(s.rotate=0),this.defaults.checkImageOrigin&&(a.prop("crossOrigin")||this.isCrossOriginURL(i))&&(l=" crossOrigin"),this.$clone=t=e("<img"+l+' src="'+i+'">'),t.one("load",function(){s.naturalWidth=this.naturalWidth||t.width(),s.naturalHeight=this.naturalHeight||t.height(),s.aspectRatio=s.naturalWidth/s.naturalHeight,n.url=i,n.ready=r,n.build()}),t.addClass(v).prependTo("body"))},isCrossOriginURL:function(e){var t=e.match(/^(https?:)\/\/([^\:\/\?#]+):?(\d*)/i);return!t||t[1]===n.protocol&&t[2]===n.hostname&&t[3]===n.port?a:r},build:function(){var t,i,n=this.$element,o=this.defaults;this.ready&&(this.built&&this.unbuild(),n.one(Q,o.build),t=e.Event(Q),n.trigger(t),t.isDefaultPrevented()||(this.$cropper=i=e(I.TEMPLATE),n.addClass(g),this.$clone.removeClass(v).prependTo(i),this.rotated||(this.$original=this.$clone.clone(),this.$original.addClass(g).prependTo(this.$cropper),this.originalImage=e.extend({},this.image)),this.$container=n.parent(),this.$container.append(i),this.$canvas=i.find(".cropper-canvas"),this.$dragger=i.find(".cropper-dragger"),this.$viewer=i.find(".cropper-viewer"),o.autoCrop?this.cropped=r:this.$dragger.addClass(g),o.dragCrop&&this.setDragMode("crop"),o.modal&&this.$canvas.addClass(m),!o.dashed&&this.$dragger.find(".cropper-dashed").addClass(g),!o.movable&&this.$dragger.find(".cropper-face").data(c,"move"),!o.resizable&&this.$dragger.find(".cropper-line, .cropper-point").addClass(g),this.addListeners(),this.initPreview(),this.built=r,this.update(),this.replaced=a,n.one($,o.built),n.trigger($)))},unbuild:function(){this.built&&(this.built=a,this.removeListeners(),this.$preview.empty(),this.$preview=o,this.$dragger=o,this.$canvas=o,this.$container=o,this.$cropper.remove(),this.$cropper=o)},update:function(e){this.initContainer(),this.initCropper(),this.initImage(),this.initDragger(),e?(this.setData(e,r),this.setDragMode("crop")):this.setData(this.defaults.data)},resize:function(){clearTimeout(this.resizing),this.resizing=setTimeout(e.proxy(this.update,this,this.getData()),200)},preview:function(){var t=this.image,i=this.dragger,n=t.width,r=t.height,a=i.left-t.left,o=i.top-t.top;this.$viewer.find("img").css({width:n,height:r,marginLeft:-a,marginTop:-o}),this.$preview.each(function(){var t=e(this),s=t.width()/i.width;t.find("img").css({width:n*s,height:r*s,marginLeft:-a*s,marginTop:-o*s})})},addListeners:function(){var n=this.defaults;this.$element.on(D,n.dragstart).on(T,n.dragmove).on(O,n.dragend),this.$cropper.on(_,e.proxy(this.dragstart,this)).on(k,e.proxy(this.dblclick,this)),n.zoomable&&this.$cropper.on(C,e.proxy(this.wheel,this)),n.multiple?this.$cropper.on(x,e.proxy(this.dragmove,this)).on(j,e.proxy(this.dragend,this)):i.on(x,this._dragmove=E(this.dragmove,this)).on(j,this._dragend=E(this.dragend,this)),t.on(S,this._resize=E(this.resize,this))},removeListeners:function(){var e=this.defaults;this.$element.off(D,e.dragstart).off(T,e.dragmove).off(O,e.dragend),this.$cropper.off(_,this.dragstart).off(k,this.dblclick),e.zoomable&&this.$cropper.off(C,this.wheel),e.multiple?this.$cropper.off(x,this.dragmove).off(j,this.dragend):i.off(x,this._dragmove).off(j,this._dragend),t.off(S,this._resize)},initPreview:function(){var t='<img src="'+this.url+'">';this.$preview=e(this.defaults.preview),this.$viewer.html(t),this.$preview.html(t).find("img").css("cssText","min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;")},initContainer:function(){var e=this.$container;e!==o&&(this.container={width:R(e.width(),300),height:R(e.height(),150)})},initCropper:function(){var e,t=this.container,i=this.image;i.naturalWidth*t.height/i.naturalHeight-t.width>=0?(e={width:t.width,height:t.width/i.aspectRatio,left:0},e.top=(t.height-e.height)/2):(e={width:t.height*i.aspectRatio,height:t.height,top:0},e.left=(t.width-e.width)/2),this.$cropper.css({width:e.width,height:e.height,left:e.left,top:e.top}),this.cropper=e},initImage:function(){var t=this.image,i=this.cropper,n={_width:i.width,_height:i.height,width:i.width,height:i.height,left:0,top:0,ratio:i.width/t.naturalWidth};this.defaultImage=e.extend({},t,n),t._width!==i.width||t._height!==i.height?e.extend(t,n):(t=e.extend({},n,t),this.replaced&&(t.ratio=n.ratio)),this.image=t,this.renderImage()},renderImage:function(e){var t=this.image;"zoom"===e&&(t.left-=(t.width-t.oldWidth)/2,t.top-=(t.height-t.oldHeight)/2),t.left=L(R(t.left,t._width-t.width),0),t.top=L(R(t.top,t._height-t.height),0),this.$clone.css({width:t.width,height:t.height,marginLeft:t.left,marginTop:t.top}),e&&(this.defaults.done(this.getData()),this.preview())},initDragger:function(){var t,i=this.defaults,n=this.cropper,r=i.aspectRatio||this.image.aspectRatio,a=this.image.ratio;t=n.height*r-n.width>=0?{height:n.width/r,width:n.width,left:0,top:(n.height-n.width/r)/2,maxWidth:n.width,maxHeight:n.width/r}:{height:n.height,width:n.height*r,left:(n.width-n.height*r)/2,top:0,maxWidth:n.height*r,maxHeight:n.height},t.minWidth=0,t.minHeight=0,i.aspectRatio?(isFinite(i.maxWidth)?(t.maxWidth=L(t.maxWidth,i.maxWidth*a),t.maxHeight=t.maxWidth/r):isFinite(i.maxHeight)&&(t.maxHeight=L(t.maxHeight,i.maxHeight*a),t.maxWidth=t.maxHeight*r),i.minWidth>0?(t.minWidth=R(0,i.minWidth*a),t.minHeight=t.minWidth/r):i.minHeight>0&&(t.minHeight=R(0,i.minHeight*a),t.minWidth=t.minHeight*r)):(t.maxWidth=L(t.maxWidth,i.maxWidth*a),t.maxHeight=L(t.maxHeight,i.maxHeight*a),t.minWidth=R(0,i.minWidth*a),t.minHeight=R(0,i.minHeight*a)),t.minWidth=L(t.maxWidth,t.minWidth),t.minHeight=L(t.maxHeight,t.minHeight),t.height*=i.autoCropArea,t.width*=i.autoCropArea,t.left=(n.width-t.width)/2,t.top=(n.height-t.height)/2,t.oldLeft=t.left,t.oldTop=t.top,this.defaultDragger=t,this.dragger=e.extend({},t)},renderDragger:function(){var e=this.dragger,t=this.cropper;e.width>e.maxWidth?(e.width=e.maxWidth,e.left=e.oldLeft):e.width<e.minWidth&&(e.width=e.minWidth,e.left=e.oldLeft),e.height>e.maxHeight?(e.height=e.maxHeight,e.top=e.oldTop):e.height<e.minHeight&&(e.height=e.minHeight,e.top=e.oldTop),e.left=L(R(e.left,0),t.width-e.width),e.top=L(R(e.top,0),t.height-e.height),e.oldLeft=e.left,e.oldTop=e.top,this.dragger=e,this.disabled||this.defaults.done(this.getData()),this.$dragger.css({width:e.width,height:e.height,left:e.left,top:e.top}),this.preview()},reset:function(t){this.cropped&&(t&&(this.defaults.data={}),this.image=e.extend({},this.defaultImage),this.renderImage(),this.dragger=e.extend({},this.defaultDragger),this.setData(this.defaults.data))},clear:function(){this.cropped&&(this.cropped=a,this.setData({x:0,y:0,width:0,height:0}),this.$canvas.removeClass(m),this.$dragger.addClass(g))},destroy:function(){var e=this.$element;this.ready&&(this.unbuild(),e.removeClass(g).removeData("cropper"),this.rotated&&e.attr("src",this.$original.attr("src")))},replace:function(t,i){var n,o=this,s=this.$element,l=this.element;t&&t!==this.url&&t!==s.attr("src")&&(i||(this.rotated=a,this.replaced=r),s.is("img")?(s.attr("src",t),this.load()):s.is("canvas")&&this.support.canvas&&(n=l.getContext("2d"),e('<img src="'+t+'">').one("load",function(){l.width=this.width,l.height=this.height,n.clearRect(0,0,l.width,l.height),n.drawImage(this,0,0),o.load()})))},setData:function(t,i){var n=this.cropper,r=this.dragger,a=this.image,s=this.defaults.aspectRatio;this.built&&typeof t!==u&&((t===o||e.isEmptyObject(t))&&(r=e.extend({},this.defaultDragger)),e.isPlainObject(t)&&!e.isEmptyObject(t)&&(i||(this.defaults.data=t),t=this.transformData(t),A(t.x)&&t.x<=n.width-a.left&&(r.left=t.x+a.left),A(t.y)&&t.y<=n.height-a.top&&(r.top=t.y+a.top),s?A(t.width)&&t.width<=r.maxWidth&&t.width>=r.minWidth?(r.width=t.width,r.height=r.width/s):A(t.height)&&t.height<=r.maxHeight&&t.height>=r.minHeight&&(r.height=t.height,r.width=r.height*s):(A(t.width)&&t.width<=r.maxWidth&&t.width>=r.minWidth&&(r.width=t.width),A(t.height)&&t.height<=r.maxHeight&&t.height>=r.minHeight&&(r.height=t.height))),this.dragger=r,this.renderDragger())},getData:function(e){var t=this.dragger,i=this.image,n={};return this.built&&(n={x:t.left-i.left,y:t.top-i.top,width:t.width,height:t.height},n=this.transformData(n,r,e)),n},transformData:function(t,i,n){var r=this.image.ratio,a={};return e.each(t,function(e,t){t=q(t),p.test(e)&&!isNaN(t)&&(a[e]=i?n?Math.round(t/r):t/r:t*r)}),a},setAspectRatio:function(e){var t="auto"===e;e=q(e),(t||!isNaN(e)&&e>0)&&(this.defaults.aspectRatio=t?s:e,this.built&&(this.initDragger(),this.renderDragger()))},getImageData:function(){var t={};return this.ready&&e.each(this.image,function(e,i){f.test(e)&&(t[e]=i)}),t},getDataURL:function(t,i,n){var r,a=e("<canvas>")[0],o=this.getData(),s="";return e.isPlainObject(t)||(n=i,i=t,t={}),t=e.extend({width:o.width,height:o.height},t),this.cropped&&this.support.canvas&&(a.width=t.width,a.height=t.height,r=a.getContext("2d"),"image/jpeg"===i&&(r.fillStyle="#fff",r.fillRect(0,0,t.width,t.height)),r.drawImage(this.$clone[0],o.x,o.y,o.width,o.height,0,0,t.width,t.height),s=a.toDataURL(i,n)),s},setDragMode:function(e){var t=this.$canvas,i=this.defaults,n=a,o=a;if(this.built&&!this.disabled){switch(e){case"crop":i.dragCrop&&(n=r,t.data(c,e));break;case"move":o=r,t.data(c,e);break;default:t.removeData(c)}t.toggleClass(b,n).toggleClass(y,o)}},enable:function(){this.built&&(this.disabled=a,this.$cropper.removeClass(w))},disable:function(){this.built&&(this.disabled=r,this.$cropper.addClass(w))},rotate:function(e){var t=this.image;e=q(e)||0,this.built&&0!==e&&!this.disabled&&this.defaults.rotatable&&this.support.canvas&&(this.rotated=r,e=t.rotate=(t.rotate+e)%360,this.replace(this.getRotatedDataURL(e),!0))},getRotatedDataURL:function(t){var i=e("<canvas>")[0],n=i.getContext("2d"),r=t*Math.PI/180,a=H(t)%180,o=a>90?180-a:a,s=o*Math.PI/180,l=this.originalImage,u=l.naturalWidth,c=l.naturalHeight,d=H(u*z(s)+c*B(s)),h=H(u*B(s)+c*z(s));return i.width=d,i.height=h,n.save(),n.translate(d/2,h/2),n.rotate(r),n.drawImage(this.$original[0],-u/2,-c/2,u,c),n.restore(),i.toDataURL()},zoom:function(e){var t,i,n,r=this.image;e=q(e),this.built&&e&&!this.disabled&&this.defaults.zoomable&&(t=r.width*(1+e),i=r.height*(1+e),n=t/r._width,n>10||(1>n&&(t=r._width,i=r._height),1>=n?this.setDragMode("crop"):this.setDragMode("move"),r.oldWidth=r.width,r.oldHeight=r.height,r.width=t,r.height=i,r.ratio=r.width/r.naturalWidth,this.renderImage("zoom")))},dblclick:function(){this.disabled||(this.$canvas.hasClass(b)?this.setDragMode("move"):this.setDragMode("crop"))},wheel:function(e){var t,i=e.originalEvent,n=117.25,r=5,a=166.66665649414062,o=.1;this.disabled||(e.preventDefault(),i.deltaY?(t=i.deltaY,t=t%r===0?t/r:t%n===0?t/n:t/a):t=i.wheelDelta?-i.wheelDelta/120:i.detail?i.detail/3:0,this.zoom(t*o))},dragstart:function(t){var i,n,o,s=t.originalEvent.touches,l=t;if(!this.disabled){if(s){if(o=s.length,o>1){if(!this.defaults.zoomable||2!==o)return;l=s[1],this.startX2=l.pageX,this.startY2=l.pageY,i="zoom"}l=s[0]}if(i=i||e(l.target).data(c),h.test(i)){if(t.preventDefault(),n=e.Event(D),this.$element.trigger(n),n.isDefaultPrevented())return;this.directive=i,this.cropping=a,this.startX=l.pageX,this.startY=l.pageY,"crop"===i&&(this.cropping=r,this.$canvas.addClass(m))}}},dragmove:function(t){var i,n,r=t.originalEvent.touches,a=t;if(!this.disabled){if(r){if(n=r.length,n>1){if(!this.defaults.zoomable||2!==n)return;a=r[1],this.endX2=a.pageX,this.endY2=a.pageY}a=r[0]}if(this.directive){if(t.preventDefault(),i=e.Event(T),this.$element.trigger(i),i.isDefaultPrevented())return;this.endX=a.pageX,this.endY=a.pageY,this.dragging()}}},dragend:function(t){var i;if(!this.disabled&&this.directive){if(t.preventDefault(),i=e.Event(O),this.$element.trigger(i),i.isDefaultPrevented())return;this.cropping&&(this.cropping=a,this.$canvas.toggleClass(m,this.cropped&&this.defaults.modal)),this.directive=""}},dragging:function(){var e,t=this.directive,i=this.image,n=this.cropper,o=n.width,s=n.height,l=this.dragger,u=l.width,c=l.height,d=l.left,h=l.top,p=d+u,f=h+c,m=r,v=this.defaults,y=v.aspectRatio,b={x:this.endX-this.startX,y:this.endY-this.startY};switch(y&&(b.X=b.y*y,b.Y=b.x/y),t){case"all":d+=b.x,h+=b.y;break;case"e":if(b.x>=0&&(p>=o||y&&(0>=h||f>=s))){m=a;break}u+=b.x,y&&(c=u/y,h-=b.Y/2),0>u&&(t="w",u=0);break;case"n":if(b.y<=0&&(0>=h||y&&(0>=d||p>=o))){m=a;break}c-=b.y,h+=b.y,y&&(u=c*y,d+=b.X/2),0>c&&(t="s",c=0);break;case"w":if(b.x<=0&&(0>=d||y&&(0>=h||f>=s))){m=a;break}u-=b.x,d+=b.x,y&&(c=u/y,h+=b.Y/2),0>u&&(t="e",u=0);break;case"s":if(b.y>=0&&(f>=s||y&&(0>=d||p>=o))){m=a;break}c+=b.y,y&&(u=c*y,d-=b.X/2),0>c&&(t="n",c=0);break;case"ne":if(y){if(b.y<=0&&(0>=h||p>=o)){m=a;break}c-=b.y,h+=b.y,u=c*y}else b.x>=0?o>p?u+=b.x:b.y<=0&&0>=h&&(m=a):u+=b.x,b.y<=0?h>0&&(c-=b.y,h+=b.y):(c-=b.y,h+=b.y);0>c&&(t="sw",c=0,u=0);break;case"nw":if(y){if(b.y<=0&&(0>=h||0>=d)){m=a;break}c-=b.y,h+=b.y,u=c*y,d+=b.X}else b.x<=0?d>0?(u-=b.x,d+=b.x):b.y<=0&&0>=h&&(m=a):(u-=b.x,d+=b.x),b.y<=0?h>0&&(c-=b.y,h+=b.y):(c-=b.y,h+=b.y);0>c&&(t="se",c=0,u=0);break;case"sw":if(y){if(b.x<=0&&(0>=d||f>=s)){m=a;break}u-=b.x,d+=b.x,c=u/y}else b.x<=0?d>0?(u-=b.x,d+=b.x):b.y>=0&&f>=s&&(m=a):(u-=b.x,d+=b.x),b.y>=0?s>f&&(c+=b.y):c+=b.y;0>u&&(t="ne",c=0,u=0);break;case"se":if(y){if(b.x>=0&&(p>=o||f>=s)){m=a;break}u+=b.x,c=u/y}else b.x>=0?o>p?u+=b.x:b.y>=0&&f>=s&&(m=a):u+=b.x,b.y>=0?s>f&&(c+=b.y):c+=b.y;0>u&&(t="nw",c=0,u=0);break;case"move":i.left+=b.x,i.top+=b.y,this.renderImage("move"),m=a;break;case"zoom":v.zoomable&&(this.zoom(function(e,t,i,n,r,a){return(P(r*r+a*a)-P(i*i+n*n))/P(e*e+t*t)}(i.width,i.height,H(this.startX-this.startX2),H(this.startY-this.startY2),H(this.endX-this.endX2),H(this.endY-this.endY2))),this.endX2=this.startX2,this.endY2=this.startY2);break;case"crop":b.x&&b.y&&(e=this.$cropper.offset(),d=this.startX-e.left,h=this.startY-e.top,u=l.minWidth,c=l.minHeight,b.x>0?b.y>0?t="se":(t="ne",h-=c):b.y>0?(t="sw",d-=u):(t="nw",d-=u,h-=c),this.cropped||(this.cropped=r,this.$dragger.removeClass(g)))}m&&(l.width=u,l.height=c,l.left=d,l.top=h,this.directive=t,this.renderDragger()),this.startX=this.endX,this.startY=this.endY}},I.TEMPLATE=function(e,t){return t=t.split(","),e.replace(/\d+/g,function(e){return t[e]})}('<0 6="5-container"><0 6="5-canvas"></0><0 6="5-dragger"><1 6="5-viewer"></1><1 6="5-8 8-h"></1><1 6="5-8 8-v"></1><1 6="5-face" 3-2="all"></1><1 6="5-7 7-e" 3-2="e"></1><1 6="5-7 7-n" 3-2="n"></1><1 6="5-7 7-w" 3-2="w"></1><1 6="5-7 7-s" 3-2="s"></1><1 6="5-4 4-e" 3-2="e"></1><1 6="5-4 4-n" 3-2="n"></1><1 6="5-4 4-w" 3-2="w"></1><1 6="5-4 4-s" 3-2="s"></1><1 6="5-4 4-ne" 3-2="ne"></1><1 6="5-4 4-nw" 3-2="nw"></1><1 6="5-4 4-sw" 3-2="sw"></1><1 6="5-4 4-se" 3-2="se"></1></0></0>',"div,span,directive,data,point,cropper,class,line,dashed"),I.DEFAULTS={aspectRatio:"auto",autoCropArea:.8,data:{},done:e.noop,preview:"",multiple:a,autoCrop:r,dragCrop:r,dashed:r,modal:r,movable:r,resizable:r,zoomable:r,rotatable:r,checkImageOrigin:r,minWidth:0,minHeight:0,maxWidth:l,maxHeight:l,build:o,built:o,dragstart:o,dragmove:o,dragend:o},I.setDefaults=function(t){e.extend(I.DEFAULTS,t)},I.other=e.fn.cropper,e.fn.cropper=function(t){var i,n=M(arguments,1);return this.each(function(){var r,a=e(this),o=a.data("cropper");o||a.data("cropper",o=new I(this,t)),"string"==typeof t&&e.isFunction(r=o[t])&&(i=r.apply(o,n))}),typeof i!==u?i:this},e.fn.cropper.Constructor=I,e.fn.cropper.setDefaults=I.setDefaults,e.fn.cropper.noConflict=function(){return e.fn.cropper=I.other,this}}),function(e){function t(e,t){return"function"==typeof e?e.call(t):e}function i(e){for(;e=e.parentNode;)if(e==document)return!0;return!1}function n(t,i){this.$element=e(t),this.options=i,this.enabled=!0,this.fixTitle()}n.prototype={show:function(){var i=this.getTitle();if(i&&this.enabled){var n=this.tip();n.find(".tipsy-inner")[this.options.html?"html":"text"](i),n[0].className="tipsy",n.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var r,a=e.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}),o=n[0].offsetWidth,s=n[0].offsetHeight,l=t(this.options.gravity,this.$element[0]);switch(l.charAt(0)){case"n":r={top:a.top+a.height+this.options.offset,left:a.left+a.width/2-o/2};break;case"s":r={top:a.top-s-this.options.offset,left:a.left+a.width/2-o/2};break;case"e":r={top:a.top+a.height/2-s/2,left:a.left-o-this.options.offset};break;case"w":extra_gap=0,e("body").css("position").length>0&&"relative"==e("body").css("position")&&e("#wpadminbar").length&&(extra_gap=e("#wpadminbar").height()),r={top:a.top+a.height/2-s/2-extra_gap,left:a.left+a.width+this.options.offset}}2==l.length&&("w"==l.charAt(1)?r.left=a.left+a.width/2-15:r.left=a.left+a.width/2-o+15),n.css(r).addClass("tipsy-"+l),n.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+l.charAt(0),this.options.className&&n.addClass(t(this.options.className,this.$element[0])),this.options.fade?n.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity}):n.css({visibility:"visible",opacity:this.options.opacity})}},hide:function(){this.options.fade?this.tip().stop().fadeOut(function(){e(this).remove()}):this.tip().remove()},fixTitle:function(){var e=this.$element;(e.attr("title")||"string"!=typeof e.attr("original-title"))&&e.attr("original-title",e.attr("title")||"").removeAttr("title")},getTitle:function(){var e,t=this.$element,i=this.options;this.fixTitle();var e,i=this.options;return"string"==typeof i.title?e=t.attr("title"==i.title?"original-title":i.title):"function"==typeof i.title&&(e=i.title.call(t[0])),e=(""+e).replace(/(^\s*|\s*$)/,""),e||i.fallback},tip:function(){return this.$tip||(this.$tip=e('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>'),this.$tip.data("tipsy-pointee",this.$element[0])),this.$tip},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled}},e.fn.tipsy=function(t){function i(i){var r=e.data(i,"tipsy");return r||(r=new n(i,e.fn.tipsy.elementOptions(i,t)),e.data(i,"tipsy",r)),r}function r(){var e=i(this);e.hoverState="in",0==t.delayIn?e.show():(e.fixTitle(),setTimeout(function(){"in"==e.hoverState&&e.show()},t.delayIn))}function a(){var e=i(this);e.hoverState="out",0==t.delayOut?e.hide():setTimeout(function(){"out"==e.hoverState&&e.hide()},t.delayOut)}if(t===!0)return this.data("tipsy");if("string"==typeof t){var o=this.data("tipsy");return o&&o[t](),this}if(t=e.extend({},e.fn.tipsy.defaults,t),t.live||this.each(function(){i(this)}),"manual"!=t.trigger){var s="hover"==t.trigger?"mouseenter":"focus",l="hover"==t.trigger?"mouseleave":"blur";t.live?e(document).on(s,this.selector,r).on(l,this.selector,a):this.bind(s,r).bind(l,a)}return this},e.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:!1,fallback:"",gravity:"n",html:!1,live:!1,offset:0,opacity:.8,title:"title",trigger:"hover"},e.fn.tipsy.revalidate=function(){e(".tipsy").each(function(){var t=e.data(this,"tipsy-pointee");t&&i(t)||e(this).remove()})},e.fn.tipsy.elementOptions=function(t,i){return e.metadata?e.extend({},i,e(t).metadata()):i},e.fn.tipsy.autoNS=function(){return e(this).offset().top>e(document).scrollTop()+e(window).height()/2?"s":"n"},e.fn.tipsy.autoWE=function(){return e(this).offset().left>e(document).scrollLeft()+e(window).width()/2?"e":"w"},e.fn.tipsy.autoBounds=function(t,i){return function(){var n={ns:i[0],ew:i.length>1?i[1]:!1},r=e(document).scrollTop()+t,a=e(document).scrollLeft()+t,o=e(this);return o.offset().top<r&&(n.ns="n"),o.offset().left<a&&(n.ew="w"),e(window).width()+e(document).scrollLeft()-o.offset().left<t&&(n.ew="e"),e(window).height()+e(document).scrollTop()-o.offset().top<t&&(n.ns="s"),n.ns+(n.ew?n.ew:"")}}}(jQuery);var live_field,live_value,xhrValidateUsername=!1;jQuery(document).ready(function(){2==jQuery("input[data-key=user_password],input[data-key=confirm_user_password]").length&&UM_check_password_matched()}),jQuery(function(){jQuery(".um-search form *").keypress(function(e){return 13==e.which?(jQuery(".um-search form").submit(),!1):void 0}),jQuery(document).on("touchend",function(){})}),jQuery(window).load(function(){um_responsive(),um_modal_responsive()}),jQuery(window).resize(function(){responsive_Modal(),jQuery("img.cropper-hidden").cropper("destroy"),
8
+ um_responsive(),um_modal_responsive()}),jQuery(document).ready(function(){jQuery(document).on("input change",".um-field input[type=text]",function(){live_field=jQuery(this).parents(".um-field").data("key"),live_value=jQuery(this).val(),um_conditional()}),jQuery(".um-field input[type=text]").trigger("input"),jQuery(document).on("change",".um-field select, .um-field input[type=radio], .um-field input[type=checkbox]",function(){live_field=jQuery(this).parents(".um-field").data("key"),live_value=jQuery(this).val(),jQuery(this).is(":checkbox")&&(jQuery(this).parents(".um-field").find("input:checked").length>1?(live_value="",jQuery(this).parents(".um-field").find("input:checked").each(function(){live_value=live_value+jQuery(this).val()+" "})):live_value=jQuery(this).parents(".um-field").find("input:checked").val()),jQuery(this).is(":radio")&&(live_value=jQuery(this).parents(".um-field").find("input[type=radio]:checked").val()),um_conditional()}),jQuery(".um-field select, .um-field input[type=radio], .um-field input[type=checkbox]").trigger("change")}),jQuery(document).ready(function(){jQuery(document).on("click",".um-dropdown a",function(e){return!1}),jQuery(document).on("click",".um-dropdown a.real_url",function(e){window.location=jQuery(this).attr("href")}),jQuery(document).on("click",".um-trigger-menu-on-click",function(e){return jQuery(".um-dropdown").hide(),menu=jQuery(this).find(".um-dropdown"),menu.show(),!1}),jQuery(document).on("click",".um-dropdown-hide",function(e){UM_hide_menus()}),jQuery(document).on("click","a.um-manual-trigger",function(){var e=jQuery(this).attr("data-child"),t=jQuery(this).attr("data-parent");jQuery(this).parents(t).find(e).trigger("click")}),jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,live:"a.live",offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,live:"a.live",offset:3}),jQuery(document).on("change",".um-field-area input[type=radio]",function(){var e=jQuery(this).parents(".um-field-area"),t=jQuery(this).parents("label");e.find(".um-field-radio").removeClass("active"),e.find(".um-field-radio").find("i").removeClass().addClass("um-icon-android-radio-button-off"),t.addClass("active"),t.find("i").removeClass().addClass("um-icon-android-radio-button-on")}),jQuery(document).on("change",".um-field-area input[type=checkbox]",function(){var e=(jQuery(this).parents(".um-field-area"),jQuery(this).parents("label"));e.hasClass("active")?(e.removeClass("active"),e.find("i").removeClass().addClass("um-icon-android-checkbox-outline-blank")):(e.addClass("active"),e.find("i").removeClass().addClass("um-icon-android-checkbox-outline"))}),jQuery(".um-datepicker").each(function(){if(elem=jQuery(this),""!=elem.attr("data-disabled_weekdays"))var e=JSON.parse(elem.attr("data-disabled_weekdays"));else var e=!1;var t=elem.attr("data-years"),i=elem.attr("data-date_min"),n=elem.attr("data-date_max"),r=i.split(","),a=n.split(","),o=r.length?new Date(r):null,s=r.length?new Date(a):null;if(o&&"Invalid Date"==o.toString()&&3==r.length){var l=r[1]+"/"+r[2]+"/"+r[0];o=new Date(Date.parse(l))}if(s&&"Invalid Date"==s.toString()&&3==a.length){var u=a[1]+"/"+a[2]+"/"+a[0];s=new Date(Date.parse(u))}elem.pickadate({selectYears:t,min:o,max:s,disable:e,format:elem.attr("data-format"),formatSubmit:"yyyy/mm/dd",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})}),jQuery(".um-timepicker").each(function(){elem=jQuery(this),elem.pickatime({format:elem.attr("data-format"),interval:parseInt(elem.attr("data-intervals")),formatSubmit:"HH:i",hiddenName:!0,onOpen:function(){elem.blur()},onClose:function(){elem.blur()}})}),jQuery(".um-rating").raty({half:!1,starType:"i",number:function(){return jQuery(this).attr("data-number")},score:function(){return jQuery(this).attr("data-score")},scoreName:function(){return jQuery(this).attr("data-key")},hints:!1,click:function(e,t){live_field=this.id,live_value=e,um_conditional()}}),jQuery(".um-rating-readonly").raty({half:!1,starType:"i",number:function(){return jQuery(this).attr("data-number")},score:function(){return jQuery(this).attr("data-score")},scoreName:function(){return jQuery(this).attr("data-key")},hints:!1,readOnly:!0}),jQuery(document).on("click",".um .um-single-image-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field"),i=jQuery(this).parents(".um-field").find(".um-single-image-preview img").attr("src");return t.find(".um-single-image-preview img").attr("src",""),t.find(".um-single-image-preview").hide(),t.find(".um-btn-auto-width").html("Upload"),t.find("input[type=hidden]").val(""),jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_remove_file",src:i}}),!1}),jQuery(document).on("click",".um .um-single-file-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field"),i=jQuery(this).parents(".um-field").find(".um-single-fileinfo a").attr("href");return t.find(".um-single-file-preview").hide(),t.find(".um-btn-auto-width").html("Upload"),t.find("input[type=hidden]").val(""),jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_remove_file",src:i}}),!1}),jQuery(".um-s1,.um-s2").css({display:"block"}),jQuery(".um-s1").select2({allowClear:!0}),jQuery(".um-s2").select2({allowClear:!1,minimumResultsForSearch:10}),jQuery(document).on("click",".um-field-group-head:not(.disabled)",function(){var e=jQuery(this).parents(".um-field-group"),t=e.data("max_entries");e.find(".um-field-group-body").is(":hidden")?e.find(".um-field-group-body").show():e.find(".um-field-group-body:first").clone().appendTo(e),increase_id=0,e.find(".um-field-group-body").each(function(){increase_id++,jQuery(this).find("input").each(function(){var e=jQuery(this);e.attr("id",e.data("key")+"-"+increase_id),e.attr("name",e.data("key")+"-"+increase_id),e.parent().parent().find("label").attr("for",e.data("key")+"-"+increase_id)})}),t>0&&e.find(".um-field-group-body").length==t&&jQuery(this).addClass("disabled")}),jQuery(document).on("click",".um-field-group-cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-field-group"),i=t.data("max_entries");return t.find(".um-field-group-body").length>1?jQuery(this).parents(".um-field-group-body").remove():jQuery(this).parents(".um-field-group-body").hide(),i>0&&t.find(".um-field-group-body").length<i&&t.find(".um-field-group-head").removeClass("disabled"),!1}),jQuery(document).on("click",".um-ajax-paginate",function(e){e.preventDefault();var t=jQuery(this).parent();t.addClass("loading");var i=jQuery(this).data("args"),n=jQuery(this).data("hook"),r=jQuery(this).parents(".um").find(".um-ajax-items");return jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_ajax_paginate",hook:n,args:i},complete:function(){t.removeClass("loading")},success:function(e){t.remove(),r.append(e)}}),!1}),jQuery(document).on("click",".um-ajax-action",function(e){e.preventDefault();var t=jQuery(this).data("hook"),i=jQuery(this).data("user_id"),n=jQuery(this).data("arguments");return jQuery(this).data("js-remove")&&jQuery(this).parents("."+jQuery(this).data("js-remove")).fadeOut("fast"),jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_muted_action",hook:t,user_id:i,arguments:n},success:function(e){}}),!1}),jQuery(document).on("click","#um-search-button",function(){jQuery(this).parents("form").submit()})}),jQuery(document).ready(function(){jQuery(".um-members").each(function(){UM_Member_Grid(jQuery(this))}),jQuery(".um-member-connect").each(function(){0==jQuery(this).find("a").length&&jQuery(this).remove()}),jQuery(".um-member-meta-main").each(function(){0==jQuery(this).find(".um-member-metaline").length&&0==jQuery(this).find(".um-member-connect").find("a").length&&jQuery(this).remove()}),jQuery(document).on("click",".um-member-more a",function(e){e.preventDefault();var t=jQuery(this).parents(".um-member"),i=jQuery(this).parents(".um-members");return t.find(".um-member-more").hide(),t.find(".um-member-meta").slideDown(function(){UM_Member_Grid(i)}),t.find(".um-member-less").fadeIn(),setTimeout(function(){UM_Member_Grid(i)},100),!1}),jQuery(document).on("click",".um-member-less a",function(e){e.preventDefault();var t=jQuery(this).parents(".um-member"),i=jQuery(this).parents(".um-members");return t.find(".um-member-less").hide(),t.find(".um-member-meta").slideUp(function(){t.find(".um-member-more").fadeIn(),UM_Member_Grid(i)}),!1}),jQuery(document).on("click",".um-do-search",function(e){return e.preventDefault(),jQuery(this).parents("form").submit(),!1})}),jQuery(document).ready(function(){function e(){if("undefined"!=typeof jQuery("textarea[id=um-meta-bio]").val()){var e=jQuery("textarea[id=um-meta-bio]").attr("data-character-limit"),t=e-jQuery("textarea[id=um-meta-bio]").val().length;jQuery("span.um-meta-bio-character span.um-bio-limit").text(t),5>t?jQuery("span.um-meta-bio-character").css("color","red"):jQuery("span.um-meta-bio-character").css("color","")}}jQuery(".um-profile.um-viewing .um-profile-body .um-row").each(function(){var e=jQuery(this);0==e.find(".um-field").length&&(e.prev(".um-row-heading").remove(),e.remove())}),jQuery(".um-profile.um-viewing .um-profile-body").length&&0==jQuery(".um-profile.um-viewing .um-profile-body").find(".um-field").length&&(jQuery(".um-row-heading,.um-row").remove(),jQuery(".um-profile-note").show()),jQuery(document).on("click",".um-profile-save",function(e){return e.preventDefault(),jQuery(this).parents(".um").find("form").submit(),!1}),jQuery(document).on("click",".um-profile-edit-a",function(e){jQuery(this).addClass("active")}),jQuery(document).on("click",".um-cover a, .um-photo a",function(e){return e.preventDefault(),!1}),jQuery(document).on("click",".um-photo-modal",function(e){e.preventDefault();var t=jQuery(this).attr("data-src");return um_new_modal("um_view_photo","fit",!0,t),!1}),jQuery(document).on("click",".um-reset-profile-photo",function(e){jQuery(".um-profile-photo-img img").attr("src",jQuery(this).attr("data-default_src")),user_id=jQuery(this).attr("data-user_id"),metakey="profile_photo",jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_delete_profile_photo",metakey:metakey,user_id:user_id}})}),jQuery(document).on("click",".um-reset-cover-photo",function(e){jQuery(".um-cover-overlay").hide(),jQuery(".um-cover-e").html('<a href="#" class="um-cover-add um-manual-trigger" data-parent=".um-cover" data-child=".um-btn-auto-width"><span class="um-cover-add-i"><i class="um-icon-plus um-tip-n" title="Upload a cover photo"></i></span></a>'),jQuery(".um-dropdown").hide(),um_responsive(),user_id=jQuery(this).attr("data-user_id"),metakey="cover_photo",jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_delete_cover_photo",metakey:metakey,user_id:user_id}})}),e(),jQuery("textarea[id=um-meta-bio]").change(e),jQuery("textarea[id=um-meta-bio]").keyup(e)}),jQuery(document).ready(function(){var e=jQuery(".um-account-main").attr("data-current_tab");e&&jQuery(".um-account-tab[data-tab="+e+"]").show(),jQuery(document).on("click",".um-account-side li a",function(e){e.preventDefault();var t=jQuery(this);t.parents("ul").find("li a").removeClass("current"),t.addClass("current");var i=jQuery(this).attr("href"),n=jQuery(this).attr("data-tab");return jQuery("#_um_account_tab").val(n),window.history.pushState("","",i),jQuery(".um-account-tab").hide(),jQuery(".um-account-tab[data-tab="+n+"]").fadeIn(),jQuery(".um-account-nav a").removeClass("current"),jQuery(".um-account-nav a[data-tab="+n+"]").addClass("current"),!1}),jQuery(document).on("click",".um-account-nav a",function(e){e.preventDefault();var t=jQuery(this).attr("data-tab"),i=jQuery(this).parents("div"),n=jQuery(this);return jQuery(".um-account-tab").hide(),n.hasClass("current")?(i.next(".um-account-tab").slideUp(),n.removeClass("current")):(i.next(".um-account-tab").slideDown(),n.parents("div").find("a").removeClass("current"),n.addClass("current")),jQuery(".um-account-side li a").removeClass("current"),jQuery(".um-account-side li a[data-tab="+t+"]").addClass("current"),!1})});
core/um-actions-access.php CHANGED
@@ -473,6 +473,70 @@
473
$args = $ultimatemember->access->get_meta( $um_post_id );
474
extract( $args );
475
476
if ( !isset( $args['custom_access_settings'] ) || $args['custom_access_settings'] == 0 ) {
477
478
$um_post_id = apply_filters('um_access_control_for_parent_posts', $um_post_id );
473
$args = $ultimatemember->access->get_meta( $um_post_id );
474
extract( $args );
475
476
+ $categories = get_the_category( $post->ID );
477
+ // Check post category restriction
478
+ foreach( $categories as $cat ){
479
+
480
+ $opt = get_option("category_{$cat->term_id}");
481
+
482
+ if ( isset( $opt['_um_accessible'] ) ) {
483
+ switch( $opt['_um_accessible'] ) {
484
+
485
+ case 0: // Open to everyone
486
+ $ultimatemember->access->allow_access = true;
487
+ $ultimatemember->access->redirect_handler = false; // open to everyone
488
+ break;
489
+
490
+ case 1: // Logged out users only
491
+
492
+ if ( is_user_logged_in() )
493
+ $ultimatemember->access->redirect_handler = ( isset( $opt['_um_redirect'] ) ) ? $opt['_um_redirect'] : site_url();
494
+
495
+ if ( !is_user_logged_in() )
496
+ $ultimatemember->access->allow_access = true;
497
+
498
+ break;
499
+
500
+ case 2: // Logged in users only
501
+
502
+ if ( ! is_user_logged_in() ){
503
+ $ultimatemember->access->redirect_handler = ( isset( $opt['_um_redirect'] ) && ! empty( $opt['_um_redirect'] ) ) ? $opt['_um_redirect'] : um_get_core_page('login');
504
+ $ultimatemember->access->allow_access = false;
505
+ }
506
+
507
+ if ( is_user_logged_in() ){
508
+
509
+ if( isset( $opt['_um_roles'] ) && !empty( $opt['_um_roles'] ) ){
510
+
511
+ if ( in_array( um_user('role'), $opt['_um_roles'] ) ) {
512
+
513
+ $ultimatemember->access->allow_access = true;
514
+
515
+ }else{
516
+
517
+ $ultimatemember->access->redirect_handler = ( isset( $opt['_um_redirect'] ) && ! empty( $opt['_um_redirect'] ) ) ? $opt['_um_redirect'] : site_url();
518
+ $ultimatemember->access->allow_access = false;
519
+
520
+ }
521
+
522
+ }else{ // if allowed all roles
523
+ $ultimatemember->access->allow_access = true;
524
+ }
525
+
526
+ }
527
+
528
+ }
529
+
530
+
531
+ } // end if isset( $opt['_um_accessible'] )
532
+
533
+ // if one of the categories has enabled restriction, apply its settings to the current post
534
+ if( $ultimatemember->access->allow_access == false ){
535
+ return;
536
+ }
537
+
538
+ } // end foreach
539
+
540
if ( !isset( $args['custom_access_settings'] ) || $args['custom_access_settings'] == 0 ) {
541
542
$um_post_id = apply_filters('um_access_control_for_parent_posts', $um_post_id );
core/um-actions-account.php CHANGED
@@ -30,8 +30,8 @@
30
}
31
}
32
}
33
-
34
- $changes = array();
35
foreach( $_POST as $k => $v ) {
36
if ( !strstr( $k, 'password' ) && !strstr( $k, 'um_account' ) && in_array( $k, $arr_fields ) ) {
37
$changes[ $k ] = $v;
@@ -42,8 +42,8 @@
42
delete_user_meta( um_user('ID'), 'hide_in_members' );
43
unset( $changes['hide_in_members'] );
44
}
45
-
46
- // fired on account page, just before updating profile
47
do_action('um_account_pre_update_profile', $changes, um_user('ID') );
48
49
$ultimatemember->user->update_profile( $changes );
30
}
31
}
32
}
33
+
34
+ $changes = array();
35
foreach( $_POST as $k => $v ) {
36
if ( !strstr( $k, 'password' ) && !strstr( $k, 'um_account' ) && in_array( $k, $arr_fields ) ) {
37
$changes[ $k ] = $v;
42
delete_user_meta( um_user('ID'), 'hide_in_members' );
43
unset( $changes['hide_in_members'] );
44
}
45
+
46
+ // fired on account page, just before updating profile
47
do_action('um_account_pre_update_profile', $changes, um_user('ID') );
48
49
$ultimatemember->user->update_profile( $changes );
core/um-actions-ajax.php CHANGED
@@ -5,8 +5,12 @@
5
***/
6
add_action('wp_head','ultimatemember_ajax_urls');
7
add_action('admin_head','ultimatemember_ajax_urls');
8
- function ultimatemember_ajax_urls() { ?>
9
10
<script type="text/javascript">
11
12
var ultimatemember_image_upload_url = '<?php echo um_url . 'core/lib/upload/um-image-upload.php'; ?>';
@@ -16,7 +20,7 @@
16
</script>
17
18
<?php
19
-
20
}
21
22
/***
5
***/
6
add_action('wp_head','ultimatemember_ajax_urls');
7
add_action('admin_head','ultimatemember_ajax_urls');
8
+ function ultimatemember_ajax_urls() {
9
10
+ $enable_ajax_urls = apply_filters("um_enable_ajax_urls", true );
11
+ if( $enable_ajax_urls ){
12
+ ?>
13
+
14
<script type="text/javascript">
15
16
var ultimatemember_image_upload_url = '<?php echo um_url . 'core/lib/upload/um-image-upload.php'; ?>';
20
</script>
21
22
<?php
23
+ }
24
}
25
26
/***
core/um-actions-form.php CHANGED
@@ -210,10 +210,14 @@
210
$ultimatemember->form->add_error($key, sprintf(__('Your %s must contain less than %s characters','ultimatemember'), $array['label'], $array['max_chars']) );
211
}
212
}
213
-
214
- if ( isset( $array['html'] ) && $array['html'] == 0 ) {
215
- if ( wp_strip_all_tags( $args[$key] ) != trim( $args[$key] ) ) {
216
- $ultimatemember->form->add_error($key, __('You can not use HTML tags here','ultimatemember') );
217
}
218
}
219
@@ -440,8 +444,8 @@
440
441
if ( isset( $args['description'] ) ) {
442
$max_chars = um_get_option('profile_bio_maxchars');
443
- if ( strlen( utf8_decode( $args['description'] ) ) > $max_chars && $max_chars ) {
444
- $ultimatemember->form->add_error('description', sprintf(__('Your user description must contain less than %s characters','ultimatemember'), $max_chars ) );
445
}
446
}
447
210
$ultimatemember->form->add_error($key, sprintf(__('Your %s must contain less than %s characters','ultimatemember'), $array['label'], $array['max_chars']) );
211
}
212
}
213
+
214
+ $profile_show_html_bio = um_get_option('profile_show_html_bio');
215
+
216
+ if( $profile_show_html_bio == 1 && $key !== "description" ){
217
+ if ( isset( $array['html'] ) && $array['html'] == 0 ) {
218
+ if ( wp_strip_all_tags( $args[$key] ) != trim( $args[$key] ) ) {
219
+ $ultimatemember->form->add_error($key, __('You can not use HTML tags here','ultimatemember') );
220
+ }
221
}
222
}
223
444
445
if ( isset( $args['description'] ) ) {
446
$max_chars = um_get_option('profile_bio_maxchars');
447
+ if ( strlen( utf8_decode( $args['description'] ) ) > $max_chars && $max_chars ) {
448
+ $ultimatemember->form->add_error('description', sprintf(__('Your user description must contain less than %s characters','ultimatemember'), $max_chars ) );
449
}
450
}
451
core/um-actions-members.php CHANGED
@@ -135,7 +135,7 @@
135
<?php _e('Jump to page:','ultimatemember'); ?>
136
137
<?php if ( um_members('pages_to_show') && is_array( um_members('pages_to_show') ) ) { ?>
138
- <select onChange="window.location.href=this.value" class="um-s1" style="width: 100px">
139
<?php foreach( um_members('pages_to_show') as $i ) { ?>
140
<option value="<?php echo $ultimatemember->permalinks->add_query( 'members_page', $i ); ?>" <?php selected($i, um_members('page')); ?>><?php printf(__('%s of %d','ultimatemember'), $i, um_members('total_pages') ); ?></option>
141
<?php } ?>
135
<?php _e('Jump to page:','ultimatemember'); ?>
136
137
<?php if ( um_members('pages_to_show') && is_array( um_members('pages_to_show') ) ) { ?>
138
+ <select onChange="window.location.href=this.value" class="um-s2" style="width: 100px">
139
<?php foreach( um_members('pages_to_show') as $i ) { ?>
140
<option value="<?php echo $ultimatemember->permalinks->add_query( 'members_page', $i ); ?>" <?php selected($i, um_members('page')); ?>><?php printf(__('%s of %d','ultimatemember'), $i, um_members('total_pages') ); ?></option>
141
<?php } ?>
core/um-actions-profile.php CHANGED
@@ -381,20 +381,10 @@
381
382
<div class="um-meta-text">
383
<?php
384
- $allowed_tags = array(
385
- 'a' => array(
386
- 'href' => array(),
387
- 'title' => array()
388
- ),
389
- 'br' => array(),
390
- 'em' => array(),
391
- 'strong' => array(),
392
- );
393
394
$description = get_user_meta( um_user('ID') , 'description', true);
395
-
396
- if( um_get_option( 'profile_show_html_bio' ) ) : ?>
397
- <?php echo make_clickable( wp_kses( $description, $allowed_tags) ); ?>
398
<?php else : ?>
399
<?php echo esc_html( $description ); ?>
400
<?php endif; ?>
@@ -405,8 +395,10 @@
405
<div class="um-meta-text">
406
<textarea id="um-meta-bio" data-character-limit="<?php echo um_get_option('profile_bio_maxchars'); ?>" placeholder="<?php _e('Tell us a bit about yourself...','ultimatemember'); ?>" name="<?php echo 'description-' . $args['form_id']; ?>" id="<?php echo 'description-' . $args['form_id']; ?>"><?php if ( um_user('description') ) { echo um_user('description'); } ?></textarea>
407
<span class="um-meta-bio-character um-right"><span class="um-bio-limit"><?php echo um_get_option('profile_bio_maxchars'); ?></span></span>
408
- <?php if ( $ultimatemember->fields->is_error('description') ) {
409
- echo $ultimatemember->fields->field_error( $ultimatemember->fields->show_error('description'), true ); }
410
?>
411
412
</div>
@@ -683,25 +675,25 @@
683
684
</div>
685
686
- <?php foreach( $tabs as $id => $tab ) {
687
688
- if ( isset( $tab['subnav'] ) && $active_tab == $id ) {
689
690
- $active_subnav = ( $ultimatemember->profile->active_subnav() ) ? $ultimatemember->profile->active_subnav() : $tab['subnav_default'];
691
692
- echo '<div class="um-profile-subnav">';
693
- foreach( $tab['subnav'] as $id => $subtab ) {
694
695
- ?>
696
697
- <a href="<?php echo add_query_arg('subnav', $id ); ?>" class="<?php if ( $active_subnav == $id ) echo 'active'; ?>"><?php echo $subtab; ?></a>
698
699
- <?php
700
701
}
702
- echo '</div>';
703
- }
704
705
- }
706
707
}
381
382
<div class="um-meta-text">
383
<?php
384
385
$description = get_user_meta( um_user('ID') , 'description', true);
386
+ if( um_get_option( 'profile_show_html_bio' ) ) : ?>
387
+ <?php echo make_clickable( wpautop( wp_kses_post( $description ) ) ); ?>
388
<?php else : ?>
389
<?php echo esc_html( $description ); ?>
390
<?php endif; ?>
395
<div class="um-meta-text">
396
<textarea id="um-meta-bio" data-character-limit="<?php echo um_get_option('profile_bio_maxchars'); ?>" placeholder="<?php _e('Tell us a bit about yourself...','ultimatemember'); ?>" name="<?php echo 'description-' . $args['form_id']; ?>" id="<?php echo 'description-' . $args['form_id']; ?>"><?php if ( um_user('description') ) { echo um_user('description'); } ?></textarea>
397
<span class="um-meta-bio-character um-right"><span class="um-bio-limit"><?php echo um_get_option('profile_bio_maxchars'); ?></span></span>
398
+ <?php
399
+ if ( $ultimatemember->fields->is_error('description') ) {
400
+ echo $ultimatemember->fields->field_error( $ultimatemember->fields->show_error('description'), true );
401
+ }
402
?>
403
404
</div>
675
676
</div>
677
678
+ <?php foreach( $tabs as $id => $tab ) {
679
680
+ if ( isset( $tab['subnav'] ) && $active_tab == $id ) {
681
682
+ $active_subnav = ( $ultimatemember->profile->active_subnav() ) ? $ultimatemember->profile->active_subnav() : $tab['subnav_default'];
683
684
+ echo '<div class="um-profile-subnav">';
685
+ foreach( $tab['subnav'] as $id => $subtab ) {
686
687
+ ?>
688
689
+ <a href="<?php echo add_query_arg('subnav', $id ); ?>" class="<?php if ( $active_subnav == $id ) echo 'active'; ?>"><?php echo $subtab; ?></a>
690
691
+ <?php
692
693
+ }
694
+ echo '</div>';
695
}
696
697
+ }
698
699
}
core/um-fields.php CHANGED
@@ -69,6 +69,10 @@ class UM_Fields {
69
echo '</div>';
70
}
71
72
/***
73
*** @update a field globally
74
***/
@@ -484,7 +488,7 @@ class UM_Fields {
484
} else {
485
486
if ( !isset( $ultimatemember->form->post_form ) ) {
487
-
488
if ( um_user( $key ) && $this->editing == true ) {
489
490
if ( strstr($key, 'role_') ) {
@@ -909,12 +913,17 @@ class UM_Fields {
909
if ( !isset( $data['type'] ) ) return;
910
911
if ( isset( $data['in_group'] ) && $data['in_group'] != '' && $rule != 'group' ) return;
912
913
- if ( $visibility == 'view' ) return;
914
915
if ( !um_can_view_field( $data ) ) return;
916
if ( !um_can_edit_field( $data ) ) return;
917
918
// fields that need to be disabled in edit mode (profile)
919
$arr_restricted_fields = array('user_email','username','user_login','user_password');
920
@@ -982,9 +991,16 @@ class UM_Fields {
982
983
}
984
985
- $output .= '<input '.$disabled.' class="'.$this->get_class($key, $data).'" type="'.$input.'" name="'.$key.$ultimatemember->form->form_suffix.'" id="'.$key.$ultimatemember->form->form_suffix.'" value="'. htmlspecialchars( $this->field_value( $key, $default, $data ) ) .'" placeholder="'.$placeholder.'" data-validate="'.$validate.'" data-key="'.$key.'" />
986
987
</div>';
988
989
if ( $this->is_error($key) ) {
990
$output .= $this->field_error( $this->show_error($key) );
@@ -1010,9 +1026,16 @@ class UM_Fields {
1010
1011
}
1012
1013
- $output .= '<input '.$disabled.' class="'.$this->get_class($key, $data).'" type="'.$input.'" name="'.$key.$ultimatemember->form->form_suffix.'" id="'.$key.$ultimatemember->form->form_suffix.'" value="'. htmlspecialchars( $this->field_value( $key, $default, $data ) ) .'" placeholder="'.$placeholder.'" data-validate="'.$validate.'" data-key="'.$key.'" />
1014
1015
</div>';
1016
1017
if ( $this->is_error($key) ) {
1018
$output .= $this->field_error( $this->show_error($key) );
@@ -1195,7 +1218,7 @@ class UM_Fields {
1195
1196
}
1197
1198
- $output .= '<input class="'.$this->get_class($key, $data).'" type="'.$input.'" name="'.$key.$ultimatemember->form->form_suffix.'" id="'.$key.$ultimatemember->form->form_suffix.'" value="'. $this->field_value( $key, $default, $data ) .'" placeholder="'.$placeholder.'" data-validate="'.$validate.'" data-key="'.$key.'" />
1199
1200
</div>';
1201
@@ -1223,7 +1246,7 @@ class UM_Fields {
1223
1224
}
1225
1226
- $output .= '<input class="'.$this->get_class($key, $data).'" type="'.$input.'" name="'.$key.$ultimatemember->form->form_suffix.'" id="'.$key.$ultimatemember->form->form_suffix.'" value="'. $this->field_value( $key, $default, $data ) .'" placeholder="'.$placeholder.'" data-validate="'.$validate.'" data-key="'.$key.'" data-range="'.$range.'" data-years="'.$years.'" data-years_x="'.$years_x.'" data-disabled_weekdays="'.$disabled_weekdays.'" data-date_min="'.$date_min.'" data-date_max="'.$date_max.'" data-format="'.$js_format.'" data-value="'. $this->field_value( $key, $default, $data ) .'" />
1227
1228
</div>';
1229
@@ -1251,7 +1274,7 @@ class UM_Fields {
1251
1252
}
1253
1254
- $output .= '<input class="'.$this->get_class($key, $data).'" type="'.$input.'" name="'.$key.$ultimatemember->form->form_suffix.'" id="'.$key.$ultimatemember->form->form_suffix.'" value="'. $this->field_value( $key, $default, $data ) .'" placeholder="'.$placeholder.'" data-validate="'.$validate.'" data-key="'.$key.'" data-format="'.$js_format.'" data-intervals="'.$intervals.'" data-value="'. $this->field_value( $key, $default, $data ) .'" />
1255
1256
</div>';
1257
@@ -1276,6 +1299,8 @@ class UM_Fields {
1276
}
1277
1278
$output .= '<div class="um-field-area">';
1279
1280
if ( isset( $data['html'] ) && $data['html'] != 0 && $key != "description" ) {
1281
@@ -1287,27 +1312,35 @@ class UM_Fields {
1287
'editor_height' => $height,
1288
'tinymce'=> array(
1289
'toolbar1' => 'formatselect,bullist,numlist,bold,italic,underline,forecolor,blockquote,hr,removeformat,link,unlink,undo,redo',
1290
- 'toolbar2' => ''
1291
)
1292
);
1293
1294
$textarea_settings = apply_filters('um_form_fields_textarea_settings', $textarea_settings );
1295
1296
// turn on the output buffer
1297
ob_start();
1298
1299
// echo the editor to the buffer
1300
- wp_editor( $this->field_value( $key, $default, $data ) , $key, $textarea_settings );
1301
1302
// add the contents of the buffer to the output variable
1303
$output .= ob_get_clean();
1304
1305
}
1306
- else $output .= '<textarea style="height: '.$height.';" class="'.$this->get_class($key, $data).'" name="'.$key.'" id="'.$key.'" placeholder="'.$placeholder.'">'.$this->field_value( $key, $default, $data ).'</textarea>';
1307
1308
$output .= '
1309
</div>';
1310
1311
if ( $this->is_error($key) ) {
1312
$output .= $this->field_error( $this->show_error($key) );
1313
}
@@ -1544,7 +1577,7 @@ class UM_Fields {
1544
1545
$output .= '<div class="um-field-area">';
1546
1547
- $output .= '<select name="'.$form_key.'" id="'.$form_key.'" data-validate="'.$validate.'" data-key="'.$key.'" class="'.$this->get_class($key, $data, $class).'" style="width: 100%" data-placeholder="'.$placeholder.'">';
1548
1549
if ( isset($options) && $options == 'builtin'){
1550
$options = $ultimatemember->builtin->get ( $filter );
@@ -1580,41 +1613,54 @@ class UM_Fields {
1580
1581
// add an empty option!
1582
$output .= '<option value=""></option>';
1583
1584
- // add options
1585
foreach($options as $k => $v) {
1586
1587
$v = rtrim($v);
1588
1589
- if ( !is_numeric( $k ) && in_array($form_key, array('role') ) ) {
1590
$option_value = $k;
1591
- } else {
1592
- $option_value = $v;
1593
}
1594
-
1595
if ( isset( $options_pair ) ) {
1596
$option_value = $k;
1597
}
1598
1599
- $um_field_checkbox_item_title = $option_value;
1600
-
1601
$option_value = apply_filters('um_field_non_utf8_value',$option_value );
1602
1603
$output .= '<option value="' . $option_value . '" ';
1604
1605
- if ( $this->is_selected( $form_key, $option_value, $data ) || $this->is_selected( $form_key, $v, $data ) ) {
1606
$output.= 'selected';
1607
}
1608
-
1609
-
1610
$output .= '>'.__( $um_field_checkbox_item_title, UM_TEXTDOMAIN).'</option>';
1611
1612
}
1613
1614
$output .= '</select>';
1615
1616
$output .= '</div>';
1617
1618
if ( $this->is_error($form_key) ) {
1619
$output .= $this->field_error( $this->show_error($form_key) );
1620
}
@@ -1639,10 +1685,13 @@ class UM_Fields {
1639
$output .= $this->field_label($label, $key, $data);
1640
}
1641
1642
$output .= '<div class="um-field-area">';
1643
1644
- $output .= '<select multiple="multiple" name="'.$key.'[]" id="'.$key.'" data-maxsize="'. $max_selections . '" data-validate="'.$validate.'" data-key="'.$key.'" class="'.$this->get_class($key, $data, $class).'" style="width: 100%" data-placeholder="'.$placeholder.'">';
1645
1646
if ( isset($options) && $options == 'builtin'){
1647
$options = $ultimatemember->builtin->get ( $filter );
1648
}
@@ -1659,36 +1708,48 @@ class UM_Fields {
1659
1660
// add an empty option!
1661
$output .= '<option value=""></option>';
1662
-
1663
- // add options
1664
foreach( $options as $k => $v ) {
1665
1666
$v = rtrim( $v );
1667
1668
- $use_keyword = apply_filters('um_multiselect_option_value', 0, $data['type'] );
1669
-
1670
- if ( $use_keyword ) {
1671
$opt_value = $k;
1672
- } else {
1673
- $opt_value = $v;
1674
}
1675
1676
- $um_field_checkbox_item_title = $opt_value;
1677
-
1678
$opt_value = apply_filters('um_field_non_utf8_value',$opt_value );
1679
1680
$output .= '<option value="'.$opt_value.'" ';
1681
if ( $this->is_selected( $key, $opt_value, $data ) ) {
1682
$output .= 'selected';
1683
}
1684
- $output .= '>'.__( $um_field_checkbox_item_title ,UM_TEXTDOMAIN).'</option>';
1685
1686
}
1687
1688
$output .= '</select>';
1689
1690
$output .= '</div>';
1691
1692
if ( $this->is_error($key) ) {
1693
$output .= $this->field_error( $this->show_error( $key ) );
1694
}
@@ -1718,7 +1779,7 @@ class UM_Fields {
1718
if ( $form_key == 'role' ) {
1719
1720
global $wpdb;
1721
- foreach($options as $key => $val ) {
1722
$val = (string) $val;
1723
$val = trim( $val );
1724
$post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'um_role' AND post_title = '$val'");
@@ -1732,15 +1793,18 @@ class UM_Fields {
1732
1733
// add options
1734
$i = 0;
1735
1736
foreach($options as $k => $v) {
1737
1738
$v = rtrim($v);
1739
1740
if ( !is_numeric( $k ) && in_array($form_key, array('role') ) ) {
1741
$option_value = $k;
1742
- } else {
1743
- $option_value = $v;
1744
}
1745
1746
$i++;
@@ -1760,17 +1824,17 @@ class UM_Fields {
1760
1761
$output .= '<label class="um-field-radio '.$active.' um-field-half '.$col_class.'">';
1762
1763
- $um_field_checkbox_item_title = $option_value;
1764
-
1765
$option_value = apply_filters('um_field_non_utf8_value',$option_value );
1766
1767
- $output .= '<input type="radio" name="'.$form_key.'" value="'.$option_value.'" ';
1768
1769
if ( $this->is_radio_checked($key, $option_value, $data) ) {
1770
$output.= 'checked';
1771
}
1772
1773
$output .= ' />';
1774
$output .= '<span class="um-field-radio-state"><i class="'.$class.'"></i></span>';
1775
$output .= '<span class="um-field-radio-option">'.__( $um_field_checkbox_item_title,UM_TEXTDOMAIN).'</span>';
1776
$output .= '</label>';
@@ -1781,6 +1845,12 @@ class UM_Fields {
1781
1782
}
1783
1784
$output .= '<div class="um-clear"></div>';
1785
1786
$output .= '</div>';
@@ -1836,7 +1906,7 @@ class UM_Fields {
1836
1837
$v = apply_filters('um_field_non_utf8_value', $v );
1838
1839
- $output .= '<input type="checkbox" name="'.$key.'[]" value="'.strip_tags( $v ).'" ';
1840
1841
if ( $this->is_selected($key, $v, $data) ) {
1842
$output.= 'checked';
@@ -1844,7 +1914,13 @@ class UM_Fields {
1844
1845
$output .= ' />';
1846
1847
$output .= '<span class="um-field-checkbox-state"><i class="'.$class.'"></i></span>';
1848
$output .= '<span class="um-field-checkbox-option">'. __( $um_field_checkbox_item_title ,UM_TEXTDOMAIN) .'</span>';
1849
$output .= '</label>';
1850
@@ -1858,6 +1934,7 @@ class UM_Fields {
1858
1859
$output .= '</div>';
1860
1861
if ( $this->is_error($key) ) {
1862
$output .= $this->field_error( $this->show_error($key) );
1863
}
69
echo '</div>';
70
}
71
72
+ function disabled_hidden_field( $key, $value ){
73
+ return '<input type="hidden" name="'.$key.'" value="'.esc_attr( $value ).'"/>';
74
+ }
75
+
76
/***
77
*** @update a field globally
78
***/
488
} else {
489
490
if ( !isset( $ultimatemember->form->post_form ) ) {
491
+
492
if ( um_user( $key ) && $this->editing == true ) {
493
494
if ( strstr($key, 'role_') ) {
913
if ( !isset( $data['type'] ) ) return;
914
915
if ( isset( $data['in_group'] ) && $data['in_group'] != '' && $rule != 'group' ) return;
916
+
917
+ if ( $visibility == 'view' && $this->set_mode != 'register' ) return;
918
919
+ if ( $visibility == 'view' && $this->set_mode == 'register' ){
920
+ $disabled = ' disabled="disabled" ';
921
+ }
922
923
if ( !um_can_view_field( $data ) ) return;
924
if ( !um_can_edit_field( $data ) ) return;
925
926
+
927
// fields that need to be disabled in edit mode (profile)
928
$arr_restricted_fields = array('user_email','username','user_login','user_password');
929
991
992
}
993
994
+ $field_name = $key.$ultimatemember->form->form_suffix;
995
+ $field_value = htmlspecialchars( $this->field_value( $key, $default, $data ) );
996
+
997
+ $output .= '<input '.$disabled.' class="'.$this->get_class($key, $data).'" type="'.$input.'" name="'.$field_name.'" id="'.$field_name.'" value="'. $field_value .'" placeholder="'.$placeholder.'" data-validate="'.$validate.'" data-key="'.$key.'" />
998
999
</div>';
1000
+
1001
+ if( ! empty( $disabled ) ){
1002
+ $output .= $this->disabled_hidden_field( $field_name, $field_value );
1003
+ }
1004
1005
if ( $this->is_error($key) ) {
1006
$output .= $this->field_error( $this->show_error($key) );
1026
1027
}
1028
1029
+ $field_name = $key.$ultimatemember->form->form_suffix;
1030
+ $field_value = htmlspecialchars( $this->field_value( $key, $default, $data ) );
1031
+
1032
+ $output .= '<input '.$disabled.' class="'.$this->get_class($key, $data).'" type="'.$input.'" name="'.$field_name.'" id="'.$field_name.'" value="'. $field_value .'" placeholder="'.$placeholder.'" data-validate="'.$validate.'" data-key="'.$key.'" />
1033
1034
</div>';
1035
+
1036
+ if( ! empty( $disabled ) ){
1037
+ $output .= $this->disabled_hidden_field( $field_name, $field_value );
1038
+ }
1039
1040
if ( $this->is_error($key) ) {
1041
$output .= $this->field_error( $this->show_error($key) );
1218
1219
}
1220
1221
+ $output .= '<input '.$disabled.' class="'.$this->get_class($key, $data).'" type="'.$input.'" name="'.$key.$ultimatemember->form->form_suffix.'" id="'.$key.$ultimatemember->form->form_suffix.'" value="'. $this->field_value( $key, $default, $data ) .'" placeholder="'.$placeholder.'" data-validate="'.$validate.'" data-key="'.$key.'" />
1222
1223
</div>';
1224
1246
1247
}
1248
1249
+ $output .= '<input '.$disabled.' class="'.$this->get_class($key, $data).'" type="'.$input.'" name="'.$key.$ultimatemember->form->form_suffix.'" id="'.$key.$ultimatemember->form->form_suffix.'" value="'. $this->field_value( $key, $default, $data ) .'" placeholder="'.$placeholder.'" data-validate="'.$validate.'" data-key="'.$key.'" data-range="'.$range.'" data-years="'.$years.'" data-years_x="'.$years_x.'" data-disabled_weekdays="'.$disabled_weekdays.'" data-date_min="'.$date_min.'" data-date_max="'.$date_max.'" data-format="'.$js_format.'" data-value="'. $this->field_value( $key, $default, $data ) .'" />
1250
1251
</div>';
1252
1274
1275
}
1276
1277
+ $output .= '<input '.$disabled.' class="'.$this->get_class($key, $data).'" type="'.$input.'" name="'.$key.$ultimatemember->form->form_suffix.'" id="'.$key.$ultimatemember->form->form_suffix.'" value="'. $this->field_value( $key, $default, $data ) .'" placeholder="'.$placeholder.'" data-validate="'.$validate.'" data-key="'.$key.'" data-format="'.$js_format.'" data-intervals="'.$intervals.'" data-value="'. $this->field_value( $key, $default, $data ) .'" />
1278
1279
</div>';
1280
1299
}
1300
1301
$output .= '<div class="um-field-area">';
1302
+ $field_name = $key;
1303
+ $field_value = $this->field_value( $key, $default, $data );
1304
1305
if ( isset( $data['html'] ) && $data['html'] != 0 && $key != "description" ) {
1306
1312
'editor_height' => $height,
1313
'tinymce'=> array(
1314
'toolbar1' => 'formatselect,bullist,numlist,bold,italic,underline,forecolor,blockquote,hr,removeformat,link,unlink,undo,redo',
1315
+ 'toolbar2' => '',
1316
)
1317
);
1318
1319
+ if( ! empty( $disabled ) ){
1320
+ $textarea_settings['tinymce']['readonly'] = true;
1321
+ }
1322
+
1323
$textarea_settings = apply_filters('um_form_fields_textarea_settings', $textarea_settings );
1324
1325
// turn on the output buffer
1326
ob_start();
1327
1328
// echo the editor to the buffer
1329
+ wp_editor( $field_value , $key, $textarea_settings );
1330
1331
// add the contents of the buffer to the output variable
1332
$output .= ob_get_clean();
1333
1334
}
1335
+ else $output .= '<textarea '.$disabled.' style="height: '.$height.';" class="'.$this->get_class($key, $data).'" name="'.$key.'" id="'.$key.'" placeholder="'.$placeholder.'">'.$field_value.'</textarea>';
1336
1337
$output .= '
1338
</div>';
1339
1340
+ if( ! empty( $disabled ) ){
1341
+ $output .= $this->disabled_hidden_field( $field_name, $field_value );
1342
+ }
1343
+
1344
if ( $this->is_error($key) ) {
1345
$output .= $this->field_error( $this->show_error($key) );
1346
}
1577
1578
$output .= '<div class="um-field-area">';
1579
1580
+ $output .= '<select '.$disabled.' name="'.$form_key.'" id="'.$form_key.'" data-validate="'.$validate.'" data-key="'.$key.'" class="'.$this->get_class($key, $data, $class).'" style="width: 100%" data-placeholder="'.$placeholder.'">';
1581
1582
if ( isset($options) && $options == 'builtin'){
1583
$options = $ultimatemember->builtin->get ( $filter );
1613
1614
// add an empty option!
1615
$output .= '<option value=""></option>';
1616
+
1617
+ $field_value = '';
1618
1619
+ // add options
1620
foreach($options as $k => $v) {
1621
1622
$v = rtrim($v);
1623
1624
+ $option_value = $v;
1625
+ $um_field_checkbox_item_title = $v;
1626
+
1627
+
1628
+ if ( ! is_numeric( $k ) && in_array($form_key, array('role') ) ) {
1629
$option_value = $k;
1630
+ $um_field_checkbox_item_title = $v;
1631
}
1632
+
1633
if ( isset( $options_pair ) ) {
1634
$option_value = $k;
1635
+ $um_field_checkbox_item_title = $v;
1636
}
1637
1638
$option_value = apply_filters('um_field_non_utf8_value',$option_value );
1639
1640
$output .= '<option value="' . $option_value . '" ';
1641
1642
+ if ( $this->is_selected( $form_key, $option_value, $data ) ) {
1643
+ $output.= 'selected';
1644
+ $field_value = $option_value;
1645
+ }else if( ! isset( $options_pair ) && $this->is_selected( $form_key, $v, $data ) ){
1646
$output.= 'selected';
1647
+ $field_value = $v;
1648
}
1649
+
1650
$output .= '>'.__( $um_field_checkbox_item_title, UM_TEXTDOMAIN).'</option>';
1651
1652
+
1653
}
1654
1655
+ if( ! empty( $disabled ) ){
1656
+ $output .= $this->disabled_hidden_field( $form_key, $field_value );
1657
+ }
1658
+
1659
$output .= '</select>';
1660
1661
$output .= '</div>';
1662
1663
+
1664
if ( $this->is_error($form_key) ) {
1665
$output .= $this->field_error( $this->show_error($form_key) );
1666
}
1685
$output .= $this->field_label($label, $key, $data);
1686
}
1687
1688
+ $use_keyword = apply_filters('um_multiselect_option_value', 0, $data['type'] );
1689
+
1690
$output .= '<div class="um-field-area">';
1691
1692
+ $output .= '<select '.$disabled.' multiple="multiple" name="'.$key.'[]" id="'.$key.'" data-maxsize="'. $max_selections . '" data-validate="'.$validate.'" data-key="'.$key.'" class="'.$this->get_class($key, $data, $class).' um-user-keyword_'.$use_keyword.'" style="width: 100%" data-placeholder="'.$placeholder.'">';
1693
1694
+
1695
if ( isset($options) && $options == 'builtin'){
1696
$options = $ultimatemember->builtin->get ( $filter );
1697
}
1708
1709
// add an empty option!
1710
$output .= '<option value=""></option>';
1711
+
1712
+ $arr_selected = array();
1713
+ // add options
1714
foreach( $options as $k => $v ) {
1715
1716
$v = rtrim( $v );
1717
1718
+ $um_field_checkbox_item_title = $v;
1719
+ $opt_value = $v;
1720
+
1721
+ if ( $use_keyword ) {
1722
+ $um_field_checkbox_item_title = $v;
1723
$opt_value = $k;
1724
}
1725
1726
+
1727
$opt_value = apply_filters('um_field_non_utf8_value',$opt_value );
1728
1729
$output .= '<option value="'.$opt_value.'" ';
1730
if ( $this->is_selected( $key, $opt_value, $data ) ) {
1731
+
1732
$output .= 'selected';
1733
+ $arr_selected[ $opt_value ] = $opt_value;
1734
}
1735
1736
+ $output .= '>'.__( $um_field_checkbox_item_title ,UM_TEXTDOMAIN).'</option>';
1737
+
1738
+
1739
+
1740
}
1741
1742
$output .= '</select>';
1743
1744
+ if( ! empty( $disabled ) && ! empty( $arr_selected ) ){
1745
+ foreach( $arr_selected as $item ){
1746
+ $output .= $this->disabled_hidden_field( $key.'[]', $item );
1747
+ }
1748
+ }
1749
+
1750
$output .= '</div>';
1751
1752
+
1753
if ( $this->is_error($key) ) {
1754
$output .= $this->field_error( $this->show_error( $key ) );
1755
}
1779
if ( $form_key == 'role' ) {
1780
1781
global $wpdb;
1782
+ foreach($options as $rkey => $val ) {
1783
$val = (string) $val;
1784
$val = trim( $val );
1785
$post_id = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE post_status = 'publish' AND post_type = 'um_role' AND post_title = '$val'");
1793
1794
// add options
1795
$i = 0;
1796
+ $field_value = array();
1797
1798
foreach($options as $k => $v) {
1799
1800
$v = rtrim($v);
1801
1802
+ $um_field_checkbox_item_title = $v;
1803
+ $option_value = $v;
1804
+
1805
if ( !is_numeric( $k ) && in_array($form_key, array('role') ) ) {
1806
+ $um_field_checkbox_item_title = $v;
1807
$option_value = $k;
1808
}
1809
1810
$i++;
1824
1825
$output .= '<label class="um-field-radio '.$active.' um-field-half '.$col_class.'">';
1826
1827
$option_value = apply_filters('um_field_non_utf8_value',$option_value );
1828
1829
+ $output .= '<input '.$disabled.' type="radio" name="'.$form_key.'[]" value="'.$option_value.'" ';
1830
1831
if ( $this->is_radio_checked($key, $option_value, $data) ) {
1832
$output.= 'checked';
1833
+ $field_value[ $key ] = $option_value;
1834
}
1835
1836
$output .= ' />';
1837
+
1838
$output .= '<span class="um-field-radio-state"><i class="'.$class.'"></i></span>';
1839
$output .= '<span class="um-field-radio-option">'.__( $um_field_checkbox_item_title,UM_TEXTDOMAIN).'</span>';
1840
$output .= '</label>';
1845
1846
}
1847
1848
+ if( ! empty( $disabled ) ){
1849
+ foreach( $field_value as $item ){
1850
+ $output .= $this->disabled_hidden_field( $form_key , $item );
1851
+ }
1852
+ }
1853
+
1854
$output .= '<div class="um-clear"></div>';
1855
1856
$output .= '</div>';
1906
1907
$v = apply_filters('um_field_non_utf8_value', $v );
1908
1909
+ $output .= '<input '.$disabled.' type="checkbox" name="'.$key.'[]" value="'.strip_tags( $v ).'" ';
1910
1911
if ( $this->is_selected($key, $v, $data) ) {
1912
$output.= 'checked';
1914
1915
$output .= ' />';
1916
1917
+ if( ! empty( $disabled ) && $this->is_selected($key, $v, $data) ){
1918
+ $output .= $this->disabled_hidden_field( $key.'[]', strip_tags( $v ) );
1919
+ }
1920
+
1921
+
1922
$output .= '<span class="um-field-checkbox-state"><i class="'.$class.'"></i></span>';
1923
+ $um_field_checkbox_item_title = apply_filters("um_field_checkbox_item_title", $um_field_checkbox_item_title , $key, $v, $data );
1924
$output .= '<span class="um-field-checkbox-option">'. __( $um_field_checkbox_item_title ,UM_TEXTDOMAIN) .'</span>';
1925
$output .= '</label>';
1926
1934
1935
$output .= '</div>';
1936
1937
+
1938
if ( $this->is_error($key) ) {
1939
$output .= $this->field_error( $this->show_error($key) );
1940
}
core/um-filters-fields.php CHANGED
@@ -13,15 +13,6 @@
13
return $label;
14
}
15
16
- /***
17
- *** @change birth date label in view
18
- ***/
19
- add_filter('um_view_label_birth_date', 'um_view_label_birth_date');
20
- function um_view_label_birth_date( $label ) {
21
- $label = __('Age','ultimatemember');
22
- return $label;
23
- }
24
-
25
/***
26
*** @outputs a soundcloud track
27
***/
13
return $label;
14
}
15
16
/***
17
*** @outputs a soundcloud track
18
***/
core/um-filters-members.php CHANGED
@@ -83,8 +83,18 @@
83
$operator = 'LIKE';
84
}
85
86
- if ( in_array( $ultimatemember->fields->get_field_type( $field ), array('checkbox','multiselect') ) ) {
87
$operator = 'LIKE';
88
}
89
90
if ( $value && $field != 'um_search' && $field != 'page_id' ) {
@@ -117,6 +127,7 @@
117
if ( count ($query_args['meta_query']) == 1 ) {
118
unset( $query_args['meta_query'] );
119
}
120
return $query_args;
121
122
}
83
$operator = 'LIKE';
84
}
85
86
+ $arr_filter_field_types = array('checkbox','multiselect');
87
+ $arr_field_types = apply_filters('um_search_filter_field_types', $arr_filter_field_types );
88
+
89
+ if ( in_array( $ultimatemember->fields->get_field_type( $field ), $arr_field_types ) ) {
90
$operator = 'LIKE';
91
+ if( ! empty( $value ) ){
92
+ $value = serialize( strval( $value ) );
93
+ }
94
+ }
95
+
96
+ if( in_array( $ultimatemember->fields->get_field_type( $field ) , array('select') ) ){
97
+ $operator = '=';
98
}
99
100
if ( $value && $field != 'um_search' && $field != 'page_id' ) {
127
if ( count ($query_args['meta_query']) == 1 ) {
128
unset( $query_args['meta_query'] );
129
}
130
+
131
return $query_args;
132
133
}
core/um-permalinks.php CHANGED
@@ -217,7 +217,7 @@ class UM_Permalinks {
217
*** @add a query param to url
218
***/
219
function add_query( $key, $value ) {
220
- $this->current_url = add_query_arg( $key, $value, $this->current_url );
221
return $this->current_url;
222
}
223
/***
217
*** @add a query param to url
218
***/
219
function add_query( $key, $value ) {
220
+ $this->current_url = add_query_arg( $key, $value, $this->get_current_url() );
221
return $this->current_url;
222
}
223
/***
core/um-register.php CHANGED
@@ -14,7 +14,13 @@ class UM_Register {
14
15
public function verify_nonce( $args ){
16
global $ultimatemember;
17
18
if ( ! wp_verify_nonce( $args['_wpnonce'], 'um_register_form' ) || empty( $args['_wpnonce'] ) || ! isset( $args['_wpnonce'] ) ) {
19
wp_die('Invalid Nonce.');
20
}
14
15
public function verify_nonce( $args ){
16
global $ultimatemember;
17
+
18
+ $allow_nonce_verification = apply_filters("um_register_allow_nonce_verification", true );
19
20
+ if( ! $allow_nonce_verification ){
21
+ return $args;
22
+ }
23
+
24
if ( ! wp_verify_nonce( $args['_wpnonce'], 'um_register_form' ) || empty( $args['_wpnonce'] ) || ! isset( $args['_wpnonce'] ) ) {
25
wp_die('Invalid Nonce.');
26
}
core/um-short-functions.php CHANGED
@@ -364,7 +364,7 @@ function um_user_ip() {
364
$v = um_user_uploads_uri() . $file;
365
}
366
367
- if ( !strstr( $k, 'user_pass' ) && $k != 'g-recaptcha-response' && $k != 'request' ) {
368
369
if ( is_array($v) ) {
370
$v = implode(',', $v );
@@ -1055,8 +1055,8 @@ function um_get_option($option_id) {
1055
global $ultimatemember;
1056
if ( !isset( $ultimatemember->options ) ) return '';
1057
$um_options = $ultimatemember->options;
1058
- if ( isset($um_options[$option_id]) && !empty( $um_options[$option_id] ) ) {
1059
- return $um_options[$option_id];
1060
}
1061
1062
switch($option_id){
@@ -1131,11 +1131,15 @@ function um_fetch_user( $user_id ) {
1131
***/
1132
function um_profile( $key ){
1133
global $ultimatemember;
1134
- if (isset( $ultimatemember->user->profile[$key] ) && !empty( $ultimatemember->user->profile[$key] ) ){
1135
- return $ultimatemember->user->profile[$key];
1136
} else {
1137
- return false;
1138
}
1139
}
1140
1141
/***
@@ -1291,8 +1295,10 @@ function um_fetch_user( $user_id ) {
1291
function um_get_default_cover_uri() {
1292
$uri = um_get_option('default_cover');
1293
$uri = $uri['url'];
1294
- if ( $uri )
1295
return $uri;
1296
return '';
1297
}
1298
364
$v = um_user_uploads_uri() . $file;
365
}
366
367
+ if ( !strstr( $k, 'user_pass' ) && ! in_array( $k, array('g-recaptcha-response','request','_wpnonce','_wp_http_referer') ) ) {
368
369
if ( is_array($v) ) {
370
$v = implode(',', $v );
1055
global $ultimatemember;
1056
if ( !isset( $ultimatemember->options ) ) return '';
1057
$um_options = $ultimatemember->options;
1058
+ if ( isset( $um_options[ $option_id ] ) && !empty( $um_options[ $option_id ] ) ) {
1059
+ return apply_filters("um_get_option_filter__{$option_id}", $um_options[ $option_id ] );
1060
}
1061
1062
switch($option_id){
1131
***/
1132
function um_profile( $key ){
1133
global $ultimatemember;
1134
+
1135
+ if (isset( $ultimatemember->user->profile[ $key ] ) && !empty( $ultimatemember->user->profile[ $key ] ) ){
1136
+ $value = apply_filters("um_profile_{$key}__filter", $ultimatemember->user->profile[ $key ] );
1137
} else {
1138
+ $value = apply_filters("um_profile_{$key}_empty__filter", false );
1139
}
1140
+
1141
+ return $value;
1142
+
1143
}
1144
1145
/***
1295
function um_get_default_cover_uri() {
1296
$uri = um_get_option('default_cover');
1297
$uri = $uri['url'];
1298
+ if ( $uri ){
1299
+ $uri = apply_filters('um_get_default_cover_uri_filter', $uri );
1300
return $uri;
1301
+ }
1302
return '';
1303
}
1304
core/um-user.php CHANGED
@@ -873,15 +873,16 @@ class UM_User {
873
global $ultimatemember;
874
875
$args['ID'] = $this->id;
876
-
877
$changes = apply_filters('um_before_update_profile', $changes, $this->id);
878
879
// save or update profile meta
880
foreach( $changes as $key => $value ) {
881
-
882
- if ( !in_array( $key, $this->update_user_keys ) ) {
883
-
884
- update_user_meta( $this->id, $key, $value );
885
886
} else {
887
@@ -890,10 +891,8 @@ class UM_User {
890
}
891
892
}
893
-
894
- // hook for name changes
895
- do_action('um_update_profile_full_name', $changes );
896
-
897
// update user
898
if ( count( $args ) > 1 ) {
899
wp_update_user( $args );
873
global $ultimatemember;
874
875
$args['ID'] = $this->id;
876
$changes = apply_filters('um_before_update_profile', $changes, $this->id);
877
878
+ // hook for name changes
879
+ do_action('um_update_profile_full_name', $changes );
880
+
881
// save or update profile meta
882
foreach( $changes as $key => $value ) {
883
+ if ( !in_array( $key, $this->update_user_keys ) ) {
884
+
885
+ update_user_meta( $this->id, $key, $value );
886
887
} else {
888
891
}
892
893
}
894
+
895
+
896
// update user
897
if ( count( $args ) > 1 ) {
898
wp_update_user( $args );
index.php CHANGED
@@ -3,7 +3,7 @@
3
Plugin Name: Ultimate Member
4
Plugin URI: http://ultimatemember.com/
5
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
6
- Version: 1.3.66
7
Author: Ultimate Member
8
Author URI: http://ultimatemember.com/
9
Text Domain: ultimatemember
3
Plugin Name: Ultimate Member
4
Plugin URI: http://ultimatemember.com/
5
Description: The easiest way to create powerful online communities and beautiful user profiles with WordPress
6
+ Version: 1.3.67
7
Author: Ultimate Member
8
Author URI: http://ultimatemember.com/
9
Text Domain: ultimatemember
readme.txt CHANGED
@@ -5,9 +5,9 @@ Contributors: ultimatemember, champsupertramp
5
Donate link:
6
Tags: access control, author, authors, author profile, comments, community, communities, conditional fields, conditional logic, conditional menus, content protection, custom fields, file uploads, form builder, front-end login, front-end registration, gravatar, hide wp-admin, login, login page, logged-in users, mandrill, member, members, membership, member directory, online users, profile, profiles, profile builder, registration, restriction, restrict content, role creation, role menus, search filters, sign in, sign up, social network, star ratings, toolbar, user, users, user fields, user profile, user-profile, user profiles, user roles
7
Requires at least: 4.1
8
- Tested up to: 4.5.3
9
10
- Stable Tag: 1.3.66
11
12
License: GNU Version 2 or Any Later Version
13
@@ -149,6 +149,30 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
149
150
== Changelog ==
151
152
= 1.3.66: July 14, 2016 =
153
154
* Tweak: update translation strings and English translation file.
5
Donate link:
6
Tags: access control, author, authors, author profile, comments, community, communities, conditional fields, conditional logic, conditional menus, content protection, custom fields, file uploads, form builder, front-end login, front-end registration, gravatar, hide wp-admin, login, login page, logged-in users, mandrill, member, members, membership, member directory, online users, profile, profiles, profile builder, registration, restriction, restrict content, role creation, role menus, search filters, sign in, sign up, social network, star ratings, toolbar, user, users, user fields, user profile, user-profile, user profiles, user roles
7
Requires at least: 4.1
8
+ Tested up to: 4.6
9
10
+ Stable Tag: 1.3.67
11
12
License: GNU Version 2 or Any Later Version
13
149
150
== Changelog ==
151
152
+ = 1.3.67: August 02, 2016 =
153
+
154
+ * New: allow non-editable fields in registration form
155
+ * Fixed: member directory mobile pagination
156
+ * Fixed: biography field validation in profile header and forms
157
+ * Fixed: remove override 'birth date' label
158
+ * Fixed: html support in biography field
159
+ * Fixed: select options search
160
+ * Fixed: select field's search query
161
+ * Fixed: search filters and multi-select fields
162
+ * Fixed: select, radio and checkbox field options
163
+ * Fixed: multiple select in UM settings
164
+ * Fixed: member directory's pagination links
165
+ * Fixed: remove nonce and http referer from submitted user details
166
+ * Fixed: disallow direct access link to posts with enabled category access restriction
167
+ * Added: new filter hook: `um_get_default_cover_uri_filter`
168
+ * Added: new filter hook: `um_register_allow_nonce_verification`
169
+ * Added: new filter hook: `um_get_option_filter__{$option_id}`
170
+ * Added: new filter hook: ` um_profile_{$key}__filter`
171
+ * Added: new filter hook: `um_profile_{$key}_empty__filter`
172
+ * Added: new filter hook `um_enable_ajax_urls`
173
+ * Added: new filter hook `um_field_checkbox_item_title`
174
+
175
+
176
= 1.3.66: July 14, 2016 =
177
178
* Tweak: update translation strings and English translation file.