PageSourceSearch

https://bobandrosemary.com/wp-content/plugins/op-builder/public/as…&ver=146721ad0ef096bc0de80fb87e48922a

js bobandrosemary.com collected 2026-10-04 19:40:05 UTC 17,023 bytes, 55 lines download raw bytes

1/**
2 * DOMContentLoaded Event Deferral Helper
3 * 
4 * Intercepts DOMContentLoaded event listeners and automatically wraps their
5 * callbacks with requestAnimationFrame to prevent forced synchronous layouts
6 * (reflows) that negatively impact page performance metrics.
7 * 
8 * This approach maintains full backward compatibility while deferring layout-
9 * triggering operations (offsetHeight, getComputedStyle, etc.) until the next
10 * animation frame, allowing the browser to optimize rendering.
11 * 
12 * @see https://web.dev/avoid-large-complex-layouts-and-layout-thrashing/
13 */
14(function() {
15    'use strict';
16    
17    var originalAddEventListener = document.addEventListener;
18    var isDOMReady = document.readyState === 'complete' || document.readyState === 'interactive';
19    
20    /**
21     * Intercept document.addEventListener to defer DOMContentLoaded callbacks
22     * 
23     * @param {string} event - Event name
24     * @param {Function} callback - Event callback
25     * @param {Object|boolean} options - Event listener options
26     */
27    document.addEventListener = function(event, callback, options) {
28        if (event === 'DOMContentLoaded' && typeof callback === 'function') {
29            var deferredCallback = function(e) {
30                requestAnimationFrame(function() {
31                    callback.call(this, e);
32                }.bind(this));
33            };
34            
35            if (isDOMReady) {
36                // DOM already loaded, execute immediately but deferred
37                requestAnimationFrame(function() {
38                    callback.call(document, new Event('DOMContentLoaded'));
39                });
40            } else {
41                originalAddEventListener.call(document, event, deferredCallback, options);
42            }
43        } else {
44            originalAddEventListener.call(document, event, callback, options);
45        }
46    };
47    
48    // Track when DOM becomes ready
49    if (!isDOMReady) {
50        originalAddEventListener.call(document, 'DOMContentLoaded', function() {
51            isDOMReady = true;
52        });
53    }
54})();
55document.addEventListener("DOMContentLoaded",function(e){var n=window.location.search.slice(1).split("&").map(function(e){for(var n=e.split("=");n.length<2;)n.push("");return[n[0],e=n.slice(1).join("=")]}).reduce(function(e,n){var t=n.map(decodeURIComponent),o=t[0],a=t[1],i=o in e;return i&&"string"==typeof e[o]?e[o]=[e[o],a]:i?e[o].push(a):e[o]=a,e},{}),t="";for(var o in n)o&&(t+=(t?",":"")+'.op3-element [data-op-url-mapping="'+o+'"]:not(:disabled):not(input:read-only)');t&&document.querySelectorAll(t).forEach(function(e){var t=e.getAttribute("data-op-url-mapping"),o=n[t];e.matches("select")?e.querySelector('option[value="'+o+'"]')&&(e.value=o):e.matches('input[type="checkbox"],input[type="radio"]')?e.checked=-1===["false","unchecked","none","0",""].indexOf(o):e.value=o})});!function(e,t){"use strict";var o=function(){if(!(this instanceof o))throw"OP3_Cookie: OP3_Cookie is a constructor."};o.prototype={_defaults:{expires:null,"max-age":null,domain:null,path:"/",secure:null,samesite:null},_encodeKey:function(e){return e.replace(/[^\x10-\x7E]+/g,"").replace(/[\x20\(\)<>@,;:\\"\/\[\]\?={}]+/g,"")},_encodeValue:function(e){return encodeURIComponent(e)},_decodeValue:function(e){return decodeURIComponent(e)},get:function(e){var t=this.toObject();return e in t?t[e]:null},set:function(e,o,i){if(void 0!==e&&""!==e){if(e=this._encodeKey(e),o=this._encodeValue(o),!e||!o)throw"OP3.Cookie: key/value arguments are mandatory.";for(var n in i=i||{}){var r=i[n];delete i[n],i[n.toLowerCase()]=r}for(var n in this._defaults)n in i||(i[n]=this._defaults[n]);if(i.expires){if(!isNaN(1*i.expires)){var s=new Date;s.setTime(s.getTime()+24*i.expires*60*60*1e3),i.expires=s}i.expires instanceof Date&&(i.expires=i.expires.toUTCString())}var a="";for(var n in i)null!==i[n]&&!1!==i[n]&&(a+=";"+n,!0!==i[n]&&(a+="="+i[n]));t.cookie=e+"="+o+a}},del:function(e){this.set(e,"0",{expires:-1})},toObject:function(){var e={};return(t.cookie?t.cookie.split("; "):[]).forEach(function(t){var o=t.split("="),i=o[0],n=o.slice(1).join("=");n=(n=this._decodeValue(n)).replace(/^"(.*)"$/,"$1"),e[i]=n}.bind(this)),e}},o.prototype.constructor=o,e.OP3=e.OP3||{},e.OP3.Cookie=new o}(window,document);!function(e,t){"use strict";var n=function(t){if(!(this instanceof n))throw"OP3_PopOverlay: OP3_PopOverlay is a constructor.";if(t=t||e,"[object Window]"!==Object.prototype.toString.call(t))throw"OP3_PopOverlay: parent argument must be of type Window.";this._init(t)};n.prototype={constructor:n,_init:function(e){this._parent=e,this._wrapper=null,this._wrappers=null,this._elements=null,this._current=null,this._focusablesSelector='a[href]:not([tabindex="-1"]),button:not([disabled]):not([tabindex="-1"]),input:not([disabled]):not([tabindex="-1"]),select:not([disabled]):not([tabindex="-1"]),textarea:not([disabled]):not([tabindex="-1"]),[tabindex]:not
55([tabindex="-1"])',this._lastFocused=null,this._openKeydownHandler=null,this._focusInHandler=null,this._boundHandleLoad=this._handleLoad.bind(this),this._boundHandleExitIntent=this._handleExitIntent.bind(this),this._boundHandleClick=this._handleClick.bind(this),this.parent.addEventListener("load",this._boundHandleLoad),this.parent.document.addEventListener("exitintent",this._boundHandleExitIntent),this.parent.document.body.addEventListener("click",this._boundHandleClick),this.refresh()},destroy:function(){this.clearElements(),this.parent.document.body.removeEventListener("click",this._boundHandleClick),this.parent.document.removeEventListener("exitintent",this._boundHandleExitIntent),this.parent.removeEventListener("load",this._boundHandleLoad),delete this._boundHandleClick,delete this._boundHandleExitIntent,delete this._boundHandleLoad,delete this._current,delete this._elements,delete this._wrappers,delete this._wrapper,delete this._parent},get parent(){return this._parent},set parent(e){if(this.parent!==e){if("[object Window]"!==Object.prototype.toString.call(e))throw"OP3_PopOverlay: parent property must be of type Window.";this.destroy(),this._init(e)}},get wrapper(){return this._wrapper||(this._wrappers=Array.from(this.parent.document.querySelectorAll(".op3-designer-element--content, .op3-designer-element--header, .op3-designer-element--footer, .op3-designer-element--layout")),this._wrapper=this._wrappers.length>0?this._wrappers[0]:null),this._wrapper},get wrappers(){return this._wrappers||(this._wrappers=Array.from(this.parent.document.querySelectorAll(".op3-designer-element--content, .op3-designer-element--header, .op3-designer-element--footer, .op3-designer-element--layout")),this._wrapper=this._wrappers.length>0?this._wrappers[0]:null),this._wrappers},get current(){return this._current},refresh:function(){this.clearElements(),this.wrappers.forEach(function(e){e.querySelectorAll('.op3-element[data-op3-element-type="popoverlay"]').forEach(function(e){this.addElement(e)}.bind(this))}.bind(this))},clearElements:function(){this._elements&&Object.keys(this._elements).map(function(e){return this._elements[e]}.bind(this)).forEach(function(e){e.interval&&this.parent.clearInterval(e.interval),this._teardownA11yHandlers(e)}.bind(this)),this._elements={}},addElement:function(e){var t=this._getElementConfig(e);if(t){var n=t.index;Object.keys(this._elements).map(function(e){return this._elements[e]}.bind(this)).filter(function(e){return e.index>=n}).forEach(function(e){e.index++}),this._elements[t.uuid]=t}},removeElement:function(e){var t=this._getElementConfig(e);if(t){var n=this.current,i=t.uuid,o=t.index,r=t.interval;n===i&&this.close(),r&&this.parent.clearInterval(r),delete this._elements[i],Object.keys(this._elements).map(function(e){return this._elements[e]}.bind(this)).filter(function(e){return e.index>=o}).forEach(function(e){e.index--})}},refreshElement:function(e){var t=this._getElementConfig(e);t&&(this._elements[t.uuid]=this._getElementConfig(e,!0))},getConfig:function(e){return e in this._elements?this._elements[e]:null},open:function(e,t){if(this.current)return this._call(t,null);var n=this._elements[e];if(!n)return this._call(t,null);this._modalShow(n,t)},close:function(e){var t=this.current;t?this._modalHide(this._elements[t],e):this._call(e,null)},_isDevice:!!(navigator.maxTouchPoints||"ontouchstart"in t.documentElement),_call:function(e){if("function"==typeof e){var t=Array.prototype.slice.call(arguments,1);e.apply(this,t)}},_trigger:function(e,t,n){var i=new CustomEvent("op3popoverlay"+t,n||{});return e.dispatchEvent(i),i},_getElementConfig:function(t,n){if(!n){var i=t.getAttribute("data-op3-uuid"),o=this.getConfig(i);if(o)return o}var r=t.querySelector(".op3-popoverlay-content"),a=t.querySelector(".op3-popoverlay-controls"),s=t.querySelectorAll('[data-op3-element-type="video"] iframe, [data-op3-element-type="video"] video'),l=t.querySelectorAll('[data-op3-element-type="soundcloud"] iframe'),d=[];this.wrappers.forEach(function(e){var t=Array.prototype.slice.call(e.querySelectorAll('.op3-element[data-op3-element-type="popoverlay"]'));d=d.concat(t)});var c,p=d.indexOf(t),u=t.getAttribute("data-op3-uuid"),h=r.getAttribute("data-op3-text"),v=r.getAttribute("data-op-animation"),f=r.getAttribute("data-op-animation-trigger")||"none",m=!!(1*r.getAttribute("data-op3-use-on-devices")),_=0,y=1*r.getAttribute("data-op3-cookie-expires")||0;t.className=t.className.replace(/(^|\s)op3-popoverlay-effect-\S+/g," ").replace(/\s+/g," ").trim(),t.className+=(t.className?" ":"")+"op3-popoverlay-effect-"+v;var b=e.getComputedStyle(r);c=parseFloat(b.getPropertyValue("animation-duration"))||parseFloat(b.getPropertyValue("transition-duration"))||0;var g=r.getAttribute("data-op-timer")||"0sec";g&&g.indexOf("sec")>-1?_=1e3*parseInt(g,10):g&&g.indexOf("min")>-1&&(_=1e3*parseInt(g,10)*60);var E=t.querySelector(".op3-popoverlay-wrapper"),w=t.querySelector(".op3-popoverlay-background"),A=t.querySelector(".op3-popoverlay-title"),k=t.querySelector(".op3-popoverlay-desc"),x=t.querySelector(".op3-popoverlay-close"),H=A?A.id||"op3-pop-title-"+u:null;A&&!A.id&&(A.id=H);var L=k?k.id||"op3-pop-desc-"+u:null;return k&&!k.id&&(k.id=L),E&&(E.setAttribute("role","dialog"),E.setAttribute("aria-modal","true"),H&&E.setAttribute("aria-labelledby",H),L&&E.setAttribute("aria-describedby",L),E.setAttribute("tabindex","-1")),{element:t,content:r,controls:a,videoElements:s,soundcloudElements:l,interval:null,index:
55p,uuid:u,name:h,animationStyle:v,animationDuration:c,triggerEvent:f,useOnDevices:m,delayTimer:_,cookieExpires:y,dialogEl:E,backdropEl:w,titleEl:A,descEl:k,closeEl:x}},_setupA11yHandlers:function(e){var n=this,i=e.dialogEl,o=e.backdropEl;this._lastFocused=t.activeElement,o&&(e._backdropClick=function(){n.close()},o.addEventListener("click",e._backdropClick)),this._openKeydownHandler=function(e){if(i)if("Escape"===e.key)e.preventDefault(),n.close();else if("Tab"===e.key){var o=Array.from(i.querySelectorAll(n._focusablesSelector)).filter(function(e){return null!==e.offsetParent||e===i});if(0===o.length)return e.preventDefault(),void i.focus();var r=o[0],a=o[o.length-1];e.shiftKey&&t.activeElement===r?(e.preventDefault(),a.focus()):e.shiftKey||t.activeElement!==a||(e.preventDefault(),r.focus())}},t.addEventListener("keydown",this._openKeydownHandler,!0),this._focusInHandler=function(e){i&&(i.contains(e.target)||((i.querySelectorAll(n._focusablesSelector)[0]||i).focus(),e.stopPropagation()))},t.addEventListener("focusin",this._focusInHandler,!0),e.closeEl&&"A"===e.closeEl.tagName&&(e.closeEl.setAttribute("role","button"),e._closeKeyHandler=function(e){" "!==e.key&&"Enter"!==e.key||(e.preventDefault(),n.close())},e.closeEl.addEventListener("keydown",e._closeKeyHandler)),i&&i.focus(),t.body.style.overflow="hidden"},_teardownA11yHandlers:function(e){var n=e.backdropEl;this._openKeydownHandler&&(t.removeEventListener("keydown",this._openKeydownHandler,!0),this._openKeydownHandler=null),this._focusInHandler&&(t.removeEventListener("focusin",this._focusInHandler,!0),this._focusInHandler=null),n&&e._backdropClick&&(n.removeEventListener("click",e._backdropClick),n.setAttribute("aria-hidden","true"),n.hidden=!0,delete e._backdropClick),e.closeEl&&e._closeKeyHandler&&(e.closeEl.removeEventListener("keydown",e._closeKeyHandler),delete e._closeKeyHandler),this._lastFocused&&"function"==typeof this._lastFocused.focus&&this._lastFocused.focus(),this._lastFocused=null,t.body.style.overflow=""},_modalShow:function(e,t){var n=e.element,i=this.wrapper,o=function(i){i&&i.target!==e.content||(i&&(i.target.removeEventListener("transitionend",o),i.target.removeEventListener("animationend",o)),e.dialogEl&&(e.dialogEl.setAttribute("aria-modal","true"),e.dialogEl.removeAttribute("aria-hidden")),this._setupA11yHandlers(e),this._trigger(n,"open",{bubbles:!0,detail:{config:e}}),this._call(t,e))}.bind(this);this._current=e.uuid,i&&i.classList.add("op3-popoverlay-active"),n.classList.remove("op3-popoverlay-hide"),n.classList.remove("op3-popoverlay-show"),n.style.display="block",e.backdropEl&&(e.backdropEl.removeAttribute("aria-hidden"),e.backdropEl.hidden=!1),n.offsetHeight,n.classList.add("op3-popoverlay-show"),e.animationDuration&&n.parentElement?(e.content.addEventListener("transitionend",o),e.content.addEventListener("animationend",o)):o(),this._videoStart(),this._soundcloudStart()},_modalHide:function(e,t){var n=e.element,i=this.wrapper,o=function(r){r&&r.target!==e.content||(r&&(r.target.removeEventListener("transitionend",o),r.target.removeEventListener("animationend",o)),e.dialogEl&&e.dialogEl.setAttribute("aria-hidden","true"),this._teardownA11yHandlers(e),this._current=null,i&&i.classList.remove("op3-popoverlay-active"),n.classList.remove("op3-popoverlay-show"),n.style.display="none",this._trigger(n,"close",{bubbles:!0,detail:{config:e}}),this._call(t,e))}.bind(this);e.interval&&(this.parent.clearInterval(e.interval),e.interval=null),n.classList.remove("op3-popoverlay-show"),n.classList.add("op3-popoverlay-hide"),e.animationDuration&&n.parentElement?(e.content.addEventListener("transitionend",o),e.content.addEventListener("animationend",o)):o(),this._videoStop(),this._soundcloudStop()},_popup:function(e){var t="op3-popoverlay-"+OP3.Meta.pageId+"-"+e.uuid;OP3.Cookie.get(t)||(e.cookieExpires&&OP3.Cookie.set(t,"1",{expires:e.cookieExpires}),this.open(e.uuid))},_videoStart:function(){this.getConfig(this.current).videoElements.forEach(function(e){if(!e.matches("[data-embed-video-facade-src]")){var t=e.closest(".op3-video-wrapper"),n=e.getAttribute("src"),i=t.getAttribute("data-op3-src");if(!n&&i&&e.setAttribute("src",i),t.matches('[data-op3-video-autoplay="1"]')){var o=t.closest(".op3-element").querySelector(".op3-video-image-overlay");o&&(o.style.display="none")}}})},_videoStop:function(){this.getConfig(this.current).videoElements.forEac
55h(function(e){if(!e.matches("[data-embed-video-facade-src]")){var t=e.closest(".op3-video-wrapper"),n=e.getAttribute("src"),i=t.getAttribute("data-op3-src");"embed"===t.getAttribute("data-op3-video-source")&&t.setAttribute("data-op3-src",n),i&&e.setAttribute("src","")}})},_soundcloudStart:function(){this.getConfig(this.current).soundcloudElements.forEach(function(e){var t=e.getAttribute("src"),n=e.getAttribute("data-op3-src");t&&e.setAttribute("data-op3-src",t),!t&&n&&e.setAttribute("src",n)})},_soundcloudStop:function(){this.getConfig(this.current).soundcloudElements.forEach(function(e){e.setAttribute("src","")})},_handleLoad:function(e){Object.keys(this._elements).map(function(e){return this._elements[e]}.bind(this)).filter(function(e){var t=e.triggerEvent;return"load"===t||"load_delay"===t||"exitintent"===t&&this._isDevice&&e.useOnDevices}.bind(this)).forEach(function(e){var t=e.triggerEvent,n=e.useOnDevices,i="exitintent"!==t?e.delayTimer:0;n&&this._isDevice&&"exitintent"===t&&e.delayTimer>0&&(i=e.delayTimer),e.interval=this.parent.setTimeout(this._popup.bind(this,e),i)}.bind(this))},_handleExitIntent:function(e){Object.keys(this._elements).map(function(e){return this._elements[e]}.bind(this)).filter(function(e){return"exitintent"===e.triggerEvent&&!this._isDevice}.bind(this)).forEach(function(e){var t="exitintent"!==e.triggerEvent?e.delayTimer:0;e.interval=this.parent.setTimeout(this._popup.bind(this,e),t)}.bind(this))},_handleClick:function(e){e.target.closest('[data-op3-action="popoverlay"],[data-op-action="popoverlay"]')&&this._handleClickOpen(e),e.target.closest('.op3-popoverlay-background,.op3-popoverlay-close,[data-op-action="closePopoverlay"]')&&this._handleClickClose(e)},_handleClickOpen:function(e){e.preventDefault();var t=e.target.closest('[data-op3-action="popoverlay"],[data-op-action="popoverlay"]'),n=t.getAttribute("data-op-popoverlay-trigger")||t.getAttribute("data-op3-popoverlay-trigger");this._elements[n]&&this.close(function(){this.open(n)}.bind(this))},_handleClickClose:function(e){e.preventDefault();var t=e.target.closest('[data-op3-element-type="popoverlay"]');t&&(t.getAttribute("data-op3-uuid")===this.current&&this.close())}},e.OP3=e.OP3||{}
55,OP3.PopOverlay=new n}(window,document);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.