vendor: 13,947 bytes, lines 1-184
1/*! easyPieChart */ 2!function(e,t){"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e)}):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}(this,function(e){var t=function(e,t){var n,a=document.createElement("canvas");e.appendChild(a),"object"==typeof G_vmlCanvasManager&&G_vmlCanvasManager.initElement(a);var i=a.getContext("2d");a.width=a.height=t.size;var r=1;window.devicePixelRatio>1&&(r=window.devicePixelRatio,a.style.width=a.style.height=[t.size,"px"].join(""),a.width=a.height=t.size*r,i.scale(r,r)),i.translate(t.size/2,t.size/2),i.rotate((-.5+t.rotate/180)*Math.PI);var o=(t.size-t.lineWidth)/2;t.scaleColor&&t.scaleLength&&(o-=t.scaleLength+2),Date.now=Date.now||function(){return+new Date};var s=function(e,t,n){n=Math.min(Math.max(-1,n||0),1);var a=0>=n?!0:!1;i.beginPath(),i.arc(0,0,o,0,2*Math.PI*n,a),i.strokeStyle=e,i.lineWidth=t,i.stroke()},d=function(){var e,n;i.lineWidth=1,i.fillStyle=t.scaleColor,i.save();for(var a=24;a>0;--a)a%6===0?(n=t.scaleLength,e=0):(n=.6*t.scaleLength,e=t.scaleLength-n),i.fillRect(-t.size/2+e,0,n,1),i.rotate(Math.PI/12);i.restore()},h=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}(),u=function(){t.scaleColor&&d(),t.trackColor&&s(t.trackColor,t.trackWidth||t.lineWidth,1)};this.getCanvas=function(){return a},this.getCtx=function(){return i},this.clear=function(){i.clearRect(t.size/-2,t.size/-2,t.size,t.size)},this.draw=function(e){t.scaleColor||t.trackColor?i.getImageData&&i.putImageData?n?i.putImageData(n,0,0):(u(),n=i.getImageData(0,0,t.size*r,t.size*r)):(this.clear(),u()):this.clear(),i.lineCap=t.lineCap;var a;a="function"==typeof t.barColor?t.barColor(e):t.barColor,s(a,t.lineWidth,e/100)}.bind(this),this.animate=function(e,n){var a=Date.now();t.onStart(e,n);var i=function(){var r=Math.min(Date.now()-a,t.animate.duration),o=t.easing(this,r,e,n-e,t.animate.duration);this.draw(o),t.onStep(e,n,o),r>=t.animate.duration?t.onStop(e,n):h(i)}.bind(this);h(i)}.bind(this)},n=function(e,n){var a={barColor:"#ef1e25",trackColor:"#f9f9f9",scaleColor:"#dfe0e0",scaleLength:5,lineCap:"round",lineWidth:3,trackWidth:void 0,size:110,rotate:0,animate:{duration:1e3,enabled:!0},easing:function(e,t,n,a,i){return t/=i/2,1>t?a/2*t*t+n:-a/2*(--t*(t-2)-1)+n},onStart:function(e,t){},onStep:function(e,t,n){},onStop:function(e,t){}};if("undefined"!=typeof t)a.renderer=t;else{if("undefined"==typeof SVGRenderer)throw new Error("Please load either the SVG- or the CanvasRenderer");a.renderer=SVGRenderer}var i={},r=0,o=function(){this.el=e,this.options=i;for(var t in a)a.hasOwnProperty(t)&&(i[t]=n&&"undefined"!=typeof n[t]?n[t]:a[t],"function"==typeof i[t]&&(i[t]=i[t].bind(this)));"string"==typeof i.easing&&"undefined"!=typeof jQuery&&jQuery.isFunction(jQuery.easing[i.easing])?i.easing=jQuery.easing[i.easing]:i.easing=a.easing,"number"==typeof i.animate&&(i.animate={duration:i.animate,enabled:!0}),"boolean"!=typeof i.animate||i.animate||(i.animate={duration:1e3,enabled:i.animate}),this.renderer=new i.renderer(e,i),this.renderer.draw(r),e.dataset&&e.dataset.percent?this.update(parseFloat(e.dataset.percent)):e.getAttribute&&e.getAttribute("data-percent")&&this.update(parseFloat(e.getAttribute("data-percent")))}.bind(this);this.update=function(e){return e=parseFloat(e),i.animate.enabled?this.renderer.animate(r,e):this.renderer.draw(e),r=e,this}.bind(this),this.disableAnimation=function(){return i.animate.enabled=!1,this},this.enableAnimation=function(){return i.animate.enabled=!0,this},o()};e.fn.easyPieChart=function(t){return this.each(function(){var a;e.data(this,"easyPieChart")||(a=e.extend({},t,e(this).data()),e.data(this,"easyPieChart",new n(this,a)))})}}); 3/*! 4 * Bootstrap v3.3.7 (http://getbootstrap.com) 5 * Copyright 2011-2017 Twitter, Inc. 6 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 7 */ 8 9/*! 10 * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=34a66cab5021c4a9c9dc053d9f6fa2c8) 11 * Config saved to config.json and https://gist.github.com/34a66cab5021c4a9c9dc053d9f6fa2c8 12 */ 13if ("undefined" == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery"); + function(t) { 14 "use strict"; 15 var e = t.fn.jquery.split(" ")[0].split("."); 16 if (e[0] < 2 && e[1] < 9 || 1 == e[0] && 9 == e[1] && e[2] < 1 || e[0] > 3) throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4") 17}(jQuery), + function(t) { 18 "use strict"; 19 20 function e(e) { 21 return this.each(function() { 22 var o = t(this), 23 n = o.data("bs.tooltip"), 24 s = "object" == typeof e && e; 25 !n && /destroy|hide/.test(e) || (n || o.data("bs.tooltip", n = new i(this, s)), "string" == typeof e && n[e]()) 26 }) 27 } 28 var i = function(t, e) { 29 this.type = null, this.options = null, this.enabled = null, this.timeout = null, this.hoverState = null, this.$element = null, this.inState = null, this.init("tooltip", t, e) 30 }; 31 i.VERSION = "3.3.7", i.TRANSITION_DURATION = 150, i.DEFAULTS = { 32 animation: !0, 33 placement: "top", 34 selector: !1, 35 template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', 36 trigger: "hover focus", 37 title: "", 38 delay: 0, 39 html: !1, 40 container: !1, 41 viewport: { 42 selector: "body", 43 padding: 0 44 } 45 }, i.prototype.init = function(e, i, o) { 46 if (this.enabled = !0, this.type = e, this.$element = t(i), this.options = this.getOptions(o), this.$viewport = this.options.viewport && t(t.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : this.options.viewport.selector || this.options.viewport), this.inState = { 47 click: !1, 48 hover: !1, 49 focus: !1 50 }, this.$element[0] instanceof document.constructor && !this.options.selector) throw new Error("`selector` option must be specified when initializing " + this.type + " on the window.document object!"); 51 for (var n = this.options.trigger.split(" "), s = n.length; s--;) { 52 var a = n[s]; 53 if ("click" == a) this.$element.on("click." + this.type, this.options.selector, t.proxy(this.toggle, this)); 54 else if ("manual" != a) { 55 var r = "hover" == a ? "mouseenter" : "focusin", 56 l = "hover" == a ? "mouseleave" : "focusout"; 57 this.$element.on(r + "." + this.type, this.options.selector, t.proxy(this.enter, this)), this.$element.on(l + "." + this.type, this.options.selector, t.proxy(this.leave, this)) 58 } 59 } 60 this.options.selector ? this._options = t.extend({}, this.options, { 61 trigger: "manual", 62 selector: "" 63 }) : this.fixTitle() 64 }, i.prototype.getDefaults = function() { 65 return i.DEFAULTS 66 }, i.prototype.getOptions = function(e) { 67 return e = t.extend({}, this.getDefaults(), this.$element.data(), e), e.delay && "number" == typeof e.delay && (e.delay = { 68 show: e.delay, 69 hide: e.delay 70 }), e 71 }, i.prototype.getDelegateOptions = function() { 72 var e = {}, 73 i = this.getDefaults(); 74 return this._options && t.each(this._options, function(t, o) { 75 i[t] != o && (e[t] = o) 76 }), e 77 }, i.prototype.enter = function(e) { 78 var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type); 79 return i || (i = new this.constructor(e.currentTarget, this.getDelegateOptions()), t(e.currentTarget).data("bs." + this.type, i)), e instanceof t.Event && (i.inState["focusin" == e.type ? "focus" : "hover"] = !0), i.tip().hasClass("in") || "in" == i.hoverState ? void(i.hoverState = "in") : (clearTimeout(i.timeout), i.hoverState = "in", i.options.delay && i.options.delay.show ? void(i.timeout = setTimeout(function() { 80 "in" == i.hoverState && i.show() 81 }, i.options.delay.show)) : i.show()) 82 }, i.prototype.isInStateTrue = function() { 83 for (var t in this.inState) 84 if (this.inState[t]) return !0; 85 return !1 86 }, i.prototype.leave = function(e) { 87 var i = e instanceof this.constructor ? e : t(e.currentTarget).data("bs." + this.type); 88 return i || (i = new this.constructor(e.currentTarget, this.getDelegateOptions()), t(e.currentTarget).data("bs." + this.type, i)), e instanceof t.Event && (i.inState["focusout" == e.type ? "focus" : "hover"] = !1), i.isInStateTrue() ? void 0 : (clearTimeout(i.timeout), i.hoverState = "out", i.options.delay && i.options.delay.hide ? void(i.timeout = setTimeout(function() { 89 "out" == i.hoverState && i.hide() 90 }, i.options.delay.hide)) : i.hide()) 91 }, i.prototype.show = function() { 92 var e = t.Event("show.bs." + this.type); 93 if (this.hasContent() && this.enabled) { 94 this.$element.trigger(e); 95 var o = t.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]); 96 if (e.isDefaultPrevented() || !o) return; 97 var n = this, 98 s = this.tip(), 99 a = this.getUID(this.type); 100 this.setContent(), s.attr("id", a), this.$element.attr("aria-describedby", a), this.options.animation && s.addClass("fade"); 101 var r = "function" == typeof this.options.placement ? this.options.placement.call(this, s[0], this.$element[0]) : this.options.placement, 102 l = /\s?auto?\s?/i, 103 p = l.test(r); 104 p && (r = r.replace(l, "") || "top"), s.detach().css({ 105 top: 0, 106 left: 0, 107 display: "block" 108 }).addClass(r).data("bs." + this.type, this), this.options.container ? s.appendTo(this.options.container) : s.insertAfter(this.$element), this.$element.trigger("inserted.bs." + this.type); 109 var h = this.getPosition(), 110 d = s[0].offsetWidth, 111 c = s[0].offsetHeight; 112 if (p) { 113 var f = r, 114 u = this.getPosition(this.$viewport); 115 r = "bottom" == r && h.bottom + c > u.bottom ? "top" : "top" == r && h.top - c < u.top ? "bottom" : "right" == r && h.right + d > u.width ? "left" : "left" == r && h.left - d < u.left ? "right" : r, s.removeClass(f).addClass(r) 116 } 117 var g = this.getCalculatedOffset(r, h, d, c); 118 this.applyPlacement(g, r); 119 var v = function() { 120 var t = n.hoverState; 121 n.$element.trigger("shown.bs." + n.type), n.hoverState = null, "out" == t && n.leave(n) 122 }; 123 t.support.transition && this.$tip.hasClass("fade") ? s.one("bsTransitionEnd", v).emulateTransitionEnd(i.TRANSITION_DURATION) : v() 124 } 125 }, i.prototype.applyPlacement = function(e, i) { 126 var o = this.tip(), 127 n = o[0].offsetWidth, 128 s = o[0].offsetHeight, 129 a = parseInt(o.css("margin-top"), 10), 130 r = parseInt(o.css("margin-left"), 10); 131 isNaN(a) && (a = 0), isNaN(r) && (r = 0), e.top += a, e.left += r, t.offset.setOffset(o[0], t.extend({ 132 using: function(t) { 133 o.css({ 134 top: Math.round(t.top), 135 left: Math.round(t.left) 136 }) 137 } 138 }, e), 0), o.addClass("in"); 139 var l = o[0].offsetWidth, 140 p = o[0].offsetHeight; 141 "top" == i && p != s && (e.top = e.top + s - p); 142 var h = this.getViewportAdjustedDelta(i, e, l, p); 143 h.left ? e.left += h.left : e.top += h.top; 144 var d = /top|bottom/.test(i), 145 c = d ? 2 * h.left - n + l : 2 * h.top - s + p, 146 f = d ? "offsetWidth" : "offsetHeight"; 147 o.offset(e), this.replaceArrow(c, o[0][f], d) 148 }, i.prototype.replaceArrow = function(t, e, i) { 149 this.arrow().css(i ? "left" : "top", 50 * (1 - t / e) + "%").css(i ? "top" : "left", "") 150 }, i.prototype.setContent = function() { 151 var t = this.tip(), 152 e = this.getTitle(); 153 t.find(".tooltip-inner")[this.options.html ? "html" : "text"](e), t.removeClass("fade in top bottom left right") 154 }, i.prototype.hide = function(e) { 155 function o() { 156 "in" != n.hoverState && s.detach(), n.$element && n.$element.removeAttr("aria-describedby").trigger("hidden.bs." + n.type), e && e() 157 } 158 var n = this, 159 s = t(this.$tip), 160 a = t.Event("hide.bs." + this.type); 161 return this.$element.trigger(a), a.isDefaultPrevented() ? void 0 : (s.removeClass("in"), t.support.transition && s.hasClass("fade") ? s.one("bsTransitionEnd", o).emulateTransitionEnd(i.TRANSITION_DURATION) : o(), this.hoverState = null, this) 162 }, i.prototype.fixTitle = function() { 163 var t = this.$element; 164 (t.attr("title") || "string" != typeof t.attr("data-original-title")) && t.attr("data-original-title", t.attr("title") || "").attr("title", "") 165 }, i.prototype.hasContent = function() { 166 return this.getTitle() 167 }, i.prototype.getPosition = function(e) { 168 e = e || this.$element; 169 var i = e[0], 170 o = "BODY" == i.tagName, 171 n = i.getBoundingClientRect(); 172 null == n.width && (n = t.extend({}, n, { 173 width: n.right - n.left, 174 height: n.bottom - n.top 175 })); 176 var s = window.SVGElement && i instanceof window.SVGElement, 177 a = o ? { 178 top: 0, 179 left: 0 180 } : s ? null : e.offset(), 181 r = { 182 scroll: o ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop() 183 }, 184 l = o ? {
vendor: 16,384 bytes, lines 185-539
185 width: t(window).width(), 186 height: t(window).height() 187 } : null; 188 return t.extend({}, n, r, l, a) 189 }, i.prototype.getCalculatedOffset = function(t, e, i, o) { 190 return "bottom" == t ? { 191 top: e.top + e.height, 192 left: e.left + e.width / 2 - i / 2 193 } : "top" == t ? { 194 top: e.top - o, 195 left: e.left + e.width / 2 - i / 2 196 } : "left" == t ? { 197 top: e.top + e.height / 2 - o / 2, 198 left: e.left - i 199 } : { 200 top: e.top + e.height / 2 - o / 2, 201 left: e.left + e.width 202 } 203 }, i.prototype.getViewportAdjustedDelta = function(t, e, i, o) { 204 var n = { 205 top: 0, 206 left: 0 207 }; 208 if (!this.$viewport) return n; 209 var s = this.options.viewport && this.options.viewport.padding || 0, 210 a = this.getPosition(this.$viewport); 211 if (/right|left/.test(t)) { 212 var r = e.top - s - a.scroll, 213 l = e.top + s - a.scroll + o; 214 r < a.top ? n.top = a.top - r : l > a.top + a.height && (n.top = a.top + a.height - l) 215 } else { 216 var p = e.left - s, 217 h = e.left + s + i; 218 p < a.left ? n.left = a.left - p : h > a.right && (n.left = a.left + a.width - h) 219 } 220 return n 221 }, i.prototype.getTitle = function() { 222 var t, e = this.$element, 223 i = this.options; 224 return t = e.attr("data-original-title") || ("function" == typeof i.title ? i.title.call(e[0]) : i.title) 225 }, i.prototype.getUID = function(t) { 226 do t += ~~(1e6 * Math.random()); while (document.getElementById(t)); 227 return t 228 }, i.prototype.tip = function() { 229 if (!this.$tip && (this.$tip = t(this.options.template), 1 != this.$tip.length)) throw new Error(this.type + " `template` option must consist of exactly 1 top-level element!"); 230 return this.$tip 231 }, i.prototype.arrow = function() { 232 return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow") 233 }, i.prototype.enable = function() { 234 this.enabled = !0 235 }, i.prototype.disable = function() { 236 this.enabled = !1 237 }, i.prototype.toggleEnabled = function() { 238 this.enabled = !this.enabled 239 }, i.prototype.toggle = function(e) { 240 var i = this; 241 e && (i = t(e.currentTarget).data("bs." + this.type), i || (i = new this.constructor(e.currentTarget, this.getDelegateOptions()), t(e.currentTarget).data("bs." + this.type, i))), e ? (i.inState.click = !i.inState.click, i.isInStateTrue() ? i.enter(i) : i.leave(i)) : i.tip().hasClass("in") ? i.leave(i) : i.enter(i) 242 }, i.prototype.destroy = function() { 243 var t = this; 244 clearTimeout(this.timeout), this.hide(function() { 245 t.$element.off("." + t.type).removeData("bs." + t.type), t.$tip && t.$tip.detach(), t.$tip = null, t.$arrow = null, t.$viewport = null, t.$element = null 246 }) 247 }; 248 var o = t.fn.tooltip; 249 t.fn.tooltip = e, t.fn.tooltip.Constructor = i, t.fn.tooltip.noConflict = function() { 250 return t.fn.tooltip = o, this 251 } 252}(jQuery), + function(t) { 253 "use strict"; 254 255 function e(e) { 256 return this.each(function() { 257 var o = t(this), 258 n = o.data("bs.tab"); 259 n || o.data("bs.tab", n = new i(this)), "string" == typeof e && n[e]() 260 }) 261 } 262 var i = function(e) { 263 this.element = t(e) 264 }; 265 i.VERSION = "3.3.7", i.TRANSITION_DURATION = 150, i.prototype.show = function() { 266 var e = this.element, 267 i = e.closest("ul:not(.dropdown-menu)"), 268 o = e.data("target"); 269 if (o || (o = e.attr("href"), o = o && o.replace(/.*(?=#[^\s]*$)/, "")), !e.parent("li").hasClass("active")) { 270 var n = i.find(".active:last a"), 271 s = t.Event("hide.bs.tab", { 272 relatedTarget: e[0] 273 }), 274 a = t.Event("show.bs.tab", { 275 relatedTarget: n[0] 276 }); 277 if (n.trigger(s), e.trigger(a), !a.isDefaultPrevented() && !s.isDefaultPrevented()) { 278 var r = t(o); 279 this.activate(e.closest("li"), i), this.activate(r, r.parent(), function() { 280 n.trigger({ 281 type: "hidden.bs.tab", 282 relatedTarget: e[0] 283 }), e.trigger({ 284 type: "shown.bs.tab", 285 relatedTarget: n[0] 286 }) 287 }) 288 } 289 } 290 }, i.prototype.activate = function(e, o, n) { 291 function s() { 292 a.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !1), e.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded", !0), r ? (e[0].offsetWidth, e.addClass("in")) : e.removeClass("fade"), e.parent(".dropdown-menu").length && e.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", !0), n && n() 293 } 294 var a = o.find("> .active"), 295 r = n && t.support.transition && (a.length && a.hasClass("fade") || !!o.find("> .fade").length); 296 a.length && r ? a.one("bsTransitionEnd", s).emulateTransitionEnd(i.TRANSITION_DURATION) : s(), a.removeClass("in") 297 }; 298 var o = t.fn.tab; 299 t.fn.tab = e, t.fn.tab.Constructor = i, t.fn.tab.noConflict = function() { 300 return t.fn.tab = o, this 301 }; 302 var n = function(i) { 303 i.preventDefault(), e.call(t(this), "show") 304 }; 305 t(document).on("click.bs.tab.data-api", '[data-toggle="tab"]', n).on("click.bs.tab.data-api", '[data-toggle="pill"]', n) 306}(jQuery), + function(t) { 307 "use strict"; 308 309 function e(e) { 310 var i, o = e.attr("data-target") || (i = e.attr("href")) && i.replace(/.*(?=#[^\s]+$)/, ""); 311 return t(o) 312 } 313 314 function i(e) { 315 return this.each(function() { 316 var i = t(this), 317 n = i.data("bs.collapse"), 318 s = t.extend({}, o.DEFAULTS, i.data(), "object" == typeof e && e); 319 !n && s.toggle && /show|hide/.test(e) && (s.toggle = !1), n || i.data("bs.collapse", n = new o(this, s)), "string" == typeof e && n[e]() 320 }) 321 } 322 var o = function(e, i) { 323 this.$element = t(e), this.options = t.extend({}, o.DEFAULTS, i), this.$trigger = t('[data-toggle="collapse"][href="#' + e.id + '"],[data-toggle="collapse"][data-target="#' + e.id + '"]'), this.transitioning = null, this.options.parent ? this.$parent = this.getParent() : this.addAriaAndCollapsedClass(this.$element, this.$trigger), this.options.toggle && this.toggle() 324 }; 325 o.VERSION = "3.3.7", o.TRANSITION_DURATION = 350, o.DEFAULTS = { 326 toggle: !0 327 }, o.prototype.dimension = function() { 328 var t = this.$element.hasClass("width"); 329 return t ? "width" : "height" 330 }, o.prototype.show = function() { 331 if (!this.transitioning && !this.$element.hasClass("in")) { 332 var e, n = this.$parent && this.$parent.children(".panel").children(".in, .collapsing"); 333 if (!(n && n.length && (e = n.data("bs.collapse"), e && e.transitioning))) { 334 var s = t.Event("show.bs.collapse"); 335 if (this.$element.trigger(s), !s.isDefaultPrevented()) { 336 n && n.length && (i.call(n, "hide"), e || n.data("bs.collapse", null)); 337 var a = this.dimension(); 338 this.$element.removeClass("collapse").addClass("collapsing")[a](0).attr("aria-expanded", !0), this.$trigger.removeClass("collapsed").attr("aria-expanded", !0), this.transitioning = 1; 339 var r = function() { 340 this.$element.removeClass("collapsing").addClass("collapse in")[a](""), this.transitioning = 0, this.$element.trigger("shown.bs.collapse") 341 }; 342 if (!t.support.transition) return r.call(this); 343 var l = t.camelCase(["scroll", a].join("-")); 344 this.$element.one("bsTransitionEnd", t.proxy(r, this)).emulateTransitionEnd(o.TRANSITION_DURATION)[a](this.$element[0][l]) 345 } 346 } 347 } 348 }, o.prototype.hide = function() { 349 if (!this.transitioning && this.$element.hasClass("in")) { 350 var e = t.Event("hide.bs.collapse"); 351 if (this.$element.trigger(e), !e.isDefaultPrevented()) { 352 var i = this.dimension(); 353 this.$element[i](this.$element[i]())[0].offsetHeight, this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", !1), this.$trigger.addClass("collapsed").attr("aria-expanded", !1), this.transitioning = 1; 354 var n = function() { 355 this.transitioning = 0, this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse") 356 }; 357 return t.support.transition ? void this.$element[i](0).one("bsTransitionEnd", t.proxy(n, this)).emulateTransitionEnd(o.TRANSITION_DURATION) : n.call(this) 358 } 359 } 360 }, o.prototype.toggle = function() { 361 this[this.$element.hasClass("in") ? "hide" : "show"]() 362 }, o.prototype.getParent = function() { 363 return t(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each(t.proxy(function(i, o) { 364 var n = t(o); 365 this.addAriaAndCollapsedClass(e(n), n) 366 }, this)).end() 367 }, o.prototype.addAriaAndCollapsedClass = function(t, e) { 368 var i = t.hasClass("in"); 369 t.attr("aria-expanded", i), e.toggleClass("collapsed", !i).attr("aria-expanded", i) 370 }; 371 var n = t.fn.collapse; 372 t.fn.collapse = i, t.fn.collapse.Constructor = o, t.fn.collapse.noConflict = function() { 373 return t.fn.collapse = n, this 374 }, t(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function(o) { 375 var n = t(this); 376 n.attr("data-target") || o.preventDefault(); 377 var s = e(n), 378 a = s.data("bs.collapse"), 379 r = a ? "toggle" : n.data(); 380 i.call(s, r) 381 }) 382}(jQuery), + function(t) { 383 "use strict"; 384 385 function e() { 386 var t = document.createElement("bootstrap"), 387 e = { 388 WebkitTransition: "webkitTransitionEnd", 389 MozTransition: "transitionend", 390 OTransition: "oTransitionEnd otransitionend", 391 transition: "transitionend" 392 }; 393 for (var i in e) 394 if (void 0 !== t.style[i]) return { 395 end: e[i] 396 }; 397 return !1 398 } 399 t.fn.emulateTransitionEnd = function(e) { 400 var i = !1, 401 o = this; 402 t(this).one("bsTransitionEnd", function() { 403 i = !0 404 }); 405 var n = function() { 406 i || t(o).trigger(t.support.transition.end) 407 }; 408 return setTimeout(n, e), this 409 }, t(function() { 410 t.support.transition = e(), t.support.transition && (t.event.special.bsTransitionEnd = { 411 bindType: t.support.transition.end, 412 delegateType: t.support.transition.end, 413 handle: function(e) { 414 return t(e.target).is(this) ? e.handleObj.handler.apply(this, arguments) : void 0 415 } 416 }) 417 }) 418}(jQuery); 419/*easing */ 420jQuery.easing["jswing"] = jQuery.easing["swing"]; 421jQuery.extend(jQuery.easing, { 422 def: "easeOutQuad", 423 swing: function(e, t, n, r, i) { 424 return jQuery.easing[jQuery.easing.def](e, t, n, r, i) 425 }, 426 easeInQuad: function(e, t, n, r, i) { 427 return r * (t /= i) * t + n 428 }, 429 easeOutQuad: function(e, t, n, r, i) { 430 return -r * (t /= i) * (t - 2) + n 431 }, 432 easeInOutQuad: function(e, t, n, r, i) { 433 if ((t /= i / 2) < 1) return r / 2 * t * t + n; 434 return -r / 2 * (--t * (t - 2) - 1) + n 435 }, 436 easeInCubic: function(e, t, n, r, i) { 437 return r * (t /= i) * t * t + n 438 }, 439 easeOutCubic: function(e, t, n, r, i) { 440 return r * ((t = t / i - 1) * t * t + 1) + n 441 }, 442 easeInOutCubic: function(e, t, n, r, i) { 443 if ((t /= i / 2) < 1) return r / 2 * t * t * t + n; 444 return r / 2 * ((t -= 2) * t * t + 2) + n 445 }, 446 easeInQuart: function(e, t, n, r, i) { 447 return r * (t /= i) * t * t * t + n 448 }, 449 easeOutQuart: function(e, t, n, r, i) { 450 return -r * ((t = t / i - 1) * t * t * t - 1) + n 451 }, 452 easeInOutQuart: function(e, t, n, r, i) { 453 if ((t /= i / 2) < 1) return r / 2 * t * t * t * t + n; 454 return -r / 2 * ((t -= 2) * t * t * t - 2) + n 455 }, 456 easeInQuint: function(e, t, n, r, i) { 457 return r * (t /= i) * t * t * t * t + n 458 }, 459 easeOutQuint: function(e, t, n, r, i) { 460 return r * ((t = t / i - 1) * t * t * t * t + 1) + n 461 }, 462 easeInOutQuint: function(e, t, n, r, i) { 463 if ((t /= i / 2) < 1) return r / 2 * t * t * t * t * t + n; 464 return r / 2 * ((t -= 2) * t * t * t * t + 2) + n 465 }, 466 easeInSine: function(e, t, n, r, i) { 467 return -r * Math.cos(t / i * (Math.PI / 2)) + r + n 468 }, 469 easeOutSine: function(e, t, n, r, i) { 470 return r * Math.sin(t / i * (Math.PI / 2)) + n 471 }, 472 easeInOutSine: function(e, t, n, r, i) { 473 return -r / 2 * (Math.cos(Math.PI * t / i) - 1) + n 474 }, 475 easeInExpo: function(e, t, n, r, i) { 476 return t == 0 ? n : r * Math.pow(2, 10 * (t / i - 1)) + n 477 }, 478 easeOutExpo: function(e, t, n, r, i) { 479 return t == i ? n + r : r * (-Math.pow(2, -10 * t / i) + 1) + n 480 }, 481 easeInOutExpo: function(e, t, n, r, i) { 482 if (t == 0) return n; 483 if (t == i) return n + r; 484 if ((t /= i / 2) < 1) return r / 2 * Math.pow(2, 10 * (t - 1)) + n; 485 return r / 2 * (-Math.pow(2, -10 * --t) + 2) + n 486 }, 487 easeInCirc: function(e, t, n, r, i) { 488 return -r * (Math.sqrt(1 - (t /= i) * t) - 1) + n 489 }, 490 easeOutCirc: function(e, t, n, r, i) { 491 return r * Math.sqrt(1 - (t = t / i - 1) * t) + n 492 }, 493 easeInOutCirc: function(e, t, n, r, i) { 494 if ((t /= i / 2) < 1) return -r / 2 * (Math.sqrt(1 - t * t) - 1) + n; 495 return r / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + n 496 }, 497 easeInElastic: function(e, t, n, r, i) { 498 var s = 1.70158; 499 var o = 0; 500 var u = r; 501 if (t == 0) return n; 502 if ((t /= i) == 1) return n + r; 503 if (!o) o = i * .3; 504 if (u < Math.abs(r)) { 505 u = r; 506 var s = o / 4 507 } else var s = o / (2 * Math.PI) * Math.asin(r / u); 508 return -(u * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * i - s) * 2 * Math.PI / o)) + n 509 }, 510 easeOutElastic: function(e, t, n, r, i) { 511 var s = 1.70158; 512 var o = 0; 513 var u = r; 514 if (t == 0) return n; 515 if ((t /= i) == 1) return n + r; 516 if (!o) o = i * .3; 517 if (u < Math.abs(r)) { 518 u = r; 519 var s = o / 4 520 } else var s = o / (2 * Math.PI) * Math.asin(r / u); 521 return u * Math.pow(2, -10 * t) * Math.sin((t * i - s) * 2 * Math.PI / o) + r + n 522 }, 523 easeInOutElastic: function(e, t, n, r, i) { 524 var s = 1.70158; 525 var o = 0; 526 var u = r; 527 if (t == 0) return n; 528 if ((t /= i / 2) == 2) return n + r; 529 if (!o) o = i * .3 * 1.5; 530 if (u < Math.abs(r)) { 531 u = r; 532 var s = o / 4 533 } else var s = o / (2 * Math.PI) * Math.asin(r / u); 534 if (t < 1) return -.5 * u * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * i - s) * 2 * Math.PI / o) + n; 535 return u * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * i - s) * 2 * Math.PI / o) * .5 + r + n 536 }, 537 easeInBack: function(e, t, n, r, i, s) { 538 if (s == undefined) s = 1.70158; 539 return r * (t /=
539 i) * t * ((s + 1) * t - s) + n 540 }, 541 easeOutBack: function(e, t, n, r, i, s) { 542 if (s == undefined) s = 1.70158; 543 return r * ((t = t / i - 1) * t * ((s + 1) * t + s) + 1) + n 544 }, 545 easeInOutBack: function(e, t, n, r, i, s) { 546 if (s == undefined) s = 1.70158; 547 if ((t /= i / 2) < 1) return r / 2 * t * t * (((s *= 1.525) + 1) * t - s) + n; 548 return r / 2 * ((t -= 2) * t * (((s *= 1.525) + 1) * t + s) + 2) + n 549 }, 550 easeInBounce: function(e, t, n, r, i) { 551 return r - jQuery.easing.easeOutBounce(e, i - t, 0, r, i) + n 552 }, 553 easeOutBounce: function(e, t, n, r, i) { 554 if ((t /= i) < 1 / 2.75) { 555 return r * 7.5625 * t * t + n 556 } else if (t < 2 / 2.75) { 557 return r * (7.5625 * (t -= 1.5 / 2.75) * t + .75) + n 558 } else if (t < 2.5 / 2.75) { 559 return r * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) + n 560 } else { 561 return r * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) + n 562 } 563 }, 564 easeInOutBounce: function(e, t, n, r, i) { 565 if (t < i / 2) return jQuery.easing.easeInBounce(e, t * 2, 0, r, i) * .5 + n; 566 return jQuery.easing.easeOutBounce(e, t * 2 - i, 0, r, i) * .5 + r * .5 + n 567 } 568 }) 569/*! 570 * justifiedGallery - v3.7.0 571 * http://miromannino.github.io/Justified-Gallery/ 572 * Copyright (c) 2018 Miro Mannino 573 * Licensed under the MIT license. 574 */ 575!(function (factory) { 576 if (typeof define === 'function' && define.amd) { 577 // AMD. Register as an anonymous module. 578 define(['jquery'], factory); 579 } else if (typeof module === 'object' && module.exports) { 580 // Node/CommonJS 581 module.exports = function( root, jQuery ) { 582 if ( jQuery === undefined ) { 583 // require('jQuery') returns a factory that requires window to 584 // build a jQuery instance, we normalize how we use modules 585 // that require this pattern but the window provided is a noop 586 // if it's defined (how jquery works) 587 if ( typeof window !== 'undefined' ) { 588 jQuery = require('jquery'); 589 } 590 else { 591 jQuery = require('jquery')(root); 592 } 593 } 594 factory(jQuery); 595 return jQuery; 596 }; 597 } else { 598 // Browser globals 599 factory(jQuery); 600 } 601}(function ($) { 602 603 /** 604 * Justified Gallery controller constructor 605 * 606 * @param $gallery the gallery to build 607 * @param settings the settings (the defaults are in JustifiedGallery.defaults) 608 * @constructor 609 */ 610 var JustifiedGallery = function ($gallery, settings) { 611 612 this.settings = settings; 613 this.checkSettings(); 614 615 this.imgAnalyzerTimeout = null; 616 this.entries = null; 617 this.buildingRow = { 618 entriesBuff : [], 619 width : 0, 620 height : 0, 621 aspectRatio : 0 622 }; 623 this.lastFetchedEntry = null; 624 this.lastAnalyzedIndex = -1; 625 this.yield = { 626 every : 2, // do a flush every n flushes (must be greater than 1) 627 flushed : 0 // flushed rows without a yield 628 }; 629 this.border = settings.border >= 0 ? settings.border : settings.margins; 630 this.maxRowHeight = this.retrieveMaxRowHeight(); 631 this.suffixRanges = this.retrieveSuffixRanges(); 632 this.offY = this.border; 633 this.rows = 0; 634 this.spinner = { 635 phase : 0, 636 timeSlot : 150, 637 $el : $('<div class="spinner"><span></span><span></span><span></span></div>'), 638 intervalId : null 639 }; 640 this.scrollBarOn = false; 641 this.checkWidthIntervalId = null; 642 this.galleryWidth = $gallery.width(); 643 this.$gallery = $gallery; 644 645 }; 646 647 /** @returns {String} the best suffix given the width and the height */ 648 JustifiedGallery.prototype.getSuffix = function (width, height) { 649 var longestSide, i; 650 longestSide = (width > height) ? width : height; 651 for (i = 0; i < this.suffixRanges.length; i++) { 652 if (longestSide <= this.suffixRanges[i]) { 653 return this.settings.sizeRangeSuffixes[this.suffixRanges[i]]; 654 } 655 } 656 return this.settings.sizeRangeSuffixes[this.suffixRanges[i - 1]]; 657 }; 658 659 /** 660 * Remove the suffix from the string 661 * 662 * @returns {string} a new string without the suffix 663 */ 664 JustifiedGallery.prototype.removeSuffix = function (str, suffix
vendor: 15,621 bytes, lines 664-1088
664) { 665 return str.substring(0, str.length - suffix.length); 666 }; 667 668 /** 669 * @returns {boolean} a boolean to say if the suffix is contained in the str or not 670 */ 671 JustifiedGallery.prototype.endsWith = function (str, suffix) { 672 return str.indexOf(suffix, str.length - suffix.length) !== -1; 673 }; 674 675 /** 676 * Get the used suffix of a particular url 677 * 678 * @param str 679 * @returns {String} return the used suffix 680 */ 681 JustifiedGallery.prototype.getUsedSuffix = function (str) { 682 for (var si in this.settings.sizeRangeSuffixes) { 683 if (this.settings.sizeRangeSuffixes.hasOwnProperty(si)) { 684 if (this.settings.sizeRangeSuffixes[si].length === 0) continue; 685 if (this.endsWith(str, this.settings.sizeRangeSuffixes[si])) return this.settings.sizeRangeSuffixes[si]; 686 } 687 } 688 return ''; 689 }; 690 691 /** 692 * Given an image src, with the width and the height, returns the new image src with the 693 * best suffix to show the best quality thumbnail. 694 * 695 * @returns {String} the suffix to use 696 */ 697 JustifiedGallery.prototype.newSrc = function (imageSrc, imgWidth, imgHeight, image) { 698 var newImageSrc; 699 700 if (this.settings.thumbnailPath) { 701 newImageSrc = this.settings.thumbnailPath(imageSrc, imgWidth, imgHeight, image); 702 } else { 703 var matchRes = imageSrc.match(this.settings.extension); 704 var ext = (matchRes !== null) ? matchRes[0] : ''; 705 newImageSrc = imageSrc.replace(this.settings.extension, ''); 706 newImageSrc = this.removeSuffix(newImageSrc, this.getUsedSuffix(newImageSrc)); 707 newImageSrc += this.getSuffix(imgWidth, imgHeight) + ext; 708 } 709 710 return newImageSrc; 711 }; 712 713 /** 714 * Shows the images that is in the given entry 715 * 716 * @param $entry the entry 717 * @param callback the callback that is called when the show animation is finished 718 */ 719 JustifiedGallery.prototype.showImg = function ($entry, callback) { 720 if (this.settings.cssAnimation) { 721 $entry.addClass('entry-visible'); 722 if (callback) callback(); 723 } else { 724 $entry.stop().fadeTo(this.settings.imagesAnimationDuration, 1.0, callback); 725 $entry.find(this.settings.imgSelector).stop().fadeTo(this.settings.imagesAnimationDuration, 1.0, callback); 726 } 727 }; 728 729 /** 730 * Extract the image src form the image, looking from the 'safe-src', and if it can't be found, from the 731 * 'src' attribute. It saves in the image data the 'jg.originalSrc' field, with the extracted src. 732 * 733 * @param $image the image to analyze 734 * @returns {String} the extracted src 735 */ 736 JustifiedGallery.prototype.extractImgSrcFromImage = function ($image) { 737 var imageSrc = (typeof $image.data('safe-src') !== 'undefined') ? $image.data('safe-src') : $image.attr('src'); 738 $image.data('jg.originalSrc', imageSrc); 739 return imageSrc; 740 }; 741 742 /** @returns {jQuery} the image in the given entry */ 743 JustifiedGallery.prototype.imgFromEntry = function ($entry) { 744 var $img = $entry.find(this.settings.imgSelector); 745 return $img.length === 0 ? null : $img; 746 }; 747 748 /** @returns {jQuery} the caption in the given entry */ 749 JustifiedGallery.prototype.captionFromEntry = function ($entry) { 750 var $caption = $entry.find('> .caption'); 751 return $caption.length === 0 ? null : $caption; 752 }; 753 754 /** 755 * Display the entry 756 * 757 * @param {jQuery} $entry the entry to display 758 * @param {int} x the x position where the entry must be positioned 759 * @param y the y position where the entry must be positioned 760 * @param imgWidth the image width 761 * @param imgHeight the image height 762 * @param rowHeight the row height of the row that owns the entry 763 */ 764 JustifiedGallery.prototype.displayEntry = function ($entry, x, y, imgWidth, imgHeight, rowHeight) { 765 $entry.width(imgWidth); 766 $entry.height(rowHeight); 767 $entry.css('top', y); 768 $entry.css('left', x); 769 770 var $image = this.imgFromEntry($entry); 771 if ($image !== null) { 772 $image.css('width', imgWidth); 773 $image.css('height', imgHeight); 774 $image.css('margin-left', - imgWidth / 2); 775 $image.css('margin-top', - imgHeight / 2); 776 777 // Image reloading for an high quality of thumbnails 778 var imageSrc = $image.attr('src'); 779 var newImageSrc = this.newSrc(imageSrc, imgWidth, imgHeight, $image[0]); 780 781 $image.one('error', function () { 782 $image.attr('src', $image.data('jg.originalSrc')); //revert to the original thumbnail, we got it. 783 }); 784 785 var loadNewImage = function () { 786 if (imageSrc !== newImageSrc) { //load the new image after the fadeIn 787 $image.attr('src', newImageSrc); 788 } 789 }; 790 791 if ($entry.data('jg.loaded') === 'skipped') { 792 this.onImageEvent(imageSrc, $.proxy(function() { 793 this.showImg($entry, loadNewImage); 794 $entry.data('jg.loaded', true); 795 }, this)); 796 } else { 797 this.showImg($entry, loadNewImage); 798 } 799 800 } else { 801 this.showImg($entry); 802 } 803 804 this.displayEntryCaption($entry); 805 }; 806 807 /** 808 * Display the entry caption. If the caption element doesn't exists, it creates the caption using the 'alt' 809 * or the 'title' attributes. 810 * 811 * @param {jQuery} $entry the entry to process 812 */ 813 JustifiedGallery.prototype.displayEntryCaption = function ($entry) { 814 var $image = this.imgFromEntry($entry); 815 if ($image !== null && this.settings.captions) { 816 var $imgCaption = this.captionFromEntry($entry); 817 818 // Create it if it doesn't exists 819 if ($imgCaption === null) { 820 var caption = $image.attr('alt'); 821 if (!this.isValidCaption(caption)) caption = $entry.attr('title'); 822 if (this.isValidCaption(caption)) { // Create only we found something 823 $imgCaption = $('<div class="caption">' + caption + '</div>'); 824 $entry.append($imgCaption); 825 $entry.data('jg.createdCaption', true); 826 } 827 } 828 829 // Create events (we check again the $imgCaption because it can be still inexistent) 830 if ($imgCaption !== null) { 831 if (!this.settings.cssAnimation) $imgCaption.stop().fadeTo(0, this.settings.captionSettings.nonVisibleOpacity); 832 this.addCaptionEventsHandlers($entry); 833 } 834 } else { 835 this.removeCaptionEventsHandlers($entry); 836 } 837 }; 838 839 /** 840 * Validates the caption 841 * 842 * @param caption The caption that should be validated 843 * @return {boolean} Validation result 844 */ 845 JustifiedGallery.prototype.isValidCaption = function (caption) { 846 return (typeof caption !== 'undefined' && caption.length > 0); 847 }; 848 849 /** 850 * The callback for the event 'mouseenter'. It assumes that the event currentTarget is an entry. 851 * It shows the caption using jQuery (or using CSS if it is configured so) 852 * 853 * @param {Event} eventObject the event object 854 */ 855 JustifiedGallery.prototype.onEntryMouseEnterForCaption = function (eventObject) { 856 var $caption = this.captionFromEntry($(eventObject.currentTarget)); 857 if (this.settings.cssAnimation) { 858 $caption.addClass('caption-visible').removeClass('caption-hidden'); 859 } else { 860 $caption.stop().fadeTo(this.settings.captionSettings.animationDuration, 861 this.settings.captionSettings.visibleOpacity); 862 } 863 }; 864 865 /** 866 * The callback for the event 'mouseleave'. It assumes that the event currentTarget is an entry. 867 * It hides the caption using jQuery (or using CSS if it is configured so) 868 * 869 * @param {Event} eventObject the event object 870 */ 871 JustifiedGallery.prototype.onEntryMouseLeaveForCaption = function (eventObject) { 872 var $caption = this.captionFromEntry($(eventObject.currentTarget)); 873 if (this.settings.cssAnimation) { 874 $caption.removeClass('caption-visible').removeClass('caption-hidden'); 875 } else { 876 $caption.stop().fadeTo(this.settings.captionSettings.animationDuration, 877 this.settings.captionSettings.nonVisibleOpacity); 878 } 879 }; 880 881 /** 882 * Add the handlers of the entry for the caption 883 * 884 * @param $entry the entry to modify 885 */ 886 JustifiedGallery.prototype.addCaptionEventsHandlers = function ($entry) { 887 var captionMouseEvents = $entry.data('jg.captionMouseEvents'); 888 if (typeof captionMouseEvents === 'undefined') { 889 captionMouseEvents = { 890 mouseenter: $.proxy(this.onEntryMouseEnterForCaption, this), 891 mouseleave: $.proxy(this.onEntryMouseLeaveForCaption, this) 892 }; 893 $entry.on('mouseenter', undefined, undefined, captionMouseEvents.mouseenter); 894 $entry.on('mouseleave', undefined, undefined, captionMouseEvents.mouseleave); 895 $entry.data('jg.captionMouseEvents', captionMouseEvents); 896 } 897 }; 898 899 /** 900 * Remove the handlers of the entry for the caption 901 * 902 * @param $entry the entry to modify 903 */ 904 JustifiedGallery.prototype.removeCaptionEventsHandlers = function ($entry) { 905 var captionMouseEvents = $entry.data('jg.captionMouseEvents'); 906 if (typeof captionMouseEvents !== 'undefined') { 907 $entry.off('mouseenter', undefined, captionMouseEvents.mouseenter); 908 $entry.off('mouseleave', undefined, captionMouseEvents.mouseleave); 909 $entry.removeData('jg.captionMouseEvents'); 910 } 911 }; 912 913 /** 914 * Clear the building row data to be used for a new row 915 */ 916 JustifiedGallery.prototype.clearBuildingRow = function () { 917 this.buildingRow.entriesBuff = []; 918 this.buildingRow.aspectRatio = 0; 919 this.buildingRow.width = 0; 920 }; 921 922 /** 923 * Justify the building row, preparing it to 924 * 925 * @param isLastRow 926 * @returns a boolean to know if the row has been justified or not 927 */ 928 JustifiedGallery.prototype.prepareBuildingRow = function (isLastRow) { 929 var i, $entry, imgAspectRatio, newImgW, newImgH, justify = true; 930 var minHeight = 0; 931 var availableWidth = this.galleryWidth - 2 * this.border - ( 932 (this.buildingRow.entriesBuff.length - 1) * this.settings.margins); 933 var rowHeight = availableWidth / this.buildingRow.aspectRatio; 934 var defaultRowHeight = this.settings.rowHeight; 935 var justifiable = this.buildingRow.width / availableWidth > this.settings.justifyThreshold; 936 937 //Skip the last row if we can't justify it and the lastRow == 'hide' 938 if (isLastRow && this.settings.lastRow === 'hide' && !justifiable) { 939 for (i = 0; i < this.buildingRow.entriesBuff.length; i++) { 940 $entry = this.buildingRow.entriesBuff[i]; 941 if (this.settings.cssAnimation) 942 $entry.removeClass('entry-visible'); 943 else { 944 $entry.stop().fadeTo(0, 0.1); 945 $entry.find('> img, > a > img').fadeTo(0, 0); 946 } 947 } 948 return -1; 949 } 950 951 952 953 // With lastRow = nojustify, justify if is justificable (the images will not become too big) 954 if (isLastRow && !justifiable && this.settings.lastRow !== 'justify' && this.settings.lastRow !== 'hide') { 955 justify = false; 956 957 if (this.rows > 0) { 958 defaultRowHeight = (this.offY - this.border - this.settings.margins * this.rows) / this.rows; 959 justify = defaultRowHeight * this.buildingRow.aspectRatio / availableWidth > this.settings.justifyThreshold; 960 } 961 } 962 963 for (i = 0; i < this.buildingRow.entriesBuff.length; i++) { 964 $entry = this.buildingRow.entriesBuff[i]; 965 imgAspectRatio = $entry.data('jg.width') / $entry.data('jg.height'); 966 967 if (justify) { 968 newImgW = (i === this.buildingRow.entriesBuff.length - 1) ? availableWidth : rowHeight * imgAspectRatio; 969 newImgH = rowHeight; 970 } else { 971 newImgW = defaultRowHeight * imgAspectRatio; 972 newImgH = defaultRowHeight; 973 } 974 975 availableWidth -= Math.round(newImgW); 976 $entry.data('jg.jwidth', Math.round(newImgW)); 977 $entry.data('jg.jheight', Math.ceil(newImgH)); 978 if (i === 0 || minHeight > newImgH) minHeight = newImgH; 979 } 980 981 this.buildingRow.height = minHeight; 982 return justify; 983 }; 984 985 /** 986 * Flush a row: justify it, modify the gallery height accordingly to the row height 987 * 988 * @param isLastRow 989 */ 990 JustifiedGallery.prototype.flushRow = function (isLastRow) { 991 var settings = this.settings; 992 var $entry, buildingRowRes, offX = this.border, i; 993 994 buildingRowRes = this.prepareBuildingRow(isLastRow); 995 if (isLastRow && settings.lastRow === 'hide' && buildingRowRes === -1) { 996 this.clearBuildingRow(); 997 return; 998 } 999 1000 if(this.maxRowHeight) { 1001 if(this.maxRowHeight < this.buildingRow.height) this.buildingRow.height = this.maxRowHeight; 1002 } 1003 1004 //Align last (unjustified) row 1005 if (isLastRow && (settings.lastRow === 'center' || settings.lastRow === 'right')) { 1006 var availableWidth = this.galleryWidth - 2 * this.border - (this.buildingRow.entriesBuff.length - 1) * settings.margins; 1007 1008 for (i = 0; i < this.buildingRow.entriesBuff.length; i++) { 1009 $entry = this.buildingRow.entriesBuff[i]; 1010 availableWidth -= $entry.data('jg.jwidth'); 1011 } 1012 1013 if (settings.lastRow === 'center') 1014 offX += availableWidth / 2; 1015 else if (settings.lastRow === 'right') 1016 offX += availableWidth; 1017 } 1018 1019 var lastEntryIdx = this.buildingRow.entriesBuff.length - 1; 1020 for (i = 0; i <= lastEntryIdx; i++) { 1021 $entry = this.buildingRow.entriesBuff[ this.settings.rtl ? lastEntryIdx - i : i ]; 1022 this.displayEntry($entry, offX, this.offY, $entry.data('jg.jwidth'), $entry.data('jg.jheight'), this.buildingRow.height); 1023 offX += $entry.data('jg.jwidth') + settings.margins; 1024 } 1025 1026 //Gallery Height 1027 this.galleryHeightToSet = this.offY + this.buildingRow.height + this.border; 1028 this.setGalleryTempHeight(this.galleryHeightToSet + this.getSpinnerHeight()); 1029 1030 if (!isLastRow || (this.buildingRow.height <= settings.rowHeight && buildingRowRes)) { 1031 //Ready for a new row 1032 this.offY += this.buildingRow.height + settings.margins; 1033 this.rows += 1; 1034 this.clearBuildingRow(); 1035 this.settings.triggerEvent.call(this, 'jg.rowflush'); 1036 } 1037 }; 1038 1039 1040 // Scroll position not restoring: https://github.com/miromannino/Justified-Gallery/issues/221 1041 var galleryPrevStaticHeight = 0; 1042 1043 JustifiedGallery.prototype.rememberGalleryHeight = function () { 1044 galleryPrevStaticHeight = this.$gallery.height(); 1045 this.$gallery.height(galleryPrevStaticHeight); 1046 }; 1047 1048 // grow only 1049 JustifiedGallery.prototype.setGalleryTempHeight = function (height) { 1050 galleryPrevStaticHeight = Math.max(height, galleryPrevStaticHeight); 1051 this.$gallery.height(galleryPrevStaticHeight); 1052 }; 1053 1054 JustifiedGallery.prototype.setGalleryFinalHeight = function (height) { 1055 galleryPrevStaticHeight = height; 1056 this.$gallery.height(height); 1057 }; 1058 1059 /** 1060 * @returns {boolean} a boolean saying if the scrollbar is active or not 1061 */ 1062 function hasScrollBar() { 1063 return $("body").height() > $(window).height(); 1064 } 1065 1066 /** 1067 * Checks the width of the gallery container, to know if a new justification is needed 1068 */ 1069 JustifiedGallery.prototype.checkWidth = function () { 1070 this.checkWidthIntervalId = setInterval($.proxy(function () { 1071 1072 // if the gallery is not currently visible, abort. 1073 if (!this.$gallery.is(":visible")) return; 1074 1075 var galleryWidth = parseFloat(this.$gallery.width()); 1076 if (hasScrollBar() === this.scrollBarOn) { 1077 if (Math.abs(galleryWidth - this.galleryWidth) > this.settings.refreshSensitivity) { 1078 this.galleryWidth = galleryWidth; 1079 this.rewind(); 1080 1081 this.rememberGalleryHeight(); 1082 1083 // Restart to analyze 1084 this.startImgAnalyzer(true); 1085 } 1086 } else { 1087 this.scrollBarOn = hasScrollBar(); 1088 this.galleryWidth = galleryWidth
vendor: 1,945 bytes, lines 1088-1148
1088; 1089 } 1090 }, this), this.settings.refreshTime); 1091 }; 1092 1093 /** 1094 * @returns {boolean} a boolean saying if the spinner is active or not 1095 */ 1096 JustifiedGallery.prototype.isSpinnerActive = function () { 1097 return this.spinner.intervalId !== null; 1098 }; 1099 1100 /** 1101 * @returns {int} the spinner height 1102 */ 1103 JustifiedGallery.prototype.getSpinnerHeight = function () { 1104 return this.spinner.$el.innerHeight(); 1105 }; 1106 1107 /** 1108 * Stops the spinner animation and modify the gallery height to exclude the spinner 1109 */ 1110 JustifiedGallery.prototype.stopLoadingSpinnerAnimation = function () { 1111 clearInterval(this.spinner.intervalId); 1112 this.spinner.intervalId = null; 1113 this.setGalleryTempHeight(this.$gallery.height() - this.getSpinnerHeight()); 1114 this.spinner.$el.detach(); 1115 }; 1116 1117 /** 1118 * Starts the spinner animation 1119 */ 1120 JustifiedGallery.prototype.startLoadingSpinnerAnimation = function () { 1121 var spinnerContext = this.spinner; 1122 var $spinnerPoints = spinnerContext.$el.find('span'); 1123 clearInterval(spinnerContext.intervalId); 1124 this.$gallery.append(spinnerContext.$el); 1125 this.setGalleryTempHeight(this.offY + this.buildingRow.height + this.getSpinnerHeight()); 1126 spinnerContext.intervalId = setInterval(function () { 1127 if (spinnerContext.phase < $spinnerPoints.length) { 1128 $spinnerPoints.eq(spinnerContext.phase).fadeTo(spinnerContext.timeSlot, 1); 1129 } else { 1130 $spinnerPoints.eq(spinnerContext.phase - $spinnerPoints.length).fadeTo(spinnerContext.timeSlot, 0); 1131 } 1132 spinnerContext.phase = (spinnerContext.phase + 1) % ($spinnerPoints.length * 2); 1133 }, spinnerContext.timeSlot); 1134 }; 1135 1136 /** 1137 * Rewind the image analysis to start from the first entry. 1138 */ 1139 JustifiedGallery.prototype.rewind = function () { 1140 this.lastFetchedEntry = null; 1141 this.lastAnalyzedIndex = -1; 1142 this.offY = this.border; 1143 this.rows = 0; 1144 this.clearBuildingRow(); 1145 }; 1146 1147 /** 1148 *
vendor: 3,829 bytes, lines 1148-1274
1148Update the entries searching it from the justified gallery HTML element 1149 * 1150 * @param norewind if norewind only the new entries will be changed (i.e. randomized, sorted or filtered) 1151 * @returns {boolean} true if some entries has been founded 1152 */ 1153 JustifiedGallery.prototype.updateEntries = function (norewind) { 1154 var newEntries; 1155 1156 if (norewind && this.lastFetchedEntry != null) { 1157 newEntries = $(this.lastFetchedEntry).nextAll(this.settings.selector).toArray(); 1158 } else { 1159 this.entries = []; 1160 newEntries = this.$gallery.children(this.settings.selector).toArray(); 1161 } 1162 1163 if (newEntries.length > 0) { 1164 1165 // Sort or randomize 1166 if ($.isFunction(this.settings.sort)) { 1167 newEntries = this.sortArray(newEntries); 1168 } else if (this.settings.randomize) { 1169 newEntries = this.shuffleArray(newEntries); 1170 } 1171 this.lastFetchedEntry = newEntries[newEntries.length - 1]; 1172 1173 // Filter 1174 if (this.settings.filter) { 1175 newEntries = this.filterArray(newEntries); 1176 } else { 1177 this.resetFilters(newEntries); 1178 } 1179 1180 } 1181 1182 this.entries = this.entries.concat(newEntries); 1183 return true; 1184 }; 1185 1186 /** 1187 * Apply the entries order to the DOM, iterating the entries and appending the images 1188 * 1189 * @param entries the entries that has been modified and that must be re-ordered in the DOM 1190 */ 1191 JustifiedGallery.prototype.insertToGallery = function (entries) { 1192 var that = this; 1193 $.each(entries, function () { 1194 $(this).appendTo(that.$gallery); 1195 }); 1196 }; 1197 1198 /** 1199 * Shuffle the array using the Fisher-Yates shuffle algorithm 1200 * 1201 * @param a the array to shuffle 1202 * @return the shuffled array 1203 */ 1204 JustifiedGallery.prototype.shuffleArray = function (a) { 1205 var i, j, temp; 1206 for (i = a.length - 1; i > 0; i--) { 1207 j = Math.floor(Math.random() * (i + 1)); 1208 temp = a[i]; 1209 a[i] = a[j]; 1210 a[j] = temp; 1211 } 1212 this.insertToGallery(a); 1213 return a; 1214 }; 1215 1216 /** 1217 * Sort the array using settings.comparator as comparator 1218 * 1219 * @param a the array to sort (it is sorted) 1220 * @return the sorted array 1221 */ 1222 JustifiedGallery.prototype.sortArray = function (a) { 1223 a.sort(this.settings.sort); 1224 this.insertToGallery(a); 1225 return a; 1226 }; 1227 1228 /** 1229 * Reset the filters removing the 'jg-filtered' class from all the entries 1230 * 1231 * @param a the array to reset 1232 */ 1233 JustifiedGallery.prototype.resetFilters = function (a) { 1234 for (var i = 0; i < a.length; i++) $(a[i]).removeClass('jg-filtered'); 1235 }; 1236 1237 /** 1238 * Filter the entries considering theirs classes (if a string has been passed) or using a function for filtering. 1239 * 1240 * @param a the array to filter 1241 * @return the filtered array 1242 */ 1243 JustifiedGallery.prototype.filterArray = function (a) { 1244 var settings = this.settings; 1245 if ($.type(settings.filter) === 'string') { 1246 // Filter only keeping the entries passed in the string 1247 return a.filter(function (el) { 1248 var $el = $(el); 1249 if ($el.is(settings.filter)) { 1250 $el.removeClass('jg-filtered'); 1251 return true; 1252 } else { 1253 $el.addClass('jg-filtered').removeClass('jg-visible'); 1254 return false; 1255 } 1256 }); 1257 } else if ($.isFunction(settings.filter)) { 1258 // Filter using the passed function 1259 var filteredArr = a.filter(settings.filter); 1260 for (var i = 0; i < a.length; i++) { 1261 if (filteredArr.indexOf(a[i]) === -1) { 1262 $(a[i]).addClass('jg-filtered').removeClass('jg-visible'); 1263 } else { 1264 $(a[i]).removeClass('jg-filtered'); 1265 } 1266 } 1267 return filteredArr; 1268 } 1269 }; 1270 1271 /** 1272 * Destroy the Justified Gallery instance. 1273 * 1274 * It clears all the css properties added in the style attributes. We doesn't backup the original
1275 * values for those css attributes, because it costs (performance) and because in general one 1276 * shouldn't use the style attribute for an uniform set of images (where we suppose the use of 1277 * classes). Creating a backup is also difficult because JG could be called multiple times and 1278 * with different style attributes. 1279 */ 1280 JustifiedGallery.prototype.destroy = function () { 1281 clearInterval(this.checkWidthIntervalId); 1282 1283 $.each(this.entries, $.proxy(function(_, entry) { 1284 var $entry = $(entry); 1285 1286 // Reset entry style 1287 $entry.css('width', ''); 1288 $entry.css('height', ''); 1289 $entry.css('top', ''); 1290 $entry.css('left', ''); 1291 $entry.data('jg.loaded', undefined); 1292 $entry.removeClass('jg-entry'); 1293 1294 // Reset image style 1295 var $img = this.imgFromEntry($entry); 1296 $img.css('width', ''); 1297 $img.css('height', ''); 1298 $img.css('margin-left', ''); 1299 $img.css('margin-top', ''); 1300 $img.attr('src', $img.data('jg.originalSrc')); 1301 $img.data('jg.originalSrc', undefined); 1302 1303 // Remove caption 1304 this.removeCaptionEventsHandlers($entry); 1305 var $caption = this.captionFromEntry($entry); 1306 if ($entry.data('jg.createdCaption')) { 1307 // remove also the caption element (if created by jg) 1308 $entry.data('jg.createdCaption', undefined); 1309 if ($caption !== null) $caption.remove(); 1310 } else { 1311 if ($caption !== null) $caption.fadeTo(0, 1); 1312 } 1313 1314 }, this)); 1315 1316 this.$gallery.css('height', ''); 1317 this.$gallery.removeClass('justified-gallery'); 1318 this.$gallery.data('jg.controller', undefined); 1319 }; 1320 1321 /** 1322 * Analyze the images and builds the rows. It returns if it found an image that is not loaded. 1323 * 1324 * @param isForResize if the image analyzer is called for resizing or not, to call a different callback at the end 1325 */ 1326 JustifiedGallery.prototype.analyzeImages = function (isForResize) { 1327 for (var i = this.lastAnalyzedIndex + 1; i < this.entries.length; i++) { 1328 var $entry = $(this.entries[i]); 1329 if ($entry.data('jg.loaded') === true || $entry.data('jg.loaded') === 'skipped') { 1330 var availableWidth = this.galleryWidth - 2 * this.border - ( 1331 (this.buildingRow.entriesBuff.length - 1) * this.settings.margins); 1332 var imgAspectRatio = $entry.data('jg.width') / $entry.data('jg.height'); 1333 if (availableWidth / (this.buildingRow.aspectRatio + imgAspectRatio) < this.settings.rowHeight) { 1334 this.flushRow(false); 1335 1336 if(++this.yield.flushed >= this.yield.every) { 1337 this.startImgAnalyzer(isForResize); 1338 return; 1339 } 1340 } 1341 1342 this.buildingRow.entriesBuff.push($entry); 1343 this.buildingRow.aspectRatio += imgAspectRatio; 1344 this.buildingRow.width += imgAspectRatio * this.settings.rowHeight; 1345 this.lastAnalyzedIndex = i; 1346 1347 } else if ($entry.data('jg.loaded') !== 'error') { 1348 return; 1349 } 1350 } 1351 1352 // Last row flush (the row is not full) 1353 if (this.buildingRow.entriesBuff.length > 0) this.flushRow(true); 1354 1355 if (this.isSpinnerActive()) { 1356 this.stopLoadingSpinnerAnimation(); 1357 } 1358 1359 /* Stop, if there is, the timeout to start the analyzeImages. 1360 This is because an image can be set loaded, and the timeout can be set, 1361 but this image can be analyzed yet. 1362 */ 1363 this.stopImgAnalyzerStarter(); 1364 1365 //On complete callback 1366 this.settings.triggerEvent.call(this, isForResize ? 'jg.resize' : 'jg.complete'); 1367 this.setGalleryFinalHeight(this.galleryHeightToSet); 1368 }; 1369 1370 /** 1371 * Stops any ImgAnalyzer starter (that has an assigned timeout) 1372 */ 1373 JustifiedGallery.prototype.stopImgAnalyzerStarter = function () { 1374 this.yield.flushed = 0; 1375 if (this.imgAnalyzerTimeout !== null) { 1376 clearTimeout(this.imgAnalyzerTimeout); 1377 this.imgAnalyzerTimeout = null; 1378 } 1379 }; 1380 1381 /** 1382 * Starts the image analyzer. It is not immediately called to let the browser to update the view 1383 * 1384 * @param isForResize specifies if the image analyzer must be called for resizing or not 1385 */ 1386 JustifiedGallery.prototype.startImgAnalyzer = function (isForResize) { 1387 var that = this; 1388 this.stopImgAnalyzerStarter(); 1389 this.imgAnalyzerTimeout = setTimeout(function () { 1390 that.analyzeImages(isForResize); 1391 }, 0.001); // we can't start it immediately due to a IE different behaviour 1392 }; 1393 1394 /** 1395 * Checks if the image is loaded or not using another image object. We cannot use the 'complete' image property, 1396 * because some browsers, with a 404 set complete = true. 1397 * 1398 * @param imageSrc the image src to load 1399 * @param onLoad callback that is called when the image has been loaded
vendor: 11,662 bytes, lines 1400-1699
1400 * @param onError callback that is called in case of an error 1401 */ 1402 JustifiedGallery.prototype.onImageEvent = function (imageSrc, onLoad, onError) { 1403 if (!onLoad && !onError) return; 1404 1405 var memImage = new Image(); 1406 var $memImage = $(memImage); 1407 if (onLoad) { 1408 $memImage.one('load', function () { 1409 $memImage.off('load error'); 1410 onLoad(memImage); 1411 }); 1412 } 1413 if (onError) { 1414 $memImage.one('error', function() { 1415 $memImage.off('load error'); 1416 onError(memImage); 1417 }); 1418 } 1419 memImage.src = imageSrc; 1420 }; 1421 1422 /** 1423 * Init of Justified Gallery controlled 1424 * It analyzes all the entries starting theirs loading and calling the image analyzer (that works with loaded images) 1425 */ 1426 JustifiedGallery.prototype.init = function () { 1427 var imagesToLoad = false, skippedImages = false, that = this; 1428 $.each(this.entries, function (index, entry) { 1429 var $entry = $(entry); 1430 var $image = that.imgFromEntry($entry); 1431 1432 $entry.addClass('jg-entry'); 1433 1434 if ($entry.data('jg.loaded') !== true && $entry.data('jg.loaded') !== 'skipped') { 1435 1436 // Link Rel global overwrite 1437 if (that.settings.rel !== null) $entry.attr('rel', that.settings.rel); 1438 1439 // Link Target global overwrite 1440 if (that.settings.target !== null) $entry.attr('target', that.settings.target); 1441 1442 if ($image !== null) { 1443 1444 // Image src 1445 var imageSrc = that.extractImgSrcFromImage($image); 1446 $image.attr('src', imageSrc); 1447 1448 /* If we have the height and the width, we don't wait that the image is loaded, but we start directly 1449 * with the justification */ 1450 if (that.settings.waitThumbnailsLoad === false) { 1451 var width = parseFloat($image.prop('width')); 1452 var height = parseFloat($image.prop('height')); 1453 if (!isNaN(width) && !isNaN(height)) { 1454 $entry.data('jg.width', width); 1455 $entry.data('jg.height', height); 1456 $entry.data('jg.loaded', 'skipped'); 1457 skippedImages = true; 1458 that.startImgAnalyzer(false); 1459 return true; // continue 1460 } 1461 } 1462 1463 $entry.data('jg.loaded', false); 1464 imagesToLoad = true; 1465 1466 // Spinner start 1467 if (!that.isSpinnerActive()) that.startLoadingSpinnerAnimation(); 1468 1469 that.onImageEvent(imageSrc, function (loadImg) { // image loaded 1470 $entry.data('jg.width', loadImg.width); 1471 $entry.data('jg.height', loadImg.height); 1472 $entry.data('jg.loaded', true); 1473 that.startImgAnalyzer(false); 1474 }, function () { // image load error 1475 $entry.data('jg.loaded', 'error'); 1476 that.startImgAnalyzer(false); 1477 }); 1478 1479 } else { 1480 $entry.data('jg.loaded', true); 1481 $entry.data('jg.width', $entry.width() | parseFloat($entry.css('width')) | 1); 1482 $entry.data('jg.height', $entry.height() | parseFloat($entry.css('height')) | 1); 1483 } 1484 1485 } 1486 1487 }); 1488 1489 if (!imagesToLoad && !skippedImages) this.startImgAnalyzer(false); 1490 this.checkWidth(); 1491 }; 1492 1493 /** 1494 * Checks that it is a valid number. If a string is passed it is converted to a number 1495 * 1496 * @param settingContainer the object that contains the setting (to allow the conversion) 1497 * @param settingName the setting name 1498 */ 1499 JustifiedGallery.prototype.checkOrConvertNumber = function (settingContainer, settingName) { 1500 if ($.type(settingContainer[settingName]) === 'string') { 1501 settingContainer[settingName] = parseFloat(settingContainer[settingName]); 1502 } 1503 1504 if ($.type(settingContainer[settingName]) === 'number') { 1505 if (isNaN(settingContainer[settingName])) throw 'invalid number for ' + settingName; 1506 } else { 1507 throw settingName + ' must be a number'; 1508 } 1509 }; 1510 1511 /** 1512 * Checks the sizeRangeSuffixes and, if necessary, converts 1513 * its keys from string (e.g. old settings with 'lt100') to int. 1514 */ 1515 JustifiedGallery.prototype.checkSizeRangesSuffixes = function () { 1516 if ($.type(this.settings.sizeRangeSuffixes) !== 'object') { 1517 throw 'sizeRangeSuffixes must be defined and must be an object'; 1518 } 1519 1520 var suffixRanges = []; 1521 for (var rangeIdx in this.settings.sizeRangeSuffixes) { 1522 if (this.settings.sizeRangeSuffixes.hasOwnProperty(rangeIdx)) suffixRanges.push(rangeIdx); 1523 } 1524 1525 var newSizeRngSuffixes = {0: ''}; 1526 for (var i = 0; i < suffixRanges.length; i++) { 1527 if ($.type(suffixRanges[i]) === 'string') { 1528 try { 1529 var numIdx = parseInt(suffixRanges[i].replace(/^[a-z]+/, ''), 10); 1530 newSizeRngSuffixes[numIdx] = this.settings.sizeRangeSuffixes[suffixRanges[i]]; 1531 } catch (e) { 1532 throw 'sizeRangeSuffixes keys must contains correct numbers (' + e + ')'; 1533 } 1534 } else { 1535 newSizeRngSuffixes[suffixRanges[i]] = this.settings.sizeRangeSuffixes[suffixRanges[i]]; 1536 } 1537 } 1538 1539 this.settings.sizeRangeSuffixes = newSizeRngSuffixes; 1540 }; 1541 1542 /** 1543 * check and convert the maxRowHeight setting 1544 * requires rowHeight to be already set 1545 * TODO: should be always called when only rowHeight is changed 1546 * @return number or null 1547 */ 1548 JustifiedGallery.prototype.retrieveMaxRowHeight = function () { 1549 var newMaxRowHeight = null; 1550 var rowHeight = this.settings.rowHeight; 1551 1552 if ($.type(this.settings.maxRowHeight) === 'string') { 1553 if (this.settings.maxRowHeight.match(/^[0-9]+%$/)) { 1554 newMaxRowHeight = rowHeight * parseFloat(this.settings.maxRowHeight.match(/^([0-9]+)%$/)[1]) / 100; 1555 } else { 1556 newMaxRowHeight = parseFloat(this.settings.maxRowHeight); 1557 } 1558 } else if ($.type(this.settings.maxRowHeight) === 'number') { 1559 newMaxRowHeight = this.settings.maxRowHeight; 1560 } else if (this.settings.maxRowHeight === false || this.settings.maxRowHeight == null) { 1561 return null; 1562 } else { 1563 throw 'maxRowHeight must be a number or a percentage'; 1564 } 1565 1566 // check if the converted value is not a number 1567 if (isNaN(newMaxRowHeight)) throw 'invalid number for maxRowHeight'; 1568 1569 // check values, maxRowHeight must be >= rowHeight 1570 if (newMaxRowHeight < rowHeight) newMaxRowHeight = rowHeight; 1571 1572 return newMaxRowHeight; 1573 }; 1574 1575 /** 1576 * Checks the settings 1577 */ 1578 JustifiedGallery.prototype.checkSettings = function () { 1579 this.checkSizeRangesSuffixes(); 1580 1581 this.checkOrConvertNumber(this.settings, 'rowHeight'); 1582 this.checkOrConvertNumber(this.settings, 'margins'); 1583 this.checkOrConvertNumber(this.settings, 'border'); 1584 1585 var lastRowModes = [ 1586 'justify', 1587 'nojustify', 1588 'left', 1589 'center', 1590 'right', 1591 'hide' 1592 ]; 1593 if (lastRowModes.indexOf(this.settings.lastRow) === -1) { 1594 throw 'lastRow must be one of: ' + lastRowModes.join(', '); 1595 } 1596 1597 this.checkOrConvertNumber(this.settings, 'justifyThreshold'); 1598 if (this.settings.justifyThreshold < 0 || this.settings.justifyThreshold > 1) { 1599 throw 'justifyThreshold must be in the interval [0,1]'; 1600 } 1601 if ($.type(this.settings.cssAnimation) !== 'boolean') { 1602 throw 'cssAnimation must be a boolean'; 1603 } 1604 1605 if ($.type(this.settings.captions) !== 'boolean') throw 'captions must be a boolean'; 1606 this.checkOrConvertNumber(this.settings.captionSettings, 'animationDuration'); 1607 1608 this.checkOrConvertNumber(this.settings.captionSettings, 'visibleOpacity'); 1609 if (this.settings.captionSettings.visibleOpacity < 0 || 1610 this.settings.captionSettings.visibleOpacity > 1) { 1611 throw 'captionSettings.visibleOpacity must be in the interval [0, 1]'; 1612 } 1613 1614 this.checkOrConvertNumber(this.settings.captionSettings, 'nonVisibleOpacity'); 1615 if (this.settings.captionSettings.nonVisibleOpacity < 0 || 1616 this.settings.captionSettings.nonVisibleOpacity > 1) { 1617 throw 'captionSettings.nonVisibleOpacity must be in the interval [0, 1]'; 1618 } 1619 1620 this.checkOrConvertNumber(this.settings, 'imagesAnimationDuration'); 1621 this.checkOrConvertNumber(this.settings, 'refreshTime'); 1622 this.checkOrConvertNumber(this.settings, 'refreshSensitivity'); 1623 if ($.type(this.settings.randomize) !== 'boolean') throw 'randomize must be a boolean'; 1624 if ($.type(this.settings.selector) !== 'string') throw 'selector must be a string'; 1625 1626 if (this.settings.sort !== false && !$.isFunction(this.settings.sort)) { 1627 throw 'sort must be false or a comparison function'; 1628 } 1629 1630 if (this.settings.filter !== false && !$.isFunction(this.settings.filter) && 1631 $.type(this.settings.filter) !== 'string') { 1632 throw 'filter must be false, a string or a filter function'; 1633 } 1634 }; 1635 1636 /** 1637 * It brings all the indexes from the sizeRangeSuffixes and it orders them. They are then sorted and returned. 1638 * @returns {Array} sorted suffix ranges 1639 */ 1640 JustifiedGallery.prototype.retrieveSuffixRanges = function () { 1641 var suffixRanges = []; 1642 for (var rangeIdx in this.settings.sizeRangeSuffixes) { 1643 if (this.settings.sizeRangeSuffixes.hasOwnProperty(rangeIdx)) suffixRanges.push(parseInt(rangeIdx, 10)); 1644 } 1645 suffixRanges.sort(function (a, b) { return a > b ? 1 : a < b ? -1 : 0; }); 1646 return suffixRanges; 1647 }; 1648 1649 /** 1650 * Update the existing settings only changing some of them 1651 * 1652 * @param newSettings the new settings (or a subgroup of them) 1653 */ 1654 JustifiedGallery.prototype.updateSettings = function (newSettings) { 1655 // In this case Justified Gallery has been called again changing only some options 1656 this.settings = $.extend({}, this.settings, newSettings); 1657 this.checkSettings(); 1658 1659 // As reported in the settings: negative value = same as margins, 0 = disabled 1660 this.border = this.settings.border >= 0 ? this.settings.border : this.settings.margins; 1661 1662 this.maxRowHeight = this.retrieveMaxRowHeight(); 1663 this.suffixRanges = this.retrieveSuffixRanges(); 1664 }; 1665 1666 JustifiedGallery.prototype.defaults = { 1667 sizeRangeSuffixes: { }, /* e.g. Flickr configuration 1668 { 1669 100: '_t', // used when longest is less than 100px 1670 240: '_m', // used when longest is between 101px and 240px 1671 320: '_n', // ... 1672 500: '', 1673 640: '_z', 1674 1024: '_b' // used as else case because it is the last 1675 } 1676 */ 1677 thumbnailPath: undefined, /* If defined, sizeRangeSuffixes is not used, and this function is used to determine the 1678 path relative to a specific thumbnail size. The function should accept respectively three arguments: 1679 current path, width and height */ 1680 rowHeight: 120, // required? required to be > 0? 1681 maxRowHeight: false, // false or negative value to deactivate. Positive number to express the value in pixels, 1682 // A string '[0-9]+%' to express in percentage (e.g. 300% means that the row height 1683 // can't exceed 3 * rowHeight) 1684 margins: 1, 1685 border: -1, // negative value = same as margins, 0 = disabled, any other value to set the border 1686 1687 lastRow: 'nojustify', // … which is the same as 'left', or can be 'justify', 'center', 'right' or 'hide' 1688 1689 justifyThreshold: 0.90, /* if row width / available space > 0.90 it will be always justified 1690 * (i.e. lastRow setting is not considered) */ 1691 waitThumbnailsLoad: true, 1692 captions: true, 1693 cssAnimation: true, 1694 imagesAnimationDuration: 500, // ignored with css animations 1695 captionSettings: { // ignored with css animations 1696 animationDuration: 500, 1697 visibleOpacity: 0.7, 1698 nonVisibleOpacity: 0.0 1699 },
vendor: 44,492 bytes, lines 1700-3602
1700 rel: null, // rewrite the rel of each analyzed links 1701 target: null, // rewrite the target of all links 1702 extension: /\.[^.\\/]+$/, // regexp to capture the extension of an image 1703 refreshTime: 200, // time interval (in ms) to check if the page changes its width 1704 refreshSensitivity: 0, // change in width allowed (in px) without re-building the gallery 1705 randomize: false, 1706 rtl: false, // right-to-left mode 1707 sort: false, /* 1708 - false: to do not sort 1709 - function: to sort them using the function as comparator (see Array.prototype.sort()) 1710 */ 1711 filter: false, /* 1712 - false, null or undefined: for a disabled filter 1713 - a string: an entry is kept if entry.is(filter string) returns true 1714 see jQuery's .is() function for further information 1715 - a function: invoked with arguments (entry, index, array). Return true to keep the entry, false otherwise. 1716 It follows the specifications of the Array.prototype.filter() function of JavaScript. 1717 */ 1718 selector: 'a, div:not(.spinner)', // The selector that is used to know what are the entries of the gallery 1719 imgSelector: '> img, > a > img', // The selector that is used to know what are the images of each entry 1720 triggerEvent: function (event) { // This is called to trigger events, the default behavior is to call $.trigger 1721 this.$gallery.trigger(event); // Consider that 'this' is this set to the JustifiedGallery object, so it can 1722 } // access to fields such as $gallery, useful to trigger events with jQuery. 1723 }; 1724 1725 /** 1726 * Justified Gallery plugin for jQuery 1727 * 1728 * Events 1729 * - jg.complete : called when all the gallery has been created 1730 * - jg.resize : called when the gallery has been resized 1731 * - jg.rowflush : when a new row appears 1732 * 1733 * @param arg the action (or the settings) passed when the plugin is called 1734 * @returns {*} the object itself 1735 */ 1736 $.fn.justifiedGallery = function (arg) { 1737 return this.each(function (index, gallery) { 1738 1739 var $gallery = $(gallery); 1740 $gallery.addClass('justified-gallery'); 1741 1742 var controller = $gallery.data('jg.controller'); 1743 if (typeof controller === 'undefined') { 1744 // Create controller and assign it to the object data 1745 if (typeof arg !== 'undefined' && arg !== null && $.type(arg) !== 'object') { 1746 if (arg === 'destroy') return; // Just a call to an unexisting object 1747 throw 'The argument must be an object'; 1748 } 1749 controller = new JustifiedGallery($gallery, $.extend({}, JustifiedGallery.prototype.defaults, arg)); 1750 $gallery.data('jg.controller', controller); 1751 } else if (arg === 'norewind') { 1752 // In this case we don't rewind: we analyze only the latest images (e.g. to complete the last unfinished row 1753 // ... left to be more readable 1754 } else if (arg === 'destroy') { 1755 controller.destroy(); 1756 return; 1757 } else { 1758 // In this case Justified Gallery has been called again changing only some options 1759 controller.updateSettings(arg); 1760 controller.rewind(); 1761 } 1762 1763 // Update the entries list 1764 if (!controller.updateEntries(arg === 'norewind')) return; 1765 1766 // Init justified gallery 1767 controller.init(); 1768 1769 }); 1770 }; 1771 1772})); 1773 1774/*! Magnific Popup - v1.1.0 - 2016-02-20 1775* http://dimsemenov.com/plugins/magnific-popup/ 1776* Copyright (c) 2016 Dmitry Semenov; */ 1777;(function (factory) { 1778if (typeof define === 'function' && define.amd) { 1779 // AMD. Register as an anonymous module. 1780 define(['jquery'], factory); 1781 } else if (typeof exports === 'object') { 1782 // Node/CommonJS 1783 factory(require('jquery')); 1784 } else { 1785 // Browser globals 1786 factory(window.jQuery || window.Zepto); 1787 } 1788 }(function($) { 1789 1790/*>>core*/ 1791/** 1792 * 1793 * Magnific Popup Core JS file 1794 * 1795 */ 1796 1797 1798/** 1799 * Private static constants 1800 */ 1801var CLOSE_EVENT = 'Close', 1802 BEFORE_CLOSE_EVENT = 'BeforeClose', 1803 AFTER_CLOSE_EVENT = 'AfterClose', 1804 BEFORE_APPEND_EVENT = 'BeforeAppend', 1805 MARKUP_PARSE_EVENT = 'MarkupParse', 1806 OPEN_EVENT = 'Open', 1807 CHANGE_EVENT = 'Change', 1808 NS = 'mfp', 1809 EVENT_NS = '.' + NS, 1810 READY_CLASS = 'mfp-ready', 1811 REMOVING_CLASS = 'mfp-removing', 1812 PREVENT_CLOSE_CLASS = 'mfp-prevent-close'; 1813 1814 1815/** 1816 * Private vars 1817 */ 1818/*jshint -W079 */ 1819var mfp, // As we have only one instance of MagnificPopup object, we define it locally to not to use 'this' 1820 MagnificPopup = function(){}, 1821 _isJQ = !!(window.jQuery), 1822 _prevStatus, 1823 _window = $(window), 1824 _document, 1825 _prevContentType, 1826 _wrapClasses, 1827 _currPopupType; 1828 1829 1830/** 1831 * Private functions 1832 */ 1833var _mfpOn = function(name, f) { 1834 mfp.ev.on(NS + name + EVENT_NS, f); 1835 }, 1836 _getEl = function(className, appendTo, html, raw) { 1837 var el = document.createElement('div'); 1838 el.className = 'mfp-'+className; 1839 if(html) { 1840 el.innerHTML = html; 1841 } 1842 if(!raw) { 1843 el = $(el); 1844 if(appendTo) { 1845 el.appendTo(appendTo); 1846 } 1847 } else if(appendTo) { 1848 appendTo.appendChild(el); 1849 } 1850 return el; 1851 }, 1852 _mfpTrigger = function(e, data) { 1853 mfp.ev.triggerHandler(NS + e, data); 1854 1855 if(mfp.st.callbacks) { 1856 // converts "mfpEventName" to "eventName" callback and triggers it if it's present 1857 e = e.charAt(0).toLowerCase() + e.slice(1); 1858 if(mfp.st.callbacks[e]) { 1859 mfp.st.callbacks[e].apply(mfp, $.isArray(data) ? data : [data]); 1860 } 1861 } 1862 }, 1863 _getCloseBtn = function(type) { 1864 if(type !== _currPopupType || !mfp.currTemplate.closeBtn) { 1865 mfp.currTemplate.closeBtn = $( mfp.st.closeMarkup.replace('%title%', mfp.st.tClose ) ); 1866 _currPopupType = type; 1867 } 1868 return mfp.currTemplate.closeBtn; 1869 }, 1870 // Initialize Magnific Popup only when called at least once 1871 _checkInstance = function() { 1872 if(!$.magnificPopup.instance) { 1873 /*jshint -W020 */ 1874 mfp = new MagnificPopup(); 1875 mfp.init(); 1876 $.magnificPopup.instance = mfp; 1877 } 1878 }, 1879 // CSS transition detection, http://stackoverflow.com/questions/7264899/detect-css-transitions-using-javascript-and-without-modernizr 1880 supportsTransitions = function() { 1881 var s = document.createElement('p').style, // 's' for style. better to create an element if body yet to exist 1882 v = ['ms','O','Moz','Webkit']; // 'v' for vendor 1883 1884 if( s['transition'] !== undefined ) { 1885 return true; 1886 } 1887 1888 while( v.length ) { 1889 if( v.pop() + 'Transition' in s ) { 1890 return true; 1891 } 1892 } 1893 1894 return false; 1895 }; 1896 1897 1898 1899/** 1900 * Public functions 1901 */ 1902MagnificPopup.prototype = { 1903 1904 constructor: MagnificPopup, 1905 1906 /** 1907 * Initializes Magnific Popup plugin. 1908 * This function is triggered only once when $.fn.magnificPopup or $.magnificPopup is executed 1909 */ 1910 init: function() { 1911 var appVersion = navigator.appVersion; 1912 mfp.isLowIE = mfp.isIE8 = document.all && !document.addEventListener; 1913 mfp.isAndroid = (/android/gi).test(appVersion); 1914 mfp.isIOS = (/iphone|ipad|ipod/gi).test(appVersion); 1915 mfp.supportsTransition = supportsTransitions(); 1916 1917 // We disable fixed positioned lightbox on devices that don't handle it nicely. 1918 // If you know a better way of detecting this - let me know. 1919 mfp.probablyMobile = (mfp.isAndroid || mfp.isIOS || /(Opera Mini)|Kindle|webOS|BlackBerry|(Opera Mobi)|(Windows Phone)|IEMobile/i.test(navigator.userAgent) ); 1920 _document = $(document); 1921 1922 mfp.popupsCache = {}; 1923 }, 1924 1925 /** 1926 * Opens popup 1927 * @param data [description] 1928 */ 1929 open: function(data) { 1930 1931 var i; 1932 1933 if(data.isObj === false) { 1934 // convert jQuery collection to array to avoid conflicts later 1935 mfp.items = data.items.toArray(); 1936 1937 mfp.index = 0; 1938 var items = data.items, 1939 item; 1940 for(i = 0; i < items.length; i++) { 1941 item = items[i]; 1942 if(item.parsed) { 1943 item = item.el[0]; 1944 } 1945 if(item === data.el[0]) { 1946 mfp.index = i; 1947 break; 1948 } 1949 } 1950 } else { 1951 mfp.items = $.isArray(data.items) ? data.items : [data.items]; 1952 mfp.index = data.index || 0; 1953 } 1954 1955 // if popup is already opened - we just update the content 1956 if(mfp.isOpen) { 1957 mfp.updateItemHTML(); 1958 return; 1959 } 1960 1961 mfp.types = []; 1962 _wrapClasses = ''; 1963 if(data.mainEl && data.mainEl.length) { 1964 mfp.ev = data.mainEl.eq(0); 1965 } else { 1966 mfp.ev = _document; 1967 } 1968 1969 if(data.key) { 1970 if(!mfp.popupsCache[data.key]) { 1971 mfp.popupsCache[data.key] = {}; 1972 } 1973 mfp.currTemplate = mfp.popupsCache[data.key]; 1974 } else { 1975 mfp.currTemplate = {}; 1976 } 1977 1978 1979 1980 mfp.st = $.extend(true, {}, $.magnificPopup.defaults, data ); 1981 mfp.fixedContentPos = mfp.st.fixedContentPos === 'auto' ? !mfp.probablyMobile : mfp.st.fixedContentPos; 1982 1983 if(mfp.st.modal) { 1984 mfp.st.closeOnContentClick = false; 1985 mfp.st.closeOnBgClick = false; 1986 mfp.st.showCloseBtn = false; 1987 mfp.st.enableEscapeKey = false; 1988 } 1989 1990 1991 // Building markup 1992 // main containers are created only once 1993 if(!mfp.bgOverlay) { 1994 1995 // Dark overlay 1996 mfp.bgOverlay = _getEl('bg').on('click'+EVENT_NS, function() { 1997 mfp.close(); 1998 }); 1999 2000 mfp.wrap = _getEl('wrap').attr('tabindex', -1).on('click'+EVENT_NS, function(e) { 2001 if(mfp._checkIfClose(e.target)) { 2002 mfp.close(); 2003 } 2004 }); 2005 2006 mfp.container = _getEl('container', mfp.wrap); 2007 } 2008 2009 mfp.contentContainer = _getEl('content'); 2010 if(mfp.st.preloader) { 2011 mfp.preloader = _getEl('preloader', mfp.container, mfp.st.tLoading); 2012 } 2013 2014 2015 // Initializing modules 2016 var modules = $.magnificPopup.modules; 2017 for(i = 0; i < modules.length; i++) { 2018 var n = modules[i]; 2019 n = n.charAt(0).toUpperCase() + n.slice(1); 2020 mfp['init'+n].call(mfp); 2021 } 2022 _mfpTrigger('BeforeOpen'); 2023 2024 2025 if(mfp.st.showCloseBtn) { 2026 // Close button 2027 if(!mfp.st.closeBtnInside) { 2028 mfp.wrap.append( _getCloseBtn() ); 2029 } else { 2030 _mfpOn(MARKUP_PARSE_EVENT, function(e, template, values, item) { 2031 values.close_replaceWith = _getCloseBtn(item.type); 2032 }); 2033 _wrapClasses += ' mfp-close-btn-in'; 2034 } 2035 } 2036 2037 if(mfp.st.alignTop) { 2038 _wrapClasses += ' mfp-align-top'; 2039 } 2040 2041 2042 2043 if(mfp.fixedContentPos) { 2044 mfp.wrap.css({ 2045 overflow: mfp.st.overflowY, 2046 overflowX: 'hidden', 2047 overflowY: mfp.st.overflowY 2048 }); 2049 } else { 2050 mfp.wrap.css({ 2051 top: _window.scrollTop(), 2052 position: 'absolute' 2053 }); 2054 } 2055 if( mfp.st.fixedBgPos === false || (mfp.st.fixedBgPos === 'auto' && !mfp.fixedContentPos) ) { 2056 mfp.bgOverlay.css({ 2057 height: _document.height(), 2058 position: 'absolute' 2059 }); 2060 } 2061 2062 2063 2064 if(mfp.st.enableEscapeKey) { 2065 // Close on ESC key 2066 _document.on('keyup' + EVENT_NS, function(e) { 2067 if(e.keyCode === 27) { 2068 mfp.close(); 2069 } 2070 }); 2071 } 2072 2073 _window.on('resize' + EVENT_NS, function() { 2074 mfp.updateSize(); 2075 }); 2076 2077 2078 if(!mfp.st.closeOnContentClick) { 2079 _wrapClasses += ' mfp-auto-cursor'; 2080 } 2081 2082 if(_wrapClasses) 2083 mfp.wrap.addClass(_wrapClasses); 2084 2085 2086 // this triggers recalculation of layout, so we get it once to not to trigger twice 2087 var windowHeight = mfp.wH = _window.height(); 2088 2089 2090 var windowStyles = {}; 2091 2092 if( mfp.fixedContentPos ) { 2093 if(mfp._hasScrollBar(windowHeight)){ 2094 var s = mfp._getScrollbarSize(); 2095 if(s) { 2096 windowStyles.marginRight = s; 2097 } 2098 } 2099 } 2100 2101 if(mfp.fixedContentPos) { 2102 if(!mfp.isIE7) { 2103 windowStyles.overflow = 'hidden'; 2104 } else { 2105 // ie7 double-scroll bug 2106 $('body, html').css('overflow', 'hidden'); 2107 } 2108 } 2109 2110 2111 2112 var classesToadd = mfp.st.mainClass; 2113 if(mfp.isIE7) { 2114 classesToadd += ' mfp-ie7'; 2115 } 2116 if(classesToadd) { 2117 mfp._addClassToMFP( classesToadd ); 2118 } 2119 2120 // add content 2121 mfp.updateItemHTML(); 2122 2123 _mfpTrigger('BuildControls'); 2124 2125 // remove scrollbar, add margin e.t.c 2126 $('html').css(windowStyles); 2127 2128 // add everything to DOM 2129 mfp.bgOverlay.add(mfp.wrap).prependTo( mfp.st.prependTo || $(document.body) ); 2130 2131 // Save last focused element 2132 mfp._lastFocusedEl = document.activeElement; 2133 2134 // Wait for next cycle to allow CSS transition 2135 setTimeout(function() { 2136 2137 if(mfp.content) { 2138 mfp._addClassToMFP(READY_CLASS); 2139 mfp._setFocus(); 2140 } else { 2141 // if content is not defined (not loaded e.t.c) we add class only for BG 2142 mfp.bgOverlay.addClass(READY_CLASS); 2143 } 2144 2145 // Trap the focus in popup 2146 _document.on('focusin' + EVENT_NS, mfp._onFocusIn); 2147 2148 }, 16); 2149 2150 mfp.isOpen = true; 2151 mfp.updateSize(windowHeight); 2152 _mfpTrigger(OPEN_EVENT); 2153 2154 return data; 2155 }, 2156 2157 /** 2158 * Closes the popup 2159 */ 2160 close: function() { 2161 if(!mfp.isOpen) return; 2162 _mfpTrigger(BEFORE_CLOSE_EVENT); 2163 2164 mfp.isOpen = false; 2165 // for CSS3 animation 2166 if(mfp.st.removalDelay && !mfp.isLowIE && mfp.supportsTransition ) { 2167 mfp._addClassToMFP(REMOVING_CLASS); 2168 setTimeout(function() { 2169 mfp._close(); 2170 }, mfp.st.removalDelay); 2171 } else { 2172 mfp._close(); 2173 } 2174 }, 2175 2176 /** 2177 * Helper for close() function 2178 */ 2179 _close: function() { 2180 _mfpTrigger(CLOSE_EVENT); 2181 2182 var classesToRemove = REMOVING_CLASS + ' ' + READY_CLASS + ' '; 2183 2184 mfp.bgOverlay.detach(); 2185 mfp.wrap.detach(); 2186 mfp.container.empty(); 2187 2188 if(mfp.st.mainClass) { 2189 classesToRemove += mfp.st.mainClass + ' '; 2190 } 2191 2192 mfp._removeClassFromMFP(classesToRemove); 2193 2194 if(mfp.fixedContentPos) { 2195 var windowStyles = {marginRight: ''}; 2196 if(mfp.isIE7) { 2197 $('body, html').css('overflow', ''); 2198 } else { 2199 windowStyles.overflow = ''; 2200 } 2201 $('html').css(windowStyles); 2202 } 2203 2204 _document.off('keyup' + EVENT_NS + ' focusin' + EVENT_NS); 2205 mfp.ev.off(EVENT_NS); 2206 2207 // clean up DOM elements that aren't removed 2208 mfp.wrap.attr('class', 'mfp-wrap').removeAttr('style'); 2209 mfp.bgOverlay.attr('class', 'mfp-bg'); 2210 mfp.container.attr('class', 'mfp-container'); 2211 2212 // remove close button from target element 2213 if(mfp.st.showCloseBtn && 2214 (!mfp.st.closeBtnInside || mfp.currTemplate[mfp.currItem.type] === true)) { 2215 if(mfp.currTemplate.closeBtn) 2216 mfp.currTemplate.closeBtn.detach(); 2217 } 2218 2219 2220 if(mfp.st.autoFocusLast && mfp._lastFocusedEl) { 2221 $(mfp._lastFocusedEl).focus(); // put tab focus back 2222 } 2223 mfp.currItem = null; 2224 mfp.content = null; 2225 mfp.currTemplate = null; 2226 mfp.prevHeight = 0; 2227 2228 _mfpTrigger(AFTER_CLOSE_EVENT); 2229 }, 2230 2231 updateSize: function(winHeight) { 2232 2233 if(mfp.isIOS) { 2234 // fixes iOS nav bars https://github.com/dimsemenov/Magnific-Popup/issues/2 2235 var zoomLevel = document.documentElement.clientWidth / window.innerWidth; 2236 var height = window.innerHeight * zoomLevel; 2237 mfp.wrap.css('height', height); 2238 mfp.wH = height; 2239 } else { 2240 mfp.wH = winHeight || _window.height(); 2241 } 2242 // Fixes #84: popup incorrectly positioned with position:relative on body 2243 if(!mfp.fixedContentPos) { 2244 mfp.wrap.css('height', mfp.wH); 2245 } 2246 2247 _mfpTrigger('Resize'); 2248 2249 }, 2250 2251 /** 2252 * Set content of popup based on current index 2253 */ 2254 updateItemHTML: function() { 2255 var item = mfp.items[mfp.index]; 2256 2257 // Detach and perform modifications 2258 mfp.contentContainer.detach(); 2259 2260 if(mfp.content) 2261 mfp.content.detach(); 2262 2263 if(!item.parsed) { 2264 item = mfp.parseEl( mfp.index ); 2265 } 2266 2267 var type = item.type; 2268 2269 _mfpTrigger('BeforeChange', [mfp.currItem ? mfp.currItem.type : '', type]); 2270 // BeforeChange event works like so: 2271 // _mfpOn('BeforeChange', function(e, prevType, newType) { }); 2272 2273 mfp.currItem = item; 2274 2275 if(!mfp.currTemplate[type]) { 2276 var markup = mfp.st[type] ? mfp.st[type].markup : false; 2277 2278 // allows to modify markup 2279 _mfpTrigger('FirstMarkupParse', markup); 2280 2281 if(markup) { 2282 mfp.currTemplate[type] = $(markup); 2283 } else { 2284 // if there is no markup found we just define that template is parsed 2285 mfp.currTemplate[type] = true; 2286 } 2287 } 2288 2289 if(_prevContentType && _prevContentType !== item.type) { 2290 mfp.container.removeClass('mfp-'+_prevContentType+'-holder'); 2291 } 2292 2293 var newContent = mfp['get' + type.charAt(0).toUpperCase() + type.slice(1)](item, mfp.currTemplate[type]); 2294 mfp.appendContent(newContent, type); 2295 2296 item.preloaded = true; 2297 2298 _mfpTrigger(CHANGE_EVENT, item); 2299 _prevContentType = item.type; 2300 2301 // Append container back after its content changed 2302 mfp.container.prepend(mfp.contentContainer); 2303 2304 _mfpTrigger('AfterChange'); 2305 }, 2306 2307 2308 /** 2309 * Set HTML content of popup 2310 */ 2311 appendContent: function(newContent, type) { 2312 mfp.content = newContent; 2313 2314 if(newContent) { 2315 if(mfp.st.showCloseBtn && mfp.st.closeBtnInside && 2316 mfp.currTemplate[type] === true) { 2317 // if there is no markup, we just append close button element inside 2318 if(!mfp.content.find('.mfp-close').length) { 2319 mfp.content.append(_getCloseBtn()); 2320 } 2321 } else { 2322 mfp.content = newContent; 2323 } 2324 } else { 2325 mfp.content = ''; 2326 } 2327 2328 _mfpTrigger(BEFORE_APPEND_EVENT); 2329 mfp.container.addClass('mfp-'+type+'-holder'); 2330 2331 mfp.contentContainer.append(mfp.content); 2332 }, 2333 2334 2335 /** 2336 * Creates Magnific Popup data object based on given data 2337 * @param {int} index Index of item to parse 2338 */ 2339 parseEl: function(index) { 2340 var item = mfp.items[index], 2341 type; 2342 2343 if(item.tagName) { 2344 item = { el: $(item) }; 2345 } else { 2346 type = item.type; 2347 item = { data: item, src: item.src }; 2348 } 2349 2350 if(item.el) { 2351 var types = mfp.types; 2352 2353 // check for 'mfp-TYPE' class 2354 for(var i = 0; i < types.length; i++) { 2355 if( item.el.hasClass('mfp-'+types[i]) ) { 2356 type = types[i]; 2357 break; 2358 } 2359 } 2360 2361 item.src = item.el.attr('data-mfp-src'); 2362 if(!item.src) { 2363 item.src = item.el.attr('href'); 2364 } 2365 } 2366 2367 item.type = type || mfp.st.type || 'inline'; 2368 item.index = index; 2369 item.parsed = true; 2370 mfp.items[index] = item; 2371 _mfpTrigger('ElementParse', item); 2372 2373 return mfp.items[index]; 2374 }, 2375 2376 2377 /** 2378 * Initializes single popup or a group of popups 2379 */ 2380 addGroup: function(el, options) { 2381 var eHandler = function(e) { 2382 e.mfpEl = this; 2383 mfp._openClick(e, el, options); 2384 }; 2385 2386 if(!options) { 2387 options = {}; 2388 } 2389 2390 var eName = 'click.magnificPopup'; 2391 options.mainEl = el; 2392 2393 if(options.items) { 2394 options.isObj = true; 2395 el.off(eName).on(eName, eHandler); 2396 } else { 2397 options.isObj = false; 2398 if(options.delegate) { 2399 el.off(eName).on(eName, options.delegate , eHandler); 2400 } else { 2401 options.items = el; 2402 el.off(eName).on(eName, eHandler); 2403 } 2404 } 2405 }, 2406 _openClick: function(e, el, options) { 2407 var midClick = options.midClick !== undefined ? options.midClick : $.magnificPopup.defaults.midClick; 2408 2409 2410 if(!midClick && ( e.which === 2 || e.ctrlKey || e.metaKey || e.altKey || e.shiftKey ) ) { 2411 return; 2412 } 2413 2414 var disableOn = options.disableOn !== undefined ? options.disableOn : $.magnificPopup.defaults.disableOn; 2415 2416 if(disableOn) { 2417 if($.isFunction(disableOn)) { 2418 if( !disableOn.call(mfp) ) { 2419 return true; 2420 } 2421 } else { // else it's number 2422 if( _window.width() < disableOn ) { 2423 return true; 2424 } 2425 } 2426 } 2427 2428 if(e.type) { 2429 e.preventDefault(); 2430 2431 // This will prevent popup from closing if element is inside and popup is already opened 2432 if(mfp.isOpen) { 2433 e.stopPropagation(); 2434 } 2435 } 2436 2437 options.el = $(e.mfpEl); 2438 if(options.delegate) { 2439 options.items = el.find(options.delegate); 2440 } 2441 mfp.open(options); 2442 }, 2443 2444 2445 /** 2446 * Updates text on preloader 2447 */ 2448 updateStatus: function(status, text) { 2449 2450 if(mfp.preloader) { 2451 if(_prevStatus !== status) { 2452 mfp.container.removeClass('mfp-s-'+_prevStatus); 2453 } 2454 2455 if(!text && status === 'loading') { 2456 text = mfp.st.tLoading; 2457 } 2458 2459 var data = { 2460 status: status, 2461 text: text 2462 }; 2463 // allows to modify status 2464 _mfpTrigger('UpdateStatus', data); 2465 2466 status = data.status; 2467 text = data.text; 2468 2469 mfp.preloader.html(text); 2470 2471 mfp.preloader.find('a').on('click', function(e) { 2472 e.stopImmediatePropagation(); 2473 }); 2474 2475 mfp.container.addClass('mfp-s-'+status); 2476 _prevStatus = status; 2477 } 2478 }, 2479 2480 2481 /* 2482 "Private" helpers that aren't private at all 2483 */ 2484 // Check to close popup or not 2485 // "target" is an element that was clicked 2486 _checkIfClose: function(target) { 2487 2488 if($(target).hasClass(PREVENT_CLOSE_CLASS)) { 2489 return; 2490 } 2491 2492 var closeOnContent = mfp.st.closeOnContentClick; 2493 var closeOnBg = mfp.st.closeOnBgClick; 2494 2495 if(closeOnContent && closeOnBg) { 2496 return true; 2497 } else { 2498 2499 // We close the popup if click is on close button or on preloader. Or if there is no content. 2500 if(!mfp.content || $(target).hasClass('mfp-close') || (mfp.preloader && target === mfp.preloader[0]) ) { 2501 return true; 2502 } 2503 2504 // if click is outside the content 2505 if( (target !== mfp.content[0] && !$.contains(mfp.content[0], target)) ) { 2506 if(closeOnBg) { 2507 // last check, if the clicked element is in DOM, (in case it's removed onclick) 2508 if( $.contains(document, target) ) { 2509 return true; 2510 } 2511 } 2512 } else if(closeOnContent) { 2513 return true; 2514 } 2515 2516 } 2517 return false; 2518 }, 2519 _addClassToMFP: function(cName) { 2520 mfp.bgOverlay.addClass(cName); 2521 mfp.wrap.addClass(cName); 2522 }, 2523 _removeClassFromMFP: function(cName) { 2524 this.bgOverlay.removeClass(cName); 2525 mfp.wrap.removeClass(cName); 2526 }, 2527 _hasScrollBar: function(winHeight) { 2528 return ( (mfp.isIE7 ? _document.height() : document.body.scrollHeight) > (winHeight || _window.height()) ); 2529 }, 2530 _setFocus: function() { 2531 (mfp.st.focus ? mfp.content.find(mfp.st.focus).eq(0) : mfp.wrap).focus(); 2532 }, 2533 _onFocusIn: function(e) { 2534 if( e.target !== mfp.wrap[0] && !$.contains(mfp.wrap[0], e.target) ) { 2535 mfp._setFocus(); 2536 return false; 2537 } 2538 }, 2539 _parseMarkup: function(template, values, item) { 2540 var arr; 2541 if(item.data) { 2542 values = $.extend(item.data, values); 2543 } 2544 _mfpTrigger(MARKUP_PARSE_EVENT, [template, values, item] ); 2545 2546 $.each(values, function(key, value) { 2547 if(value === undefined || value === false) { 2548 return true; 2549 } 2550 arr = key.split('_'); 2551 if(arr.length > 1) { 2552 var el = template.find(EVENT_NS + '-'+arr[0]); 2553 2554 if(el.length > 0) { 2555 var attr = arr[1]; 2556 if(attr === 'replaceWith') { 2557 if(el[0] !== value[0]) { 2558 el.replaceWith(value); 2559 } 2560 } else if(attr === 'img') { 2561 if(el.is('img')) { 2562 el.attr('src', value); 2563 } else { 2564 el.replaceWith( $('<img>').attr('src', value).attr('class', el.attr('class')) ); 2565 } 2566 } else { 2567 el.attr(arr[1], value); 2568 } 2569 } 2570 2571 } else { 2572 template.find(EVENT_NS + '-'+key).html(value); 2573 } 2574 }); 2575 }, 2576 2577 _getScrollbarSize: function() { 2578 // thx David 2579 if(mfp.scrollbarSize === undefined) { 2580 var scrollDiv = document.createElement("div"); 2581 scrollDiv.style.cssText = 'width: 99px; height: 99px; overflow: scroll; position: absolute; top: -9999px;'; 2582 document.body.appendChild(scrollDiv); 2583 mfp.scrollbarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth; 2584 document.body.removeChild(scrollDiv); 2585 } 2586 return mfp.scrollbarSize; 2587 } 2588 2589}; /* MagnificPopup core prototype end */ 2590 2591 2592 2593 2594/** 2595 * Public static functions 2596 */ 2597$.magnificPopup = { 2598 instance: null, 2599 proto: MagnificPopup.prototype, 2600 modules: [], 2601 2602 open: function(options, index) { 2603 _checkInstance(); 2604 2605 if(!options) { 2606 options = {}; 2607 } else { 2608 options = $.extend(true, {}, options); 2609 } 2610 2611 options.isObj = true; 2612 options.index = index || 0; 2613 return this.instance.open(options); 2614 }, 2615 2616 close: function() { 2617 return $.magnificPopup.instance && $.magnificPopup.instance.close(); 2618 }, 2619 2620 registerModule: function(name, module) { 2621 if(module.options) { 2622 $.magnificPopup.defaults[name] = module.options; 2623 } 2624 $.extend(this.proto, module.proto); 2625 this.modules.push(name); 2626 }, 2627 2628 defaults: { 2629 2630 // Info about options is in docs: 2631 // http://dimsemenov.com/plugins/magnific-popup/documentation.html#options 2632 2633 disableOn: 0, 2634 2635 key: null, 2636 2637 midClick: false, 2638 2639 mainClass: '', 2640 2641 preloader: true, 2642 2643 focus: '', // CSS selector of input to focus after popup is opened 2644 2645 closeOnContentClick: false, 2646 2647 closeOnBgClick: true, 2648 2649 closeBtnInside: true, 2650 2651 showCloseBtn: true, 2652 2653 enableEscapeKey: true, 2654 2655 modal: false, 2656 2657 alignTop: false, 2658 2659 removalDelay: 0, 2660 2661 prependTo: null, 2662 2663 fixedContentPos: 'auto', 2664 2665 fixedBgPos: 'auto', 2666 2667 overflowY: 'auto', 2668 2669 closeMarkup: '<button title="%title%" type="button" class="mfp-close">×</button>', 2670 2671 tClose: 'Close (Esc)', 2672 2673 tLoading: 'Loading...', 2674 2675 autoFocusLast: true 2676 2677 } 2678}; 2679 2680 2681 2682$.fn.magnificPopup = function(options) { 2683 _checkInstance(); 2684 2685 var jqEl = $(this); 2686 2687 // We call some API method of first param is a string 2688 if (typeof options === "string" ) { 2689 2690 if(options === 'open') { 2691 var items, 2692 itemOpts = _isJQ ? jqEl.data('magnificPopup') : jqEl[0].magnificPopup, 2693 index = parseInt(arguments[1], 10) || 0; 2694 2695 if(itemOpts.items) { 2696 items = itemOpts.items[index]; 2697 } else { 2698 items = jqEl; 2699 if(itemOpts.delegate) { 2700 items = items.find(itemOpts.delegate); 2701 } 2702 items = items.eq( index ); 2703 } 2704 mfp._openClick({mfpEl:items}, jqEl, itemOpts); 2705 } else { 2706 if(mfp.isOpen) 2707 mfp[options].apply(mfp, Array.prototype.slice.call(arguments, 1)); 2708 } 2709 2710 } else { 2711 // clone options obj 2712 options = $.extend(true, {}, options); 2713 2714 /* 2715 * As Zepto doesn't support .data() method for objects 2716 * and it works only in normal browsers 2717 * we assign "options" object directly to the DOM element. FTW! 2718 */ 2719 if(_isJQ) { 2720 jqEl.data('magnificPopup', options); 2721 } else { 2722 jqEl[0].magnificPopup = options; 2723 } 2724 2725 mfp.addGroup(jqEl, options); 2726 2727 } 2728 return jqEl; 2729}; 2730 2731/*>>core*/ 2732 2733/*>>inline*/ 2734 2735var INLINE_NS = 'inline', 2736 _hiddenClass, 2737 _inlinePlaceholder, 2738 _lastInlineElement, 2739 _putInlineElementsBack = function() { 2740 if(_lastInlineElement) { 2741 _inlinePlaceholder.after( _lastInlineElement.addClass(_hiddenClass) ).detach(); 2742 _lastInlineElement = null; 2743 } 2744 }; 2745 2746$.magnificPopup.registerModule(INLINE_NS, { 2747 options: { 2748 hiddenClass: 'hide', // will be appended with `mfp-` prefix 2749 markup: '', 2750 tNotFound: 'Content not found' 2751 }, 2752 proto: { 2753 2754 initInline: function() { 2755 mfp.types.push(INLINE_NS); 2756 2757 _mfpOn(CLOSE_EVENT+'.'+INLINE_NS, function() { 2758 _putInlineElementsBack(); 2759 }); 2760 }, 2761 2762 getInline: function(item, template) { 2763 2764 _putInlineElementsBack(); 2765 2766 if(item.src) { 2767 var inlineSt = mfp.st.inline, 2768 el = $(item.src); 2769 2770 if(el.length) { 2771 2772 // If target element has parent - we replace it with placeholder and put it back after popup is closed 2773 var parent = el[0].parentNode; 2774 if(parent && parent.tagName) { 2775 if(!_inlinePlaceholder) { 2776 _hiddenClass = inlineSt.hiddenClass; 2777 _inlinePlaceholder = _getEl(_hiddenClass); 2778 _hiddenClass = 'mfp-'+_hiddenClass; 2779 } 2780 // replace target inline element with placeholder 2781 _lastInlineElement = el.after(_inlinePlaceholder).detach().removeClass(_hiddenClass); 2782 } 2783 2784 mfp.updateStatus('ready'); 2785 } else { 2786 mfp.updateStatus('error', inlineSt.tNotFound); 2787 el = $('<div>'); 2788 } 2789 2790 item.inlineElement = el; 2791 return el; 2792 } 2793 2794 mfp.updateStatus('ready'); 2795 mfp._parseMarkup(template, {}, item); 2796 return template; 2797 } 2798 } 2799}); 2800 2801/*>>inline*/ 2802 2803/*>>ajax*/ 2804var AJAX_NS = 'ajax', 2805 _ajaxCur, 2806 _removeAjaxCursor = function() { 2807 if(_ajaxCur) { 2808 $(document.body).removeClass(_ajaxCur); 2809 } 2810 }, 2811 _destroyAjaxRequest = function() { 2812 _removeAjaxCursor(); 2813 if(mfp.req) { 2814 mfp.req.abort(); 2815 } 2816 }; 2817 2818$.magnificPopup.registerModule(AJAX_NS, { 2819 2820 options: { 2821 settings: null, 2822 cursor: 'mfp-ajax-cur', 2823 tError: '<a href="%url%">The content</a> could not be loaded.' 2824 }, 2825 2826 proto: { 2827 initAjax: function() { 2828 mfp.types.push(AJAX_NS); 2829 _ajaxCur = mfp.st.ajax.cursor; 2830 2831 _mfpOn(CLOSE_EVENT+'.'+AJAX_NS, _destroyAjaxRequest); 2832 _mfpOn('BeforeChange.' + AJAX_NS, _destroyAjaxRequest); 2833 }, 2834 getAjax: function(item) { 2835 2836 if(_ajaxCur) { 2837 $(document.body).addClass(_ajaxCur); 2838 } 2839 2840 mfp.updateStatus('loading'); 2841 2842 var opts = $.extend({ 2843 url: item.src, 2844 success: function(data, textStatus, jqXHR) { 2845 var temp = { 2846 data:data, 2847 xhr:jqXHR 2848 }; 2849 2850 _mfpTrigger('ParseAjax', temp); 2851 2852 mfp.appendContent( $(temp.data), AJAX_NS ); 2853 2854 item.finished = true; 2855 2856 _removeAjaxCursor(); 2857 2858 mfp._setFocus(); 2859 2860 setTimeout(function() { 2861 mfp.wrap.addClass(READY_CLASS); 2862 }, 16); 2863 2864 mfp.updateStatus('ready'); 2865 2866 _mfpTrigger('AjaxContentAdded'); 2867 }, 2868 error: function() { 2869 _removeAjaxCursor(); 2870 item.finished = item.loadError = true; 2871 mfp.updateStatus('error', mfp.st.ajax.tError.replace('%url%', item.src)); 2872 } 2873 }, mfp.st.ajax.settings); 2874 2875 mfp.req = $.ajax(opts); 2876 2877 return ''; 2878 } 2879 } 2880}); 2881 2882/*>>ajax*/ 2883 2884/*>>image*/ 2885var _imgInterval, 2886 _getTitle = function(item) { 2887 if(item.data && item.data.title !== undefined) 2888 return item.data.title; 2889 2890 var src = mfp.st.image.titleSrc; 2891 2892 if(src) { 2893 if($.isFunction(src)) { 2894 return src.call(mfp, item); 2895 } else if(item.el) { 2896 return item.el.attr(src) || ''; 2897 } 2898 } 2899 return ''; 2900 }; 2901 2902$.magnificPopup.registerModule('image', { 2903 2904 options: { 2905 markup: '<div class="mfp-figure">'+ 2906 '<div class="mfp-close"></div>'+ 2907 '<figure>'+ 2908 '<div class="mfp-img"></div>'+ 2909 '<figcaption>'+ 2910 '<div class="mfp-bottom-bar">'+ 2911 '<div class="mfp-title"></div>'+ 2912 '<div class="mfp-counter"></div>'+ 2913 '</div>'+ 2914 '</figcaption>'+ 2915 '</figure>'+ 2916 '</div>', 2917 cursor: 'mfp-zoom-out-cur', 2918 titleSrc: 'title', 2919 verticalFit: true, 2920 tError: '<a href="%url%">The image</a> could not be loaded.' 2921 }, 2922 2923 proto: { 2924 initImage: function() { 2925 var imgSt = mfp.st.image, 2926 ns = '.image'; 2927 2928 mfp.types.push('image'); 2929 2930 _mfpOn(OPEN_EVENT+ns, function() { 2931 if(mfp.currItem.type === 'image' && imgSt.cursor) { 2932 $(document.body).addClass(imgSt.cursor); 2933 } 2934 }); 2935 2936 _mfpOn(CLOSE_EVENT+ns, function() { 2937 if(imgSt.cursor) { 2938 $(document.body).removeClass(imgSt.cursor); 2939 } 2940 _window.off('resize' + EVENT_NS); 2941 }); 2942 2943 _mfpOn('Resize'+ns, mfp.resizeImage); 2944 if(mfp.isLowIE) { 2945 _mfpOn('AfterChange', mfp.resizeImage); 2946 } 2947 }, 2948 resizeImage: function() { 2949 var item = mfp.currItem; 2950 if(!item || !item.img) return; 2951 2952 if(mfp.st.image.verticalFit) { 2953 var decr = 0; 2954 // fix box-sizing in ie7/8 2955 if(mfp.isLowIE) { 2956 decr = parseInt(item.img.css('padding-top'), 10) + parseInt(item.img.css('padding-bottom'),10); 2957 } 2958 item.img.css('max-height', mfp.wH-decr); 2959 } 2960 }, 2961 _onImageHasSize: function(item) { 2962 if(item.img) { 2963 2964 item.hasSize = true; 2965 2966 if(_imgInterval) { 2967 clearInterval(_imgInterval); 2968 } 2969 2970 item.isCheckingImgSize = false; 2971 2972 _mfpTrigger('ImageHasSize', item); 2973 2974 if(item.imgHidden) { 2975 if(mfp.content) 2976 mfp.content.removeClass('mfp-loading'); 2977 2978 item.imgHidden = false; 2979 } 2980 2981 } 2982 }, 2983 2984 /** 2985 * Function that loops until the image has size to display elements that rely on it asap 2986 */ 2987 findImageSize: function(item) { 2988 2989 var counter = 0, 2990 img = item.img[0], 2991 mfpSetInterval = function(delay) { 2992 2993 if(_imgInterval) { 2994 clearInterval(_imgInterval); 2995 } 2996 // decelerating interval that checks for size of an image 2997 _imgInterval = setInterval(function() { 2998 if(img.naturalWidth > 0) { 2999 mfp._onImageHasSize(item); 3000 return; 3001 } 3002 3003 if(counter > 200) { 3004 clearInterval(_imgInterval); 3005 } 3006 3007 counter++; 3008 if(counter === 3) { 3009 mfpSetInterval(10); 3010 } else if(counter === 40) { 3011 mfpSetInterval(50); 3012 } else if(counter === 100) { 3013 mfpSetInterval(500); 3014 } 3015 }, delay); 3016 }; 3017 3018 mfpSetInterval(1); 3019 }, 3020 3021 getImage: function(item, template) { 3022 3023 var guard = 0, 3024 3025 // image load complete handler 3026 onLoadComplete = function() { 3027 if(item) { 3028 if (item.img[0].complete) { 3029 item.img.off('.mfploader'); 3030 3031 if(item === mfp.currItem){ 3032 mfp._onImageHasSize(item); 3033 3034 mfp.updateStatus('ready'); 3035 } 3036 3037 item.hasSize = true; 3038 item.loaded = true; 3039 3040 _mfpTrigger('ImageLoadComplete'); 3041 3042 } 3043 else { 3044 // if image complete check fails 200 times (20 sec), we assume that there was an error. 3045 guard++; 3046 if(guard < 200) { 3047 setTimeout(onLoadComplete,100); 3048 } else { 3049 onLoadError(); 3050 } 3051 } 3052 } 3053 }, 3054 3055 // image error handler 3056 onLoadError = function() { 3057 if(item) { 3058 item.img.off('.mfploader'); 3059 if(item === mfp.currItem){ 3060 mfp._onImageHasSize(item); 3061 mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); 3062 } 3063 3064 item.hasSize = true; 3065 item.loaded = true; 3066 item.loadError = true; 3067 } 3068 }, 3069 imgSt = mfp.st.image; 3070 3071 3072 var el = template.find('.mfp-img'); 3073 if(el.length) { 3074 var img = document.createElement('img'); 3075 img.className = 'mfp-img'; 3076 if(item.el && item.el.find('img').length) { 3077 img.alt = item.el.find('img').attr('alt'); 3078 } 3079 item.img = $(img).on('load.mfploader', onLoadComplete).on('error.mfploader', onLoadError); 3080 img.src = item.src; 3081 3082 // without clone() "error" event is not firing when IMG is replaced by new IMG 3083 // TODO: find a way to avoid such cloning 3084 if(el.is('img')) { 3085 item.img = item.img.clone(); 3086 } 3087 3088 img = item.img[0]; 3089 if(img.naturalWidth > 0) { 3090 item.hasSize = true; 3091 } else if(!img.width) { 3092 item.hasSize = false; 3093 } 3094 } 3095 3096 mfp._parseMarkup(template, { 3097 title: _getTitle(item), 3098 img_replaceWith: item.img 3099 }, item); 3100 3101 mfp.resizeImage(); 3102 3103 if(item.hasSize) { 3104 if(_imgInterval) clearInterval(_imgInterval); 3105 3106 if(item.loadError) { 3107 template.addClass('mfp-loading'); 3108 mfp.updateStatus('error', imgSt.tError.replace('%url%', item.src) ); 3109 } else { 3110 template.removeClass('mfp-loading'); 3111 mfp.updateStatus('ready'); 3112 } 3113 return template; 3114 } 3115 3116 mfp.updateStatus('loading'); 3117 item.loading = true; 3118 3119 if(!item.hasSize) { 3120 item.imgHidden = true; 3121 template.addClass('mfp-loading'); 3122 mfp.findImageSize(item); 3123 } 3124 3125 return template; 3126 } 3127 } 3128}); 3129 3130/*>>image*/ 3131 3132/*>>zoom*/ 3133var hasMozTransform, 3134 getHasMozTransform = function() { 3135 if(hasMozTransform === undefined) { 3136 hasMozTransform = document.createElement('p').style.MozTransform !== undefined; 3137 } 3138 return hasMozTransform; 3139 }; 3140 3141$.magnificPopup.registerModule('zoom', { 3142 3143 options: { 3144 enabled: false, 3145 easing: 'ease-in-out', 3146 duration: 300, 3147 opener: function(element) { 3148 return element.is('img') ? element : element.find('img'); 3149 } 3150 }, 3151 3152 proto: { 3153 3154 initZoom: function() { 3155 var zoomSt = mfp.st.zoom, 3156 ns = '.zoom', 3157 image; 3158 3159 if(!zoomSt.enabled || !mfp.supportsTransition) { 3160 return; 3161 } 3162 3163 var duration = zoomSt.duration, 3164 getElToAnimate = function(image) { 3165 var newImg = image.clone().removeAttr('style').removeAttr('class').addClass('mfp-animated-image'), 3166 transition = 'all '+(zoomSt.duration/1000)+'s ' + zoomSt.easing, 3167 cssObj = { 3168 position: 'fixed', 3169 zIndex: 9999, 3170 left: 0, 3171 top: 0, 3172 '-webkit-backface-visibility': 'hidden' 3173 }, 3174 t = 'transition'; 3175 3176 cssObj['-webkit-'+t] = cssObj['-moz-'+t] = cssObj['-o-'+t] = cssObj[t] = transition; 3177 3178 newImg.css(cssObj); 3179 return newImg; 3180 }, 3181 showMainContent = function() { 3182 mfp.content.css('visibility', 'visible'); 3183 }, 3184 openTimeout, 3185 animatedImg; 3186 3187 _mfpOn('BuildControls'+ns, function() { 3188 if(mfp._allowZoom()) { 3189 3190 clearTimeout(openTimeout); 3191 mfp.content.css('visibility', 'hidden'); 3192 3193 // Basically, all code below does is clones existing image, puts in on top of the current one and animated it 3194 3195 image = mfp._getItemToZoom(); 3196 3197 if(!image) { 3198 showMainContent(); 3199 return; 3200 } 3201 3202 animatedImg = getElToAnimate(image); 3203 3204 animatedImg.css( mfp._getOffset() ); 3205 3206 mfp.wrap.append(animatedImg); 3207 3208 openTimeout = setTimeout(function() { 3209 animatedImg.css( mfp._getOffset( true ) ); 3210 openTimeout = setTimeout(function() { 3211 3212 showMainContent(); 3213 3214 setTimeout(function() { 3215 animatedImg.remove(); 3216 image = animatedImg = null; 3217 _mfpTrigger('ZoomAnimationEnded'); 3218 }, 16); // avoid blink when switching images 3219 3220 }, duration); // this timeout equals animation duration 3221 3222 }, 16); // by adding this timeout we avoid short glitch at the beginning of animation 3223 3224 3225 // Lots of timeouts... 3226 } 3227 }); 3228 _mfpOn(BEFORE_CLOSE_EVENT+ns, function() { 3229 if(mfp._allowZoom()) { 3230 3231 clearTimeout(openTimeout); 3232 3233 mfp.st.removalDelay = duration; 3234 3235 if(!image) { 3236 image = mfp._getItemToZoom(); 3237 if(!image) { 3238 return; 3239 } 3240 animatedImg = getElToAnimate(image); 3241 } 3242 3243 animatedImg.css( mfp._getOffset(true) ); 3244 mfp.wrap.append(animatedImg); 3245 mfp.content.css('visibility', 'hidden'); 3246 3247 setTimeout(function() { 3248 animatedImg.css( mfp._getOffset() ); 3249 }, 16); 3250 } 3251 3252 }); 3253 3254 _mfpOn(CLOSE_EVENT+ns, function() { 3255 if(mfp._allowZoom()) { 3256 showMainContent(); 3257 if(animatedImg) { 3258 animatedImg.remove(); 3259 } 3260 image = null; 3261 } 3262 }); 3263 }, 3264 3265 _allowZoom: function() { 3266 return mfp.currItem.type === 'image'; 3267 }, 3268 3269 _getItemToZoom: function() { 3270 if(mfp.currItem.hasSize) { 3271 return mfp.currItem.img; 3272 } else { 3273 return false; 3274 } 3275 }, 3276 3277 // Get element postion relative to viewport 3278 _getOffset: function(isLarge) { 3279 var el; 3280 if(isLarge) { 3281 el = mfp.currItem.img; 3282 } else { 3283 el = mfp.st.zoom.opener(mfp.currItem.el || mfp.currItem); 3284 } 3285 3286 var offset = el.offset(); 3287 var paddingTop = parseInt(el.css('padding-top'),10); 3288 var paddingBottom = parseInt(el.css('padding-bottom'),10); 3289 offset.top -= ( $(window).scrollTop() - paddingTop ); 3290 3291 3292 /* 3293 3294 Animating left + top + width/height looks glitchy in Firefox, but perfect in Chrome. And vice-versa. 3295 3296 */ 3297 var obj = { 3298 width: el.width(), 3299 // fix Zepto height+padding issue 3300 height: (_isJQ ? el.innerHeight() : el[0].offsetHeight) - paddingBottom - paddingTop 3301 }; 3302 3303 // I hate to do this, but there is no another option 3304 if( getHasMozTransform() ) { 3305 obj['-moz-transform'] = obj['transform'] = 'translate(' + offset.left + 'px,' + offset.top + 'px)'; 3306 } else { 3307 obj.left = offset.left; 3308 obj.top = offset.top; 3309 } 3310 return obj; 3311 } 3312 3313 } 3314}); 3315 3316 3317 3318/*>>zoom*/ 3319 3320/*>>iframe*/ 3321 3322var IFRAME_NS = 'iframe', 3323 _emptyPage = '//about:blank', 3324 3325 _fixIframeBugs = function(isShowing) { 3326 if(mfp.currTemplate[IFRAME_NS]) { 3327 var el = mfp.currTemplate[IFRAME_NS].find('iframe'); 3328 if(el.length) { 3329 // reset src after the popup is closed to avoid "video keeps playing after popup is closed" bug 3330 if(!isShowing) { 3331 el[0].src = _emptyPage; 3332 } 3333 3334 // IE8 black screen bug fix 3335 if(mfp.isIE8) { 3336 el.css('display', isShowing ? 'block' : 'none'); 3337 } 3338 } 3339 } 3340 }; 3341 3342$.magnificPopup.registerModule(IFRAME_NS, { 3343 3344 options: { 3345 markup: '<div class="mfp-iframe-scaler">'+ 3346 '<div class="mfp-close"></div>'+ 3347 '<iframe class="mfp-iframe" src="//about:blank" frameborder="0" allowfullscreen></iframe>'+ 3348 '</div>', 3349 3350 srcAction: 'iframe_src', 3351 3352 // we don't care and support only one default type of URL by default 3353 patterns: { 3354 youtube: { 3355 index: 'youtube.com', 3356 id: 'v=', 3357 src: '//www.youtube.com/embed/%id%?autohide=1&rel=0&autoplay=1&playsinline=1&iv_load_policy=3&modestbranding=1' 3358 }, 3359 youtu: { 3360 index: 'youtu.be', 3361 id: '/', 3362 src: '//www.youtube.com/embed/%id%?autohide=1&rel=0&autoplay=1&playsinline=1&iv_load_policy=3&modestbranding=1' 3363 }, 3364 vimeo: { 3365 index: 'vimeo.com/', 3366 id: '/', 3367 src: '//player.vimeo.com/video/%id%?autoplay=1' 3368 }, 3369 gmaps: { 3370 index: '//maps.google.', 3371 src: '%id%&output=embed' 3372 } 3373 } 3374 }, 3375 3376 proto: { 3377 initIframe: function() { 3378 mfp.types.push(IFRAME_NS); 3379 3380 _mfpOn('BeforeChange', function(e, prevType, newType) { 3381 if(prevType !== newType) { 3382 if(prevType === IFRAME_NS) { 3383 _fixIframeBugs(); // iframe if removed 3384 } else if(newType === IFRAME_NS) { 3385 _fixIframeBugs(true); // iframe is showing 3386 } 3387 }// else { 3388 // iframe source is switched, don't do anything 3389 //} 3390 }); 3391 3392 _mfpOn(CLOSE_EVENT + '.' + IFRAME_NS, function() { 3393 _fixIframeBugs(); 3394 }); 3395 }, 3396 3397 getIframe: function(item, template) { 3398 var embedSrc = item.src; 3399 var iframeSt = mfp.st.iframe; 3400 3401 $.each(iframeSt.patterns, function() { 3402 if(embedSrc.indexOf( this.index ) > -1) { 3403 if(this.id) { 3404 if(typeof this.id === 'string') { 3405 embedSrc = embedSrc.substr(embedSrc.lastIndexOf(this.id)+this.id.length, embedSrc.length); 3406 } else { 3407 embedSrc = this.id.call( this, embedSrc ); 3408 } 3409 } 3410 embedSrc = this.src.replace('%id%', embedSrc ); 3411 return false; // break; 3412 } 3413 }); 3414 3415 var dataObj = {}; 3416 if(iframeSt.srcAction) { 3417 dataObj[iframeSt.srcAction] = embedSrc; 3418 } 3419 mfp._parseMarkup(template, dataObj, item); 3420 3421 mfp.updateStatus('ready'); 3422 3423 return template; 3424 } 3425 } 3426}); 3427 3428 3429 3430/*>>iframe*/ 3431 3432/*>>gallery*/ 3433/** 3434 * Get looped index depending on number of slides 3435 */ 3436var _getLoopedId = function(index) { 3437 var numSlides = mfp.items.length; 3438 if(index > numSlides - 1) { 3439 return index - numSlides; 3440 } else if(index < 0) { 3441 return numSlides + index; 3442 } 3443 return index; 3444 }, 3445 _replaceCurrTotal = function(text, curr, total) { 3446 return text.replace(/%curr%/gi, curr + 1).replace(/%total%/gi, total); 3447 }; 3448 3449$.magnificPopup.registerModule('gallery', { 3450 3451 options: { 3452 enabled: false, 3453 arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', 3454 preload: [0,2], 3455 navigateByImgClick: true, 3456 arrows: true, 3457 3458 tPrev: 'Previous (Left arrow key)', 3459 tNext: 'Next (Right arrow key)', 3460 tCounter: '%curr% of %total%' 3461 }, 3462 3463 proto: { 3464 initGallery: function() { 3465 3466 var gSt = mfp.st.gallery, 3467 ns = '.mfp-gallery'; 3468 3469 mfp.direction = true; // true - next, false - prev 3470 3471 if(!gSt || !gSt.enabled ) return false; 3472 3473 _wrapClasses += ' mfp-gallery'; 3474 3475 _mfpOn(OPEN_EVENT+ns, function() { 3476 3477 if(gSt.navigateByImgClick) { 3478 mfp.wrap.on('click'+ns, '.mfp-img', function() { 3479 if(mfp.items.length > 1) { 3480 mfp.next(); 3481 return false; 3482 } 3483 }); 3484 } 3485 3486 _document.on('keydown'+ns, function(e) { 3487 if (e.keyCode === 37) { 3488 mfp.prev(); 3489 } else if (e.keyCode === 39) { 3490 mfp.next(); 3491 } 3492 }); 3493 }); 3494 3495 _mfpOn('UpdateStatus'+ns, function(e, data) { 3496 if(data.text) { 3497 data.text = _replaceCurrTotal(data.text, mfp.currItem.index, mfp.items.length); 3498 } 3499 }); 3500 3501 _mfpOn(MARKUP_PARSE_EVENT+ns, function(e, element, values, item) { 3502 var l = mfp.items.length; 3503 values.counter = l > 1 ? _replaceCurrTotal(gSt.tCounter, item.index, l) : ''; 3504 }); 3505 3506 _mfpOn('BuildControls' + ns, function() { 3507 if(mfp.items.length > 1 && gSt.arrows && !mfp.arrowLeft) { 3508 var markup = gSt.arrowMarkup, 3509 arrowLeft = mfp.arrowLeft = $( markup.replace(/%title%/gi, gSt.tPrev).replace(/%dir%/gi, 'left') ).addClass(PREVENT_CLOSE_CLASS), 3510 arrowRight = mfp.arrowRight = $( markup.replace(/%title%/gi, gSt.tNext).replace(/%dir%/gi, 'right') ).addClass(PREVENT_CLOSE_CLASS); 3511 3512 arrowLeft.click(function() { 3513 mfp.prev(); 3514 }); 3515 arrowRight.click(function() { 3516 mfp.next(); 3517 }); 3518 3519 mfp.container.append(arrowLeft.add(arrowRight)); 3520 } 3521 }); 3522 3523 _mfpOn(CHANGE_EVENT+ns, function() { 3524 if(mfp._preloadTimeout) clearTimeout(mfp._preloadTimeout); 3525 3526 mfp._preloadTimeout = setTimeout(function() { 3527 mfp.preloadNearbyImages(); 3528 mfp._preloadTimeout = null; 3529 }, 16); 3530 }); 3531 3532 3533 _mfpOn(CLOSE_EVENT+ns, function() { 3534 _document.off(ns); 3535 mfp.wrap.off('click'+ns); 3536 mfp.arrowRight = mfp.arrowLeft = null; 3537 }); 3538 3539 }, 3540 next: function() { 3541 mfp.direction = true; 3542 mfp.index = _getLoopedId(mfp.index + 1); 3543 mfp.updateItemHTML(); 3544 }, 3545 prev: function() { 3546 mfp.direction = false; 3547 mfp.index = _getLoopedId(mfp.index - 1); 3548 mfp.updateItemHTML(); 3549 }, 3550 goTo: function(newIndex) { 3551 mfp.direction = (newIndex >= mfp.index); 3552 mfp.index = newIndex; 3553 mfp.updateItemHTML(); 3554 }, 3555 preloadNearbyImages: function() { 3556 var p = mfp.st.gallery.preload, 3557 preloadBefore = Math.min(p[0], mfp.items.length), 3558 preloadAfter = Math.min(p[1], mfp.items.length), 3559 i; 3560 3561 for(i = 1; i <= (mfp.direction ? preloadAfter : preloadBefore); i++) { 3562 mfp._preloadItem(mfp.index+i); 3563 } 3564 for(i = 1; i <= (mfp.direction ? preloadBefore : preloadAfter); i++) { 3565 mfp._preloadItem(mfp.index-i); 3566 } 3567 }, 3568 _preloadItem: function(index) { 3569 index = _getLoopedId(index); 3570 3571 if(mfp.items[index].preloaded) { 3572 return; 3573 } 3574 3575 var item = mfp.items[index]; 3576 if(!item.parsed) { 3577 item = mfp.parseEl( index ); 3578 } 3579 3580 _mfpTrigger('LazyLoad', item); 3581 3582 if(item.type === 'image') { 3583 item.img = $('<img class="mfp-img" />').on('load.mfploader', function() { 3584 item.hasSize = true; 3585 }).on('error.mfploader', function() { 3586 item.hasSize = true; 3587 item.loadError = true; 3588 _mfpTrigger('LazyLoadError', item); 3589 }).attr('src', item.src); 3590 } 3591 3592 3593 item.preloaded = true; 3594 } 3595 } 3596}); 3597 3598/*>>gallery*/ 3599 3600 3601 _checkInstance(); })); 3602
vendor: 36,085 bytes, lines 3603-3609
3603/** 3604 * Owl Carousel v2.3.4 3605 * Copyright 2013-2018 David Deutsch 3606 * Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE 3607 */ 3608!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,checkVisibility:!0,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",slideTransition:"",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>0;)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,g-=1;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.$stage.children(".center").removeClass("center"),this.settings.center&&this.$stage.children().eq(this.current()).addClass("center")}}],e.prototype.initializeStage=function(){this.$stage=this.$element.find("."+this.settings.stageClass),this.$stage.length||(this.$element.addClass(this.options.loadingClass),this.$stage=a("<"+this.settings.stageElement+">",{class:this.settings.stageClass}).wrap(a("<div/>",{class:this.settings.stageOuterClass})),this.$element.append(this.$stage.parent()))},e.prototype.initializeItems=function(){var b=this.$element.find(".owl-item");if(b.length)return this._items=b.get().map(function(b){return a(b)}),this._mergers=this._items.map(function(){return 1}),void this.refresh();this.replace(this.$element.children().not(this.$stage.parent())),this.isVisible()?this.refresh():this.invalidate("width"),this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass)},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 a,b,c;a=this.$element.find("img"),b=this.settings.nestedItemSelector?"."+this.settings.nestedItemSelector:d,c=this.$element.children(b).width(),a.length&&c<=0&&this.preloadAutoWidthImages(a)}this.initializeStage(),this.initializeItems(),this.registerEventHandlers(),this.leave("initializing"),this.trigger("initialized")},e.prototype.isVisible=function(){return!this.settings.checkVisibility||this.$element.is(":visible")},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.isVisible()&&(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)),!1!==this.settings.responsive&&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 e=-1,f=30,g=this.width(),h=this.coordinates();return this.settings.freeDrag||a.each(h,a.proxy(function(a,i){return"left"===c&&b>i-f&&b<i+f?e=a:"right"===c&&b>i-g-f&&b<i-g+f?e=a+1:this.op(b,"<",i)&&this.op(b,">",h[a+1]!==d?h[a+1]:i-g)&&(e="left"===c?a+1:a),-1===e},this)),this.settings.loop||(this.op(b,">",h[this.minimum()])?e=b=this.minimum():this.op(b,"<",h[this.maximum()])&&(e=b=this.maximum())),e},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"+(this.settings.slideTransition?" "+this.settings.slideTransition:"")}):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))!==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){if(b=this._items.length)for(c=this._items[--b].width(),d=this.$element.width();b--&&!((c+=this._items[b].width()+this.settings.margin)>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+=-1*f*g),a=c+e,(d=((a-h)%g+g)%g+h)!==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.isVisible()&&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))!==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"),!1!==this.settings.responsive&&(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.$stage.remove(),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&&-1!==a.namespace.indexOf("owl")?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.isVisible(),this._interval=b.setInterval(a.proxy(this.refresh,this),this._core.settings.autoRefreshInterval))},e.prototype.refresh=function(){this._core.isVisible()!==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)){var c=this._core.settings,e=c.center&&Math.ceil(c.items/2)||c.items,f=c.center&&-1*e||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);for(c.lazyLoadEager>0&&(e+=c.lazyLoadEager,c.loop&&(g-=c.lazyLoadEager,e++));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,lazyLoadEager:0},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")||f.attr("data-srcset");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):f.is("source")?f.one("load.owl.lazy",a.proxy(function(){this._core.trigger("loaded",{element:f,url:g},"lazy")},this)).attr("srcset",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(c){this._core=c,this._previousHeight=null,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),this._intervalId=null;var d=this;a(b).on("load",function(){d._core.settings.autoHeight&&d.update()}),a(b).resize(function(){d._core.settings.autoHeight&&(null!=d._intervalId&&clearTimeout(d._intervalId),d._intervalId=setTimeout(function(){d.update()},250))})};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.settings.lazyLoad,e=this._core.$stage.children().toArray().slice(b,c),f=[],g=0;a.each(e,function(b,c){f.push(a(c).height())}),g=Math.max.apply(null,f),g<=1&&d&&this._previousHeight&&(g=this._previousHeight),this._previousHeight=g,this._core.$stage.parent().height(g).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|be\-nocookie\.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?"width:"+c.width+"px;height:"+c.height+"px;":"",h=b.find("img"),i="src",j="",k=this._core.settings,l=function(c){e='<div class="owl-video-play-icon"></div>',d=k.lazyLoad?a("<div/>",{class:"owl-video-tn "+j,srcType:c}):a("<div/>",{class:"owl-video-tn",style:"opacity:1;background-image:url("+c+")"}),b.after(d),b.after(e)};if(b.wrap(a("<div/>",{class:"owl-video-wrapper",style:g})),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()),c=a('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>'),c.attr("height",h),c.attr("width",g),"youtube"===f.type?c.attr("src","//www.youtube.com/embed/"+f.id+"?autoplay=1&rel=0&v="+f.id):"vimeo"===f.type?c.attr("src","//player.vimeo.com/video/"+f.id+"?autoplay=1"):"vzaar"===f.type&&c.attr("src","//view.vzaar.com/"+f.id+"/player?autoplay=true"),a(c).wrap('<div class="owl-video-frame" />').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, 3609animateIn:!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)},a.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._call=null,this._time=0,this._timeout=0,this._paused=!0,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._paused&&(this._time=0)},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._next=function(d){this._call=b.setTimeout(a.proxy(this._next,this,d),this._timeout*(Math.round(this.read()/this._timeout)+1)-this.read()),this._core.is("interacting")||c.hidden||this._core.next(d||this._core.settings.autoplaySpeed)},e.prototype.read=function(){return(new Date).getTime()-this._time},e.prototype.play=function(c,d){var e;this._core.is("rotating")||this._core.enter("rotating"),c=c||this._core.settings.autoplayTimeout,e=Math.min(this._time%(this._timeout||c),c),this._paused?(this._time=this.read(),this._paused=!1):b.clearTimeout(this._call),this._time+=this.read()%c-e,this._timeout=c,this._call=b.setTimeout(a.proxy(this._next,this,d),c-e)},e.prototype.stop=function(){this._core.is("rotating")&&(this._time=0,this._paused=!0,b.clearTimeout(this._call),this._core.leave("rotating"))},e.prototype.pause=function(){this._core.is("rotating")&&!this._paused&&(this._time=this.read(),this._paused=!0,b.clearTimeout(this._call))},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}
vendor: 5,569 bytes, line 3609
3609,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:['<span aria-label="Previous">‹</span>','<span aria-label="Next">›</span>'],navSpeed:!1,navElement:'button type="button" role="presentation"',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('<button role="button">').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","button",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,e;e=this._core.settings;for(a in this._handlers)this.$element.off(a,this._handlers[a]);for(b in this._controls)"$relative"===b&&e.navContainer?this._controls[b].html(""):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}(
vendor: 3,357 bytes, lines 3609-3629
3609window.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); 3610 3611 3612/*********************************** 3613Nav Accordion Plugin v1.1.2 3614************************************/ 3615(function($) { 3616 $.fn.navAccordion = function(options, callback) { 3617 this.each(function() { 3618 var settings = $.extend({ 3619 expandButtonText: "+", 3620 collapseButtonText: "-", 3621 selectedExpand: "true", 3622 selectedClass: "selected", 3623 multipleLevels: "true", 3624 buttonWidth: "20%", 3625 buttonPosition: "right", 3626 slideSpeed: "fast", 3627 parentElement: "li", 3628 childElement: "ul", 3629 headersOnly: false,
vendor: 4,734 bytes, lines 3630-3712
3630 headersOnlyCheck: false, 3631 delayLink: false, 3632 delayAmount: null 3633 }, options); 3634 var container = this, 3635 multi = settings.multipleLevels ? '' : ' > ' + settings.childElement + ' > '; 3636 $(container).addClass('accordion-nav'); 3637 $(multi + settings.parentElement, container).each(function() { 3638 if (($(this).contents(settings.childElement).length > 0 && settings.headersOnlyCheck == false) || (!($('> a', this).attr('href')) && settings.headersOnlyCheck == true)) { 3639 $(this).addClass('has-subnav').css('position', 'relative').find('>a').css('margin-' + settings.buttonPosition, settings.buttonWidth); 3640 $(' > ' + settings.childElement, this).before('<span class="accordion-btn-wrap"><span class="accordion-btn accordion-collapsed">' + settings.expandButtonText + '</span><span class="accordion-btn accordion-expanded">' + settings.collapseButtonText + '</span></span>'); 3641 $('.accordion-btn-wrap', this).css({ 3642 'width': settings.buttonWidth, 3643 'position': 'absolute', 3644 'top': 0, 3645 'text-align': 'center', 3646 'cursor': 'pointer', 3647 'display': 'inline-block' 3648 }).css(settings.buttonPosition, 0); 3649 $('.accordion-btn ', this).css({ 3650 'display': 'inline-block', 3651 'width': '100%' 3652 }); 3653 $('.accordion-expanded', this).css('display', 'none'); 3654 } 3655 if (!($('> a', this).attr('href')) || settings.headersOnly) { 3656 $(this).addClass('accordion-header-only').find('.accordion-btn-wrap').css({ 3657 'width': '100%', 3658 'text-align': settings.buttonPosition 3659 }).find('.accordion-btn ').css({ 3660 'width': settings.buttonWidth, 3661 'text-align': 'center' 3662 }); 3663 } 3664 if (settings.delayLink && !settings.headersOnly) { 3665 var currentThis = this, 3666 speed = settings.delayAmount != null ? settings.delayAmount : settings.slideSpeed; 3667 if (speed == "fast") { 3668 speed = 200; 3669 } else if (speed == "slow") { 3670 speed = 600; 3671 } 3672 $('> a', currentThis).on('click', function(e) { 3673 if (!$('> .accordion-btn-wrap', currentThis).hasClass("accordion-active")) { 3674 e.preventDefault(); 3675 var href = $(this).attr('href'); 3676 clickToggle($('> .accordion-btn-wrap', currentThis)); 3677 setTimeout(function() { 3678 window.location = href; 3679 }, speed) 3680 } 3681 }) 3682 } 3683 }); 3684 var selectedNavAccordion = $(settings.parentElement + '.' + settings.selectedClass + ' > .accordion-btn-wrap', container); 3685 var buttonheightResize = debounce(function() { 3686 buttonheight(); 3687 expandSelected(); 3688 }, 250); 3689 $(window).on('resize', buttonheightResize); 3690 buttonheight(); 3691 expandSelected(); 3692 $(container).on('click', '.accordion-btn-wrap', function(e) { 3693 e.preventDefault(); 3694 clickToggle(this); 3695 }); 3696 if (typeof callback == "function") { 3697 callback(); 3698 } 3699 3700 function clickToggle(element) { 3701 var nextChild = $(element).next(settings.childElement), 3702 currentExpandBtn = $('.accordion-expanded', element), 3703 currentCollapseBtn = $('.accordion-collapsed', element), 3704 parentObj = $(element).closest(settings.parentElement); 3705 if (nextChild.is(':visible')) { 3706 nextChild.slideUp(settings.slideSpeed); 3707 $(element).removeClass('accordion-active'); 3708 currentExpandBtn.css('display', 'none'); 3709 currentCollapseBtn.css('display', 'inline-block'); 3710 parentObj.add(parentObj.siblings('.active')).add(parentObj.find('.active')).removeClass('active'); 3711 } else { 3712 $(element).closest(settings.childElement).find('.accordion-active').removeClass('accordion-active').next(settings.childElement).slide
3712Up(settings.slideSpeed).prev().find('.accordion-expanded').css('display', 'none').parent().find('.accordion-collapsed').css('display', 'inline-block'); 3713 parentObj.add(parentObj.siblings('.active')).add(parentObj.find('.active')).removeClass('active'); 3714 $(element).addClass('accordion-active'); 3715 nextChild.slideToggle(settings.slideSpeed); 3716 currentExpandBtn.css('display', 'inline-block'); 3717 currentCollapseBtn.css('display', 'none'); 3718 parentObj.addClass('active'); 3719 } 3720 } 3721 3722 function expandSelected() { 3723 if (settings.selectedExpand) { 3724 if (!settings.headersOnlyCheck) { 3725 selectedNavAccordion.find('.accordion-expanded').css('display', 'inline-block'); 3726 selectedNavAccordion.find('.accordion-collapsed').css('display', 'none'); 3727 selectedNavAccordion.addClass('accordion-active').next(settings.childElement).css('display', 'block'); 3728 selectedNavAccordion.closest(settings.parentElement).addClass('active'); 3729 } else { 3730 $(settings.parentElement + '.' + settings.selectedClass + ' > ' + settings.childElement, container).css('display', 'block'); 3731 $(settings.parentElement + '.' + settings.selectedClass).addClass('active'); 3732 } 3733 } 3734 } 3735 3736 function buttonheight() { 3737 $('.accordion-btn', container).each(function() { 3738 $(settings.parentElement + '.has-subnav > ' + settings.childElement, container).css('display', 'block'); 3739 var parentItem = $(this).closest(settings.parentElement), 3740 lineheight = $('> a', parentItem).innerHeight(); 3741 $(this).css({ 3742 'line-height': lineheight + 'px', 3743 'height': lineheight 3744 }); 3745 $(settings.parentElement + ((settings.headersOnlyCheck) ? ' ' : '.has-subnav > ') + settings.childElement, container).css('display', 'none'); 3746 $('.accordion-expanded').css('display', 'none'); 3747 $('.accordion-collapsed').css('display', 'inline-block'); 3748 }) 3749 } 3750 3751 function debounce(func, wait, immediate) { 3752 var timeout; 3753 return function() { 3754 var context = this, 3755 args = arguments; 3756 var later = function() { 3757 timeout = null; 3758 if (!immediate) func.apply(context, args); 3759 }; 3760 var callNow = immediate && !timeout; 3761 clearTimeout(timeout); 3762 timeout = setTimeout(later, wait); 3763 if (callNow) func.apply(context, args); 3764 }; 3765 }; 3766 }); 3767 } 3768})(jQuery); 3769/*********************************** 3770DOUBLE TAP to GO 3771************************************/ 3772! function(t, n, o) { 3773 "use strict"; 3774 t.fn.doubleTouchToGo = function() { 3775 return "ontouchstart" in n || navigator.msMaxTouchPoints || navigator.userAgent.toLowerCase().match(/windows phone os 7/i) ? (this.each(function() { 3776 var n = !1; 3777 t(this).on("click", function(o) { 3778 var i = t(this); 3779 i[0] != n[0] && (o.preventDefault(), n = i) 3780 }), t(o).on("click touchstart MSPointerDown", function(o) { 3781 for (var i = !0, e = t(o.target).parents(), r = 0; r < e.length; r++) e[r] == n[0] && (i = !1); 3782 i && (n = !1) 3783 }) 3784 }), this) : !1 3785 } 3786}(jQuery, window, document); 3787/*********************************** 3788AUDIO PLAYER 3789************************************/ 3790! function(a, b, c, d) { 3791 var e = "ontouchstart" in b, 3792 f = e ? "touchstart" : "mousedown", 3793 g = e ? "touchmove" : "mousemove", 3794 i = e ? "touchcancel" : "mouseup", 3795 j = function(a) { 3796 var b = Math.floor(a / 3600), 3797 c = Math.floor(a % 3600 / 60), 3798 d = Math.ceil(a % 3600 % 60); 3799 return (0 == b ? "" : b > 0 && b.toString().length < 2 ? "0" + b + ":" : b + ":") + (c.toString().length < 2 ? "0" + c : c) + ":" + (d.toString().length < 2 ? "0" + d : d) 3800 }, 3801 k = function(a) { 3802 var b = c.createElement("audio"); 3803 return !(!b.canPlayType || !b.canPlayType("audio/" + a.split(".").pop().toLowerCase() + ";").replace(/no/, "")) 3804 }; 3805 a.fn.audioPlayer = function(b) { 3806 var b = a.extend({ 3807 classPrefix: "audioplayer", 3808 strPlay: "Play", 3809 strPause: "Pause", 3810 strVolume: "Volume" 3811 }, b), 3812 c = {}, 3813 d = { 3814 playPause: "playpause", 3815 playing: "playing", 3816 time: "time",
3817 timeCurrent: "time-current", 3818 timeDuration: "time-duration", 3819 bar: "bar", 3820 barLoaded: "bar-loaded", 3821 barPlayed: "bar-played", 3822 volume: "volume", 3823 volumeButton: "volume-button", 3824 volumeAdjust: "volume-adjust", 3825 noVolume: "novolume", 3826 mute: "mute", 3827 mini: "mini" 3828 }; 3829 for (var h in d) c[h] = b.classPrefix + "-" + d[h]; 3830 return this.each(function() { 3831 if ("audio" != a(this).prop("tagName").toLowerCase()) return !1; 3832 var d = a(this), 3833 h = d.attr("src"), 3834 l = d.get(0).getAttribute("autoplay"), 3835 l = "" === l || "autoplay" === l, 3836 m = d.get(0).getAttribute("loop"), 3837 m = "" === m || "loop" === m, 3838 n = !1; 3839 "undefined" == typeof h ? d.find("source").each(function() { 3840 if (h = a(this).attr("src"), "undefined" != typeof h && k(h)) return n = !0, !1 3841 }) : k(h) && (n = !0); 3842 var o = a('<div class="' + b.classPrefix + '">' + (n ? a("<div>").append(d.eq(0).clone()).html() : '<embed src="' + h + '" width="0" height="0" volume="100" autostart="' + l.toString() + '" loop="' + m.toString() + '" />') + '<div class="' + c.playPause + '" title="' + b.strPlay + '"><a href="#">' + b.strPlay + "</a></div></div>"), 3843 p = n ? o.find("audio") : o.find("embed"), 3844 p = p.get(0); 3845 if (n) { 3846 o.find("audio").css({ 3847 width: 0, 3848 height: 0, 3849 visibility: "hidden" 3850 }), o.append('<div class="' + c.time + " " + c.timeCurrent + '"></div><div class="' + c.bar + '"><div class="' + c.barLoaded + '"></div><div class="' + c.barPlayed + '"></div></div><div class="' + c.time + " " + c.timeDuration + '"></div><div class="' + c.volume + '"><div class="' + c.volumeButton + '" title="' + b.strVolume + '"><a href="#">' + b.strVolume + '</a></div><div class="' + c.volumeAdjust + '"><div><div></div></div></div></div>'); 3851 var q = o.find("." + c.bar), 3852 r = o.find("." + c.barPlayed), 3853 t = (o.find("." + c.barLoaded), o.find("." + c.timeCurrent)), 3854 u = o.find("." + c.timeDuration), 3855 v = o.find("." + c.volumeButton), 3856 w = o.find("." + c.volumeAdjust + " > div"), 3857 x = 0, 3858 y = function(a) { 3859 theRealEvent = e ? a.originalEvent.touches[0] : a, p.currentTime = Math.round(p.duration * (theRealEvent.pageX - q.offset().left) / q.width()) 3860 }, 3861 z = function(a) { 3862 theRealEvent = e ? a.originalEvent.touches[0] : a, p.volume = Math.abs((theRealEvent.pageY - (w.offset().top + w.height())) / w.height()) 3863 }, 3864 B = (setInterval(function() {}, 100), p.volume), 3865 C = p.volume = .111; 3866 Math.round(1e3 * p.volume) / 1e3 == C ? p.volume = B : o.addClass(c.noVolume), u.html("…"), t.text(j(0)), p.addEventListener("loadeddata", function() { 3867 u.text(j(p.duration)), w.find("div").height(100 * p.volume + "%"), x = p.volume 3868 }), p.addEventListener("timeupdate", function() { 3869 t.text(j(p.currentTime)), r.width(p.currentTime / p.duration * 100 + "%") 3870 }), p.addEventListener("volumechange", function() { 3871 w.find("div").height(100 * p.volume + "%"), p.volume > 0 && o.hasClass(c.mute) && o.removeClass(c.mute), p.volume <= 0 && !o.hasClass(c.mute) && o.addClass(c.mute) 3872 }), p.addEventListener("ended", function() { 3873 o.removeClass(c.playing) 3874 }), q.on(f, function(a) { 3875 y(a), q.on(g, function(a) { 3876 y(a) 3877 }) 3878 }).on(i, function() { 3879 q.unbind(g) 3880 }), v.on("click", function() { 3881 return o.hasClass(c.mute) ? (o.removeClass(c.mute), p.volume = x) : (o.addClass(c.mute), x = p.volume, p.volume = 0), !1 3882 }), w.on(f, function(a) { 3883 z(a), w.on(g, function(a) { 3884 z(a) 3885 }) 3886 }).on(i, function() { 3887 w.unbind(g) 3888 }) 3889 } else o.addClass(c.mini); 3890 l && o.addClass(c.playing), o.find("." + c.playPause).on("click", function() { 3891 return o.hasClass(c.playing) ? (a(this).attr("title", b.strPlay).find("a").html(b.strPlay), o.removeClass(c.playing), n ? p.pause() : p.Stop()) : (a(this).attr("title", b.strPause).find("a").html(b.strPause), o.addClass(c.playing), n ? p.play() : p.Play()), !1 3892 }), d.replaceWith(o) 3893 }), this 3894 } 3895}(jQuery, window, document); 3896/** 3897 * Infinite Ajax Scroll 3898 */ 3899! function(a) { 3900 "use strict"; 3901 var b = -1, 3902 c = function(c, e) { 3903 return this.itemsContainerSelector = e.container, this.itemSelector = e.item, this.nextSelector = e.next, this.paginationSelector = e.pagination, this.$scrollC
3903ontainer = c, this.$container = window === c.get(0) ? a(document) : c, this.defaultDelay = e.delay, this.negativeMargin = e.negativeMargin, this.nextUrl = null, this.isBound = !1, this.isPaused = !1, this.isInitialized = !1, this.jsXhr = !1, this.listeners = { 3904 next: new d(a), 3905 load: new d(a), 3906 loaded: new d(a), 3907 render: new d(a), 3908 rendered: new d(a), 3909 scroll: new d(a), 3910 noneLeft: new d(a), 3911 ready: new d(a) 3912 }, this.extensions = [], this.scrollHandler = function() { 3913 if (this.isBound && !this.isPaused) { 3914 var a = this.getCurrentScrollOffset(this.$scrollContainer), 3915 c = this.getScrollThreshold(); 3916 b != c && (this.fire("scroll", [a, c]), a >= c && this.next()) 3917 } 3918 }, this.getItemsContainer = function() { 3919 return a(this.itemsContainerSelector, this.$container) 3920 }, this.getLastItem = function() { 3921 return a(this.itemSelector, this.getItemsContainer().get(0)).last() 3922 }, this.getFirstItem = function() { 3923 return a(this.itemSelector, this.getItemsContainer().get(0)).first() 3924 }, this.getScrollThreshold = function(a) { 3925 var c; 3926 return a = a || this.negativeMargin, a = a >= 0 ? a * -1 : a, c = this.getLastItem(), 0 === c.length ? b : c.offset().top + c.height() + a 3927 }, this.getCurrentScrollOffset = function(a) { 3928 var b = 0, 3929 c = a.height(); 3930 return b = window === a.get(0) ? a.scrollTop() : a.offset().top, navigator.platform.indexOf("iPhone") == -1 && navigator.platform.indexOf("iPod") == -1 || (c += 80), b + c 3931 }, this.getNextUrl = function(b) { 3932 return b = b || this.$container, a(this.nextSelector, b).last().attr("href") 3933 }, this.load = function(b, c, d) { 3934 var f, i, e = this, 3935 g = [], 3936 h = +new Date; 3937 d = d || this.defaultDelay; 3938 var j = { 3939 url: b 3940 }; 3941 return e.fire("load", [j]), this.jsXhr = a.get(j.url, null, a.proxy(function(b) { 3942 f = a(this.itemsContainerSelector, b).eq(0), 0 === f.length && (f = a(b).filter(this.itemsContainerSelector).eq(0)), f && f.find(this.itemSelector).each(function() { 3943 g.push(this) 3944 }), e.fire("loaded", [b, g]), c && (i = +new Date - h, i < d ? setTimeout(function() { 3945 c.call(e, b, g) 3946 }, d - i) : c.call(e, b, g)) 3947 }, e), "html"), this.jsXhr 3948 }, this.render = function(b, c) { 3949 var d = this, 3950 e = this.getLastItem(), 3951 f = 0, 3952 g = this.fire("render", [b]); 3953 g.done(function() { 3954 a(b).hide(), e.after(b), a(b).fadeIn(400, function() { 3955 ++f < b.length || (d.fire("rendered", [b]), c && c()) 3956 }) 3957 }), g.fail(function() { 3958 c && c() 3959 }) 3960 }, this.hidePagination = function() { 3961 this.paginationSelector && a(this.paginationSelector, this.$container).hide() 3962 }, this.restorePagination = function() { 3963 this.paginationSelector && a(this.paginationSelector, this.$container).show() 3964 }, this.throttle = function(b, c) { 3965 var e, f, d = 0; 3966 return e = function() { 3967 function h() { 3968 d = +new Date, b.apply(a, e) 3969 } 3970 var a = this, 3971 e = arguments, 3972 g = +new Date - d; 3973 f ? clearTimeout(f) : h(), g > c ? h() : f = setTimeout(h, c) 3974 }, a.guid && (e.guid = b.guid = b.guid || a.guid++), e 3975 }, this.fire = function(a, b) { 3976 return this.listeners[a].fireWith(this, b) 3977 }, this.pause = function() { 3978 this.isPaused = !0 3979 }, this.resume = function() { 3980 this.isPaused = !1 3981 }, this 3982 }; 3983 c.prototype.initialize = function() { 3984 if (this.isInitialized) return !1;
3985 var a = !!("onscroll" in this.$scrollContainer.get(0)), 3986 b = this.getCurrentScrollOffset(this.$scrollContainer), 3987 c = this.getScrollThreshold(); 3988 return !!a && (this.hidePagination(), this.bind(), this.fire("ready"), this.nextUrl = this.getNextUrl(), b >= c ? (this.next(), this.one("rendered", function() { 3989 this.isInitialized = !0 3990 })) : this.isInitialized = !0, this) 3991 }, c.prototype.reinitialize = function() { 3992 this.isInitialized = !1, this.unbind(), this.initialize() 3993 }, c.prototype.bind = function() { 3994 if (!this.isBound) { 3995 this.$scrollContainer.on("scroll", a.proxy(this.throttle(this.scrollHandler, 150), this)); 3996 for (var b = 0, c = this.extensions.length; b < c; b++) this.extensions[b].bind(this); 3997 this.isBound = !0, this.resume() 3998 } 3999 }, c.prototype.unbind = function() { 4000 if (this.isBound) { 4001 this.$scrollContainer.off("scroll", this.scrollHandler); 4002 for (var a = 0, b = this.extensions.length; a < b; a++) "undefined" != typeof this.extensions[a].unbind && this.extensions[a].unbind(this); 4003 this.isBound = !1 4004 } 4005 }, c.prototype.destroy = function() { 4006 try { 4007 this.jsXhr.abort() 4008 } catch (a) {} 4009 this.unbind(), this.$scrollContainer.data("hrs", null) 4010 }, c.prototype.on = function(b, c, d) { 4011 if ("undefined" == typeof this.listeners[b]) throw new Error('There is no event called "' + b + '"'); 4012 return d = d || 0, this.listeners[b].add(a.proxy(c, this), d), this 4013 }, c.prototype.one = function(a, b) { 4014 var c = this, 4015 d = function() { 4016 c.off(a, b), c.off(a, d) 4017 }; 4018 return this.on(a, b), this.on(a, d), this 4019 }, c.prototype.off = function(a, b) { 4020 if ("undefined" == typeof this.listeners[a]) throw new Error('There is no event called "' + a + '"'); 4021 return this.listeners[a].remove(b), this 4022 }, c.prototype.next = function() { 4023 var a = this.nextUrl, 4024 b = this; 4025 if (this.pause(), !a) return this.fire("noneLeft", [this.getLastItem()]), this.listeners.noneLeft.disable(), b.resume(), !1; 4026 var c = this.fire("next", [a]); 4027 return c.done(function() { 4028 b.load(a, function(a, c) { 4029 b.render(c, function() { 4030 b.nextUrl = b.getNextUrl(a), b.resume() 4031 }) 4032 }) 4033 }), c.fail(function() { 4034 b.resume() 4035 }), !0 4036 }, c.prototype.extension = function(a) { 4037 if ("undefined" == typeof a.bind) throw new Error('Extension doesn\'t have required method "bind"'); 4038 return "undefined" != typeof a.initialize && a.initialize(this), this.extensions.push(a), this.isInitialized && this.reinitialize(), this 4039 }, a.hrs = function(b) { 4040 var c = a(window); 4041 return c.hrs.apply(c, arguments) 4042 }, a.fn.hrs = function(b) { 4043 var d = Array.prototype.slice.call(arguments), 4044 e = this; 4045 return this.each(function() { 4046 var f = a(this), 4047 g = f.data("hrs"), 4048 h = a.extend({}, a.fn.hrs.defaults, f.data(), "object" == typeof b && b); 4049 if (g || (f.data("hrs", g = new c(f, h)), a(document).ready(a.proxy(g.initialize, g))), "string" == typeof b) { 4050 if ("function" != typeof g[b]) throw new Error('There is no method called "' + b + '"'); 4051 d.shift(), g[b].apply(g, d) 4052 } 4053 e = g 4054 }), e 4055 }, a.fn.hrs.defaults = { 4056 item: ".item", 4057 container: ".listing", 4058 next: ".next", 4059 pagination: !1, 4060 delay: 100, 4061 negativeMargin: 10 4062 }; 4063 var d = function(a) { 4064 return this.list = [], this.fireStack = [], this.isFiring = !1, this.isDisabled = !1, this.fire = function(a) { 4065 var b = a[0], 4066 c = a[1], 4067 d = a[2]; 4068 this.isFiring = !0; 4069 for (var e = 0, f = this.list.length; e < f; e++) 4070 if (void 0 != this.list[e] && !1 === this.list[e].fn.apply(b, d)) { 4071 c.reject(); 4072 break 4073 } 4074 this.isFiring = !1, c.resolve(), this.fireStack.length && this.fire(this.fireStack.shift()) 4075 }, this.inList = function(a, b) { 4076 b = b || 0; 4077 for (var c = b, d = this.list.length; c < d; c++) 4078 if (this.list[c].fn === a || a.guid && this.list[c].fn.guid && a.guid === this.list[c].fn.guid) return c; 4079 return -1 4080 }, this 4081 }; 4082 d.prototype = { 4083 add: function(a, b) { 4084 var c = { 4085 fn: a, 4086 priority: b 4087 }; 4088 b = b || 0; 4089 for (var d = 0, e = this.list.length; d < e; d++) 4090 if (b > this.list[d].priority) return this.list.splice(d, 0, c), this; 4091 return this.list.push(c), this 4092 }, 4093 remove: function(a) { 4094 for (var b = 0; 4095 (b = this.inList(a, b)) > -1;) this.list.splice(b, 1); 4096 return this 4097 }, 4098 has: function(a) { 4099 return this.inList(a) > -1 4100 }, 4101 fireWith: function(b, c) { 4102 var d = a.Deferred(); 4103 return this.isDisabled ? d.reject() : (c = c || [], c = [b, d, c.slice ? c.slice() : c], this.isFiring ? this.fireStack.push(c) : this.fire(c), d) 4104 }, 4105 disable: function() { 4106 this.isDisabled = !0 4107 }, 4108 enable: function() { 4109 this.isDisabled = !1 4110 } 4111 } 4112}(jQuery); 4113var HRSSpinnerExtension = function(a) { 4114 return a = jQuery.extend({}
4114, this.defaults, a), this.hrs = null, this.uid = (new Date).getTime(), this.src = a.src, this.html = a.html.replace("{src}", this.src), this.showSpinner = function() { 4115 var a = this.getSpinner() || this.createSpinner(), 4116 b = this.hrs.getItemsContainer(); 4117 b.after(a), a.fadeIn() 4118 }, this.showSpinnerBefore = function() { 4119 var a = this.getSpinner() || this.createSpinner(), 4120 b = this.hrs.getFirstItem(); 4121 b.before(a), a.fadeIn() 4122 }, this.removeSpinner = function() { 4123 this.hasSpinner() && this.getSpinner().remove() 4124 }, this.getSpinner = function() { 4125 var a = jQuery("#hrs_spinner_" + this.uid); 4126 return a.length > 0 && a 4127 }, this.hasSpinner = function() { 4128 var a = jQuery("#hrs_spinner_" + this.uid); 4129 return a.length > 0 4130 }, this.createSpinner = function() { 4131 var a = jQuery(this.html).attr("id", "hrs_spinner_" + this.uid); 4132 return a.hide(), a 4133 }, this 4134}; 4135HRSSpinnerExtension.prototype.bind = function(a) { 4136 this.hrs = a, a.on("next", jQuery.proxy(this.showSpinner, this)), a.on("render", jQuery.proxy(this.removeSpinner, this)); 4137 try { 4138 a.on("prev", jQuery.proxy(this.showSpinnerBefore, this)) 4139 } catch (a) {} 4140}, HRSSpinnerExtension.prototype.unbind = function(a) { 4141 a.off("next", this.showSpinner), a.off("render", this.removeSpinner); 4142 try { 4143 a.off("prev", this.showSpinnerBefore) 4144 } catch (a) {} 4145}, HRSSpinnerExtension.prototype.defaults = { 4146 src: "data:image/gif;
4146base64,R0lGODlhEAAQAPQAAP///wAAAPDw8IqKiuDg4EZGRnp6egAAAFhYWCQkJKysrL6+vhQUFJycnAQEBDY2NmhoaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBFMi4wAwEAAAAh/hpDcmVhdGVkIHdpdGggYWpheGxvYWQuaW5mbwAh+QQJCgAAACwAAAAAEAAQAAAFdyAgAgIJIeWoAkRCCMdBkKtIHIngyMKsErPBYbADpkSCwhDmQCBethRB6Vj4kFCkQPG4IlWDgrNRIwnO4UKBXDufzQvDMaoSDBgFb886MiQadgNABAokfCwzBA8LCg0Egl8jAggGAA1kBIA1BAYzlyILczULC2UhACH5BAkKAAAALAAAAAAQABAAAAV2ICACAmlAZTmOREEIyUEQjLKKxPHADhEvqxlgcGgkGI1DYSVAIAWMx+lwSKkICJ0QsHi9RgKBwnVTiRQQgwF4I4UFDQQEwi6/3YSGWRRmjhEETAJfIgMFCnAKM0KDV4EEEAQLiF18TAYNXDaSe3x6mjidN1s3IQAh+QQJCgAAACwAAAAAEAAQAAAFeCAgAgLZDGU5jgRECEUiCI+yioSDwDJyLKsXoHFQxBSHAoAAFBhqtMJg8DgQBgfrEsJAEAg4YhZIEiwgKtHiMBgtpg3wbUZXGO7kOb1MUKRFMysCChAoggJCIg0GC2aNe4gqQldfL4l/Ag1AXySJgn5LcoE3QXI3IQAh+QQJCgAAACwAAAAAEAAQAAAFdiAgAgLZNGU5joQhCEjxIssqEo8bC9BRjy9Ag7GILQ4QEoE0gBAEBcOpcBA0DoxSK/e8LRIHn+i1cK0IyKdg0VAoljYIg+GgnRrwVS/8IAkICyosBIQpBAMoKy9dImxPhS+GKkFrkX+TigtLlIyKXUF+NjagNiEAIfkECQoAAAAsAAAAABAAEAAABWwgIAICaRhlOY4EIgjH8R7LKhKHGwsMvb4AAy3WODBIBBKCsYA9TjuhDNDKEVSERezQEL0WrhXucRUQGuik7bFlngzqVW9LMl9XWvLdjFaJtDFqZ1cEZUB0dUgvL3dgP4WJZn4jkomWNpSTIyEAIfkECQoAAAAsAAAAABAAEAAABX4gIAICuSxlOY6CIgiD8RrEKgqGOwxwUrMlAoSwIzAGpJpgoSDAGifDY5kopBYDlEpAQBwevxfBtRIUGi8xwWkDNBCIwmC9Vq0aiQQDQuK+VgQPDXV9hCJjBwcFYU5pLwwHXQcMKSmNLQcIAExlbH8JBwttaX0ABAcNbWVbKyEAIfkECQoAAAAsAAAAABAAEAAABXkgIAICSRBlOY7CIghN8zbEKsKoIjdFzZaEgUBHKChMJtRwcWpAWoWnifm6ESAMhO8lQK0EEAV3rFopIBCEcGwDKAqPh4HUrY4ICHH1dSoTFgcHUiZjBhAJB2AHDykpKAwHAwdzf19KkASIPl9cDgcnDkdtNwiMJCshACH5BAkKAAAALAAAAAAQABAAAAV3ICACAkkQZTmOAiosiyAoxCq+KPxCNVsSMRgBsiClWrLTSWFoIQZHl6pleBh6suxKMIhlvzbAwkBWfFWrBQTxNLq2RG2yhSUkDs2b63AYDAoJXAcFRwADeAkJDX0AQCsEfAQMDAIPBz0rCgcxky0JRWE1AmwpKyEAIfkECQoAAAAsAAAAABAAEAAABXkgIAICKZzkqJ4nQZxLqZKv4NqNLKK2/Q4Ek4lFXChsg5ypJjs1II3gEDUSRInEGYAw6B6zM4JhrDAtEosVkLUtHA7RHaHAGJQEjsODcEg0FBAFVgkQJQ1pAwcDDw8KcFtSInwJAowCCA6RIwqZAgkPNgVpWndjdyohACH5BAkKAAAALAAAAAAQABAAAAV5ICACAimc5KieLEuUKvm2xAKLqDCfC2GaO9eL0LABWTiBYmA06W6kHgvCqEJiAIJiu3gcvgUsscHUERm+kaCxyxa+zRPk0SgJEgfIvbAdIAQLCAYlCj4DBw0IBQsMCjIqBAcPAooCBg9pKgsJLwUFOhCZKyQDA3YqIQAh+QQJCgAAACwAAAAAEAAQAAAFdSAgAgIpnOSonmxbqiThCrJKEHFbo8JxDDOZYFFb+A41E4H4OhkOipXwBElYITDAckFEOBgMQ3arkMkUBdxIUGZpEb7kaQBRlASPg0FQQHAbEEMGDSVEAA1QBhAED1E0NgwFAooCDWljaQIQCE5qMHcNhCkjIQAh+QQJCgAAACwAAAAAEAAQAAAFeSAgAgIpnOSoLgxxvqgKLEcCC65KEAByKK8cSpA4DAiHQ/DkKhGKh4ZCtCyZGo6F6iYYPAqFgYy02xkSaLEMV34tELyRYNEsCQyHlvWkGCzsPgMCEAY7Cg04Uk48LAsDhRA8MVQPEF0GAgqYYwSRlycNcWskCkApIyEAOwAAAAAAAAAAAA==", 4147 html: '<div class="hrs-spinner" style="text-align: center;"><img src="{src}"/></div>' 4148}; 4149var HRSTriggerExtension = function(a) { 4150 return a = jQuery.extend({}, this.defaults, a), this.hrs = null, this.html = a.html.replace("{text}", a.text), this.htmlPrev = a.htmlPrev.replace("{text}", a.textPrev), this.enabled = !0, this.count = 0, this.offset = a.offset, this.$triggerNext = null, this.$triggerPrev = null, this.showTriggerNext = function() { 4151 if (!this.enabled) return !0; 4152 if (!1 === this.offset || ++this.count < this.offset) return !0; 4153 var a = this.$triggerNext || (this.$triggerNext = this.createTrigger(this.next, this.html)), 4154 b = this.hrs.getItemsContainer(); 4155 return b.after(a), a.fadeIn(), !1 4156 }, this.showTriggerPrev = function() { 4157 if (!this.enabled) return !0; 4158 var a = this.$triggerPrev || (this.$triggerPrev = this.createTrigger(this.prev, this.htmlPrev)), 4159 b = this.hrs.getFirstItem(); 4160 return b.before(a), a.fadeIn(), !1 4161 }, this.onRendered = function() { 4162 this.enabled = !0 4163 }, this.createTrigger = function(a, b) { 4164 var d, c = (new Date).getTime(); 4165 return b = b || this.html, d = jQuery(b).attr("id", "hrs_trigger_" + c), d.hide(), d.on("click", jQuery.proxy(a, this)), d 4166 }, this 4167}; 4168HRSTriggerExtension.prototype.bind = function(a) { 4169 this.hrs = a, a.on("next", jQuery.proxy(this.showTriggerNext, this), this.priority), a.on("rendered", jQuery.proxy(this.onRendered, this), this.priority); 4170 try { 4171 a.on("prev", jQuery.proxy(this.showTriggerPrev, this), this.priority) 4172 } catch (a) {} 4173}, HRSTriggerExtension.prototype.unbind = function(a) { 4174 a.off("next", this.showTriggerNext), a.off("rendered", this.onRendered); 4175 try { 4176 a.off("prev", this.showTriggerPrev) 4177 } catch (a) {} 4178}, HRSTriggerExtension.prototype.next = function() { 4179 this.enabled = !1, this.hrs.pause(), this.$triggerNext && (this.$triggerNext.remove(), this.$triggerNext = null), this.hrs.next() 4180}, HRSTriggerExtension.prototype.prev = function() { 4181 this.enabled = !1, this.hrs.pause(), this.$triggerPrev && (this.$triggerPrev.remove(), this.$triggerPrev = null), this.hrs.prev() 4182}, HRSTriggerExtension.prototype.defaults = { 4183 text: "Load more items", 4184 html: '<div class="hrs-trigger hrs-trigger-next" style="text-align: center; cursor: pointer;"><a>{text}</a></div>', 4185 textPrev: "Load previous items", 4186 htmlPrev: '<div class="hrs-trigger hrs-trigger-prev" style="text-align: center; cursor: pointer;"><a>{text}</a></div>', 4187 offset: 0 4188}, HRSTriggerExtension.prototype.priority = 1e3; 4189var HRSNoneLeftExtension = function(a) { 4190 return a = jQuery.extend({}
4190, this.defaults, a), this.hrs = null, this.uid = (new Date).getTime(), this.html = a.html.replace("{text}", a.text), this.showNoneLeft = function() { 4191 var a = jQuery(this.html).attr("id", "hrs_noneleft_" + this.uid), 4192 b = this.hrs.getItemsContainer(); 4193 b.after(a), a.fadeIn().delay(1400).animate({ 4194 opacity: 0 4195 }); 4196 }, this 4197}; 4198HRSNoneLeftExtension.prototype.bind = function(a) { 4199 this.hrs = a, a.on("noneLeft", jQuery.proxy(this.showNoneLeft, this)) 4200}, HRSNoneLeftExtension.prototype.unbind = function(a) { 4201 a.off("noneLeft", this.showNoneLeft) 4202}, HRSNoneLeftExtension.prototype.defaults = { 4203 text: "You reached the end.", 4204 html: '<div class="hrs-noneleft" style="text-align: center;">{text}</div>' 4205}; 4206/*********************************** 4207APPEAR 4208************************************/ 4209(function(e) { 4210 e.fn.disappear = function(t, n) { 4211 var r = e.extend({ 4212 data: undefined 4213 }, n); 4214 this.each(function() { 4215 var n = e(this); 4216 n.bind("disappear", t, r.data); 4217 if (!t) { 4218 n.trigger("disappear", r.data); 4219 return 4220 } 4221 }) 4222 }; 4223 e.fn.appear = function(t, n) { 4224 var r = e.extend({ 4225 data: undefined, 4226 one: true 4227 }, n); 4228 return this.each(function() { 4229 var n = e(this); 4230 n.appeared = false; 4231 if (!t) { 4232 n.trigger("appear", r.data); 4233 return 4234 } 4235 var i = e(window); 4236 var s = function() { 4237 if (!n.is(":visible")) { 4238 n.appeared = false; 4239 return 4240 } 4241 var e = i.scrollLeft(); 4242 var t = i.scrollTop(); 4243 var s = n.offset(); 4244 var o = s.left; 4245 var u = s.top; 4246 if (u + n.height() >= t && u <= t + i.height() && o + n.width() >= e && o <= e + i.width()) { 4247 if (!n.appeared) n.trigger("appear", r.data) 4248 } else { 4249 if (n.appeared) n.trigger("disappear", r.data); 4250 n.appeared = false 4251 } 4252 }; 4253 var o = function() { 4254 n.appeared = true; 4255 if (r.one) { 4256 i.unbind("scroll", s); 4257 var o = e.inArray(s, e.fn.appear.checks); 4258 if (o >= 0) e.fn.appear.checks.splice(o, 1) 4259 } 4260 t.apply(this, arguments) 4261 }; 4262 if (r.one) n.one("appear", r.data, o); 4263 else n.bind("appear", r.data, o); 4264 i.scroll(s); 4265 e.fn.appear.checks.push(s); 4266 s() 4267 }) 4268 }; 4269 e.extend(e.fn.appear, { 4270 checks: [], 4271 timeout: null, 4272 checkAll: function() { 4273 var t = e.fn.appear.checks.length; 4274 if (t > 0) 4275 while (t--) e.fn.appear.checks[t]() 4276 }, 4277 run: function() { 4278 if (e.fn.appear.timeout) clearTimeout(e.fn.appear.timeout); 4279 e.fn.appear.timeout = setTimeout(e.fn.appear.checkAll, 20) 4280 } 4281 }); 4282 e.each(["append", "prepend", "after", "before", "attr", "removeAttr", "addClass", "removeClass", "toggleClass", "remove", "css", "show", "hide"], function(t, n) { 4283 var r = e.fn[n]; 4284 if (r) { 4285 e.fn[n] = function() { 4286 var t = r.apply(this, arguments); 4287 e.fn.appear.run(); 4288 return t 4289 } 4290 } 4291 }) 4292})(jQuery) 4293 4294/*! 4295 * classie - class helper functions 4296 * from bonzo https://github.com/ded/bonzo 4297 * 4298 * classie.has( elem, 'my-class' ) -> true/false 4299 * classie.add( elem, 'my-new-class' ) 4300 * classie.remove( elem, 'my-unwanted-class' ) 4301 * classie.toggle( elem, 'my-class' ) 4302 */ 4303 4304! function(s) { 4305 "use strict"; 4306 4307 function e(s) { 4308 return new RegExp("(^|\\s+)" + s + "(\\s+|$)") 4309 } 4310 4311 function n(s, e) { 4312 var n = a(s, e) ? c : t; 4313 n(s, e) 4314 } 4315 var a, t, c; 4316 "classList" in document.documentElement ? (a = function(s, e) { 4317 return s.classList.contains(e) 4318 }, t = function(s, e) { 4319 s.classList.add(e) 4320 }, c = function(s, e) { 4321 s.classList.remove(e) 4322 }) : (a = function(s, n) { 4323 return e(n).test(s.className) 4324 }, t = function(s, e) { 4325 a(s, e) || (s.className = s.className + " " + e) 4326 }, c = function(s, n) { 4327 s.className = s.className.replace(e(n), " ") 4328 }); 4329 var i = { 4330 hasClass: a, 4331 addClass: t, 4332 removeClass: c, 4333 toggleClass: n, 4334 has: a, 4335 add: t, 4336 remove: c, 4337 toggle: n 4338 }; 4339 "function" == typeof define && define.amd ? define(i) : s.classie = i 4340}(window); 4341/*! 4342 * Theia Sticky Sidebar v1.7.0 4343 * https://github.com/WeCodePixels/theia-sticky-sidebar 4344 * 4345 * Glues your website's sidebars, making them permanently visible while scrolling. 4346 * 4347 * Copyright 2013-2016 WeCodePixels and other contributors 4348 * Released under the MIT license 4349 */ 4350 4351!(function ($) { 4352 $.fn.theiaStickySidebar = function (options) { 4353 var defaults = { 4354 'containerSelector': '', 4355 'additionalMarginTop': 0, 4356 'additionalMarginBottom': 0, 4357 'updateSidebarHeight': true, 4358 'minWidth': 0, 4359 'disableOnResponsiveLayouts': true, 4360 'sidebarBehavior': 'modern', 4361 'defaultPosition': 'relative', 4362 'namespace': 'TSS' 4363 }; 4364 options = $.extend(defaults, options); 4365 4366 // Validate options 4367 options.additionalMarginTop = parseInt(options.additionalMarginTop) || 0; 4368 options.additionalMarginBottom = parseInt(options.additionalMarginBottom) || 0; 4369 4370 tryInitOrHookIntoEvents(options, this); 4371 4372 // Try doing init, otherwise hook into window.resize and document.scroll and try again then. 4373 function tryInitOrHookIntoEvents(options, $that) { 4374 var success = tryInit(options, $that); 4375 4376 if (!success) {
4377 console.log('TSS: Body width smaller than options.minWidth. Init is delayed.'); 4378 4379 $(document).on('scroll.' + options.namespace, function (options, $that) { 4380 return function (evt) { 4381 var success = tryInit(options, $that); 4382 4383 if (success) { 4384 $(this).unbind(evt); 4385 } 4386 }; 4387 }(options, $that)); 4388 $(window).on('resize.' + options.namespace, function (options, $that) { 4389 return function (evt) { 4390 var success = tryInit(options, $that); 4391 4392 if (success) { 4393 $(this).unbind(evt); 4394 } 4395 }; 4396 }(options, $that)) 4397 } 4398 } 4399 4400 // Try doing init if proper conditions are met. 4401 function tryInit(options, $that) { 4402 if (options.initialized === true) { 4403 return true; 4404 } 4405 4406 if ($('body').width() < options.minWidth) { 4407 return false; 4408 } 4409 4410 init(options, $that); 4411 4412 return true; 4413 } 4414 4415 // Init the sticky sidebar(s). 4416 function init(options, $that) { 4417 options.initialized = true; 4418 4419 // Add CSS 4420 var existingStylesheet = $('#theia-sticky-sidebar-stylesheet-' + options.namespace); 4421 if (existingStylesheet.length === 0) { 4422 $('head').append($('<style id="theia-sticky-sidebar-stylesheet-' + options.namespace + '">.theiaStickySidebar:after {content: ""; display: table; clear: both;}</style>')); 4423 } 4424 4425 $that.each(function () { 4426 var o = {}; 4427 4428 o.sidebar = $(this); 4429 4430 // Save options 4431 o.options = options || {}; 4432 4433 // Get container 4434 o.container = $(o.options.containerSelector); 4435 if (o.container.length == 0) { 4436 o.container = o.sidebar.parent(); 4437 } 4438 4439 // Create sticky sidebar 4440 o.sidebar.parents().css('-webkit-transform', 'none'); // Fix for WebKit bug - https://code.google.com/p/chromium/issues/detail?id=20574 4441 o.sidebar.css({ 4442 'position': o.options.defaultPosition, 4443 'overflow': 'visible', 4444 // The "box-sizing" must be set to "content-box" because we set a fixed height to this element when the sticky
4444sidebar has a fixed position. 4445 '-webkit-box-sizing': 'border-box', 4446 '-moz-box-sizing': 'border-box', 4447 'box-sizing': 'border-box' 4448 }); 4449 4450 // Get the sticky sidebar element. If none has been found, then create one. 4451 o.stickySidebar = o.sidebar.find('.theiaStickySidebar'); 4452 if (o.stickySidebar.length == 0) { 4453 // Remove <script> tags, otherwise they will be run again when added to the stickySidebar. 4454 var javaScriptMIMETypes = /(?:text|application)\/(?:x-)?(?:javascript|ecmascript)/i; 4455 o.sidebar.find('script').filter(function (index, script) { 4456 return script.type.length === 0 || script.type.match(javaScriptMIMETypes); 4457 }).remove(); 4458 4459 o.stickySidebar = $('<div>').addClass('theiaStickySidebar').append(o.sidebar.children()); 4460 o.sidebar.append(o.stickySidebar); 4461 } 4462 4463 // Get existing top and bottom margins and paddings 4464 o.marginBottom = parseInt(o.sidebar.css('margin-bottom')); 4465 o.paddingTop = parseInt(o.sidebar.css('padding-top')); 4466 o.paddingBottom = parseInt(o.sidebar.css('padding-bottom')); 4467
4468 // Add a temporary padding rule to check for collapsable margins. 4469 var collapsedTopHeight = o.stickySidebar.offset().top; 4470 var collapsedBottomHeight = o.stickySidebar.outerHeight(); 4471 o.stickySidebar.css('padding-top', 1); 4472 o.stickySidebar.css('padding-bottom', 1); 4473 collapsedTopHeight -= o.stickySidebar.offset().top; 4474 collapsedBottomHeight = o.stickySidebar.outerHeight() - collapsedBottomHeight - collapsedTopHeight; 4475 if (collapsedTopHeight == 0) { 4476 o.stickySidebar.css('padding-top', 0); 4477 o.stickySidebarPaddingTop = 0; 4478 } 4479 else { 4480 o.stickySidebarPaddingTop = 1; 4481 } 4482 4483 if (collapsedBottomHeight == 0) { 4484 o.stickySidebar.css('padding-bottom', 0); 4485 o.stickySidebarPaddingBottom = 0; 4486 } 4487 else { 4488 o.stickySidebarPaddingBottom = 1; 4489 } 4490 4491 // We use this to know whether the user is scrolling up or down. 4492 o.previousScrollTop = null; 4493 4494 // Scroll top (value) when the sidebar has fixed position. 4495 o.fixedScrollTop = 0; 4496 4497 // Set sidebar to default values. 4498 resetSidebar(); 4499 4500 o.onScroll = function (o) { 4501 // Stop if the sidebar isn't visible. 4502 if (!o.stickySidebar.is(":visible")) { 4503 return; 4504 } 4505 4506 // Stop if the window is too small. 4507 if ($('body').width() < o.options.minWidth) { 4508 resetSidebar(); 4509 return; 4510 } 4511 4512 // Stop if the sidebar width is larger than the container width (e.g. the theme is responsive and the sidebar is now below the content) 4513 if (o.options.disableOnResponsiveLayouts) { 4514 var sidebarWidth = o.sidebar.outerWidth(o.sidebar.css('float') == 'none'); 4515 4516 if (sidebarWidth + 50 > o.container.width()) { 4517 resetSidebar(); 4518 return; 4519 } 4520 } 4521 4522 var scrollTop = $(document).scrollTop(); 4523 var position = 'static'; 4524 4525 // If the user has scrolled down enough for the sidebar to be clipped at the top, then we can consider changing its position. 4526 if (scrollTop >= o.sidebar.offset().top + (o.paddingTop - o.options.additionalMarginTop)) { 4527 // The top and bottom offsets, used in various calculations. 4528 var offsetTop = o.paddingTop + options.additionalMarginTop; 4529 var offsetBottom = o.paddingBottom + o.marginBottom + options.additionalMarginBottom; 4530 4531 // All top and bottom positions are relative to the window, not to the parent elemnts. 4532 var containerTop = o.sidebar.offset().top; 4533 var containerBottom = o.sidebar.offset().top + getClearedHeight(o.container); 4534 4535 // The top and bottom offsets relative to the window screen top (zero) and bottom (window height). 4536 var windowOffsetTop = 0 + options.additionalMarginTop; 4537 var windowOffsetBottom; 4538 4539 var sidebarSmallerThanWindow = (o.stickySidebar.outerHeight() + offsetTop + offsetBottom) < $(window).height(); 4540 if (sidebarSmallerThanWindow) { 4541 windowOffsetBottom = windowOffsetTop + o.stickySidebar.outerHeight(); 4542 } 4543 else { 4544 windowOffsetBottom = $(window).height() - o.marginBottom - o.paddingBottom - options.additionalMarginBottom; 4545 } 4546 4547 var staticLimitTop = containerTop - scrollTop + o.paddingTop; 4548 var staticLimitBottom = containerBottom - scrollTop - o.paddingBottom - o.marginBottom; 4549 4550 var top = o.stickySidebar.offset().top - scrollTop; 4551 var scrollTopDiff = o.previousScrollTop - scrollTop; 4552 4553 // If the sidebar position is fixed, then it won't move up or down by itself. So, we manually adjust the top coordinate. 4554 if (o.stickySidebar.css('position') == 'fixed') { 4555 if (o.options.sidebarBehavior == 'modern') { 4556 top += scrollTopDiff; 4557 } 4558 } 4559 4560 if (o.options.sidebarBehavior == 'stick-to-top') { 4561 top = options.additionalMarginTop; 4562 } 4563 4564 if (o.options.sidebarBehavior == 'stick-to-bottom') { 4565 top = windowOffsetBottom - o.stickySidebar.outerHeight(); 4566 } 4567 4568 if (scrollTopDiff > 0) { // If the user is scrolling up. 4569 top = Math.min(top, windowOffsetTop); 4570 } 4571 else { // If the user is scrolling down. 4572 top = Math.max(top, windowOffsetBottom - o.stickySidebar.outerHeight()); 4573 } 4574 4575 top = Math.max(top, staticLimitTop); 4576 4577 top = Math.min(top, staticLimitBottom - o.stickySidebar.outerHeight()); 4578 4579 // If the sidebar is the same height as the container, we won't use fixed positioning. 4580 var sidebarSameHeightAsContainer = o.container.height() == o.stickySidebar.outerHeight(); 4581 4582 if (!sidebarSameHeightAsContainer && top == windowOffsetTop) { 4583 position = 'fixed'; 4584 } 4585 else if (!sidebarSameHeightAsContainer && top == windowOffsetBottom - o.stickySidebar.outerHeight()) { 4586 position = 'fixed'; 4587 } 4588 else if (scrollTop + top - o.sidebar.offset().top - o.paddingTop <= options.additionalMarginTop) { 4589 // Stuck to the top of the page. No special behavior. 4590 position = 'static'; 4591 } 4592 else { 4593 // Stuck to the bottom of the page. 4594 position = 'absolute'; 4595 } 4596 } 4597 4598 /*
4599 * Performance notice: It's OK to set these CSS values at each resize/scroll, even if they don't change. 4600 * It's way slower to first check if the values have changed. 4601 */ 4602 if (position == 'fixed') { 4603 var scrollLeft = $(document).scrollLeft(); 4604 4605 o.stickySidebar.css({ 4606 'position': 'fixed', 4607 'width': getWidthForObject(o.stickySidebar) + 'px', 4608 'transform': 'translateY(' + top + 'px)', 4609 'left': (o.sidebar.offset().left + parseInt(o.sidebar.css('padding-left')) - scrollLeft) + 'px', 4610 'top': '0px' 4611 }); 4612 } 4613 else if (position == 'absolute') { 4614 var css = {}; 4615 4616 if (o.stickySidebar.css('position') != 'absolute') { 4617 css.position = 'absolute'; 4618 css.transform = 'translateY(' + (scrollTop + top - o.sidebar.offset().top - o.stickySidebarPaddingTop - o.stickySidebarPaddingBottom) + 'px)'; 4619 css.top = '0px'; 4620 } 4621 4622 css.width = getWidthForObject(o.stickySidebar) + 'px'; 4623 css.left = ''; 4624 4625 o.stickySidebar.css(css); 4626 } 4627 else if (position == 'static') { 4628 resetSidebar(); 4629 } 4630 4631 if (position != 'static') { 4632 if (o.options.updateSidebarHeight == true) { 4633 o.sidebar.css({ 4634 'min-height': o.stickySidebar.outerHeight() + o.stickySidebar.offset().top - o.sidebar.offset().top + o.paddingBottom 4635 }); 4636 } 4637 } 4638 4639 o.previousScrollTop = scrollTop; 4640 }; 4641 4642 // Initialize the sidebar's position. 4643 o.onScroll(o); 4644 4645 // Recalculate the sidebar's position on every scroll and resize. 4646 $(document).on('scroll.' + o.options.namespace, function (o) { 4647 return function () { 4648 o.onScroll(o); 4649 }; 4650 }(o)); 4651 $(window).on('resize.' + o.options.namespace, function (o) { 4652 return function () { 4653 o.stickySidebar.css({'position': 'static'}); 4654 o.onScroll(o); 4655 }; 4656 }(o)); 4657 4658 // Recalculate the sidebar's position every time the sidebar changes its size. 4659 if (typeof ResizeSensor !== 'undefined') { 4660 new ResizeSensor(o.stickySidebar[0], function (o) { 4661 return function () { 4662 o.onScroll(o); 4663 }; 4664 }(o)); 4665 } 4666 4667 // Reset the sidebar to its default state 4668 function resetSidebar() { 4669 o.fixedScrollTop = 0; 4670 o.sidebar.css({ 4671 'min-height': '1px' 4672 }); 4673 o.stickySidebar.css({ 4674 'position': 'static', 4675 'width': '', 4676 'transform': 'none' 4677 }); 4678 } 4679 4680 // Get the height of a div as if its floated children were cleared. Note that this function fails if the floats are more than one level deep. 4681 function getClearedHeight(e) { 4682 var height = e.height(); 4683 4684 e.children().each(function () { 4685 height = Math.max(height, $(this).height()); 4686 }); 4687 4688 return height; 4689 } 4690 }); 4691 } 4692 4693 function getWidthForObject(object) { 4694 var width; 4695 4696 try { 4697 width = object[0].getBoundingClientRect().width; 4698 } 4699 catch (err) { 4700 } 4701 4702 if (typeof width === "undefined") { 4703 width = object.width(); 4704 } 4705 4706 return width; 4707 } 4708 4709 return this; 4710 } 4711})(jQuery); 4712 4713/*! 4714 * Name : Just Another Parallax [Jarallax] 4715 * Version : 1.11.1 4716 * Author : nK <https://nkdev.info> 4717 * GitHub : https://github.com/nk-o/jarallax 4718 */!function(n){var i={};function o(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};
4718return n[e].call(t.exports,t,t.exports,o),t.l=!0,t.exports}o.m=n,o.c=i,o.d=function(e,t,n){o.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.t=function(t,e){if(1&e&&(t=o(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(o.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)o.d(n,i,function(e){return t[e]}.bind(null,i));return n},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="",o(o.s=11)}([,,function(e,t,n){"use strict";e.exports=function(e){"complete"===document.readyState||"interactive"===document.readyState?e.call():document.attachEvent?document.attachEvent("onreadystatechange",function(){"interactive"===document.readyState&&e.call()}):document.addEventListener&&document.addEventListener("DOMContentLoaded",e)}},,function(n,e,t){"use strict";(function(e){var t;t="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},n.exports=t}).call(this,t(5))},function(e,t,n){"use strict";var i,o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":o(window))&&(i=window)}e.exports=i},,,,,,function(e,t,n){e.exports=n(12)},function(e,t,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o=l(n(2)),a=n(4),r=l(n(13));function l(e){return e&&e.__esModule?e:{default:e}}var s=a.window.jarallax;if(a.window.jarallax=r.default,a.window.jarallax.noConflict=function(){return a.window.jarallax=s,this},void 0!==a.jQuery){var c=function(){var e=arguments||[];Array.prototype.unshift.call(e,this);var t=r.default.apply(a.window,e);return"object"!==(void 0===t?"undefined":i(t))?t:this};c.constructor=r.default.constructor;var u=a.jQuery.fn.jarallax;a.jQuery.fn.jarallax=c,a.jQuery.fn.jarallax.noConflict=function(){return a.jQuery.fn.jarallax=u,this}}(0,o.default)(function(){(0,r.default)(document.querySelectorAll("[data-jarallax]"))})},function(e,I,P){"use strict";(function(e){Object.defineProperty(I,"__esModule",{value:!0});var s=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],i=!0,o=!1,a=void 0;try{for(var r,l=e[Symbol.iterator]();!(i=(r=l.next()).done)&&(n.push(r.value),!t||n.length!==t);i=!0);}catch(e){o=!0,a=e}finally{try{!i&&l.return&&l.return()}finally{if(o)throw a}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},t=function(e,t,n){return t&&i(e.prototype,t),n&&i(e,n),e};function i(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=r(P(2)),o=r(P(14)),a=P(4);function r(e){return e&&e.__esModule?e:{default:e}}var u=-1<navigator.userAgent.indexOf("MSIE ")||-1<navigator.userAgent.indexOf("Trident/")||-1<navigator.userAgent.indexOf("Edge/"),l=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),d=function(){for(var e="transform WebkitTransform MozTransform".split(" "),t=document.createElement("div"),n=0;n<e.length;n++)if(t&&void 0!==t.style[e[n]])return e[n];return!1}(),m=void 0;var v=void 0,b=void 0,p=void 0,f=!1,g=!1;function y(e){v=a.window.innerWidth||document.documentElement.clientWidth,b=l?(!m&&document.body&&((m=document.createElement("div")).style.cssText="position: fixed; top: -9999px; left: 0; height: 100vh; width: 0;",document.body.appendChild(m)),(m?m.clientHeight:0)||a.window.innerHeight||document.documentElement.clientHeight):a.window.innerHeight||document.documentElement.clientHeight,"object"!==(void 0===e?"undefined":c(e))||"load"!==e.type&&"dom
4718-loaded"!==e.type||(f=!0)}y(),a.window.addEventListener("resize",y),a.window.addEventListener("orientationchange",y),a.window.addEventListener("load",y),(0,n.default)(function(){y({type:"dom-loaded"})});var h=[],x=!1;function w(){if(h.length){p=void 0!==a.window.pageYOffset?a.window.pageYOffset:(document.documentElement||document.body.parentNode||document.body).scrollTop;var t=f||!x||x.width!==v||x.height!==b,n=g||t||!x||x.y!==p;g=f=!1,(t||n)&&(h.forEach(function(e){t&&e.onResize(),n&&e.onScroll()}),x={width:v,height:b,y:p}),(0,o.default)(w)}}var A=!!e.ResizeObserver&&new e.ResizeObserver(function(e){e&&e.length&&(0,o.default)(function(){e.forEach(function(e){e.target&&e.target.jarallax&&(f||e.target.jarallax.onResize(),g=!0)})})}),$=0,S=(t(j,[{key:"css",value:function(t,n){return"string"==typeof n?a.window.getComputedStyle(t).getPropertyValue(n):(n.transform&&d&&(n[d]=n.transform),Object.keys(n).forEach(function(e){t.style[e]=n[e]}),t)}},{key:"extend",value:function(n){var i=arguments;return n=n||{},Object.keys(arguments).forEach(function(t){i[t]&&Object.keys(i[t]).forEach(function(e){n[e]=i[t][e]})}),n}},{key:"getWindowData",value:function(){return{width:v,height:b,y:p}}},{key:"initImg",value:function(){var e=this,t=e.options.imgElement;return t&&"string"==typeof t&&(t=e.$item.querySelector(t)),t instanceof Element||(e.options.imgSrc?(t=new Image).src=e.options.imgSrc:t=null),t&&(e.options.keepImg?e.image.$item=t.cloneNode(!0):(e.image.$item=t,e.image.$itemParent=t.parentNode),e.image.useImgTag=!0),!(!e.image.$item&&(null===e.image.src&&(e.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",e.image.bgImage=e.css(e.$item,"background-image")),!e.image.bgImage||"none"===e.image.bgImage))}},{key:"canInitParallax",value:function(){return d&&!this.options.disableParallax()}},{key:"init",value:function(){var e=this,t={position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},n={};if(!e.options.keepImg){var i=e.$item.getAttribute("style");if(i&&e.$item.setAttribute("data-jarallax-original-styles",i),e.image.useImgTag){var o=e.image.$item.getAttribute("style");o&&e.image.$item.setAttribute("data-jarallax-original-styles",o)}}if("static"===e.css(e.$item,"position")&&e.css(e.$item,{position:"relative"}),"auto"===e.css(e.$item,"z-index")&&e.css(e.$item,{zIndex:0}),e.image.$container=document.createElement("div"),e.css(e.image.$container,t),e.css(e.image.$container,{"z-index":e.options.zIndex}),u&&e.css(e.image.$container,{opacity:.9999}),e.image.$container.setAttribute("id","jarallax-container-"+e.instanceID),e.$item.appendChild(e.image.$container),e.image.useImgTag?n=e.extend({"object-fit":e.options.imgSize,"object-position":e.options.imgPosition,"font-family":"object-fit: "+e.options.imgSize+"; object-position: "+e.options.imgPosition+";","max-width":"none"},t,n):(e.image.$item=document.createElement("div"),e.image.src&&(n=e.extend({"background-position":e.options.imgPosition,"background-size":e.options.imgSize,"background-repeat":e.options.imgRepeat,"background-image":e.image.bgImage||'url("'+e.image.src+'")'},t,n))),"opacity"!==e.options.type&&"scale"!==e.options.type&&"scale-opacity"!==e.options.type&&1!==e.options.speed||(e.image.position="absolute"),"fixed"===e.image.position)for(var a=0,r=e.$item;null!==r&&r!==document&&0===a;){var l=e.css(r,"-webkit-transform")||e.css(r,"-moz-transform")||e.css(r,"transform");l&&"none"!==l&&(a=1,e.image.position="absolute"),r=r.parentNode}n.position=e.image.position,e.css(e.image.$item,n),e.image.$container.appendChild(e.image.$item),e.onResize(),e.onScroll(!0),e.o
4718ptions.automaticResize&&A&&A.observe(e.$item),e.options.onInit&&e.options.onInit.call(e),"none"!==e.css(e.$item,"background-image")&&e.css(e.$item,{"background-image":"none"}),e.addToParallaxList()}},{key:"addToParallaxList",value:function(){h.push(this),1===h.length&&w()}},{key:"removeFromParallaxList",value:function(){var n=this;h.forEach(function(e,t){e.instanceID===n.instanceID&&h.splice(t,1)})}},{key:"destroy",value:function(){var e=this;e.removeFromParallaxList();var t=e.$item.getAttribute("data-jarallax-original-styles");if(e.$item.removeAttribute("data-jarallax-original-styles"),t?e.$item.setAttribute("style",t):e.$item.removeAttribute("style"),e.image.useImgTag){var n=e.image.$item.getAttribute("data-jarallax-original-styles");e.image.$item.removeAttribute("data-jarallax-original-styles"),n?e.image.$item.setAttribute("style",t):e.image.$item.removeAttribute("style"),e.image.$itemParent&&e.image.$itemParent.appendChild(e.image.$item)}e.$clipStyles&&e.$clipStyles.parentNode.removeChild(e.$clipStyles),e.image.$container&&e.image.$container.parentNode.removeChild(e.image.$container),e.options.onDestroy&&e.options.onDestroy.call(e),delete e.$item.jarallax}},{key:"clipContainer",value:function(){if("fixed"===this.image.position){var e=this,t=e.image.$container.getBoundingClientRect(),n=t.width,i=t.height;e.$clipStyles||(e.$clipStyles=document.createElement("style"),e.$clipStyles.setAttribute("type","text/css"),e.$clipStyles.setAttribute("id","jarallax-clip-"+e.instanceID),(document.head||document.getElementsByTagName("head")[0]).appendChild(e.$clipStyles));var o="#jarallax-container-"+e.instanceID+" {\n clip: rect(0 "+n+"px "+i+"px 0);\n clip: rect(0, "+n+"px, "+i+"px, 0);\n }";e.$clipStyles.styleSheet?e.$clipStyles.styleSheet.cssText=o:e.$clipStyles.innerHTML=o}}},{key:"coverImage",value:function(){var e=this,t=e.image.$container.getBoundingClientRect(),n=t.height,i=e.options.speed,o="scroll"===e.options.type||"scroll-opacity"===e.options.type,a=0,r=n,l=0;return o&&(i<0?(a=i*Math.max(n,b),b<n&&(a-=i*(n-b))):a=i*(n+b),1<i?r=Math.abs(a-b):i<0?r=a/i+Math.abs(a):r+=(b-n)*(1-i),a/=2),e.parallaxScrollDistance=a,l=o?(b-r)/2:(n-r)/2,e.css(e.image.$item,{height:r+"px",marginTop:l+"px",left:"fixed"===e.image.position?t.left+"px":"0",width:t.width+"px"}),e.options.onCoverImage&&e.options.onCoverImage.call(e),{image:{height:r,marginTop:l},container:t}}},{key:"isVisible",value:function(){return this.isElementInViewport||!1}},{key:"onScroll",value:function(e){var t=this,n=t.$item.getBoundingClientRect(),i=n.top,o=n.height,a={},r=n;if(t.options.elementInViewport&&(r=t.options.elementInViewport.getBoundingClientRect()),t.isElementInViewport=0<=r.bottom&&0<=r.right&&r.top<=b&&r.left<=v,e||t.isElementInViewport){var l=Math.max(0,i),s=Math.max(0,o+i),c=Math.max(0,-i),u=Math.max(0,i+o-b),d=Math.max(0,o-(i+o-b)),m=Math.max(0,-i+b-o),p=1-2*(b-i)/(b+o),f=1;if(o<b?f=1-(c||u)/o:s<=b?f=s/b:d<=b&&(f=d/b),"opacity"!==t.options.type&&"scale-opacity"!==t.options.type&&"scroll-opacity"!==t.options.type||(a.transform="translate3d(0,0,0)",a.opacity=f),"scale"===t.options.type||"scale-opacity"===t.options.type){var g=1;t.options.speed<0?g-=t.options.speed*f:g+=t.options.speed*(1-f),a.transform="scale("+g+") translate3d(0,0,0)"}if("scroll"===t.options.type||"scroll-opacity"===t.options.type){var y=t.parallaxScrollDistance*p;"absolute"===t.image.position&&(y-=i),a.transform="translate3d(0,"+y+"px,0)"}t.css(t.image.$item,a),t.options.onScroll&&t.options.onScroll.call(t,{section:n,beforeTop:l,beforeTopEnd:s,afterTop:c,beforeBottom:u,beforeBottomEnd:d,afterBottom:m,visiblePercent:f,fromViewportCenter:p})}}},{key:"onResize",value:function(){this.coverImage(),this.clipContainer()}}]),j);function j(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,j);var n=this;n.instanceID=$++,n.$item=e,n.defaults={type:"scroll",speed:.5,imgSrc:null,imgElement:".jarallax-img",imgSize:"cover",imgPosition:"50% 50%",imgRepeat:"no-repeat",keepImg:!1,elementInViewport:null,zIndex:-100,disableParallax:!1,disableVideo:!1,automaticResize:!0,videoSrc:null,videoStartTime:0,videoEndTime:0,videoVolume:0,videoLoop:!0,videoPlayOnlyVisible:!0,videoLazyLoading:!0,onScroll:null,onInit:null,onDestroy:null,onCoverImage:null};var i=n.$item.dataset||{},o={};
4718if(Object.keys(i).forEach(function(e){var t=e.substr(0,1).toLowerCase()+e.substr(1);t&&void 0!==n.defaults[t]&&(o[t]=i[e])}),n.options=n.extend({},n.defaults,o,t),n.pureOptions=n.extend({},n.options),Object.keys(n.options).forEach(function(e){"true"===n.options[e]?n.options[e]=!0:"false"===n.options[e]&&(n.options[e]=!1)}),n.options.speed=Math.min(2,Math.max(-1,parseFloat(n.options.speed))),"string"==typeof n.options.disableParallax&&(n.options.disableParallax=new RegExp(n.options.disableParallax)),n.options.disableParallax instanceof RegExp){var a=n.options.disableParallax;n.options.disableParallax=function(){return a.test(navigator.userAgent)}}if("function"!=typeof n.options.disableParallax&&(n.options.disableParallax=function(){return!1}),"string"==typeof n.options.disableVideo&&(n.options.disableVideo=new RegExp(n.options.disableVideo)),n.options.disableVideo instanceof RegExp){var r=n.options.disableVideo;n.options.disableVideo=function(){return r.test(navigator.userAgent)}}"function"!=typeof n.options.disableVideo&&(n.options.disableVideo=function(){return!1});var l=n.options.elementInViewport;l&&"object"===(void 0===l?"undefined":c(l))&&void 0!==l.length&&(l=s(l,1)[0]);l instanceof Element||(l=null),n.options.elementInViewport=l,n.image={src:n.options.imgSrc||null,$container:null,useImgTag:!1,position:/iPad|iPhone|iPod|Android/.test(navigator.userAgent)?"absolute":"fixed"},n.initImg()&&n.canInitParallax()&&n.init()}function E(e,t){("object"===("undefined"==typeof HTMLElement?"undefined":c(HTMLElement))?e instanceof HTMLElement:e&&"object"===(void 0===e?"undefined":c(e))&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName)&&(e=[e]);for(var n=t,i=Array.prototype.slice.call(arguments,2),o=e.length,a=0,r=void 0;a<o;a++)if("object"===(void 0===n?"undefined":c(n))||void 0===n?e[a].jarallax||(e[a].jarallax=new S(e[a],n)):e[a].jarallax&&(r=e[a].jarallax[n].apply(e[a].jarallax,i)),void 0!==r)return r;return e}E.constructor=S,I.default=E}).call(this,P(5))},function(e,t,n){"use strict";var i=n(15),o=i.requestAnimationFrame||i.webkitRequestAnimationFrame||i.mozRequestAnimationFrame||function(e){var t=+new Date,n=Math.max(0,16-(t-a)),i=setTimeout(e,n);return a=t,i},a=+new Date;var r=i.cancelAnimationFrame||i.webkitCancelAnimationFrame||i.mozCancelAnimationFrame||clearTimeout;Function.prototype.bind&&(o=o.bind(i),r=r.bind(i)),(e.exports=o).cancel=r},function(n,e,t){"use strict";(function(e){var t;t="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},n.exports=t}).call(this,t(5))}]); 4719 4720/*! 4721 * Name : Video Background Extension for Jarallax 4722 * Version : 1.0.1 4723 * Author : nK <https://nkdev.info> 4724 * GitHub : https://github.com/nk-o/jarallax 4725 */!function(o){var i={};function n(e){if(i[e])return i[e].exports;var t=i[e]={i:e,l:!1,exports:{}};return o[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}n.m=o,n.c=i,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(o,i,function(e){return t[e]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=6)}([,,function(e,t,o){"use strict";e.exports=function(e){"complete"===document.readyState||"interactive"===document.readyState?e.call():document.attachEvent?document.attachEvent("onreadystatechange",function(){"interactive"===document.readyState&&e.call()}):document.addEventListener&&document.addEventListener("DOMContentLoaded",e)}},,function(o,e,t){"use strict";(function(e){var t;t="undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{},o.exports=t}).call(this,t(5))},function(e,t,o){"use strict";var i,n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};i=function(){return this}();try{i=i||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":n(window))&&(i=window)}e.exports=i},function(e,t,o){e.exports=o(7)},function(e,t,o){"use strict";var i=l(o(8)),n=l(o(4)),a=l(o(2)),r=l(o(10));
4725function l(e){return e&&e.__esModule?e:{default:e}}n.default.VideoWorker=n.default.VideoWorker||i.default,(0,r.default)(),(0,a.default)(function(){"undefined"!=typeof jarallax&&jarallax(document.querySelectorAll("[data-jarallax-video]"))})},function(e,t,o){"use strict";e.exports=o(9)},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n=function(e,t,o){return t&&a(e.prototype,t),o&&a(e,o),e};function a(e,t){for(var o=0;o<t.length;o++){var i=t[o];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(){this._done=[],this._fail=[]}r.prototype={execute:function(e,t){var o=e.length;for(t=Array.prototype.slice.call(t);o--;)e[o].apply(null,t)},resolve:function(){this.execute(this._done,arguments)},reject:function(){this.execute(this._fail,arguments)},done:function(e){this._done.push(e)},fail:function(e){this._fail.push(e)}};var l=0,p=0,u=0,d=0,s=0,y=new r,c=new r,v=(n(m,[{key:"extend",value:function(o){var i=arguments;return o=o||{},Object.keys(arguments).forEach(function(t){i[t]&&Object.keys(i[t]).forEach(function(e){o[e]=i[t][e]})}),o}},{key:"parseURL",value:function(e){var t,o,i,n,a,r=!(!(t=e.match(/.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=)([^#\&\?]*).*/))||11!==t[1].length)&&t[1],l=!(!(o=e.match(/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/))||!o[3])&&o[3],p=(i=e.split(/,(?=mp4\:|webm\:|ogv\:|ogg\:)/),n={},a=0,i.forEach(function(e){var t=e.match(/^(mp4|webm|ogv|ogg)\:(.*)/);t&&t[1]&&t[2]&&(n["ogv"===t[1]?"ogg":t[1]]=t[2],a=1)}),!!a&&n);return r?(this.type="youtube",r):l?(this.type="vimeo",l):!!p&&(this.type="local",p)}},{key:"isValid",value:function(){return!!this.videoID}},{key:"on",value:function(e,t){this.userEventsList=this.userEventsList||[],(this.userEventsList[e]||(this.userEventsList[e]=[])).push(t)}},{key:"off",value:function(o,i){var n=this;this.userEventsList&&this.userEventsList[o]&&(i?this.userEventsList[o].forEach(function(e,t){e===i&&(n.userEventsList[o][t]=!1)}):delete this.userEventsList[o])}},{key:"fire",value:function(e){var t=this,o=[].slice.call(arguments,1);this.userEventsList&&void 0!==this.userEventsList[e]&&this.userEventsList[e].forEach(function(e){e&&e.apply(t,o)})}},{key:"play",value:function(e){var t=this;t.player&&("youtube"===t.type&&t.player.playVideo&&(void 0!==e&&t.player.seekTo(e||0),YT.PlayerState.PLAYING!==t.player.getPlayerState()&&t.player.playVideo()),"vimeo"===t.type&&(void 0!==e&&t.player.setCurrentTime(e),t.player.getPaused().then(function(e){e&&t.player.play()})),"local"===t.type&&(void 0!==e&&(t.player.currentTime=e),t.player.paused&&t.player.play()))}},{key:"pause",value:function(){var t=this;t.player&&("youtube"===t.type&&t.player.pauseVideo&&YT.PlayerState.PLAYING===t.player.getPlayerState()&&t.player.pauseVideo(),"vimeo"===t.type&&t.player.getPaused().then(function(e){e||t.player.pause()}),"local"===t.type&&(t.player.paused||t.player.pause()))}},{key:"mute",value:function(){var e=this;e.player&&("youtube"===e.type&&e.player.mute&&e.player.mute(),"vimeo"===e.type&&e.player.setVolume&&e.player.setVolume(0),"local"===e.type&&(e.$video.muted=!0))}},{key:"unmute",value:function(){var e=this;e.player&&("youtube"===e.type&&e.player.mute&&e.player.unMute(),"vimeo"===e.type&&e.player.setVolume&&e.player.setVolume(e.options.volume),"local"===e.type&&(e.$video.muted=!1))}},{key:"setVolume",value:function(e){var t=0<arguments.length&&void 0!==e&&e,o=this;o.player&&t&&("youtube"===o.type&&o.player.setVolume&&o.player.setVolume(t),"vimeo"===o.type&&o.player.setVolume&&o.player.setVolume(t),"local"===o.type&&(o.$video.volume=t/100))}},{key:"getVolume",value:function(t){var e=this;e.player?("youtube"===e.type&&e.player.getVolume&&t(e.player.getVolume()),"vimeo"===e.type&&e.player.getVolume&&e.player.getVolume().then(function(e){t(e)}),"local"===e.type&&t(100*e.$video.volume)):t(!1)}},{key:"getMuted",value:function(t){var e=this;e.player?("youtube"===e.type&&e.player.isMuted&&t(e.player.isMuted()),"vimeo"===e.type&&e.player.getVolume&&e.player.getVolume().then(function(e){t(!!e)}),"local"===e.type&&t(e.$video.muted)):t(null)}},{key:"getImageURL",value:function(t){var o=this;
4725if(o.videoImage)t(o.videoImage);else{if("youtube"===o.type){var e=["maxresdefault","sddefault","hqdefault","0"],i=0,n=new Image;n.onload=function(){120!==(this.naturalWidth||this.width)||i===e.length-1?(o.videoImage="https://img.youtube.com/vi/"+o.videoID+"/"+e[i]+".jpg",t(o.videoImage)):(i++,this.src="https://img.youtube.com/vi/"+o.videoID+"/"+e[i]+".jpg")},n.src="https://img.youtube.com/vi/"+o.videoID+"/"+e[i]+".jpg"}if("vimeo"===o.type){var a=new XMLHttpRequest;a.open("GET","https://vimeo.com/api/v2/video/"+o.videoID+".json",!0),a.onreadystatechange=function(){if(4===this.readyState&&200<=this.status&&this.status<400){var e=JSON.parse(this.responseText);o.videoImage=e[0].thumbnail_large,t(o.videoImage)}},a.send(),a=null}}}},{key:"getIframe",value:function(e){this.getVideo(e)}},{key:"getVideo",value:function(p){var u=this;u.$video?p(u.$video):u.onAPIready(function(){var e=void 0;if(u.$video||((e=document.createElement("div")).style.display="none"),"youtube"===u.type){u.playerOptions={},u.playerOptions.videoId=u.videoID,u.playerOptions.playerVars={autohide:1,rel:0,autoplay:0,playsinline:1},u.options.showContols||(u.playerOptions.playerVars.iv_load_policy=3,u.playerOptions.playerVars.modestbranding=1,u.playerOptions.playerVars.controls=0,u.playerOptions.playerVars.showinfo=0,u.playerOptions.playerVars.disablekb=1);var t=void 0,o=void 0;u.playerOptions.events={onReady:function(t){u.options.mute?t.target.mute():u.options.volume&&t.target.setVolume(u.options.volume),u.options.autoplay&&u.play(u.options.startTime),u.fire("ready",t),u.options.loop&&!u.options.endTime&&(u.options.endTime=u.player.getDuration()-.1),setInterval(function(){u.getVolume(function(e){u.options.volume!==e&&(u.options.volume=e,u.fire("volumechange",t))})},150)},onStateChange:function(e){u.options.loop&&e.data===YT.PlayerState.ENDED&&u.play(u.options.startTime),t||e.data!==YT.PlayerState.PLAYING||(t=1,u.fire("started",e)),e.data===YT.PlayerState.PLAYING&&u.fire("play",e),e.data===YT.PlayerState.PAUSED&&u.fire("pause",e),e.data===YT.PlayerState.ENDED&&u.fire("ended",e),e.data===YT.PlayerState.PLAYING?o=setInterval(function(){u.fire("timeupdate",e),u.options.endTime&&u.player.getCurrentTime()>=u.options.endTime&&(u.options.loop?u.play(u.options.startTime):u.pause())},150):clearInterval(o)}};var i=!u.$video;if(i){var n=document.createElement("div");n.setAttribute("id",u.playerID),e.appendChild(n),document.body.appendChild(e)}u.player=u.player||new window.YT.Player(u.playerID,u.playerOptions),i&&(u.$video=document.getElementById(u.playerID),u.videoWidth=parseInt(u.$video.getAttribute("width"),10)||1280,u.videoHeight=parseInt(u.$video.getAttribute("height"),10)||720)}if("vimeo"===u.type){if(u.playerOptions={id:u.videoID,autopause:0,transparent:0,autoplay:u.options.autoplay?1:0,loop:u.options.loop?1:0,muted:u.options.mute?1:0},u.options.volume&&(u.playerOptions.volume=u.options.volume),u.options.showContols||(u.playerOptions.badge=0,u.playerOptions.byline=0,u.playerOptions.portrait=0,u.playerOptions.title=0),!u.$video){var a="";Object.keys(u.playerOptions).forEach(function(e){""!==a&&(a+="&"),a+=e+"="+encodeURIComponent(u.playerOptions[e])}),u.$video=document.createElement("iframe"),u.$video.setAttribute("id",u.playerID),u.$video.setAttribute("src","https://player.vimeo.com/video/"+u.videoID+"?"+a),u.$video.setAttribute("frameborder","0"),u.$video.setAttribute("mozallowfullscreen",""),u.$video.setAttribute("allowfullscreen",""),e.appendChild(u.$video),document.body.appendChild(e)}u.player=u.player||new Vimeo.Player(u.$video,u.playerOptions),u.options.startTime&&u.options.autoplay&&u.player.setCurrentTime(u.options.startTime),u.player.getVideoWidth().then(function(e){u.videoWidth=e||1280}),u.player.getVideoHeight().then(function(e){u.videoHeight=e||720});var r=void 0;u.player.on("timeupdate",function(e){r||(u.fire("started",e),r=1),u.fire("timeupdate",e),u.options.endTime&&u.options.endTime&&e.seconds>=u.options.endTime&&(u.options.loop?u.play(u.options.startTime):u.pause())}),u.player.on("play",function(e){u.fire("play",e),u.options.startTime&&0===e.seconds&&u.play(u.options.startTime)}),u.player.on("pause",function(e){u.fire("pause",e)}),u.player.on("ended",function(e){u.fire("ended",e)}),u.player.on("loaded",function(e){u.fire("ready",e)}),u.player.on("volumechange",function(e){u.fire("volumechange",e)})}if("local"===u.type){u.$video||(u.$video=document.createElement("video"),u.options.showContols&&(u.$video.controls=!0),u.options.mute?u.$video.muted=!0:u.$video.volume&&(u.$video.volume=u.options.volume/100),u.options.loop&&(u.$video.loop=!0),u.$video.setAttribute("playsinline",""),u.$video.setAttribute("webkit-playsinline",""),u.$video.setAttribute("id",u.playerID),e.appendChild(u.$video),document.body.appendChild(e),Object.keys(u.videoID).forEac
4725h(function(e){!function(e,t,o){var i=document.createElement("source");i.src=t,i.type=o,e.appendChild(i)}(u.$video,u.videoID[e],"video/"+e)})),u.player=u.player||u.$video;var l=void 0;u.player.addEventListener("playing",function(e){l||u.fire("started",e),l=1}),u.player.addEventListener("timeupdate",function(e){u.fire("timeupdate",e),u.options.endTime&&u.options.endTime&&this.currentTime>=u.options.endTime&&(u.options.loop?u.play(u.options.startTime):u.pause())}),u.player.addEventListener("play",function(e){u.fire("play",e)}),u.player.addEventListener("pause",function(e){u.fire("pause",e)}),u.player.addEventListener("ended",function(e){u.fire("ended",e)}),u.player.addEventListener("loadedmetadata",function(){u.videoWidth=this.videoWidth||1280,u.videoHeight=this.videoHeight||720,u.fire("ready"),u.options.autoplay&&u.play(u.options.startTime)}),u.player.addEventListener("volumechange",function(e){u.getVolume(function(e){u.options.volume=e}),u.fire("volumechange",e)})}p(u.$video)})}},{key:"init",value:function(){this.playerID="VideoWorker-"+this.ID}},{key:"loadAPI",value:function(){if(!p||!u){var e="";if("youtube"!==this.type||p||(p=1,e="https://www.youtube.com/iframe_api"),"vimeo"!==this.type||u||(u=1,e="https://player.vimeo.com/api/player.js"),e){var t=document.createElement("script"),o=document.getElementsByTagName("head")[0];t.src=e,o.appendChild(t),t=o=null}}}},{key:"onAPIready",value:function(e){if("youtube"===this.type&&("undefined"!=typeof YT&&0!==YT.loaded||d?"object"===("undefined"==typeof YT?"undefined":i(YT))&&1===YT.loaded?e():y.done(function(){e()}):(d=1,window.onYouTubeIframeAPIReady=function(){window.onYouTubeIframeAPIReady=null,y.resolve("done"),e()})),"vimeo"===this.type)if("undefined"!=typeof Vimeo||s)"undefined"!=typeof Vimeo?e():c.done(function(){e()});else{s=1;var t=setInterval(function(){"undefined"!=typeof Vimeo&&(clearInterval(t),c.resolve("done"),e())},20)}"local"===this.type&&e()}}]),m);function m(e,t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,m);var o=this;o.url=e,o.options_default={autoplay:!1,loop:!1,mute:!1,volume:100,showContols:!0,startTime:0,endTime:0},o.options=o.extend({},o.options_default,t),o.videoID=o.parseURL(e),o.videoID&&(o.ID=l++,o.loadAPI(),o.init())}t.default=v},function(e,t,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:p.default.jarallax;if(void 0===e)return;var t=e.constructor,i=t.prototype.onScroll;t.prototype.onScroll=function(){var o=this;i.apply(o),o.isVideoInserted||!o.video||o.options.videoLazyLoading&&!o.isElementInViewport||o.options.disableVideo()||(o.isVideoInserted=!0,o.video.getVideo(function(e){var t=e.parentNode;o.css(e,{position:o.image.position,top:"0px",left:"0px",right:"0px",bottom:"0px",width:"100%",height:"100%",maxWidth:"none",maxHeight:"none",margin:0,zIndex:-1}),o.$video=e,o.image.$container.appendChild(e),t.parentNode.removeChild(t)}))};var l=t.prototype.coverImage;t.prototype.coverImage=function(){var e=this,t=l.apply(e),o=!!e.image.$item&&e.image.$item.nodeName;
4725if(t&&e.video&&o&&("IFRAME"===o||"VIDEO"===o)){var i=t.image.height,n=i*e.image.width/e.image.height,a=(t.container.width-n)/2,r=t.image.marginTop;t.container.width>n&&(i=(n=t.container.width)*e.image.height/e.image.width,a=0,r+=(t.image.height-i)/2),"IFRAME"===o&&(i+=400,r-=200),e.css(e.$video,{width:n+"px",marginLeft:a+"px",height:i+"px",marginTop:r+"px"})}return t};var o=t.prototype.initImg;t.prototype.initImg=function(){var e=this,t=o.apply(e);return e.options.videoSrc||(e.options.videoSrc=e.$item.getAttribute("data-jarallax-video")||null),e.options.videoSrc?(e.defaultInitImgResult=t,!0):t};var n=t.prototype.canInitParallax;t.prototype.canInitParallax=function(){var o=this,e=n.apply(o);if(!o.options.videoSrc)return e;var t=new r.default(o.options.videoSrc,{autoplay:!0,loop:o.options.videoLoop,showContols:!1,startTime:o.options.videoStartTime||0,endTime:o.options.videoEndTime||0,mute:o.options.videoVolume?0:1,volume:o.options.videoVolume||0});if(t.isValid())if(e){if(t.on("ready",function(){if(o.options.videoPlayOnlyVisible){var e=o.onScroll;o.onScroll=function(){e.apply(o),!o.options.videoLoop&&(o.options.videoLoop||o.videoEnded)||(o.isVisible()?t.play():t.pause())}}else t.play()}),t.on("started",function(){o.image.$default_item=o.image.$item,o.image.$item=o.$video,o.image.width=o.video.videoWidth||1280,o.image.height=o.video.videoHeight||720,o.coverImage(),o.clipContainer(),o.onScroll(),o.image.$default_item&&(o.image.$default_item.style.display="none")}),t.on("ended",function(){o.videoEnded=!0,o.options.videoLoop||o.image.$default_item&&(o.image.$item=o.image.$default_item,o.image.$item.style.display="block",o.coverImage(),o.clipContainer(),o.onScroll())}),o.video=t,!o.defaultInitImgResult)return o.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7","local"===t.type||(t.getImageURL(function(e){o.image.bgImage='url("'+e+'")',o.init()}),!1)}else o.defaultInitImgResult||t.getImageURL(function(e){var t=o.$item.getAttribute("style");t&&o.$item.setAttribute("data-jarallax-original-styles",t),o.css(o.$item,{"background-image":'url("'+e+'")',"background-position":"center","background-size":"cover"})});return e};var a=t.prototype.destroy;t.prototype.destroy=function(){var e=this;e.image.$default_item&&(e.image.$item=e.image.$default_item,delete e.image.$default_item),a.apply(e)}};var r=i(o(8)),p=i(o(4));function i(e){return e&&e.__esModule?e:{default:e}}}]); 4726 4727 4728/*! npm.im/object-fit-images 3.2.4 */ 4729var objectFitImages=function(){"use strict";function t(t,e){return"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='"+t+"' height='"+e+"'%3E%3C/svg%3E"}function e(t){if(t.srcset&&!p&&window.picturefill){var e=window.picturefill._;t[e.ns]&&t[e.ns].evaled||e.fillImg(t,{reselect:!0}),t[e.ns].curSrc||(t[e.ns].supported=!1,e.fillImg(t,{reselect:!0})),t.currentSrc=t[e.ns].curSrc||t.src}}function i(t){for(var e,i=getComputedStyle(t).fontFamily,r={};null!==(e=u.exec(i));)r[e[1]]=e[2];return r}function r(e,i,r){var n=t(i||1,r||0);b.call(e,"src")!==n&&h.call(e,"src",n)}function n(t,e){t.naturalWidth?e(t):setTimeout(n,100,t,e)}function c(t){var c=i(t),o=t[l];if(c["object-fit"]=c["object-fit"]||"fill",!o.img){if("fill"===c["object-fit"])return;if(!o.skipTest&&f&&!c["object-position"])return}if(!o.img){o.img=new Image(t.width,t.height),o.img.srcset=b.call(t,"data-ofi-srcset")||t.srcset,o.img.src=b.call(t,"data-ofi-src")||t.src,h.call(t,"data-ofi-src",t.src),t.srcset&&h.call(t,"data-ofi-srcset",t.srcset),r(t,t.naturalWidth||t.width,t.naturalHeight||t.height),t.srcset&&(t.srcset="");try{s(t)}catch(t){window.console&&console.warn("https://bit.ly/ofi-old-browser")}}e(o.img),t.style.backgroundImage='url("'+(o.img.currentSrc||o.img.src).replace(/"/g,'\\"')+'")',t.style.backgroundPosition=c["object-position"]||"center",t.style.backgroundRepeat="no-repeat",t.style.backgroundOrigin="content-box",/scale-down/.test(c["object-fit"])?n(o.img,function(){o.img.naturalWidth>t.width||o.img.naturalHeight>t.height?t.style.backgroundSize="contain":t.style.backgroundSize="auto"}):t.style.backgroundSize=c["object-fit"].replace("none","auto").replace("fill","100% 100%"),n(o.img,function(e){r(t,e.naturalWi
4729dth,e.naturalHeight)})}function s(t){var e={get:function(e){return t[l].img[e?e:"src"]},set:function(e,i){return t[l].img[i?i:"src"]=e,h.call(t,"data-ofi-"+i,e),c(t),e}};Object.defineProperty(t,"src",e),Object.defineProperty(t,"currentSrc",{get:function(){return e.get("currentSrc")}}),Object.defineProperty(t,"srcset",{get:function(){return e.get("srcset")},set:function(t){return e.set(t,"srcset")}})}function o(){function t(t,e){return t[l]&&t[l].img&&("src"===e||"srcset"===e)?t[l].img:t}d||(HTMLImageElement.prototype.getAttribute=function(e){return b.call(t(this,e),e)},HTMLImageElement.prototype.setAttribute=function(e,i){return h.call(t(this,e),e,String(i))})}function a(t,e){var i=!y&&!t;if(e=e||{},t=t||"img",d&&!e.skipTest||!m)return!1;"img"===t?t=document.getElementsByTagName("img"):"string"==typeof t?t=document.querySelectorAll(t):"length"in t||(t=[t]);for(var r=0;r<t.length;r++)t[r][l]=t[r][l]||{skipTest:e.skipTest},c(t[r]);i&&(document.body.addEventListener("load",function(t){"IMG"===t.target.tagName&&a(t.target,{skipTest:e.skipTest})},!0),y=!0,t="img"),e.watchMQ&&window.addEventListener("resize",a.bind(null,t,{skipTest:e.skipTest}))}var l="bfred-it:object-fit-images",u=/(object-fit|object-position)\s*:\s*([-.\w\s%]+)/g,g="undefined"==typeof Image?{style:{"object-position":1}}:new Image,f="object-fit"in g.style,d="object-position"in g.style,m="background-size"in g.style,p="string"==typeof g.currentSrc,b=g.getAttribute,h=g.setAttribute,y=!1;return a.supportsObjectFit=f,a.supportsObjectPosition=d,o(),a}(); 4730 4731/*! resizeObserver 3.2.4 */ 4732!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ResizeObserver=e()}(this,function(){"use strict";var t=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some(function(t,r){return t[0]===e&&(n=r,!0)}),n}return function(){function e(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n<r.length;n+=1){var i=r[n];t.call(e,i[1],i[0])}},Object.defineProperties(e.prototype,n),e}()}(),e="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,n="undefined"!=typeof global&&global.Math===Math?global:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),r="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(n):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)},i=2,o=["top","right","bottom","left","width","height","size","weight"],s="undefined"!=typeof MutationObserver,c=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,o=!1,s=0;function c(){n&&(n=!1,t()),o&&h()}function a(){r(c)}function h(){var t=Date.now();if(n){if(t-s<i)return;o=!0}else n=!0,o=!1,setTimeout(a,e);s=t}return h}(this.refresh.bind(this),20)};c.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},c.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},c.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},c.prototype.updateObservers_=function(){var t=this.observers_.filter(function(t){return t.gatherActive(),t.hasActive()});return t.forEach(function(t){return t.broadcastActive()}),t.length>0},c.prototype.connect_=function(){e&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),s?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},c.prototype.disconnect_=function(){e&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},c.prototype.onTransitionEnd_=function(t){var e=t.propertyName;void 0===e&&(e=""),o.some(function(t){return!!~e.indexOf(t)})&&this.refresh()},c.getInstance=function(){return this.instance_||(this.instance_=ne
4732w c),this.instance_},c.instance_=null;var a=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n+=1){var i=r[n];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},h=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||n},u=_(0,0,0,0);function f(t){return parseFloat(t)||0}function d(t){for(var e=[],n=arguments.length-1;n-- >0;)e[n]=arguments[n+1];return e.reduce(function(e,n){return e+f(t["border-"+n+"-width"])},0)}function p(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return u;var r=h(t).getComputedStyle(t),i=function(t){for(var e={},n=0,r=["top","right","bottom","left"];n<r.length;n+=1){var i=r[n],o=t["padding-"+i];e[i]=f(o)}return e}(r),o=i.left+i.right,s=i.top+i.bottom,c=f(r.width),a=f(r.height);if("border-box"===r.boxSizing&&(Math.round(c+o)!==e&&(c-=d(r,"left","right")+o),Math.round(a+s)!==n&&(a-=d(r,"top","bottom")+s)),!function(t){return t===h(t).document.documentElement}(t)){var p=Math.round(c+o)-e,v=Math.round(a+s)-n;1!==Math.abs(p)&&(c-=p),1!==Math.abs(v)&&(a-=v)}return _(i.left,i.top,c,a)}var v="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof h(t).SVGGraphicsElement}:function(t){return t instanceof h(t).SVGElement&&"function"==typeof t.getBBox};function l(t){return e?v(t)?function(t){var e=t.getBBox();return _(0,0,e.width,e.height)}(t):p(t):u}function _(t,e,n,r){return{x:t,y:e,width:n,height:r}}var b=function(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=_(0,0,0,0),this.target=t};b.prototype.isActive=function(){var t=l(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},b.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t};var m=function(t,e){var n,r,i,o,s,c,h,u=(r=(n=e).x,i=n.y,o=n.width,s=n.height,c="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,h=Object.create(c.prototype),a(h,{x:r,y:i,width:o,height:s,top:i,right:r+o,bottom:s+i,left:r}),h);a(this,{target:t,contentRect:u})},y=function(e,n,r){if(this.activeObservations_=[],this.observations_=new t,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r};y.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof h(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new b(t)),this.controller_.addObserver(this),this.controller_.refresh())}},y.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof h(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},y.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},y.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},y.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(t){return new m(t.target,t.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},y.prototype.clearActive=function(){this.activeObservations_.splice(0)},y.prototype.hasActive=function(){return this.activeObservations_.length>0};var g="undefined"!=typeof WeakMap?new WeakMap:new t,w=function(t){if(!(this instanceof w))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var e=c.getInstance(),n=new y(t,e,this);g.set(this,n)};return["observe","unobserve","disconnect"].forEach(function(t){w.prototype[t]=function(){return(e=g.get(this))[t].apply(e,arguments);var e}}),void 0!==n.ResizeObserver?n.ResizeObserver:(n.ResizeObserver=w,w)}); 4733 4734 4735 4736(function($,sr){ 4737 4738 // debouncing function from John Hann 4739 // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/ 4740 var debounce = function (func, threshold, execAsap) { 4741 var timeout; 4742 4743 return function debounced () { 4744 var obj = this, args = arguments; 4745 function delayed () { 4746 if (!execAsap) 4747 func.apply(obj, args); 4748 timeout = null; 4749 }; 4750 4751 if (timeout) 4752 clearTimeout(timeout); 4753 else if (execAsap) 4754 func.apply(obj, args); 4755 4756 timeout = setTimeout(delayed, threshold || 100); 4757 }; 4758 } 4759 // smartresize 4760 jQuery.fn[sr] = function(fn){ return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr); }; 4761 4762})(jQuery,'smartresize'); 4763 4764 4765/** 4766 * Parallax 4767 */ 4768 4769( function( $ ){ 4770 4771 $.fn.herculesDesignParallax = function( options ){ 4772 4773 var $$ = $(this); 4774 4775 if( options === 'refreshParallax' ) { 4776 return $$.trigger( 'refreshParallax' ); 4777 } 4778 4779 options = $.extend( { 4780 // We need to know the background image URL to use 4781 backgroundUrl: null, 4782 // And the exact size of that image 4783 backgroundSize: null, 4784 // We can work out the aspect ratio from the size 4785 backgroundAspectRatio: null, 4786 // How we want to handle sizing of the background image 4787 backgroundSizing: 'scaled', 4788 // Should we limit the amount of motion in the background image 4789 // The number of pixels the background image can move for every pixel of scrolling 4790 limitMotion: 'auto', 4791 }, options ); 4792 4793 if( options.backgroundAspectRatio === null ) { 4794 options.backgroundAspectRatio = options.backgroundSize[0] / options.backgroundSize[1]; 4795 } 4796 4797 var setupParallax = function( ){ 4798 4799 try { 4800 var wrapperSize = [ 4801 $$.outerWidth(), 4802 $$.outerHeight() 4803 ]; 4804 4805 var bounding = $$[0].getBoundingClientRect(); 4806 var windowHeight = $( window ).outerHeight(); 4807 4808 if( $$.data('herculesdesign-parallax-init') === undefined ) { 4809 // Do the initial setup 4810 $$.css( { 4811 'background-image' : 'url(' + options.backgroundUrl + ')' 4812 } ); 4813 } 4814 4815 var limitMotion; 4816 if( options.limitMotion === 'auto' ) { 4817 if( windowHeight < 720 ) { 4818 limitMotion = 0.55; 4819 } else if( windowHeight > 1300 ) { 4820 limitMotion = 0.45; 4821 } else { 4822 limitMotion = (-0.00017 * ( windowHeight - 720 ) ) + 0.55; 4823 } 4824 } else { 4825 limitMotion = parseFloat( options.limitMotion ); 4826 } 4827 4828 // What percent is this through a screen cycle 4829 // -1 is when the bottom of the wrapper is at the top of the screen 4830 // 1 is when the top of the wrapper is at the bottom of the screen 4831 var position = ( bounding.bottom + ( bounding.top - windowHeight ) ) / ( windowHeight + bounding.height ); 4832 var percent = ( position - 1 ) / - 2; 4833 var topPosition = 0; 4834 var limitScale = 1; 4835 var backgroundSize = options.backgroundSize; 4836 4837 // Do the setup for every time something changes 4838 if( options.backgroundSizing === 'scaled' ) { 4839 // This is the required Y height to create a parallax effect 4840 var finalY = wrapperSize[1] / ( limitMotion ? limitMotion : 1 ); 4841 var scaleBG = wrapperSize[0] / backgroundSize[0]; // The initial scaling is based on container width 4842 4843 if( finalY > backgroundSize[1] * scaleBG ) { 4844 // This image wouldn't be tall enough to give a decent parallax effect, so we'll scale it up 4845 scaleBG = finalY / backgroundSize[1]; 4846 limitMotion = false;
4847 } 4848 4849 $$.css( 4850 'background-size', 4851 ( backgroundSize[0] * scaleBG ) + 'px ' + 4852 ( backgroundSize[1] * scaleBG ) + 'px' 4853 ); 4854 4855 // Work out the top position 4856 if( bounding.top > - wrapperSize[1] && bounding.bottom - windowHeight < wrapperSize[1] ) { 4857 // This is the scaled background height 4858 var backgroundHeight = backgroundSize[1] * scaleBG; 4859 4860 // Check if we need to limit the amount of motion in the background image 4861 if( limitMotion && backgroundHeight > windowHeight * limitMotion ) { 4862 // Work out how much to scale percent position based on how much motion we want. 4863 limitScale = ( windowHeight * limitMotion ) / ( backgroundHeight ); 4864 // Percent is scaled so that the midpoint is still 0.5 4865 percent = ( percent * limitScale ) + ( ( 1 - limitScale ) / 2 ); 4866 } 4867 // console.log( percent ); 4868 4869 topPosition = - ( backgroundHeight - wrapperSize[1] ) * percent; 4870 } 4871 4872 $$.css( 'background-position', '50% ' + topPosition + 'px' ); 4873 4874 } else if( options.backgroundSizing === 'original' ) { 4875 // See scaled version or explanation of this code. 4876 if( limitMotion && backgroundSize[1] > windowHeight * limitMotion ) { 4877 limitScale = ( windowHeight * limitMotion ) / ( backgroundSize[1] ); 4878 percent = (percent * limitScale) + ( ( 1 - limitScale ) / 2 ); 4879 } 4880 4881 // In this case, the background height is always the background size 4882 topPosition = - ( backgroundSize[1] - wrapperSize[1] ) * percent; 4883 4884 // This is a version with no scaling 4885 $$.css( 'background-size', 'auto' ); 4886 $$.css( 'background-position', '50% ' + topPosition + 'px' ); 4887 } 4888 } 4889 catch( err ) { 4890 console.log( err.message ); 4891 $$.css( { 4892 'background-size': options.backgroundSizing === 'scaled' ? 'cover' : 'auto', 4893 'background-position': '50% 50%' 4894 } ); 4895 } 4896 }; 4897 setupParallax(); 4898 4899 // All the events where we'll need to change the parallax 4900 $( window ).on( 'scroll', setupParallax ); 4901 $( window ).on( 'resize', setupParallax ); 4902 $$.on( 'refreshParallax', setupParallax ); 4903 // Ensure that the parallax has run on inital load. 4904 setTimeout( function () { 4905 setupParallax(); 4906 }, 100 ); 4907 }; 4908 4909}( jQuery ) ); 4910 4911 4912jQuery( function( $ ){ 4913 $('[data-herculesdesign-parallax]' ).each( function(){ 4914 $( this ).herculesDesignParallax( $( this ).data('herculesdesign-parallax') ); 4915 } ); 4916} );
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.