var cff_js_exists=(typeof cff_js_exists!=='undefined') ? true:false; if(!cff_js_exists){ if(typeof window.cff_block_editor!=='undefined'){ cffmetatrans=false; cffajaxurl=window.cff_block_editor.cffajaxurl; } if(typeof cffnomobileswipe==='undefined'){ !function (a, b, c, d){ "use strict"; function e(a, b, c){ return setTimeout(j(a, c), b) } function f(a, b, c){ return Array.isArray(a) ? (g(a, c[b], c), !0):!1 } function g(a, b, c){ var e; if(a) if(a.forEach) a.forEach(b, c); else if(a.length!==d) for (e=0; e < a.length;) b.call(c, a[e], e, a), e++; else for (e in a) a.hasOwnProperty(e)&&b.call(c, a[e], e, a) } function h(b, c, d){ var e="DEPRECATED METHOD: " + c + "\n" + d + " AT \n"; return function (){ var c=new Error("get-stack-trace"), d=c&&c.stack ? c.stack.replace(/^[^\(]+?[\n$]/gm, "").replace(/^\s+at\s+/gm, "").replace(/^Object.\s*\(/gm, "{anonymous}()@"):"Unknown Stack Trace", f=a.console&&(a.console.warn||a.console.log); return f&&f.call(a.console, e, d), b.apply(this, arguments) }} function i(a, b, c){ var d, e=b.prototype; d=a.prototype=Object.create(e), d.constructor=a, d._super=e, c&&la(d, c) } function j(a, b){ return function (){ return a.apply(b, arguments) }} function k(a, b){ return typeof a==oa ? a.apply(b ? b[0]||d:d, b):a } function l(a, b){ return a===d ? b:a } function m(a, b, c){ g(q(b), function (b){ a.addEventListener(b, c, !1) }) } function n(a, b, c){ g(q(b), function (b){ a.removeEventListener(b, c, !1) }) } function o(a, b){ for (; a;){ if(a==b) return !0; a=a.parentNode } return !1 } function p(a, b){ return a.indexOf(b) > -1 } function q(a){ return a.trim().split(/\s+/g) } function r(a, b, c){ if(a.indexOf&&!c) return a.indexOf(b); for (var d=0; d < a.length;){ if(c&&a[d][c]==b||!c&&a[d]===b) return d; d++ } return -1 } function s(a){ return Array.prototype.slice.call(a, 0) } function t(a, b, c){ for (var d=[], e=[], f=0; f < a.length;){ var g=b ? a[f][b]:a[f]; r(e, g) < 0&&d.push(a[f]), e[f]=g, f++ } return c&&(d=b ? d.sort(function (a, c){ return a[b] > c[b] }):d.sort()), d } function u(a, b){ for (var c, e, f=b[0].toUpperCase() + b.slice(1), g=0; g < ma.length;){ if(c=ma[g], e=c ? c + f:b, e in a) return e; g++ } return d } function v(){ return ua++ } function w(b){ var c=b.ownerDocument||b; return c.defaultView||c.parentWindow||a } function x(a, b){ var c=this; this.manager=a, this.callback=b, this.element=a.element, this.target=a.options.inputTarget, this.domHandler=function (b){ k(a.options.enable, [a])&&c.handler(b) }, this.init() } function y(a){ var b, c=a.options.inputClass; return new (b=c ? c:xa ? M:ya ? P:wa ? R:L)(a, z) } function z(a, b, c){ var d=c.pointers.length, e=c.changedPointers.length, f=b & Ea&&d - e===0, g=b & (Ga | Ha)&&d - e===0; c.isFirst = !!f, c.isFinal = !!g, f&&(a.session={}), c.eventType=b, A(a, c), a.emit("hammer.input", c), a.recognize(c), a.session.prevInput=c } function A(a, b){ var c=a.session, d=b.pointers, e=d.length; c.firstInput||(c.firstInput=D(b)), e > 1&&!c.firstMultiple ? c.firstMultiple=D(b):1===e&&(c.firstMultiple = !1); var f=c.firstInput, g=c.firstMultiple, h=g ? g.center:f.center, i=b.center=E(d); b.timeStamp=ra(), b.deltaTime=b.timeStamp - f.timeStamp, b.angle=I(h, i), b.distance=H(h, i), B(c, b), b.offsetDirection=G(b.deltaX, b.deltaY); var j=F(b.deltaTime, b.deltaX, b.deltaY); b.overallVelocityX=j.x, b.overallVelocityY=j.y, b.overallVelocity=qa(j.x) > qa(j.y) ? j.x:j.y, b.scale=g ? K(g.pointers, d):1, b.rotation=g ? J(g.pointers, d):0, b.maxPointers=c.prevInput ? b.pointers.length > c.prevInput.maxPointers ? b.pointers.length:c.prevInput.maxPointers:b.pointers.length, C(c, b); var k=a.element; o(b.srcEvent.target, k)&&(k=b.srcEvent.target), b.target=k } function B(a, b){ var c=b.center, d=a.offsetDelta||{}, e=a.prevDelta||{}, f=a.prevInput||{}; b.eventType!==Ea&&f.eventType!==Ga||(e=a.prevDelta={ x: f.deltaX||0, y: f.deltaY||0 }, d=a.offsetDelta={x: c.x, y: c.y}), b.deltaX=e.x + (c.x - d.x), b.deltaY=e.y + (c.y - d.y) } function C(a, b){ var c, e, f, g, h=a.lastInterval||b, i=b.timeStamp - h.timeStamp; if(b.eventType!=Ha&&(i > Da||h.velocity===d)){ var j=b.deltaX - h.deltaX, k=b.deltaY - h.deltaY, l=F(i, j, k); e=l.x, f=l.y, c=qa(l.x) > qa(l.y) ? l.x:l.y, g=G(j, k), a.lastInterval=b } else c=h.velocity, e=h.velocityX, f=h.velocityY, g=h.direction; b.velocity=c, b.velocityX=e, b.velocityY=f, b.direction=g } function D(a){ for (var b=[], c=0; c < a.pointers.length;) b[c]={ clientX: pa(a.pointers[c].clientX), clientY: pa(a.pointers[c].clientY) }, c++; return {timeStamp: ra(), pointers: b, center: E(b), deltaX: a.deltaX, deltaY: a.deltaY}} function E(a){ var b=a.length; if(1===b) return {x: pa(a[0].clientX), y: pa(a[0].clientY)}; for (var c=0, d=0, e=0; b > e;) c +=a[e].clientX, d +=a[e].clientY, e++; return {x: pa(c / b), y: pa(d / b)}} function F(a, b, c){ return {x: b / a||0, y: c / a||0}} function G(a, b){ return a===b ? Ia:qa(a) >=qa(b) ? 0 > a ? Ja:Ka:0 > b ? La:Ma } function H(a, b, c){ c||(c=Qa); var d=b[c[0]] - a[c[0]], e=b[c[1]] - a[c[1]]; return Math.sqrt(d * d + e * e) } function I(a, b, c){ c||(c=Qa); var d=b[c[0]] - a[c[0]], e=b[c[1]] - a[c[1]]; return 180 * Math.atan2(e, d) / Math.PI } function J(a, b){ return I(b[1], b[0], Ra) + I(a[1], a[0], Ra) } function K(a, b){ return H(b[0], b[1], Ra) / H(a[0], a[1], Ra) } function L(){ this.evEl=Ta, this.evWin=Ua, this.pressed = !1, x.apply(this, arguments) } function M(){ this.evEl=Xa, this.evWin=Ya, x.apply(this, arguments), this.store=this.manager.session.pointerEvents=[] } function N(){ this.evTarget=$a, this.evWin=_a, this.started = !1, x.apply(this, arguments) } function O(a, b){ var c=s(a.touches), d=s(a.changedTouches); return b & (Ga | Ha)&&(c=t(c.concat(d), "identifier", !0)), [c, d] } function P(){ this.evTarget=bb, this.targetIds={}, x.apply(this, arguments) } function Q(a, b){ var c=s(a.touches), d=this.targetIds; if(b & (Ea | Fa)&&1===c.length) return d[c[0].identifier] = !0, [c, c]; var e, f, g=s(a.changedTouches), h=[], i=this.target; if(f=c.filter(function (a){ return o(a.target, i) }), b===Ea) for (e=0; e < f.length;) d[f[e].identifier] = !0, e++; for (e=0; e < g.length;) d[g[e].identifier]&&h.push(g[e]), b & (Ga | Ha)&&delete d[g[e].identifier], e++; return h.length ? [t(f.concat(h), "identifier", !0), h]:void 0 } function R(){ x.apply(this, arguments); var a=j(this.handler, this); this.touch=new P(this.manager, a), this.mouse=new L(this.manager, a), this.primaryTouch=null, this.lastTouches=[] } function S(a, b){ a & Ea ? (this.primaryTouch=b.changedPointers[0].identifier, T.call(this, b)):a & (Ga | Ha)&&T.call(this, b) } function T(a){ var b=a.changedPointers[0]; if(b.identifier===this.primaryTouch){ var c={x: b.clientX, y: b.clientY}; this.lastTouches.push(c); var d=this.lastTouches, e=function (){ var a=d.indexOf(c); a > -1&&d.splice(a, 1) }; setTimeout(e, cb) }} function U(a){ for (var b=a.srcEvent.clientX, c=a.srcEvent.clientY, d=0; d < this.lastTouches.length; d++){ var e=this.lastTouches[d], f=Math.abs(b - e.x), g=Math.abs(c - e.y); if(db >=f&&db >=g) return !0 } return !1 } function V(a, b){ this.manager=a, this.set(b) } function W(a){ if(p(a, jb)) return jb; var b=p(a, kb), c=p(a, lb); return b&&c ? jb:b||c ? b ? kb:lb:p(a, ib) ? ib:hb } function X(){ if(!fb) return !1; var b={}, c=a.CSS&&a.CSS.supports; return ["auto", "manipulation", "pan-y", "pan-x", "pan-x pan-y", "none"].forEach(function (d){ b[d]=c ? a.CSS.supports("touch-action", d):!0 }), b } function Y(a){ this.options=la({}, this.defaults, a||{}), this.id=v(), this.manager=null, this.options.enable=l(this.options.enable, !0), this.state=nb, this.simultaneous={}, this.requireFail=[] } function Z(a){ return a & sb ? "cancel":a & qb ? "end":a & pb ? "move":a & ob ? "start":"" } function $(a){ return a==Ma ? "down":a==La ? "up":a==Ja ? "left":a==Ka ? "right":"" } function _(a, b){ var c=b.manager; return c ? c.get(a):a } function aa(){ Y.apply(this, arguments) } function ba(){ aa.apply(this, arguments), this.pX=null, this.pY=null } function ca(){ aa.apply(this, arguments) } function da(){ Y.apply(this, arguments), this._timer=null, this._input=null } function ea(){ aa.apply(this, arguments) } function fa(){ aa.apply(this, arguments) } function ga(){ Y.apply(this, arguments), this.pTime = !1, this.pCenter = !1, this._timer=null, this._input=null, this.count=0 } function ha(a, b){ return b=b||{}, b.recognizers=l(b.recognizers, ha.defaults.preset), new ia(a, b) } function ia(a, b){ this.options=la({}, ha.defaults, b||{}), this.options.inputTarget=this.options.inputTarget||a, this.handlers={}, this.session={}, this.recognizers=[], this.oldCssProps={}, this.element=a, this.input=y(this), this.touchAction=new V(this, this.options.touchAction), ja(this, !0), g(this.options.recognizers, function (a){ var b=this.add(new a[0](a[1])); a[2]&&b.recognizeWith(a[2]), a[3]&&b.requireFailure(a[3]) }, this) } function ja(a, b){ var c=a.element; if(c.style){ var d; g(a.options.cssProps, function (e, f){ d=u(c.style, f), b ? (a.oldCssProps[d]=c.style[d], c.style[d]=e):c.style[d]=a.oldCssProps[d]||"" }), b||(a.oldCssProps={}) }} function ka(a, c){ var d=b.createEvent("Event"); d.initEvent(a, !0, !0), d.gesture=c, c.target.dispatchEvent(d) } var la, ma=["", "webkit", "Moz", "MS", "ms", "o"], na=b.createElement("div"), oa="function", pa=Math.round, qa=Math.abs, ra=Date.now; la="function"!=typeof Object.assign ? function (a){ if(a===d||null===a) throw new TypeError("Cannot convert undefined or null to object"); for (var b=Object(a), c=1; c < arguments.length; c++){ var e=arguments[c]; if(e!==d&&null!==e) for (var f in e) e.hasOwnProperty(f)&&(b[f]=e[f]) } return b }:Object.assign; var sa=h(function (a, b, c){ for (var e=Object.keys(b), f=0; f < e.length;) (!c||c&&a[e[f]]===d)&&(a[e[f]]=b[e[f]]), f++; return a }, "extend", "Use `assign`."), ta=h(function (a, b){ return sa(a, b, !0) }, "merge", "Use `assign`."), ua=1, va=/mobile|tablet|ip(ad|hone|od)|android/i, wa="ontouchstart" in a, xa=u(a, "PointerEvent")!==d, ya=wa&&va.test(navigator.userAgent), za="touch", Aa="pen", Ba="mouse", Ca="kinect", Da=25, Ea=1, Fa=2, Ga=4, Ha=8, Ia=1, Ja=2, Ka=4, La=8, Ma=16, Na=Ja | Ka, Oa=La | Ma, Pa=Na | Oa, Qa=["x", "y"], Ra=["clientX", "clientY"]; x.prototype={ handler: function (){ }, init: function (){ this.evEl&&m(this.element, this.evEl, this.domHandler), this.evTarget&&m(this.target, this.evTarget, this.domHandler), this.evWin&&m(w(this.element), this.evWin, this.domHandler) }, destroy: function (){ this.evEl&&n(this.element, this.evEl, this.domHandler), this.evTarget&&n(this.target, this.evTarget, this.domHandler), this.evWin&&n(w(this.element), this.evWin, this.domHandler) }}; var Sa={mousedown: Ea, mousemove: Fa, mouseup: Ga}, Ta="mousedown", Ua="mousemove mouseup"; i(L, x, { handler: function (a){ var b=Sa[a.type]; b & Ea&&0===a.button&&(this.pressed = !0), b & Fa&&1!==a.which&&(b=Ga), this.pressed&&(b & Ga&&(this.pressed = !1), this.callback(this.manager, b, { pointers: [a], changedPointers: [a], pointerType: Ba, srcEvent: a })) }}); var Va={pointerdown: Ea, pointermove: Fa, pointerup: Ga, pointercancel: Ha, pointerout: Ha}, Wa={2: za, 3: Aa, 4: Ba, 5: Ca}, Xa="pointerdown", Ya="pointermove pointerup pointercancel"; a.MSPointerEvent&&!a.PointerEvent&&(Xa="MSPointerDown", Ya="MSPointerMove MSPointerUp MSPointerCancel"), i(M, x, { handler: function (a){ var b=this.store, c = !1, d=a.type.toLowerCase().replace("ms", ""), e=Va[d], f=Wa[a.pointerType]||a.pointerType, g=f==za, h=r(b, a.pointerId, "pointerId"); e & Ea&&(0===a.button||g) ? 0 > h&&(b.push(a), h=b.length - 1):e & (Ga | Ha)&&(c = !0), 0 > h||(b[h]=a, this.callback(this.manager, e, { pointers: b, changedPointers: [a], pointerType: f, srcEvent: a }), c&&b.splice(h, 1)) }}); var Za={touchstart: Ea, touchmove: Fa, touchend: Ga, touchcancel: Ha}, $a="touchstart", _a="touchstart touchmove touchend touchcancel"; i(N, x, { handler: function (a){ var b=Za[a.type]; if(b===Ea&&(this.started = !0), this.started){ var c=O.call(this, a, b); b & (Ga | Ha)&&c[0].length - c[1].length===0&&(this.started = !1), this.callback(this.manager, b, { pointers: c[0], changedPointers: c[1], pointerType: za, srcEvent: a }) }} }); var ab={touchstart: Ea, touchmove: Fa, touchend: Ga, touchcancel: Ha}, bb="touchstart touchmove touchend touchcancel"; i(P, x, { handler: function (a){ var b=ab[a.type], c=Q.call(this, a, b); c&&this.callback(this.manager, b, { pointers: c[0], changedPointers: c[1], pointerType: za, srcEvent: a }) }}); var cb=2500, db=25; i(R, x, { handler: function (a, b, c){ var d=c.pointerType==za, e=c.pointerType==Ba; if(!(e&&c.sourceCapabilities&&c.sourceCapabilities.firesTouchEvents)){ if(d) S.call(this, b, c); else if(e&&U.call(this, c)) return; this.callback(a, b, c) }}, destroy: function (){ this.touch.destroy(), this.mouse.destroy() }}); var eb=u(na.style, "touchAction"), fb=eb!==d, gb="compute", hb="auto", ib="manipulation", jb="none", kb="pan-x", lb="pan-y", mb=X(); V.prototype={ set: function (a){ a==gb&&(a=this.compute()), fb&&this.manager.element.style&&mb[a]&&(this.manager.element.style[eb]=a), this.actions=a.toLowerCase().trim() }, update: function (){ this.set(this.manager.options.touchAction) }, compute: function (){ var a=[]; return g(this.manager.recognizers, function (b){ k(b.options.enable, [b])&&(a=a.concat(b.getTouchAction())) }), W(a.join(" ")) }, preventDefaults: function (a){ var b=a.srcEvent, c=a.offsetDirection; if(this.manager.session.prevented) return void b.preventDefault(); var d=this.actions, e=p(d, jb)&&!mb[jb], f=p(d, lb)&&!mb[lb], g=p(d, kb)&&!mb[kb]; if(e){ var h=1===a.pointers.length, i=a.distance < 2, j=a.deltaTime < 250; if(h&&i && j) return } return g&&f ? void 0:e||f&&c & Na||g&&c & Oa ? this.preventSrc(b):void 0 }, preventSrc: function (a){ this.manager.session.prevented = !0, a.preventDefault() }}; var nb=1, ob=2, pb=4, qb=8, rb=qb, sb=16, tb=32; Y.prototype={ defaults: {}, set: function (a){ return la(this.options, a), this.manager&&this.manager.touchAction.update(), this }, recognizeWith: function (a){ if(f(a, "recognizeWith", this)) return this; var b=this.simultaneous; return a=_(a, this), b[a.id]||(b[a.id]=a, a.recognizeWith(this)), this }, dropRecognizeWith: function (a){ return f(a, "dropRecognizeWith", this) ? this:(a=_(a, this), delete this.simultaneous[a.id], this) }, requireFailure: function (a){ if(f(a, "requireFailure", this)) return this; var b=this.requireFail; return a=_(a, this), -1===r(b, a)&&(b.push(a), a.requireFailure(this)), this }, dropRequireFailure: function (a){ if(f(a, "dropRequireFailure", this)) return this; a=_(a, this); var b=r(this.requireFail, a); return b > -1&&this.requireFail.splice(b, 1), this }, hasRequireFailures: function (){ return this.requireFail.length > 0 }, canRecognizeWith: function (a){ return !!this.simultaneous[a.id] }, emit: function (a){ function b(b){ c.manager.emit(b, a) } var c=this, d=this.state; qb > d&&b(c.options.event + Z(d)), b(c.options.event), a.additionalEvent&&b(a.additionalEvent), d >=qb&&b(c.options.event + Z(d)) }, tryEmit: function (a){ return this.canEmit() ? this.emit(a):void (this.state=tb) }, canEmit: function (){ for (var a=0; a < this.requireFail.length;){ if(!(this.requireFail[a].state & (tb | nb))) return !1; a++ } return !0 }, recognize: function (a){ var b=la({}, a); return k(this.options.enable, [this, b]) ? (this.state & (rb | sb | tb)&&(this.state=nb), this.state=this.process(b), void (this.state & (ob | pb | qb | sb)&&this.tryEmit(b))):(this.reset(), void (this.state=tb)) }, process: function (a){ }, getTouchAction: function (){ }, reset: function (){ }}, i(aa, Y, { defaults: {pointers: 1}, attrTest: function (a){ var b=this.options.pointers; return 0===b||a.pointers.length===b }, process: function (a){ var b=this.state, c=a.eventType, d=b & (ob | pb), e=this.attrTest(a); return d&&(c & Ha||!e) ? b | sb:d||e ? c & Ga ? b | qb:b & ob ? b | pb:ob:tb }}), i(ba, aa, { defaults: {event: "pan", threshold: 10, pointers: 1, direction: Pa}, getTouchAction: function (){ var a=this.options.direction, b=[]; return a & Na&&b.push(lb), a & Oa&&b.push(kb), b }, directionTest: function (a){ var b=this.options, c = !0, d=a.distance, e=a.direction, f=a.deltaX, g=a.deltaY; return e & b.direction||(b.direction & Na ? (e=0===f ? Ia:0 > f ? Ja:Ka, c=f!=this.pX, d=Math.abs(a.deltaX)):(e=0===g ? Ia:0 > g ? La:Ma, c=g!=this.pY, d=Math.abs(a.deltaY))), a.direction=e, c&&d > b.threshold&&e & b.direction }, attrTest: function (a){ return aa.prototype.attrTest.call(this, a)&&(this.state & ob||!(this.state & ob)&&this.directionTest(a)) }, emit: function (a){ this.pX=a.deltaX, this.pY=a.deltaY; var b=$(a.direction); b&&(a.additionalEvent=this.options.event + b), this._super.emit.call(this, a) }}), i(ca, aa, { defaults: {event: "pinch", threshold: 0, pointers: 2}, getTouchAction: function (){ return [jb] }, attrTest: function (a){ return this._super.attrTest.call(this, a)&&(Math.abs(a.scale - 1) > this.options.threshold||this.state & ob) }, emit: function (a){ if(1!==a.scale){ var b=a.scale < 1 ? "in":"out"; a.additionalEvent=this.options.event + b } this._super.emit.call(this, a) }}), i(da, Y, { defaults: {event: "press", pointers: 1, time: 251, threshold: 9}, getTouchAction: function (){ return [hb] }, process: function (a){ var b=this.options, c=a.pointers.length===b.pointers, d=a.distance < b.threshold, f=a.deltaTime > b.time; if(this._input=a, !d||!c||a.eventType & (Ga | Ha)&&!f) this.reset(); else if(a.eventType & Ea) this.reset(), this._timer=e(function (){ this.state=rb, this.tryEmit() }, b.time, this); else if(a.eventType & Ga) return rb; return tb }, reset: function (){ clearTimeout(this._timer) }, emit: function (a){ this.state===rb&&(a&&a.eventType & Ga ? this.manager.emit(this.options.event + "up", a):(this._input.timeStamp=ra(), this.manager.emit(this.options.event, this._input))) }}), i(ea, aa, { defaults: {event: "rotate", threshold: 0, pointers: 2}, getTouchAction: function (){ return [jb] }, attrTest: function (a){ return this._super.attrTest.call(this, a)&&(Math.abs(a.rotation) > this.options.threshold||this.state & ob) }}), i(fa, aa, { defaults: {event: "swipe", threshold: 10, velocity: .3, direction: Na | Oa, pointers: 1}, getTouchAction: function (){ return ba.prototype.getTouchAction.call(this) }, attrTest: function (a){ var b, c=this.options.direction; return c & (Na | Oa) ? b=a.overallVelocity:c & Na ? b=a.overallVelocityX:c & Oa&&(b=a.overallVelocityY), this._super.attrTest.call(this, a)&&c & a.offsetDirection&&a.distance > this.options.threshold&&a.maxPointers==this.options.pointers&&qa(b) > this.options.velocity&&a.eventType & Ga }, emit: function (a){ var b=$(a.offsetDirection); b&&this.manager.emit(this.options.event + b, a), this.manager.emit(this.options.event, a) }}), i(ga, Y, { defaults: { event: "tap", pointers: 1, taps: 1, interval: 300, time: 250, threshold: 9, posThreshold: 10 }, getTouchAction: function (){ return [ib] }, process: function (a){ var b=this.options, c=a.pointers.length===b.pointers, d=a.distance < b.threshold, f=a.deltaTime < b.time; if(this.reset(), a.eventType & Ea&&0===this.count) return this.failTimeout(); if(d&&f && c){ if(a.eventType!=Ga) return this.failTimeout(); var g=this.pTime ? a.timeStamp - this.pTime < b.interval:!0, h = !this.pCenter||H(this.pCenter, a.center) < b.posThreshold; this.pTime=a.timeStamp, this.pCenter=a.center, h&&g ? this.count +=1:this.count=1, this._input=a; var i=this.count % b.taps; if(0===i) return this.hasRequireFailures() ? (this._timer=e(function (){ this.state=rb, this.tryEmit() }, b.interval, this), ob):rb } return tb }, failTimeout: function (){ return this._timer=e(function (){ this.state=tb }, this.options.interval, this), tb }, reset: function (){ clearTimeout(this._timer) }, emit: function (){ this.state==rb&&(this._input.tapCount=this.count, this.manager.emit(this.options.event, this._input)) }}), ha.VERSION="2.0.8", ha.defaults={ domEvents: !1, touchAction: gb, enable: !0, inputTarget: null, inputClass: null, preset: [[ea, {enable: !1}], [ca, {enable: !1}, ["rotate"]], [fa, {direction: Na}], [ba, {direction: Na}, ["swipe"]], [ga], [ga, { event: "doubletap", taps: 2 }, ["tap"]], [da]], cssProps: { userSelect: "none", touchSelect: "none", touchCallout: "none", contentZooming: "none", userDrag: "none", tapHighlightColor: "rgba(0,0,0,0)" }}; var ub=1, vb=2; ia.prototype={ set: function (a){ return la(this.options, a), a.touchAction&&this.touchAction.update(), a.inputTarget&&(this.input.destroy(), this.input.target=a.inputTarget, this.input.init()), this }, stop: function (a){ this.session.stopped=a ? vb:ub }, recognize: function (a){ var b=this.session; if(!b.stopped){ this.touchAction.preventDefaults(a); var c, d=this.recognizers, e=b.curRecognizer; (!e||e&&e.state & rb)&&(e=b.curRecognizer=null); for (var f=0; f < d.length;) c=d[f], b.stopped===vb||e&&c!=e&&!c.canRecognizeWith(e) ? c.reset():c.recognize(a), !e&&c.state & (ob | pb | qb)&&(e=b.curRecognizer=c), f++ }}, get: function (a){ if(a instanceof Y) return a; for (var b=this.recognizers, c=0; c < b.length; c++) if(b[c].options.event==a) return b[c]; return null }, add: function (a){ if(f(a, "add", this)) return this; var b=this.get(a.options.event); return b&&this.remove(b), this.recognizers.push(a), a.manager=this, this.touchAction.update(), a }, remove: function (a){ if(f(a, "remove", this)) return this; if(a=this.get(a)){ var b=this.recognizers, c=r(b, a); -1!==c&&(b.splice(c, 1), this.touchAction.update()) } return this }, on: function (a, b){ if(a!==d&&b!==d){ var c=this.handlers; return g(q(a), function (a){ c[a]=c[a]||[], c[a].push(b) }), this }}, off: function (a, b){ if(a!==d){ var c=this.handlers; return g(q(a), function (a){ b ? c[a]&&c[a].splice(r(c[a], b), 1):delete c[a] }), this }}, emit: function (a, b){ this.options.domEvents&&ka(a, b); var c=this.handlers[a]&&this.handlers[a].slice(); if(c&&c.length){ b.type=a, b.preventDefault=function (){ b.srcEvent.preventDefault() }; for (var d=0; d < c.length;) c[d](b), d++ }}, destroy: function (){ this.element&&ja(this, !1), this.handlers={}, this.session={}, this.input.destroy(), this.element=null }}, la(ha, { INPUT_START: Ea, INPUT_MOVE: Fa, INPUT_END: Ga, INPUT_CANCEL: Ha, STATE_POSSIBLE: nb, STATE_BEGAN: ob, STATE_CHANGED: pb, STATE_ENDED: qb, STATE_RECOGNIZED: rb, STATE_CANCELLED: sb, STATE_FAILED: tb, DIRECTION_NONE: Ia, DIRECTION_LEFT: Ja, DIRECTION_RIGHT: Ka, DIRECTION_UP: La, DIRECTION_DOWN: Ma, DIRECTION_HORIZONTAL: Na, DIRECTION_VERTICAL: Oa, DIRECTION_ALL: Pa, Manager: ia, Input: x, TouchAction: V, TouchInput: P, MouseInput: L, PointerEventInput: M, TouchMouseInput: R, SingleTouchInput: N, Recognizer: Y, AttrRecognizer: aa, Tap: ga, Pan: ba, Swipe: fa, Pinch: ca, Rotate: ea, Press: da, on: m, off: n, each: g, merge: ta, extend: sa, assign: la, inherit: i, bindFn: j, prefixed: u }); var wb="undefined"!=typeof a ? a:"undefined"!=typeof self ? self:{}; wb.Hammer=ha, "function"==typeof define&&define.amd ? define(function (){ return ha }):"undefined"!=typeof module&&module.exports ? module.exports=ha:a[c]=ha }(window, document, "Hammer"); (function (factory){ if(typeof define==='function'&&define.amd){ define(['jquery', 'hammerjs'], factory); }else if(typeof exports==='object'){ factory(require('jquery'), require('hammerjs')); }else{ factory(jQuery, Hammer); }}(function (jQuery, Hammer){ function hammerify(el, options){ var $el=jQuery(el); if(!$el.data("hammer")){ $el.data("hammer", new Hammer($el[0], options)); }} jQuery.fn.hammer=function (options){ return this.each(function (){ hammerify(this, options); }); }; Hammer.Manager.prototype.emit=(function (originalEmit){ return function (type, data){ originalEmit.call(this, type, data); jQuery(this.element).trigger({ type: type, gesture: data }); };})(Hammer.Manager.prototype.emit); })); }else{ var Hammer={ Manager: { prototype: {}} }; (function (factory){ if(typeof define==='function'&&define.amd){ define(['jquery', 'hammerjs'], factory); }else if(typeof exports==='object'){ factory(require('jquery'), require('hammerjs')); }else{ factory(jQuery, Hammer); }}(function (jQuery, Hammer){ function hammerify(el, options){ } jQuery.fn.hammer=function (options){ return this.each(function (){ hammerify(this, options); }); }; Hammer.Manager.prototype.emit=(function (originalEmit){ return function (type, data){ originalEmit.call(this, type, data); jQuery(this.element).trigger({ type: type, gesture: data }); };})(Hammer.Manager.prototype.emit); })); } if(jQuery('#cff.cff-masonry-js').length||typeof window.cff_block_editor!=='undefined'){ !function(a){function b(){} function c(a){function c(b){b.prototype.option||(b.prototype.option=function(b){a.isPlainObject(b)&&(this.options=a.extend(!0,this.options,b))})} function e(b,c){a.fn[b]=function(e){if("string"==typeof e){for(var g=d.call(arguments,1),h=0,i=this.length;i>h;h++){var j=this[h],k=a.data(j,b);if(k)if(a.isFunction(k[e])&&"_"!==e.charAt(0)){var l=k[e].apply(k,g);if(void 0!==l)return l}else f("no such method '"+e+"' for "+b+" instance");else f("cannot call methods on "+b+" prior to initialization; attempted to call '"+e+"'")} return this} return this.each(function(){var d=a.data(this,b);d?(d.option(e),d._init()):(d=new c(this,e),a.data(this,b,d))})}} if(a){var f="undefined"==typeof console?b:function(a){console.error(a)};return a.bridget=function(a,b){c(b),e(a,b)},a.bridget}} var d=Array.prototype.slice;"function"==typeof define&&define.amd?define("jquery-bridget/jquery.bridget",["jquery"],c):c("object"==typeof exports?require("jquery"):a.jQuery)}(window),function(a){function b(b){var c=a.event;return c.target=c.target||c.srcElement||b,c} var c=document.documentElement,d=function(){};c.addEventListener?d=function(a,b,c){a.addEventListener(b,c,!1)}:c.attachEvent&&(d=function(a,c,d){a[c+d]=d.handleEvent?function(){var c=b(a);d.handleEvent.call(d,c)}:function(){var c=b(a);d.call(a,c)},a.attachEvent("on"+c,a[c+d])});var e=function(){};c.removeEventListener?e=function(a,b,c){a.removeEventListener(b,c,!1)}:c.detachEvent&&(e=function(a,b,c){a.detachEvent("on"+b,a[b+c]);try{delete a[b+c]}catch(d){a[b+c]=void 0}});var f={bind:d,unbind:e};"function"==typeof define&&define.amd?define("eventie/eventie",f):"object"==typeof exports?module.exports=f:a.eventie=f}(window),function(){function a(){} function b(a,b){for(var c=a.length;c--;)if(a[c].listener===b)return c;return-1} function c(a){return function(){return this[a].apply(this,arguments)}} var d=a.prototype,e=this,f=e.EventEmitter;d.getListeners=function(a){var b,c,d=this._getEvents();if(a instanceof RegExp){b={};for(c in d)d.hasOwnProperty(c)&&a.test(c)&&(b[c]=d[c])}else b=d[a]||(d[a]=[]);return b},d.flattenListeners=function(a){var b,c=[];for(b=0;be;e++)if(b=c[e]+a,"string"==typeof d[b])return b}} var c="Webkit Moz ms Ms O".split(" "),d=document.documentElement.style;"function"==typeof define&&define.amd?define("get-style-property/get-style-property",[],function(){return b}):"object"==typeof exports?module.exports=b:a.getStyleProperty=b}(window),function(a){function b(a){var b=parseFloat(a),c=-1===a.indexOf("%")&&!isNaN(b);return c&&b} function c(){} function d(){for(var a={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},b=0,c=g.length;c>b;b++){var d=g[b];a[d]=0} return a} function e(c){function e(){if(!m){m=!0;var d=a.getComputedStyle;if(j=function(){var a=d?function(a){return d(a,null)}:function(a){return a.currentStyle};return function(b){var c=a(b);return c||f("Style returned "+c+". Are you running this code in a hidden iframe on Firefox? See http://bit.ly/getsizebug1"),c}}(),k=c("boxSizing")){var e=document.createElement("div");e.style.width="200px",e.style.padding="1px 2px 3px 4px",e.style.borderStyle="solid",e.style.borderWidth="1px 2px 3px 4px",e.style[k]="border-box";var g=document.body||document.documentElement;g.appendChild(e);var h=j(e);l=200===b(h.width),g.removeChild(e)}}} function h(a){if(e(),"string"==typeof a&&(a=document.querySelector(a)),a&&"object"==typeof a&&a.nodeType){var c=j(a);if("none"===c.display)return d();var f={};f.width=a.offsetWidth,f.height=a.offsetHeight;for(var h=f.isBorderBox=!(!k||!c[k]||"border-box"!==c[k]),m=0,n=g.length;n>m;m++){var o=g[m],p=c[o];p=i(a,p);var q=parseFloat(p);f[o]=isNaN(q)?0:q} var r=f.paddingLeft+f.paddingRight,s=f.paddingTop+f.paddingBottom,t=f.marginLeft+f.marginRight,u=f.marginTop+f.marginBottom,v=f.borderLeftWidth+f.borderRightWidth,w=f.borderTopWidth+f.borderBottomWidth,x=h&&l,y=b(c.width);y!==!1&&(f.width=y+(x?0:r+v));var z=b(c.height);return z!==!1&&(f.height=z+(x?0:s+w)),f.innerWidth=f.width-(r+v),f.innerHeight=f.height-(s+w),f.outerWidth=f.width+t,f.outerHeight=f.height+u,f}} function i(b,c){if(a.getComputedStyle||-1===c.indexOf("%"))return c;var d=b.style,e=d.left,f=b.runtimeStyle,g=f&&f.left;return g&&(f.left=b.currentStyle.left),d.left=c,c=d.pixelLeft,d.left=e,g&&(f.left=g),c} var j,k,l,m=!1;return h} var f="undefined"==typeof console?c:function(a){console.error(a)},g=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];"function"==typeof define&&define.amd?define("get-size/get-size",["get-style-property/get-style-property"],e):"object"==typeof exports?module.exports=e(require("desandro-get-style-property")):a.getSize=e(a.getStyleProperty)}(window),function(a){function b(a){"function"==typeof a&&(b.isReady?a():g.push(a))} function c(a){var c="readystatechange"===a.type&&"complete"!==f.readyState;b.isReady||c||d()} function d(){b.isReady=!0;for(var a=0,c=g.length;c>a;a++){var d=g[a];d()}} function e(e){return"complete"===f.readyState?d():(e.bind(f,"DOMContentLoaded",c),e.bind(f,"readystatechange",c),e.bind(a,"load",c)),b} var f=a.document,g=[];b.isReady=!1,"function"==typeof define&&define.amd?define("doc-ready/doc-ready",["eventie/eventie"],e):"object"==typeof exports?module.exports=e(require("eventie")):a.docReady=e(a.eventie)}(window),function(a){function b(a,b){return a[g](b)} function c(a){if(!a.parentNode){var b=document.createDocumentFragment();b.appendChild(a)}} function d(a,b){c(a);for(var d=a.parentNode.querySelectorAll(b),e=0,f=d.length;f>e;e++)if(d[e]===a)return!0;return!1} function e(a,d){return c(a),b(a,d)} var f,g=function(){if(a.matches)return"matches";if(a.matchesSelector)return"matchesSelector";for(var b=["webkit","moz","ms","o"],c=0,d=b.length;d>c;c++){var e=b[c],f=e+"MatchesSelector";if(a[f])return f}}();if(g){var h=document.createElement("div"),i=b(h,"div");f=i?b:e}else f=d;"function"==typeof define&&define.amd?define("matches-selector/matches-selector",[],function(){return f}):"object"==typeof exports?module.exports=f:window.matchesSelector=f}(Element.prototype),function(a,b){"function"==typeof define&&define.amd?define("fizzy-ui-utils/utils",["doc-ready/doc-ready","matches-selector/matches-selector"],function(c,d){return b(a,c,d)}):"object"==typeof exports?module.exports=b(a,require("doc-ready"),require("desandro-matches-selector")):a.fizzyUIUtils=b(a,a.docReady,a.matchesSelector)}(window,function(a,b,c){var d={};d.extend=function(a,b){for(var c in b)a[c]=b[c];return a},d.modulo=function(a,b){return(a%b+b)%b};var e=Object.prototype.toString;d.isArray=function(a){return"[object Array]"==e.call(a)},d.makeArray=function(a){var b=[];if(d.isArray(a))b=a;else if(a&&"number"==typeof a.length)for(var c=0,e=a.length;e>c;c++)b.push(a[c]);else b.push(a);return b},d.indexOf=Array.prototype.indexOf?function(a,b){return a.indexOf(b)}:function(a,b){for(var c=0,d=a.length;d>c;c++)if(a[c]===b)return c;return-1},d.removeFrom=function(a,b){var c=d.indexOf(a,b);-1!=c&&a.splice(c,1)},d.isElement="function"==typeof HTMLElement||"object"==typeof HTMLElement?function(a){return a instanceof HTMLElement}:function(a){return a&&"object"==typeof a&&1==a.nodeType&&"string"==typeof a.nodeName},d.setText=function(){function a(a,c){b=b||(void 0!==document.documentElement.textContent?"textContent":"innerText"),a[b]=c} var b;return a}(),d.getParent=function(a,b){for(;a!=document.body;)if(a=a.parentNode,c(a,b))return a},d.getQueryElement=function(a){return"string"==typeof a?document.querySelector(a):a},d.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},d.filterFindElements=function(a,b){a=d.makeArray(a);for(var e=[],f=0,g=a.length;g>f;f++){var h=a[f];if(d.isElement(h))if(b){c(h,b)&&e.push(h);for(var i=h.querySelectorAll(b),j=0,k=i.length;k>j;j++)e.push(i[j])}else e.push(h)} return e},d.debounceMethod=function(a,b,c){var d=a.prototype[b],e=b+"Timeout";a.prototype[b]=function(){var a=this[e];a&&clearTimeout(a);var b=arguments,f=this;this[e]=setTimeout(function(){d.apply(f,b),delete f[e]},c||100)}},d.toDashed=function(a){return a.replace(/(.)([A-Z])/g,function(a,b,c){return b+"-"+c}).toLowerCase()};var f=a.console;return d.htmlInit=function(c,e){b(function(){for(var b=d.toDashed(e),g=document.querySelectorAll(".js-"+b),h="data-"+b+"-options",i=0,j=g.length;j>i;i++){var k,l=g[i],m=l.getAttribute(h);try{k=m&&JSON.parse(m)}catch(n){f&&f.error("Error parsing "+h+" on "+l.nodeName.toLowerCase()+(l.id?"#"+l.id:"")+": "+n);continue} var o=new c(l,k),p=a.jQuery;p&&p.data(l,e,o)}})},d}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/item",["eventEmitter/EventEmitter","get-size/get-size","get-style-property/get-style-property","fizzy-ui-utils/utils"],function(c,d,e,f){return b(a,c,d,e,f)}):"object"==typeof exports?module.exports=b(a,require("wolfy87-eventemitter"),require("get-size"),require("desandro-get-style-property"),require("fizzy-ui-utils")):(a.Outlayer={},a.Outlayer.Item=b(a,a.EventEmitter,a.getSize,a.getStyleProperty,a.fizzyUIUtils))}(window,function(a,b,c,d,e){function f(a){for(var b in a)return!1;return b=null,!0} function g(a,b){a&&(this.element=a,this.layout=b,this.position={x:0,y:0},this._create())} var h=a.getComputedStyle,i=h?function(a){return h(a,null)}:function(a){return a.currentStyle},j=d("transition"),k=d("transform"),l=j&&k,m=!!d("perspective"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"otransitionend",transition:"transitionend"}[j],o=["transform","transition","transitionDuration","transitionProperty"],p=function(){for(var a={},b=0,c=o.length;c>b;b++){var e=o[b],f=d(e);f&&f!==e&&(a[e]=f)} return a}();e.extend(g.prototype,b.prototype),g.prototype._create=function(){this._transn={ingProperties:{},clean:{},onEnd:{}},this.css({position:"absolute"})},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.getSize=function(){this.size=c(this.element)},g.prototype.css=function(a){var b=this.element.style;for(var c in a){var d=p[c]||c;b[d]=a[c]}},g.prototype.getPosition=function(){var a=i(this.element),b=this.layout.options,c=b.isOriginLeft,d=b.isOriginTop,e=parseInt(a[c?"left":"right"],10),f=parseInt(a[d?"top":"bottom"],10);e=isNaN(e)?0:e,f=isNaN(f)?0:f;var g=this.layout.size;e-=c?g.paddingLeft:g.paddingRight,f-=d?g.paddingTop:g.paddingBottom,this.position.x=e,this.position.y=f},g.prototype.layoutPosition=function(){var a=this.layout.size,b=this.layout.options,c={},d=b.isOriginLeft?"paddingLeft":"paddingRight",e=b.isOriginLeft?"left":"right",f=b.isOriginLeft?"right":"left",g=this.position.x+a[d];g=b.percentPosition&&!b.isHorizontal?g/a.width*100+"%":g+"px",c[e]=g,c[f]="";var h=b.isOriginTop?"paddingTop":"paddingBottom",i=b.isOriginTop?"top":"bottom",j=b.isOriginTop?"bottom":"top",k=this.position.y+a[h];k=b.percentPosition&&b.isHorizontal?k/a.height*100+"%":k+"px",c[i]=k,c[j]="",this.css(c),this.emitEvent("layout",[this])};var q=m?function(a,b){return"translate3d("+a+"px, "+b+"px, 0)"}:function(a,b){return"translate("+a+"px, "+b+"px)"};g.prototype._transitionTo=function(a,b){this.getPosition();var c=this.position.x,d=this.position.y,e=parseInt(a,10),f=parseInt(b,10),g=e===this.position.x&&f===this.position.y;if(this.setPosition(a,b),g&&!this.isTransitioning)return void this.layoutPosition();var h=a-c,i=b-d,j={},k=this.layout.options;h=k.isOriginLeft?h:-h,i=k.isOriginTop?i:-i,j.transform=q(h,i),this.transition({to:j,onTransitionEnd:{transform:this.layoutPosition},isCleaning:!0})},g.prototype.goTo=function(a,b){this.setPosition(a,b),this.layoutPosition()},g.prototype.moveTo=l?g.prototype._transitionTo:g.prototype.goTo,g.prototype.setPosition=function(a,b){this.position.x=parseInt(a,10),this.position.y=parseInt(b,10)},g.prototype._nonTransition=function(a){this.css(a.to),a.isCleaning&&this._removeStyles(a.to);for(var b in a.onTransitionEnd)a.onTransitionEnd[b].call(this)},g.prototype._transition=function(a){if(!parseFloat(this.layout.options.transitionDuration))return void this._nonTransition(a);var b=this._transn;for(var c in a.onTransitionEnd)b.onEnd[c]=a.onTransitionEnd[c];for(c in a.to)b.ingProperties[c]=!0,a.isCleaning&&(b.clean[c]=!0);if(a.from){this.css(a.from);var d=this.element.offsetHeight;d=null} this.enableTransition(a.to),this.css(a.to),this.isTransitioning=!0};var r=k&&e.toDashed(k)+",opacity";g.prototype.enableTransition=function(){this.isTransitioning||(this.css({transitionProperty:r,transitionDuration:this.layout.options.transitionDuration}),this.element.addEventListener(n,this,!1))},g.prototype.transition=g.prototype[j?"_transition":"_nonTransition"],g.prototype.onwebkitTransitionEnd=function(a){this.ontransitionend(a)},g.prototype.onotransitionend=function(a){this.ontransitionend(a)};var s={"-webkit-transform":"transform","-moz-transform":"transform","-o-transform":"transform"};g.prototype.ontransitionend=function(a){if(a.target===this.element){var b=this._transn,c=s[a.propertyName]||a.propertyName;if(delete b.ingProperties[c],f(b.ingProperties)&&this.disableTransition(),c in b.clean&&(this.element.style[a.propertyName]="",delete b.clean[c]),c in b.onEnd){var d=b.onEnd[c];d.call(this),delete b.onEnd[c]} this.emitEvent("transitionEnd",[this])}},g.prototype.disableTransition=function(){this.removeTransitionStyles(),this.element.removeEventListener(n,this,!1),this.isTransitioning=!1},g.prototype._removeStyles=function(a){var b={};for(var c in a)b[c]="";this.css(b)};var t={transitionProperty:"",transitionDuration:""};return g.prototype.removeTransitionStyles=function(){this.css(t)},g.prototype.removeElem=function(){this.element.parentNode.removeChild(this.element),this.css({display:""}),this.emitEvent("remove",[this])},g.prototype.remove=function(){if(!j||!parseFloat(this.layout.options.transitionDuration))return void this.removeElem();var a=this;this.once("transitionEnd",function(){a.removeElem()}),this.hide()},g.prototype.reveal=function(){delete this.isHidden,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("visibleStyle");b[c]=this.onRevealTransitionEnd,this.transition({from:a.hiddenStyle,to:a.visibleStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onRevealTransitionEnd=function(){this.isHidden||this.emitEvent("reveal")},g.prototype.getHideRevealTransitionEndProperty=function(a){var b=this.layout.options[a];if(b.opacity)return"opacity";for(var c in b)return c},g.prototype.hide=function(){this.isHidden=!0,this.css({display:""});var a=this.layout.options,b={},c=this.getHideRevealTransitionEndProperty("hiddenStyle");b[c]=this.onHideTransitionEnd,this.transition({from:a.visibleStyle,to:a.hiddenStyle,isCleaning:!0,onTransitionEnd:b})},g.prototype.onHideTransitionEnd=function(){this.isHidden&&(this.css({display:"none"}),this.emitEvent("hide"))},g.prototype.destroy=function(){this.css({position:"",left:"",right:"",top:"",bottom:"",transition:"",transform:""})},g}),function(a,b){"function"==typeof define&&define.amd?define("outlayer/outlayer",["eventie/eventie","eventEmitter/EventEmitter","get-size/get-size","fizzy-ui-utils/utils","./item"],function(c,d,e,f,g){return b(a,c,d,e,f,g)}):"object"==typeof exports?module.exports=b(a,require("eventie"),require("wolfy87-eventemitter"),require("get-size"),require("fizzy-ui-utils"),require("./item")):a.Outlayer=b(a,a.eventie,a.EventEmitter,a.getSize,a.fizzyUIUtils,a.Outlayer.Item)}(window,function(a,b,c,d,e,f){function g(a,b){var c=e.getQueryElement(a);if(!c)return void(h&&h.error("Bad element for "+this.constructor.namespace+": "+(c||a)));this.element=c,i&&(this.$element=i(this.element)),this.options=e.extend({},this.constructor.defaults),this.option(b);var d=++k;this.element.outlayerGUID=d,l[d]=this,this._create(),this.options.isInitLayout&&this.layout()} var h=a.console,i=a.jQuery,j=function(){},k=0,l={};return g.namespace="outlayer",g.Item=f,g.defaults={containerStyle:{position:"relative"},isInitLayout:!0,isOriginLeft:!0,isOriginTop:!0,isResizeBound:!0,isResizingContainer:!0,transitionDuration:"0.4s",hiddenStyle:{opacity:0,transform:"scale(0.001)"},visibleStyle:{opacity:1,transform:"scale(1)"}},e.extend(g.prototype,c.prototype),g.prototype.option=function(a){e.extend(this.options,a)},g.prototype._create=function(){this.reloadItems(),this.stamps=[],this.stamp(this.options.stamp),e.extend(this.element.style,this.options.containerStyle),this.options.isResizeBound&&this.bindResize()},g.prototype.reloadItems=function(){this.items=this._itemize(this.element.children)},g.prototype._itemize=function(a){for(var b=this._filterFindItemElements(a),c=this.constructor.Item,d=[],e=0,f=b.length;f>e;e++){var g=b[e],h=new c(g,this);d.push(h)} return d},g.prototype._filterFindItemElements=function(a){return e.filterFindElements(a,this.options.itemSelector)},g.prototype.getItemElements=function(){for(var a=[],b=0,c=this.items.length;c>b;b++)a.push(this.items[b].element);return a},g.prototype.layout=function(){this._resetLayout(),this._manageStamps();var a=void 0!==this.options.isLayoutInstant?this.options.isLayoutInstant:!this._isLayoutInited;this.layoutItems(this.items,a),this._isLayoutInited=!0},g.prototype._init=g.prototype.layout,g.prototype._resetLayout=function(){this.getSize()},g.prototype.getSize=function(){this.size=d(this.element)},g.prototype._getMeasurement=function(a,b){var c,f=this.options[a];f?("string"==typeof f?c=this.element.querySelector(f):e.isElement(f)&&(c=f),this[a]=c?d(c)[b]:f):this[a]=0},g.prototype.layoutItems=function(a,b){a=this._getItemsForLayout(a),this._layoutItems(a,b),this._postLayout()},g.prototype._getItemsForLayout=function(a){for(var b=[],c=0,d=a.length;d>c;c++){var e=a[c];e.isIgnored||b.push(e)} return b},g.prototype._layoutItems=function(a,b){if(this._emitCompleteOnItems("layout",a),a&&a.length){for(var c=[],d=0,e=a.length;e>d;d++){var f=a[d],g=this._getItemLayoutPosition(f);g.item=f,g.isInstant=b||f.isLayoutInstant,c.push(g)} this._processLayoutQueue(c)}},g.prototype._getItemLayoutPosition=function(){return{x:0,y:0}},g.prototype._processLayoutQueue=function(a){for(var b=0,c=a.length;c>b;b++){var d=a[b];this._positionItem(d.item,d.x,d.y,d.isInstant)}},g.prototype._positionItem=function(a,b,c,d){d?a.goTo(b,c):a.moveTo(b,c)},g.prototype._postLayout=function(){this.resizeContainer()},g.prototype.resizeContainer=function(){if(this.options.isResizingContainer){var a=this._getContainerSize();a&&(this._setContainerMeasure(a.width,!0),this._setContainerMeasure(a.height,!1))}},g.prototype._getContainerSize=j,g.prototype._setContainerMeasure=function(a,b){if(void 0!==a){var c=this.size;c.isBorderBox&&(a+=b?c.paddingLeft+c.paddingRight+c.borderLeftWidth+c.borderRightWidth:c.paddingBottom+c.paddingTop+c.borderTopWidth+c.borderBottomWidth),a=Math.max(a,0),this.element.style[b?"width":"height"]=a+"px"}},g.prototype._emitCompleteOnItems=function(a,b){function c(){e.emitEvent(a+"Complete",[b])} function d(){g++,g===f&&c()} var e=this,f=b.length;if(!b||!f)return void c();for(var g=0,h=0,i=b.length;i>h;h++){var j=b[h];j.once(a,d)}},g.prototype.ignore=function(a){var b=this.getItem(a);b&&(b.isIgnored=!0)},g.prototype.unignore=function(a){var b=this.getItem(a);b&&delete b.isIgnored},g.prototype.stamp=function(a){if(a=this._find(a)){this.stamps=this.stamps.concat(a);for(var b=0,c=a.length;c>b;b++){var d=a[b];this.ignore(d)}}},g.prototype.unstamp=function(a){if(a=this._find(a))for(var b=0,c=a.length;c>b;b++){var d=a[b];e.removeFrom(this.stamps,d),this.unignore(d)}},g.prototype._find=function(a){return a?("string"==typeof a&&(a=this.element.querySelectorAll(a)),a=e.makeArray(a)):void 0},g.prototype._manageStamps=function(){if(this.stamps&&this.stamps.length){this._getBoundingRect();for(var a=0,b=this.stamps.length;b>a;a++){var c=this.stamps[a];this._manageStamp(c)}}},g.prototype._getBoundingRect=function(){var a=this.element.getBoundingClientRect(),b=this.size;this._boundingRect={left:a.left+b.paddingLeft+b.borderLeftWidth,top:a.top+b.paddingTop+b.borderTopWidth,right:a.right-(b.paddingRight+b.borderRightWidth),bottom:a.bottom-(b.paddingBottom+b.borderBottomWidth)}},g.prototype._manageStamp=j,g.prototype._getElementOffset=function(a){var b=a.getBoundingClientRect(),c=this._boundingRect,e=d(a),f={left:b.left-c.left-e.marginLeft,top:b.top-c.top-e.marginTop,right:c.right-b.right-e.marginRight,bottom:c.bottom-b.bottom-e.marginBottom};return f},g.prototype.handleEvent=function(a){var b="on"+a.type;this[b]&&this[b](a)},g.prototype.bindResize=function(){this.isResizeBound||(b.bind(a,"resize",this),this.isResizeBound=!0)},g.prototype.unbindResize=function(){this.isResizeBound&&b.unbind(a,"resize",this),this.isResizeBound=!1},g.prototype.onresize=function(){function a(){b.resize(),delete b.resizeTimeout} this.resizeTimeout&&clearTimeout(this.resizeTimeout);var b=this;this.resizeTimeout=setTimeout(a,100)},g.prototype.resize=function(){this.isResizeBound&&this.needsResizeLayout()&&this.layout()},g.prototype.needsResizeLayout=function(){var a=d(this.element),b=this.size&&a;return b&&a.innerWidth!==this.size.innerWidth},g.prototype.addItems=function(a){var b=this._itemize(a);return b.length&&(this.items=this.items.concat(b)),b},g.prototype.appended=function(a){var b=this.addItems(a);b.length&&(this.layoutItems(b,!0),this.reveal(b))},g.prototype.prepended=function(a){var b=this._itemize(a);if(b.length){var c=this.items.slice(0);this.items=b.concat(c),this._resetLayout(),this._manageStamps(),this.layoutItems(b,!0),this.reveal(b),this.layoutItems(c)}},g.prototype.reveal=function(a){this._emitCompleteOnItems("reveal",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.reveal()}},g.prototype.hide=function(a){this._emitCompleteOnItems("hide",a);for(var b=a&&a.length,c=0;b&&b>c;c++){var d=a[c];d.hide()}},g.prototype.revealItemElements=function(a){var b=this.getItems(a);this.reveal(b)},g.prototype.hideItemElements=function(a){var b=this.getItems(a);this.hide(b)},g.prototype.getItem=function(a){for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];if(d.element===a)return d}},g.prototype.getItems=function(a){a=e.makeArray(a);for(var b=[],c=0,d=a.length;d>c;c++){var f=a[c],g=this.getItem(f);g&&b.push(g)} return b},g.prototype.remove=function(a){var b=this.getItems(a);if(this._emitCompleteOnItems("remove",b),b&&b.length)for(var c=0,d=b.length;d>c;c++){var f=b[c];f.remove(),e.removeFrom(this.items,f)}},g.prototype.destroy=function(){var a=this.element.style;a.height="",a.position="",a.width="";for(var b=0,c=this.items.length;c>b;b++){var d=this.items[b];d.destroy()} this.unbindResize();var e=this.element.outlayerGUID;delete l[e],delete this.element.outlayerGUID,i&&i.removeData(this.element,this.constructor.namespace)},g.data=function(a){a=e.getQueryElement(a);var b=a&&a.outlayerGUID;return b&&l[b]},g.create=function(a,b){function c(){g.apply(this,arguments)} return Object.create?c.prototype=Object.create(g.prototype):e.extend(c.prototype,g.prototype),c.prototype.constructor=c,c.defaults=e.extend({},g.defaults),e.extend(c.defaults,b),c.prototype.settings={},c.namespace=a,c.data=g.data,c.Item=function(){f.apply(this,arguments)},c.Item.prototype=new f,e.htmlInit(c,a),i&&i.bridget&&i.bridget(a,c),c},g.Item=f,g}),function(a,b){"function"==typeof define&&define.amd?define(["outlayer/outlayer","get-size/get-size","fizzy-ui-utils/utils"],b):"object"==typeof exports?module.exports=b(require("outlayer"),require("get-size"),require("fizzy-ui-utils")):a.Masonry=b(a.Outlayer,a.getSize,a.fizzyUIUtils)}(window,function(a,b,c){var d=a.create("masonry");return d.prototype._resetLayout=function(){this.getSize(),this._getMeasurement("columnWidth","outerWidth"),this._getMeasurement("gutter","outerWidth"),this.measureColumns();var a=this.cols;for(this.colYs=[];a--;)this.colYs.push(0);this.maxY=0},d.prototype.measureColumns=function(){if(this.getContainerWidth(),!this.columnWidth){var a=this.items[0],c=a&&a.element;this.columnWidth=c&&b(c).outerWidth||this.containerWidth} var d=this.columnWidth+=this.gutter,e=this.containerWidth+this.gutter,f=e/d,g=d-e%d,h=g&&1>g?"round":"floor";f=Math[h](f),this.cols=Math.max(f,1)},d.prototype.getContainerWidth=function(){var a=this.options.isFitWidth?this.element.parentNode:this.element,c=b(a);this.containerWidth=c&&c.innerWidth},d.prototype._getItemLayoutPosition=function(a){a.getSize();var b=a.size.outerWidth%this.columnWidth,d=b&&1>b?"round":"ceil",e=Math[d](a.size.outerWidth/this.columnWidth);e=Math.min(e,this.cols);for(var f=this._getColGroup(e),g=Math.min.apply(Math,f),h=c.indexOf(f,g),i={x:this.columnWidth*h,y:g},j=g+a.size.outerHeight,k=this.cols+1-f.length,l=0;k>l;l++)this.colYs[h+l]=j;return i},d.prototype._getColGroup=function(a){if(2>a)return this.colYs;for(var b=[],c=this.cols+1-a,d=0;c>d;d++){var e=this.colYs.slice(d,d+a);b[d]=Math.max.apply(Math,e)} return b},d.prototype._manageStamp=function(a){var c=b(a),d=this._getElementOffset(a),e=this.options.isOriginLeft?d.left:d.right,f=e+c.outerWidth,g=Math.floor(e/this.columnWidth);g=Math.max(0,g);var h=Math.floor(f/this.columnWidth);h-=f%this.columnWidth?0:1,h=Math.min(this.cols-1,h);for(var i=(this.options.isOriginTop?d.top:d.bottom)+c.outerHeight,j=g;h>=j;j++)this.colYs[j]=Math.max(i,this.colYs[j])},d.prototype._getContainerSize=function(){this.maxY=Math.max.apply(Math,this.colYs);var a={height:this.maxY};return this.options.isFitWidth&&(a.width=this._getContainerFitWidth()),a},d.prototype._getContainerFitWidth=function(){for(var a=0,b=this.cols;--b&&0===this.colYs[b];)a++;return(this.cols-a)*this.columnWidth-this.gutter},d.prototype.needsResizeLayout=function(){var a=this.containerWidth;return this.getContainerWidth(),a!==this.containerWidth},d}) function cffAddMasonry($self){ var evt=jQuery.Event('cffbeforemasonry'); evt.$self=$self; jQuery(window).trigger(evt); if(typeof $self.masonry!=='function'){ return; } if(jQuery(window).width() > 480&&$self.hasClass('masonry-1-desktop')){ $self.addClass('cff-disable-masonry'); }else if(jQuery(window).width() > 780||$self.hasClass('masonry-2-mobile')){ $self.addClass('cff-masonry cff-masonry-js').removeClass('cff-disable-masonry'); if($self.find('.cff-item').length){ window.cffMasonrySettings.itemSelector='.cff-new, .cff-item, .cff-likebox'; $self.masonry(window.cffMasonrySettings); $self.find('.cff-item').each(function(){ jQuery(this).css('margin-bottom', '15px'); }); }else if($self.find('.cff-album-item').length){ window.cffMasonrySettings.itemSelector='.cff-album-item'; $self.masonry(window.cffMasonrySettings); }}else{ $self.addClass('cff-disable-masonry'); }} } window.cffMasonrySettings={itemSelector: '.cff-album-item' }; function Cff(){ this.feeds={}; this.options={};} Cff.prototype={ createPage: function (createFeeds, createFeedsArgs){ if(typeof window.cffOptions==='undefined' || typeof window.cffOptions.resized_url==='undefined'){ window.cffOptions={ resized_url: location.protocol + '//' + window.location.hostname + "/wp-content/uploads/sb-facebook-feed-images/", placeholder: location.protocol + '//' + window.location.hostname + "/wp-content/plugins/custom-facebook-feed-pro/img/placeholder.png", }} createFeeds(createFeedsArgs); }, createFeeds: function (args){ jQuery('.cff').each(function (index){ jQuery(this).attr('data-cff-index', index + 1); var $self=jQuery(this); var feedOptions={ feedID:$self.find('.cff_resized_image_data').attr('data-feedid'), shortCodeAtts:$self.attr('data-cff-shortcode'), resizingEnabled:$self.find('.cff_resized_image_data').length, page: 1, pag_url:'', }; window.cff.feeds[index]=new CffFeed(this, index, feedOptions); window.cff.feeds[index].setResizedImages(); window.cff.feeds[index].init(); }); }, }; function CffFeed(el, index, settings){ this.el=el; this.index=index; this.settings=settings; this.resizedImages={}; this.needsResizing=[]; this.imagesWaiting=0; } CffFeed.prototype={ init: function(){ var feed=this; var cff_delay=(function (){ var cff_timer=0; return function (cff_callback, cff_ms){ clearTimeout(cff_timer); cff_timer=setTimeout(cff_callback, cff_ms); };})(); this.afterInitialImagesLoaded(); jQuery(window).resize(function (){ cff_delay(function (){ feed.afterResize(); }, 500); }); jQuery(this.el).find('.cff-item').each(function(){ feed.lazyLoadCheck(jQuery(this)); }); }, setResizedImages: function (){ if(jQuery(this.el).find('.cff_resized_image_data').length && typeof jQuery(this.el).find('.cff_resized_image_data').attr('data-resized')!=='undefined' && (jQuery(this.el).find('.cff_resized_image_data').attr('data-resized').indexOf('{"')===0||jQuery(this.el).find('.cff_resized_image_data').attr('data-resized').indexOf('[')===0)){ var rawResized=JSON.parse(jQuery(this.el).find('.cff_resized_image_data').attr('data-resized')), organizedResized={}; jQuery.each(rawResized,function(index,value){ organizedResized[value.facebook_id]={ id: value.media_id, sizes: JSON.parse(value.sizes), aspect: value.aspect_ratio }}); this.resizedImages=organizedResized; } jQuery(this.el).find('.cff_resized_image_data').remove(); }, sendNeedsResizingToServer: function(){ var feed=this; if(feed.needsResizing.length > 0&&feed.settings.resizingEnabled){ var itemOffset=jQuery(this.el).find('.cff-item').length; var submitData={ action: 'cff_resized_images_submit', needs_resizing: feed.needsResizing, offset: itemOffset, feed_id: feed.settings.feedID, atts: feed.settings.shortCodeAtts, pag_url: feed.pag_url }; var onSuccess=function(data){ feed.needsResizing=[]; if(data.trim().indexOf('{')===0){ var response=JSON.parse(data); if(feed.settings.debugEnabled){ console.log(response); }} }; cffAjax(submitData,onSuccess); }}, hasTargetElement: function($cffItem){ var $target=$cffItem; if($cffItem.find('.cff-photo').length){ $target=$cffItem.find('.cff-photo'); }else if($cffItem.find('.cff-poster').length){ $target=$cffItem.find('.cff-poster'); }else if($cffItem.find('.cff-link-slider-slides').length){ $target=$cffItem.find('.cff-link-slider-slides'); }else if($cffItem.find('.cff-img-wrap').length){ $target=$cffItem.find('.cff-img-wrap'); }else if($cffItem.find('.cff-album-cover').length){ $target=$cffItem.find('.cff-album-cover'); }else if($cffItem.find('.cff-link').length){ $target=$cffItem.find('.cff-link'); } return typeof $target.attr('data-img-src-set')!=='undefined'; }, getTargetElement: function($cffItem){ var $target=$cffItem.find('.cff-photo'); if($cffItem.find('.cff-poster').length){ $target=$cffItem.find('.cff-poster'); }else if($cffItem.find('.cff-link-slider-slides').length){ $target=$cffItem.find('.cff-link-slider-item'); }else if($cffItem.find('.cff-img-wrap').length){ $target=$cffItem.find('.cff-img-wrap'); }else if($cffItem.find('.cff-album-cover').length){ $target=$cffItem.find('.cff-album-cover'); }else if($cffItem.find('.cff-link').length){ $target=$cffItem.find('.cff-link'); } return $target; }, getTargetElementImage: function($targetItem){ if($targetItem.find('img').length){ return $targetItem.find('img'); }else{ return $targetItem; }}, getTargetWidth: function($imgWrapItem,$item,index){ var width=50, newWidth=0; if($item.find('.cff-multi-image').length > 2&&index > 0){ newWidth=$item.innerWidth() / 3; }else if($item.closest('.cff-masonry').length){ newWidth=$item.innerWidth(); }else if($imgWrapItem.closest('.cff-item').find('.cff-link-slider').length){ newWidth=$imgWrapItem.closest('.cff-item').find('.cff-link-slider').width(); }else{ newWidth=$imgWrapItem.innerWidth(); } return Math.max(width,newWidth); }, maybeRaiseSingleImageResolution: function ($item, index, forceChange){ var feed=this, $target=feed.getTargetElement($item), imgSrcSet=feed.getImageUrls($item,$target); $target.each(function(i){ var $imgWrapItem=jQuery(this), $targetImageElement=feed.getTargetElementImage($imgWrapItem), currentUrl=$targetImageElement.attr('src'), currentRes=typeof $imgWrapItem.attr('data-current')==='undefined' ? 0:parseInt($imgWrapItem.attr('data-current')), neededRes=feed.getTargetWidth($imgWrapItem,$item,i), changeToRes=false; if(currentRes < neededRes){ var foundBestRes=false; jQuery.each(imgSrcSet[i], function (ii, value){ if(! foundBestRes&&ii > currentRes){ changeToRes=ii; if(ii >=neededRes){ foundBestRes=true; }} }); } if(changeToRes){ currentRes=changeToRes; if(feed.settings.debugEnabled){ var reason=currentUrl===feed.placeholderURL ? 'was placeholder':'too small'; } $imgWrapItem.attr('data-current',changeToRes); var newUrl=imgSrcSet[i][changeToRes]; if(newUrl!==currentUrl){ $targetImageElement.attr('src', newUrl); if($imgWrapItem.hasClass('imgLiquid_ready')){ $imgWrapItem.css('background-image', 'url("' + newUrl + '")'); } feed.processNewImage($imgWrapItem); if(currentRes < 720&&$item.hasClass('cff-album-item')&&! $targetImageElement.hasClass('cff-secondary-check')){ $targetImageElement.addClass('cff-secondary-check'); $targetImageElement.on('load',function(){ if(!jQuery(this).hasClass('cff-secondary-checked')){ jQuery(this).addClass('cff-secondary-checked'); var imagEl=$targetImageElement.get(0), height=imagEl.naturalHeight, aspectRatio=imagEl.naturalWidth/imagEl.naturalHeight; if($targetImageElement.innerWidth() > height){ neededRes=feed.getTargetWidth($imgWrapItem,$item,i) * aspectRatio; if(parseInt(currentRes) < neededRes){ foundBestRes=false; jQuery.each(imgSrcSet[i], function (ii, value){ if(! foundBestRes&&ii > currentRes){ changeToRes=ii; if(ii >=neededRes){ foundBestRes=true; }} }); if(changeToRes){ $imgWrapItem.attr('data-current', changeToRes); var newUrl=imgSrcSet[i][changeToRes]; if(newUrl!==currentUrl){ $targetImageElement.attr('src', newUrl); if($imgWrapItem.hasClass('imgLiquid_ready')){ $imgWrapItem.css('background-image', 'url("' + newUrl + '")'); } feed.processNewImage($imgWrapItem); }} }} }}); }} } $targetImageElement.on('error', function (){ if(!jQuery(this).hasClass('cff-img-error')){ jQuery(this).addClass('cff-img-error'); var newUrl=typeof jQuery(this).attr('data-orig-source')!=='undefined' ? jQuery(this).attr('data-orig-source'):false; if(newUrl&&newUrl!==currentUrl){ $targetImageElement.attr('src', newUrl); if($imgWrapItem.hasClass('imgLiquid_ready')){ $imgWrapItem.css('background-image', 'url("' + newUrl + '")'); }} setTimeout(function(){ feed.afterResize(); }, 1500) }else{ console.log('unfixed error ' + jQuery(this).attr('src')); }}); }); }, maybeRaiseImageResolution: function (justNew){ var feed=this, itemsSelector=typeof justNew!=='undefined'&&justNew===true ? '.cff-item.cff-new, .cff-album-item.cff-new':'.cff-item, .cff-album-item'; jQuery(feed.el).find(itemsSelector).each(function (index){ if(!jQuery(this).hasClass('cff-num-diff-hide') && feed.hasTargetElement(jQuery(this))){ feed.maybeRaiseSingleImageResolution(jQuery(this),index); }}); }, getImageUrls: function ($item,$target){ var feed=this, srcSet={}, $srcSetItem=false, id=$item.attr('id').replace('cff_', ''); if(typeof $target.attr('data-img-src-set')!=='undefined'){ $srcSetItem=$target; }else if(typeof $item.find('.cff-photo').attr('data-img-src-set')!=='undefined'){ $srcSetItem=$item.find('.cff-photo'); }else if(typeof $item.find('.cff-link-slider-slides').attr('data-img-src-set')!=='undefined'){ $srcSetItem=$item.find('.cff-link-slider-slides'); }else if(typeof $item.find('.cff-album-cover').attr('data-img-src-set')!=='undefined'){ $srcSetItem=$item.find('.cff-album-cover'); } if($srcSetItem){ srcSet=JSON.parse($srcSetItem.attr('data-img-src-set').replace(/\\\//g, '/')) } var returnSrcSet=srcSet; if(typeof feed.resizedImages[id]==='undefined'&&id.indexOf('_')===-1){ id=$item.attr('data-page-id') + '_' + id; } if(typeof feed.resizedImages[id]!=='undefined' && feed.resizedImages[id].id!=='pending' && feed.resizedImages[id].id!=='error'){ jQuery.each(srcSet,function(index,value){ jQuery.each(feed.resizedImages[id].sizes,function(index2,value2){ returnSrcSet[index][value2]=window.cffOptions.resized_url+feed.resizedImages[id].id+'-'+index+'-'+value2+'.jpg'; }); }); }else if(typeof this.resizedImages[id]==='undefined' || (typeof this.resizedImages[id]['id']!=='undefined'&&this.resizedImages[id]['id']!=='pending'&&this.resizedImages[id]['id']!=='error')){ var hasMediumSize=false; jQuery.each(returnSrcSet[0],function(resolution){ if(parseInt(resolution) > 150&&parseInt(resolution) < 500){ hasMediumSize=true; }}); if(!hasMediumSize){ this.addToNeedsResizing(id); }} return returnSrcSet; }, addToNeedsResizing: function (id){ if(this.needsResizing.indexOf(id)===-1){ this.needsResizing.push(id); }}, processNewImage: function($item){ var feed=this; $item.find('img').each(function(){ if(!jQuery(this).prop('complete')){ feed.imagesWaiting++; jQuery(this).addClass('cff-image-loading').on('load',function(){ jQuery(this).removeClass('cff-image-loading'); feed.imagesWaiting--; if(feed.imagesWaiting < 1){ feed.afterResize(); }}); jQuery(this).on('error',function(){ jQuery(this).removeClass('cff-image-loading'); feed.imagesWaiting--; if(feed.imagesWaiting < 1){ feed.afterResize(); }}); }}); }, lazyLoadCheck: function($item){ if(!$item.closest('.cff').hasClass('cff-no-ll-check')){ $item.find('img').each(function(){ if(typeof jQuery(this).attr('data-src')!=='undefined'){ jQuery(this).attr('data-src',jQuery(this).attr('data-orig-source')); } if(typeof jQuery(this).attr('data-orig-src')!=='undefined'){ jQuery(this).attr('data-orig-src',jQuery(this).attr('data-orig-source')); } jQuery(this).on('load',function(){ if(!jQuery(this).hasClass('cff-replaced') && jQuery(this).attr('src').indexOf('placeholder') > -1){ jQuery(this).addClass('cff-replaced'); var origSource=typeof jQuery(this).attr('data-orig-source')!=='undefined' ? jQuery(this).attr('data-orig-source'):false; if(origSource){ jQuery(this).attr('src',jQuery(this).attr('data-orig-source')); if(jQuery(this).closest('.imgLiquid_bgSize').length){ jQuery(this).closest('.imgLiquid_bgSize').css('background-image', 'url(' + origSource + ')'); }} }}); }); }}, maybeRelayoutMasonry: function(){ var $cff=jQuery(this.el); if($cff.hasClass('cff-masonry-js')&&!$cff.hasClass('cff-masonry-css')){ var cff_delay=(function (){ var cff_timer=0; return function (cff_callback, cff_ms){ clearTimeout(cff_timer); cff_timer=setTimeout(cff_callback, cff_ms); };})(); cff_delay(function (){ cffAddMasonry($cff); }, 500); }}, afterInitialImagesLoaded: function(){ this.maybeRaiseImageResolution(); this.sendNeedsResizingToServer(); this.maybeCleanUpNew(); }, afterResize: function (){ this.maybeRaiseImageResolution(); this.maybeRelayoutMasonry(); }, afterLoadMoreClicked: function(){ this.maybeRaiseImageResolution(); }, maybeCleanUpNew: function(){ var feed=this, $cff=jQuery(this.el); setTimeout(function(){ if(feed.index > 0){ $cff.find('.cff-new').removeClass('cff-new'); } $cff.find('img').each(function(){ if(!jQuery(this).hasClass('cff-image-loading') && jQuery(this).attr('src').indexOf('placeholder.png') > -1){ console.log('lazy load correction'); var $self=jQuery(this), currentSrc=$self.attr('src'), originalSrc=$self.attr('data-orig-source'); if(originalSrc!=currentSrc){ $self.attr('src', originalSrc); } if($self.hasClass('cff-multi-image')){ $self.css('background-image', 'url(' + originalSrc + ')'); }} }); },1250); }}; function cffAjax(submitData, onSuccess){ jQuery.ajax({ url: cffajaxurl, type: 'post', data: submitData, success: onSuccess }); } function cff_init($cff){ jQuery('.cff-nojs').removeClass('cff-nojs'); var cffTouchDevice=false; if(cffIsTouchDevice()===true) cffTouchDevice=true; function cffIsTouchDevice(){ return true==("ontouchstart" in window||window.DocumentTouch&&document instanceof DocumentTouch); } var firsttime=false; if(typeof $cff==='undefined'){ $cff=jQuery('.cff'); firsttime=true; } (function($){ $('.cff-likebox iframe').each(function(){ var $likebox=$(this), likeboxWidth=$likebox.attr('data-likebox-width'), cffFeedWidth=$likebox.parent().width(); if(likeboxWidth=='') likeboxWidth=340; if(cffFeedWidth < likeboxWidth) likeboxWidth=cffFeedWidth; $likebox.attr('src', 'https://www.facebook.com/plugins/page.php?href=https%3A%2F%2Fwww.facebook.com%2F'+$likebox.attr('data-likebox-id')+'%2F&tabs&width='+Math.floor(likeboxWidth)+'&small_header='+$likebox.attr('data-likebox-header')+'&adapt_container_width=true&hide_cover='+$likebox.attr('data-hide-cover')+'&hide_cta='+$likebox.attr('data-hide-cta')+'&show_facepile='+$likebox.attr('data-likebox-faces')+'&locale='+$likebox.attr('data-locale')); }); jQuery(document).off('click', '#cff a.cff-view-comments').on('click', '#cff a.cff-view-comments', function(){ var $self=jQuery(this), $commentsBox=$self.closest('.cff-item').find('.cff-comments-box'); $self.toggleClass('cff-open'); $commentsBox.slideToggle(300); var $feed=$self.closest('#cff'), $item=$(this).closest('.cff-item'); if($feed.hasClass('cff-masonry-js')&&!$feed.hasClass('cff-opaque-comments')){ setTimeout(function(){ cffAddMasonry($feed); }, 500); } $commentsBox.find('.cff-comment:visible').each(function(){ var $thisComment=jQuery(this); $thisComment.find('.cff-comment-img:not(.cff-comment-reply-img) a, .cff-comment-img:not(.cff-comment-reply-img) span').html('Avatar'); }); }); var cffAnimateIconColorVar, stopAnimate=false; $cff.find('.cff-view-comments').hover(function(){ var $self=$(this), time=50; if($self.hasClass('cff-open')) return; $self.find('.cff-icon').each(function(){ var $cffIcon=jQuery(this); cffAnimateIconColor($cffIcon, time); time +=50; }); }, function(){ cffStopAnimateIconColor(); $(this).find('.cff-icon').removeClass('cff-animate'); }); function cffAnimateIconColor($cffIcon, time){ stopAnimate=false; cffAnimateIconColorVar=setTimeout(function(){ if(!stopAnimate) $cffIcon.addClass('cff-animate'); }, time); } function cffStopAnimateIconColor(){ clearTimeout(cffAnimateIconColorVar); stopAnimate=true; } if(typeof cffsiteurl==='undefined'||cffsiteurl=='') cffsiteurl=window.location.host + '/wp-content/plugins'; var locatefile=true; var metaArr={}, newMetaArr={}; var lb=0; jQuery('#cff.cff-lb').each(function(){ lb++; $(this).attr('data-cff-lb', lb); }); var $cff_post_selector=$cff.find('.cff-item.cff-new, .cff-album-item.cff-new'); if(firsttime){ $cff_post_selector=jQuery('#cff .cff-item.cff-new, #cff .cff-album-item.cff-new'); } $cff_post_selector.each(function(){ var $self=jQuery(this); if($self.find('.cff-viewpost-link, .cff-viewpost-facebook, .cff-viewpost').parent('p').length){ if(!$self.hasClass('event')) $self.find('.cff-viewpost-link, .cff-viewpost-facebook, .cff-viewpost').unwrap('p'); } if($self.find('.cff-photo').parent('p').length){ $self.find('p .cff-photo').unwrap('p'); $self.find('.cff-album-icon').appendTo('.cff-photo:last'); } if($self.find('.cff-event-thumb').parent('p').length){ $self.find('.cff-event-thumb').unwrap('p'); } if($self.find('.cff-vidLink').parent('p').length){ $self.find('.cff-vidLink').unwrap('p'); } if($self.find('.cff-link').parent('p').length){ $self.find('.cff-link').unwrap('p'); } if($self.find('.cff-viewpost-link').parent('p').length){ $self.find('.cff-viewpost-link').unwrap('p'); } if($self.find('.cff-viewpost-facebook').parent('p').length){ $self.find('.cff-viewpost-facebook').unwrap('p'); } if($self.find('iframe').parent('p').length){ $self.find('iframe').unwrap('p'); } if($self.find('.cff-author').parent('p').length){ $self.find('.cff-author').eq(1).unwrap('p'); $self.find('.cff-author').eq(1).remove(); } if($self.find('.cff-view-comments').parent('p').length){ $self.find('.cff-meta-wrap > p').remove(); $self.find('.cff-view-comments').eq(1).remove(); var $cffMeta=$self.find('.cff-meta'), cffMetaClasses=$cffMeta.attr('class'); $cffMeta.find('.cff-view-comments').unwrap().wrapInner('