(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=$(''); $.each(data.invalidFields, function(i, n){ if(n.idref){ var $li=$('
  • ').append($('').attr('href', '#' + n.idref).append(n.message)); }else{ var $li=$('
  • ').append(n.message); } $invalids.append($li); }); $response.append($invalids); } $response.attr('role', 'alert').focus(); }); }; $.ajax({ type: 'POST', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/feedback'), data: formData, dataType: 'json', processData: false, contentType: false }).done(function(data, status, xhr){ ajaxSuccess(data, status, xhr, $form); $('.ajax-loader', $form).removeClass('is-active'); }).fail(function(xhr, status, error){ var $e=$('
    ').text(error.message); $form.after($e); }); }; wpcf7.triggerEvent=function(target, name, detail){ var $target=$(target); var event=new CustomEvent('wpcf7' + name, { bubbles: true, detail: detail }); $target.get(0).dispatchEvent(event); $target.trigger('wpcf7:' + name, detail); $target.trigger(name + '.wpcf7', detail); }; wpcf7.toggleSubmit=function(form, state){ var $form=$(form); var $submit=$('input:submit', $form); if(typeof state!=='undefined'){ $submit.prop('disabled', ! state); return; } if($form.hasClass('wpcf7-acceptance-as-validation')){ return; } $submit.prop('disabled', false); $('.wpcf7-acceptance', $form).each(function(){ var $span=$(this); var $input=$('input:checkbox', $span); if(! $span.hasClass('optional')){ if($span.hasClass('invert')&&$input.is(':checked') || ! $span.hasClass('invert')&&! $input.is(':checked')){ $submit.prop('disabled', true); return false; }} }); }; wpcf7.notValidTip=function(target, message){ var $target=$(target); $('.wpcf7-not-valid-tip', $target).remove(); $('') .text(message).appendTo($target); if($target.is('.use-floating-validation-tip *')){ var fadeOut=function(target){ $(target).not(':hidden').animate({ opacity: 0 }, 'fast', function(){ $(this).css({ 'z-index': -100 }); }); }; $target.on('mouseover', '.wpcf7-not-valid-tip', function(){ fadeOut(this); }); $target.on('focus', ':input', function(){ fadeOut($('.wpcf7-not-valid-tip', $target)); }); }}; wpcf7.refill=function(form, data){ var $form=$(form); var refillCaptcha=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find('img.wpcf7-captcha-' + i).attr('src', n); var match=/([0-9]+)\.(png|gif|jpeg)$/.exec(n); $form.find('input:hidden[name="_wpcf7_captcha_challenge_' + i + '"]').attr('value', match[ 1 ]); }); }; var refillQuiz=function($form, items){ $.each(items, function(i, n){ $form.find(':input[name="' + i + '"]').val(''); $form.find(':input[name="' + i + '"]').siblings('span.wpcf7-quiz-label').text(n[ 0 ]); $form.find('input:hidden[name="_wpcf7_quiz_answer_' + i + '"]').attr('value', n[ 1 ]); }); }; if(typeof data==='undefined'){ $.ajax({ type: 'GET', url: wpcf7.apiSettings.getRoute('/contact-forms/' + wpcf7.getId($form) + '/refill'), beforeSend: function(xhr){ var nonce=$form.find(':input[name="_wpnonce"]').val(); if(nonce){ xhr.setRequestHeader('X-WP-Nonce', nonce); }}, dataType: 'json' }).done(function(data, status, xhr){ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }}); }else{ if(data.captcha){ refillCaptcha($form, data.captcha); } if(data.quiz){ refillQuiz($form, data.quiz); }} }; wpcf7.clearResponse=function(form){ var $form=$(form); $form.removeClass('invalid spam sent failed'); $form.siblings('.screen-reader-response').html('').attr('role', ''); $('.wpcf7-not-valid-tip', $form).remove(); $('[aria-invalid]', $form).attr('aria-invalid', 'false'); $('.wpcf7-form-control', $form).removeClass('wpcf7-not-valid'); $('.wpcf7-response-output', $form) .hide().empty().removeAttr('role') .removeClass('wpcf7-mail-sent-ok wpcf7-mail-sent-ng wpcf7-validation-errors wpcf7-spam-blocked'); }; wpcf7.apiSettings.getRoute=function(path){ var url=wpcf7.apiSettings.root; url=url.replace(wpcf7.apiSettings.namespace, wpcf7.apiSettings.namespace + path); return url; };})(jQuery); (function (){ if(typeof window.CustomEvent==="function") return false; function CustomEvent(event, params){ params=params||{ bubbles: false, cancelable: false, detail: undefined }; var evt=document.createEvent('CustomEvent'); evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); return evt; } CustomEvent.prototype=window.Event.prototype; window.CustomEvent=CustomEvent; })(); !function(e){e.fn.CodeDropz_Uploader=function(a){this.each(function(){var d=e(this),r=e.extend({handler:d,color:"#000",background:"",server_max_error:"Uploaded file exceeds the maximum upload size of your server.",max_file:d.data("max")?d.data("max"):10,max_upload_size:d.data("limit")?d.data("limit"):"5242880",supported_type:d.data("type")?d.data("type"):"jpg|jpeg|JPG|png|gif|pdf|doc|docx|ppt|pptx|odt|avi|ogg|m4a|mov|mp3|mp4|mpg|wav|wmv|xls",text:"Drag & Drop Files Here",separator:"or",button_text:"Browse Files",on_success:""},a),o=d.data("name")+"_count_files";localStorage.setItem(o,1);var t='

    '+r.text+"

    "+r.separator+'
    ";r.handler.wrapAll('
    '),r.supported_type=r.supported_type.replace(/[^a-zA-Z0-9| ]/g,"");var s=r.handler.parents("form"),n=r.handler.parents(".codedropz-upload-wrapper"),p=e('input[type="submit"]',s);r.handler.after(t),e(".codedropz-upload-handler",n).on("drag dragstart dragend dragover dragenter dragleave drop",function(e){e.preventDefault(),e.stopPropagation()}),e(".codedropz-upload-handler",n).on("dragover dragenter",function(a){e(this).addClass("codedropz-dragover")}),e(".codedropz-upload-handler",n).on("dragleave dragend drop",function(a){e(this).removeClass("codedropz-dragover")}),e("a.cd-upload-btn",n).on("click",function(e){e.preventDefault(),r.handler.val(null),r.handler.click()}),e(".codedropz-upload-handler",n).on("drop",function(e){l(e.originalEvent.dataTransfer.files,"drop")}),r.handler.on("change",function(e){l(this.files,"click")});var l=function(a,t){if(!(!a.length>1)){var p=new FormData;p.append("supported_type",r.supported_type),p.append("size_limit",r.max_upload_size),p.append("action","dnd_codedropz_upload"),p.append("type",t),p.append("security",dnd_cf7_uploader.ajax_nonce),e("span.has-error",r.handler).remove(),e.each(a,function(a,t){if(void 0!==p.delete&&p.delete("upload-file"),localStorage.getItem(o)>r.max_file)return!e("span.has-error-msg",n).length>0&&(err_msg=dnd_cf7_uploader.drag_n_drop_upload.max_file_limit,n.append(''+err_msg.replace("%count%",r.max_file)+"")),!1;var l=i.createProgressBar(t),c=!1;if(t.size>r.max_upload_size&&(e(".dnd-upload-details",e("#"+l)).append(''+dnd_cf7_uploader.drag_n_drop_upload.large_file+""),c=!0),regex_type=new RegExp("(.*?).("+r.supported_type+")$"),!1!==c||regex_type.test(t.name.toLowerCase())||(e(".dnd-upload-details",e("#"+l)).append(''+dnd_cf7_uploader.drag_n_drop_upload.inavalid_type+""),c=!0),localStorage.setItem(o,Number(localStorage.getItem(o))+1),!1===c){p.append("upload-file",t);e.ajax({url:r.ajax_url,type:s.attr("method"),data:p,dataType:"json",cache:!1,contentType:!1,processData:!1,xhr:function(){var e=new window.XMLHttpRequest;return e.upload.addEventListener("progress",function(e){if(e.lengthComputable){var a=e.loaded/e.total,d=parseInt(100*a);i.setProgressBar(l,d)}},!1),e},complete:function(){i.setProgressBar(l,100)},success:function(a){a.success?e.isFunction(r.on_success)&&r.on_success.call(this,d,l,a):(e(".dnd-progress-bar",e("#"+l)).remove(),e(".dnd-upload-details",e("#"+l)).append(''+a.data+""),e('input[type="submit"]',s).removeClass("disabled").prop("disabled",!1))},error:function(a,d,o){e(".dnd-progress-bar",e("#"+l)).remove(),e(".dnd-upload-details",e("#"+l)).append(''+r.server_max_error+""),e('input[type="submit"]',s).removeClass("disabled").prop("disabled",!1)}})}})}},i={createProgressBar:function(a){var d=e(".codedropz-upload-handler",n),r="dnd-file-"+Math.random().toString(36).substr(2,9),t='
    '+a.name+"("+i.bytesToSize(a.size)+')
    ';return d.after('
    '+t+"
    "),r},setProgressBar:function(a,d){var r=e(".dnd-progress-bar",e("#"+a));return r.length>0&&(i.disableBtn(p),progress_width=d*r.width()/100,e("span",r).addClass("in-progress").animate({width:progress_width},10).text(d+"% "),100==d&&e("span",r).addClass("complete").removeClass("in-progress")),!1},bytesToSize:function(e){return 0===e?"0":(kBytes=e/1024,fileSize=kBytes>=1024?(kBytes/1024).toFixed(2)+"MB":kBytes.toFixed(2)+"KB",fileSize)},disableBtn:function(e){e.length>0&&e.addClass("disable").prop("disabled",!0)}}}),e(document).on("click",".dnd-icon-remove",function(d){var r=e(this),o=r.parents(".dnd-upload-status"),t=r.parents(".codedropz-upload-wrapper"),s=r.parent("a").attr("data-storage");return!(e("span.in-progress",o).length>0)&&(e(".has-error",o).length>0?(o.remove(),localStorage.setItem(s,Number(localStorage.getItem(s))-1),!1):(r.addClass("deleting").text(dnd_cf7_uploader.drag_n_drop_upload.delete.text+"..."),void e.post(a.ajax_url,{path:o.find('input[type="hidden"]').val(),action:"dnd_codedropz_upload_delete",security:dnd_cf7_uploader.ajax_nonce},function(a){a.success&&(o.remove(),localStorage.setItem(s,Number(localStorage.getItem(s))-1),e(".dnd-upload-status",t).length<=1&&e("span.has-error-msg",t).remove())})))})}}(jQuery); jQuery(document).ready(function($){ document.addEventListener('wpcf7mailsent', function(event){ var inputFile=$('.wpcf7-drag-n-drop-file'); if(inputFile.length > 0){ $.each(inputFile, function(){ localStorage.setItem($(this).attr('data-name') + '_count_files', 1); }); }else{ localStorage.setItem(inputFile.attr('data-name') + '_count_files', 1); } $('.dnd-upload-status', inputFile.parents('form')).remove(); $('span.has-error-msg').remove(); }, false); window.initDragDrop=function (){ var TextOJB=dnd_cf7_uploader.drag_n_drop_upload; $('.wpcf7-drag-n-drop-file').CodeDropz_Uploader({ 'color':'#fff', 'ajax_url':dnd_cf7_uploader.ajax_url, 'text':TextOJB.text, 'separator':TextOJB.or_separator, 'button_text':TextOJB.browse, 'server_max_error':TextOJB.server_max_error, 'on_success':function(input, progressBar, response){ var progressDetails=$('#' + progressBar, input.parents('.codedropz-upload-wrapper')); if($('.in-progress', input.parents('form')).length===0){ setTimeout(function(){ $('input[type="submit"]', input.parents('form')).removeAttr('disabled'); }, 1); } progressDetails .find('.dnd-upload-details') .append(''); }}); } window.initDragDrop(); }); (function (factory){ if(typeof define==='function'&&define.amd){ define(['jquery'], factory); }else if(typeof exports==='object'){ module.exports=factory(require('jquery')); }else{ factory(jQuery); }}(function ($){ var pluses=/\+/g; function encode(s){ return config.raw ? s:encodeURIComponent(s); } function decode(s){ return config.raw ? s:decodeURIComponent(s); } function stringifyCookieValue(value){ return encode(config.json ? JSON.stringify(value):String(value)); } function parseCookieValue(s){ if(s.indexOf('"')===0){ s=s.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, '\\'); } try { s=decodeURIComponent(s.replace(pluses, ' ')); return config.json ? JSON.parse(s):s; } catch(e){}} function read(s, converter){ var value=config.raw ? s:parseCookieValue(s); return $.isFunction(converter) ? converter(value):value; } var config=$.cookie=function (key, value, options){ if(arguments.length > 1&&!$.isFunction(value)){ options=$.extend({}, config.defaults, options); if(typeof options.expires==='number'){ var days=options.expires, t=options.expires=new Date(); t.setMilliseconds(t.getMilliseconds() + days * 864e+5); } return (document.cookie=[ encode(key), '=', stringifyCookieValue(value), options.expires ? '; expires=' + options.expires.toUTCString():'', options.path ? '; path=' + options.path:'', options.domain ? '; domain=' + options.domain:'', options.secure ? '; secure':'' ].join('')); } var result=key ? undefined:{}, cookies=document.cookie ? document.cookie.split('; '):[], i=0, l=cookies.length; for (; i < l; i++){ var parts=cookies[i].split('='), name=decode(parts.shift()), cookie=parts.join('='); if(key===name){ result=read(cookie, value); break; } if(!key&&(cookie=read(cookie))!==undefined){ result[name]=cookie; }} return result; }; config.defaults={}; $.removeCookie=function (key, options){ $.cookie(key, '', $.extend({}, options, { expires: -1 })); return !$.cookie(key); };})); ;(function($, window, document, undefined){ var drag, state, e; drag={ start: 0, startX: 0, startY: 0, current: 0, currentX: 0, currentY: 0, offsetX: 0, offsetY: 0, distance: null, startTime: 0, endTime: 0, updatedX: 0, targetEl: null }; state={ isTouch: false, isScrolling: false, isSwiping: false, direction: false, inMotion: false }; e={ _onDragStart: null, _onDragMove: null, _onDragEnd: null, _transitionEnd: null, _resizer: null, _responsiveCall: null, _goToLoop: null, _checkVisibile: null }; function Owl(element, options){ this.settings=null; this.options=$.extend({}, Owl.Defaults, options); this.$element=$(element); this.drag=$.extend({}, drag); this.state=$.extend({}, state); this.e=$.extend({}, e); this._plugins={}; this._supress={}; this._current=null; this._speed=null; this._coordinates=[]; this._breakpoint=null; this._width=null; this._items=[]; this._clones=[]; this._mergers=[]; this._invalidated={}; this._pipe=[]; $.each(Owl.Plugins, $.proxy(function(key, plugin){ this._plugins[key[0].toLowerCase() + key.slice(1)] = new plugin(this); }, this)); $.each(Owl.Pipe, $.proxy(function(priority, worker){ this._pipe.push({ 'filter': worker.filter, 'run': $.proxy(worker.run, this) }); }, this)); this.setup(); this.initialize(); } Owl.Defaults={ items: 3, loop: false, center: false, mouseDrag: true, touchDrag: true, pullDrag: true, freeDrag: false, margin: 0, stagePadding: 0, merge: false, mergeFit: true, autoWidth: false, startPosition: 0, rtl: false, smartSpeed: 250, fluidSpeed: false, dragEndSpeed: false, responsive: {}, responsiveRefreshRate: 200, responsiveBaseElement: window, responsiveClass: false, fallbackEasing: 'swing', info: false, nestedItemSelector: false, itemElement: 'div', stageElement: 'div', themeClass: 'owl-theme', baseClass: 'owl-carousel', itemClass: 'owl-item', centerClass: 'center', activeClass: 'active' }; Owl.Width={ Default: 'default', Inner: 'inner', Outer: 'outer' }; Owl.Plugins={}; Owl.Pipe=[ { filter: [ 'width', 'items', 'settings' ], run: function(cache){ cache.current=this._items&&this._items[this.relative(this._current)]; }}, { filter: [ 'items', 'settings' ], run: function(){ var cached=this._clones, clones=this.$stage.children('.cloned'); if(clones.length!==cached.length||(!this.settings.loop&&cached.length > 0)){ this.$stage.children('.cloned').remove(); this._clones=[]; }} }, { filter: [ 'items', 'settings' ], run: function(){ var i, n, clones=this._clones, items=this._items, delta=this.settings.loop ? clones.length - Math.max(this.settings.items * 2, 4):0; for (i=0, n=Math.abs(delta / 2); i < n; i++){ if(delta > 0){ this.$stage.children().eq(items.length + clones.length - 1).remove(); clones.pop(); this.$stage.children().eq(0).remove(); clones.pop(); }else{ clones.push(clones.length / 2); this.$stage.append(items[clones[clones.length - 1]].clone().addClass('cloned')); clones.push(items.length - 1 - (clones.length - 1) / 2); this.$stage.prepend(items[clones[clones.length - 1]].clone().addClass('cloned')); }} }}, { filter: [ 'width', 'items', 'settings' ], run: function(){ var rtl=(this.settings.rtl ? 1:-1), width=(this.width() / this.settings.items).toFixed(3), coordinate=0, merge, i, n; this._coordinates=[]; for (i=0, n=this._clones.length + this._items.length; i < n; i++){ merge=this._mergers[this.relative(i)]; merge=(this.settings.mergeFit&&Math.min(merge, this.settings.items))||merge; coordinate +=(this.settings.autoWidth ? this._items[this.relative(i)].width() + this.settings.margin:width * merge) * rtl; this._coordinates.push(coordinate); }} }, { filter: [ 'width', 'items', 'settings' ], run: function(){ var i, n, width=(this.width() / this.settings.items).toFixed(3), css={ 'width': Math.abs(this._coordinates[this._coordinates.length - 1]) + this.settings.stagePadding * 2, 'padding-left': this.settings.stagePadding||'', 'padding-right': this.settings.stagePadding||'' }; this.$stage.css(css); css={ 'width': this.settings.autoWidth ? 'auto':width - this.settings.margin }; css[this.settings.rtl ? 'margin-left':'margin-right']=this.settings.margin; if(!this.settings.autoWidth&&$.grep(this._mergers, function(v){ return v > 1 }).length > 0){ for (i=0, n=this._coordinates.length; i < n; i++){ css.width=Math.abs(this._coordinates[i]) - Math.abs(this._coordinates[i - 1]||0) - this.settings.margin; this.$stage.children().eq(i).css(css); }}else{ this.$stage.children().css(css); }} }, { filter: [ 'width', 'items', 'settings' ], run: function(cache){ cache.current&&this.reset(this.$stage.children().index(cache.current)); }}, { filter: [ 'position' ], run: function(){ this.animate(this.coordinates(this._current)); }}, { filter: [ 'width', 'position', 'items', 'settings' ], run: function(){ var rtl=this.settings.rtl ? 1:-1, padding=this.settings.stagePadding * 2, begin=this.coordinates(this.current()) + padding, end=begin + this.width() * rtl, inner, outer, matches=[], i, n; for (i=0, n=this._coordinates.length; i < n; i++){ inner=this._coordinates[i - 1]||0; outer=Math.abs(this._coordinates[i]) + padding * rtl; if((this.op(inner, '<=', begin)&&(this.op(inner, '>', end))) || (this.op(outer, '<', begin)&&this.op(outer, '>', end))){ matches.push(i); }} this.$stage.children('.' + this.settings.activeClass).removeClass(this.settings.activeClass); this.$stage.children(':eq(' + matches.join('), :eq(') + ')').addClass(this.settings.activeClass); if(this.settings.center){ this.$stage.children('.' + this.settings.centerClass).removeClass(this.settings.centerClass); this.$stage.children().eq(this.current()).addClass(this.settings.centerClass); }} } ]; Owl.prototype.initialize=function(){ this.trigger('initialize'); this.$element .addClass(this.settings.baseClass) .addClass(this.settings.themeClass) .toggleClass('owl-rtl', this.settings.rtl); this.browserSupport(); if(this.settings.autoWidth&&this.state.imagesLoaded!==true){ var imgs, nestedSelector, width; imgs=this.$element.find('img'); nestedSelector=this.settings.nestedItemSelector ? '.' + this.settings.nestedItemSelector:undefined; width=this.$element.children(nestedSelector).width(); if(imgs.length&&width <=0){ this.preloadAutoWidthImages(imgs); return false; }} this.$element.addClass('owl-loading'); this.$stage=$('<' + this.settings.stageElement + ' class="owl-stage"/>') .wrap('
    '); 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=''; }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='
    '+c+'
    '+d+f+"
    ",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;eh){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('