/*! For license information please see view.js.LICENSE.txt */ (()=>{var e={9764:function(e,t,r){var a;a=e=>(()=>{var t={703:(e,t,r)=>{"use strict";var a=r(414);function n(){}function o(){}o.resetWarningCache=n,e.exports=function(){function e(e,t,r,n,o,i){if(i!==a){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:n};return r.PropTypes=r,r}},697:(e,t,r)=>{e.exports=r(703)()},414:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},98:t=>{"use strict";t.exports=e}},r={};function a(e){var n=r[e];if(void 0!==n)return n.exports;var o=r[e]={exports:{}};return t[e](o,o.exports,a),o.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var r in t)a.o(t,r)&&!a.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{"use strict";a.r(n),a.d(n,{default:()=>P});var e=a(98),t=a.n(e),r=a(697),o=a.n(r);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:""}function f(e){return f="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},f(e)}function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?t-1:void 0,{isPrevious:!0})})),m(v(r),"handleNextPage",(function(e){var t=r.state.selected,a=r.props.pageCount;r.handleClick(e,null,t3&&void 0!==arguments[3]?arguments[3]:{},o=n.isPrevious,i=void 0!==o&&o,s=n.isNext,l=void 0!==s&&s,c=n.isBreak,u=void 0!==c&&c,p=n.isActive,d=void 0!==p&&p;e.preventDefault?e.preventDefault():e.returnValue=!1;var f=r.state.selected,g=r.props.onClick,b=a;if(g){var v=g({index:t,selected:f,nextSelectedPage:a,event:e,isPrevious:i,isNext:l,isBreak:u,isActive:d});if(!1===v)return;Number.isInteger(v)&&(b=v)}void 0!==b&&r.handlePageChange(b)})),m(v(r),"handleBreakClick",(function(e,t){var a=r.state.selected;r.handleClick(t,e,ao-n/2?g=n-(b=o-d):do-i)h.push({type:"page",index:v,display:m(v)});else if(v>=d-g&&v<=d+(0===d&&n>1?b-1:b))h.push({type:"page",index:v,display:m(v)});else if(s&&h.length>0&&h[h.length-1].display!==y&&(n>0||i>0)){var C=vn-1&&console.warn("(react-paginate): The initialPage prop provided is greater than the maximum page index from pageCount prop (".concat(t," > ").concat(n-1,").")),void 0!==o&&o>n-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(o," > ").concat(n-1,")."))}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.forcePage&&this.props.forcePage!==e.forcePage&&(this.props.forcePage>this.props.pageCount-1&&console.warn("(react-paginate): The forcePage prop provided is greater than the maximum page index from pageCount prop (".concat(this.props.forcePage," > ").concat(this.props.pageCount-1,").")),this.setState({selected:this.props.forcePage})),Number.isInteger(e.pageCount)&&!Number.isInteger(this.props.pageCount)&&console.warn("(react-paginate): The pageCount prop value provided is not an integer (".concat(this.props.pageCount,"). Did you forget a Math.ceil()?"))}},{key:"getForwardJump",value:function(){var e=this.state.selected,t=this.props,r=t.pageCount,a=e+t.pageRangeDisplayed;return a>=r?r-1:a}},{key:"getBackwardJump",value:function(){var e=this.state.selected-this.props.pageRangeDisplayed;return e<0?0:e}},{key:"getElementHref",value:function(e){var t=this.props,r=t.hrefBuilder,a=t.pageCount,n=t.hrefAllControls;if(r)return n||e>=0&&e=0&&e{"use strict";e.exports=window.React},6942:(e,t)=>{var r;!function(){"use strict";var a={}.hasOwnProperty;function n(){for(var e="",t=0;t{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";const e=window.wp.element;var t=r(9764),a=r.n(t);const n=window.wp.apiFetch;var o=r.n(n);const i=window.wp.url;var s=r(6942),l=r.n(s);const c=window.ReactJSXRuntime;function u(e){return u="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},u(e)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function d(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,a=Array(t);rAn error occurred.

')})).finally((function(){k(!1),r.current.scrollIntoView()}))}),[h]),null!=window["jfQuery".concat(R)]&&(window["jfQueryProxy".concat(R)]=new Proxy(window["jfQuery".concat(R)],{set:function(e,t,r){return e[t]=r,P(d(d({},h),{},{context:d(d({},h.context),{},{query:e})})),Reflect.set.apply(Reflect,arguments)},get:function(e,t,r){return Reflect.get.apply(Reflect,arguments)}}));return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)("ul",{ref:r,className:l()("wp-block-jf-blog-template__posts",{loading:x}),"data-page":D,dangerouslySetInnerHTML:{__html:v}}),L>1&&(0,c.jsx)(a(),{breakLabel:null,nextLabel:"Next",forcePage:T.current,onPageChange:function(e){var t=A.current+e.selected*E,r=Math.round(e.selected*E/E)+1;B(r),window["jfQueryProxy".concat(R)].offset=t,window.history.pushState({paged:r},"",(0,i.addQueryArgs)(window.location.href,{paged:r}))},pageRangeDisplayed:3,marginPagesDisplayed:0,pageCount:L,previousLabel:"Previous",renderOnZeroPageCount:null,className:"wp-block-jf-blog-template__pagination"})]})})),y=document.getElementsByClassName("wp-block-jf-blog-template");window.addEventListener("DOMContentLoaded",(function(){for(var t=0;t+~]|"+ge+")"+ge+"*"),x=new RegExp(ge+"|>"),j=new RegExp(g),A=new RegExp("^"+t+"$"),D={ID:new RegExp("^#("+t+")"),CLASS:new RegExp("^\\.("+t+")"),TAG:new RegExp("^("+t+"|[*])"),ATTR:new RegExp("^"+p),PSEUDO:new RegExp("^"+g),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+ge+"*(even|odd|(([+-]|)(\\d*)n|)"+ge+"*(?:([+-]|)"+ge+"*(\\d+)|))"+ge+"*\\)|)","i"),bool:new RegExp("^(?:"+f+")$","i"),needsContext:new RegExp("^"+ge+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+ge+"*((?:-\\d)?\\d*)"+ge+"*\\)|)(?=[^-]|$)","i")},N=/^(?:input|select|textarea|button)$/i,q=/^h\d$/i,L=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,H=/[+~]/,O=new RegExp("\\\\[\\da-fA-F]{1,6}"+ge+"?|\\\\([^\\r\\n\\f])","g"),P=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},M=function(){V()},R=J(function(e){return!0===e.disabled&&fe(e,"fieldset")},{dir:"parentNode",next:"legend"});try{k.apply(oe=ae.call(ye.childNodes),ye.childNodes),oe[ye.childNodes.length].nodeType}catch(e){k={apply:function(e,t){me.apply(e,ae.call(t))},call:function(e){me.apply(e,ae.call(arguments,1))}}}function I(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(V(e),e=e||T,C)){if(11!==p&&(u=L.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return k.call(n,a),n}else if(f&&(a=f.getElementById(i))&&I.contains(e,a)&&a.id===i)return k.call(n,a),n}else{if(u[2])return k.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&e.getElementsByClassName)return k.apply(n,e.getElementsByClassName(i)),n}if(!(h[t+" "]||d&&d.test(t))){if(c=t,f=e,1===p&&(x.test(t)||m.test(t))){(f=H.test(t)&&U(e.parentNode)||e)==e&&le.scope||((s=e.getAttribute("id"))?s=ce.escapeSelector(s):e.setAttribute("id",s=S)),o=(l=Y(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+Q(l[o]);c=l.join(",")}try{return k.apply(n,f.querySelectorAll(c)),n}catch(e){h(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return re(t.replace(ve,"$1"),e,n,r)}function W(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function F(e){return e[S]=!0,e}function $(e){var t=T.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function B(t){return function(e){return fe(e,"input")&&e.type===t}}function _(t){return function(e){return(fe(e,"input")||fe(e,"button"))&&e.type===t}}function z(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&R(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function X(a){return F(function(o){return o=+o,F(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function U(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}function V(e){var t,n=e?e.ownerDocument||e:ye;return n!=T&&9===n.nodeType&&n.documentElement&&(r=(T=n).documentElement,C=!ce.isXMLDoc(T),i=r.matches||r.webkitMatchesSelector||r.msMatchesSelector,r.msMatchesSelector&&ye!=T&&(t=T.defaultView)&&t.top!==t&&t.addEventListener("unload",M),le.getById=$(function(e){return r.appendChild(e).id=ce.expando,!T.getElementsByName||!T.getElementsByName(ce.expando).length}),le.disconnectedMatch=$(function(e){return i.call(e,"*")}),le.scope=$(function(){return T.querySelectorAll(":scope")}),le.cssHas=$(function(){try{return T.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}}),le.getById?(b.filter.ID=function(e){var t=e.replace(O,P);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(O,P);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&C){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},b.find.CLASS=function(e,t){if("undefined"!=typeof t.getElementsByClassName&&C)return t.getElementsByClassName(e)},d=[],$(function(e){var t;r.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||d.push("\\["+ge+"*(?:value|"+f+")"),e.querySelectorAll("[id~="+S+"-]").length||d.push("~="),e.querySelectorAll("a#"+S+"+*").length||d.push(".#.+[+~]"),e.querySelectorAll(":checked").length||d.push(":checked"),(t=T.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),r.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&d.push(":enabled",":disabled"),(t=T.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||d.push("\\["+ge+"*name"+ge+"*="+ge+"*(?:''|\"\")")}),le.cssHas||d.push(":has"),d=d.length&&new RegExp(d.join("|")),l=function(e,t){if(e===t)return a=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!le.sortDetached&&t.compareDocumentPosition(e)===n?e===T||e.ownerDocument==ye&&I.contains(ye,e)?-1:t===T||t.ownerDocument==ye&&I.contains(ye,t)?1:o?se.call(o,e)-se.call(o,t):0:4&n?-1:1)}),T}for(e in I.matches=function(e,t){return I(e,null,null,t)},I.matchesSelector=function(e,t){if(V(e),C&&!h[t+" "]&&(!d||!d.test(t)))try{var n=i.call(e,t);if(n||le.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){h(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(O,P),e[3]=(e[3]||e[4]||e[5]||"").replace(O,P),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||I.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&I.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return D.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&j.test(n)&&(t=Y(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(O,P).toLowerCase();return"*"===e?function(){return!0}:function(e){return fe(e,t)}},CLASS:function(e){var t=s[e+" "];return t||(t=new RegExp("(^|"+ge+")"+e+"("+ge+"|$)"))&&s(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=I.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function T(e,n,r){return v(n)?ce.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?ce.grep(e,function(e){return e===n!==r}):"string"!=typeof n?ce.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(ce.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||k,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:S.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof ce?t[0]:t,ce.merge(this,ce.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:C,!0)),w.test(r[1])&&ce.isPlainObject(t))for(r in t)v(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=C.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):v(e)?void 0!==n.ready?n.ready(e):e(ce):ce.makeArray(e,this)}).prototype=ce.fn,k=ce(C);var E=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function A(e,t){while((e=e[t])&&1!==e.nodeType);return e}ce.fn.extend({has:function(e){var t=ce(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;xe=C.createDocumentFragment().appendChild(C.createElement("div")),(be=C.createElement("input")).setAttribute("type","radio"),be.setAttribute("checked","checked"),be.setAttribute("name","t"),xe.appendChild(be),le.checkClone=xe.cloneNode(!0).cloneNode(!0).lastChild.checked,xe.innerHTML="",le.noCloneChecked=!!xe.cloneNode(!0).lastChild.defaultValue,xe.innerHTML="",le.option=!!xe.lastChild;var ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function Se(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&fe(e,t)?ce.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var je=/<|&#?\w+;/;function Ae(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function Re(e,t){return fe(e,"table")&&fe(11!==t.nodeType?t:t.firstChild,"tr")&&ce(e).children("tbody")[0]||e}function Ie(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function We(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Fe(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(_.hasData(e)&&(s=_.get(e).events))for(i in _.remove(t,"handle events"),s)for(n=0,r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),C.head.appendChild(r[0])},abort:function(){i&&i()}}});var Jt,Kt=[],Zt=/(=)\?(?=&|$)|\?\?/;ce.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Kt.pop()||ce.expando+"_"+jt.guid++;return this[e]=!0,e}}),ce.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=v(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Zt,"$1"+r):!1!==e.jsonp&&(e.url+=(At.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||ce.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=ie[r],ie[r]=function(){o=arguments},n.always(function(){void 0===i?ce(ie).removeProp(r):ie[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Kt.push(r)),o&&v(i)&&i(o[0]),o=i=void 0}),"script"}),le.createHTMLDocument=((Jt=C.implementation.createHTMLDocument("").body).innerHTML="
",2===Jt.childNodes.length),ce.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(le.createHTMLDocument?((r=(t=C.implementation.createHTMLDocument("")).createElement("base")).href=C.location.href,t.head.appendChild(r)):t=C),o=!n&&[],(i=w.exec(e))?[t.createElement(i[1])]:(i=Ae([e],t,o),o&&o.length&&ce(o).remove(),ce.merge([],i.childNodes)));var r,i,o},ce.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(ce.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},ce.expr.pseudos.animated=function(t){return ce.grep(ce.timers,function(e){return t===e.elem}).length},ce.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=ce.css(e,"position"),c=ce(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=ce.css(e,"top"),u=ce.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),v(t)&&(t=t.call(e,n,ce.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},ce.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){ce.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===ce.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===ce.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=ce(e).offset()).top+=ce.css(e,"borderTopWidth",!0),i.left+=ce.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-ce.css(r,"marginTop",!0),left:t.left-i.left-ce.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===ce.css(e,"position"))e=e.offsetParent;return e||J})}}),ce.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;ce.fn[t]=function(e){return M(this,function(e,t,n){var r;if(y(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),ce.each(["top","left"],function(e,n){ce.cssHooks[n]=Ye(le.pixelPosition,function(e,t){if(t)return t=Ge(e,n),_e.test(t)?ce(e).position()[n]+"px":t})}),ce.each({Height:"height",Width:"width"},function(a,s){ce.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){ce.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return M(this,function(e,t,n){var r;return y(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?ce.css(e,t,i):ce.style(e,t,n,i)},s,n?e:void 0,n)}})}),ce.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){ce.fn[t]=function(e){return this.on(t,e)}}),ce.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),ce.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){ce.fn[n]=function(e,t){return 0\x20\t\r\n\f]*)[^>]*)\/>/gi;s.UNSAFE_restoreLegacyHtmlPrefilter=function(){s.migrateEnablePatches("self-closed-tags")},i(s,"htmlPrefilter",function(e){var t,r;return(r=(t=e).replace(F,"<$1>"))!==t&&T(t)!==T(r)&&u("self-closed-tags","HTML tags must be properly nested and closed: "+t),e.replace(F,"<$1>")},"self-closed-tags"),s.migrateDisablePatches("self-closed-tags");var D,W,_,I=s.fn.offset;return i(s.fn,"offset",function(){var e=this[0];return!e||e.nodeType&&e.getBoundingClientRect?I.apply(this,arguments):(u("offset-valid-elem","jQuery.fn.offset() requires a valid DOM element"),arguments.length?this:void 0)},"offset-valid-elem"),s.ajax&&(D=s.param,i(s,"param",function(e,t){var r=s.ajaxSettings&&s.ajaxSettings.traditional;return void 0===t&&r&&(u("param-ajax-traditional","jQuery.param() no longer uses jQuery.ajaxSettings.traditional"),t=r),D.call(this,e,t)},"param-ajax-traditional")),c(s.fn,"andSelf",s.fn.addBack,"andSelf","jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()"),s.Deferred&&(W=s.Deferred,_=[["resolve","done",s.Callbacks("once memory"),s.Callbacks("once memory"),"resolved"],["reject","fail",s.Callbacks("once memory"),s.Callbacks("once memory"),"rejected"],["notify","progress",s.Callbacks("memory"),s.Callbacks("memory")]],i(s,"Deferred",function(e){var a=W(),i=a.promise();function t(){var o=arguments;return s.Deferred(function(n){s.each(_,function(e,t){var r="function"==typeof o[e]&&o[e];a[t[1]](function(){var e=r&&r.apply(this,arguments);e&&"function"==typeof e.promise?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[t[0]+"With"](this===i?n.promise():this,r?[e]:arguments)})}),o=null}).promise()}return c(a,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),c(i,"pipe",t,"deferred-pipe","deferred.pipe() is deprecated"),e&&e.call(a,a),a},"deferred-pipe"),s.Deferred.exceptionHook=W.exceptionHook),s}); ; "use strict"; ; /* global wppopups_settings,*/ (function ($) { /** * Copyright 2012, Digital Fusion * Licensed under the MIT license. * http://teamdf.com/jquery-plugins/license/ * * @author Sam Sehnert * @desc A small plugin that checks whether elements are within * the user visible viewport of a web browser. * can accounts for vertical position, horizontal, or both */ var $w = $(window); $.fn.visible = function (partial, hidden, direction, container) { if (this.length < 1) return; // Set direction default to 'both'. direction = direction || 'both'; var $t = this.length > 1 ? this.eq(0) : this, isContained = typeof container !== 'undefined' && container !== null, $c = isContained ? $(container) : $w, wPosition = isContained ? $c.position() : 0, t = $t.get(0), vpWidth = $c.outerWidth(), vpHeight = $c.outerHeight(), clientSize = hidden === true ? t.offsetWidth * t.offsetHeight : true; if (typeof t.getBoundingClientRect === 'function') { // Use this native browser method, if available. var rec = t.getBoundingClientRect(), tViz = isContained ? rec.top - wPosition.top >= 0 && rec.top < vpHeight + wPosition.top : rec.top >= 0 && rec.top < vpHeight, bViz = isContained ? rec.bottom - wPosition.top > 0 && rec.bottom <= vpHeight + wPosition.top : rec.bottom > 0 && rec.bottom <= vpHeight, lViz = isContained ? rec.left - wPosition.left >= 0 && rec.left < vpWidth + wPosition.left : rec.left >= 0 && rec.left < vpWidth, rViz = isContained ? rec.right - wPosition.left > 0 && rec.right < vpWidth + wPosition.left : rec.right > 0 && rec.right <= vpWidth, vVisible = partial ? tViz || bViz : tViz && bViz, hVisible = partial ? lViz || rViz : lViz && rViz, vVisible = rec.top < 0 && rec.bottom > vpHeight ? true : vVisible, hVisible = rec.left < 0 && rec.right > vpWidth ? true : hVisible; if (direction === 'both') return clientSize && vVisible && hVisible;else if (direction === 'vertical') return clientSize && vVisible;else if (direction === 'horizontal') return clientSize && hVisible; } else { var viewTop = isContained ? 0 : wPosition, viewBottom = viewTop + vpHeight, viewLeft = $c.scrollLeft(), viewRight = viewLeft + vpWidth, position = $t.position(), _top = position.top, _bottom = _top + $t.height(), _left = position.left, _right = _left + $t.width(), compareTop = partial === true ? _bottom : _top, compareBottom = partial === true ? _top : _bottom, compareLeft = partial === true ? _right : _left, compareRight = partial === true ? _left : _right; if (direction === 'both') return !!clientSize && compareBottom <= viewBottom && compareTop >= viewTop && compareRight <= viewRight && compareLeft >= viewLeft;else if (direction === 'vertical') return !!clientSize && compareBottom <= viewBottom && compareTop >= viewTop;else if (direction === 'horizontal') return !!clientSize && compareRight <= viewRight && compareLeft >= viewLeft; } }; })(jQuery); (function ($) { 'use strict'; var WPPopupsPro = { popups: {}, last_position: null, delta: 0, timer: null, /** * Start the engine. * * @since 2.0.0 */ init: function init() { // Document ready $(document).ready(WPPopupsPro.ready); // Page load $(window).on('load', WPPopupsPro.load); // Document ready $(document).on('wppopupsReady', WPPopupsPro.start); // Before rules in src $(document).on('wppopupsBeforeReady', WPPopupsPro.beforeReady); // register events and hooks WPPopupsPro.bindEvents(); }, /** * Document ready. * * @since 2.0.0 */ ready: function ready() {}, /** * Page load. * * @since 2.0.0 */ load: function load() {}, start: function start() { WPPopupsPro.loopPopups(); // Set user identifier // WPPopupsPro.setUserIndentifier(); not needed for now $(document).trigger('wppopupsProStarted'); }, /** * Configure each popup */ loopPopups: function loopPopups() { $(".spu-box").each(function () { var $popup = $(this), $id = $popup.data('id'); // check if popups goes after content WPPopupsPro.afterContentPopups($popup); // check advanced method WPPopupsPro.advancedClosePopups($popup); WPPopupsPro.pushContentPopups($popup); }); }, // --------------------------------------------------------------------// // Binds // --------------------------------------------------------------------// /** * Events bindings. * * @since 2.0.0 */ bindEvents: function bindEvents() { // Stats if (wppopups_pro_vars.enable_stats && '1' == wppopups_pro_vars.enable_stats) { $(document).on('wppopups.popup_converted', WPPopupsPro.trackConversion); $(document).on('wppopups.popup_opened', WPPopupsPro.trackOpening); } //disable scroll window.wp.hooks.addAction('wppopups_before_show_popup', 'wppopups', WPPopupsPro.disablePageScroll); window.wp.hooks.addAction('wppopups_hide_popup', 'wppopups', WPPopupsPro.enablePageScroll); // animations window.wp.hooks.addAction('wppopups_show_popup', 'wppopups', WPPopupsPro.triggerShowAnimations); window.wp.hooks.addAction('wppopups_show_popup', 'wppopups', WPPopupsPro.triggerAutoClose); // sticky window.wp.hooks.addAction('wppopups_show_popup', 'wppopups', WPPopupsPro.stickyPopup); window.wp.hooks.addFilter('wppopups_cancel_hide', 'wppopups', function (default_value, popup) { var settings = window.wppopups.settings(popup, 'position'); if (settings.position == 'sticky-left' || settings.position == 'sticky-right') { return true; } return default_value; }); $(document).on('click', '.spu-box .spu-sticky-title, .spu-position-sticky-right .spu-close-popup, .spu-position-sticky-left .spu-close-popup', function (e) { $(this).closest('.spu-box').toggleClass('spu-sticky-open'); }); // Triggers window.wp.hooks.addAction('wppopups_trigger_popup', 'wppopups', WPPopupsPro.bindTriggers); }, /** * Bind popup open trigger * @param func_name * @param trigger_value * @param $popup */ bindTriggers: function bindTriggers(func_name, trigger_value, $popup) { if (typeof WPPopupsPro[func_name] == 'function') { WPPopupsPro[func_name](trigger_value, $popup); } }, /** * Trigger exit intent * @param value * @param $popup */ triggerByExit: function triggerByExit(value, $popup) { if (window.wppopups.isMobile()) { $(document).on('scroll', { value: value, popup: $popup }, WPPopupsPro.exitIntentMobile); } else { $(document.body).on('mouseleave', { value: value, popup: $popup }, WPPopupsPro.exitIntent); } }, /** * TRigger popup when element of class become visible * @param value * @param $popup */ triggerByVisible: function triggerByVisible(value, $popup) { // if not class provided abort if (value === '') { return; } $(window).bind('scroll', { value: value, popup: $popup }, WPPopupsPro.triggerVisible); }, /** * @param value * @param $popup */ triggerVisible: function triggerVisible(e) { var triggerClass = WPPopupsPro.cleanClass(e.data.value); // show box when criteria for this box is matched if ($(triggerClass).visible(true) && window.wppopups.checkConvertion(e.data.popup)) { // remove listen event if box shouldn't be hidden again $(window).unbind('scroll', WPPopupsPro.triggerVisible); window.wppopups.showPopup(e.data.popup); } }, /** * Function that check a classname and add . in front * @param classname */ cleanClass: function cleanClass(classname) { if (classname.indexOf('.') !== 0) { return '.' + classname; } return classname; }, /** * Callback for exit intent popup * @param e * @param $popup */ exitIntent: function exitIntent(e) { // Only trigger if leaving near the top of the page if (e.clientY > 20 || !window.wppopups.checkConvertion(e.data.popup)) { return; } window.wppopups.showPopup(e.data.popup); // we want to show it only once $(document.body).unbind('mouseleave', WPPopupsPro.exitIntent); }, /** * Callback for exit intent popup for Mobile * @param e * @param $popup */ exitIntentMobile: function exitIntentMobile(e) { if (!window.wppopups.checkConvertion(e.data.popup)) return; WPPopupsPro.scrollSpeed(); if (WPPopupsPro.delta < -200) window.wppopups.showPopup(e.data.popup); }, /** * Callback for calculate the speed scroll */ scrollSpeed: function scrollSpeed() { var new_position = window.scrollY; if (WPPopupsPro.last_position != null) WPPopupsPro.delta = new_position - WPPopupsPro.last_position; WPPopupsPro.last_position = new_position; clearTimeout(WPPopupsPro.timer); WPPopupsPro.timer = setTimeout(function () { WPPopupsPro.last_position = null; WPPopupsPro.delta = 0; }, 50); }, /** * Set cookie container user UUID. * */ setUserIndentifier: function setUserIndentifier() { if (wppopups_settings.uuid_cookie && !WPPopupsPro.getCookie('_wpfuuid')) { // Generate UUID - http://stackoverflow.com/a/873856/1489528 var s = new Array(36), hexDigits = '0123456789abcdef', uuid; for (var i = 0; i < 36; i++) { s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); } s[14] = "4"; s[19] = hexDigits.substr(s[19] & 0x3 | 0x8, 1); s[8] = s[13] = s[18] = s[23] = '-'; uuid = s.join(""); WPPopupsPro.createCookie('_wpfuuid', uuid, 3999); } }, /** * Track popup opening * @param event * @param id */ trackOpening: function trackOpening(event, id) { var $popup = window.wppopups.getPopup(id), settings = window.wppopups.settings($popup, 'settings'), sampling_active = wppopups_vars.dsampling || false, sampling_rate = wppopups_vars.dsamplingrate; var do_request = true; // don't track admins or test mode if (wppopups_vars.is_admin && settings.test_mode == '1') { return; } // only save when sampling is not active or lottery wins if (sampling_active && sampling_rate > 0) { var num = Math.floor(Math.random() * sampling_rate) + 1; do_request = 1 === num; } if (do_request) { // Make the ajax request to track the data. If using Google Analytics, send to GA, otherwise track locally. WPPopupsPro.trackGoogleAnalytics(id, false); var data = { action: 'track_wppopups', popup_id: id, conversion: false, post_id: wppopups_pro_vars.post_id }; var ajax = { url: wppopups_vars.ajax_url, data: data, cache: false, type: 'POST', dataType: 'json', timeout: 30000 }; $.ajax(ajax); } }, /** * Track in GA * @param popup_id * @param conversion */ trackGoogleAnalytics: function trackGoogleAnalytics(popup_id, conversion) { var $popup = window.wppopups.getPopup(popup_id), settings = window.wppopups.settings($popup, 'settings'), eventCategory = settings.ga_event_category || 'Popup Event', m_id = wppopups_pro_vars.m_id, eventLabel = settings.ga_event_label || 'wppopups-' + popup_id, eventIAction = settings.ga_event_action_impression || 'impression', eventCAction = settings.ga_event_action_conversion || 'conversion', eventAction = conversion ? eventCAction : eventIAction; if (!m_id) { return; } /* // Create a custom event tracker and dimensions if it has not been initialized. if ( ! WPPopupsPro.ga_init ) { if (typeof ga == 'function') { // create tracker ga('create', ga_id, 'auto', { 'name' : 'WPPopupsTracker' }); } //yoast analytics if (typeof __gaTracker == 'function') { //create tracker __gaTracker('create', ga_id, 'auto', { 'name' : 'WPPopupsTracker' }); } WPPopupsPro.ga_init = true; } // monster insights if (typeof __gaTracker == 'function') { // Send the event tracking data to Google Analytics. if( ga_id ) { __gaTracker('WPPopupsTracker.send', 'event', eventCategory, eventAction, eventLabel); } } else { if (typeof ga == 'function') { // Send the event tracking data to Google Analytics. ga('WPPopupsTracker.send', 'event', eventCategory, eventAction, eventLabel ); } }*/ // monster insights if (typeof __gtagTracker == 'function') { // new method as well if (m_id) { __gtagTracker('event', eventAction, { 'send_to': m_id, 'event_category': eventCategory, 'event_label': eventLabel }); } } else { if (typeof gtag == 'function' && m_id) { // Send the event tracking data to Google Universal Analytics. gtag('event', eventAction, { 'send_to': m_id, 'event_category': eventCategory, 'event_label': eventLabel }); } } }, /** * Track popup conversion * @param event * @param id */ trackConversion: function trackConversion(event, id) { var $popup = window.wppopups.getPopup(id), settings = window.wppopups.settings($popup, 'settings'); var do_request = true; // don't track admins or test mode if (wppopups_vars.is_admin && settings.test_mode == '1') { return; } // Make the ajax request to track the data. If using Google Analytics, send to GA, otherwise track locally. WPPopupsPro.trackGoogleAnalytics(id, true); var data = { action: 'track_wppopups', popup_id: id, conversion: true, post_id: wppopups_pro_vars.post_id }; var ajax = { url: wppopups_vars.ajax_url, data: data, cache: false, type: 'POST', dataType: 'json', timeout: 30000 }; $.ajax(ajax); }, /** * Run before the popup rules are checked */ beforeReady: function beforeReady() { var counter = WPPopupsPro.sessionCounter(); window.wp.hooks.addFilter('wppopups_pre_ready_data', 'wppopups', function (data) { data.visited_n_pages = counter; return data; }); // check if any popups has trigger by conversion $(".spu-box").each(function () { var $popup = $(this), $rules = window.wppopups.settings($popup, 'rules'); if (Object.keys($rules).length) { for (var group in $rules) { for (var rule in $rules[group]) { if ($rules[group][rule].rule == 'converted') { // add need-convert class $popup.addClass($rules[group][rule].operator == '==' ? 'yes-convert' : 'no-convert'); $popup.data('convert-id', $rules[group][rule].value); } // check if there is no need for ajax and we have a rule for n visited pages if ($rules[group][rule].rule == 'visited_n_pages' && !$popup.data('need_ajax')) { var operator = $rules[group][rule].operator; var show_popup = false; if (operator == "==") { show_popup = counter == $rules[group][rule].value; } else if (operator == "!=") { show_popup = !(counter == $rules[group][rule].value); } if (counter < $rules[group][rule].value && operator == "<") { show_popup = true; } if (counter > $rules[group][rule].value && operator == ">") { show_popup = true; } if (!show_popup) { $popup.remove(); } } } } } }); }, /** * Auto close trigger method * @param $popup */ triggerAutoClose: function triggerAutoClose($popup) { var settings = window.wppopups.settings($popup, 'settings'); // Seconds left to close ( autoclose timer ) if (settings.autoclose > 0 && typeof $popup.counter === 'undefined') { $popup.autoclose = settings.autoclose; $popup.counter = setInterval(function () { WPPopupsPro.autoClose($popup); }, 1000); } }, /** * Auto close function * @param $popup */ autoClose: function autoClose($popup) { var settings = window.wppopups.settings($popup, 'settings'); $popup.autoclose = $popup.autoclose - 1; if ($popup.autoclose <= 0) { clearInterval($popup.counter); $popup.counter = 'undefined'; $popup.autoclose = settings.autoclose; window.wppopups.hidePopup($popup, false); return; } $("#spu-" + $popup.data('id')).find('.spu-timer').html(wppopups_pro_vars.l18n.wait + " " + $popup.autoclose + " " + wppopups_pro_vars.l18n.seconds); }, /** * Move popup after post content * @param $popup */ afterContentPopups: function afterContentPopups($popup) { var settings = window.wppopups.settings($popup, 'position'); if (settings.position == 'after-post') { $('#spu-bg-' + $popup.data('id')).remove(); if ($('.spu-placeholder').length) { $('.spu-placeholder').append($popup); } else { $popup.remove(); } $('.spu-placeholder').show(); // remove advanced close for this popup WPPopupsPro.advancedClosePopups($popup, true); } }, /** * Disable advanced close method * @param $popup * @param force boolean */ advancedClosePopups: function advancedClosePopups($popup, force) { var settings = window.wppopups.settings($popup, 'settings'); // if popup has disabled advanced close or we are forcing ir (after content if (settings.advanced_close == '1' || force) { window.wp.hooks.addFilter('wppopups_allow_togglePopups', 'wppopups', function (default_value, popup) { // if event fired popup id is equal to our popup, cancel it if (popup.data('id') == $popup.data('id')) { return false; } return default_value; }); } }, /** * Disabel page scroll if needed * @param $popup */ disablePageScroll: function disablePageScroll($popup) { var settings = window.wppopups.settings($popup, 'settings'); if (settings.disable_scroll && settings.disable_scroll == '1') { $('body,html').css('overflow', 'hidden'); } }, /** * Disabel page scroll if needed * @param $popup */ enablePageScroll: function enablePageScroll($popup) { var settings = window.wppopups.settings($popup, 'settings'); if (settings.disable_scroll && settings.disable_scroll == '1') { $('body,html').css('overflow', ''); } }, /** * Trigger premium animations on the popup * @param $popup */ triggerShowAnimations: function triggerShowAnimations($popup) { var animation = window.wppopups.settings($popup, 'animation'); var $class_name = ''; switch (animation.animation) { case 'fade': break; case 'slide': break; case 'disable': break; default: $class_name = 'spu-animation-' + animation.animation; break; } if ($class_name !== '') { $popup.addClass($class_name).addClass('spu-animation-animated'); } }, /** * Show a sticky popup * @param $popup */ stickyPopup: function stickyPopup($popup) { var settings = window.wppopups.settings($popup, 'position'); if (settings.position != 'sticky-left' && settings.position != 'sticky-right') return; var sticky_title = $popup.find('.spu-sticky-title'); $('#spu-bg-' + $popup.data('id')).remove(); sticky_title.show(); var popupHeight = $popup.outerHeight(), titleHeight = $popup.find('.spu-sticky-title').outerHeight(); $popup.css({ "bottom": "-" + (popupHeight - titleHeight) + "px" }); }, /** * Check if user visited the page before and remove popup if not */ sessionCounter: function sessionCounter() { var counter = sessionStorage.getItem('wppopups_visited_page') || 0; var new_value = parseInt(counter) + 1; // if we have a counter and matches the number of the rule update popup sessionStorage.setItem('wppopups_visited_page', new_value); return new_value; }, /** * Move popup to top/bottom if needed * @param $popup */ pushContentPopups: function pushContentPopups($popup) { var settings = window.wppopups.settings($popup, 'position'); if (settings.position == 'top-bar' && settings.push_content == '1') { $popup.prependTo('body'); } } }; // Initialize. WPPopupsPro.init(); // Add to global scope. window.wppopups_pro = WPPopupsPro; })(jQuery);;