1 line
12 KiB
JavaScript
Executable File
1 line
12 KiB
JavaScript
Executable File
!function o(l,i,r){function a(t,e){if(!i[t]){if(!l[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(s)return s(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=i[t]={exports:{}},l[t][0].call(n.exports,function(e){return a(l[t][1][e]||e)},n,n.exports,o,l,i,r)}return i[t].exports}for(var s="function"==typeof require&&require,e=0;e<r.length;e++)a(r[e]);return a}({1:[function(e,t,n){"use strict";var o=e("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(n,"__esModule",{value:!0}),n.fadeOutNav=n.fadeInNav=n.isSelectorValid=n.isElement=n.getSiblings=n.visible=n.offset=n.fadeToggle=n.fadeOut=n.fadeIn=n.slideToggle=n.slideUp=n.slideDown=n.wrap=void 0;var l=o(e("@babel/runtime/helpers/typeof"));n.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,n=window.getComputedStyle(e).display;"none"===n&&(n="block"),e.style.transitionProperty="height",e.style.transitionDuration="".concat(t,"ms"),e.style.opacity=0,e.style.display=n;var o=e.offsetHeight;e.style.height=0,e.style.opacity=1,e.style.overflow="hidden",setTimeout(function(){e.style.height="".concat(o,"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)}n.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)}n.slideUp=r;n.slideToggle=function(e,t){("none"===window.getComputedStyle(e).display?i:r)(e,t)};function a(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)}n.fadeIn=a;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))}n.fadeOut=s;n.fadeToggle=function(e,t){("none"===window.getComputedStyle(e).display?a:s)(e,t)};n.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}};n.visible=function(e){return!!e&&!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)};n.getSiblings=function(e){var t=[];if(!e.parentNode)return t;for(var n=e.parentNode.firstChild;n;)1===n.nodeType&&n!==e&&t.push(n),n=n.nextSibling;return t};n.isElement=function(e){return"object"===("undefined"==typeof HTMLElement?"undefined":(0,l.default)(HTMLElement))?e instanceof HTMLElement:e&&"object"===(0,l.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});n.isSelectorValid=e;n.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)};n.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":10,"@babel/runtime/helpers/typeof":11}],2:[function(e,t,n){"use strict";var o=e("@babel/runtime/helpers/interopRequireDefault"),l=o(e("@babel/runtime/helpers/defineProperty")),i=o(e("@babel/runtime/helpers/classCallCheck")),r=o(e("@babel/runtime/helpers/classPrivateFieldSet")),u=o(e("@babel/runtime/helpers/classPrivateFieldGet")),a=e("../../lib/utils");function s(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function c(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach(function(e){(0,l.default)(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}var d=new WeakMap,p=new WeakMap,f=new WeakMap,y=new WeakMap,v=new WeakMap,m=new WeakMap,b=new WeakMap,h=new WeakMap,g=new WeakMap,w=new WeakMap,e=function e(){var s=this;(0,i.default)(this,e),d.set(this,{writable:!0,value:{toggleMenuBtn:document.querySelector("#site-header.full_screen-header .menu-bar")}}),p.set(this,{writable:!0,value:function(){(0,r.default)(s,d,c(c({},(0,u.default)(s,d)),{},{menu:document.querySelector("#site-header.full_screen-header #full-screen-menu"),header:document.querySelector("#site-header.full_screen-header"),logo:document.querySelector("#site-logo.has-full-screen-logo"),html:document.querySelector("html")}))}}),f.set(this,{writable:!0,value:function(){(0,u.default)(s,d).menu.querySelectorAll(".nav-arrow").forEach(function(e){e.setAttribute("tabindex",0)})}}),y.set(this,{writable:!0,value:function(){var e;(0,u.default)(s,d).toggleMenuBtn.addEventListener("click",(0,u.default)(s,v)),null!==(e=document.querySelectorAll('#full-screen-menu #site-navigation ul > li.dropdown > a > .text-wrap > span.nav-arrow, #full-screen-menu #site-navigation ul > li.dropdown > a[href="#"]'))&&void 0!==e&&e.forEach(function(e){e.addEventListener("click",(0,u.default)(s,m)),e.addEventListener("tap",(0,u.default)(s,m))}),document.querySelectorAll('#full-screen-menu #site-navigation a.menu-link[href*="#"]:not([href="#"])').forEach(function(e){e.addEventListener("click",(0,u.default)(s,b))}),document.addEventListener("keydown",(0,u.default)(s,w))}}),v.set(this,{writable:!0,value:function(e){e.preventDefault(),(e.currentTarget.classList.contains("exit")?(0,u.default)(s,g):(0,u.default)(s,h)).call(s)}}),m.set(this,{writable:!0,value:function(e){e.preventDefault(),e.stopPropagation();var t=e.currentTarget.closest("li.dropdown"),e=t.querySelector("ul.sub-menu");"none"!==window.getComputedStyle(e).display?(t.classList.remove("open-sub"),(0,a.slideUp)(e,250)):(t.classList.add("open-sub"),(0,a.slideDown)(e,250))}}),b.set(this,{writable:!0,value:function(e){(0,u.default)(s,g).call(s)}}),h.set(this,{writable:!0,value:function(){(0,u.default)(s,d).header.classList.add("nav-open"),(0,u.default)(s,d).toggleMenuBtn.classList.add("exit"),null!==(t=(0,u.default)(s,d).logo)&&void 0!==t&&t.classList.add("opened"),(0,u.default)(s,d).menu.classList.add("active"),(0,a.fadeIn)((0,u.default)(s,d).menu);var e=(0,u.default)(s,d).html.innerWidth;(0,u.default)(s,d).html.style.overflow="hidden";var t=(0,u.default)(s,d).html.innerWidth;(0,u.default)(s,d).html.style.marginRight=e-t+"px"}}),g.set(this,{writable:!0,value:function(){var e;(0,u.default)(s,d).header.classList.remove("nav-open"),(0,u.default)(s,d).toggleMenuBtn.classList.remove("exit"),null!==(e=(0,u.default)(s,d).logo)&&void 0!==e&&e.classList.remove("opened"),(0,u.default)(s,d).menu.classList.remove("active"),(0,a.fadeOut)((0,u.default)(s,d).menu),((0,u.default)(s,d).html.style.overflow="",u.default)(s,d).html.style.marginRight="",document.querySelectorAll("#full-screen-menu #site-navigation ul > li.dropdown").forEach(function(e){e.classList.remove("open-sub")}),document.querySelectorAll("#full-screen-menu #site-navigation ul.sub-menu").forEach(function(e){(0,a.slideUp)(e,250)})}}),w.set(this,{writable:!0,value:function(e){var t,n,o,l,i,r,a;null!==(r=(0,u.default)(s,d).menu)&&void 0!==r&&r.classList.contains("active")&&(t=9===e.keyCode,n=e.shiftKey,o=27===e.keyCode,l=13===e.keyCode,i=(0,u.default)(s,d).toggleMenuBtn,r=(a=(0,u.default)(s,d).menu.querySelector("nav").querySelectorAll("a, span.nav-arrow, input, button"))[0],a=a[a.length-1],i.style.outline="",o&&(e.preventDefault(),(0,u.default)(s,g).call(s)),l&&document.activeElement.classList.contains("nav-arrow")&&(e.preventDefault(),document.activeElement.click()),!n&&t&&a===document.activeElement&&(e.preventDefault(),i.style.outline="1px dashed rgba(255, 255, 255, 0.6)",i.focus()),n&&t&&r===document.activeElement&&(e.preventDefault(),i.style.outline="1px dashed rgba(255, 255, 255, 0.6)",i.focus()),t&&r===a&&e.preventDefault())}}),(0,u.default)(this,d).toggleMenuBtn&&((0,u.default)(this,p).call(this),(0,u.default)(this,f).call(this),(0,u.default)(this,y).call(this))};window.oceanwp=window.oceanwp||{},oceanwp.fullScreenMenu=new e},{"../../lib/utils":1,"@babel/runtime/helpers/classCallCheck":5,"@babel/runtime/helpers/classPrivateFieldGet":7,"@babel/runtime/helpers/classPrivateFieldSet":8,"@babel/runtime/helpers/defineProperty":9,"@babel/runtime/helpers/interopRequireDefault":10}],3:[function(e,t,n){t.exports=function(e,t){return t.get?t.get.call(e):t.value},t.exports.default=t.exports,t.exports.__esModule=!0},{}],4:[function(e,t,n){t.exports=function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}},t.exports.default=t.exports,t.exports.__esModule=!0},{}],5:[function(e,t,n){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},{}],6:[function(e,t,n){t.exports=function(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)},t.exports.default=t.exports,t.exports.__esModule=!0},{}],7:[function(e,t,n){var o=e("./classApplyDescriptorGet.js"),l=e("./classExtractFieldDescriptor.js");t.exports=function(e,t){return t=l(e,t,"get"),o(e,t)},t.exports.default=t.exports,t.exports.__esModule=!0},{"./classApplyDescriptorGet.js":3,"./classExtractFieldDescriptor.js":6}],8:[function(e,t,n){var o=e("./classApplyDescriptorSet.js"),l=e("./classExtractFieldDescriptor.js");t.exports=function(e,t,n){return t=l(e,t,"set"),o(e,t,n),n},t.exports.default=t.exports,t.exports.__esModule=!0},{"./classApplyDescriptorSet.js":4,"./classExtractFieldDescriptor.js":6}],9:[function(e,t,n){t.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},t.exports.default=t.exports,t.exports.__esModule=!0},{}],10:[function(e,t,n){t.exports=function(e){return e&&e.__esModule?e:{default:e}},t.exports.default=t.exports,t.exports.__esModule=!0},{}],11:[function(e,t,n){function o(e){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=o=function(e){return typeof e}:t.exports=o=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,o(e)}t.exports=o,t.exports.default=t.exports,t.exports.__esModule=!0},{}]},{},[2]); |