(function($){
'use strict';
if(typeof wpcf7==='undefined'||wpcf7===null){
return;
}
wpcf7=$.extend({
cached: 0,
inputs: []
}, wpcf7);
$(function(){
wpcf7.supportHtml5=(function(){
var features={};
var input=document.createElement('input');
features.placeholder='placeholder' in input;
var inputTypes=[ 'email', 'url', 'tel', 'number', 'range', 'date' ];
$.each(inputTypes, function(index, value){
input.setAttribute('type', value);
features[ value ]=input.type!=='text';
});
return features;
})();
$('div.wpcf7 > form').each(function(){
var $form=$(this);
wpcf7.initForm($form);
if(wpcf7.cached){
wpcf7.refill($form);
}});
});
wpcf7.getId=function(form){
return parseInt($('input[name="_wpcf7"]', form).val(), 10);
};
wpcf7.initForm=function(form){
var $form=$(form);
$form.submit(function(event){
if(! wpcf7.supportHtml5.placeholder){
$('[placeholder].placeheld', $form).each(function(i, n){
$(n).val('').removeClass('placeheld');
});
}
if(typeof window.FormData==='function'){
wpcf7.submit($form);
event.preventDefault();
}});
$('.wpcf7-submit', $form).after(' ');
wpcf7.toggleSubmit($form);
$form.on('click', '.wpcf7-acceptance', function(){
wpcf7.toggleSubmit($form);
});
$('.wpcf7-exclusive-checkbox', $form).on('click', 'input:checkbox', function(){
var name=$(this).attr('name');
$form.find('input:checkbox[name="' + name + '"]').not(this).prop('checked', false);
});
$('.wpcf7-list-item.has-free-text', $form).each(function(){
var $freetext=$(':input.wpcf7-free-text', this);
var $wrap=$(this).closest('.wpcf7-form-control');
if($(':checkbox, :radio', this).is(':checked')){
$freetext.prop('disabled', false);
}else{
$freetext.prop('disabled', true);
}
$wrap.on('change', ':checkbox, :radio', function(){
var $cb=$('.has-free-text', $wrap).find(':checkbox, :radio');
if($cb.is(':checked')){
$freetext.prop('disabled', false).focus();
}else{
$freetext.prop('disabled', true);
}});
});
if(! wpcf7.supportHtml5.placeholder){
$('[placeholder]', $form).each(function(){
$(this).val($(this).attr('placeholder'));
$(this).addClass('placeheld');
$(this).focus(function(){
if($(this).hasClass('placeheld')){
$(this).val('').removeClass('placeheld');
}});
$(this).blur(function(){
if(''===$(this).val()){
$(this).val($(this).attr('placeholder'));
$(this).addClass('placeheld');
}});
});
}
if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.date){
$form.find('input.wpcf7-date[type="date"]').each(function(){
$(this).datepicker({
dateFormat: 'yy-mm-dd',
minDate: new Date($(this).attr('min')),
maxDate: new Date($(this).attr('max'))
});
});
}
if(wpcf7.jqueryUi&&! wpcf7.supportHtml5.number){
$form.find('input.wpcf7-number[type="number"]').each(function(){
$(this).spinner({
min: $(this).attr('min'),
max: $(this).attr('max'),
step: $(this).attr('step')
});
});
}
$('.wpcf7-character-count', $form).each(function(){
var $count=$(this);
var name=$count.attr('data-target-name');
var down=$count.hasClass('down');
var starting=parseInt($count.attr('data-starting-value'), 10);
var maximum=parseInt($count.attr('data-maximum-value'), 10);
var minimum=parseInt($count.attr('data-minimum-value'), 10);
var updateCount=function(target){
var $target=$(target);
var length=$target.val().length;
var count=down ? starting - length:length;
$count.attr('data-current-value', count);
$count.text(count);
if(maximum&&maximum < length){
$count.addClass('too-long');
}else{
$count.removeClass('too-long');
}
if(minimum&&length < minimum){
$count.addClass('too-short');
}else{
$count.removeClass('too-short');
}};
$(':input[name="' + name + '"]', $form).each(function(){
updateCount(this);
$(this).keyup(function(){
updateCount(this);
});
});
});
$form.on('change', '.wpcf7-validates-as-url', function(){
var val=$.trim($(this).val());
if(val
&& ! val.match(/^[a-z][a-z0-9.+-]*:/i)
&& -1!==val.indexOf('.')){
val=val.replace(/^\/+/, '');
val='http://' + val;
}
$(this).val(val);
});
};
wpcf7.submit=function(form){
if(typeof window.FormData!=='function'){
return;
}
var $form=$(form);
$('.ajax-loader', $form).addClass('is-active');
wpcf7.clearResponse($form);
var formData=new FormData($form.get(0));
var detail={
id: $form.closest('div.wpcf7').attr('id'),
status: 'init',
inputs: [],
formData: formData
};
$.each($form.serializeArray(), function(i, field){
if('_wpcf7'==field.name){
detail.contactFormId=field.value;
}else if('_wpcf7_version'==field.name){
detail.pluginVersion=field.value;
}else if('_wpcf7_locale'==field.name){
detail.contactFormLocale=field.value;
}else if('_wpcf7_unit_tag'==field.name){
detail.unitTag=field.value;
}else if('_wpcf7_container_post'==field.name){
detail.containerPostId=field.value;
}else if(field.name.match(/^_wpcf7_\w+_free_text_/)){
var owner=field.name.replace(/^_wpcf7_\w+_free_text_/, '');
detail.inputs.push({
name: owner + '-free-text',
value: field.value
});
}else if(field.name.match(/^_/)){
}else{
detail.inputs.push(field);
}});
wpcf7.triggerEvent($form.closest('div.wpcf7'), 'beforesubmit', detail);
var ajaxSuccess=function(data, status, xhr, $form){
detail.id=$(data.into).attr('id');
detail.status=data.status;
detail.apiResponse=data;
var $message=$('.wpcf7-response-output', $form);
switch(data.status){
case 'validation_failed':
$.each(data.invalidFields, function(i, n){
$(n.into, $form).each(function(){
wpcf7.notValidTip(this, n.message);
$('.wpcf7-form-control', this).addClass('wpcf7-not-valid');
$('[aria-invalid]', this).attr('aria-invalid', 'true');
});
});
$message.addClass('wpcf7-validation-errors');
$form.addClass('invalid');
wpcf7.triggerEvent(data.into, 'invalid', detail);
break;
case 'acceptance_missing':
$message.addClass('wpcf7-acceptance-missing');
$form.addClass('unaccepted');
wpcf7.triggerEvent(data.into, 'unaccepted', detail);
break;
case 'spam':
$message.addClass('wpcf7-spam-blocked');
$form.addClass('spam');
$('[name="g-recaptcha-response"]', $form).each(function(){
if(''===$(this).val()){
var $recaptcha=$(this).closest('.wpcf7-form-control-wrap');
wpcf7.notValidTip($recaptcha, wpcf7.recaptcha.messages.empty);
}});
wpcf7.triggerEvent(data.into, 'spam', detail);
break;
case 'aborted':
$message.addClass('wpcf7-aborted');
$form.addClass('aborted');
wpcf7.triggerEvent(data.into, 'aborted', detail);
break;
case 'mail_sent':
$message.addClass('wpcf7-mail-sent-ok');
$form.addClass('sent');
wpcf7.triggerEvent(data.into, 'mailsent', detail);
break;
case 'mail_failed':
$message.addClass('wpcf7-mail-sent-ng');
$form.addClass('failed');
wpcf7.triggerEvent(data.into, 'mailfailed', detail);
break;
default:
var customStatusClass='custom-'
+ data.status.replace(/[^0-9a-z]+/i, '-');
$message.addClass('wpcf7-' + customStatusClass);
$form.addClass(customStatusClass);
}
wpcf7.refill($form, data);
wpcf7.triggerEvent(data.into, 'submit', detail);
if('mail_sent'==data.status){
$form.each(function(){
this.reset();
});
wpcf7.toggleSubmit($form);
}
if(! wpcf7.supportHtml5.placeholder){
$form.find('[placeholder].placeheld').each(function(i, n){
$(n).val($(n).attr('placeholder'));
});
}
$message.html('').append(data.message).slideDown('fast');
$message.attr('role', 'alert');
$('.screen-reader-response', $form.closest('.wpcf7')).each(function(){
var $response=$(this);
$response.html('').attr('role', '').append(data.message);
if(data.invalidFields){
var $invalids=$('
');
this.$element.append(this.$stage.parent());
this.replace(this.$element.children().not(this.$stage.parent()));
this._width=this.$element.width();
this.refresh();
this.$element.removeClass('owl-loading').addClass('owl-loaded');
this.eventsCall();
this.internalEvents();
this.addTriggerableEvents();
this.trigger('initialized');
};
Owl.prototype.setup=function(){
var viewport=this.viewport(),
overwrites=this.options.responsive,
match=-1,
settings=null;
if(!overwrites){
settings=$.extend({}, this.options);
}else{
$.each(overwrites, function(breakpoint){
if(breakpoint <=viewport&&breakpoint > match){
match=Number(breakpoint);
}});
settings=$.extend({}, this.options, overwrites[match]);
delete settings.responsive;
if(settings.responsiveClass){
this.$element.attr('class', function(i, c){
return c.replace(/\b owl-responsive-\S+/g, '');
}).addClass('owl-responsive-' + match);
}}
if(this.settings===null||this._breakpoint!==match){
this.trigger('change', { property: { name: 'settings', value: settings }});
this._breakpoint=match;
this.settings=settings;
this.invalidate('settings');
this.trigger('changed', { property: { name: 'settings', value: this.settings }});
}};
Owl.prototype.optionsLogic=function(){
this.$element.toggleClass('owl-center', this.settings.center);
if(this.settings.loop&&this._items.length < this.settings.items){
this.settings.loop=false;
}
if(this.settings.autoWidth){
this.settings.stagePadding=false;
this.settings.merge=false;
}};
Owl.prototype.prepare=function(item){
var event=this.trigger('prepare', { content: item });
if(!event.data){
event.data=$('<' + this.settings.itemElement + '/>')
.addClass(this.settings.itemClass).append(item)
}
this.trigger('prepared', { content: event.data });
return event.data;
};
Owl.prototype.update=function(){
var i=0,
n=this._pipe.length,
filter=$.proxy(function(p){ return this[p] }, this._invalidated),
cache={};
while (i < n){
if(this._invalidated.all||$.grep(this._pipe[i].filter, filter).length > 0){
this._pipe[i].run(cache);
}
i++;
}
this._invalidated={};};
Owl.prototype.width=function(dimension){
dimension=dimension||Owl.Width.Default;
switch (dimension){
case Owl.Width.Inner:
case Owl.Width.Outer:
return this._width;
default:
return this._width - this.settings.stagePadding * 2 + this.settings.margin;
}};
Owl.prototype.refresh=function(){
if(this._items.length===0){
return false;
}
var start=new Date().getTime();
this.trigger('refresh');
this.setup();
this.optionsLogic();
this.$stage.addClass('owl-refresh');
this.update();
this.$stage.removeClass('owl-refresh');
this.state.orientation=window.orientation;
this.watchVisibility();
this.trigger('refreshed');
};
Owl.prototype.eventsCall=function(){
this.e._onDragStart=$.proxy(function(e){
this.onDragStart(e);
}, this);
this.e._onDragMove=$.proxy(function(e){
this.onDragMove(e);
}, this);
this.e._onDragEnd=$.proxy(function(e){
this.onDragEnd(e);
}, this);
this.e._onResize=$.proxy(function(e){
this.onResize(e);
}, this);
this.e._transitionEnd=$.proxy(function(e){
this.transitionEnd(e);
}, this);
this.e._preventClick=$.proxy(function(e){
this.preventClick(e);
}, this);
};
Owl.prototype.onThrottledResize=function(){
window.clearTimeout(this.resizeTimer);
this.resizeTimer=window.setTimeout(this.e._onResize, this.settings.responsiveRefreshRate);
};
Owl.prototype.onResize=function(){
if(!this._items.length){
return false;
}
if(this._width===this.$element.width()){
return false;
}
if(this.trigger('resize').isDefaultPrevented()){
return false;
}
this._width=this.$element.width();
this.invalidate('width');
this.refresh();
this.trigger('resized');
};
Owl.prototype.eventsRouter=function(event){
var type=event.type;
if(type==="mousedown"||type==="touchstart"){
this.onDragStart(event);
}else if(type==="mousemove"||type==="touchmove"){
this.onDragMove(event);
}else if(type==="mouseup"||type==="touchend"){
this.onDragEnd(event);
}else if(type==="touchcancel"){
this.onDragEnd(event);
}};
Owl.prototype.internalEvents=function(){
var isTouch=isTouchSupport(),
isTouchIE=isTouchSupportIE();
if(this.settings.mouseDrag){
this.$stage.on('mousedown', $.proxy(function(event){ this.eventsRouter(event) }, this));
this.$stage.on('dragstart', function(){ return false });
this.$stage.get(0).onselectstart=function(){ return false };}else{
this.$element.addClass('owl-text-select-on');
}
if(this.settings.touchDrag&&!isTouchIE){
this.$stage.on('touchstart touchcancel', $.proxy(function(event){ this.eventsRouter(event) }, this));
}
if(this.transitionEndVendor){
this.on(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd, false);
}
if(this.settings.responsive!==false){
this.on(window, 'resize', $.proxy(this.onThrottledResize, this));
}};
Owl.prototype.onDragStart=function(event){
var ev, isTouchEvent, pageX, pageY, animatedPos;
ev=event.originalEvent||event||window.event;
if(ev.which===3||this.state.isTouch){
return false;
}
if(ev.type==='mousedown'){
this.$stage.addClass('owl-grab');
}
this.trigger('drag');
this.drag.startTime=new Date().getTime();
this.speed(0);
this.state.isTouch=true;
this.state.isScrolling=false;
this.state.isSwiping=false;
this.drag.distance=0;
pageX=getTouches(ev).x;
pageY=getTouches(ev).y;
this.drag.offsetX=this.$stage.position().left;
this.drag.offsetY=this.$stage.position().top;
if(this.settings.rtl){
this.drag.offsetX=this.$stage.position().left + this.$stage.width() - this.width()
+ this.settings.margin;
}
if(this.state.inMotion&&this.support3d){
animatedPos=this.getTransformProperty();
this.drag.offsetX=animatedPos;
this.animate(animatedPos);
this.state.inMotion=true;
}else if(this.state.inMotion&&!this.support3d){
this.state.inMotion=false;
return false;
}
this.drag.startX=pageX - this.drag.offsetX;
this.drag.startY=pageY - this.drag.offsetY;
this.drag.start=pageX - this.drag.startX;
this.drag.targetEl=ev.target||ev.srcElement;
this.drag.updatedX=this.drag.start;
if(this.drag.targetEl.tagName==="IMG"||this.drag.targetEl.tagName==="A"){
this.drag.targetEl.draggable=false;
}
$(document).on('mousemove.owl.dragEvents mouseup.owl.dragEvents touchmove.owl.dragEvents touchend.owl.dragEvents', $.proxy(function(event){this.eventsRouter(event)},this));
};
Owl.prototype.onDragMove=function(event){
var ev, isTouchEvent, pageX, pageY, minValue, maxValue, pull;
if(!this.state.isTouch){
return;
}
if(this.state.isScrolling){
return;
}
ev=event.originalEvent||event||window.event;
pageX=getTouches(ev).x;
pageY=getTouches(ev).y;
this.drag.currentX=pageX - this.drag.startX;
this.drag.currentY=pageY - this.drag.startY;
this.drag.distance=this.drag.currentX - this.drag.offsetX;
if(this.drag.distance < 0){
this.state.direction=this.settings.rtl ? 'right':'left';
}else if(this.drag.distance > 0){
this.state.direction=this.settings.rtl ? 'left':'right';
}
if(this.settings.loop){
if(this.op(this.drag.currentX, '>', this.coordinates(this.minimum()))&&this.state.direction==='right'){
this.drag.currentX -=(this.settings.center&&this.coordinates(0)) - this.coordinates(this._items.length);
}else if(this.op(this.drag.currentX, '<', this.coordinates(this.maximum()))&&this.state.direction==='left'){
this.drag.currentX +=(this.settings.center&&this.coordinates(0)) - this.coordinates(this._items.length);
}}else{
minValue=this.settings.rtl ? this.coordinates(this.maximum()):this.coordinates(this.minimum());
maxValue=this.settings.rtl ? this.coordinates(this.minimum()):this.coordinates(this.maximum());
pull=this.settings.pullDrag ? this.drag.distance / 5:0;
this.drag.currentX=Math.max(Math.min(this.drag.currentX, minValue + pull), maxValue + pull);
}
if((this.drag.distance > 8||this.drag.distance < -8)){
if(ev.preventDefault!==undefined){
ev.preventDefault();
}else{
ev.returnValue=false;
}
this.state.isSwiping=true;
}
this.drag.updatedX=this.drag.currentX;
if((this.drag.currentY > 16||this.drag.currentY < -16)&&this.state.isSwiping===false){
this.state.isScrolling=true;
this.drag.updatedX=this.drag.start;
}
this.animate(this.drag.updatedX);
};
Owl.prototype.onDragEnd=function(event){
var compareTimes, distanceAbs, closest;
if(!this.state.isTouch){
return;
}
if(event.type==='mouseup'){
this.$stage.removeClass('owl-grab');
}
this.trigger('dragged');
this.drag.targetEl.removeAttribute("draggable");
this.state.isTouch=false;
this.state.isScrolling=false;
this.state.isSwiping=false;
if(this.drag.distance===0&&this.state.inMotion!==true){
this.state.inMotion=false;
return false;
}
this.drag.endTime=new Date().getTime();
compareTimes=this.drag.endTime - this.drag.startTime;
distanceAbs=Math.abs(this.drag.distance);
if(distanceAbs > 3||compareTimes > 300){
this.removeClick(this.drag.targetEl);
}
closest=this.closest(this.drag.updatedX);
this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed);
this.current(closest);
this.invalidate('position');
this.update();
if(!this.settings.pullDrag&&this.drag.updatedX===this.coordinates(closest)){
this.transitionEnd();
}
this.drag.distance=0;
$(document).off('.owl.dragEvents');
};
Owl.prototype.removeClick=function(target){
this.drag.targetEl=target;
$(target).on('click.preventClick', this.e._preventClick);
window.setTimeout(function(){
$(target).off('click.preventClick');
}, 300);
};
Owl.prototype.preventClick=function(ev){
if(ev.preventDefault){
ev.preventDefault();
}else{
ev.returnValue=false;
}
if(ev.stopPropagation){
ev.stopPropagation();
}
$(ev.target).off('click.preventClick');
};
Owl.prototype.getTransformProperty=function(){
var transform, matrix3d;
transform=window.getComputedStyle(this.$stage.get(0), null).getPropertyValue(this.vendorName + 'transform');
transform=transform.replace(/matrix(3d)?\(|\)/g, '').split(',');
matrix3d=transform.length===16;
return matrix3d!==true ? transform[4]:transform[12];
};
Owl.prototype.closest=function(coordinate){
var position=-1, pull=30, width=this.width(), coordinates=this.coordinates();
if(!this.settings.freeDrag){
$.each(coordinates, $.proxy(function(index, value){
if(coordinate > value - pull&&coordinate < value + pull){
position=index;
}else if(this.op(coordinate, '<', value)
&& this.op(coordinate, '>', coordinates[index + 1]||value - width)){
position=this.state.direction==='left' ? index + 1:index;
}
return position===-1;
}, this));
}
if(!this.settings.loop){
if(this.op(coordinate, '>', coordinates[this.minimum()])){
position=coordinate=this.minimum();
}else if(this.op(coordinate, '<', coordinates[this.maximum()])){
position=coordinate=this.maximum();
}}
return position;
};
Owl.prototype.animate=function(coordinate){
this.trigger('translate');
this.state.inMotion=this.speed() > 0;
if(this.support3d){
this.$stage.css({
transform: 'translate3d(' + coordinate + 'px' + ',0px, 0px)',
transition: (this.speed() / 1000) + 's'
});
}else if(this.state.isTouch){
this.$stage.css({
left: coordinate + 'px'
});
}else{
this.$stage.animate({
left: coordinate
}, this.speed() / 1000, this.settings.fallbackEasing, $.proxy(function(){
if(this.state.inMotion){
this.transitionEnd();
}}, this));
}};
Owl.prototype.current=function(position){
if(position===undefined){
return this._current;
}
if(this._items.length===0){
return undefined;
}
position=this.normalize(position);
if(this._current!==position){
var event=this.trigger('change', { property: { name: 'position', value: position }});
if(event.data!==undefined){
position=this.normalize(event.data);
}
this._current=position;
this.invalidate('position');
this.trigger('changed', { property: { name: 'position', value: this._current }});
}
return this._current;
};
Owl.prototype.invalidate=function(part){
this._invalidated[part]=true;
}
Owl.prototype.reset=function(position){
position=this.normalize(position);
if(position===undefined){
return;
}
this._speed=0;
this._current=position;
this.suppress([ 'translate', 'translated' ]);
this.animate(this.coordinates(position));
this.release([ 'translate', 'translated' ]);
};
Owl.prototype.normalize=function(position, relative){
var n=(relative ? this._items.length:this._items.length + this._clones.length);
if(!$.isNumeric(position)||n < 1){
return undefined;
}
if(this._clones.length){
position=((position % n) + n) % n;
}else{
position=Math.max(this.minimum(relative), Math.min(this.maximum(relative), position));
}
return position;
};
Owl.prototype.relative=function(position){
position=this.normalize(position);
position=position - this._clones.length / 2;
return this.normalize(position, true);
};
Owl.prototype.maximum=function(relative){
var maximum, width, i=0, coordinate,
settings=this.settings;
if(relative){
return this._items.length - 1;
}
if(!settings.loop&&settings.center){
maximum=this._items.length - 1;
}else if(!settings.loop&&!settings.center){
maximum=this._items.length - settings.items;
}else if(settings.loop||settings.center){
maximum=this._items.length + settings.items;
}else if(settings.autoWidth||settings.merge){
revert=settings.rtl ? 1:-1;
width=this.$stage.width() - this.$element.width();
while (coordinate=this.coordinates(i)){
if(coordinate * revert >=width){
break;
}
maximum=++i;
}}else{
throw 'Can not detect maximum absolute position.'
}
return maximum;
};
Owl.prototype.minimum=function(relative){
if(relative){
return 0;
}
return this._clones.length / 2;
};
Owl.prototype.items=function(position){
if(position===undefined){
return this._items.slice();
}
position=this.normalize(position, true);
return this._items[position];
};
Owl.prototype.mergers=function(position){
if(position===undefined){
return this._mergers.slice();
}
position=this.normalize(position, true);
return this._mergers[position];
};
Owl.prototype.clones=function(position){
var odd=this._clones.length / 2,
even=odd + this._items.length,
map=function(index){ return index % 2===0 ? even + index / 2:odd - (index + 1) / 2 };
if(position===undefined){
return $.map(this._clones, function(v, i){ return map(i) });
}
return $.map(this._clones, function(v, i){ return v===position ? map(i):null });
};
Owl.prototype.speed=function(speed){
if(speed!==undefined){
this._speed=speed;
}
return this._speed;
};
Owl.prototype.coordinates=function(position){
var coordinate=null;
if(position===undefined){
return $.map(this._coordinates, $.proxy(function(coordinate, index){
return this.coordinates(index);
}, this));
}
if(this.settings.center){
coordinate=this._coordinates[position];
coordinate +=(this.width() - coordinate + (this._coordinates[position - 1]||0)) / 2 * (this.settings.rtl ? -1:1);
}else{
coordinate=this._coordinates[position - 1]||0;
}
return coordinate;
};
Owl.prototype.duration=function(from, to, factor){
return Math.min(Math.max(Math.abs(to - from), 1), 6) * Math.abs((factor||this.settings.smartSpeed));
};
Owl.prototype.to=function(position, speed){
if(this.settings.loop){
var distance=position - this.relative(this.current()),
revert=this.current(),
before=this.current(),
after=this.current() + distance,
direction=before - after < 0 ? true:false,
items=this._clones.length + this._items.length;
if(after < this.settings.items&&direction===false){
revert=before + this._items.length;
this.reset(revert);
}else if(after >=items - this.settings.items&&direction===true){
revert=before - this._items.length;
this.reset(revert);
}
window.clearTimeout(this.e._goToLoop);
this.e._goToLoop=window.setTimeout($.proxy(function(){
this.speed(this.duration(this.current(), revert + distance, speed));
this.current(revert + distance);
this.update();
}, this), 30);
}else{
this.speed(this.duration(this.current(), position, speed));
this.current(position);
this.update();
}};
Owl.prototype.next=function(speed){
speed=speed||false;
this.to(this.relative(this.current()) + 1, speed);
};
Owl.prototype.prev=function(speed){
speed=speed||false;
this.to(this.relative(this.current()) - 1, speed);
};
Owl.prototype.transitionEnd=function(event){
if(event!==undefined){
event.stopPropagation();
if((event.target||event.srcElement||event.originalTarget)!==this.$stage.get(0)){
return false;
}}
this.state.inMotion=false;
this.trigger('translated');
};
Owl.prototype.viewport=function(){
var width;
if(this.options.responsiveBaseElement!==window){
width=$(this.options.responsiveBaseElement).width();
}else if(window.innerWidth){
width=window.innerWidth;
}else if(document.documentElement&&document.documentElement.clientWidth){
width=document.documentElement.clientWidth;
}else{
throw 'Can not detect viewport width.';
}
return width;
};
Owl.prototype.replace=function(content){
this.$stage.empty();
this._items=[];
if(content){
content=(content instanceof jQuery) ? content:$(content);
}
if(this.settings.nestedItemSelector){
content=content.find('.' + this.settings.nestedItemSelector);
}
content.filter(function(){
return this.nodeType===1;
}).each($.proxy(function(index, item){
item=this.prepare(item);
this.$stage.append(item);
this._items.push(item);
this._mergers.push(item.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1||1);
}, this));
this.reset($.isNumeric(this.settings.startPosition) ? this.settings.startPosition:0);
this.invalidate('items');
};
Owl.prototype.add=function(content, position){
position=position===undefined ? this._items.length:this.normalize(position, true);
this.trigger('add', { content: content, position: position });
if(this._items.length===0||position===this._items.length){
this.$stage.append(content);
this._items.push(content);
this._mergers.push(content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1||1);
}else{
this._items[position].before(content);
this._items.splice(position, 0, content);
this._mergers.splice(position, 0, content.find('[data-merge]').andSelf('[data-merge]').attr('data-merge') * 1||1);
}
this.invalidate('items');
this.trigger('added', { content: content, position: position });
};
Owl.prototype.remove=function(position){
position=this.normalize(position, true);
if(position===undefined){
return;
}
this.trigger('remove', { content: this._items[position], position: position });
this._items[position].remove();
this._items.splice(position, 1);
this._mergers.splice(position, 1);
this.invalidate('items');
this.trigger('removed', { content: null, position: position });
};
Owl.prototype.addTriggerableEvents=function(){
var handler=$.proxy(function(callback, event){
return $.proxy(function(e){
if(e.relatedTarget!==this){
this.suppress([ event ]);
callback.apply(this, [].slice.call(arguments, 1));
this.release([ event ]);
}}, this);
}, this);
$.each({
'next': this.next,
'prev': this.prev,
'to': this.to,
'destroy': this.destroy,
'refresh': this.refresh,
'replace': this.replace,
'add': this.add,
'remove': this.remove
}, $.proxy(function(event, callback){
this.$element.on(event + '.owl.carousel', handler(callback, event + '.owl.carousel'));
}, this));
};
Owl.prototype.watchVisibility=function(){
if(!isElVisible(this.$element.get(0))){
this.$element.addClass('owl-hidden');
window.clearInterval(this.e._checkVisibile);
this.e._checkVisibile=window.setInterval($.proxy(checkVisible, this), 500);
}
function isElVisible(el){
return el.offsetWidth > 0&&el.offsetHeight > 0;
}
function checkVisible(){
if(isElVisible(this.$element.get(0))){
this.$element.removeClass('owl-hidden');
this.refresh();
window.clearInterval(this.e._checkVisibile);
}}
};
Owl.prototype.preloadAutoWidthImages=function(imgs){
var loaded, that, $el, img;
loaded=0;
that=this;
imgs.each(function(i, el){
$el=$(el);
img=new Image();
img.onload=function(){
loaded++;
$el.attr('src', img.src);
$el.css('opacity', 1);
if(loaded >=imgs.length){
that.state.imagesLoaded=true;
that.initialize();
}};
img.src=$el.attr('src')||$el.attr('data-src')||$el.attr('data-src-retina');
});
};
Owl.prototype.destroy=function(){
if(this.$element.hasClass(this.settings.themeClass)){
this.$element.removeClass(this.settings.themeClass);
}
if(this.settings.responsive!==false){
$(window).off('resize.owl.carousel');
}
if(this.transitionEndVendor){
this.off(this.$stage.get(0), this.transitionEndVendor, this.e._transitionEnd);
}
for(var i in this._plugins){
this._plugins[i].destroy();
}
if(this.settings.mouseDrag||this.settings.touchDrag){
this.$stage.off('mousedown touchstart touchcancel');
$(document).off('.owl.dragEvents');
this.$stage.get(0).onselectstart=function(){};
this.$stage.off('dragstart', function(){ return false });
}
this.$element.off('.owl');
this.$stage.children('.cloned').remove();
this.e=null;
this.$element.removeData('owlCarousel');
this.$stage.children().contents().unwrap();
this.$stage.children().unwrap();
this.$stage.unwrap();
};
Owl.prototype.op=function(a, o, b){
var rtl=this.settings.rtl;
switch (o){
case '<':
return rtl ? a > b:a < b;
case '>':
return rtl ? a < b:a > b;
case '>=':
return rtl ? a <=b:a >=b;
case '<=':
return rtl ? a >=b:a <=b;
default:
break;
}};
Owl.prototype.on=function(element, event, listener, capture){
if(element.addEventListener){
element.addEventListener(event, listener, capture);
}else if(element.attachEvent){
element.attachEvent('on' + event, listener);
}};
Owl.prototype.off=function(element, event, listener, capture){
if(element.removeEventListener){
element.removeEventListener(event, listener, capture);
}else if(element.detachEvent){
element.detachEvent('on' + event, listener);
}};
Owl.prototype.trigger=function(name, data, namespace){
var status={
item: { count: this._items.length, index: this.current() }}, handler=$.camelCase($.grep([ 'on', name, namespace ], function(v){ return v })
.join('-').toLowerCase()
), event=$.Event([ name, 'owl', namespace||'carousel' ].join('.').toLowerCase(),
$.extend({ relatedTarget: this }, status, data)
);
if(!this._supress[name]){
$.each(this._plugins, function(name, plugin){
if(plugin.onTrigger){
plugin.onTrigger(event);
}});
this.$element.trigger(event);
if(this.settings&&typeof this.settings[handler]==='function'){
this.settings[handler].apply(this, event);
}}
return event;
};
Owl.prototype.suppress=function(events){
$.each(events, $.proxy(function(index, event){
this._supress[event]=true;
}, this));
}
Owl.prototype.release=function(events){
$.each(events, $.proxy(function(index, event){
delete this._supress[event];
}, this));
}
Owl.prototype.browserSupport=function(){
this.support3d=isPerspective();
if(this.support3d){
this.transformVendor=isTransform();
var endVendors=[ 'transitionend', 'webkitTransitionEnd', 'transitionend', 'oTransitionEnd' ];
this.transitionEndVendor=endVendors[isTransition()];
this.vendorName=this.transformVendor.replace(/Transform/i, '');
this.vendorName=this.vendorName!=='' ? '-' + this.vendorName.toLowerCase() + '-':'';
}
this.state.orientation=window.orientation;
};
function getTouches(event){
if(event.touches!==undefined){
return {
x: event.touches[0].pageX,
y: event.touches[0].pageY
};}
if(event.touches===undefined){
if(event.pageX!==undefined){
return {
x: event.pageX,
y: event.pageY
};}
if(event.pageX===undefined){
return {
x: event.clientX,
y: event.clientY
};}}
}
function isStyleSupported(array){
var p, s, fake=document.createElement('div'), list=array;
for (p in list){
s=list[p];
if(typeof fake.style[s]!=='undefined'){
fake=null;
return [ s, p ];
}}
return [ false ];
}
function isTransition(){
return isStyleSupported([ 'transition', 'WebkitTransition', 'MozTransition', 'OTransition' ])[1];
}
function isTransform(){
return isStyleSupported([ 'transform', 'WebkitTransform', 'MozTransform', 'OTransform', 'msTransform' ])[0];
}
function isPerspective(){
return isStyleSupported([ 'perspective', 'webkitPerspective', 'MozPerspective', 'OPerspective', 'MsPerspective' ])[0];
}
function isTouchSupport(){
return 'ontouchstart' in window||!!(navigator.msMaxTouchPoints);
}
function isTouchSupportIE(){
return window.navigator.msPointerEnabled;
}
$.fn.owlCarousel=function(options){
return this.each(function(){
if(!$(this).data('owlCarousel')){
$(this).data('owlCarousel', new Owl(this, options));
}});
};
$.fn.owlCarousel.Constructor=Owl;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var Lazy=function(carousel){
this._core=carousel;
this._loaded=[];
this._handlers={
'initialized.owl.carousel change.owl.carousel': $.proxy(function(e){
if(!e.namespace){
return;
}
if(!this._core.settings||!this._core.settings.lazyLoad){
return;
}
if((e.property&&e.property.name=='position')||e.type=='initialized'){
var settings=this._core.settings,
n=(settings.center&&Math.ceil(settings.items / 2)||settings.items),
i=((settings.center&&n * -1)||0),
position=((e.property&&e.property.value)||this._core.current()) + i,
clones=this._core.clones().length,
load=$.proxy(function(i, v){ this.load(v) }, this);
while (i++ < n){
this.load(clones / 2 + this._core.relative(position));
clones&&$.each(this._core.clones(this._core.relative(position++)), load);
}}
}, this)
};
this._core.options=$.extend({}, Lazy.Defaults, this._core.options);
this._core.$element.on(this._handlers);
}
Lazy.Defaults={
lazyLoad: false
}
Lazy.prototype.load=function(position){
var $item=this._core.$stage.children().eq(position),
$elements=$item&&$item.find('.owl-lazy');
if(!$elements||$.inArray($item.get(0), this._loaded) > -1){
return;
}
$elements.each($.proxy(function(index, element){
var $element=$(element), image,
url=(window.devicePixelRatio > 1&&$element.attr('data-src-retina'))||$element.attr('data-src');
this._core.trigger('load', { element: $element, url: url }, 'lazy');
if($element.is('img')){
$element.one('load.owl.lazy', $.proxy(function(){
$element.css('opacity', 1);
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
}, this)).attr('src', url);
}else{
image=new Image();
image.onload=$.proxy(function(){
$element.css({
'background-image': 'url(' + url + ')',
'opacity': '1'
});
this._core.trigger('loaded', { element: $element, url: url }, 'lazy');
}, this);
image.src=url;
}}, this));
this._loaded.push($item.get(0));
}
Lazy.prototype.destroy=function(){
var handler, property;
for (handler in this.handlers){
this._core.$element.off(handler, this.handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}}
$.fn.owlCarousel.Constructor.Plugins.Lazy=Lazy;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var AutoHeight=function(carousel){
this._core=carousel;
this._handlers={
'initialized.owl.carousel': $.proxy(function(){
if(this._core.settings.autoHeight){
this.update();
}}, this),
'changed.owl.carousel': $.proxy(function(e){
if(this._core.settings.autoHeight&&e.property.name=='position'){
this.update();
}}, this),
'loaded.owl.lazy': $.proxy(function(e){
if(this._core.settings.autoHeight&&e.element.closest('.' + this._core.settings.itemClass)===this._core.$stage.children().eq(this._core.current())){
this.update();
}}, this)
};
this._core.options=$.extend({}, AutoHeight.Defaults, this._core.options);
this._core.$element.on(this._handlers);
};
AutoHeight.Defaults={
autoHeight: false,
autoHeightClass: 'owl-height'
};
AutoHeight.prototype.update=function(){
this._core.$stage.parent()
.height(this._core.$stage.children().eq(this._core.current()).height())
.addClass(this._core.settings.autoHeightClass);
};
AutoHeight.prototype.destroy=function(){
var handler, property;
for (handler in this._handlers){
this._core.$element.off(handler, this._handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.AutoHeight=AutoHeight;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var Video=function(carousel){
this._core=carousel;
this._videos={};
this._playing=null;
this._fullscreen=false;
this._handlers={
'resize.owl.carousel': $.proxy(function(e){
if(this._core.settings.video&&!this.isInFullScreen()){
e.preventDefault();
}}, this),
'refresh.owl.carousel changed.owl.carousel': $.proxy(function(e){
if(this._playing){
this.stop();
}}, this),
'prepared.owl.carousel': $.proxy(function(e){
var $element=$(e.content).find('.owl-video');
if($element.length){
$element.css('display', 'none');
this.fetch($element, $(e.content));
}}, this)
};
this._core.options=$.extend({}, Video.Defaults, this._core.options);
this._core.$element.on(this._handlers);
this._core.$element.on('click.owl.video', '.owl-video-play-icon', $.proxy(function(e){
this.play(e);
}, this));
};
Video.Defaults={
video: false,
videoHeight: false,
videoWidth: false
};
Video.prototype.fetch=function(target, item){
var type=target.attr('data-vimeo-id') ? 'vimeo':'youtube',
id=target.attr('data-vimeo-id')||target.attr('data-youtube-id'),
width=target.attr('data-width')||this._core.settings.videoWidth,
height=target.attr('data-height')||this._core.settings.videoHeight,
url=target.attr('href');
if(url){
id=url.match(/(http:|https:|)\/\/(player.|www.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com))\/(video\/|embed\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/);
if(id[3].indexOf('youtu') > -1){
type='youtube';
}else if(id[3].indexOf('vimeo') > -1){
type='vimeo';
}else{
throw new Error('Video URL not supported.');
}
id=id[6];
}else{
throw new Error('Missing video URL.');
}
this._videos[url]={
type: type,
id: id,
width: width,
height: height
};
item.attr('data-video', url);
this.thumbnail(target, this._videos[url]);
};
Video.prototype.thumbnail=function(target, video){
var tnLink,
icon,
path,
dimensions=video.width&&video.height ? 'style="width:' + video.width + 'px;height:' + video.height + 'px;"':'',
customTn=target.find('img'),
srcType='src',
lazyClass='',
settings=this._core.settings,
create=function(path){
icon='
';
if(settings.lazyLoad){
tnLink='
';
}else{
tnLink='
';
}
target.after(tnLink);
target.after(icon);
};
target.wrap('
');
if(this._core.settings.lazyLoad){
srcType='data-src';
lazyClass='owl-lazy';
}
if(customTn.length){
create(customTn.attr(srcType));
customTn.remove();
return false;
}
if(video.type==='youtube'){
path="http://img.youtube.com/vi/" + video.id + "/hqdefault.jpg";
create(path);
}else if(video.type==='vimeo'){
$.ajax({
type: 'GET',
url: 'http://vimeo.com/api/v2/video/' + video.id + '.json',
jsonp: 'callback',
dataType: 'jsonp',
success: function(data){
path=data[0].thumbnail_large;
create(path);
}});
}};
Video.prototype.stop=function(){
this._core.trigger('stop', null, 'video');
this._playing.find('.owl-video-frame').remove();
this._playing.removeClass('owl-video-playing');
this._playing=null;
};
Video.prototype.play=function(ev){
this._core.trigger('play', null, 'video');
if(this._playing){
this.stop();
}
var target=$(ev.target||ev.srcElement),
item=target.closest('.' + this._core.settings.itemClass),
video=this._videos[item.attr('data-video')],
width=video.width||'100%',
height=video.height||this._core.$stage.height(),
html, wrap;
if(video.type==='youtube'){
html='
VIDEO ';
}else if(video.type==='vimeo'){
html='
';
}
item.addClass('owl-video-playing');
this._playing=item;
wrap=$('
'
+ html + '
');
target.after(wrap);
};
Video.prototype.isInFullScreen=function(){
var element=document.fullscreenElement||document.mozFullScreenElement
|| document.webkitFullscreenElement;
if(element&&$(element).parent().hasClass('owl-video-frame')){
this._core.speed(0);
this._fullscreen=true;
}
if(element&&this._fullscreen&&this._playing){
return false;
}
if(this._fullscreen){
this._fullscreen=false;
return false;
}
if(this._playing){
if(this._core.state.orientation!==window.orientation){
this._core.state.orientation=window.orientation;
return false;
}}
return true;
};
Video.prototype.destroy=function(){
var handler, property;
this._core.$element.off('click.owl.video');
for (handler in this._handlers){
this._core.$element.off(handler, this._handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.Video=Video;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var Animate=function(scope){
this.core=scope;
this.core.options=$.extend({}, Animate.Defaults, this.core.options);
this.swapping=true;
this.previous=undefined;
this.next=undefined;
this.handlers={
'change.owl.carousel': $.proxy(function(e){
if(e.property.name=='position'){
this.previous=this.core.current();
this.next=e.property.value;
}}, this),
'drag.owl.carousel dragged.owl.carousel translated.owl.carousel': $.proxy(function(e){
this.swapping=e.type=='translated';
}, this),
'translate.owl.carousel': $.proxy(function(e){
if(this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)){
this.swap();
}}, this)
};
this.core.$element.on(this.handlers);
};
Animate.Defaults={
animateOut: false,
animateIn: false
};
Animate.prototype.swap=function(){
if(this.core.settings.items!==1||!this.core.support3d){
return;
}
this.core.speed(0);
var left,
clear=$.proxy(this.clear, this),
previous=this.core.$stage.children().eq(this.previous),
next=this.core.$stage.children().eq(this.next),
incoming=this.core.settings.animateIn,
outgoing=this.core.settings.animateOut;
if(this.core.current()===this.previous){
return;
}
if(outgoing){
left=this.core.coordinates(this.previous) - this.core.coordinates(this.next);
previous.css({ 'left': left + 'px' })
.addClass('animated owl-animated-out')
.addClass(outgoing)
.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear);
}
if(incoming){
next.addClass('animated owl-animated-in')
.addClass(incoming)
.one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', clear);
}};
Animate.prototype.clear=function(e){
$(e.target).css({ 'left': '' })
.removeClass('animated owl-animated-out owl-animated-in')
.removeClass(this.core.settings.animateIn)
.removeClass(this.core.settings.animateOut);
this.core.transitionEnd();
}
Animate.prototype.destroy=function(){
var handler, property;
for (handler in this.handlers){
this.core.$element.off(handler, this.handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.Animate=Animate;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
var Autoplay=function(scope){
this.core=scope;
this.core.options=$.extend({}, Autoplay.Defaults, this.core.options);
this.handlers={
'translated.owl.carousel refreshed.owl.carousel': $.proxy(function(){
this.autoplay();
}, this),
'play.owl.autoplay': $.proxy(function(e, t, s){
this.play(t, s);
}, this),
'stop.owl.autoplay': $.proxy(function(){
this.stop();
}, this),
'mouseover.owl.autoplay': $.proxy(function(){
if(this.core.settings.autoplayHoverPause){
this.pause();
}}, this),
'mouseleave.owl.autoplay': $.proxy(function(){
if(this.core.settings.autoplayHoverPause){
this.autoplay();
}}, this)
};
this.core.$element.on(this.handlers);
};
Autoplay.Defaults={
autoplay: false,
autoplayTimeout: 5000,
autoplayHoverPause: false,
autoplaySpeed: false
};
Autoplay.prototype.autoplay=function(){
if(this.core.settings.autoplay&&!this.core.state.videoPlay){
window.clearInterval(this.interval);
this.interval=window.setInterval($.proxy(function(){
this.play();
}, this), this.core.settings.autoplayTimeout);
}else{
window.clearInterval(this.interval);
}};
Autoplay.prototype.play=function(timeout, speed){
if(document.hidden===true){
return;
}
if(this.core.state.isTouch||this.core.state.isScrolling
|| this.core.state.isSwiping||this.core.state.inMotion){
return;
}
if(this.core.settings.autoplay===false){
window.clearInterval(this.interval);
return;
}
this.core.next(this.core.settings.autoplaySpeed);
};
Autoplay.prototype.stop=function(){
window.clearInterval(this.interval);
};
Autoplay.prototype.pause=function(){
window.clearInterval(this.interval);
};
Autoplay.prototype.destroy=function(){
var handler, property;
window.clearInterval(this.interval);
for (handler in this.handlers){
this.core.$element.off(handler, this.handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}};
$.fn.owlCarousel.Constructor.Plugins.autoplay=Autoplay;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
'use strict';
var Navigation=function(carousel){
this._core=carousel;
this._initialized=false;
this._pages=[];
this._controls={};
this._templates=[];
this.$element=this._core.$element;
this._overrides={
next: this._core.next,
prev: this._core.prev,
to: this._core.to
};
this._handlers={
'prepared.owl.carousel': $.proxy(function(e){
if(this._core.settings.dotsData){
this._templates.push($(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot'));
}}, this),
'add.owl.carousel': $.proxy(function(e){
if(this._core.settings.dotsData){
this._templates.splice(e.position, 0, $(e.content).find('[data-dot]').andSelf('[data-dot]').attr('data-dot'));
}}, this),
'remove.owl.carousel prepared.owl.carousel': $.proxy(function(e){
if(this._core.settings.dotsData){
this._templates.splice(e.position, 1);
}}, this),
'change.owl.carousel': $.proxy(function(e){
if(e.property.name=='position'){
if(!this._core.state.revert&&!this._core.settings.loop&&this._core.settings.navRewind){
var current=this._core.current(),
maximum=this._core.maximum(),
minimum=this._core.minimum();
e.data=e.property.value > maximum
? current >=maximum ? minimum:maximum
: e.property.value < minimum ? maximum:e.property.value;
}}
}, this),
'changed.owl.carousel': $.proxy(function(e){
if(e.property.name=='position'){
this.draw();
}}, this),
'refreshed.owl.carousel': $.proxy(function(){
if(!this._initialized){
this.initialize();
this._initialized=true;
}
this._core.trigger('refresh', null, 'navigation');
this.update();
this.draw();
this._core.trigger('refreshed', null, 'navigation');
}, this)
};
this._core.options=$.extend({}, Navigation.Defaults, this._core.options);
this.$element.on(this._handlers);
}
Navigation.Defaults={
nav: false,
navRewind: true,
navText: [ 'prev', 'next' ],
navSpeed: false,
navElement: 'div',
navContainer: false,
navContainerClass: 'owl-nav',
navClass: [ 'owl-prev', 'owl-next' ],
slideBy: 1,
dotClass: 'owl-dot',
dotsClass: 'owl-dots',
dots: true,
dotsEach: false,
dotData: false,
dotsSpeed: false,
dotsContainer: false,
controlsClass: 'owl-controls'
}
Navigation.prototype.initialize=function(){
var $container, override,
options=this._core.settings;
if(!options.dotsData){
this._templates=[ $('
')
.addClass(options.dotClass)
.append($('
'))
.prop('outerHTML') ];
}
if(!options.navContainer||!options.dotsContainer){
this._controls.$container=$('')
.addClass(options.controlsClass)
.appendTo(this.$element);
}
this._controls.$indicators=options.dotsContainer ? $(options.dotsContainer)
: $('
').hide().addClass(options.dotsClass).appendTo(this._controls.$container);
this._controls.$indicators.on('click', 'div', $.proxy(function(e){
var index=$(e.target).parent().is(this._controls.$indicators)
? $(e.target).index():$(e.target).parent().index();
e.preventDefault();
this.to(index, options.dotsSpeed);
}, this));
$container=options.navContainer ? $(options.navContainer)
: $('
').addClass(options.navContainerClass).prependTo(this._controls.$container);
this._controls.$next=$('<' + options.navElement + '>');
this._controls.$previous=this._controls.$next.clone();
this._controls.$previous
.addClass(options.navClass[0])
.html(options.navText[0])
.hide()
.prependTo($container)
.on('click', $.proxy(function(e){
this.prev(options.navSpeed);
}, this));
this._controls.$next
.addClass(options.navClass[1])
.html(options.navText[1])
.hide()
.appendTo($container)
.on('click', $.proxy(function(e){
this.next(options.navSpeed);
}, this));
for (override in this._overrides){
this._core[override]=$.proxy(this[override], this);
}}
Navigation.prototype.destroy=function(){
var handler, control, property, override;
for (handler in this._handlers){
this.$element.off(handler, this._handlers[handler]);
}
for (control in this._controls){
this._controls[control].remove();
}
for (override in this.overides){
this._core[override]=this._overrides[override];
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}}
Navigation.prototype.update=function(){
var i, j, k,
options=this._core.settings,
lower=this._core.clones().length / 2,
upper=lower + this._core.items().length,
size=options.center||options.autoWidth||options.dotData
? 1:options.dotsEach||options.items;
if(options.slideBy!=='page'){
options.slideBy=Math.min(options.slideBy, options.items);
}
if(options.dots||options.slideBy=='page'){
this._pages=[];
for (i=lower, j=0, k=0; i < upper; i++){
if(j >=size||j===0){
this._pages.push({
start: i - lower,
end: i - lower + size - 1
});
j=0, ++k;
}
j +=this._core.mergers(this._core.relative(i));
}}
}
Navigation.prototype.draw=function(){
var difference, i, html='',
options=this._core.settings,
$items=this._core.$stage.children(),
index=this._core.relative(this._core.current());
if(options.nav&&!options.loop&&!options.navRewind){
this._controls.$previous.toggleClass('disabled', index <=0);
this._controls.$next.toggleClass('disabled', index >=this._core.maximum());
}
this._controls.$previous.toggle(options.nav);
this._controls.$next.toggle(options.nav);
if(options.dots){
difference=this._pages.length - this._controls.$indicators.children().length;
if(options.dotData&&difference!==0){
for (i=0; i < this._controls.$indicators.children().length; i++){
html +=this._templates[this._core.relative(i)];
}
this._controls.$indicators.html(html);
}else if(difference > 0){
html=new Array(difference + 1).join(this._templates[0]);
this._controls.$indicators.append(html);
}else if(difference < 0){
this._controls.$indicators.children().slice(difference).remove();
}
this._controls.$indicators.find('.active').removeClass('active');
this._controls.$indicators.children().eq($.inArray(this.current(), this._pages)).addClass('active');
}
this._controls.$indicators.toggle(options.dots);
}
Navigation.prototype.onTrigger=function(event){
var settings=this._core.settings;
event.page={
index: $.inArray(this.current(), this._pages),
count: this._pages.length,
size: settings&&(settings.center||settings.autoWidth||settings.dotData
? 1:settings.dotsEach||settings.items)
};}
Navigation.prototype.current=function(){
var index=this._core.relative(this._core.current());
return $.grep(this._pages, function(o){
return o.start <=index&&o.end >=index;
}).pop();
}
Navigation.prototype.getPosition=function(successor){
var position, length,
options=this._core.settings;
if(options.slideBy=='page'){
position=$.inArray(this.current(), this._pages);
length=this._pages.length;
successor ? ++position:--position;
position=this._pages[((position % length) + length) % length].start;
}else{
position=this._core.relative(this._core.current());
length=this._core.items().length;
successor ? position +=options.slideBy:position -=options.slideBy;
}
return position;
}
Navigation.prototype.next=function(speed){
$.proxy(this._overrides.to, this._core)(this.getPosition(true), speed);
}
Navigation.prototype.prev=function(speed){
$.proxy(this._overrides.to, this._core)(this.getPosition(false), speed);
}
Navigation.prototype.to=function(position, speed, standard){
var length;
if(!standard){
length=this._pages.length;
$.proxy(this._overrides.to, this._core)(this._pages[((position % length) + length) % length].start, speed);
}else{
$.proxy(this._overrides.to, this._core)(position, speed);
}}
$.fn.owlCarousel.Constructor.Plugins.Navigation=Navigation;
})(window.Zepto||window.jQuery, window, document);
;(function($, window, document, undefined){
'use strict';
var Hash=function(carousel){
this._core=carousel;
this._hashes={};
this.$element=this._core.$element;
this._handlers={
'initialized.owl.carousel': $.proxy(function(){
if(this._core.settings.startPosition=='URLHash'){
$(window).trigger('hashchange.owl.navigation');
}}, this),
'prepared.owl.carousel': $.proxy(function(e){
var hash=$(e.content).find('[data-hash]').andSelf('[data-hash]').attr('data-hash');
this._hashes[hash]=e.content;
}, this)
};
this._core.options=$.extend({}, Hash.Defaults, this._core.options);
this.$element.on(this._handlers);
$(window).on('hashchange.owl.navigation', $.proxy(function(){
var hash=window.location.hash.substring(1),
items=this._core.$stage.children(),
position=this._hashes[hash]&&items.index(this._hashes[hash])||0;
if(!hash){
return false;
}
this._core.to(position, false, true);
}, this));
}
Hash.Defaults={
URLhashListener: false
}
Hash.prototype.destroy=function(){
var handler, property;
$(window).off('hashchange.owl.navigation');
for (handler in this._handlers){
this._core.$element.off(handler, this._handlers[handler]);
}
for (property in Object.getOwnPropertyNames(this)){
typeof this[property]!='function'&&(this[property]=null);
}}
$.fn.owlCarousel.Constructor.Plugins.Hash=Hash;
})(window.Zepto||window.jQuery, window, document);
!function(a,b){"function"==typeof define&&define.amd?define(["jquery"],function(a){return b(a)}):"object"==typeof exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){!function(){"use strict";function b(b,d){if(this.el=b,this.$el=a(b),this.s=a.extend({},c,d),this.s.dynamic&&"undefined"!==this.s.dynamicEl&&this.s.dynamicEl.constructor===Array&&!this.s.dynamicEl.length)throw"When using dynamic mode, you must also define dynamicEl as an Array.";return this.modules={},this.lGalleryOn=!1,this.lgBusy=!1,this.hideBartimeout=!1,this.isTouch="ontouchstart"in document.documentElement,this.s.slideEndAnimatoin&&(this.s.hideControlOnEnd=!1),this.s.dynamic?this.$items=this.s.dynamicEl:"this"===this.s.selector?this.$items=this.$el:""!==this.s.selector?this.s.selectWithin?this.$items=a(this.s.selectWithin).find(this.s.selector):this.$items=this.$el.find(a(this.s.selector)):this.$items=this.$el.children(),this.$slide="",this.$outer="",this.init(),this}var c={mode:"lg-slide",cssEasing:"ease",easing:"linear",speed:600,height:"100%",width:"100%",addClass:"",startClass:"lg-start-zoom",backdropDuration:150,hideBarsDelay:6e3,useLeft:!1,closable:!0,loop:!0,escKey:!0,keyPress:!0,controls:!0,slideEndAnimatoin:!0,hideControlOnEnd:!1,mousewheel:!0,getCaptionFromTitleOrAlt:!0,appendSubHtmlTo:".lg-sub-html",subHtmlSelectorRelative:!1,preload:1,showAfterLoad:!0,selector:"",selectWithin:"",nextHtml:"",prevHtml:"",index:!1,iframeMaxWidth:"100%",download:!0,counter:!0,appendCounterTo:".lg-toolbar",swipeThreshold:50,enableSwipe:!0,enableDrag:!0,dynamic:!1,dynamicEl:[],galleryId:1};b.prototype.init=function(){var b=this;b.s.preload>b.$items.length&&(b.s.preload=b.$items.length);var c=window.location.hash;c.indexOf("lg="+this.s.galleryId)>0&&(b.index=parseInt(c.split("&slide=")[1],10),a("body").addClass("lg-from-hash"),a("body").hasClass("lg-on")||(setTimeout(function(){b.build(b.index)}),a("body").addClass("lg-on"))),b.s.dynamic?(b.$el.trigger("onBeforeOpen.lg"),b.index=b.s.index||0,a("body").hasClass("lg-on")||setTimeout(function(){b.build(b.index),a("body").addClass("lg-on")})):b.$items.on("click.lgcustom",function(c){try{c.preventDefault(),c.preventDefault()}catch(a){c.returnValue=!1}b.$el.trigger("onBeforeOpen.lg"),b.index=b.s.index||b.$items.index(this),a("body").hasClass("lg-on")||(b.build(b.index),a("body").addClass("lg-on"))})},b.prototype.build=function(b){var c=this;c.structure(),a.each(a.fn.lightGallery.modules,function(b){c.modules[b]=new a.fn.lightGallery.modules[b](c.el)}),c.slide(b,!1,!1),c.s.keyPress&&c.keyPress(),c.$items.length>1&&(c.arrow(),setTimeout(function(){c.enableDrag(),c.enableSwipe()},50),c.s.mousewheel&&c.mousewheel()),c.counter(),c.closeGallery(),c.$el.trigger("onAfterOpen.lg"),c.$outer.on("mousemove.lg click.lg touchstart.lg",function(){c.$outer.removeClass("lg-hide-items"),clearTimeout(c.hideBartimeout),c.hideBartimeout=setTimeout(function(){c.$outer.addClass("lg-hide-items")},c.s.hideBarsDelay)})},b.prototype.structure=function(){var b,c="",d="",e=0,f="",g=this;for(a("body").append('
'),a(".lg-backdrop").css("transition-duration",this.s.backdropDuration+"ms"),e=0;e
';if(this.s.controls&&this.$items.length>1&&(d='
'+this.s.prevHtml+'
'+this.s.nextHtml+"
"),".lg-sub-html"===this.s.appendSubHtmlTo&&(f='
'),b='
",a("body").append(b),this.$outer=a(".lg-outer"),this.$slide=this.$outer.find(".lg-item"),this.s.useLeft?(this.$outer.addClass("lg-use-left"),this.s.mode="lg-slide"):this.$outer.addClass("lg-use-css3"),g.setTop(),a(window).on("resize.lg orientationchange.lg",function(){setTimeout(function(){g.setTop()},100)}),this.$slide.eq(this.index).addClass("lg-current"),this.doCss()?this.$outer.addClass("lg-css3"):(this.$outer.addClass("lg-css"),this.s.speed=0),this.$outer.addClass(this.s.mode),this.s.enableDrag&&this.$items.length>1&&this.$outer.addClass("lg-grab"),this.s.showAfterLoad&&this.$outer.addClass("lg-show-after-load"),this.doCss()){var h=this.$outer.find(".lg-inner");h.css("transition-timing-function",this.s.cssEasing),h.css("transition-duration",this.s.speed+"ms")}setTimeout(function(){a(".lg-backdrop").addClass("in")}),setTimeout(function(){g.$outer.addClass("lg-visible")},this.s.backdropDuration),this.s.download&&this.$outer.find(".lg-toolbar").append('
'),this.prevScrollTop=a(window).scrollTop()},b.prototype.setTop=function(){if("100%"!==this.s.height){var b=a(window).height(),c=(b-parseInt(this.s.height,10))/2,d=this.$outer.find(".lg");b>=parseInt(this.s.height,10)?d.css("top",c+"px"):d.css("top","0px")}},b.prototype.doCss=function(){var a=function(){var a=["transition","MozTransition","WebkitTransition","OTransition","msTransition","KhtmlTransition"],b=document.documentElement,c=0;for(c=0;c
'+(parseInt(this.index,10)+1)+' / '+this.$items.length+" ")},b.prototype.addHtml=function(b){var c,d,e=null;if(this.s.dynamic?this.s.dynamicEl[b].subHtmlUrl?c=this.s.dynamicEl[b].subHtmlUrl:e=this.s.dynamicEl[b].subHtml:(d=this.$items.eq(b),d.attr("data-sub-html-url")?c=d.attr("data-sub-html-url"):(e=d.attr("data-sub-html"),this.s.getCaptionFromTitleOrAlt&&!e&&(e=d.attr("title")||d.find("img").first().attr("alt")))),!c)if("undefined"!=typeof e&&null!==e){var f=e.substring(0,1);"."!==f&&"#"!==f||(e=this.s.subHtmlSelectorRelative&&!this.s.dynamic?d.find(e).html():a(e).html())}else e="";".lg-sub-html"===this.s.appendSubHtmlTo?c?this.$outer.find(this.s.appendSubHtmlTo).load(c):this.$outer.find(this.s.appendSubHtmlTo).html(e):c?this.$slide.eq(b).load(c):this.$slide.eq(b).append(e),"undefined"!=typeof e&&null!==e&&(""===e?this.$outer.find(this.s.appendSubHtmlTo).addClass("lg-empty-html"):this.$outer.find(this.s.appendSubHtmlTo).removeClass("lg-empty-html")),this.$el.trigger("onAfterAppendSubHtml.lg",[b])},b.prototype.preload=function(a){var b=1,c=1;for(b=1;b<=this.s.preload&&!(b>=this.$items.length-a);b++)this.loadContent(a+b,!1,0);for(c=1;c<=this.s.preload&&!(a-c<0);c++)this.loadContent(a-c,!1,0)},b.prototype.loadContent=function(b,c,d){var e,f,g,h,i,j,k=this,l=!1,m=function(b){for(var c=[],d=[],e=0;e
h){f=d[i];break}};if(k.s.dynamic){if(k.s.dynamicEl[b].poster&&(l=!0,g=k.s.dynamicEl[b].poster),j=k.s.dynamicEl[b].html,f=k.s.dynamicEl[b].src,k.s.dynamicEl[b].responsive){var n=k.s.dynamicEl[b].responsive.split(",");m(n)}h=k.s.dynamicEl[b].srcset,i=k.s.dynamicEl[b].sizes}else{if(k.$items.eq(b).attr("data-poster")&&(l=!0,g=k.$items.eq(b).attr("data-poster")),j=k.$items.eq(b).attr("data-html"),f=k.$items.eq(b).attr("href")||k.$items.eq(b).attr("data-src"),k.$items.eq(b).attr("data-responsive")){var o=k.$items.eq(b).attr("data-responsive").split(",");m(o)}h=k.$items.eq(b).attr("data-srcset"),i=k.$items.eq(b).attr("data-sizes")}var p=!1;k.s.dynamic?k.s.dynamicEl[b].iframe&&(p=!0):"true"===k.$items.eq(b).attr("data-iframe")&&(p=!0);var q=k.isVideo(f,b);if(!k.$slide.eq(b).hasClass("lg-loaded")){if(p)k.$slide.eq(b).prepend('');else if(l){var r="";r=q&&q.youtube?"lg-has-youtube":q&&q.vimeo?"lg-has-vimeo":"lg-has-html5",k.$slide.eq(b).prepend('')}else q?(k.$slide.eq(b).prepend(''),k.$el.trigger("hasVideo.lg",[b,f,j])):k.$slide.eq(b).prepend(' ');if(k.$el.trigger("onAferAppendSlide.lg",[b]),e=k.$slide.eq(b).find(".lg-object"),i&&e.attr("sizes",i),h){e.attr("srcset",h);try{picturefill({elements:[e[0]]})}catch(a){console.error("Make sure you have included Picturefill version 2")}}".lg-sub-html"!==this.s.appendSubHtmlTo&&k.addHtml(b),k.$slide.eq(b).addClass("lg-loaded")}k.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){var c=0;d&&!a("body").hasClass("lg-from-hash")&&(c=d),setTimeout(function(){k.$slide.eq(b).addClass("lg-complete"),k.$el.trigger("onSlideItemLoad.lg",[b,d||0])},c)}),q&&q.html5&&!l&&k.$slide.eq(b).addClass("lg-complete"),c===!0&&(k.$slide.eq(b).hasClass("lg-complete")?k.preload(b):k.$slide.eq(b).find(".lg-object").on("load.lg error.lg",function(){k.preload(b)}))},b.prototype.slide=function(b,c,d){var e=this.$outer.find(".lg-current").index(),f=this;if(!f.lGalleryOn||e!==b){var g=this.$slide.length,h=f.lGalleryOn?this.s.speed:0,i=!1,j=!1;if(!f.lgBusy){if(this.s.download){var k;k=f.s.dynamic?f.s.dynamicEl[b].downloadUrl!==!1&&(f.s.dynamicEl[b].downloadUrl||f.s.dynamicEl[b].src):"false"!==f.$items.eq(b).attr("data-download-url")&&(f.$items.eq(b).attr("data-download-url")||f.$items.eq(b).attr("href")||f.$items.eq(b).attr("data-src")),k?(a("#lg-download").attr("href",k),f.$outer.removeClass("lg-hide-download")):f.$outer.addClass("lg-hide-download")}if(this.$el.trigger("onBeforeSlide.lg",[e,b,c,d]),f.lgBusy=!0,clearTimeout(f.hideBartimeout),".lg-sub-html"===this.s.appendSubHtmlTo&&setTimeout(function(){f.addHtml(b)},h),this.arrowDisable(b),c){var l=b-1,m=b+1;0===b&&e===g-1?(m=0,l=g-1):b===g-1&&0===e&&(m=0,l=g-1),this.$slide.removeClass("lg-prev-slide lg-current lg-next-slide"),f.$slide.eq(l).addClass("lg-prev-slide"),f.$slide.eq(m).addClass("lg-next-slide"),f.$slide.eq(b).addClass("lg-current")}else f.$outer.addClass("lg-no-trans"),this.$slide.removeClass("lg-prev-slide lg-next-slide"),be&&(i=!0,b!==g-1||0!==e||d||(j=!0,i=!1)),j?(this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(e).addClass("lg-next-slide")):i&&(this.$slide.eq(b).addClass("lg-next-slide"),this.$slide.eq(e).addClass("lg-prev-slide")),setTimeout(function(){f.$slide.removeClass("lg-current"),f.$slide.eq(b).addClass("lg-current"),f.$outer.removeClass("lg-no-trans")},50);f.lGalleryOn?(setTimeout(function(){f.loadContent(b,!0,0)},this.s.speed+50),setTimeout(function(){f.lgBusy=!1,f.$el.trigger("onAfterSlide.lg",[e,b,c,d])},this.s.speed)):(f.loadContent(b,!0,f.s.backdropDuration),f.lgBusy=!1,f.$el.trigger("onAfterSlide.lg",[e,b,c,d])),f.lGalleryOn=!0,this.s.counter&&a("#lg-counter-current").text(b+1)}}},b.prototype.goToNextSlide=function(a){var b=this;b.lgBusy||(b.index+10?(b.index--,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1)):b.s.loop?(b.index=b.$items.length-1,b.$el.trigger("onBeforePrevSlide.lg",[b.index,a]),b.slide(b.index,a,!1)):b.s.slideEndAnimatoin&&(b.$outer.addClass("lg-left-end"),setTimeout(function(){b.$outer.removeClass("lg-left-end")},400)))},b.prototype.keyPress=function(){var b=this;this.$items.length>1&&a(window).on("keyup.lg",function(a){b.$items.length>1&&(37===a.keyCode&&(a.preventDefault(),b.goToPrevSlide()),39===a.keyCode&&(a.preventDefault(),b.goToNextSlide()))}),a(window).on("keydown.lg",function(a){b.s.escKey===!0&&27===a.keyCode&&(a.preventDefault(),b.$outer.hasClass("lg-thumb-open")?b.$outer.removeClass("lg-thumb-open"):b.destroy())})},b.prototype.arrow=function(){var a=this;this.$outer.find(".lg-prev").on("click.lg",function(){a.goToPrevSlide()}),this.$outer.find(".lg-next").on("click.lg",function(){a.goToNextSlide()})},b.prototype.arrowDisable=function(a){!this.s.loop&&this.s.hideControlOnEnd&&(a+10?this.$outer.find(".lg-prev").removeAttr("disabled").removeClass("disabled"):this.$outer.find(".lg-prev").attr("disabled","disabled").addClass("disabled"))},b.prototype.setTranslate=function(a,b,c){this.s.useLeft?a.css("left",b):a.css({transform:"translate3d("+b+"px, "+c+"px, 0px)"})},b.prototype.touchMove=function(b,c){var d=c-b;Math.abs(d)>15&&(this.$outer.addClass("lg-dragging"),this.setTranslate(this.$slide.eq(this.index),d,0),this.setTranslate(a(".lg-prev-slide"),-this.$slide.eq(this.index).width()+d,0),this.setTranslate(a(".lg-next-slide"),this.$slide.eq(this.index).width()+d,0))},b.prototype.touchEnd=function(a){var b=this;"lg-slide"!==b.s.mode&&b.$outer.addClass("lg-slide"),this.$slide.not(".lg-current, .lg-prev-slide, .lg-next-slide").css("opacity","0"),setTimeout(function(){b.$outer.removeClass("lg-dragging"),a<0&&Math.abs(a)>b.s.swipeThreshold?b.goToNextSlide(!0):a>0&&Math.abs(a)>b.s.swipeThreshold?b.goToPrevSlide(!0):Math.abs(a)<5&&b.$el.trigger("onSlideClick.lg"),b.$slide.removeAttr("style")}),setTimeout(function(){b.$outer.hasClass("lg-dragging")||"lg-slide"===b.s.mode||b.$outer.removeClass("lg-slide")},b.s.speed+100)},b.prototype.enableSwipe=function(){var a=this,b=0,c=0,d=!1;a.s.enableSwipe&&a.isTouch&&a.doCss()&&(a.$slide.on("touchstart.lg",function(c){a.$outer.hasClass("lg-zoomed")||a.lgBusy||(c.preventDefault(),a.manageSwipeClass(),b=c.originalEvent.targetTouches[0].pageX)}),a.$slide.on("touchmove.lg",function(e){a.$outer.hasClass("lg-zoomed")||(e.preventDefault(),c=e.originalEvent.targetTouches[0].pageX,a.touchMove(b,c),d=!0)}),a.$slide.on("touchend.lg",function(){a.$outer.hasClass("lg-zoomed")||(d?(d=!1,a.touchEnd(c-b)):a.$el.trigger("onSlideClick.lg"))}))},b.prototype.enableDrag=function(){var b=this,c=0,d=0,e=!1,f=!1;b.s.enableDrag&&!b.isTouch&&b.doCss()&&(b.$slide.on("mousedown.lg",function(d){b.$outer.hasClass("lg-zoomed")||(a(d.target).hasClass("lg-object")||a(d.target).hasClass("lg-video-play"))&&(d.preventDefault(),b.lgBusy||(b.manageSwipeClass(),c=d.pageX,e=!0,b.$outer.scrollLeft+=1,b.$outer.scrollLeft-=1,b.$outer.removeClass("lg-grab").addClass("lg-grabbing"),b.$el.trigger("onDragstart.lg")))}),a(window).on("mousemove.lg",function(a){e&&(f=!0,d=a.pageX,b.touchMove(c,d),b.$el.trigger("onDragmove.lg"))}),a(window).on("mouseup.lg",function(g){f?(f=!1,b.touchEnd(d-c),b.$el.trigger("onDragend.lg")):(a(g.target).hasClass("lg-object")||a(g.target).hasClass("lg-video-play"))&&b.$el.trigger("onSlideClick.lg"),e&&(e=!1,b.$outer.removeClass("lg-grabbing").addClass("lg-grab"))}))},b.prototype.manageSwipeClass=function(){var a=this.index+1,b=this.index-1,c=this.$slide.length;this.s.loop&&(0===this.index?b=c-1:this.index===c-1&&(a=0)),this.$slide.removeClass("lg-next-slide lg-prev-slide"),b>-1&&this.$slide.eq(b).addClass("lg-prev-slide"),this.$slide.eq(a).addClass("lg-next-slide")},b.prototype.mousewheel=function(){var a=this;a.$outer.on("mousewheel.lg",function(b){b.deltaY&&(b.deltaY>0?a.goToPrevSlide():a.goToNextSlide(),b.preventDefault())})},b.prototype.closeGallery=function(){var b=this,c=!1;this.$outer.find(".lg-close").on("click.lg",function(){b.destroy()}),b.s.closable&&(b.$outer.on("mousedown.lg",function(b){c=!!(a(b.target).is(".lg-outer")||a(b.target).is(".lg-item ")||a(b.target).is(".lg-img-wrap"))}),b.$outer.on("mouseup.lg",function(d){(a(d.target).is(".lg-outer")||a(d.target).is(".lg-item ")||a(d.target).is(".lg-img-wrap")&&c)&&(b.$outer.hasClass("lg-dragging")||b.destroy())}))},b.prototype.destroy=function(b){var c=this;b||c.$el.trigger("onBeforeClose.lg"),a(window).scrollTop(c.prevScrollTop),b&&(c.s.dynamic||this.$items.off("click.lg click.lgcustom"),a.removeData(c.el,"lightGallery")),this.$el.off(".lg.tm"),a.each(a.fn.lightGallery.modules,function(a){c.modules[a]&&c.modules[a].destroy()}),this.lGalleryOn=!1,clearTimeout(c.hideBartimeout),this.hideBartimeout=!1,a(window).off(".lg"),a("body").removeClass("lg-on lg-from-hash"),c.$outer&&c.$outer.removeClass("lg-visible"),a(".lg-backdrop").removeClass("in"),setTimeout(function(){c.$outer&&c.$outer.remove(),a(".lg-backdrop").remove(),b||c.$el.trigger("onCloseAfter.lg")},c.s.backdropDuration+50)},a.fn.lightGallery=function(c){return this.each(function(){if(a.data(this,"lightGallery"))try{a(this).data("lightGallery").init()}catch(a){console.error("lightGallery has not initiated properly")}else a.data(this,"lightGallery",new b(this,c))})},a.fn.lightGallery.modules={}}()});
!function(e){"function"==typeof define&&define.amd?define(["jquery"],e):e(jQuery)}(function(a){var e,t,n,i;function r(e,t){var n,i,r,o=e.nodeName.toLowerCase();return"area"===o?(i=(n=e.parentNode).name,!(!e.href||!i||"map"!==n.nodeName.toLowerCase())&&(!!(r=a("img[usemap='#"+i+"']")[0])&&s(r))):(/^(input|select|textarea|button|object)$/.test(o)?!e.disabled:"a"===o&&e.href||t)&&s(e)}function s(e){return a.expr.filters.visible(e)&&!a(e).parents().addBack().filter(function(){return"hidden"===a.css(this,"visibility")}).length}a.ui=a.ui||{},a.extend(a.ui,{version:"1.11.4",keyCode:{BACKSPACE:8,COMMA:188,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,LEFT:37,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SPACE:32,TAB:9,UP:38}}),a.fn.extend({scrollParent:function(e){var t=this.css("position"),n="absolute"===t,i=e?/(auto|scroll|hidden)/:/(auto|scroll)/,r=this.parents().filter(function(){var e=a(this);return(!n||"static"!==e.css("position"))&&i.test(e.css("overflow")+e.css("overflow-y")+e.css("overflow-x"))}).eq(0);return"fixed"!==t&&r.length?r:a(this[0].ownerDocument||document)},uniqueId:(e=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++e)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&a(this).removeAttr("id")})}}),a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(t){return function(e){return!!a.data(e,t)}}):function(e,t,n){return!!a.data(e,n[3])},focusable:function(e){return r(e,!isNaN(a.attr(e,"tabindex")))},tabbable:function(e){var t=a.attr(e,"tabindex"),n=isNaN(t);return(n||0<=t)&&r(e,!n)}}),a("").outerWidth(1).jquery||a.each(["Width","Height"],function(e,n){var r="Width"===n?["Left","Right"]:["Top","Bottom"],i=n.toLowerCase(),o={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};function s(e,t,n,i){return a.each(r,function(){t-=parseFloat(a.css(e,"padding"+this))||0,n&&(t-=parseFloat(a.css(e,"border"+this+"Width"))||0),i&&(t-=parseFloat(a.css(e,"margin"+this))||0)}),t}a.fn["inner"+n]=function(e){return void 0===e?o["inner"+n].call(this):this.each(function(){a(this).css(i,s(this,e)+"px")})},a.fn["outer"+n]=function(e,t){return"number"!=typeof e?o["outer"+n].call(this,e):this.each(function(){a(this).css(i,s(this,e,!0,t)+"px")})}}),a.fn.addBack||(a.fn.addBack=function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}),a(" ").data("a-b","a").removeData("a-b").data("a-b")&&(a.fn.removeData=(t=a.fn.removeData,function(e){return arguments.length?t.call(this,a.camelCase(e)):t.call(this)})),a.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()),a.fn.extend({focus:(i=a.fn.focus,function(t,n){return"number"==typeof t?this.each(function(){var e=this;setTimeout(function(){a(e).focus(),n&&n.call(e)},t)}):i.apply(this,arguments)}),disableSelection:(n="onselectstart"in document.createElement("div")?"selectstart":"mousedown",function(){return this.bind(n+".ui-disableSelection",function(e){e.preventDefault()})}),enableSelection:function(){return this.unbind(".ui-disableSelection")},zIndex:function(e){if(void 0!==e)return this.css("zIndex",e);if(this.length)for(var t,n,i=a(this[0]);i.length&&i[0]!==document;){if(("absolute"===(t=i.css("position"))||"relative"===t||"fixed"===t)&&(n=parseInt(i.css("zIndex"),10),!isNaN(n)&&0!==n))return n;i=i.parent()}return 0}}),a.ui.plugin={add:function(e,t,n){var i,r=a.ui[e].prototype;for(i in n)r.plugins[i]=r.plugins[i]||[],r.plugins[i].push([t,n[i]])},call:function(e,t,n,i){var r,o=e.plugins[t];if(o&&(i||e.element[0].parentNode&&11!==e.element[0].parentNode.nodeType))for(r=0;r",options:{disabled:!1,create:null},_createWidget:function(t,e){e=h(e||this.defaultElement||this)[0],this.element=h(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=h(),this.hoverable=h(),this.focusable=h(),e!==this&&(h.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=h(e.style?e.ownerDocument:e.document||e),this.window=h(this.document[0].defaultView||this.document[0].parentWindow)),this.options=h.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:h.noop,_getCreateEventData:h.noop,_create:h.noop,_init:h.noop,destroy:function(){this._destroy(),this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(h.camelCase(this.widgetFullName)),this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled"),this.bindings.unbind(this.eventNamespace),this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")},_destroy:h.noop,widget:function(){return this.element},option:function(t,e){var i,n,s,o=t;if(0===arguments.length)return h.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(n=o[t]=h.widget.extend({},this.options[t]),s=0;s=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}})});
!function(e){"function"==typeof define&&define.amd?define(["jquery","./core","./mouse","./widget"],e):e(jQuery)}(function(r){return r.widget("ui.slider",r.ui.mouse,{version:"1.11.4",widgetEventPrefix:"slide",options:{animate:!1,distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this.element.addClass("ui-slider ui-slider-"+this.orientation+" ui-widget ui-widget-content ui-corner-all"),this._refresh(),this._setOption("disabled",this.options.disabled),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var e,t,i=this.options,s=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),a=[];for(t=i.values&&i.values.length||1,s.length>t&&(s.slice(t).remove(),s=s.slice(0,t)),e=s.length;e");this.handles=s.add(r(a.join("")).appendTo(this.element)),this.handle=this.handles.eq(0),this.handles.each(function(e){r(this).data("ui-slider-handle-index",e)})},_createRange:function(){var e=this.options,t="";e.range?(!0===e.range&&(e.values?e.values.length&&2!==e.values.length?e.values=[e.values[0],e.values[0]]:r.isArray(e.values)&&(e.values=e.values.slice(0)):e.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?this.range.removeClass("ui-slider-range-min ui-slider-range-max").css({left:"",bottom:""}):(this.range=r("
").appendTo(this.element),t="ui-slider-range ui-widget-header ui-corner-all"),this.range.addClass(t+("min"===e.range||"max"===e.range?" ui-slider-range-"+e.range:""))):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-widget ui-widget-content ui-corner-all"),this._mouseDestroy()},_mouseCapture:function(e){var t,i,s,a,n,h,l,o=this,u=this.options;return!u.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),t={x:e.pageX,y:e.pageY},i=this._normValueFromMouse(t),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(e){var t=Math.abs(i-o.values(e));(t=this._valueMax())return this._valueMax();var t=0=t&&(s+=0 0){
$('.stm-login-form-unregistered').addClass('working');
}},
success: function (data){
if($(this).parent('.lOffer-account-unit').length > 0){
$('.stm-login-form-unregistered').addClass('working');
}
if(data.user_html){
var $user_html=$(data.user_html).appendTo('#stm_user_info');
$('.stm-not-disabled, .stm-not-enabled').slideUp('fast', function (){
$('#stm_user_info').slideDown('fast');
});
$("html, body").animate({scrollTop: $('.stm-form-checking-user').offset().top}, "slow");
$('.stm-add-a-car-login-overlay,.stm-add-a-car-login').toggleClass('visiblity');
$('.stm-form-checking-user button[type="submit"]').removeClass('disabled').addClass('enabled');
}
if(data.restricted&&data.restricted){
$('.btn-add-edit').remove();
}
$(this).find('.stm-listing-loader').removeClass('visible');
for (var err in data.errors){
$(this).find('input[name=' + err + ']').addClass('form-error');
}
if(data.message){
var message=$(' ' + data.message + '
').hide();
$(this).find('.stm-validation-message').append(message);
message.slideDown('fast');
}
if(typeof(data.redirect_url)!=='undefined'){
window.location=data.redirect_url;
}}
});
});
};
STMListings.save_user_settings_success=function (data){
$(this).find('.stm-listing-loader').removeClass('visible');
$('.stm-user-message').text(data.error_msg);
$('.stm-image-avatar img').attr('src', data.new_avatar);
if(data.new_avatar===''){
$('.stm-image-avatar').removeClass('hide-empty').addClass('hide-photo');
}else{
$('.stm-image-avatar').addClass('hide-empty').removeClass('hide-photo');
}};
STMListings.save_user_settings=function (){
$('#stm_user_settings_edit').submit(function (e){
var formData=new FormData();
formData.append('stm-avatar', $('input[name="stm-avatar"]')[0].files[0]);
var formInputs=$(this).serializeArray();
for (var key in formInputs){
if(formInputs.hasOwnProperty(key)){
formData.append(formInputs[key]['name'], formInputs[key]['value']);
}}
formData.append('action', 'stm_listings_ajax_save_user_data');
e.preventDefault();
$.ajax({
type: "POST",
url: ajaxurl,
dataType: 'json',
context: this,
data: formData,
contentType: false,
processData: false,
beforeSend: function (){
$('.stm-user-message').empty();
$(this).find('.stm-listing-loader').addClass('visible');
},
success: STMListings.save_user_settings_success
});
})
};
STMListings.stm_logout=function (){
$('body').on('click', '.stm_logout a', function (e){
e.preventDefault();
$.ajax({
url: ajaxurl,
type: "POST",
dataType: 'json',
context: this,
data: {
'action': 'stm_logout_user'
},
beforeSend: function (){
$('.stm_add_car_form .stm-form-checking-user .stm-form-inner').addClass('activated');
},
success: function (data){
if(data.exit){
$('#stm_user_info').slideUp('fast', function (){
$(this).empty();
$('.stm-not-enabled, .stm-not-disabled').slideDown('fast');
$("html, body").animate({scrollTop: $('.stm-form-checking-user').offset().top}, "slow");
});
$('.stm-form-checking-user button[type="submit"]').removeClass('enabled').addClass('disabled');
}
$('.stm_add_car_form .stm-form-checking-user .stm-form-inner').removeClass('activated');
}});
})
};
STMListings.stm_ajax_registration=function (){
$(".stm-register-form form").submit(function (e){
e.preventDefault();
$.ajax({
type: "POST",
url: ajaxurl,
dataType: 'json',
context: this,
data: $(this).serialize() + '&action=stm_custom_register',
beforeSend: function (){
$(this).find('input').removeClass('form-error');
$(this).find('.stm-listing-loader').addClass('visible');
$('.stm-validation-message').empty();
},
success: function (data){
if(data.user_html){
var $user_html=$(data.user_html).appendTo('#stm_user_info');
$('.stm-not-disabled, .stm-not-enabled').slideUp('fast', function (){
$('#stm_user_info').slideDown('fast');
});
$("html, body").animate({scrollTop: $('.stm-form-checking-user').offset().top}, "slow");
$('.stm-form-checking-user button[type="submit"]').removeClass('disabled').addClass('enabled');
}
if(data.restricted&&data.restricted){
$('.btn-add-edit').remove();
}
$(this).find('.stm-listing-loader').removeClass('visible');
for (var err in data.errors){
$(this).find('input[name=' + err + ']').addClass('form-error');
}
if(data.redirect_url){
window.location=data.redirect_url;
}
if(data.message){
var message=$('' + data.message + '
').hide();
$(this).find('.stm-validation-message').append(message);
message.slideDown('fast');
}}
});
});
};
STMListings.initVideoIFrame=function (){
$('.light_gallery_iframe').lightGallery({
selector: 'this',
iframeMaxWidth: '70%'
});
};
$(document).ready(function (){
STMListings.stm_ajax_login();
STMListings.save_user_settings();
STMListings.stm_logout();
STMListings.resetFields();
STMListings.stm_ajax_registration();
$(document).on('change', '.stm-sort-by-options select', function (){
$('input[name="sort_order"]').val($(this).val()).closest('form').submit();
});
$(document).on('change', '.ajax-filter select, .stm-sort-by-options select, .stm-slider-filter-type-unit', function (){
$(this).closest('form').submit();
});
$(document).on('slidestop', '.ajax-filter .stm-filter-type-slider', function (event, ui){
$(this).closest('form').submit();
});
$('.stm_login_me a').click(function (e){
e.preventDefault();
$('.stm-add-a-car-login-overlay,.stm-add-a-car-login').toggleClass('visiblity');
});
$('.stm-add-a-car-login-overlay').click(function (e){
$('.stm-add-a-car-login-overlay,.stm-add-a-car-login').toggleClass('visiblity');
});
$('.stm-big-car-gallery').lightGallery({
selector: '.stm_light_gallery',
mode:'lg-fade'
});
STMListings.initVideoIFrame();
});
$(document).on('click', '.add-to-compare', function (e){
e.preventDefault();
var stm_cookies=$.cookie();
var stm_car_compare=[];
var stm_car_add_to=$(this).data('id');
for (var key in stm_cookies){
if(stm_cookies.hasOwnProperty(key)){
if(key.indexOf('compare_ids') > -1){
stm_car_compare.push(stm_cookies[key]);
}}
}
var stm_compare_cars_counter=stm_car_compare.length;
$.cookie.raw=true;
if($.inArray(stm_car_add_to.toString(), stm_car_compare)===-1){
if(stm_car_compare.length < 3){
$.cookie('compare_ids[' + stm_car_add_to + ']', stm_car_add_to, {expires: 7, path: '/'});
$(this).addClass('active');
stm_compare_cars_counter++;
$(this).addClass('active');
if(typeof(stm_label_remove)!='undefined'){
$(this).text(stm_label_remove);
}}else{
}}else{
$.removeCookie('compare_ids[' + stm_car_add_to + ']', {path: '/'});
$(this).removeClass('active');
stm_compare_cars_counter--;
$(this).removeClass('active');
if(typeof(stm_label_add)!='undefined'){
$(this).text(stm_label_add);
}
if($(this).hasClass('stm_remove_after')){
window.location.reload();
}}
});
})(jQuery);
if(typeof (STMListings)=='undefined'){
var STMListings={};}
(function ($){
"use strict";
function Filter(form){
this.form=form;
this.ajax_action=($(this.form).data('action')) ? $(this.form).data('action'):'listings-result';
this.init();
}
Filter.prototype.init=function (){
$(this.form).submit($.proxy(this.submit, this));
this.getTarget().on('click', 'a.page-numbers', $.proxy(this.paginationClick, this));
};
Filter.prototype.submit=function (event){
event.preventDefault();
var data=[],
url=$(this.form).attr('action'),
sign=url.indexOf('?') < 0 ? '?':'&';
$.each($(this.form).serializeArray(), function (i, field){
if(field.value!=''){
if(field.name=='stm_lat'||field.name=='stm_lng'){
if(field.value!=0){
data.push(field.name + '=' + field.value)
}}else{
data.push(field.name + '=' + field.value)
}}
});
url=url + sign + data.join('&');
this.performAjax(url);
};
Filter.prototype.paginationClick=function (event){
event.preventDefault();
var stmTarget=$(event.target).closest('a').attr('href');
this.performAjax(stmTarget);
};
Filter.prototype.pushState=function (url){
window.history.pushState('', '', decodeURI(url));
};
Filter.prototype.performAjax=function (url){
$.ajax({
url: url,
dataType: 'json',
context: this,
data: 'ajax_action=' + this.ajax_action,
beforeSend: this.ajaxBefore,
success: this.ajaxSuccess,
complete: this.ajaxComplete
});
};
Filter.prototype.ajaxBefore=function (){
this.getTarget().addClass('stm-loading');
};
Filter.prototype.ajaxSuccess=function (res){
this.getTarget().html(res.html);
this.disableOptions(res);
if(res.url){
this.pushState(res.url);
}};
Filter.prototype.ajaxComplete=function (){
this.getTarget().removeClass('stm-loading');
};
Filter.prototype.disableOptions=function (res){
if(typeof res.options!='undefined'){
$.each(res.options, function (key, options){
$('select[name=' + key + '] > option', this.form).each(function (){
var slug=$(this).val();
if(options.hasOwnProperty(slug)){
$(this).prop('disabled', options[slug].disabled);
}});
});
}};
Filter.prototype.getTarget=function (){
var target=$(this.form).data('target');
if(!target){
target='#listings-result';
}
return $(target);
};
STMListings.Filter=Filter;
$(function (){
$('form[data-trigger=filter]').each(function (){
$(this).data('Filter', new Filter(this));
});
});
})(jQuery);
function ufcWindowLoadEvent(n){var o=window.onload;"function"!=typeof window.onload?window.onload=n:window.onload=function(){o(),n()}}function ufcTrackFBComments(n,o,e,t,c){jQuery.ajax({type:"POST",url:ufc_frontend_ajax_data.ajaxurl,dataType:"json",data:{action:n,href:o,commentID:e,parentCommentID:t,commentText:c,postTitle:ufc_frontend_ajax_data.title,postID:ufc_frontend_ajax_data.postid,security:ufc_frontend_ajax_data.security},success:function(){},error:function(){}})}function ufcFBCommentsdkInit(){"undefined"!=typeof FB&&FB.Event.subscribe("comment.create",function(n){void 0!==n.commentID&&n.commentID&&ufcFacebookCommentID!=n.commentID&&(ufcFacebookCommentID=n.commentID,ufcTrackFBComments("ufc_handle_fb_comment_created",n.href,n.commentID,n.parentCommentID,n.message))}),"undefined"!=typeof FB&&FB.Event.subscribe("comment.remove",function(n){void 0!==n.commentID&&n.commentID&&ufcFacebookCommentDelID!=n.commentID&&(ufcFacebookCommentDelID=n.commentID,ufcTrackFBComments("ufc_handle_fb_comment_removed",null,null,null,null))})}var ufcFacebookCommentID="",ufcFacebookCommentDelID="";ufcWindowLoadEvent(function(){if(void 0!==window.fbAsyncInit&&!0===window.fbAsyncInit.hasRun)ufcFBCommentsdkInit();else{var n=window.fbAsyncInit;window.fbAsyncInit=function(){"function"==typeof n&&n(),ufcFBCommentsdkInit()},ufcFBCommentsdkInit()}});
!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(s){var u,l,c,d,t,p,h,g,i,e,b,a,o,f,m,y,n,r,v,x,C="ui-effects-",w=s;function _(t,e,n){var r=g[e.type]||{};return null==t?n||!e.def?null:e.def:(t=r.floor?~~t:parseFloat(t),isNaN(t)?e.def:r.mod?(t+r.mod)%r.mod:t<0?0:r.max")[0],b=u.each,e.style.cssText="background-color:rgba(1,1,1,.5)",i.rgba=-1a.mod/2?r+=a.mod:r-o>a.mod/2&&(r-=a.mod)),c[n]=_((o-r)*i+r,e)))}),this[e](c)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),n=e.pop(),r=p(t)._rgba;return p(u.map(e,function(t,e){return(1-n)*r[e]+n*t}))},toRgbaString:function(){var t="rgba(",e=u.map(this._rgba,function(t,e){return null==t?2 ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:n.width(),height:n.height()},o=document.activeElement;try{o.id}catch(t){o=document.body}return n.wrap(t),n[0]!==o&&!s.contains(n[0],o)||s(o).focus(),t=n.parent(),"static"===n.css("position")?(t.css({position:"relative"}),n.css({position:"relative"})):(s.extend(r,{position:n.css("position"),zIndex:n.css("z-index")}),s.each(["top","left","bottom","right"],function(t,e){r[e]=n.css(e),isNaN(parseInt(r[e],10))&&(r[e]="auto")}),n.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),n.css(e),t.css(r).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!s.contains(t[0],e)||s(e).focus()),t},setTransition:function(r,t,o,a){return a=a||{},s.each(t,function(t,e){var n=r.cssUnit(e);0").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=this.document[0];if(this.handleElement.is(t.target))try{e.activeElement&&"body"!==e.activeElement.nodeName.toLowerCase()&&P(e.activeElement).blur()}catch(t){}},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this.helper.addClass("ui-draggable-dragging"),this._cacheHelperProportions(),P.ui.ddmanager&&(P.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0s[2]&&(a=s[2]+this.offset.click.left),t.pageY-this.offset.click.top>s[3]&&(h=s[3]+this.offset.click.top)),r.grid&&(o=r.grid[1]?this.originalPageY+Math.round((h-this.originalPageY)/r.grid[1])*r.grid[1]:this.originalPageY,h=s?o-this.offset.click.top>=s[1]||o-this.offset.click.top>s[3]?o:o-this.offset.click.top>=s[1]?o-r.grid[1]:o+r.grid[1]:o,n=r.grid[0]?this.originalPageX+Math.round((a-this.originalPageX)/r.grid[0])*r.grid[0]:this.originalPageX,a=s?n-this.offset.click.left>=s[0]||n-this.offset.click.left>s[2]?n:n-this.offset.click.left>=s[0]?n-r.grid[0]:n+r.grid[0]:n),"y"===r.axis&&(a=this.originalPageX),"x"===r.axis&&(h=this.originalPageY)),{top:h-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:l?0:this.offset.scroll.top),left:a-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:l?0:this.offset.scroll.left)}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_normalizeRightBottom:function(){"y"!==this.options.axis&&"auto"!==this.helper.css("right")&&(this.helper.width(this.helper.width()),this.helper.css("right","auto")),"x"!==this.options.axis&&"auto"!==this.helper.css("bottom")&&(this.helper.height(this.helper.height()),this.helper.css("bottom","auto"))},_trigger:function(t,e,s){return s=s||this._uiHash(),P.ui.plugin.call(this,t,[e,s,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),s.offset=this.positionAbs),P.Widget.prototype._trigger.call(this,t,e,s)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),P.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,s){var i=P.extend({},t,{item:s.element});s.sortables=[],P(s.options.connectToSortable).each(function(){var t=P(this).sortable("instance");t&&!t.options.disabled&&(s.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,i))})},stop:function(e,t,s){var i=P.extend({},t,{item:s.element});s.cancelHelperRemoval=!1,P.each(s.sortables,function(){var t=this;t.isOver?(t.isOver=0,s.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,i))})},drag:function(s,i,o){P.each(o.sortables,function(){var t=!1,e=this;e.positionAbs=o.positionAbs,e.helperProportions=o.helperProportions,e.offset.click=o.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,P.each(o.sortables,function(){return this.positionAbs=o.positionAbs,this.helperProportions=o.helperProportions,this.offset.click=o.offset.click,this!==e&&this._intersectsWith(this.containerCache)&&P.contains(e.element[0],this.element[0])&&(t=!1),t})),t?(e.isOver||(e.isOver=1,o._parent=i.helper.parent(),e.currentItem=i.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return i.helper[0]},s.target=e.currentItem[0],e._mouseCapture(s,!0),e._mouseStart(s,!0,!0),e.offset.click.top=o.offset.click.top,e.offset.click.left=o.offset.click.left,e.offset.parent.left-=o.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=o.offset.parent.top-e.offset.parent.top,o._trigger("toSortable",s),o.dropped=e.element,P.each(o.sortables,function(){this.refreshPositions()}),o.currentItem=o.element,e.fromOutside=o),e.currentItem&&(e._mouseDrag(s),i.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",s,e._uiHash(e)),e._mouseStop(s,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),i.helper.appendTo(o._parent),o._refreshOffsets(s),i.position=o._generatePosition(s,!0),o._trigger("fromSortable",s),o.dropped=!1,P.each(o.sortables,function(){this.refreshPositions()}))})}}),P.ui.plugin.add("draggable","cursor",{start:function(t,e,s){var i=P("body"),o=s.options;i.css("cursor")&&(o._cursor=i.css("cursor")),i.css("cursor",o.cursor)},stop:function(t,e,s){var i=s.options;i._cursor&&P("body").css("cursor",i._cursor)}}),P.ui.plugin.add("draggable","opacity",{start:function(t,e,s){var i=P(e.helper),o=s.options;i.css("opacity")&&(o._opacity=i.css("opacity")),i.css("opacity",o.opacity)},stop:function(t,e,s){var i=s.options;i._opacity&&P(e.helper).css("opacity",i._opacity)}}),P.ui.plugin.add("draggable","scroll",{start:function(t,e,s){s.scrollParentNotHidden||(s.scrollParentNotHidden=s.helper.scrollParent(!1)),s.scrollParentNotHidden[0]!==s.document[0]&&"HTML"!==s.scrollParentNotHidden[0].tagName&&(s.overflowOffset=s.scrollParentNotHidden.offset())},drag:function(t,e,s){var i=s.options,o=!1,n=s.scrollParentNotHidden[0],r=s.document[0];n!==r&&"HTML"!==n.tagName?(i.axis&&"x"===i.axis||(s.overflowOffset.top+n.offsetHeight-t.pageY",{size:1}).attr("size")&&e.attrFn,s=e.attr,u=e.attrHooks.value&&e.attrHooks.value.get||function(){return null},c=e.attrHooks.value&&e.attrHooks.value.set||function(){return n},l=/^(?:input|button)$/i,d=/^[238]$/,p=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,f=/^(?:checked|selected)$/i;a(e,"attrFn",o||{},"jQuery.attrFn is deprecated"),e.attr=function(t,a,i,u){var c=a.toLowerCase(),g=t&&t.nodeType;return u&&(4>s.length&&r("jQuery.fn.attr(props, pass) is deprecated"),t&&!d.test(g)&&(o?a in o:e.isFunction(e.fn[a])))?e(t)[a](i):("type"===a&&i!==n&&l.test(t.nodeName)&&t.parentNode&&r("Can't change the 'type' of an input or button in IE 6/7/8"),!e.attrHooks[c]&&p.test(c)&&(e.attrHooks[c]={get:function(t,r){var a,i=e.prop(t,r);return i===!0||"boolean"!=typeof i&&(a=t.getAttributeNode(r))&&a.nodeValue!==!1?r.toLowerCase():n},set:function(t,n,r){var a;return n===!1?e.removeAttr(t,r):(a=e.propFix[r]||r,a in t&&(t[a]=!0),t.setAttribute(r,r.toLowerCase())),r}},f.test(c)&&r("jQuery.fn.attr('"+c+"') may use property instead of attribute")),s.call(e,t,a,i))},e.attrHooks.value={get:function(e,t){var n=(e.nodeName||"").toLowerCase();return"button"===n?u.apply(this,arguments):("input"!==n&&"option"!==n&&r("jQuery.fn.attr('value') no longer gets properties"),t in e?e.value:null)},set:function(e,t){var a=(e.nodeName||"").toLowerCase();return"button"===a?c.apply(this,arguments):("input"!==a&&"option"!==a&&r("jQuery.fn.attr('value', val) no longer sets properties"),e.value=t,n)}};var g,h,v=e.fn.init,m=e.parseJSON,y=/^([^<]*)(<[\w\W]+>)([^>]*)$/;e.fn.init=function(t,n,a){var i;return t&&"string"==typeof t&&!e.isPlainObject(n)&&(i=y.exec(e.trim(t)))&&i[0]&&("<"!==t.charAt(0)&&r("$(html) HTML strings must start with '<' character"),i[3]&&r("$(html) HTML text after last tag is ignored"),"#"===i[0].charAt(0)&&(r("HTML string cannot start with a '#' character"),e.error("JQMIGRATE: Invalid selector string (XSS)")),n&&n.context&&(n=n.context),e.parseHTML)?v.call(this,e.parseHTML(i[2],n,!0),n,a):v.apply(this,arguments)},e.fn.init.prototype=e.fn,e.parseJSON=function(e){return e||null===e?m.apply(this,arguments):(r("jQuery.parseJSON requires a valid JSON string"),null)},e.uaMatch=function(e){e=e.toLowerCase();var t=/(chrome)[ \/]([\w.]+)/.exec(e)||/(webkit)[ \/]([\w.]+)/.exec(e)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e)||/(msie) ([\w.]+)/.exec(e)||0>e.indexOf("compatible")&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(e)||[];return{browser:t[1]||"",version:t[2]||"0"}},e.browser||(g=e.uaMatch(navigator.userAgent),h={},g.browser&&(h[g.browser]=!0,h.version=g.version),h.chrome?h.webkit=!0:h.webkit&&(h.safari=!0),e.browser=h),a(e,"browser",e.browser,"jQuery.browser is deprecated"),e.sub=function(){function t(e,n){return new t.fn.init(e,n)}e.extend(!0,t,this),t.superclass=this,t.fn=t.prototype=this(),t.fn.constructor=t,t.sub=this.sub,t.fn.init=function(r,a){return a&&a instanceof e&&!(a instanceof t)&&(a=t(a)),e.fn.init.call(this,r,a,n)},t.fn.init.prototype=t.fn;var n=t(document);return r("jQuery.sub() is deprecated"),t},e.ajaxSetup({converters:{"text json":e.parseJSON}});var b=e.fn.data;e.fn.data=function(t){var a,i,o=this[0];return!o||"events"!==t||1!==arguments.length||(a=e.data(o,t),i=e._data(o,t),a!==n&&a!==i||i===n)?b.apply(this,arguments):(r("Use of jQuery.fn.data('events') is deprecated"),i)};var j=/\/(java|ecma)script/i,w=e.fn.andSelf||e.fn.addBack;e.fn.andSelf=function(){return r("jQuery.fn.andSelf() replaced by jQuery.fn.addBack()"),w.apply(this,arguments)},e.clean||(e.clean=function(t,a,i,o){a=a||document,a=!a.nodeType&&a[0]||a,a=a.ownerDocument||a,r("jQuery.clean() is deprecated");var s,u,c,l,d=[];if(e.merge(d,e.buildFragment(t,a).childNodes),i)for(c=function(e){return!e.type||j.test(e.type)?o?o.push(e.parentNode?e.parentNode.removeChild(e):e):i.appendChild(e):n},s=0;null!=(u=d[s]);s++)e.nodeName(u,"script")&&c(u)||(i.appendChild(u),u.getElementsByTagName!==n&&(l=e.grep(e.merge([],u.getElementsByTagName("script")),c),d.splice.apply(d,[s+1,0].concat(l)),s+=l.length));return d});var Q=e.event.add,x=e.event.remove,k=e.event.trigger,N=e.fn.toggle,T=e.fn.live,M=e.fn.die,S="ajaxStart|ajaxStop|ajaxSend|ajaxComplete|ajaxError|ajaxSuccess",C=RegExp("\\b(?:"+S+")\\b"),H=/(?:^|\s)hover(\.\S+|)\b/,A=function(t){return"string"!=typeof t||e.event.special.hover?t:(H.test(t)&&r("'hover' pseudo-event is deprecated, use 'mouseenter mouseleave'"),t&&t.replace(H,"mouseenter$1 mouseleave$1"))};e.event.props&&"attrChange"!==e.event.props[0]&&e.event.props.unshift("attrChange","attrName","relatedNode","srcElement"),e.event.dispatch&&a(e.event,"handle",e.event.dispatch,"jQuery.event.handle is undocumented and deprecated"),e.event.add=function(e,t,n,a,i){e!==document&&C.test(t)&&r("AJAX events should be attached to document: "+t),Q.call(this,e,A(t||""),n,a,i)},e.event.remove=function(e,t,n,r,a){x.call(this,e,A(t)||"",n,r,a)},e.fn.error=function(){var e=Array.prototype.slice.call(arguments,0);return r("jQuery.fn.error() is deprecated"),e.splice(0,0,"error"),arguments.length?this.bind.apply(this,e):(this.triggerHandler.apply(this,e),this)},e.fn.toggle=function(t,n){if(!e.isFunction(t)||!e.isFunction(n))return N.apply(this,arguments);r("jQuery.fn.toggle(handler, handler...) is deprecated");var a=arguments,i=t.guid||e.guid++,o=0,s=function(n){var r=(e._data(this,"lastToggle"+t.guid)||0)%o;return e._data(this,"lastToggle"+t.guid,r+1),n.preventDefault(),a[r].apply(this,arguments)||!1};for(s.guid=i;a.length>o;)a[o++].guid=i;return this.click(s)},e.fn.live=function(t,n,a){return r("jQuery.fn.live() is deprecated"),T?T.apply(this,arguments):(e(this.context).on(t,this.selector,n,a),this)},e.fn.die=function(t,n){return r("jQuery.fn.die() is deprecated"),M?M.apply(this,arguments):(e(this.context).off(t,this.selector||"**",n),this)},e.event.trigger=function(e,t,n,a){return n||C.test(e)||r("Global events are undocumented and deprecated"),k.call(this,e,t,n||document,a)},e.each(S.split("|"),function(t,n){e.event.special[n]={setup:function(){var t=this;return t!==document&&(e.event.add(document,n+"."+e.guid,function(){e.event.trigger(n,null,t,!0)}),e._data(this,n,e.guid++)),!1},teardown:function(){return this!==document&&e.event.remove(document,n+"."+e._data(this,n)),!1}}})}(jQuery,window);
if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.1",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.1",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active"));a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.1",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c="prev"==a?-1:1,d=this.getItemIndex(b),e=(d+c)%this.$items.length;return this.$items.eq(e)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i="next"==b?"first":"last",j=this;if(!f.length){if(!this.options.wrap)return;f=this.$element.find(".item")[i]()}if(f.hasClass("active"))return this.sliding=!1;var k=f[0],l=a.Event("slide.bs.carousel",{relatedTarget:k,direction:h});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var m=a(this.$indicators.children()[this.getItemIndex(f)]);m&&m.addClass("active")}var n=a.Event("slid.bs.carousel",{relatedTarget:k,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),j.sliding=!1,setTimeout(function(){j.$element.trigger(n)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(n)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a(this.options.trigger).filter('[href="#'+b.id+'"], [data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.1",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0,trigger:'[data-toggle="collapse"]'},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.find("> .panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":a.extend({},e.data(),{trigger:this});c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=c(d),f={relatedTarget:this};e.hasClass("open")&&(e.trigger(b=a.Event("hide.bs.dropdown",f)),b.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f)))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.1",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('
').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27|32)/.test(b.which)&&!/input|textarea/i.test(b.target.tagName)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g&&27!=b.which||g&&27==b.which)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.divider):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(b.target);38==b.which&&j>0&&j--,40==b.which&&j ').prependTo(this.$element).on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),f&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;f?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var g=function(){d.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",g).emulateTransitionEnd(c.BACKDROP_TRANSITION_DURATION):g()}else b&&b()},c.prototype.handleUpdate=function(){this.options.backdrop&&this.adjustBackdrop(),this.adjustDialog()},c.prototype.adjustBackdrop=function(){this.$backdrop.css("height",0).css("height",this.$element[0].scrollHeight)},c.prototype.adjustDialog=function(){var a=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){this.bodyIsOverflowing=document.body.scrollHeight>document.documentElement.clientHeight,this.scrollbarWidth=this.measureScrollbar()},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.bodyIsOverflowing&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b,g=f&&f.selector;(e||"destroy"!=b)&&(g?(e||d.data("bs.tooltip",e={}),e[g]||(e[g]=new c(this,f))):e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.3.1",c.TRANSITION_DURATION=150,c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c&&c.$tip&&c.$tip.is(":visible")?void(c.hoverState="in"):(c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.options.container?a(this.options.container):this.$element.parent(),p=this.getPosition(o);h="bottom"==h&&k.bottom+m>p.bottom?"top":"top"==h&&k.top-mp.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type)})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b,g=f&&f.selector;(e||"destroy"!=b)&&(g?(e||d.data("bs.popover",e={}),e[g]||(e[g]=new c(this,f))):e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.1",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},c.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){var e=a.proxy(this.process,this);this.$body=a("body"),this.$scrollElement=a(a(c).is("body")?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.1",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b="offset",c=0;a.isWindow(this.$scrollElement[0])||(b="position",c=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var d=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+c,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){d.offsets.push(this[0]),d.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,this.clear();var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")},b.prototype.clear=function(){a(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.3.1",c.TRANSITION_DURATION=150,c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a"),f=a.Event("hide.bs.tab",{relatedTarget:b[0]}),g=a.Event("show.bs.tab",{relatedTarget:e[0]});if(e.trigger(f),b.trigger(g),!g.isDefaultPrevented()&&!f.isDefaultPrevented()){var h=a(d);this.activate(b.closest("li"),c),this.activate(h,h.parent(),function(){e.trigger({type:"hidden.bs.tab",relatedTarget:b[0]}),b.trigger({type:"shown.bs.tab",relatedTarget:e[0]})
})}}},c.prototype.activate=function(b,d,e){function f(){g.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.1",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=i?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=a("body").height();"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
(function(){"use strict";function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,s=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;ta;a++){var p=this[a],h=t.data(p,e);if(h)if(t.isFunction(h[n])&&"_"!==n.charAt(0)){var f=h[n].apply(h,s);if(void 0!==f)return f}else r("no such method '"+n+"' for "+e+" instance");else r("cannot call methods on "+e+" prior to initialization; "+"attempted to call '"+n+"'")}return this}return this.each(function(){var o=t.data(this,e);o?(o.option(n),o._init()):(o=new i(this,n),t.data(this,e,o))})}}if(t){var r="undefined"==typeof console?e:function(t){console.error(t)};return t.bridget=function(t,e){i(e),n(t,e)},t.bridget}}var o=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],i):"object"==typeof exports?i(require("jquery")):i(t.jQuery)})(window),function(t){function e(e){var i=t.event;return i.target=i.target||i.srcElement||e,i}var i=document.documentElement,o=function(){};i.addEventListener?o=function(t,e,i){t.addEventListener(e,i,!1)}:i.attachEvent&&(o=function(t,i,o){t[i+o]=o.handleEvent?function(){var i=e(t);o.handleEvent.call(o,i)}:function(){var i=e(t);o.call(t,i)},t.attachEvent("on"+i,t[i+o])});var n=function(){};i.removeEventListener?n=function(t,e,i){t.removeEventListener(e,i,!1)}:i.detachEvent&&(n=function(t,e,i){t.detachEvent("on"+e,t[e+i]);try{delete t[e+i]}catch(o){t[e+i]=void 0}});var r={bind:o,unbind:n};"function"==typeof define&&define.amd?define("eventie/eventie",r):"object"==typeof exports?module.exports=r:t.eventie=r}(this),function(t){function e(t){"function"==typeof t&&(e.isReady?t():s.push(t))}function i(t){var i="readystatechange"===t.type&&"complete"!==r.readyState;e.isReady||i||o()}function o(){e.isReady=!0;for(var t=0,i=s.length;i>t;t++){var o=s[t];o()}}function n(n){return"complete"===r.readyState?o():(n.bind(r,"DOMContentLoaded",i),n.bind(r,"readystatechange",i),n.bind(t,"load",i)),e}var r=t.document,s=[];e.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],n):"object"==typeof exports?module.exports=n(require("eventie")):t.docReady=n(t.eventie)}(window),function(){function t(){}function e(t,e){for(var i=t.length;i--;)if(t[i].listener===e)return i;return-1}function i(t){return function(){return this[t].apply(this,arguments)}}var o=t.prototype,n=this,r=n.EventEmitter;o.getListeners=function(t){var e,i,o=this._getEvents();if(t instanceof RegExp){e={};for(i in o)o.hasOwnProperty(i)&&t.test(i)&&(e[i]=o[i])}else e=o[t]||(o[t]=[]);return e},o.flattenListeners=function(t){var e,i=[];for(e=0;t.length>e;e+=1)i.push(t[e].listener);return i},o.getListenersAsObject=function(t){var e,i=this.getListeners(t);return i instanceof Array&&(e={},e[t]=i),e||i},o.addListener=function(t,i){var o,n=this.getListenersAsObject(t),r="object"==typeof i;for(o in n)n.hasOwnProperty(o)&&-1===e(n[o],i)&&n[o].push(r?i:{listener:i,once:!1});return this},o.on=i("addListener"),o.addOnceListener=function(t,e){return this.addListener(t,{listener:e,once:!0})},o.once=i("addOnceListener"),o.defineEvent=function(t){return this.getListeners(t),this},o.defineEvents=function(t){for(var e=0;t.length>e;e+=1)this.defineEvent(t[e]);return this},o.removeListener=function(t,i){var o,n,r=this.getListenersAsObject(t);for(n in r)r.hasOwnProperty(n)&&(o=e(r[n],i),-1!==o&&r[n].splice(o,1));return this},o.off=i("removeListener"),o.addListeners=function(t,e){return this.manipulateListeners(!1,t,e)},o.removeListeners=function(t,e){return this.manipulateListeners(!0,t,e)},o.manipulateListeners=function(t,e,i){var o,n,r=t?this.removeListener:this.addListener,s=t?this.removeListeners:this.addListeners;if("object"!=typeof e||e instanceof RegExp)for(o=i.length;o--;)r.call(this,e,i[o]);else for(o in e)e.hasOwnProperty(o)&&(n=e[o])&&("function"==typeof n?r.call(this,o,n):s.call(this,o,n));return this},o.removeEvent=function(t){var e,i=typeof t,o=this._getEvents();if("string"===i)delete o[t];else if(t instanceof RegExp)for(e in o)o.hasOwnProperty(e)&&t.test(e)&&delete o[e];else delete this._events;return this},o.removeAllListeners=i("removeEvent"),o.emitEvent=function(t,e){var i,o,n,r,s=this.getListenersAsObject(t);for(n in s)if(s.hasOwnProperty(n))for(o=s[n].length;o--;)i=s[n][o],i.once===!0&&this.removeListener(t,i.listener),r=i.listener.apply(this,e||[]),r===this._getOnceReturnValue()&&this.removeListener(t,i.listener);return this},o.trigger=i("emitEvent"),o.emit=function(t){var e=Array.prototype.slice.call(arguments,1);return this.emitEvent(t,e)},o.setOnceReturnValue=function(t){return this._onceReturnValue=t,this},o._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},o._getEvents=function(){return this._events||(this._events={})},t.noConflict=function(){return n.EventEmitter=r,t},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return t}):"object"==typeof module&&module.exports?module.exports=t:n.EventEmitter=t}.call(this),function(t){function e(t){if(t){if("string"==typeof o[t])return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e,n=0,r=i.length;r>n;n++)if(e=i[n]+t,"string"==typeof o[e])return e}}var i="Webkit Moz ms Ms O".split(" "),o=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return e}):"object"==typeof exports?module.exports=e:t.getStyleProperty=e}(window),function(t){function e(t){var e=parseFloat(t),i=-1===t.indexOf("%")&&!isNaN(e);return i&&e}function i(){}function o(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0,i=s.length;i>e;e++){var o=s[e];t[o]=0}return t}function n(i){function n(){if(!d){d=!0;var o=t.getComputedStyle;if(p=function(){var t=o?function(t){return o(t,null)}:function(t){return t.currentStyle};return function(e){var i=t(e);return i||r("Style returned "+i+". Are you running this code in a hidden iframe on Firefox? "+"See http://bit.ly/getsizebug1"),i}}(),h=i("boxSizing")){var n=document.createElement("div");n.style.width="200px",n.style.padding="1px 2px 3px 4px",n.style.borderStyle="solid",n.style.borderWidth="1px 2px 3px 4px",n.style[h]="border-box";var s=document.body||document.documentElement;s.appendChild(n);var a=p(n);f=200===e(a.width),s.removeChild(n)}}}function a(t){if(n(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var i=p(t);if("none"===i.display)return o();var r={};r.width=t.offsetWidth,r.height=t.offsetHeight;for(var a=r.isBorderBox=!(!h||!i[h]||"border-box"!==i[h]),d=0,l=s.length;l>d;d++){var c=s[d],y=i[c];y=u(t,y);var m=parseFloat(y);r[c]=isNaN(m)?0:m}var g=r.paddingLeft+r.paddingRight,v=r.paddingTop+r.paddingBottom,_=r.marginLeft+r.marginRight,I=r.marginTop+r.marginBottom,L=r.borderLeftWidth+r.borderRightWidth,z=r.borderTopWidth+r.borderBottomWidth,b=a&&f,x=e(i.width);x!==!1&&(r.width=x+(b?0:g+L));var S=e(i.height);return S!==!1&&(r.height=S+(b?0:v+z)),r.innerWidth=r.width-(g+L),r.innerHeight=r.height-(v+z),r.outerWidth=r.width+_,r.outerHeight=r.height+I,r}}function u(e,i){if(t.getComputedStyle||-1===i.indexOf("%"))return i;var o=e.style,n=o.left,r=e.runtimeStyle,s=r&&r.left;return s&&(r.left=e.currentStyle.left),o.left=i,i=o.pixelLeft,o.left=n,s&&(r.left=s),i}var p,h,f,d=!1;return a}var r="undefined"==typeof console?i:function(t){console.error(t)},s=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],n):"object"==typeof exports?module.exports=n(require("desandro-get-style-property")):t.getSize=n(t.getStyleProperty)}(window),function(t){function e(t,e){return t[s](e)}function i(t){if(!t.parentNode){var e=document.createDocumentFragment();e.appendChild(t)}}function o(t,e){i(t);for(var o=t.parentNode.querySelectorAll(e),n=0,r=o.length;r>n;n++)if(o[n]===t)return!0;return!1}function n(t,o){return i(t),e(t,o)}var r,s=function(){if(t.matchesSelector)return"matchesSelector";for(var e=["webkit","moz","ms","o"],i=0,o=e.length;o>i;i++){var n=e[i],r=n+"MatchesSelector";if(t[r])return r}}();if(s){var a=document.createElement("div"),u=e(a,"div");r=u?e:n}else r=o;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return r}):"object"==typeof exports?module.exports=r:window.matchesSelector=r}(Element.prototype),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){for(var e in t)return!1;return e=null,!0}function o(t){return t.replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function n(t,n,r){function a(t,e){t&&(this.element=t,this.layout=e,this.position={x:0,y:0},this._create())}var u=r("transition"),p=r("transform"),h=u&&p,f=!!r("perspective"),d={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[u],l=["transform","transition","transitionDuration","transitionProperty"],c=function(){for(var t={},e=0,i=l.length;i>e;e++){var o=l[e],n=r(o);n&&n!==o&&(t[o]=n)}return t}();e(a.prototype,t.prototype),a.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},a.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},a.prototype.getSize=function(){this.size=n(this.element)},a.prototype.css=function(t){var e=this.element.style;for(var i in t){var o=c[i]||i;e[o]=t[i]}},a.prototype.getPosition=function(){var t=s(this.element),e=this.layout.options,i=e.isOriginLeft,o=e.isOriginTop,n=parseInt(t[i?"left":"right"],10),r=parseInt(t[o?"top":"bottom"],10);n=isNaN(n)?0:n,r=isNaN(r)?0:r;var a=this.layout.size;n-=i?a.paddingLeft:a.paddingRight,r-=o?a.paddingTop:a.paddingBottom,this.position.x=n,this.position.y=r},a.prototype.layoutPosition=function(){var t=this.layout.size,e=this.layout.options,i={};e.isOriginLeft?(i.left=this.position.x+t.paddingLeft+"px",i.right=""):(i.right=this.position.x+t.paddingRight+"px",i.left=""),e.isOriginTop?(i.top=this.position.y+t.paddingTop+"px",i.bottom=""):(i.bottom=this.position.y+t.paddingBottom+"px",i.top=""),this.css(i),this.emitEvent("layout",[this])};var y=f?function(t,e){return"translate3d("+t+"px, "+e+"px, 0)"}:function(t,e){return"translate("+t+"px, "+e+"px)"};a.prototype._transitionTo=function(t,e){this.getPosition();var i=this.position.x,o=this.position.y,n=parseInt(t,10),r=parseInt(e,10),s=n===this.position.x&&r===this.position.y;if(this.setPosition(t,e),s&&!this.isTransitioning)return this.layoutPosition(),void 0;var a=t-i,u=e-o,p={},h=this.layout.options;a=h.isOriginLeft?a:-a,u=h.isOriginTop?u:-u,p.transform=y(a,u),this.transition({to:p,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},a.prototype.goTo=function(t,e){this.setPosition(t,e),this.layoutPosition()},a.prototype.moveTo=h?a.prototype._transitionTo:a.prototype.goTo,a.prototype.setPosition=function(t,e){this.position.x=parseInt(t,10),this.position.y=parseInt(e,10)},a.prototype._nonTransition=function(t){this.css(t.to),t.isCleaning&&this._removeStyles(t.to);for(var e in t.onTransitionEnd)t.onTransitionEnd[e].call(this)},a.prototype._transition=function(t){if(!parseFloat(this.layout.options.transitionDuration))return this._nonTransition(t),void 0;var e=this._transn;for(var i in t.onTransitionEnd)e.onEnd[i]=t.onTransitionEnd[i];for(i in t.to)e.ingProperties[i]=!0,t.isCleaning&&(e.clean[i]=!0);if(t.from){this.css(t.from);var o=this.element.offsetHeight;o=null}this.enableTransition(t.to),this.css(t.to),this.isTransitioning=!0};var m=p&&o(p)+",opacity";a.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:m,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(d,this,!1))},a.prototype.transition=a.prototype[u?"_transition":"_nonTransition"],a.prototype.onwebkitTransitionEnd=function(t){this.ontransitionend(t)},a.prototype.onotransitionend=function(t){this.ontransitionend(t)};var g={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};a.prototype.ontransitionend=function(t){if(t.target===this.element){var e=this._transn,o=g[t.propertyName]||t.propertyName;if(delete e.ingProperties[o],i(e.ingProperties)&&this.disableTransition(),o in e.clean&&(this.element.style[t.propertyName]="",delete e.clean[o]),o in e.onEnd){var n=e.onEnd[o];n.call(this),delete e.onEnd[o]}this.emitEvent("transitionEnd",[this])}},a.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(d,this,!1),this.isTransitioning=!1},a.prototype._removeStyles=function(t){var e={};for(var i in t)e[i]="";this.css(e)};var v={transitionProperty:"",transitionDuration:""};return a.prototype.removeTransitionStyles=function(){this.css(v)},a.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.emitEvent("remove",[this])},a.prototype.remove=function(){if(!u||!parseFloat(this.layout.options.transitionDuration))return this.removeElem(),void 0;var t=this;this.on("transitionEnd",function(){return t.removeElem(),!0}),this.hide()},a.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var t=this.layout.options;this.transition({from:t.hiddenStyle,to:t.visibleStyle,isCleaning:!0})},a.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var t=this.layout.options;this.transition({from:t.visibleStyle,to:t.hiddenStyle,isCleaning:!0,onTransitionEnd:{opacity:function(){this.isHidden&&this.css({display:"none"})}}})},a.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},a}var r=t.getComputedStyle,s=r?function(t){return r(t,null)}:function(t){return t.currentStyle};"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property"],n):"object"==typeof exports?module.exports=n(require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property")):(t.Outlayer={},t.Outlayer.Item=n(t.EventEmitter,t.getSize,t.getStyleProperty))}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===f.call(t)}function o(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=l(e,t);-1!==i&&e.splice(i,1)}function r(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()}function s(i,s,f,l,c,y){function m(t,i){if("string"==typeof t&&(t=a.querySelector(t)),!t||!d(t))return u&&u.error("Bad "+this.constructor.namespace+" element: "+t),void 0;this.element=t,this.options=e({},this.constructor.defaults),this.option(i);var o=++g;this.element.outlayerGUID=o,v[o]=this,this._create(),this.options.isInitLayout&&this.layout()}var g=0,v={};return m.namespace="outlayer",m.Item=y,m.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e(m.prototype,f.prototype),m.prototype.option=function(t){e(this.options,t)},m.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},m.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},m.prototype._itemize=function(t){for(var e=this._filterFindItemElements(t),i=this.constructor.Item,o=[],n=0,r=e.length;r>n;n++){var s=e[n],a=new i(s,this);o.push(a)}return o},m.prototype._filterFindItemElements=function(t){t=o(t);for(var e=this.options.itemSelector,i=[],n=0,r=t.length;r>n;n++){var s=t[n];if(d(s))if(e){c(s,e)&&i.push(s);for(var a=s.querySelectorAll(e),u=0,p=a.length;p>u;u++)i.push(a[u])}else i.push(s)}return i},m.prototype.getItemElements=function(){for(var t=[],e=0,i=this.items.length;i>e;e++)t.push(this.items[e].element);return t},m.prototype.layout=function(){this._resetLayout(),this._manageStamps();var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,t),this._isLayoutInited=!0},m.prototype._init=m.prototype.layout,m.prototype._resetLayout=function(){this.getSize()},m.prototype.getSize=function(){this.size=l(this.element)},m.prototype._getMeasurement=function(t,e){var i,o=this.options[t];o?("string"==typeof o?i=this.element.querySelector(o):d(o)&&(i=o),this[t]=i?l(i)[e]:o):this[t]=0},m.prototype.layoutItems=function(t,e){t=this._getItemsForLayout(t),this._layoutItems(t,e),this._postLayout()},m.prototype._getItemsForLayout=function(t){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i];n.isIgnored||e.push(n)}return e},m.prototype._layoutItems=function(t,e){function i(){o.emitEvent("layoutComplete",[o,t])}var o=this;if(!t||!t.length)return i(),void 0;this._itemsOn(t,"layout",i);for(var n=[],r=0,s=t.length;s>r;r++){var a=t[r],u=this._getItemLayoutPosition(a);u.item=a,u.isInstant=e||a.isLayoutInstant,n.push(u)}this._processLayoutQueue(n)},m.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},m.prototype._processLayoutQueue=function(t){for(var e=0,i=t.length;i>e;e++){var o=t[e];this._positionItem(o.item,o.x,o.y,o.isInstant)}},m.prototype._positionItem=function(t,e,i,o){o?t.goTo(e,i):t.moveTo(e,i)},m.prototype._postLayout=function(){this.resizeContainer()},m.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var t=this._getContainerSize();t&&(this._setContainerMeasure(t.width,!0),this._setContainerMeasure(t.height,!1))}},m.prototype._getContainerSize=h,m.prototype._setContainerMeasure=function(t,e){if(void 0!==t){var i=this.size;i.isBorderBox&&(t+=e?i.paddingLeft+i.paddingRight+i.borderLeftWidth+i.borderRightWidth:i.paddingBottom+i.paddingTop+i.borderTopWidth+i.borderBottomWidth),t=Math.max(t,0),this.element.style[e?"width":"height"]=t+"px"}},m.prototype._itemsOn=function(t,e,i){function o(){return n++,n===r&&i.call(s),!0}for(var n=0,r=t.length,s=this,a=0,u=t.length;u>a;a++){var p=t[a];p.on(e,o)}},m.prototype.ignore=function(t){var e=this.getItem(t);e&&(e.isIgnored=!0)},m.prototype.unignore=function(t){var e=this.getItem(t);e&&delete e.isIgnored},m.prototype.stamp=function(t){if(t=this._find(t)){this.stamps=this.stamps.concat(t);for(var e=0,i=t.length;i>e;e++){var o=t[e];this.ignore(o)}}},m.prototype.unstamp=function(t){if(t=this._find(t))for(var e=0,i=t.length;i>e;e++){var o=t[e];n(o,this.stamps),this.unignore(o)}},m.prototype._find=function(t){return t?("string"==typeof t&&(t=this.element.querySelectorAll(t)),t=o(t)):void 0},m.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var t=0,e=this.stamps.length;e>t;t++){var i=this.stamps[t];this._manageStamp(i)}}},m.prototype._getBoundingRect=function(){var t=this.element.getBoundingClientRect(),e=this.size;this._boundingRect={left:t.left+e.paddingLeft+e.borderLeftWidth,top:t.top+e.paddingTop+e.borderTopWidth,right:t.right-(e.paddingRight+e.borderRightWidth),bottom:t.bottom-(e.paddingBottom+e.borderBottomWidth)}},m.prototype._manageStamp=h,m.prototype._getElementOffset=function(t){var e=t.getBoundingClientRect(),i=this._boundingRect,o=l(t),n={left:e.left-i.left-o.marginLeft,top:e.top-i.top-o.marginTop,right:i.right-e.right-o.marginRight,bottom:i.bottom-e.bottom-o.marginBottom};return n},m.prototype.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},m.prototype.bindResize=function(){this.isResizeBound||(i.bind(t,"resize",this),this.isResizeBound=!0)},m.prototype.unbindResize=function(){this.isResizeBound&&i.unbind(t,"resize",this),this.isResizeBound=!1},m.prototype.onresize=function(){function t(){e.resize(),delete e.resizeTimeout}this.resizeTimeout&&clearTimeout(this.resizeTimeout);var e=this;this.resizeTimeout=setTimeout(t,100)},m.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},m.prototype.needsResizeLayout=function(){var t=l(this.element),e=this.size&&t;return e&&t.innerWidth!==this.size.innerWidth},m.prototype.addItems=function(t){var e=this._itemize(t);return e.length&&(this.items=this.items.concat(e)),e},m.prototype.appended=function(t){var e=this.addItems(t);e.length&&(this.layoutItems(e,!0),this.reveal(e))},m.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps(),this.layoutItems(e,!0),this.reveal(e),this.layoutItems(i)}},m.prototype.reveal=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.reveal()}},m.prototype.hide=function(t){var e=t&&t.length;if(e)for(var i=0;e>i;i++){var o=t[i];o.hide()}},m.prototype.getItem=function(t){for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];if(o.element===t)return o}},m.prototype.getItems=function(t){if(t&&t.length){for(var e=[],i=0,o=t.length;o>i;i++){var n=t[i],r=this.getItem(n);r&&e.push(r)}return e}},m.prototype.remove=function(t){t=o(t);var e=this.getItems(t);if(e&&e.length){this._itemsOn(e,"remove",function(){this.emitEvent("removeComplete",[this,e])});for(var i=0,r=e.length;r>i;i++){var s=e[i];s.remove(),n(s,this.items)}}},m.prototype.destroy=function(){var t=this.element.style;t.height="",t.position="",t.width="";for(var e=0,i=this.items.length;i>e;e++){var o=this.items[e];o.destroy()}this.unbindResize();var n=this.element.outlayerGUID;delete v[n],delete this.element.outlayerGUID,p&&p.removeData(this.element,this.constructor.namespace)},m.data=function(t){var e=t&&t.outlayerGUID;return e&&v[e]},m.create=function(t,i){function o(){m.apply(this,arguments)}return Object.create?o.prototype=Object.create(m.prototype):e(o.prototype,m.prototype),o.prototype.constructor=o,o.defaults=e({},m.defaults),e(o.defaults,i),o.prototype.settings={},o.namespace=t,o.data=m.data,o.Item=function(){y.apply(this,arguments)},o.Item.prototype=new y,s(function(){for(var e=r(t),i=a.querySelectorAll(".js-"+e),n="data-"+e+"-options",s=0,h=i.length;h>s;s++){var f,d=i[s],l=d.getAttribute(n);try{f=l&&JSON.parse(l)}catch(c){u&&u.error("Error parsing "+n+" on "+d.nodeName.toLowerCase()+(d.id?"#"+d.id:"")+": "+c);continue}var y=new o(d,f);p&&p.data(d,t,y)}}),p&&p.bridget&&p.bridget(t,o),o},m.Item=y,m}var a=t.document,u=t.console,p=t.jQuery,h=function(){},f=Object.prototype.toString,d="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(t){return t instanceof HTMLElement}:function(t){return t&&"object"==typeof t&&1===t.nodeType&&"string"==typeof t.nodeName},l=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","doc-ready/doc-ready","eventEmitter/EventEmitter","get-size/get-size","matches-selector/matches-selector","./item"],s):"object"==typeof exports?module.exports=s(require("eventie"),require("doc-ready"),require("wolfy87-eventemitter"),require("get-size"),require("desandro-matches-selector"),require("./item")):t.Outlayer=s(t.eventie,t.docReady,t.EventEmitter,t.getSize,t.matchesSelector,t.Outlayer.Item)}(window),function(t){function e(t){function e(){t.Item.apply(this,arguments)}e.prototype=new t.Item,e.prototype._create=function(){this.id=this.layout.itemGUID++,t.Item.prototype._create.call(this),this.sortData={}},e.prototype.updateSortData=function(){if(!this.isIgnored){this.sortData.id=this.id,this.sortData["original-order"]=this.id,this.sortData.random=Math.random();var t=this.layout.options.getSortData,e=this.layout._sorters;for(var i in t){var o=e[i];this.sortData[i]=o(this.element,this)}}};var i=e.prototype.destroy;return e.prototype.destroy=function(){i.apply(this,arguments),this.css({display:""})},e}"function"==typeof define&&define.amd?define("isotope/js/item",["outlayer/outlayer"],e):"object"==typeof exports?module.exports=e(require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.Item=e(t.Outlayer))}(window),function(t){function e(t,e){function i(t){this.isotope=t,t&&(this.options=t.options[this.namespace],this.element=t.element,this.items=t.filteredItems,this.size=t.size)}return function(){function t(t){return function(){return e.prototype[t].apply(this.isotope,arguments)}}for(var o=["_resetLayout","_getItemLayoutPosition","_manageStamp","_getContainerSize","_getElementOffset","needsResizeLayout"],n=0,r=o.length;r>n;n++){var s=o[n];i.prototype[s]=t(s)}}(),i.prototype.needsVerticalResizeLayout=function(){var e=t(this.isotope.element),i=this.isotope.size&&e;return i&&e.innerHeight!==this.isotope.size.innerHeight},i.prototype._getMeasurement=function(){this.isotope._getMeasurement.apply(this,arguments)},i.prototype.getColumnWidth=function(){this.getSegmentSize("column","Width")},i.prototype.getRowHeight=function(){this.getSegmentSize("row","Height")},i.prototype.getSegmentSize=function(t,e){var i=t+e,o="outer"+e;if(this._getMeasurement(i,o),!this[i]){var n=this.getFirstItemSize();this[i]=n&&n[o]||this.isotope.size["inner"+e]}},i.prototype.getFirstItemSize=function(){var e=this.isotope.filteredItems[0];return e&&e.element&&t(e.element)},i.prototype.layout=function(){this.isotope.layout.apply(this.isotope,arguments)},i.prototype.getSize=function(){this.isotope.getSize(),this.size=this.isotope.size},i.modes={},i.create=function(t,e){function o(){i.apply(this,arguments)}return o.prototype=new i,e&&(o.options=e),o.prototype.namespace=t,i.modes[t]=o,o},i}"function"==typeof define&&define.amd?define("isotope/js/layout-mode",["get-size/get-size","outlayer/outlayer"],e):"object"==typeof exports?module.exports=e(require("get-size"),require("outlayer")):(t.Isotope=t.Isotope||{},t.Isotope.LayoutMode=e(t.getSize,t.Outlayer))}(window),function(t){function e(t,e){var o=t.create("masonry");return o.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var t=this.cols;for(this.colYs=[];t--;)this.colYs.push(0);this.maxY=0},o.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var t=this.items[0],i=t&&t.element;this.columnWidth=i&&e(i).outerWidth||this.containerWidth}this.columnWidth+=this.gutter,this.cols=Math.floor((this.containerWidth+this.gutter)/this.columnWidth),this.cols=Math.max(this.cols,1)},o.prototype.getContainerWidth=function(){var t=this.options.isFitWidth?this.element.parentNode:this.element,i=e(t);this.containerWidth=i&&i.innerWidth},o.prototype._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth%this.columnWidth,o=e&&1>e?"round":"ceil",n=Math[o](t.size.outerWidth/this.columnWidth);n=Math.min(n,this.cols);for(var r=this._getColGroup(n),s=Math.min.apply(Math,r),a=i(r,s),u={x:this.columnWidth*a,y:s},p=s+t.size.outerHeight,h=this.cols+1-r.length,f=0;h>f;f++)this.colYs[a+f]=p;return u},o.prototype._getColGroup=function(t){if(2>t)return this.colYs;for(var e=[],i=this.cols+1-t,o=0;i>o;o++){var n=this.colYs.slice(o,o+t);e[o]=Math.max.apply(Math,n)}return e},o.prototype._manageStamp=function(t){var i=e(t),o=this._getElementOffset(t),n=this.options.isOriginLeft?o.left:o.right,r=n+i.outerWidth,s=Math.floor(n/this.columnWidth);s=Math.max(0,s);var a=Math.floor(r/this.columnWidth);a-=r%this.columnWidth?0:1,a=Math.min(this.cols-1,a);for(var u=(this.options.isOriginTop?o.top:o.bottom)+i.outerHeight,p=s;a>=p;p++)this.colYs[p]=Math.max(u,this.colYs[p])},o.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var t={height:this.maxY};return this.options.isFitWidth&&(t.width=this._getContainerFitWidth()),t},o.prototype._getContainerFitWidth=function(){for(var t=0,e=this.cols;--e&&0===this.colYs[e];)t++;return(this.cols-t)*this.columnWidth-this.gutter},o.prototype.needsResizeLayout=function(){var t=this.containerWidth;return this.getContainerWidth(),t!==this.containerWidth},o}var i=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++){var n=t[i];if(n===e)return i}return-1};"function"==typeof define&&define.amd?define("masonry/masonry",["outlayer/outlayer","get-size/get-size"],e):"object"==typeof exports?module.exports=e(require("outlayer"),require("get-size")):t.Masonry=e(t.Outlayer,t.getSize)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t,i){var o=t.create("masonry"),n=o.prototype._getElementOffset,r=o.prototype.layout,s=o.prototype._getMeasurement;e(o.prototype,i.prototype),o.prototype._getElementOffset=n,o.prototype.layout=r,o.prototype._getMeasurement=s;var a=o.prototype.measureColumns;o.prototype.measureColumns=function(){this.items=this.isotope.filteredItems,a.call(this)};var u=o.prototype._manageStamp;return o.prototype._manageStamp=function(){this.options.isOriginLeft=this.isotope.options.isOriginLeft,this.options.isOriginTop=this.isotope.options.isOriginTop,u.apply(this,arguments)},o}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/masonry",["../layout-mode","masonry/masonry"],i):"object"==typeof exports?module.exports=i(require("../layout-mode"),require("masonry-layout")):i(t.Isotope.LayoutMode,t.Masonry)}(window),function(t){function e(t){var e=t.create("fitRows");return e.prototype._resetLayout=function(){this.x=0,this.y=0,this.maxY=0,this._getMeasurement("gutter","outerWidth")},e.prototype._getItemLayoutPosition=function(t){t.getSize();var e=t.size.outerWidth+this.gutter,i=this.isotope.size.innerWidth+this.gutter;0!==this.x&&e+this.x>i&&(this.x=0,this.y=this.maxY);var o={x:this.x,y:this.y};return this.maxY=Math.max(this.maxY,this.y+t.size.outerHeight),this.x+=e,o},e.prototype._getContainerSize=function(){return{height:this.maxY}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/fit-rows",["../layout-mode"],e):"object"==typeof exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window),function(t){function e(t){var e=t.create("vertical",{horizontalAlignment:0});return e.prototype._resetLayout=function(){this.y=0},e.prototype._getItemLayoutPosition=function(t){t.getSize();var e=(this.isotope.size.innerWidth-t.size.outerWidth)*this.options.horizontalAlignment,i=this.y;return this.y+=t.size.outerHeight,{x:e,y:i}},e.prototype._getContainerSize=function(){return{height:this.y}},e}"function"==typeof define&&define.amd?define("isotope/js/layout-modes/vertical",["../layout-mode"],e):"object"==typeof exports?module.exports=e(require("../layout-mode")):e(t.Isotope.LayoutMode)}(window),function(t){function e(t,e){for(var i in e)t[i]=e[i];return t}function i(t){return"[object Array]"===h.call(t)}function o(t){var e=[];if(i(t))e=t;else if(t&&"number"==typeof t.length)for(var o=0,n=t.length;n>o;o++)e.push(t[o]);else e.push(t);return e}function n(t,e){var i=f(e,t);-1!==i&&e.splice(i,1)}function r(t,i,r,u,h){function f(t,e){return function(i,o){for(var n=0,r=t.length;r>n;n++){var s=t[n],a=i.sortData[s],u=o.sortData[s];if(a>u||u>a){var p=void 0!==e[s]?e[s]:e,h=p?1:-1;return(a>u?1:-1)*h}}return 0}}var d=t.create("isotope",{layoutMode:"masonry",isJQueryFiltering:!0,sortAscending:!0});d.Item=u,d.LayoutMode=h,d.prototype._create=function(){this.itemGUID=0,this._sorters={},this._getSorters(),t.prototype._create.call(this),this.modes={},this.filteredItems=this.items,this.sortHistory=["original-order"];for(var e in h.modes)this._initLayoutMode(e)},d.prototype.reloadItems=function(){this.itemGUID=0,t.prototype.reloadItems.call(this)},d.prototype._itemize=function(){for(var e=t.prototype._itemize.apply(this,arguments),i=0,o=e.length;o>i;i++){var n=e[i];n.id=this.itemGUID++}return this._updateItemsSortData(e),e
},d.prototype._initLayoutMode=function(t){var i=h.modes[t],o=this.options[t]||{};this.options[t]=i.options?e(i.options,o):o,this.modes[t]=new i(this)},d.prototype.layout=function(){return!this._isLayoutInited&&this.options.isInitLayout?(this.arrange(),void 0):(this._layout(),void 0)},d.prototype._layout=function(){var t=this._getIsInstant();this._resetLayout(),this._manageStamps(),this.layoutItems(this.filteredItems,t),this._isLayoutInited=!0},d.prototype.arrange=function(t){this.option(t),this._getIsInstant(),this.filteredItems=this._filter(this.items),this._sort(),this._layout()},d.prototype._init=d.prototype.arrange,d.prototype._getIsInstant=function(){var t=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;return this._isInstant=t,t},d.prototype._filter=function(t){function e(){f.reveal(n),f.hide(r)}var i=this.options.filter;i=i||"*";for(var o=[],n=[],r=[],s=this._getFilterTest(i),a=0,u=t.length;u>a;a++){var p=t[a];if(!p.isIgnored){var h=s(p);h&&o.push(p),h&&p.isHidden?n.push(p):h||p.isHidden||r.push(p)}}var f=this;return this._isInstant?this._noTransition(e):e(),o},d.prototype._getFilterTest=function(t){return s&&this.options.isJQueryFiltering?function(e){return s(e.element).is(t)}:"function"==typeof t?function(e){return t(e.element)}:function(e){return r(e.element,t)}},d.prototype.updateSortData=function(t){var e;t?(t=o(t),e=this.getItems(t)):e=this.items,this._getSorters(),this._updateItemsSortData(e)},d.prototype._getSorters=function(){var t=this.options.getSortData;for(var e in t){var i=t[e];this._sorters[e]=l(i)}},d.prototype._updateItemsSortData=function(t){for(var e=t&&t.length,i=0;e&&e>i;i++){var o=t[i];o.updateSortData()}};var l=function(){function t(t){if("string"!=typeof t)return t;var i=a(t).split(" "),o=i[0],n=o.match(/^\[(.+)\]$/),r=n&&n[1],s=e(r,o),u=d.sortDataParsers[i[1]];return t=u?function(t){return t&&u(s(t))}:function(t){return t&&s(t)}}function e(t,e){var i;return i=t?function(e){return e.getAttribute(t)}:function(t){var i=t.querySelector(e);return i&&p(i)}}return t}();d.sortDataParsers={parseInt:function(t){return parseInt(t,10)},parseFloat:function(t){return parseFloat(t)}},d.prototype._sort=function(){var t=this.options.sortBy;if(t){var e=[].concat.apply(t,this.sortHistory),i=f(e,this.options.sortAscending);this.filteredItems.sort(i),t!==this.sortHistory[0]&&this.sortHistory.unshift(t)}},d.prototype._mode=function(){var t=this.options.layoutMode,e=this.modes[t];if(!e)throw Error("No layout mode: "+t);return e.options=this.options[t],e},d.prototype._resetLayout=function(){t.prototype._resetLayout.call(this),this._mode()._resetLayout()},d.prototype._getItemLayoutPosition=function(t){return this._mode()._getItemLayoutPosition(t)},d.prototype._manageStamp=function(t){this._mode()._manageStamp(t)},d.prototype._getContainerSize=function(){return this._mode()._getContainerSize()},d.prototype.needsResizeLayout=function(){return this._mode().needsResizeLayout()},d.prototype.appended=function(t){var e=this.addItems(t);if(e.length){var i=this._filterRevealAdded(e);this.filteredItems=this.filteredItems.concat(i)}},d.prototype.prepended=function(t){var e=this._itemize(t);if(e.length){var i=this.items.slice(0);this.items=e.concat(i),this._resetLayout(),this._manageStamps();var o=this._filterRevealAdded(e);this.layoutItems(i),this.filteredItems=o.concat(this.filteredItems)}},d.prototype._filterRevealAdded=function(t){var e=this._noTransition(function(){return this._filter(t)});return this.layoutItems(e,!0),this.reveal(e),t},d.prototype.insert=function(t){var e=this.addItems(t);if(e.length){var i,o,n=e.length;for(i=0;n>i;i++)o=e[i],this.element.appendChild(o.element);var r=this._filter(e);for(this._noTransition(function(){this.hide(r)}),i=0;n>i;i++)e[i].isLayoutInstant=!0;for(this.arrange(),i=0;n>i;i++)delete e[i].isLayoutInstant;this.reveal(r)}};var c=d.prototype.remove;return d.prototype.remove=function(t){t=o(t);var e=this.getItems(t);if(c.call(this,t),e&&e.length)for(var i=0,r=e.length;r>i;i++){var s=e[i];n(s,this.filteredItems)}},d.prototype.shuffle=function(){for(var t=0,e=this.items.length;e>t;t++){var i=this.items[t];i.sortData.random=Math.random()}this.options.sortBy="random",this._sort(),this._layout()},d.prototype._noTransition=function(t){var e=this.options.transitionDuration;this.options.transitionDuration=0;var i=t.call(this);return this.options.transitionDuration=e,i},d.prototype.getFilteredItemElements=function(){for(var t=[],e=0,i=this.filteredItems.length;i>e;e++)t.push(this.filteredItems[e].element);return t},d}var s=t.jQuery,a=String.prototype.trim?function(t){return t.trim()}:function(t){return t.replace(/^\s+|\s+$/g,"")},u=document.documentElement,p=u.textContent?function(t){return t.textContent}:function(t){return t.innerText},h=Object.prototype.toString,f=Array.prototype.indexOf?function(t,e){return t.indexOf(e)}:function(t,e){for(var i=0,o=t.length;o>i;i++)if(t[i]===e)return i;return-1};"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","matches-selector/matches-selector","isotope/js/item","isotope/js/layout-mode","isotope/js/layout-modes/masonry","isotope/js/layout-modes/fit-rows","isotope/js/layout-modes/vertical"],r):"object"==typeof exports?module.exports=r(require("outlayer"),require("get-size"),require("desandro-matches-selector"),require("./item"),require("./layout-mode"),require("./layout-modes/masonry"),require("./layout-modes/fit-rows"),require("./layout-modes/vertical")):t.Isotope=r(t.Outlayer,t.getSize,t.matchesSelector,t.Isotope.Item,t.Isotope.LayoutMode)}(window);
!function(a,b,c,d){var e=a(b);a.fn.lazyload=function(f){function g(){var b=0;i.each(function(){var c=a(this);if(!j.skip_invisible||c.is(":visible"))if(a.abovethetop(this,j)||a.leftofbegin(this,j));else if(a.belowthefold(this,j)||a.rightoffold(this,j)){if(++b>j.failure_limit)return!1}else c.trigger("appear"),b=0})}var h,i=this,j={threshold:0,failure_limit:0,event:"scroll",effect:"show",container:b,data_attribute:"original",skip_invisible:!0,appear:null,load:null,placeholder:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB/AAffA0nNPuCLAAAAAElFTkSuQmCC"};return f&&(d!==f.failurelimit&&(f.failure_limit=f.failurelimit,delete f.failurelimit),d!==f.effectspeed&&(f.effect_speed=f.effectspeed,delete f.effectspeed),a.extend(j,f)),h=j.container===d||j.container===b?e:a(j.container),0===j.event.indexOf("scroll")&&h.bind(j.event,function(){return g()}),this.each(function(){var b=this,c=a(b);b.loaded=!1,(c.attr("src")===d||c.attr("src")===!1)&&c.is("img")&&c.attr("src",j.placeholder),c.one("appear",function(){if(!this.loaded){if(j.appear){var d=i.length;j.appear.call(b,d,j)}a(" ").bind("load",function(){var d=c.attr("data-"+j.data_attribute);c.hide(),c.is("img")?c.attr("src",d):c.css("background-image","url('"+d+"')"),c[j.effect](j.effect_speed),b.loaded=!0;var e=a.grep(i,function(a){return!a.loaded});if(i=a(e),j.load){var f=i.length;j.load.call(b,f,j)}}).attr("src",c.attr("data-"+j.data_attribute))}}),0!==j.event.indexOf("scroll")&&c.bind(j.event,function(){b.loaded||c.trigger("appear")})}),e.bind("resize",function(){g()}),/(?:iphone|ipod|ipad).*os 5/gi.test(navigator.appVersion)&&e.bind("pageshow",function(b){b.originalEvent&&b.originalEvent.persisted&&i.each(function(){a(this).trigger("appear")})}),a(c).ready(function(){g()}),this},a.belowthefold=function(c,f){var g;return g=f.container===d||f.container===b?(b.innerHeight?b.innerHeight:e.height())+e.scrollTop():a(f.container).offset().top+a(f.container).height(),g<=a(c).offset().top-f.threshold},a.rightoffold=function(c,f){var g;return g=f.container===d||f.container===b?e.width()+e.scrollLeft():a(f.container).offset().left+a(f.container).width(),g<=a(c).offset().left-f.threshold},a.abovethetop=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollTop():a(f.container).offset().top,g>=a(c).offset().top+f.threshold+a(c).height()},a.leftofbegin=function(c,f){var g;return g=f.container===d||f.container===b?e.scrollLeft():a(f.container).offset().left,g>=a(c).offset().left+f.threshold+a(c).width()},a.inviewport=function(b,c){return!(a.rightoffold(b,c)||a.leftofbegin(b,c)||a.belowthefold(b,c)||a.abovethetop(b,c))},a.extend(a.expr[":"],{"below-the-fold":function(b){return a.belowthefold(b,{threshold:0})},"above-the-top":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-screen":function(b){return a.rightoffold(b,{threshold:0})},"left-of-screen":function(b){return!a.rightoffold(b,{threshold:0})},"in-viewport":function(b){return a.inviewport(b,{threshold:0})},"above-the-fold":function(b){return!a.belowthefold(b,{threshold:0})},"right-of-fold":function(b){return a.rightoffold(b,{threshold:0})},"left-of-fold":function(b){return!a.rightoffold(b,{threshold:0})}})}(jQuery,window,document);
!function(a){function f(a,b){if(!(a.originalEvent.touches.length>1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery);
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;hc;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(' '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a(' ');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(' '),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a(" ")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html(''),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('× ');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('× ');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a(' ');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var 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","Ⓓ":"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","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");
if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a(' ');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a(' '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(" "),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null;
},e.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&(f=d(this),null!=f&&g.push(f))})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;return this._isInitialized?void b.call(this,c):void this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `` element instead."),a.call(this,b,c)}return b.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f=0;f--){var g=d.children[f],h=b(c.term,g.text,g);h||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c;var d=this.options.get("query");d.call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){var d=c.find(".dropdown-wrapper");d.append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery-mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(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)}})}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
!function(e,t,n){"use strict";function s(e){var t=Array.prototype.slice.call(arguments,1);return e.prop?e.prop.apply(e,t):e.attr.apply(e,t)}function a(e,t,n){var s,a;for(s in n)n.hasOwnProperty(s)&&(a=s.replace(/ |$/g,t.eventNamespace),e.bind(a,n[s]))}function r(e,t,n){a(e,n,{focus:function(){t.addClass(n.focusClass)},blur:function(){t.removeClass(n.focusClass),t.removeClass(n.activeClass)},mouseenter:function(){t.addClass(n.hoverClass)},mouseleave:function(){t.removeClass(n.hoverClass),t.removeClass(n.activeClass)},"mousedown touchbegin":function(){e.is(":disabled")||t.addClass(n.activeClass)},"mouseup touchend":function(){t.removeClass(n.activeClass)}})}function i(e,t){e.removeClass(t.hoverClass+" "+t.focusClass+" "+t.activeClass)}function l(e,t,n){n?e.addClass(t):e.removeClass(t)}function u(e,t,n){var s="checked",a=t.is(":"+s);t.prop?t.prop(s,a):a?t.attr(s,s):t.removeAttr(s),l(e,n.checkedClass,a)}function o(e,t,n){l(e,n.disabledClass,t.is(":disabled"))}function c(e,t,n){switch(n){case"after":return e.after(t),e.next();case"before":return e.before(t),e.prev();case"wrap":return e.wrap(t),e.parent()}return null}function d(e,n,a){var r,i,l;return a||(a={}),a=t.extend({bind:{},divClass:null,divWrap:"wrap",spanClass:null,spanHtml:null,spanWrap:"wrap"},a),r=t("
"),i=t(" "),n.autoHide&&e.is(":hidden")&&"none"===e.css("display")&&r.hide(),a.divClass&&r.addClass(a.divClass),n.wrapperClass&&r.addClass(n.wrapperClass),a.spanClass&&i.addClass(a.spanClass),l=s(e,"id"),n.useID&&l&&s(r,"id",n.idPrefix+"-"+l),a.spanHtml&&i.html(a.spanHtml),r=c(e,r,a.divWrap),i=c(e,i,a.spanWrap),o(r,e,n),{div:r,span:i}}function f(e,n){var s;return n.wrapperClass?(s=t(" ").addClass(n.wrapperClass),s=c(e,s,"wrap")):null}function p(){var n,s,a,r;return r="rgb(120,2,153)",s=t(''),t("body").append(s),a=s.get(0),n=e.getComputedStyle?e.getComputedStyle(a,"").color:(a.currentStyle||a.style||{}).color,s.remove(),n.replace(/ /g,"")!==r}function m(e){return e?t("
").text(e).html():""}function v(){return navigator.cpuClass&&!navigator.product}function h(){return void 0!==e.XMLHttpRequest?!0:!1}function C(e){var t;return e[0].multiple?!0:(t=s(e,"size"),!t||1>=t?!1:!0)}function b(){return!1}function y(e,t){var n="none";a(e,t,{"selectstart dragstart mousedown":b}),e.css({MozUserSelect:n,msUserSelect:n,webkitUserSelect:n,userSelect:n})}function w(e,t,n){var s=e.val();""===s?s=n.fileDefaultHtml:(s=s.split(/[\/\\]+/),s=s[s.length-1]),t.text(s)}function g(e,t,n){var s,a;for(s=[],e.each(function(){var e;for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(s.push({el:this,name:e,old:this.style[e]}),this.style[e]=t[e])}),n();s.length;)a=s.pop(),a.el.style[a.name]=a.old}function k(e,t){var n;n=e.parents(),n.push(e[0]),n=n.not(":visible"),g(n,{visibility:"hidden",display:"block",position:"absolute"},t)}function H(e,t){return function(){e.unwrap().unwrap().unbind(t.eventNamespace)}}var x=!0,A=!1,W=[{match:function(e){return e.is("a, button, :submit, :reset, input[type='button']")},apply:function(t,n){var l,u,c,f,p;return u=n.submitDefaultHtml,t.is(":reset")&&(u=n.resetDefaultHtml),f=t.is("a, button")?function(){return t.html()||u}:function(){return m(s(t,"value"))||u},c=d(t,n,{divClass:n.buttonClass,spanHtml:f()}),l=c.div,r(t,l,n),p=!1,a(l,n,{"click touchend":function(){var n,a,r,i;p||t.is(":disabled")||(p=!0,t[0].dispatchEvent?(n=document.createEvent("MouseEvents"),n.initEvent("click",!0,!0),a=t[0].dispatchEvent(n),t.is("a")&&a&&(r=s(t,"target"),i=s(t,"href"),r&&"_self"!==r?e.open(i,r):document.location.href=i)):t.click(),p=!1)}}),y(l,n),{remove:function(){return l.after(t),l.remove(),t.unbind(n.eventNamespace),t},update:function(){i(l,n),o(l,t,n),t.detach(),c.span.html(f()).append(t)}}}},{match:function(e){return e.is(":checkbox")},apply:function(e,t){var n,s,l;return n=d(e,t,{divClass:t.checkboxClass}),s=n.div,l=n.span,r(e,s,t),a(e,t,{"click touchend":function(){u(l,e,t)}}),u(l,e,t),{remove:H(e,t),update:function(){i(s,t),l.removeClass(t.checkedClass),u(l,e,t),o(s,e,t)}}}},{match:function(e){return e.is(":file")},apply:function(e,n){function l(){w(e,p,n)}var u,f,p,m;return u=d(e,n,{divClass:n.fileClass,spanClass:n.fileButtonClass,spanHtml:n.fileButtonHtml,spanWrap:"after"}),f=u.div,m=u.span,p=t("
").html(n.fileDefaultHtml),p.addClass(n.filenameClass),p=c(e,p,"after"),s(e,"size")||s(e,"size",f.width()/10),r(e,f,n),l(),v()?a(e,n,{click:function(){e.trigger("change"),setTimeout(l,0)}}):a(e,n,{change:l}),y(p,n),y(m,n),{remove:function(){return p.remove(),m.remove(),e.unwrap().unbind(n.eventNamespace)},update:function(){i(f,n),w(e,p,n),o(f,e,n)}}}},{match:function(e){if(e.is("input")){var t=(" "+s(e,"type")+" ").toLowerCase(),n=" color date datetime datetime-local email month number password search tel text time url week ";return n.indexOf(t)>=0}return!1},apply:function(e,t){var n,a;return n=s(e,"type"),e.addClass(t.inputClass),a=f(e,t),r(e,e,t),t.inputAddTypeAsClass&&e.addClass(n),{remove:function(){e.removeClass(t.inputClass),t.inputAddTypeAsClass&&e.removeClass(n),a&&e.unwrap()},update:b}}},{match:function(e){return e.is(":radio")},apply:function(e,n){var l,c,f;return l=d(e,n,{divClass:n.radioClass}),c=l.div,f=l.span,r(e,c,n),a(e,n,{"click touchend":function(){t.uniform.update(t(':radio[name="'+s(e,"name")+'"]'))}}),u(f,e,n),{remove:H(e,n),update:function(){i(c,n),u(f,e,n),o(c,e,n)}}}},{match:function(e){return e.is("select")&&!C(e)?!0:!1},apply:function(e,n){var s,l,u,c;return n.selectAutoWidth&&k(e,function(){c=e.width()}),s=d(e,n,{divClass:n.selectClass,spanHtml:(e.find(":selected:first")||e.find("option:first")).html(),spanWrap:"before"}),l=s.div,u=s.span,n.selectAutoWidth?k(e,function(){g(t([u[0],l[0]]),{display:"block"},function(){var e;e=u.outerWidth()-u.width(),l.width(c+e),u.width(c)})}):l.addClass("fixedWidth"),r(e,l,n),a(e,n,{change:function(){u.html(e.find(":selected").html()),l.removeClass(n.activeClass)},"click touchend":function(){var t=e.find(":selected").html();u.html()!==t&&e.trigger("change")},keyup:function(){u.html(e.find(":selected").html())}}),y(u,n),{remove:function(){return u.remove(),e.unwrap().unbind(n.eventNamespace),e},update:function(){n.selectAutoWidth?(t.uniform.restore(e),e.uniform(n)):(i(l,n),u.html(e.find(":selected").html()),o(l,e,n))}}}},{match:function(e){return e.is("select")&&C(e)?!0:!1},apply:function(e,t){var n;return e.addClass(t.selectMultiClass),n=f(e,t),r(e,e,t),{remove:function(){e.removeClass(t.selectMultiClass),n&&e.unwrap()},update:b}}},{match:function(e){return e.is("textarea")},apply:function(e,t){var n;return e.addClass(t.textareaClass),n=f(e,t),r(e,e,t),{remove:function(){e.removeClass(t.textareaClass),n&&e.unwrap()},update:b}}}];v()&&!h()&&(x=!1),t.uniform={defaults:{activeClass:"active",autoHide:!0,buttonClass:"button",checkboxClass:"checker",checkedClass:"checked",disabledClass:"disabled",eventNamespace:".uniform",fileButtonClass:"action",fileButtonHtml:"Choose File",fileClass:"uploader",fileDefaultHtml:"No file selected",filenameClass:"filename",focusClass:"focus",hoverClass:"hover",idPrefix:"uniform",inputAddTypeAsClass:!0,inputClass:"uniform-input",radioClass:"radio",resetDefaultHtml:"Reset",resetSelector:!1,selectAutoWidth:!0,selectClass:"selector",selectMultiClass:"uniform-multiselect",submitDefaultHtml:"Submit",textareaClass:"uniform",useID:!0,wrapperClass:null},elements:[]},t.fn.uniform=function(n){var s=this;return n=t.extend({},t.uniform.defaults,n),A||(A=!0,p()&&(x=!1)),x?(n.resetSelector&&t(n.resetSelector).mouseup(function(){e.setTimeout(function(){t.uniform.update(s)},10)}),this.each(function(){var e,s,a,r=t(this);if(r.data("uniformed"))return t.uniform.update(r),void 0;for(e=0;e
=0&&t.uniform.elements.splice(e,1),s.removeData("uniformed"))})},t.uniform.update=t.fn.uniform.update=function(e){e===n&&(e=t.uniform.elements),t(e).each(function(){var e,n=t(this);e=n.data("uniformed"),e&&e.update(n,e.options)})}}(this,jQuery);
var DateFormatter;!function(){"use strict";var t,e,r,n,a,u,i;u=864e5,i=3600,t=function(t,e){return"string"==typeof t&&"string"==typeof e&&t.toLowerCase()===e.toLowerCase()},e=function(t,r,n){var a=n||"0",u=t.toString();return u.lengths?"20":"19")+i):s,g=!0;break;case"m":case"n":case"M":case"F":if(isNaN(s)){if(o=d.getMonth(i),!(o>0))return null;y.month=o}else{if(!(s>=1&&12>=s))return null;y.month=s}g=!0;break;case"d":case"j":if(!(s>=1&&31>=s))return null;y.day=s,g=!0;break;case"g":case"h":if(c=n.indexOf("a")>-1?n.indexOf("a"):n.indexOf("A")>-1?n.indexOf("A"):-1,h=a[c],c>-1)f=t(h,p.meridiem[0])?0:t(h,p.meridiem[1])?12:-1,s>=1&&12>=s&&f>-1?y.hour=s+f-1:s>=0&&23>=s&&(y.hour=s);else{if(!(s>=0&&23>=s))return null;y.hour=s}m=!0;break;case"G":case"H":if(!(s>=0&&23>=s))return null;y.hour=s,m=!0;break;case"i":if(!(s>=0&&59>=s))return null;y.min=s,m=!0;break;case"s":if(!(s>=0&&59>=s))return null;y.sec=s,m=!0}if(g===!0&&y.year&&y.month&&y.day)y.date=new Date(y.year,y.month-1,y.day,y.hour,y.min,y.sec,0);else{if(m!==!0)return null;y.date=new Date(0,0,0,y.hour,y.min,y.sec,0)}return y.date},guessDate:function(t,e){if("string"!=typeof t)return t;var r,n,a,u,i,s,o=this,c=t.replace(o.separators,"\x00").split("\x00"),f=/^[djmn]/g,l=e.match(o.validParts),h=new Date,d=0;if(!f.test(l[0]))return t;for(a=0;ar?r:4,n=parseInt(4>r?n.toString().substr(0,4-r)+i:i.substr(0,4)),!n)return null;h.setFullYear(n);break;case 3:h.setHours(s);break;case 4:h.setMinutes(s);break;case 5:h.setSeconds(s)}u=i.substr(d),u.length>0&&c.splice(a+1,0,u)}return h},parseFormat:function(t,r){var n,a=this,s=a.dateSettings,o=/\\?(.?)/gi,c=function(t,e){return n[t]?n[t]():e};return n={d:function(){return e(n.j(),2)},D:function(){return s.daysShort[n.w()]},j:function(){return r.getDate()},l:function(){return s.days[n.w()]},N:function(){return n.w()||7},w:function(){return r.getDay()},z:function(){var t=new Date(n.Y(),n.n()-1,n.j()),e=new Date(n.Y(),0,1);return Math.round((t-e)/u)},W:function(){var t=new Date(n.Y(),n.n()-1,n.j()-n.N()+3),r=new Date(t.getFullYear(),0,4);return e(1+Math.round((t-r)/u/7),2)},F:function(){return s.months[r.getMonth()]},m:function(){return e(n.n(),2)},M:function(){return s.monthsShort[r.getMonth()]},n:function(){return r.getMonth()+1},t:function(){return new Date(n.Y(),n.n(),0).getDate()},L:function(){var t=n.Y();return t%4===0&&t%100!==0||t%400===0?1:0},o:function(){var t=n.n(),e=n.W(),r=n.Y();return r+(12===t&&9>e?1:1===t&&e>9?-1:0)},Y:function(){return r.getFullYear()},y:function(){return n.Y().toString().slice(-2)},a:function(){return n.A().toLowerCase()},A:function(){var t=n.G()<12?0:1;return s.meridiem[t]},B:function(){var t=r.getUTCHours()*i,n=60*r.getUTCMinutes(),a=r.getUTCSeconds();return e(Math.floor((t+n+a+i)/86.4)%1e3,3)},g:function(){return n.G()%12||12},G:function(){return r.getHours()},h:function(){return e(n.g(),2)},H:function(){return e(n.G(),2)},i:function(){return e(r.getMinutes(),2)},s:function(){return e(r.getSeconds(),2)},u:function(){return e(1e3*r.getMilliseconds(),6)},e:function(){var t=/\((.*)\)/.exec(String(r))[1];return t||"Coordinated Universal Time"},I:function(){var t=new Date(n.Y(),0),e=Date.UTC(n.Y(),0),r=new Date(n.Y(),6),a=Date.UTC(n.Y(),6);return t-e!==r-a?1:0},O:function(){var t=r.getTimezoneOffset(),n=Math.abs(t);return(t>0?"-":"+")+e(100*Math.floor(n/60)+n%60,4)},P:function(){var t=n.O();return t.substr(0,3)+":"+t.substr(3,2)},T:function(){var t=(String(r).match(a.tzParts)||[""]).pop().replace(a.tzClip,"");return t||"UTC"},Z:function(){return 60*-r.getTimezoneOffset()},c:function(){return"Y-m-d\\TH:i:sP".replace(o,c)},r:function(){return"D, d M Y H:i:s O".replace(o,c)},U:function(){return r.getTime()/1e3||0}},c(t,t)},formatDate:function(t,e){var r,n,a,u,i,s=this,o="",c="\\";if("string"==typeof t&&(t=s.parseDate(t,e),!t))return null;if(t instanceof Date){for(a=e.length,r=0;a>r;r++)i=e.charAt(r),"S"!==i&&i!==c&&(r>0&&e.charAt(r-1)===c?o+=i:(u=s.parseFormat(i,t),r!==a-1&&s.intParts.test(i)&&"S"===e.charAt(r+1)&&(n=parseInt(u)||0,u+=s.dateSettings.ordinal(n)),o+=u));return o}return""}}}();
var datetimepickerFactory=function ($){
'use strict';
var default_options={
i18n: {
ar: {
months: [
"كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"
],
dayOfWeekShort: [
"ن", "ث", "ع", "خ", "ج", "س", "ح"
],
dayOfWeek: ["الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت", "الأحد"]
},
ro: {
months: [
"Ianuarie", "Februarie", "Martie", "Aprilie", "Mai", "Iunie", "Iulie", "August", "Septembrie", "Octombrie", "Noiembrie", "Decembrie"
],
dayOfWeekShort: [
"Du", "Lu", "Ma", "Mi", "Jo", "Vi", "Sâ"
],
dayOfWeek: ["Duminică", "Luni", "Marţi", "Miercuri", "Joi", "Vineri", "Sâmbătă"]
},
id: {
months: [
"Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember"
],
dayOfWeekShort: [
"Min", "Sen", "Sel", "Rab", "Kam", "Jum", "Sab"
],
dayOfWeek: ["Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"]
},
is: {
months: [
"Janúar", "Febrúar", "Mars", "Apríl", "Maí", "Júní", "Júlí", "Ágúst", "September", "Október", "Nóvember", "Desember"
],
dayOfWeekShort: [
"Sun", "Mán", "Þrið", "Mið", "Fim", "Fös", "Lau"
],
dayOfWeek: ["Sunnudagur", "Mánudagur", "Þriðjudagur", "Miðvikudagur", "Fimmtudagur", "Föstudagur", "Laugardagur"]
},
bg: {
months: [
"Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември"
],
dayOfWeekShort: [
"Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
],
dayOfWeek: ["Неделя", "Понеделник", "Вторник", "Сряда", "Четвъртък", "Петък", "Събота"]
},
fa: {
months: [
'فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند'
],
dayOfWeekShort: [
'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'
],
dayOfWeek: ["یکشنبه", "دوشنبه", "سهشنبه", "چهارشنبه", "پنجشنبه", "جمعه", "شنبه", "یکشنبه"]
},
ru: {
months: [
'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'
],
dayOfWeekShort: [
"Вс", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб"
],
dayOfWeek: ["Воскресенье", "Понедельник", "Вторник", "Среда", "Четверг", "Пятница", "Суббота"]
},
uk: {
months: [
'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень'
],
dayOfWeekShort: [
"Ндл", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Сбт"
],
dayOfWeek: ["Неділя", "Понеділок", "Вівторок", "Середа", "Четвер", "П'ятниця", "Субота"]
},
en: {
months: [
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
],
dayOfWeekShort: [
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
],
dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
},
el: {
months: [
"Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος"
],
dayOfWeekShort: [
"Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ"
],
dayOfWeek: ["Κυριακή", "Δευτέρα", "Τρίτη", "Τετάρτη", "Πέμπτη", "Παρασκευή", "Σάββατο"]
},
de: {
months: [
'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember'
],
dayOfWeekShort: [
"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"
],
dayOfWeek: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"]
},
nl: {
months: [
"januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"
],
dayOfWeekShort: [
"zo", "ma", "di", "wo", "do", "vr", "za"
],
dayOfWeek: ["zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"]
},
tr: {
months: [
"Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık"
],
dayOfWeekShort: [
"Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts"
],
dayOfWeek: ["Pazar", "Pazartesi", "Salı", "Çarşamba", "Perşembe", "Cuma", "Cumartesi"]
},
fr: {
months: [
"Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre"
],
dayOfWeekShort: [
"Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam"
],
dayOfWeek: ["dimanche", "lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi"]
},
es: {
months: [
"Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre"
],
dayOfWeekShort: [
"Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb"
],
dayOfWeek: ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"]
},
th: {
months: [
'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม'
],
dayOfWeekShort: [
'อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.'
],
dayOfWeek: ["อาทิตย์", "จันทร์", "อังคาร", "พุธ", "พฤหัส", "ศุกร์", "เสาร์", "อาทิตย์"]
},
pl: {
months: [
"styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień"
],
dayOfWeekShort: [
"nd", "pn", "wt", "śr", "cz", "pt", "sb"
],
dayOfWeek: ["niedziela", "poniedziałek", "wtorek", "środa", "czwartek", "piątek", "sobota"]
},
pt: {
months: [
"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
],
dayOfWeekShort: [
"Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab"
],
dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"]
},
ch: {
months: [
"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
],
dayOfWeekShort: [
"日", "一", "二", "三", "四", "五", "六"
]
},
se: {
months: [
"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
],
dayOfWeekShort: [
"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
]
},
km: {
months: [
"មករា", "កុម្ភៈ", "មិនា", "មេសា", "ឧសភា", "មិថុនា", "កក្កដា", "សីហា", "កញ្ញា", "តុលា", "វិច្ឆិកា", "ធ្នូ"
],
dayOfWeekShort: ["អាទិ", "ច័ន្ទ", "អង្គារ", "ពុធ", "ព្រហ", "សុក្រ", "សៅរ៍"],
dayOfWeek: ["អាទិត្យ", "ច័ន្ទ", "អង្គារ", "ពុធ", "ព្រហស្បតិ៍", "សុក្រ", "សៅរ៍"]
},
kr: {
months: [
"1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
],
dayOfWeekShort: [
"일", "월", "화", "수", "목", "금", "토"
],
dayOfWeek: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"]
},
it: {
months: [
"Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre"
],
dayOfWeekShort: [
"Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab"
],
dayOfWeek: ["Domenica", "Lunedì", "Martedì", "Mercoledì", "Giovedì", "Venerdì", "Sabato"]
},
da: {
months: [
"Januar", "Februar", "Marts", "April", "Maj", "Juni", "Juli", "August", "September", "Oktober", "November", "December"
],
dayOfWeekShort: [
"Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
],
dayOfWeek: ["søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"]
},
no: {
months: [
"Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember"
],
dayOfWeekShort: [
"Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør"
],
dayOfWeek: ['Søndag', 'Mandag', 'Tirsdag', 'Onsdag', 'Torsdag', 'Fredag', 'Lørdag']
},
ja: {
months: [
"1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"
],
dayOfWeekShort: [
"日", "月", "火", "水", "木", "金", "土"
],
dayOfWeek: ["日曜", "月曜", "火曜", "水曜", "木曜", "金曜", "土曜"]
},
vi: {
months: [
"Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12"
],
dayOfWeekShort: [
"CN", "T2", "T3", "T4", "T5", "T6", "T7"
],
dayOfWeek: ["Chủ nhật", "Thứ hai", "Thứ ba", "Thứ tư", "Thứ năm", "Thứ sáu", "Thứ bảy"]
},
sl: {
months: [
"Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December"
],
dayOfWeekShort: [
"Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob"
],
dayOfWeek: ["Nedelja", "Ponedeljek", "Torek", "Sreda", "Četrtek", "Petek", "Sobota"]
},
cs: {
months: [
"Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec"
],
dayOfWeekShort: [
"Ne", "Po", "Út", "St", "Čt", "Pá", "So"
]
},
hu: {
months: [
"Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December"
],
dayOfWeekShort: [
"Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo"
],
dayOfWeek: ["vasárnap", "hétfő", "kedd", "szerda", "csütörtök", "péntek", "szombat"]
},
az: {
months: [
"Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr"
],
dayOfWeekShort: [
"B", "Be", "Ça", "Ç", "Ca", "C", "Ş"
],
dayOfWeek: ["Bazar", "Bazar ertəsi", "Çərşənbə axşamı", "Çərşənbə", "Cümə axşamı", "Cümə", "Şənbə"]
},
bs: {
months: [
"Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
],
dayOfWeekShort: [
"Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
],
dayOfWeek: ["Nedjelja","Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"]
},
ca: {
months: [
"Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre"
],
dayOfWeekShort: [
"Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds"
],
dayOfWeek: ["Diumenge", "Dilluns", "Dimarts", "Dimecres", "Dijous", "Divendres", "Dissabte"]
},
'en-GB': {
months: [
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"
],
dayOfWeekShort: [
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
],
dayOfWeek: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
},
et: { //"Eesti"
months: [
"Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember"
],
dayOfWeekShort: [
"P", "E", "T", "K", "N", "R", "L"
],
dayOfWeek: ["Pühapäev", "Esmaspäev", "Teisipäev", "Kolmapäev", "Neljapäev", "Reede", "Laupäev"]
},
eu: {
months: [
"Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua"
],
dayOfWeekShort: [
"Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La."
],
dayOfWeek: ['Igandea', 'Astelehena', 'Asteartea', 'Asteazkena', 'Osteguna', 'Ostirala', 'Larunbata']
},
fi: {
months: [
"Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu"
],
dayOfWeekShort: [
"Su", "Ma", "Ti", "Ke", "To", "Pe", "La"
],
dayOfWeek: ["sunnuntai", "maanantai", "tiistai", "keskiviikko", "torstai", "perjantai", "lauantai"]
},
gl: {
months: [
"Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec"
],
dayOfWeekShort: [
"Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab"
],
dayOfWeek: ["Domingo", "Luns", "Martes", "Mércores", "Xoves", "Venres", "Sábado"]
},
hr: {
months: [
"Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac"
],
dayOfWeekShort: [
"Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub"
],
dayOfWeek: ["Nedjelja", "Ponedjeljak", "Utorak", "Srijeda", "Četvrtak", "Petak", "Subota"]
},
ko: {
months: [
"1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월"
],
dayOfWeekShort: [
"일", "월", "화", "수", "목", "금", "토"
],
dayOfWeek: ["일요일", "월요일", "화요일", "수요일", "목요일", "금요일", "토요일"]
},
lt: {
months: [
"Sausio", "Vasario", "Kovo", "Balandžio", "Gegužės", "Birželio", "Liepos", "Rugpjūčio", "Rugsėjo", "Spalio", "Lapkričio", "Gruodžio"
],
dayOfWeekShort: [
"Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš"
],
dayOfWeek: ["Sekmadienis", "Pirmadienis", "Antradienis", "Trečiadienis", "Ketvirtadienis", "Penktadienis", "Šeštadienis"]
},
lv: {
months: [
"Janvāris", "Februāris", "Marts", "Aprīlis ", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris"
],
dayOfWeekShort: [
"Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St"
],
dayOfWeek: ["Svētdiena", "Pirmdiena", "Otrdiena", "Trešdiena", "Ceturtdiena", "Piektdiena", "Sestdiena"]
},
mk: {
months: [
"јануари", "февруари", "март", "април", "мај", "јуни", "јули", "август", "септември", "октомври", "ноември", "декември"
],
dayOfWeekShort: [
"нед", "пон", "вто", "сре", "чет", "пет", "саб"
],
dayOfWeek: ["Недела", "Понеделник", "Вторник", "Среда", "Четврток", "Петок", "Сабота"]
},
mn: {
months: [
"1-р сар", "2-р сар", "3-р сар", "4-р сар", "5-р сар", "6-р сар", "7-р сар", "8-р сар", "9-р сар", "10-р сар", "11-р сар", "12-р сар"
],
dayOfWeekShort: [
"Дав", "Мяг", "Лха", "Пүр", "Бсн", "Бям", "Ням"
],
dayOfWeek: ["Даваа", "Мягмар", "Лхагва", "Пүрэв", "Баасан", "Бямба", "Ням"]
},
'pt-BR': {
months: [
"Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"
],
dayOfWeekShort: [
"Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"
],
dayOfWeek: ["Domingo", "Segunda", "Terça", "Quarta", "Quinta", "Sexta", "Sábado"]
},
sk: {
months: [
"Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December"
],
dayOfWeekShort: [
"Ne", "Po", "Ut", "St", "Št", "Pi", "So"
],
dayOfWeek: ["Nedeľa", "Pondelok", "Utorok", "Streda", "Štvrtok", "Piatok", "Sobota"]
},
sq: {
months: [
"Janar", "Shkurt", "Mars", "Prill", "Maj", "Qershor", "Korrik", "Gusht", "Shtator", "Tetor", "Nëntor", "Dhjetor"
],
dayOfWeekShort: [
"Die", "Hën", "Mar", "Mër", "Enj", "Pre", "Shtu"
],
dayOfWeek: ["E Diel", "E Hënë", "E Martē", "E Mërkurë", "E Enjte", "E Premte", "E Shtunë"]
},
'sr-YU': {
months: [
"Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar"
],
dayOfWeekShort: [
"Ned", "Pon", "Uto", "Sre", "čet", "Pet", "Sub"
],
dayOfWeek: ["Nedelja","Ponedeljak", "Utorak", "Sreda", "Četvrtak", "Petak", "Subota"]
},
sr: {
months: [
"јануар", "фебруар", "март", "април", "мај", "јун", "јул", "август", "септембар", "октобар", "новембар", "децембар"
],
dayOfWeekShort: [
"нед", "пон", "уто", "сре", "чет", "пет", "суб"
],
dayOfWeek: ["Недеља","Понедељак", "Уторак", "Среда", "Четвртак", "Петак", "Субота"]
},
sv: {
months: [
"Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December"
],
dayOfWeekShort: [
"Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör"
],
dayOfWeek: ["Söndag", "Måndag", "Tisdag", "Onsdag", "Torsdag", "Fredag", "Lördag"]
},
'zh-TW': {
months: [
"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
],
dayOfWeekShort: [
"日", "一", "二", "三", "四", "五", "六"
],
dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
},
zh: {
months: [
"一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"
],
dayOfWeekShort: [
"日", "一", "二", "三", "四", "五", "六"
],
dayOfWeek: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
},
ug:{
months: [
"1-ئاي","2-ئاي","3-ئاي","4-ئاي","5-ئاي","6-ئاي","7-ئاي","8-ئاي","9-ئاي","10-ئاي","11-ئاي","12-ئاي"
],
dayOfWeek: [
"يەكشەنبە", "دۈشەنبە","سەيشەنبە","چارشەنبە","پەيشەنبە","جۈمە","شەنبە"
]
},
he: {
months: [
'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר'
],
dayOfWeekShort: [
'א\'', 'ב\'', 'ג\'', 'ד\'', 'ה\'', 'ו\'', 'שבת'
],
dayOfWeek: ["ראשון", "שני", "שלישי", "רביעי", "חמישי", "שישי", "שבת", "ראשון"]
},
hy: {
months: [
"Հունվար", "Փետրվար", "Մարտ", "Ապրիլ", "Մայիս", "Հունիս", "Հուլիս", "Օգոստոս", "Սեպտեմբեր", "Հոկտեմբեր", "Նոյեմբեր", "Դեկտեմբեր"
],
dayOfWeekShort: [
"Կի", "Երկ", "Երք", "Չոր", "Հնգ", "Ուրբ", "Շբթ"
],
dayOfWeek: ["Կիրակի", "Երկուշաբթի", "Երեքշաբթի", "Չորեքշաբթի", "Հինգշաբթի", "Ուրբաթ", "Շաբաթ"]
},
kg: {
months: [
'Үчтүн айы', 'Бирдин айы', 'Жалган Куран', 'Чын Куран', 'Бугу', 'Кулжа', 'Теке', 'Баш Оона', 'Аяк Оона', 'Тогуздун айы', 'Жетинин айы', 'Бештин айы'
],
dayOfWeekShort: [
"Жек", "Дүй", "Шей", "Шар", "Бей", "Жум", "Ише"
],
dayOfWeek: [
"Жекшемб", "Дүйшөмб", "Шейшемб", "Шаршемб", "Бейшемби", "Жума", "Ишенб"
]
},
rm: {
months: [
"Schaner", "Favrer", "Mars", "Avrigl", "Matg", "Zercladur", "Fanadur", "Avust", "Settember", "October", "November", "December"
],
dayOfWeekShort: [
"Du", "Gli", "Ma", "Me", "Gie", "Ve", "So"
],
dayOfWeek: [
"Dumengia", "Glindesdi", "Mardi", "Mesemna", "Gievgia", "Venderdi", "Sonda"
]
},
ka: {
months: [
'იანვარი', 'თებერვალი', 'მარტი', 'აპრილი', 'მაისი', 'ივნისი', 'ივლისი', 'აგვისტო', 'სექტემბერი', 'ოქტომბერი', 'ნოემბერი', 'დეკემბერი'
],
dayOfWeekShort: [
"კვ", "ორშ", "სამშ", "ოთხ", "ხუთ", "პარ", "შაბ"
],
dayOfWeek: ["კვირა", "ორშაბათი", "სამშაბათი", "ოთხშაბათი", "ხუთშაბათი", "პარასკევი", "შაბათი"]
}},
ownerDocument: document,
contentWindow: window,
value: '',
rtl: false,
format: 'Y/m/d H:i',
formatTime: 'H:i',
formatDate: 'Y/m/d',
startDate: false,
step: 60,
monthChangeSpinner: true,
closeOnDateSelect: false,
closeOnTimeSelect: true,
closeOnWithoutClick: true,
closeOnInputClick: true,
openOnFocus: true,
timepicker: true,
datepicker: true,
weeks: false,
defaultTime: false,
defaultDate: false,
minDate: false,
maxDate: false,
minTime: false,
maxTime: false,
minDateTime: false,
maxDateTime: false,
allowTimes: [],
opened: false,
initTime: true,
inline: false,
theme: '',
touchMovedThreshold: 5,
onSelectDate: function (){},
onSelectTime: function (){},
onChangeMonth: function (){},
onGetWeekOfYear: function (){},
onChangeYear: function (){},
onChangeDateTime: function (){},
onShow: function (){},
onClose: function (){},
onGenerate: function (){},
withoutCopyright: true,
inverseButton: false,
hours12: false,
next: 'xdsoft_next',
prev:'xdsoft_prev',
dayOfWeekStart: 0,
parentID: 'body',
timeHeightInTimePicker: 25,
timepickerScrollbar: true,
todayButton: true,
prevButton: true,
nextButton: true,
defaultSelect: true,
scrollMonth: true,
scrollTime: true,
scrollInput: false,
lazyInit: false,
mask: false,
validateOnBlur: true,
allowBlank: true,
yearStart: 1950,
yearEnd: 2050,
monthStart: 0,
monthEnd: 11,
style: '',
id: '',
fixed: false,
roundTime: 'round',
className: '',
weekends: [],
highlightedDates: [],
highlightedPeriods: [],
allowDates:[],
allowDateRe:null,
disabledDates:[],
disabledWeekDays: [],
yearOffset: 0,
beforeShowDay: null,
enterLikeTab: true,
showApplyButton: false
};
var dateHelper=null,
defaultDateHelper=null,
globalLocaleDefault='en',
globalLocale='en';
var dateFormatterOptionsDefault={
meridiem: ['AM', 'PM']
};
var initDateFormatter=function(){
var locale=default_options.i18n[globalLocale],
opts={
days: locale.dayOfWeek,
daysShort: locale.dayOfWeekShort,
months: locale.months,
monthsShort: $.map(locale.months, function(n){ return n.substring(0, 3) })
};
if(typeof DateFormatter==='function'){
dateHelper=defaultDateHelper=new DateFormatter({
dateSettings: $.extend({}, dateFormatterOptionsDefault, opts)
});
}};
var dateFormatters={
moment: {
default_options:{
format: 'YYYY/MM/DD HH:mm',
formatDate: 'YYYY/MM/DD',
formatTime: 'HH:mm',
},
formatter: {
parseDate: function (date, format){
if(isFormatStandard(format)){
return defaultDateHelper.parseDate(date, format);
}
var d=moment(date, format);
return d.isValid() ? d.toDate():false;
},
formatDate: function (date, format){
if(isFormatStandard(format)){
return defaultDateHelper.formatDate(date, format);
}
return moment(date).format(format);
},
formatMask: function(format){
return format
.replace(/Y{4}/g, '9999')
.replace(/Y{2}/g, '99')
.replace(/M{2}/g, '19')
.replace(/D{2}/g, '39')
.replace(/H{2}/g, '29')
.replace(/m{2}/g, '59')
.replace(/s{2}/g, '59');
},
}}
}
$.datetimepicker={
setLocale: function(locale){
var newLocale=default_options.i18n[locale] ? locale:globalLocaleDefault;
if(globalLocale!==newLocale){
globalLocale=newLocale;
initDateFormatter();
}},
setDateFormatter: function(dateFormatter){
if(typeof dateFormatter==='string'&&dateFormatters.hasOwnProperty(dateFormatter)){
var df=dateFormatters[dateFormatter];
$.extend(default_options, df.default_options);
dateHelper=df.formatter;
}else{
dateHelper=dateFormatter;
}},
};
var standardFormats={
RFC_2822: 'D, d M Y H:i:s O',
ATOM: 'Y-m-d\TH:i:sP',
ISO_8601: 'Y-m-d\TH:i:sO',
RFC_822: 'D, d M y H:i:s O',
RFC_850: 'l, d-M-y H:i:s T',
RFC_1036: 'D, d M y H:i:s O',
RFC_1123: 'D, d M Y H:i:s O',
RSS: 'D, d M Y H:i:s O',
W3C: 'Y-m-d\TH:i:sP'
}
var isFormatStandard=function(format){
return Object.values(standardFormats).indexOf(format)===-1 ? false:true;
}
$.extend($.datetimepicker, standardFormats);
initDateFormatter();
if(!window.getComputedStyle){
window.getComputedStyle=function (el){
this.el=el;
this.getPropertyValue=function (prop){
var re=/(-([a-z]))/g;
if(prop==='float'){
prop='styleFloat';
}
if(re.test(prop)){
prop=prop.replace(re, function (a, b, c){
return c.toUpperCase();
});
}
return el.currentStyle[prop]||null;
};
return this;
};}
if(!Array.prototype.indexOf){
Array.prototype.indexOf=function (obj, start){
var i, j;
for (i=(start||0), j=this.length; i < j; i +=1){
if(this[i]===obj){ return i; }}
return -1;
};}
Date.prototype.countDaysInMonth=function (){
return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate();
};
$.fn.xdsoftScroller=function (options, percent){
return this.each(function (){
var timeboxparent=$(this),
pointerEventToXY=function (e){
var out={x: 0, y: 0},
touch;
if(e.type==='touchstart'||e.type==='touchmove'||e.type==='touchend'||e.type==='touchcancel'){
touch=e.originalEvent.touches[0]||e.originalEvent.changedTouches[0];
out.x=touch.clientX;
out.y=touch.clientY;
}else if(e.type==='mousedown'||e.type==='mouseup'||e.type==='mousemove'||e.type==='mouseover'||e.type==='mouseout'||e.type==='mouseenter'||e.type==='mouseleave'){
out.x=e.clientX;
out.y=e.clientY;
}
return out;
},
timebox,
parentHeight,
height,
scrollbar,
scroller,
maximumOffset=100,
start=false,
startY=0,
startTop=0,
h1=0,
touchStart=false,
startTopScroll=0,
calcOffset=function (){};
if(percent==='hide'){
timeboxparent.find('.xdsoft_scrollbar').hide();
return;
}
if(!$(this).hasClass('xdsoft_scroller_box')){
timebox=timeboxparent.children().eq(0);
parentHeight=timeboxparent[0].clientHeight;
height=timebox[0].offsetHeight;
scrollbar=$('
');
scroller=$('
');
scrollbar.append(scroller);
timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar);
calcOffset=function calcOffset(event){
var offset=pointerEventToXY(event).y - startY + startTopScroll;
if(offset < 0){
offset=0;
}
if(offset + scroller[0].offsetHeight > h1){
offset=h1 - scroller[0].offsetHeight;
}
timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset:0]);
};
scroller
.on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event){
if(!parentHeight){
timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
}
startY=pointerEventToXY(event).y;
startTopScroll=parseInt(scroller.css('margin-top'), 10);
h1=scrollbar[0].offsetHeight;
if(event.type==='mousedown'||event.type==='touchstart'){
if(options.ownerDocument){
$(options.ownerDocument.body).addClass('xdsoft_noselect');
}
$([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft_scroller', function arguments_callee(){
$([options.ownerDocument.body, options.contentWindow]).off('touchend mouseup.xdsoft_scroller', arguments_callee)
.off('mousemove.xdsoft_scroller', calcOffset)
.removeClass('xdsoft_noselect');
});
$(options.ownerDocument.body).on('mousemove.xdsoft_scroller', calcOffset);
}else{
touchStart=true;
event.stopPropagation();
event.preventDefault();
}})
.on('touchmove', function (event){
if(touchStart){
event.preventDefault();
calcOffset(event);
}})
.on('touchend touchcancel', function (){
touchStart=false;
startTopScroll=0;
});
timeboxparent
.on('scroll_element.xdsoft_scroller', function (event, percentage){
if(!parentHeight){
timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]);
}
percentage=percentage > 1 ? 1:(percentage < 0||isNaN(percentage)) ? 0:percentage;
scroller.css('margin-top', maximumOffset * percentage);
setTimeout(function (){
timebox.css('marginTop', -parseInt((timebox[0].offsetHeight - parentHeight) * percentage, 10));
}, 10);
})
.on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll){
var percent, sh;
parentHeight=timeboxparent[0].clientHeight;
height=timebox[0].offsetHeight;
percent=parentHeight / height;
sh=percent * scrollbar[0].offsetHeight;
if(percent > 1){
scroller.hide();
}else{
scroller.show();
scroller.css('height', parseInt(sh > 10 ? sh:10, 10));
maximumOffset=scrollbar[0].offsetHeight - scroller[0].offsetHeight;
if(noTriggerScroll!==true){
timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage||Math.abs(parseInt(timebox.css('marginTop'), 10)) / (height - parentHeight)]);
}}
});
timeboxparent.on('mousewheel', function (event){
var top=Math.abs(parseInt(timebox.css('marginTop'), 10));
top=top - (event.deltaY * 20);
if(top < 0){
top=0;
}
timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]);
event.stopPropagation();
return false;
});
timeboxparent.on('touchstart', function (event){
start=pointerEventToXY(event);
startTop=Math.abs(parseInt(timebox.css('marginTop'), 10));
});
timeboxparent.on('touchmove', function (event){
if(start){
event.preventDefault();
var coord=pointerEventToXY(event);
timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]);
}});
timeboxparent.on('touchend touchcancel', function (){
start=false;
startTop=0;
});
}
timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]);
});
};
$.fn.datetimepicker=function (opt, opt2){
var result=this,
KEY0=48,
KEY9=57,
_KEY0=96,
_KEY9=105,
CTRLKEY=17,
DEL=46,
ENTER=13,
ESC=27,
BACKSPACE=8,
ARROWLEFT=37,
ARROWUP=38,
ARROWRIGHT=39,
ARROWDOWN=40,
TAB=9,
F5=116,
AKEY=65,
CKEY=67,
VKEY=86,
ZKEY=90,
YKEY=89,
ctrlDown=false,
options=($.isPlainObject(opt)||!opt) ? $.extend(true, {}, default_options, opt):$.extend(true, {}, default_options),
lazyInitTimer=0,
createDateTimePicker,
destroyDateTimePicker,
lazyInit=function (input){
input
.on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function initOnActionCallback(){
if(input.is(':disabled')||input.data('xdsoft_datetimepicker')){
return;
}
clearTimeout(lazyInitTimer);
lazyInitTimer=setTimeout(function (){
if(!input.data('xdsoft_datetimepicker')){
createDateTimePicker(input);
}
input
.off('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', initOnActionCallback)
.trigger('open.xdsoft');
}, 100);
});
};
createDateTimePicker=function (input){
var datetimepicker=$('
'),
xdsoft_copyright=$(''),
datepicker=$('
'),
month_picker=$(''),
calendar=$('
'),
timepicker=$(''),
timeboxparent=timepicker.find('.xdsoft_time_box').eq(0),
timebox=$('
'),
applyButton=$('Save Selected '),
monthselect=$(''),
yearselect=$(''),
triggerAfterOpen=false,
XDSoft_datetime,
xchangeTimer,
timerclick,
current_time_index,
setPos,
timer=0,
_xdsoft_datetime,
forEachAncestorOf;
if(options.id){
datetimepicker.attr('id', options.id);
}
if(options.style){
datetimepicker.attr('style', options.style);
}
if(options.weeks){
datetimepicker.addClass('xdsoft_showweeks');
}
if(options.rtl){
datetimepicker.addClass('xdsoft_rtl');
}
datetimepicker.addClass('xdsoft_' + options.theme);
datetimepicker.addClass(options.className);
month_picker
.find('.xdsoft_month span')
.after(monthselect);
month_picker
.find('.xdsoft_year span')
.after(yearselect);
month_picker
.find('.xdsoft_month,.xdsoft_year')
.on('touchstart mousedown.xdsoft', function (event){
var select=$(this).find('.xdsoft_select').eq(0),
val=0,
top=0,
visible=select.is(':visible'),
items,
i;
month_picker
.find('.xdsoft_select')
.hide();
if(_xdsoft_datetime.currentTime){
val=_xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth':'getFullYear']();
}
select[visible ? 'hide':'show']();
for (items=select.find('div.xdsoft_option'), i=0; i < items.length; i +=1){
if(items.eq(i).data('value')===val){
break;
}else{
top +=items[0].offsetHeight;
}}
select.xdsoftScroller(options, top / (select.children()[0].offsetHeight - (select[0].clientHeight)));
event.stopPropagation();
return false;
});
var handleTouchMoved=function (event){
var evt=event.originalEvent;
var touchPosition=evt.touches ? evt.touches[0]:evt;
this.touchStartPosition=this.touchStartPosition||touchPosition;
var xMovement=Math.abs(this.touchStartPosition.clientX - touchPosition.clientX);
var yMovement=Math.abs(this.touchStartPosition.clientY - touchPosition.clientY);
var distance=Math.sqrt(xMovement * xMovement + yMovement * yMovement);
if(distance > options.touchMovedThreshold){
this.touchMoved=true;
}}
month_picker
.find('.xdsoft_select')
.xdsoftScroller(options)
.on('touchstart mousedown.xdsoft', function (event){
var evt=event.originalEvent;
this.touchMoved=false;
this.touchStartPosition=evt.touches ? evt.touches[0]:evt;
event.stopPropagation();
event.preventDefault();
})
.on('touchmove', '.xdsoft_option', handleTouchMoved)
.on('touchend mousedown.xdsoft', '.xdsoft_option', function (){
if(!this.touchMoved){
if(_xdsoft_datetime.currentTime===undefined||_xdsoft_datetime.currentTime===null){
_xdsoft_datetime.currentTime=_xdsoft_datetime.now();
}
var year=_xdsoft_datetime.currentTime.getFullYear();
if(_xdsoft_datetime&&_xdsoft_datetime.currentTime){
_xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth':'setFullYear']($(this).data('value'));
}
$(this).parent().parent().hide();
datetimepicker.trigger('xchange.xdsoft');
if(options.onChangeMonth&&$.isFunction(options.onChangeMonth)){
options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
}
if(year!==_xdsoft_datetime.currentTime.getFullYear()&&$.isFunction(options.onChangeYear)){
options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
}}
});
datetimepicker.getValue=function (){
return _xdsoft_datetime.getCurrentTime();
};
datetimepicker.setOptions=function (_options){
var highlightedDates={};
options=$.extend(true, {}, options, _options);
if(_options.allowTimes&&$.isArray(_options.allowTimes)&&_options.allowTimes.length){
options.allowTimes=$.extend(true, [], _options.allowTimes);
}
if(_options.weekends&&$.isArray(_options.weekends)&&_options.weekends.length){
options.weekends=$.extend(true, [], _options.weekends);
}
if(_options.allowDates&&$.isArray(_options.allowDates)&&_options.allowDates.length){
options.allowDates=$.extend(true, [], _options.allowDates);
}
if(_options.allowDateRe&&Object.prototype.toString.call(_options.allowDateRe)==="[object String]"){
options.allowDateRe=new RegExp(_options.allowDateRe);
}
if(_options.highlightedDates&&$.isArray(_options.highlightedDates)&&_options.highlightedDates.length){
$.each(_options.highlightedDates, function (index, value){
var splitData=$.map(value.split(','), $.trim),
exDesc,
hDate=new HighlightedDate(dateHelper.parseDate(splitData[0], options.formatDate), splitData[1], splitData[2]),
keyDate=dateHelper.formatDate(hDate.date, options.formatDate);
if(highlightedDates[keyDate]!==undefined){
exDesc=highlightedDates[keyDate].desc;
if(exDesc&&exDesc.length&&hDate.desc&&hDate.desc.length){
highlightedDates[keyDate].desc=exDesc + "\n" + hDate.desc;
}}else{
highlightedDates[keyDate]=hDate;
}});
options.highlightedDates=$.extend(true, [], highlightedDates);
}
if(_options.highlightedPeriods&&$.isArray(_options.highlightedPeriods)&&_options.highlightedPeriods.length){
highlightedDates=$.extend(true, [], options.highlightedDates);
$.each(_options.highlightedPeriods, function (index, value){
var dateTest,
dateEnd,
desc,
hDate,
keyDate,
exDesc,
style;
if($.isArray(value)){
dateTest=value[0];
dateEnd=value[1];
desc=value[2];
style=value[3];
}else{
var splitData=$.map(value.split(','), $.trim);
dateTest=dateHelper.parseDate(splitData[0], options.formatDate);
dateEnd=dateHelper.parseDate(splitData[1], options.formatDate);
desc=splitData[2];
style=splitData[3];
}
while (dateTest <=dateEnd){
hDate=new HighlightedDate(dateTest, desc, style);
keyDate=dateHelper.formatDate(dateTest, options.formatDate);
dateTest.setDate(dateTest.getDate() + 1);
if(highlightedDates[keyDate]!==undefined){
exDesc=highlightedDates[keyDate].desc;
if(exDesc&&exDesc.length&&hDate.desc&&hDate.desc.length){
highlightedDates[keyDate].desc=exDesc + "\n" + hDate.desc;
}}else{
highlightedDates[keyDate]=hDate;
}}
});
options.highlightedDates=$.extend(true, [], highlightedDates);
}
if(_options.disabledDates&&$.isArray(_options.disabledDates)&&_options.disabledDates.length){
options.disabledDates=$.extend(true, [], _options.disabledDates);
}
if(_options.disabledWeekDays&&$.isArray(_options.disabledWeekDays)&&_options.disabledWeekDays.length){
options.disabledWeekDays=$.extend(true, [], _options.disabledWeekDays);
}
if((options.open||options.opened)&&(!options.inline)){
input.trigger('open.xdsoft');
}
if(options.inline){
triggerAfterOpen=true;
datetimepicker.addClass('xdsoft_inline');
input.after(datetimepicker).hide();
}
if(options.inverseButton){
options.next='xdsoft_prev';
options.prev='xdsoft_next';
}
if(options.datepicker){
datepicker.addClass('active');
}else{
datepicker.removeClass('active');
}
if(options.timepicker){
timepicker.addClass('active');
}else{
timepicker.removeClass('active');
}
if(options.value){
_xdsoft_datetime.setCurrentTime(options.value);
if(input&&input.val){
input.val(_xdsoft_datetime.str);
}}
if(isNaN(options.dayOfWeekStart)){
options.dayOfWeekStart=0;
}else{
options.dayOfWeekStart=parseInt(options.dayOfWeekStart, 10) % 7;
}
if(!options.timepickerScrollbar){
timeboxparent.xdsoftScroller(options, 'hide');
}
if(options.minDate&&/^[\+\-](.*)$/.test(options.minDate)){
options.minDate=dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.minDate), options.formatDate);
}
if(options.maxDate&&/^[\+\-](.*)$/.test(options.maxDate)){
options.maxDate=dateHelper.formatDate(_xdsoft_datetime.strToDateTime(options.maxDate), options.formatDate);
}
if(options.minDateTime&&/^\+(.*)$/.test(options.minDateTime)){
options.minDateTime=_xdsoft_datetime.strToDateTime(options.minDateTime).dateFormat(options.formatDate);
}
if(options.maxDateTime&&/^\+(.*)$/.test(options.maxDateTime)){
options.maxDateTime=_xdsoft_datetime.strToDateTime(options.maxDateTime).dateFormat(options.formatDate);
}
applyButton.toggle(options.showApplyButton);
month_picker
.find('.xdsoft_today_button')
.css('visibility', !options.todayButton ? 'hidden':'visible');
month_picker
.find('.' + options.prev)
.css('visibility', !options.prevButton ? 'hidden':'visible');
month_picker
.find('.' + options.next)
.css('visibility', !options.nextButton ? 'hidden':'visible');
setMask(options);
if(options.validateOnBlur){
input
.off('blur.xdsoft')
.on('blur.xdsoft', function (){
if(options.allowBlank&&(!$.trim($(this).val()).length ||
(typeof options.mask==="string"&&$.trim($(this).val())===options.mask.replace(/[0-9]/g, '_')))){
$(this).val(null);
datetimepicker.data('xdsoft_datetime').empty();
}else{
var d=dateHelper.parseDate($(this).val(), options.format);
if(d){
$(this).val(dateHelper.formatDate(d, options.format));
}else{
var splittedHours=+([$(this).val()[0], $(this).val()[1]].join('')),
splittedMinutes=+([$(this).val()[2], $(this).val()[3]].join(''));
if(!options.datepicker&&options.timepicker&&splittedHours >=0&&splittedHours < 24&&splittedMinutes >=0&&splittedMinutes < 60){
$(this).val([splittedHours, splittedMinutes].map(function (item){
return item > 9 ? item:'0' + item;
}).join(':'));
}else{
$(this).val(dateHelper.formatDate(_xdsoft_datetime.now(), options.format));
}}
datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val());
}
datetimepicker.trigger('changedatetime.xdsoft');
datetimepicker.trigger('close.xdsoft');
});
}
options.dayOfWeekStartPrev=(options.dayOfWeekStart===0) ? 6:options.dayOfWeekStart - 1;
datetimepicker
.trigger('xchange.xdsoft')
.trigger('afterOpen.xdsoft');
};
datetimepicker
.data('options', options)
.on('touchstart mousedown.xdsoft', function (event){
event.stopPropagation();
event.preventDefault();
yearselect.hide();
monthselect.hide();
return false;
});
timeboxparent.append(timebox);
timeboxparent.xdsoftScroller(options);
datetimepicker.on('afterOpen.xdsoft', function (){
timeboxparent.xdsoftScroller(options);
});
datetimepicker
.append(datepicker)
.append(timepicker);
if(options.withoutCopyright!==true){
datetimepicker
.append(xdsoft_copyright);
}
datepicker
.append(month_picker)
.append(calendar)
.append(applyButton);
$(options.parentID)
.append(datetimepicker);
XDSoft_datetime=function (){
var _this=this;
_this.now=function (norecursion){
var d=new Date(),
date,
time;
if(!norecursion&&options.defaultDate){
date=_this.strToDateTime(options.defaultDate);
d.setFullYear(date.getFullYear());
d.setMonth(date.getMonth());
d.setDate(date.getDate());
}
d.setFullYear(d.getFullYear());
if(!norecursion&&options.defaultTime){
time=_this.strtotime(options.defaultTime);
d.setHours(time.getHours());
d.setMinutes(time.getMinutes());
d.setSeconds(time.getSeconds());
d.setMilliseconds(time.getMilliseconds());
}
return d;
};
_this.isValidDate=function (d){
if(Object.prototype.toString.call(d)!=="[object Date]"){
return false;
}
return !isNaN(d.getTime());
};
_this.setCurrentTime=function (dTime, requireValidDate){
if(typeof dTime==='string'){
_this.currentTime=_this.strToDateTime(dTime);
}
else if(_this.isValidDate(dTime)){
_this.currentTime=dTime;
}
else if(!dTime&&!requireValidDate&&options.allowBlank&&!options.inline){
_this.currentTime=null;
}else{
_this.currentTime=_this.now();
}
datetimepicker.trigger('xchange.xdsoft');
};
_this.empty=function (){
_this.currentTime=null;
};
_this.getCurrentTime=function (){
return _this.currentTime;
};
_this.nextMonth=function (){
if(_this.currentTime===undefined||_this.currentTime===null){
_this.currentTime=_this.now();
}
var month=_this.currentTime.getMonth() + 1,
year;
if(month===12){
_this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1);
month=0;
}
year=_this.currentTime.getFullYear();
_this.currentTime.setDate(Math.min(new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
_this.currentTime.getDate()
)
);
_this.currentTime.setMonth(month);
if(options.onChangeMonth&&$.isFunction(options.onChangeMonth)){
options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
}
if(year!==_this.currentTime.getFullYear()&&$.isFunction(options.onChangeYear)){
options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
}
datetimepicker.trigger('xchange.xdsoft');
return month;
};
_this.prevMonth=function (){
if(_this.currentTime===undefined||_this.currentTime===null){
_this.currentTime=_this.now();
}
var month=_this.currentTime.getMonth() - 1;
if(month===-1){
_this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1);
month=11;
}
_this.currentTime.setDate(Math.min(new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(),
_this.currentTime.getDate()
)
);
_this.currentTime.setMonth(month);
if(options.onChangeMonth&&$.isFunction(options.onChangeMonth)){
options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
}
datetimepicker.trigger('xchange.xdsoft');
return month;
};
_this.getWeekOfYear=function (datetime){
if(options.onGetWeekOfYear&&$.isFunction(options.onGetWeekOfYear)){
var week=options.onGetWeekOfYear.call(datetimepicker, datetime);
if(typeof week!=='undefined'){
return week;
}}
var onejan=new Date(datetime.getFullYear(), 0, 1);
if(onejan.getDay()!==4){
onejan.setMonth(0, 1 + ((4 - onejan.getDay()+ 7) % 7));
}
return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7);
};
_this.strToDateTime=function (sDateTime){
var tmpDate=[], timeOffset, currentTime;
if(sDateTime&&sDateTime instanceof Date&&_this.isValidDate(sDateTime)){
return sDateTime;
}
tmpDate=/^([+-]{1})(.*)$/.exec(sDateTime);
if(tmpDate){
tmpDate[2]=dateHelper.parseDate(tmpDate[2], options.formatDate);
}
if(tmpDate&&tmpDate[2]){
timeOffset=tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000;
currentTime=new Date((_this.now(true)).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset);
}else{
currentTime=sDateTime ? dateHelper.parseDate(sDateTime, options.format):_this.now();
}
if(!_this.isValidDate(currentTime)){
currentTime=_this.now();
}
return currentTime;
};
_this.strToDate=function (sDate){
if(sDate&&sDate instanceof Date&&_this.isValidDate(sDate)){
return sDate;
}
var currentTime=sDate ? dateHelper.parseDate(sDate, options.formatDate):_this.now(true);
if(!_this.isValidDate(currentTime)){
currentTime=_this.now(true);
}
return currentTime;
};
_this.strtotime=function (sTime){
if(sTime&&sTime instanceof Date&&_this.isValidDate(sTime)){
return sTime;
}
var currentTime=sTime ? dateHelper.parseDate(sTime, options.formatTime):_this.now(true);
if(!_this.isValidDate(currentTime)){
currentTime=_this.now(true);
}
return currentTime;
};
_this.str=function (){
var format=options.format;
if(options.yearOffset){
format=format.replace('Y', _this.currentTime.getFullYear() + options.yearOffset);
format=format.replace('y', String(_this.currentTime.getFullYear() + options.yearOffset).substring(2, 4));
}
return dateHelper.formatDate(_this.currentTime, format);
};
_this.currentTime=this.now();
};
_xdsoft_datetime=new XDSoft_datetime();
applyButton.on('touchend click', function (e){
e.preventDefault();
datetimepicker.data('changed', true);
_xdsoft_datetime.setCurrentTime(getCurrentValue());
input.val(_xdsoft_datetime.str());
datetimepicker.trigger('close.xdsoft');
});
month_picker
.find('.xdsoft_today_button')
.on('touchend mousedown.xdsoft', function (){
datetimepicker.data('changed', true);
_xdsoft_datetime.setCurrentTime(0, true);
datetimepicker.trigger('afterOpen.xdsoft');
}).on('dblclick.xdsoft', function (){
var currentDate=_xdsoft_datetime.getCurrentTime(), minDate, maxDate;
currentDate=new Date(currentDate.getFullYear(), currentDate.getMonth(), currentDate.getDate());
minDate=_xdsoft_datetime.strToDate(options.minDate);
minDate=new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
if(currentDate < minDate){
return;
}
maxDate=_xdsoft_datetime.strToDate(options.maxDate);
maxDate=new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate());
if(currentDate > maxDate){
return;
}
input.val(_xdsoft_datetime.str());
input.trigger('change');
datetimepicker.trigger('close.xdsoft');
});
month_picker
.find('.xdsoft_prev,.xdsoft_next')
.on('touchend mousedown.xdsoft', function (){
var $this=$(this),
timer=0,
stop=false;
(function arguments_callee1(v){
if($this.hasClass(options.next)){
_xdsoft_datetime.nextMonth();
}else if($this.hasClass(options.prev)){
_xdsoft_datetime.prevMonth();
}
if(options.monthChangeSpinner){
if(!stop){
timer=setTimeout(arguments_callee1, v||100);
}}
}(500));
$([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft', function arguments_callee2(){
clearTimeout(timer);
stop=true;
$([options.ownerDocument.body, options.contentWindow]).off('touchend mouseup.xdsoft', arguments_callee2);
});
});
timepicker
.find('.xdsoft_prev,.xdsoft_next')
.on('touchend mousedown.xdsoft', function (){
var $this=$(this),
timer=0,
stop=false,
period=110;
(function arguments_callee4(v){
var pheight=timeboxparent[0].clientHeight,
height=timebox[0].offsetHeight,
top=Math.abs(parseInt(timebox.css('marginTop'), 10));
if($this.hasClass(options.next)&&(height - pheight) - options.timeHeightInTimePicker >=top){
timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px');
}else if($this.hasClass(options.prev)&&top - options.timeHeightInTimePicker >=0){
timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px');
}
timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox[0].style.marginTop, 10) / (height - pheight))]);
period=(period > 10) ? 10:period - 10;
if(!stop){
timer=setTimeout(arguments_callee4, v||period);
}}(500));
$([options.ownerDocument.body, options.contentWindow]).on('touchend mouseup.xdsoft', function arguments_callee5(){
clearTimeout(timer);
stop=true;
$([options.ownerDocument.body, options.contentWindow])
.off('touchend mouseup.xdsoft', arguments_callee5);
});
});
xchangeTimer=0;
datetimepicker
.on('xchange.xdsoft', function (event){
clearTimeout(xchangeTimer);
xchangeTimer=setTimeout(function (){
if(_xdsoft_datetime.currentTime===undefined||_xdsoft_datetime.currentTime===null){
_xdsoft_datetime.currentTime=_xdsoft_datetime.now();
}
var table='',
start=new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0),
i=0,
j,
today=_xdsoft_datetime.now(),
maxDate=false,
minDate=false,
minDateTime=false,
maxDateTime=false,
hDate,
day,
d,
y,
m,
w,
classes=[],
customDateSettings,
newRow=true,
time='',
h,
line_time,
description;
while (start.getDay()!==options.dayOfWeekStart){
start.setDate(start.getDate() - 1);
}
table +='';
if(options.weeks){
table +=' ';
}
for (j=0; j < 7; j +=1){
table +='' + options.i18n[globalLocale].dayOfWeekShort[(j + options.dayOfWeekStart) % 7] + ' ';
}
table +=' ';
table +='';
if(options.maxDate!==false){
maxDate=_xdsoft_datetime.strToDate(options.maxDate);
maxDate=new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999);
}
if(options.minDate!==false){
minDate=_xdsoft_datetime.strToDate(options.minDate);
minDate=new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate());
}
if(options.minDateTime!==false){
minDateTime=_xdsoft_datetime.strToDate(options.minDateTime);
minDateTime=new Date(minDateTime.getFullYear(), minDateTime.getMonth(), minDateTime.getDate(), minDateTime.getHours(), minDateTime.getMinutes(), minDateTime.getSeconds());
}
if(options.maxDateTime!==false){
maxDateTime=_xdsoft_datetime.strToDate(options.maxDateTime);
maxDateTime=new Date(maxDateTime.getFullYear(), maxDateTime.getMonth(), maxDateTime.getDate(), maxDateTime.getHours(), maxDateTime.getMinutes(), maxDateTime.getSeconds());
}
var maxDateTimeDay;
if(maxDateTime!==false){
maxDateTimeDay=((maxDateTime.getFullYear() * 12) + maxDateTime.getMonth()) * 31 + maxDateTime.getDate();
}
while (i < _xdsoft_datetime.currentTime.countDaysInMonth()||start.getDay()!==options.dayOfWeekStart||_xdsoft_datetime.currentTime.getMonth()===start.getMonth()){
classes=[];
i +=1;
day=start.getDay();
d=start.getDate();
y=start.getFullYear();
m=start.getMonth();
w=_xdsoft_datetime.getWeekOfYear(start);
description='';
classes.push('xdsoft_date');
if(options.beforeShowDay&&$.isFunction(options.beforeShowDay.call)){
customDateSettings=options.beforeShowDay.call(datetimepicker, start);
}else{
customDateSettings=null;
}
if(options.allowDateRe&&Object.prototype.toString.call(options.allowDateRe)==="[object RegExp]"){
if(!options.allowDateRe.test(dateHelper.formatDate(start, options.formatDate))){
classes.push('xdsoft_disabled');
}}
if(options.allowDates&&options.allowDates.length>0){
if(options.allowDates.indexOf(dateHelper.formatDate(start, options.formatDate))===-1){
classes.push('xdsoft_disabled');
}}
var currentDay=((start.getFullYear() * 12) + start.getMonth()) * 31 + start.getDate();
if((maxDate!==false&&start > maxDate)||(minDateTime!==false&&start < minDateTime)||(minDate!==false&&start < minDate)||(maxDateTime!==false&¤tDay > maxDateTimeDay)||(customDateSettings&&customDateSettings[0]===false)){
classes.push('xdsoft_disabled');
}
if(options.disabledDates.indexOf(dateHelper.formatDate(start, options.formatDate))!==-1){
classes.push('xdsoft_disabled');
}
if(options.disabledWeekDays.indexOf(day)!==-1){
classes.push('xdsoft_disabled');
}
if(input.is('[disabled]')){
classes.push('xdsoft_disabled');
}
if(customDateSettings&&customDateSettings[1]!==""){
classes.push(customDateSettings[1]);
}
if(_xdsoft_datetime.currentTime.getMonth()!==m){
classes.push('xdsoft_other_month');
}
if((options.defaultSelect||datetimepicker.data('changed'))&&dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate)===dateHelper.formatDate(start, options.formatDate)){
classes.push('xdsoft_current');
}
if(dateHelper.formatDate(today, options.formatDate)===dateHelper.formatDate(start, options.formatDate)){
classes.push('xdsoft_today');
}
if(start.getDay()===0||start.getDay()===6||options.weekends.indexOf(dateHelper.formatDate(start, options.formatDate))!==-1){
classes.push('xdsoft_weekend');
}
if(options.highlightedDates[dateHelper.formatDate(start, options.formatDate)]!==undefined){
hDate=options.highlightedDates[dateHelper.formatDate(start, options.formatDate)];
classes.push(hDate.style===undefined ? 'xdsoft_highlighted_default':hDate.style);
description=hDate.desc===undefined ? '':hDate.desc;
}
if(options.beforeShowDay&&$.isFunction(options.beforeShowDay)){
classes.push(options.beforeShowDay(start));
}
if(newRow){
table +='';
newRow=false;
if(options.weeks){
table +='' + w + ' ';
}}
table +='' +
'' + d + '
' +
' ';
if(start.getDay()===options.dayOfWeekStartPrev){
table +=' ';
newRow=true;
}
start.setDate(d + 1);
}
table +='
';
calendar.html(table);
month_picker.find('.xdsoft_label span').eq(0).text(options.i18n[globalLocale].months[_xdsoft_datetime.currentTime.getMonth()]);
month_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear() + options.yearOffset);
time='';
h='';
m='';
var minTimeMinutesOfDay=0;
if(options.minTime!==false){
var t=_xdsoft_datetime.strtotime(options.minTime);
minTimeMinutesOfDay=60 * t.getHours() + t.getMinutes();
}
var maxTimeMinutesOfDay=24 * 60;
if(options.maxTime!==false){
var t=_xdsoft_datetime.strtotime(options.maxTime);
maxTimeMinutesOfDay=60 * t.getHours() + t.getMinutes();
}
if(options.minDateTime!==false){
var t=_xdsoft_datetime.strToDateTime(options.minDateTime);
var currentDayIsMinDateTimeDay=dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate)===dateHelper.formatDate(t, options.formatDate);
if(currentDayIsMinDateTimeDay){
var m=60 * t.getHours() + t.getMinutes();
if(m > minTimeMinutesOfDay) minTimeMinutesOfDay=m;
}}
if(options.maxDateTime!==false){
var t=_xdsoft_datetime.strToDateTime(options.maxDateTime);
var currentDayIsMaxDateTimeDay=dateHelper.formatDate(_xdsoft_datetime.currentTime, options.formatDate)===dateHelper.formatDate(t, options.formatDate);
if(currentDayIsMaxDateTimeDay){
var m=60 * t.getHours() + t.getMinutes();
if(m < maxTimeMinutesOfDay) maxTimeMinutesOfDay=m;
}}
line_time=function line_time(h, m){
var now=_xdsoft_datetime.now(), current_time,
isALlowTimesInit=options.allowTimes&&$.isArray(options.allowTimes)&&options.allowTimes.length;
now.setHours(h);
h=parseInt(now.getHours(), 10);
now.setMinutes(m);
m=parseInt(now.getMinutes(), 10);
classes=[];
var currentMinutesOfDay=60 * h + m;
if(input.is('[disabled]')||(currentMinutesOfDay >=maxTimeMinutesOfDay)||(currentMinutesOfDay < minTimeMinutesOfDay)){
classes.push('xdsoft_disabled');
}
current_time=new Date(_xdsoft_datetime.currentTime);
current_time.setHours(parseInt(_xdsoft_datetime.currentTime.getHours(), 10));
if(!isALlowTimesInit){
current_time.setMinutes(Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step);
}
if((options.initTime||options.defaultSelect||datetimepicker.data('changed'))&¤t_time.getHours()===parseInt(h, 10)&&((!isALlowTimesInit&&options.step > 59)||current_time.getMinutes()===parseInt(m, 10))){
if(options.defaultSelect||datetimepicker.data('changed')){
classes.push('xdsoft_current');
}else if(options.initTime){
classes.push('xdsoft_init_time');
}}
if(parseInt(today.getHours(), 10)===parseInt(h, 10)&&parseInt(today.getMinutes(), 10)===parseInt(m, 10)){
classes.push('xdsoft_today');
}
time +='' + dateHelper.formatDate(now, options.formatTime) + '
';
};
if(!options.allowTimes||!$.isArray(options.allowTimes)||!options.allowTimes.length){
for (i=0, j=0; i < (options.hours12 ? 12:24); i +=1){
for (j=0; j < 60; j +=options.step){
var currentMinutesOfDay=i * 60 + j;
if(currentMinutesOfDay < minTimeMinutesOfDay) continue;
if(currentMinutesOfDay >=maxTimeMinutesOfDay) continue;
h=(i < 10 ? '0':'') + i;
m=(j < 10 ? '0':'') + j;
line_time(h, m);
}}
}else{
for (i=0; i < options.allowTimes.length; i +=1){
h=_xdsoft_datetime.strtotime(options.allowTimes[i]).getHours();
m=_xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes();
line_time(h, m);
}}
timebox.html(time);
opt='';
for (i=parseInt(options.yearStart, 10); i <=parseInt(options.yearEnd, 10); i +=1){
opt +='' + (i + options.yearOffset) + '
';
}
yearselect.children().eq(0)
.html(opt);
for (i=parseInt(options.monthStart, 10), opt=''; i <=parseInt(options.monthEnd, 10); i +=1){
opt +='' + options.i18n[globalLocale].months[i] + '
';
}
monthselect.children().eq(0).html(opt);
$(datetimepicker)
.trigger('generate.xdsoft');
}, 10);
event.stopPropagation();
})
.on('afterOpen.xdsoft', function (){
if(options.timepicker){
var classType, pheight, height, top;
if(timebox.find('.xdsoft_current').length){
classType='.xdsoft_current';
}else if(timebox.find('.xdsoft_init_time').length){
classType='.xdsoft_init_time';
}
if(classType){
pheight=timeboxparent[0].clientHeight;
height=timebox[0].offsetHeight;
top=timebox.find(classType).index() * options.timeHeightInTimePicker + 1;
if((height - pheight) < top){
top=height - pheight;
}
timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight)]);
}else{
timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]);
}}
});
timerclick=0;
calendar
.on('touchend click.xdsoft', 'td', function (xdevent){
xdevent.stopPropagation();
timerclick +=1;
var $this=$(this),
currentTime=_xdsoft_datetime.currentTime;
if(currentTime===undefined||currentTime===null){
_xdsoft_datetime.currentTime=_xdsoft_datetime.now();
currentTime=_xdsoft_datetime.currentTime;
}
if($this.hasClass('xdsoft_disabled')){
return false;
}
currentTime.setDate(1);
currentTime.setFullYear($this.data('year'));
currentTime.setMonth($this.data('month'));
currentTime.setDate($this.data('date'));
datetimepicker.trigger('select.xdsoft', [currentTime]);
input.val(_xdsoft_datetime.str());
if(options.onSelectDate&&$.isFunction(options.onSelectDate)){
options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
}
datetimepicker.data('changed', true);
datetimepicker.trigger('xchange.xdsoft');
datetimepicker.trigger('changedatetime.xdsoft');
if((timerclick > 1||(options.closeOnDateSelect===true||(options.closeOnDateSelect===false&&!options.timepicker)))&&!options.inline){
datetimepicker.trigger('close.xdsoft');
}
setTimeout(function (){
timerclick=0;
}, 200);
});
timebox
.on('touchstart', 'div', function (xdevent){
this.touchMoved=false;
})
.on('touchmove', 'div', handleTouchMoved)
.on('touchend click.xdsoft', 'div', function (xdevent){
if(!this.touchMoved){
xdevent.stopPropagation();
var $this=$(this),
currentTime=_xdsoft_datetime.currentTime;
if(currentTime===undefined||currentTime===null){
_xdsoft_datetime.currentTime=_xdsoft_datetime.now();
currentTime=_xdsoft_datetime.currentTime;
}
if($this.hasClass('xdsoft_disabled')){
return false;
}
currentTime.setHours($this.data('hour'));
currentTime.setMinutes($this.data('minute'));
datetimepicker.trigger('select.xdsoft', [currentTime]);
datetimepicker.data('input').val(_xdsoft_datetime.str());
if(options.onSelectTime&&$.isFunction(options.onSelectTime)){
options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
}
datetimepicker.data('changed', true);
datetimepicker.trigger('xchange.xdsoft');
datetimepicker.trigger('changedatetime.xdsoft');
if(options.inline!==true&&options.closeOnTimeSelect===true){
datetimepicker.trigger('close.xdsoft');
}}
});
datepicker
.on('mousewheel.xdsoft', function (event){
if(!options.scrollMonth){
return true;
}
if(event.deltaY < 0){
_xdsoft_datetime.nextMonth();
}else{
_xdsoft_datetime.prevMonth();
}
return false;
});
input
.on('mousewheel.xdsoft', function (event){
if(!options.scrollInput){
return true;
}
if(!options.datepicker&&options.timepicker){
current_time_index=timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index():0;
if(current_time_index + event.deltaY >=0&¤t_time_index + event.deltaY < timebox.children().length){
current_time_index +=event.deltaY;
}
if(timebox.children().eq(current_time_index).length){
timebox.children().eq(current_time_index).trigger('mousedown');
}
return false;
}
if(options.datepicker&&!options.timepicker){
datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]);
if(input.val){
input.val(_xdsoft_datetime.str());
}
datetimepicker.trigger('changedatetime.xdsoft');
return false;
}});
datetimepicker
.on('changedatetime.xdsoft', function (event){
if(options.onChangeDateTime&&$.isFunction(options.onChangeDateTime)){
var $input=datetimepicker.data('input');
options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event);
delete options.value;
$input.trigger('change');
}})
.on('generate.xdsoft', function (){
if(options.onGenerate&&$.isFunction(options.onGenerate)){
options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
}
if(triggerAfterOpen){
datetimepicker.trigger('afterOpen.xdsoft');
triggerAfterOpen=false;
}})
.on('click.xdsoft', function (xdevent){
xdevent.stopPropagation();
});
current_time_index=0;
forEachAncestorOf=function (node, callback){
do {
node=node.parentNode;
if(!node||callback(node)===false){
break;
}} while (node.nodeName!=='HTML');
};
setPos=function (){
var dateInputOffset,
dateInputElem,
verticalPosition,
left,
position,
datetimepickerElem,
dateInputHasFixedAncestor,
$dateInput,
windowWidth,
verticalAnchorEdge,
datetimepickerCss,
windowHeight,
windowScrollTop;
$dateInput=datetimepicker.data('input');
dateInputOffset=$dateInput.offset();
dateInputElem=$dateInput[0];
verticalAnchorEdge='top';
verticalPosition=(dateInputOffset.top + dateInputElem.offsetHeight) - 1;
left=dateInputOffset.left;
position="absolute";
windowWidth=$(options.contentWindow).width();
windowHeight=$(options.contentWindow).height();
windowScrollTop=$(options.contentWindow).scrollTop();
if((options.ownerDocument.documentElement.clientWidth - dateInputOffset.left) < datepicker.parent().outerWidth(true)){
var diff=datepicker.parent().outerWidth(true) - dateInputElem.offsetWidth;
left=left - diff;
}
if($dateInput.parent().css('direction')==='rtl'){
left -=(datetimepicker.outerWidth() - $dateInput.outerWidth());
}
if(options.fixed){
verticalPosition -=windowScrollTop;
left -=$(options.contentWindow).scrollLeft();
position="fixed";
}else{
dateInputHasFixedAncestor=false;
forEachAncestorOf(dateInputElem, function (ancestorNode){
if(ancestorNode===null){
return false;
}
if(options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position')==='fixed'){
dateInputHasFixedAncestor=true;
return false;
}});
if(dateInputHasFixedAncestor){
position='fixed';
if(verticalPosition + datetimepicker.outerHeight() > windowHeight + windowScrollTop){
verticalAnchorEdge='bottom';
verticalPosition=(windowHeight + windowScrollTop) - dateInputOffset.top;
}else{
verticalPosition -=windowScrollTop;
}}else{
if(verticalPosition + datetimepicker[0].offsetHeight > windowHeight + windowScrollTop){
verticalPosition=dateInputOffset.top - datetimepicker[0].offsetHeight + 1;
}}
if(verticalPosition < 0){
verticalPosition=0;
}
if(left + dateInputElem.offsetWidth > windowWidth){
left=windowWidth - dateInputElem.offsetWidth;
}}
left=(left < 35) ? 35:left;
datetimepickerElem=datetimepicker[0];
forEachAncestorOf(datetimepickerElem, function (ancestorNode){
var ancestorNodePosition;
ancestorNodePosition=options.contentWindow.getComputedStyle(ancestorNode).getPropertyValue('position');
if(ancestorNodePosition==='relative'&&windowWidth >=ancestorNode.offsetWidth){
left=left - ((windowWidth - ancestorNode.offsetWidth) / 2);
return false;
}});
datetimepickerCss={
position: position,
left: left,
top: '',
bottom: ''
};
var iOS=/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream;
if(iOS){
verticalPosition=verticalPosition + 100;
}
datetimepickerCss[verticalAnchorEdge]=verticalPosition;
datetimepicker.css(datetimepickerCss);
};
datetimepicker
.on('open.xdsoft', function (event){
var onShow=true;
if(options.onShow&&$.isFunction(options.onShow)){
onShow=options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
}
if(onShow!==false){
datetimepicker.show();
setPos();
$(options.contentWindow)
.off('resize.xdsoft', setPos)
.on('resize.xdsoft', setPos);
if(options.closeOnWithoutClick){
$([options.ownerDocument.body, options.contentWindow]).on('touchstart mousedown.xdsoft', function arguments_callee6(){
datetimepicker.trigger('close.xdsoft');
$([options.ownerDocument.body, options.contentWindow]).off('touchstart mousedown.xdsoft', arguments_callee6);
});
}}
})
.on('close.xdsoft', function (event){
var onClose=true;
month_picker
.find('.xdsoft_month,.xdsoft_year')
.find('.xdsoft_select')
.hide();
if(options.onClose&&$.isFunction(options.onClose)){
onClose=options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
}
if(onClose!==false&&!options.opened&&!options.inline){
datetimepicker.hide();
}
event.stopPropagation();
})
.on('toggle.xdsoft', function (){
if(datetimepicker.is(':visible')){
datetimepicker.trigger('close.xdsoft');
}else{
datetimepicker.trigger('open.xdsoft');
}})
.data('input', input);
timer=0;
datetimepicker.data('xdsoft_datetime', _xdsoft_datetime);
datetimepicker.setOptions(options);
function getCurrentValue(){
var ct=false, time;
if(options.startDate){
ct=_xdsoft_datetime.strToDate(options.startDate);
}else{
ct=options.value||((input&&input.val&&input.val()) ? input.val():'');
if(ct){
ct=_xdsoft_datetime.strToDateTime(ct);
if(options.yearOffset){
ct=new Date(ct.getFullYear() - options.yearOffset, ct.getMonth(), ct.getDate(), ct.getHours(), ct.getMinutes(), ct.getSeconds(), ct.getMilliseconds());
}}else if(options.defaultDate){
ct=_xdsoft_datetime.strToDateTime(options.defaultDate);
if(options.defaultTime){
time=_xdsoft_datetime.strtotime(options.defaultTime);
ct.setHours(time.getHours());
ct.setMinutes(time.getMinutes());
}}
}
if(ct&&_xdsoft_datetime.isValidDate(ct)){
datetimepicker.data('changed', true);
}else{
ct='';
}
return ct||0;
}
function setMask(options){
var isValidValue=function (mask, value){
var reg=mask
.replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1')
.replace(/_/g, '{digit+}')
.replace(/([0-9]{1})/g, '{digit$1}')
.replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}')
.replace(/\{digit[\+]\}/g, '[0-9_]{1}');
return (new RegExp(reg)).test(value);
},
getCaretPos=function (input){
try {
if(options.ownerDocument.selection&&options.ownerDocument.selection.createRange){
var range=options.ownerDocument.selection.createRange();
return range.getBookmark().charCodeAt(2) - 2;
}
if(input.setSelectionRange){
return input.selectionStart;
}} catch (e){
return 0;
}},
setCaretPos=function (node, pos){
node=(typeof node==="string"||node instanceof String) ? options.ownerDocument.getElementById(node):node;
if(!node){
return false;
}
if(node.createTextRange){
var textRange=node.createTextRange();
textRange.collapse(true);
textRange.moveEnd('character', pos);
textRange.moveStart('character', pos);
textRange.select();
return true;
}
if(node.setSelectionRange){
node.setSelectionRange(pos, pos);
return true;
}
return false;
};
if(options.mask){
input.off('keydown.xdsoft');
}
if(options.mask===true){
if(dateHelper.formatMask){
options.mask=dateHelper.formatMask(options.format)
}else{
options.mask=options.format
.replace(/Y/g, '9999')
.replace(/F/g, '9999')
.replace(/m/g, '19')
.replace(/d/g, '39')
.replace(/H/g, '29')
.replace(/i/g, '59')
.replace(/s/g, '59');
}}
if($.type(options.mask)==='string'){
if(!isValidValue(options.mask, input.val())){
input.val(options.mask.replace(/[0-9]/g, '_'));
setCaretPos(input[0], 0);
}
input.on('paste.xdsoft', function (event){
var clipboardData=event.clipboardData||event.originalEvent.clipboardData||window.clipboardData,
pastedData=clipboardData.getData('text'),
val=this.value,
pos=this.selectionStart
var valueBeforeCursor=val.substr(0, pos);
var valueAfterPaste=val.substr(pos + pastedData.length);
val=valueBeforeCursor + pastedData + valueAfterPaste;
pos +=pastedData.length;
if(isValidValue(options.mask, val)){
this.value=val;
setCaretPos(this, pos);
}else if($.trim(val)===''){
this.value=options.mask.replace(/[0-9]/g, '_');
}else{
input.trigger('error_input.xdsoft');
}
event.preventDefault();
return false;
});
input.on('keydown.xdsoft', function (event){
var val=this.value,
key=event.which,
pos=this.selectionStart,
selEnd=this.selectionEnd,
hasSel=pos!==selEnd,
digit;
if(((key >=KEY0&&key <=KEY9) ||
(key >=_KEY0&&key <=_KEY9)) ||
(key===BACKSPACE||key===DEL)){
digit=(key===BACKSPACE||key===DEL) ? '_' :
String.fromCharCode((_KEY0 <=key&&key <=_KEY9) ? key - KEY0:key);
if(key===BACKSPACE&&pos&&!hasSel){
pos -=1;
}
while (true){
var maskValueAtCurPos=options.mask.substr(pos, 1);
var posShorterThanMaskLength=pos < options.mask.length;
var posGreaterThanZero=pos > 0;
var notNumberOrPlaceholder=/[^0-9_]/;
var curPosOnSep=notNumberOrPlaceholder.test(maskValueAtCurPos);
var continueMovingPosition=curPosOnSep&&posShorterThanMaskLength&&posGreaterThanZero
if(!continueMovingPosition) break;
pos +=(key===BACKSPACE&&!hasSel) ? -1:1;
}
if(hasSel){
var selLength=selEnd - pos
var defaultBlank=options.mask.replace(/[0-9]/g, '_');
var defaultBlankSelectionReplacement=defaultBlank.substr(pos, selLength);
var selReplacementRemainder=defaultBlankSelectionReplacement.substr(1)
var valueBeforeSel=val.substr(0, pos);
var insertChars=digit + selReplacementRemainder;
var charsAfterSelection=val.substr(pos + selLength);
val=valueBeforeSel + insertChars + charsAfterSelection
}else{
var valueBeforeCursor=val.substr(0, pos);
var insertChar=digit;
var valueAfterNextChar=val.substr(pos + 1);
val=valueBeforeCursor + insertChar + valueAfterNextChar
}
if($.trim(val)===''){
val=defaultBlank
}else{
if(pos===options.mask.length){
event.preventDefault();
return false;
}}
pos +=(key===BACKSPACE) ? 0:1;
while (/[^0-9_]/.test(options.mask.substr(pos, 1))&&pos < options.mask.length&&pos > 0){
pos +=(key===BACKSPACE) ? 0:1;
}
if(isValidValue(options.mask, val)){
this.value=val;
setCaretPos(this, pos);
}else if($.trim(val)===''){
this.value=options.mask.replace(/[0-9]/g, '_');
}else{
input.trigger('error_input.xdsoft');
}}else{
if(([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key)!==-1&&ctrlDown)||[ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key)!==-1){
return true;
}}
event.preventDefault();
return false;
});
}}
_xdsoft_datetime.setCurrentTime(getCurrentValue());
input
.data('xdsoft_datetimepicker', datetimepicker)
.on('open.xdsoft focusin.xdsoft mousedown.xdsoft touchstart', function (){
if(input.is(':disabled')||(input.data('xdsoft_datetimepicker').is(':visible')&&options.closeOnInputClick)){
return;
}
if(!options.openOnFocus){
return;
}
clearTimeout(timer);
timer=setTimeout(function (){
if(input.is(':disabled')){
return;
}
triggerAfterOpen=true;
_xdsoft_datetime.setCurrentTime(getCurrentValue(), true);
if(options.mask){
setMask(options);
}
datetimepicker.trigger('open.xdsoft');
}, 100);
})
.on('keydown.xdsoft', function (event){
var elementSelector,
key=event.which;
if([ENTER].indexOf(key)!==-1&&options.enterLikeTab){
elementSelector=$("input:visible,textarea:visible,button:visible,a:visible");
datetimepicker.trigger('close.xdsoft');
elementSelector.eq(elementSelector.index(this) + 1).focus();
return false;
}
if([TAB].indexOf(key)!==-1){
datetimepicker.trigger('close.xdsoft');
return true;
}})
.on('blur.xdsoft', function (){
datetimepicker.trigger('close.xdsoft');
});
};
destroyDateTimePicker=function (input){
var datetimepicker=input.data('xdsoft_datetimepicker');
if(datetimepicker){
datetimepicker.data('xdsoft_datetime', null);
datetimepicker.remove();
input
.data('xdsoft_datetimepicker', null)
.off('.xdsoft');
$(options.contentWindow).off('resize.xdsoft');
$([options.contentWindow, options.ownerDocument.body]).off('mousedown.xdsoft touchstart');
if(input.unmousewheel){
input.unmousewheel();
}}
};
$(options.ownerDocument)
.off('keydown.xdsoftctrl keyup.xdsoftctrl')
.on('keydown.xdsoftctrl', function (e){
if(e.keyCode===CTRLKEY){
ctrlDown=true;
}})
.on('keyup.xdsoftctrl', function (e){
if(e.keyCode===CTRLKEY){
ctrlDown=false;
}});
this.each(function (){
var datetimepicker=$(this).data('xdsoft_datetimepicker'), $input;
if(datetimepicker){
if($.type(opt)==='string'){
switch (opt){
case 'show':
$(this).select().focus();
datetimepicker.trigger('open.xdsoft');
break;
case 'hide':
datetimepicker.trigger('close.xdsoft');
break;
case 'toggle':
datetimepicker.trigger('toggle.xdsoft');
break;
case 'destroy':
destroyDateTimePicker($(this));
break;
case 'reset':
this.value=this.defaultValue;
if(!this.value||!datetimepicker.data('xdsoft_datetime').isValidDate(dateHelper.parseDate(this.value, options.format))){
datetimepicker.data('changed', false);
}
datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value);
break;
case 'validate':
$input=datetimepicker.data('input');
$input.trigger('blur.xdsoft');
break;
default:
if(datetimepicker[opt]&&$.isFunction(datetimepicker[opt])){
result=datetimepicker[opt](opt2);
}}
}else{
datetimepicker
.setOptions(opt);
}
return 0;
}
if($.type(opt)!=='string'){
if(!options.lazyInit||options.open||options.inline){
createDateTimePicker($(this));
}else{
lazyInit($(this));
}}
});
return result;
};
$.fn.datetimepicker.defaults=default_options;
function HighlightedDate(date, desc, style){
"use strict";
this.date=date;
this.desc=desc;
this.style=style;
}};
;(function (factory){
if(typeof define==='function'&&define.amd){
define(['jquery', 'jquery-mousewheel'], factory);
}else if(typeof exports==='object'){
module.exports=factory(require('jquery'));;
}else{
factory(jQuery);
}}(datetimepickerFactory));
(function (factory){
if(typeof define==='function'&&define.amd){
define(['jquery'], factory);
}else if(typeof exports==='object'){
module.exports=factory;
}else{
factory(jQuery);
}}(function ($){
var toFix=['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
toBind=('onwheel' in document||document.documentMode >=9) ?
['wheel']:['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
slice=Array.prototype.slice,
nullLowestDeltaTimeout, lowestDelta;
if($.event.fixHooks){
for(var i=toFix.length; i;){
$.event.fixHooks[ toFix[--i] ]=$.event.mouseHooks;
}}
var special=$.event.special.mousewheel={
version: '3.1.12',
setup: function(){
if(this.addEventListener){
for(var i=toBind.length; i;){
this.addEventListener(toBind[--i], handler, false);
}}else{
this.onmousewheel=handler;
}
$.data(this, 'mousewheel-line-height', special.getLineHeight(this));
$.data(this, 'mousewheel-page-height', special.getPageHeight(this));
},
teardown: function(){
if(this.removeEventListener){
for(var i=toBind.length; i;){
this.removeEventListener(toBind[--i], handler, false);
}}else{
this.onmousewheel=null;
}
$.removeData(this, 'mousewheel-line-height');
$.removeData(this, 'mousewheel-page-height');
},
getLineHeight: function(elem){
var $elem=$(elem),
$parent=$elem['offsetParent' in $.fn ? 'offsetParent':'parent']();
if(!$parent.length){
$parent=$('body');
}
return parseInt($parent.css('fontSize'), 10)||parseInt($elem.css('fontSize'), 10)||16;
},
getPageHeight: function(elem){
return $(elem).height();
},
settings: {
adjustOldDeltas: true,
normalizeOffset: true
}};
$.fn.extend({
mousewheel: function(fn){
return fn ? this.on('mousewheel', fn):this.trigger('mousewheel');
},
unmousewheel: function(fn){
return this.unbind('mousewheel', fn);
}});
function handler(event){
var orgEvent=event||window.event,
args=slice.call(arguments, 1),
delta=0,
deltaX=0,
deltaY=0,
absDelta=0,
offsetX=0,
offsetY=0;
event=$.event.fix(orgEvent);
event.type='mousewheel';
if('detail' in orgEvent){ deltaY=orgEvent.detail * -1; }
if('wheelDelta' in orgEvent){ deltaY=orgEvent.wheelDelta; }
if('wheelDeltaY' in orgEvent){ deltaY=orgEvent.wheelDeltaY; }
if('wheelDeltaX' in orgEvent){ deltaX=orgEvent.wheelDeltaX * -1; }
if('axis' in orgEvent&&orgEvent.axis===orgEvent.HORIZONTAL_AXIS){
deltaX=deltaY * -1;
deltaY=0;
}
delta=deltaY===0 ? deltaX:deltaY;
if('deltaY' in orgEvent){
deltaY=orgEvent.deltaY * -1;
delta=deltaY;
}
if('deltaX' in orgEvent){
deltaX=orgEvent.deltaX;
if(deltaY===0){ delta=deltaX * -1; }}
if(deltaY===0&&deltaX===0){ return; }
if(orgEvent.deltaMode===1){
var lineHeight=$.data(this, 'mousewheel-line-height');
delta *=lineHeight;
deltaY *=lineHeight;
deltaX *=lineHeight;
}else if(orgEvent.deltaMode===2){
var pageHeight=$.data(this, 'mousewheel-page-height');
delta *=pageHeight;
deltaY *=pageHeight;
deltaX *=pageHeight;
}
absDelta=Math.max(Math.abs(deltaY), Math.abs(deltaX));
if(!lowestDelta||absDelta < lowestDelta){
lowestDelta=absDelta;
if(shouldAdjustOldDeltas(orgEvent, absDelta)){
lowestDelta /=40;
}}
if(shouldAdjustOldDeltas(orgEvent, absDelta)){
delta /=40;
deltaX /=40;
deltaY /=40;
}
delta=Math[ delta >=1 ? 'floor':'ceil' ](delta / lowestDelta);
deltaX=Math[ deltaX >=1 ? 'floor':'ceil' ](deltaX / lowestDelta);
deltaY=Math[ deltaY >=1 ? 'floor':'ceil' ](deltaY / lowestDelta);
if(special.settings.normalizeOffset&&this.getBoundingClientRect){
var boundingRect=this.getBoundingClientRect();
offsetX=event.clientX - boundingRect.left;
offsetY=event.clientY - boundingRect.top;
}
event.deltaX=deltaX;
event.deltaY=deltaY;
event.deltaFactor=lowestDelta;
event.offsetX=offsetX;
event.offsetY=offsetY;
event.deltaMode=0;
args.unshift(event, delta, deltaX, deltaY);
if(nullLowestDeltaTimeout){ clearTimeout(nullLowestDeltaTimeout); }
nullLowestDeltaTimeout=setTimeout(nullLowestDelta, 200);
return ($.event.dispatch||$.event.handle).apply(this, args);
}
function nullLowestDelta(){
lowestDelta=null;
}
function shouldAdjustOldDeltas(orgEvent, absDelta){
return special.settings.adjustOldDeltas&&orgEvent.type==='mousewheel'&&absDelta % 120===0;
}}));
(function (root, factory){
if(typeof define==='function'&&define.amd){
define(['jquery'], function (a0){
return (factory(a0));
});
}else if(typeof module==='object'&&module.exports){
module.exports=factory(require('jquery'));
}else{
factory(root["jQuery"]);
}}(this, function ($){
(function(){
'use strict';
var defaults={
videoMaxWidth: '855px',
autoplayFirstVideo: true,
youtubePlayerParams: false,
vimeoPlayerParams: false,
dailymotionPlayerParams: false,
vkPlayerParams: false,
videojs: false,
videojsOptions: {}};
var Video=function(element){
this.core=$(element).data('lightGallery');
this.$el=$(element);
this.core.s=$.extend({}, defaults, this.core.s);
this.videoLoaded=false;
this.init();
return this;
};
Video.prototype.init=function(){
var _this=this;
_this.core.$el.on('hasVideo.lg.tm', onHasVideo.bind(this));
_this.core.$el.on('onAferAppendSlide.lg.tm', onAferAppendSlide.bind(this));
if(_this.core.doCss()&&(_this.core.$items.length > 1)&&(_this.core.s.enableSwipe||_this.core.s.enableDrag)){
_this.core.$el.on('onSlideClick.lg.tm', function(){
var $el=_this.core.$slide.eq(_this.core.index);
_this.loadVideoOnclick($el);
});
}else{
_this.core.$slide.on('click.lg', function(){
_this.loadVideoOnclick($(this));
});
}
_this.core.$el.on('onBeforeSlide.lg.tm', onBeforeSlide.bind(this));
_this.core.$el.on('onAfterSlide.lg.tm', function(event, prevIndex){
_this.core.$slide.eq(prevIndex).removeClass('lg-video-playing');
});
if(_this.core.s.autoplayFirstVideo){
_this.core.$el.on('onAferAppendSlide.lg.tm', function (e, index){
if(!_this.core.lGalleryOn){
var $el=_this.core.$slide.eq(index);
setTimeout(function (){
_this.loadVideoOnclick($el);
}, 100);
}});
}};
Video.prototype.loadVideo=function(src, addClass, noPoster, index, html){
var video='';
var autoplay=1;
var a='';
var isVideo=this.core.isVideo(src, index)||{};
if(noPoster){
if(this.videoLoaded){
autoplay=0;
}else{
autoplay=this.core.s.autoplayFirstVideo ? 1:0;
}}
if(isVideo.youtube){
a='?wmode=opaque&autoplay=' + autoplay + '&enablejsapi=1';
if(this.core.s.youtubePlayerParams){
a=a + '&' + $.param(this.core.s.youtubePlayerParams);
}
video='';
}else if(isVideo.vimeo){
a='?autoplay=' + autoplay + '&api=1';
if(this.core.s.vimeoPlayerParams){
a=a + '&' + $.param(this.core.s.vimeoPlayerParams);
}
video='';
}else if(isVideo.dailymotion){
a='?wmode=opaque&autoplay=' + autoplay + '&api=postMessage';
if(this.core.s.dailymotionPlayerParams){
a=a + '&' + $.param(this.core.s.dailymotionPlayerParams);
}
video='';
}else if(isVideo.html5){
var fL=html.substring(0, 1);
if(fL==='.'||fL==='#'){
html=$(html).html();
}
video=html;
}else if(isVideo.vk){
a='&autoplay=' + autoplay;
if(this.core.s.vkPlayerParams){
a=a + '&' + $.param(this.core.s.vkPlayerParams);
}
video='';
}
return video;
};
Video.prototype.loadVideoOnclick=function($el){
var _this=this;
if($el.find('.lg-object').hasClass('lg-has-poster')&&$el.find('.lg-object').is(':visible')){
if(!$el.hasClass('lg-has-video')){
$el.addClass('lg-video-playing lg-has-video');
var _src;
var _html;
var _loadVideo=function(_src, _html){
$el.find('.lg-video').append(_this.loadVideo(_src, '', false, _this.core.index, _html));
if(_html){
if(_this.core.s.videojs){
try {
videojs(_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function(){
this.play();
});
} catch (e){
console.error('Make sure you have included videojs');
}}else{
_this.core.$slide.eq(_this.core.index).find('.lg-html5').get(0).play();
}}
};
if(_this.core.s.dynamic){
_src=_this.core.s.dynamicEl[_this.core.index].src;
_html=_this.core.s.dynamicEl[_this.core.index].html;
_loadVideo(_src, _html);
}else{
_src=_this.core.$items.eq(_this.core.index).attr('href')||_this.core.$items.eq(_this.core.index).attr('data-src');
_html=_this.core.$items.eq(_this.core.index).attr('data-html');
_loadVideo(_src, _html);
}
var $tempImg=$el.find('.lg-object');
$el.find('.lg-video').append($tempImg);
if(!$el.find('.lg-video-object').hasClass('lg-html5')){
$el.removeClass('lg-complete');
$el.find('.lg-video-object').on('load.lg error.lg', function(){
$el.addClass('lg-complete');
});
}}else{
var youtubePlayer=$el.find('.lg-youtube').get(0);
var vimeoPlayer=$el.find('.lg-vimeo').get(0);
var dailymotionPlayer=$el.find('.lg-dailymotion').get(0);
var html5Player=$el.find('.lg-html5').get(0);
if(youtubePlayer){
youtubePlayer.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}', '*');
}else if(vimeoPlayer){
try {
$f(vimeoPlayer).api('play');
} catch (e){
console.error('Make sure you have included froogaloop2 js');
}}else if(dailymotionPlayer){
dailymotionPlayer.contentWindow.postMessage('play', '*');
}else if(html5Player){
if(_this.core.s.videojs){
try {
videojs(html5Player).play();
} catch (e){
console.error('Make sure you have included videojs');
}}else{
html5Player.play();
}}
$el.addClass('lg-video-playing');
}}
};
Video.prototype.destroy=function(){
this.videoLoaded=false;
};
function onHasVideo(event, index, src, html){
var _this=this;
_this.core.$slide.eq(index).find('.lg-video').append(_this.loadVideo(src, 'lg-object', true, index, html));
if(html){
if(_this.core.s.videojs){
try {
videojs(_this.core.$slide.eq(index).find('.lg-html5').get(0), _this.core.s.videojsOptions, function(){
if(!_this.videoLoaded&&_this.core.s.autoplayFirstVideo){
this.play();
}});
} catch (e){
console.error('Make sure you have included videojs');
}}else{
if(!_this.videoLoaded&&_this.core.s.autoplayFirstVideo){
_this.core.$slide.eq(index).find('.lg-html5').get(0).play();
}}
}}
function onAferAppendSlide(event, index){
var $videoCont=this.core.$slide.eq(index).find('.lg-video-cont');
if(!$videoCont.hasClass('lg-has-iframe')){
$videoCont.css('max-width', this.core.s.videoMaxWidth);
this.videoLoaded=true;
}}
function onBeforeSlide(event, prevIndex, index){
var _this=this;
var $videoSlide=_this.core.$slide.eq(prevIndex);
var youtubePlayer=$videoSlide.find('.lg-youtube').get(0);
var vimeoPlayer=$videoSlide.find('.lg-vimeo').get(0);
var dailymotionPlayer=$videoSlide.find('.lg-dailymotion').get(0);
var vkPlayer=$videoSlide.find('.lg-vk').get(0);
var html5Player=$videoSlide.find('.lg-html5').get(0);
if(youtubePlayer){
youtubePlayer.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
}else if(vimeoPlayer){
try {
$f(vimeoPlayer).api('pause');
} catch (e){
console.error('Make sure you have included froogaloop2 js');
}}else if(dailymotionPlayer){
dailymotionPlayer.contentWindow.postMessage('pause', '*');
}else if(html5Player){
if(_this.core.s.videojs){
try {
videojs(html5Player).pause();
} catch (e){
console.error('Make sure you have included videojs');
}}else{
html5Player.pause();
}} if(vkPlayer){
$(vkPlayer).attr('src', $(vkPlayer).attr('src').replace('&autoplay', '&noplay'));
}
var _src;
if(_this.core.s.dynamic){
_src=_this.core.s.dynamicEl[index].src;
}else{
_src=_this.core.$items.eq(index).attr('href')||_this.core.$items.eq(index).attr('data-src');
}
var _isVideo=_this.core.isVideo(_src, index)||{};
if(_isVideo.youtube||_isVideo.vimeo||_isVideo.dailymotion||_isVideo.vk){
_this.core.$outer.addClass('lg-hide-download');
}}
$.fn.lightGallery.modules.video=Video;
})();
}));