Socket
Socket
Sign inDemoInstall

@pluginjs/dom

Package Overview
Dependencies
2
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.8.4 to 0.8.5

4

dist/dom.common.js
/*!
* @pluginjs/dom v0.8.4 (https://pluginjs.com)
* Copyright 2020 Creation Studio Limited
* @pluginjs/dom v0.8.5 (https://pluginjs.com)
* Copyright 2021 Creation Studio Limited
* Released under the GPL-3.0 License.

@@ -5,0 +5,0 @@ */

/*!
* @pluginjs/dom v0.8.4 (https://pluginjs.com)
* Copyright 2020 Creation Studio Limited
* @pluginjs/dom v0.8.5 (https://pluginjs.com)
* Copyright 2021 Creation Studio Limited
* Released under the GPL-3.0 License.
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@pluginjs/utils"),t=require("@pluginjs/is"),r=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Array.isArray(t[0])?t[0].reduce((e,r,n)=>e+t[n]+r):t[0],o=document.createElement("div");if(o.innerHTML=n,1===o.children.length)return o.children[0];var i=document.createDocumentFragment();if(o.children.length)for(;o.children.length>0;)i.appendChild(o.children[0]);else for(;o.childNodes.length>0;)i.appendChild(o.childNodes[0]);return i},n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(t.querySelectorAll(e))},o=e.curry((e,t)=>t.querySelector(e)),i=e.curry((e,t)=>Array.from(t.querySelectorAll(e))),s=(e,r)=>(t.isString(e)||void 0!==r||(r=e,e=void 0),t.isElement(r)?t.isString(e)?(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),Array.from(r.children).filter(t=>t.matches(e))):Array.from(r.children):[]),p=e.curry((e,t)=>{var r=t.previousElementSibling;return r?e(r)?r:p(e,r):null}),a=e.curry((e,t)=>{var r=t.nextElementSibling;return r?e(r)?r:a(e,r):null}),l=e.curry((e,t)=>{var r=t.parentNode;return!(!r||r===document)&&(e(r)?r:l(e,r))}),d="__pluginjsData",c=e=>e[d]=e[d]||{},m=(r,n)=>{t.isElement(r)&&void 0===n&&(n=r,r=void 0);var o=c(n);if(r){if(!(r in o)){var i=n.dataset[r]||n.dataset[e.camelize(r,!1)];if(void 0!==i){try{i=JSON.parse(i)}catch(e){}o[r]=i}}return o[r]}return o},u=(e,t,r)=>(c(r)[e]=t,r),h=e.curryWith((e,r,n)=>{if(t.isElement(r)&&void 0===n&&(n=r,r=void 0),"string"==typeof e){if(void 0===r)return m(e,n);u(e,r,n)}else Object.entries(e).forEach(e=>{var[t,r]=e;return u(t,r,n)});return n},t.isElement),y=e.curryWith((e,r,n)=>{if(t.isElement(r)&&void 0===n&&(n=r,r=void 0),"string"==typeof e){if(void 0===r)return n.getAttribute(e);n.setAttribute(e,r)}else Object.entries(e).forEach(e=>{var[t,r]=e;return n.setAttribute(t,r)});return n},t.isElement),f=e.curry((e,t)=>(e.split(" ").forEach(e=>{t.removeAttribute(e)}),t)),v={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},x=e.curryWith((e,r,n)=>{if(t.isElement(r)&&void 0===n&&(n=r,r=void 0),"string"==typeof e){if(void 0===r)return n[v[e]||e];n[v[e]||e]=r}else Object.entries(e).forEach(e=>{var[t,r]=e;n[v[t]||t]=r});return n},t.isElement),g=e.curry((e,t)=>(e.split(" ").forEach(e=>{delete t[e=v[e]||e]}),t)),E=e.curry(e=>e.cloneNode(!0)),S=e.curry(e=>(e.parentNode&&e.parentNode.removeChild(e),e)),N=e.curry(e=>{t.isIE()||t.isIE11()?e.removeNode(!0):e.remove()}),b=e.curry(e=>{for(;e.lastChild;)e.removeChild(e.lastChild);return e}),A=e.curryWith((e,r)=>(t.isString(e)||void 0!==r||(r=e,e=void 0),void 0===e?r.innerHTML:(r.innerHTML=e,r)),t.isElement),M=e.curryWith((e,r)=>(t.isString(e)||void 0!==r||(r=e,e=void 0),void 0===e?r.textContent:(r.textContent=e,r)),t.isElement),L=e.curry((e,r)=>(t.isString(e)?r.insertAdjacentHTML("beforeend",e):r.appendChild(e),r)),T=e.curry((e,n)=>(t.isString(e)&&(e=r(e)),n.appendChild(e),e)),C=e.curry((e,r)=>(t.isString(e)?r.insertAdjacentHTML("afterbegin",e):(F(),r.prepend(e)),r)),H=e.curry((e,n)=>(t.isString(e)&&(e=r(e)),F(),n.prepend(e),e)),j=e.curry((e,r)=>(t.isString(e)?r.insertAdjacentHTML("beforebegin",e):r.parentNode.insertBefore(e,r),r)),O=e.curry((e,n)=>(t.isString(e)&&(e=r(e)),NodeList.prototype.isPrototypeOf(e)?e.forEach(e=>{n.parentNode.insertBefore(e,n)}):n.parentNode.insertBefore(e,n),e)),D=e.curry((e,r)=>(t.isString(e)?r.insertAdjacentHTML("afterend",e):r.parentNode.insertBefore(e,r.nextElementSibling),r)),B=e.curry((e,n)=>(t.isString(e)&&(e=r(e)),NodeList.prototype.isPrototypeOf(e)?e.forEach(e=>{n.parentNode.insertBefore(e,n.nextElementSibling)}):n.parentNode.insertBefore(e,n.nextElementSibling),e)),I=e.curry((e,n)=>(t.isString(e)&&(e=r(e)),O(e,n),L(n,e),e)),P=e.curry((e,n)=>(t.isString(e)&&(e=r(e)),e.innerHTML=n.innerHTML,n.innerHTML="",n.append(e),n)),W=e.curry((e,n)=>(t.isString(e)&&(e=r(e)),O(e,n[0]),e.append(...n),e)),q=e.curryWith((e,r)=>{t.isString(e)||void 0!==r||(r=e,e=void 0);var n=r.parentNode;return Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),e&&!n.matches(e)||(s(n).forEach(e=>{O(e,n)}),t.isIE()||t.isIE11()?n.removeNode(!0):n.remove()),r},t.isElement),w=e.curry((e,n)=>(t.isString(e)&&(e=r(e)),n.parentNode.replaceChild(e,n),t.isIE()||t.isIE11()?n.removeNode(!0):n.remove(),e)),F=()=>{[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(e){e.prepend=e.prepend||function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach((function(e){var r=e instanceof Node;t.appendChild(r?e:document.createTextNode(String(e)))})),this.insertBefore(t,this.firstChild)}}))};exports.after=D,exports.append=L,exports.appendTo=T,exports.attr=y,exports.before=j,exports.children=s,exports.clone=E,exports.closest=(e,t)=>(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),t.matches(e)?t:l(t=>t.matches(e),t)),exports.contents=e=>"IFRAME"===e.tagName?[e.contentDocument]:e.childNodes,exports.data=h,exports.detach=S,exports.docReady=e=>{var t=document.readyState;"complete"===t||"interactive"===t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},exports.empty=b,exports.find=o,exports.findAll=i,exports.getData=m,exports.has=(e,r)=>t.isString(e)?Boolean(n(e,r).length):r.contains(e),exports.hasData=e=>d in e&&!t.isEmptyObject(e[d]),exports.html=A,exports.indexOf=e=>[...e.parentElement.children].indexOf(e),exports.insertAfter=B,exports.insertBefore=O,exports.next=e=>e.nextElementSibling,exports.nextWith=a,exports.offsetParent=e=>{for(var t=e.offsetParent;t&&"static"===t.style.position;)t=t.offsetParent;return t||document.documentElement},exports.parent=e=>e.parentNode,exports.parentWith=l,exports.parents=(e,r)=>{t.isString(e)||void 0!==r||(r=e,e=void 0);for(var n=[],o=r;t.isElement(o)&&o.parentNode&&o!==document.body.parentNode;)o=o.parentNode,Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),(!e||e&&o.matches(e))&&n.push(o);return n},exports.parseHTML=r,exports.prepend=C,exports.prependTo=H,exports.prev=e=>e.previousElementSibling,exports.prevWith=p,exports.prop=x,exports.query=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelector(e)},exports.queryAll=n,exports.remove=N,exports.removeAttr=f,exports.removeData=(e,r)=>(t.isElement(e)&&void 0===r&&(r=e,e=void 0),void 0===e?delete r[d]:delete c(r)[e],r),exports.removeProp=g,exports.replace=w,exports.scrollParent=e=>l(e=>e.scrollHeight>e.clientHeight,e),exports.setData=u,exports.siblings=(e,r)=>(t.isString(e)||void 0!==r||(r=e,e=void 0),t.isElement(r)?s(e,r.parentNode).filter(e=>e!==r):[]),exports.text=M,exports.unwrap=q,exports.wrap=I,exports.wrapAll=W,exports.wrapInner=P;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@pluginjs/utils"),t=require("@pluginjs/is"),r=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Array.isArray(t[0])?t[0].reduce(((e,r,n)=>e+t[n]+r)):t[0],o=document.createElement("div");if(o.innerHTML=n,1===o.children.length)return o.children[0];var i=document.createDocumentFragment();if(o.children.length)for(;o.children.length>0;)i.appendChild(o.children[0]);else for(;o.childNodes.length>0;)i.appendChild(o.childNodes[0]);return i},n=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(t.querySelectorAll(e))},o=e.curry(((e,t)=>t.querySelector(e))),i=e.curry(((e,t)=>Array.from(t.querySelectorAll(e)))),s=(e,r)=>(t.isString(e)||void 0!==r||(r=e,e=void 0),t.isElement(r)?t.isString(e)?(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),Array.from(r.children).filter((t=>t.matches(e)))):Array.from(r.children):[]),p=e.curry(((e,t)=>{var r=t.previousElementSibling;return r?e(r)?r:p(e,r):null})),a=e.curry(((e,t)=>{var r=t.nextElementSibling;return r?e(r)?r:a(e,r):null})),l=e.curry(((e,t)=>{var r=t.parentNode;return!(!r||r===document)&&(e(r)?r:l(e,r))})),d="__pluginjsData",c=e=>e[d]=e[d]||{},m=(r,n)=>{t.isElement(r)&&void 0===n&&(n=r,r=void 0);var o=c(n);if(r){if(!(r in o)){var i=n.dataset[r]||n.dataset[e.camelize(r,!1)];if(void 0!==i){try{i=JSON.parse(i)}catch(e){}o[r]=i}}return o[r]}return o},u=(e,t,r)=>(c(r)[e]=t,r),h=e.curryWith(((e,r,n)=>{if(t.isElement(r)&&void 0===n&&(n=r,r=void 0),"string"==typeof e){if(void 0===r)return m(e,n);u(e,r,n)}else Object.entries(e).forEach((e=>{var[t,r]=e;return u(t,r,n)}));return n}),t.isElement),y=e.curryWith(((e,r,n)=>{if(t.isElement(r)&&void 0===n&&(n=r,r=void 0),"string"==typeof e){if(void 0===r)return n.getAttribute(e);n.setAttribute(e,r)}else Object.entries(e).forEach((e=>{var[t,r]=e;return n.setAttribute(t,r)}));return n}),t.isElement),f=e.curry(((e,t)=>(e.split(" ").forEach((e=>{t.removeAttribute(e)})),t))),v={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},x=e.curryWith(((e,r,n)=>{if(t.isElement(r)&&void 0===n&&(n=r,r=void 0),"string"==typeof e){if(void 0===r)return n[v[e]||e];n[v[e]||e]=r}else Object.entries(e).forEach((e=>{var[t,r]=e;n[v[t]||t]=r}));return n}),t.isElement),g=e.curry(((e,t)=>(e.split(" ").forEach((e=>{delete t[e=v[e]||e]})),t))),E=e.curry((e=>e.cloneNode(!0))),S=e.curry((e=>(e.parentNode&&e.parentNode.removeChild(e),e))),N=e.curry((e=>{t.isIE()||t.isIE11()?e.removeNode(!0):e.remove()})),b=e.curry((e=>{for(;e.lastChild;)e.removeChild(e.lastChild);return e})),A=e.curryWith(((e,r)=>(t.isString(e)||void 0!==r||(r=e,e=void 0),void 0===e?r.innerHTML:(r.innerHTML=e,r))),t.isElement),M=e.curryWith(((e,r)=>(t.isString(e)||void 0!==r||(r=e,e=void 0),void 0===e?r.textContent:(r.textContent=e,r))),t.isElement),L=e.curry(((e,r)=>(t.isString(e)?r.insertAdjacentHTML("beforeend",e):r.appendChild(e),r))),T=e.curry(((e,n)=>(t.isString(e)&&(e=r(e)),n.appendChild(e),e))),C=e.curry(((e,r)=>(t.isString(e)?r.insertAdjacentHTML("afterbegin",e):(F(),r.prepend(e)),r))),H=e.curry(((e,n)=>(t.isString(e)&&(e=r(e)),F(),n.prepend(e),e))),j=e.curry(((e,r)=>(t.isString(e)?r.insertAdjacentHTML("beforebegin",e):r.parentNode.insertBefore(e,r),r))),O=e.curry(((e,n)=>(t.isString(e)&&(e=r(e)),NodeList.prototype.isPrototypeOf(e)?e.forEach((e=>{n.parentNode.insertBefore(e,n)})):n.parentNode.insertBefore(e,n),e))),D=e.curry(((e,r)=>(t.isString(e)?r.insertAdjacentHTML("afterend",e):r.parentNode.insertBefore(e,r.nextElementSibling),r))),B=e.curry(((e,n)=>(t.isString(e)&&(e=r(e)),NodeList.prototype.isPrototypeOf(e)?e.forEach((e=>{n.parentNode.insertBefore(e,n.nextElementSibling)})):n.parentNode.insertBefore(e,n.nextElementSibling),e))),I=e.curry(((e,n)=>(t.isString(e)&&(e=r(e)),O(e,n),L(n,e),e))),P=e.curry(((e,n)=>(t.isString(e)&&(e=r(e)),e.innerHTML=n.innerHTML,n.innerHTML="",n.append(e),n))),W=e.curry(((e,n)=>(t.isString(e)&&(e=r(e)),O(e,n[0]),e.append(...n),e))),q=e.curryWith(((e,r)=>{t.isString(e)||void 0!==r||(r=e,e=void 0);var n=r.parentNode;return Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),e&&!n.matches(e)||(s(n).forEach((e=>{O(e,n)})),t.isIE()||t.isIE11()?n.removeNode(!0):n.remove()),r}),t.isElement),w=e.curry(((e,n)=>(t.isString(e)&&(e=r(e)),n.parentNode.replaceChild(e,n),t.isIE()||t.isIE11()?n.removeNode(!0):n.remove(),e))),F=()=>{[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(e){e.prepend=e.prepend||function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach((function(e){var r=e instanceof Node;t.appendChild(r?e:document.createTextNode(String(e)))})),this.insertBefore(t,this.firstChild)}}))};exports.after=D,exports.append=L,exports.appendTo=T,exports.attr=y,exports.before=j,exports.children=s,exports.clone=E,exports.closest=(e,t)=>(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),t.matches(e)?t:l((t=>t.matches(e)),t)),exports.contents=e=>"IFRAME"===e.tagName?[e.contentDocument]:e.childNodes,exports.data=h,exports.detach=S,exports.docReady=e=>{var t=document.readyState;"complete"===t||"interactive"===t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},exports.empty=b,exports.find=o,exports.findAll=i,exports.getData=m,exports.has=(e,r)=>t.isString(e)?Boolean(n(e,r).length):r.contains(e),exports.hasData=e=>d in e&&!t.isEmptyObject(e[d]),exports.html=A,exports.indexOf=e=>[...e.parentElement.children].indexOf(e),exports.insertAfter=B,exports.insertBefore=O,exports.next=e=>e.nextElementSibling,exports.nextWith=a,exports.offsetParent=e=>{for(var t=e.offsetParent;t&&"static"===t.style.position;)t=t.offsetParent;return t||document.documentElement},exports.parent=e=>e.parentNode,exports.parentWith=l,exports.parents=(e,r)=>{t.isString(e)||void 0!==r||(r=e,e=void 0);for(var n=[],o=r;t.isElement(o)&&o.parentNode&&o!==document.body.parentNode;)o=o.parentNode,Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),(!e||e&&o.matches(e))&&n.push(o);return n},exports.parseHTML=r,exports.prepend=C,exports.prependTo=H,exports.prev=e=>e.previousElementSibling,exports.prevWith=p,exports.prop=x,exports.query=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelector(e)},exports.queryAll=n,exports.remove=N,exports.removeAttr=f,exports.removeData=(e,r)=>(t.isElement(e)&&void 0===r&&(r=e,e=void 0),void 0===e?delete r[d]:delete c(r)[e],r),exports.removeProp=g,exports.replace=w,exports.scrollParent=e=>l((e=>e.scrollHeight>e.clientHeight),e),exports.setData=u,exports.siblings=(e,r)=>(t.isString(e)||void 0!==r||(r=e,e=void 0),t.isElement(r)?s(e,r.parentNode).filter((e=>e!==r)):[]),exports.text=M,exports.unwrap=q,exports.wrap=I,exports.wrapAll=W,exports.wrapInner=P;
/*!
* @pluginjs/dom v0.8.4 (https://pluginjs.com)
* Copyright 2020 Creation Studio Limited
* @pluginjs/dom v0.8.5 (https://pluginjs.com)
* Copyright 2021 Creation Studio Limited
* Released under the GPL-3.0 License.

@@ -5,0 +5,0 @@ */

/*!
* @pluginjs/dom v0.8.4 (https://pluginjs.com)
* Copyright 2020 Creation Studio Limited
* @pluginjs/dom v0.8.5 (https://pluginjs.com)
* Copyright 2021 Creation Studio Limited
* Released under the GPL-3.0 License.
*/
import{curry as e,camelize as t,curryWith as r}from"@pluginjs/utils";import{isString as n,isElement as o,isEmptyObject as i,isIE as a,isIE11 as d}from"@pluginjs/is";var l=e=>{var t=document.readyState;"complete"===t||"interactive"===t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},c=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Array.isArray(t[0])?t[0].reduce((e,r,n)=>e+t[n]+r):t[0],o=document.createElement("div");if(o.innerHTML=n,1===o.children.length)return o.children[0];var i=document.createDocumentFragment();if(o.children.length)for(;o.children.length>0;)i.appendChild(o.children[0]);else for(;o.childNodes.length>0;)i.appendChild(o.childNodes[0]);return i},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelector(e)},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(t.querySelectorAll(e))},m=e((e,t)=>t.querySelector(e)),f=e((e,t)=>Array.from(t.querySelectorAll(e))),h=(e,t)=>n(e)?Boolean(s(e,t).length):t.contains(e),u=e=>"IFRAME"===e.tagName?[e.contentDocument]:e.childNodes,v=(e,t)=>(n(e)||void 0!==t||(t=e,e=void 0),o(t)?n(e)?(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),Array.from(t.children).filter(t=>t.matches(e))):Array.from(t.children):[]),y=(e,t)=>(n(e)||void 0!==t||(t=e,e=void 0),o(t)?v(e,t.parentNode).filter(e=>e!==t):[]),g=e=>e.previousElementSibling,E=e=>e.nextElementSibling,N=e((e,t)=>{var r=t.previousElementSibling;return r?e(r)?r:N(e,r):null}),b=e((e,t)=>{var r=t.nextElementSibling;return r?e(r)?r:b(e,r):null}),S=e=>e.parentNode,A=(e,t)=>{n(e)||void 0!==t||(t=e,e=void 0);for(var r=[],i=t;o(i)&&i.parentNode&&i!==document.body.parentNode;)i=i.parentNode,Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),(!e||e&&i.matches(e))&&r.push(i);return r},M=e((e,t)=>{var r=t.parentNode;return!(!r||r===document)&&(e(r)?r:M(e,r))}),L=(e,t)=>(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),t.matches(e)?t:M(t=>t.matches(e),t)),x=e=>{for(var t=e.offsetParent;t&&"static"===t.style.position;)t=t.offsetParent;return t||document.documentElement},C=e=>M(e=>e.scrollHeight>e.clientHeight,e),H=e=>[...e.parentElement.children].indexOf(e),T="__pluginjsData",j=e=>e[T]=e[T]||{},B=(e,r)=>{o(e)&&void 0===r&&(r=e,e=void 0);var n=j(r);if(e){if(!(e in n)){var i=r.dataset[e]||r.dataset[t(e,!1)];if(void 0!==i){try{i=JSON.parse(i)}catch(e){}n[e]=i}}return n[e]}return n},O=(e,t,r)=>(j(r)[e]=t,r),D=(e,t)=>(o(e)&&void 0===t&&(t=e,e=void 0),void 0===e?delete t[T]:delete j(t)[e],t),F=e=>T in e&&!i(e[T]),P=r((e,t,r)=>{if(o(t)&&void 0===r&&(r=t,t=void 0),"string"==typeof e){if(void 0===t)return B(e,r);O(e,t,r)}else Object.entries(e).forEach(e=>{var[t,n]=e;return O(t,n,r)});return r},o),q=r((e,t,r)=>{if(o(t)&&void 0===r&&(r=t,t=void 0),"string"==typeof e){if(void 0===t)return r.getAttribute(e);r.setAttribute(e,t)}else Object.entries(e).forEach(e=>{var[t,n]=e;return r.setAttribute(t,n)});return r},o),w=e((e,t)=>(e.split(" ").forEach(e=>{t.removeAttribute(e)}),t)),I={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},_=r((e,t,r)=>{if(o(t)&&void 0===r&&(r=t,t=void 0),"string"==typeof e){if(void 0===t)return r[I[e]||e];r[I[e]||e]=t}else Object.entries(e).forEach(e=>{var[t,n]=e;r[I[t]||t]=n});return r},o),J=e((e,t)=>(e.split(" ").forEach(e=>{delete t[e=I[e]||e]}),t)),R=e(e=>e.cloneNode(!0)),k=e(e=>(e.parentNode&&e.parentNode.removeChild(e),e)),z=e(e=>{a()||d()?e.removeNode(!0):e.remove()}),G=e(e=>{for(;e.lastChild;)e.removeChild(e.lastChild);return e}),K=r((e,t)=>(n(e)||void 0!==t||(t=e,e=void 0),void 0===e?t.innerHTML:(t.innerHTML=e,t)),o),Q=r((e,t)=>(n(e)||void 0!==t||(t=e,e=void 0),void 0===e?t.textContent:(t.textContent=e,t)),o),U=e((e,t)=>(n(e)?t.insertAdjacentHTML("beforeend",e):t.appendChild(e),t)),V=e((e,t)=>(n(e)&&(e=c(e)),t.appendChild(e),e)),W=e((e,t)=>(n(e)?t.insertAdjacentHTML("afterbegin",e):(ae(),t.prepend(e)),t)),X=e((e,t)=>(n(e)&&(e=c(e)),ae(),t.prepend(e),e)),Y=e((e,t)=>(n(e)?t.insertAdjacentHTML("beforebegin",e):t.parentNode.insertBefore(e,t),t)),Z=e((e,t)=>(n(e)&&(e=c(e)),NodeList.prototype.isPrototypeOf(e)?e.forEach(e=>{t.parentNode.insertBefore(e,t)}):t.parentNode.insertBefore(e,t),e)),$=e((e,t)=>(n(e)?t.insertAdjacentHTML("afterend",e):t.parentNode.insertBefore(e,t.nextElementSibling),t)),ee=e((e,t)=>(n(e)&&(e=c(e)),NodeList.prototype.isPrototypeOf(e)?e.forEach(e=>{t.parentNode.insertBefore(e,t.nextElementSibling)}):t.parentNode.insertBefore(e,t.nextElementSibling),e)),te=e((e,t)=>(n(e)&&(e=c(e)),Z(e,t),U(t,e),e)),re=e((e,t)=>(n(e)&&(e=c(e)),e.innerHTML=t.innerHTML,t.innerHTML="",t.append(e),t)),ne=e((e,t)=>(n(e)&&(e=c(e)),Z(e,t[0]),e.append(...t),e)),oe=r((e,t)=>{n(e)||void 0!==t||(t=e,e=void 0);var r=t.parentNode;return Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),e&&!r.matches(e)||(v(r).forEach(e=>{Z(e,r)}),a()||d()?r.removeNode(!0):r.remove()),t},o),ie=e((e,t)=>(n(e)&&(e=c(e)),t.parentNode.replaceChild(e,t),a()||d()?t.removeNode(!0):t.remove(),e)),ae=()=>{[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(e){e.prepend=e.prepend||function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach((function(e){var r=e instanceof Node;t.appendChild(r?e:document.createTextNode(String(e)))})),this.insertBefore(t,this.firstChild)}}))};export{$ as after,U as append,V as appendTo,q as attr,Y as before,v as children,R as clone,L as closest,u as contents,P as data,k as detach,l as docReady,G as empty,m as find,f as findAll,B as getData,h as has,F as hasData,K as html,H as indexOf,ee as insertAfter,Z as insertBefore,E as next,b as nextWith,x as offsetParent,S as parent,M as parentWith,A as parents,c as parseHTML,W as prepend,X as prependTo,g as prev,N as prevWith,_ as prop,p as query,s as queryAll,z as remove,w as removeAttr,D as removeData,J as removeProp,ie as replace,C as scrollParent,O as setData,y as siblings,Q as text,oe as unwrap,te as wrap,ne as wrapAll,re as wrapInner};
import{curry as e,camelize as t,curryWith as r}from"@pluginjs/utils";import{isString as n,isElement as o,isEmptyObject as i,isIE as a,isIE11 as d}from"@pluginjs/is";var l=e=>{var t=document.readyState;"complete"===t||"interactive"===t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},c=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Array.isArray(t[0])?t[0].reduce(((e,r,n)=>e+t[n]+r)):t[0],o=document.createElement("div");if(o.innerHTML=n,1===o.children.length)return o.children[0];var i=document.createDocumentFragment();if(o.children.length)for(;o.children.length>0;)i.appendChild(o.children[0]);else for(;o.childNodes.length>0;)i.appendChild(o.childNodes[0]);return i},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelector(e)},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(t.querySelectorAll(e))},m=e(((e,t)=>t.querySelector(e))),f=e(((e,t)=>Array.from(t.querySelectorAll(e)))),h=(e,t)=>n(e)?Boolean(s(e,t).length):t.contains(e),u=e=>"IFRAME"===e.tagName?[e.contentDocument]:e.childNodes,v=(e,t)=>(n(e)||void 0!==t||(t=e,e=void 0),o(t)?n(e)?(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),Array.from(t.children).filter((t=>t.matches(e)))):Array.from(t.children):[]),y=(e,t)=>(n(e)||void 0!==t||(t=e,e=void 0),o(t)?v(e,t.parentNode).filter((e=>e!==t)):[]),g=e=>e.previousElementSibling,E=e=>e.nextElementSibling,N=e(((e,t)=>{var r=t.previousElementSibling;return r?e(r)?r:N(e,r):null})),b=e(((e,t)=>{var r=t.nextElementSibling;return r?e(r)?r:b(e,r):null})),S=e=>e.parentNode,A=(e,t)=>{n(e)||void 0!==t||(t=e,e=void 0);for(var r=[],i=t;o(i)&&i.parentNode&&i!==document.body.parentNode;)i=i.parentNode,Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),(!e||e&&i.matches(e))&&r.push(i);return r},M=e(((e,t)=>{var r=t.parentNode;return!(!r||r===document)&&(e(r)?r:M(e,r))})),L=(e,t)=>(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),t.matches(e)?t:M((t=>t.matches(e)),t)),x=e=>{for(var t=e.offsetParent;t&&"static"===t.style.position;)t=t.offsetParent;return t||document.documentElement},C=e=>M((e=>e.scrollHeight>e.clientHeight),e),H=e=>[...e.parentElement.children].indexOf(e),T="__pluginjsData",j=e=>e[T]=e[T]||{},B=(e,r)=>{o(e)&&void 0===r&&(r=e,e=void 0);var n=j(r);if(e){if(!(e in n)){var i=r.dataset[e]||r.dataset[t(e,!1)];if(void 0!==i){try{i=JSON.parse(i)}catch(e){}n[e]=i}}return n[e]}return n},O=(e,t,r)=>(j(r)[e]=t,r),D=(e,t)=>(o(e)&&void 0===t&&(t=e,e=void 0),void 0===e?delete t[T]:delete j(t)[e],t),F=e=>T in e&&!i(e[T]),P=r(((e,t,r)=>{if(o(t)&&void 0===r&&(r=t,t=void 0),"string"==typeof e){if(void 0===t)return B(e,r);O(e,t,r)}else Object.entries(e).forEach((e=>{var[t,n]=e;return O(t,n,r)}));return r}),o),q=r(((e,t,r)=>{if(o(t)&&void 0===r&&(r=t,t=void 0),"string"==typeof e){if(void 0===t)return r.getAttribute(e);r.setAttribute(e,t)}else Object.entries(e).forEach((e=>{var[t,n]=e;return r.setAttribute(t,n)}));return r}),o),w=e(((e,t)=>(e.split(" ").forEach((e=>{t.removeAttribute(e)})),t))),I={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},_=r(((e,t,r)=>{if(o(t)&&void 0===r&&(r=t,t=void 0),"string"==typeof e){if(void 0===t)return r[I[e]||e];r[I[e]||e]=t}else Object.entries(e).forEach((e=>{var[t,n]=e;r[I[t]||t]=n}));return r}),o),J=e(((e,t)=>(e.split(" ").forEach((e=>{delete t[e=I[e]||e]})),t))),R=e((e=>e.cloneNode(!0))),k=e((e=>(e.parentNode&&e.parentNode.removeChild(e),e))),z=e((e=>{a()||d()?e.removeNode(!0):e.remove()})),G=e((e=>{for(;e.lastChild;)e.removeChild(e.lastChild);return e})),K=r(((e,t)=>(n(e)||void 0!==t||(t=e,e=void 0),void 0===e?t.innerHTML:(t.innerHTML=e,t))),o),Q=r(((e,t)=>(n(e)||void 0!==t||(t=e,e=void 0),void 0===e?t.textContent:(t.textContent=e,t))),o),U=e(((e,t)=>(n(e)?t.insertAdjacentHTML("beforeend",e):t.appendChild(e),t))),V=e(((e,t)=>(n(e)&&(e=c(e)),t.appendChild(e),e))),W=e(((e,t)=>(n(e)?t.insertAdjacentHTML("afterbegin",e):(ae(),t.prepend(e)),t))),X=e(((e,t)=>(n(e)&&(e=c(e)),ae(),t.prepend(e),e))),Y=e(((e,t)=>(n(e)?t.insertAdjacentHTML("beforebegin",e):t.parentNode.insertBefore(e,t),t))),Z=e(((e,t)=>(n(e)&&(e=c(e)),NodeList.prototype.isPrototypeOf(e)?e.forEach((e=>{t.parentNode.insertBefore(e,t)})):t.parentNode.insertBefore(e,t),e))),$=e(((e,t)=>(n(e)?t.insertAdjacentHTML("afterend",e):t.parentNode.insertBefore(e,t.nextElementSibling),t))),ee=e(((e,t)=>(n(e)&&(e=c(e)),NodeList.prototype.isPrototypeOf(e)?e.forEach((e=>{t.parentNode.insertBefore(e,t.nextElementSibling)})):t.parentNode.insertBefore(e,t.nextElementSibling),e))),te=e(((e,t)=>(n(e)&&(e=c(e)),Z(e,t),U(t,e),e))),re=e(((e,t)=>(n(e)&&(e=c(e)),e.innerHTML=t.innerHTML,t.innerHTML="",t.append(e),t))),ne=e(((e,t)=>(n(e)&&(e=c(e)),Z(e,t[0]),e.append(...t),e))),oe=r(((e,t)=>{n(e)||void 0!==t||(t=e,e=void 0);var r=t.parentNode;return Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),e&&!r.matches(e)||(v(r).forEach((e=>{Z(e,r)})),a()||d()?r.removeNode(!0):r.remove()),t}),o),ie=e(((e,t)=>(n(e)&&(e=c(e)),t.parentNode.replaceChild(e,t),a()||d()?t.removeNode(!0):t.remove(),e))),ae=()=>{[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(e){e.prepend=e.prepend||function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach((function(e){var r=e instanceof Node;t.appendChild(r?e:document.createTextNode(String(e)))})),this.insertBefore(t,this.firstChild)}}))};export{$ as after,U as append,V as appendTo,q as attr,Y as before,v as children,R as clone,L as closest,u as contents,P as data,k as detach,l as docReady,G as empty,m as find,f as findAll,B as getData,h as has,F as hasData,K as html,H as indexOf,ee as insertAfter,Z as insertBefore,E as next,b as nextWith,x as offsetParent,S as parent,M as parentWith,A as parents,c as parseHTML,W as prepend,X as prependTo,g as prev,N as prevWith,_ as prop,p as query,s as queryAll,z as remove,w as removeAttr,D as removeData,J as removeProp,ie as replace,C as scrollParent,O as setData,y as siblings,Q as text,oe as unwrap,te as wrap,ne as wrapAll,re as wrapInner};
/*!
* @pluginjs/dom v0.8.4 (https://pluginjs.com)
* Copyright 2020 Creation Studio Limited
* @pluginjs/dom v0.8.5 (https://pluginjs.com)
* Copyright 2021 Creation Studio Limited
* Released under the GPL-3.0 License.

@@ -9,3 +9,3 @@ */

typeof define === 'function' && define.amd ? define(['exports', '@pluginjs/utils', '@pluginjs/is'], factory) :
(global = global || self, factory(global['@pluginjs/dom'] = {}, global['@pluginjs/utils'], global['@pluginjs/is']));
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['@pluginjs/dom'] = {}, global['@pluginjs/utils'], global['@pluginjs/is']));
}(this, (function (exports, utils, is) { 'use strict';

@@ -12,0 +12,0 @@

/*!
* @pluginjs/dom v0.8.4 (https://pluginjs.com)
* Copyright 2020 Creation Studio Limited
* @pluginjs/dom v0.8.5 (https://pluginjs.com)
* Copyright 2021 Creation Studio Limited
* Released under the GPL-3.0 License.
*/
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@pluginjs/utils"),require("@pluginjs/is")):"function"==typeof define&&define.amd?define(["exports","@pluginjs/utils","@pluginjs/is"],t):t((e=e||self)["@pluginjs/dom"]={},e["@pluginjs/utils"],e["@pluginjs/is"])}(this,(function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var u,c=e[Symbol.iterator]();!(n=(u=c.next()).done)&&(r.push(u.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(i)throw o}}return r}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||o(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 o(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var c=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Array.isArray(t[0])?t[0].reduce((function(e,r,n){return e+t[n]+r})):t[0],i=document.createElement("div");if(i.innerHTML=n,1===i.children.length)return i.children[0];var o=document.createDocumentFragment();if(i.children.length)for(;i.children.length>0;)o.appendChild(i.children[0]);else for(;i.childNodes.length>0;)o.appendChild(i.childNodes[0]);return o},a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(t.querySelectorAll(e))},l=t.curry((function(e,t){return t.querySelector(e)})),s=t.curry((function(e,t){return Array.from(t.querySelectorAll(e))})),f=function(e,t){return r.isString(e)||void 0!==t||(t=e,e=void 0),r.isElement(t)?r.isString(e)?(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),Array.from(t.children).filter((function(t){return t.matches(e)}))):Array.from(t.children):[]},d=t.curry((function(e,t){var r=t.previousElementSibling;return r?e(r)?r:d(e,r):null})),p=t.curry((function(e,t){var r=t.nextElementSibling;return r?e(r)?r:p(e,r):null})),m=t.curry((function(e,t){var r=t.parentNode;return!(!r||r===document)&&(e(r)?r:m(e,r))})),y="__pluginjsData",h=function(e){return e[y]=e[y]||{}},v=function(e,n){r.isElement(e)&&void 0===n&&(n=e,e=void 0);var i=h(n);if(e){if(!(e in i)){var o=n.dataset[e]||n.dataset[t.camelize(e,!1)];if(void 0!==o){try{o=JSON.parse(o)}catch(e){}i[e]=o}}return i[e]}return i},g=function(e,t,r){return h(r)[e]=t,r},E=t.curryWith((function(e,t,i){if(r.isElement(t)&&void 0===i&&(i=t,t=void 0),"string"==typeof e){if(void 0===t)return v(e,i);g(e,t,i)}else Object.entries(e).forEach((function(e){var t=n(e,2),r=t[0],o=t[1];return g(r,o,i)}));return i}),r.isElement),S=t.curryWith((function(e,t,i){if(r.isElement(t)&&void 0===i&&(i=t,t=void 0),"string"==typeof e){if(void 0===t)return i.getAttribute(e);i.setAttribute(e,t)}else Object.entries(e).forEach((function(e){var t=n(e,2),r=t[0],o=t[1];return i.setAttribute(r,o)}));return i}),r.isElement),b=t.curry((function(e,t){return e.split(" ").forEach((function(e){t.removeAttribute(e)})),t})),A={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},N=t.curryWith((function(e,t,i){if(r.isElement(t)&&void 0===i&&(i=t,t=void 0),"string"==typeof e){if(void 0===t)return i[A[e]||e];i[A[e]||e]=t}else Object.entries(e).forEach((function(e){var t=n(e,2),r=t[0],o=t[1];i[A[r]||r]=o}));return i}),r.isElement),j=t.curry((function(e,t){return e.split(" ").forEach((function(e){delete t[e=A[e]||e]})),t})),x=t.curry((function(e){return e.cloneNode(!0)})),M=t.curry((function(e){return e.parentNode&&e.parentNode.removeChild(e),e})),T=t.curry((function(e){r.isIE()||r.isIE11()?e.removeNode(!0):e.remove()})),L=t.curry((function(e){for(;e.lastChild;)e.removeChild(e.lastChild);return e})),O=t.curryWith((function(e,t){return r.isString(e)||void 0!==t||(t=e,e=void 0),void 0===e?t.innerHTML:(t.innerHTML=e,t)}),r.isElement),C=t.curryWith((function(e,t){return r.isString(e)||void 0!==t||(t=e,e=void 0),void 0===e?t.textContent:(t.textContent=e,t)}),r.isElement),I=t.curry((function(e,t){return r.isString(e)?t.insertAdjacentHTML("beforeend",e):t.appendChild(e),t})),w=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),t.appendChild(e),e})),H=t.curry((function(e,t){return r.isString(e)?t.insertAdjacentHTML("afterbegin",e):(U(),t.prepend(e)),t})),D=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),U(),t.prepend(e),e})),B=t.curry((function(e,t){return r.isString(e)?t.insertAdjacentHTML("beforebegin",e):t.parentNode.insertBefore(e,t),t})),P=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),NodeList.prototype.isPrototypeOf(e)?e.forEach((function(e){t.parentNode.insertBefore(e,t)})):t.parentNode.insertBefore(e,t),e})),W=t.curry((function(e,t){return r.isString(e)?t.insertAdjacentHTML("afterend",e):t.parentNode.insertBefore(e,t.nextElementSibling),t})),q=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),NodeList.prototype.isPrototypeOf(e)?e.forEach((function(e){t.parentNode.insertBefore(e,t.nextElementSibling)})):t.parentNode.insertBefore(e,t.nextElementSibling),e})),F=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),P(e,t),I(t,e),e})),_=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),e.innerHTML=t.innerHTML,t.innerHTML="",t.append(e),t})),R=t.curry((function(e,t){var n;return r.isString(e)&&(e=c(e)),P(e,t[0]),(n=e).append.apply(n,i(t)),e})),z=t.curryWith((function(e,t){r.isString(e)||void 0!==t||(t=e,e=void 0);var n=t.parentNode;return Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),e&&!n.matches(e)||(f(n).forEach((function(e){P(e,n)})),r.isIE()||r.isIE11()?n.removeNode(!0):n.remove()),t}),r.isElement),J=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),t.parentNode.replaceChild(e,t),r.isIE()||r.isIE11()?t.removeNode(!0):t.remove(),e})),U=function(){[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(e){e.prepend=e.prepend||function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach((function(e){var r=e instanceof Node;t.appendChild(r?e:document.createTextNode(String(e)))})),this.insertBefore(t,this.firstChild)}}))};e.after=W,e.append=I,e.appendTo=w,e.attr=S,e.before=B,e.children=f,e.clone=x,e.closest=function(e,t){return Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),t.matches(e)?t:m((function(t){return t.matches(e)}),t)},e.contents=function(e){return"IFRAME"===e.tagName?[e.contentDocument]:e.childNodes},e.data=E,e.detach=M,e.docReady=function(e){var t=document.readyState;"complete"===t||"interactive"===t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},e.empty=L,e.find=l,e.findAll=s,e.getData=v,e.has=function(e,t){return r.isString(e)?Boolean(a(e,t).length):t.contains(e)},e.hasData=function(e){return y in e&&!r.isEmptyObject(e[y])},e.html=O,e.indexOf=function(e){return i(e.parentElement.children).indexOf(e)},e.insertAfter=q,e.insertBefore=P,e.next=function(e){return e.nextElementSibling},e.nextWith=p,e.offsetParent=function(e){for(var t=e.offsetParent;t&&"static"===t.style.position;)t=t.offsetParent;return t||document.documentElement},e.parent=function(e){return e.parentNode},e.parentWith=m,e.parents=function(e,t){r.isString(e)||void 0!==t||(t=e,e=void 0);for(var n=[],i=t;r.isElement(i)&&i.parentNode&&i!==document.body.parentNode;)i=i.parentNode,Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),(!e||e&&i.matches(e))&&n.push(i);return n},e.parseHTML=c,e.prepend=H,e.prependTo=D,e.prev=function(e){return e.previousElementSibling},e.prevWith=d,e.prop=N,e.query=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelector(e)},e.queryAll=a,e.remove=T,e.removeAttr=b,e.removeData=function(e,t){return r.isElement(e)&&void 0===t&&(t=e,e=void 0),void 0===e?delete t[y]:delete h(t)[e],t},e.removeProp=j,e.replace=J,e.scrollParent=function(e){return m((function(e){return e.scrollHeight>e.clientHeight}),e)},e.setData=g,e.siblings=function(e,t){return r.isString(e)||void 0!==t||(t=e,e=void 0),r.isElement(t)?f(e,t.parentNode).filter((function(e){return e!==t})):[]},e.text=C,e.unwrap=z,e.wrap=F,e.wrapAll=R,e.wrapInner=_,Object.defineProperty(e,"__esModule",{value:!0})}));
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@pluginjs/utils"),require("@pluginjs/is")):"function"==typeof define&&define.amd?define(["exports","@pluginjs/utils","@pluginjs/is"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["@pluginjs/dom"]={},e["@pluginjs/utils"],e["@pluginjs/is"])}(this,(function(e,t,r){"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var r=[],n=!0,i=!1,o=void 0;try{for(var u,c=e[Symbol.iterator]();!(n=(u=c.next()).done)&&(r.push(u.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==c.return||c.return()}finally{if(i)throw o}}return r}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||o(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 o(e,t){if(e){if("string"==typeof e)return u(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?u(e,t):void 0}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var c=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=Array.isArray(t[0])?t[0].reduce((function(e,r,n){return e+t[n]+r})):t[0],i=document.createElement("div");if(i.innerHTML=n,1===i.children.length)return i.children[0];var o=document.createDocumentFragment();if(i.children.length)for(;i.children.length>0;)o.appendChild(i.children[0]);else for(;i.childNodes.length>0;)o.appendChild(i.childNodes[0]);return o},a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return Array.from(t.querySelectorAll(e))},l=t.curry((function(e,t){return t.querySelector(e)})),s=t.curry((function(e,t){return Array.from(t.querySelectorAll(e))})),f=function(e,t){return r.isString(e)||void 0!==t||(t=e,e=void 0),r.isElement(t)?r.isString(e)?(Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),Array.from(t.children).filter((function(t){return t.matches(e)}))):Array.from(t.children):[]},d=t.curry((function(e,t){var r=t.previousElementSibling;return r?e(r)?r:d(e,r):null})),p=t.curry((function(e,t){var r=t.nextElementSibling;return r?e(r)?r:p(e,r):null})),m=t.curry((function(e,t){var r=t.parentNode;return!(!r||r===document)&&(e(r)?r:m(e,r))})),y="__pluginjsData",h=function(e){return e[y]=e[y]||{}},v=function(e,n){r.isElement(e)&&void 0===n&&(n=e,e=void 0);var i=h(n);if(e){if(!(e in i)){var o=n.dataset[e]||n.dataset[t.camelize(e,!1)];if(void 0!==o){try{o=JSON.parse(o)}catch(e){}i[e]=o}}return i[e]}return i},g=function(e,t,r){return h(r)[e]=t,r},E=t.curryWith((function(e,t,i){if(r.isElement(t)&&void 0===i&&(i=t,t=void 0),"string"==typeof e){if(void 0===t)return v(e,i);g(e,t,i)}else Object.entries(e).forEach((function(e){var t=n(e,2),r=t[0],o=t[1];return g(r,o,i)}));return i}),r.isElement),b=t.curryWith((function(e,t,i){if(r.isElement(t)&&void 0===i&&(i=t,t=void 0),"string"==typeof e){if(void 0===t)return i.getAttribute(e);i.setAttribute(e,t)}else Object.entries(e).forEach((function(e){var t=n(e,2),r=t[0],o=t[1];return i.setAttribute(r,o)}));return i}),r.isElement),S=t.curry((function(e,t){return e.split(" ").forEach((function(e){t.removeAttribute(e)})),t})),A={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},N=t.curryWith((function(e,t,i){if(r.isElement(t)&&void 0===i&&(i=t,t=void 0),"string"==typeof e){if(void 0===t)return i[A[e]||e];i[A[e]||e]=t}else Object.entries(e).forEach((function(e){var t=n(e,2),r=t[0],o=t[1];i[A[r]||r]=o}));return i}),r.isElement),j=t.curry((function(e,t){return e.split(" ").forEach((function(e){delete t[e=A[e]||e]})),t})),x=t.curry((function(e){return e.cloneNode(!0)})),M=t.curry((function(e){return e.parentNode&&e.parentNode.removeChild(e),e})),T=t.curry((function(e){r.isIE()||r.isIE11()?e.removeNode(!0):e.remove()})),L=t.curry((function(e){for(;e.lastChild;)e.removeChild(e.lastChild);return e})),O=t.curryWith((function(e,t){return r.isString(e)||void 0!==t||(t=e,e=void 0),void 0===e?t.innerHTML:(t.innerHTML=e,t)}),r.isElement),C=t.curryWith((function(e,t){return r.isString(e)||void 0!==t||(t=e,e=void 0),void 0===e?t.textContent:(t.textContent=e,t)}),r.isElement),I=t.curry((function(e,t){return r.isString(e)?t.insertAdjacentHTML("beforeend",e):t.appendChild(e),t})),w=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),t.appendChild(e),e})),H=t.curry((function(e,t){return r.isString(e)?t.insertAdjacentHTML("afterbegin",e):(U(),t.prepend(e)),t})),D=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),U(),t.prepend(e),e})),B=t.curry((function(e,t){return r.isString(e)?t.insertAdjacentHTML("beforebegin",e):t.parentNode.insertBefore(e,t),t})),P=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),NodeList.prototype.isPrototypeOf(e)?e.forEach((function(e){t.parentNode.insertBefore(e,t)})):t.parentNode.insertBefore(e,t),e})),W=t.curry((function(e,t){return r.isString(e)?t.insertAdjacentHTML("afterend",e):t.parentNode.insertBefore(e,t.nextElementSibling),t})),q=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),NodeList.prototype.isPrototypeOf(e)?e.forEach((function(e){t.parentNode.insertBefore(e,t.nextElementSibling)})):t.parentNode.insertBefore(e,t.nextElementSibling),e})),F=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),P(e,t),I(t,e),e})),_=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),e.innerHTML=t.innerHTML,t.innerHTML="",t.append(e),t})),R=t.curry((function(e,t){var n;return r.isString(e)&&(e=c(e)),P(e,t[0]),(n=e).append.apply(n,i(t)),e})),z=t.curryWith((function(e,t){r.isString(e)||void 0!==t||(t=e,e=void 0);var n=t.parentNode;return Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),e&&!n.matches(e)||(f(n).forEach((function(e){P(e,n)})),r.isIE()||r.isIE11()?n.removeNode(!0):n.remove()),t}),r.isElement),J=t.curry((function(e,t){return r.isString(e)&&(e=c(e)),t.parentNode.replaceChild(e,t),r.isIE()||r.isIE11()?t.removeNode(!0):t.remove(),e})),U=function(){[Element.prototype,Document.prototype,DocumentFragment.prototype].forEach((function(e){e.prepend=e.prepend||function(){var e=Array.prototype.slice.call(arguments),t=document.createDocumentFragment();e.forEach((function(e){var r=e instanceof Node;t.appendChild(r?e:document.createTextNode(String(e)))})),this.insertBefore(t,this.firstChild)}}))};e.after=W,e.append=I,e.appendTo=w,e.attr=b,e.before=B,e.children=f,e.clone=x,e.closest=function(e,t){return Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),t.matches(e)?t:m((function(t){return t.matches(e)}),t)},e.contents=function(e){return"IFRAME"===e.tagName?[e.contentDocument]:e.childNodes},e.data=E,e.detach=M,e.docReady=function(e){var t=document.readyState;"complete"===t||"interactive"===t?setTimeout(e):document.addEventListener("DOMContentLoaded",e)},e.empty=L,e.find=l,e.findAll=s,e.getData=v,e.has=function(e,t){return r.isString(e)?Boolean(a(e,t).length):t.contains(e)},e.hasData=function(e){return y in e&&!r.isEmptyObject(e[y])},e.html=O,e.indexOf=function(e){return i(e.parentElement.children).indexOf(e)},e.insertAfter=q,e.insertBefore=P,e.next=function(e){return e.nextElementSibling},e.nextWith=p,e.offsetParent=function(e){for(var t=e.offsetParent;t&&"static"===t.style.position;)t=t.offsetParent;return t||document.documentElement},e.parent=function(e){return e.parentNode},e.parentWith=m,e.parents=function(e,t){r.isString(e)||void 0!==t||(t=e,e=void 0);for(var n=[],i=t;r.isElement(i)&&i.parentNode&&i!==document.body.parentNode;)i=i.parentNode,Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector),(!e||e&&i.matches(e))&&n.push(i);return n},e.parseHTML=c,e.prepend=H,e.prependTo=D,e.prev=function(e){return e.previousElementSibling},e.prevWith=d,e.prop=N,e.query=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;return t.querySelector(e)},e.queryAll=a,e.remove=T,e.removeAttr=S,e.removeData=function(e,t){return r.isElement(e)&&void 0===t&&(t=e,e=void 0),void 0===e?delete t[y]:delete h(t)[e],t},e.removeProp=j,e.replace=J,e.scrollParent=function(e){return m((function(e){return e.scrollHeight>e.clientHeight}),e)},e.setData=g,e.siblings=function(e,t){return r.isString(e)||void 0!==t||(t=e,e=void 0),r.isElement(t)?f(e,t.parentNode).filter((function(e){return e!==t})):[]},e.text=C,e.unwrap=z,e.wrap=F,e.wrapAll=R,e.wrapInner=_,Object.defineProperty(e,"__esModule",{value:!0})}));

@@ -14,3 +14,3 @@ {

},
"version": "0.8.4",
"version": "0.8.5",
"category": "utils",

@@ -37,11 +37,11 @@ "main": "dist/dom.common.js",

"dependencies": {
"@pluginjs/is": "^0.8.4",
"@pluginjs/utils": "^0.8.4"
"@pluginjs/is": "^0.8.5",
"@pluginjs/utils": "^0.8.5"
},
"devDependencies": {
"@babel/core": "^7.10.2",
"@pluginjs/browserslist-config": "^1.3.1",
"@pluginjs/cli": "^0.8.1",
"@rollup/plugin-commonjs": "^12.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
"@babel/core": "^7.12.10",
"@pluginjs/browserslist-config": "^1.3.2",
"@pluginjs/cli": "^0.8.2",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-node-resolve": "^11.1.0",
"babel-jest": "*",

@@ -51,3 +51,3 @@ "jest": "*",

"rename": "^1.0.4",
"rollup": "^2.12.0",
"rollup": "^2.38.1",
"rollup-plugin-babel": "*",

@@ -71,3 +71,3 @@ "rollup-plugin-terser": "*"

],
"gitHead": "c7a30bcc922362e40dbc35af4290a259c9b29566"
"gitHead": "e0247ab4b5e2026b77a390619f2b96bac30609c6"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc