File "basicLightbox.min.js"

Full Path: /home/rubycabfbt/www/wp-content/plugins/wtec-webp/assets/js/basicLightbox.min.js
File size: 3.01 KB
MIME-type: text/plain
Charset: utf-8

!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).basicLightbox=e()}(function(){return function o(r,i,c){function l(n,e){if(!i[n]){if(!r[n]){var t="function"==typeof require&&require;if(!e&&t)return t(n,!0);if(s)return s(n,!0);e=new Error("Cannot find module '"+n+"'");throw e.code="MODULE_NOT_FOUND",e}t=i[n]={exports:{}};r[n][0].call(t.exports,function(e){return l(r[n][1][e]||e)},t,t.exports,o,r,i,c)}return i[n].exports}for(var s="function"==typeof require&&require,e=0;e<c.length;e++)l(c[e]);return l}({1:[function(e,n,t){Object.defineProperty(t,"__esModule",{value:!0}),t.create=t.visible=void 0;function u(e){var n=1<arguments.length&&void 0!==arguments[1]&&arguments[1],t=document.createElement("div");return t.innerHTML=e.trim(),!0===n?t.children:t.firstChild}function a(e,n){return 1===(e=e.children).length&&e[0].tagName===n}function f(e){return null!=(e=e||document.querySelector(".basicLightbox"))&&!0===e.ownerDocument.body.contains(e)}t.visible=f,t.create=function(e,t){function n(e){return!1!==t.onClose(s)&&((n=l).classList.remove("basicLightbox--visible"),setTimeout(function(){if(!1!==f(n)&&n.parentElement.removeChild(n),"function"==typeof e)return e(s)},410),!0);var n}e=e=(e=>{var n="string"==typeof e,t=e instanceof HTMLElement==1;if(!1==n&&!1==t)throw new Error("Content must be a DOM element/node or string");return!0==n?Array.from(u(e,!0)):"TEMPLATE"===e.tagName?[e.content.cloneNode(!0)]:Array.from(e.children)})(e),o=t=function(e){e=0<arguments.length&&void 0!==e?e:{};if(null==(e=Object.assign({},e)).closable&&(e.closable=!0),null==e.className&&(e.className=""),null==e.onShow&&(e.onShow=function(){}),null==e.onClose&&(e.onClose=function(){}),"boolean"!=typeof e.closable)throw new Error("Property `closable` must be a boolean");if("string"!=typeof e.className)throw new Error("Property `className` must be a string");if("function"!=typeof e.onShow)throw new Error("Property `onShow` must be a function");if("function"!=typeof e.onClose)throw new Error("Property `onClose` must be a function");return e}(t),o=u('\n\t\t<div class="basicLightbox '.concat(o.className,'">\n\t\t\t<div class="basicLightbox__placeholder" role="dialog"></div>\n\t\t</div>\n\t')),r=o.querySelector(".basicLightbox__placeholder"),e.forEach(function(e){return r.appendChild(e)}),e=a(r,"IMG"),i=a(r,"VIDEO"),c=a(r,"IFRAME"),!0===e&&o.classList.add("basicLightbox--img"),!0===i&&o.classList.add("basicLightbox--video"),!0===c&&o.classList.add("basicLightbox--iframe");var o,r,i,c,l=o,s=(!0===t.closable&&l.addEventListener("click",function(e){e.target===l&&n()}),{element:function(){return l},visible:function(){return f(l)},show:function(e){return!1!==t.onShow(s)&&(n=l,document.body.appendChild(n),setTimeout(function(){requestAnimationFrame(function(){if(n.classList.add("basicLightbox--visible"),"function"==typeof e)return e(s)})},10),!0);var n},close:n});return s}},{}]},{},[1])(1)});