PageSourceSearch

https://divimode.com/wp-content/plugins/searchwp-modal-search-form…/dist/searchwp-modal-form.min.js?ver=0.5.6

js divimode.com collected 2026-09-25 21:05:27 UTC 8,063 bytes, 1 lines download raw bytes

vendor: 4,347 bytes, line 1
1!function(){"use strict";function e(e){return function(e){if(Array.isArray(e))return t(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,o){if(e){if("string"==typeof e)return t(e,o);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)?t(e,o):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 t(e,t){(null==t||t>e.length)&&(t=e.length);for(var o=0,n=new Array(t);o<t;o++)n[o]=e[o];return n}var o,n,i,r,a,l=(o=["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^="-"])'],n=function(){function t(o){var n=o.targetModal,i=o.triggers,r=void 0===i?[]:i,a=o.onShow,l=void 0===a?function(){}:a,s=o.onClose,c=void 0===s?function(){}:s,d=o.openTrigger,u=void 0===d?"data-micromodal-trigger":d,f=o.closeTrigger,h=void 0===f?"data-micromodal-close":f,m=o.openClass,v=void 0===m?"is-open":m,g=o.disableScroll,y=void 0!==g&&g,b=o.disableFocus,w=void 0!==b&&b,p=o.awaitCloseAnimation,E=void 0!==p&&p,k=o.awaitOpenAnimation,A=void 0!==k&&k,M=o.debugMode,C=void 0!==M&&M;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),this.modal=document.getElementById(n),this.config={debugMode:C,disableScroll:y,openTrigger:u,closeTrigger:h,openClass:v,onShow:l,onClose:c,awaitCloseAnimation:E,awaitOpenAnimation:A,disableFocus:w},r.length>0&&this.registerTriggers.apply(this,e(r)),this.onClick=this.onClick.bind(this),this.onKeydown=this.onKeydown.bind(this)}var n;return(n=[{key:"registerTriggers",value:function(){for(var e=this,t=arguments.length,o=new Array(t),n=0;n<t;n++)o[n]=arguments[n];o.filter(Boolean).forEach((function(t){t.addEventListener("click",(function(t){return e.showModal(t)}))}))}},{key:"showModal",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(this.activeElement=document.activeElement,this.modal.setAttribute("aria-hidden","false"),this.modal.classList.add(this.config.openClass),this.scrollBehaviour("disable"),this.addEventListeners(),this.config.awaitOpenAnimation){this.modal.addEventListener("animationend",(function t(){e.modal.removeEventListener("animationend",t,!1),e.setFocusToFirstNode()}),!1)}else this.setFocusToFirstNode();this.config.onShow(this.modal,this.activeElement,t)}},{key:"closeModal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=this.modal;if(this.modal.setAttribute("aria-hidden","true"),this.removeEventListeners(),this.scrollBehaviour("enable"),this.activeElement&&this.activeElement.focus&&this.activeElement.focus(),this.config.onClose(this.modal,this.activeElement,e),this.config.awaitCloseAnimation){var o=this.config.openClass;this.modal.addEventListener("animationend",(function e(){t.classList.remove(o),t.removeEventListener("animationend",e,!1)}),!1)}else t.classList.remove(this.config.openClass)}},{key:"closeModalById",value:function(e){this.modal=document.getElementById(e),this.modal&&this.closeModal()}},{key:"scrollBehaviour",value:function(e){if(this.config.disableScroll){var t=document.querySelector("body");switch(e){case"enable":Object.assign(t.style,{overflow:""});break;case"disable":Object.assign(t.style,{overflow:"hidden"})}}}},{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)||e.target.parentNode.hasAttribute(this.config.closeTrigger))&&(e.preventDefault(),e.stopPropagation(),this.closeModal(e))}}
1,{key:"onKeydown",value:function(e){27===e.keyCode&&this.closeModal(e),9===e.keyCode&&this.retainFocus(e)}},{key:"getFocusableNodes",value:function(){var t=this.modal.querySelectorAll(o);return Array.apply(void 0,e(t))}},{key:"setFocusToFirstNode",value:function(){var e=this;if(!this.config.disableFocus){var t=this.getFocusableNodes();if(0!==t.length){var o=t.filter((function(t){return!t.hasAttribute(e.config.closeTrigger)}));o.length>0&&o[0].focus(),0===o.length&&t[0].focus()}}}},{key:"retainFocus",value:function(e){var t=this.getFocusableNodes();if(0!==t.length)if(t=t.filter((function(e){return null!==e.offsetParent})),this.modal.contains(document.activeElement)){var o=t.indexOf(document.activeElement);e.shiftKey&&0===o&&(t[t.length-1].focus(),e.preventDefault()),!e.shiftKey&&t.length>0&&o===t.length-1&&(t[0].focus(),e.preventDefault())}else t[0].focus()}}])&&function(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,n),t}(),i=null,r=function(e){if(!document.getElementById(e))return console.warn("MicroModal: ❗Seems like you have missed %c'".concat(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="'.concat(e,'"></div>')),!1},a=function(e,t){if(function(e){e.length<=0&&(console.warn("MicroModal: ❗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>'))}(e),!t)return!0;for(var o in t)r(o);return!0},{init:function(t){var o=Object.assign({},{openTrigger:"data-micromodal-trigger"},t),r=e(document.querySelectorAll("[".concat(o.openTrigger,"]"))),l=function(e,t){var o=[];return e.forEach((function(e){var n=e.attributes[t].value;void 0===o[n]&&(o[n]=[]),o[n].push(e)})),o}(r,o.openTrigger);if(!0!==o.debugMode||!1!==a(r,l))for(var s in l){var c=l[s];o.targetModal=s,o.triggers=e(c),i=new n(o)}},show:function(e,t){var o=t||{};o.targetModal=e,!0===o.debugMode&&!1===r(e)||(i&&i.removeEventListeners(),(i=new n(o)).showModal())},close:function(e){e?i.closeModalById(e):i.closeModal()}});"undefined"!=typeof window&&(window.MicroModal=l);var s=["interactive","complete"],c=function(e,t){return new Promise((function(o){e&&"function"!=typeof e&&(t=e,e=null),t=t||window.document;var n=function(){return o(void(e&&setTimeout(e)))};-1!==s.indexOf(t.readyState)?n():t.addEventListener("DOMContentLoaded",n)}))};c.resume=function(e){return function(t){return c(e).then((function(){return t}))}},l.init({onShow:function(e){let t=e.querySelectorAll('[name="s"]')[0];t.focus(),t.select()}}),c((function(){let e="",t=document.querySelectorAll("[data-searchwp-modal-trigger]"),o=document.querySelectorAll("[data-searchwp-modal-form-close]");t.forEach((function(t){t.addEventListener("click",(function(t){t.preventDefault();let o=t.currentTarget.getAttribute("data-searchwp-modal-trigger");e=o,l.show(o,{onShow:function(e){window.jQuery&&jQuery("body").trigger("searchwpModalOnShow",{modal:o,el:jQuery("#"+o),obj:e})},onClose:function(e){window.jQuery&&jQuery("body").trigger("searchwpModalOnClose",{modal:o,el:jQuery("#"+o),obj:e})},disableScroll:searchwp_modal_form_params.disableScroll})}),!1)})),o.forEach((function(t){t.addEventListener("click",(function(t){t.target.hasAttribute("data-searchwp-modal-form-close")&&(t.preventDefault(),l.close(e),e="")}),!0)}))}))}();

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.