Ultimate Member – User Profile & Membership Plugin - Version 1.3.38

Version Description

Download this release

Release Info

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

Code changes from version 1.3.37 to 1.3.38

admin/core/um-admin-builder.php CHANGED
@@ -230,8 +230,8 @@ class UM_Admin_Builder {
230
  <?php } else if ( isset($keyarray['icon']) && !empty( $keyarray['icon'] ) ) { ?>
231
  <i class="<?php echo $keyarray['icon']; ?>"></i>
232
  <?php } ?><?php echo $title; ?></div>
233
-
234
- <div class="um-admin-drag-fld-type um-field-type-<?php echo $type; ?>"><?php echo $ultimatemember->builtin->core_fields[$type]['name']; ?></div>
235
  <div class="um-admin-drag-fld-icons um-field-type-<?php echo $type; ?>">
236
 
237
  <a href="#" class="um-admin-tipsy-n" title="Edit" data-modal="UM_edit_field" data-modal-size="normal" data-dynamic-content="um_admin_edit_field_popup" data-arg1="<?php echo $type; ?>" data-arg2="<?php echo $this->form_id; ?>" data-arg3="<?php echo $key; ?>"><i class="um-faicon-pencil"></i></a>
230
  <?php } else if ( isset($keyarray['icon']) && !empty( $keyarray['icon'] ) ) { ?>
231
  <i class="<?php echo $keyarray['icon']; ?>"></i>
232
  <?php } ?><?php echo $title; ?></div>
233
+ <?php $field_name = isset( $ultimatemember->builtin->core_fields[$type]['name'] )?$ultimatemember->builtin->core_fields[$type]['name']:''; ?>
234
+ <div class="um-admin-drag-fld-type um-field-type-<?php echo $type; ?>"><?php echo $field_name; ?></div>
235
  <div class="um-admin-drag-fld-icons um-field-type-<?php echo $type; ?>">
236
 
237
  <a href="#" class="um-admin-tipsy-n" title="Edit" data-modal="UM_edit_field" data-modal-size="normal" data-dynamic-content="um_admin_edit_field_popup" data-arg1="<?php echo $type; ?>" data-arg2="<?php echo $this->form_id; ?>" data-arg3="<?php echo $key; ?>"><i class="um-faicon-pencil"></i></a>
assets/js/um-functions.js CHANGED
@@ -197,7 +197,7 @@ function um_conditional(){
197
  }
198
 
199
  function UM_check_password_matched() {
200
- jQuery(document).on('input[data-key=user_password],input[data-key=confirm_user_password]').on('keyup', function(e) {
201
  var value = jQuery('input[data-key=user_password]').val();
202
  var match = jQuery('input[data-key=confirm_user_password]').val();
203
  var field = jQuery('input[data-key=user_password],input[data-key=confirm_user_password]');
@@ -214,7 +214,7 @@ function UM_check_password_matched() {
214
 
215
  var xhrValidateUsername = false;
216
  function UM_check_username() {
217
- jQuery(document).on('input[data-key=user_login]').on('keyup', function() {
218
  var field = jQuery('input[data-key=user_login]');
219
  var value = field.val();
220
 
@@ -270,9 +270,11 @@ jQuery(document).ready(function(){
270
  UM_check_password_matched();
271
  }
272
 
 
273
  if(jQuery('input[data-key=user_login]').length) {
274
  UM_check_username();
275
  }
 
276
  });
277
 
278
  function UM_hide_menus() {
197
  }
198
 
199
  function UM_check_password_matched() {
200
+ jQuery(document).on('keyup', 'input[data-key=user_password],input[data-key=confirm_user_password]', function(e) {
201
  var value = jQuery('input[data-key=user_password]').val();
202
  var match = jQuery('input[data-key=confirm_user_password]').val();
203
  var field = jQuery('input[data-key=user_password],input[data-key=confirm_user_password]');
214
 
215
  var xhrValidateUsername = false;
216
  function UM_check_username() {
217
+ jQuery(document).on('keyup', 'input[data-key=user_login]:not([disabled=disabled])', function() {
218
  var field = jQuery('input[data-key=user_login]');
219
  var value = field.val();
220
 
270
  UM_check_password_matched();
271
  }
272
 
273
+ /*
274
  if(jQuery('input[data-key=user_login]').length) {
275
  UM_check_username();
276
  }
277
+ */
278
  });
279
 
280
  function UM_hide_menus() {
assets/js/um.min.js CHANGED
@@ -1,134 +1,7 @@
1
- !function(a){"undefined"==typeof a.fn.each2&&a.extend(a.fn,{each2:function(b){for(var c=a([0]),d=-1,e=this.length;++d<e&&(c.context=c[0]=this[d])&&b.call(c[0],d,c)!==!1;);return this}})}(jQuery),function(a,b){"use strict";function n(b){var c=a(document.createTextNode(""));b.before(c),c.before(b),c.remove()}function o(a){function b(a){return m[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function p(a,b){for(var c=0,d=b.length;d>c;c+=1)if(r(a,b[c]))return c;return-1}function q(){var b=a(l);b.appendTo("body");var c={width:b.width()-b[0].clientWidth,height:b.height()-b[0].clientHeight};return b.remove(),c}function r(a,c){return a===c?!0:a===b||c===b?!1:null===a||null===c?!1:a.constructor===String?a+""==c+"":c.constructor===String?c+""==a+"":!1}function s(b,c){var d,e,f;if(null===b||b.length<1)return[];for(d=b.split(c),e=0,f=d.length;f>e;e+=1)d[e]=a.trim(d[e]);return d}function t(a){return a.outerWidth(!1)-a.width()}function u(c){var d="keyup-change-value";c.on("keydown",function(){a.data(c,d)===b&&a.data(c,d,c.val())}),c.on("keyup",function(){var e=a.data(c,d);e!==b&&c.val()!==e&&(a.removeData(c,d),c.trigger("keyup-change"))})}function v(c){c.on("mousemove",function(c){var d=i;(d===b||d.x!==c.pageX||d.y!==c.pageY)&&a(c.target).trigger("mousemove-filtered",c)})}function w(a,c,d){d=d||b;var e;return function(){var b=arguments;window.clearTimeout(e),e=window.setTimeout(function(){c.apply(d,b)},a)}}function x(a,b){var c=w(a,function(a){b.trigger("scroll-debounced",a)});b.on("scroll",function(a){p(a.target,b.get())>=0&&c(a)})}function y(a){a[0]!==document.activeElement&&window.setTimeout(function(){var d,b=a[0],c=a.val().length;a.focus();var e=b.offsetWidth>0||b.offsetHeight>0;e&&b===document.activeElement&&(b.setSelectionRange?b.setSelectionRange(c,c):b.createTextRange&&(d=b.createTextRange(),d.collapse(!1),d.select()))},0)}function z(b){b=a(b)[0];var c=0,d=0;if("selectionStart"in b)c=b.selectionStart,d=b.selectionEnd-c;else if("selection"in document){b.focus();var e=document.selection.createRange();d=document.selection.createRange().text.length,e.moveStart("character",-b.value.length),c=e.text.length-d}return{offset:c,length:d}}function A(a){a.preventDefault(),a.stopPropagation()}function B(a){a.preventDefault(),a.stopImmediatePropagation()}function C(b){if(!h){var c=b[0].currentStyle||window.getComputedStyle(b[0],null);h=a(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:c.fontSize,fontFamily:c.fontFamily,fontStyle:c.fontStyle,fontWeight:c.fontWeight,letterSpacing:c.letterSpacing,textTransform:c.textTransform,whiteSpace:"nowrap"}),h.attr("class","select2-sizer"),a("body").append(h)}return h.text(b.val()),h.width()}function D(b,c,d){var e,g,f=[];e=b.attr("class"),e&&(e=""+e,a(e.split(" ")).each2(function(){0===this.indexOf("select2-")&&f.push(this)})),e=c.attr("class"),e&&(e=""+e,a(e.split(" ")).each2(function(){0!==this.indexOf("select2-")&&(g=d(this),g&&f.push(g))})),b.attr("class",f.join(" "))}function E(a,b,c,d){var e=o(a.toUpperCase()).indexOf(o(b.toUpperCase())),f=b.length;return 0>e?(c.push(d(a)),void 0):(c.push(d(a.substring(0,e))),c.push("<span class='select2-match'>"),c.push(d(a.substring(e,e+f))),c.push("</span>"),c.push(d(a.substring(e+f,a.length))),void 0)}function F(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})}function G(c){var d,e=null,f=c.quietMillis||100,g=c.url,h=this;return function(i){window.clearTimeout(d),d=window.setTimeout(function(){var d=c.data,f=g,j=c.transport||a.fn.select2.ajaxDefaults.transport,k={type:c.type||"GET",cache:c.cache||!1,jsonpCallback:c.jsonpCallback||b,dataType:c.dataType||"json"},l=a.extend({},a.fn.select2.ajaxDefaults.params,k);d=d?d.call(h,i.term,i.page,i.context):null,f="function"==typeof f?f.call(h,i.term,i.page,i.context):f,e&&"function"==typeof e.abort&&e.abort(),c.params&&(a.isFunction(c.params)?a.extend(l,c.params.call(h)):a.extend(l,c.params)),a.extend(l,{url:f,dataType:c.dataType,data:d,success:function(a){var b=c.results(a,i.page);i.callback(b)}}),e=j.call(h,l)},f)}}function H(b){var d,e,c=b,f=function(a){return""+a.text};a.isArray(c)&&(e=c,c={results:e}),a.isFunction(c)===!1&&(e=c,c=function(){return e});var g=c();return g.text&&(f=g.text,a.isFunction(f)||(d=g.text,f=function(a){return a[d]})),function(b){var g,d=b.term,e={results:[]};return""===d?(b.callback(c()),void 0):(g=function(c,e){var h,i;if(c=c[0],c.children){h={};for(i in c)c.hasOwnProperty(i)&&(h[i]=c[i]);h.children=[],a(c.children).each2(function(a,b){g(b,h.children)}),(h.children.length||b.matcher(d,f(h),c))&&e.push(h)}else b.matcher(d,f(c),c)&&e.push(c)},a(c().results).each2(function(a,b){g(b,e.results)}),b.callback(e),void 0)}}function I(c){var d=a.isFunction(c);return function(e){var f=e.term,g={results:[]},h=d?c(e):c;a.isArray(h)&&(a(h).each(function(){var a=this.text!==b,c=a?this.text:this;(""===f||e.matcher(f,c))&&g.results.push(a?this:{id:this,text:this})}),e.callback(g))}}function J(b,c){if(a.isFunction(b))return!0;if(!b)return!1;if("string"==typeof b)return!0;throw new Error(c+" must be a string, function, or falsy value")}function K(b){if(a.isFunction(b)){var c=Array.prototype.slice.call(arguments,1);return b.apply(null,c)}return b}function L(b){var c=0;return a.each(b,function(a,b){b.children?c+=L(b.children):c++}),c}function M(a,c,d,e){var h,i,j,k,l,f=a,g=!1;if(!e.createSearchChoice||!e.tokenSeparators||e.tokenSeparators.length<1)return b;for(;;){for(i=-1,j=0,k=e.tokenSeparators.length;k>j&&(l=e.tokenSeparators[j],i=a.indexOf(l),!(i>=0));j++);if(0>i)break;if(h=a.substring(0,i),a=a.substring(i+l.length),h.length>0&&(h=e.createSearchChoice.call(this,h,c),h!==b&&null!==h&&e.id(h)!==b&&null!==e.id(h))){for(g=!1,j=0,k=c.length;k>j;j++)if(r(e.id(h),e.id(c[j]))){g=!0;break}g||d(h)}}return f!==a?a:void 0}function N(){var a=this;Array.prototype.forEach.call(arguments,function(b){a[b].remove(),a[b]=null})}function O(b,c){var d=function(){};return d.prototype=new b,d.prototype.constructor=d,d.prototype.parent=b.prototype,d.prototype=a.extend(d.prototype,c),d}if(window.Select2===b){var c,d,e,f,g,h,j,k,i={x:0,y:0},c={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(a){switch(a=a.which?a.which:a){case c.LEFT:case c.RIGHT:case c.UP:case c.DOWN:return!0}return!1},isControl:function(a){var b=a.which;switch(b){case c.SHIFT:case c.CTRL:case c.ALT:return!0}return a.metaKey?!0:!1},isFunctionKey:function(a){return a=a.which?a.which:a,a>=112&&123>=a}},l="<div class='select2-measure-scrollbar'></div>",m={"\u24b6":"A","\uff21":"A","\xc0":"A","\xc1":"A","\xc2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\xc3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\xc4":"A","\u01de":"A","\u1ea2":"A","\xc5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A","\ua732":"AA","\xc6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\xc7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D","\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\xc8":"E","\xc9":"E","\xca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\xcb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F","\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\xcc":"I","\xcd":"I","\xce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\xcf":"I","\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L","\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\xd1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\xd2":"O","\xd3":"O","\xd4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O","\xd5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\xd6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\xd8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P","\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S","\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\xd9":"U","\xda":"U","\xdb":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\xdc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U","\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\xdd":"Y","\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\xe0":"a","\xe1":"a","\xe2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\xe3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a","\u1eb3":"a","\u0227":"a","\u01e1":"a","\xe4":"a","\u01df":"a","\u1ea3":"a","\xe5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\xe6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\xe7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\xe8":"e","\xe9":"e","\xea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e","\xeb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h","\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\xec":"i","\xed":"i","\xee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\xef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k","\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\xf1":"n","\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\xf2":"o","\xf3":"o","\xf4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\xf5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\xf6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o","\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\xf8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r","\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\xdf":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t","\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\xf9":"u","\xfa":"u","\xfb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\xfc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v","\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\xfd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\xff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z","\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z"};j=a(document),g=function(){var a=1;return function(){return a++}}(),j.on("mousemove",function(a){i.x=a.pageX,i.y=a.pageY}),d=O(Object,{bind:function(a){var b=this;return function(){a.apply(b,arguments)}},init:function(c){var d,e,f=".select2-results";this.opts=c=this.prepareOpts(c),this.id=c.id,c.element.data("select2")!==b&&null!==c.element.data("select2")&&c.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=a("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body),this.containerId="s2id_"+(c.element.attr("id")||"autogen"+g()),this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",c.element.attr("title")),this.body=a("body"),D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",c.element.attr("style")),this.container.css(K(c.containerCss)),this.container.addClass(K(c.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",A),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(c.dropdownCssClass)),this.dropdown.data("select2",this),this.dropdown.on("click",A),this.results=d=this.container.find(f),this.search=e=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",A),v(this.results),this.dropdown.on("mousemove-filtered",f,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",f,this.bind(function(a){this._touchEvent=!0,this.highlightUnderEvent(a)})),this.dropdown.on("touchmove",f,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",f,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),x(80,this.results),this.dropdown.on("scroll-debounced",f,this.bind(this.loadMoreIfNeeded)),a(this.container).on("change",".select2-input",function(a){a.stopPropagation()}),a(this.dropdown).on("change",".select2-input",function(a){a.stopPropagation()}),a.fn.mousewheel&&d.mousewheel(function(a,b,c,e){var f=d.scrollTop();e>0&&0>=f-e?(d.scrollTop(0),A(a)):0>e&&d.get(0).scrollHeight-d.scrollTop()+e<=d.height()&&(d.scrollTop(d.get(0).scrollHeight-d.height()),A(a))}),u(e),e.on("keyup-change input paste",this.bind(this.updateResults)),e.on("focus",function(){e.addClass("select2-focused")}),e.on("blur",function(){e.removeClass("select2-focused")}),this.dropdown.on("mouseup",f,this.bind(function(b){a(b.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(b),this.selectHighlighted(b))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(a){a.stopPropagation()}),this.nextSearchTerm=b,a.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==c.maximumInputLength&&this.search.attr("maxlength",c.maximumInputLength);var h=c.element.prop("disabled");h===b&&(h=!1),this.enable(!h);var i=c.element.prop("readonly");i===b&&(i=!1),this.readonly(i),k=k||q(),this.autofocus=c.element.prop("autofocus"),c.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",c.searchInputPlaceholder)},destroy:function(){var a=this.opts.element,c=a.data("select2");this.close(),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),c!==b&&(c.container.remove(),c.liveRegion.remove(),c.dropdown.remove(),a.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?a.attr({tabindex:this.elementTabIndex}):a.removeAttr("tabindex"),a.show()),N.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(a){return a.is("option")?{id:a.prop("value"),text:a.text(),element:a.get(),css:a.attr("class"),disabled:a.prop("disabled"),locked:r(a.attr("locked"),"locked")||r(a.data("locked"),!0)}:a.is("optgroup")?{text:a.attr("label"),children:[],element:a.get(),css:a.attr("class")}:void 0},prepareOpts:function(c){var d,e,f,h,i=this;if(d=c.element,"select"===d.get(0).tagName.toLowerCase()&&(this.select=e=c.element),e&&a.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in c)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),c=a.extend({},{populateResults:function(d,e,f){var h,j=this.opts.id,k=this.liveRegion;h=function(d,e,l){var m,n,o,p,q,r,s,t,u,v;for(d=c.sortResults(d,e,f),m=0,n=d.length;n>m;m+=1)o=d[m],q=o.disabled===!0,p=!q&&j(o)!==b,r=o.children&&o.children.length>0,s=a("<li></li>"),s.addClass("select2-results-dept-"+l),s.addClass("select2-result"),s.addClass(p?"select2-result-selectable":"select2-result-unselectable"),q&&s.addClass("select2-disabled"),r&&s.addClass("select2-result-with-children"),s.addClass(i.opts.formatResultCssClass(o)),s.attr("role","presentation"),t=a(document.createElement("div")),t.addClass("select2-result-label"),t.attr("id","select2-result-label-"+g()),t.attr("role","option"),v=c.formatResult(o,t,f,i.opts.escapeMarkup),v!==b&&(t.html(v),s.append(t)),r&&(u=a("<ul></ul>"),u.addClass("select2-result-sub"),h(o.children,u,l+1),s.append(u)),s.data("select2-data",o),e.append(s);k.text(c.formatMatches(d.length))},h(e,d,0)}},a.fn.select2.defaults,c),"function"!=typeof c.id&&(f=c.id,c.id=function(a){return a[f]}),a.isArray(c.element.data("select2Tags"))){if("tags"in c)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+c.element.attr("id");c.tags=c.element.data("select2Tags")}if(e?(c.query=this.bind(function(a){var f,g,h,c={results:[],more:!1},e=a.term;h=function(b,c){var d;b.is("option")?a.matcher(e,b.text(),b)&&c.push(i.optionToData(b)):b.is("optgroup")&&(d=i.optionToData(b),b.children().each2(function(a,b){h(b,d.children)}),d.children.length>0&&c.push(d))},f=d.children(),this.getPlaceholder()!==b&&f.length>0&&(g=this.getPlaceholderOption(),g&&(f=f.not(g))),f.each2(function(a,b){h(b,c.results)}),a.callback(c)}),c.id=function(a){return a.id}):"query"in c||("ajax"in c?(h=c.element.data("ajax-url"),h&&h.length>0&&(c.ajax.url=h),c.query=G.call(c.element,c.ajax)):"data"in c?c.query=H(c.data):"tags"in c&&(c.query=I(c.tags),c.createSearchChoice===b&&(c.createSearchChoice=function(b){return{id:a.trim(b),text:a.trim(b)}}),c.initSelection===b&&(c.initSelection=function(b,d){var e=[];a(s(b.val(),c.separator)).each(function(){var b={id:this,text:this},d=c.tags;a.isFunction(d)&&(d=d()),a(d).each(function(){return r(this.id,b.id)?(b=this,!1):void 0}),e.push(b)}),d(e)}))),"function"!=typeof c.query)throw"query function not defined for Select2 "+c.element.attr("id");if("top"===c.createSearchChoicePosition)c.createSearchChoicePosition=function(a,b){a.unshift(b)};else if("bottom"===c.createSearchChoicePosition)c.createSearchChoicePosition=function(a,b){a.push(b)};else if("function"!=typeof c.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return c},monitorSource:function(){var c,d,a=this.opts.element;a.on("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),c=this.bind(function(){var c=a.prop("disabled");c===b&&(c=!1),this.enable(!c);var d=a.prop("readonly");d===b&&(d=!1),this.readonly(d),D(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(K(this.opts.containerCssClass)),D(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(K(this.opts.dropdownCssClass))}),a.length&&a[0].attachEvent&&a.each(function(){this.attachEvent("onpropertychange",c)}),d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,d!==b&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new d(function(a){a.forEach(c)}),this.propertyObserver.observe(a.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(b){var c=a.Event("select2-selecting",{val:this.id(b),object:b});return this.opts.element.trigger(c),!c.isDefaultPrevented()},triggerChange:function(b){b=b||{},b=a.extend({},b,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(b),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var a=this._enabled&&!this._readonly,b=!a;return a===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",b),this.close(),this.enabledInterface=a,!0)},enable:function(a){a===b&&(a=!0),this._enabled!==a&&(this._enabled=a,this.opts.element.prop("disabled",!a),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(a){a===b&&(a=!1),this._readonly!==a&&(this._readonly=a,this.opts.element.prop("readonly",a),this.enableInterface())},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t,u,v,w,x,b=this.dropdown,c=this.container.offset(),d=this.container.outerHeight(!1),e=this.container.outerWidth(!1),f=b.outerHeight(!1),g=a(window),h=g.width(),i=g.height(),j=g.scrollLeft()+h,l=g.scrollTop()+i,m=c.top+d,n=c.left,o=l>=m+f,p=c.top-f>=g.scrollTop(),q=b.outerWidth(!1),r=j>=n+q,s=b.hasClass("select2-drop-above");s?(u=!0,!p&&o&&(v=!0,u=!1)):(u=!1,!o&&p&&(v=!0,u=!0)),v&&(b.hide(),c=this.container.offset(),d=this.container.outerHeight(!1),e=this.container.outerWidth(!1),f=b.outerHeight(!1),j=g.scrollLeft()+h,l=g.scrollTop()+i,m=c.top+d,n=c.left,q=b.outerWidth(!1),r=j>=n+q,b.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(x=a(".select2-results",b)[0],b.addClass("select2-drop-auto-width"),b.css("width",""),q=b.outerWidth(!1)+(x.scrollHeight===x.clientHeight?0:k.width),q>e?e=q:q=e,f=b.outerHeight(!1),r=j>=n+q):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(t=this.body.offset(),m-=t.top,n-=t.left),r||(n=c.left+this.container.outerWidth(!1)-q),w={left:n,width:e},u?(w.top=c.top-f,w.bottom="auto",this.container.addClass("select2-drop-above"),b.addClass("select2-drop-above")):(w.top=m,w.bottom="auto",this.container.removeClass("select2-drop-above"),b.removeClass("select2-drop-above")),w=a.extend(w,K(this.opts.dropdownCss)),b.css(w)},shouldOpen:function(){var b;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(b=a.Event("select2-opening"),this.opts.element.trigger(b),!b.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),!0):!1},opening:function(){var f,b=this.containerEventName,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),f=a("#select2-drop-mask"),0==f.length&&(f=a(document.createElement("div")),f.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),f.hide(),f.appendTo(this.body),f.on("mousedown touchstart click",function(b){n(f);var d,c=a("#select2-drop");c.length>0&&(d=c.data("select2"),d.opts.selectOnBlur&&d.selectHighlighted({noFocus:!0}),d.close(),b.preventDefault(),b.stopPropagation())})),this.dropdown.prev()[0]!==f[0]&&this.dropdown.before(f),a("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),f.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var g=this;this.container.parents().add(window).each(function(){a(this).on(d+" "+c+" "+e,function(){g.opened()&&g.positionDropdown()})})},close:function(){if(this.opened()){var b=this.containerEventName,c="scroll."+b,d="resize."+b,e="orientationchange."+b;this.container.parents().add(window).each(function(){a(this).off(c).off(d).off(e)}),this.clearDropdownAlignmentPreference(),a("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(a.Event("select2-close"))}},externalSearch:function(a){this.open(),this.search.val(a),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return K(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var c,d,e,f,g,h,i,b=this.results;if(d=this.highlight(),!(0>d)){if(0==d)return b.scrollTop(0),void 0;c=this.findHighlightableChoices().find(".select2-result-label"),e=a(c[d]),f=e.offset().top+e.outerHeight(!0),d===c.length-1&&(i=b.find("li.select2-more-results"),i.length>0&&(f=i.offset().top+i.outerHeight(!0))),g=b.offset().top+b.outerHeight(!0),f>g&&b.scrollTop(b.scrollTop()+(f-g)),h=e.offset().top-b.offset().top,0>h&&"none"!=e.css("display")&&b.scrollTop(b.scrollTop()+h)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(b){for(var c=this.findHighlightableChoices(),d=this.highlight();d>-1&&d<c.length;){d+=b;var e=a(c[d]);if(e.hasClass("select2-result-selectable")&&!e.hasClass("select2-disabled")&&!e.hasClass("select2-selected")){this.highlight(d);break}}},highlight:function(b){var d,e,c=this.findHighlightableChoices();return 0===arguments.length?p(c.filter(".select2-highlighted")[0],c.get()):(b>=c.length&&(b=c.length-1),0>b&&(b=0),this.removeHighlight(),d=a(c[b]),d.addClass("select2-highlighted"),this.search.attr("aria-activedescendant",d.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(d.text()),e=d.data("select2-data"),e&&this.opts.element.trigger({type:"select2-highlight",val:this.id(e),choice:e}),void 0)},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length
2
- },highlightUnderEvent:function(b){var c=a(b.target).closest(".select2-result-selectable");if(c.length>0&&!c.is(".select2-highlighted")){var d=this.findHighlightableChoices();this.highlight(d.index(c))}else 0==c.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var c,a=this.results,b=a.find("li.select2-more-results"),d=this.resultsPage+1,e=this,f=this.search.val(),g=this.context;0!==b.length&&(c=b.offset().top-a.offset().top-a.height(),c<=this.opts.loadMorePadding&&(b.addClass("select2-active"),this.opts.query({element:this.opts.element,term:f,page:d,context:g,matcher:this.opts.matcher,callback:this.bind(function(c){e.opened()&&(e.opts.populateResults.call(this,a,c.results,{term:f,page:d,context:g}),e.postprocessResults(c,!1,!1),c.more===!0?(b.detach().appendTo(a).text(K(e.opts.formatLoadMore,d+1)),window.setTimeout(function(){e.loadMoreIfNeeded()},10)):b.remove(),e.positionDropdown(),e.resultsPage=d,e.context=c.context,this.opts.element.trigger({type:"select2-loaded",items:c}))})})))},tokenize:function(){},updateResults:function(c){function m(){d.removeClass("select2-active"),h.positionDropdown(),e.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?h.liveRegion.text(e.text()):h.liveRegion.text(h.opts.formatMatches(e.find(".select2-result-selectable").length))}function n(a){e.html(a),m()}var g,i,l,d=this.search,e=this.results,f=this.opts,h=this,j=d.val(),k=a.data(this.container,"select2-last-term");if((c===!0||!k||!r(j,k))&&(a.data(this.container,"select2-last-term",j),c===!0||this.showSearchInput!==!1&&this.opened())){l=++this.queryCount;var o=this.getMaximumSelectionSize();if(o>=1&&(g=this.data(),a.isArray(g)&&g.length>=o&&J(f.formatSelectionTooBig,"formatSelectionTooBig")))return n("<li class='select2-selection-limit'>"+K(f.formatSelectionTooBig,o)+"</li>"),void 0;if(d.val().length<f.minimumInputLength)return J(f.formatInputTooShort,"formatInputTooShort")?n("<li class='select2-no-results'>"+K(f.formatInputTooShort,d.val(),f.minimumInputLength)+"</li>"):n(""),c&&this.showSearch&&this.showSearch(!0),void 0;if(f.maximumInputLength&&d.val().length>f.maximumInputLength)return J(f.formatInputTooLong,"formatInputTooLong")?n("<li class='select2-no-results'>"+K(f.formatInputTooLong,d.val(),f.maximumInputLength)+"</li>"):n(""),void 0;f.formatSearching&&0===this.findHighlightableChoices().length&&n("<li class='select2-searching'>"+K(f.formatSearching)+"</li>"),d.addClass("select2-active"),this.removeHighlight(),i=this.tokenize(),i!=b&&null!=i&&d.val(i),this.resultsPage=1,f.query({element:f.element,term:d.val(),page:this.resultsPage,context:null,matcher:f.matcher,callback:this.bind(function(g){var i;if(l==this.queryCount){if(!this.opened())return this.search.removeClass("select2-active"),void 0;if(this.context=g.context===b?null:g.context,this.opts.createSearchChoice&&""!==d.val()&&(i=this.opts.createSearchChoice.call(h,d.val(),g.results),i!==b&&null!==i&&h.id(i)!==b&&null!==h.id(i)&&0===a(g.results).filter(function(){return r(h.id(this),h.id(i))}).length&&this.opts.createSearchChoicePosition(g.results,i)),0===g.results.length&&J(f.formatNoMatches,"formatNoMatches"))return n("<li class='select2-no-results'>"+K(f.formatNoMatches,d.val())+"</li>"),void 0;e.empty(),h.opts.populateResults.call(this,e,g.results,{term:d.val(),page:this.resultsPage,context:null}),g.more===!0&&J(f.formatLoadMore,"formatLoadMore")&&(e.append("<li class='select2-more-results'>"+h.opts.escapeMarkup(K(f.formatLoadMore,this.resultsPage))+"</li>"),window.setTimeout(function(){h.loadMoreIfNeeded()},10)),this.postprocessResults(g,c),m(),this.opts.element.trigger({type:"select2-loaded",items:g})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){y(this.search)},selectHighlighted:function(a){if(this._touchMoved)return this.clearTouchMoved(),void 0;var b=this.highlight(),c=this.results.find(".select2-highlighted"),d=c.closest(".select2-result").data("select2-data");d?(this.highlight(b),this.onSelect(d,a)):a&&a.noFocus&&this.close()},getPlaceholder:function(){var a;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((a=this.getPlaceholderOption())!==b?a.text():b)},getPlaceholderOption:function(){if(this.select){var c=this.select.children("option").first();if(this.opts.placeholderOption!==b)return"first"===this.opts.placeholderOption&&c||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===a.trim(c.text())&&""===c.val())return c}},initContainerWidth:function(){function c(){var c,d,e,f,g,h;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(c=this.opts.element.attr("style"),c!==b)for(d=c.split(";"),f=0,g=d.length;g>f;f+=1)if(h=d[f].replace(/\s/g,""),e=h.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==e&&e.length>=1)return e[1];return"resolve"===this.opts.width?(c=this.opts.element.css("width"),c.indexOf("%")>0?c:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return a.isFunction(this.opts.width)?this.opts.width():this.opts.width}var d=c.call(this);null!==d&&this.container.css("width",d)}}),e=O(d,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox'>"," </ul>","</div>"].join(""));return b},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var c,d,e;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),c=this.search.get(0),c.createTextRange?(d=c.createTextRange(),d.collapse(!1),d.select()):c.setSelectionRange&&(e=this.search.val().length,c.setSelectionRange(e,e))),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){a("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),N.call(this,"selection","focusser")},initContainer:function(){var b,h,d=this.container,e=this.dropdown,f=g();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=b=d.find(".select2-choice"),this.focusser=d.find(".select2-focusser"),b.find(".select2-chosen").attr("id","select2-chosen-"+f),this.focusser.attr("aria-labelledby","select2-chosen-"+f),this.results.attr("id","select2-results-"+f),this.search.attr("aria-owns","select2-results-"+f),this.focusser.attr("id","s2id_autogen"+f),h=a("label[for='"+this.opts.element.attr("id")+"']"),this.focusser.prev().text(h.text()).attr("for",this.focusser.attr("id"));var i=this.opts.element.attr("title");this.opts.element.attr("title",i||h.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(a("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()){if(a.which===c.PAGE_UP||a.which===c.PAGE_DOWN)return A(a),void 0;switch(a.which){case c.UP:case c.DOWN:return this.moveHighlight(a.which===c.UP?-1:1),A(a),void 0;case c.ENTER:return this.selectHighlighted(),A(a),void 0;case c.TAB:return this.selectHighlighted({noFocus:!0}),void 0;case c.ESC:return this.cancel(a),A(a),void 0}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()&&a.which!==c.TAB&&!c.isControl(a)&&!c.isFunctionKey(a)&&a.which!==c.ESC){if(this.opts.openOnEnter===!1&&a.which===c.ENTER)return A(a),void 0;if(a.which==c.DOWN||a.which==c.UP||a.which==c.ENTER&&this.opts.openOnEnter){if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return;return this.open(),A(a),void 0}return a.which==c.DELETE||a.which==c.BACKSPACE?(this.opts.allowClear&&this.clear(),A(a),void 0):void 0}})),u(this.focusser),this.focusser.on("keyup-change input",this.bind(function(a){if(this.opts.minimumResultsForSearch>=0){if(a.stopPropagation(),this.opened())return;this.open()}})),b.on("mousedown touchstart","abbr",this.bind(function(a){this.isInterfaceEnabled()&&(this.clear(),B(a),this.close(),this.selection.focus())})),b.on("mousedown touchstart",this.bind(function(c){n(b),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),A(c)})),e.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),b.on("focus",this.bind(function(a){A(a)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(a.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(b){var c=this.selection.data("select2-data");if(c){var d=a.Event("select2-clearing");if(this.opts.element.trigger(d),d.isDefaultPrevented())return;var e=this.getPlaceholderOption();this.opts.element.val(e?e.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),b!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(c),choice:c}),this.triggerChange({removed:c}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.setPlaceholder(),c.nextSearchTerm=c.opts.nextSearchTerm(a,c.search.val()))})}},isPlaceholderOptionSelected:function(){var a;return this.getPlaceholder()===b?!1:(a=this.getPlaceholderOption())!==b&&a.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===b||null===this.opts.element.val()},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=a.find("option").filter(function(){return this.selected&&!this.disabled});b(c.optionToData(d))}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=c.val(),f=null;b.query({matcher:function(a,c,d){var g=r(e,b.id(d));return g&&(f=d),g},callback:a.isFunction(d)?function(){d(f)}:a.noop})}),b},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===b?b:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var a=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&a!==b){if(this.select&&this.getPlaceholderOption()===b)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(a)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(a,b,c){var d=0,e=this;if(this.findHighlightableChoices().each2(function(a,b){return r(e.id(b.data("select2-data")),e.opts.element.val())?(d=a,!1):void 0}),c!==!1&&(b===!0&&d>=0?this.highlight(d):this.highlight(0)),b===!0){var g=this.opts.minimumResultsForSearch;g>=0&&this.showSearch(L(a.results)>=g)}},showSearch:function(b){this.showSearchInput!==b&&(this.showSearchInput=b,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!b),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!b),a(this.dropdown,this.container).toggleClass("select2-with-searchbox",b))},onSelect:function(a,b){if(this.triggerSelect(a)){var c=this.opts.element.val(),d=this.data();this.opts.element.val(this.id(a)),this.updateSelection(a),this.opts.element.trigger({type:"select2-selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.close(),b&&b.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),r(c,this.id(a))||this.triggerChange({added:a,removed:d})}},updateSelection:function(a){var d,e,c=this.selection.find(".select2-chosen");this.selection.data("select2-data",a),c.empty(),null!==a&&(d=this.opts.formatSelection(a,c,this.opts.escapeMarkup)),d!==b&&c.append(d),e=this.opts.formatSelectionCssClass(a,c),e!==b&&c.addClass(e),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==b&&this.container.addClass("select2-allowclear")},val:function(){var a,c=!1,d=null,e=this,f=this.data();if(0===arguments.length)return this.opts.element.val();if(a=arguments[0],arguments.length>1&&(c=arguments[1]),this.select)this.select.val(a).find("option").filter(function(){return this.selected}).each2(function(a,b){return d=e.optionToData(b),!1}),this.updateSelection(d),this.setPlaceholder(),c&&this.triggerChange({added:d,removed:f});else{if(!a&&0!==a)return this.clear(c),void 0;if(this.opts.initSelection===b)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(a),this.opts.initSelection(this.opts.element,function(a){e.opts.element.val(a?e.id(a):""),e.updateSelection(a),e.setPlaceholder(),c&&e.triggerChange({added:a,removed:f})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(a){var c,d=!1;return 0===arguments.length?(c=this.selection.data("select2-data"),c==b&&(c=null),c):(arguments.length>1&&(d=arguments[1]),a?(c=this.data(),this.opts.element.val(a?this.id(a):""),this.updateSelection(a),d&&this.triggerChange({added:a,removed:c})):this.clear(d),void 0)}}),f=O(d,{createContainer:function(){var b=a(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return b},prepareOpts:function(){var b=this.parent.prepareOpts.apply(this,arguments),c=this;return"select"===b.element.get(0).tagName.toLowerCase()?b.initSelection=function(a,b){var d=[];a.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(a,b){d.push(c.optionToData(b))}),b(d)}:"data"in b&&(b.initSelection=b.initSelection||function(c,d){var e=s(c.val(),b.separator),f=[];b.query({matcher:function(c,d,g){var h=a.grep(e,function(a){return r(a,b.id(g))}).length;return h&&f.push(g),h},callback:a.isFunction(d)?function(){for(var a=[],c=0;c<e.length;c++)for(var g=e[c],h=0;h<f.length;h++){var i=f[h];if(r(g,b.id(i))){a.push(i),f.splice(h,1);break}}d(a)}:a.noop})}),b},selectChoice:function(a){var b=this.container.find(".select2-search-choice-focus");b.length&&a&&a[0]==b[0]||(b.length&&this.opts.element.trigger("choice-deselected",b),b.removeClass("select2-search-choice-focus"),a&&a.length&&(this.close(),a.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",a)))},destroy:function(){a("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),N.call(this,"searchContainer","selection")},initContainer:function(){var d,b=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=d=this.container.find(b);var e=this;this.selection.on("click",".select2-search-choice:not(.select2-locked)",function(){e.search[0].focus(),e.selectChoice(a(this))}),this.search.attr("id","s2id_autogen"+g()),this.search.prev().text(a("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(a){if(this.isInterfaceEnabled()){++this.keydowns;var b=d.find(".select2-search-choice-focus"),e=b.prev(".select2-search-choice:not(.select2-locked)"),f=b.next(".select2-search-choice:not(.select2-locked)"),g=z(this.search);if(b.length&&(a.which==c.LEFT||a.which==c.RIGHT||a.which==c.BACKSPACE||a.which==c.DELETE||a.which==c.ENTER)){var h=b;return a.which==c.LEFT&&e.length?h=e:a.which==c.RIGHT?h=f.length?f:null:a.which===c.BACKSPACE?this.unselect(b.first())&&(this.search.width(10),h=e.length?e:f):a.which==c.DELETE?this.unselect(b.first())&&(this.search.width(10),h=f.length?f:null):a.which==c.ENTER&&(h=null),this.selectChoice(h),A(a),h&&h.length||this.open(),void 0}if((a.which===c.BACKSPACE&&1==this.keydowns||a.which==c.LEFT)&&0==g.offset&&!g.length)return this.selectChoice(d.find(".select2-search-choice:not(.select2-locked)").last()),A(a),void 0;if(this.selectChoice(null),this.opened())switch(a.which){case c.UP:case c.DOWN:return this.moveHighlight(a.which===c.UP?-1:1),A(a),void 0;case c.ENTER:return this.selectHighlighted(),A(a),void 0;case c.TAB:return this.selectHighlighted({noFocus:!0}),this.close(),void 0;case c.ESC:return this.cancel(a),A(a),void 0}if(a.which!==c.TAB&&!c.isControl(a)&&!c.isFunctionKey(a)&&a.which!==c.BACKSPACE&&a.which!==c.ESC){if(a.which===c.ENTER){if(this.opts.openOnEnter===!1)return;if(a.altKey||a.ctrlKey||a.shiftKey||a.metaKey)return}this.open(),(a.which===c.PAGE_UP||a.which===c.PAGE_DOWN)&&A(a),a.which===c.ENTER&&A(a)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(b){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),b.stopImmediatePropagation(),this.opts.element.trigger(a.Event("select2-blur"))})),this.container.on("click",b,this.bind(function(b){this.isInterfaceEnabled()&&(a(b.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.open(),this.focusSearch(),b.preventDefault()))})),this.container.on("focus",b,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(a.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var c=this;this.opts.initSelection.call(null,this.opts.element,function(a){a!==b&&null!==a&&(c.updateSelection(a),c.close(),c.clearSearch())})}},clearSearch:function(){var a=this.getPlaceholder(),c=this.getMaxSearchWidth();a!==b&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(a).addClass("select2-default"),this.search.width(c>0?c:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(a.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(b){var c=[],d=[],e=this;a(b).each(function(){p(e.id(this),c)<0&&(c.push(e.id(this)),d.push(this))}),b=d,this.selection.find(".select2-search-choice").remove(),a(b).each(function(){e.addSelectedChoice(this)}),e.postprocessResults()},tokenize:function(){var a=this.search.val();a=this.opts.tokenizer.call(this,a,this.data(),this.bind(this.onSelect),this.opts),null!=a&&a!=b&&(this.search.val(a),a.length>0&&this.open())},onSelect:function(a,c){this.triggerSelect(a)&&(this.addSelectedChoice(a),this.opts.element.trigger({type:"selected",val:this.id(a),choice:a}),this.nextSearchTerm=this.opts.nextSearchTerm(a,this.search.val()),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(a,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=b&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:a}),c&&c.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(c){var j,k,d=!c.locked,e=a("<li class='select2-search-choice'> <div></div> <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),f=a("<li class='select2-search-choice select2-locked'><div></div></li>"),g=d?e:f,h=this.id(c),i=this.getVal();j=this.opts.formatSelection(c,g.find("div"),this.opts.escapeMarkup),j!=b&&g.find("div").replaceWith("<div>"+j+"</div>"),k=this.opts.formatSelectionCssClass(c,g.find("div")),k!=b&&g.addClass(k),d&&g.find(".select2-search-choice-close").on("mousedown",A).on("click dblclick",this.bind(function(b){this.isInterfaceEnabled()&&(this.unselect(a(b.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),A(b),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),g.data("select2-data",c),g.insertBefore(this.searchContainer),i.push(h),this.setVal(i)},unselect:function(b){var d,e,c=this.getVal();if(b=b.closest(".select2-search-choice"),0===b.length)throw"Invalid argument: "+b+". Must be .select2-search-choice";if(d=b.data("select2-data")){var f=a.Event("select2-removing");if(f.val=this.id(d),f.choice=d,this.opts.element.trigger(f),f.isDefaultPrevented())return!1;for(;(e=p(this.id(d),c))>=0;)c.splice(e,1),this.setVal(c),this.select&&this.postprocessResults();return b.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(d),choice:d}),this.triggerChange({removed:d}),!0}},postprocessResults:function(a,b,c){var d=this.getVal(),e=this.results.find(".select2-result"),f=this.results.find(".select2-result-with-children"),g=this;e.each2(function(a,b){var c=g.id(b.data("select2-data"));p(c,d)>=0&&(b.addClass("select2-selected"),b.find(".select2-result-selectable").addClass("select2-selected"))}),f.each2(function(a,b){b.is(".select2-result-selectable")||0!==b.find(".select2-result-selectable:not(.select2-selected)").length||b.addClass("select2-selected")}),-1==this.highlight()&&c!==!1&&g.highlight(0),!this.opts.createSearchChoice&&!e.filter(".select2-result:not(.select2-selected)").length>0&&(!a||a&&!a.more&&0===this.results.find(".select2-no-results").length)&&J(g.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+K(g.opts.formatNoMatches,g.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-t(this.search)},resizeSearch:function(){var a,b,c,d,e,f=t(this.search);a=C(this.search)+10,b=this.search.offset().left,c=this.selection.width(),d=this.selection.offset().left,e=c-(b-d)-f,a>e&&(e=c-f),40>e&&(e=c-f),0>=e&&(e=a),this.search.width(Math.floor(e))},getVal:function(){var a;return this.select?(a=this.select.val(),null===a?[]:a):(a=this.opts.element.val(),s(a,this.opts.separator))},setVal:function(b){var c;this.select?this.select.val(b):(c=[],a(b).each(function(){p(this,c)<0&&c.push(this)}),this.opts.element.val(0===c.length?"":c.join(this.opts.separator)))},buildChangeDetails:function(a,b){for(var b=b.slice(0),a=a.slice(0),c=0;c<b.length;c++)for(var d=0;d<a.length;d++)r(this.opts.id(b[c]),this.opts.id(a[d]))&&(b.splice(c,1),c>0&&c--,a.splice(d,1),d--);return{added:b,removed:a}},val:function(c,d){var e,f=this;if(0===arguments.length)return this.getVal();if(e=this.data(),e.length||(e=[]),!c&&0!==c)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),d&&this.triggerChange({added:this.data(),removed:e}),void 0;if(this.setVal(c),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),d&&this.triggerChange(this.buildChangeDetails(e,this.data()));else{if(this.opts.initSelection===b)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(b){var c=a.map(b,f.id);f.setVal(c),f.updateSelection(b),f.clearSearch(),d&&f.triggerChange(f.buildChangeDetails(e,f.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var b=[],c=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){b.push(c.opts.id(a(this).data("select2-data")))}),this.setVal(b),this.triggerChange()},data:function(b,c){var e,f,d=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return a(this).data("select2-data")}).get():(f=this.data(),b||(b=[]),e=a.map(b,function(a){return d.opts.id(a)}),this.setVal(e),this.updateSelection(b),this.clearSearch(),c&&this.triggerChange(this.buildChangeDetails(f,this.data())),void 0)}}),a.fn.select2=function(){var d,e,f,g,h,c=Array.prototype.slice.call(arguments,0),i=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],j=["opened","isFocused","container","dropdown"],k=["val","data"],l={search:"externalSearch"};return this.each(function(){if(0===c.length||"object"==typeof c[0])d=0===c.length?{}:a.extend({},c[0]),d.element=a(this),"select"===d.element.get(0).tagName.toLowerCase()?h=d.element.prop("multiple"):(h=d.multiple||!1,"tags"in d&&(d.multiple=h=!0)),e=h?new window.Select2["class"].multi:new window.Select2["class"].single,e.init(d);else{if("string"!=typeof c[0])throw"Invalid arguments to select2 plugin: "+c;if(p(c[0],i)<0)throw"Unknown method: "+c[0];if(g=b,e=a(this).data("select2"),e===b)return;if(f=c[0],"container"===f?g=e.container:"dropdown"===f?g=e.dropdown:(l[f]&&(f=l[f]),g=e[f].apply(e,c.slice(1))),p(c[0],j)>=0||p(c[0],k)>=0&&1==c.length)return!1}}),g===b?this:g},a.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(a,b,c,d){var e=[];return E(a.text,c.term,e,d),e.join("")},formatSelection:function(a,c,d){return a?d(a.text):b},sortResults:function(a){return a},formatResultCssClass:function(a){return a.css},formatSelectionCssClass:function(){return b},formatMatches:function(a){return a+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(a,b){var c=b-a.length;return"Please enter "+c+" or more character"+(1==c?"":"s")},formatInputTooLong:function(a,b){var c=a.length-b;return"Please delete "+c+" character"+(1==c?"":"s")},formatSelectionTooBig:function(a){return"You can only select "+a+" item"+(1==a?"":"s")},formatLoadMore:function(){return"Loading more results\u2026"},formatSearching:function(){return"Searching\u2026"},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(a){return a==b?null:a.id},matcher:function(a,b){return o(""+b).toUpperCase().indexOf(o(""+a).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:M,escapeMarkup:F,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(a){return a},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return b},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(a){var b="ontouchstart"in window||navigator.msMaxTouchPoints>0;return b?a.opts.minimumResultsForSearch<0?!1:!0:!0}},a.fn.select2.ajaxDefaults={transport:a.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:G,local:H,tags:I},util:{debounce:w,markMatch:E,escapeMarkup:F,stripDiacritics:o},"class":{"abstract":d,single:e,multi:f}}}}(jQuery);
3
-
4
- (function(b){typeof define==="function"&&define.amd?define(["jquery"],b):b(typeof jQuery!="undefined"?jQuery:window.Zepto)})(function(b){function O(a){var g=a.data;if(!a.isDefaultPrevented()){a.preventDefault();b(a.target).ajaxSubmit(g)}}function P(a){var g=a.target,k=b(g);if(!k.is("[type=submit],[type=image]")){g=k.closest("[type=submit]");if(g.length===0)return;g=g[0]}var e=this;e.clk=g;if(g.type=="image")if(a.offsetX!==undefined){e.clk_x=a.offsetX;e.clk_y=a.offsetY}else if(typeof b.fn.offset==
5
- "function"){k=k.offset();e.clk_x=a.pageX-k.left;e.clk_y=a.pageY-k.top}else{e.clk_x=a.pageX-g.offsetLeft;e.clk_y=a.pageY-g.offsetTop}setTimeout(function(){e.clk=e.clk_x=e.clk_y=null},100)}function u(){if(b.fn.ajaxSubmit.debug){var a="[jquery.form] "+Array.prototype.join.call(arguments,"");if(window.console&&window.console.log)window.console.log(a);else window.opera&&window.opera.postError&&window.opera.postError(a)}}var K={};K.fileapi=b("<input type='file'/>").get(0).files!==undefined;K.formdata=window.FormData!==
6
- undefined;var S=!!b.fn.prop;b.fn.attr2=function(){if(!S)return this.attr.apply(this,arguments);var a=this.prop.apply(this,arguments);if(a&&a.jquery||typeof a==="string")return a;return this.attr.apply(this,arguments)};b.fn.ajaxSubmit=function(a){function g(l){l=b.param(l,a.traditional).split("&");var w=l.length,p=[],t,n;for(t=0;t<w;t++){l[t]=l[t].replace(/\+/g," ");n=l[t].split("=");p.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])])}return p}function k(l){for(var w=new FormData,p=0;p<l.length;p++)w.append(l[p].name,
7
- l[p].value);if(a.extraData){l=g(a.extraData);for(p=0;p<l.length;p++)l[p]&&w.append(l[p][0],l[p][1])}a.data=null;p=b.extend(true,{},b.ajaxSettings,a,{contentType:false,processData:false,cache:false,type:i||"POST"});if(a.uploadProgress)p.xhr=function(){var n=b.ajaxSettings.xhr();n.upload&&n.upload.addEventListener("progress",function(r){var c=0,B=r.loaded||r.position,G=r.total;if(r.lengthComputable)c=Math.ceil(B/G*100);a.uploadProgress(r,B,G,c)},false);return n};p.data=null;var t=p.beforeSend;p.beforeSend=
8
- function(n,r){r.data=a.formData?a.formData:w;t&&t.call(this,n,r)};return b.ajax(p)}function e(l){function w(f){var j=null;try{if(f.contentWindow)j=f.contentWindow.document}catch(x){u("cannot get iframe.contentWindow document: "+x)}if(j)return j;try{j=f.contentDocument?f.contentDocument:f.document}catch(y){u("cannot get iframe.contentDocument: "+y);j=f.document}return j}function p(){function f(){try{var H=w(z).readyState;u("state = "+H);H&&H.toLowerCase()=="uninitialized"&&setTimeout(f,50)}catch(I){u("Server abort: ",
9
- I," (",I.name,")");t(Q);L&&clearTimeout(L);L=undefined}}var j=o.attr2("target"),x=o.attr2("action"),y=o.attr("enctype")||o.attr("encoding")||"multipart/form-data";n.setAttribute("target",G);if(!i||/post/i.test(i))n.setAttribute("method","POST");x!=c.url&&n.setAttribute("action",c.url);if(!c.skipEncodingOverride&&(!i||/post/i.test(i)))o.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"});if(c.timeout)L=setTimeout(function(){R=true;t(T)},c.timeout);var C=[];try{if(c.extraData)for(var A in c.extraData)if(c.extraData.hasOwnProperty(A))b.isPlainObject(c.extraData[A])&&
10
- c.extraData[A].hasOwnProperty("name")&&c.extraData[A].hasOwnProperty("value")?C.push(b('<input type="hidden" name="'+c.extraData[A].name+'">').val(c.extraData[A].value).appendTo(n)[0]):C.push(b('<input type="hidden" name="'+A+'">').val(c.extraData[A]).appendTo(n)[0]);c.iframeTarget||D.appendTo("body");z.attachEvent?z.attachEvent("onload",t):z.addEventListener("load",t,false);setTimeout(f,15);try{n.submit()}catch(M){document.createElement("form").submit.apply(n)}}finally{n.setAttribute("action",x);
11
- n.setAttribute("enctype",y);j?n.setAttribute("target",j):o.removeAttr("target");b(C).remove()}}function t(f){if(!(d.aborted||U)){v=w(z);if(!v){u("cannot access response document");f=Q}if(f===T&&d){d.abort("timeout");E.reject(d,"timeout")}else if(f==Q&&d){d.abort("server abort");E.reject(d,"error","server abort")}else{if(!v||v.location.href==c.iframeSrc)if(!R)return;z.detachEvent?z.detachEvent("onload",t):z.removeEventListener("load",t,false);f="success";var j;try{if(R)throw"timeout";var x=c.dataType==
12
- "xml"||v.XMLDocument||b.isXMLDoc(v);u("isXml="+x);if(!x&&window.opera&&(v.body===null||!v.body.innerHTML))if(--X){u("requeing onLoad callback, DOM not available");setTimeout(t,250);return}var y=v.body?v.body:v.documentElement;d.responseText=y?y.innerHTML:null;d.responseXML=v.XMLDocument?v.XMLDocument:v;if(x)c.dataType="xml";d.getResponseHeader=function(Y){return{"content-type":c.dataType}[Y.toLowerCase()]};if(y){d.status=Number(y.getAttribute("status"))||d.status;d.statusText=y.getAttribute("statusText")||
13
- d.statusText}var C=(c.dataType||"").toLowerCase(),A=/(json|script|text)/.test(C);if(A||c.textarea){var M=v.getElementsByTagName("textarea")[0];if(M){d.responseText=M.value;d.status=Number(M.getAttribute("status"))||d.status;d.statusText=M.getAttribute("statusText")||d.statusText}else if(A){var H=v.getElementsByTagName("pre")[0],I=v.getElementsByTagName("body")[0];if(H)d.responseText=H.textContent?H.textContent:H.innerText;else if(I)d.responseText=I.textContent?I.textContent:I.innerText}}else if(C==
14
- "xml"&&!d.responseXML&&d.responseText)d.responseXML=Z(d.responseText);try{V=$(d,C,c)}catch(aa){f="parsererror";d.error=j=aa||f}}catch(W){u("error caught: ",W);f="error";d.error=j=W||f}if(d.aborted){u("upload aborted");f=null}if(d.status)f=d.status>=200&&d.status<300||d.status===304?"success":"error";if(f==="success"){c.success&&c.success.call(c.context,V,"success",d);E.resolve(d.responseText,"success",d);B&&b.event.trigger("ajaxSuccess",[d,c])}else if(f){if(j===undefined)j=d.statusText;c.error&&c.error.call(c.context,
15
- d,f,j);E.reject(d,"error",j);B&&b.event.trigger("ajaxError",[d,c,j])}B&&b.event.trigger("ajaxComplete",[d,c]);B&&!--b.active&&b.event.trigger("ajaxStop");c.complete&&c.complete.call(c.context,d,f);U=true;c.timeout&&clearTimeout(L);setTimeout(function(){c.iframeTarget?D.attr("src",c.iframeSrc):D.remove();d.responseXML=null},100)}}}var n=o[0],r,c,B,G,D,z,d,R,L,E=b.Deferred();E.abort=function(f){d.abort(f)};if(l)for(r=0;r<s.length;r++){l=b(s[r]);S?l.prop("disabled",false):l.removeAttr("disabled")}c=
16
- b.extend(true,{},b.ajaxSettings,a);c.context=c.context||c;G="jqFormIO"+(new Date).getTime();if(c.iframeTarget){D=b(c.iframeTarget);if(r=D.attr2("name"))G=r;else D.attr2("name",G)}else{D=b('<iframe name="'+G+'" src="'+c.iframeSrc+'" ></300>');D.css({position:"absolute",top:"-1000px",left:"-1000px"})}z=D[0];d={aborted:0,responseText:null,responseXML:null,status:0,statusText:"n/a",getAllResponseHeaders:function(){},getResponseHeader:function(){},setRequestHeader:function(){},abort:function(f){var j=f==="timeout"?
17
- "timeout":"aborted";u("aborting upload... "+j);this.aborted=1;try{z.contentWindow.document.execCommand&&z.contentWindow.document.execCommand("Stop")}catch(x){}D.attr("src",c.iframeSrc);d.error=j;c.error&&c.error.call(c.context,d,j,f);B&&b.event.trigger("ajaxError",[d,c,j]);c.complete&&c.complete.call(c.context,d,j)}};(B=c.global)&&0===b.active++&&b.event.trigger("ajaxStart");B&&b.event.trigger("ajaxSend",[d,c]);if(c.beforeSend&&c.beforeSend.call(c.context,d,c)===false){c.global&&b.active--;E.reject();
18
- return E}if(d.aborted){E.reject();return E}if(l=n.clk)if((r=l.name)&&!l.disabled){c.extraData=c.extraData||{};c.extraData[r]=l.value;if(l.type=="image"){c.extraData[r+".x"]=n.clk_x;c.extraData[r+".y"]=n.clk_y}}var T=1,Q=2;l=b("meta[name=csrf-token]").attr("content");if((r=b("meta[name=csrf-param]").attr("content"))&&l){c.extraData=c.extraData||{};c.extraData[r]=l}c.forceSync?p():setTimeout(p,10);var V,v,X=50,U,Z=b.parseXML||function(f,j){if(window.ActiveXObject){j=new ActiveXObject("Microsoft.XMLDOM");
19
- j.async="false";j.loadXML(f)}else j=(new DOMParser).parseFromString(f,"text/xml");return j&&j.documentElement&&j.documentElement.nodeName!="parsererror"?j:null},ba=b.parseJSON||function(f){return window.eval("("+f+")")},$=function(f,j,x){var y=f.getResponseHeader("content-type")||"",C=j==="xml"||!j&&y.indexOf("xml")>=0;f=C?f.responseXML:f.responseText;C&&f.documentElement.nodeName==="parsererror"&&b.error&&b.error("parsererror");if(x&&x.dataFilter)f=x.dataFilter(f,j);if(typeof f==="string")if(j===
20
- "json"||!j&&y.indexOf("json")>=0)f=ba(f);else if(j==="script"||!j&&y.indexOf("javascript")>=0)b.globalEval(f);return f};return E}if(!this.length){u("ajaxSubmit: skipping submit process - no element selected");return this}var i,h,o=this;if(typeof a=="function")a={success:a};else if(a===undefined)a={};i=a.type||this.attr2("method");h=a.url||this.attr2("action");if(h=(h=typeof h==="string"?b.trim(h):"")||window.location.href||"")h=(h.match(/^([^#]+)/)||[])[1];a=b.extend(true,{url:h,success:b.ajaxSettings.success,
21
- type:i||b.ajaxSettings.type,iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank"},a);h={};this.trigger("form-pre-serialize",[this,a,h]);if(h.veto){u("ajaxSubmit: submit vetoed via form-pre-serialize trigger");return this}if(a.beforeSerialize&&a.beforeSerialize(this,a)===false){u("ajaxSubmit: submit aborted via beforeSerialize callback");return this}var q=a.traditional;if(q===undefined)q=b.ajaxSettings.traditional;var s=[],m,F=this.formToArray(a.semantic,s);if(a.data){a.extraData=
22
- a.data;m=b.param(a.data,q)}if(a.beforeSubmit&&a.beforeSubmit(F,this,a)===false){u("ajaxSubmit: submit aborted via beforeSubmit callback");return this}this.trigger("form-submit-validate",[F,this,a,h]);if(h.veto){u("ajaxSubmit: submit vetoed via form-submit-validate trigger");return this}h=b.param(F,q);if(m)h=h?h+"&"+m:m;if(a.type.toUpperCase()=="GET"){a.url+=(a.url.indexOf("?")>=0?"&":"?")+h;a.data=null}else a.data=h;var J=[];a.resetForm&&J.push(function(){o.resetForm()});a.clearForm&&J.push(function(){o.clearForm(a.includeHidden)});
23
- if(!a.dataType&&a.target){var ca=a.success||function(){};J.push(function(l){var w=a.replaceTarget?"replaceWith":"html";b(a.target)[w](l).each(ca,arguments)})}else a.success&&J.push(a.success);a.success=function(l,w,p){for(var t=a.context||this,n=0,r=J.length;n<r;n++)J[n].apply(t,[l,w,p||o,o])};if(a.error){var da=a.error;a.error=function(l,w,p){da.apply(a.context||this,[l,w,p,o])}}if(a.complete){var ea=a.complete;a.complete=function(l,w){ea.apply(a.context||this,[l,w,o])}}m=b("input[type=file]:enabled",
24
- this).filter(function(){return b(this).val()!==""}).length>0;h=o.attr("enctype")=="multipart/form-data"||o.attr("encoding")=="multipart/form-data";q=K.fileapi&&K.formdata;u("fileAPI :"+q);var N;if(a.iframe!==false&&(a.iframe||(m||h)&&!q))if(a.closeKeepAlive)b.get(a.closeKeepAlive,function(){N=e(F)});else N=e(F);else N=(m||h)&&q?k(F):b.ajax(a);o.removeData("jqxhr").data("jqxhr",N);for(m=0;m<s.length;m++)s[m]=null;this.trigger("form-submit-notify",[this,a]);return this};b.fn.ajaxForm=function(a){a=
25
- a||{};a.delegation=a.delegation&&b.isFunction(b.fn.on);if(!a.delegation&&this.length===0){var g={s:this.selector,c:this.context};if(!b.isReady&&g.s){u("DOM not ready, queuing ajaxForm");b(function(){b(g.s,g.c).ajaxForm(a)});return this}u("terminating; zero elements found by selector"+(b.isReady?"":" (DOM not ready)"));return this}if(a.delegation){b(document).off("submit.form-plugin",this.selector,O).off("click.form-plugin",this.selector,P).on("submit.form-plugin",this.selector,a,O).on("click.form-plugin",
26
- this.selector,a,P);return this}return this.ajaxFormUnbind().bind("submit.form-plugin",a,O).bind("click.form-plugin",a,P)};b.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")};b.fn.formToArray=function(a,g){var k=[];if(this.length===0)return k;var e=this[0],i=this.attr("id"),h=a?e.getElementsByTagName("*"):e.elements;if(h&&!/MSIE [678]/.test(navigator.userAgent))h=b(h).get();if(i){i=b(':input[form="'+i+'"]').get();if(i.length)h=(h||[]).concat(i)}if(!h||!h.length)return k;
27
- var o,q,s,m,F;o=0;for(F=h.length;o<F;o++){m=h[o];i=m.name;if(!(!i||m.disabled))if(a&&e.clk&&m.type=="image"){if(e.clk==m){k.push({name:i,value:b(m).val(),type:m.type});k.push({name:i+".x",value:e.clk_x},{name:i+".y",value:e.clk_y})}}else if((s=b.fieldValue(m,true))&&s.constructor==Array){g&&g.push(m);q=0;for(m=s.length;q<m;q++)k.push({name:i,value:s[q]})}else if(K.fileapi&&m.type=="file"){g&&g.push(m);s=m.files;if(s.length)for(q=0;q<s.length;q++)k.push({name:i,value:s[q],type:m.type});else k.push({name:i,
28
- value:"",type:m.type})}else if(s!==null&&typeof s!="undefined"){g&&g.push(m);k.push({name:i,value:s,type:m.type,required:m.required})}}if(!a&&e.clk){h=b(e.clk);o=h[0];if((i=o.name)&&!o.disabled&&o.type=="image"){k.push({name:i,value:h.val()});k.push({name:i+".x",value:e.clk_x},{name:i+".y",value:e.clk_y})}}return k};b.fn.formSerialize=function(a){return b.param(this.formToArray(a))};b.fn.fieldSerialize=function(a){var g=[];this.each(function(){var k=this.name;if(k){var e=b.fieldValue(this,a);if(e&&
29
- e.constructor==Array)for(var i=0,h=e.length;i<h;i++)g.push({name:k,value:e[i]});else e!==null&&typeof e!="undefined"&&g.push({name:this.name,value:e})}});return b.param(g)};b.fn.fieldValue=function(a){for(var g=[],k=0,e=this.length;k<e;k++){var i=b.fieldValue(this[k],a);i===null||typeof i=="undefined"||i.constructor==Array&&!i.length||(i.constructor==Array?b.merge(g,i):g.push(i))}return g};b.fieldValue=function(a,g){var k=a.name,e=a.type,i=a.tagName.toLowerCase();if(g===undefined)g=true;if(g&&(!k||
30
- a.disabled||e=="reset"||e=="button"||(e=="checkbox"||e=="radio")&&!a.checked||(e=="submit"||e=="image")&&a.form&&a.form.clk!=a||i=="select"&&a.selectedIndex==-1))return null;if(i=="select"){var h=a.selectedIndex;if(h<0)return null;k=[];i=a.options;var o=(e=e=="select-one")?h+1:i.length;for(h=e?h:0;h<o;h++){var q=i[h];if(q.selected){var s=q.value;s||(s=q.attributes&&q.attributes.value&&!q.attributes.value.specified?q.text:q.value);if(e)return s;k.push(s)}}return k}return b(a).val()};b.fn.clearForm=
31
- function(a){return this.each(function(){b("input,select,textarea",this).clearFields(a)})};b.fn.clearFields=b.fn.clearInputs=function(a){var g=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var k=this.type,e=this.tagName.toLowerCase();if(g.test(k)||e=="textarea")this.value="";else if(k=="checkbox"||k=="radio")this.checked=false;else if(e=="select")this.selectedIndex=-1;else if(k=="file")/MSIE/.test(navigator.userAgent)?b(this).replaceWith(b(this).clone(true)):
32
- b(this).val("");else if(a)if(a===true&&/hidden/.test(k)||typeof a=="string"&&b(this).is(a))this.value=""})};b.fn.resetForm=function(){return this.each(function(){if(typeof this.reset=="function"||typeof this.reset=="object"&&!this.reset.nodeType)this.reset()})};b.fn.enable=function(a){if(a===undefined)a=true;return this.each(function(){this.disabled=!a})};b.fn.selected=function(a){if(a===undefined)a=true;return this.each(function(){var g=this.type;if(g=="checkbox"||g=="radio")this.checked=a;else if(this.tagName.toLowerCase()==
33
- "option"){g=b(this).parent("select");a&&g[0]&&g[0].type=="select-one"&&g.find("option").selected(false);this.selected=a}})};b.fn.ajaxSubmit.debug=false});
34
-
35
- (function(b){if(b.fn.ajaxForm==undefined){}var a={};a.fileapi=b("<input type='file'/>").get(0).files!==undefined;a.formdata=window.FormData!==undefined;b.fn.uploadFile=function(t){var r=b.extend({url:"",method:"POST",enctype:"multipart/form-data",formData:null,returnType:null,allowedTypes:"*",fileName:"file",formData:{},dynamicFormData:function(){return{}},maxFileSize:-1,maxFileCount:-1,multiple:true,dragDrop:true,autoSubmit:true,showCancel:true,showAbort:true,showDone:true,showDelete:false,showError:true,showStatusAfterSuccess:true,showStatusAfterError:true,showFileCounter:true,fileCounterStyle:"). ",showProgress:false,onSelect:function(s){return true},onSubmit:function(s,u){},onSuccess:function(u,s,v){},onError:function(v,s,u){},deleteCallback:false,afterUploadAll:false,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:""},t);this.fileCounter=1;this.selectedFiles=0;this.fCounter=0;this.sCounter=0;this.tCounter=0;var d="upload-"+(new Date().getTime());this.formGroup=d;this.hide();this.errorLog=b("<div></div>");this.after(this.errorLog);this.responses=[];if(!a.formdata){r.dragDrop=false}if(!a.formdata){r.multiple=false}var m=this;var e=b("<div>"+b(this).html()+"</div>");b(e).addClass(r.uploadButtonClass);(function k(){if(b.fn.ajaxForm){if(r.dragDrop){var s=b('<div class="ajax-upload-dragdrop" style="vertical-align:top;"></div>');b(m).before(s);b(s).append(e);b(s).prepend(b(r.dragDropStr));f(m,r,s)}else{b(m).before(e)}q(m,d,r,e)}else{window.setTimeout(k,10)}})();this.startUpload=function(){b("."+this.formGroup).each(function(u,s){if(b(this).is("form")){b(this).submit()}})};this.stopUpload=function(){b(".upload-red").each(function(u,s){if(b(this).hasClass(m.formGroup)){b(this).click()}})};this.getResponses=function(){return this.responses};var g=false;function j(){if(r.afterUploadAll&&!g){g=true;(function s(){if(m.sCounter!=0&&(m.sCounter+m.fCounter==m.tCounter)){r.afterUploadAll(m);g=false}else{window.setTimeout(s,100)}})()}}function f(w,u,v){v.on("dragenter",function(s){s.stopPropagation();s.preventDefault();b(this).css("border","2px dashed #ddd")});v.on("dragover",function(s){s.stopPropagation();s.preventDefault()});v.on("drop",function(x){b(this).css("border","2px dashed #ddd");x.preventDefault();w.errorLog.html("");var s=x.originalEvent.dataTransfer.files;if(!u.multiple&&s.length>1){if(u.showError){b("<div class='um-error-block'>"+u.multiDragErrorStr+"</div>").appendTo(w.errorLog)}return}if(u.onSelect(s)==false){return}l(u,w,s)});b(document).on("dragenter",function(s){s.stopPropagation();s.preventDefault()});b(document).on("dragover",function(s){s.stopPropagation();s.preventDefault();v.css("border","2px dashed #ddd")});b(document).on("drop",function(s){s.stopPropagation();s.preventDefault();v.css("border","2px dashed #ddd")})}function i(s){var v="";var u=s/1024;if(parseInt(u)>1024){var w=u/1024;v=w.toFixed(2)+" MB"}else{v=u.toFixed(2)+" KB"}return v}function o(x){var y=[];if(jQuery.type(x)=="string"){y=x.split("&")}else{y=b.param(x).split("&")}var u=y.length;var s=[];var w,v;for(w=0;w<u;w++){y[w]=y[w].replace(/\+/g," ");v=y[w].split("=");s.push([decodeURIComponent(v[0]),decodeURIComponent(v[1])])}return s}function l(H,B,u){for(var C=0;C<u.length;C++){if(!c(B,H,u[C].name)){if(H.showError){b("<div class='um-error-block'>"+H.extErrorStr+"</div>").appendTo(B.errorLog)}continue}if(H.maxFileSize!=-1&&u[C].size>H.maxFileSize){if(H.showError){b("<div class='um-error-block'>"+H.sizeErrorStr+"</div>").appendTo(B.errorLog)}continue}if(H.maxFileCount!=-1&&B.selectedFiles>=H.maxFileCount){if(H.showError){b("<div class='um-error-block'>"+H.maxFileCountErrorStr+"</div>").appendTo(B.errorLog)}continue}B.selectedFiles++;var D=H;var w=new FormData();var A=H.fileName.replace("[]","");w.append(A,u[C]);var y=H.formData;if(y){var F=o(y);for(var z=0;z<F.length;z++){if(F[z]){w.append(F[z][0],F[z][1])}}}D.fileData=w;var E=new p(B,H);var G="";if(H.showFileCounter){G=B.fileCounter+H.fileCounterStyle+u[C].name}else{G=u[C].name}E.filename.html(G);var v=b("<form style='display:block; position:absolute;left: 150px;' class='"+B.formGroup+"' method='"+H.method+"' action='"+H.url+"' enctype='"+H.enctype+"'></form>");v.appendTo("body");var x=[];x.push(u[C].name);n(v,D,E,x,B);B.fileCounter++}}function c(w,v,y){var x=v.allowedTypes.toLowerCase().split(",");var u=y.split(".").pop().toLowerCase();if(v.allowedTypes!="*"&&jQuery.inArray(u,x)<0){return false}return true}function h(u,w){if(u.showFileCounter){var v=b(".upload-filename").length;w.fileCounter=v+1;b(".upload-filename").each(function(A,y){var s=b(this).html().split(u.fileCounterStyle);var x=parseInt(s[0])-1;var z=v+u.fileCounterStyle+s[1];b(this).html(z);v--})}}function q(y,B,D,u){var A="ajax-upload-id-"+(new Date().getTime());var w=b("<form method='"+D.method+"' action='"+D.url+"' enctype='"+D.enctype+"'></form>");var v="<input type='file' id='"+A+"' name='"+D.fileName+"'/>";if(D.multiple){if(D.fileName.indexOf("[]")!=D.fileName.length-2){D.fileName+="[]"}v="<input type='file' id='"+A+"' name='"+D.fileName+"' multiple/>"}var z=b(v).appendTo(w);z.change(function(){y.errorLog.html("");var K=D.allowedTypes.toLowerCase().split(",");var G=[];if(this.files){for(H=0;H<this.files.length;H++){G.push(this.files[H].name)}if(D.onSelect(this.files)==false){return}}else{var I=b(this).val();var F=[];G.push(I);if(!c(y,D,I)){if(D.showError){b("<div class='um-error-block'>"+D.extErrorStr+"</div>").appendTo(y.errorLog)}return}F.push({name:I,size:"NA"});if(D.onSelect(F)==false){return}}h(D,y);u.unbind("click");w.hide();q(y,B,D,u);w.addClass(B);if(a.fileapi&&a.formdata){w.removeClass(B);var J=this.files;l(D,y,J)}else{var E="";for(var H=0;H<G.length;H++){if(D.showFileCounter){E+=y.fileCounter+D.fileCounterStyle+G[H]+"<br>"}else{E+=G[H]+"<br>"}y.fileCounter++}if(D.maxFileCount!=-1&&(y.selectedFiles+G.length)>D.maxFileCount){if(D.showError){b("<div class='um-error-block'>"+D.maxFileCountErrorStr+"</div>").appendTo(y.errorLog)}return}y.selectedFiles+=G.length;var s=new p(y,D);s.filename.html(E);n(w,D,s,G,y)}});w.css({margin:0,padding:0});var C=b(u).width()+10;if(C==10){C=120}var x=u.height()+10;if(x==10){x=35}u.css({position:"relative",overflow:"hidden",cursor:"default"});z.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"});w.appendTo(u)}function p(v,u){this.statusbar=b("<div class='upload-statusbar'></div>");this.filename=b("<div class='upload-filename'></div>").appendTo(this.statusbar);this.progressDiv=b("<div class='upload-progress'>").appendTo(this.statusbar).hide();this.progressbar=b("<div class='upload-bar "+v.formGroup+"'></div>").appendTo(this.progressDiv);this.abort=b("<div class='upload-red "+v.formGroup+"'>"+u.abortStr+"</div>").appendTo(this.statusbar).hide();this.cancel=b("<div class='upload-red'>"+u.cancelStr+"</div>").appendTo(this.statusbar).hide();this.done=b("<div class='upload-green'>"+u.doneStr+"</div>").appendTo(this.statusbar).hide();this.del=b("<div class='upload-red'>"+u.deletelStr+"</div>").appendTo(this.statusbar).hide();v.errorLog.after(this.statusbar);return this}function n(z,y,u,w,A){var x=null;var v={cache:false,contentType:false,processData:false,forceSync:false,data:y.formData,formData:y.fileData,dataType:y.returnType,beforeSubmit:function(F,C,E){if(y.onSubmit.call(this,w)!=false){var B=y.dynamicFormData();if(B){var s=o(B);if(s){for(var D=0;D<s.length;D++){if(s[D]){if(y.fileData!=undefined){E.formData.append(s[D][0],s[D][1])}else{E.data[s[D][0]]=s[D][1]}}}}}A.tCounter+=w.length;j();return true}u.statusbar.append("<div class='um-error-block'>"+y.uploadErrorStr+"</div>");u.cancel.show();z.remove();u.cancel.click(function(){u.statusbar.remove()});return false},beforeSend:function(B,s){u.progressDiv.show();u.cancel.hide();u.done.hide();if(y.showAbort){u.abort.show();u.abort.click(function(){B.abort();A.selectedFiles-=w.length})}if(!a.formdata){u.progressbar.width("5%")}else{u.progressbar.width("1%")}},uploadProgress:function(E,s,D,C){if(C>98){C=98}var B=C+"%";if(C>1){u.progressbar.width(B)}if(y.showProgress){u.progressbar.html(B);u.progressbar.css("text-align","center")}},success:function(B,s,C){A.responses.push(B);u.progressbar.width("100%");if(y.showProgress){u.progressbar.html("100%");u.progressbar.css("text-align","center")}u.abort.hide();y.onSuccess.call(this,w,B,C);if(y.showStatusAfterSuccess){if(y.showDone){u.done.show();u.done.click(function(){u.statusbar.hide("slow");u.statusbar.remove()})}else{u.done.hide()}if(y.showDelete){u.del.show();u.del.click(function(){u.statusbar.hide().remove();if(y.deleteCallback){y.deleteCallback.call(this,B,u)}A.selectedFiles-=w.length;h(y,A)})}else{u.del.hide()}}else{u.statusbar.hide("slow");u.statusbar.remove()}z.remove();A.sCounter+=w.length},error:function(C,s,B){u.abort.hide();if(C.statusText=="abort"){u.statusbar.hide("slow").remove();h(y,A)}else{y.onError.call(this,w,s,B);if(y.showStatusAfterError){u.progressDiv.hide();u.statusbar.append("<span class='um-error-block'>ERROR: "+B+"</span>")}else{u.statusbar.hide();u.statusbar.remove()}A.selectedFiles-=w.length}z.remove();A.fCounter+=w.length}};if(y.autoSubmit){z.ajaxSubmit(v)}else{if(y.showCancel){u.cancel.show();u.cancel.click(function(){z.remove();u.statusbar.remove();A.selectedFiles-=w.length;h(y,A)})}z.ajaxForm(v)}}return this}}(jQuery));
36
-
37
- !function(a){"function"==typeof define&&define.amd?define("picker",["jquery"],a):this.Picker=a(jQuery)}(function(a){function b(f,g,h,k){function l(){return b._.node("div",b._.node("div",b._.node("div",b._.node("div",w.component.nodes(r.open),t.box),t.wrap),t.frame),t.holder)}function m(){u.data(g,w).addClass(t.input).val(u.data("value")?w.get("select",s.format):f.value).on("focus."+r.id+" click."+r.id,p),s.editable||u.on("keydown."+r.id,function(a){var b=a.keyCode,c=/^(8|46)$/.test(b);return 27==b?(w.close(),!1):void((32==b||c||!r.open&&w.component.key[b])&&(a.preventDefault(),a.stopPropagation(),c?w.clear().close():w.open()))}),e(f,{haspopup:!0,expanded:!1,readonly:!1,owns:f.id+"_root"+(w._hidden?" "+w._hidden.id:"")})}function n(){w.$root.on({focusin:function(a){w.$root.removeClass(t.focused),a.stopPropagation()},"mousedown click":function(b){var c=b.target;c!=w.$root.children()[0]&&(b.stopPropagation(),"mousedown"!=b.type||a(c).is(":input")||"OPTION"==c.nodeName||(b.preventDefault(),f.focus()))}}).on("click","[data-pick], [data-nav], [data-clear]",function(){var c=a(this),d=c.data(),e=c.hasClass(t.navDisabled)||c.hasClass(t.disabled),g=document.activeElement;g=g&&(g.type||g.href)&&g,(e||g&&!a.contains(w.$root[0],g))&&f.focus(),d.nav&&!e?w.set("highlight",w.component.item.highlight,{nav:d.nav}):b._.isInteger(d.pick)&&!e?w.set("select",d.pick).close(!0):d.clear&&w.clear().close(!0)}),e(w.$root[0],"hidden",!0)}function o(){var b,c;s.hiddenName===!0?(b=f.name+"_hidden",c=f.name,f.name=""):(c=["string"==typeof s.hiddenPrefix?s.hiddenPrefix:"","string"==typeof s.hiddenSuffix?s.hiddenSuffix:"_submit"],c=b=c[0]+f.name+c[1]),w._hidden=a('<input type=hidden name="'+c+'"id="'+b+'"'+(u.data("value")||f.value?' value="'+w.get("select",s.formatSubmit)+'"':"")+">")[0],u.on("change."+r.id,function(){w._hidden.value=f.value?w.get("select",s.formatSubmit):""}).after(w._hidden)}function p(a){a.stopPropagation(),"focus"==a.type&&w.$root.addClass(t.focused),w.open()}if(!f)return b;var q=!1,r={id:f.id||"P"+Math.abs(~~(Math.random()*new Date))},s=h?a.extend(!0,{},h.defaults,k):k||{},t=a.extend({},b.klasses(),s.klass),u=a(f),v=function(){return this.start()},w=v.prototype={constructor:v,$node:u,start:function(){return r&&r.start?w:(r.methods={},r.start=!0,r.open=!1,r.type=f.type,f.autofocus=f==document.activeElement,f.type="text",f.readOnly=!s.editable,f.id=f.id||r.id,w.component=new h(w,s),w.$root=a(b._.node("div",l(),t.picker,'id="'+f.id+'_root"')),n(),s.formatSubmit&&o(),m(),s.container?a(s.container).append(w.$root):u.after(w.$root),w.on({start:w.component.onStart,render:w.component.onRender,stop:w.component.onStop,open:w.component.onOpen,close:w.component.onClose,set:w.component.onSet}).on({start:s.onStart,render:s.onRender,stop:s.onStop,open:s.onOpen,close:s.onClose,set:s.onSet}),q=c(w.$root.children()[0]),f.autofocus&&w.open(),w.trigger("start").trigger("render"))},render:function(a){return a?w.$root.html(l()):w.$root.find("."+t.box).html(w.component.nodes(r.open)),w.trigger("render")},stop:function(){return r.start?(w.close(),w._hidden&&w._hidden.parentNode.removeChild(w._hidden),w.$root.remove(),u.removeClass(t.input).removeData(g),setTimeout(function(){u.off("."+r.id)},0),f.type=r.type,f.readOnly=!1,w.trigger("stop"),r.methods={},r.start=!1,w):w},open:function(c){return r.open?w:(u.addClass(t.active),e(f,"expanded",!0),setTimeout(function(){w.$root.addClass(t.opened),e(w.$root[0],"hidden",!1)},0),c!==!1&&(r.open=!0,q&&j.css("overflow","hidden").css("padding-right","+="+d()),u.trigger("focus"),i.on("click."+r.id+" focusin."+r.id,function(a){var b=a.target;b!=f&&b!=document&&3!=a.which&&w.close(b===w.$root.children()[0])}).on("keydown."+r.id,function(c){var d=c.keyCode,e=w.component.key[d],g=c.target;27==d?w.close(!0):g!=f||!e&&13!=d?a.contains(w.$root[0],g)&&13==d&&(c.preventDefault(),g.click()):(c.preventDefault(),e?b._.trigger(w.component.key.go,w,[b._.trigger(e)]):w.$root.find("."+t.highlighted).hasClass(t.disabled)||w.set("select",w.component.item.highlight).close())})),w.trigger("open"))},close:function(a){return a&&(u.off("focus."+r.id).trigger("focus"),setTimeout(function(){u.on("focus."+r.id,p)},0)),u.removeClass(t.active),e(f,"expanded",!1),setTimeout(function(){w.$root.removeClass(t.opened+" "+t.focused),e(w.$root[0],"hidden",!0)},0),r.open?(r.open=!1,q&&j.css("overflow","").css("padding-right","-="+d()),i.off("."+r.id),w.trigger("close")):w},clear:function(){return w.set("clear")},set:function(b,c,d){var e,f,g=a.isPlainObject(b),h=g?b:{};if(d=g&&a.isPlainObject(c)?c:d||{},b){g||(h[b]=c);for(e in h)f=h[e],e in w.component.item&&(void 0===f&&(f=null),w.component.set(e,f,d)),("select"==e||"clear"==e)&&u.val("clear"==e?"":w.get(e,s.format)).trigger("change");w.render()}return d.muted?w:w.trigger("set",h)},get:function(a,c){if(a=a||"value",null!=r[a])return r[a];if("value"==a)return f.value;if(a in w.component.item){if("string"==typeof c){var d=w.component.get(a);return d?b._.trigger(w.component.formats.toString,w.component,[c,d]):""}return w.component.get(a)}},on:function(b,c){var d,e,f=a.isPlainObject(b),g=f?b:{};if(b){f||(g[b]=c);for(d in g)e=g[d],r.methods[d]=r.methods[d]||[],r.methods[d].push(e)}return w},off:function(){var a,b,c=arguments;for(a=0,namesCount=c.length;namesCount>a;a+=1)b=c[a],b in r.methods&&delete r.methods[b];return w},trigger:function(a,c){var d=r.methods[a];return d&&d.map(function(a){b._.trigger(a,w,[c])}),w}};return new v}function c(a){var b,c="position";return a.currentStyle?b=a.currentStyle[c]:window.getComputedStyle&&(b=getComputedStyle(a)[c]),"fixed"==b}function d(){if(j.height()<=h.height())return 0;var b=a('<div style="visibility:hidden;width:100px" />').appendTo("body"),c=b[0].offsetWidth;b.css("overflow","scroll");var d=a('<div style="width:100%" />').appendTo(b),e=d[0].offsetWidth;return b.remove(),c-e}function e(b,c,d){if(a.isPlainObject(c))for(var e in c)f(b,e,c[e]);else f(b,c,d)}function f(a,b,c){a.setAttribute(("role"==b?"":"aria-")+b,c)}function g(b,c){a.isPlainObject(b)||(b={attribute:c}),c="";for(var d in b){var e=("role"==d?"":"aria-")+d,f=b[d];c+=null==f?"":e+'="'+b[d]+'"'}return c}var h=a(window),i=a(document),j=a(document.documentElement);return b.klasses=function(a){return a=a||"picker",{picker:a,opened:a+"--opened",focused:a+"--focused",input:a+"__input",active:a+"__input--active",holder:a+"__holder",frame:a+"__frame",wrap:a+"__wrap",box:a+"__box"}},b._={group:function(a){for(var c,d="",e=b._.trigger(a.min,a);e<=b._.trigger(a.max,a,[e]);e+=a.i)c=b._.trigger(a.item,a,[e]),d+=b._.node(a.node,c[0],c[1],c[2]);return d},node:function(b,c,d,e){return c?(c=a.isArray(c)?c.join(""):c,d=d?' class="'+d+'"':"",e=e?" "+e:"","<"+b+d+e+">"+c+"</"+b+">"):""},lead:function(a){return(10>a?"0":"")+a},trigger:function(a,b,c){return"function"==typeof a?a.apply(b,c||[]):a},digits:function(a){return/\d/.test(a[1])?2:1},isDate:function(a){return{}.toString.call(a).indexOf("Date")>-1&&this.isInteger(a.getDate())},isInteger:function(a){return{}.toString.call(a).indexOf("Number")>-1&&a%1===0},ariaAttr:g},b.extend=function(c,d){a.fn[c]=function(e,f){var g=this.data(c);return"picker"==e?g:g&&"string"==typeof e?b._.trigger(g[e],g,[f]):this.each(function(){var f=a(this);f.data(c)||new b(this,c,d,e)})},a.fn[c].defaults=d.defaults},b});
38
-
39
- !function(a){"function"==typeof define&&define.amd?define(["picker","jquery"],a):a(Picker,jQuery)}(function(a,b){function c(a,b){var c=this,d=a.$node[0].value,e=a.$node.data("value"),f=e||d,g=e?b.formatSubmit:b.format,h=function(){return"rtl"===getComputedStyle(a.$root[0]).direction};c.settings=b,c.$node=a.$node,c.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"},c.item={},c.item.clear=null,c.item.disable=(b.disable||[]).slice(0),c.item.enable=-function(a){return a[0]===!0?a.shift():-1}(c.item.disable),c.set("min",b.min).set("max",b.max).set("now"),f?c.set("select",f,{format:g}):c.set("select",null).set("highlight",c.item.now),c.key={40:7,38:-7,39:function(){return h()?-1:1},37:function(){return h()?1:-1},go:function(a){var b=c.item.highlight,d=new Date(b.year,b.month,b.date+a);c.set("highlight",[d.getFullYear(),d.getMonth(),d.getDate()],{interval:a}),this.render()}},a.on("render",function(){a.$root.find("."+b.klass.selectMonth).on("change",function(){var c=this.value;c&&(a.set("highlight",[a.get("view").year,c,a.get("highlight").date]),a.$root.find("."+b.klass.selectMonth).trigger("focus"))}),a.$root.find("."+b.klass.selectYear).on("change",function(){var c=this.value;c&&(a.set("highlight",[c,a.get("view").month,a.get("highlight").date]),a.$root.find("."+b.klass.selectYear).trigger("focus"))})}).on("open",function(){a.$root.find("button, select").attr("disabled",!1)}).on("close",function(){a.$root.find("button, select").attr("disabled",!0)})}var d=7,e=6,f=a._;c.prototype.set=function(a,b,c){var d=this,e=d.item;return null===b?("clear"==a&&(a="select"),e[a]=b,d):(e["enable"==a?"disable":"flip"==a?"enable":a]=d.queue[a].split(" ").map(function(e){return b=d[e](a,b,c)}).pop(),"select"==a?d.set("highlight",e.select,c):"highlight"==a?d.set("view",e.highlight,c):a.match(/^(flip|min|max|disable|enable)$/)&&(e.select&&d.disabled(e.select)&&d.set("select",e.select,c),e.highlight&&d.disabled(e.highlight)&&d.set("highlight",e.highlight,c)),d)},c.prototype.get=function(a){return this.item[a]},c.prototype.create=function(a,c,d){var e,g=this;return c=void 0===c?a:c,c==-1/0||1/0==c?e=c:b.isPlainObject(c)&&f.isInteger(c.pick)?c=c.obj:b.isArray(c)?(c=new Date(c[0],c[1],c[2]),c=f.isDate(c)?c:g.create().obj):c=f.isInteger(c)||f.isDate(c)?g.normalize(new Date(c),d):g.now(a,c,d),{year:e||c.getFullYear(),month:e||c.getMonth(),date:e||c.getDate(),day:e||c.getDay(),obj:e||c,pick:e||c.getTime()}},c.prototype.createRange=function(a,c){var d=this,e=function(a){return a===!0||b.isArray(a)||f.isDate(a)?d.create(a):a};return f.isInteger(a)||(a=e(a)),f.isInteger(c)||(c=e(c)),f.isInteger(a)&&b.isPlainObject(c)?a=[c.year,c.month,c.date+a]:f.isInteger(c)&&b.isPlainObject(a)&&(c=[a.year,a.month,a.date+c]),{from:e(a),to:e(c)}},c.prototype.withinRange=function(a,b){return a=this.createRange(a.from,a.to),b.pick>=a.from.pick&&b.pick<=a.to.pick},c.prototype.overlapRanges=function(a,b){var c=this;return a=c.createRange(a.from,a.to),b=c.createRange(b.from,b.to),c.withinRange(a,b.from)||c.withinRange(a,b.to)||c.withinRange(b,a.from)||c.withinRange(b,a.to)},c.prototype.now=function(a,b,c){return b=new Date,c&&c.rel&&b.setDate(b.getDate()+c.rel),this.normalize(b,c)},c.prototype.navigate=function(a,c,d){var e,f,g,h,i=b.isArray(c),j=b.isPlainObject(c),k=this.item.view;if(i||j){for(j?(f=c.year,g=c.month,h=c.date):(f=+c[0],g=+c[1],h=+c[2]),d&&d.nav&&k&&k.month!==g&&(f=k.year,g=k.month),e=new Date(f,g+(d&&d.nav?d.nav:0),1),f=e.getFullYear(),g=e.getMonth();new Date(f,g,h).getMonth()!==g;)h-=1;c=[f,g,h]}return c},c.prototype.normalize=function(a){return a.setHours(0,0,0,0),a},c.prototype.measure=function(a,b){var c=this;return b?f.isInteger(b)&&(b=c.now(a,b,{rel:b})):b="min"==a?-1/0:1/0,b},c.prototype.viewset=function(a,b){return this.create([b.year,b.month,1])},c.prototype.validate=function(a,c,d){var e,g,h,i,j=this,k=c,l=d&&d.interval?d.interval:1,m=-1===j.item.enable,n=j.item.min,o=j.item.max,p=m&&j.item.disable.filter(function(a){if(b.isArray(a)){var d=j.create(a).pick;d<c.pick?e=!0:d>c.pick&&(g=!0)}return f.isInteger(a)}).length;if((!d||!d.nav)&&(!m&&j.disabled(c)||m&&j.disabled(c)&&(p||e||g)||!m&&(c.pick<=n.pick||c.pick>=o.pick)))for(m&&!p&&(!g&&l>0||!e&&0>l)&&(l*=-1);j.disabled(c)&&(Math.abs(l)>1&&(c.month<k.month||c.month>k.month)&&(c=k,l=l>0?1:-1),c.pick<=n.pick?(h=!0,l=1,c=j.create([n.year,n.month,n.date+(c.pick===n.pick?0:-1)])):c.pick>=o.pick&&(i=!0,l=-1,c=j.create([o.year,o.month,o.date+(c.pick===o.pick?0:1)])),!h||!i);)c=j.create([c.year,c.month,c.date+l]);return c},c.prototype.disabled=function(a){var c=this,d=c.item.disable.filter(function(d){return f.isInteger(d)?a.day===(c.settings.firstDay?d:d-1)%7:b.isArray(d)||f.isDate(d)?a.pick===c.create(d).pick:b.isPlainObject(d)?c.withinRange(d,a):void 0});return d=d.length&&!d.filter(function(a){return b.isArray(a)&&"inverted"==a[3]||b.isPlainObject(a)&&a.inverted}).length,-1===c.item.enable?!d:d||a.pick<c.item.min.pick||a.pick>c.item.max.pick},c.prototype.parse=function(a,b,c){var d=this,e={};return b&&"string"==typeof b?(c&&c.format||(c=c||{},c.format=d.settings.format),d.formats.toArray(c.format).map(function(a){var c=d.formats[a],g=c?f.trigger(c,d,[b,e]):a.replace(/^!/,"").length;c&&(e[a]=b.substr(0,g)),b=b.substr(g)}),[e.yyyy||e.yy,+(e.mm||e.m)-1,e.dd||e.d]):b},c.prototype.formats=function(){function a(a,b,c){var d=a.match(/\w+/)[0];return c.mm||c.m||(c.m=b.indexOf(d)+1),d.length}function b(a){return a.match(/\w+/)[0].length}return{d:function(a,b){return a?f.digits(a):b.date},dd:function(a,b){return a?2:f.lead(b.date)},ddd:function(a,c){return a?b(a):this.settings.weekdaysShort[c.day]},dddd:function(a,c){return a?b(a):this.settings.weekdaysFull[c.day]},m:function(a,b){return a?f.digits(a):b.month+1},mm:function(a,b){return a?2:f.lead(b.month+1)},mmm:function(b,c){var d=this.settings.monthsShort;return b?a(b,d,c):d[c.month]},mmmm:function(b,c){var d=this.settings.monthsFull;return b?a(b,d,c):d[c.month]},yy:function(a,b){return a?2:(""+b.year).slice(2)},yyyy:function(a,b){return a?4:b.year},toArray:function(a){return a.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g)},toString:function(a,b){var c=this;return c.formats.toArray(a).map(function(a){return f.trigger(c.formats[a],c,[0,b])||a.replace(/^!/,"")}).join("")}}}(),c.prototype.isDateExact=function(a,c){var d=this;return f.isInteger(a)&&f.isInteger(c)||"boolean"==typeof a&&"boolean"==typeof c?a===c:(f.isDate(a)||b.isArray(a))&&(f.isDate(c)||b.isArray(c))?d.create(a).pick===d.create(c).pick:b.isPlainObject(a)&&b.isPlainObject(c)?d.isDateExact(a.from,c.from)&&d.isDateExact(a.to,c.to):!1},c.prototype.isDateOverlap=function(a,c){var d=this,e=d.settings.firstDay?1:0;return f.isInteger(a)&&(f.isDate(c)||b.isArray(c))?(a=a%7+e,a===d.create(c).day+1):f.isInteger(c)&&(f.isDate(a)||b.isArray(a))?(c=c%7+e,c===d.create(a).day+1):b.isPlainObject(a)&&b.isPlainObject(c)?d.overlapRanges(a,c):!1},c.prototype.flipEnable=function(a){var b=this.item;b.enable=a||(-1==b.enable?1:-1)},c.prototype.deactivate=function(a,c){var d=this,e=d.item.disable.slice(0);return"flip"==c?d.flipEnable():c===!1?(d.flipEnable(1),e=[]):c===!0?(d.flipEnable(-1),e=[]):c.map(function(a){for(var c,g=0;g<e.length;g+=1)if(d.isDateExact(a,e[g])){c=!0;break}c||(f.isInteger(a)||f.isDate(a)||b.isArray(a)||b.isPlainObject(a)&&a.from&&a.to)&&e.push(a)}),e},c.prototype.activate=function(a,c){var d=this,e=d.item.disable,g=e.length;return"flip"==c?d.flipEnable():c===!0?(d.flipEnable(1),e=[]):c===!1?(d.flipEnable(-1),e=[]):c.map(function(a){var c,h,i,j;for(i=0;g>i;i+=1){if(h=e[i],d.isDateExact(h,a)){c=e[i]=null,j=!0;break}if(d.isDateOverlap(h,a)){b.isPlainObject(a)?(a.inverted=!0,c=a):b.isArray(a)?(c=a,c[3]||c.push("inverted")):f.isDate(a)&&(c=[a.getFullYear(),a.getMonth(),a.getDate(),"inverted"]);break}}if(c)for(i=0;g>i;i+=1)if(d.isDateExact(e[i],a)){e[i]=null;break}if(j)for(i=0;g>i;i+=1)if(d.isDateOverlap(e[i],a)){e[i]=null;break}c&&e.push(c)}),e.filter(function(a){return null!=a})},c.prototype.nodes=function(a){var b=this,c=b.settings,g=b.item,h=g.now,i=g.select,j=g.highlight,k=g.view,l=g.disable,m=g.min,n=g.max,o=function(a,b){return c.firstDay&&(a.push(a.shift()),b.push(b.shift())),f.node("thead",f.node("tr",f.group({min:0,max:d-1,i:1,node:"th",item:function(d){return[a[d],c.klass.weekdays,'scope=col title="'+b[d]+'"']}})))}((c.showWeekdaysFull?c.weekdaysFull:c.weekdaysShort).slice(0),c.weekdaysFull.slice(0)),p=function(a){return f.node("div"," ",c.klass["nav"+(a?"Next":"Prev")]+(a&&k.year>=n.year&&k.month>=n.month||!a&&k.year<=m.year&&k.month<=m.month?" "+c.klass.navDisabled:""),"data-nav="+(a||-1)+" "+f.ariaAttr({role:"button",controls:b.$node[0].id+"_table"})+' title="'+(a?c.labelMonthNext:c.labelMonthPrev)+'"')},q=function(){var d=c.showMonthsShort?c.monthsShort:c.monthsFull;return c.selectMonths?f.node("select",f.group({min:0,max:11,i:1,node:"option",item:function(a){return[d[a],0,"value="+a+(k.month==a?" selected":"")+(k.year==m.year&&a<m.month||k.year==n.year&&a>n.month?" disabled":"")]}}),c.klass.selectMonth,(a?"":"disabled")+" "+f.ariaAttr({controls:b.$node[0].id+"_table"})+' title="'+c.labelMonthSelect+'"'):f.node("div",d[k.month],c.klass.month)},r=function(){var d=k.year,e=c.selectYears===!0?5:~~(c.selectYears/2);if(e){var g=m.year,h=n.year,i=d-e,j=d+e;if(g>i&&(j+=g-i,i=g),j>h){var l=i-g,o=j-h;i-=l>o?o:l,j=h}return f.node("select",f.group({min:i,max:j,i:1,node:"option",item:function(a){return[a,0,"value="+a+(d==a?" selected":"")]}}),c.klass.selectYear,(a?"":"disabled")+" "+f.ariaAttr({controls:b.$node[0].id+"_table"})+' title="'+c.labelYearSelect+'"')}return f.node("div",d,c.klass.year)};return f.node("div",(c.selectYears?r()+q():q()+r())+p()+p(1),c.klass.header)+f.node("table",o+f.node("tbody",f.group({min:0,max:e-1,i:1,node:"tr",item:function(a){var e=c.firstDay&&0===b.create([k.year,k.month,1]).day?-7:0;return[f.group({min:d*a-k.day+e+1,max:function(){return this.min+d-1},i:1,node:"td",item:function(a){a=b.create([k.year,k.month,a+(c.firstDay?1:0)]);var d=i&&i.pick==a.pick,e=j&&j.pick==a.pick,g=l&&b.disabled(a)||a.pick<m.pick||a.pick>n.pick;return[f.node("div",a.date,function(b){return b.push(k.month==a.month?c.klass.infocus:c.klass.outfocus),h.pick==a.pick&&b.push(c.klass.now),d&&b.push(c.klass.selected),e&&b.push(c.klass.highlighted),g&&b.push(c.klass.disabled),b.join(" ")}([c.klass.day]),"data-pick="+a.pick+" "+f.ariaAttr({role:"gridcell",selected:d&&b.$node.val()===f.trigger(b.formats.toString,b,[c.format,a])?!0:null,activedescendant:e?!0:null,disabled:g?!0:null})),"",f.ariaAttr({role:"presentation"})]}})]}})),c.klass.table,'id="'+b.$node[0].id+'_table" '+f.ariaAttr({role:"grid",controls:b.$node[0].id,readonly:!0}))+f.node("div",f.node("button",c.today,c.klass.buttonToday,"type=button data-pick="+h.pick+(a?"":" disabled")+" "+f.ariaAttr({controls:b.$node[0].id}))+f.node("button",c.clear,c.klass.buttonClear,"type=button data-clear=1"+(a?"":" disabled")+" "+f.ariaAttr({controls:b.$node[0].id})),c.klass.footer)},c.defaults=function(a){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",format:"d mmmm, yyyy",klass:{table:a+"table",header:a+"header",navPrev:a+"nav--prev",navNext:a+"nav--next",navDisabled:a+"nav--disabled",month:a+"month",year:a+"year",selectMonth:a+"select--month",selectYear:a+"select--year",weekdays:a+"weekday",day:a+"day",disabled:a+"day--disabled",selected:a+"day--selected",highlighted:a+"day--highlighted",now:a+"day--today",infocus:a+"day--infocus",outfocus:a+"day--outfocus",footer:a+"footer",buttonClear:a+"button--clear",buttonToday:a+"button--today"}}}(a.klasses().picker+"__"),a.extend("pickadate",c)});
40
-
41
- !function(a){"function"==typeof define&&define.amd?define(["picker","jquery"],a):a(Picker,jQuery)}(function(a,b){function c(a,b){var c=this,d=a.$node[0].value,e=a.$node.data("value"),f=e||d,g=e?b.formatSubmit:b.format;c.settings=b,c.$node=a.$node,c.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"},c.item={},c.item.clear=null,c.item.interval=b.interval||30,c.item.disable=(b.disable||[]).slice(0),c.item.enable=-function(a){return a[0]===!0?a.shift():-1}(c.item.disable),c.set("min",b.min).set("max",b.max).set("now"),f?c.set("select",f,{format:g,fromValue:!!d}):c.set("select",null).set("highlight",c.item.now),c.key={40:1,38:-1,39:1,37:-1,go:function(a){c.set("highlight",c.item.highlight.pick+a*c.item.interval,{interval:a*c.item.interval}),this.render()}},a.on("render",function(){var c=a.$root.children(),d=c.find("."+b.klass.viewset);d.length&&(c[0].scrollTop=~~d.position().top-2*d[0].clientHeight)}).on("open",function(){a.$root.find("button").attr("disabled",!1)}).on("close",function(){a.$root.find("button").attr("disabled",!0)})}var d=24,e=60,f=12,g=d*e,h=a._;c.prototype.set=function(a,b,c){var d=this,e=d.item;return null===b?("clear"==a&&(a="select"),e[a]=b,d):(e["enable"==a?"disable":"flip"==a?"enable":a]=d.queue[a].split(" ").map(function(e){return b=d[e](a,b,c)}).pop(),"select"==a?d.set("highlight",e.select,c):"highlight"==a?d.set("view",e.highlight,c):"interval"==a?d.set("min",e.min,c).set("max",e.max,c):a.match(/^(flip|min|max|disable|enable)$/)&&("min"==a&&d.set("max",e.max,c),e.select&&d.disabled(e.select)&&d.set("select",e.select,c),e.highlight&&d.disabled(e.highlight)&&d.set("highlight",e.highlight,c)),d)},c.prototype.get=function(a){return this.item[a]},c.prototype.create=function(a,c,f){var i=this;return c=void 0===c?a:c,h.isDate(c)&&(c=[c.getHours(),c.getMinutes()]),b.isPlainObject(c)&&h.isInteger(c.pick)?c=c.pick:b.isArray(c)?c=+c[0]*e+ +c[1]:h.isInteger(c)||(c=i.now(a,c,f)),"max"==a&&c<i.item.min.pick&&(c+=g),"min"!=a&&"max"!=a&&(c-i.item.min.pick)%i.item.interval!==0&&(c+=i.item.interval),c=i.normalize(a,c,f),{hour:~~(d+c/e)%d,mins:(e+c%e)%e,time:(g+c)%g,pick:c}},c.prototype.createRange=function(a,c){var d=this,e=function(a){return a===!0||b.isArray(a)||h.isDate(a)?d.create(a):a};return h.isInteger(a)||(a=e(a)),h.isInteger(c)||(c=e(c)),h.isInteger(a)&&b.isPlainObject(c)?a=[c.hour,c.mins+a*d.settings.interval]:h.isInteger(c)&&b.isPlainObject(a)&&(c=[a.hour,a.mins+c*d.settings.interval]),{from:e(a),to:e(c)}},c.prototype.withinRange=function(a,b){return a=this.createRange(a.from,a.to),b.pick>=a.from.pick&&b.pick<=a.to.pick},c.prototype.overlapRanges=function(a,b){var c=this;return a=c.createRange(a.from,a.to),b=c.createRange(b.from,b.to),c.withinRange(a,b.from)||c.withinRange(a,b.to)||c.withinRange(b,a.from)||c.withinRange(b,a.to)},c.prototype.now=function(a,b){var c,d=this.item.interval,f=new Date,g=f.getHours()*e+f.getMinutes(),i=h.isInteger(b);return g-=g%d,c=0>b&&-d>=d*b+g,g+="min"==a&&c?0:d,i&&(g+=d*(c&&"max"!=a?b+1:b)),g},c.prototype.normalize=function(a,b){var c=this.item.interval,d=this.item.min&&this.item.min.pick||0;return b-="min"==a?0:(b-d)%c},c.prototype.measure=function(a,c,f){var g=this;return c?c===!0||h.isInteger(c)?c=g.now(a,c,f):b.isPlainObject(c)&&h.isInteger(c.pick)&&(c=g.normalize(a,c.pick,f)):c="min"==a?[0,0]:[d-1,e-1],c},c.prototype.validate=function(a,b,c){var d=this,e=c&&c.interval?c.interval:d.item.interval;return d.disabled(b)&&(b=d.shift(b,e)),b=d.scope(b),d.disabled(b)&&(b=d.shift(b,-1*e)),b},c.prototype.disabled=function(a){var c=this,d=c.item.disable.filter(function(d){return h.isInteger(d)?a.hour==d:b.isArray(d)||h.isDate(d)?a.pick==c.create(d).pick:b.isPlainObject(d)?c.withinRange(d,a):void 0});return d=d.length&&!d.filter(function(a){return b.isArray(a)&&"inverted"==a[2]||b.isPlainObject(a)&&a.inverted}).length,-1===c.item.enable?!d:d||a.pick<c.item.min.pick||a.pick>c.item.max.pick},c.prototype.shift=function(a,b){var c=this,d=c.item.min.pick,e=c.item.max.pick;for(b=b||c.item.interval;c.disabled(a)&&(a=c.create(a.pick+=b),!(a.pick<=d||a.pick>=e)););return a},c.prototype.scope=function(a){var b=this.item.min.pick,c=this.item.max.pick;return this.create(a.pick>c?c:a.pick<b?b:a)},c.prototype.parse=function(a,b,c){var d,f,g,i,j,k=this,l={};if(!b||"string"!=typeof b)return b;c&&c.format||(c=c||{},c.format=k.settings.format),k.formats.toArray(c.format).map(function(a){var c,d=k.formats[a],e=d?h.trigger(d,k,[b,l]):a.replace(/^!/,"").length;d&&(c=b.substr(0,e),l[a]=c.match(/^\d+$/)?+c:c),b=b.substr(e)});for(i in l)j=l[i],h.isInteger(j)?i.match(/^(h|hh)$/i)?(d=j,("h"==i||"hh"==i)&&(d%=12)):"i"==i&&(f=j):i.match(/^a$/i)&&j.match(/^p/i)&&("h"in l||"hh"in l)&&(g=!0);return(g?d+12:d)*e+f},c.prototype.formats={h:function(a,b){return a?h.digits(a):b.hour%f||f},hh:function(a,b){return a?2:h.lead(b.hour%f||f)},H:function(a,b){return a?h.digits(a):""+b.hour%24},HH:function(a,b){return a?h.digits(a):h.lead(b.hour%24)},i:function(a,b){return a?2:h.lead(b.mins)},a:function(a,b){return a?4:g/2>b.time%g?"a.m.":"p.m."},A:function(a,b){return a?2:g/2>b.time%g?"AM":"PM"},toArray:function(a){return a.split(/(h{1,2}|H{1,2}|i|a|A|!.)/g)},toString:function(a,b){var c=this;return c.formats.toArray(a).map(function(a){return h.trigger(c.formats[a],c,[0,b])||a.replace(/^!/,"")}).join("")}},c.prototype.isTimeExact=function(a,c){var d=this;return h.isInteger(a)&&h.isInteger(c)||"boolean"==typeof a&&"boolean"==typeof c?a===c:(h.isDate(a)||b.isArray(a))&&(h.isDate(c)||b.isArray(c))?d.create(a).pick===d.create(c).pick:b.isPlainObject(a)&&b.isPlainObject(c)?d.isTimeExact(a.from,c.from)&&d.isTimeExact(a.to,c.to):!1},c.prototype.isTimeOverlap=function(a,c){var d=this;return h.isInteger(a)&&(h.isDate(c)||b.isArray(c))?a===d.create(c).hour:h.isInteger(c)&&(h.isDate(a)||b.isArray(a))?c===d.create(a).hour:b.isPlainObject(a)&&b.isPlainObject(c)?d.overlapRanges(a,c):!1},c.prototype.flipEnable=function(a){var b=this.item;b.enable=a||(-1==b.enable?1:-1)},c.prototype.deactivate=function(a,c){var d=this,e=d.item.disable.slice(0);return"flip"==c?d.flipEnable():c===!1?(d.flipEnable(1),e=[]):c===!0?(d.flipEnable(-1),e=[]):c.map(function(a){for(var c,f=0;f<e.length;f+=1)if(d.isTimeExact(a,e[f])){c=!0;break}c||(h.isInteger(a)||h.isDate(a)||b.isArray(a)||b.isPlainObject(a)&&a.from&&a.to)&&e.push(a)}),e},c.prototype.activate=function(a,c){var d=this,e=d.item.disable,f=e.length;return"flip"==c?d.flipEnable():c===!0?(d.flipEnable(1),e=[]):c===!1?(d.flipEnable(-1),e=[]):c.map(function(a){var c,g,i,j;for(i=0;f>i;i+=1){if(g=e[i],d.isTimeExact(g,a)){c=e[i]=null,j=!0;break}if(d.isTimeOverlap(g,a)){b.isPlainObject(a)?(a.inverted=!0,c=a):b.isArray(a)?(c=a,c[2]||c.push("inverted")):h.isDate(a)&&(c=[a.getFullYear(),a.getMonth(),a.getDate(),"inverted"]);break}}if(c)for(i=0;f>i;i+=1)if(d.isTimeExact(e[i],a)){e[i]=null;break}if(j)for(i=0;f>i;i+=1)if(d.isTimeOverlap(e[i],a)){e[i]=null;break}c&&e.push(c)}),e.filter(function(a){return null!=a})},c.prototype.i=function(a,b){return h.isInteger(b)&&b>0?b:this.item.interval},c.prototype.nodes=function(a){var b=this,c=b.settings,d=b.item.select,e=b.item.highlight,f=b.item.view,g=b.item.disable;return h.node("ul",h.group({min:b.item.min.pick,max:b.item.max.pick,i:b.item.interval,node:"li",item:function(a){a=b.create(a);var i=a.pick,j=d&&d.pick==i,k=e&&e.pick==i,l=g&&b.disabled(a);return[h.trigger(b.formats.toString,b,[h.trigger(c.formatLabel,b,[a])||c.format,a]),function(a){return j&&a.push(c.klass.selected),k&&a.push(c.klass.highlighted),f&&f.pick==i&&a.push(c.klass.viewset),l&&a.push(c.klass.disabled),a.join(" ")}([c.klass.listItem]),"data-pick="+a.pick+" "+h.ariaAttr({role:"option",selected:j&&b.$node.val()===h.trigger(b.formats.toString,b,[c.format,a])?!0:null,activedescendant:k?!0:null,disabled:l?!0:null})]}})+h.node("li",h.node("button",c.clear,c.klass.buttonClear,"type=button data-clear=1"+(a?"":" disabled")+" "+h.ariaAttr({controls:b.$node[0].id})),"",h.ariaAttr({role:"presentation"})),c.klass.list,h.ariaAttr({role:"listbox",controls:b.$node[0].id}))},c.defaults=function(a){return{clear:"Clear",format:"h:i A",interval:30,klass:{picker:a+" "+a+"--time",holder:a+"__holder",list:a+"__list",listItem:a+"__list-item",disabled:a+"__list-item--disabled",selected:a+"__list-item--selected",highlighted:a+"__list-item--highlighted",viewset:a+"__list-item--viewset",now:a+"__list-item--now",buttonClear:a+"__button--clear"}}}(a.klasses().picker),a.extend("pickatime",c)});
42
-
43
- [].map||(Array.prototype.map=function(a,b){for(var c=this,d=c.length,e=new Array(d),f=0;d>f;f++)f in c&&(e[f]=a.call(b,c[f],f,c));return e}),[].filter||(Array.prototype.filter=function(a){if(null==this)throw new TypeError;var b=Object(this),c=b.length>>>0;if("function"!=typeof a)throw new TypeError;for(var d=[],e=arguments[1],f=0;c>f;f++)if(f in b){var g=b[f];a.call(e,g,f,b)&&d.push(g)}return d}),[].indexOf||(Array.prototype.indexOf=function(a){if(null==this)throw new TypeError;var b=Object(this),c=b.length>>>0;if(0===c)return-1;var d=0;if(arguments.length>1&&(d=Number(arguments[1]),d!=d?d=0:0!==d&&1/0!=d&&d!=-1/0&&(d=(d>0||-1)*Math.floor(Math.abs(d)))),d>=c)return-1;for(var e=d>=0?d:Math.max(c-Math.abs(d),0);c>e;e++)if(e in b&&b[e]===a)return e;return-1});
44
- var nativeSplit=String.prototype.split,compliantExecNpcg=void 0===/()??/.exec("")[1];String.prototype.split=function(a,b){var c=this;if("[object RegExp]"!==Object.prototype.toString.call(a))return nativeSplit.call(c,a,b);var d,e,f,g,h=[],i=(a.ignoreCase?"i":"")+(a.multiline?"m":"")+(a.extended?"x":"")+(a.sticky?"y":""),j=0;for(a=new RegExp(a.source,i+"g"),c+="",compliantExecNpcg||(d=new RegExp("^"+a.source+"$(?!\\s)",i)),b=void 0===b?-1>>>0:b>>>0;(e=a.exec(c))&&(f=e.index+e[0].length,!(f>j&&(h.push(c.slice(j,e.index)),!compliantExecNpcg&&e.length>1&&e[0].replace(d,function(){for(var a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(e[a]=void 0)}),e.length>1&&e.index<c.length&&Array.prototype.push.apply(h,e.slice(1)),g=e[0].length,j=f,h.length>=b)));)a.lastIndex===e.index&&a.lastIndex++;return j===c.length?(g||!a.test(""))&&h.push(""):h.push(c.slice(j)),h.length>b?h.slice(0,b):h};
45
-
46
- (function(e){var c={init:function(a){return this.each(function(){this.self=e(this);c.destroy.call(this.self);this.opt=e.extend(true,{},e.fn.raty.defaults,a);c._adjustCallback.call(this);c._adjustNumber.call(this);this.opt.starType!=="img"&&c._adjustStarType.call(this);c._adjustPath.call(this);c._createStars.call(this);this.opt.cancel&&c._createCancel.call(this);this.opt.precision&&c._adjustPrecision.call(this);c._createScore.call(this);c._apply.call(this,this.opt.score);c._target.call(this,this.opt.score);
47
- if(this.opt.readOnly)c._lock.call(this);else{this.style.cursor="pointer";c._binds.call(this)}this.self.data("options",this.opt)})},_adjustCallback:function(){for(var a=["number","readOnly","score","scoreName","target"],b=0;b<a.length;b++)if(typeof this.opt[a[b]]==="function")this.opt[a[b]]=this.opt[a[b]].call(this)},_adjustNumber:function(){this.opt.number=c._between(this.opt.number,1,this.opt.numberMax)},_adjustPath:function(){this.opt.path=this.opt.path||"";if(this.opt.path&&this.opt.path.charAt(this.opt.path.length-
48
- 1)!=="/")this.opt.path+="/"},_adjustPrecision:function(){this.opt.half=true;this.opt.targetType="score"},_adjustStarType:function(){this.opt.path="";for(var a=["cancelOff","cancelOn","starHalf","starOff","starOn"],b=0;b<a.length;b++)this.opt[a[b]]=this.opt[a[b]].replace(".","-")},_apply:function(a){c._fill.call(this,a);if(a){a>0&&this.score.val(c._between(a,0,this.opt.number));c._roundStars.call(this,a)}},_between:function(a,b,d){return Math.min(Math.max(parseFloat(a),b),d)},_binds:function(){if(this.cancel){c._bindOverCancel.call(this);
49
- c._bindClickCancel.call(this);c._bindOutCancel.call(this)}c._bindOver.call(this);c._bindClick.call(this);c._bindOut.call(this)},_bindClick:function(){var a=this;a.stars.on("click.raty",function(b){var d=e(this);a.score.val(a.opt.half||a.opt.precision?a.self.data("score"):this.alt||d.data("alt"));a.opt.click&&a.opt.click.call(a,+a.score.val(),b)})},_bindClickCancel:function(){var a=this;a.cancel.on("click.raty",function(b){a.score.removeAttr("value");a.opt.click&&a.opt.click.call(a,null,b)})},_bindOut:function(){var a=
50
- this;a.self.on("mouseleave.raty",function(b){var d=+a.score.val()||undefined;c._apply.call(a,d);c._target.call(a,d,b);a.opt.mouseout&&a.opt.mouseout.call(a,d,b)})},_bindOutCancel:function(){var a=this;a.cancel.on("mouseleave.raty",function(b){var d=a.opt.cancelOff;if(a.opt.starType!=="img")d=a.opt.cancelClass+" "+d;c._setIcon.call(a,this,d);if(a.opt.mouseout){d=+a.score.val()||undefined;a.opt.mouseout.call(a,d,b)}})},_bindOver:function(){var a=this;a.stars.on(a.opt.half?"mousemove.raty":"mouseover.raty",
51
- function(b){var d=c._getScoreByPosition.call(a,b,this);c._fill.call(a,d);if(a.opt.half){c._roundStars.call(a,d);a.self.data("score",d)}c._target.call(a,d,b);a.opt.mouseover&&a.opt.mouseover.call(a,d,b)})},_bindOverCancel:function(){var a=this;a.cancel.on("mouseover.raty",function(b){var d=a.opt.path+a.opt.starOff,f=a.opt.cancelOn;if(a.opt.starType==="img")a.stars.attr("src",d);else{f=a.opt.cancelClass+" "+f;a.stars.attr("class",d)}c._setIcon.call(a,this,f);c._target.call(a,null,b);a.opt.mouseover&&
52
- a.opt.mouseover.call(a,null)})},_buildScoreField:function(){return e("<input />",{name:this.opt.scoreName,type:"hidden"}).appendTo(this)},_createCancel:function(){var a=this.opt.path+this.opt.cancelOff,b=e("<"+this.opt.starType+" />",{title:this.opt.cancelHint,"class":this.opt.cancelClass});this.opt.starType==="img"?b.attr({src:a,alt:"x"}):b.attr("data-alt","x").addClass(a);this.opt.cancelPlace==="left"?this.self.prepend(" ").prepend(b):this.self.append(" ").append(b);this.cancel=b},_createScore:function(){var a=
53
- e(this.opt.targetScore);this.score=a.length?a:c._buildScoreField.call(this)},_createStars:function(){for(var a=1;a<=this.opt.number;a++){var b=c._nameForIndex.call(this,a);b={alt:a,src:this.opt.path+this.opt[b]};if(this.opt.starType!=="img")b={"data-alt":a,"class":b.src};b.title=c._getHint.call(this,a);e("<"+this.opt.starType+" />",b).appendTo(this);if(this.opt.space)this.self.append(a<this.opt.number?" ":"")}this.stars=this.self.children(this.opt.starType)},_error:function(a){e(this).text(a);
54
- e.error(a)},_fill:function(a){for(var b=0,d=1;d<=this.stars.length;d++){var f,g=this.stars[d-1];f=c._turnOn.call(this,d,a);if(this.opt.iconRange&&this.opt.iconRange.length>b){var h=this.opt.iconRange[b];f=c._getRangeIcon.call(this,h,f);d<=h.range&&c._setIcon.call(this,g,f);d===h.range&&b++}else{f=this.opt[f?"starOn":"starOff"];c._setIcon.call(this,g,f)}}},_getRangeIcon:function(a,b){return b?a.on||this.opt.starOn:a.off||this.opt.starOff},_getScoreByPosition:function(a,b){var d=parseInt(b.alt||b.getAttribute("data-alt"),
55
- 10);if(this.opt.half){var f=c._getSize.call(this);f=parseFloat((a.pageX-e(b).offset().left)/f);d=this.opt.precision?d-1+f:d-1+(f>0.5?1:0.5)}return d},_getSize:function(){var a;(a=this.opt.starType==="img"?this.stars[0].width:parseFloat(this.stars.eq(0).css("font-size")))||c._error.call(this,"Could not be possible get the icon size!");return a},_turnOn:function(a,b){return this.opt.single?a===b:a<=b},_getHint:function(a){var b=this.opt.hints[a-1];return b===""?"":b||a},_lock:function(){var a=parseInt(this.score.val(),
56
- 10);a=a?c._getHint.call(this,a):this.opt.noRatedMsg;this.style.cursor="";this.title=a;this.score.prop("readonly",true);this.stars.prop("title",a);this.cancel&&this.cancel.hide();this.self.data("readonly",true)},_nameForIndex:function(a){return this.opt.score&&this.opt.score>=a?"starOn":"starOff"},_roundStars:function(a){var b=(a%1).toFixed(2);if(b>this.opt.round.down){var d="starOn";if(this.opt.halfShow&&b<this.opt.round.up)d="starHalf";else if(b<this.opt.round.full)d="starOff";c._setIcon.call(this,
57
- this.stars[Math.ceil(a)-1],this.opt[d])}},_setIcon:function(a,b){a[this.opt.starType==="img"?"src":"className"]=this.opt.path+b},_setTarget:function(a,b){if(b)b=this.opt.targetFormat.toString().replace("{score}",b);a.is(":input")?a.val(b):a.html(b)},_target:function(a,b){if(this.opt.target){var d=e(this.opt.target);d.length||c._error.call(this,"Target selector invalid or missing!");var f=b&&b.type==="mouseover";if(a===undefined)a=this.opt.targetText;else if(a===null)a=f?this.opt.cancelHint:this.opt.targetText;
58
- else{if(this.opt.targetType==="hint")a=c._getHint.call(this,Math.ceil(a));else if(this.opt.precision)a=parseFloat(a).toFixed(1);var g=b&&b.type==="mousemove";if(!f&&!g&&!this.opt.targetKeep)a=this.opt.targetText}c._setTarget.call(this,d,a)}},_unlock:function(){this.style.cursor="pointer";this.removeAttribute("title");this.score.removeAttr("readonly");this.self.data("readonly",false);for(var a=0;a<this.opt.number;a++)this.stars[a].title=c._getHint.call(this,a+1);this.cancel&&this.cancel.css("display",
59
- "")},cancel:function(a){return this.each(function(){var b=e(this);if(b.data("readonly")!==true){c[a?"click":"score"].call(b,null);this.score.removeAttr("value")}})},click:function(a){return this.each(function(){if(e(this).data("readonly")!==true){c._apply.call(this,a);this.opt.click&&this.opt.click.call(this,a,e.Event("click"));c._target.call(this,a)}})},destroy:function(){return this.each(function(){var a=e(this),b=a.data("raw");b?a.off(".raty").empty().css({cursor:b.style.cursor}).removeData("readonly"):
60
- a.data("raw",a.clone()[0])})},getScore:function(){var a=[],b;this.each(function(){b=this.score.val();a.push(b?+b:undefined)});return a.length>1?a:a[0]},move:function(a){return this.each(function(){var b=parseInt(a,10),d=e(this).data("options"),f=(+a).toFixed(1).split(".")[1];if(b>=d.number){b=d.number-1;f=10}d=c._getSize.call(this)/10;b=e(this.stars[b]);f=b.offset().left+d*parseInt(f,10);f=e.Event("mousemove",{pageX:f});b.trigger(f)})},readOnly:function(a){return this.each(function(){var b=e(this);
61
- if(b.data("readonly")!==a){if(a){b.off(".raty").children("img").off(".raty");c._lock.call(this)}else{c._binds.call(this);c._unlock.call(this)}b.data("readonly",a)}})},reload:function(){return c.set.call(this,{})},score:function(){var a=e(this);return arguments.length?c.setScore.apply(a,arguments):c.getScore.call(a)},set:function(a){return this.each(function(){var b=e(this),d=b.data("options");d=e.extend({},d,a);b.raty(d)})},setScore:function(a){return this.each(function(){if(e(this).data("readonly")!==
62
- true){c._apply.call(this,a);c._target.call(this,a)}})}};e.fn.raty=function(a){if(c[a])return c[a].apply(this,Array.prototype.slice.call(arguments,1));else if(typeof a==="object"||!a)return c.init.apply(this,arguments);else e.error("Method "+a+" does not exist!")};e.fn.raty.defaults={cancel:false,cancelClass:"raty-cancel",cancelHint:"Cancel this rating!",cancelOff:"cancel-off.png",cancelOn:"cancel-on.png",cancelPlace:"left",click:undefined,half:false,halfShow:true,hints:["bad","poor","regular","good",
63
- "gorgeous"],iconRange:undefined,mouseout:undefined,mouseover:undefined,noRatedMsg:"Not rated yet!",number:5,numberMax:20,path:undefined,precision:false,readOnly:false,round:{down:0.25,full:0.6,up:0.76},score:undefined,scoreName:"score",single:false,space:true,starHalf:"star-half.png",starOff:"star-off.png",starOn:"star-on.png",starType:"img",target:undefined,targetFormat:"{score}",targetKeep:false,targetScore:undefined,targetText:"",targetType:"hint"}})(jQuery);
64
-
65
- (function(h){if(typeof define==="function"&&define.amd)define(["jquery"],h);else typeof exports==="object"?h(require("jquery")):h(jQuery)})(function(h){var z=h(window),A=h(document),v=window.location,K=/^(e|n|w|s|ne|nw|sw|se|all|crop|move|zoom)$/,L=/^(x|y|width|height)$/,M=/^(naturalWidth|naturalHeight|width|height|aspectRatio|ratio|rotate)$/,u=function(a){return typeof a==="number"},w=function(a,b){var c=[];typeof b==="number"&&c.push(b);return c.slice.apply(a,c)},x=function(a,b){var c=w(arguments,
66
- 2);return function(){return a.apply(b,c.concat(w(arguments)))}},n=function(a,b){this.element=a;this.$element=h(a);this.defaults=h.extend({},n.DEFAULTS,h.isPlainObject(b)?b:{});this.$original=null;this.replaced=this.disabled=this.rotated=this.cropped=this.built=this.ready=false;this.init()},y=Math.sqrt,p=Math.min,q=Math.max,o=Math.abs,B=Math.sin,C=Math.cos,s=parseFloat;n.prototype={constructor:n,support:{canvas:h.isFunction(h("<canvas>")[0].getContext)},init:function(){var a=this.defaults;h.each(a,
67
- function(b,c){switch(b){case "aspectRatio":a[b]=o(s(c))||NaN;break;case "autoCropArea":a[b]=o(s(c))||0.8;break;case "minWidth":case "minHeight":a[b]=o(s(c))||0;break;case "maxWidth":case "maxHeight":a[b]=o(s(c))||Infinity}});this.image={rotate:0};this.load()},load:function(){var a=this,b=this.$element,c=this.element,e=this.image,d="",g,i;if(b.is("img"))i=b.prop("src");else if(b.is("canvas")&&this.support.canvas)i=c.toDataURL();if(i){if(this.replaced)e.rotate=0;if(this.defaults.checkImageOrigin)if(b.prop("crossOrigin")||
68
- this.isCrossOriginURL(i))d=" crossOrigin";this.$clone=g=h("<img"+d+' src="'+i+'">');g.one("load",function(){e.naturalWidth=this.naturalWidth||g.width();e.naturalHeight=this.naturalHeight||g.height();e.aspectRatio=e.naturalWidth/e.naturalHeight;a.url=i;a.ready=true;a.build()});g.addClass("cropper-invisible").prependTo("body")}},isCrossOriginURL:function(a){if((a=a.match(/^(https?:)\/\/([^\:\/\?#]+):?(\d*)/i))&&(a[1]!==v.protocol||a[2]!==v.hostname||a[3]!==v.port))return true;return false},build:function(){var a=
69
- this.$element,b=this.defaults,c;if(this.ready){this.built&&this.unbuild();a.one("build.cropper",b.build);c=h.Event("build.cropper");a.trigger(c);if(!c.isDefaultPrevented()){this.$cropper=c=h(n.TEMPLATE);a.addClass("cropper-hidden");this.$clone.removeClass("cropper-invisible").prependTo(c);if(!this.rotated){this.$original=this.$clone.clone();this.$original.addClass("cropper-hidden").prependTo(this.$cropper);this.originalImage=h.extend({},this.image)}this.$container=a.parent();this.$container.append(c);
70
- this.$canvas=c.find(".cropper-canvas");this.$dragger=c.find(".cropper-dragger");this.$viewer=c.find(".cropper-viewer");b.autoCrop?this.cropped=true:this.$dragger.addClass("cropper-hidden");b.dragCrop&&this.setDragMode("crop");b.modal&&this.$canvas.addClass("cropper-modal");!b.dashed&&this.$dragger.find(".cropper-dashed").addClass("cropper-hidden");!b.movable&&this.$dragger.find(".cropper-face").data("directive","move");!b.resizable&&this.$dragger.find(".cropper-line, .cropper-point").addClass("cropper-hidden");
71
- this.addListeners();this.initPreview();this.built=true;this.update();this.replaced=false;a.one("built.cropper",b.built);a.trigger("built.cropper")}}},unbuild:function(){if(this.built){this.built=false;this.removeListeners();this.$preview.empty();this.$container=this.$canvas=this.$dragger=this.$preview=null;this.$cropper.remove();this.$cropper=null}},update:function(a){this.initContainer();this.initCropper();this.initImage();this.initDragger();if(a){this.setData(a,true);this.setDragMode("crop")}else this.setData(this.defaults.data)},
72
- resize:function(){clearTimeout(this.resizing);this.resizing=setTimeout(h.proxy(this.update,this,this.getData()),200)},preview:function(){var a=this.image,b=this.dragger,c=a.width,e=a.height,d=b.left-a.left,g=b.top-a.top;this.$viewer.find("img").css({width:c,height:e,marginLeft:-d,marginTop:-g});this.$preview.each(function(){var i=h(this),j=i.width()/b.width;i.find("img").css({width:c*j,height:e*j,marginLeft:-d*j,marginTop:-g*j})})},addListeners:function(){var a=this.defaults;this.$element.on("dragstart.cropper",
73
- a.dragstart).on("dragmove.cropper",a.dragmove).on("dragend.cropper",a.dragend);this.$cropper.on("mousedown touchstart",h.proxy(this.dragstart,this)).on("dblclick",h.proxy(this.dblclick,this));if(a.zoomable)this.$cropper.on("wheel mousewheel DOMMouseScroll",h.proxy(this.wheel,this));if(a.multiple)this.$cropper.on("mousemove touchmove",h.proxy(this.dragmove,this)).on("mouseup mouseleave touchend touchleave touchcancel",h.proxy(this.dragend,this));else A.on("mousemove touchmove",this._dragmove=x(this.dragmove,
74
- this)).on("mouseup mouseleave touchend touchleave touchcancel",this._dragend=x(this.dragend,this));z.on("resize.cropper",this._resize=x(this.resize,this))},removeListeners:function(){var a=this.defaults;this.$element.off("dragstart.cropper",a.dragstart).off("dragmove.cropper",a.dragmove).off("dragend.cropper",a.dragend);this.$cropper.off("mousedown touchstart",this.dragstart).off("dblclick",this.dblclick);a.zoomable&&this.$cropper.off("wheel mousewheel DOMMouseScroll",this.wheel);a.multiple?this.$cropper.off("mousemove touchmove",
75
- this.dragmove).off("mouseup mouseleave touchend touchleave touchcancel",this.dragend):A.off("mousemove touchmove",this._dragmove).off("mouseup mouseleave touchend touchleave touchcancel",this._dragend);z.off("resize.cropper",this._resize)},initPreview:function(){var a='<img src="'+this.url+'">';this.$preview=h(this.defaults.preview);this.$viewer.html(a);this.$preview.html(a).find("img").css("cssText","min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;")},
76
- initContainer:function(){var a=this.$container;this.container={width:q(a.width(),300),height:q(a.height(),150)}},initCropper:function(){var a=this.container,b=this.image;if(b.naturalWidth*a.height/b.naturalHeight-a.width>=0){b={width:a.width,height:a.width/b.aspectRatio,left:0};b.top=(a.height-b.height)/2}else{b={width:a.height*b.aspectRatio,height:a.height,top:0};b.left=(a.width-b.width)/2}this.$cropper.css({width:b.width,height:b.height,left:b.left,top:b.top});this.cropper=b},initImage:function(){var a=
77
- this.image,b=this.cropper,c={_width:b.width,_height:b.height,width:b.width,height:b.height,left:0,top:0,ratio:b.width/a.naturalWidth};this.defaultImage=h.extend({},a,c);if(a._width!==b.width||a._height!==b.height)h.extend(a,c);else{a=h.extend({},c,a);if(this.replaced)a.ratio=c.ratio}this.image=a;this.renderImage()},renderImage:function(a){var b=this.image;if(a==="zoom"){b.left-=(b.width-b.oldWidth)/2;b.top-=(b.height-b.oldHeight)/2}b.left=p(q(b.left,b._width-b.width),0);b.top=p(q(b.top,b._height-
78
- b.height),0);this.$clone.css({width:b.width,height:b.height,marginLeft:b.left,marginTop:b.top});if(a){this.defaults.done(this.getData());this.preview()}},initDragger:function(){var a=this.defaults,b=this.cropper,c=a.aspectRatio||this.image.aspectRatio,e=this.image.ratio,d;d=b.height*c-b.width>=0?{height:b.width/c,width:b.width,left:0,top:(b.height-b.width/c)/2,maxWidth:b.width,maxHeight:b.width/c}:{height:b.height,width:b.height*c,left:(b.width-b.height*c)/2,top:0,maxWidth:b.height*c,maxHeight:b.height};
79
- d.minWidth=0;d.minHeight=0;if(a.aspectRatio){if(isFinite(a.maxWidth)){d.maxWidth=p(d.maxWidth,a.maxWidth*e);d.maxHeight=d.maxWidth/c}else if(isFinite(a.maxHeight)){d.maxHeight=p(d.maxHeight,a.maxHeight*e);d.maxWidth=d.maxHeight*c}if(a.minWidth>0){d.minWidth=q(0,a.minWidth*e);d.minHeight=d.minWidth/c}else if(a.minHeight>0){d.minHeight=q(0,a.minHeight*e);d.minWidth=d.minHeight*c}}else{d.maxWidth=p(d.maxWidth,a.maxWidth*e);d.maxHeight=p(d.maxHeight,a.maxHeight*e);d.minWidth=q(0,a.minWidth*e);d.minHeight=
80
- q(0,a.minHeight*e)}d.minWidth=p(d.maxWidth,d.minWidth);d.minHeight=p(d.maxHeight,d.minHeight);d.height*=a.autoCropArea;d.width*=a.autoCropArea;d.left=(b.width-d.width)/2;d.top=(b.height-d.height)/2;d.oldLeft=d.left;d.oldTop=d.top;this.defaultDragger=d;this.dragger=h.extend({},d)},renderDragger:function(){var a=this.dragger,b=this.cropper;if(a.width>a.maxWidth){a.width=a.maxWidth;a.left=a.oldLeft}else if(a.width<a.minWidth){a.width=a.minWidth;a.left=a.oldLeft}if(a.height>a.maxHeight){a.height=a.maxHeight;
81
- a.top=a.oldTop}else if(a.height<a.minHeight){a.height=a.minHeight;a.top=a.oldTop}a.left=p(q(a.left,0),b.width-a.width);a.top=p(q(a.top,0),b.height-a.height);a.oldLeft=a.left;a.oldTop=a.top;this.dragger=a;this.disabled||this.defaults.done(this.getData());this.$dragger.css({width:a.width,height:a.height,left:a.left,top:a.top});this.preview()},reset:function(a){if(this.cropped){if(a)this.defaults.data={};this.image=h.extend({},this.defaultImage);this.renderImage();this.dragger=h.extend({},this.defaultDragger);
82
- this.setData(this.defaults.data)}},clear:function(){if(this.cropped){this.cropped=false;this.setData({x:0,y:0,width:0,height:0});this.$canvas.removeClass("cropper-modal");this.$dragger.addClass("cropper-hidden")}},destroy:function(){var a=this.$element;if(this.ready){this.unbuild();a.removeClass("cropper-hidden").removeData("cropper");this.rotated&&a.attr("src",this.$original.attr("src"))}},replace:function(a,b){var c=this,e=this.$element,d=this.element,g;if(a&&a!==this.url&&a!==e.attr("src")){if(!b){this.rotated=
83
- false;this.replaced=true}if(e.is("img")){e.attr("src",a);this.load()}else if(e.is("canvas")&&this.support.canvas){g=d.getContext("2d");h('<img src="'+a+'">').one("load",function(){d.width=this.width;d.height=this.height;g.clearRect(0,0,d.width,d.height);g.drawImage(this,0,0);c.load()})}}},setData:function(a,b){var c=this.cropper,e=this.dragger,d=this.image,g=this.defaults.aspectRatio;if(!(!this.built||typeof a==="undefined")){if(a===null||h.isEmptyObject(a))e=h.extend({},this.defaultDragger);if(h.isPlainObject(a)&&
84
- !h.isEmptyObject(a)){if(!b)this.defaults.data=a;a=this.transformData(a);if(u(a.x)&&a.x<=c.width-d.left)e.left=a.x+d.left;if(u(a.y)&&a.y<=c.height-d.top)e.top=a.y+d.top;if(g)if(u(a.width)&&a.width<=e.maxWidth&&a.width>=e.minWidth){e.width=a.width;e.height=e.width/g}else{if(u(a.height)&&a.height<=e.maxHeight&&a.height>=e.minHeight){e.height=a.height;e.width=e.height*g}}else{if(u(a.width)&&a.width<=e.maxWidth&&a.width>=e.minWidth)e.width=a.width;if(u(a.height)&&a.height<=e.maxHeight&&a.height>=e.minHeight)e.height=
85
- a.height}}this.dragger=e;this.renderDragger()}},getData:function(a){var b=this.dragger,c=this.image,e={};if(this.built){e={x:b.left-c.left,y:b.top-c.top,width:b.width,height:b.height};e=this.transformData(e,true,a)}return e},transformData:function(a,b,c){var e=this.image.ratio,d={};h.each(a,function(g,i){i=s(i);if(L.test(g)&&!isNaN(i))d[g]=b?c?Math.round(i/e):i/e:i*e});return d},setAspectRatio:function(a){var b=a==="auto";a=s(a);if(b||!isNaN(a)&&a>0){this.defaults.aspectRatio=b?NaN:a;if(this.built){this.initDragger();
86
- this.renderDragger()}}},getImageData:function(){var a={};this.ready&&h.each(this.image,function(b,c){if(M.test(b))a[b]=c});return a},getDataURL:function(a,b,c){var e=h("<canvas>")[0],d=this.getData(),g="";if(!h.isPlainObject(a)){c=b;b=a;a={}}a=h.extend({width:d.width,height:d.height},a);if(this.cropped&&this.support.canvas){e.width=a.width;e.height=a.height;g=e.getContext("2d");if(b==="image/jpeg"){g.fillStyle="#fff";g.fillRect(0,0,a.width,a.height)}g.drawImage(this.$clone[0],d.x,d.y,d.width,d.height,
87
- 0,0,a.width,a.height);g=e.toDataURL(b,c)}return g},setDragMode:function(a){var b=this.$canvas,c=this.defaults,e=false,d=false;if(!(!this.built||this.disabled)){switch(a){case "crop":if(c.dragCrop){e=true;b.data("directive",a)}break;case "move":d=true;b.data("directive",a);break;default:b.removeData("directive")}b.toggleClass("cropper-crop",e).toggleClass("cropper-move",d)}},enable:function(){if(this.built){this.disabled=false;this.$cropper.removeClass("cropper-disabled")}},disable:function(){if(this.built){this.disabled=
88
- true;this.$cropper.addClass("cropper-disabled")}},rotate:function(a){var b=this.image;a=s(a)||0;if(!(!this.built||a===0||this.disabled||!this.defaults.rotatable||!this.support.canvas)){this.rotated=true;a=b.rotate=(b.rotate+a)%360;this.replace(this.getRotatedDataURL(a),true)}},getRotatedDataURL:function(a){var b=h("<canvas>")[0],c=b.getContext("2d"),e=a*Math.PI/180;a=o(a)%180;var d=(a>90?180-a:a)*Math.PI/180,g=this.originalImage;a=g.naturalWidth;g=g.naturalHeight;var i=o(a*C(d)+g*B(d));d=o(a*B(d)+
89
- g*C(d));b.width=i;b.height=d;c.save();c.translate(i/2,d/2);c.rotate(e);c.drawImage(this.$original[0],-a/2,-g/2,a,g);c.restore();return b.toDataURL()},zoom:function(a){var b=this.image,c,e;a=s(a);if(!(!this.built||!a||this.disabled||!this.defaults.zoomable)){c=b.width*(1+a);a=b.height*(1+a);e=c/b._width;if(!(e>10)){if(e<1){c=b._width;a=b._height}e<=1?this.setDragMode("crop"):this.setDragMode("move");b.oldWidth=b.width;b.oldHeight=b.height;b.width=c;b.height=a;b.ratio=b.width/b.naturalWidth;this.renderImage("zoom")}}},
90
- dblclick:function(){this.disabled||(this.$canvas.hasClass("cropper-crop")?this.setDragMode("move"):this.setDragMode("crop"))},wheel:function(a){var b=a.originalEvent;if(!this.disabled){a.preventDefault();if(b.deltaY){a=b.deltaY;a=a%5===0?a/5:a%117.25===0?a/117.25:a/166.66665649414062}else a=b.wheelDelta?-b.wheelDelta/120:b.detail?b.detail/3:0;this.zoom(a*0.1)}},dragstart:function(a){var b=a.originalEvent.touches,c=a,e;if(!this.disabled){if(b){c=b.length;if(c>1)if(this.defaults.zoomable&&c===2){c=
91
- b[1];this.startX2=c.pageX;this.startY2=c.pageY;e="zoom"}else return;c=b[0]}e=e||h(c.target).data("directive");if(K.test(e)){a.preventDefault();a=h.Event("dragstart.cropper");this.$element.trigger(a);if(!a.isDefaultPrevented()){this.directive=e;this.cropping=false;this.startX=c.pageX;this.startY=c.pageY;if(e==="crop"){this.cropping=true;this.$canvas.addClass("cropper-modal")}}}}},dragmove:function(a){var b=a.originalEvent.touches,c=a;if(!this.disabled){if(b){c=b.length;if(c>1)if(this.defaults.zoomable&&
92
- c===2){c=b[1];this.endX2=c.pageX;this.endY2=c.pageY}else return;c=b[0]}if(this.directive){a.preventDefault();a=h.Event("dragmove.cropper");this.$element.trigger(a);if(!a.isDefaultPrevented()){this.endX=c.pageX;this.endY=c.pageY;this.dragging()}}}},dragend:function(a){if(!this.disabled)if(this.directive){a.preventDefault();a=h.Event("dragend.cropper");this.$element.trigger(a);if(!a.isDefaultPrevented()){if(this.cropping){this.cropping=false;this.$canvas.toggleClass("cropper-modal",this.cropped&&this.defaults.modal)}this.directive=
93
- ""}}},dragging:function(){var a=this.directive,b=this.image,c=this.cropper,e=c.width,d=c.height;c=this.dragger;var g=c.width,i=c.height,j=c.left,k=c.top,t=j+g,r=k+i,m=true,D=this.defaults,l=D.aspectRatio,f={x:this.endX-this.startX,y:this.endY-this.startY};if(l){f.X=f.y*l;f.Y=f.x/l}switch(a){case "all":j+=f.x;k+=f.y;break;case "e":if(f.x>=0&&(t>=e||l&&(k<=0||r>=d))){m=false;break}g+=f.x;if(l){i=g/l;k-=f.Y/2}if(g<0){a="w";g=0}break;case "n":if(f.y<=0&&(k<=0||l&&(j<=0||t>=e))){m=false;break}i-=f.y;k+=
94
- f.y;if(l){g=i*l;j+=f.X/2}if(i<0){a="s";i=0}break;case "w":if(f.x<=0&&(j<=0||l&&(k<=0||r>=d))){m=false;break}g-=f.x;j+=f.x;if(l){i=g/l;k+=f.Y/2}if(g<0){a="e";g=0}break;case "s":if(f.y>=0&&(r>=d||l&&(j<=0||t>=e))){m=false;break}i+=f.y;if(l){g=i*l;j-=f.X/2}if(i<0){a="n";i=0}break;case "ne":if(l){if(f.y<=0&&(k<=0||t>=e)){m=false;break}i-=f.y;k+=f.y;g=i*l}else{if(f.x>=0)if(t<e)g+=f.x;else{if(f.y<=0&&k<=0)m=false}else g+=f.x;if(f.y<=0){if(k>0){i-=f.y;k+=f.y}}else{i-=f.y;k+=f.y}}if(i<0){a="sw";g=i=0}break;
95
- case "nw":if(l){if(f.y<=0&&(k<=0||j<=0)){m=false;break}i-=f.y;k+=f.y;g=i*l;j+=f.X}else{if(f.x<=0)if(j>0){g-=f.x;j+=f.x}else{if(f.y<=0&&k<=0)m=false}else{g-=f.x;j+=f.x}if(f.y<=0){if(k>0){i-=f.y;k+=f.y}}else{i-=f.y;k+=f.y}}if(i<0){a="se";g=i=0}break;case "sw":if(l){if(f.x<=0&&(j<=0||r>=d)){m=false;break}g-=f.x;j+=f.x;i=g/l}else{if(f.x<=0)if(j>0){g-=f.x;j+=f.x}else{if(f.y>=0&&r>=d)m=false}else{g-=f.x;j+=f.x}if(f.y>=0){if(r<d)i+=f.y}else i+=f.y}if(g<0){a="ne";g=i=0}break;case "se":if(l){if(f.x>=0&&(t>=
96
- e||r>=d)){m=false;break}g+=f.x;i=g/l}else{if(f.x>=0)if(t<e)g+=f.x;else{if(f.y>=0&&r>=d)m=false}else g+=f.x;if(f.y>=0){if(r<d)i+=f.y}else i+=f.y}if(g<0){a="nw";g=i=0}break;case "move":b.left+=f.x;b.top+=f.y;this.renderImage("move");m=false;break;case "zoom":if(D.zoomable){this.zoom(function(E,F,G,H,I,J){return(y(I*I+J*J)-y(G*G+H*H))/y(E*E+F*F)}(b.width,b.height,o(this.startX-this.startX2),o(this.startY-this.startY2),o(this.endX-this.endX2),o(this.endY-this.endY2)));this.endX2=this.startX2;this.endY2=
97
- this.startY2}break;case "crop":if(f.x&&f.y){a=this.$cropper.offset();j=this.startX-a.left;k=this.startY-a.top;g=c.minWidth;i=c.minHeight;if(f.x>0)if(f.y>0)a="se";else{a="ne";k-=i}else if(f.y>0){a="sw";j-=g}else{a="nw";j-=g;k-=i}if(!this.cropped){this.cropped=true;this.$dragger.removeClass("cropper-hidden")}}}if(m){c.width=g;c.height=i;c.left=j;c.top=k;this.directive=a;this.renderDragger()}this.startX=this.endX;this.startY=this.endY}};n.TEMPLATE=function(a,b){b=b.split(",");return a.replace(/\d+/g,
98
- function(c){return b[c]})}('<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>',
99
- "div,span,directive,data,point,cropper,class,line,dashed");n.DEFAULTS={aspectRatio:"auto",autoCropArea:0.8,data:{},done:h.noop,preview:"",multiple:false,autoCrop:true,dragCrop:true,dashed:true,modal:true,movable:true,resizable:true,zoomable:true,rotatable:true,checkImageOrigin:true,minWidth:0,minHeight:0,maxWidth:Infinity,maxHeight:Infinity,build:null,built:null,dragstart:null,dragmove:null,dragend:null};n.setDefaults=function(a){h.extend(n.DEFAULTS,a)};n.other=h.fn.cropper;h.fn.cropper=function(a){var b=
100
- w(arguments,1),c;this.each(function(){var e=h(this),d=e.data("cropper"),g;d||e.data("cropper",d=new n(this,a));if(typeof a==="string"&&h.isFunction(g=d[a]))c=g.apply(d,b)});return typeof c!=="undefined"?c:this};h.fn.cropper.Constructor=n;h.fn.cropper.setDefaults=n.setDefaults;h.fn.cropper.noConflict=function(){h.fn.cropper=n.other;return this}});
101
-
102
- (function(b){function j(a,c){this.$element=b(a);this.options=c;this.enabled=true;this.fixTitle()}j.prototype={show:function(){var a=this.getTitle();if(a&&this.enabled){var c=this.tip();c.find(".tipsy-inner")[this.options.html?"html":"text"](a);c[0].className="tipsy";c.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);a=b.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight});var d=c[0].offsetWidth,h=c[0].offsetHeight,
103
- f=typeof this.options.gravity=="function"?this.options.gravity.call(this.$element[0]):this.options.gravity,g;switch(f.charAt(0)){case "n":g={top:a.top+a.height+this.options.offset,left:a.left+a.width/2-d/2};break;case "s":g={top:a.top-h-this.options.offset,left:a.left+a.width/2-d/2};break;case "e":g={top:a.top+a.height/2-h/2,left:a.left-d-this.options.offset};break;case "w":extra_gap=0;if(b("body").css("position").length>0&&b("body").css("position")=="relative")if(b("#wpadminbar").length)extra_gap=
104
- b("#wpadminbar").height();g={top:a.top+a.height/2-h/2-extra_gap,left:a.left+a.width+this.options.offset}}if(f.length==2)g.left=f.charAt(1)=="w"?a.left+a.width/2-15:a.left+a.width/2-d+15;c.css(g).addClass("tipsy-"+f);c.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+f.charAt(0);this.options.className&&c.addClass(typeof this.options.className=="function"?this.options.className.call(this.$element[0]):this.options.className);this.options.fade?c.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity}):
105
- c.css({visibility:"visible",opacity:this.options.opacity})}},hide:function(){this.options.fade?this.tip().stop().fadeOut(function(){b(this).remove()}):this.tip().remove()},fixTitle:function(){var a=this.$element;if(a.attr("title")||typeof a.attr("original-title")!="string")a.attr("original-title",a.attr("title")||"").removeAttr("title")},getTitle:function(){var a,c=this.$element,d=this.options;this.fixTitle();d=this.options;if(typeof d.title=="string")a=c.attr(d.title=="title"?"original-title":d.title);
106
- else if(typeof d.title=="function")a=d.title.call(c[0]);return(""+a).replace(/(^\s*|\s*$)/,"")||d.fallback},tip:function(){if(!this.$tip){this.$tip=b('<div class="tipsy"></div>').html('<div class="tipsy-arrow"></div><div class="tipsy-inner"></div>');this.$tip.data("tipsy-pointee",this.$element[0])}return this.$tip},validate:function(){if(!this.$element[0].parentNode){this.hide();this.options=this.$element=null}},enable:function(){this.enabled=true},disable:function(){this.enabled=false},toggleEnabled:function(){this.enabled=
107
- !this.enabled}};b.fn.tipsy=function(a){function c(e){var i=b.data(e,"tipsy");if(!i){i=new j(e,b.fn.tipsy.elementOptions(e,a));b.data(e,"tipsy",i)}return i}function d(){var e=c(this);e.hoverState="in";if(a.delayIn==0)e.show();else{e.fixTitle();setTimeout(function(){e.hoverState=="in"&&e.show()},a.delayIn)}}function h(){var e=c(this);e.hoverState="out";a.delayOut==0?e.hide():setTimeout(function(){e.hoverState=="out"&&e.hide()},a.delayOut)}if(a===true)return this.data("tipsy");else if(typeof a=="string"){var f=
108
- this.data("tipsy");if(f)f[a]();return this}a=b.extend({},b.fn.tipsy.defaults,a);a.live||this.each(function(){c(this)});if(a.trigger!="manual"){var g=a.trigger=="hover"?"mouseleave":"blur";this['on'](a.trigger=="hover"?"mouseenter":"focus",d)['on'](g,h)}return this};b.fn.tipsy.defaults={className:null,delayIn:0,delayOut:0,fade:false,fallback:"",gravity:"n",html:false,live:false,offset:0,opacity:0.8,title:"title",trigger:"hover"};b.fn.tipsy.revalidate=function(){b(".tipsy").each(function(){var a=
109
- b.data(this,"tipsy-pointee"),c;if(!(c=!a)){a:{for(;a=a.parentNode;)if(a==document){a=true;break a}a=false}c=!a}c&&b(this).remove()})};b.fn.tipsy.elementOptions=function(a,c){return b.metadata?b.extend({},c,b(a).metadata()):c};b.fn.tipsy.autoNS=function(){return b(this).offset().top>b(document).scrollTop()+b(window).height()/2?"s":"n"};b.fn.tipsy.autoWE=function(){return b(this).offset().left>b(document).scrollLeft()+b(window).width()/2?"e":"w"};b.fn.tipsy.autoBounds=function(a,c){return function(){var d=
110
- {ns:c[0],ew:c.length>1?c[1]:false},h=b(document).scrollTop()+a,f=b(document).scrollLeft()+a,g=b(this);if(g.offset().top<h)d.ns="n";if(g.offset().left<f)d.ew="w";if(b(window).width()+b(document).scrollLeft()-g.offset().left<a)d.ew="e";if(b(window).height()+b(document).scrollTop()-g.offset().top<a)d.ns="s";return d.ns+(d.ew?d.ew:"")}}})(jQuery);
111
-
112
- ;(function(f){"use strict";"function"===typeof define&&define.amd?define(["jquery"],f):"undefined"!==typeof module&&module.exports?module.exports=f(require("jquery")):f(jQuery)})(function($){"use strict";function n(a){return!a.nodeName||-1!==$.inArray(a.nodeName.toLowerCase(),["iframe","#document","html","body"])}function h(a){return $.isFunction(a)||$.isPlainObject(a)?a:{top:a,left:a}}var p=$.scrollTo=function(a,d,b){return $(window).scrollTo(a,d,b)};p.defaults={axis:"xy",duration:0,limit:!0};$.fn.scrollTo=function(a,d,b){"object"=== typeof d&&(b=d,d=0);"function"===typeof b&&(b={onAfter:b});"max"===a&&(a=9E9);b=$.extend({},p.defaults,b);d=d||b.duration;var u=b.queue&&1<b.axis.length;u&&(d/=2);b.offset=h(b.offset);b.over=h(b.over);return this.each(function(){function k(a){var k=$.extend({},b,{queue:!0,duration:d,complete:a&&function(){a.call(q,e,b)}});r.animate(f,k)}if(null!==a){var l=n(this),q=l?this.contentWindow||window:this,r=$(q),e=a,f={},t;switch(typeof e){case "number":case "string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(e)){e= h(e);break}e=l?$(e):$(e,q);if(!e.length)return;case "object":if(e.is||e.style)t=(e=$(e)).offset()}var v=$.isFunction(b.offset)&&b.offset(q,e)||b.offset;$.each(b.axis.split(""),function(a,c){var d="x"===c?"Left":"Top",m=d.toLowerCase(),g="scroll"+d,h=r[g](),n=p.max(q,c);t?(f[g]=t[m]+(l?0:h-r.offset()[m]),b.margin&&(f[g]-=parseInt(e.css("margin"+d),10)||0,f[g]-=parseInt(e.css("border"+d+"Width"),10)||0),f[g]+=v[m]||0,b.over[m]&&(f[g]+=e["x"===c?"width":"height"]()*b.over[m])):(d=e[m],f[g]=d.slice&& "%"===d.slice(-1)?parseFloat(d)/100*n:d);b.limit&&/^\d+$/.test(f[g])&&(f[g]=0>=f[g]?0:Math.min(f[g],n));!a&&1<b.axis.length&&(h===f[g]?f={}:u&&(k(b.onAfterFirst),f={}))});k(b.onAfter)}})};p.max=function(a,d){var b="x"===d?"Width":"Height",h="scroll"+b;if(!n(a))return a[h]-$(a)[b.toLowerCase()]();var b="client"+b,k=a.ownerDocument||a.document,l=k.documentElement,k=k.body;return Math.max(l[h],k[h])-Math.min(l[b],k[b])};$.Tween.propHooks.scrollLeft=$.Tween.propHooks.scrollTop={get:function(a){return $(a.elem)[a.prop]()}, set:function(a){var d=this.get(a);if(a.options.interrupt&&a._last&&a._last!==d)return $(a.elem).stop();var b=Math.round(a.now);d!==b&&($(a.elem)[a.prop](b),a._last=this.get(a))}};return p});
113
-
114
- var live_field;var live_value;function um_conditional(){jQuery('.um-field.um-is-conditional').each(function(){for(var i = 0;i < 5;i++){var action0 = jQuery(this).data('cond-'+i+'-action');var field0 = jQuery(this).data('cond-'+i+'-field');var operator0 = jQuery(this).data('cond-'+i+'-operator');var value0 = jQuery(this).data('cond-'+i+'-value');if(action0 == 'show' && field0 == live_field){if(operator0 == 'empty'){if(!live_value||live_value == ''){jQuery(this).fadeIn()}else{jQuery(this).hide()}}if(operator0 == 'not empty'){if(live_value&&live_value!= ''){jQuery(this).fadeIn()}else{jQuery(this).hide()}}if(operator0 == 'equals to'){if(value0 == live_value){jQuery(this).fadeIn()}else{jQuery(this).hide()}}if(operator0 == 'not equals'){if(jQuery.isNumeric(value0) && parseInt(live_value)!= parseInt(value0) && live_value){jQuery(this).fadeIn()}else if(!jQuery.isNumeric(value0) && value0!= live_value){jQuery(this).fadeIn()}else{jQuery(this).hide()}}if(operator0 == 'greater than'){if(jQuery.isNumeric(value0) && parseInt(live_value)>parseInt(value0)){jQuery(this).fadeIn()}else{jQuery(this).hide()}}if(operator0 == 'less than'){if(jQuery.isNumeric(value0) && parseInt(live_value) < parseInt(value0) && live_value){jQuery(this).fadeIn()}else{jQuery(this).hide()}}if(operator0 == 'contains'){if(live_value && live_value.indexOf(value0)>= 0){jQuery(this).fadeIn()}else{jQuery(this).hide()}}}if(action0 == 'hide' && field0 == live_field){if(operator0 == 'empty'){if(!live_value||live_value == ''){jQuery(this).hide()}else{jQuery(this).fadeIn()}}if(operator0 == 'not empty'){if(live_value&&live_value!= ''){jQuery(this).hide()}else{jQuery(this).fadeIn()}}if(operator0 == 'equals to'){if(value0 == live_value){jQuery(this).hide()}else{jQuery(this).fadeIn()}}if(operator0 == 'not equals'){if(jQuery.isNumeric(value0) && parseInt(live_value)!= parseInt(value0) && live_value){jQuery(this).hide()}else if(!jQuery.isNumeric(value0) && value0!= live_value){jQuery(this).hide()}else{jQuery(this).fadeIn()}}if(operator0 == 'greater than'){if(jQuery.isNumeric(value0) && parseInt(live_value)>parseInt(value0)){jQuery(this).hide()}else{jQuery(this).fadeIn()}}if(operator0 == 'less than'){if(jQuery.isNumeric(value0) && parseInt(live_value) < parseInt(value0) && live_value){jQuery(this).hide()}else{jQuery(this).fadeIn()}}if(operator0 == 'contains'){if(live_value && live_value.indexOf(value0)>= 0){jQuery(this).hide()}else{jQuery(this).fadeIn()}}}}})}function UM_hide_menus(){menu = jQuery('.um-dropdown');menu.parents('div').find('a').removeClass('active');menu.hide()}function UM_domenus(){jQuery('.um-dropdown').each(function(){var menu = jQuery(this);var element = jQuery(this).attr('data-element');var position = jQuery(this).attr('data-position');jQuery(element).addClass('um-trigger-menu-on-'+menu.attr('data-trigger'));if(jQuery(window).width() <= 1200 && element == 'div.um-profile-edit'){position = 'lc'}if(position == 'lc'){if(200>jQuery(element).find('img').width()){left_p =((jQuery(element).width() - jQuery(element).find('img').width()) / 2)+((jQuery(element).find('img').width() - 200) / 2)}else{left_p =((jQuery(element).width() - jQuery(element).find('img').width()) / 2)}top_ = parseInt(jQuery(element).find('a').css('top'));if(top_){top_p = jQuery(element).find('img').height()+4+top_;left_gap = 4}else{top_p = jQuery(element).find('img').height()+4;left_gap = 0}if(top_p == 4 && element == 'div.um-cover'){top_p = jQuery(element).height() / 2+(menu.height() / 2)}else if(top_p == 4){top_p = jQuery(element).height()+20}gap_right = jQuery(element).width()+17;menu.css({'top':0,'width':200,'left':'auto','right':gap_right+'px','text-align':'center'});menu.find('.um-dropdown-arr').find('i').removeClass().addClass('um-icon-arrow-right-b');menu.find('.um-dropdown-arr').css({'top':'4px','left':'auto','right':'-17px'})}if(position == 'bc'){if(200>jQuery(element).find('img').width()){left_p =((jQuery(element).width() - jQuery(element).find('img').width()) / 2)+((jQuery(element).find('img').width() - 200) / 2)}else{left_p =((jQuery(element).width() - jQuery(element).find('img').width()) / 2)}top_ = parseInt(jQuery(element).find('a').css('top'));if(top_){top_p = jQuery(element).find('img').height()+4+top_;left_gap = 4}else{top_p = jQuery(element).find('img').height()+4;left_gap = 0}if(top_p == 4 && element == 'div.um-cover'){top_p = jQuery(element).height() / 2+(menu.height() / 2)}else if(top_p == 4){top_p = jQuery(element).height()+20}menu.css({'top':top_p,'width':200,'left':left_p+left_gap,'right':'auto','text-align':'center'});menu.find('.um-dropdown-arr').find('i').removeClass().addClass('um-icon-arrow-up-b');menu.find('.um-dropdown-arr').css({'top':'-17px','left':(menu.width() / 2) - 12,'right':'auto'})}})}function um_responsive(){jQuery('.um').each(function(){element_width = jQuery(this).width();if(element_width <= 340){jQuery(this).removeClass('uimob340');jQuery(this).removeClass('uimob500');jQuery(this).removeClass('uimob800');jQuery(this).removeClass('uimob960');jQuery(this).addClass('uimob340')}else if(element_width <= 500){jQuery(this).removeClass('uimob340');jQuery(this).removeClass('uimob500');jQuery(this).removeClass('uimob800');jQuery(this).removeClass('uimob960');jQuery(this).addClass('uimob500')}else if(element_width <= 800){jQuery(this).removeClass('uimob340');jQuery(this).removeClass('uimob500');jQuery(this).removeClass('uimob800');jQuery(this).removeClass('uimob960');jQuery(this).addClass('uimob800')}else if(element_width <= 960){jQuery(this).removeClass('uimob340');jQuery(this).removeClass('uimob500');jQuery(this).removeClass('uimob800');jQuery(this).removeClass('uimob960');jQuery(this).addClass('uimob960')}else if(element_width>960){jQuery(this).removeClass('uimob340');jQuery(this).removeClass('uimob500');jQuery(this).removeClass('uimob800');jQuery(this).removeClass('uimob960')}if(jQuery('.um-account-nav').length>0 && jQuery('.um-account-side').is(':visible') && jQuery('.um-account-tab:visible').length == 0){jQuery('.um-account-side li a.current').trigger('click')}jQuery(this).css('opacity',1)});jQuery('.um-cover,.um-member-cover').each(function(){var elem = jQuery(this);var ratio = elem.data('ratio');var width = elem.width();var ratios = ratio.split(':');calcHeight = Math.round(width / ratios[0])+'px';elem.height(calcHeight);elem.find('.um-cover-add').height(calcHeight)});jQuery('.um-members').each(function(){UM_Member_Grid(jQuery(this))});UM_domenus()}function UM_Member_Grid(container){container.masonry({itemSelector:'.um-member',columnWidth:'.um-member',gutter:'.um-gutter-sizer'})}function initImageUpload_UM(trigger){if(trigger.data('upload_help_text')){upload_help_text = '<span class="help">'+trigger.data('upload_help_text')+'</span>'}else{upload_help_text = ''}if(trigger.data('icon')){icon = '<span class="icon"><i class="'+trigger.data('icon')+'"></i></span>'}else{icon = ''}if(trigger.data('upload_text')){upload_text = '<span class="str">'+trigger.data('upload_text')+'</span>'}else{upload_text = ''}trigger.uploadFile({url:um_scripts.imageupload,method:"POST",multiple:false,formData:{key:trigger.data('key'),set_id:trigger.data('set_id'),set_mode:trigger.data('set_mode')},fileName:trigger.data('key'),allowedTypes:trigger.data('allowed_types'),maxFileSize:trigger.data('max_size'),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:trigger.data('max_size_error'),extErrorStr:trigger.data('extension_error'),maxFileCountErrorStr:trigger.data('max_files_error'),maxFileCount:1,showDelete:false,showAbort:false,showDone:false,showFileCounter:false,showStatusAfterSuccess:true,onSubmit:function(files){trigger.parents('.um-modal-body').find('.um-error-block').remove()},onSuccess:function(files,data,xhr){trigger.selectedFiles = 0;data = jQuery.parseJSON(data);if(data.error && data.error!= ''){trigger.parents('.um-modal-body').append('<div class="um-error-block">'+data.error+'</div>');trigger.parents('.um-modal-body').find('.upload-statusbar').hide(0);um_modal_responsive()}else{jQuery.each(data,function(key,value){var img_id = trigger.parents('.um-modal-body').find('.um-single-image-preview img');var img_id_h = trigger.parents('.um-modal-body').find('.um-single-image-preview');img_id.attr("src",value);img_id.load(function(){trigger.parents('.um-modal-body').find('.um-modal-btn.um-finish-upload.disabled').removeClass('disabled');trigger.parents('.um-modal-body').find('.ajax-upload-dragdrop,.upload-statusbar').hide(0);img_id_h.show(0);um_modal_responsive()})})}}})}function initFileUpload_UM(trigger){if(trigger.data('upload_help_text')){upload_help_text = '<span class="help">'+trigger.data('upload_help_text')+'</span>'}else{upload_help_text = ''}if(trigger.data('icon')){icon = '<span class="icon"><i class="'+trigger.data('icon')+'"></i></span>'}else{icon = ''}if(trigger.data('upload_text')){upload_text = '<span class="str">'+trigger.data('upload_text')+'</span>'}else{upload_text = ''}trigger.uploadFile({url:um_scripts.fileupload,method:"POST",multiple:false,formData:{key:trigger.data('key'),set_id:trigger.data('set_id'),set_mode:trigger.data('set_mode')},fileName:trigger.data('key'),allowedTypes:trigger.data('allowed_types'),maxFileSize:trigger.data('max_size'),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:trigger.data('max_size_error'),extErrorStr:trigger.data('extension_error'),maxFileCountErrorStr:trigger.data('max_files_error'),maxFileCount:1,showDelete:false,showAbort:false,showDone:false,showFileCounter:false,showStatusAfterSuccess:true,onSubmit:function(files){trigger.parents('.um-modal-body').find('.um-error-block').remove()},onSuccess:function(files,data,xhr){trigger.selectedFiles = 0;data = jQuery.parseJSON(data);if(data.error && data.error!= ''){trigger.parents('.um-modal-body').append('<div class="um-error-block">'+data.error+'</div>');trigger.parents('.um-modal-body').find('.upload-statusbar').hide(0);um_modal_responsive()}else{jQuery.each(data,function(key,value){trigger.parents('.um-modal-body').find('.um-modal-btn.um-finish-upload.disabled').removeClass('disabled');trigger.parents('.um-modal-body').find('.ajax-upload-dragdrop,.upload-statusbar').hide(0);trigger.parents('.um-modal-body').find('.um-single-file-preview').show(0);if(key == 'icon'){trigger.parents('.um-modal-body').find('.um-single-fileinfo i').removeClass().addClass(value)}else if(key == 'icon_bg'){trigger.parents('.um-modal-body').find('.um-single-fileinfo span.icon').css({'background-color':value})}else if(key == 'filename'){trigger.parents('.um-modal-body').find('.um-single-fileinfo span.filename').html(value)}else{trigger.parents('.um-modal-body').find('.um-single-fileinfo a').attr('href',value)}});um_modal_responsive()}}})}function initCrop_UM(){var target_img = jQuery('.um-modal:visible .um-single-image-preview img');var target_img_parent = jQuery('.um-modal:visible .um-single-image-preview');var crop_data = target_img.parent().attr('data-crop');var min_width = target_img.parent().attr('data-min_width');var min_height = target_img.parent().attr('data-min_height');var ratio = target_img.parent().attr('data-ratio');if(jQuery('.um-modal').find('#um_upload_single').attr('data-ratio')){var ratio = jQuery('.um-modal').find('#um_upload_single').attr('data-ratio');var ratio_split = ratio.split(':');var ratio = ratio_split[0]}if(target_img.length){if(target_img.attr('src')!= ''){var max_height = jQuery(window).height() -(jQuery('.um-modal-footer a').height()+20) - 50 -(jQuery('.um-modal-header:visible').height());target_img.css({'height':'auto'});target_img_parent.css({'height':'auto'});if(jQuery(window).height() <= 400){target_img_parent.css({'height':max_height+'px','max-height':max_height+'px'});target_img.css({'height':'auto'})}else{target_img.css({'height':'auto','max-height':max_height+'px'});target_img_parent.css({'height':target_img.height(),'max-height':max_height+'px'})}if(crop_data == 'square'){var opts ={minWidth:min_width,minHeight:min_height,dragCrop:false,aspectRatio:1.0,zoomable:false,rotatable:false,dashed:false,done:function(data){target_img.parent().attr('data-coord',Math.round(data.x)+','+Math.round(data.y)+','+Math.round(data.width)+','+Math.round(data.height))}}}else if(crop_data == 'cover'){var opts ={minWidth:min_width,minHeight:Math.round(min_width / ratio),dragCrop:false,aspectRatio:ratio,zoomable:false,rotatable:false,dashed:false,done:function(data){target_img.parent().attr('data-coord',Math.round(data.x)+','+Math.round(data.y)+','+Math.round(data.width)+','+Math.round(data.height))}}}else if(crop_data == 'user'){var opts ={minWidth:min_width,minHeight:min_height,dragCrop:true,aspectRatio:"auto",zoomable:false,rotatable:false,dashed:false,done:function(data){target_img.parent().attr('data-coord',Math.round(data.x)+','+Math.round(data.y)+','+Math.round(data.width)+','+Math.round(data.height))}}}if(crop_data!= 0){target_img.cropper(opts)}}}}function um_new_modal(id,size,isPhoto,source){var modal = jQuery('body').find('.um-modal-overlay');if(modal.length == 0){jQuery('.tipsy').hide();UM_hide_menus();jQuery('body,html,textarea').css("overflow","hidden");jQuery(document).bind("touchmove",function(e){e.preventDefault()});jQuery('.um-modal').on('touchmove',function(e){e.stopPropagation()});if(isPhoto){jQuery('body').append('<div class="um-modal-overlay" ></div><div class="um-modal is-photo" ></div>')}else{jQuery('body').append('<div class="um-modal-overlay" ></div><div class="um-modal no-photo" ></div>')}jQuery('#'+id).prependTo('.um-modal');if(isPhoto){jQuery('.um-modal').find('.um-modal-photo').html('<img />');var photo_ = jQuery('.um-modal-photo img');var photo_maxw = jQuery(window).width() - 60;var photo_maxh = jQuery(window).height() -(jQuery(window).height() * .25);photo_.attr("src",source);photo_.load(function(){jQuery('#'+id).show();jQuery('.um-modal').show();photo_.css({'opacity':0});photo_.css({'max-width':photo_maxw});photo_.css({'max-height':photo_maxh});jQuery('.um-modal').css({'width':photo_.width(),'margin-left':'-'+photo_.width() / 2+'px'});photo_.animate({'opacity':1},1000);um_modal_responsive()})}else{jQuery('#'+id).show();jQuery('.um-modal').show();um_modal_size(size);initImageUpload_UM(jQuery('.um-modal:visible').find('.um-single-image-upload'));initFileUpload_UM(jQuery('.um-modal:visible').find('.um-single-file-upload'));um_modal_responsive()}}}function um_modal_responsive(){var modal = jQuery('.um-modal:visible');var photo_modal = jQuery('.um-modal-body.photo:visible');if(photo_modal.length){modal.removeClass('uimob340');modal.removeClass('uimob500');var photo_ = jQuery('.um-modal-photo img');var photo_maxw = jQuery(window).width() - 60;var photo_maxh = jQuery(window).height() -(jQuery(window).height() * .25);photo_.css({'opacity':0});photo_.css({'max-width':photo_maxw});photo_.css({'max-height':photo_maxh});jQuery('.um-modal').css({'width':photo_.width(),'margin-left':'-'+photo_.width() / 2+'px'});photo_.animate({'opacity':1},1000);var half_gap =(jQuery(window).height() - modal.innerHeight()) / 2+'px';modal.animate({'bottom':half_gap},300)}else if(modal.length){var element_width = jQuery(window).width();modal.removeClass('uimob340');modal.removeClass('uimob500');if(element_width <= 340){modal.addClass('uimob340');initCrop_UM();modal.animate({'bottom':0},300)}else if(element_width <= 500){modal.addClass('uimob500');initCrop_UM();modal.animate({'bottom':0},300)}else if(element_width <= 800){initCrop_UM();var half_gap =(jQuery(window).height() - modal.innerHeight()) / 2+'px';modal.animate({'bottom':half_gap},300)}else if(element_width <= 960){initCrop_UM();var half_gap =(jQuery(window).height() - modal.innerHeight()) / 2+'px';modal.animate({'bottom':half_gap},300)}else if(element_width>960){initCrop_UM();var half_gap =(jQuery(window).height() - modal.innerHeight()) / 2+'px';modal.animate({'bottom':half_gap},300)}}}function um_remove_modal(){jQuery('img.cropper-hidden').cropper('destroy');jQuery('body,html,textarea').css("overflow","auto");jQuery(document).unbind('touchmove');jQuery('.um-modal div[id^="um_"]').hide().appendTo('body');jQuery('.um-modal,.um-modal-overlay').remove()}function um_modal_size(aclass){jQuery('.um-modal:visible').addClass(aclass)}function um_modal_add_attr(id,value){jQuery('.um-modal:visible').data(id,value)}
115
-
116
- /* == jquery mousewheel plugin == Version: 3.1.12, License: MIT License (MIT) */
117
- !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
118
- /* == malihu jquery custom scrollbar plugin == Version: 3.0.8, License: MIT License (MIT) */
119
- !function(e){"undefined"!=typeof module&&module.exports?module.exports=e:e(jQuery,window,document)}(function(e){!function(t){var o="function"==typeof define&&define.amd,a="undefined"!=typeof module&&module.exports,n="https:"==document.location.protocol?"https:":"http:",i="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js";o||(a?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+n+"//"+i+"%3E%3C/script%3E"))),t()}(function(){var t,o="mCustomScrollbar",a="mCS",n=".mCustomScrollbar",i={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}},r=0,l={},s=window.attachEvent&&!window.addEventListener?1:0,c=!1,d=["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"],u={init:function(t){var t=e.extend(!0,{},i,t),o=f.call(this);if(t.live){var s=t.liveSelector||this.selector||n,c=e(s);if("off"===t.live)return void m(s);l[s]=setTimeout(function(){c.mCustomScrollbar(t),"once"===t.live&&c.length&&m(s)},500)}else m(s);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":p(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),h(t),e(o).each(function(){var o=e(this);if(!o.data(a)){o.data(a,{idx:++r,opt:t,scrollRatio:{y:null,x:null},overflowed:null,contentReset:{y:null,x:null},bindEvents:!1,tweenRunning:!1,sequential:{},langDir:o.css("direction"),cbOffsets:null,trigger:null});var n=o.data(a),i=n.opt,l=o.data("mcs-axis"),s=o.data("mcs-scrollbar-position"),c=o.data("mcs-theme");l&&(i.axis=l),s&&(i.scrollbarPosition=s),c&&(i.theme=c,h(i)),v.call(this),e("#mCSB_"+n.idx+"_container img:not(."+d[2]+")").addClass(d[2]),u.update.call(null,o)}})},update:function(t,o){var n=t||f.call(this);return e(n).each(function(){var t=e(this);if(t.data(a)){var n=t.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container"),l=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];if(!r.length)return;n.tweenRunning&&V(t),t.hasClass(d[3])&&t.removeClass(d[3]),t.hasClass(d[4])&&t.removeClass(d[4]),S.call(this),_.call(this),"y"===i.axis||i.advanced.autoExpandHorizontalScroll||r.css("width",x(r.children())),n.overflowed=B.call(this),O.call(this),i.autoDraggerLength&&b.call(this),C.call(this),k.call(this);var s=[Math.abs(r[0].offsetTop),Math.abs(r[0].offsetLeft)];"x"!==i.axis&&(n.overflowed[0]?l[0].height()>l[0].parent().height()?T.call(this):(Q(t,s[0].toString(),{dir:"y",dur:0,overwrite:"none"}),n.contentReset.y=null):(T.call(this),"y"===i.axis?M.call(this):"yx"===i.axis&&n.overflowed[1]&&Q(t,s[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==i.axis&&(n.overflowed[1]?l[1].width()>l[1].parent().width()?T.call(this):(Q(t,s[1].toString(),{dir:"x",dur:0,overwrite:"none"}),n.contentReset.x=null):(T.call(this),"x"===i.axis?M.call(this):"yx"===i.axis&&n.overflowed[0]&&Q(t,s[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),o&&n&&(2===o&&i.callbacks.onImageLoad&&"function"==typeof i.callbacks.onImageLoad?i.callbacks.onImageLoad.call(this):3===o&&i.callbacks.onSelectorChange&&"function"==typeof i.callbacks.onSelectorChange?i.callbacks.onSelectorChange.call(this):i.callbacks.onUpdate&&"function"==typeof i.callbacks.onUpdate&&i.callbacks.onUpdate.call(this)),X.call(this)}})},scrollTo:function(t,o){if("undefined"!=typeof t&&null!=t){var n=f.call(this);return e(n).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l={trigger:"external",scrollInertia:r.scrollInertia,scrollEasing:"mcsEaseInOut",moveDragger:!1,timeout:60,callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},s=e.extend(!0,{},l,o),c=Y.call(this,t),d=s.scrollInertia>0&&s.scrollInertia<17?17:s.scrollInertia;c[0]=j.call(this,c[0],"y"),c[1]=j.call(this,c[1],"x"),s.moveDragger&&(c[0]*=i.scrollRatio.y,c[1]*=i.scrollRatio.x),s.dur=d,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==r.axis&&i.overflowed[0]&&(s.dir="y",s.overwrite="all",Q(n,c[0].toString(),s)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==r.axis&&i.overflowed[1]&&(s.dir="x",s.overwrite="none",Q(n,c[1].toString(),s))},s.timeout)}})}},stop:function(){var t=f.call(this);return e(t).each(function(){var t=e(this);t.data(a)&&V(t)})},disable:function(t){var o=f.call(this);return e(o).each(function(){var o=e(this);if(o.data(a)){{o.data(a)}X.call(this,"remove"),M.call(this),t&&T.call(this),O.call(this,!0),o.addClass(d[3])}})},destroy:function(){var t=f.call(this);return e(t).each(function(){var n=e(this);if(n.data(a)){var i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx),s=e("#mCSB_"+i.idx+"_container"),c=e(".mCSB_"+i.idx+"_scrollbar");r.live&&m(r.liveSelector||e(t).selector),X.call(this,"remove"),M.call(this),T.call(this),n.removeData(a),Z(this,"mcs"),c.remove(),s.find("img."+d[2]).removeClass(d[2]),l.replaceWith(s.contents()),n.removeClass(o+" _"+a+"_"+i.idx+" "+d[6]+" "+d[7]+" "+d[5]+" "+d[3]).addClass(d[4])}})}},f=function(){return"object"!=typeof e(this)||e(this).length<1?n:this},h=function(t){var o=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],a=["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"],n=["minimal","minimal-dark"],i=["minimal","minimal-dark"],r=["minimal","minimal-dark"];t.autoDraggerLength=e.inArray(t.theme,o)>-1?!1:t.autoDraggerLength,t.autoExpandScrollbar=e.inArray(t.theme,a)>-1?!1:t.autoExpandScrollbar,t.scrollButtons.enable=e.inArray(t.theme,n)>-1?!1:t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,i)>-1?!0:t.autoHideScrollbar,t.scrollbarPosition=e.inArray(t.theme,r)>-1?"outside":t.scrollbarPosition},m=function(e){l[e]&&(clearTimeout(l[e]),Z(l,e))},p=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),n=t.data(a),i=n.opt,r=i.autoExpandScrollbar?" "+d[1]+"_expand":"",l=["<div id='mCSB_"+n.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+n.idx+"_scrollbar mCS-"+i.theme+" mCSB_scrollTools_vertical"+r+"'><div class='"+d[12]+"'><div id='mCSB_"+n.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_"+n.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+n.idx+"_scrollbar mCS-"+i.theme+" mCSB_scrollTools_horizontal"+r+"'><div class='"+d[12]+"'><div id='mCSB_"+n.idx+"_dragger_horizontal' class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' /></div><div class='mCSB_draggerRail' /></div></div>"],s="yx"===i.axis?"mCSB_vertical_horizontal":"x"===i.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===i.axis?l[0]+l[1]:"x"===i.axis?l[1]:l[0],u="yx"===i.axis?"<div id='mCSB_"+n.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",f=i.autoHideScrollbar?" "+d[6]:"",h="x"!==i.axis&&"rtl"===n.langDir?" "+d[7]:"";i.setWidth&&t.css("width",i.setWidth),i.setHeight&&t.css("height",i.setHeight),i.setLeft="y"!==i.axis&&"rtl"===n.langDir?"989999px":i.setLeft,t.addClass(o+" _"+a+"_"+n.idx+f+h).wrapInner("<div id='mCSB_"+n.idx+"' class='mCustomScrollBox mCS-"+i.theme+" "+s+"'><div id='mCSB_"+n.idx+"_container' class='mCSB_container' style='position:relative; top:"+i.setTop+"; left:"+i.setLeft+";' dir="+n.langDir+" /></div>");var m=e("#mCSB_"+n.idx),p=e("#mCSB_"+n.idx+"_container");"y"===i.axis||i.advanced.autoExpandHorizontalScroll||p.css("width",x(p.children())),"outside"===i.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),m.addClass("mCSB_outside").after(c)):(m.addClass("mCSB_inside").append(c),p.wrap(u)),w.call(this);var g=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];g[0].css("min-height",g[0].height()),g[1].css("min-width",g[1].width())},x=function(t){return Math.max.apply(Math,t.map(function(){return e(this).outerWidth(!0)}).get())},_=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx+"_container");n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis&&i.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(i[0].getBoundingClientRect().right+.4)-Math.floor(i[0].getBoundingClientRect().left),position:"relative"}).unwrap()},w=function(){var t=e(this),o=t.data(a),n=o.opt,i=e(".mCSB_"+o.idx+"_scrollbar:first"),r=tt(n.scrollButtons.tabindex)?"tabindex='"+n.scrollButtons.tabindex+"'":"",l=["<a href='#' class='"+d[13]+"' oncontextmenu='return false;' "+r+" />","<a href='#' class='"+d[14]+"' oncontextmenu='return false;' "+r+" />","<a href='#' class='"+d[15]+"' oncontextmenu='return false;' "+r+" />","<a href='#' class='"+d[16]+"' oncontextmenu='return false;' "+r+" />"],s=["x"===n.axis?l[2]:l[0],"x"===n.axis?l[3]:l[1],l[2],l[3]];n.scrollButtons.enable&&i.prepend(s[0]).append(s[1]).next(".mCSB_scrollTools").prepend(s[2]).append(s[3])},S=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=t.css("max-height")||"none",r=-1!==i.indexOf("%"),l=t.css("box-sizing");if("none"!==i){var s=r?t.parent().height()*parseInt(i)/100:parseInt(i);"border-box"===l&&(s-=t.innerHeight()-t.height()+(t.outerHeight()-t.innerHeight())),n.css("max-height",Math.round(s))}},b=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[n.height()/i.outerHeight(!1),n.width()/i.outerWidth(!1)],c=[parseInt(r[0].css("min-height")),Math.round(l[0]*r[0].parent().height()),parseInt(r[1].css("min-width")),Math.round(l[1]*r[1].parent().width())],d=s&&c[1]<c[0]?c[0]:c[1],u=s&&c[3]<c[2]?c[2]:c[3];r[0].css({height:d,"max-height":r[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":c[0]+"px"}),r[1].css({width:u,"max-width":r[1].parent().width()-10})},C=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")],l=[i.outerHeight(!1)-n.height(),i.outerWidth(!1)-n.width()],s=[l[0]/(r[0].parent().height()-r[0].height()),l[1]/(r[1].parent().width()-r[1].width())];o.scrollRatio={y:s[0],x:s[1]}},y=function(e,t,o){var a=o?d[0]+"_expanded":"",n=e.closest(".mCSB_scrollTools");"active"===t?(e.toggleClass(d[0]+" "+a),n.toggleClass(d[1]),e[0]._draggable=e[0]._draggable?0:1):e[0]._draggable||("hide"===t?(e.removeClass(d[0]),n.removeClass(d[1])):(e.addClass(d[0]),n.addClass(d[1])))},B=function(){var t=e(this),o=t.data(a),n=e("#mCSB_"+o.idx),i=e("#mCSB_"+o.idx+"_container"),r=null==o.overflowed?i.height():i.outerHeight(!1),l=null==o.overflowed?i.width():i.outerWidth(!1);return[r>n.height(),l>n.width()]},T=function(){var t=e(this),o=t.data(a),n=o.opt,i=e("#mCSB_"+o.idx),r=e("#mCSB_"+o.idx+"_container"),l=[e("#mCSB_"+o.idx+"_dragger_vertical"),e("#mCSB_"+o.idx+"_dragger_horizontal")];if(V(t),("x"!==n.axis&&!o.overflowed[0]||"y"===n.axis&&o.overflowed[0])&&(l[0].add(r).css("top",0),Q(t,"_resetY")),"y"!==n.axis&&!o.overflowed[1]||"x"===n.axis&&o.overflowed[1]){var s=dx=0;"rtl"===o.langDir&&(s=i.width()-r.outerWidth(!1),dx=Math.abs(s/o.scrollRatio.x)),r.css("left",s),l[1].css("left",dx),Q(t,"_resetX")}},k=function(){function t(){r=setTimeout(function(){e.event.special.mousewheel?(clearTimeout(r),W.call(o[0])):t()},100)}var o=e(this),n=o.data(a),i=n.opt;if(!n.bindEvents){if(R.call(this),i.contentTouchScroll&&E.call(this),D.call(this),i.mouseWheel.enable){var r;t()}P.call(this),H.call(this),i.advanced.autoScrollOnFocus&&z.call(this),i.scrollButtons.enable&&U.call(this),i.keyboard.enable&&q.call(this),n.bindEvents=!0}},M=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=".mCSB_"+o.idx+"_scrollbar",l=e("#mCSB_"+o.idx+",#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,"+r+" ."+d[12]+",#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal,"+r+">a"),s=e("#mCSB_"+o.idx+"_container");n.advanced.releaseDraggableSelectors&&l.add(e(n.advanced.releaseDraggableSelectors)),o.bindEvents&&(e(document).unbind("."+i),l.each(function(){e(this).unbind("."+i)}),clearTimeout(t[0]._focusTimeout),Z(t[0],"_focusTimeout"),clearTimeout(o.sequential.step),Z(o.sequential,"step"),clearTimeout(s[0].onCompleteTimeout),Z(s[0],"onCompleteTimeout"),o.bindEvents=!1)},O=function(t){var o=e(this),n=o.data(a),i=n.opt,r=e("#mCSB_"+n.idx+"_container_wrapper"),l=r.length?r:e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_scrollbar_vertical"),e("#mCSB_"+n.idx+"_scrollbar_horizontal")],c=[s[0].find(".mCSB_dragger"),s[1].find(".mCSB_dragger")];"x"!==i.axis&&(n.overflowed[0]&&!t?(s[0].add(c[0]).add(s[0].children("a")).css("display","block"),l.removeClass(d[8]+" "+d[10])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[0].css("display","none"),l.removeClass(d[10])):(s[0].css("display","none"),l.addClass(d[10])),l.addClass(d[8]))),"y"!==i.axis&&(n.overflowed[1]&&!t?(s[1].add(c[1]).add(s[1].children("a")).css("display","block"),l.removeClass(d[9]+" "+d[11])):(i.alwaysShowScrollbar?(2!==i.alwaysShowScrollbar&&c[1].css("display","none"),l.removeClass(d[11])):(s[1].css("display","none"),l.addClass(d[11])),l.addClass(d[9]))),n.overflowed[0]||n.overflowed[1]?o.removeClass(d[5]):o.addClass(d[5])},I=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 o=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0],a=e.originalEvent.touches.length||e.originalEvent.changedTouches.length;return e.target.ownerDocument!==document?[o.screenY,o.screenX,a>1]:[o.pageY,o.pageX,a>1];default:return[e.pageY,e.pageX,!1]}},R=function(){function t(e){var t=m.find("iframe");if(t.length){var o=e?"auto":"none";t.css("pointer-events",o)}}function o(e,t,o,a){if(m[0].idleTimer=u.scrollInertia<233?250:0,n.attr("id")===h[1])var i="x",r=(n[0].offsetLeft-t+a)*d.scrollRatio.x;else var i="y",r=(n[0].offsetTop-e+o)*d.scrollRatio.y;Q(l,r.toString(),{dir:i,drag:!0})}var n,i,r,l=e(this),d=l.data(a),u=d.opt,f=a+"_"+d.idx,h=["mCSB_"+d.idx+"_dragger_vertical","mCSB_"+d.idx+"_dragger_horizontal"],m=e("#mCSB_"+d.idx+"_container"),p=e("#"+h[0]+",#"+h[1]),g=u.advanced.releaseDraggableSelectors?p.add(e(u.advanced.releaseDraggableSelectors)):p;p.bind("mousedown."+f+" touchstart."+f+" pointerdown."+f+" MSPointerDown."+f,function(o){if(o.stopImmediatePropagation(),o.preventDefault(),$(o)){c=!0,s&&(document.onselectstart=function(){return!1}),t(!1),V(l),n=e(this);var a=n.offset(),d=I(o)[0]-a.top,f=I(o)[1]-a.left,h=n.height()+a.top,m=n.width()+a.left;h>d&&d>0&&m>f&&f>0&&(i=d,r=f),y(n,"active",u.autoExpandScrollbar)}}).bind("touchmove."+f,function(e){e.stopImmediatePropagation(),e.preventDefault();var t=n.offset(),a=I(e)[0]-t.top,l=I(e)[1]-t.left;o(i,r,a,l)}),e(document).bind("mousemove."+f+" pointermove."+f+" MSPointerMove."+f,function(e){if(n){var t=n.offset(),a=I(e)[0]-t.top,l=I(e)[1]-t.left;if(i===a)return;o(i,r,a,l)}}).add(g).bind("mouseup."+f+" touchend."+f+" pointerup."+f+" MSPointerUp."+f,function(){n&&(y(n,"active",u.autoExpandScrollbar),n=null),c=!1,s&&(document.onselectstart=null),t(!0)})},E=function(){function o(e){if(!et(e)||c||I(e)[2])return void(t=0);t=1,S=0,b=0;var o=M.offset();d=I(e)[0]-o.top,u=I(e)[1]-o.left,A=[I(e)[0],I(e)[1]]}function n(e){if(et(e)&&!c&&!I(e)[2]&&(e.stopImmediatePropagation(),!b||S)){p=J();var t=k.offset(),o=I(e)[0]-t.top,a=I(e)[1]-t.left,n="mcsLinearOut";if(R.push(o),E.push(a),A[2]=Math.abs(I(e)[0]-A[0]),A[3]=Math.abs(I(e)[1]-A[1]),y.overflowed[0])var i=O[0].parent().height()-O[0].height(),r=d-o>0&&o-d>-(i*y.scrollRatio.y)&&(2*A[3]<A[2]||"yx"===B.axis);if(y.overflowed[1])var l=O[1].parent().width()-O[1].width(),f=u-a>0&&a-u>-(l*y.scrollRatio.x)&&(2*A[2]<A[3]||"yx"===B.axis);r||f?(e.preventDefault(),S=1):b=1,_="yx"===B.axis?[d-o,u-a]:"x"===B.axis?[null,u-a]:[d-o,null],M[0].idleTimer=250,y.overflowed[0]&&s(_[0],D,n,"y","all",!0),y.overflowed[1]&&s(_[1],D,n,"x",W,!0)}}function i(e){if(!et(e)||c||I(e)[2])return void(t=0);t=1,e.stopImmediatePropagation(),V(C),m=J();var o=k.offset();f=I(e)[0]-o.top,h=I(e)[1]-o.left,R=[],E=[]}function r(e){if(et(e)&&!c&&!I(e)[2]){e.stopImmediatePropagation(),S=0,b=0,g=J();var t=k.offset(),o=I(e)[0]-t.top,a=I(e)[1]-t.left;if(!(g-p>30)){x=1e3/(g-m);var n="mcsEaseOut",i=2.5>x,r=i?[R[R.length-2],E[E.length-2]]:[0,0];v=i?[o-r[0],a-r[1]]:[o-f,a-h];var d=[Math.abs(v[0]),Math.abs(v[1])];x=i?[Math.abs(v[0]/4),Math.abs(v[1]/4)]:[x,x];var u=[Math.abs(M[0].offsetTop)-v[0]*l(d[0]/x[0],x[0]),Math.abs(M[0].offsetLeft)-v[1]*l(d[1]/x[1],x[1])];_="yx"===B.axis?[u[0],u[1]]:"x"===B.axis?[null,u[1]]:[u[0],null],w=[4*d[0]+B.scrollInertia,4*d[1]+B.scrollInertia];var C=parseInt(B.contentTouchScroll)||0;_[0]=d[0]>C?_[0]:0,_[1]=d[1]>C?_[1]:0,y.overflowed[0]&&s(_[0],w[0],n,"y",W,!1),y.overflowed[1]&&s(_[1],w[1],n,"x",W,!1)}}}function l(e,t){var o=[1.5*t,2*t,t/1.5,t/2];return e>90?t>4?o[0]:o[3]:e>60?t>3?o[3]:o[2]:e>30?t>8?o[1]:t>6?o[0]:t>4?t:o[2]:t>8?t:o[3]}function s(e,t,o,a,n,i){e&&Q(C,e.toString(),{dur:t,scrollEasing:o,dir:a,overwrite:n,drag:i})}var d,u,f,h,m,p,g,v,x,_,w,S,b,C=e(this),y=C.data(a),B=y.opt,T=a+"_"+y.idx,k=e("#mCSB_"+y.idx),M=e("#mCSB_"+y.idx+"_container"),O=[e("#mCSB_"+y.idx+"_dragger_vertical"),e("#mCSB_"+y.idx+"_dragger_horizontal")],R=[],E=[],D=0,W="yx"===B.axis?"none":"all",A=[],P=M.find("iframe"),z=["touchstart."+T+" pointerdown."+T+" MSPointerDown."+T,"touchmove."+T+" pointermove."+T+" MSPointerMove."+T,"touchend."+T+" pointerup."+T+" MSPointerUp."+T];M.bind(z[0],function(e){o(e)}).bind(z[1],function(e){n(e)}),k.bind(z[0],function(e){i(e)}).bind(z[2],function(e){r(e)}),P.length&&P.each(function(){e(this).load(function(){L(this)&&e(this.contentDocument||this.contentWindow.document).bind(z[0],function(e){o(e),i(e)}).bind(z[1],function(e){n(e)}).bind(z[2],function(e){r(e)})})})},D=function(){function o(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function n(e,t,o){d.type=o&&i?"stepped":"stepless",d.scrollAmount=10,F(r,e,t,"mcsLinearOut",o?60:null)}var i,r=e(this),l=r.data(a),s=l.opt,d=l.sequential,u=a+"_"+l.idx,f=e("#mCSB_"+l.idx+"_container"),h=f.parent();f.bind("mousedown."+u,function(){t||i||(i=1,c=!0)}).add(document).bind("mousemove."+u,function(e){if(!t&&i&&o()){var a=f.offset(),r=I(e)[0]-a.top+f[0].offsetTop,c=I(e)[1]-a.left+f[0].offsetLeft;r>0&&r<h.height()&&c>0&&c<h.width()?d.step&&n("off",null,"stepped"):("x"!==s.axis&&l.overflowed[0]&&(0>r?n("on",38):r>h.height()&&n("on",40)),"y"!==s.axis&&l.overflowed[1]&&(0>c?n("on",37):c>h.width()&&n("on",39)))}}).bind("mouseup."+u,function(){t||(i&&(i=0,n("off",null)),c=!1)})},W=function(){function t(t,a){if(V(o),!A(o,t.target)){var r="auto"!==i.mouseWheel.deltaFactor?parseInt(i.mouseWheel.deltaFactor):s&&t.deltaFactor<100?100:t.deltaFactor||100;if("x"===i.axis||"x"===i.mouseWheel.axis)var d="x",u=[Math.round(r*n.scrollRatio.x),parseInt(i.mouseWheel.scrollAmount)],f="auto"!==i.mouseWheel.scrollAmount?u[1]:u[0]>=l.width()?.9*l.width():u[0],h=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetLeft),m=c[1][0].offsetLeft,p=c[1].parent().width()-c[1].width(),g=t.deltaX||t.deltaY||a;else var d="y",u=[Math.round(r*n.scrollRatio.y),parseInt(i.mouseWheel.scrollAmount)],f="auto"!==i.mouseWheel.scrollAmount?u[1]:u[0]>=l.height()?.9*l.height():u[0],h=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetTop),m=c[0][0].offsetTop,p=c[0].parent().height()-c[0].height(),g=t.deltaY||a;"y"===d&&!n.overflowed[0]||"x"===d&&!n.overflowed[1]||(i.mouseWheel.invert&&(g=-g),i.mouseWheel.normalizeDelta&&(g=0>g?-1:1),(g>0&&0!==m||0>g&&m!==p||i.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),Q(o,(h-g*f).toString(),{dir:d}))}}var o=e(this),n=o.data(a),i=n.opt,r=a+"_"+n.idx,l=e("#mCSB_"+n.idx),c=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")],d=e("#mCSB_"+n.idx+"_container").find("iframe");n&&(d.length&&d.each(function(){e(this).load(function(){L(this)&&e(this.contentDocument||this.contentWindow.document).bind("mousewheel."+r,function(e,o){t(e,o)})})}),l.bind("mousewheel."+r,function(e,o){t(e,o)}))},L=function(e){var t=null;try{var o=e.contentDocument||e.contentWindow.document;t=o.body.innerHTML}catch(a){}return null!==t},A=function(t,o){var n=o.nodeName.toLowerCase(),i=t.data(a).opt.mouseWheel.disableOver,r=["select","textarea"];return e.inArray(n,i)>-1&&!(e.inArray(n,r)>-1&&!e(o).is(":focus"))},P=function(){var t=e(this),o=t.data(a),n=a+"_"+o.idx,i=e("#mCSB_"+o.idx+"_container"),r=i.parent(),l=e(".mCSB_"+o.idx+"_scrollbar ."+d[12]);l.bind("touchstart."+n+" pointerdown."+n+" MSPointerDown."+n,function(){c=!0}).bind("touchend."+n+" pointerup."+n+" MSPointerUp."+n,function(){c=!1}).bind("click."+n,function(a){if(e(a.target).hasClass(d[12])||e(a.target).hasClass("mCSB_draggerRail")){V(t);var n=e(this),l=n.find(".mCSB_dragger");if(n.parent(".mCSB_scrollTools_horizontal").length>0){if(!o.overflowed[1])return;var s="x",c=a.pageX>l.offset().left?-1:1,u=Math.abs(i[0].offsetLeft)-.9*c*r.width()}else{if(!o.overflowed[0])return;var s="y",c=a.pageY>l.offset().top?-1:1,u=Math.abs(i[0].offsetTop)-.9*c*r.height()}Q(t,u.toString(),{dir:s,scrollEasing:"mcsEaseInOut"})}})},z=function(){var t=e(this),o=t.data(a),n=o.opt,i=a+"_"+o.idx,r=e("#mCSB_"+o.idx+"_container"),l=r.parent();r.bind("focusin."+i,function(){var o=e(document.activeElement),a=r.find(".mCustomScrollBox").length,i=0;o.is(n.advanced.autoScrollOnFocus)&&(V(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=a?(i+17)*a:0,t[0]._focusTimeout=setTimeout(function(){var e=[ot(o)[0],ot(o)[1]],a=[r[0].offsetTop,r[0].offsetLeft],s=[a[0]+e[0]>=0&&a[0]+e[0]<l.height()-o.outerHeight(!1),a[1]+e[1]>=0&&a[0]+e[1]<l.width()-o.outerWidth(!1)],c="yx"!==n.axis||s[0]||s[1]?"all":"none";"x"===n.axis||s[0]||Q(t,e[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:c,dur:i}),"y"===n.axis||s[1]||Q(t,e[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:c,dur:i})},t[0]._focusTimer))})},H=function(){var t=e(this),o=t.data(a),n=a+"_"+o.idx,i=e("#mCSB_"+o.idx+"_container").parent();i.bind("scroll."+n,function(){(0!==i.scrollTop()||0!==i.scrollLeft())&&e(".mCSB_"+o.idx+"_scrollbar").css("visibility","hidden")})},U=function(){var t=e(this),o=t.data(a),n=o.opt,i=o.sequential,r=a+"_"+o.idx,l=".mCSB_"+o.idx+"_scrollbar",s=e(l+">a");s.bind("mousedown."+r+" touchstart."+r+" pointerdown."+r+" MSPointerDown."+r+" mouseup."+r+" touchend."+r+" pointerup."+r+" MSPointerUp."+r+" mouseout."+r+" pointerout."+r+" MSPointerOut."+r+" click."+r,function(a){function r(e,o){i.scrollAmount=n.snapAmount||n.scrollButtons.scrollAmount,F(t,e,o)}if(a.preventDefault(),$(a)){var l=e(this).attr("class");switch(i.type=n.scrollButtons.scrollType,a.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===i.type)return;c=!0,o.tweenRunning=!1,r("on",l);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===i.type)return;c=!1,i.dir&&r("off",l);break;case"click":if("stepped"!==i.type||o.tweenRunning)return;r("on",l)}}})},q=function(){function t(t){function a(e,t){r.type=i.keyboard.scrollType,r.scrollAmount=i.snapAmount||i.keyboard.scrollAmount,"stepped"===r.type&&n.tweenRunning||F(o,e,t)}switch(t.type){case"blur":n.tweenRunning&&r.dir&&a("off",null);break;case"keydown":case"keyup":var l=t.keyCode?t.keyCode:t.which,s="on";if("x"!==i.axis&&(38===l||40===l)||"y"!==i.axis&&(37===l||39===l)){if((38===l||40===l)&&!n.overflowed[0]||(37===l||39===l)&&!n.overflowed[1])return;"keyup"===t.type&&(s="off"),e(document.activeElement).is(u)||(t.preventDefault(),t.stopImmediatePropagation(),a(s,l))}else if(33===l||34===l){if((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){V(o);var f=34===l?-1:1;if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=Math.abs(c[0].offsetLeft)-.9*f*d.width();else var h="y",m=Math.abs(c[0].offsetTop)-.9*f*d.height();Q(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}else if((35===l||36===l)&&!e(document.activeElement).is(u)&&((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===i.axis||"yx"===i.axis&&n.overflowed[1]&&!n.overflowed[0])var h="x",m=35===l?Math.abs(d.width()-c.outerWidth(!1)):0;else var h="y",m=35===l?Math.abs(d.height()-c.outerHeight(!1)):0;Q(o,m.toString(),{dir:h,scrollEasing:"mcsEaseInOut"})}}}var o=e(this),n=o.data(a),i=n.opt,r=n.sequential,l=a+"_"+n.idx,s=e("#mCSB_"+n.idx),c=e("#mCSB_"+n.idx+"_container"),d=c.parent(),u="input,textarea,select,datalist,keygen,[contenteditable='true']",f=c.find("iframe"),h=["blur."+l+" keydown."+l+" keyup."+l];f.length&&f.each(function(){e(this).load(function(){L(this)&&e(this.contentDocument||this.contentWindow.document).bind(h[0],function(e){t(e)})})}),s.attr("tabindex","0").bind(h[0],function(e){t(e)})},F=function(t,o,n,i,r){function l(e){var o="stepped"!==f.type,a=r?r:e?o?p/1.5:g:1e3/60,n=e?o?7.5:40:2.5,s=[Math.abs(h[0].offsetTop),Math.abs(h[0].offsetLeft)],d=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],u="x"===f.dir[0]?s[1]+f.dir[1]*d[1]*n:s[0]+f.dir[1]*d[0]*n,m="x"===f.dir[0]?s[1]+f.dir[1]*parseInt(f.scrollAmount):s[0]+f.dir[1]*parseInt(f.scrollAmount),v="auto"!==f.scrollAmount?m:u,x=i?i:e?o?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",_=e?!0:!1;return e&&17>a&&(v="x"===f.dir[0]?s[1]:s[0]),Q(t,v.toString(),{dir:f.dir[0],scrollEasing:x,dur:a,onComplete:_}),e?void(f.dir=!1):(clearTimeout(f.step),void(f.step=setTimeout(function(){l()},a)))}function s(){clearTimeout(f.step),Z(f,"step"),V(t)}var c=t.data(a),u=c.opt,f=c.sequential,h=e("#mCSB_"+c.idx+"_container"),m="stepped"===f.type?!0:!1,p=u.scrollInertia<26?26:u.scrollInertia,g=u.scrollInertia<1?17:u.scrollInertia;switch(o){case"on":if(f.dir=[n===d[16]||n===d[15]||39===n||37===n?"x":"y",n===d[13]||n===d[15]||38===n||37===n?-1:1],V(t),tt(n)&&"stepped"===f.type)return;l(m);break;case"off":s(),(m||c.tweenRunning&&f.dir)&&l(!0)}},Y=function(t){var o=e(this).data(a).opt,n=[];return"function"==typeof t&&(t=t()),t instanceof Array?n=t.length>1?[t[0],t[1]]:"x"===o.axis?[null,t[0]]:[t[0],null]:(n[0]=t.y?t.y:t.x||"x"===o.axis?null:t,n[1]=t.x?t.x:t.y||"y"===o.axis?null:t),"function"==typeof n[0]&&(n[0]=n[0]()),"function"==typeof n[1]&&(n[1]=n[1]()),n},j=function(t,o){if(null!=t&&"undefined"!=typeof t){var n=e(this),i=n.data(a),r=i.opt,l=e("#mCSB_"+i.idx+"_container"),s=l.parent(),c=typeof t;o||(o="x"===r.axis?"x":"y");var d="x"===o?l.outerWidth(!1):l.outerHeight(!1),f="x"===o?l[0].offsetLeft:l[0].offsetTop,h="x"===o?"left":"top";switch(c){case"function":return t();case"object":var m=t.jquery?t:e(t);if(!m.length)return;return"x"===o?ot(m)[1]:ot(m)[0];case"string":case"number":if(tt(t))return Math.abs(t);if(-1!==t.indexOf("%"))return Math.abs(d*parseInt(t)/100);if(-1!==t.indexOf("-="))return Math.abs(f-parseInt(t.split("-=")[1]));if(-1!==t.indexOf("+=")){var p=f+parseInt(t.split("+=")[1]);return p>=0?0:Math.abs(p)}if(-1!==t.indexOf("px")&&tt(t.split("px")[0]))return Math.abs(t.split("px")[0]);if("top"===t||"left"===t)return 0;if("bottom"===t)return Math.abs(s.height()-l.outerHeight(!1));if("right"===t)return Math.abs(s.width()-l.outerWidth(!1));if("first"===t||"last"===t){var m=l.find(":"+t);return"x"===o?ot(m)[1]:ot(m)[0]}return e(t).length?"x"===o?ot(e(t))[1]:ot(e(t))[0]:(l.css(h,t),void u.update.call(null,n[0]))}}},X=function(t){function o(){clearTimeout(h[0].autoUpdate),h[0].autoUpdate=setTimeout(function(){return f.advanced.updateOnSelectorChange&&(m=r(),m!==w)?(l(3),void(w=m)):(f.advanced.updateOnContentResize&&(p=[h.outerHeight(!1),h.outerWidth(!1),v.height(),v.width(),_()[0],_()[1]],(p[0]!==S[0]||p[1]!==S[1]||p[2]!==S[2]||p[3]!==S[3]||p[4]!==S[4]||p[5]!==S[5])&&(l(p[0]!==S[0]||p[1]!==S[1]),S=p)),f.advanced.updateOnImageLoad&&(g=n(),g!==b&&(h.find("img").each(function(){i(this)}),b=g)),void((f.advanced.updateOnSelectorChange||f.advanced.updateOnContentResize||f.advanced.updateOnImageLoad)&&o()))},60)}function n(){var e=0;return f.advanced.updateOnImageLoad&&(e=h.find("img").length),e}function i(t){function o(e,t){return function(){return t.apply(e,arguments)}}function a(){this.onload=null,e(t).addClass(d[2]),l(2)}if(e(t).hasClass(d[2]))return void l();var n=new Image;n.onload=o(n,a),n.src=t.src}function r(){f.advanced.updateOnSelectorChange===!0&&(f.advanced.updateOnSelectorChange="*");var t=0,o=h.find(f.advanced.updateOnSelectorChange);return f.advanced.updateOnSelectorChange&&o.length>0&&o.each(function(){t+=e(this).height()+e(this).width()}),t}function l(e){clearTimeout(h[0].autoUpdate),u.update.call(null,s[0],e)}var s=e(this),c=s.data(a),f=c.opt,h=e("#mCSB_"+c.idx+"_container");if(t)return clearTimeout(h[0].autoUpdate),void Z(h[0],"autoUpdate");var m,p,g,v=h.parent(),x=[e("#mCSB_"+c.idx+"_scrollbar_vertical"),e("#mCSB_"+c.idx+"_scrollbar_horizontal")],_=function(){return[x[0].is(":visible")?x[0].outerHeight(!0):0,x[1].is(":visible")?x[1].outerWidth(!0):0]},w=r(),S=[h.outerHeight(!1),h.outerWidth(!1),v.height(),v.width(),_()[0],_()[1]],b=n();o()},N=function(e,t,o){return Math.round(e/t)*t-o},V=function(t){var o=t.data(a),n=e("#mCSB_"+o.idx+"_container,#mCSB_"+o.idx+"_container_wrapper,#mCSB_"+o.idx+"_dragger_vertical,#mCSB_"+o.idx+"_dragger_horizontal");n.each(function(){K.call(this)})},Q=function(t,o,n){function i(e){return s&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function r(){return[c.callbacks.alwaysTriggerOffsets||_>=w[0]+b,c.callbacks.alwaysTriggerOffsets||-C>=_]}function l(){var e=[h[0].offsetTop,h[0].offsetLeft],o=[v[0].offsetTop,v[0].offsetLeft],a=[h.outerHeight(!1),h.outerWidth(!1)],i=[f.height(),f.width()];t[0].mcs={content:h,top:e[0],left:e[1],draggerTop:o[0],draggerLeft:o[1],topPct:Math.round(100*Math.abs(e[0])/(Math.abs(a[0])-i[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(a[1])-i[1])),direction:n.dir}}var s=t.data(a),c=s.opt,d={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=e.extend(d,n),u=[n.dur,n.drag?0:n.dur],f=e("#mCSB_"+s.idx),h=e("#mCSB_"+s.idx+"_container"),m=h.parent(),p=c.callbacks.onTotalScrollOffset?Y.call(t,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?Y.call(t,c.callbacks.onTotalScrollBackOffset):[0,0];
120
- if(s.trigger=n.trigger,(0!==m.scrollTop()||0!==m.scrollLeft())&&(e(".mCSB_"+s.idx+"_scrollbar").css("visibility","visible"),m.scrollTop(0).scrollLeft(0)),"_resetY"!==o||s.contentReset.y||(i("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(t[0]),s.contentReset.y=1),"_resetX"!==o||s.contentReset.x||(i("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(t[0]),s.contentReset.x=1),"_resetY"!==o&&"_resetX"!==o){switch(!s.contentReset.y&&t[0].mcs||!s.overflowed[0]||(i("onOverflowY")&&c.callbacks.onOverflowY.call(t[0]),s.contentReset.x=null),!s.contentReset.x&&t[0].mcs||!s.overflowed[1]||(i("onOverflowX")&&c.callbacks.onOverflowX.call(t[0]),s.contentReset.x=null),c.snapAmount&&(o=N(o,c.snapAmount,c.snapOffset)),n.dir){case"x":var v=e("#mCSB_"+s.idx+"_dragger_horizontal"),x="left",_=h[0].offsetLeft,w=[f.width()-h.outerWidth(!1),v.parent().width()-v.width()],S=[o,0===o?0:o/s.scrollRatio.x],b=p[1],C=g[1],B=b>0?b/s.scrollRatio.x:0,T=C>0?C/s.scrollRatio.x:0;break;case"y":var v=e("#mCSB_"+s.idx+"_dragger_vertical"),x="top",_=h[0].offsetTop,w=[f.height()-h.outerHeight(!1),v.parent().height()-v.height()],S=[o,0===o?0:o/s.scrollRatio.y],b=p[0],C=g[0],B=b>0?b/s.scrollRatio.y:0,T=C>0?C/s.scrollRatio.y:0}S[1]<0||0===S[0]&&0===S[1]?S=[0,0]:S[1]>=w[1]?S=[w[0],w[1]]:S[0]=-S[0],t[0].mcs||(l(),i("onInit")&&c.callbacks.onInit.call(t[0])),clearTimeout(h[0].onCompleteTimeout),(s.tweenRunning||!(0===_&&S[0]>=0||_===w[0]&&S[0]<=w[0]))&&(G(v[0],x,Math.round(S[1]),u[1],n.scrollEasing),G(h[0],x,Math.round(S[0]),u[0],n.scrollEasing,n.overwrite,{onStart:function(){n.callbacks&&n.onStart&&!s.tweenRunning&&(i("onScrollStart")&&(l(),c.callbacks.onScrollStart.call(t[0])),s.tweenRunning=!0,y(v),s.cbOffsets=r())},onUpdate:function(){n.callbacks&&n.onUpdate&&i("whileScrolling")&&(l(),c.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(n.callbacks&&n.onComplete){"yx"===c.axis&&clearTimeout(h[0].onCompleteTimeout);var e=h[0].idleTimer||0;h[0].onCompleteTimeout=setTimeout(function(){i("onScroll")&&(l(),c.callbacks.onScroll.call(t[0])),i("onTotalScroll")&&S[1]>=w[1]-B&&s.cbOffsets[0]&&(l(),c.callbacks.onTotalScroll.call(t[0])),i("onTotalScrollBack")&&S[1]<=T&&s.cbOffsets[1]&&(l(),c.callbacks.onTotalScrollBack.call(t[0])),s.tweenRunning=!1,h[0].idleTimer=0,y(v,"hide")},e)}}}))}},G=function(e,t,o,a,n,i,r){function l(){S.stop||(x||m.call(),x=J()-v,s(),x>=S.time&&(S.time=x>S.time?x+f-(x-S.time):x+f-1,S.time<x+1&&(S.time=x+1)),S.time<a?S.id=h(l):g.call())}function s(){a>0?(S.currVal=u(S.time,_,b,a,n),w[t]=Math.round(S.currVal)+"px"):w[t]=o+"px",p.call()}function c(){f=1e3/60,S.time=x+f,h=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return s(),setTimeout(e,.01)},S.id=h(l)}function d(){null!=S.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(S.id):clearTimeout(S.id),S.id=null)}function u(e,t,o,a,n){switch(n){case"linear":case"mcsLinear":return o*e/a+t;case"mcsLinearOut":return e/=a,e--,o*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=a/2,1>e?o/2*e*e+t:(e--,-o/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=a/2,1>e?o/2*Math.pow(2,10*(e-1))+t:(e--,o/2*(-Math.pow(2,-10*e)+2)+t);case"easeInOut":case"mcsEaseInOut":return e/=a/2,1>e?o/2*e*e*e+t:(e-=2,o/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=a,e--,-o*(e*e*e*e-1)+t;case"easeOutStrong":return o*(-Math.pow(2,-10*e/a)+1)+t;case"easeOut":case"mcsEaseOut":default:var i=(e/=a)*e,r=i*e;return t+o*(.499999999999997*r*i+-2.5*i*i+5.5*r+-6.5*i+4*e)}}e._mTween||(e._mTween={top:{},left:{}});var f,h,r=r||{},m=r.onStart||function(){},p=r.onUpdate||function(){},g=r.onComplete||function(){},v=J(),x=0,_=e.offsetTop,w=e.style,S=e._mTween[t];"left"===t&&(_=e.offsetLeft);var b=o-_;S.stop=0,"none"!==i&&d(),c()},J=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()},K=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],o=0;o<t.length;o++){var a=t[o];e._mTween[a].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(e._mTween[a].id):clearTimeout(e._mTween[a].id),e._mTween[a].id=null,e._mTween[a].stop=1)}},Z=function(e,t){try{delete e[t]}catch(o){e[t]=null}},$=function(e){return!(e.which&&1!==e.which)},et=function(e){var t=e.originalEvent.pointerType;return!(t&&"touch"!==t&&2!==t)},tt=function(e){return!isNaN(parseFloat(e))&&isFinite(e)},ot=function(e){var t=e.parents(".mCSB_container");return[e.offset().top-t.offset().top,e.offset().left-t.offset().left]};e.fn[o]=function(t){return u[t]?u[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):u.init.apply(this,arguments)},e[o]=function(t){return u[t]?u[t].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof t&&t?void e.error("Method "+t+" does not exist"):u.init.apply(this,arguments)},e[o].defaults=i,window[o]=!0,e(window).load(function(){e(n)[o](),e.extend(e.expr[":"],{mcsInView:e.expr[":"].mcsInView||function(t){var o,a,n=e(t),i=n.parents(".mCSB_container");if(i.length)return o=i.parent(),a=[i[0].offsetTop,i[0].offsetLeft],a[0]+ot(n)[0]>=0&&a[0]+ot(n)[0]<o.height()-n.outerHeight(!1)&&a[1]+ot(n)[1]>=0&&a[1]+ot(n)[1]<o.width()-n.outerWidth(!1)},mcsOverflow:e.expr[":"].mcsOverflow||function(t){var o=e(t).data(a);if(o)return o.overflowed[0]||o.overflowed[1]}})})})});
121
-
122
- function prepare_Modal(){if(jQuery('.um-popup-overlay').length == 0){jQuery('body').append('<div class="um-popup-overlay"></div>');jQuery('body').append('<div class="um-popup"></div>');jQuery('.um-popup').addClass('loading');jQuery("body,html").css({overflow:'hidden'})}}function remove_Modal(){if(jQuery('.um-popup-overlay').length){jQuery('.tipsy').remove();jQuery('.um-popup').empty().remove();jQuery('.um-popup-overlay').empty().remove();jQuery("body,html").css({overflow:'auto'})}}function show_Modal(contents){if(jQuery('.um-popup-overlay').length){jQuery('.um-popup').removeClass('loading').html(contents);jQuery('.um-tip-n').tipsy({gravity:'n',opacity:1,offset:3});jQuery('.um-tip-w').tipsy({gravity:'w',opacity:1,offset:3});jQuery('.um-tip-e').tipsy({gravity:'e',opacity:1,offset:3});jQuery('.um-tip-s').tipsy({gravity:'s',opacity:1,offset:3})}}function responsive_Modal(){if(jQuery('.um-popup-overlay').length){ag_height = jQuery(window).height() - jQuery('.um-popup um-popup-header').outerHeight() - jQuery('.um-popup .um-popup-footer').outerHeight() - 80;if(ag_height>350){ag_height = 350}if(jQuery('.um-popup-autogrow:visible').length){jQuery('.um-popup-autogrow:visible').css({'height':ag_height+'px'});jQuery('.um-popup-autogrow:visible').mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500}).mCustomScrollbar("scrollTo","bottom",{scrollInertia:0})}else if(jQuery('.um-popup-autogrow2:visible').length){jQuery('.um-popup-autogrow2:visible').css({'max-height':ag_height+'px'});jQuery('.um-popup-autogrow2:visible').mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500})}}}
123
-
124
- jQuery(window).load(function(){um_responsive();um_modal_responsive()});jQuery(window).resize(function(){responsive_Modal();jQuery('img.cropper-hidden').cropper('destroy');um_responsive();um_modal_responsive()});jQuery(document).ready(function(){jQuery(document).on('click','.um-popup-overlay',function(){remove_Modal()});jQuery(document).on("click",'.um-modal-overlay, a[data-action="um_remove_modal"]',function(){um_remove_modal()});jQuery(document).on("click",'a[data-modal^="um_"], span[data-modal^="um_"], .um-modal a',function(a){a.preventDefault();return false});jQuery(document).on("click",".um-modal .um-single-file-preview a.cancel",function(a){a.preventDefault();a=jQuery(this).parents(".um-modal-body");var b=jQuery(this).parents(".um-modal-body").find(".um-single-fileinfo a").attr("href");
125
- a.find(".um-single-file-preview").hide();a.find(".ajax-upload-dragdrop").show();a.find(".um-modal-btn.um-finish-upload").addClass("disabled");um_modal_responsive();jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_remove_file",src:b}});return false});jQuery(document).on("click",".um-modal .um-single-image-preview a.cancel",function(a){a.preventDefault();a=jQuery(this).parents(".um-modal-body");var b=jQuery(this).parents(".um-modal-body").find(".um-single-image-preview img").attr("src");
126
- jQuery('img.cropper-hidden').cropper('destroy');a.find(".um-single-image-preview img").attr("src","");a.find(".um-single-image-preview").hide();a.find(".ajax-upload-dragdrop").show();a.find(".um-modal-btn.um-finish-upload").addClass("disabled");um_modal_responsive();jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_remove_file",src:b}});return false});jQuery(document).on("click",".um-finish-upload.file",function(){var a=jQuery(this).attr("data-key"),
127
- b=jQuery(this).parents(".um-modal-body").find(".um-single-file-preview").html();um_remove_modal();jQuery(".um-single-file-preview[data-key="+a+"]").fadeIn().html(b);jQuery(".um-single-file-preview[data-key="+a+"]").parents(".um-field").find(".um-btn-auto-width").html(jQuery(this).attr("data-change"));jQuery(".um-single-file-preview[data-key="+a+"]").parents(".um-field").find("input[type=hidden]").val(jQuery(".um-single-file-preview[data-key="+a+"]").parents(".um-field").find(".um-single-fileinfo a").attr("href"))});
128
- jQuery(document).on("click",".um-finish-upload.image",function(){var a=jQuery(this),b=jQuery(this).attr("data-key"),c=jQuery(this).parents(".um-modal-body").find(".um-single-image-preview"),f=c.find("img").attr("src");c=c.attr("data-coord");var g=jQuery(this).parents("#um_upload_single").attr("data-user_id")?jQuery(this).parents("#um_upload_single").attr("data-user_id"):0;if(c){jQuery(this).html(jQuery(this).attr("data-processing")).addClass("disabled");jQuery.ajax({url:um_scripts.ajaxurl,type:"POST",
129
- data:{action:"ultimatemember_resize_image",src:f,coord:c,user_id:g,key:b},success:function(e){d=new Date;b=="profile_photo"&&jQuery(".um-profile-photo-img img").attr("src",e+"?"+d.getTime());if(b=="cover_photo"){jQuery(".um-cover-e").empty().html('<img src="'+e+"?"+d.getTime()+'" alt="" />');jQuery(".um").hasClass("um-editing")&&jQuery(".um-cover-overlay").show()}jQuery(".um-single-image-preview[data-key="+b+"]").fadeIn().find("img").attr("src",e+"?"+d.getTime());um_remove_modal();jQuery(".um-single-image-preview[data-key="+
130
- b+"]").parents(".um-field").find(".um-btn-auto-width").html(a.attr("data-change"));jQuery(".um-single-image-preview[data-key="+b+"]").parents(".um-field").find("input[type=hidden]").val(e)}})}else{d=new Date;jQuery(".um-single-image-preview[data-key="+b+"]").fadeIn().find("img").attr("src",f+"?"+d.getTime());um_remove_modal();jQuery(".um-single-image-preview[data-key="+b+"]").parents(".um-field").find(".um-btn-auto-width").html(a.attr("data-change"));jQuery(".um-single-image-preview[data-key="+b+
131
- "]").parents(".um-field").find("input[type=hidden]").val(f)}});jQuery(document).on("click",'a[data-modal^="um_"], span[data-modal^="um_"]',function(){var a=jQuery(this).attr("data-modal"),b=jQuery(this).data("modal-size")?jQuery(this).data("modal-size"):"normal";if(jQuery(this).data("modal-copy")){jQuery("#"+a).html(jQuery(this).parents(".um-field").find(".um-modal-hidden-content").html());jQuery(this).parents(".um-profile-photo").attr("data-user_id")&&jQuery("#"+a).attr("data-user_id",jQuery(this).parents(".um-profile-photo").attr("data-user_id"));
132
- jQuery(this).parents(".um-cover").attr("data-ratio")&&jQuery("#"+a).attr("data-ratio",jQuery(this).parents(".um-cover").attr("data-ratio"));jQuery(this).parents(".um-cover").attr("data-user_id")&&jQuery("#"+a).attr("data-user_id",jQuery(this).parents(".um-cover").attr("data-user_id"))}um_new_modal(a,b)});jQuery(document).on('input','.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();if(jQuery(this).is(':checkbox')){if(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()+' '})}else{live_value = jQuery(this).parents('.um-field').find('input:checked').val()}}if(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).on('click','.um-dropdown a',function(e){return false});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){jQuery('.um-dropdown').hide();menu = jQuery(this).find('.um-dropdown');menu.show();return false});jQuery(document).on('click','.um-dropdown-hide',function(e){UM_hide_menus()});jQuery(document).on('click','a.um-manual-trigger',function(){var child = jQuery(this).attr('data-child');var parent = jQuery(this).attr('data-parent');jQuery(this).parents(parent).find(child).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 field = jQuery(this).parents('.um-field-area');var this_field = jQuery(this).parents('label');field.find('.um-field-radio').removeClass('active');field.find('.um-field-radio').find('i').removeClass().addClass('um-icon-android-radio-button-off');this_field.addClass('active');this_field.find('i').removeClass().addClass('um-icon-android-radio-button-on')});jQuery(document).on('change','.um-field-area input[type=checkbox]',function(){var field = jQuery(this).parents('.um-field-area');var this_field = jQuery(this).parents('label');if(this_field.hasClass('active')){this_field.removeClass('active');this_field.find('i').removeClass().addClass('um-icon-android-checkbox-outline-blank')}else{this_field.addClass('active');this_field.find('i').removeClass().addClass('um-icon-android-checkbox-outline')}});jQuery('.um-datepicker').each(function(){elem = jQuery(this);if(elem.attr('data-disabled_weekdays')!= ''){var disable = JSON.parse(elem.attr('data-disabled_weekdays'))}else{var disable = false}var years_n = elem.attr('data-years');var min = elem.attr('data-date_min');var max = elem.attr('data-date_max');var min = min.split(",");var max = max.split(",");elem.pickadate({selectYears:years_n,min:min,max:max,disable:disable,format:elem.attr('data-format'),formatSubmit:'yyyy/mm/dd',hiddenName:true,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:true})});jQuery('.um-rating').raty({half:false,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:false,click:function(score,evt){live_field = this.id;live_value = score;um_conditional()}});jQuery('.um-rating-readonly').raty({half:false,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:false,readOnly:true});jQuery(document).on('click','.um .um-single-image-preview a.cancel',function(e){e.preventDefault();var parent = jQuery(this).parents('.um-field');var src = jQuery(this).parents('.um-field').find('.um-single-image-preview img').attr('src');parent.find('.um-single-image-preview img').attr('src','');parent.find('.um-single-image-preview').hide();parent.find('.um-btn-auto-width').html('Upload');parent.find('input[type=hidden]').val('');jQuery.ajax({url:um_scripts.ajaxurl,type:'post',data:{action:'ultimatemember_remove_file',src:src}});return false});jQuery(document).on('click','.um .um-single-file-preview a.cancel',function(e){e.preventDefault();var parent = jQuery(this).parents('.um-field');var src = jQuery(this).parents('.um-field').find('.um-single-fileinfo a').attr('href');parent.find('.um-single-file-preview').hide();parent.find('.um-btn-auto-width').html('Upload');parent.find('input[type=hidden]').val('');jQuery.ajax({url:um_scripts.ajaxurl,type:'post',data:{action:'ultimatemember_remove_file',src:src}});return false});jQuery(".um-s1").select2({allowClear:true,minimumResultsForSearch:10});jQuery(".um-s2").select2({allowClear:false,minimumResultsForSearch:10});jQuery('.um-s1,.um-s2').css({'display':'block'});jQuery(document).on('click','.um-field-group-head:not(.disabled)',function(){var field = jQuery(this).parents('.um-field-group');var limit = field.data('max_entries');if(field.find('.um-field-group-body').is(':hidden')){field.find('.um-field-group-body').show()}else{field.find('.um-field-group-body:first').clone().appendTo(field)}increase_id = 0;field.find('.um-field-group-body').each(function(){increase_id++;jQuery(this).find('input').each(function(){var input = jQuery(this);input.attr('id',input.data('key')+'-'+increase_id);input.attr('name',input.data('key')+'-'+increase_id);input.parent().parent().find('label').attr('for',input.data('key')+'-'+increase_id)})});if(limit>0 && field.find('.um-field-group-body').length == limit){jQuery(this).addClass('disabled')}});jQuery(document).on('click','.um-field-group-cancel',function(e){e.preventDefault();var field = jQuery(this).parents('.um-field-group');var limit = field.data('max_entries');if(field.find('.um-field-group-body').length>1){jQuery(this).parents('.um-field-group-body').remove()}else{jQuery(this).parents('.um-field-group-body').hide()}if(limit>0 && field.find('.um-field-group-body').length < limit){field.find('.um-field-group-head').removeClass('disabled')}return false});jQuery(document).on('click','.um-ajax-paginate',function(e){e.preventDefault();var parent = jQuery(this).parent();parent.addClass('loading');var args = jQuery(this).data('args');var hook = jQuery(this).data('hook');var container = jQuery(this).parents('.um').find('.um-ajax-items');jQuery.ajax({url:um_scripts.ajaxurl,type:'post',data:{action:'ultimatemember_ajax_paginate',hook:hook,args:args},complete:function(){parent.removeClass('loading')},success:function(data){parent.remove();container.append(data)}});return false});jQuery(document).on('click','.um-ajax-action',function(e){e.preventDefault();var hook = jQuery(this).data('hook');var user_id = jQuery(this).data('user_id');var arguments = jQuery(this).data('arguments');if(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:hook,user_id:user_id,arguments:arguments}});return false});jQuery('.um-members').each(function(){UM_Member_Grid(jQuery(this))});jQuery('.um-member-connect').each(function(){if(jQuery(this).find('a').length == 0){jQuery(this).remove()}});jQuery('.um-member-meta-main').each(function(){if(jQuery(this).find('.um-member-metaline').length == 0 && jQuery(this).find('.um-member-connect').find('a').length == 0){jQuery(this).remove()}});jQuery(document).on('click','.um-member-more a',function(e){e.preventDefault();var block = jQuery(this).parents('.um-member');var container = jQuery(this).parents('.um-members');block.find('.um-member-more').hide();block.find('.um-member-meta').slideDown(function(){UM_Member_Grid(container)});block.find('.um-member-less').fadeIn();setTimeout(function(){UM_Member_Grid(container)},100);return false});jQuery(document).on('click','.um-member-less a',function(e){e.preventDefault();var block = jQuery(this).parents('.um-member');var container = jQuery(this).parents('.um-members');block.find('.um-member-less').hide();block.find('.um-member-meta').slideUp(function(){block.find('.um-member-more').fadeIn();UM_Member_Grid(container)});return false});jQuery(document).on('click','.um-do-search',function(e){e.preventDefault();jQuery(this).parents('form').submit();return false});jQuery('.um-profile.um-viewing .um-profile-body .um-row').each(function(){var this_row = jQuery(this);if(this_row.find('.um-field').length == 0){this_row.prev('.um-row-heading').remove();this_row.remove()}});if(jQuery('.um-profile.um-viewing .um-profile-body').length && jQuery('.um-profile.um-viewing .um-profile-body').find('.um-field').length == 0){jQuery('.um-row-heading,.um-row').remove();jQuery('.um-profile-note').show()}jQuery(document).on('click','.um-profile-save',function(e){e.preventDefault();jQuery(this).parents('.um').find('form').submit();return false});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){e.preventDefault();return false});jQuery(document).on('click','.um-photo-modal',function(e){e.preventDefault();var photo_src = jQuery(this).attr('data-src');um_new_modal('um_view_photo','fit',true,photo_src);return false});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}})});var g=jQuery(".um-account-main").attr("data-current_tab");g&&jQuery(".um-account-tab[data-tab="+g+"]").show();jQuery(document).on("click",".um-account-side li a",function(a){a.preventDefault();a=jQuery(this);a.parents("ul").find("li a").removeClass("current");
133
- a.addClass("current");a=jQuery(this).attr("href");var b=jQuery(this).attr("data-tab");window.history.pushState("","",a);jQuery(".um-account-tab").hide();jQuery(".um-account-tab[data-tab="+b+"]").fadeIn();jQuery(".um-account-nav a").removeClass("current");jQuery(".um-account-nav a[data-tab="+b+"]").addClass("current");return false});jQuery(document).on("click",".um-account-nav a",function(a){a.preventDefault();a=jQuery(this).attr("data-tab");var b=jQuery(this).parents("div"),c=jQuery(this);jQuery(".um-account-tab").hide();
134
- if(c.hasClass("current")){b.next(".um-account-tab").slideUp();c.removeClass("current")}else{b.next(".um-account-tab").slideDown();c.parents("div").find("a").removeClass("current");c.addClass("current")}jQuery(".um-account-side li a").removeClass("current");jQuery(".um-account-side li a[data-tab="+a+"]").addClass("current");return false})});
1
+ function um_conditional(){jQuery(".um-field.um-is-conditional").each(function(){for(var e=0,t=jQuery(this).data("key"),i=0;5>i;i++){var a=jQuery(this).data("cond-"+i+"-action"),n=jQuery(this).data("cond-"+i+"-field"),r=jQuery(this).data("cond-"+i+"-operator"),o=jQuery(this).data("cond-"+i+"-value");"show"==a&&n==live_field&&"undefined"!=typeof o&&("empty"==r&&(!live_value||""==live_value||e>0?(jQuery(this).fadeIn(),e++):(jQuery(this).hide(),jQuery("div.um-field[data-cond-"+i+"-field="+t+"]").hide(),um_reset_field("div.um-field[data-cond-"+i+"-field="+t+"]"))),"not empty"==r&&(live_value&&""!=live_value||e>0?(jQuery(this).fadeIn(),e++):(jQuery(this).hide(),jQuery("div.um-field[data-cond-"+i+"-field="+t+"]").hide(),um_reset_field("div.um-field[data-cond-"+i+"-field="+t+"]"))),"equals to"==r&&(o==live_value||e>0?(jQuery(this).fadeIn(),e++):(jQuery(this).hide(),jQuery("div.um-field[data-cond-"+i+"-field="+t+"]").hide(),um_reset_field("div.um-field[data-cond-"+i+"-field="+t+"]"))),"not equals"==r&&(jQuery.isNumeric(o)&&parseInt(live_value)!=parseInt(o)&&live_value||e>0?(jQuery(this).fadeIn(),e++):!jQuery.isNumeric(o)&&o!=live_value||e>0?(jQuery(this).fadeIn(),e++):(jQuery(this).hide(),jQuery("div.um-field[data-cond-"+i+"-field="+t+"]").hide(),um_reset_field("div.um-field[data-cond-"+i+"-field="+t+"]"))),"greater than"==r&&(jQuery.isNumeric(o)&&parseInt(live_value)>parseInt(o)||e>0?(jQuery(this).fadeIn(),e++):(jQuery(this).hide(),jQuery("div.um-field[data-cond-"+i+"-field="+t+"]").hide(),um_reset_field("div.um-field[data-cond-"+i+"-field="+t+"]"))),"less than"==r&&(jQuery.isNumeric(o)&&parseInt(live_value)<parseInt(o)&&live_value||e>0?(jQuery(this).fadeIn(),e++):(jQuery(this).hide(),jQuery("div.um-field[data-cond-"+i+"-field="+t+"]").hide(),um_reset_field("div.um-field[data-cond-"+i+"-field="+t+"]"))),"contains"==r&&(live_value&&live_value.indexOf(o)>=0||e>0?(jQuery(this).fadeIn(),e++):(jQuery(this).hide(),jQuery("div.um-field[data-cond-"+i+"-field="+t+"]").hide(),um_reset_field("div.um-field[data-cond-"+i+"-field="+t+"]")))),"hide"==a&&n==live_field&&"undefined"!=typeof o&&("empty"==r&&(live_value&&""!=live_value?jQuery(this).fadeIn():(jQuery(this).hide(),e++)),"not empty"==r&&(live_value&&""!=live_value?(jQuery(this).hide(),e++):(jQuery(this).fadeIn(),jQuery("div.um-field[data-cond-"+i+"-field="+t+"]").show())),"equals to"==r&&(o==live_value?(jQuery(this).hide(),e++):(jQuery(this).fadeIn(),jQuery("div.um-field[data-cond-"+i+"-field="+t+"]").show())),"not equals"==r&&(jQuery.isNumeric(o)&&parseInt(live_value)!=parseInt(o)&&live_value?(jQuery(this).hide(),e++):jQuery.isNumeric(o)||o==live_value?(jQuery(this).fadeIn(),jQuery("div.um-field[data-cond-"+i+"-field="+t+"]").show()):(jQuery(this).hide(),e++)),"greater than"==r&&(jQuery.isNumeric(o)&&parseInt(live_value)>parseInt(o)?(jQuery(this).hide(),e++):(jQuery(this).fadeIn(),jQuery("div.um-field[data-cond-"+i+"-field="+t+"]").show())),"less than"==r&&(jQuery.isNumeric(o)&&parseInt(live_value)<parseInt(o)&&live_value?(jQuery(this).hide(),e++):(jQuery(this).fadeIn(),jQuery("div.um-field[data-cond-"+i+"-field="+t+"]").show())),"contains"==r&&(live_value&&live_value.indexOf(o)>=0?(jQuery(this).hide(),e++):(jQuery(this).fadeIn(),jQuery("div.um-field[data-cond-"+i+"-field="+t+"]").show())))}})}function UM_check_password_matched(){jQuery(document).on("keyup","input[data-key=user_password],input[data-key=confirm_user_password]",function(e){var t=jQuery("input[data-key=user_password]").val(),i=jQuery("input[data-key=confirm_user_password]").val(),a=jQuery("input[data-key=user_password],input[data-key=confirm_user_password]");t||i?t!==i?a.removeClass("um-validate-matched").addClass("um-validate-not-matched"):a.removeClass("um-validate-not-matched").addClass("um-validate-matched"):a.removeClass("um-validate-matched").removeClass("um-validate-not-matched")})}function UM_check_username(){jQuery(document).on("keyup","input[data-key=user_login]:not([disabled=disabled])",function(){var e=jQuery("input[data-key=user_login]"),t=e.val();if(e.parents(".um-field").find(".um-field-error").length)var i=e.parents(".um-field").find(".um-field-error");else var i=jQuery('<div class="um-field-error"><span class="um-field-arrow"><i class="um-faicon-caret-up"></i></span>Your username is already taken</div>');return xhrValidateUsername&&xhrValidateUsername.abort(),t?(e.addClass("um-searching-username"),void(xhrValidateUsername=jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_check_username_exists",username:t},complete:function(){e.removeClass("um-searching-username")},success:function(t){parseInt(t)>0?(e.removeClass("um-validate-username-unique").addClass("um-validate-username-exists"),e.parents(".um-field").find(".um-field-error").length||e.parents(".um-field").append(i),i.show()):(e.removeClass("um-validate-username-exists").addClass("um-validate-username-unique"),i.hide())}}))):void e.removeClass("um-searching-username")})}function UM_hide_menus(){menu=jQuery(".um-dropdown"),menu.parents("div").find("a").removeClass("active"),menu.hide()}function UM_domenus(){jQuery(".um-dropdown").each(function(){var e=jQuery(this),t=jQuery(this).attr("data-element"),i=jQuery(this).attr("data-position");jQuery(t).addClass("um-trigger-menu-on-"+e.attr("data-trigger")),jQuery(window).width()<=1200&&"div.um-profile-edit"==t&&(i="lc"),"lc"==i&&(200>jQuery(t).find("img").width()?left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2+(jQuery(t).find("img").width()-200)/2:left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2,top_=parseInt(jQuery(t).find("a").css("top")),top_?(top_p=jQuery(t).find("img").height()+4+top_,left_gap=4):(top_p=jQuery(t).find("img").height()+4,left_gap=0),4==top_p&&"div.um-cover"==t?top_p=jQuery(t).height()/2+e.height()/2:4==top_p&&(top_p=jQuery(t).height()+20),gap_right=jQuery(t).width()+17,e.css({top:0,width:200,left:"auto",right:gap_right+"px","text-align":"center"}),e.find(".um-dropdown-arr").find("i").removeClass().addClass("um-icon-arrow-right-b"),e.find(".um-dropdown-arr").css({top:"4px",left:"auto",right:"-17px"})),"bc"==i&&(200>jQuery(t).find("img").width()?left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2+(jQuery(t).find("img").width()-200)/2:left_p=(jQuery(t).width()-jQuery(t).find("img").width())/2,top_=parseInt(jQuery(t).find("a").css("top")),top_?(top_p=jQuery(t).find("img").height()+4+top_,left_gap=4):(top_p=jQuery(t).find("img").height()+4,left_gap=0),4==top_p&&"div.um-cover"==t?top_p=jQuery(t).height()/2+e.height()/2:4==top_p&&(top_p=jQuery(t).height()+20),e.css({top:top_p,width:200,left:left_p+left_gap,right:"auto","text-align":"center"}),e.find(".um-dropdown-arr").find("i").removeClass().addClass("um-icon-arrow-up-b"),e.find(".um-dropdown-arr").css({top:"-17px",left:e.width()/2-12,right:"auto"}))})}function um_responsive(){jQuery(".um").each(function(){element_width=jQuery(this).width(),element_width<=340?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob340")):element_width<=500?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob500")):element_width<=800?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob800")):element_width<=960?(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960"),jQuery(this).addClass("uimob960")):element_width>960&&(jQuery(this).removeClass("uimob340"),jQuery(this).removeClass("uimob500"),jQuery(this).removeClass("uimob800"),jQuery(this).removeClass("uimob960")),jQuery(".um-account-nav").length>0&&jQuery(".um-account-side").is(":visible")&&0==jQuery(".um-account-tab:visible").length&&jQuery(".um-account-side li a.current").trigger("click"),jQuery(this).css("opacity",1)}),jQuery(".um-cover, .um-member-cover").each(function(){var e=jQuery(this),t=e.data("ratio"),i=e.width(),a=t.split(":");calcHeight=Math.round(i/a[0])+"px",e.height(calcHeight),e.find(".um-cover-add").height(calcHeight)}),jQuery(".um-members").each(function(){UM_Member_Grid(jQuery(this))}),UM_domenus()}function UM_Member_Grid(e){e.masonry({itemSelector:".um-member",columnWidth:".um-member",gutter:".um-gutter-sizer"})}function initImageUpload_UM(e){e.data("upload_help_text")?upload_help_text='<span class="help">'+e.data("upload_help_text")+"</span>":upload_help_text="",e.data("icon")?icon='<span class="icon"><i class="'+e.data("icon")+'"></i></span>':icon="",e.data("upload_text")?upload_text='<span class="str">'+e.data("upload_text")+"</span>":upload_text="",e.uploadFile({url:um_scripts.imageupload,method:"POST",multiple:!1,formData:{key:e.data("key"),set_id:e.data("set_id"),set_mode:e.data("set_mode")},fileName:e.data("key"),allowedTypes:e.data("allowed_types"),maxFileSize:e.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:e.data("max_size_error"),extErrorStr:e.data("extension_error"),maxFileCountErrorStr:e.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,onSubmit:function(t){e.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(t,i,a){e.selectedFiles=0,i=jQuery.parseJSON(i),i.error&&""!=i.error?(e.parents(".um-modal-body").append('<div class="um-error-block">'+i.error+"</div>"),e.parents(".um-modal-body").find(".upload-statusbar").hide(0),um_modal_responsive()):jQuery.each(i,function(t,i){var a=e.parents(".um-modal-body").find(".um-single-image-preview img"),n=e.parents(".um-modal-body").find(".um-single-image-preview");a.attr("src",i),a.load(function(){e.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),e.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),n.show(0),um_modal_responsive()})})}})}function initFileUpload_UM(e){e.data("upload_help_text")?upload_help_text='<span class="help">'+e.data("upload_help_text")+"</span>":upload_help_text="",e.data("icon")?icon='<span class="icon"><i class="'+e.data("icon")+'"></i></span>':icon="",e.data("upload_text")?upload_text='<span class="str">'+e.data("upload_text")+"</span>":upload_text="",e.uploadFile({url:um_scripts.fileupload,method:"POST",multiple:!1,formData:{key:e.data("key"),set_id:e.data("set_id"),set_mode:e.data("set_mode")},fileName:e.data("key"),allowedTypes:e.data("allowed_types"),maxFileSize:e.data("max_size"),dragDropStr:icon+upload_text+upload_help_text,sizeErrorStr:e.data("max_size_error"),extErrorStr:e.data("extension_error"),maxFileCountErrorStr:e.data("max_files_error"),maxFileCount:1,showDelete:!1,showAbort:!1,showDone:!1,showFileCounter:!1,showStatusAfterSuccess:!0,onSubmit:function(t){e.parents(".um-modal-body").find(".um-error-block").remove()},onSuccess:function(t,i,a){e.selectedFiles=0,i=jQuery.parseJSON(i),i.error&&""!=i.error?(e.parents(".um-modal-body").append('<div class="um-error-block">'+i.error+"</div>"),e.parents(".um-modal-body").find(".upload-statusbar").hide(0),um_modal_responsive()):(jQuery.each(i,function(t,i){e.parents(".um-modal-body").find(".um-modal-btn.um-finish-upload.disabled").removeClass("disabled"),e.parents(".um-modal-body").find(".ajax-upload-dragdrop,.upload-statusbar").hide(0),e.parents(".um-modal-body").find(".um-single-file-preview").show(0),"icon"==t?e.parents(".um-modal-body").find(".um-single-fileinfo i").removeClass().addClass(i):"icon_bg"==t?e.parents(".um-modal-body").find(".um-single-fileinfo span.icon").css({"background-color":i}):"filename"==t?e.parents(".um-modal-body").find(".um-single-fileinfo span.filename").html(i):e.parents(".um-modal-body").find(".um-single-fileinfo a").attr("href",i)}),um_modal_responsive())}})}function initCrop_UM(){var e=jQuery(".um-modal:visible .um-single-image-preview img"),t=jQuery(".um-modal:visible .um-single-image-preview"),i=e.parent().attr("data-crop"),a=e.parent().attr("data-min_width"),n=e.parent().attr("data-min_height"),r=e.parent().attr("data-ratio");if(jQuery(".um-modal").find("#um_upload_single").attr("data-ratio"))var r=jQuery(".um-modal").find("#um_upload_single").attr("data-ratio"),o=r.split(":"),r=o[0];if(e.length&&""!=e.attr("src")){var s=jQuery(window).height()-(jQuery(".um-modal-footer a").height()+20)-50-jQuery(".um-modal-header:visible").height();if(e.css({height:"auto"}),t.css({height:"auto"}),jQuery(window).height()<=400?(t.css({height:s+"px","max-height":s+"px"}),e.css({height:"auto"})):(e.css({height:"auto","max-height":s+"px"}),t.css({height:e.height(),"max-height":s+"px"})),"square"==i)var l={minWidth:a,minHeight:n,dragCrop:!1,aspectRatio:1,zoomable:!1,rotatable:!1,dashed:!1,done:function(t){e.parent().attr("data-coord",Math.round(t.x)+","+Math.round(t.y)+","+Math.round(t.width)+","+Math.round(t.height))}};else if("cover"==i)var l={minWidth:a,minHeight:Math.round(a/r),dragCrop:!1,aspectRatio:r,zoomable:!1,rotatable:!1,dashed:!1,done:function(t){e.parent().attr("data-coord",Math.round(t.x)+","+Math.round(t.y)+","+Math.round(t.width)+","+Math.round(t.height))}};else if("user"==i)var l={minWidth:a,minHeight:n,dragCrop:!0,aspectRatio:"auto",zoomable:!1,rotatable:!1,dashed:!1,done:function(t){e.parent().attr("data-coord",Math.round(t.x)+","+Math.round(t.y)+","+Math.round(t.width)+","+Math.round(t.height))}};0!=i&&e.cropper(l)}}function um_new_modal(e,t,i,a){var n=jQuery("body").find(".um-modal-overlay");if(0==n.length)if(jQuery(".tipsy").hide(),UM_hide_menus(),jQuery("body,html,textarea").css("overflow","hidden"),jQuery(document).bind("touchmove",function(e){e.preventDefault()}),jQuery(".um-modal").on("touchmove",function(e){e.stopPropagation()}),i?jQuery("body").append('<div class="um-modal-overlay" /><div class="um-modal is-photo" />'):jQuery("body").append('<div class="um-modal-overlay" /><div class="um-modal no-photo" />'),jQuery("#"+e).prependTo(".um-modal"),i){jQuery(".um-modal").find(".um-modal-photo").html("<img />");var r=jQuery(".um-modal-photo img"),o=jQuery(window).width()-60,s=jQuery(window).height()-.25*jQuery(window).height();r.attr("src",a),r.load(function(){jQuery("#"+e).show(),jQuery(".um-modal").show(),r.css({opacity:0}),r.css({"max-width":o}),r.css({"max-height":s}),jQuery(".um-modal").css({width:r.width(),"margin-left":"-"+r.width()/2+"px"}),r.animate({opacity:1},1e3),um_modal_responsive()})}else jQuery("#"+e).show(),jQuery(".um-modal").show(),um_modal_size(t),initImageUpload_UM(jQuery(".um-modal:visible").find(".um-single-image-upload")),initFileUpload_UM(jQuery(".um-modal:visible").find(".um-single-file-upload")),um_modal_responsive()}function um_modal_responsive(){var e=jQuery(".um-modal:visible"),t=jQuery(".um-modal-body.photo:visible");if(t.length){e.removeClass("uimob340"),e.removeClass("uimob500");var i=jQuery(".um-modal-photo img"),a=jQuery(window).width()-60,n=jQuery(window).height()-.25*jQuery(window).height();i.css({opacity:0}),i.css({"max-width":a}),i.css({"max-height":n}),jQuery(".um-modal").css({width:i.width(),"margin-left":"-"+i.width()/2+"px"}),i.animate({opacity:1},1e3);var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}else if(e.length){var o=jQuery(window).width();if(e.removeClass("uimob340"),e.removeClass("uimob500"),340>=o)e.addClass("uimob340"),initCrop_UM(),e.animate({bottom:0},300);else if(500>=o)e.addClass("uimob500"),initCrop_UM(),e.animate({bottom:0},300);else if(800>=o){initCrop_UM();var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}else if(960>=o){initCrop_UM();var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}else if(o>960){initCrop_UM();var r=(jQuery(window).height()-e.innerHeight())/2+"px";e.animate({bottom:r},300)}}}function um_remove_modal(){jQuery("img.cropper-hidden").cropper("destroy"),jQuery("body,html,textarea").css("overflow","auto"),jQuery(document).unbind("touchmove"),jQuery('.um-modal div[id^="um_"]').hide().appendTo("body"),jQuery(".um-modal,.um-modal-overlay").remove()}function um_modal_size(e){jQuery(".um-modal:visible").addClass(e)}function um_modal_add_attr(e,t){jQuery(".um-modal:visible").data(e,t)}function prepare_Modal(){0==jQuery(".um-popup-overlay").length&&(jQuery("body").append('<div class="um-popup-overlay"></div>'),jQuery("body").append('<div class="um-popup"></div>'),jQuery(".um-popup").addClass("loading"),jQuery("body,html").css({overflow:"hidden"}))}function remove_Modal(){jQuery(".um-popup-overlay").length&&(jQuery(".tipsy").remove(),jQuery(".um-popup").empty().remove(),jQuery(".um-popup-overlay").empty().remove(),jQuery("body,html").css({overflow:"auto"}))}function show_Modal(e){jQuery(".um-popup-overlay").length&&(jQuery(".um-popup").removeClass("loading").html(e),jQuery(".um-tip-n").tipsy({gravity:"n",opacity:1,offset:3}),jQuery(".um-tip-w").tipsy({gravity:"w",opacity:1,offset:3}),jQuery(".um-tip-e").tipsy({gravity:"e",opacity:1,offset:3}),jQuery(".um-tip-s").tipsy({gravity:"s",opacity:1,offset:3}))}function responsive_Modal(){jQuery(".um-popup-overlay").length&&(ag_height=jQuery(window).height()-jQuery(".um-popup um-popup-header").outerHeight()-jQuery(".um-popup .um-popup-footer").outerHeight()-80,ag_height>350&&(ag_height=350),jQuery(".um-popup-autogrow:visible").length?(jQuery(".um-popup-autogrow:visible").css({height:ag_height+"px"}),jQuery(".um-popup-autogrow:visible").mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500}).mCustomScrollbar("scrollTo","bottom",{scrollInertia:0})):jQuery(".um-popup-autogrow2:visible").length&&(jQuery(".um-popup-autogrow2:visible").css({"max-height":ag_height+"px"}),jQuery(".um-popup-autogrow2:visible").mCustomScrollbar({theme:"dark-3",mouseWheelPixels:500})))}function um_reset_field(e){jQuery(e).find("div.um-field-area").find("input,textarea,select").not(":button, :submit, :reset, :hidden").val("").removeAttr("checked").removeAttr("selected")}!function(e){"undefined"==typeof e.fn.each2&&e.extend(e.fn,{each2:function(t){for(var i=e([0]),a=-1,n=this.length;++a<n&&(i.context=i[0]=this[a])&&t.call(i[0],a,i)!==!1;);return this}})}(jQuery),function(e,t){"use strict";function i(t){var i=e(document.createTextNode(""));t.before(i),i.before(t),i.remove()}function a(e){function t(e){return B[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function n(e,t){for(var i=0,a=t.length;a>i;i+=1)if(o(e,t[i]))return i;return-1}function r(){var t=e(L);t.appendTo("body");var i={width:t.width()-t[0].clientWidth,height:t.height()-t[0].clientHeight};return t.remove(),i}function o(e,i){return e===i?!0:e===t||i===t?!1:null===e||null===i?!1:e.constructor===String?e+""==i+"":i.constructor===String?i+""==e+"":!1}function s(t,i){var a,n,r;if(null===t||t.length<1)return[];for(a=t.split(i),n=0,r=a.length;r>n;n+=1)a[n]=e.trim(a[n]);return a}function l(e){return e.outerWidth(!1)-e.width()}function c(i){var a="keyup-change-value";i.on("keydown",function(){e.data(i,a)===t&&e.data(i,a,i.val())}),i.on("keyup",function(){var n=e.data(i,a);n!==t&&i.val()!==n&&(e.removeData(i,a),i.trigger("keyup-change"))})}function u(i){i.on("mousemove",function(i){var a=F;(a===t||a.x!==i.pageX||a.y!==i.pageY)&&e(i.target).trigger("mousemove-filtered",i)})}function d(e,i,a){a=a||t;var n;return function(){var t=arguments;window.clearTimeout(n),n=window.setTimeout(function(){i.apply(a,t)},e)}}function h(e,t){var i=d(e,function(e){t.trigger("scroll-debounced",e)});t.on("scroll",function(e){n(e.target,t.get())>=0&&i(e)})}function p(e){e[0]!==document.activeElement&&window.setTimeout(function(){var t,i=e[0],a=e.val().length;e.focus();var n=i.offsetWidth>0||i.offsetHeight>0;n&&i===document.activeElement&&(i.setSelectionRange?i.setSelectionRange(a,a):i.createTextRange&&(t=i.createTextRange(),t.collapse(!1),t.select()))},0)}function f(t){t=e(t)[0];var i=0,a=0;if("selectionStart"in t)i=t.selectionStart,a=t.selectionEnd-i;else if("selection"in document){t.focus();var n=document.selection.createRange();a=document.selection.createRange().text.length,n.moveStart("character",-t.value.length),i=n.text.length-a}return{offset:i,length:a}}function m(e){e.preventDefault(),e.stopPropagation()}function g(e){e.preventDefault(),e.stopImmediatePropagation()}function v(t){if(!P){var i=t[0].currentStyle||window.getComputedStyle(t[0],null);P=e(document.createElement("div")).css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:i.fontSize,fontFamily:i.fontFamily,fontStyle:i.fontStyle,fontWeight:i.fontWeight,letterSpacing:i.letterSpacing,textTransform:i.textTransform,whiteSpace:"nowrap"}),P.attr("class","select2-sizer"),e("body").append(P)}return P.text(t.val()),P.width()}function y(t,i,a){var n,r,o=[];n=t.attr("class"),n&&(n=""+n,e(n.split(" ")).each2(function(){0===this.indexOf("select2-")&&o.push(this)})),n=i.attr("class"),n&&(n=""+n,e(n.split(" ")).each2(function(){0!==this.indexOf("select2-")&&(r=a(this),r&&o.push(r))})),t.attr("class",o.join(" "))}function b(e,t,i,n){var r=a(e.toUpperCase()).indexOf(a(t.toUpperCase())),o=t.length;return 0>r?void i.push(n(e)):(i.push(n(e.substring(0,r))),i.push("<span class='select2-match'>"),i.push(n(e.substring(r,r+o))),i.push("</span>"),void i.push(n(e.substring(r+o,e.length))))}function w(e){var t={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})}function x(i){var a,n=null,r=i.quietMillis||100,o=i.url,s=this;return function(l){window.clearTimeout(a),a=window.setTimeout(function(){var a=i.data,r=o,c=i.transport||e.fn.select2.ajaxDefaults.transport,u={type:i.type||"GET",cache:i.cache||!1,jsonpCallback:i.jsonpCallback||t,dataType:i.dataType||"json"},d=e.extend({},e.fn.select2.ajaxDefaults.params,u);a=a?a.call(s,l.term,l.page,l.context):null,r="function"==typeof r?r.call(s,l.term,l.page,l.context):r,n&&"function"==typeof n.abort&&n.abort(),i.params&&(e.isFunction(i.params)?e.extend(d,i.params.call(s)):e.extend(d,i.params)),e.extend(d,{url:r,dataType:i.dataType,data:a,success:function(e){var t=i.results(e,l.page);l.callback(t)}}),n=c.call(s,d)},r)}}function _(t){var i,a,n=t,r=function(e){return""+e.text};e.isArray(n)&&(a=n,n={results:a}),e.isFunction(n)===!1&&(a=n,n=function(){return a});var o=n();return o.text&&(r=o.text,e.isFunction(r)||(i=o.text,r=function(e){return e[i]})),function(t){var i,a=t.term,o={results:[]};return""===a?void t.callback(n()):(i=function(n,o){var s,l;if(n=n[0],n.children){s={};for(l in n)n.hasOwnProperty(l)&&(s[l]=n[l]);s.children=[],e(n.children).each2(function(e,t){i(t,s.children)}),(s.children.length||t.matcher(a,r(s),n))&&o.push(s)}else t.matcher(a,r(n),n)&&o.push(n)},e(n().results).each2(function(e,t){i(t,o.results)}),void t.callback(o))}}function C(i){var a=e.isFunction(i);return function(n){var r=n.term,o={results:[]},s=a?i(n):i;e.isArray(s)&&(e(s).each(function(){var e=this.text!==t,i=e?this.text:this;(""===r||n.matcher(r,i))&&o.results.push(e?this:{id:this,text:this})}),n.callback(o))}}function S(t,i){if(e.isFunction(t))return!0;if(!t)return!1;if("string"==typeof t)return!0;throw new Error(i+" must be a string, function, or falsy value")}function j(t){if(e.isFunction(t)){var i=Array.prototype.slice.call(arguments,1);return t.apply(null,i)}return t}function k(t){var i=0;return e.each(t,function(e,t){t.children?i+=k(t.children):i++}),i}function Q(e,i,a,n){var r,s,l,c,u,d=e,h=!1;if(!n.createSearchChoice||!n.tokenSeparators||n.tokenSeparators.length<1)return t;for(;;){for(s=-1,l=0,c=n.tokenSeparators.length;c>l&&(u=n.tokenSeparators[l],s=e.indexOf(u),!(s>=0));l++);if(0>s)break;if(r=e.substring(0,s),e=e.substring(s+u.length),r.length>0&&(r=n.createSearchChoice.call(this,r,i),r!==t&&null!==r&&n.id(r)!==t&&null!==n.id(r))){for(h=!1,l=0,c=i.length;c>l;l++)if(o(n.id(r),n.id(i[l]))){h=!0;break}h||a(r)}}return d!==e?e:void 0}function T(){var e=this;Array.prototype.forEach.call(arguments,function(t){e[t].remove(),e[t]=null})}function D(t,i){var a=function(){};return a.prototype=new t,a.prototype.constructor=a,a.prototype.parent=t.prototype,a.prototype=e.extend(a.prototype,i),a}if(window.Select2===t){var O,E,M,I,A,P,R,H,F={x:0,y:0},O={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(e){switch(e=e.which?e.which:e){case O.LEFT:case O.RIGHT:case O.UP:case O.DOWN:return!0}return!1},isControl:function(e){var t=e.which;switch(t){case O.SHIFT:case O.CTRL:case O.ALT:return!0}return e.metaKey?!0:!1},isFunctionKey:function(e){return e=e.which?e.which:e,e>=112&&123>=e}},L="<div class='select2-measure-scrollbar'></div>",B={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z"};R=e(document),A=function(){var e=1;return function(){return e++}}(),R.on("mousemove",function(e){F.x=e.pageX,F.y=e.pageY}),E=D(Object,{bind:function(e){var t=this;return function(){e.apply(t,arguments)}},init:function(i){var a,n,o=".select2-results";this.opts=i=this.prepareOpts(i),this.id=i.id,i.element.data("select2")!==t&&null!==i.element.data("select2")&&i.element.data("select2").destroy(),this.container=this.createContainer(),this.liveRegion=e("<span>",{role:"status","aria-live":"polite"}).addClass("select2-hidden-accessible").appendTo(document.body),this.containerId="s2id_"+(i.element.attr("id")||"autogen"+A()),
2
+ this.containerEventName=this.containerId.replace(/([.])/g,"_").replace(/([;&,\-\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1"),this.container.attr("id",this.containerId),this.container.attr("title",i.element.attr("title")),this.body=e("body"),y(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.attr("style",i.element.attr("style")),this.container.css(j(i.containerCss)),this.container.addClass(j(i.containerCssClass)),this.elementTabIndex=this.opts.element.attr("tabindex"),this.opts.element.data("select2",this).attr("tabindex","-1").before(this.container).on("click.select2",m),this.container.data("select2",this),this.dropdown=this.container.find(".select2-drop"),y(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(j(i.dropdownCssClass)),this.dropdown.data("select2",this),this.dropdown.on("click",m),this.results=a=this.container.find(o),this.search=n=this.container.find("input.select2-input"),this.queryCount=0,this.resultsPage=0,this.context=null,this.initContainer(),this.container.on("click",m),u(this.results),this.dropdown.on("mousemove-filtered",o,this.bind(this.highlightUnderEvent)),this.dropdown.on("touchstart touchmove touchend",o,this.bind(function(e){this._touchEvent=!0,this.highlightUnderEvent(e)})),this.dropdown.on("touchmove",o,this.bind(this.touchMoved)),this.dropdown.on("touchstart touchend",o,this.bind(this.clearTouchMoved)),this.dropdown.on("click",this.bind(function(){this._touchEvent&&(this._touchEvent=!1,this.selectHighlighted())})),h(80,this.results),this.dropdown.on("scroll-debounced",o,this.bind(this.loadMoreIfNeeded)),e(this.container).on("change",".select2-input",function(e){e.stopPropagation()}),e(this.dropdown).on("change",".select2-input",function(e){e.stopPropagation()}),e.fn.mousewheel&&a.mousewheel(function(e,t,i,n){var r=a.scrollTop();n>0&&0>=r-n?(a.scrollTop(0),m(e)):0>n&&a.get(0).scrollHeight-a.scrollTop()+n<=a.height()&&(a.scrollTop(a.get(0).scrollHeight-a.height()),m(e))}),c(n),n.on("keyup-change input paste",this.bind(this.updateResults)),n.on("focus",function(){n.addClass("select2-focused")}),n.on("blur",function(){n.removeClass("select2-focused")}),this.dropdown.on("mouseup",o,this.bind(function(t){e(t.target).closest(".select2-result-selectable").length>0&&(this.highlightUnderEvent(t),this.selectHighlighted(t))})),this.dropdown.on("click mouseup mousedown touchstart touchend focusin",function(e){e.stopPropagation()}),this.nextSearchTerm=t,e.isFunction(this.opts.initSelection)&&(this.initSelection(),this.monitorSource()),null!==i.maximumInputLength&&this.search.attr("maxlength",i.maximumInputLength);var s=i.element.prop("disabled");s===t&&(s=!1),this.enable(!s);var l=i.element.prop("readonly");l===t&&(l=!1),this.readonly(l),H=H||r(),this.autofocus=i.element.prop("autofocus"),i.element.prop("autofocus",!1),this.autofocus&&this.focus(),this.search.attr("placeholder",i.searchInputPlaceholder)},destroy:function(){var e=this.opts.element,i=e.data("select2");this.close(),this.propertyObserver&&(this.propertyObserver.disconnect(),this.propertyObserver=null),i!==t&&(i.container.remove(),i.liveRegion.remove(),i.dropdown.remove(),e.removeClass("select2-offscreen").removeData("select2").off(".select2").prop("autofocus",this.autofocus||!1),this.elementTabIndex?e.attr({tabindex:this.elementTabIndex}):e.removeAttr("tabindex"),e.show()),T.call(this,"container","liveRegion","dropdown","results","search")},optionToData:function(e){return e.is("option")?{id:e.prop("value"),text:e.text(),element:e.get(),css:e.attr("class"),disabled:e.prop("disabled"),locked:o(e.attr("locked"),"locked")||o(e.data("locked"),!0)}:e.is("optgroup")?{text:e.attr("label"),children:[],element:e.get(),css:e.attr("class")}:void 0},prepareOpts:function(i){var a,n,r,l,c=this;if(a=i.element,"select"===a.get(0).tagName.toLowerCase()&&(this.select=n=i.element),n&&e.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in i)throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}),i=e.extend({},{populateResults:function(a,n,r){var o,s=this.opts.id,l=this.liveRegion;(o=function(a,n,u){var d,h,p,f,m,g,v,y,b,w;for(a=i.sortResults(a,n,r),d=0,h=a.length;h>d;d+=1)p=a[d],m=p.disabled===!0,f=!m&&s(p)!==t,g=p.children&&p.children.length>0,v=e("<li></li>"),v.addClass("select2-results-dept-"+u),v.addClass("select2-result"),v.addClass(f?"select2-result-selectable":"select2-result-unselectable"),m&&v.addClass("select2-disabled"),g&&v.addClass("select2-result-with-children"),v.addClass(c.opts.formatResultCssClass(p)),v.attr("role","presentation"),y=e(document.createElement("div")),y.addClass("select2-result-label"),y.attr("id","select2-result-label-"+A()),y.attr("role","option"),w=i.formatResult(p,y,r,c.opts.escapeMarkup),w!==t&&(y.html(w),v.append(y)),g&&(b=e("<ul></ul>"),b.addClass("select2-result-sub"),o(p.children,b,u+1),v.append(b)),v.data("select2-data",p),n.append(v);l.text(i.formatMatches(a.length))})(n,a,0)}},e.fn.select2.defaults,i),"function"!=typeof i.id&&(r=i.id,i.id=function(e){return e[r]}),e.isArray(i.element.data("select2Tags"))){if("tags"in i)throw"tags specified as both an attribute 'data-select2-tags' and in options of Select2 "+i.element.attr("id");i.tags=i.element.data("select2Tags")}if(n?(i.query=this.bind(function(e){var i,n,r,o={results:[],more:!1},s=e.term;r=function(t,i){var a;t.is("option")?e.matcher(s,t.text(),t)&&i.push(c.optionToData(t)):t.is("optgroup")&&(a=c.optionToData(t),t.children().each2(function(e,t){r(t,a.children)}),a.children.length>0&&i.push(a))},i=a.children(),this.getPlaceholder()!==t&&i.length>0&&(n=this.getPlaceholderOption(),n&&(i=i.not(n))),i.each2(function(e,t){r(t,o.results)}),e.callback(o)}),i.id=function(e){return e.id}):"query"in i||("ajax"in i?(l=i.element.data("ajax-url"),l&&l.length>0&&(i.ajax.url=l),i.query=x.call(i.element,i.ajax)):"data"in i?i.query=_(i.data):"tags"in i&&(i.query=C(i.tags),i.createSearchChoice===t&&(i.createSearchChoice=function(t){return{id:e.trim(t),text:e.trim(t)}}),i.initSelection===t&&(i.initSelection=function(t,a){var n=[];e(s(t.val(),i.separator)).each(function(){var t={id:this,text:this},a=i.tags;e.isFunction(a)&&(a=a()),e(a).each(function(){return o(this.id,t.id)?(t=this,!1):void 0}),n.push(t)}),a(n)}))),"function"!=typeof i.query)throw"query function not defined for Select2 "+i.element.attr("id");if("top"===i.createSearchChoicePosition)i.createSearchChoicePosition=function(e,t){e.unshift(t)};else if("bottom"===i.createSearchChoicePosition)i.createSearchChoicePosition=function(e,t){e.push(t)};else if("function"!=typeof i.createSearchChoicePosition)throw"invalid createSearchChoicePosition option must be 'top', 'bottom' or a custom function";return i},monitorSource:function(){var e,i,a=this.opts.element;a.on("change.select2",this.bind(function(){this.opts.element.data("select2-change-triggered")!==!0&&this.initSelection()})),e=this.bind(function(){var e=a.prop("disabled");e===t&&(e=!1),this.enable(!e);var i=a.prop("readonly");i===t&&(i=!1),this.readonly(i),y(this.container,this.opts.element,this.opts.adaptContainerCssClass),this.container.addClass(j(this.opts.containerCssClass)),y(this.dropdown,this.opts.element,this.opts.adaptDropdownCssClass),this.dropdown.addClass(j(this.opts.dropdownCssClass))}),a.length&&a[0].attachEvent&&a.each(function(){this.attachEvent("onpropertychange",e)}),i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver,i!==t&&(this.propertyObserver&&(delete this.propertyObserver,this.propertyObserver=null),this.propertyObserver=new i(function(t){t.forEach(e)}),this.propertyObserver.observe(a.get(0),{attributes:!0,subtree:!1}))},triggerSelect:function(t){var i=e.Event("select2-selecting",{val:this.id(t),object:t});return this.opts.element.trigger(i),!i.isDefaultPrevented()},triggerChange:function(t){t=t||{},t=e.extend({},t,{type:"change",val:this.val()}),this.opts.element.data("select2-change-triggered",!0),this.opts.element.trigger(t),this.opts.element.data("select2-change-triggered",!1),this.opts.element.click(),this.opts.blurOnChange&&this.opts.element.blur()},isInterfaceEnabled:function(){return this.enabledInterface===!0},enableInterface:function(){var e=this._enabled&&!this._readonly,t=!e;return e===this.enabledInterface?!1:(this.container.toggleClass("select2-container-disabled",t),this.close(),this.enabledInterface=e,!0)},enable:function(e){e===t&&(e=!0),this._enabled!==e&&(this._enabled=e,this.opts.element.prop("disabled",!e),this.enableInterface())},disable:function(){this.enable(!1)},readonly:function(e){e===t&&(e=!1),this._readonly!==e&&(this._readonly=e,this.opts.element.prop("readonly",e),this.enableInterface())},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var t,i,a,n,r,o=this.dropdown,s=this.container.offset(),l=this.container.outerHeight(!1),c=this.container.outerWidth(!1),u=o.outerHeight(!1),d=e(window),h=d.width(),p=d.height(),f=d.scrollLeft()+h,m=d.scrollTop()+p,g=s.top+l,v=s.left,y=m>=g+u,b=s.top-u>=d.scrollTop(),w=o.outerWidth(!1),x=f>=v+w,_=o.hasClass("select2-drop-above");_?(i=!0,!b&&y&&(a=!0,i=!1)):(i=!1,!y&&b&&(a=!0,i=!0)),a&&(o.hide(),s=this.container.offset(),l=this.container.outerHeight(!1),c=this.container.outerWidth(!1),u=o.outerHeight(!1),f=d.scrollLeft()+h,m=d.scrollTop()+p,g=s.top+l,v=s.left,w=o.outerWidth(!1),x=f>=v+w,o.show(),this.focusSearch()),this.opts.dropdownAutoWidth?(r=e(".select2-results",o)[0],o.addClass("select2-drop-auto-width"),o.css("width",""),w=o.outerWidth(!1)+(r.scrollHeight===r.clientHeight?0:H.width),w>c?c=w:w=c,u=o.outerHeight(!1),x=f>=v+w):this.container.removeClass("select2-drop-auto-width"),"static"!==this.body.css("position")&&(t=this.body.offset(),g-=t.top,v-=t.left),x||(v=s.left+this.container.outerWidth(!1)-w),n={left:v,width:c},i?(n.top=s.top-u,n.bottom="auto",this.container.addClass("select2-drop-above"),o.addClass("select2-drop-above")):(n.top=g,n.bottom="auto",this.container.removeClass("select2-drop-above"),o.removeClass("select2-drop-above")),n=e.extend(n,j(this.opts.dropdownCss)),o.css(n)},shouldOpen:function(){var t;return this.opened()?!1:this._enabled===!1||this._readonly===!0?!1:(t=e.Event("select2-opening"),this.opts.element.trigger(t),!t.isDefaultPrevented())},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above"),this.dropdown.removeClass("select2-drop-above")},open:function(){return this.shouldOpen()?(this.opening(),!0):!1},opening:function(){var t,a=this.containerEventName,n="scroll."+a,r="resize."+a,o="orientationchange."+a;this.container.addClass("select2-dropdown-open").addClass("select2-container-active"),this.clearDropdownAlignmentPreference(),this.dropdown[0]!==this.body.children().last()[0]&&this.dropdown.detach().appendTo(this.body),t=e("#select2-drop-mask"),0==t.length&&(t=e(document.createElement("div")),t.attr("id","select2-drop-mask").attr("class","select2-drop-mask"),t.hide(),t.appendTo(this.body),t.on("mousedown touchstart click",function(a){i(t);var n,r=e("#select2-drop");r.length>0&&(n=r.data("select2"),n.opts.selectOnBlur&&n.selectHighlighted({noFocus:!0}),n.close(),a.preventDefault(),a.stopPropagation())})),this.dropdown.prev()[0]!==t[0]&&this.dropdown.before(t),e("#select2-drop").removeAttr("id"),this.dropdown.attr("id","select2-drop"),t.show(),this.positionDropdown(),this.dropdown.show(),this.positionDropdown(),this.dropdown.addClass("select2-drop-active");var s=this;this.container.parents().add(window).each(function(){e(this).on(r+" "+n+" "+o,function(){s.opened()&&s.positionDropdown()})})},close:function(){if(this.opened()){var t=this.containerEventName,i="scroll."+t,a="resize."+t,n="orientationchange."+t;this.container.parents().add(window).each(function(){e(this).off(i).off(a).off(n)}),this.clearDropdownAlignmentPreference(),e("#select2-drop-mask").hide(),this.dropdown.removeAttr("id"),this.dropdown.hide(),this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active"),this.results.empty(),this.clearSearch(),this.search.removeClass("select2-active"),this.opts.element.trigger(e.Event("select2-close"))}},externalSearch:function(e){this.open(),this.search.val(e),this.updateResults(!1)},clearSearch:function(){},getMaximumSelectionSize:function(){return j(this.opts.maximumSelectionSize)},ensureHighlightVisible:function(){var t,i,a,n,r,o,s,l=this.results;if(i=this.highlight(),!(0>i)){if(0==i)return void l.scrollTop(0);t=this.findHighlightableChoices().find(".select2-result-label"),a=e(t[i]),n=a.offset().top+a.outerHeight(!0),i===t.length-1&&(s=l.find("li.select2-more-results"),s.length>0&&(n=s.offset().top+s.outerHeight(!0))),r=l.offset().top+l.outerHeight(!0),n>r&&l.scrollTop(l.scrollTop()+(n-r)),o=a.offset().top-l.offset().top,0>o&&"none"!=a.css("display")&&l.scrollTop(l.scrollTop()+o)}},findHighlightableChoices:function(){return this.results.find(".select2-result-selectable:not(.select2-disabled):not(.select2-selected)")},moveHighlight:function(t){for(var i=this.findHighlightableChoices(),a=this.highlight();a>-1&&a<i.length;){a+=t;var n=e(i[a]);if(n.hasClass("select2-result-selectable")&&!n.hasClass("select2-disabled")&&!n.hasClass("select2-selected")){this.highlight(a);break}}},highlight:function(t){var i,a,r=this.findHighlightableChoices();return 0===arguments.length?n(r.filter(".select2-highlighted")[0],r.get()):(t>=r.length&&(t=r.length-1),0>t&&(t=0),this.removeHighlight(),i=e(r[t]),i.addClass("select2-highlighted"),this.search.attr("aria-activedescendant",i.find(".select2-result-label").attr("id")),this.ensureHighlightVisible(),this.liveRegion.text(i.text()),a=i.data("select2-data"),void(a&&this.opts.element.trigger({type:"select2-highlight",val:this.id(a),choice:a})))},removeHighlight:function(){this.results.find(".select2-highlighted").removeClass("select2-highlighted")},touchMoved:function(){this._touchMoved=!0},clearTouchMoved:function(){this._touchMoved=!1},countSelectableResults:function(){return this.findHighlightableChoices().length},highlightUnderEvent:function(t){var i=e(t.target).closest(".select2-result-selectable");if(i.length>0&&!i.is(".select2-highlighted")){var a=this.findHighlightableChoices();this.highlight(a.index(i))}else 0==i.length&&this.removeHighlight()},loadMoreIfNeeded:function(){var e,t=this.results,i=t.find("li.select2-more-results"),a=this.resultsPage+1,n=this,r=this.search.val(),o=this.context;0!==i.length&&(e=i.offset().top-t.offset().top-t.height(),e<=this.opts.loadMorePadding&&(i.addClass("select2-active"),this.opts.query({element:this.opts.element,term:r,page:a,context:o,matcher:this.opts.matcher,callback:this.bind(function(e){n.opened()&&(n.opts.populateResults.call(this,t,e.results,{term:r,page:a,context:o}),n.postprocessResults(e,!1,!1),e.more===!0?(i.detach().appendTo(t).text(j(n.opts.formatLoadMore,a+1)),window.setTimeout(function(){n.loadMoreIfNeeded()},10)):i.remove(),n.positionDropdown(),n.resultsPage=a,n.context=e.context,this.opts.element.trigger({type:"select2-loaded",items:e}))})})))},tokenize:function(){},updateResults:function(i){function a(){c.removeClass("select2-active"),h.positionDropdown(),u.find(".select2-no-results,.select2-selection-limit,.select2-searching").length?h.liveRegion.text(u.text()):h.liveRegion.text(h.opts.formatMatches(u.find(".select2-result-selectable").length))}function n(e){u.html(e),a()}var r,s,l,c=this.search,u=this.results,d=this.opts,h=this,p=c.val(),f=e.data(this.container,"select2-last-term");if((i===!0||!f||!o(p,f))&&(e.data(this.container,"select2-last-term",p),i===!0||this.showSearchInput!==!1&&this.opened())){l=++this.queryCount;var m=this.getMaximumSelectionSize();if(m>=1&&(r=this.data(),e.isArray(r)&&r.length>=m&&S(d.formatSelectionTooBig,"formatSelectionTooBig")))return void n("<li class='select2-selection-limit'>"+j(d.formatSelectionTooBig,m)+"</li>");if(c.val().length<d.minimumInputLength)return n(S(d.formatInputTooShort,"formatInputTooShort")?"<li class='select2-no-results'>"+j(d.formatInputTooShort,c.val(),d.minimumInputLength)+"</li>":""),void(i&&this.showSearch&&this.showSearch(!0));if(d.maximumInputLength&&c.val().length>d.maximumInputLength)return void n(S(d.formatInputTooLong,"formatInputTooLong")?"<li class='select2-no-results'>"+j(d.formatInputTooLong,c.val(),d.maximumInputLength)+"</li>":"");d.formatSearching&&0===this.findHighlightableChoices().length&&n("<li class='select2-searching'>"+j(d.formatSearching)+"</li>"),c.addClass("select2-active"),this.removeHighlight(),s=this.tokenize(),s!=t&&null!=s&&c.val(s),this.resultsPage=1,d.query({element:d.element,term:c.val(),page:this.resultsPage,context:null,matcher:d.matcher,callback:this.bind(function(r){var s;if(l==this.queryCount){if(!this.opened())return void this.search.removeClass("select2-active");if(this.context=r.context===t?null:r.context,this.opts.createSearchChoice&&""!==c.val()&&(s=this.opts.createSearchChoice.call(h,c.val(),r.results),s!==t&&null!==s&&h.id(s)!==t&&null!==h.id(s)&&0===e(r.results).filter(function(){return o(h.id(this),h.id(s))}).length&&this.opts.createSearchChoicePosition(r.results,s)),0===r.results.length&&S(d.formatNoMatches,"formatNoMatches"))return void n("<li class='select2-no-results'>"+j(d.formatNoMatches,c.val())+"</li>");u.empty(),h.opts.populateResults.call(this,u,r.results,{term:c.val(),page:this.resultsPage,context:null}),r.more===!0&&S(d.formatLoadMore,"formatLoadMore")&&(u.append("<li class='select2-more-results'>"+h.opts.escapeMarkup(j(d.formatLoadMore,this.resultsPage))+"</li>"),window.setTimeout(function(){h.loadMoreIfNeeded()},10)),this.postprocessResults(r,i),a(),this.opts.element.trigger({type:"select2-loaded",items:r})}})})}},cancel:function(){this.close()},blur:function(){this.opts.selectOnBlur&&this.selectHighlighted({noFocus:!0}),this.close(),this.container.removeClass("select2-container-active"),this.search[0]===document.activeElement&&this.search.blur(),this.clearSearch(),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){p(this.search)},selectHighlighted:function(e){if(this._touchMoved)return void this.clearTouchMoved();var t=this.highlight(),i=this.results.find(".select2-highlighted"),a=i.closest(".select2-result").data("select2-data");a?(this.highlight(t),this.onSelect(a,e)):e&&e.noFocus&&this.close()},getPlaceholder:function(){var e;return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder||((e=this.getPlaceholderOption())!==t?e.text():t)},getPlaceholderOption:function(){if(this.select){var i=this.select.children("option").first();if(this.opts.placeholderOption!==t)return"first"===this.opts.placeholderOption&&i||"function"==typeof this.opts.placeholderOption&&this.opts.placeholderOption(this.select);if(""===e.trim(i.text())&&""===i.val())return i}},initContainerWidth:function(){function i(){var i,a,n,r,o,s;if("off"===this.opts.width)return null;if("element"===this.opts.width)return 0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px";if("copy"===this.opts.width||"resolve"===this.opts.width){if(i=this.opts.element.attr("style"),i!==t)for(a=i.split(";"),r=0,o=a.length;o>r;r+=1)if(s=a[r].replace(/\s/g,""),n=s.match(/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i),null!==n&&n.length>=1)return n[1];return"resolve"===this.opts.width?(i=this.opts.element.css("width"),i.indexOf("%")>0?i:0===this.opts.element.outerWidth(!1)?"auto":this.opts.element.outerWidth(!1)+"px"):null}return e.isFunction(this.opts.width)?this.opts.width():this.opts.width}var a=i.call(this);null!==a&&this.container.css("width",a)}}),M=D(E,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container"}).html(["<a href='javascript:void(0)' class='select2-choice' tabindex='-1'>"," <span class='select2-chosen'>&#160;</span><abbr class='select2-search-choice-close'></abbr>"," <span class='select2-arrow' role='presentation'><b role='presentation'></b></span>","</a>","<label for='' class='select2-offscreen'></label>","<input class='select2-focusser select2-offscreen' type='text' aria-haspopup='true' role='button' />","<div class='select2-drop select2-display-none'>"," <div class='select2-search'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input' role='combobox' aria-expanded='true'"," aria-autocomplete='list' />"," </div>"," <ul class='select2-results' role='listbox'>"," </ul>","</div>"].join(""));return t},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.focusser.prop("disabled",!this.isInterfaceEnabled())},opening:function(){var i,a,n;this.opts.minimumResultsForSearch>=0&&this.showSearch(!0),this.parent.opening.apply(this,arguments),this.showSearchInput!==!1&&this.search.val(this.focusser.val()),this.opts.shouldFocusInput(this)&&(this.search.focus(),i=this.search.get(0),i.createTextRange?(a=i.createTextRange(),a.collapse(!1),a.select()):i.setSelectionRange&&(n=this.search.val().length,i.setSelectionRange(n,n))),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.focusser.prop("disabled",!0).val(""),this.updateResults(!0),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&(this.parent.close.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},focus:function(){this.opened()?this.close():(this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus())},isFocused:function(){return this.container.hasClass("select2-container-active")},cancel:function(){this.parent.cancel.apply(this,arguments),this.focusser.prop("disabled",!1),this.opts.shouldFocusInput(this)&&this.focusser.focus()},destroy:function(){e("label[for='"+this.focusser.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),T.call(this,"selection","focusser")},initContainer:function(){var t,a,n=this.container,r=this.dropdown,o=A();this.opts.minimumResultsForSearch<0?this.showSearch(!1):this.showSearch(!0),this.selection=t=n.find(".select2-choice"),this.focusser=n.find(".select2-focusser"),t.find(".select2-chosen").attr("id","select2-chosen-"+o),this.focusser.attr("aria-labelledby","select2-chosen-"+o),this.results.attr("id","select2-results-"+o),this.search.attr("aria-owns","select2-results-"+o),this.focusser.attr("id","s2id_autogen"+o),a=e("label[for='"+this.opts.element.attr("id")+"']"),this.focusser.prev().text(a.text()).attr("for",this.focusser.attr("id"));var s=this.opts.element.attr("title");this.opts.element.attr("title",s||a.text()),this.focusser.attr("tabindex",this.elementTabIndex),this.search.attr("id",this.focusser.attr("id")+"_search"),this.search.prev().text(e("label[for='"+this.focusser.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){if(e.which===O.PAGE_UP||e.which===O.PAGE_DOWN)return void m(e);switch(e.which){case O.UP:case O.DOWN:return this.moveHighlight(e.which===O.UP?-1:1),void m(e);case O.ENTER:return this.selectHighlighted(),void m(e);case O.TAB:return void this.selectHighlighted({noFocus:!0});case O.ESC:return this.cancel(e),void m(e)}}})),this.search.on("blur",this.bind(function(){document.activeElement===this.body.get(0)&&window.setTimeout(this.bind(function(){this.opened()&&this.search.focus()}),0)})),this.focusser.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()&&e.which!==O.TAB&&!O.isControl(e)&&!O.isFunctionKey(e)&&e.which!==O.ESC){if(this.opts.openOnEnter===!1&&e.which===O.ENTER)return void m(e);if(e.which==O.DOWN||e.which==O.UP||e.which==O.ENTER&&this.opts.openOnEnter){if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return;return this.open(),void m(e)}return e.which==O.DELETE||e.which==O.BACKSPACE?(this.opts.allowClear&&this.clear(),void m(e)):void 0}})),c(this.focusser),this.focusser.on("keyup-change input",this.bind(function(e){if(this.opts.minimumResultsForSearch>=0){if(e.stopPropagation(),this.opened())return;this.open()}})),t.on("mousedown touchstart","abbr",this.bind(function(e){this.isInterfaceEnabled()&&(this.clear(),g(e),this.close(),this.selection.focus())})),t.on("mousedown touchstart",this.bind(function(a){i(t),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.opened()?this.close():this.isInterfaceEnabled()&&this.open(),m(a)})),r.on("mousedown touchstart",this.bind(function(){this.opts.shouldFocusInput(this)&&this.search.focus()})),t.on("focus",this.bind(function(e){m(e)})),this.focusser.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})).on("blur",this.bind(function(){this.opened()||(this.container.removeClass("select2-container-active"),this.opts.element.trigger(e.Event("select2-blur")))})),this.search.on("focus",this.bind(function(){this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active")})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.setPlaceholder()},clear:function(t){var i=this.selection.data("select2-data");if(i){var a=e.Event("select2-clearing");if(this.opts.element.trigger(a),a.isDefaultPrevented())return;var n=this.getPlaceholderOption();this.opts.element.val(n?n.val():""),this.selection.find(".select2-chosen").empty(),this.selection.removeData("select2-data"),this.setPlaceholder(),t!==!1&&(this.opts.element.trigger({type:"select2-removed",val:this.id(i),choice:i}),this.triggerChange({removed:i}))}},initSelection:function(){if(this.isPlaceholderOptionSelected())this.updateSelection(null),this.close(),this.setPlaceholder();else{var e=this;this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&null!==i&&(e.updateSelection(i),e.close(),e.setPlaceholder(),e.nextSearchTerm=e.opts.nextSearchTerm(i,e.search.val()))})}},isPlaceholderOptionSelected:function(){var e;return this.getPlaceholder()===t?!1:(e=this.getPlaceholderOption())!==t&&e.prop("selected")||""===this.opts.element.val()||this.opts.element.val()===t||null===this.opts.element.val()},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var a=e.find("option").filter(function(){return this.selected&&!this.disabled});t(i.optionToData(a))}:"data"in t&&(t.initSelection=t.initSelection||function(i,a){var n=i.val(),r=null;t.query({matcher:function(e,i,a){var s=o(n,t.id(a));return s&&(r=a),s},callback:e.isFunction(a)?function(){a(r)}:e.noop})}),t},getPlaceholder:function(){return this.select&&this.getPlaceholderOption()===t?t:this.parent.getPlaceholder.apply(this,arguments)},setPlaceholder:function(){var e=this.getPlaceholder();if(this.isPlaceholderOptionSelected()&&e!==t){if(this.select&&this.getPlaceholderOption()===t)return;this.selection.find(".select2-chosen").html(this.opts.escapeMarkup(e)),this.selection.addClass("select2-default"),this.container.removeClass("select2-allowclear")}},postprocessResults:function(e,t,i){var a=0,n=this;if(this.findHighlightableChoices().each2(function(e,t){return o(n.id(t.data("select2-data")),n.opts.element.val())?(a=e,!1):void 0}),i!==!1&&(t===!0&&a>=0?this.highlight(a):this.highlight(0)),t===!0){var r=this.opts.minimumResultsForSearch;r>=0&&this.showSearch(k(e.results)>=r)}},showSearch:function(t){this.showSearchInput!==t&&(this.showSearchInput=t,this.dropdown.find(".select2-search").toggleClass("select2-search-hidden",!t),this.dropdown.find(".select2-search").toggleClass("select2-offscreen",!t),e(this.dropdown,this.container).toggleClass("select2-with-searchbox",t))},onSelect:function(e,t){if(this.triggerSelect(e)){var i=this.opts.element.val(),a=this.data();this.opts.element.val(this.id(e)),this.updateSelection(e),this.opts.element.trigger({type:"select2-selected",val:this.id(e),choice:e}),this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val()),this.close(),t&&t.noFocus||!this.opts.shouldFocusInput(this)||this.focusser.focus(),o(i,this.id(e))||this.triggerChange({added:e,removed:a})}},updateSelection:function(e){var i,a,n=this.selection.find(".select2-chosen");this.selection.data("select2-data",e),n.empty(),null!==e&&(i=this.opts.formatSelection(e,n,this.opts.escapeMarkup)),i!==t&&n.append(i),a=this.opts.formatSelectionCssClass(e,n),a!==t&&n.addClass(a),this.selection.removeClass("select2-default"),this.opts.allowClear&&this.getPlaceholder()!==t&&this.container.addClass("select2-allowclear")},val:function(){var e,i=!1,a=null,n=this,r=this.data();if(0===arguments.length)return this.opts.element.val();if(e=arguments[0],arguments.length>1&&(i=arguments[1]),this.select)this.select.val(e).find("option").filter(function(){return this.selected}).each2(function(e,t){return a=n.optionToData(t),!1}),this.updateSelection(a),this.setPlaceholder(),i&&this.triggerChange({added:a,removed:r});else{if(!e&&0!==e)return void this.clear(i);if(this.opts.initSelection===t)throw new Error("cannot call val() if initSelection() is not defined");this.opts.element.val(e),this.opts.initSelection(this.opts.element,function(e){n.opts.element.val(e?n.id(e):""),n.updateSelection(e),n.setPlaceholder(),i&&n.triggerChange({added:e,removed:r})})}},clearSearch:function(){this.search.val(""),this.focusser.val("")},data:function(e){var i,a=!1;return 0===arguments.length?(i=this.selection.data("select2-data"),i==t&&(i=null),i):(arguments.length>1&&(a=arguments[1]),void(e?(i=this.data(),this.opts.element.val(e?this.id(e):""),this.updateSelection(e),a&&this.triggerChange({added:e,removed:i})):this.clear(a)))}}),I=D(E,{createContainer:function(){var t=e(document.createElement("div")).attr({"class":"select2-container select2-container-multi"}).html(["<ul class='select2-choices'>"," <li class='select2-search-field'>"," <label for='' class='select2-offscreen'></label>"," <input type='text' autocomplete='off' autocorrect='off' autocapitalize='off' spellcheck='false' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi select2-display-none'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return t},prepareOpts:function(){var t=this.parent.prepareOpts.apply(this,arguments),i=this;return"select"===t.element.get(0).tagName.toLowerCase()?t.initSelection=function(e,t){var a=[];e.find("option").filter(function(){return this.selected&&!this.disabled}).each2(function(e,t){a.push(i.optionToData(t))}),t(a)}:"data"in t&&(t.initSelection=t.initSelection||function(i,a){var n=s(i.val(),t.separator),r=[];t.query({matcher:function(i,a,s){var l=e.grep(n,function(e){return o(e,t.id(s))}).length;return l&&r.push(s),l},callback:e.isFunction(a)?function(){for(var e=[],i=0;i<n.length;i++)for(var s=n[i],l=0;l<r.length;l++){var c=r[l];if(o(s,t.id(c))){e.push(c),r.splice(l,1);break}}a(e)}:e.noop})}),t},selectChoice:function(e){var t=this.container.find(".select2-search-choice-focus");t.length&&e&&e[0]==t[0]||(t.length&&this.opts.element.trigger("choice-deselected",t),t.removeClass("select2-search-choice-focus"),e&&e.length&&(this.close(),e.addClass("select2-search-choice-focus"),this.opts.element.trigger("choice-selected",e)))},destroy:function(){e("label[for='"+this.search.attr("id")+"']").attr("for",this.opts.element.attr("id")),this.parent.destroy.apply(this,arguments),T.call(this,"searchContainer","selection")},initContainer:function(){var t,i=".select2-choices";this.searchContainer=this.container.find(".select2-search-field"),this.selection=t=this.container.find(i);
3
+ var a=this;this.selection.on("click",".select2-search-choice:not(.select2-locked)",function(){a.search[0].focus(),a.selectChoice(e(this))}),this.search.attr("id","s2id_autogen"+A()),this.search.prev().text(e("label[for='"+this.opts.element.attr("id")+"']").text()).attr("for",this.search.attr("id")),this.search.on("input paste",this.bind(function(){this.isInterfaceEnabled()&&(this.opened()||this.open())})),this.search.attr("tabindex",this.elementTabIndex),this.keydowns=0,this.search.on("keydown",this.bind(function(e){if(this.isInterfaceEnabled()){++this.keydowns;var i=t.find(".select2-search-choice-focus"),a=i.prev(".select2-search-choice:not(.select2-locked)"),n=i.next(".select2-search-choice:not(.select2-locked)"),r=f(this.search);if(i.length&&(e.which==O.LEFT||e.which==O.RIGHT||e.which==O.BACKSPACE||e.which==O.DELETE||e.which==O.ENTER)){var o=i;return e.which==O.LEFT&&a.length?o=a:e.which==O.RIGHT?o=n.length?n:null:e.which===O.BACKSPACE?this.unselect(i.first())&&(this.search.width(10),o=a.length?a:n):e.which==O.DELETE?this.unselect(i.first())&&(this.search.width(10),o=n.length?n:null):e.which==O.ENTER&&(o=null),this.selectChoice(o),m(e),void(o&&o.length||this.open())}if((e.which===O.BACKSPACE&&1==this.keydowns||e.which==O.LEFT)&&0==r.offset&&!r.length)return this.selectChoice(t.find(".select2-search-choice:not(.select2-locked)").last()),void m(e);if(this.selectChoice(null),this.opened())switch(e.which){case O.UP:case O.DOWN:return this.moveHighlight(e.which===O.UP?-1:1),void m(e);case O.ENTER:return this.selectHighlighted(),void m(e);case O.TAB:return this.selectHighlighted({noFocus:!0}),void this.close();case O.ESC:return this.cancel(e),void m(e)}if(e.which!==O.TAB&&!O.isControl(e)&&!O.isFunctionKey(e)&&e.which!==O.BACKSPACE&&e.which!==O.ESC){if(e.which===O.ENTER){if(this.opts.openOnEnter===!1)return;if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey)return}this.open(),(e.which===O.PAGE_UP||e.which===O.PAGE_DOWN)&&m(e),e.which===O.ENTER&&m(e)}}})),this.search.on("keyup",this.bind(function(){this.keydowns=0,this.resizeSearch()})),this.search.on("blur",this.bind(function(t){this.container.removeClass("select2-container-active"),this.search.removeClass("select2-focused"),this.selectChoice(null),this.opened()||this.clearSearch(),t.stopImmediatePropagation(),this.opts.element.trigger(e.Event("select2-blur"))})),this.container.on("click",i,this.bind(function(t){this.isInterfaceEnabled()&&(e(t.target).closest(".select2-search-choice").length>0||(this.selectChoice(null),this.clearPlaceholder(),this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.open(),this.focusSearch(),t.preventDefault()))})),this.container.on("focus",i,this.bind(function(){this.isInterfaceEnabled()&&(this.container.hasClass("select2-container-active")||this.opts.element.trigger(e.Event("select2-focus")),this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"),this.clearPlaceholder())})),this.initContainerWidth(),this.opts.element.addClass("select2-offscreen"),this.clearSearch()},enableInterface:function(){this.parent.enableInterface.apply(this,arguments)&&this.search.prop("disabled",!this.isInterfaceEnabled())},initSelection:function(){if(""===this.opts.element.val()&&""===this.opts.element.text()&&(this.updateSelection([]),this.close(),this.clearSearch()),this.select||""!==this.opts.element.val()){var e=this;this.opts.initSelection.call(null,this.opts.element,function(i){i!==t&&null!==i&&(e.updateSelection(i),e.close(),e.clearSearch())})}},clearSearch:function(){var e=this.getPlaceholder(),i=this.getMaxSearchWidth();e!==t&&0===this.getVal().length&&this.search.hasClass("select2-focused")===!1?(this.search.val(e).addClass("select2-default"),this.search.width(i>0?i:this.container.css("width"))):this.search.val("").width(10)},clearPlaceholder:function(){this.search.hasClass("select2-default")&&this.search.val("").removeClass("select2-default")},opening:function(){this.clearPlaceholder(),this.resizeSearch(),this.parent.opening.apply(this,arguments),this.focusSearch(),""===this.search.val()&&this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.search.select()),this.updateResults(!0),this.opts.shouldFocusInput(this)&&this.search.focus(),this.opts.element.trigger(e.Event("select2-open"))},close:function(){this.opened()&&this.parent.close.apply(this,arguments)},focus:function(){this.close(),this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(t){var i=[],a=[],r=this;e(t).each(function(){n(r.id(this),i)<0&&(i.push(r.id(this)),a.push(this))}),t=a,this.selection.find(".select2-search-choice").remove(),e(t).each(function(){r.addSelectedChoice(this)}),r.postprocessResults()},tokenize:function(){var e=this.search.val();e=this.opts.tokenizer.call(this,e,this.data(),this.bind(this.onSelect),this.opts),null!=e&&e!=t&&(this.search.val(e),e.length>0&&this.open())},onSelect:function(e,i){this.triggerSelect(e)&&(this.addSelectedChoice(e),this.opts.element.trigger({type:"selected",val:this.id(e),choice:e}),this.nextSearchTerm=this.opts.nextSearchTerm(e,this.search.val()),this.clearSearch(),this.updateResults(),(this.select||!this.opts.closeOnSelect)&&this.postprocessResults(e,!1,this.opts.closeOnSelect===!0),this.opts.closeOnSelect?(this.close(),this.search.width(10)):this.countSelectableResults()>0?(this.search.width(10),this.resizeSearch(),this.getMaximumSelectionSize()>0&&this.val().length>=this.getMaximumSelectionSize()?this.updateResults(!0):this.nextSearchTerm!=t&&(this.search.val(this.nextSearchTerm),this.updateResults(),this.search.select()),this.positionDropdown()):(this.close(),this.search.width(10)),this.triggerChange({added:e}),i&&i.noFocus||this.focusSearch())},cancel:function(){this.close(),this.focusSearch()},addSelectedChoice:function(i){var a,n,r=!i.locked,o=e("<li class='select2-search-choice'> <div></div> <a href='#' class='select2-search-choice-close' tabindex='-1'></a></li>"),s=e("<li class='select2-search-choice select2-locked'><div></div></li>"),l=r?o:s,c=this.id(i),u=this.getVal();a=this.opts.formatSelection(i,l.find("div"),this.opts.escapeMarkup),a!=t&&l.find("div").replaceWith("<div>"+a+"</div>"),n=this.opts.formatSelectionCssClass(i,l.find("div")),n!=t&&l.addClass(n),r&&l.find(".select2-search-choice-close").on("mousedown",m).on("click dblclick",this.bind(function(t){this.isInterfaceEnabled()&&(this.unselect(e(t.target)),this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus"),m(t),this.close(),this.focusSearch())})).on("focus",this.bind(function(){this.isInterfaceEnabled()&&(this.container.addClass("select2-container-active"),this.dropdown.addClass("select2-drop-active"))})),l.data("select2-data",i),l.insertBefore(this.searchContainer),u.push(c),this.setVal(u)},unselect:function(t){var i,a,r=this.getVal();if(t=t.closest(".select2-search-choice"),0===t.length)throw"Invalid argument: "+t+". Must be .select2-search-choice";if(i=t.data("select2-data")){var o=e.Event("select2-removing");if(o.val=this.id(i),o.choice=i,this.opts.element.trigger(o),o.isDefaultPrevented())return!1;for(;(a=n(this.id(i),r))>=0;)r.splice(a,1),this.setVal(r),this.select&&this.postprocessResults();return t.remove(),this.opts.element.trigger({type:"select2-removed",val:this.id(i),choice:i}),this.triggerChange({removed:i}),!0}},postprocessResults:function(e,t,i){var a=this.getVal(),r=this.results.find(".select2-result"),o=this.results.find(".select2-result-with-children"),s=this;r.each2(function(e,t){var i=s.id(t.data("select2-data"));n(i,a)>=0&&(t.addClass("select2-selected"),t.find(".select2-result-selectable").addClass("select2-selected"))}),o.each2(function(e,t){t.is(".select2-result-selectable")||0!==t.find(".select2-result-selectable:not(.select2-selected)").length||t.addClass("select2-selected")}),-1==this.highlight()&&i!==!1&&s.highlight(0),!this.opts.createSearchChoice&&!r.filter(".select2-result:not(.select2-selected)").length>0&&(!e||e&&!e.more&&0===this.results.find(".select2-no-results").length)&&S(s.opts.formatNoMatches,"formatNoMatches")&&this.results.append("<li class='select2-no-results'>"+j(s.opts.formatNoMatches,s.search.val())+"</li>")},getMaxSearchWidth:function(){return this.selection.width()-l(this.search)},resizeSearch:function(){var e,t,i,a,n,r=l(this.search);e=v(this.search)+10,t=this.search.offset().left,i=this.selection.width(),a=this.selection.offset().left,n=i-(t-a)-r,e>n&&(n=i-r),40>n&&(n=i-r),0>=n&&(n=e),this.search.width(Math.floor(n))},getVal:function(){var e;return this.select?(e=this.select.val(),null===e?[]:e):(e=this.opts.element.val(),s(e,this.opts.separator))},setVal:function(t){var i;this.select?this.select.val(t):(i=[],e(t).each(function(){n(this,i)<0&&i.push(this)}),this.opts.element.val(0===i.length?"":i.join(this.opts.separator)))},buildChangeDetails:function(e,t){for(var t=t.slice(0),e=e.slice(0),i=0;i<t.length;i++)for(var a=0;a<e.length;a++)o(this.opts.id(t[i]),this.opts.id(e[a]))&&(t.splice(i,1),i>0&&i--,e.splice(a,1),a--);return{added:t,removed:e}},val:function(i,a){var n,r=this;if(0===arguments.length)return this.getVal();if(n=this.data(),n.length||(n=[]),!i&&0!==i)return this.opts.element.val(""),this.updateSelection([]),this.clearSearch(),void(a&&this.triggerChange({added:this.data(),removed:n}));if(this.setVal(i),this.select)this.opts.initSelection(this.select,this.bind(this.updateSelection)),a&&this.triggerChange(this.buildChangeDetails(n,this.data()));else{if(this.opts.initSelection===t)throw new Error("val() cannot be called if initSelection() is not defined");this.opts.initSelection(this.opts.element,function(t){var i=e.map(t,r.id);r.setVal(i),r.updateSelection(t),r.clearSearch(),a&&r.triggerChange(r.buildChangeDetails(n,r.data()))})}this.clearSearch()},onSortStart:function(){if(this.select)throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.");this.search.width(0),this.searchContainer.hide()},onSortEnd:function(){var t=[],i=this;this.searchContainer.show(),this.searchContainer.appendTo(this.searchContainer.parent()),this.resizeSearch(),this.selection.find(".select2-search-choice").each(function(){t.push(i.opts.id(e(this).data("select2-data")))}),this.setVal(t),this.triggerChange()},data:function(t,i){var a,n,r=this;return 0===arguments.length?this.selection.children(".select2-search-choice").map(function(){return e(this).data("select2-data")}).get():(n=this.data(),t||(t=[]),a=e.map(t,function(e){return r.opts.id(e)}),this.setVal(a),this.updateSelection(t),this.clearSearch(),void(i&&this.triggerChange(this.buildChangeDetails(n,this.data()))))}}),e.fn.select2=function(){var i,a,r,o,s,l=Array.prototype.slice.call(arguments,0),c=["val","destroy","opened","open","close","focus","isFocused","container","dropdown","onSortStart","onSortEnd","enable","disable","readonly","positionDropdown","data","search"],u=["opened","isFocused","container","dropdown"],d=["val","data"],h={search:"externalSearch"};return this.each(function(){if(0===l.length||"object"==typeof l[0])i=0===l.length?{}:e.extend({},l[0]),i.element=e(this),"select"===i.element.get(0).tagName.toLowerCase()?s=i.element.prop("multiple"):(s=i.multiple||!1,"tags"in i&&(i.multiple=s=!0)),a=s?new window.Select2["class"].multi:new window.Select2["class"].single,a.init(i);else{if("string"!=typeof l[0])throw"Invalid arguments to select2 plugin: "+l;if(n(l[0],c)<0)throw"Unknown method: "+l[0];if(o=t,a=e(this).data("select2"),a===t)return;if(r=l[0],"container"===r?o=a.container:"dropdown"===r?o=a.dropdown:(h[r]&&(r=h[r]),o=a[r].apply(a,l.slice(1))),n(l[0],u)>=0||n(l[0],d)>=0&&1==l.length)return!1}}),o===t?this:o},e.fn.select2.defaults={width:"copy",loadMorePadding:0,closeOnSelect:!0,openOnEnter:!0,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(e,t,i,a){var n=[];return b(e.text,i.term,n,a),n.join("")},formatSelection:function(e,i,a){return e?a(e.text):t},sortResults:function(e){return e},formatResultCssClass:function(e){return e.css},formatSelectionCssClass:function(){return t},formatMatches:function(e){return e+" results are available, use up and down arrow keys to navigate."},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(e,t){var i=t-e.length;return"Please enter "+i+" or more character"+(1==i?"":"s")},formatInputTooLong:function(e,t){var i=e.length-t;return"Please delete "+i+" character"+(1==i?"":"s")},formatSelectionTooBig:function(e){return"You can only select "+e+" item"+(1==e?"":"s")},formatLoadMore:function(){return"Loading more results…"},formatSearching:function(){return"Searching…"},minimumResultsForSearch:0,minimumInputLength:0,maximumInputLength:null,maximumSelectionSize:0,id:function(e){return e==t?null:e.id},matcher:function(e,t){return a(""+t).toUpperCase().indexOf(a(""+e).toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:Q,escapeMarkup:w,blurOnChange:!1,selectOnBlur:!1,adaptContainerCssClass:function(e){return e},adaptDropdownCssClass:function(){return null},nextSearchTerm:function(){return t},searchInputPlaceholder:"",createSearchChoicePosition:"top",shouldFocusInput:function(e){var t="ontouchstart"in window||navigator.msMaxTouchPoints>0;return t&&e.opts.minimumResultsForSearch<0?!1:!0}},e.fn.select2.ajaxDefaults={transport:e.ajax,params:{type:"GET",cache:!1,dataType:"json"}},window.Select2={query:{ajax:x,local:_,tags:C},util:{debounce:d,markMatch:b,escapeMarkup:w,stripDiacritics:a},"class":{"abstract":E,single:M,multi:I}}}}(jQuery),jQuery(document).ready(function(){jQuery(document).on("click",".um-popup-overlay",function(){remove_Modal()}),jQuery(document).on("click",'.um-modal-overlay, a[data-action="um_remove_modal"]',function(){um_remove_modal()}),jQuery(document).on("click",'a[data-modal^="um_"], span[data-modal^="um_"], .um-modal a',function(e){return e.preventDefault(),!1}),jQuery(document).on("click",".um-modal .um-single-file-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-modal-body"),i=jQuery(this).parents(".um-modal-body").find(".um-single-fileinfo a").attr("href");return t.find(".um-single-file-preview").hide(),t.find(".ajax-upload-dragdrop").show(),t.find(".um-modal-btn.um-finish-upload").addClass("disabled"),um_modal_responsive(),jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_remove_file",src:i}}),!1}),jQuery(document).on("click",".um-modal .um-single-image-preview a.cancel",function(e){e.preventDefault();var t=jQuery(this).parents(".um-modal-body"),i=jQuery(this).parents(".um-modal-body").find(".um-single-image-preview img").attr("src");return jQuery("img.cropper-hidden").cropper("destroy"),t.find(".um-single-image-preview img").attr("src",""),t.find(".um-single-image-preview").hide(),t.find(".ajax-upload-dragdrop").show(),t.find(".um-modal-btn.um-finish-upload").addClass("disabled"),um_modal_responsive(),jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_remove_file",src:i}}),!1}),jQuery(document).on("click",".um-finish-upload.file",function(){var e=jQuery(this).attr("data-key"),t=jQuery(this).parents(".um-modal-body").find(".um-single-file-preview").html();um_remove_modal(),jQuery(".um-single-file-preview[data-key="+e+"]").fadeIn().html(t),jQuery(".um-single-file-preview[data-key="+e+"]").parents(".um-field").find(".um-btn-auto-width").html(jQuery(this).attr("data-change")),jQuery(".um-single-file-preview[data-key="+e+"]").parents(".um-field").find("input[type=hidden]").val(jQuery(".um-single-file-preview[data-key="+e+"]").parents(".um-field").find(".um-single-fileinfo a").attr("href"))}),jQuery(document).on("click",".um-finish-upload.image",function(){var e=jQuery(this),t=jQuery(this).attr("data-key"),i=jQuery(this).parents(".um-modal-body").find(".um-single-image-preview"),a=i.find("img").attr("src"),n=i.attr("data-coord");if(jQuery(this).parents("#um_upload_single").attr("data-user_id"))var r=jQuery(this).parents("#um_upload_single").attr("data-user_id");else var r=0;n?(jQuery(this).html(jQuery(this).attr("data-processing")).addClass("disabled"),jQuery.ajax({url:um_scripts.ajaxurl,type:"POST",data:{action:"ultimatemember_resize_image",src:a,coord:n,user_id:r,key:t},success:function(i){d=new Date,"profile_photo"==t&&jQuery(".um-profile-photo-img img").attr("src",i+"?"+d.getTime()),"cover_photo"==t&&(jQuery(".um-cover-e").empty().html('<img src="'+i+"?"+d.getTime()+'" alt="" />'),jQuery(".um").hasClass("um-editing")&&jQuery(".um-cover-overlay").show()),jQuery(".um-single-image-preview[data-key="+t+"]").fadeIn().find("img").attr("src",i+"?"+d.getTime()),um_remove_modal(),jQuery(".um-single-image-preview[data-key="+t+"]").parents(".um-field").find(".um-btn-auto-width").html(e.attr("data-change")),jQuery(".um-single-image-preview[data-key="+t+"]").parents(".um-field").find("input[type=hidden]").val(i)}})):(d=new Date,jQuery(".um-single-image-preview[data-key="+t+"]").fadeIn().find("img").attr("src",a+"?"+d.getTime()),um_remove_modal(),jQuery(".um-single-image-preview[data-key="+t+"]").parents(".um-field").find(".um-btn-auto-width").html(e.attr("data-change")),jQuery(".um-single-image-preview[data-key="+t+"]").parents(".um-field").find("input[type=hidden]").val(a))}),jQuery(document).on("click",'a[data-modal^="um_"], span[data-modal^="um_"]',function(e){var t=jQuery(this).attr("data-modal");if(jQuery(this).data("modal-size"))var i=jQuery(this).data("modal-size");else var i="normal";jQuery(this).data("modal-copy")?(jQuery("#"+t).html(jQuery(this).parents(".um-field").find(".um-modal-hidden-content").html()),jQuery(this).parents(".um-profile-photo").attr("data-user_id")&&jQuery("#"+t).attr("data-user_id",jQuery(this).parents(".um-profile-photo").attr("data-user_id")),jQuery(this).parents(".um-cover").attr("data-ratio")&&jQuery("#"+t).attr("data-ratio",jQuery(this).parents(".um-cover").attr("data-ratio")),jQuery(this).parents(".um-cover").attr("data-user_id")&&jQuery("#"+t).attr("data-user_id",jQuery(this).parents(".um-cover").attr("data-user_id")),um_new_modal(t,i)):um_new_modal(t,i)})}),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):e("undefined"!=typeof jQuery?jQuery:window.Zepto)}(function(e){"use strict";function t(t){var i=t.data;t.isDefaultPrevented()||(t.preventDefault(),e(t.target).ajaxSubmit(i))}function i(t){var i=t.target,a=e(i);if(!a.is("[type=submit],[type=image]")){var n=a.closest("[type=submit]");if(0===n.length)return;i=n[0]}var r=this;if(r.clk=i,"image"==i.type)if(void 0!==t.offsetX)r.clk_x=t.offsetX,r.clk_y=t.offsetY;else if("function"==typeof e.fn.offset){var o=a.offset();r.clk_x=t.pageX-o.left,r.clk_y=t.pageY-o.top}else r.clk_x=t.pageX-i.offsetLeft,r.clk_y=t.pageY-i.offsetTop;setTimeout(function(){r.clk=r.clk_x=r.clk_y=null},100)}function a(){if(e.fn.ajaxSubmit.debug){var t="[jquery.form] "+Array.prototype.join.call(arguments,"");window.console&&window.console.log?window.console.log(t):window.opera&&window.opera.postError&&window.opera.postError(t)}}var n={};n.fileapi=void 0!==e("<input type='file'/>").get(0).files,n.formdata=void 0!==window.FormData;var r=!!e.fn.prop;e.fn.attr2=function(){if(!r)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 a,n,r=e.param(i,t.traditional).split("&"),o=r.length,s=[];for(a=0;o>a;a++)r[a]=r[a].replace(/\+/g," "),n=r[a].split("="),s.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return s}function o(a){for(var n=new FormData,r=0;r<a.length;r++)n.append(a[r].name,a[r].value);if(t.extraData){var o=i(t.extraData);for(r=0;r<o.length;r++)o[r]&&n.append(o[r][0],o[r][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,a=e.loaded||e.position,n=e.total;e.lengthComputable&&(i=Math.ceil(a/n*100)),t.uploadProgress(e,a,n,i)},!1),i}),s.data=null;var c=s.beforeSend;return s.beforeSend=function(e,i){t.formData?i.data=t.formData:i.data=n,c&&c.call(this,e,i)},e.ajax(s)}function s(i){function n(e){var t=null;try{e.contentWindow&&(t=e.contentWindow.document)}catch(i){a("cannot get iframe.contentWindow document: "+i)}if(t)return t;try{t=e.contentDocument?e.contentDocument:e.document}catch(i){a("cannot get iframe.contentDocument: "+i),t=e.document}return t}function o(){function t(){try{var e=n(v).readyState;a("state = "+e),e&&"uninitialized"==e.toLowerCase()&&setTimeout(t,50)}catch(i){a("Server abort: ",i," (",i.name,")"),s(k),_&&clearTimeout(_),_=void 0}}var i=d.attr2("target"),r=d.attr2("action"),o="multipart/form-data",c=d.attr("enctype")||d.attr("encoding")||o;C.setAttribute("target",f),(!l||/post/i.test(l))&&C.setAttribute("method","POST"),r!=h.url&&C.setAttribute("action",h.url),h.skipEncodingOverride||l&&!/post/i.test(l)||d.attr({encoding:"multipart/form-data",enctype:"multipart/form-data"}),h.timeout&&(_=setTimeout(function(){x=!0,s(j)},h.timeout));var u=[];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")?u.push(e('<input type="hidden" name="'+h.extraData[p].name+'">').val(h.extraData[p].value).appendTo(C)[0]):u.push(e('<input type="hidden" name="'+p+'">').val(h.extraData[p]).appendTo(C)[0]));h.iframeTarget||g.appendTo("body"),v.attachEvent?v.attachEvent("onload",s):v.addEventListener("load",s,!1),setTimeout(t,15);try{C.submit()}catch(m){var y=document.createElement("form").submit;y.apply(C)}}finally{C.setAttribute("action",r),C.setAttribute("enctype",c),i?C.setAttribute("target",i):d.removeAttr("target"),e(u).remove()}}function s(t){if(!y.aborted&&!E){if(O=n(v),O||(a("cannot access response document"),t=k),t===j&&y)return y.abort("timeout"),void S.reject(y,"timeout");if(t==k&&y)return y.abort("server abort"),void S.reject(y,"error","server abort");if(O&&O.location.href!=h.iframeSrc||x){v.detachEvent?v.detachEvent("onload",s):v.removeEventListener("load",s,!1);var i,r="success";try{if(x)throw"timeout";var o="xml"==h.dataType||O.XMLDocument||e.isXMLDoc(O);if(a("isXml="+o),!o&&window.opera&&(null===O.body||!O.body.innerHTML)&&--M)return a("requeing onLoad callback, DOM not available"),void setTimeout(s,250);var l=O.body?O.body:O.documentElement;y.responseText=l?l.innerHTML:null,y.responseXML=O.XMLDocument?O.XMLDocument:O,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 c=(h.dataType||"").toLowerCase(),u=/(json|script|text)/.test(c);if(u||h.textarea){var d=O.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(u){var f=O.getElementsByTagName("pre")[0],m=O.getElementsByTagName("body")[0];f?y.responseText=f.textContent?f.textContent:f.innerText:m&&(y.responseText=m.textContent?m.textContent:m.innerText)}}else"xml"==c&&!y.responseXML&&y.responseText&&(y.responseXML=I(y.responseText));try{D=P(y,c,h)}catch(b){r="parsererror",y.error=i=b||r}}catch(b){a("error caught: ",b),r="error",y.error=i=b||r}y.aborted&&(a("upload aborted"),r=null),y.status&&(r=y.status>=200&&y.status<300||304===y.status?"success":"error"),"success"===r?(h.success&&h.success.call(h.context,D,"success",y),S.resolve(y.responseText,"success",y),p&&e.event.trigger("ajaxSuccess",[y,h])):r&&(void 0===i&&(i=y.statusText),h.error&&h.error.call(h.context,y,r,i),S.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,r),E=!0,h.timeout&&clearTimeout(_),setTimeout(function(){h.iframeTarget?g.attr("src",h.iframeSrc):g.remove(),y.responseXML=null},100)}}}var c,u,h,p,f,g,v,y,b,w,x,_,C=d[0],S=e.Deferred();if(S.abort=function(e){y.abort(e)},i)for(u=0;u<m.length;u++)c=e(m[u]),r?c.prop("disabled",!1):c.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";a("aborting upload... "+i),this.aborted=1;try{v.contentWindow.document.execCommand&&v.contentWindow.document.execCommand("Stop")}catch(n){}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--,S.reject(),S;if(y.aborted)return S.reject(),S;b=C.clk,b&&(w=b.name,w&&!b.disabled&&(h.extraData=h.extraData||{},h.extraData[w]=b.value,"image"==b.type&&(h.extraData[w+".x"]=C.clk_x,h.extraData[w+".y"]=C.clk_y)));var j=1,k=2,Q=e("meta[name=csrf-token]").attr("content"),T=e("meta[name=csrf-param]").attr("content");T&&Q&&(h.extraData=h.extraData||{},h.extraData[T]=Q),h.forceSync?o():setTimeout(o,10);var D,O,E,M=50,I=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},A=e.parseJSON||function(e){return window.eval("("+e+")")},P=function(t,i,a){var n=t.getResponseHeader("content-type")||"",r="xml"===i||!i&&n.indexOf("xml")>=0,o=r?t.responseXML:t.responseText;return r&&"parsererror"===o.documentElement.nodeName&&e.error&&e.error("parsererror"),a&&a.dataFilter&&(o=a.dataFilter(o,i)),"string"==typeof o&&("json"===i||!i&&n.indexOf("json")>=0?o=A(o):("script"===i||!i&&n.indexOf("javascript")>=0)&&e.globalEval(o)),o};return S}if(!this.length)return a("ajaxSubmit: skipping submit process - no element selected"),this;var l,c,u,d=this;"function"==typeof t?t={success:t}:void 0===t&&(t={}),l=t.type||this.attr2("method"),c=t.url||this.attr2("action"),u="string"==typeof c?e.trim(c):"",u=u||window.location.href||"",u&&(u=(u.match(/^([^#]+)/)||[])[1]),t=e.extend(!0,{url:u,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 a("ajaxSubmit: submit vetoed via form-pre-serialize trigger"),this;if(t.beforeSerialize&&t.beforeSerialize(this,t)===!1)return a("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 a("ajaxSubmit: submit aborted via beforeSubmit callback"),this;if(this.trigger("form-submit-validate",[g,this,t,h]),h.veto)return a("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 a=t.replaceTarget?"replaceWith":"html";e(t.target)[a](i).each(b,arguments)})}else t.success&&y.push(t.success);if(t.success=function(e,i,a){for(var n=t.context||this,r=0,o=y.length;o>r;r++)y[r].apply(n,[e,i,a||d,d])},t.error){var w=t.error;t.error=function(e,i,a){var n=t.context||this;w.apply(n,[e,i,a,d])}}if(t.complete){var x=t.complete;t.complete=function(e,i){var a=t.context||this;x.apply(a,[e,i,d])}}var _=e("input[type=file]:enabled",this).filter(function(){return""!==e(this).val()}),C=_.length>0,S="multipart/form-data",j=d.attr("enctype")==S||d.attr("encoding")==S,k=n.fileapi&&n.formdata;a("fileAPI :"+k);var Q,T=(C||j)&&!k;t.iframe!==!1&&(t.iframe||T)?t.closeKeepAlive?e.get(t.closeKeepAlive,function(){Q=s(g)}):Q=s(g):Q=(C||j)&&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(n){if(n=n||{},n.delegation=n.delegation&&e.isFunction(e.fn.on),!n.delegation&&0===this.length){var r={s:this.selector,c:this.context};return!e.isReady&&r.s?(a("DOM not ready, queuing ajaxForm"),e(function(){e(r.s,r.c).ajaxForm(n)}),this):(a("terminating; zero elements found by selector"+(e.isReady?"":" (DOM not ready)")),this)}return n.delegation?(e(document).off("submit.form-plugin",this.selector,t).off("click.form-plugin",this.selector,i).on("submit.form-plugin",this.selector,n,t).on("click.form-plugin",this.selector,n,i),this):this.ajaxFormUnbind().bind("submit.form-plugin",n,t).bind("click.form-plugin",n,i)},e.fn.ajaxFormUnbind=function(){return this.unbind("submit.form-plugin click.form-plugin")},e.fn.formToArray=function(t,i){var a=[];if(0===this.length)return a;var r,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&&(r=e(':input[form="'+s+'"]').get(),r.length&&(l=(l||[]).concat(r))),!l||!l.length)return a;var c,u,d,h,p,f,m;for(c=0,f=l.length;f>c;c++)if(p=l[c],d=p.name,d&&!p.disabled)if(t&&o.clk&&"image"==p.type)o.clk==p&&(a.push({name:d,value:e(p).val(),type:p.type}),a.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),u=0,m=h.length;m>u;u++)a.push({name:d,value:h[u]});else if(n.fileapi&&"file"==p.type){i&&i.push(p);var g=p.files;if(g.length)for(u=0;u<g.length;u++)a.push({name:d,value:g[u],type:p.type});else a.push({name:d,value:"",type:p.type})}else null!==h&&"undefined"!=typeof h&&(i&&i.push(p),a.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&&(a.push({name:d,value:v.val()}),a.push({name:d+".x",value:o.clk_x},{name:d+".y",value:o.clk_y}))}return a},e.fn.formSerialize=function(t){return e.param(this.formToArray(t))},e.fn.fieldSerialize=function(t){var i=[];return this.each(function(){var a=this.name;if(a){var n=e.fieldValue(this,t);if(n&&n.constructor==Array)for(var r=0,o=n.length;o>r;r++)i.push({name:a,value:n[r]});else null!==n&&"undefined"!=typeof n&&i.push({name:this.name,value:n})}}),e.param(i)},e.fn.fieldValue=function(t){for(var i=[],a=0,n=this.length;n>a;a++){var r=this[a],o=e.fieldValue(r,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 a=t.name,n=t.type,r=t.tagName.toLowerCase();if(void 0===i&&(i=!0),i&&(!a||t.disabled||"reset"==n||"button"==n||("checkbox"==n||"radio"==n)&&!t.checked||("submit"==n||"image"==n)&&t.form&&t.form.clk!=t||"select"==r&&-1==t.selectedIndex))return null;if("select"==r){var o=t.selectedIndex;if(0>o)return null;for(var s=[],l=t.options,c="select-one"==n,u=c?o+1:l.length,d=c?o:0;u>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),c)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){
4
+ var i=/^(?:color|date|datetime|email|month|number|password|range|search|tel|text|time|url|week)$/i;return this.each(function(){var a=this.type,n=this.tagName.toLowerCase();i.test(a)||"textarea"==n?this.value="":"checkbox"==a||"radio"==a?this.checked=!1:"select"==n?this.selectedIndex=-1:"file"==a?/MSIE/.test(navigator.userAgent)?e(this).replaceWith(e(this).clone(!0)):e(this).val(""):t&&(t===!0&&/hidden/.test(a)||"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 a=e(this).parent("select");t&&a[0]&&"select-one"==a[0].type&&a.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 a(){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 n(t,i,a){a.on("dragenter",function(t){t.stopPropagation(),t.preventDefault(),e(this).css("border","2px dashed #ddd")}),a.on("dragover",function(e){e.stopPropagation(),e.preventDefault()}),a.on("drop",function(a){e(this).css("border","2px dashed #ddd"),a.preventDefault(),t.errorLog.html("");var n=a.originalEvent.dataTransfer.files;return!i.multiple&&n.length>1?void(i.showError&&e("<div class='um-error-block'>"+i.multiDragErrorStr+"</div>").appendTo(t.errorLog)):void(0!=i.onSelect(n)&&o(i,t,n))}),e(document).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}),e(document).on("dragover",function(e){e.stopPropagation(),e.preventDefault(),a.css("border","2px dashed #ddd")}),e(document).on("drop",function(e){e.stopPropagation(),e.preventDefault(),a.css("border","2px dashed #ddd")})}function r(t){var i=[];i="string"==jQuery.type(t)?t.split("&"):e.param(t).split("&");var a,n,r=i.length,o=[];for(a=0;r>a;a++)i[a]=i[a].replace(/\+/g," "),n=i[a].split("="),o.push([decodeURIComponent(n[0]),decodeURIComponent(n[1])]);return o}function o(t,i,a){for(var n=0;n<a.length;n++)if(s(i,t,a[n].name))if(-1!=t.maxFileSize&&a[n].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,c=t.fileName.replace("[]","");l.append(c,a[n]);var h=t.formData;if(h)for(var p=r(h),f=0;f<p.length;f++)p[f]&&l.append(p[f][0],p[f][1]);o.fileData=l;var m=new u(i,t),g="";g=t.showFileCounter?i.fileCounter+t.fileCounterStyle+a[n].name:a[n].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(a[n].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 a=t.allowedTypes.toLowerCase().split(","),n=i.split(".").pop().toLowerCase();return"*"!=t.allowedTypes&&jQuery.inArray(n,a)<0?!1:!0}function l(t,i){if(t.showFileCounter){var a=e(".upload-filename").length;i.fileCounter=a+1,e(".upload-filename").each(function(i,n){var r=e(this).html().split(t.fileCounterStyle),o=(parseInt(r[0])-1,a+t.fileCounterStyle+r[1]);e(this).html(o),a--})}}function c(i,a,n,r){var h="ajax-upload-id-"+(new Date).getTime(),p=e("<form method='"+n.method+"' action='"+n.url+"' enctype='"+n.enctype+"'></form>"),f="<input type='file' id='"+h+"' name='"+n.fileName+"'/>";n.multiple&&(n.fileName.indexOf("[]")!=n.fileName.length-2&&(n.fileName+="[]"),f="<input type='file' id='"+h+"' name='"+n.fileName+"' multiple/>");var m=e(f).appendTo(p);m.change(function(){i.errorLog.html("");var h=(n.allowedTypes.toLowerCase().split(","),[]);if(this.files){for(y=0;y<this.files.length;y++)h.push(this.files[y].name);if(0==n.onSelect(this.files))return}else{var f=e(this).val(),m=[];if(h.push(f),!s(i,n,f))return void(n.showError&&e("<div class='um-error-block'>"+n.extErrorStr+"</div>").appendTo(i.errorLog));if(m.push({name:f,size:"NA"}),0==n.onSelect(m))return}if(l(n,i),r.unbind("click"),p.hide(),c(i,a,n,r),p.addClass(a),t.fileapi&&t.formdata){p.removeClass(a);var g=this.files;o(n,i,g)}else{for(var v="",y=0;y<h.length;y++)v+=n.showFileCounter?i.fileCounter+n.fileCounterStyle+h[y]+"<br>":h[y]+"<br>",i.fileCounter++;if(-1!=n.maxFileCount&&i.selectedFiles+h.length>n.maxFileCount)return void(n.showError&&e("<div class='um-error-block'>"+n.maxFileCountErrorStr+"</div>").appendTo(i.errorLog));i.selectedFiles+=h.length;var b=new u(i,n);b.filename.html(v),d(p,n,b,h,i)}}),p.css({margin:0,padding:0});var g=e(r).width()+10;10==g&&(g=120);var v=r.height()+10;10==v&&(v=35),r.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(r)}function u(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,n,o,s){var c={cache:!1,contentType:!1,processData:!1,forceSync:!1,data:i.formData,formData:i.fileData,dataType:i.returnType,beforeSubmit:function(t,l,c){if(0!=i.onSubmit.call(this,o)){var u=i.dynamicFormData();if(u){var d=r(u);if(d)for(var h=0;h<d.length;h++)d[h]&&(void 0!=i.fileData?c.formData.append(d[h][0],d[h][1]):c.data[d[h][0]]=d[h][1])}return s.tCounter+=o.length,a(),!0}return n.statusbar.append("<div class='um-error-block'>"+i.uploadErrorStr+"</div>"),n.cancel.show(),e.remove(),n.cancel.click(function(){n.statusbar.remove()}),!1},beforeSend:function(e,a){n.progressDiv.show(),n.cancel.hide(),n.done.hide(),i.showAbort&&(n.abort.show(),n.abort.click(function(){e.abort(),s.selectedFiles-=o.length})),t.formdata?n.progressbar.width("1%"):n.progressbar.width("5%")},uploadProgress:function(e,t,a,r){r>98&&(r=98);var o=r+"%";r>1&&n.progressbar.width(o),i.showProgress&&(n.progressbar.html(o),n.progressbar.css("text-align","center"))},success:function(t,a,r){s.responses.push(t),n.progressbar.width("100%"),i.showProgress&&(n.progressbar.html("100%"),n.progressbar.css("text-align","center")),n.abort.hide(),i.onSuccess.call(this,o,t,r),i.showStatusAfterSuccess?(i.showDone?(n.done.show(),n.done.click(function(){n.statusbar.hide("slow"),n.statusbar.remove()})):n.done.hide(),i.showDelete?(n.del.show(),n.del.click(function(){n.statusbar.hide().remove(),i.deleteCallback&&i.deleteCallback.call(this,t,n),s.selectedFiles-=o.length,l(i,s)})):n.del.hide()):(n.statusbar.hide("slow"),n.statusbar.remove()),e.remove(),s.sCounter+=o.length},error:function(t,a,r){n.abort.hide(),"abort"==t.statusText?(n.statusbar.hide("slow").remove(),l(i,s)):(i.onError.call(this,o,a,r),i.showStatusAfterError?(n.progressDiv.hide(),n.statusbar.append("<span class='um-error-block'>ERROR: "+r+"</span>")):(n.statusbar.hide(),n.statusbar.remove()),s.selectedFiles-=o.length),e.remove(),s.fCounter+=o.length}};i.autoSubmit?e.ajaxSubmit(c):(i.showCancel&&(n.cancel.show(),n.cancel.click(function(){e.remove(),n.statusbar.remove(),s.selectedFiles-=o.length,l(i,s)})),e.ajaxForm(c))}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)),n(f,h,t)}else e(f).before(m);c(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(r,o,l,h){function p(){return t._.node("div",t._.node("div",t._.node("div",t._.node("div",Q.component.nodes(_.open),S.box),S.wrap),S.frame),S.holder,'tabindex="-1"')}function f(){j.data(o,Q).addClass(S.input).val(j.data("value")?Q.get("select",C.format):r.value),C.editable||j.on("focus."+_.id+" click."+_.id,function(e){e.preventDefault(),Q.open()}).on("keydown."+_.id,w),n(r,{haspopup:!0,expanded:!1,readonly:!1,owns:r.id+"_root"})}function m(){n(Q.$root[0],"hidden",!0)}function g(){Q.$holder.on({keydown:w,"focus.toOpen":b,blur:function(){j.removeClass(S.target)},focusin:function(e){Q.$root.removeClass(S.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(),a=t.hasClass(S.navDisabled)||t.hasClass(S.disabled),n=s();n=n&&(n.type||n.href),(a||n&&!e.contains(Q.$root[0],n))&&Q.$holder[0].focus(),!a&&i.nav?Q.set("highlight",Q.component.item.highlight,{nav:i.nav}):!a&&"pick"in i?(Q.set("select",i.pick),C.closeOnSelect&&Q.close(!0)):i.clear?(Q.clear(),C.closeOnClear&&Q.close(!0)):i.close&&Q.close(!0)})}function v(){var t;C.hiddenName===!0?(t=r.name,r.name=""):(t=["string"==typeof C.hiddenPrefix?C.hiddenPrefix:"","string"==typeof C.hiddenSuffix?C.hiddenSuffix:"_submit"],t=t[0]+r.name+t[1]),Q._hidden=e('<input type=hidden name="'+t+'"'+(j.data("value")||r.value?' value="'+Q.get("select",C.formatSubmit)+'"':"")+">")[0],j.on("change."+_.id,function(){Q._hidden.value=r.value?Q.get("select",C.formatSubmit):""})}function y(){x&&d?Q.$holder.find("."+S.frame).one("transitionend",function(){Q.$holder[0].focus()}):Q.$holder[0].focus()}function b(e){e.stopPropagation(),j.addClass(S.target),Q.$root.addClass(S.focused),Q.open()}function w(e){var t=e.keyCode,i=/^(8|46)$/.test(t);return 27==t?(Q.close(!0),!1):void((32==t||i||!_.open&&Q.component.key[t])&&(e.preventDefault(),e.stopPropagation(),i?Q.clear().close():Q.open()))}if(!r)return t;var x=!1,_={id:r.id||"P"+Math.abs(~~(Math.random()*new Date))},C=l?e.extend(!0,{},l.defaults,h):h||{},S=e.extend({},t.klasses(),C.klass),j=e(r),k=function(){return this.start()},Q=k.prototype={constructor:k,$node:j,start:function(){return _&&_.start?Q:(_.methods={},_.start=!0,_.open=!1,_.type=r.type,r.autofocus=r==s(),r.readOnly=!C.editable,r.id=r.id||_.id,"text"!=r.type&&(r.type="text"),Q.component=new l(Q,C),Q.$root=e('<div class="'+S.picker+'" id="'+r.id+'_root" />'),m(),Q.$holder=e(p()).appendTo(Q.$root),g(),C.formatSubmit&&v(),f(),C.containerHidden?e(C.containerHidden).append(Q._hidden):j.after(Q._hidden),C.container?e(C.container).append(Q.$root):j.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:C.onStart,render:C.onRender,stop:C.onStop,open:C.onOpen,close:C.onClose,set:C.onSet}),x=i(Q.$holder[0]),r.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("."+S.box).html(Q.component.nodes(_.open)),Q.trigger("render")},stop:function(){return _.start?(Q.close(),Q._hidden&&Q._hidden.parentNode.removeChild(Q._hidden),Q.$root.remove(),j.removeClass(S.input).removeData(o),setTimeout(function(){j.off("."+_.id)},0),r.type=_.type,r.readOnly=!1,Q.trigger("stop"),_.methods={},_.start=!1,Q):Q},open:function(i){return _.open?Q:(j.addClass(S.active),n(r,"expanded",!0),setTimeout(function(){Q.$root.addClass(S.opened),n(Q.$root[0],"hidden",!1)},0),i!==!1&&(_.open=!0,x&&u.css("overflow","hidden").css("padding-right","+="+a()),y(),c.on("click."+_.id+" focusin."+_.id,function(e){var t=e.target;t!=r&&t!=document&&3!=e.which&&Q.close(t===Q.$holder[0])}).on("keydown."+_.id,function(i){var a=i.keyCode,n=Q.component.key[a],r=i.target;27==a?Q.close(!0):r!=Q.$holder[0]||!n&&13!=a?e.contains(Q.$root[0],r)&&13==a&&(i.preventDefault(),r.click()):(i.preventDefault(),n?t._.trigger(Q.component.key.go,Q,[t._.trigger(n)]):Q.$root.find("."+S.highlighted).hasClass(S.disabled)||(Q.set("select",Q.component.item.highlight),C.closeOnSelect&&Q.close(!0)))})),Q.trigger("open"))},close:function(e){return e&&(C.editable?r.focus():(Q.$holder.off("focus.toOpen").focus(),setTimeout(function(){Q.$holder.on("focus.toOpen",b)},0))),j.removeClass(S.active),n(r,"expanded",!1),setTimeout(function(){Q.$root.removeClass(S.opened+" "+S.focused),n(Q.$root[0],"hidden",!0)},0),_.open?(_.open=!1,x&&u.css("overflow","").css("padding-right","-="+a()),c.off("."+_.id),Q.trigger("close")):Q},clear:function(e){return Q.set("clear",null,e)},set:function(t,i,a){var n,r,o=e.isPlainObject(t),s=o?t:{};if(a=o&&e.isPlainObject(i)?i:a||{},t){o||(s[t]=i);for(n in s)r=s[n],n in Q.component.item&&(void 0===r&&(r=null),Q.component.set(n,r,a)),("select"==n||"clear"==n)&&j.val("clear"==n?"":Q.get(n,C.format)).trigger("change");Q.render()}return a.muted?Q:Q.trigger("set",s)},get:function(e,i){if(e=e||"value",null!=_[e])return _[e];if("valueSubmit"==e){if(Q._hidden)return Q._hidden.value;e="value"}if("value"==e)return r.value;if(e in Q.component.item){if("string"==typeof i){var a=Q.component.get(e);return a?t._.trigger(Q.component.formats.toString,Q.component,[i,a]):""}return Q.component.get(e)}},on:function(t,i,a){var n,r,o=e.isPlainObject(t),s=o?t:{};if(t){o||(s[t]=i);for(n in s)r=s[n],a&&(n="_"+n),_.methods[n]=_.methods[n]||[],_.methods[n].push(r)}return Q},off:function(){var e,t,i=arguments;for(e=0,namesCount=i.length;e<namesCount;e+=1)t=i[e],t in _.methods&&delete _.methods[t];return Q},trigger:function(e,i){var a=function(e){var a=_.methods[e];a&&a.map(function(e){t._.trigger(e,Q,[i])})};return a("_"+e),a(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 a(){if(u.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 a=e('<div style="width:100%" />').appendTo(t),n=a[0].offsetWidth;return t.remove(),i-n}function n(t,i,a){if(e.isPlainObject(i))for(var n in i)r(t,n,i[n]);else r(t,i,a)}function r(e,t,i){e.setAttribute(("role"==t?"":"aria-")+t,i)}function o(t,i){e.isPlainObject(t)||(t={attribute:i}),i="";for(var a in t){var n=("role"==a?"":"aria-")+a,r=t[a];i+=null==r?"":n+'="'+t[a]+'"'}return i}function s(){try{return document.activeElement}catch(e){}}var l=e(window),c=e(document),u=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,a="",n=t._.trigger(e.min,e);n<=t._.trigger(e.max,e,[n]);n+=e.i)i=t._.trigger(e.item,e,[n]),a+=t._.node(e.node,i[0],i[1],i[2]);return a},node:function(t,i,a,n){return i?(i=e.isArray(i)?i.join(""):i,a=a?' class="'+a+'"':"",n=n?" "+n:"","<"+t+a+n+">"+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,a){e.fn[i]=function(n,r){var o=this.data(i);return"picker"==n?o:o&&"string"==typeof n?t._.trigger(o[n],o,[r]):this.each(function(){var r=e(this);r.data(i)||new t(this,i,a,n)})},e.fn[i].defaults=a.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,a=e.$node[0],n=a.value,r=e.$node.data("value"),o=r||n,s=r?t.formatSubmit:t.format,l=function(){return a.currentStyle?"rtl"==a.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,{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,a=new Date(t.year,t.month,t.date+e);i.set("highlight",a,{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 a="";i.disabled(i.get("now"))&&(a=":not(."+t.klass.buttonToday+")"),e.$root.find("button"+a+", select").attr("disabled",!1)},1).on("close",function(){e.$root.find("button, select").attr("disabled",!0)},1)}var a=7,n=6,r=e._;i.prototype.set=function(e,t,i){var a=this,n=a.item;return null===t?("clear"==e&&(e="select"),n[e]=t,a):(n["enable"==e?"disable":"flip"==e?"enable":e]=a.queue[e].split(" ").map(function(n){return t=a[n](e,t,i)}).pop(),"select"==e?a.set("highlight",n.select,i):"highlight"==e?a.set("view",n.highlight,i):e.match(/^(flip|min|max|disable|enable)$/)&&(n.select&&a.disabled(n.select)&&a.set("select",n.select,i),n.highlight&&a.disabled(n.highlight)&&a.set("highlight",n.highlight,i)),a)},i.prototype.get=function(e){return this.item[e]},i.prototype.create=function(e,i,a){var n,o=this;return i=void 0===i?e:i,i==-(1/0)||i==1/0?n=i:t.isPlainObject(i)&&r.isInteger(i.pick)?i=i.obj:t.isArray(i)?(i=new Date(i[0],i[1],i[2]),i=r.isDate(i)?i:o.create().obj):i=r.isInteger(i)||r.isDate(i)?o.normalize(new Date(i),a):o.now(e,i,a),{year:n||i.getFullYear(),month:n||i.getMonth(),date:n||i.getDate(),day:n||i.getDay(),obj:n||i,pick:n||i.getTime()}},i.prototype.createRange=function(e,i){var a=this,n=function(e){return e===!0||t.isArray(e)||r.isDate(e)?a.create(e):e};return r.isInteger(e)||(e=n(e)),r.isInteger(i)||(i=n(i)),r.isInteger(e)&&t.isPlainObject(i)?e=[i.year,i.month,i.date+e]:r.isInteger(i)&&t.isPlainObject(e)&&(i=[e.year,e.month,e.date+i]),{from:n(e),to:n(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,a){var n,r,o,s,l=t.isArray(i),c=t.isPlainObject(i),u=this.item.view;if(l||c){for(c?(r=i.year,o=i.month,s=i.date):(r=+i[0],o=+i[1],s=+i[2]),a&&a.nav&&u&&u.month!==o&&(r=u.year,o=u.month),n=new Date(r,o+(a&&a.nav?a.nav:0),1),r=n.getFullYear(),o=n.getMonth();new Date(r,o,s).getMonth()!==o;)s-=1;i=[r,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):r.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,a){var n,o,s,l,c=this,u=i,d=a&&a.interval?a.interval:1,h=-1===c.item.enable,p=c.item.min,f=c.item.max,m=h&&c.item.disable.filter(function(e){if(t.isArray(e)){var a=c.create(e).pick;a<i.pick?n=!0:a>i.pick&&(o=!0)}return r.isInteger(e)}).length;if((!a||!a.nav&&!a.defaultValue)&&(!h&&c.disabled(i)||h&&c.disabled(i)&&(m||n||o)||!h&&(i.pick<=p.pick||i.pick>=f.pick)))for(h&&!m&&(!o&&d>0||!n&&0>d)&&(d*=-1);c.disabled(i)&&(Math.abs(d)>1&&(i.month<u.month||i.month>u.month)&&(i=u,d=d>0?1:-1),i.pick<=p.pick?(s=!0,d=1,i=c.create([p.year,p.month,p.date+(i.pick===p.pick?0:-1)])):i.pick>=f.pick&&(l=!0,d=-1,i=c.create([f.year,f.month,f.date+(i.pick===f.pick?0:1)])),!s||!l);)i=c.create([i.year,i.month,i.date+d]);return i},i.prototype.disabled=function(e){var i=this,a=i.item.disable.filter(function(a){return r.isInteger(a)?e.day===(i.settings.firstDay?a:a-1)%7:t.isArray(a)||r.isDate(a)?e.pick===i.create(a).pick:t.isPlainObject(a)?i.withinRange(a,e):void 0});return a=a.length&&!a.filter(function(e){return t.isArray(e)&&"inverted"==e[3]||t.isPlainObject(e)&&e.inverted}).length,-1===i.item.enable?!a:a||e.pick<i.item.min.pick||e.pick>i.item.max.pick},i.prototype.parse=function(e,t,i){var a=this,n={};return t&&"string"==typeof t?(i&&i.format||(i=i||{},i.format=a.settings.format),a.formats.toArray(i.format).map(function(e){var i=a.formats[e],o=i?r.trigger(i,a,[t,n]):e.replace(/^!/,"").length;i&&(n[e]=t.substr(0,o)),t=t.substr(o)}),[n.yyyy||n.yy,+(n.mm||n.m)-1,n.dd||n.d]):t},i.prototype.formats=function(){function e(e,t,i){var a=e.match(/[^\x00-\x7F]+|\w+/)[0];return i.mm||i.m||(i.m=t.indexOf(a)+1),a.length}function t(e){return e.match(/\w+/)[0].length}return{d:function(e,t){return e?r.digits(e):t.date},dd:function(e,t){return e?2:r.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?r.digits(e):t.month+1},mm:function(e,t){return e?2:r.lead(t.month+1)},mmm:function(t,i){var a=this.settings.monthsShort;return t?e(t,a,i):a[i.month]},mmmm:function(t,i){var a=this.settings.monthsFull;return t?e(t,a,i):a[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 r.trigger(i.formats[e],i,[0,t])||e.replace(/^!/,"")}).join("")}}}(),i.prototype.isDateExact=function(e,i){var a=this;return r.isInteger(e)&&r.isInteger(i)||"boolean"==typeof e&&"boolean"==typeof i?e===i:(r.isDate(e)||t.isArray(e))&&(r.isDate(i)||t.isArray(i))?a.create(e).pick===a.create(i).pick:t.isPlainObject(e)&&t.isPlainObject(i)?a.isDateExact(e.from,i.from)&&a.isDateExact(e.to,i.to):!1},i.prototype.isDateOverlap=function(e,i){var a=this,n=a.settings.firstDay?1:0;return r.isInteger(e)&&(r.isDate(i)||t.isArray(i))?(e=e%7+n,e===a.create(i).day+1):r.isInteger(i)&&(r.isDate(e)||t.isArray(e))?(i=i%7+n,i===a.create(e).day+1):t.isPlainObject(e)&&t.isPlainObject(i)?a.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 a=this,n=a.item.disable.slice(0);return"flip"==i?a.flipEnable():i===!1?(a.flipEnable(1),n=[]):i===!0?(a.flipEnable(-1),n=[]):i.map(function(e){for(var i,o=0;o<n.length;o+=1)if(a.isDateExact(e,n[o])){i=!0;break}i||(r.isInteger(e)||r.isDate(e)||t.isArray(e)||t.isPlainObject(e)&&e.from&&e.to)&&n.push(e)}),n},i.prototype.activate=function(e,i){var a=this,n=a.item.disable,o=n.length;return"flip"==i?a.flipEnable():i===!0?(a.flipEnable(1),n=[]):i===!1?(a.flipEnable(-1),n=[]):i.map(function(e){var i,s,l,c;for(l=0;o>l;l+=1){if(s=n[l],a.isDateExact(s,e)){i=n[l]=null,c=!0;break}if(a.isDateOverlap(s,e)){t.isPlainObject(e)?(e.inverted=!0,i=e):t.isArray(e)?(i=e,i[3]||i.push("inverted")):r.isDate(e)&&(i=[e.getFullYear(),e.getMonth(),e.getDate(),"inverted"]);break}}if(i)for(l=0;o>l;l+=1)if(a.isDateExact(n[l],e)){n[l]=null;break}if(c)for(l=0;o>l;l+=1)if(a.isDateOverlap(n[l],e)){n[l]=null;break}i&&n.push(i)}),n.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,c=o.highlight,u=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())),r.node("thead",r.node("tr",r.group({min:0,max:a-1,i:1,node:"th",item:function(a){return[e[a],i.klass.weekdays,'scope=col title="'+t[a]+'"']}})))}((i.showWeekdaysFull?i.weekdaysFull:i.weekdaysShort).slice(0),i.weekdaysFull.slice(0)),m=function(e){return r.node("div"," ",i.klass["nav"+(e?"Next":"Prev")]+(e&&u.year>=p.year&&u.month>=p.month||!e&&u.year<=h.year&&u.month<=h.month?" "+i.klass.navDisabled:""),"data-nav="+(e||-1)+" "+r.ariaAttr({role:"button",controls:t.$node[0].id+"_table"})+' title="'+(e?i.labelMonthNext:i.labelMonthPrev)+'"')},g=function(){var a=i.showMonthsShort?i.monthsShort:i.monthsFull;return i.selectMonths?r.node("select",r.group({min:0,max:11,i:1,node:"option",item:function(e){return[a[e],0,"value="+e+(u.month==e?" selected":"")+(u.year==h.year&&e<h.month||u.year==p.year&&e>p.month?" disabled":"")]}}),i.klass.selectMonth,(e?"":"disabled")+" "+r.ariaAttr({controls:t.$node[0].id+"_table"})+' title="'+i.labelMonthSelect+'"'):r.node("div",a[u.month],i.klass.month)},v=function(){var a=u.year,n=i.selectYears===!0?5:~~(i.selectYears/2);if(n){var o=h.year,s=p.year,l=a-n,c=a+n;if(o>l&&(c+=o-l,l=o),c>s){var d=l-o,f=c-s;l-=d>f?f:d,c=s}return r.node("select",r.group({min:l,max:c,i:1,node:"option",item:function(e){return[e,0,"value="+e+(a==e?" selected":"")]}}),i.klass.selectYear,(e?"":"disabled")+" "+r.ariaAttr({controls:t.$node[0].id+"_table"})+' title="'+i.labelYearSelect+'"')}return r.node("div",a,i.klass.year)};return r.node("div",(i.selectYears?v()+g():g()+v())+m()+m(1),i.klass.header)+r.node("table",f+r.node("tbody",r.group({min:0,max:n-1,i:1,node:"tr",item:function(e){var n=i.firstDay&&0===t.create([u.year,u.month,1]).day?-7:0;return[r.group({min:a*e-u.day+n+1,max:function(){return this.min+a-1},i:1,node:"td",item:function(e){e=t.create([u.year,u.month,e+(i.firstDay?1:0)]);var a=l&&l.pick==e.pick,n=c&&c.pick==e.pick,o=d&&t.disabled(e)||e.pick<h.pick||e.pick>p.pick,f=r.trigger(t.formats.toString,t,[i.format,e]);return[r.node("div",e.date,function(t){return t.push(u.month==e.month?i.klass.infocus:i.klass.outfocus),s.pick==e.pick&&t.push(i.klass.now),a&&t.push(i.klass.selected),n&&t.push(i.klass.highlighted),o&&t.push(i.klass.disabled),t.join(" ")}([i.klass.day]),"data-pick="+e.pick+" "+r.ariaAttr({role:"gridcell",label:f,selected:a&&t.$node.val()===f?!0:null,activedescendant:n?!0:null,disabled:o?!0:null})),"",r.ariaAttr({role:"presentation"})]}})]}})),i.klass.table,'id="'+t.$node[0].id+'_table" '+r.ariaAttr({role:"grid",controls:t.$node[0].id,readonly:!0}))+r.node("div",r.node("button",i.today,i.klass.buttonToday,"type=button data-pick="+s.pick+(e&&!t.disabled(s)?"":" disabled")+" "+r.ariaAttr({controls:t.$node[0].id}))+r.node("button",i.clear,i.klass.buttonClear,"type=button data-clear=1"+(e?"":" disabled")+" "+r.ariaAttr({controls:t.$node[0].id}))+r.node("button",i.close,i.klass.buttonClose,"type=button data-close=true "+(e?"":" disabled")+" "+r.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,a=e.$node[0].value,n=e.$node.data("value"),r=n||a,o=n?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"),r?i.set("select",r,{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(),a=i.find("."+t.klass.viewset),n=function(e){return["webkit","moz","ms","o",""].map(function(t){
5
+ return(t?"-"+t+"-":"")+e})},r=function(e,t){n("transform").map(function(i){e.css(i,t)}),n("transition").map(function(i){e.css(i,t)})};a.length&&(r(i,"none"),i[0].scrollTop=~~a.position().top-2*a[0].clientHeight,r(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 a=24,n=60,r=12,o=a*n,s=e._;i.prototype.set=function(e,t,i){var a=this,n=a.item;return null===t?("clear"==e&&(e="select"),n[e]=t,a):(n["enable"==e?"disable":"flip"==e?"enable":e]=a.queue[e].split(" ").map(function(n){return t=a[n](e,t,i)}).pop(),"select"==e?a.set("highlight",n.select,i):"highlight"==e?a.set("view",n.highlight,i):"interval"==e?a.set("min",n.min,i).set("max",n.max,i):e.match(/^(flip|min|max|disable|enable)$/)&&(n.select&&a.disabled(n.select)&&a.set("select",t,i),n.highlight&&a.disabled(n.highlight)&&a.set("highlight",t,i),"min"==e&&a.set("max",n.max,i)),a)},i.prototype.get=function(e){return this.item[e]},i.prototype.create=function(e,i,r){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]*n+ +i[1]:s.isInteger(i)||(i=l.now(e,i,r)),"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,r),{hour:~~(a+i/n)%a,mins:(n+i%n)%n,time:(o+i)%o,pick:i%o}},i.prototype.createRange=function(e,i){var a=this,n=function(e){return e===!0||t.isArray(e)||s.isDate(e)?a.create(e):e};return s.isInteger(e)||(e=n(e)),s.isInteger(i)||(i=n(i)),s.isInteger(e)&&t.isPlainObject(i)?e=[i.hour,i.mins+e*a.settings.interval]:s.isInteger(i)&&t.isPlainObject(e)&&(i=[e.hour,e.mins+i*a.settings.interval]),{from:n(e),to:n(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,a=this.item.interval,r=new Date,o=r.getHours()*n+r.getMinutes(),l=s.isInteger(t);return o-=o%a,i=0>t&&-a>=a*t+o,o+="min"==e&&i?0:a,l&&(o+=a*(i&&"max"!=e?t+1:t)),o},i.prototype.normalize=function(e,t){var i=this.item.interval,a=this.item.min&&this.item.min.pick||0;return t-="min"==e?0:(t-a)%i},i.prototype.measure=function(e,i,r){var o=this;return i||(i="min"==e?[0,0]:[a-1,n-1]),"string"==typeof i?i=o.parse(e,i):i===!0||s.isInteger(i)?i=o.now(e,i,r):t.isPlainObject(i)&&s.isInteger(i.pick)&&(i=o.normalize(e,i.pick,r)),i},i.prototype.validate=function(e,t,i){var a=this,n=i&&i.interval?i.interval:a.item.interval;return a.disabled(t)&&(t=a.shift(t,n)),t=a.scope(t),a.disabled(t)&&(t=a.shift(t,-1*n)),t},i.prototype.disabled=function(e){var i=this,a=i.item.disable.filter(function(a){return s.isInteger(a)?e.hour==a:t.isArray(a)||s.isDate(a)?e.pick==i.create(a).pick:t.isPlainObject(a)?i.withinRange(a,e):void 0});return a=a.length&&!a.filter(function(e){return t.isArray(e)&&"inverted"==e[2]||t.isPlainObject(e)&&e.inverted}).length,-1===i.item.enable?!a:a||e.pick<i.item.min.pick||e.pick>i.item.max.pick},i.prototype.shift=function(e,t){var i=this,a=i.item.min.pick,n=i.item.max.pick;for(t=t||i.item.interval;i.disabled(e)&&(e=i.create(e.pick+=t),!(e.pick<=a||e.pick>=n)););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 a,r,o,l,c,u=this,d={};if(!t||"string"!=typeof t)return t;i&&i.format||(i=i||{},i.format=u.settings.format),u.formats.toArray(i.format).map(function(e){var i,a=u.formats[e],n=a?s.trigger(a,u,[t,d]):e.replace(/^!/,"").length;a&&(i=t.substr(0,n),d[e]=i.match(/^\d+$/)?+i:i),t=t.substr(n)});for(l in d)c=d[l],s.isInteger(c)?l.match(/^(h|hh)$/i)?(a=c,("h"==l||"hh"==l)&&(a%=12)):"i"==l&&(r=c):l.match(/^a$/i)&&c.match(/^p/i)&&("h"in d||"hh"in d)&&(o=!0);return(o?a+12:a)*n+r},i.prototype.formats={h:function(e,t){return e?s.digits(e):t.hour%r||r},hh:function(e,t){return e?2:s.lead(t.hour%r||r)},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 a=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))?a.create(e).pick===a.create(i).pick:t.isPlainObject(e)&&t.isPlainObject(i)?a.isTimeExact(e.from,i.from)&&a.isTimeExact(e.to,i.to):!1},i.prototype.isTimeOverlap=function(e,i){var a=this;return s.isInteger(e)&&(s.isDate(i)||t.isArray(i))?e===a.create(i).hour:s.isInteger(i)&&(s.isDate(e)||t.isArray(e))?i===a.create(e).hour:t.isPlainObject(e)&&t.isPlainObject(i)?a.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 a=this,n=a.item.disable.slice(0);return"flip"==i?a.flipEnable():i===!1?(a.flipEnable(1),n=[]):i===!0?(a.flipEnable(-1),n=[]):i.map(function(e){for(var i,r=0;r<n.length;r+=1)if(a.isTimeExact(e,n[r])){i=!0;break}i||(s.isInteger(e)||s.isDate(e)||t.isArray(e)||t.isPlainObject(e)&&e.from&&e.to)&&n.push(e)}),n},i.prototype.activate=function(e,i){var a=this,n=a.item.disable,r=n.length;return"flip"==i?a.flipEnable():i===!0?(a.flipEnable(1),n=[]):i===!1?(a.flipEnable(-1),n=[]):i.map(function(e){var i,o,l,c;for(l=0;r>l;l+=1){if(o=n[l],a.isTimeExact(o,e)){i=n[l]=null,c=!0;break}if(a.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;r>l;l+=1)if(a.isTimeExact(n[l],e)){n[l]=null;break}if(c)for(l=0;r>l;l+=1)if(a.isTimeOverlap(n[l],e)){n[l]=null;break}i&&n.push(i)}),n.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,a=t.item.select,n=t.item.highlight,r=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,c=a&&a.pick==l,u=n&&n.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 c&&e.push(i.klass.selected),u&&e.push(i.klass.highlighted),r&&r.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:c&&t.$node.val()===h?!0:null,activedescendant:u?!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,a=i.length,n=new Array(a),r=0;a>r;r++)r in i&&(n[r]=e.call(t,i[r],r,i));return n}),[].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 a=[],n=arguments[1],r=0;i>r;r++)if(r in t){var o=t[r];e.call(n,o,r,t)&&a.push(o)}return a}),[].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 a=0;if(arguments.length>1&&(a=Number(arguments[1]),a!=a?a=0:0!==a&&a!=1/0&&a!=-(1/0)&&(a=(a>0||-1)*Math.floor(Math.abs(a)))),a>=i)return-1;for(var n=a>=0?a:Math.max(i-Math.abs(a),0);i>n;n++)if(n in t&&t[n]===e)return n;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 a,n,r,o,s=[],l=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.extended?"x":"")+(e.sticky?"y":""),c=0;for(e=new RegExp(e.source,l+"g"),i+="",compliantExecNpcg||(a=new RegExp("^"+e.source+"$(?!\\s)",l)),t=void 0===t?-1>>>0:t>>>0;(n=e.exec(i))&&(r=n.index+n[0].length,!(r>c&&(s.push(i.slice(c,n.index)),!compliantExecNpcg&&n.length>1&&n[0].replace(a,function(){for(var e=1;e<arguments.length-2;e++)void 0===arguments[e]&&(n[e]=void 0)}),n.length>1&&n.index<i.length&&Array.prototype.push.apply(s,n.slice(1)),o=n[0].length,c=r,s.length>=t)));)e.lastIndex===n.index&&e.lastIndex++;return c===i.length?(o||!e.test(""))&&s.push(""):s.push(i.slice(c)),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 a=e(this);t.score.val(t.opt.half||t.opt.precision?t.self.data("score"):this.alt||a.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 a=+e.score.val()||void 0;t._apply.call(e,a),t._target.call(e,a,i),e.opt.mouseout&&e.opt.mouseout.call(e,a,i)})},_bindOutCancel:function(){var e=this;e.cancel.on("mouseleave.raty",function(i){var a=e.opt.cancelOff;if("img"!==e.opt.starType&&(a=e.opt.cancelClass+" "+a),t._setIcon.call(e,this,a),e.opt.mouseout){var n=+e.score.val()||void 0;e.opt.mouseout.call(e,n,i)}})},_bindOver:function(){var e=this,i=e.opt.half?"mousemove.raty":"mouseover.raty";e.stars.on(i,function(i){var a=t._getScoreByPosition.call(e,i,this);t._fill.call(e,a),e.opt.half&&(t._roundStars.call(e,a),e.self.data("score",a)),t._target.call(e,a,i),e.opt.mouseover&&e.opt.mouseover.call(e,a,i)})},_bindOverCancel:function(){var e=this;e.cancel.on("mouseover.raty",function(i){var a=e.opt.path+e.opt.starOff,n=e.opt.cancelOn;"img"===e.opt.starType?e.stars.attr("src",a):(n=e.opt.cancelClass+" "+n,e.stars.attr("class",a)),t._setIcon.call(e,this,n),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 a=t._nameForIndex.call(this,i),n={alt:i,src:this.opt.path+this.opt[a]};"img"!==this.opt.starType&&(n={"data-alt":i,"class":n.src}),n.title=t._getHint.call(this,i),e("<"+this.opt.starType+" />",n).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,a=1;a<=this.stars.length;a++){var n,r=this.stars[a-1],o=t._turnOn.call(this,a,e);if(this.opt.iconRange&&this.opt.iconRange.length>i){var s=this.opt.iconRange[i];n=t._getRangeIcon.call(this,s,o),a<=s.range&&t._setIcon.call(this,r,n),a===s.range&&i++}else n=this.opt[o?"starOn":"starOff"],t._setIcon.call(this,r,n)}},_getRangeIcon:function(e,t){return t?e.on||this.opt.starOn:e.off||this.opt.starOff},_getScoreByPosition:function(i,a){var n=parseInt(a.alt||a.getAttribute("data-alt"),10);if(this.opt.half){var r=t._getSize.call(this),o=parseFloat((i.pageX-e(a).offset().left)/r);n=this.opt.precision?n-1+o:n-1+(o>.5?1:.5)}return n},_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 a="starOn";this.opt.halfShow&&i<this.opt.round.up?a="starHalf":i<this.opt.round.full&&(a="starOff");var n=this.opt[a],r=this.stars[Math.ceil(e)-1];t._setIcon.call(this,r,n)}},_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,a){if(this.opt.target){var n=e(this.opt.target);n.length||t._error.call(this,"Target selector invalid or missing!");var r=a&&"mouseover"===a.type;if(void 0===i)i=this.opt.targetText;else if(null===i)i=r?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=a&&"mousemove"===a.type;r||o||this.opt.targetKeep||(i=this.opt.targetText)}t._setTarget.call(this,n,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 a=e(this);a.data("readonly")!==!0&&(t[i?"click":"score"].call(a,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 a=parseInt(i,10),n=e(this).data("options"),r=(+i).toFixed(1).split(".")[1];a>=n.number&&(a=n.number-1,r=10);var o=t._getSize.call(this),s=o/10,l=e(this.stars[a]),c=l.offset().left+s*parseInt(r,10),u=e.Event("mousemove",{pageX:c});l.trigger(u)})},readOnly:function(i){return this.each(function(){var a=e(this);a.data("readonly")!==i&&(i?(a.off(".raty").children("img").off(".raty"),t._lock.call(this)):(t._binds.call(this),t._unlock.call(this)),a.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),a=i.data("options"),n=e.extend({},a,t);i.raty(n)})},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 a=e.scrollTo=function(t,i,a){return e(window).scrollTo(t,i,a)};return a.defaults={axis:"xy",duration:0,limit:!0},e.fn.scrollTo=function(n,r,o){"object"==typeof r&&(o=r,r=0),"function"==typeof o&&(o={onAfter:o}),"max"===n&&(n=9e9),o=e.extend({},a.defaults,o),r=r||o.duration;var s=o.queue&&o.axis.length>1;return s&&(r/=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:r,complete:t&&function(){t.call(d,p,o)}});h.animate(f,i)}if(null!==n){var c,u=t(this),d=u?this.contentWindow||window:this,h=e(d),p=n,f={};switch(typeof p){case"number":case"string":if(/^([+-]=?)?\d+(\.\d+)?(px|%)?$/.test(p)){p=i(p);break}if(p=u?e(p):e(p,d),!p.length)return;case"object":(p.is||p.style)&&(c=(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",n=i.toLowerCase(),r="scroll"+i,g=h[r](),v=a.max(d,t);if(c)f[r]=c[n]+(u?0:g-h.offset()[n]),o.margin&&(f[r]-=parseInt(p.css("margin"+i),10)||0,f[r]-=parseInt(p.css("border"+i+"Width"),10)||0),f[r]+=m[n]||0,o.over[n]&&(f[r]+=p["x"===t?"width":"height"]()*o.over[n]);else{var y=p[n];f[r]=y.slice&&"%"===y.slice(-1)?parseFloat(y)/100*v:y}o.limit&&/^\d+$/.test(f[r])&&(f[r]=f[r]<=0?0:Math.min(f[r],v)),!e&&o.axis.length>1&&(g===f[r]?f={}:s&&(l(o.onAfterFirst),f={}))}),l(o.onAfter)}})},a.max=function(i,a){var n="x"===a?"Width":"Height",r="scroll"+n;if(!t(i))return i[r]-e(i)[n.toLowerCase()]();var o="client"+n,s=i.ownerDocument||i.document,l=s.documentElement,c=s.body;return Math.max(l[r],c[r])-Math.min(l[o],c[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 a=Math.round(t.now);i!==a&&(e(t.elem)[t.prop](a),t._last=this.get(t))}},a}),!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),c=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),c=0===h?d:h,"deltaY"in o&&(h=-1*o.deltaY,c=h),"deltaX"in o&&(d=o.deltaX,0===h&&(c=-1*d)),0!==h||0!==d){if(1===o.deltaMode){var g=e.data(this,"mousewheel-line-height");c*=g,h*=g,d*=g}else if(2===o.deltaMode){var v=e.data(this,"mousewheel-page-height");c*=v,h*=v,d*=v}if(p=Math.max(Math.abs(h),Math.abs(d)),(!r||r>p)&&(r=p,a(o,p)&&(r/=40)),a(o,p)&&(c/=40,d/=40,h/=40),c=Math[c>=1?"floor":"ceil"](c/r),d=Math[d>=1?"floor":"ceil"](d/r),h=Math[h>=1?"floor":"ceil"](h/r),u.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=r,t.offsetX=f,t.offsetY=m,t.deltaMode=0,s.unshift(t,c,d,h),n&&clearTimeout(n),n=setTimeout(i,200),(e.event.dispatch||e.event.handle).apply(this,s)}}function i(){r=null}function a(e,t){return u.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120===0}var n,r,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 c=o.length;c;)e.event.fixHooks[o[--c]]=e.event.mouseHooks;var u=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",u.getLineHeight(this)),e.data(this,"mousewheel-page-height",u.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),a=i["offsetParent"in e.fn?"offsetParent":"parent"]();return a.length||(a=e("body")),parseInt(a.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,a="undefined"!=typeof module&&module.exports,n="https:"==document.location.protocol?"https:":"http:",r="cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.12/jquery.mousewheel.min.js";i||(a?require("jquery-mousewheel")(e):e.event.special.mousewheel||e("head").append(decodeURI("%3Cscript src="+n+"//"+r+"%3E%3C/script%3E"))),t()}(function(){var t,i="mCustomScrollbar",a="mCS",n=".mCustomScrollbar",r={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,c=!1,u=["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,{},r,t),i=h.call(this);if(t.live){var l=t.liveSelector||this.selector||n,c=e(l);if("off"===t.live)return void f(l);s[l]=setTimeout(function(){c.mCustomScrollbar(t),"once"===t.live&&c.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(a)){i.data(a,{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 n=i.data(a),r=n.opt,s=i.data("mcs-axis"),l=i.data("mcs-scrollbar-position"),c=i.data("mcs-theme");s&&(r.axis=s),l&&(r.scrollbarPosition=l),c&&(r.theme=c,p(r)),v.call(this),e("#mCSB_"+n.idx+"_container img:not(."+u[2]+")").addClass(u[2]),d.update.call(null,i)}})},update:function(t,i){var n=t||h.call(this);return e(n).each(function(){var t=e(this);if(t.data(a)){var n=t.data(a),r=n.opt,o=e("#mCSB_"+n.idx+"_container"),s=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")];if(!o.length)return;n.tweenRunning&&Y(t),t.hasClass(u[3])&&t.removeClass(u[3]),t.hasClass(u[4])&&t.removeClass(u[4]),x.call(this),b.call(this),"y"===r.axis||r.advanced.autoExpandHorizontalScroll||o.css("width",y(o.children())),n.overflowed=j.call(this),D.call(this),r.autoDraggerLength&&_.call(this),C.call(this),Q.call(this);var l=[Math.abs(o[0].offsetTop),Math.abs(o[0].offsetLeft)];"x"!==r.axis&&(n.overflowed[0]?s[0].height()>s[0].parent().height()?k.call(this):(X(t,l[0].toString(),{dir:"y",dur:0,overwrite:"none"}),n.contentReset.y=null):(k.call(this),"y"===r.axis?T.call(this):"yx"===r.axis&&n.overflowed[1]&&X(t,l[1].toString(),{dir:"x",dur:0,overwrite:"none"}))),"y"!==r.axis&&(n.overflowed[1]?s[1].width()>s[1].parent().width()?k.call(this):(X(t,l[1].toString(),{dir:"x",dur:0,overwrite:"none"}),n.contentReset.x=null):(k.call(this),"x"===r.axis?T.call(this):"yx"===r.axis&&n.overflowed[0]&&X(t,l[0].toString(),{dir:"y",dur:0,overwrite:"none"}))),i&&n&&(2===i&&r.callbacks.onImageLoad&&"function"==typeof r.callbacks.onImageLoad?r.callbacks.onImageLoad.call(this):3===i&&r.callbacks.onSelectorChange&&"function"==typeof r.callbacks.onSelectorChange?r.callbacks.onSelectorChange.call(this):r.callbacks.onUpdate&&"function"==typeof r.callbacks.onUpdate&&r.callbacks.onUpdate.call(this)),U.call(this)}})},scrollTo:function(t,i){if("undefined"!=typeof t&&null!=t){var n=h.call(this);return e(n).each(function(){var n=e(this);if(n.data(a)){var r=n.data(a),o=r.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),c=z.call(this,t),u=l.scrollInertia>0&&l.scrollInertia<17?17:l.scrollInertia;c[0]=N.call(this,c[0],"y"),c[1]=N.call(this,c[1],"x"),l.moveDragger&&(c[0]*=r.scrollRatio.y,c[1]*=r.scrollRatio.x),l.dur=u,setTimeout(function(){null!==c[0]&&"undefined"!=typeof c[0]&&"x"!==o.axis&&r.overflowed[0]&&(l.dir="y",l.overwrite="all",X(n,c[0].toString(),l)),null!==c[1]&&"undefined"!=typeof c[1]&&"y"!==o.axis&&r.overflowed[1]&&(l.dir="x",l.overwrite="none",X(n,c[1].toString(),l))},l.timeout)}})}},stop:function(){var t=h.call(this);return e(t).each(function(){var t=e(this);t.data(a)&&Y(t)})},disable:function(t){var i=h.call(this);return e(i).each(function(){var i=e(this);i.data(a)&&(i.data(a),U.call(this,"remove"),T.call(this),t&&k.call(this),D.call(this,!0),i.addClass(u[3]))})},destroy:function(){var t=h.call(this);return e(t).each(function(){var n=e(this);if(n.data(a)){var r=n.data(a),o=r.opt,s=e("#mCSB_"+r.idx),l=e("#mCSB_"+r.idx+"_container"),c=e(".mCSB_"+r.idx+"_scrollbar");o.live&&f(o.liveSelector||e(t).selector),U.call(this,"remove"),T.call(this),k.call(this),n.removeData(a),Z(this,"mcs"),c.remove(),l.find("img."+u[2]).removeClass(u[2]),s.replaceWith(l.contents()),n.removeClass(i+" _"+a+"_"+r.idx+" "+u[6]+" "+u[7]+" "+u[5]+" "+u[3]).addClass(u[4])}})}},h=function(){return"object"!=typeof e(this)||e(this).length<1?n:this},p=function(t){var i=["rounded","rounded-dark","rounded-dots","rounded-dots-dark"],a=["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"],n=["minimal","minimal-dark"],r=["minimal","minimal-dark"],o=["minimal","minimal-dark"];t.autoDraggerLength=e.inArray(t.theme,i)>-1?!1:t.autoDraggerLength,t.autoExpandScrollbar=e.inArray(t.theme,a)>-1?!1:t.autoExpandScrollbar,t.scrollButtons.enable=e.inArray(t.theme,n)>-1?!1:t.scrollButtons.enable,t.autoHideScrollbar=e.inArray(t.theme,r)>-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),n=t.data(a),r=n.opt,o=r.autoExpandScrollbar?" "+u[1]+"_expand":"",s=["<div id='mCSB_"+n.idx+"_scrollbar_vertical' class='mCSB_scrollTools mCSB_"+n.idx+"_scrollbar mCS-"+r.theme+" mCSB_scrollTools_vertical"+o+"'><div class='"+u[12]+"'><div id='mCSB_"+n.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_"+n.idx+"_scrollbar_horizontal' class='mCSB_scrollTools mCSB_"+n.idx+"_scrollbar mCS-"+r.theme+" mCSB_scrollTools_horizontal"+o+"'><div class='"+u[12]+"'><div id='mCSB_"+n.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"===r.axis?"mCSB_vertical_horizontal":"x"===r.axis?"mCSB_horizontal":"mCSB_vertical",c="yx"===r.axis?s[0]+s[1]:"x"===r.axis?s[1]:s[0],d="yx"===r.axis?"<div id='mCSB_"+n.idx+"_container_wrapper' class='mCSB_container_wrapper' />":"",h=r.autoHideScrollbar?" "+u[6]:"",p="x"!==r.axis&&"rtl"===n.langDir?" "+u[7]:"";r.setWidth&&t.css("width",r.setWidth),r.setHeight&&t.css("height",r.setHeight),r.setLeft="y"!==r.axis&&"rtl"===n.langDir?"989999px":r.setLeft,t.addClass(i+" _"+a+"_"+n.idx+h+p).wrapInner("<div id='mCSB_"+n.idx+"' class='mCustomScrollBox mCS-"+r.theme+" "+l+"'><div id='mCSB_"+n.idx+"_container' class='mCSB_container' style='position:relative; top:"+r.setTop+"; left:"+r.setLeft+";' dir="+n.langDir+" /></div>");
6
+ var f=e("#mCSB_"+n.idx),m=e("#mCSB_"+n.idx+"_container");"y"===r.axis||r.advanced.autoExpandHorizontalScroll||m.css("width",y(m.children())),"outside"===r.scrollbarPosition?("static"===t.css("position")&&t.css("position","relative"),t.css("overflow","visible"),f.addClass("mCSB_outside").after(c)):(f.addClass("mCSB_inside").append(c),m.wrap(d)),w.call(this);var g=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.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(a),n=i.opt,r=e("#mCSB_"+i.idx+"_container");n.advanced.autoExpandHorizontalScroll&&"y"!==n.axis&&r.css({position:"absolute",width:"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({width:Math.ceil(r[0].getBoundingClientRect().right+.4)-Math.floor(r[0].getBoundingClientRect().left),position:"relative"}).unwrap()},w=function(){var t=e(this),i=t.data(a),n=i.opt,r=e(".mCSB_"+i.idx+"_scrollbar:first"),o=te(n.scrollButtons.tabindex)?"tabindex='"+n.scrollButtons.tabindex+"'":"",s=["<a href='#' class='"+u[13]+"' oncontextmenu='return false;' "+o+" />","<a href='#' class='"+u[14]+"' oncontextmenu='return false;' "+o+" />","<a href='#' class='"+u[15]+"' oncontextmenu='return false;' "+o+" />","<a href='#' class='"+u[16]+"' oncontextmenu='return false;' "+o+" />"],l=["x"===n.axis?s[2]:s[0],"x"===n.axis?s[3]:s[1],s[2],s[3]];n.scrollButtons.enable&&r.prepend(l[0]).append(l[1]).next(".mCSB_scrollTools").prepend(l[2]).append(l[3])},x=function(){var t=e(this),i=t.data(a),n=e("#mCSB_"+i.idx),r=t.css("max-height")||"none",o=-1!==r.indexOf("%"),s=t.css("box-sizing");if("none"!==r){var l=o?t.parent().height()*parseInt(r)/100:parseInt(r);"border-box"===s&&(l-=t.innerHeight()-t.height()+(t.outerHeight()-t.innerHeight())),n.css("max-height",Math.round(l))}},_=function(){var t=e(this),i=t.data(a),n=e("#mCSB_"+i.idx),r=e("#mCSB_"+i.idx+"_container"),o=[e("#mCSB_"+i.idx+"_dragger_vertical"),e("#mCSB_"+i.idx+"_dragger_horizontal")],s=[n.height()/r.outerHeight(!1),n.width()/r.outerWidth(!1)],c=[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())],u=l&&c[1]<c[0]?c[0]:c[1],d=l&&c[3]<c[2]?c[2]:c[3];o[0].css({height:u,"max-height":o[0].parent().height()-10}).find(".mCSB_dragger_bar").css({"line-height":c[0]+"px"}),o[1].css({width:d,"max-width":o[1].parent().width()-10})},C=function(){var t=e(this),i=t.data(a),n=e("#mCSB_"+i.idx),r=e("#mCSB_"+i.idx+"_container"),o=[e("#mCSB_"+i.idx+"_dragger_vertical"),e("#mCSB_"+i.idx+"_dragger_horizontal")],s=[r.outerHeight(!1)-n.height(),r.outerWidth(!1)-n.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]}},S=function(e,t,i){var a=i?u[0]+"_expanded":"",n=e.closest(".mCSB_scrollTools");"active"===t?(e.toggleClass(u[0]+" "+a),n.toggleClass(u[1]),e[0]._draggable=e[0]._draggable?0:1):e[0]._draggable||("hide"===t?(e.removeClass(u[0]),n.removeClass(u[1])):(e.addClass(u[0]),n.addClass(u[1])))},j=function(){var t=e(this),i=t.data(a),n=e("#mCSB_"+i.idx),r=e("#mCSB_"+i.idx+"_container"),o=null==i.overflowed?r.height():r.outerHeight(!1),s=null==i.overflowed?r.width():r.outerWidth(!1);return[o>n.height(),s>n.width()]},k=function(){var t=e(this),i=t.data(a),n=i.opt,r=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"!==n.axis&&!i.overflowed[0]||"y"===n.axis&&i.overflowed[0])&&(s[0].add(o).css("top",0),X(t,"_resetY")),"y"!==n.axis&&!i.overflowed[1]||"x"===n.axis&&i.overflowed[1]){var l=dx=0;"rtl"===i.langDir&&(l=r.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),A.call(i[0])):t()},100)}var i=e(this),n=i.data(a),r=n.opt;if(!n.bindEvents){if(E.call(this),r.contentTouchScroll&&M.call(this),I.call(this),r.mouseWheel.enable){var o;t()}H.call(this),L.call(this),r.advanced.autoScrollOnFocus&&F.call(this),r.scrollButtons.enable&&B.call(this),r.keyboard.enable&&W.call(this),n.bindEvents=!0}},T=function(){var t=e(this),i=t.data(a),n=i.opt,r=a+"_"+i.idx,o=".mCSB_"+i.idx+"_scrollbar",s=e("#mCSB_"+i.idx+",#mCSB_"+i.idx+"_container,#mCSB_"+i.idx+"_container_wrapper,"+o+" ."+u[12]+",#mCSB_"+i.idx+"_dragger_vertical,#mCSB_"+i.idx+"_dragger_horizontal,"+o+">a"),l=e("#mCSB_"+i.idx+"_container");n.advanced.releaseDraggableSelectors&&s.add(e(n.advanced.releaseDraggableSelectors)),i.bindEvents&&(e(document).unbind("."+r),s.each(function(){e(this).unbind("."+r)}),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),n=i.data(a),r=n.opt,o=e("#mCSB_"+n.idx+"_container_wrapper"),s=o.length?o:e("#mCSB_"+n.idx+"_container"),l=[e("#mCSB_"+n.idx+"_scrollbar_vertical"),e("#mCSB_"+n.idx+"_scrollbar_horizontal")],c=[l[0].find(".mCSB_dragger"),l[1].find(".mCSB_dragger")];"x"!==r.axis&&(n.overflowed[0]&&!t?(l[0].add(c[0]).add(l[0].children("a")).css("display","block"),s.removeClass(u[8]+" "+u[10])):(r.alwaysShowScrollbar?(2!==r.alwaysShowScrollbar&&c[0].css("display","none"),s.removeClass(u[10])):(l[0].css("display","none"),s.addClass(u[10])),s.addClass(u[8]))),"y"!==r.axis&&(n.overflowed[1]&&!t?(l[1].add(c[1]).add(l[1].children("a")).css("display","block"),s.removeClass(u[9]+" "+u[11])):(r.alwaysShowScrollbar?(2!==r.alwaysShowScrollbar&&c[1].css("display","none"),s.removeClass(u[11])):(l[1].css("display","none"),s.addClass(u[11])),s.addClass(u[9]))),n.overflowed[0]||n.overflowed[1]?i.removeClass(u[5]):i.addClass(u[5])},O=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],a=e.originalEvent.touches.length||e.originalEvent.changedTouches.length;return e.target.ownerDocument!==document?[i.screenY,i.screenX,a>1]:[i.pageY,i.pageX,a>1];default:return[e.pageY,e.pageX,!1]}},E=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,a){if(f[0].idleTimer=d.scrollInertia<233?250:0,n.attr("id")===p[1])var r="x",o=(n[0].offsetLeft-t+a)*u.scrollRatio.x;else var r="y",o=(n[0].offsetTop-e+i)*u.scrollRatio.y;X(s,o.toString(),{dir:r,drag:!0})}var n,r,o,s=e(this),u=s.data(a),d=u.opt,h=a+"_"+u.idx,p=["mCSB_"+u.idx+"_dragger_vertical","mCSB_"+u.idx+"_dragger_horizontal"],f=e("#mCSB_"+u.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)){c=!0,l&&(document.onselectstart=function(){return!1}),t(!1),Y(s),n=e(this);var a=n.offset(),u=O(i)[0]-a.top,h=O(i)[1]-a.left,p=n.height()+a.top,f=n.width()+a.left;p>u&&u>0&&f>h&&h>0&&(r=u,o=h),S(n,"active",d.autoExpandScrollbar)}}).bind("touchmove."+h,function(e){e.stopImmediatePropagation(),e.preventDefault();var t=n.offset(),a=O(e)[0]-t.top,s=O(e)[1]-t.left;i(r,o,a,s)}),e(document).bind("mousemove."+h+" pointermove."+h+" MSPointerMove."+h,function(e){if(n){var t=n.offset(),a=O(e)[0]-t.top,s=O(e)[1]-t.left;if(r===a)return;i(r,o,a,s)}}).add(g).bind("mouseup."+h+" touchend."+h+" pointerup."+h+" MSPointerUp."+h,function(){n&&(S(n,"active",d.autoExpandScrollbar),n=null),c=!1,l&&(document.onselectstart=null),t(!0)})},M=function(){function i(e){if(!ee(e)||c||O(e)[2])return void(t=0);t=1,x=0,_=0;var i=T.offset();u=O(e)[0]-i.top,d=O(e)[1]-i.left,R=[O(e)[0],O(e)[1]]}function n(e){if(ee(e)&&!c&&!O(e)[2]&&(e.stopImmediatePropagation(),!_||x)){m=G();var t=Q.offset(),i=O(e)[0]-t.top,a=O(e)[1]-t.left,n="mcsLinearOut";if(E.push(i),M.push(a),R[2]=Math.abs(O(e)[0]-R[0]),R[3]=Math.abs(O(e)[1]-R[1]),S.overflowed[0])var r=D[0].parent().height()-D[0].height(),o=u-i>0&&i-u>-(r*S.scrollRatio.y)&&(2*R[3]<R[2]||"yx"===j.axis);if(S.overflowed[1])var s=D[1].parent().width()-D[1].width(),h=d-a>0&&a-d>-(s*S.scrollRatio.x)&&(2*R[2]<R[3]||"yx"===j.axis);o||h?(e.preventDefault(),x=1):_=1,b="yx"===j.axis?[u-i,d-a]:"x"===j.axis?[null,d-a]:[u-i,null],T[0].idleTimer=250,S.overflowed[0]&&l(b[0],I,n,"y","all",!0),S.overflowed[1]&&l(b[1],I,n,"x",A,!0)}}function r(e){if(!ee(e)||c||O(e)[2])return void(t=0);t=1,e.stopImmediatePropagation(),Y(C),f=G();var i=Q.offset();h=O(e)[0]-i.top,p=O(e)[1]-i.left,E=[],M=[]}function o(e){if(ee(e)&&!c&&!O(e)[2]){e.stopImmediatePropagation(),x=0,_=0,g=G();var t=Q.offset(),i=O(e)[0]-t.top,a=O(e)[1]-t.left;if(!(g-m>30)){y=1e3/(g-f);var n="mcsEaseOut",r=2.5>y,o=r?[E[E.length-2],M[M.length-2]]:[0,0];v=r?[i-o[0],a-o[1]]:[i-h,a-p];var u=[Math.abs(v[0]),Math.abs(v[1])];y=r?[Math.abs(v[0]/4),Math.abs(v[1]/4)]:[y,y];var d=[Math.abs(T[0].offsetTop)-v[0]*s(u[0]/y[0],y[0]),Math.abs(T[0].offsetLeft)-v[1]*s(u[1]/y[1],y[1])];b="yx"===j.axis?[d[0],d[1]]:"x"===j.axis?[null,d[1]]:[d[0],null],w=[4*u[0]+j.scrollInertia,4*u[1]+j.scrollInertia];var C=parseInt(j.contentTouchScroll)||0;b[0]=u[0]>C?b[0]:0,b[1]=u[1]>C?b[1]:0,S.overflowed[0]&&l(b[0],w[0],n,"y",A,!1),S.overflowed[1]&&l(b[1],w[1],n,"x",A,!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,a,n,r){e&&X(C,e.toString(),{dur:t,scrollEasing:i,dir:a,overwrite:n,drag:r})}var u,d,h,p,f,m,g,v,y,b,w,x,_,C=e(this),S=C.data(a),j=S.opt,k=a+"_"+S.idx,Q=e("#mCSB_"+S.idx),T=e("#mCSB_"+S.idx+"_container"),D=[e("#mCSB_"+S.idx+"_dragger_vertical"),e("#mCSB_"+S.idx+"_dragger_horizontal")],E=[],M=[],I=0,A="yx"===j.axis?"none":"all",R=[],H=T.find("iframe"),F=["touchstart."+k+" pointerdown."+k+" MSPointerDown."+k,"touchmove."+k+" pointermove."+k+" MSPointerMove."+k,"touchend."+k+" pointerup."+k+" MSPointerUp."+k];T.bind(F[0],function(e){i(e)}).bind(F[1],function(e){n(e)}),Q.bind(F[0],function(e){r(e)}).bind(F[2],function(e){o(e)}),H.length&&H.each(function(){e(this).load(function(){P(this)&&e(this.contentDocument||this.contentWindow.document).bind(F[0],function(e){i(e),r(e)}).bind(F[1],function(e){n(e)}).bind(F[2],function(e){o(e)})})})},I=function(){function i(){return window.getSelection?window.getSelection().toString():document.selection&&"Control"!=document.selection.type?document.selection.createRange().text:0}function n(e,t,i){u.type=i&&r?"stepped":"stepless",u.scrollAmount=10,$(o,e,t,"mcsLinearOut",i?60:null)}var r,o=e(this),s=o.data(a),l=s.opt,u=s.sequential,d=a+"_"+s.idx,h=e("#mCSB_"+s.idx+"_container"),p=h.parent();h.bind("mousedown."+d,function(){t||r||(r=1,c=!0)}).add(document).bind("mousemove."+d,function(e){if(!t&&r&&i()){var a=h.offset(),o=O(e)[0]-a.top+h[0].offsetTop,c=O(e)[1]-a.left+h[0].offsetLeft;o>0&&o<p.height()&&c>0&&c<p.width()?u.step&&n("off",null,"stepped"):("x"!==l.axis&&s.overflowed[0]&&(0>o?n("on",38):o>p.height()&&n("on",40)),"y"!==l.axis&&s.overflowed[1]&&(0>c?n("on",37):c>p.width()&&n("on",39)))}}).bind("mouseup."+d,function(){t||(r&&(r=0,n("off",null)),c=!1)})},A=function(){function t(t,a){if(Y(i),!R(i,t.target)){var o="auto"!==r.mouseWheel.deltaFactor?parseInt(r.mouseWheel.deltaFactor):l&&t.deltaFactor<100?100:t.deltaFactor||100;if("x"===r.axis||"x"===r.mouseWheel.axis)var u="x",d=[Math.round(o*n.scrollRatio.x),parseInt(r.mouseWheel.scrollAmount)],h="auto"!==r.mouseWheel.scrollAmount?d[1]:d[0]>=s.width()?.9*s.width():d[0],p=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetLeft),f=c[1][0].offsetLeft,m=c[1].parent().width()-c[1].width(),g=t.deltaX||t.deltaY||a;else var u="y",d=[Math.round(o*n.scrollRatio.y),parseInt(r.mouseWheel.scrollAmount)],h="auto"!==r.mouseWheel.scrollAmount?d[1]:d[0]>=s.height()?.9*s.height():d[0],p=Math.abs(e("#mCSB_"+n.idx+"_container")[0].offsetTop),f=c[0][0].offsetTop,m=c[0].parent().height()-c[0].height(),g=t.deltaY||a;"y"===u&&!n.overflowed[0]||"x"===u&&!n.overflowed[1]||(r.mouseWheel.invert&&(g=-g),r.mouseWheel.normalizeDelta&&(g=0>g?-1:1),(g>0&&0!==f||0>g&&f!==m||r.mouseWheel.preventDefault)&&(t.stopImmediatePropagation(),t.preventDefault()),X(i,(p-g*h).toString(),{dir:u}))}}var i=e(this),n=i.data(a),r=n.opt,o=a+"_"+n.idx,s=e("#mCSB_"+n.idx),c=[e("#mCSB_"+n.idx+"_dragger_vertical"),e("#mCSB_"+n.idx+"_dragger_horizontal")],u=e("#mCSB_"+n.idx+"_container").find("iframe");n&&(u.length&&u.each(function(){e(this).load(function(){P(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)}))},P=function(e){var t=null;try{var i=e.contentDocument||e.contentWindow.document;t=i.body.innerHTML}catch(a){}return null!==t},R=function(t,i){var n=i.nodeName.toLowerCase(),r=t.data(a).opt.mouseWheel.disableOver,o=["select","textarea"];return e.inArray(n,r)>-1&&!(e.inArray(n,o)>-1&&!e(i).is(":focus"))},H=function(){var t=e(this),i=t.data(a),n=a+"_"+i.idx,r=e("#mCSB_"+i.idx+"_container"),o=r.parent(),s=e(".mCSB_"+i.idx+"_scrollbar ."+u[12]);s.bind("touchstart."+n+" pointerdown."+n+" MSPointerDown."+n,function(){c=!0}).bind("touchend."+n+" pointerup."+n+" MSPointerUp."+n,function(){c=!1}).bind("click."+n,function(a){if(e(a.target).hasClass(u[12])||e(a.target).hasClass("mCSB_draggerRail")){Y(t);var n=e(this),s=n.find(".mCSB_dragger");if(n.parent(".mCSB_scrollTools_horizontal").length>0){if(!i.overflowed[1])return;var l="x",c=a.pageX>s.offset().left?-1:1,d=Math.abs(r[0].offsetLeft)-.9*c*o.width()}else{if(!i.overflowed[0])return;var l="y",c=a.pageY>s.offset().top?-1:1,d=Math.abs(r[0].offsetTop)-.9*c*o.height()}X(t,d.toString(),{dir:l,scrollEasing:"mcsEaseInOut"})}})},F=function(){var t=e(this),i=t.data(a),n=i.opt,r=a+"_"+i.idx,o=e("#mCSB_"+i.idx+"_container"),s=o.parent();o.bind("focusin."+r,function(){var i=e(document.activeElement),a=o.find(".mCustomScrollBox").length,r=0;i.is(n.advanced.autoScrollOnFocus)&&(Y(t),clearTimeout(t[0]._focusTimeout),t[0]._focusTimer=a?(r+17)*a:0,t[0]._focusTimeout=setTimeout(function(){var e=[ie(i)[0],ie(i)[1]],a=[o[0].offsetTop,o[0].offsetLeft],l=[a[0]+e[0]>=0&&a[0]+e[0]<s.height()-i.outerHeight(!1),a[1]+e[1]>=0&&a[0]+e[1]<s.width()-i.outerWidth(!1)],c="yx"!==n.axis||l[0]||l[1]?"all":"none";"x"===n.axis||l[0]||X(t,e[0].toString(),{dir:"y",scrollEasing:"mcsEaseInOut",overwrite:c,dur:r}),"y"===n.axis||l[1]||X(t,e[1].toString(),{dir:"x",scrollEasing:"mcsEaseInOut",overwrite:c,dur:r})},t[0]._focusTimer))})},L=function(){var t=e(this),i=t.data(a),n=a+"_"+i.idx,r=e("#mCSB_"+i.idx+"_container").parent();r.bind("scroll."+n,function(){(0!==r.scrollTop()||0!==r.scrollLeft())&&e(".mCSB_"+i.idx+"_scrollbar").css("visibility","hidden")})},B=function(){var t=e(this),i=t.data(a),n=i.opt,r=i.sequential,o=a+"_"+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(a){function o(e,i){r.scrollAmount=n.snapAmount||n.scrollButtons.scrollAmount,$(t,e,i)}if(a.preventDefault(),J(a)){var s=e(this).attr("class");switch(r.type=n.scrollButtons.scrollType,a.type){case"mousedown":case"touchstart":case"pointerdown":case"MSPointerDown":if("stepped"===r.type)return;c=!0,i.tweenRunning=!1,o("on",s);break;case"mouseup":case"touchend":case"pointerup":case"MSPointerUp":case"mouseout":case"pointerout":case"MSPointerOut":if("stepped"===r.type)return;c=!1,r.dir&&o("off",s);break;case"click":if("stepped"!==r.type||i.tweenRunning)return;o("on",s)}}})},W=function(){function t(t){function a(e,t){o.type=r.keyboard.scrollType,o.scrollAmount=r.snapAmount||r.keyboard.scrollAmount,"stepped"===o.type&&n.tweenRunning||$(i,e,t)}switch(t.type){case"blur":n.tweenRunning&&o.dir&&a("off",null);break;case"keydown":case"keyup":var s=t.keyCode?t.keyCode:t.which,l="on";if("x"!==r.axis&&(38===s||40===s)||"y"!==r.axis&&(37===s||39===s)){if((38===s||40===s)&&!n.overflowed[0]||(37===s||39===s)&&!n.overflowed[1])return;"keyup"===t.type&&(l="off"),e(document.activeElement).is(d)||(t.preventDefault(),t.stopImmediatePropagation(),a(l,s))}else if(33===s||34===s){if((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type){Y(i);var h=34===s?-1:1;if("x"===r.axis||"yx"===r.axis&&n.overflowed[1]&&!n.overflowed[0])var p="x",f=Math.abs(c[0].offsetLeft)-.9*h*u.width();else var p="y",f=Math.abs(c[0].offsetTop)-.9*h*u.height();X(i,f.toString(),{dir:p,scrollEasing:"mcsEaseInOut"})}}else if((35===s||36===s)&&!e(document.activeElement).is(d)&&((n.overflowed[0]||n.overflowed[1])&&(t.preventDefault(),t.stopImmediatePropagation()),"keyup"===t.type)){if("x"===r.axis||"yx"===r.axis&&n.overflowed[1]&&!n.overflowed[0])var p="x",f=35===s?Math.abs(u.width()-c.outerWidth(!1)):0;else var p="y",f=35===s?Math.abs(u.height()-c.outerHeight(!1)):0;X(i,f.toString(),{dir:p,scrollEasing:"mcsEaseInOut"})}}}var i=e(this),n=i.data(a),r=n.opt,o=n.sequential,s=a+"_"+n.idx,l=e("#mCSB_"+n.idx),c=e("#mCSB_"+n.idx+"_container"),u=c.parent(),d="input,textarea,select,datalist,keygen,[contenteditable='true']",h=c.find("iframe"),p=["blur."+s+" keydown."+s+" keyup."+s];h.length&&h.each(function(){e(this).load(function(){P(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)})},$=function(t,i,n,r,o){function s(e){var i="stepped"!==h.type,a=o?o:e?i?m/1.5:g:1e3/60,n=e?i?7.5:40:2.5,l=[Math.abs(p[0].offsetTop),Math.abs(p[0].offsetLeft)],u=[c.scrollRatio.y>10?10:c.scrollRatio.y,c.scrollRatio.x>10?10:c.scrollRatio.x],d="x"===h.dir[0]?l[1]+h.dir[1]*u[1]*n:l[0]+h.dir[1]*u[0]*n,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=r?r:e?i?"mcsLinearOut":"mcsEaseInOut":"mcsLinear",b=e?!0:!1;return e&&17>a&&(v="x"===h.dir[0]?l[1]:l[0]),X(t,v.toString(),{dir:h.dir[0],scrollEasing:y,dur:a,onComplete:b}),e?void(h.dir=!1):(clearTimeout(h.step),void(h.step=setTimeout(function(){s()},a)))}function l(){clearTimeout(h.step),Z(h,"step"),Y(t)}var c=t.data(a),d=c.opt,h=c.sequential,p=e("#mCSB_"+c.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=[n===u[16]||n===u[15]||39===n||37===n?"x":"y",n===u[13]||n===u[15]||38===n||37===n?-1:1],Y(t),te(n)&&"stepped"===h.type)return;s(f);break;case"off":l(),(f||c.tweenRunning&&h.dir)&&s(!0)}},z=function(t){var i=e(this).data(a).opt,n=[];return"function"==typeof t&&(t=t()),t instanceof Array?n=t.length>1?[t[0],t[1]]:"x"===i.axis?[null,t[0]]:[t[0],null]:(n[0]=t.y?t.y:t.x||"x"===i.axis?null:t,n[1]=t.x?t.x:t.y||"y"===i.axis?null:t),"function"==typeof n[0]&&(n[0]=n[0]()),"function"==typeof n[1]&&(n[1]=n[1]()),n},N=function(t,i){if(null!=t&&"undefined"!=typeof t){var n=e(this),r=n.data(a),o=r.opt,s=e("#mCSB_"+r.idx+"_container"),l=s.parent(),c=typeof t;i||(i="x"===o.axis?"x":"y");var u="x"===i?s.outerWidth(!1):s.outerHeight(!1),h="x"===i?s[0].offsetLeft:s[0].offsetTop,p="x"===i?"left":"top";switch(c){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(u*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,n[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]!==x[0]||m[1]!==x[1]||m[2]!==x[2]||m[3]!==x[3]||m[4]!==x[4]||m[5]!==x[5])&&(s(m[0]!==x[0]||m[1]!==x[1]),x=m)),h.advanced.updateOnImageLoad&&(g=n(),g!==_&&(p.find("img").each(function(){r(this)}),_=g)),void((h.advanced.updateOnSelectorChange||h.advanced.updateOnContentResize||h.advanced.updateOnImageLoad)&&i()))},60)}function n(){var e=0;return h.advanced.updateOnImageLoad&&(e=p.find("img").length),e}function r(t){function i(e,t){return function(){return t.apply(e,arguments)}}function a(){this.onload=null,e(t).addClass(u[2]),s(2)}if(e(t).hasClass(u[2]))return void s();var n=new Image;n.onload=i(n,a),n.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),c=l.data(a),h=c.opt,p=e("#mCSB_"+c.idx+"_container");if(t)return clearTimeout(p[0].autoUpdate),void Z(p[0],"autoUpdate");var f,m,g,v=p.parent(),y=[e("#mCSB_"+c.idx+"_scrollbar_vertical"),e("#mCSB_"+c.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(),x=[p.outerHeight(!1),p.outerWidth(!1),v.height(),v.width(),b()[0],b()[1]],_=n();i()},q=function(e,t,i){return Math.round(e/t)*t-i},Y=function(t){var i=t.data(a),n=e("#mCSB_"+i.idx+"_container,#mCSB_"+i.idx+"_container_wrapper,#mCSB_"+i.idx+"_dragger_vertical,#mCSB_"+i.idx+"_dragger_horizontal");n.each(function(){K.call(this)})},X=function(t,i,n){function r(e){return l&&c.callbacks[e]&&"function"==typeof c.callbacks[e]}function o(){return[c.callbacks.alwaysTriggerOffsets||b>=w[0]+_,c.callbacks.alwaysTriggerOffsets||-C>=b]}function s(){var e=[p[0].offsetTop,p[0].offsetLeft],i=[v[0].offsetTop,v[0].offsetLeft],a=[p.outerHeight(!1),p.outerWidth(!1)],r=[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(a[0])-r[0])),leftPct:Math.round(100*Math.abs(e[1])/(Math.abs(a[1])-r[1])),direction:n.dir}}var l=t.data(a),c=l.opt,u={trigger:"internal",dir:"y",scrollEasing:"mcsEaseOut",drag:!1,dur:c.scrollInertia,overwrite:"all",callbacks:!0,onStart:!0,onUpdate:!0,onComplete:!0},n=e.extend(u,n),d=[n.dur,n.drag?0:n.dur],h=e("#mCSB_"+l.idx),p=e("#mCSB_"+l.idx+"_container"),f=p.parent(),m=c.callbacks.onTotalScrollOffset?z.call(t,c.callbacks.onTotalScrollOffset):[0,0],g=c.callbacks.onTotalScrollBackOffset?z.call(t,c.callbacks.onTotalScrollBackOffset):[0,0];if(l.trigger=n.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||(r("onOverflowYNone")&&c.callbacks.onOverflowYNone.call(t[0]),l.contentReset.y=1),"_resetX"!==i||l.contentReset.x||(r("onOverflowXNone")&&c.callbacks.onOverflowXNone.call(t[0]),l.contentReset.x=1),"_resetY"!==i&&"_resetX"!==i){switch(!l.contentReset.y&&t[0].mcs||!l.overflowed[0]||(r("onOverflowY")&&c.callbacks.onOverflowY.call(t[0]),l.contentReset.x=null),!l.contentReset.x&&t[0].mcs||!l.overflowed[1]||(r("onOverflowX")&&c.callbacks.onOverflowX.call(t[0]),l.contentReset.x=null),c.snapAmount&&(i=q(i,c.snapAmount,c.snapOffset)),n.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()],x=[i,0===i?0:i/l.scrollRatio.x],_=m[1],C=g[1],j=_>0?_/l.scrollRatio.x:0,k=C>0?C/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()],x=[i,0===i?0:i/l.scrollRatio.y],_=m[0],C=g[0],j=_>0?_/l.scrollRatio.y:0,k=C>0?C/l.scrollRatio.y:0}x[1]<0||0===x[0]&&0===x[1]?x=[0,0]:x[1]>=w[1]?x=[w[0],w[1]]:x[0]=-x[0],t[0].mcs||(s(),r("onInit")&&c.callbacks.onInit.call(t[0])),clearTimeout(p[0].onCompleteTimeout),(l.tweenRunning||!(0===b&&x[0]>=0||b===w[0]&&x[0]<=w[0]))&&(V(v[0],y,Math.round(x[1]),d[1],n.scrollEasing),V(p[0],y,Math.round(x[0]),d[0],n.scrollEasing,n.overwrite,{onStart:function(){n.callbacks&&n.onStart&&!l.tweenRunning&&(r("onScrollStart")&&(s(),c.callbacks.onScrollStart.call(t[0])),l.tweenRunning=!0,S(v),l.cbOffsets=o())},onUpdate:function(){n.callbacks&&n.onUpdate&&r("whileScrolling")&&(s(),c.callbacks.whileScrolling.call(t[0]))},onComplete:function(){if(n.callbacks&&n.onComplete){"yx"===c.axis&&clearTimeout(p[0].onCompleteTimeout);var e=p[0].idleTimer||0;p[0].onCompleteTimeout=setTimeout(function(){r("onScroll")&&(s(),c.callbacks.onScroll.call(t[0])),r("onTotalScroll")&&x[1]>=w[1]-j&&l.cbOffsets[0]&&(s(),c.callbacks.onTotalScroll.call(t[0])),r("onTotalScrollBack")&&x[1]<=k&&l.cbOffsets[1]&&(s(),c.callbacks.onTotalScrollBack.call(t[0])),l.tweenRunning=!1,p[0].idleTimer=0,S(v,"hide")},e)}}}))}},V=function(e,t,i,a,n,r,o){function s(){x.stop||(y||f.call(),y=G()-v,l(),y>=x.time&&(x.time=y>x.time?y+h-(y-x.time):y+h-1,x.time<y+1&&(x.time=y+1)),x.time<a?x.id=p(s):g.call())}function l(){a>0?(x.currVal=d(x.time,b,_,a,n),w[t]=Math.round(x.currVal)+"px"):w[t]=i+"px",m.call()}function c(){h=1e3/60,x.time=y+h,p=window.requestAnimationFrame?window.requestAnimationFrame:function(e){return l(),setTimeout(e,.01)},x.id=p(s)}function u(){null!=x.id&&(window.requestAnimationFrame?window.cancelAnimationFrame(x.id):clearTimeout(x.id),x.id=null)}function d(e,t,i,a,n){switch(n){case"linear":case"mcsLinear":return i*e/a+t;case"mcsLinearOut":return e/=a,e--,i*Math.sqrt(1-e*e)+t;case"easeInOutSmooth":return e/=a/2,1>e?i/2*e*e+t:(e--,-i/2*(e*(e-2)-1)+t);case"easeInOutStrong":return e/=a/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/=a/2,1>e?i/2*e*e*e+t:(e-=2,i/2*(e*e*e+2)+t);case"easeOutSmooth":return e/=a,e--,-i*(e*e*e*e-1)+t;case"easeOutStrong":return i*(-Math.pow(2,-10*e/a)+1)+t;case"easeOut":case"mcsEaseOut":default:var r=(e/=a)*e,o=r*e;return t+i*(.499999999999997*o*r+-2.5*r*r+5.5*o+-6.5*r+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=G(),y=0,b=e.offsetTop,w=e.style,x=e._mTween[t];"left"===t&&(b=e.offsetLeft);var _=i-b;x.stop=0,"none"!==r&&u(),c()},G=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()},K=function(){var e=this;e._mTween||(e._mTween={top:{},left:{}});for(var t=["top","left"],i=0;i<t.length;i++){var a=t[i];e._mTween[a].id&&(window.requestAnimationFrame?window.cancelAnimationFrame(e._mTween[a].id):clearTimeout(e._mTween[a].id),e._mTween[a].id=null,e._mTween[a].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=r,window[i]=!0,e(window).load(function(){e(n)[i](),e.extend(e.expr[":"],{mcsInView:e.expr[":"].mcsInView||function(t){var i,a,n=e(t),r=n.parents(".mCSB_container");return r.length?(i=r.parent(),a=[r[0].offsetTop,r[0].offsetLeft],a[0]+ie(n)[0]>=0&&a[0]+ie(n)[0]<i.height()-n.outerHeight(!1)&&a[1]+ie(n)[1]>=0&&a[1]+ie(n)[1]<i.width()-n.outerWidth(!1)):void 0},mcsOverflow:e.expr[":"].mcsOverflow||function(t){var i=e(t).data(a);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),a=window.location,n=!0,r=!1,o=null,s=NaN,l=1/0,c="undefined",u="directive",d=".cropper",h=/^(e|n|w|s|ne|nw|sw|se|all|crop|move|zoom)$/,p=/^(x|y|width|height)$/,f=/^(naturalWidth|naturalHeight|width|height|aspectRatio|ratio|rotate)$/,m="cropper-modal",g="cropper-hidden",v="cropper-invisible",y="cropper-move",b="cropper-crop",w="cropper-disabled",x="mousedown touchstart",_="mousemove touchmove",C="mouseup mouseleave touchend touchleave touchcancel",S="wheel mousewheel DOMMouseScroll",j="resize"+d,k="dblclick",Q="build"+d,T="built"+d,D="dragstart"+d,O="dragmove"+d,E="dragend"+d,M=function(e){return"number"==typeof e},I=function(e,t){var i=[];return"number"==typeof t&&i.push(t),i.slice.apply(e,i)},A=function(e,t){var i=I(arguments,2);return function(){return e.apply(t,i.concat(I(arguments)))}},P=function(t,i){this.element=t,this.$element=e(t),this.defaults=e.extend({},P.DEFAULTS,e.isPlainObject(i)?i:{}),this.$original=o,this.ready=r,this.built=r,this.cropped=r,this.rotated=r,this.disabled=r,this.replaced=r,this.init()},R=Math.sqrt,H=Math.min,F=Math.max,L=Math.abs,B=Math.sin,W=Math.cos,$=parseFloat;P.prototype={constructor:P,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]=L($(i))||s;break;case"autoCropArea":t[e]=L($(i))||.8;break;case"minWidth":case"minHeight":t[e]=L($(i))||0;break;case"maxWidth":case"maxHeight":t[e]=L($(i))||l}}),this.image={rotate:0},this.load()},load:function(){var t,i,a=this,r=this.$element,o=this.element,s=this.image,l="";r.is("img")?i=r.prop("src"):r.is("canvas")&&this.support.canvas&&(i=o.toDataURL()),i&&(this.replaced&&(s.rotate=0),this.defaults.checkImageOrigin&&(r.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,a.url=i,a.ready=n,a.build()}),t.addClass(v).prependTo("body"))},isCrossOriginURL:function(e){var t=e.match(/^(https?:)\/\/([^\:\/\?#]+):?(\d*)/i);return!t||t[1]===a.protocol&&t[2]===a.hostname&&t[3]===a.port?r:n},build:function(){var t,i,a=this.$element,o=this.defaults;this.ready&&(this.built&&this.unbuild(),a.one(Q,o.build),t=e.Event(Q),a.trigger(t),t.isDefaultPrevented()||(this.$cropper=i=e(P.TEMPLATE),a.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=a.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=n: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(u,"move"),!o.resizable&&this.$dragger.find(".cropper-line, .cropper-point").addClass(g),
7
+ this.addListeners(),this.initPreview(),this.built=n,this.update(),this.replaced=r,a.one(T,o.built),a.trigger(T)))},unbuild:function(){this.built&&(this.built=r,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,n),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,a=t.width,n=t.height,r=i.left-t.left,o=i.top-t.top;this.$viewer.find("img").css({width:a,height:n,marginLeft:-r,marginTop:-o}),this.$preview.each(function(){var t=e(this),s=t.width()/i.width;t.find("img").css({width:a*s,height:n*s,marginLeft:-r*s,marginTop:-o*s})})},addListeners:function(){var a=this.defaults;this.$element.on(D,a.dragstart).on(O,a.dragmove).on(E,a.dragend),this.$cropper.on(x,e.proxy(this.dragstart,this)).on(k,e.proxy(this.dblclick,this)),a.zoomable&&this.$cropper.on(S,e.proxy(this.wheel,this)),a.multiple?this.$cropper.on(_,e.proxy(this.dragmove,this)).on(C,e.proxy(this.dragend,this)):i.on(_,this._dragmove=A(this.dragmove,this)).on(C,this._dragend=A(this.dragend,this)),t.on(j,this._resize=A(this.resize,this))},removeListeners:function(){var e=this.defaults;this.$element.off(D,e.dragstart).off(O,e.dragmove).off(E,e.dragend),this.$cropper.off(x,this.dragstart).off(k,this.dblclick),e.zoomable&&this.$cropper.off(S,this.wheel),e.multiple?this.$cropper.off(_,this.dragmove).off(C,this.dragend):i.off(_,this._dragmove).off(C,this._dragend),t.off(j,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;this.container={width:F(e.width(),300),height:F(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,a={_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,a),t._width!==i.width||t._height!==i.height?e.extend(t,a):(t=e.extend({},a,t),this.replaced&&(t.ratio=a.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=H(F(t.left,t._width-t.width),0),t.top=H(F(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,a=this.cropper,n=i.aspectRatio||this.image.aspectRatio,r=this.image.ratio;t=a.height*n-a.width>=0?{height:a.width/n,width:a.width,left:0,top:(a.height-a.width/n)/2,maxWidth:a.width,maxHeight:a.width/n}:{height:a.height,width:a.height*n,left:(a.width-a.height*n)/2,top:0,maxWidth:a.height*n,maxHeight:a.height},t.minWidth=0,t.minHeight=0,i.aspectRatio?(isFinite(i.maxWidth)?(t.maxWidth=H(t.maxWidth,i.maxWidth*r),t.maxHeight=t.maxWidth/n):isFinite(i.maxHeight)&&(t.maxHeight=H(t.maxHeight,i.maxHeight*r),t.maxWidth=t.maxHeight*n),i.minWidth>0?(t.minWidth=F(0,i.minWidth*r),t.minHeight=t.minWidth/n):i.minHeight>0&&(t.minHeight=F(0,i.minHeight*r),t.minWidth=t.minHeight*n)):(t.maxWidth=H(t.maxWidth,i.maxWidth*r),t.maxHeight=H(t.maxHeight,i.maxHeight*r),t.minWidth=F(0,i.minWidth*r),t.minHeight=F(0,i.minHeight*r)),t.minWidth=H(t.maxWidth,t.minWidth),t.minHeight=H(t.maxHeight,t.minHeight),t.height*=i.autoCropArea,t.width*=i.autoCropArea,t.left=(a.width-t.width)/2,t.top=(a.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=H(F(e.left,0),t.width-e.width),e.top=H(F(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=r,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 a,o=this,s=this.$element,l=this.element;t&&t!==this.url&&t!==s.attr("src")&&(i||(this.rotated=r,this.replaced=n),s.is("img")?(s.attr("src",t),this.load()):s.is("canvas")&&this.support.canvas&&(a=l.getContext("2d"),e('<img src="'+t+'">').one("load",function(){l.width=this.width,l.height=this.height,a.clearRect(0,0,l.width,l.height),a.drawImage(this,0,0),o.load()})))},setData:function(t,i){var a=this.cropper,n=this.dragger,r=this.image,s=this.defaults.aspectRatio;this.built&&typeof t!==c&&((t===o||e.isEmptyObject(t))&&(n=e.extend({},this.defaultDragger)),e.isPlainObject(t)&&!e.isEmptyObject(t)&&(i||(this.defaults.data=t),t=this.transformData(t),M(t.x)&&t.x<=a.width-r.left&&(n.left=t.x+r.left),M(t.y)&&t.y<=a.height-r.top&&(n.top=t.y+r.top),s?M(t.width)&&t.width<=n.maxWidth&&t.width>=n.minWidth?(n.width=t.width,n.height=n.width/s):M(t.height)&&t.height<=n.maxHeight&&t.height>=n.minHeight&&(n.height=t.height,n.width=n.height*s):(M(t.width)&&t.width<=n.maxWidth&&t.width>=n.minWidth&&(n.width=t.width),M(t.height)&&t.height<=n.maxHeight&&t.height>=n.minHeight&&(n.height=t.height))),this.dragger=n,this.renderDragger())},getData:function(e){var t=this.dragger,i=this.image,a={};return this.built&&(a={x:t.left-i.left,y:t.top-i.top,width:t.width,height:t.height},a=this.transformData(a,n,e)),a},transformData:function(t,i,a){var n=this.image.ratio,r={};return e.each(t,function(e,t){t=$(t),p.test(e)&&!isNaN(t)&&(r[e]=i?a?Math.round(t/n):t/n:t*n)}),r},setAspectRatio:function(e){var t="auto"===e;e=$(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,a){var n,r=e("<canvas>")[0],o=this.getData(),s="";return e.isPlainObject(t)||(a=i,i=t,t={}),t=e.extend({width:o.width,height:o.height},t),this.cropped&&this.support.canvas&&(r.width=t.width,r.height=t.height,n=r.getContext("2d"),"image/jpeg"===i&&(n.fillStyle="#fff",n.fillRect(0,0,t.width,t.height)),n.drawImage(this.$clone[0],o.x,o.y,o.width,o.height,0,0,t.width,t.height),s=r.toDataURL(i,a)),s},setDragMode:function(e){var t=this.$canvas,i=this.defaults,a=r,o=r;if(this.built&&!this.disabled){switch(e){case"crop":i.dragCrop&&(a=n,t.data(u,e));break;case"move":o=n,t.data(u,e);break;default:t.removeData(u)}t.toggleClass(b,a).toggleClass(y,o)}},enable:function(){this.built&&(this.disabled=r,this.$cropper.removeClass(w))},disable:function(){this.built&&(this.disabled=n,this.$cropper.addClass(w))},rotate:function(e){var t=this.image;e=$(e)||0,this.built&&0!==e&&!this.disabled&&this.defaults.rotatable&&this.support.canvas&&(this.rotated=n,e=t.rotate=(t.rotate+e)%360,this.replace(this.getRotatedDataURL(e),!0))},getRotatedDataURL:function(t){var i=e("<canvas>")[0],a=i.getContext("2d"),n=t*Math.PI/180,r=L(t)%180,o=r>90?180-r:r,s=o*Math.PI/180,l=this.originalImage,c=l.naturalWidth,u=l.naturalHeight,d=L(c*W(s)+u*B(s)),h=L(c*B(s)+u*W(s));return i.width=d,i.height=h,a.save(),a.translate(d/2,h/2),a.rotate(n),a.drawImage(this.$original[0],-c/2,-u/2,c,u),a.restore(),i.toDataURL()},zoom:function(e){var t,i,a,n=this.image;e=$(e),this.built&&e&&!this.disabled&&this.defaults.zoomable&&(t=n.width*(1+e),i=n.height*(1+e),a=t/n._width,a>10||(1>a&&(t=n._width,i=n._height),1>=a?this.setDragMode("crop"):this.setDragMode("move"),n.oldWidth=n.width,n.oldHeight=n.height,n.width=t,n.height=i,n.ratio=n.width/n.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,a=117.25,n=5,r=166.66665649414062,o=.1;this.disabled||(e.preventDefault(),i.deltaY?(t=i.deltaY,t=t%n===0?t/n:t%a===0?t/a:t/r):t=i.wheelDelta?-i.wheelDelta/120:i.detail?i.detail/3:0,this.zoom(t*o))},dragstart:function(t){var i,a,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(u),h.test(i)){if(t.preventDefault(),a=e.Event(D),this.$element.trigger(a),a.isDefaultPrevented())return;this.directive=i,this.cropping=r,this.startX=l.pageX,this.startY=l.pageY,"crop"===i&&(this.cropping=n,this.$canvas.addClass(m))}}},dragmove:function(t){var i,a,n=t.originalEvent.touches,r=t;if(!this.disabled){if(n){if(a=n.length,a>1){if(!this.defaults.zoomable||2!==a)return;r=n[1],this.endX2=r.pageX,this.endY2=r.pageY}r=n[0]}if(this.directive){if(t.preventDefault(),i=e.Event(O),this.$element.trigger(i),i.isDefaultPrevented())return;this.endX=r.pageX,this.endY=r.pageY,this.dragging()}}},dragend:function(t){var i;if(!this.disabled&&this.directive){if(t.preventDefault(),i=e.Event(E),this.$element.trigger(i),i.isDefaultPrevented())return;this.cropping&&(this.cropping=r,this.$canvas.toggleClass(m,this.cropped&&this.defaults.modal)),this.directive=""}},dragging:function(){var e,t=this.directive,i=this.image,a=this.cropper,o=a.width,s=a.height,l=this.dragger,c=l.width,u=l.height,d=l.left,h=l.top,p=d+c,f=h+u,m=n,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=r;break}c+=b.x,y&&(u=c/y,h-=b.Y/2),0>c&&(t="w",c=0);break;case"n":if(b.y<=0&&(0>=h||y&&(0>=d||p>=o))){m=r;break}u-=b.y,h+=b.y,y&&(c=u*y,d+=b.X/2),0>u&&(t="s",u=0);break;case"w":if(b.x<=0&&(0>=d||y&&(0>=h||f>=s))){m=r;break}c-=b.x,d+=b.x,y&&(u=c/y,h+=b.Y/2),0>c&&(t="e",c=0);break;case"s":if(b.y>=0&&(f>=s||y&&(0>=d||p>=o))){m=r;break}u+=b.y,y&&(c=u*y,d-=b.X/2),0>u&&(t="n",u=0);break;case"ne":if(y){if(b.y<=0&&(0>=h||p>=o)){m=r;break}u-=b.y,h+=b.y,c=u*y}else b.x>=0?o>p?c+=b.x:b.y<=0&&0>=h&&(m=r):c+=b.x,b.y<=0?h>0&&(u-=b.y,h+=b.y):(u-=b.y,h+=b.y);0>u&&(t="sw",u=0,c=0);break;case"nw":if(y){if(b.y<=0&&(0>=h||0>=d)){m=r;break}u-=b.y,h+=b.y,c=u*y,d+=b.X}else b.x<=0?d>0?(c-=b.x,d+=b.x):b.y<=0&&0>=h&&(m=r):(c-=b.x,d+=b.x),b.y<=0?h>0&&(u-=b.y,h+=b.y):(u-=b.y,h+=b.y);0>u&&(t="se",u=0,c=0);break;case"sw":if(y){if(b.x<=0&&(0>=d||f>=s)){m=r;break}c-=b.x,d+=b.x,u=c/y}else b.x<=0?d>0?(c-=b.x,d+=b.x):b.y>=0&&f>=s&&(m=r):(c-=b.x,d+=b.x),b.y>=0?s>f&&(u+=b.y):u+=b.y;0>c&&(t="ne",u=0,c=0);break;case"se":if(y){if(b.x>=0&&(p>=o||f>=s)){m=r;break}c+=b.x,u=c/y}else b.x>=0?o>p?c+=b.x:b.y>=0&&f>=s&&(m=r):c+=b.x,b.y>=0?s>f&&(u+=b.y):u+=b.y;0>c&&(t="nw",u=0,c=0);break;case"move":i.left+=b.x,i.top+=b.y,this.renderImage("move"),m=r;break;case"zoom":v.zoomable&&(this.zoom(function(e,t,i,a,n,r){return(R(n*n+r*r)-R(i*i+a*a))/R(e*e+t*t)}(i.width,i.height,L(this.startX-this.startX2),L(this.startY-this.startY2),L(this.endX-this.endX2),L(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,c=l.minWidth,u=l.minHeight,b.x>0?b.y>0?t="se":(t="ne",h-=u):b.y>0?(t="sw",d-=c):(t="nw",d-=c,h-=u),this.cropped||(this.cropped=n,this.$dragger.removeClass(g)))}m&&(l.width=c,l.height=u,l.left=d,l.top=h,this.directive=t,this.renderDragger()),this.startX=this.endX,this.startY=this.endY}},P.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"),P.DEFAULTS={aspectRatio:"auto",autoCropArea:.8,data:{},done:e.noop,preview:"",multiple:r,autoCrop:n,dragCrop:n,dashed:n,modal:n,movable:n,resizable:n,zoomable:n,rotatable:n,checkImageOrigin:n,minWidth:0,minHeight:0,maxWidth:l,maxHeight:l,build:o,built:o,dragstart:o,dragmove:o,dragend:o},P.setDefaults=function(t){e.extend(P.DEFAULTS,t)},P.other=e.fn.cropper,e.fn.cropper=function(t){var i,a=I(arguments,1);return this.each(function(){var n,r=e(this),o=r.data("cropper");o||r.data("cropper",o=new P(this,t)),"string"==typeof t&&e.isFunction(n=o[t])&&(i=n.apply(o,a))}),typeof i!==c?i:this},e.fn.cropper.Constructor=P,e.fn.cropper.setDefaults=P.setDefaults,e.fn.cropper.noConflict=function(){return e.fn.cropper=P.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 a(t,i){this.$element=e(t),this.options=i,this.enabled=!0,this.fixTitle()}a.prototype={show:function(){var i=this.getTitle();if(i&&this.enabled){var a=this.tip();a.find(".tipsy-inner")[this.options.html?"html":"text"](i),a[0].className="tipsy",a.remove().css({top:0,left:0,visibility:"hidden",display:"block"}).prependTo(document.body);var n,r=e.extend({},this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight}),o=a[0].offsetWidth,s=a[0].offsetHeight,l=t(this.options.gravity,this.$element[0]);switch(l.charAt(0)){case"n":n={top:r.top+r.height+this.options.offset,left:r.left+r.width/2-o/2};break;case"s":n={top:r.top-s-this.options.offset,left:r.left+r.width/2-o/2};break;case"e":n={top:r.top+r.height/2-s/2,left:r.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()),n={top:r.top+r.height/2-s/2-extra_gap,left:r.left+r.width+this.options.offset}}2==l.length&&("w"==l.charAt(1)?n.left=r.left+r.width/2-15:n.left=r.left+r.width/2-o+15),a.css(n).addClass("tipsy-"+l),a.find(".tipsy-arrow")[0].className="tipsy-arrow tipsy-arrow-"+l.charAt(0),this.options.className&&a.addClass(t(this.options.className,this.$element[0])),this.options.fade?a.stop().css({opacity:0,display:"block",visibility:"visible"}).animate({opacity:this.options.opacity}):a.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 n=e.data(i,"tipsy");return n||(n=new a(i,e.fn.tipsy.elementOptions(i,t)),e.data(i,"tipsy",n)),n}function n(){var e=i(this);e.hoverState="in",0==t.delayIn?e.show():(e.fixTitle(),setTimeout(function(){"in"==e.hoverState&&e.show()},t.delayIn))}function r(){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,n).on(l,this.selector,r):this.bind(s,n).bind(l,r)}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 a={ns:i[0],ew:i.length>1?i[1]:!1},n=e(document).scrollTop()+t,r=e(document).scrollLeft()+t,o=e(this);return o.offset().top<n&&(a.ns="n"),o.offset().left<r&&(a.ew="w"),e(window).width()+e(document).scrollLeft()-o.offset().left<t&&(a.ew="e"),e(window).height()+e(document).scrollTop()-o.offset().top<t&&(a.ns="s"),a.ns+(a.ew?a.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(){responsive_Modal(),jQuery("img.cropper-hidden").cropper("destroy"),um_responsive(),um_modal_responsive()}),jQuery(document).ready(function(){jQuery(document).on("input",".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"),a=elem.attr("data-date_max"),i=i.length?new Date(i.split(",")):null,a=a.length?new Date(a.split(",")):null;elem.pickadate({selectYears:t,min:i,max:a,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").select2({allowClear:!0,minimumResultsForSearch:10}),jQuery(".um-s2").select2({allowClear:!1,minimumResultsForSearch:10}),jQuery(".um-s1,.um-s2").css({display:"block"}),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"),a=jQuery(this).data("hook"),n=jQuery(this).parents(".um").find(".um-ajax-items");return jQuery.ajax({url:um_scripts.ajaxurl,type:"post",data:{action:"ultimatemember_ajax_paginate",hook:a,args:i},complete:function(){t.removeClass("loading")},success:function(e){t.remove(),n.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"),a=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:a},success:function(e){}}),!1})}),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"),a=jQuery(this).attr("data-tab");return window.history.pushState("","",i),jQuery(".um-account-tab").hide(),jQuery(".um-account-tab[data-tab="+a+"]").fadeIn(),jQuery(".um-account-nav a").removeClass("current"),jQuery(".um-account-nav a[data-tab="+a+"]").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"),a=jQuery(this);return jQuery(".um-account-tab").hide(),a.hasClass("current")?(i.next(".um-account-tab").slideUp(),a.removeClass("current")):(i.next(".um-account-tab").slideDown(),a.parents("div").find("a").removeClass("current"),a.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-members.php CHANGED
@@ -122,6 +122,10 @@
122
  global $ultimatemember;
123
  extract( $args );
124
 
 
 
 
 
125
  if ( um_members('total_pages') > 1 ) { // needs pagination
126
 
127
  ?>
122
  global $ultimatemember;
123
  extract( $args );
124
 
125
+
126
+ if ( isset( $args['search'] ) && $args['search'] == 1 && isset( $args['must_search'] ) && $args['must_search'] == 1 && !isset( $_REQUEST['um_search'] ) )
127
+ return;
128
+
129
  if ( um_members('total_pages') > 1 ) { // needs pagination
130
 
131
  ?>
core/um-filters-profile.php CHANGED
@@ -17,7 +17,7 @@
17
  /***
18
  *** @dynamic profile page title
19
  ***/
20
- add_filter('wp_title', 'um_dynamic_user_profile_pagetitle', 10, 2 );
21
  add_filter('pre_get_document_title', 'um_dynamic_user_profile_pagetitle', 100000, 2 );
22
  function um_dynamic_user_profile_pagetitle( $title, $sep = '' ) {
23
  global $paged, $page, $ultimatemember;
17
  /***
18
  *** @dynamic profile page title
19
  ***/
20
+ add_filter('wp_title', 'um_dynamic_user_profile_pagetitle', 100000, 2 );
21
  add_filter('pre_get_document_title', 'um_dynamic_user_profile_pagetitle', 100000, 2 );
22
  function um_dynamic_user_profile_pagetitle( $title, $sep = '' ) {
23
  global $paged, $page, $ultimatemember;
core/um-form.php CHANGED
@@ -62,6 +62,7 @@ class UM_Form {
62
  $http_post = 'POST';
63
  }
64
 
 
65
  if ( $http_post && !is_admin() && isset( $_POST['form_id'] ) && is_numeric($_POST['form_id']) ) {
66
 
67
  $this->form_id = $_POST['form_id'];
@@ -75,19 +76,20 @@ class UM_Form {
75
  $this->post_form = $this->beautify( $this->post_form );
76
 
77
  $this->form_data = $ultimatemember->query->post_data( $this->form_id );
78
-
79
  $this->post_form['submitted'] = $this->post_form;
80
 
81
  $this->post_form = array_merge( $this->form_data, $this->post_form );
82
-
83
- if ( isset( $this->form_data['role'] ) && ( (boolean) $this->form_data['role'] ) && isset( $_POST['role'] ) && $_POST['role'] != $this->form_data['role'] ) {
 
 
84
  wp_die( __( 'This is not possible for security reasons.','ultimatemember') );
85
  } else {
86
  if ( isset( $this->form_data['custom_fields'] ) && strstr( $this->form_data['custom_fields'], 'role_' ) ) {
87
  // In this case, admin allowed users to choose a role during registration
88
  } else {
89
  if ( isset( $_POST['role'] ) ) {
90
- $role = um_get_option('default_role');
91
  if ( $role != $_POST['role'] ) {
92
  wp_die( __( 'This is not possible for security reasons.','ultimatemember') );
93
  }
@@ -166,4 +168,12 @@ class UM_Form {
166
  return $output;
167
  }
168
 
 
 
 
 
 
 
 
 
169
  }
62
  $http_post = 'POST';
63
  }
64
 
65
+
66
  if ( $http_post && !is_admin() && isset( $_POST['form_id'] ) && is_numeric($_POST['form_id']) ) {
67
 
68
  $this->form_id = $_POST['form_id'];
76
  $this->post_form = $this->beautify( $this->post_form );
77
 
78
  $this->form_data = $ultimatemember->query->post_data( $this->form_id );
79
+
80
  $this->post_form['submitted'] = $this->post_form;
81
 
82
  $this->post_form = array_merge( $this->form_data, $this->post_form );
83
+
84
+ $role = $this->assigned_role( $this->form_id );
85
+
86
+ if ( isset( $this->form_data['role'] ) && ( (boolean) $this->form_data['role'] ) && isset( $_POST['role'] ) && $_POST['role'] != $role ) {
87
  wp_die( __( 'This is not possible for security reasons.','ultimatemember') );
88
  } else {
89
  if ( isset( $this->form_data['custom_fields'] ) && strstr( $this->form_data['custom_fields'], 'role_' ) ) {
90
  // In this case, admin allowed users to choose a role during registration
91
  } else {
92
  if ( isset( $_POST['role'] ) ) {
 
93
  if ( $role != $_POST['role'] ) {
94
  wp_die( __( 'This is not possible for security reasons.','ultimatemember') );
95
  }
168
  return $output;
169
  }
170
 
171
+ function assigned_role( $post_id ){
172
+ $role = get_post_meta( $post_id, '_um_register_role', true );
173
+
174
+ if( ! $role ){
175
+ $role = um_get_option('default_role');
176
+ }
177
+ return $role;
178
+ }
179
  }
core/um-short-functions.php CHANGED
@@ -295,8 +295,7 @@ function um_user_ip() {
295
  $k = __('date submitted','ultimatemember');
296
  $v = date("d M Y H:i", $v);
297
  }
298
- $v = urlencode( $v );
299
-
300
  if ( $style ) {
301
  if ( !$v ) $v = __('(empty)','ultimatemember');
302
  $output .= "<p><label>$k</label><span>$v</span></p>";
295
  $k = __('date submitted','ultimatemember');
296
  $v = date("d M Y H:i", $v);
297
  }
298
+
 
299
  if ( $style ) {
300
  if ( !$v ) $v = __('(empty)','ultimatemember');
301
  $output .= "<p><label>$k</label><span>$v</span></p>";
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.37
7
  Author: Ultimate Member
8
  Author URI: http://ultimatemember.com/
9
  */
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.38
7
  Author: Ultimate Member
8
  Author URI: http://ultimatemember.com/
9
  */
readme.txt CHANGED
@@ -7,7 +7,7 @@ Tags: access control, author, authors, author profile, comments, community, comm
7
  Requires at least: 4.1
8
  Tested up to: 4.4
9
 
10
- Stable Tag: 1.3.37
11
 
12
  License: GNU Version 2 or Any Later Version
13
 
@@ -149,6 +149,15 @@ The plugin works with popular caching plugins by automatically excluding Ultimat
149
 
150
  == Changelog ==
151
 
 
 
 
 
 
 
 
 
 
152
  = 1.3.37: February 17, 2016 =
153
 
154
  * New: Add password confirmation validation
7
  Requires at least: 4.1
8
  Tested up to: 4.4
9
 
10
+ Stable Tag: 1.3.38
11
 
12
  License: GNU Version 2 or Any Later Version
13
 
149
 
150
  == Changelog ==
151
 
152
+ = 1.3.38: February 19, 2016 =
153
+
154
+ * Tweak: remove username validation
155
+ * Tweak: update minified scripts
156
+ * Fixed: Fix email and user submitted data encoding
157
+ * Fixed: role validation on register submission
158
+ * Fixed: form role and validation
159
+ * Fixed: search form pagination visibility
160
+
161
  = 1.3.37: February 17, 2016 =
162
 
163
  * New: Add password confirmation validation