-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy path553.da065a6b.js
1 lines (1 loc) · 4.92 KB
/
553.da065a6b.js
1
"use strict";(self.webpackChunkreactphp_website=self.webpackChunkreactphp_website||[]).push([[553],{7788:function(t,e,n){n.d(e,{Z:function(){return d}});var r=n(9264),o={selector:"[data-ctrly]",context:null,focusTarget:!0,closeOnBlur:!0,closeOnEsc:!0,closeOnOutsideClick:!0,closeOnScroll:!1,trapFocus:!1,allowMultiple:!1,on:null,autoInit:!0};function i(t){var e={};return[o,t].forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})),e}function a(t){return"which"in t?t.which:t.keyCode}function u(t){return(0,r.sE)('[aria-controls="'.concat(t.id,'"]'))}function c(t){return document.getElementById(t.getAttribute("aria-controls")||t.getAttribute("data-ctrly"))}function s(t){t.removeAttribute("aria-pressed"),t.removeAttribute("aria-controls"),t.removeAttribute("aria-expanded")}var l=0;function d(){var t,e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=i(n),d=o.selector,f=o.on||{},p={};function b(t){return o.context?(0,r.oq)(t,o.context):document}function v(t,e){return("function"!=typeof f[e]||!1!==f[e](t))&&!1!==(0,r.WI)(t,"ctrly:".concat(e),{bubbles:!0,cancelable:!0})}function h(t){for(var e=t;e;){if(e.id&&p[e.id])return e;e=e.parentElement}}function A(t){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t)return!1;if(!t.hasAttribute("data-ctrly-opened"))return!1;if(!v(t,"close"))return!1;var n=(0,r.AW)(),o=p[t.id]||{},i=o.lastActiveElement,a=o.destroy;return delete p[t.id],a&&a(),u(t).forEach((function(t){"button"!==t.tagName.toLowerCase()&&t.setAttribute("aria-pressed","false"),t.setAttribute("aria-expanded","false")})),t.removeAttribute("data-ctrly-opened"),t.setAttribute("aria-hidden","true"),t.removeAttribute("tabindex"),t.blur(),e&&i&&t.contains(n)&&(0,r.T_)(i,{restoreScrollPosition:!0}),v(t,"closed"),t}function m(t){(0,r.sE)(d,b(t)).forEach((function(e){var n=c(e);n&&n.id!==t.id&&A(n,!1)}))}function y(t,e){var n=[];if(o.closeOnBlur&&!o.trapFocus&&n.push((0,r.on)(document,"focusin",(function(t){e.contains(t.target)||setTimeout((function(){A(e,!1)}),0)}),{capture:!0,passive:!0})),o.closeOnEsc&&n.push((0,r.on)(document,"keydown",(function(t){27===a(t)&&A(e)&&t.preventDefault()}))),o.closeOnOutsideClick&&n.push((0,r.on)(document,"click",(function(t){1!==a(t)||e.contains(t.target)||(0,r.oq)(t.target,d)||A(e)}),{passive:!0})),o.closeOnScroll){var i=!1,u=function(){i=!0},c=function(){i=!1};n.push((0,r.on)(e,"mouseenter",u,{passive:!0})),n.push((0,r.on)(e,"mouseleave",c,{passive:!0})),n.push((0,r.on)(e,"touchstart",u,{passive:!0})),n.push((0,r.on)(e,"touchend",c,{passive:!0})),n.push((0,r.on)(window,"scroll",(function(){i||A(e)}),{passive:!0}))}return o.trapFocus&&n.push((0,r.on)(document,"keydown",(function(t){if(9===a(t)){var n=(0,r.ht)(e);if(!n[0])return t.preventDefault(),void(0,r.T_)(e);var o=(0,r.AW)(),i=n[0],u=n[n.length-1];if(t.shiftKey&&o===i)return t.preventDefault(),void(0,r.T_)(u);t.shiftKey||o!==u||((0,r.T_)(i),t.preventDefault())}}))),function(){for(;n.length;)n.shift().call()}}function g(t){var e=c(t);return e?!e.hasAttribute("data-ctrly-opened")&&!!v(e,"open")&&(p[e.id]={lastActiveElement:(0,r.AW)(),destroy:y(0,e)},u(e).forEach((function(t){"button"!==t.tagName.toLowerCase()&&t.setAttribute("aria-pressed","true"),t.setAttribute("aria-expanded","true")})),e.setAttribute("data-ctrly-opened",""),e.setAttribute("aria-hidden","false"),e.setAttribute("tabindex","-1"),v(e,"opened"),e):(s(t),!1)}function w(t,e){var n=c(e);n?"true"!==e.getAttribute("aria-expanded")?(o.allowMultiple||m(n),g(e),n&&(t.preventDefault(),o.focusTarget&&(0,r.T_)((0,r.ht)(n)[0]||n),n.scrollTop=0,n.scrollLeft=0)):A(n)&&t.preventDefault():A(h(e))&&t.preventDefault()}function E(){t||(t=(0,r.cl)(document,"click",d,(function(t,e){1===a(t)&&w(t,e)})),e=(0,r.cl)(document,"keydown",d,(function(t,e){13!==a(t)&&32!==a(t)||w(t,e)}))),(0,r.sE)(d).forEach((function(t){var e=c(t);if(e){"button"!==t.tagName.toLowerCase()&&(t.hasAttribute("role")||t.setAttribute("role","button"),(0,r.Wq)(t)||t.setAttribute("tabindex","0")),t.setAttribute("aria-controls",e.id);var n=u(e).map((function(t){return t.id||t.setAttribute("id","ctrly-control-"+ ++l),t.id})),o=(e.getAttribute("aria-labelledby")||"").split(" ").concat(n).filter((function(t,e,n){return""!==t&&n.indexOf(t)===e}));e.setAttribute("aria-labelledby",o.join(" ")),"true"===t.getAttribute("aria-expanded")||t.hasAttribute("data-ctrly-open")?g(t):("button"!==t.tagName.toLowerCase()&&t.setAttribute("aria-pressed","false"),t.setAttribute("aria-expanded","false"),e.setAttribute("aria-hidden","true"),e.removeAttribute("tabindex"))}else s(t)}))}function O(n){for(var o in n&&t&&(t(),t=null,e(),e=null),(0,r.sE)(d).forEach((function(t){n&&s(t);var e=c(t);e&&(A(e,!1),n&&e.removeAttribute("aria-hidden"))})),p)Object.prototype.hasOwnProperty.call(p,o)&&(p[o].destroy(),delete p[o])}function x(){O(!1)}function k(){O(!0)}return o.autoInit&&(0,r.Cd)(E),{closeAll:x,destroy:k,init:E}}},553:function(t,e,n){n.r(e),(0,n(7788).Z)({selector:"[data-off-canvas-menu-control]",closeOnScroll:!0})}}]);