PageSourceSearch

https://www.pleasantvalleygc.com/wp-content/plugins/golfnow-custom…/assets/dist/vendor/micro-modal.js?ver=0.1

js pleasantvalleygc.com collected 2026-10-04 09:42:37 UTC 5,301 bytes, 1 lines download raw bytes

1((e,o)=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=o():"function"==typeof define&&define.amd?define(o):e.MicroModal=o()})(this,function(){var o="0.3.1";function i(e,o){for(var t=0;t<o.length;t++){var i=o[t];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function c(e){if(Array.isArray(e)){for(var o=0,t=Array(e.length);o<e.length;o++)t[o]=e[o];return t}return Array.from(e)}var e,s,t,l,d;function u(e){var o=e.targetModal,t=e.triggers,t=void 0===t?[]:t,i=e.onShow,i=void 0===i?function(){}:i,n=e.onClose,n=void 0===n?function(){}:n,a=e.openTrigger,a=void 0===a?"data-micromodal-trigger":a,r=e.closeTrigger,r=void 0===r?"data-micromodal-close":r,s=e.disableScroll,s=void 0!==s&&s,l=e.disableFocus,l=void 0!==l&&l,d=e.awaitCloseAnimation,d=void 0!==d&&d,e=e.debugMode,e=void 0!==e&&e;if(!(this instanceof u))throw new TypeError("Cannot call a class as a function");this.modal=document.getElementById(o),this.config={debugMode:e,disableScroll:s,openTrigger:a,closeTrigger:r,onShow:i,onClose:n,awaitCloseAnimation:d,disableFocus:l},0<t.length&&this.registerTriggers.apply(this,c(t)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}return e=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden])","iframe","object","embed","[contenteditable]",'[tabindex]:not([tabindex^="-"])'],function(e,o,t){return o&&i(e.prototype,o),t&&i(e,t),e}(u,[{key:"registerTriggers",value:function(){for(var o=this,e=arguments.length,t=Array(e),i=0;i<e;i++)t[i]=arguments[i];t.forEach(function(e){e.addEventListener("click",function(){return o.showModal()})})}},{key:"showModal",value:function(){this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add("is-open"),this.setFocusToFirstNode(),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.onShow(this.modal)}},{key:"closeModal",value:function(){var o=this.modal;this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement.focus(),this.config.onClose(this.modal),this.config.awaitCloseAnimation?this.modal.addEventListener("animationend",function e(){o.classList.remove("is-open"),o.removeEventListener("animationend",e,!1)},!1):o.classList.remove("is-open")}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var o=document.querySelector("body");switch(e){case"enable":Object.assign(o.style,{overflow:"initial",height:"initial"});break;case"disable":Object.assign(o.style,{overflow:"hidden",height:"100vh"})}}}},{key:"addEventListeners",value:function(){this.modal.addEventListener("touchstart",this.onClick),this.modal.addEventListener("click",this.onClick),document.addEventListener("keydown",this.onKeydown)}},{key:"removeEventListeners",value:function(){this.modal.removeEventListener("touchstart",this.onClick),this.modal.removeEventListener("click",this.onClick),document.removeEventListener("keydown",this.onKeydown)}},{key:"onClick",value:function(e){e.target.hasAttribute(this.config.closeTrigger)&&(this.closeModal(),e.preventDefault())}},{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.maintainFocus(e)}},{key:"getFocusableNodes",value:function(){var o=this.modal.querySelectorAll(e);return Object.keys(o).map(function(e){return o[e]})}},{key:"setFocusToFirstNode",value:function(){var e;this.config.disableFocus||(e=this.getFocusableNodes()).length&&e[0].focus()}},{key:"maintainFocus",value:function(e){var o,t=this.getFocusableNodes();this.modal.contains(document.activeElement)?(o=t.indexOf(document.activeElement),e.shiftKey&&0===o&&(t[t.length-1].focus(),e.preventDefault()),e.shiftKey||o!==t.length-1||(t[0].focus(),e.preventDefault())):t[0].focus()}}]),s=u,t=null,l=function(e){if(!document.getElementById(e))return console.warn("MicroModal v"+o+": ❗Seems like you have missed %c'"+e+"'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","ID somewhere in your code. Refer example below to resolve it."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'<div class="modal" id="'+e+'"></div>'),!1},d=function(e){if(e.length<=0)return console.warn("MicroModal v"+o+": ❗Please specify at least one %c'micromodal-trigger'","background-color: #f8f9fa;color: #50596c;font-weight: bold;","data attribute."),console.warn("%cExample:","background-color: #f8f9fa;color: #50596c;font-weight: bold;",'<a href="#" data-micromodal-trigger="my-modal"></a>'),!1},{init:function(e){var t,i,o=Object.assign({},{openTrigger:"data-micromodal-trigger"},e),e=[].concat(c(document.querySelectorAll("["+o.openTrigger+"]"))),n=(t=o.openTrigger,i=[],e.forEach(function(e){var o=e.attributes[t].value;void 0===i[o]&&(i[o]=[]),i[o].push(e)}),i);if(!0!==o.debugMode||!1!==((e,o)=>{if(d(e),o)for(var t in o)l(t);return!0})(e,n))for(var a in n){var r=n[a];o.targetModal=a,o.triggers=[].concat(c(r)),new s(o)}},show:function(e,o){o=o||{};o.targetModal=e,!0===o.debugMode&&!1===l(e)||(t=new s(o)).showModal()},close:function(){t.closeModal()}}});

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.