1 line
19 KiB
JavaScript
Executable File
1 line
19 KiB
JavaScript
Executable File
!function a(n,i,r){function o(t,e){if(!i[t]){if(!n[t]){var l="function"==typeof require&&require;if(!e&&l)return l(t,!0);if(s)return s(t,!0);throw(l=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",l}l=i[t]={exports:{}},n[t][0].call(l.exports,function(e){return o(n[t][1][e]||e)},l,l.exports,a,n,i,r)}return i[t].exports}for(var s="function"==typeof require&&require,e=0;e<r.length;e++)o(r[e]);return o}({1:[function(e,t,l){"use strict";Object.defineProperty(l,"__esModule",{value:!0}),l.options=void 0;var a=oceanwpLocalize;l.options=a},{}],2:[function(e,t,l){"use strict";var a=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(l,"__esModule",{value:!0}),l.fadeOutNav=l.fadeInNav=l.isSelectorValid=l.isElement=l.getSiblings=l.visible=l.offset=l.fadeToggle=l.fadeOut=l.fadeIn=l.slideToggle=l.slideUp=l.slideDown=l.wrap=void 0;var n=a(e("@babel/runtime/helpers/typeof"));l.wrap=function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:document.createElement("div");return e.nextSibling?e.parentNode.insertBefore(t,e.nextSibling):e.parentNode.appendChild(t),t.appendChild(e)};function i(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:300,l=window.getComputedStyle(e).display;"none"===l&&(l="block"),e.style.transitionProperty="height",e.style.transitionDuration="".concat(t,"ms"),e.style.opacity=0,e.style.display=l;var a=e.offsetHeight;e.style.height=0,e.style.opacity=1,e.style.overflow="hidden",setTimeout(function(){e.style.height="".concat(a,"px")},5),window.setTimeout(function(){e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property"),e.style.removeProperty("opacity")},t+50)}l.slideDown=i;function r(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:300;e.style.boxSizing="border-box",e.style.transitionProperty="height, margin",e.style.transitionDuration="".concat(t,"ms"),e.style.height="".concat(e.offsetHeight,"px"),e.style.marginTop=0,e.style.marginBottom=0,e.style.overflow="hidden",setTimeout(function(){e.style.height=0},5),window.setTimeout(function(){e.style.display="none",e.style.removeProperty("height"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property")},t+50)}l.slideUp=r;l.slideToggle=function(e,t){("none"===window.getComputedStyle(e).display?i:r)(e,t)};function o(e){var t={duration:300,display:null,opacity:1,callback:null};Object.assign(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}),e.style.opacity=0,e.style.display=t.display||"block",setTimeout(function(){e.style.transition="".concat(t.duration,"ms opacity ease"),e.style.opacity=t.opacity},5),setTimeout(function(){e.style.removeProperty("transition"),t.callback&&t.callback()},t.duration+50)}l.fadeIn=o;function s(e){var t;"none"!==e.style.display&&(t={duration:300,display:null,opacity:0,callback:null},Object.assign(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}),e.style.opacity=1,e.style.display=t.display||"block",setTimeout(function(){e.style.transition="".concat(t.duration,"ms opacity ease"),e.style.opacity=t.opacity},5),setTimeout(function(){e.style.display="none",e.style.removeProperty("transition"),t.callback&&t.callback()},t.duration+50))}l.fadeOut=s;l.fadeToggle=function(e,t){("none"===window.getComputedStyle(e).display?o:s)(e,t)};l.offset=function(e){if(!e.getClientRects().length)return{top:0,left:0};var t=e.getBoundingClientRect(),e=e.ownerDocument.defaultView;return{top:t.top+e.pageYOffset,left:t.left+e.pageXOffset}};l.visible=function(e){return!!e&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)};l.getSiblings=function(e){var t=[];if(!e.parentNode)return t;for(var l=e.parentNode.firstChild;l;)1===l.nodeType&&l!==e&&t.push(l),l=l.nextSibling;return t};l.isElement=function(e){return"object"===("undefined"==typeof HTMLElement?"undefined":(0,n.default)(HTMLElement))?e instanceof HTMLElement:e&&"object"===(0,n.default)(e)&&null!==e&&1===e.nodeType&&"string"==typeof e.nodeName};var u,e=(u=document.createDocumentFragment(),function(e){try{u.querySelector(e)}catch(e){return!1}return!0});l.isSelectorValid=e;l.fadeInNav=function(e){var t={duration:300,visibility:"visible",opacity:1,callback:null};Object.assign(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}),e.style.opacity=0,e.style.visibility=t.visibility||"visible",setTimeout(function(){e.style.transition="".concat(t.duration,"ms opacity ease"),e.style.opacity=t.opacity},5)};l.fadeOutNav=function(e){var t;"hidden"!==e.style.visibility&&(t={duration:300,visibility:"hidden",opacity:0,callback:null},Object.assign(t,1<arguments.length&&void 0!==arguments[1]?arguments[1]:{}),e.style.opacity=1,e.style.visibility=t.visibility||"visible",setTimeout(function(){e.style.transition="".concat(t.duration,"ms opacity ease"),e.style.opacity=t.opacity},5),setTimeout(function(){e.style.visibility="hidden",e.style.removeProperty("transition"),t.callback&&t.callback()},t.duration+50))}},{"@babel/runtime/helpers/interopRequireDefault":15,"@babel/runtime/helpers/typeof":16}],3:[function(e,t,l){"use strict";var a=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(l,"__esModule",{value:!0}),l.default=void 0;var n=a(e("@babel/runtime/helpers/defineProperty")),i=a(e("@babel/runtime/helpers/classCallCheck")),r=a(e("@babel/runtime/helpers/classPrivateFieldSet")),o=a(e("@babel/runtime/helpers/classPrivateFieldGet"));function s(t,e){var l,a=Object.keys(t);return Object.getOwnPropertySymbols&&(l=Object.getOwnPropertySymbols(t),e&&(l=l.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),a.push.apply(a,l)),a}function u(t){for(var e=1;e<arguments.length;e++){var l=null!=arguments[e]?arguments[e]:{};e%2?s(Object(l),!0).forEach(function(e){(0,n.default)(t,e,l[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(l)):s(Object(l)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(l,e))})}return t}var c=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,y=new WeakMap,b=new WeakMap,m=new WeakMap,h=new WeakMap;l.default=function e(){var l=this;(0,i.default)(this,e),c.set(this,{writable:!0,value:{mainSection:document.querySelector("#main")}}),d.set(this,{writable:!0,value:null}),f.set(this,{writable:!0,value:function(){(0,r.default)(l,c,u(u({},(0,o.default)(l,c)),{},{WPAdminbar:document.querySelector("#wpadminbar"),siteFooter:document.querySelector("#footer"),calloutFooter:document.querySelector("#footer-callout-wrap"),footerBar:document.querySelector("#footer-bar"),parallax:document.querySelector(".parallax-footer"),html:document.querySelector("html"),body:document.body,wrapSection:document.querySelector("#wrap")}))}}),p.set(this,{writable:!0,value:function(){window.addEventListener("load",(0,o.default)(l,y)),window.addEventListener("resize",(0,o.default)(l,b))}}),y.set(this,{writable:!0,value:function(e){(0,o.default)(l,m).call(l),(0,o.default)(l,h).call(l)}}),b.set(this,{writable:!0,value:function(e){(0,o.default)(l,m).call(l),(0,o.default)(l,h).call(l)}}),m.set(this,{writable:!0,value:function(){var e,t;document.body.classList.contains("has-fixed-footer")&&(e=null!==(t=null===(e=(0,o.default)(l,c).WPAdminbar)||void 0===e?void 0:e.offsetHeight)&&void 0!==t?t:0,t=null!==(t=null===(t=(0,o.default)(l,c).footerBar)||void 0===t?void 0:t.offsetHeight)&&void 0!==t?t:0,(0,o.default)(l,c).html.offsetHeight-e<window.innerHeight?((0,o.default)(l,c).wrapSection.style.cssText="\n display: flex;\n flex-direction: column;\n min-height: calc(100vh - ".concat(e,"px - ").concat(t,"px);\n "),(0,o.default)(l,c).calloutFooter?(0,o.default)(l,c).calloutFooter.style.marginTop="auto":(0,o.default)(l,c).siteFooter&&((0,o.default)(l,c).siteFooter.style.marginTop="auto"),(0,r.default)(l,d,"changed")):"changed"===(0,o.default)(l,d)&&(((0,o.default)(l,c).wrapSection.style.cssText="",o.default)(l,c).calloutFooter?(0,o.default)(l,c).calloutFooter.style.marginTop=null:(0,o.default)(l,c).siteFooter.style.marginTop=null,(0,r.default)(l,d,null)))}}),h.set(this,{writable:!0,value:function(){(0,o.default)(l,c).body.classList.contains("has-parallax-footer")&&setTimeout(function(){var e,t=0;t+=null===(e=(0,o.default)(l,c).parallax)||void 0===e?void 0:e.offsetHeight,(0,o.default)(l,c).calloutFooter&&((0,o.default)(l,c).calloutFooter.style.bottom="".concat(t,"px"),t+=(0,o.default)(l,c).calloutFooter.offsetHeight),(0,o.default)(l,c).mainSection.style.marginBottom="".concat(t,"px")},10)}}),(0,o.default)(this,c).mainSection&&((0,o.default)(this,f).call(this),(0,o.default)(this,p).call(this))}},{"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/classPrivateFieldGet":12,"@babel/runtime/helpers/classPrivateFieldSet":13,"@babel/runtime/helpers/defineProperty":14,"@babel/runtime/helpers/interopRequireDefault":15}],4:[function(e,t,l){"use strict";var a=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(l,"__esModule",{value:!0}),l.default=void 0;var n=a(e("@babel/runtime/helpers/classCallCheck")),i=a(e("@babel/runtime/helpers/classPrivateFieldSet")),r=a(e("@babel/runtime/helpers/classPrivateFieldGet")),o=e("../../constants"),s=e("../../lib/utils"),u=new WeakMap,c=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,y=new WeakMap,b=new WeakMap;l.default=function e(){var a=this;(0,n.default)(this,e),u.set(this,{writable:!0,value:void 0}),c.set(this,{writable:!0,value:function(){(0,i.default)(a,u,{menuContents:document.querySelectorAll(".navigation .megamenu-li.auto-mega .megamenu"),menuItems:document.querySelectorAll("#site-navigation .megamenu-li.full-mega"),topbarMenuItems:document.querySelectorAll("#top-bar-nav .megamenu-li.full-mega"),header:document.querySelector("#site-header"),topbar:document.querySelector("#top-bar"),body:document.body})}}),d.set(this,{writable:!0,value:function(){(0,r.default)(a,u).menuContents.forEach(function(e){var t,l=e.parentNode,a=(0,s.offset)(l).left,n=parseInt(window.getComputedStyle(e).width),i=a-n/2<0?(t=a-10,0):(t=n/2,l.offsetWidth/2);o.options.isRTL?(e.style.right="-".concat(t,"px"),e.style.marginRight="".concat(i,"px")):(e.style.left="-".concat(t,"px"),e.style.marginLeft="".concat(i,"px")),window.innerWidth-a-t+i+n<0&&(e.style.left="auto",e.style.right="-".concat(window.innerWidth-a-l.offsetWidth-10,"px"))})}}),f.set(this,{writable:!0,value:function(){(0,r.default)(a,u).menuItems.forEach(function(e){e.addEventListener("mouseenter",(0,r.default)(a,p)),e.addEventListener("keydown",(0,r.default)(a,p))}),(0,r.default)(a,u).topbarMenuItems.forEach(function(e){e.addEventListener("mouseenter",(0,r.default)(a,y)),e.addEventListener("keydown",(0,r.default)(a,y))})}}),p.set(this,{writable:!0,value:function(e){var t=(0,r.default)(a,u).header.classList.contains("medium-header")?document.querySelector("#site-navigation-wrap > .container"):document.querySelector("#site-header-inner");(0,r.default)(a,b).call(a,t,e)}}),y.set(this,{writable:!0,value:function(e){var t=(0,r.default)(a,u).topbar;(0,r.default)(a,b).call(a,t,e)}}),b.set(this,{writable:!0,value:function(e,t){var l=t.currentTarget,t=l.querySelector(".megamenu"),l=parseInt((0,s.offset)(l).left-(0,s.offset)(e).left+1);t&&((0,r.default)(a,u).body.classList.contains("boxed-layout")&&(l-=30),t.style.left="-".concat(l,"px"),t.style.width="".concat(e.offsetWidth,"px"))}}),(0,r.default)(this,c).call(this),(0,r.default)(this,d).call(this),(0,r.default)(this,f).call(this)}},{"../../constants":1,"../../lib/utils":2,"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/classPrivateFieldGet":12,"@babel/runtime/helpers/classPrivateFieldSet":13,"@babel/runtime/helpers/interopRequireDefault":15}],5:[function(e,t,l){"use strict";var a=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(l,"__esModule",{value:!0}),l.default=void 0;var n=a(e("@babel/runtime/helpers/classCallCheck")),i=a(e("@babel/runtime/helpers/classPrivateFieldSet")),o=a(e("@babel/runtime/helpers/classPrivateFieldGet")),s=e("../../lib/utils"),u=new WeakMap,c=new WeakMap,d=new WeakMap,f=new WeakMap,p=new WeakMap,y=new WeakMap,b=new WeakMap,m=new WeakMap;l.default=function e(){var r=this;(0,n.default)(this,e),u.set(this,{writable:!0,value:void 0}),c.set(this,{writable:!0,value:function(){document.querySelectorAll("li.nav-no-click > a").forEach(function(e){e.addEventListener("click",(0,o.default)(r,d))}),document.querySelectorAll("ul.sf-menu").forEach(function(e){e.querySelectorAll(".menu-item-has-children").forEach(function(e){e.addEventListener("mouseover",(0,o.default)(r,f)),e.addEventListener("mouseout",(0,o.default)(r,p)),e.addEventListener("keydown",(0,o.default)(r,y))})})}}),d.set(this,{writable:!0,value:function(e){e.preventDefault(),e.stopPropagation()}}),f.set(this,{writable:!0,value:function(e){(0,o.default)(r,u)&&(0,o.default)(r,u).contains(e.relatedTarget)||((0,i.default)(r,u,e.currentTarget),(0,o.default)(r,b).call(r,(0,o.default)(r,u)))}}),p.set(this,{writable:!0,value:function(e){(0,o.default)(r,u)&&!(0,o.default)(r,u).contains(e.relatedTarget)&&((0,o.default)(r,m).call(r,(0,o.default)(r,u)),(0,i.default)(r,u,null))}}),y.set(this,{writable:!0,value:function(e){var t,l,a,n,i;(0,o.default)(r,u)&&(0,o.default)(r,u).contains(e.relatedTarget)||(t=9===e.keyCode,!(l=e.shiftKey)&&t&&(0,o.default)(r,f).call(r,e),(0,o.default)(r,u)&&(a=(i=(0,o.default)(r,u).querySelectorAll("ul.sub-menu a"))[0],n=i[i.length-1],i=document.activeElement,!l&&t&&n===i&&(0,o.default)(r,p).call(r,e),l&&t&&a===i&&(0,o.default)(r,p).call(r,e)))}}),b.set(this,{writable:!0,value:function(e){var t=e.querySelector("ul.sub-menu:not( ul.sub-menu.megamenu ul.sub-menu )");e.classList.add("sfHover"),t&&(0,s.fadeInNav)(t,{callback:function(){}})}}),m.set(this,{writable:!0,value:function(e){var t=e.querySelector("ul.sub-menu:not( ul.sub-menu.megamenu ul.sub-menu )");e.classList.remove("sfHover"),t&&(t.style.pointerEvents="none",(0,s.fadeOutNav)(t,{callback:function(){t.style.pointerEvents=null,e.classList.contains("sfHover")&&(0,o.default)(r,b).call(r,e)}}))}}),(0,o.default)(this,c).call(this)}},{"../../lib/utils":2,"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/classPrivateFieldGet":12,"@babel/runtime/helpers/classPrivateFieldSet":13,"@babel/runtime/helpers/interopRequireDefault":15}],6:[function(e,t,l){"use strict";var a=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(l,"__esModule",{value:!0}),l.default=void 0;var n=a(e("@babel/runtime/helpers/classCallCheck")),i=a(e("@babel/runtime/helpers/defineProperty")),r=a(e("@babel/runtime/helpers/classPrivateFieldSet")),o=a(e("@babel/runtime/helpers/classPrivateFieldGet")),s=new WeakMap,u=new WeakMap,c=new WeakMap,d=new WeakMap,f=new WeakMap;l.default=function e(){var l=this;(0,n.default)(this,e),s.set(this,{writable:!0,value:void 0}),(0,i.default)(this,"mobileOverlayInput",void 0),u.set(this,{writable:!0,value:function(){(0,r.default)(l,s,{forms:document.querySelectorAll("form.header-searchform")})}}),c.set(this,{writable:!0,value:function(){var e;l.mobileOverlayInput=document.querySelector(".mobile-search-overlay-input"),(0,o.default)(l,s).forms.forEach(function(e){var t;null!==(t=e.querySelector("input"))&&void 0!==t&&t.value&&e.classList.add("search-filled")}),null!==(e=l.mobileOverlayInput)&&void 0!==e&&e.value&&l.mobileOverlayInput.closest("form").classList.add("search-filled")}}),d.set(this,{writable:!0,value:function(){var e;(0,o.default)(l,s).forms.forEach(function(e){var t;null!==(t=e.querySelector("input"))&&void 0!==t&&t.addEventListener("keyup",(0,o.default)(l,f)),null!==(e=e.querySelector("input"))&&void 0!==e&&e.addEventListener("blur",(0,o.default)(l,f))}),null!==(e=l.mobileOverlayInput)&&void 0!==e&&e.addEventListener("keyup",(0,o.default)(l,f)),null!==(e=l.mobileOverlayInput)&&void 0!==e&&e.addEventListener("blur",(0,o.default)(l,f))}}),f.set(this,{writable:!0,value:function(e){var t=e.currentTarget,e=t.closest("form");t.value?e.classList.add("search-filled"):e.classList.remove("search-filled")}}),(0,o.default)(this,u).call(this),(0,o.default)(this,c).call(this),(0,o.default)(this,d).call(this)}},{"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/classPrivateFieldGet":12,"@babel/runtime/helpers/classPrivateFieldSet":13,"@babel/runtime/helpers/defineProperty":14,"@babel/runtime/helpers/interopRequireDefault":15}],7:[function(e,t,l){"use strict";var a=e("@babel/runtime/helpers/interopRequireDefault"),n=a(e("@babel/runtime/helpers/classCallCheck")),i=a(e("@babel/runtime/helpers/classPrivateFieldGet")),r=a(e("./menu/menu")),o=a(e("./menu/mega-menu")),s=a(e("./search/search")),u=a(e("./footer")),c=new WeakMap,d=new WeakMap,f=new WeakMap,e=function e(){var t=this;(0,n.default)(this,e),c.set(this,{writable:!0,value:function(){t.menu=new r.default,t.megaMenu=new o.default,t.search=new s.default,t.footer=new u.default}}),d.set(this,{writable:!0,value:function(){document.addEventListener("keydown",(0,i.default)(t,f))}}),f.set(this,{writable:!0,value:function(e){13===e.keyCode&&document.querySelector(".skip-link").addEventListener("keydown",function(e){var t=document.getElementById("main");t.tabIndex=-1,t.focus()})}}),(0,i.default)(this,c).call(this),(0,i.default)(this,d).call(this)};window.oceanwp=window.oceanwp||{},oceanwp.theme=new e},{"./footer":3,"./menu/mega-menu":4,"./menu/menu":5,"./search/search":6,"@babel/runtime/helpers/classCallCheck":10,"@babel/runtime/helpers/classPrivateFieldGet":12,"@babel/runtime/helpers/interopRequireDefault":15}],8:[function(e,t,l){t.exports=function(e,t){return t.get?t.get.call(e):t.value},t.exports.default=t.exports,t.exports.__esModule=!0},{}],9:[function(e,t,l){t.exports=function(e,t,l){if(t.set)t.set.call(e,l);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=l}},t.exports.default=t.exports,t.exports.__esModule=!0},{}],10:[function(e,t,l){t.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},t.exports.default=t.exports,t.exports.__esModule=!0},{}],11:[function(e,t,l){t.exports=function(e,t,l){if(!t.has(e))throw new TypeError("attempted to "+l+" private field on non-instance");return t.get(e)},t.exports.default=t.exports,t.exports.__esModule=!0},{}],12:[function(e,t,l){var a=e("./classApplyDescriptorGet.js"),n=e("./classExtractFieldDescriptor.js");t.exports=function(e,t){return t=n(e,t,"get"),a(e,t)},t.exports.default=t.exports,t.exports.__esModule=!0},{"./classApplyDescriptorGet.js":8,"./classExtractFieldDescriptor.js":11}],13:[function(e,t,l){var a=e("./classApplyDescriptorSet.js"),n=e("./classExtractFieldDescriptor.js");t.exports=function(e,t,l){return t=n(e,t,"set"),a(e,t,l),l},t.exports.default=t.exports,t.exports.__esModule=!0},{"./classApplyDescriptorSet.js":9,"./classExtractFieldDescriptor.js":11}],14:[function(e,t,l){t.exports=function(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e},t.exports.default=t.exports,t.exports.__esModule=!0},{}],15:[function(e,t,l){t.exports=function(e){return e&&e.__esModule?e:{default:e}},t.exports.default=t.exports,t.exports.__esModule=!0},{}],16:[function(e,t,l){function a(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=a=function(e){return typeof e}:t.exports=a=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t.exports.default=t.exports,t.exports.__esModule=!0,a(e)}t.exports=a,t.exports.default=t.exports,t.exports.__esModule=!0},{}]},{},[7]); |