OwlCyberSecurity - MANAGER
Edit File: 614.js
"use strict";(self.webpackChunkrishiExports=self.webpackChunkrishiExports||[]).push([[614],{614:(e,t,n)=>{n.r(t),n.d(t,{handleFirstLevelForMenu:()=>m,handleSingleSubmenu:()=>l,handleUpdate:()=>h,mountMenuLevel:()=>f});var r=n(8981);function i(e){return function(e){if(Array.isArray(e))return a(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return a(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var o=function(e){return e.classList.contains("animated-submenu")&&(!e.parentNode.classList.contains("menu")||-1===e.className.indexOf("rt-mega-menu")&&e.parentNode.classList.contains("menu"))},u=function(e){var t=function(e,t){for(var n=[];e.parentNode;)e.parentNode&&e.parentNode.matches&&e.parentNode.matches("li.menu-item")&&n.push(e.parentNode),e=e.parentNode;return n[n.length-1]}(e);return t&&t.getBoundingClientRect().left>innerWidth/2?"left":"right"},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;i(e.querySelectorAll("[data-submenu]")).map((function(e){e.removeAttribute("data-submenu")})),setTimeout((function(){return e._popper=new r.Z(e.parentNode,e,{modifiers:{applyStyle:{enabled:!1},preventOverflow:{enabled:!1},hide:{enabled:!1},flip:{behavior:["right","left"],flipVariationsByContent:!0},setCustomStyle:{enabled:!0,order:1e8,fn:function(e){e.flipped,e.instance;var t=e.instance,n=t.reference,r=(t.popper,e.placement);e.styles,n.dataset.submenu="left"===r?"left":"right",n.addEventListener("click",(function(){}))}}},placement:t||u(e)})}))},s=function(e,t){var n=t.startPosition,r=void 0===n?"end":n,i=e.querySelector(".sub-menu"),a=u(i),o=i.getBoundingClientRect(),l=(o.left,o.width),s=(o.right,a),c=e.getBoundingClientRect();"left"===a&&("end"===r?c.left:c.right)-l<0&&(s="right"),"right"===a&&("end"===r?c.right:c.left)+l>innerWidth&&(s="left"),e.dataset.submenu=s,e.addEventListener("click",(function(){}))},c=function(e){var t=e.target.closest("li");t.classList.add("rt-active");var n=i(t.children).find((function(e){return e.matches(".__ct__toggle-dropdown-desktop-ghost")}));n.setAttribute("aria-expanded","true"),n.setAttribute("aria-label",ct_localizations.collapse_submenu),p({target:t})},d=function(e){var t=e.target.closest("li");t.classList.remove("rt-active");var n=i(t.children).find((function(e){return e.matches(".__ct__toggle-dropdown-desktop-ghost")}));n.setAttribute("aria-expanded","false"),n.setAttribute("aria-label",ct_localizations.expand_submenu),setTimeout((function(){i(t.querySelectorAll("[data-submenu]")).map((function(e){e.removeAttribute("data-submenu")})),i(t.querySelectorAll(".__ct__active")).map((function(e){e.classList.remove("rt-active")}))}),200)},f=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};i(e.children).filter((function(e){return e.matches(".menu-item-has-children, .page_item_has_children")})).map((function(e){if(e.classList.contains("__cb__mega-menu-custom-width")){var n=e.querySelector(".sub-menu"),r=e.getBoundingClientRect(),a=n.getBoundingClientRect();r.left+r.width/2+a.width/2>innerWidth&&(e.dataset.submenu="left"),r.left+r.width/2-a.width/2<0&&(e.dataset.submenu="right")}o(e)&&s(e,t);var u=i(e.children).find((function(e){return e.matches(".__cb__toggle-dropdown-desktop-ghost")}));if(u&&!u.hasEventListener){u.hasEventListener=!0;var l=u.matches('[data-interaction*="click"] *');u.addEventListener("keyup",(function(e){13===e.keyCode&&(e.target.closest("li").classList.contains("rt-active")?d(e):(c(e),e.target.closest("li").addEventListener("focusout",(function(t){e.target.closest("li").contains(t.relatedTarget)||d(e)}))))})),l?(u.matches('[data-interaction*="item"] *')?u.previousElementSibling:u.previousElementSibling.querySelector(".__cb__toggle-dropdown-desktop")).addEventListener("click",(function(e){e.preventDefault(),e.target.closest("li").classList.contains("rt-active")?d(e):(c(e),e.target.closest("li").addEventListener("focusout",(function(t){e.target.closest("li").contains(t.relatedTarget)||d(e)})))})):u.closest("li").addEventListener("mouseenter",(function(e){c({target:u}),e.target.closest("li").addEventListener("focusout",(function(t){e.target.closest("li").contains(t.relatedTarget)||d(e)})),e.target.closest("li").addEventListener("mouseleave",(function(){d({target:u})}),{once:!0})}))}}))},m=function(e){i(e.children).filter((function(e){return e.querySelector(".sub-menu")})).filter((function(e){return o(e)})).map((function(e){return e.querySelector(".sub-menu")})).map((function(e){return l(e,"right")}))},p=function(e){var t,n,a,l=e.target;if(l.matches(".menu-item-has-children, .page_item_has_children")||(l=l.closest(".menu-item-has-children, .page_item_has_children")),null!==(t=l)&&void 0!==t&&null!==(n=t.parentNode)&&void 0!==n&&null!==(a=n.classList)&&void 0!==a&&a.contains("menu")&&l.className.indexOf("rt-mega-menu")>-1&&wp&&wp.customize&&wp.customize("active_theme")&&(l.querySelector(".sub-menu").style.left="".concat(Math.round(l.closest('[class*="rt-container"]').firstElementChild.getBoundingClientRect().x)-Math.round(l.closest("nav").getBoundingClientRect().x),"px")),o(l)){var s=l.querySelector(".sub-menu");s._timeout_id&&clearTimeout(s._timeout_id),i(s.children).filter((function(e){return e.querySelector(".sub-menu")})).filter((function(e){return o(e)})).map((function(e){return e.querySelector(".sub-menu")})).map((function(e){i(e.querySelectorAll("[data-submenu]")).map((function(e){e.removeAttribute("data-submenu")})),setTimeout((function(){return e._popper=new r.Z(e.parentNode,e,{modifiers:{applyStyle:{enabled:!1},preventOverflow:{enabled:!0},hide:{enabled:!1},flip:{behavior:["right","left"],flipVariations:!0,flipVariationsByContent:!0},setCustomStyle:{enabled:!0,order:1e8,fn:function(e){e.flipped,e.instance;var t=e.instance,n=t.reference,r=t.popper,i=e.placement,a=(e.styles,r.getBoundingClientRect()),o=(a.left,a.width),u=(a.right,i);"left"===i&&n.getBoundingClientRect().left-o<0&&(u="right"),"right"===i&&n.getBoundingClientRect().right-o<0&&(u="left"),n.dataset.submenu=u,n.addEventListener("click",(function(){}))}}},placement:u(e)})}))})),s.parentNode.addEventListener("mouseleave",(function(){i(s.children).filter((function(e){return e.querySelector(".sub-menu")})).filter((function(e){return o(e)})).map((function(e){return e.querySelector(".sub-menu")})).map((function(e){e._popper&&(e._popper.destroy(),e._popper=null)})),s._timeout_id=setTimeout((function(){s._timeout_id=null,i(s.children).filter((function(e){return o(e)})).map((function(e){return e.removeAttribute("data-submenu")}))}),200)}),{once:!0})}},h=function(e){e.parentNode||(e=document.querySelector('[class="'.concat(e.className,'"]'))),e.parentNode.removeEventListener("mouseenter",p),e.parentNode.addEventListener("mouseenter",p),e.parentNode.removeEventListener("focusin",p),e.parentNode.addEventListener("focusin",p)}}}]);