1/** 2 * Owl Carousel v2.2.1 3 * Copyright 2013-2017 David Deutsch 4 * Licensed under () 5 */�
vendor: 32,001 bytes, lines 5-6
5 6!function(a,b,c,d){function e(b,c){this.settings=null,this.options=a.extend({},e.Defaults,c),this.$element=a(b),this._handlers={},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._widths=[],this._invalidated={},this._pipe=[],this._drag={time:null,target:null,pointer:null,stage:{start:null,current:null},direction:null},this._states={current:{},tags:{initializing:["busy"],animating:["busy"],dragging:["interacting"]}},a.each(["onResize","onThrottledResize"],a.proxy(function(b,c){this._handlers[c]=a.proxy(this[c],this)},this)),a.each(e.Plugins,a.proxy(function(a,b){this._plugins[a.charAt(0).toLowerCase()+a.slice(1)]=new b(this)},this)),a.each(e.Workers,a.proxy(function(b,c){this._pipe.push({filter:c.filter,run:a.proxy(c.run,this)})},this)),this.setup(),this.initialize()}e.Defaults={items:3,loop:!1,center:!1,rewind:!1,mouseDrag:!0,touchDrag:!0,pullDrag:!0,freeDrag:!1,margin:0,stagePadding:0,merge:!1,mergeFit:!0,autoWidth:!1,startPosition:0,rtl:!1,smartSpeed:250,fluidSpeed:!1,dragEndSpeed:!1,responsive:{},responsiveRefreshRate:200,responsiveBaseElement:b,fallbackEasing:"swing",info:!1,nestedItemSelector:!1,itemElement:"div",stageElement:"div",refreshClass:"owl-refresh",loadedClass:"owl-loaded",loadingClass:"owl-loading",rtlClass:"owl-rtl",responsiveClass:"owl-responsive",dragClass:"owl-drag",itemClass:"owl-item",stageClass:"owl-stage",stageOuterClass:"owl-stage-outer",grabClass:"owl-grab"},e.Width={Default:"default",Inner:"inner",Outer:"outer"},e.Type={Event:"event",State:"state"},e.Plugins={},e.Workers=[{filter:["width","settings"],run:function(){this._width=this.$element.width()}},{filter:["width","items","settings"],run:function(a){a.current=this._items&&this._items[this.relative(this._current)]}},{filter:["items","settings"],run:function(){this.$stage.children(".cloned").remove()}},{filter:["width","items","settings"],run:function(a){var b=this.settings.margin||"",c=!this.settings.autoWidth,d=this.settings.rtl,e={width:"auto","margin-left":d?b:"","margin-right":d?"":b};!c&&this.$stage.children().css(e),a.css=e}},{filter:["width","items","settings"],run:function(a){var b=(this.width()/this.settings.items).toFixed(3)-this.settings.margin,c=null,d=this._items.length,e=!this.settings.autoWidth,f=[];for(a.items={merge:!1,width:b};d--;)c=this._mergers[d],c=this.settings.mergeFit&&Math.min(c,this.settings.items)||c,a.items.merge=c>1||a.items.merge,f[d]=e?b*c:this._items[d].width();this._widths=f}},{filter:["items","settings"],run:function(){var b=[],c=this._items,d=this.settings,e=Math.max(2*d.items,4),f=2*Math.ceil(c.length/2),g=d.loop&&c.length?d.rewind?e:Math.max(e,f):0,h="",i="";for(g/=2;g--;)b.push(this.normalize(b.length/2,!0)),h+=c[b[b.length-1]][0].outerHTML,b.push(this.normalize(c.length-1-(b.length-1)/2,!0)),i=c[b[b.length-1]][0].outerHTML+i;this._clones=b,a(h).addClass("cloned").appendTo(this.$stage),a(i).addClass("cloned").prependTo(this.$stage)}},{filter:["width","items","settings"],run:function(){for(var a=this.settings.rtl?1:-1,b=this._clones.length+this._items.length,c=-1,d=0,e=0,f=[];++c<b;)d=f[c-1]||0,e=this._widths[this.relative(c)]+this.settings.margin,f.push(d+e*a);this._coordinates=f}},{filter:["width","items","settings"],run:function(){var a=this.settings.stagePadding,b=this._coordinates,c={width:Math.ceil(Math.abs(b[b.length-1]))+2*a,"padding-left":a||"","padding-right":a||""};this.$stage.css(c)}},{filter:["width","items","settings"],run:function(a){var b=this._coordinates.length,c=!this.settings.autoWidth,d=this.$stage.children();if(c&&a.items.merge)for(;b--;)a.css.width=this._widths[this.relative(b)],d.eq(b).css(a.css);else c&&(a.css.width=a.items.width,d.css(a.css))}},{filter:["items"],run:function(){this._coordinates.length<1&&this.$stage.removeAttr("style")}},{filter:["width","items","settings"],run:function(a){a.current=a.current?this.$stage.children().index(a.current):0,a.current=Math.max(this.minimum(),Math.min(this.maximum(),a.current)),this.reset(a.current)}},{filter:["position"],run:function(){this.animate(this.coordinates(this._current))}},{filter:["width","position","items","settings"],run:function(){var a,b,c,d,e=this.settings.rtl?1:-1,f=2*this.settings.stagePadding,g=this.coordinates(this.current())+f,h=g+this.width()*e,i=[];for(c=0,d=this._coordinates.length;c<d;c++)a=this._coordinates[c-1]||0,b=Math.abs(this._coordinates[c])+f*e,(this.op(a,"<=",g)&&this.op(a,">",h)||this.op(b,"<",g)&&this.op(b,">",h))&&i.push(c);this.$stage.children(".active").removeClass("active"),this.$stage.children(":eq("+i.join("), :eq(")+")").addClass("active"),this.settings.center&&(this.$stage.children(".center").removeClass("center"),this.$stage.children().eq(this.current()).addClass("center"))}}],e.prototype.initialize=function(){if(this.enter("initializing"),this.trigger("initialize"),this.$element.toggleClass(this.settings.rtlClass,this.settings.rtl),this.settings.autoWidth&&!this.is("pre-loading")){var b,c,e;b=this.$element.find("img"),c=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,e=this.$element.children(c).width(),b.length&&e<=0&&this.preloadAutoWidthImages(b)}this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+' class="'+this.settings.stageClass+'"/>').wrap('<div class="'+this.settings.stageOuterClass+'"/>'),this.$element.append(this.$stage.parent()),this.replace(this.$element.children().not(this.$stage.parent())),this.$element.is(":visible")?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.setup=function(){var b=this.viewport(),c=this.options.responsive,d=-1,e=null;c?(a.each(c,function(a){a<=b&&a>d&&(d=Number(a))}),e=a.extend({},this.options,c[d]),"function"==typeof e.stagePadding&&(e.stagePadding=e.stagePadding()),delete e.responsive,e.responsiveClass&&this.$element.attr("class",this.$element.attr("class").replace(new RegExp("("+this.options.responsiveClass+"-)\\S+\\s","g"),"$1"+d))):e=a.extend({},this.options),this.trigger("change",{property:{name:"settings",value:e}}),this._breakpoint=d,this.settings=e,this.invalidate("settings"),this.trigger("changed",{property:{name:"settings",value:this.settings}})},e.prototype.optionsLogic=function(){this.settings.autoWidth&&(this.settings.stagePadding=!1,this.settings.merge=!1)},e.prototype.prepare=function(b){var c=this.trigger("prepare",{content:b});return c.data||(c.data=a("<"+this.settings.itemElement+"/>").addClass(this.options.itemClass).append(b)),this.trigger("prepared",{content:c.data}),c.data},e.prototype.update=function(){for(var b=0,c=this._pipe.length,d=a.proxy(function(a){return this[a]},this._invalidated),e={};b<c;)(this._invalidated.all||a.grep(this._pipe[b].filter,d).length>0)&&this._pipe[b].run(e),b++;this._invalidated={},!this.is("valid")&&this.enter("valid")},e.prototype.width=function(a){switch(a=a||e.Width.Default){case e.Width.Inner:case e.Width.Outer:return this._width;default:return this._width-2*this.settings.stagePadding+this.settings.margin}},e.prototype.refresh=function(){this.enter("refreshing"),this.trigger("refresh"),this.setup(),this.optionsLogic(),this.$element.addClass(this.options.refreshClass),this.update(),this.$element.removeClass(this.options.refreshClass),this.leave("refreshing"),this.trigger("refreshed")},e.prototype.onThrottledResize=function(){b.clearTimeout(this.resizeTimer),this.resizeTimer=b.setTimeout(this._handlers.onResize,this.settings.responsiveRefreshRate)},e.prototype.onResize=function(){return!!this._items.length&&(this._width!==this.$element.width()&&(!!this.$element.is(":visible")&&(this.enter("resizing"),this.trigger("resize").isDefaultPrevented()?(this.leave("resizing"),!1):(this.invalidate("width"),this.refresh(),this.leave("resizing"),void this.trigger("resized")))))},e.prototype.registerEventHandlers=function(){a.support.transition&&this.$stage.on(a.support.transition.end+".owl.core",a.proxy(this.onTransitionEnd,this)),this.settings.responsive!==!1&&this.on(b,"resize",this._handlers.onThrottledResize),this.settings.mouseDrag&&(this.$element.addClass(this.options.dragClass),this.$stage.on("mousedown.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("dragstart.owl.core selectstart.owl.core",function(){return!1})),this.settings.touchDrag&&(this.$stage.on("touchstart.owl.core",a.proxy(this.onDragStart,this)),this.$stage.on("touchcancel.owl.core",a.proxy(this.onDragEnd,this)))},e.prototype.onDragStart=function(b){var d=null;3!==b.which&&(a.support.transform?(d=this.$stage.css("transform").replace(/.*\(|\)| /g,"").split(","),d={x:d[16===d.length?12:4],y:d[16===d.length?13:5]}):(d=this.$stage.position(),d={x:this.settings.rtl?d.left+this.$stage.width()-this.width()+this.settings.margin:d.left,y:d.top}),this.is("animating")&&(a.support.transform?this.animate(d.x):this.$stage.stop(),this.invalidate("position")),this.$element.toggleClass(this.options.grabClass,"mousedown"===b.type),this.speed(0),this._drag.time=(new Date).getTime(),this._drag.target=a(b.target),this._drag.stage.start=d,this._drag.stage.current=d,this._drag.pointer=this.pointer(b),a(c).on("mouseup.owl.core touchend.owl.core",a.proxy(this.onDragEnd,this)),a(c).one("mousemove.owl.core touchmove.owl.core",a.proxy(function(b){var d=this.difference(this._drag.pointer,this.pointer(b));a(c).on("mousemove.owl.core touchmove.owl.core",a.proxy(this.onDragMove,this)),Math.abs(d.x)<Math.abs(d.y)&&this.is("valid")||(b.preventDefault(),this.enter("dragging"),this.trigger("drag"))},this)))},e.prototype.onDragMove=function(a){var b=null,c=null,d=null,e=this.difference(this._drag.pointer,this.pointer(a)),f=this.difference(this._drag.stage.start,e);this.is("dragging")&&(a.preventDefault(),this.settings.loop?(b=this.coordinates(this.minimum()),c=this.coordinates(this.maximum()+1)-b,f.x=((f.x-b)%c+c)%c+b):(b=this.settings.rtl?this.coordinates(this.maximum()):this.coordinates(this.minimum()),c=this.settings.rtl?this.coordinates(this.minimum()):this.coordinates(this.maximum()),d=this.settings.pullDrag?-1*e.x/5:0,f.x=Math.max(Math.min(f.x,b+d),c+d)),this._drag.stage.current=f,this.animate(f.x))},e.prototype.onDragEnd=function(b){var d=this.difference(this._drag.pointer,this.pointer(b)),e=this._drag.stage.current,f=d.x>0^this.settings.rtl?"left":"right";a(c).off(".owl.core"),this.$element.removeClass(this.options.grabClass),(0!==d.x&&this.is("dragging")||!this.is("valid"))&&(this.speed(this.settings.dragEndSpeed||this.settings.smartSpeed),this.current(this.closest(e.x,0!==d.x?f:this._drag.direction)),this.invalidate("position"),this.update(),this._drag.direction=f,(Math.abs(d.x)>3||(new Date).getTime()-this._drag.time>300)&&this._drag.target.one("click.owl.core",function(){return!1})),this.is("dragging")&&(this.leave("dragging"),this.trigger("dragged"))},e.prototype.closest=function(b,c){var d=-1,e=30,f=this.width(),g=this.coordinates();return this.settings.freeDrag||a.each(g,a.proxy(function(a,h){return"left"===c&&b>h-e&&b<h+e?d=a:"right"===c&&b>h-f-e&&b<h-f+e?d=a+1:this.op(b,"<",h)&&this.op(b,">",g[a+1]||h-f)&&(d="left"===c?a+1:a),d===-1},this)),this.settings.loop||(this.op(b,">",g[this.minimum()])?d=b=this.minimum():this.op(b,"<",g[this.maximum()])&&(d=b=this.maximum())),d},e.prototype.animate=function(b){var c=this.speed()>0;this.is("animating")&&this.onTransitionEnd(),c&&(this.enter("animating"),this.trigger("translate")),a.support.transform3d&&a.support.transition?this.$stage.css({transform:"translate3d("+b+"px,0px,0px)",transition:this.speed()/1e3+"s"}):c?this.$stage.animate({left:b+"px"},this.speed(),this.settings.fallbackEasing,a.proxy(this.onTransitionEnd,this)):this.$stage.css({left:b+"px"})},e.prototype.is=function(a){return this._states.current[a]&&this._states.current[a]>0},e.prototype.current=function(a){if(a===d)return this._current;if(0===this._items.length)return d;if(a=this.normalize(a),this._current!==a){var b=this.trigger("change",{property:{name:"position",value:a}});b.data!==d&&(a=this.normalize(b.data)),this._current=a,this.invalidate("position"),this.trigger("changed",{property:{name:"position",value:this._current}})}return this._current},e.prototype.invalidate=function(b){return"string"===a.type(b)&&(this._invalidated[b]=!0,this.is("valid")&&this.leave("valid")),a.map(this._invalidated,function(a,b){return b})},e.prototype.reset=function(a){a=this.normalize(a),a!==d&&(this._speed=0,this._current=a,this.suppress(["translate","translated"]),this.animate(this.coordinates(a)),this.release(["translate","translated"]))},e.prototype.normalize=function(a,b){var c=this._items.length,e=b?0:this._clones.length;return!this.isNumeric(a)||c<1?a=d:(a<0||a>=c+e)&&(a=((a-e/2)%c+c)%c+e/2),a},e.prototype.relative=function(a){return a-=this._clones.length/2,this.normalize(a,!0)},e.prototype.maximum=function(a){var b,c,d,e=this.settings,f=this._coordinates.length;if(e.loop)f=this._clones.length/2+this._items.length-1;else if(e.autoWidth||e.merge){for(b=this._items.length,c=this._items[--b].width(),d=this.$element.width();b--&&(c+=this._items[b].width()+this.settings.margin,!(c>d)););f=b+1}else f=e.center?this._items.length-1:this._items.length-e.items;return a&&(f-=this._clones.length/2),Math.max(f,0)},e.prototype.minimum=function(a){return a?0:this._clones.length/2},e.prototype.items=function(a){return a===d?this._items.slice():(a=this.normalize(a,!0),this._items[a])},e.prototype.mergers=function(a){return a===d?this._mergers.slice():(a=this.normalize(a,!0),this._mergers[a])},e.prototype.clones=function(b){var c=this._clones.length/2,e=c+this._items.length,f=function(a){return a%2===0?e+a/2:c-(a+1)/2};return b===d?a.map(this._clones,function(a,b){return f(b)}):a.map(this._clones,function(a,c){return a===b?f(c):null})},e.prototype.speed=function(a){return a!==d&&(this._speed=a),this._speed},e.prototype.coordinates=function(b){var c,e=1,f=b-1;return b===d?a.map(this._coordinates,a.proxy(function(a,b){return this.coordinates(b)},this)):(this.settings.center?(this.settings.rtl&&(e=-1,f=b+1),c=this._coordinates[b],c+=(this.width()-c+(this._coordinates[f]||0))/2*e):c=this._coordinates[f]||0,c=Math.ceil(c))},e.prototype.duration=function(a,b,c){return 0===c?0:Math.min(Math.max(Math.abs(b-a),1),6)*Math.abs(c||this.settings.smartSpeed)},e.prototype.to=function(a,b){var c=this.current(),d=null,e=a-this.relative(c),f=(e>0)-(e<0),g=this._items.length,h=this.minimum(),i=this.maximum();this.settings.loop?(!this.settings.rewind&&Math.abs(e)>g/2&&(e+=f*-1*g),a=c+e,d=((a-h)%g+g)%g+h,d!==a&&d-e<=i&&d-e>0&&(c=d-e,a=d,this.reset(c))):this.settings.rewind?(i+=1,a=(a%i+i)%i):a=Math.max(h,Math.min(i,a)),this.speed(this.duration(c,a,b)),this.current(a),this.$element.is(":visible")&&this.update()},e.prototype.next=function(a){a=a||!1,this.to(this.relative(this.current())+1,a)},e.prototype.prev=function(a){a=a||!1,this.to(this.relative(this.current())-1,a)},e.prototype.onTransitionEnd=function(a){if(a!==d&&(a.stopPropagation(),(a.target||a.srcElement||a.originalTarget)!==this.$stage.get(0)))return!1;this.leave("animating"),this.trigger("translated")},e.prototype.viewport=function(){var d;return this.options.responsiveBaseElement!==b?d=a(this.options.responsiveBaseElement).width():b.innerWidth?d=b.innerWidth:c.documentElement&&c.documentElement.clientWidth?d=c.documentElement.clientWidth:console.warn("Can not detect viewport width."),d},e.prototype.replace=function(b){this.$stage.empty(),this._items=[],b&&(b=b instanceof jQuery?b:a(b)),this.settings.nestedItemSelector&&(b=b.find("."+this.settings.nestedItemSelector)),b.filter(function(){return 1===this.nodeType}).each(a.proxy(function(a,b){b=this.prepare(b),this.$stage.append(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)},this)),this.reset(this.isNumeric(this.settings.startPosition)?this.settings.startPosition:0),this.invalidate("items")},e.prototype.add=function(b,c){var e=this.relative(this._current);c=c===d?this._items.length:this.normalize(c,!0),b=b instanceof jQuery?b:a(b),this.trigger("add",{content:b,position:c}),b=this.prepare(b),0===this._items.length||c===this._items.length?(0===this._items.length&&this.$stage.append(b),0!==this._items.length&&this._items[c-1].after(b),this._items.push(b),this._mergers.push(1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)):(this._items[c].before(b),this._items.splice(c,0,b),this._mergers.splice(c,0,1*b.find("[data-merge]").addBack("[data-merge]").attr("data-merge")||1)),this._items[e]&&this.reset(this._items[e].index()),this.invalidate("items"),this.trigger("added",{content:b,position:c})},e.prototype.remove=function(a){a=this.normalize(a,!0),a!==d&&(this.trigger("remove",{content:this._items[a],position:a}),this._items[a].remove(),this._items.splice(a,1),this._mergers.splice(a,1),this.invalidate("items"),this.trigger("removed",{content:null,position:a}))},e.prototype.preloadAutoWidthImages=function(b){b.each(a.proxy(function(b,c){this.enter("pre-loading"),c=a(c),a(new Image).one("load",a.proxy(function(a){c.attr("src",a.target.src),c.css("opacity",1),this.leave("pre-loading"),!this.is("pre-loading")&&!this.is("initializing")&&this.refresh()},this)).attr("src",c.attr("src")||c.attr("data-src")||c.attr("data-src-retina"))},this))},e.prototype.destroy=function(){this.$element.off(".owl.core"),this.$stage.off(".owl.core"),a(c).off(".owl.core"),this.settings.responsive!==!1&&(b.clearTimeout(this.resizeTimer),this.off(b,"resize",this._handlers.onThrottledResize));for(var d in this._plugins)this._plugins[d].destroy();this.$stage.children(".cloned").remove(),this.$stage.unwrap(),this.$stage.children().contents().unwrap(),this.$stage.children().unwrap(),this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class",this.$element.attr("class").replace(new RegExp(this.options.responsiveClass+"-\\S+\\s","g"),"")).removeData("owl.carousel")},e.prototype.op=function(a,b,c){var d=this.settings.rtl;switch(b){case"<":return d?a>c:a<c;case">":return d?a<c:a>c;case">=":return d?a<=c:a>=c;case"<=":return d?a>=c:a<=c}},e.prototype.on=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d):a.attachEvent&&a.attachEvent("on"+b,c)},e.prototype.off=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d):a.detachEvent&&a.detachEvent("on"+b,c)},e.prototype.trigger=function(b,c,d,f,g){var h={item:{count:this._items.length,index:this.current()}},i=a.camelCase(a.grep(["on",b,d],function(a){return a}).join("-").toLowerCase()),j=a.Event([b,"owl",d||"carousel"].join(".").toLowerCase(),a.extend({relatedTarget:this},h,c));return this._supress[b]||(a.each(this._plugins,function(a,b){b.onTrigger&&b.onTrigger(j)}),this.register({type:e.Type.Event,name:b}),this.$element.trigger(j),this.settings&&"function"==typeof this.settings[i]&&this.settings[i].call(this,j)),j},e.prototype.enter=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]===d&&(this._states.current[b]=0),this._states.current[b]++},this))},e.prototype.leave=function(b){a.each([b].concat(this._states.tags[b]||[]),a.proxy(function(a,b){this._states.current[b]--},this))},e.prototype.register=function(b){if(b.type===e.Type.Event){if(a.event.special[b.name]||(a.event.special[b.name]={}),!a.event.special[b.name].owl){var c=a.event.special[b.name]._default;a.event.special[b.name]._default=function(a){return!c||!c.apply||a.namespace&&a.namespace.indexOf("owl")!==-1?a.namespace&&a.namespace.indexOf("owl")>-1:c.apply(this,arguments)},a.event.special[b.name].owl=!0}}else b.type===e.Type.State&&(this._states.tags[b.name]?this._states.tags[b.name]=this._states.tags[b.name].concat(b.tags):this._states.tags[b.name]=b.tags,this._states.tags[b.name]=a.grep(this._states.tags[b.name],a.proxy(function(c,d){return a.inArray(c,this._states.tags[b.name])===d},this)))},e.prototype.suppress=function(b){a.each(b,a.proxy(function(a,b){this._supress[b]=!0},this))},e.prototype.release=function(b){a.each(b,a.proxy(function(a,b){delete this._supress[b]},this))},e.prototype.pointer=function(a){var c={x:null,y:null};return a=a.originalEvent||a||b.event,a=a.touches&&a.touches.length?a.touches[0]:a.changedTouches&&a.changedTouches.length?a.changedTouches[0]:a,a.pageX?(c.x=a.pageX,c.y=a.pageY):(c.x=a.clientX,c.y=a.clientY),c},e.prototype.isNumeric=function(a){return!isNaN(parseFloat(a))},e.prototype.difference=function(a,b){return{x:a.x-b.x,y:a.y-b.y}},a.fn.owlCarousel=function(b){var c=Array.prototype.slice.call(arguments,1);return this.each(function(){var d=a(this),f=d.data("owl.carousel");f||(f=new e(this,"object"==typeof b&&b),d.data("owl.carousel",f),a.each(["next","prev","to","destroy","refresh","replace","add","remove"],function(b,c){f.register({type:e.Type.Event,name:c}),f.$element.on(c+".owl.carousel.core",a.proxy(function(a){a.namespace&&a.relatedTarget!==this&&(this.suppress([c]),f[c].apply(this,[].slice.call(arguments,1)),this.release([c]))},f))})),"string"==typeof b&&"_"!==b.charAt(0)&&f[b].apply(f,c)})},a.fn.owlCarousel.Constructor=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._interval=null,this._visible=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoRefresh&&this.watch()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoRefresh:!0,autoRefreshInterval:500},e.prototype.watch=function(){this._interval||(this._visible=this._core.$element.is(":visible"),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.$element.is(":visible")!==this._visible&&(this._visible=!this._visible,this._core.$element.toggleClass("owl-hidden",!this._visible),this._visible&&this._core.invalidate("width")&&this._core.refresh())},e.prototype.destroy=function(){var a,c;b.clearInterval(this._interval);for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoRefresh=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._loaded=[],this._handlers={"initialized.owl.carousel change.owl.carousel resized.owl.carousel":a.proxy(function(b){if(b.namespace&&this._core.settings&&this._core.settings.lazyLoad&&(b.property&&"position"==b.property.name||"initialized"==b.type))for(var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&e*-1||0,g=(b.property&&b.property.value!==d?b.property.value:this._core.current())+f,h=this._core.clones().length,i=a.proxy(function(a,b){this.load(b)},this);f++<e;)this.load(h/2+this._core.relative(g)),h&&a.each(this._core.clones(this._core.relative(g)),i),g++},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={lazyLoad:!1},e.prototype.load=function(c){var d=this._core.$stage.children().eq(c),e=d&&d.find(".owl-lazy");!e||a.inArray(d.get(0),this._loaded)>-1||(e.each(a.proxy(function(c,d){var e,f=a(d),g=b.devicePixelRatio>1&&f.attr("data-src-retina")||f.attr("data-src");this._core.trigger("load",{element:f,url:g},"lazy"),f.is("img")?f.one("load.owl.lazy",a.proxy(function(){f.css("opacity",1),this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("src",g):(e=new Image,e.onload=a.proxy(function(){f.css({"background-image":'url("'+g+'")',opacity:"1"}),this._core.trigger("loaded",{element:f,url:g},"lazy")},this),e.src=g)},this)),this._loaded.push(d.get(0)))},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this._core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Lazy=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._handlers={"initialized.owl.carousel refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&this.update()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&"position"==a.property.name&&this.update()},this),"loaded.owl.lazy":a.proxy(function(a){a.namespace&&this._core.settings.autoHeight&&a.element.closest("."+this._core.settings.itemClass).index()===this._core.current()&&this.update()},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers)};e.Defaults={autoHeight:!1,autoHeightClass:"owl-height"},e.prototype.update=function(){var b=this._core._current,c=b+this._core.settings.items,d=this._core.$stage.children().toArray().slice(b,c),e=[],f=0;a.each(d,function(b,c){e.push(a(c).height())}),f=Math.max.apply(null,e),this._core.$stage.parent().height(f).addClass(this._core.settings.autoHeightClass)},e.prototype.destroy=function(){var a,b;for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.AutoHeight=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._videos={},this._playing=null,this._handlers={"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.register({type:"state",name:"playing",tags:["interacting"]})},this),"resize.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.video&&this.isInFullScreen()&&a.preventDefault()},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._core.is("resizing")&&this._core.$stage.find(".cloned .owl-video-frame").remove()},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"===a.property.name&&this._playing&&this.stop()},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find(".owl-video");c.length&&(c.css("display","none"),this.fetch(c,a(b.content)))}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this._core.$element.on(this._handlers),this._core.$element.on("click.owl.video",".owl-video-play-icon",a.proxy(function(a){this.play(a)},this))};e.Defaults={video:!1,videoHeight:!1,videoWidth:!1},e.prototype.fetch=function(a,b){var c=function(){return a.attr("data-vimeo-id")?"vimeo":a.attr("data-vzaar-id")?"vzaar":"youtube"}(),d=a.attr("data-vimeo-id")||a.attr("data-youtube-id")||a.attr("data-vzaar-id"),e=a.attr("data-width")||this._core.settings.videoWidth,f=a.attr("data-height")||this._core.settings.videoHeight,g=a.attr("href");if(!g)throw new Error("Missing video URL.");if(d=g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/),d[3].indexOf("youtu")>-1)c="youtube";else if(d[3].indexOf("vimeo")>-1)c="vimeo";else{if(!(d[3].indexOf("vzaar")>-1))throw new Error("Video URL not supported.");c="vzaar"}d=d[6],this._videos[g]={type:c,id:d,width:e,height:f},b.attr("data-video",g),this.thumbnail(a,this._videos[g])},e.prototype.thumbnail=function(b,c){var d,e,f,g=c.width&&c.height?'style="width:'+c.width+"px;height:"+c.height+'px;"':"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(a){e='<div class="owl-video-play-icon"></div>',d=k.lazyLoad?'<div class="owl-video-tn '+j+'" '+i+'="'+a+'"></div>':'<div class="owl-video-tn" style="opacity:1;background-image:url('+a+')"></div>',b.after(d),b.after(e)};if(b.wrap('<div class="owl-video-wrapper"'+g+"></div>"),this._core.settings.lazyLoad&&(i="data-src",j="owl-lazy"),h.length)return l(h.attr(i)),h.remove(),!1;"youtube"===c.type?(f="//img.youtube.com/vi/"+c.id+"/hqdefault.jpg",l(f)):"vimeo"===c.type?a.ajax({type:"GET",url:"//vimeo.com/api/v2/video/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a[0].thumbnail_large,l(f)}}):"vzaar"===c.type&&a.ajax({type:"GET",url:"//vzaar.com/api/videos/"+c.id+".json",jsonp:"callback",dataType:"jsonp",success:function(a){f=a.framegrab_url,l(f)}})},e.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,this._core.leave("playing"),this._core.trigger("stopped",null,"video")},e.prototype.play=function(b){var c,d=a(b.target),e=d.closest("."+this._core.settings.itemClass),f=this._videos[e.attr("data-video")],g=f.width||"100%",h=f.height||this._core.$stage.height();this._playing||(this._core.enter("playing"),this._core.trigger("play",null,"video"),e=this._core.items(this._core.relative(e.index())),this._core.reset(e.index()),"youtube"===f.type?c='<iframe width="'+g+'" height="'+h+'" src="//www.youtube.com/embed/'+f.id+"?autoplay=1&rel=0&v="+f.id+'" frameborder="0" allowfullscreen></iframe>':"vimeo"===f.type?c='<iframe src="//player.vimeo.com/video/'+f.id+'?autoplay=1" width="'+g+'" height="'+h+'" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>':"vzaar"===f.type&&(c='<iframe frameborder="0"height="'+h+'"width="'+g+'" allowfullscreen mozallowfullscreen webkitAllowFullScreen src="//view.vzaar.com/'+f.id+'/player?autoplay=true"></iframe>'),a('<div class="owl-video-frame">'+c+"</div>").insertAfter(e.find(".owl-video")),this._playing=e.addClass("owl-video-playing"))},e.prototype.isInFullScreen=function(){var b=c.fullscreenElement||c.mozFullScreenElement||c.webkitFullscreenElement;return b&&a(b).parent().hasClass("owl-video-frame")},e.prototype.destroy=function(){var a,b;this._core.$element.off("click.owl.video");for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.Video=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this.core=b,this.core.options=a.extend({},e.Defaults,this.core.options),this.swapping=!0,this.previous=d,this.next=d,this.handlers={"change.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&(this.previous=this.core.current(),this.next=a.property.value)},this),"drag.owl.carousel dragged.owl.carousel translated.owl.carousel":a.proxy(function(a){a.namespace&&(this.swapping="translated"==a.type)},this),"translate.owl.carousel":a.proxy(function(a){a.namespace&&this.swapping&&(this.core.options.animateOut||this.core.options.animateIn)&&this.swap()},this)},this.core.$element.on(this.handlers)};e.Defaults={animateOut:!1,animateIn:!1},e.prototype.swap=function(){if(1===this.core.settings.items&&a.support.animation&&a.support.transition){this.core.speed(0);var b,c=a.proxy(this.clear,this),d=this.core.$stage.children().eq(this.previous),e=this.core.$stage.children().eq(this.next),f=this.core.settings.animateIn,g=this.core.settings.animateOut;this.core.current()!==this.previous&&(g&&(b=this.core.coordinates(this.previous)-this.core.coordinates(this.next),d.one(a.support.animation.end,c).css({left:b+"px"}).addClass("animated owl-animated-out").addClass(g)),f&&e.one(a.support.animation.end,c).addClass("animated owl-animated-in").addClass(f))}},e.prototype.clear=function(b){a(b.target).css({left:""}).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut),this.core.onTransitionEnd()},e.prototype.destroy=function(){var a,b;for(a in this.handlers)this.core.$element.off(a,this.handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},
6�
vendor: 10,676 bytes, lines 6-7
6 7a.fn.owlCarousel.Constructor.Plugins.Animate=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){var e=function(b){this._core=b,this._timeout=null,this._paused=!1,this._handlers={"changed.owl.carousel":a.proxy(function(a){a.namespace&&"settings"===a.property.name?this._core.settings.autoplay?this.play():this.stop():a.namespace&&"position"===a.property.name&&this._core.settings.autoplay&&this._setAutoPlayInterval()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.autoplay&&this.play()},this),"play.owl.autoplay":a.proxy(function(a,b,c){a.namespace&&this.play(b,c)},this),"stop.owl.autoplay":a.proxy(function(a){a.namespace&&this.stop()},this),"mouseover.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"mouseleave.owl.autoplay":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.play()},this),"touchstart.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this._core.is("rotating")&&this.pause()},this),"touchend.owl.core":a.proxy(function(){this._core.settings.autoplayHoverPause&&this.play()},this)},this._core.$element.on(this._handlers),this._core.options=a.extend({},e.Defaults,this._core.options)};e.Defaults={autoplay:!1,autoplayTimeout:5e3,autoplayHoverPause:!1,autoplaySpeed:!1},e.prototype.play=function(a,b){this._paused=!1,this._core.is("rotating")||(this._core.enter("rotating"),this._setAutoPlayInterval())},e.prototype._getNextTimeout=function(d,e){return this._timeout&&b.clearTimeout(this._timeout),b.setTimeout(a.proxy(function(){this._paused||this._core.is("busy")||this._core.is("interacting")||c.hidden||this._core.next(e||this._core.settings.autoplaySpeed)},this),d||this._core.settings.autoplayTimeout)},e.prototype._setAutoPlayInterval=function(){this._timeout=this._getNextTimeout()},e.prototype.stop=function(){this._core.is("rotating")&&(b.clearTimeout(this._timeout),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&(this._paused=!0)},e.prototype.destroy=function(){var a,b;this.stop();for(a in this._handlers)this._core.$element.off(a,this._handlers[a]);for(b in Object.getOwnPropertyNames(this))"function"!=typeof this[b]&&(this[b]=null)},a.fn.owlCarousel.Constructor.Plugins.autoplay=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(b){this._core=b,this._initialized=!1,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":a.proxy(function(b){b.namespace&&this._core.settings.dotsData&&this._templates.push('<div class="'+this._core.settings.dotClass+'">'+a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot")+"</div>")},this),"added.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,0,this._templates.pop())},this),"remove.owl.carousel":a.proxy(function(a){a.namespace&&this._core.settings.dotsData&&this._templates.splice(a.position,1)},this),"changed.owl.carousel":a.proxy(function(a){a.namespace&&"position"==a.property.name&&this.draw()},this),"initialized.owl.carousel":a.proxy(function(a){a.namespace&&!this._initialized&&(this._core.trigger("initialize",null,"navigation"),this.initialize(),this.update(),this.draw(),this._initialized=!0,this._core.trigger("initialized",null,"navigation"))},this),"refreshed.owl.carousel":a.proxy(function(a){a.namespace&&this._initialized&&(this._core.trigger("refresh",null,"navigation"),this.update(),this.draw(),this._core.trigger("refreshed",null,"navigation"))},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers)};e.Defaults={nav:!1,navText:["prev","next"],navSpeed:!1,navElement:"div",navContainer:!1,navContainerClass:"owl-nav",navClass:["owl-prev","owl-next"],slideBy:1,dotClass:"owl-dot",dotsClass:"owl-dots",dots:!0,dotsEach:!1,dotsData:!1,dotsSpeed:!1,dotsContainer:!1},e.prototype.initialize=function(){var b,c=this._core.settings;this._controls.$relative=(c.navContainer?a(c.navContainer):a("<div>").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"),this._controls.$previous=a("<"+c.navElement+">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click",a.proxy(function(a){this.prev(c.navSpeed)},this)),this._controls.$next=a("<"+c.navElement+">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click",a.proxy(function(a){this.next(c.navSpeed)},this)),c.dotsData||(this._templates=[a("<div>").addClass(c.dotClass).append(a("<span>")).prop("outerHTML")]),this._controls.$absolute=(c.dotsContainer?a(c.dotsContainer):a("<div>").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"),this._controls.$absolute.on("click","div",a.proxy(function(b){var d=a(b.target).parent().is(this._controls.$absolute)?a(b.target).index():a(b.target).parent().index();b.preventDefault(),this.to(d,c.dotsSpeed)},this));for(b in this._overrides)this._core[b]=a.proxy(this[b],this)},e.prototype.destroy=function(){var a,b,c,d;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)this._controls[b].remove();for(d in this.overides)this._core[d]=this._overrides[d];for(c in Object.getOwnPropertyNames(this))"function"!=typeof this[c]&&(this[c]=null)},e.prototype.update=function(){var a,b,c,d=this._core.clones().length/2,e=d+this._core.items().length,f=this._core.maximum(!0),g=this._core.settings,h=g.center||g.autoWidth||g.dotsData?1:g.dotsEach||g.items;if("page"!==g.slideBy&&(g.slideBy=Math.min(g.slideBy,g.items)),g.dots||"page"==g.slideBy)for(this._pages=[],a=d,b=0,c=0;a<e;a++){if(b>=h||0===b){if(this._pages.push({start:Math.min(f,a-d),end:a-d+h-1}),Math.min(f,a-d)===f)break;b=0,++c}b+=this._core.mergers(this._core.relative(a))}},e.prototype.draw=function(){var b,c=this._core.settings,d=this._core.items().length<=c.items,e=this._core.relative(this._core.current()),f=c.loop||c.rewind;this._controls.$relative.toggleClass("disabled",!c.nav||d),c.nav&&(this._controls.$previous.toggleClass("disabled",!f&&e<=this._core.minimum(!0)),this._controls.$next.toggleClass("disabled",!f&&e>=this._core.maximum(!0))),this._controls.$absolute.toggleClass("disabled",!c.dots||d),c.dots&&(b=this._pages.length-this._controls.$absolute.children().length,c.dotsData&&0!==b?this._controls.$absolute.html(this._templates.join("")):b>0?this._controls.$absolute.append(new Array(b+1).join(this._templates[0])):b<0&&this._controls.$absolute.children().slice(b).remove(),this._controls.$absolute.find(".active").removeClass("active"),this._controls.$absolute.children().eq(a.inArray(this.current(),this._pages)).addClass("active"))},e.prototype.onTrigger=function(b){var c=this._core.settings;b.page={index:a.inArray(this.current(),this._pages),count:this._pages.length,size:c&&(c.center||c.autoWidth||c.dotsData?1:c.dotsEach||c.items)}},e.prototype.current=function(){var b=this._core.relative(this._core.current());return a.grep(this._pages,a.proxy(function(a,c){return a.start<=b&&a.end>=b},this)).pop()},e.prototype.getPosition=function(b){var c,d,e=this._core.settings;return"page"==e.slideBy?(c=a.inArray(this.current(),this._pages),d=this._pages.length,b?++c:--c,c=this._pages[(c%d+d)%d].start):(c=this._core.relative(this._core.current()),d=this._core.items().length,b?c+=e.slideBy:c-=e.slideBy),c},e.prototype.next=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!0),b)},e.prototype.prev=function(b){a.proxy(this._overrides.to,this._core)(this.getPosition(!1),b)},e.prototype.to=function(b,c,d){var e;!d&&this._pages.length?(e=this._pages.length,a.proxy(this._overrides.to,this._core)(this._pages[(b%e+e)%e].start,c)):a.proxy(this._overrides.to,this._core)(b,c)},a.fn.owlCarousel.Constructor.Plugins.Navigation=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){"use strict";var e=function(c){this._core=c,this._hashes={},this.$element=this._core.$element,this._handlers={"initialized.owl.carousel":a.proxy(function(c){c.namespace&&"URLHash"===this._core.settings.startPosition&&a(b).trigger("hashchange.owl.navigation")},this),"prepared.owl.carousel":a.proxy(function(b){if(b.namespace){var c=a(b.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash");if(!c)return;this._hashes[c]=b.content}},this),"changed.owl.carousel":a.proxy(function(c){if(c.namespace&&"position"===c.property.name){var d=this._core.items(this._core.relative(this._core.current())),e=a.map(this._hashes,function(a,b){return a===d?b:null}).join();if(!e||b.location.hash.slice(1)===e)return;b.location.hash=e}},this)},this._core.options=a.extend({},e.Defaults,this._core.options),this.$element.on(this._handlers),a(b).on("hashchange.owl.navigation",a.proxy(function(a){var c=b.location.hash.substring(1),e=this._core.$stage.children(),f=this._hashes[c]&&e.index(this._hashes[c]);f!==d&&f!==this._core.current()&&this._core.to(this._core.relative(f),!1,!0)},this))};e.Defaults={URLhashListener:!1},e.prototype.destroy=function(){var c,d;a(b).off("hashchange.owl.navigation");for(c in this._handlers)this._core.$element.off(c,this._handlers[c]);for(d in Object.getOwnPropertyNames(this))"function"!=typeof this[d]&&(this[d]=null)},a.fn.owlCarousel.Constructor.Plugins.Hash=e}(window.Zepto||window.jQuery,window,document),function(a,b,c,d){function e(b,c){var e=!1,f=b.charAt(0).toUpperCase()+b.slice(1);return a.each((b+" "+h.join(f+" ")+f).split(" "),function(a,b){if(g[b]!==d)return e=!c||b,!1}),e}function f(a){return e(a,!0)}var g=a("<support>").get(0).style,h="Webkit Moz O ms".split(" "),i={transition:{end:{WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd",transition:"transitionend"}},animation:{end:{WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd",animation:"animationend"}}},j={csstransforms:function(){return!!e("transform")},csstransforms3d:function(){return!!e("perspective")},csstransitions:function(){return!!e("transition")},cssanimations:function(){return!!e("animation")}};j.csstransitions()&&(a.support.transition=new String(f("transition")),a.support.transition.end=i.transition.end[a.support.transition]),j.cssanimations()&&(a.support.animation=new String(f("animation")),a.support.animation.end=i.animation.end[a.support.animation]),j.csstransforms()&&(a.support.transform=new String(f("transform")),a.support.transform3d=j.csstransforms3d())}(window.Zepto||window.jQuery,window,document);
7 8 9 10$(function(){ 11 // 00: ã·ã¹ãã ãã¼ã¸å ã«ã¿ã¤ãã«æåãå ¥å 12 $("#sysMain").append("<div class='clearfix'></div>"); 13 $("#sysFormConfirm #sysMain").prepend("<h1 class='sysHeadline'><span>å ¥åå å®¹ç¢ºèª <b>CONFIRM</b></span></h1>"); 14 $("#sysMemberRegisterConfirm #sysMain").prepend("<h1 class='sysHeadline'><span>å ¥åå å®¹ç¢ºèª <b>CONFIRM</b></span></h1>"); 15 $("#sysBasket #sysMain").prepend("<h1 class='sysHeadline' style='color: #000'><span>ã«ã¼ãæ å ±<b>CART INFO</b></span></h1>"); 16 $("#sysMemberRegisterIndex #sysMain").prepend("<h1 class='sysHeadline' style='color: #000'><span>æ°è¦ä¼å¡ç»é²<b>REGISTRATION</b></span></h1>"); 17 $("#sysMypageLogin #sysMain").prepend("<h1 class='sysHeadline' style='color: #000'><span>ãã¤ãã¼ã¸ãã°ã¤ã³<b>LOG IN</b></span></h1>"); 18 $("#sysMypageLogout #sysMain").prepend("<h1 class='sysHeadline' style='color: #000'><span>ãã°ã¢ã¦ã<b>LOG OUT</b></span></h1>"); 19 $("#sysDestination #sysMain").prepend("<h1 class='sysHeadline' style='color: #000'><span>é éå ã®é¸æ<b>DESTINATION</b></span></h1>"); 20 $("#sysMypageIndex #sysMain").prepend("<h1 class='sysHeadline' style='color: #000'><span>ãã¤ãã¼ã¸<b>MY PAGE</b></span></h1>"); 21 $("#sysMemberRegisterRegister #sysMain").prepend("<h1 class='sysHeadline' style='color: #000'><span>æ°è¦ç»é²å®äº<b>COMPLETED</b></span></h1>"); 22 23 //IDä»ä¸ ååãããã¯ã®ã¹ã©ã¤ãå TOPãã¼ã¸ããªã¹ã¹ã¡åå 24 if($('.top_recommend_item ul').get(0)){ 25 $.when( 26 $('.top_recommend_item ul').attr('id', 'recommend_slider'), 27 $('.top_recommend_item ul').addClass('owl-carousel') 28 ) 29 .done(function() { 30 // ãã¹ã¦æåããæã®å¦ç 31 console.log('success'); 32 $("#recommend_slider").fadeIn(500); 33 $('#recommend_slider').owlCarousel({ 34 loop:true, 35 autoplay:true, 36 nav:true, 37 dot:true, 38 items:3 39 }); 40 }) 41 .fail(function() { 42 // ã¨ã©ã¼ããã£ãæ 43 console.log('error'); 44 }); 45 } 46 47 if($("#slider").get(0)){ 48 $.when( 49 //TOPã¹ã©ã¤ãã¼ 50 $('#slider').owlCarousel({ 51 center: true, 52 loop:true, 53 autoplay:true, 54 nav:true, 55 dot:true, 56 responsive:{ 57 0: { 58 items:1 59 }, 60 960: { 61 items:3, 62 autoWidth:true 63 } 64 } 65 }) 66 ).done(function(){ 67 $("#slider").fadeIn(500); 68 69 }).fail(function(){ 70 // ã¨ã©ã¼ããã£ãæ 71 console.log('slide_error'); 72 }); 73 } 74 75 //$('.owl-item.cloned').hide(); 76 var owl_h = $('.top_slider').height(); 77 console.log(owl_h); 78 if( owl_h === 1 ){ 79 if (window.name != "xyz"){ 80 console.log('reloaded'); 81 location.reload(); 82 window.name = "xyz"; 83 } 84 } 85 86 //01: headerã追å¾å¼ã«ããããã®htmlç·¨é 87 $('.header_h1_under,.header_h1,.header,.h_navi,.header_sp,.h_cart').wrapAll('<div class="header_wrap"><div class=\"header_wrap_inner\"></div></div>'); 88 89 //02:PCããã²ã¼ã·ã§ã³ã®éé 90 function navigationMenu(target){ 91 var w = $(window).width(); 92 var menu = []; 93 var menuButton = []; 94 var listNumber = []; 95 var menuList = []; 96 var menuState = -1; 97 98 function toggleMove(e){ 99 console.log(menuState); 100 101 if(menuState == e){ 102 menuList[e].stop().animate({'height': 0 + 'px'}, 200 , function(){ 103 menuList[e].css({'display': 'none'}); 104 $('.active').removeClass('active'); 105 menuState = -1; 106 }); 107 108 }else if(menuState == -1){ 109 menu[e].addClass('active'); 110 menuList[e].css({'display': 'block'}); 111 112 if(w > 1200){ 113 menuList[e].stop().animate({'height': listNumber[e] * 35 + 'px'}, 200, function(){ 114 menuState = e; 115 }); 116 }else{ 117 menuList[e].stop().animate({'height': listNumber[e] * 50 + 'px'}, 400, function(){ 118 menuState = e; 119 });
120 } 121 122 }else{ 123 $('.active').removeClass('active'); 124 $('.toggleNav').stop().animate({'height': 0 + 'px'}, 200 , function(){ 125 $('.toggleNav').css({'display': 'none'}); 126 menu[e].addClass('active'); 127 menuList[e].css({'display': 'block'}); 128 129 if(w > 1200){ 130 menuList[e].stop().animate({'height': listNumber[e] * 35 + 'px'}, 200, function(){ 131 menuState = e; 132 }); 133 }else{ 134 menuList[e].stop().animate({'height': listNumber[e] * 50 + 'px'}, 400, function(){ 135 menuState = e; 136 }); 137 } 138 }); 139 } 140 }; 141 142 function init(){ 143 $.each(target.find('li.tab1'),function(i){ 144 menuButton[i] = $(this).find("section"); 145 146 $.each(menuButton, function(index){ 147 menu[index] = $(this).parent('li'); 148 menuList[index] = $(this).children('.toggleNav'); 149 listNumber[index] = menuList[index].find('li.tab2').length; 150 151 $(menuButton[index]).on({ 152 'click': function(){ 153 toggleMove(index); 154 } 155 }); 156 }); 157 }); 158 }; 159 160 init(); 161 }; 162 navigationMenu($('#headNavigation')); 163 164 //03ã«ã¼ãæ å ±ã®ãããã¢ãã 165 function cartInfo(target){ 166 167 function setCartButton(btn){ 168 $(btn).on({ 169 'mouseover': function(){ 170 target.stop().css({'display': 'block'}).fadeIn(200, 'swing'); 171 }, 172 'mouseout': function(){ 173 target.stop().fadeOut(200, 'swing', function(){target.css({'display': 'none'})}); 174 } 175 }); 176 }; 177 178 function rootUrl() { 179 // aishipR é常ãã¼ã¸ã§ã¯æ©è½ãã¼ãã¿ã°<#ãµã¤ãURL>ãSSLéä¿¡ãã¼ã¸ã§ã¯<#SSLã«ã¼ãURL>ãæå®ããå ´åã¨åçã®URLãåå¾ 180 181 // ç¾å¨ãSSLé信対象ã®ãã¼ã¸ã®å ´å (æ»ãå¤: http://ssh.aispr.jp/[user]) 182 if ("ssl.aispr.jp" === document.location.hostname) { 183 // ã¦ã¼ã¶ã¼åãåå¾ (ssléä¿¡ãã¼ã¸ã®å ´åã®pathname: /[user]/[page]) 184 var u = document.location.pathname.split('/')[1]; 185 186 return document.location.origin + "/" + u; 187 } 188 189 // ç¾å¨ãé常ãã¼ã¸ã§ããå ´å (æ»ãå¤: [ãããã³ã«å]://[ãã¡ã¤ã³å]) 190 return document.location.origin; 191 } 192 193 function init(){ 194 // ã«ã¼ããã¿ã³ç¨ã®DOM使 195 var site_url = rootUrl(); 196 197 $(target).wrapAll('<section id="cartInfo">'); 198 $('<p>', { 199 'class': 'cartTxt', 200 'html': '<img src="' + site_url + '/img/top/cart_icon.png">ã«ã¼ã<button id="itemCount" class="itemCount">2</button>' 201 }).appendTo($('#cartInfo')); 202 203 $('<img>',{ 204 'src': site_url + '/img/top/cart_icon.png', 205 'alt': 'ã«ã¼ãã®ã¢ã¤ã³ã³' 206 }).prependTo($('.sysCartInfoCartIn a')); 207 208 setCartButton($('#cartInfo')); 209 }; 210 init(); 211 }; 212 cartInfo($('.h_cart')); 213 214 //04: SPã¢ã¼ãã«ããã®å¶å¾¡ 215 function spNavigation(target){ 216 //æ¢åã®htmlè¦ç´ ã弿°ã«æ ¼ç´ 217 var logIn = $(".h_login"); 218 var hSearch = $(".h_search"); 219 var navigation = $(".sp_nav"); 220 221 //DOMæ§é ã®å¶å¾¡ 222 logIn.wrapAll('<section class="wrap1">'); 223 hSearch.wrapAll('<section class="wrap1">'); 224 navigation.wrapAll('<section class="wrap1">'); 225 $(".wrap1").wrapAll('<div id="spNaviWrap">'); 226 $("#spNaviWrap").wrapAll('<div class="h_spnavi">'); 227 228 //jsã§çæããDOMã弿°ã«æ ¼ç´ 229 var navBase = $(".h_spnavi"); 230 var navWrap = $("#spNaviWrap"); 231 var closeMenu = $("#closeMenu"); 232 var closeMenu2 = $("#closeMenu2"); 233 234 function navClose(){ 235 //$( 'body' ).css( {position: 'static'} ); 236 //$( 'html, body' ).prop( { scrollTop: current_scrollY } ); 237 navWrap.stop().animate({'left': -100 + '%'}); 238 navBase.stop().animate({'opacity': 0 }, { 239 'duration': 600, 240 'complete': function(){ 241 navBase.css({'display': 'none', 'opacity': 1}) 242 } 243 }); 244 }; 245
246 function init(){ 247 248 target.on({ 249 'click': function(){ 250 //current_scrollY = $( window ).scrollTop(); 251 //$( 'body' ).css( {position: 'fixed'} ); 252 navBase.css({'display': 'block'}); 253 navWrap.stop().animate({'left': 0 + 'px'}, 400); 254 } 255 }); 256 257 closeMenu.on({ 258 'click': function(){ 259 navClose(); 260 } 261 }); 262 263 closeMenu2.on({ 264 'click': function(){ 265 navClose(); 266 } 267 }); 268 }; 269 270 init(); 271 }; 272 spNavigation($("#navBtn")); 273 274 //05 ã¢ã³ã«ã¼ã¿ã°ã®æå¹å 275 window.onload=function(){ 276 var urlHash = location.hash; 277 if( 0 < urlHash.length ){ 278 location.hash = urlHash; 279 var scroll = $(urlHash).offset().top; 280 var h = $(window).width(); 281 282 if(h > 1100){ 283 var adScroll = scroll - 150; 284 }else{ 285 var adScroll = scroll - 100; 286 } 287 288 $("html, body").animate({scrollTop: adScroll}, 0); 289 } 290 } 291 292 //06 ãã¼ã¸ãã¼ãæã«ã«ã¼ãå ã®ååæ°ãåå¾ãã¦è¡¨ç¤ºããå¦ç 293 function itemCount(target){ 294 var numberBox; 295 var itemNumber; 296 var items; 297 298 //ã«ã¼ãå ã®ååæ°ã0ã§ãªããã°ããããã¢ããã¨ååæ°ã表示 299 function count(){ 300 numberBox = $('.sysCartInfoItemCount dd span'); 301 itemNumber = numberBox.text(); 302 items = Number(itemNumber); 303 304 if(items != 0 && items != undefined){ 305 target.css({ 'display': 'inline-block'}); 306 target.text(items); 307 } 308 }; 309 310 function init(){ 311 //åå詳細ãã¼ã¸ããã«ã¼ãã«ååã追å ããå ´åã«ãååæ°è¡¨ç¤ºãæ´æ° 312 $('#sysItemDetail .sysCartButton').on({ 313 'click': function(){ 314 setTimeout(count, 3000); 315 } 316 }); 317 318 //ååã«ãã´ãªã¼ãã¼ã¸ããã«ã¼ãã«ååã追å ããå ´åã«ãååæ°è¡¨ç¤ºãæ´æ° 319 $('#sysItemCategory .sysCartButton').on({ 320 'click': function(){ 321 setTimeout(count, 3000); 322 } 323 }); 324 325 count(); 326 }; 327 328 init(); 329 }; 330 331 //itemCount(ãããã¢ããã¢ã¤ã³ã³)ãã¿ã¼ã²ããã¨ãã¦itemCount颿°ãå¼ã³åºã 332 itemCount($('#itemCount')); 333 //PCã¨SPã§ãã¼ããéãã®ã§ããªã¬ã¼ãåã æºå 334 itemCount($('#itemCount2')); 335 336 //07 ååãªã¹ãã®é«ãæã 337 (function($) { 338 $.fn.tile = function(columns) { 339 var tiles, $tile, max, c, h, last = this.length - 1, s, method; 340 if(!columns) columns = this.length; 341 this.each(function() { 342 s = this.style; 343 if(s.removeProperty) s.removeProperty("height"); 344 else if(s.removeAttribute) s.removeAttribute("height"); 345 }); 346 347 return this.each(function(i) { 348 c = i % columns; 349 if(c == 0) tiles = []; 350 $tile = tiles[c] = $(this); 351 method = ($tile.css("box-sizing") == "border-box") ? $.fn.outerHeight : $.fn.innerHeight; 352 h = method.apply($tile); 353 if(c == 0 || h > max) max = h; 354 if(i == last || c == columns - 1) { 355 $.each(tiles, function() { method.apply(this, [max]); }); 356 } 357 }); 358 }; 359 })(jQuery); 360 361 var object = $('.sysItemList li .sysItemName'); 362 var target = object.parent('div'); 363 target.addClass('itemDetailWrap'); 364 365 $(window).load(function(){ 366 target.tile(); 367 }); 368 369 $(window).resize(function(){ 370 target.tile(); 371 }); 372 373 //08 ãããã«æ»ããã¿ã³ã®å¶å¾¡ 374 function returnTop(target){ 375 376 function showBtn(){ 377 target.css({'display': 'block'}); 378 target.stop().animate({'opacity': '1' }, 300); 379 }; 380 381 function hideBtn(){ 382 target.stop().animate({'opacity': '0' }, { 383 'duration': 300, 384 'complete': function(){ 385 target.css({'display': 'none'}) 386 } 387 }); 388 }; 389 390 function init(){ 391 $(window).on({ 392 'scroll': function(){ 393 var scroll = $(window).scrollTop(); 394 395 if (scroll > 100){ 396 showBtn(); 397 }else{ 398 hideBtn();
399 } 400 } 401 }); 402 }; 403 404 init(); 405 }; 406 returnTop($('#page-top')); 407 408 //9 ç¹éä¸è¦§ã«ããã¹ãã表示ããã 409 function showFeatureTxt(target){ 410 411 function init(){ 412 $.each(target.find('li'),function(){ 413 var bnr = $(this).find('a'); 414 var menuButton = $(this).find('img'); 415 var bnrText = menuButton.attr('alt'); 416 417 $('<p>', { 418 'class': 'featuresText', 419 'html': bnrText 420 }).appendTo(bnr); 421 }); 422 }; 423 424 init(); 425 }; 426 427 showFeatureTxt($('.top_features')); 428}); 429 430//ååãã¼ã¸ æåã®ã¢ã³ã¼ãã£ãªã³ 431$(function(){ 432 $('.contents_tr').hide(); 433 $(".btn_tr").on("click", function() { 434 $('+.contents_tr',this).slideToggle(100); 435 $(this).toggleClass("active"); 436 }); 437}); 438 439//smooth_scroll.js 440/** 441https://github.com/cferdinandi/smooth-scroll 442**/ 443(function (root, factory) { 444 if ( typeof define === 'function' && define.amd ) { 445 define([], factory(root)); 446 } else if ( typeof exports === 'object' ) { 447 module.exports = factory(root); 448 } else { 449 root.smoothScroll = factory(root); 450 } 451})(typeof global !== 'undefined' ? global : this.window || this.global, function (root) { 452 453 'use strict'; 454 455 // 456 // Variables 457 // 458 459 var smoothScroll = {}; // Object for public APIs 460 var supports = 'querySelector' in document && 'addEventListener' in root; // Feature test 461 var settings, anchor, toggle, fixedHeader, headerHeight, eventTimeout, animationInterval; 462 463 // Default settings 464 var defaults = { 465 selector: '[data-scroll]', 466 selectorHeader: null, 467 speed: 500, 468 easing: 'easeInOutCubic', 469 offset: 0, 470 callback: function () {} 471 }; 472 473 474 // 475 // Methods 476 // 477 478 /** 479 * Merge two or more objects. Returns a new object. 480 * @private 481 * @param {Boolean} deep If true, do a deep (or recursive) merge [optional] 482 * @param {Object} objects The objects to merge together 483 * @returns {Object} Merged values of defaults and options 484 */ 485 var extend = function () { 486 487 // Variables 488 var extended = {}; 489 var deep = false; 490 var i = 0; 491 var length = arguments.length; 492 493 // Check if a deep merge 494 if ( Object.prototype.toString.call( arguments[0] ) === '[object Boolean]' ) { 495 deep = arguments[0]; 496 i++; 497 } 498 499 // Merge the object into the extended object 500 var merge = function (obj) { 501 for ( var prop in obj ) { 502 if ( Object.prototype.hasOwnProperty.call( obj, prop ) ) { 503 // If deep merge and property is an object, merge properties 504 if ( deep && Object.prototype.toString.call(obj[prop]) === '[object Object]' ) { 505 extended[prop] = extend( true, extended[prop], obj[prop] ); 506 } else { 507 extended[prop] = obj[prop]; 508 } 509 } 510 } 511 }; 512 513 // Loop through each object and conduct a merge 514 for ( ; i < length; i++ ) { 515 var obj = arguments[i]; 516 merge(obj); 517 } 518 519 return extended; 520 521 }; 522 523 /** 524 * Get the height of an element. 525 * @private 526 * @param {Node} elem The element to get the height of 527 * @return {Number} The element's height in pixels 528 */ 529 var getHeight = function ( elem ) { 530 return Math.max( elem.scrollHeight, elem.offsetHeight, elem.clientHeight ); 531 }; 532 533 /** 534 * Get the closest matching element up the DOM tree. 535 * @private 536 * @param {Element} elem Starting element 537 * @param {String} selector Selector to match against 538 * @return {Boolean|Element} Returns null if not match found 539 */ 540 var getClosest = function ( elem, selector ) { 541 542 // Element.matches() polyfill 543 if (!Element.prototype.matches) { 544 Element.prototype.matches = 545 Element.prototype.matchesSelector || 546 Element.prototype.mozMatchesSelector || 547 Element.prototype.msMatchesSelector || 548 Element.prototype.oMatchesSelector || 549 Element.prototype.webkitMatchesSelector || 550 function(s) { 551 var matches = (this.document || this.ownerDocument).querySelectorAll(s), 552 i = matches.length; 553 while (--i >= 0 && matches.item(i) !== this) {} 554 return i > -1; 555 }; 556 } 557 558 // Get closest match 559 for ( ; elem && elem !== document; elem = elem.parentNode ) { 560 if ( elem.matches( selector ) ) return elem; 561 } 562 563 return null; 564 565 }; 566 567 /** 568 * Escape special characters for use with querySelector 569 * @private 570 * @param {String} id The anchor ID to escape 571 * @author Mathias Bynens 572 * @link https://github.com/mathiasbynens/CSS.escape 573 */ 574 var escapeCharacters = function ( id ) { 575 576 // Remove leading hash 577 if ( id.charAt(0) === '#' ) { 578 id = id.substr(1); 579 } 580 581 var string = String(id); 582 var length = string.length; 583 var index = -1; 584 var codeUnit; 585 var result = ''; 586 var firstCodeUnit = string.charCodeAt(0); 587 while (++index < length) { 588 codeUnit = string.charCodeAt(index); 589 // Note: thereâs no need to special-case astral symbols, surrogate 590 // pairs, or lone surrogates. 591 592 // If the character is NULL (U+0000), then throw an 593 // `InvalidCharacterError` exception and terminate these steps. 594 if (codeUnit === 0x0000) { 595 throw new InvalidCharacterError( 596 'Invalid character: the input contains U+0000.' 597 ); 598 } 599 600 if ( 601 // If the character is in the range [\1-\1F] (U+0001 to U+001F) or is 602 // U+007F, [â¦] 603 (codeUnit >
603= 0x0001 && codeUnit <= 0x001F) || codeUnit == 0x007F || 604 // If the character is the first character and is in the range [0-9] 605 // (U+0030 to U+0039), [â¦] 606 (index === 0 && codeUnit >= 0x0030 && codeUnit <= 0x0039) || 607 // If the character is the second character and is in the range [0-9] 608 // (U+0030 to U+0039) and the first character is a `-` (U+002D), [â¦] 609 ( 610 index === 1 && 611 codeUnit >= 0x0030 && codeUnit <= 0x0039 && 612 firstCodeUnit === 0x002D 613 ) 614 ) { 615 // http://dev.w3.org/csswg/cssom/#escape-a-character-as-code-point 616 result += '\\' + codeUnit.toString(16) + ' '; 617 continue; 618 } 619 620 // If the character is not handled by one of the above rules and is 621 // greater than or equal to U+0080, is `-` (U+002D) or `_` (U+005F), or 622 // is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to 623 // U+005A), or [a-z] (U+0061 to U+007A), [â¦] 624 if ( 625 codeUnit >= 0x0080 || 626 codeUnit === 0x002D || 627 codeUnit === 0x005F || 628 codeUnit >= 0x0030 && codeUnit <= 0x0039 || 629 codeUnit >= 0x0041 && codeUnit <= 0x005A || 630 codeUnit >= 0x0061 && codeUnit <= 0x007A 631 ) { 632 // the character itself 633 result += string.charAt(index); 634 continue; 635 } 636 637 // Otherwise, the escaped character. 638 // http://dev.w3.org/csswg/cssom/#escape-a-character 639 result += '\\' + string.charAt(index); 640 641 } 642 643 return '#' + result; 644 645 }; 646 647 /** 648 * Calculate the easing pattern 649 * @private 650 * @link https://gist.github.com/gre/1650294 651 * @param {String} type Easing pattern 652 * @param {Number} time Time animation should take to complete 653 * @returns {Number} 654 */ 655 var easingPattern = function ( type, time ) { 656 var pattern; 657 if ( type === 'easeInQuad' ) pattern = time * time; // accelerating from zero velocity 658 if ( type === 'easeOutQuad' ) pattern = time * (2 - time); // decelerating to zero velocity 659 if ( type === 'easeInOutQuad' ) pattern = time < 0.5 ? 2 * time * time : -1 + (4 - 2 * time) * time; // acceleration until halfway, then deceleration 660 if ( type === 'easeInCubic' ) pattern = time * time * time; // accelerating from zero velocity 661 if ( type === 'easeOutCubic' ) pattern = (--time) * time * time + 1; // decelerating to zero velocity 662 if ( type === 'easeInOutCubic' ) pattern = time < 0.5 ? 4 * time * time * time : (time - 1) * (2 * time - 2) * (2 * time - 2) + 1; // acceleration until halfway, then deceleration 663 if ( type === 'easeInQuart' ) pattern = time * time * time * time; // accelerating from zero velocity 664 if ( type === 'easeOutQuart' ) pattern = 1 - (--time) * time * time * time; // decelerating to zero velocity 665 if ( type === 'easeInOutQuart' ) pattern = time < 0.5 ? 8 * time * time * time * time : 1 - 8 * (--time) * time * time * time; // acceleration until halfway, then deceleration 666 if ( type === 'easeInQuint' ) pattern = time * time * time * time * time; // accelerating from zero velocity 667 if ( type === 'easeOutQuint' ) pattern = 1 + (--time) * time * time * time * time; // decelerating to zero velocity 668 if ( type === 'easeInOutQuint' ) pattern = time < 0.5 ? 16 * time * time * time * time * time : 1 + 16 * (--time) * time * time * time * time; // acceleration until halfway, then deceleration 669 return pattern || time; // no easing, no acceleration 670 }; 671 672 /** 673 * Calculate how far to scroll 674 * @private 675 * @param {Element} anchor The anchor element to scroll to 676 * @param {Number} headerHeight Height of a fixed header, if any 677 * @param {Number} offset Number of pixels by which to offset scroll 678 * @returns {Number} 679 */ 680 var getEndLocation = function ( anchor, headerHeight, offset ) { 681 var location = 0; 682 if (anchor.offsetParent) { 683 do { 684 location += anchor.offsetTop; 685 anchor = anchor.offsetParent; 686 } while (anchor); 687 } 688 location = Math.max(location - headerHeight - offset, 0); 689 return Math.min(location, getDocumentHeight() - getViewportHeight()); 690 }; 691 692 /** 693 * Determine the viewport's height 694 * @private 695 * @returns {Number} 696 */
697 var getViewportHeight = function() { 698 return Math.max( document.documentElement.clientHeight, root.innerHeight || 0 ); 699 }; 700 701 /** 702 * Determine the document's height 703 * @private 704 * @returns {Number} 705 */ 706 var getDocumentHeight = function () { 707 return Math.max( 708 document.body.scrollHeight, document.documentElement.scrollHeight, 709 document.body.offsetHeight, document.documentElement.offsetHeight, 710 document.body.clientHeight, document.documentElement.clientHeight 711 ); 712 }; 713 714 /** 715 * Convert data-options attribute into an object of key/value pairs 716 * @private 717 * @param {String} options Link-specific options as a data attribute string 718 * @returns {Object} 719 */ 720 var getDataOptions = function ( options ) { 721 return !options || !(typeof JSON === 'object' && typeof JSON.parse === 'function') ? {} : JSON.parse( options ); 722 }; 723 724 /** 725 * Get the height of the fixed header 726 * @private 727 * @param {Node} header The header 728 * @return {Number} The height of the header 729 */ 730 var getHeaderHeight = function ( header ) { 731 return !header ? 0 : ( getHeight( header ) + header.offsetTop ); 732 }; 733 734 /** 735 * Bring the anchored element into focus 736 * @private 737 */ 738 var adjustFocus = function ( anchor, endLocation, isNum ) { 739 740 // Don't run if scrolling to a number on the page 741 if ( isNum ) return; 742 743 // Otherwise, bring anchor element into focus 744 anchor.focus(); 745 if ( document.activeElement.id !== anchor.id ) { 746 anchor.setAttribute( 'tabindex', '-1' ); 747 anchor.focus(); 748 anchor.style.outline = 'none'; 749 } 750 root.scrollTo( 0 , endLocation ); 751 752 }; 753 754 /** 755 * Start/stop the scrolling animation 756 * @public 757 * @param {Node|Number} anchor The element or position to scroll to 758 * @param {Element} toggle The element that toggled the scroll event 759 * @param {Object} options 760 */ 761 smoothScroll.animateScroll = function ( anchor, toggle, options ) { 762 763 // Options and overrides 764 var overrides = getDataOptions( toggle ? toggle.getAttribute('data-options') : null ); 765 var animateSettings = extend( settings || defaults, options || {}, overrides ); // Merge user options with defaults 766 767 // Selectors and variables 768 var isNum = Object.prototype.toString.call( anchor ) === '[object Number]' ? true : false; 769 var anchorElem = isNum || !anchor.tagName ? null : anchor; 770 if ( !isNum && !anchorElem ) return; 771 var startLocation = root.pageYOffset; // Current location on the page 772 if ( animateSettings.selectorHeader && !fixedHeader ) { 773 // Get the fixed header if not already set 774 fixedHeader = document.querySelector( animateSettings.selectorHeader ); 775 } 776 if ( !headerHeight ) { 777 // Get the height of a fixed header if one exists and not already set 778 headerHeight = getHeaderHeight( fixedHeader ); 779 } 780 var endLocation = isNum ? anchor : getEndLocation( anchorElem, headerHeight, parseInt(animateSettings.offset, 10) ); // Location to scroll to 781 var distance = endLocation - startLocation; // distance to travel 782 var documentHeight = getDocumentHeight(); 783 var timeLapsed = 0; 784 var percentage, position; 785 786 /** 787 * Stop the scroll animation when it reaches its target (or the bottom/top of page) 788 * @private 789 * @param {Number} position Current position on the page 790 * @param {Number} endLocation Scroll to location 791 * @param {Number} animationInterval How much to scroll on this loop 792 */ 793 var stopAnimateScroll = function ( position, endLocation, animationInterval ) { 794 var currentLocation = root.pageYOffset; 795 if ( position == endLocation || currentLocation == endLocation || ( (root.innerHeight + currentLocation) >= documentHeight ) ) { 796 797 // Clear the animation timer 798 clearInterval(animationInterval); 799 800 // Bring the anchored element into focus 801 adjustFocus( anchor, endLocation, isNum ); 802 803 // Run callback after animation complete 804 animateSettings.callback( anchor, toggle ); 805 806 } 807 }; 808 809 /** 810 * Loop scrolling animation 811 * @private 812 */ 813 var loopAnimateScroll = function () { 814 timeLapsed += 16; 815 percentage = ( timeLapsed / parseInt(animateSettings.speed, 10) ); 816 percentage = ( percentage > 1 ) ? 1 : percentage; 817 position = startLocation + ( distance * easingPattern(animateSettings.easing, percentage) ); 818 root.scrollTo( 0, Math.floor(position) ); 819 stopAnimateScroll(position, endLocation, animationInterval); 820 }; 821 822 /** 823 * Set interval timer 824 * @private 825 */ 826 var startAnimateScroll = function () { 827 clearInterval(animationInterval); 828 animationInterval = setInterval(loopAnimateScroll, 16); 829 }; 830 831 /** 832 * Reset position to fix weird iOS bug 833 * @link https://github.com/cferdinandi/smooth-scroll/issues/45 834 */ 835 if ( root.pageYOffset === 0 ) { 836 root.scrollTo( 0, 0 ); 837 } 838 839 // Start scrolling animation 840 startAnimateScroll(); 841 842 }; 843 844 /** 845 * Handle has change event 846 * @private 847 */ 848 var hashChangeHandler = function (event) { 849 850 // Get hash from URL 851 // var hash = decodeURIComponent( escapeCharacters( root.location.hash ) ); 852 var hash; 853 try {
854 hash = escapeCharacters( decodeURIComponent( root.location.hash ) ); 855 } catch(e) { 856 hash = escapeCharacters( root.location.hash ); 857 } 858 859 // Only run if there's an anchor element to scroll to 860 if ( !anchor ) return; 861 862 // Reset the anchor element's ID 863 anchor.id = anchor.getAttribute( 'data-scroll-id' ); 864 865 // Scroll to the anchored content 866 smoothScroll.animateScroll( anchor, toggle ); 867 868 // Reset anchor and toggle 869 anchor = null; 870 toggle = null; 871 872 }; 873 874 /** 875 * If smooth scroll element clicked, animate scroll 876 * @private 877 */ 878 var clickHandler = function (event) { 879 880 // Don't run if right-click or command/control + click 881 if ( event.button !== 0 || event.metaKey || event.ctrlKey ) return; 882 883 // Check if a smooth scroll link was clicked 884 toggle = getClosest( event.target, settings.selector ); 885 if ( !toggle || toggle.tagName.toLowerCase() !== 'a' ) return; 886 887 // Only run if link is an anchor and points to the current page 888 if ( toggle.hostname !== root.location.hostname || toggle.pathname !== root.location.pathname || !/#/.test(toggle.href) ) return; 889 890 // Get the sanitized hash 891 // var hash = decodeURIComponent( escapeCharacters( toggle.hash ) ); 892 // console.log(hash); 893 var hash; 894 try { 895 hash = escapeCharacters( decodeURIComponent( toggle.hash ) ); 896 } catch(e) { 897 hash = escapeCharacters( toggle.hash ); 898 } 899 900 // If the hash is empty, scroll to the top of the page 901 if ( hash === '#' ) { 902 903 // Prevent default link behavior 904 event.preventDefault(); 905 906 // Set the anchored element 907 anchor = document.body; 908 909 // Save or create the ID as a data attribute and remove it (prevents scroll jump) 910 var id = anchor.id ? anchor.id : 'smooth-scroll-top'; 911 anchor.setAttribute( 'data-scroll-id', id ); 912 anchor.id = ''; 913 914 // If no hash change event will happen, fire manually 915 // Otherwise, update the hash 916 if ( root.location.hash.substring(1) === id ) { 917 hashChangeHandler(); 918 } else { 919 root.location.hash = id; 920 } 921 922 return; 923 924 } 925 926 // Get the anchored element 927 anchor = document.querySelector( hash ); 928 929 // If anchored element exists, save the ID as a data attribute and remove it (prevents scroll jump) 930 if ( !anchor ) return; 931 anchor.setAttribute( 'data-scroll-id', anchor.id ); 932 anchor.id = ''; 933 934 // If no hash change event will happen, fire manually 935 if ( toggle.hash === root.location.hash ) { 936 event.preventDefault(); 937 hashChangeHandler(); 938 } 939 940 }; 941 942 /** 943 * On window scroll and resize, only run events at a rate of 15fps for better performance 944 * @private 945 * @param {Function} eventTimeout Timeout function 946 * @param {Object} settings 947 */ 948 var resizeThrottler = function (event) { 949 if ( !eventTimeout ) { 950 eventTimeout = setTimeout(function() { 951 eventTimeout = null; // Reset timeout 952 headerHeight = getHeaderHeight( fixedHeader ); // Get the height of a fixed header if one exists 953 }, 66); 954 } 955 }; 956 957 /** 958 * Destroy the current initialization. 959 * @public 960 */ 961 smoothScroll.destroy = function () { 962 963 // If plugin isn't already initialized, stop 964 if ( !settings ) return; 965 966 // Remove event listeners 967 document.removeEventListener( 'click', clickHandler, false ); 968 root.removeEventListener( 'resize', resizeThrottler, false ); 969 970 // Reset varaibles 971 settings = null; 972 anchor = null; 973 toggle = null; 974 fixedHeader = null; 975 headerHeight = null; 976 eventTimeout = null; 977 animationInterval = null; 978 }; 979 980 /** 981 * Initialize Smooth Scroll 982 * @public 983 * @param {Object} options User settings 984 */ 985 smoothScroll.init = function ( options ) { 986 987 // feature test 988 if ( !supports ) return; 989 990 // Destroy any existing initializations 991 smoothScroll.destroy(); 992 993 // Selectors and variables 994 settings = extend( defaults, options || {} ); // Merge user options with defaults 995 fixedHeader = settings.selectorHeader ? document.querySelector( settings.selectorHeader ) : null; // Get the fixed header 996 headerHeight = getHeaderHeight( fixedHeader ); 997 998 // When a toggle is clicked, run the click handler 999 document.addEventListener( 'click', clickHandler, false ); 1000 1001 // Listen for hash changes 1002 root.addEventListener('hashchange', hashChangeHandler, false); 1003 1004 // If window is resized and there's a fixed header, recalculate its size 1005 if ( fixedHeader ) { 1006 root.addEventListener( 'resize', resizeThrottler, false ); 1007 } 1008 1009 }; 1010 1011 1012 // 1013 // Public APIs 1014 // 1015 1016 return smoothScroll; 1017 1018}); 1019 1020/* #END_OF_RESOURCE_FILE */
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.