Socket
Socket
Sign inDemoInstall

shorter-js

Package Overview
Dependencies
Maintainers
1
Versions
82
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shorter-js - npm Package Compare versions

Comparing version 0.3.0-alpha9 to 0.3.0

src/get/getUID.js

4

dist/shorter-js.esm.min.js

@@ -1,2 +0,2 @@

// shorter-js v0.3.0alpha9 | dnp_theme © 2022 | MIT-License
const e="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],t="webkitAnimation"in document.head.style?"webkitAnimationDuration":"animationDuration",n="webkitAnimation"in document.head.style?"webkitAnimationDelay":"animationDelay",o="webkitAnimation"in document.head.style?"webkitAnimationName":"animationName",i="webkitAnimation"in document.head.style?"webkitAnimationEnd":"animationend",a="webkitTransition"in document.head.style?"webkitTransitionDuration":"transitionDuration",r="webkitTransition"in document.head.style?"webkitTransitionDelay":"transitionDelay",s="webkitTransition"in document.head.style?"webkitTransitionEnd":"transitionend",c="webkitTransition"in document.head.style?"webkitTransitionProperty":"transitionProperty",{userAgentData:u}=navigator,l=u,{userAgent:m}=navigator,d=m,g=/iPhone|iPad|iPod|Android/i;let f=!1;f=l?l.brands.some(e=>g.test(e.brand)):g.test(d);const E=f,y=/(iPhone|iPod|iPad)/,p=l?l.brands.some(e=>y.test(e.brand)):y.test(d),b=!!d&&d.includes("Firefox"),{head:v}=document,h="webkitPerspective"in v.style||"perspective"in v.style;function w(e,t,n,o){const i=o||!1;e.addEventListener(t,n,i)}function A(e,t,n,o){const i=o||!1;e.removeEventListener(t,n,i)}function k(e,t,n,o){w(e,t,(function i(a){a.target===e&&(n.apply(e,[a]),A(e,t,i,o))}),o)}const L=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,e)});k(document,"DOMContentLoaded",()=>{},t)}catch(e){throw Error("Passive events are not supported")}return e})(),D="webkitTransform"in v.style||"transform"in v.style,N="ontouchstart"in window||"msMaxTouchPoints"in navigator,T="webkitAnimation"in v.style||"animation"in v.style,S="webkitTransition"in v.style||"transition"in v.style;function M(e){return e instanceof Window}const C=e=>e instanceof Node;function O(e){return C(e)?e.ownerDocument:M(e)?e.document:window.document}const z=[Document,Node,Element,HTMLElement],H=[Element,HTMLElement];function I(e,t){const n="string"==typeof e,o=t&&z.some(e=>t instanceof e)?t:O();return!n&&[...H].some(t=>e instanceof t)?e:n?o.querySelector(e):null}const P=new Map,x={set:(e,t,n)=>{const o=I(e);if(!o)return;P.has(t)||P.set(t,new Map);P.get(t).set(o,n)},getAllFor:e=>P.get(e)||null,get:(e,t)=>{const n=I(e),o=x.getAllFor(t);return n&&o&&o.get(n)||null},remove:(e,t)=>{const n=I(e),o=P.get(t);o&&n&&(o.delete(n),0===o.size&&P.delete(t))}};function F(e,t){const n=getComputedStyle(e);return t in n?n[t]:""}function B(e){const t=F(e,"animationName"),n=F(e,"animationDelay"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function R(e){const t=F(e,"animationName"),n=F(e,"animationDuration"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function W(e){const t=F(e,o),i=F(e,n),a=i.includes("ms")?1:1e3,r=T&&t&&"none"!==t?parseFloat(i)*a:0;return Number.isNaN(r)?0:r}function Q(e){const n=F(e,o),i=F(e,t),a=i.includes("ms")?1:1e3,r=T&&n&&"none"!==n?parseFloat(i)*a:0;return Number.isNaN(r)?0:r}function V(e){const t=F(e,"transitionProperty"),n=F(e,"transitionDelay"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function j(e){const t=F(e,"transitionProperty"),n=F(e,"transitionDuration"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function q(e){const t=F(e,c),n=F(e,r),o=n.includes("ms")?1:1e3,i=S&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function U(e){const t=F(e,c),n=F(e,a),o=n.includes("ms")?1:1e3,i=S&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function G(e){return"true"===e||"false"!==e&&(Number.isNaN(+e)?""===e||"null"===e?null:e:+e)}const K=e=>Object.keys(e);const X=(e,t)=>Object.assign(e,t),$=!!L&&{passive:!0},Y=new Map;const Z=e=>e instanceof Element,J=e=>e instanceof HTMLElement;function _(e,t){const{width:n,height:o,top:i,right:a,bottom:r,left:s}=e.getBoundingClientRect();let c=1,u=1;return t&&(J(e)||Z(e))&&(c=e.offsetWidth>0&&Math.round(n)/e.offsetWidth||1,u=e.offsetHeight>0&&Math.round(o)/e.offsetHeight||1),{width:n/c,height:o/u,top:i/u,right:a/c,bottom:r/u,left:s/c,x:s/c,y:i/u}}function ee(e){return O(e).documentElement}function te(e){if(null==e)return window;if(!(e instanceof Window)){const{ownerDocument:t}=e;return t&&t.defaultView||window}return e}const ne=e=>e instanceof te(e).ShadowRoot||e instanceof ShadowRoot;function oe(e){const{width:t,height:n}=_(e),{offsetWidth:o,offsetHeight:i}=e;return Math.round(t)!==o||Math.round(n)!==i}const ie=e=>e&&!!e.shadowRoot;const ae={ariaChecked:"aria-checked",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",nativeEvents:["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointercancel","pointerdown","pointerleave","pointermove","pointerup","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"],abortEvent:"abort",blurEvent:"blur",moveEvent:"move",changeEvent:"change",errorEvent:"error",resetEvent:"reset",resizeEvent:"resize",scrollEvent:"scroll",submitEvent:"submit",loadEvent:"load",unloadEvent:"unload",readystatechangeEvent:"readystatechange",beforeunloadEvent:"beforeunload",orientationchangeEvent:"orientationchange",contextmenuEvent:"contextmenu",DOMContentLoadedEvent:"DOMContentLoaded",DOMMouseScrollEvent:"DOMMouseScroll",selectEvent:"select",selectendEvent:"selectend",selectstartEvent:"selectstart",mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseclickEvent:"click",mousedblclickEvent:"dblclick",mousedownEvent:"mousedown",mouseupEvent:"mouseup",mousehoverEvent:"hover",mouseHoverEvents:e,mouseenterEvent:"mouseenter",mouseleaveEvent:"mouseleave",mouseinEvent:"mousein",mouseoutEvent:"mouseout",mousemoveEvent:"mousemove",mousewheelEvent:"mousewheel",mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"},touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},touchstartEvent:"touchstart",touchmoveEvent:"touchmove",touchcancelEvent:"touchcancel",touchendEvent:"touchend",pointercancelEvent:"pointercancel",pointerdownEvent:"pointerdown",pointerleaveEvent:"pointerleave",pointermoveEvent:"pointermove",pointerupEvent:"pointerup",focusEvents:{in:"focusin",out:"focusout"},focusEvent:"focus",focusinEvent:"focusin",focusoutEvent:"focusout",gesturechangeEvent:"gesturechange",gestureendEvent:"gestureend",gesturestartEvent:"gesturestart",bezierEasings:{linear:"linear",easingSinusoidalIn:"cubic-bezier(0.47,0,0.745,0.715)",easingSinusoidalOut:"cubic-bezier(0.39,0.575,0.565,1)",easingSinusoidalInOut:"cubic-bezier(0.445,0.05,0.55,0.95)",easingQuadraticIn:"cubic-bezier(0.550,0.085,0.680,0.530)",easingQuadraticOut:"cubic-bezier(0.250,0.460,0.450,0.940)",easingQuadraticInOut:"cubic-bezier(0.455,0.030,0.515,0.955)",easingCubicIn:"cubic-bezier(0.55,0.055,0.675,0.19)",easingCubicOut:"cubic-bezier(0.215,0.61,0.355,1)",easingCubicInOut:"cubic-bezier(0.645,0.045,0.355,1)",easingQuarticIn:"cubic-bezier(0.895,0.03,0.685,0.22)",easingQuarticOut:"cubic-bezier(0.165,0.84,0.44,1)",easingQuarticInOut:"cubic-bezier(0.77,0,0.175,1)",easingQuinticIn:"cubic-bezier(0.755,0.05,0.855,0.06)",easingQuinticOut:"cubic-bezier(0.23,1,0.32,1)",easingQuinticInOut:"cubic-bezier(0.86,0,0.07,1)",easingExponentialIn:"cubic-bezier(0.95,0.05,0.795,0.035)",easingExponentialOut:"cubic-bezier(0.19,1,0.22,1)",easingExponentialInOut:"cubic-bezier(1,0,0,1)",easingCircularIn:"cubic-bezier(0.6,0.04,0.98,0.335)",easingCircularOut:"cubic-bezier(0.075,0.82,0.165,1)",easingCircularInOut:"cubic-bezier(0.785,0.135,0.15,0.86)",easingBackIn:"cubic-bezier(0.6,-0.28,0.735,0.045)",easingBackOut:"cubic-bezier(0.175,0.885,0.32,1.275)",easingBackInOut:"cubic-bezier(0.68,-0.55,0.265,1.55)"},animationDuration:"animationDuration",animationDurationLegacy:t,animationDelay:"animationDelay",animationDelayLegacy:n,animationName:"animationName",animationNameLegacy:o,animationEndEvent:"animationend",animationEndEventLegacy:i,transitionDuration:"transitionDuration",transitionDurationLegacy:a,transitionDelay:"transitionDelay",transitionDelayLegacy:r,transitionEndEvent:"transitionend",transitionEndEventLegacy:s,transitionProperty:"transitionProperty",transitionPropertyLegacy:c,isMobile:E,isApple:p,isFirefox:b,support3DTransform:h,supportPassive:L,supportTransform:D,supportTouch:N,supportAnimation:T,supportTransition:S,addEventListener:"addEventListener",removeEventListener:"removeEventListener",keyboardEventKeys:{Backspace:"Backspace",Tab:"Tab",Enter:"Enter",Shift:"Shift",Control:"Control",Alt:"Alt",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Scape:"Space",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Insert:"Insert",Delete:"Delete",Meta:"Meta",ContextMenu:"ContextMenu",ScrollLock:"ScrollLock"},keydownEvent:"keydown",keypressEvent:"keypress",keyupEvent:"keyup",keyAlt:"Alt",keyArrowDown:"ArrowDown",keyArrowLeft:"ArrowLeft",keyArrowRight:"ArrowRight",keyArrowUp:"ArrowUp",keyBackspace:"Backspace",keyCapsLock:"CapsLock",keyControl:"Control",keyDelete:"Delete",keyEnter:"Enter",keyEscape:"Escape",keyInsert:"Insert",keyMeta:"Meta",keyPause:"Pause",keyScrollLock:"ScrollLock",keyShift:"Shift",keySpace:"Space",keyTab:"Tab",offsetHeight:"offsetHeight",offsetWidth:"offsetWidth",scrollHeight:"scrollHeight",scrollWidth:"scrollWidth",userAgentData:l,userAgent:d,addClass:function(e,t){e.classList.add(t)},removeClass:function(e,t){e.classList.remove(t)},hasClass:function(e,t){return e.classList.contains(t)},on:w,off:A,one:k,distinct:(e,t,n)=>n.indexOf(e)===t,Data:x,Timer:{set:(e,t,n,o)=>{const i=I(e);if(i)if(o&&o.length){Y.has(i)||Y.set(i,new Map);Y.get(i).set(o,setTimeout(t,n))}else Y.set(i,setTimeout(t,n))},get:(e,t)=>{const n=I(e);if(!n)return null;if(t&&t.length){Y.has(n)||Y.set(n,new Map);const e=Y.get(n);if(e.has(t))return e.get(t)}else if(Y.has(n))return Y.get(n);return null},clear:(e,t)=>{const n=I(e),o=n&&Y.get(n);o&&(t&&t.length?o.has(t)&&(clearTimeout(o.get(t)),o.delete(t)):(clearTimeout(o),Y.delete(n)))}},getInstance:(e,t)=>x.get(e,t),emulateAnimationEnd:function(e,t){let n=0;const o=new Event("animationend"),i=R(e),a=B(e);if(i){const r=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener("animationend",r),n=1)};e.addEventListener("animationend",r),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},emulateAnimationEndLegacy:function(e,t){let n=0;const o=new Event(i),a=Q(e),r=W(e);if(T&&a){const s=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener(i,s),n=1)};e.addEventListener(i,s),setTimeout(()=>{n||e.dispatchEvent(o)},a+r+17)}else t.apply(e,[o])},emulateTransitionEnd:function(e,t){let n=0;const o=new Event("transitionend"),i=j(e),a=V(e);if(i){const r=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener("transitionend",r),n=1)};e.addEventListener("transitionend",r),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},emulateTransitionEndLegacy:function(e,t){let n=0;const o=new Event(s),i=U(e),a=q(e);if(S&&i){const r=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener(s,r),n=1)};e.addEventListener(s,r),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},isElementInScrollRange:e=>{const{top:t,bottom:n}=_(e),{clientHeight:o}=ee(e);return t<=o&&n>=0},isElementInViewport:e=>{const{top:t,left:n,bottom:o,right:i}=_(e,!0),{clientWidth:a,clientHeight:r}=ee(e);return t>=0&&n>=0&&o<=r&&i<=a},passiveHandler:{passive:!0},passiveHandlerLegacy:$,getElementAnimationDuration:R,getElementAnimationDurationLegacy:Q,getElementAnimationDelay:B,getElementAnimationDelayLegacy:W,getElementTransitionDuration:j,getElementTransitionDurationLegacy:U,getElementTransitionDelay:V,getElementTransitionDelayLegacy:q,getNodeScroll:function(e){const t="scrollX"in e;return{x:t?e.scrollX:e.scrollLeft,y:t?e.scrollY:e.scrollTop}},getParentNode:function(e){return"HTML"===e.nodeName?e:e.assignedSlot||e.parentNode||(ne(e)?e.host:null)||ee(e)},getRectRelativeToOffsetParent:function(e,t,n){const o=t instanceof Window,i=_(e,!o&&oe(t)),a={x:0,y:0};if(!o){const e=_(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}return{x:i.left+n.x-a.x,y:i.top+n.y-a.y,width:i.width,height:i.height}},getWindow:te,isArray:e=>Array.isArray(e),isString:e=>"string"==typeof e,isCustomElement:ie,isElement:Z,isNode:C,isHTMLElement:J,isHTMLImageElement:e=>e instanceof HTMLImageElement,isSVGElement:e=>e instanceof SVGElement,isNodeList:e=>e instanceof NodeList,isHTMLCollection:e=>e instanceof HTMLCollection,isScaledElement:oe,isTableElement:e=>["TABLE","TD","TH"].includes(e.tagName),isShadowRoot:ne,isDocument:e=>e instanceof Document,isElementsArray:e=>Array.isArray(e)&&e.every(e=>J(e)),isWindow:M,isMedia:e=>e&&[SVGElement,HTMLImageElement,HTMLVideoElement].some(t=>e instanceof t),isRTL:e=>"rtl"===ee(e).dir,elementNodes:H,parentNodes:z,closest:function e(t,n){return t&&t.closest(n)||e(t.getRootNode().host,n)},querySelector:I,getCustomElements:function(e){return[...(e&&z.some(t=>e instanceof t)?e:O()).querySelectorAll("*")].filter(ie)},querySelectorAll:function(e,t){return(t&&z.some(e=>t instanceof e)?t:O()).querySelectorAll(e)},getElementsByClassName:function(e,t){return(t&&z.some(e=>t instanceof e)?t:O()).getElementsByClassName(e)},getElementsByTagName:function(e,t){return(t&&z.some(e=>t instanceof e)?t:O()).getElementsByTagName(e)},normalizeValue:G,normalizeOptions:function(e,t,n,o){const i={...e.dataset},a={},r={};return K(i).forEach(e=>{const t=o&&e.includes(o)?e.replace(o,"").replace(/[A-Z]/,e=>e.toLowerCase()):e;r[t]=G(i[e])}),K(n).forEach(e=>{n[e]=G(n[e])}),K(t).forEach(e=>{a[e]=e in n?n[e]:e in r?r[e]:t[e]}),a},tryWrapper:function(e,t){try{e()}catch(e){throw TypeError(`${t} ${e}`)}},reflow:e=>e.offsetHeight,focus:e=>e.focus(),ArrayFrom:e=>Array.from(e),Float32ArrayFrom:e=>Float32Array.from(Array.from(e)),Float64ArrayFrom:e=>Float64Array.from(Array.from(e)),ObjectAssign:X,ObjectKeys:K,ObjectValues:e=>Object.values(e),getBoundingClientRect:_,getDocument:O,getDocumentBody:function(e){return O(e).body},getDocumentElement:ee,getDocumentHead:function(e){return O(e).head},getElementStyle:F,setElementStyle:(e,t)=>{X(e.style,t)},hasAttribute:(e,t)=>e.hasAttribute(t),hasAttributeNS:(e,t,n)=>e.hasAttributeNS(n||null,t),getAttribute:(e,t)=>e.getAttribute(t),getAttributeNS:(e,t,n)=>e.getAttributeNS(n||null,t),setAttribute:(e,t,n)=>e.setAttribute(t,n),setAttributeNS:(e,t,n,o)=>e.setAttributeNS(o||null,t,n),removeAttribute:(e,t)=>e.removeAttribute(t),removeAttributeNS:(e,t,n)=>e.removeAttributeNS(n||null,t),Version:"0.3.0alpha9"};export{ae as default};
// shorter-js v0.3.0 | dnp_theme © 2022 | MIT-License
const e={DOMContentLoaded:"DOMContentLoaded",DOMMouseScroll:"DOMMouseScroll",abort:"abort",beforeunload:"beforeunload",blur:"blur",change:"change",click:"click",contextmenu:"contextmenu",dblclick:"dblclick",error:"error",focus:"focus",focusin:"focusin",focusout:"focusout",gesturechange:"gesturechange",gestureend:"gestureend",gesturestart:"gesturestart",hover:"hover",keydown:"keydown",keypress:"keypress",keyup:"keyup",load:"load",mousedown:"mousedown",mousemove:"mousemove",mousein:"mousein",mouseout:"mouseout",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseup:"mouseup",mousewheel:"mousewheel",move:"move",orientationchange:"orientationchange",pointercancel:"pointercancel",pointerdown:"pointerdown",pointerleave:"pointerleave",pointermove:"pointermove",pointerup:"pointerup",readystatechange:"readystatechange",reset:"reset",resize:"resize",scroll:"scroll",select:"select",selectend:"selectend",selectstart:"selectstart",submit:"submit",touchcancel:"touchcancel",touchend:"touchend",touchmove:"touchmove",touchstart:"touchstart",unload:"unload"},t="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],{head:n}=document,o="webkitAnimation"in n.style?"webkitAnimationDuration":"animationDuration",i="webkitAnimation"in n.style?"webkitAnimationDelay":"animationDelay",a="webkitAnimation"in n.style?"webkitAnimationName":"animationName",r="webkitAnimation"in n.style?"webkitAnimationEnd":"animationend",s="webkitTransition"in n.style?"webkitTransitionDuration":"transitionDuration",c="webkitTransition"in n.style?"webkitTransitionDelay":"transitionDelay",u="webkitTransition"in n.style?"webkitTransitionEnd":"transitionend",l="webkitTransition"in n.style?"webkitTransitionProperty":"transitionProperty",{userAgentData:m}=navigator,d=m,{userAgent:g}=navigator,f=g,E=/iPhone|iPad|iPod|Android/i;let p=!1;p=d?d.brands.some(e=>E.test(e.brand)):E.test(f);const v=p,b=/(iPhone|iPod|iPad)/,y=d?d.brands.some(e=>b.test(e.brand)):b.test(f),h=!!f&&f.includes("Firefox"),w="webkitPerspective"in n.style||"perspective"in n.style;function A(e,t,n,o){const i=o||!1;e.addEventListener(t,n,i)}function k(e,t,n,o){const i=o||!1;e.removeEventListener(t,n,i)}function L(e,t,n,o){const i=a=>{a.target===e&&(n.apply(e,[a]),k(e,t,i,o))};A(e,t,i,o)}const N=(()=>{let e=!1;try{const t=Object.defineProperty({},"passive",{get:()=>(e=!0,e)});L(document,"DOMContentLoaded",()=>{},t)}catch(e){throw Error("Passive events are not supported")}return e})(),D="webkitTransform"in n.style||"transform"in n.style,T="ontouchstart"in window||"msMaxTouchPoints"in navigator,S="webkitAnimation"in n.style||"animation"in n.style,M="webkitTransition"in n.style||"transition"in n.style,C=(e,t)=>e.getAttribute(t);function O(e){return e instanceof HTMLElement?e.ownerDocument:e instanceof Window?e.document:window.document}const z=[Document,Element,HTMLElement],H=[Element,HTMLElement];function I(e,t){const n=z.some(e=>t instanceof e)?t:O();return H.some(t=>e instanceof t)?e:n.querySelector(e)}const P=new Map,x={set:(e,t,n)=>{const o=I(e);if(!o)return;P.has(t)||P.set(t,new Map);P.get(t).set(o,n)},getAllFor:e=>P.get(e)||null,get:(e,t)=>{const n=I(e),o=x.getAllFor(t);return n&&o&&o.get(n)||null},remove:(e,t)=>{const n=I(e),o=P.get(t);o&&n&&(o.delete(n),0===o.size&&P.delete(t))}},B=(e,t)=>Object.assign(e,t);function F(e,t){const n=getComputedStyle(e);return t in n?n[t]:""}function R(e){const t=F(e,"animationName"),n=F(e,"animationDelay"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function W(e){const t=F(e,"animationName"),n=F(e,"animationDuration"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function Q(e){const t=F(e,a),n=F(e,i),o=n.includes("ms")?1:1e3,r=S&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(r)?0:r}function V(e){const t=F(e,a),n=F(e,o),i=n.includes("ms")?1:1e3,r=S&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(r)?0:r}function j(e){const t=F(e,"transitionProperty"),n=F(e,"transitionDelay"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function U(e){const t=F(e,"transitionProperty"),n=F(e,"transitionDuration"),o=n.includes("ms")?1:1e3,i=t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function q(e){const t=F(e,l),n=F(e,c),o=n.includes("ms")?1:1e3,i=M&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function G(e){const t=F(e,l),n=F(e,s),o=n.includes("ms")?1:1e3,i=M&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(i)?0:i}function K(e){return"true"===e||"false"!==e&&(Number.isNaN(+e)?""===e||"null"===e?null:e:+e)}const X=e=>Object.keys(e),$=e=>e.toLowerCase();const Y=!!N&&{passive:!0},Z=new Map,J={set:(e,t,n,o)=>{const i=I(e);if(i)if(o&&o.length){Z.has(i)||Z.set(i,new Map);Z.get(i).set(o,setTimeout(t,n))}else Z.set(i,setTimeout(t,n))},get:(e,t)=>{const n=I(e);if(!n)return null;const o=Z.get(n);return t&&t.length&&o&&o.get?o.get(t)||null:o||null},clear:(e,t)=>{const n=I(e);if(n)if(t&&t.length){const e=Z.get(n);e&&e.get&&(clearTimeout(e.get(t)),e.delete(t),0===e.size&&Z.delete(n))}else clearTimeout(Z.get(n)),Z.delete(n)}};function _(e,t){const{width:n,height:o,top:i,right:a,bottom:r,left:s}=e.getBoundingClientRect();let c=1,u=1;if(t&&e instanceof HTMLElement){const{offsetWidth:t,offsetHeight:i}=e;c=t>0&&Math.round(n)/t||1,u=i>0&&Math.round(o)/i||1}return{width:n/c,height:o/u,top:i/u,right:a/c,bottom:r/u,left:s/c,x:s/c,y:i/u}}function ee(e){return O(e).documentElement}function te(e){if(null==e)return window;if(!(e instanceof Window)){const{ownerDocument:t}=e;return t&&t.defaultView||window}return e}const ne=e=>e instanceof te(e).ShadowRoot||e instanceof ShadowRoot;function oe(e){const{width:t,height:n}=_(e),{offsetWidth:o,offsetHeight:i}=e;return Math.round(t)!==o||Math.round(n)!==i}let ie=1;const ae=new Map;const re=e=>e&&!!e.shadowRoot;function se(e,t){return(t&&z.some(e=>t instanceof e)?t:O()).getElementsByTagName(e)}const ce=se("*");const ue=Element.prototype,le=ue.matches||ue.matchesSelector||ue.webkitMatchesSelector||ue.mozMatchesSelector||ue.msMatchesSelector||ue.oMatchesSelector||function(){return!1};const me={ariaChecked:"aria-checked",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",nativeEvents:e,abortEvent:"abort",blurEvent:"blur",moveEvent:"move",changeEvent:"change",errorEvent:"error",resetEvent:"reset",resizeEvent:"resize",scrollEvent:"scroll",submitEvent:"submit",loadEvent:"load",loadstartEvent:"loadstart",unloadEvent:"unload",readystatechangeEvent:"readystatechange",beforeunloadEvent:"beforeunload",orientationchangeEvent:"orientationchange",contextmenuEvent:"contextmenu",DOMContentLoadedEvent:"DOMContentLoaded",DOMMouseScrollEvent:"DOMMouseScroll",selectEvent:"select",selectendEvent:"selectend",selectstartEvent:"selectstart",mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseclickEvent:"click",mousedblclickEvent:"dblclick",mousedownEvent:"mousedown",mouseupEvent:"mouseup",mousehoverEvent:"hover",mouseHoverEvents:t,mouseenterEvent:"mouseenter",mouseleaveEvent:"mouseleave",mouseinEvent:"mousein",mouseoutEvent:"mouseout",mouseoverEvent:"mouseover",mousemoveEvent:"mousemove",mousewheelEvent:"mousewheel",mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"},touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},touchstartEvent:"touchstart",touchmoveEvent:"touchmove",touchcancelEvent:"touchcancel",touchendEvent:"touchend",pointercancelEvent:"pointercancel",pointerdownEvent:"pointerdown",pointerleaveEvent:"pointerleave",pointermoveEvent:"pointermove",pointerupEvent:"pointerup",focusEvents:{in:"focusin",out:"focusout"},focusEvent:"focus",focusinEvent:"focusin",focusoutEvent:"focusout",gesturechangeEvent:"gesturechange",gestureendEvent:"gestureend",gesturestartEvent:"gesturestart",bezierEasings:{linear:"linear",easingSinusoidalIn:"cubic-bezier(0.47,0,0.745,0.715)",easingSinusoidalOut:"cubic-bezier(0.39,0.575,0.565,1)",easingSinusoidalInOut:"cubic-bezier(0.445,0.05,0.55,0.95)",easingQuadraticIn:"cubic-bezier(0.550,0.085,0.680,0.530)",easingQuadraticOut:"cubic-bezier(0.250,0.460,0.450,0.940)",easingQuadraticInOut:"cubic-bezier(0.455,0.030,0.515,0.955)",easingCubicIn:"cubic-bezier(0.55,0.055,0.675,0.19)",easingCubicOut:"cubic-bezier(0.215,0.61,0.355,1)",easingCubicInOut:"cubic-bezier(0.645,0.045,0.355,1)",easingQuarticIn:"cubic-bezier(0.895,0.03,0.685,0.22)",easingQuarticOut:"cubic-bezier(0.165,0.84,0.44,1)",easingQuarticInOut:"cubic-bezier(0.77,0,0.175,1)",easingQuinticIn:"cubic-bezier(0.755,0.05,0.855,0.06)",easingQuinticOut:"cubic-bezier(0.23,1,0.32,1)",easingQuinticInOut:"cubic-bezier(0.86,0,0.07,1)",easingExponentialIn:"cubic-bezier(0.95,0.05,0.795,0.035)",easingExponentialOut:"cubic-bezier(0.19,1,0.22,1)",easingExponentialInOut:"cubic-bezier(1,0,0,1)",easingCircularIn:"cubic-bezier(0.6,0.04,0.98,0.335)",easingCircularOut:"cubic-bezier(0.075,0.82,0.165,1)",easingCircularInOut:"cubic-bezier(0.785,0.135,0.15,0.86)",easingBackIn:"cubic-bezier(0.6,-0.28,0.735,0.045)",easingBackOut:"cubic-bezier(0.175,0.885,0.32,1.275)",easingBackInOut:"cubic-bezier(0.68,-0.55,0.265,1.55)"},animationDuration:"animationDuration",animationDurationLegacy:o,animationDelay:"animationDelay",animationDelayLegacy:i,animationName:"animationName",animationNameLegacy:a,animationEndEvent:"animationend",animationEndEventLegacy:r,transitionDuration:"transitionDuration",transitionDurationLegacy:s,transitionDelay:"transitionDelay",transitionDelayLegacy:c,transitionEndEvent:"transitionend",transitionEndEventLegacy:u,transitionProperty:"transitionProperty",transitionPropertyLegacy:l,isMobile:v,isApple:y,isFirefox:h,support3DTransform:w,supportPassive:N,supportTransform:D,supportTouch:T,supportAnimation:S,supportTransition:M,addEventListener:"addEventListener",removeEventListener:"removeEventListener",keyboardEventKeys:{Backspace:"Backspace",Tab:"Tab",Enter:"Enter",Shift:"Shift",Control:"Control",Alt:"Alt",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Scape:"Space",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Insert:"Insert",Delete:"Delete",Meta:"Meta",ContextMenu:"ContextMenu",ScrollLock:"ScrollLock"},keydownEvent:"keydown",keypressEvent:"keypress",keyupEvent:"keyup",keyAlt:"Alt",keyArrowDown:"ArrowDown",keyArrowLeft:"ArrowLeft",keyArrowRight:"ArrowRight",keyArrowUp:"ArrowUp",keyBackspace:"Backspace",keyCapsLock:"CapsLock",keyControl:"Control",keyDelete:"Delete",keyEnter:"Enter",keyEscape:"Escape",keyInsert:"Insert",keyMeta:"Meta",keyPause:"Pause",keyScrollLock:"ScrollLock",keyShift:"Shift",keySpace:"Space",keyTab:"Tab",offsetHeight:"offsetHeight",offsetWidth:"offsetWidth",scrollHeight:"scrollHeight",scrollWidth:"scrollWidth",userAgentData:d,userAgent:f,addClass:function(e,t){e.classList.add(t)},removeClass:function(e,t){e.classList.remove(t)},hasClass:function(e,t){return e.classList.contains(t)},on:A,off:k,one:L,dispatchEvent:(e,t)=>e.dispatchEvent(t),distinct:(e,t,n)=>n.indexOf(e)===t,Data:x,getInstance:(e,t)=>x.get(e,t),createElement:function e(t){if("string"==typeof t)return O().createElement(t);const{tagName:n}=t,o={...t},i=e(n);return delete o.tagName,B(i,o),i},createElementNS:function e(t,n){if("string"==typeof n)return O().createElementNS(t,n);const{tagName:o}=n,i={...n},a=e(t,o);return delete i.tagName,B(a,i),a},toUpperCase:e=>e.toUpperCase(),toLowerCase:$,Timer:J,emulateAnimationEnd:function(e,t){let n=0;const o=new Event("animationend"),i=W(e),a=R(e);if(i){const r=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener("animationend",r),n=1)};e.addEventListener("animationend",r),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},emulateAnimationEndLegacy:function(e,t){let n=0;const o=new Event(r),i=V(e),a=Q(e);if(S&&i){const s=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener(r,s),n=1)};e.addEventListener(r,s),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},emulateTransitionEnd:function(e,t){let n=0;const o=new Event("transitionend"),i=U(e),a=j(e);if(i){const r=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener("transitionend",r),n=1)};e.addEventListener("transitionend",r),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},emulateTransitionEndLegacy:function(e,t){let n=0;const o=new Event(u),i=G(e),a=q(e);if(M&&i){const r=o=>{o.target===e&&(t.apply(e,[o]),e.removeEventListener(u,r),n=1)};e.addEventListener(u,r),setTimeout(()=>{n||e.dispatchEvent(o)},i+a+17)}else t.apply(e,[o])},isElementInScrollRange:e=>{const{top:t,bottom:n}=_(e),{clientHeight:o}=ee(e);return t<=o&&n>=0},isElementInViewport:e=>{const{top:t,left:n,bottom:o,right:i}=_(e,!0),{clientWidth:a,clientHeight:r}=ee(e);return t>=0&&n>=0&&o<=r&&i<=a},passiveHandler:{passive:!0},passiveHandlerLegacy:Y,getElementAnimationDuration:W,getElementAnimationDurationLegacy:V,getElementAnimationDelay:R,getElementAnimationDelayLegacy:Q,getElementTransitionDuration:U,getElementTransitionDurationLegacy:G,getElementTransitionDelay:j,getElementTransitionDelayLegacy:q,getNodeScroll:function(e){const t="scrollX"in e;return{x:t?e.scrollX:e.scrollLeft,y:t?e.scrollY:e.scrollTop}},getParentNode:function(e){return"HTML"===e.nodeName?e:e.assignedSlot||e.parentNode||(ne(e)?e.host:null)||ee(e)},getRectRelativeToOffsetParent:function(e,t,n){const o=t instanceof HTMLElement,i=_(e,o&&oe(t)),a={x:0,y:0};if(o){const e=_(t,!0);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}return{x:i.left+n.x-a.x,y:i.top+n.y-a.y,width:i.width,height:i.height}},getWindow:te,isArray:e=>Array.isArray(e),isString:e=>"string"==typeof e,isCustomElement:re,isElement:e=>e instanceof Element,isNode:e=>e instanceof Node,isHTMLElement:e=>e instanceof HTMLElement,isHTMLImageElement:e=>e instanceof HTMLImageElement,isSVGElement:e=>e instanceof SVGElement,isNodeList:e=>e instanceof NodeList,isHTMLCollection:e=>e instanceof HTMLCollection,isScaledElement:oe,isTableElement:e=>["TABLE","TD","TH"].includes(e.tagName),isShadowRoot:ne,isDocument:e=>e instanceof Document,isElementsArray:e=>Array.isArray(e)&&e.every(e=>[HTMLElement,Element].some(t=>e instanceof t)),isWindow:function(e){return e instanceof Window},isMedia:e=>e&&[SVGElement,HTMLImageElement,HTMLVideoElement].some(t=>e instanceof t),isRTL:e=>"rtl"===ee(e).dir,elementNodes:H,parentNodes:z,closest:function e(t,n){return t?t.closest(n)||e(t.getRootNode().host,n):null},documentAll:ce,querySelector:I,getCustomElements:function(e){return[...e&&z.some(t=>e instanceof t)?se("*",e):ce].filter(re)},getElementById:function(e){return O().getElementById(e)},querySelectorAll:function(e,t){return(t&&z.some(e=>t instanceof e)?t:O()).querySelectorAll(e)},getElementsByClassName:function(e,t){return(t&&z.some(e=>t instanceof e)?t:O()).getElementsByClassName(e)},getElementsByTagName:se,matches:function(e,t){return e.matches(t)},matchesLegacy:function(e,t){return le.call(e,t)},normalizeValue:K,normalizeOptions:function(e,t,n,o){const i={...e.dataset},a={},r={};return X(i).forEach(e=>{const t=o&&e.includes(o)?e.replace(o,"").replace(/[A-Z]/,e=>$(e)):e;r[t]=K(i[e])}),X(n).forEach(e=>{n[e]=K(n[e])}),X(t).forEach(o=>{a[o]=o in n?n[o]:o in r?r[o]:"title"===o?C(e,"title"):t[o]}),a},tryWrapper:function(e,t){try{e()}catch(e){throw TypeError(`${t} ${e}`)}},reflow:e=>e.offsetHeight,noop:()=>{},focus:e=>e.focus(),getUID:function(e,t){ie+=1;let n=ae.get(e),o=ie;if(t&&t.length)if(n){const e=n.get(t);Number.isNaN(e)?n.set(t,o):o=e}else ae.set(e,new Map),n=ae.get(e),n.set(t,o);else Number.isNaN(n)?ae.set(e,o):o=n;return o},ArrayFrom:e=>Array.from(e),Float32ArrayFrom:e=>Float32Array.from(Array.from(e)),Float64ArrayFrom:e=>Float64Array.from(Array.from(e)),ObjectAssign:B,ObjectKeys:X,ObjectValues:e=>Object.values(e),OriginalEvent:function(e,t){const n=new CustomEvent(e,{cancelable:!0,bubbles:!0});return t instanceof Object&&B(n,t),n},getBoundingClientRect:_,getDocument:O,getDocumentBody:function(e){return O(e).body},getDocumentElement:ee,getDocumentHead:function(e){return O(e).head},getElementStyle:F,setElementStyle:(e,t)=>{B(e.style,t)},hasAttribute:(e,t)=>e.hasAttribute(t),hasAttributeNS:(e,t,n)=>t.hasAttributeNS(e,n),getAttribute:C,getAttributeNS:(e,t,n)=>t.getAttributeNS(e,n),setAttribute:(e,t,n)=>e.setAttribute(t,n),setAttributeNS:(e,t,n,o)=>t.setAttributeNS(e,n,o),removeAttribute:(e,t)=>e.removeAttribute(t),removeAttributeNS:(e,t,n)=>t.removeAttributeNS(e,n),Version:"0.3.0"};export{me as default};

@@ -1,2 +0,2 @@

// shorter-js v0.3.0alpha9 | dnp_theme © 2022 | MIT-License
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).SHORTER=t()}(this,(function(){"use strict";var e="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],t="webkitAnimation"in document.head.style?"webkitAnimationDuration":"animationDuration",n="webkitAnimation"in document.head.style?"webkitAnimationDelay":"animationDelay",i="webkitAnimation"in document.head.style?"webkitAnimationName":"animationName",o="webkitAnimation"in document.head.style?"webkitAnimationEnd":"animationend",r="webkitTransition"in document.head.style?"webkitTransitionDuration":"transitionDuration",a="webkitTransition"in document.head.style?"webkitTransitionDelay":"transitionDelay",u="webkitTransition"in document.head.style?"webkitTransitionEnd":"transitionend",s="webkitTransition"in document.head.style?"webkitTransitionProperty":"transitionProperty",c=navigator.userAgentData,l=navigator.userAgent,m=/iPhone|iPad|iPod|Android/i,d=c?c.brands.some((function(e){return m.test(e.brand)})):m.test(l),f=/(iPhone|iPod|iPad)/,v=c?c.brands.some((function(e){return f.test(e.brand)})):f.test(l),g=!!l&&l.includes("Firefox"),p=document.head,y="webkitPerspective"in p.style||"perspective"in p.style;function E(e,t,n,i){var o=i||!1;e.addEventListener(t,n,o)}function b(e,t,n,i){var o=i||!1;e.removeEventListener(t,n,o)}function h(e,t,n,i){E(e,t,(function o(r){r.target===e&&(n.apply(e,[r]),b(e,t,o,i))}),i)}var w=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0}});h(document,"DOMContentLoaded",(function(){}),t)}catch(e){throw Error("Passive events are not supported")}return e}(),A="webkitTransform"in p.style||"transform"in p.style,k="ontouchstart"in window||"msMaxTouchPoints"in navigator,L="webkitAnimation"in p.style||"animation"in p.style,D="webkitTransition"in p.style||"transition"in p.style;function N(e){return e instanceof Window}var T=function(e){return e instanceof Node};function S(e){return T(e)?e.ownerDocument:N(e)?e.document:window.document}var M=[Document,Node,Element,HTMLElement],C=[Element,HTMLElement];function O(e,t){var n="string"==typeof e,i=t&&M.some((function(e){return t instanceof e}))?t:S();return!n&&[].concat(C).some((function(t){return e instanceof t}))?e:n?i.querySelector(e):null}var z=new Map,H={set:function(e,t,n){var i=O(e);i&&(z.has(t)||z.set(t,new Map),z.get(t).set(i,n))},getAllFor:function(e){return z.get(e)||null},get:function(e,t){var n=O(e),i=H.getAllFor(t);return n&&i&&i.get(n)||null},remove:function(e,t){var n=O(e),i=z.get(t);i&&n&&(i.delete(n),0===i.size&&z.delete(t))}};function I(e,t){var n=getComputedStyle(e);return t in n?n[t]:""}function P(e){var t=I(e,"animationName"),n=I(e,"animationDelay"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function x(e){var t=I(e,"animationName"),n=I(e,"animationDuration"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function F(e){var t=I(e,i),o=I(e,n),r=o.includes("ms")?1:1e3,a=L&&t&&"none"!==t?parseFloat(o)*r:0;return Number.isNaN(a)?0:a}function B(e){var n=I(e,i),o=I(e,t),r=o.includes("ms")?1:1e3,a=L&&n&&"none"!==n?parseFloat(o)*r:0;return Number.isNaN(a)?0:a}function R(e){var t=I(e,"transitionProperty"),n=I(e,"transitionDelay"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function W(e){var t=I(e,"transitionProperty"),n=I(e,"transitionDuration"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function j(e){var t=I(e,s),n=I(e,a),i=n.includes("ms")?1:1e3,o=D&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function Q(e){var t=I(e,s),n=I(e,r),i=n.includes("ms")?1:1e3,o=D&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function V(e){return"true"===e||"false"!==e&&(Number.isNaN(+e)?""===e||"null"===e?null:e:+e)}var q=function(e){return Object.keys(e)};var U=function(e,t){return Object.assign(e,t)},G=!!w&&{passive:!0},K=new Map;var X=function(e){return e instanceof Element},Y=function(e){return e instanceof HTMLElement};function Z(e,t){var n=e.getBoundingClientRect(),i=n.width,o=n.height,r=n.top,a=n.right,u=n.bottom,s=n.left,c=1,l=1;return t&&(Y(e)||X(e))&&(c=e.offsetWidth>0&&Math.round(i)/e.offsetWidth||1,l=e.offsetHeight>0&&Math.round(o)/e.offsetHeight||1),{width:i/c,height:o/l,top:r/l,right:a/c,bottom:u/l,left:s/c,x:s/c,y:r/l}}function J(e){return S(e).documentElement}function $(e){if(null==e)return window;if(!(e instanceof Window)){var t=e.ownerDocument;return t&&t.defaultView||window}return e}var _=function(e){return e instanceof $(e).ShadowRoot||e instanceof ShadowRoot};function ee(e){var t=Z(e),n=t.width,i=t.height,o=e.offsetWidth,r=e.offsetHeight;return Math.round(n)!==o||Math.round(i)!==r}var te=function(e){return e&&!!e.shadowRoot};return{ariaChecked:"aria-checked",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",nativeEvents:["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointercancel","pointerdown","pointerleave","pointermove","pointerup","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"],abortEvent:"abort",blurEvent:"blur",moveEvent:"move",changeEvent:"change",errorEvent:"error",resetEvent:"reset",resizeEvent:"resize",scrollEvent:"scroll",submitEvent:"submit",loadEvent:"load",unloadEvent:"unload",readystatechangeEvent:"readystatechange",beforeunloadEvent:"beforeunload",orientationchangeEvent:"orientationchange",contextmenuEvent:"contextmenu",DOMContentLoadedEvent:"DOMContentLoaded",DOMMouseScrollEvent:"DOMMouseScroll",selectEvent:"select",selectendEvent:"selectend",selectstartEvent:"selectstart",mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseclickEvent:"click",mousedblclickEvent:"dblclick",mousedownEvent:"mousedown",mouseupEvent:"mouseup",mousehoverEvent:"hover",mouseHoverEvents:e,mouseenterEvent:"mouseenter",mouseleaveEvent:"mouseleave",mouseinEvent:"mousein",mouseoutEvent:"mouseout",mousemoveEvent:"mousemove",mousewheelEvent:"mousewheel",mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"},touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},touchstartEvent:"touchstart",touchmoveEvent:"touchmove",touchcancelEvent:"touchcancel",touchendEvent:"touchend",pointercancelEvent:"pointercancel",pointerdownEvent:"pointerdown",pointerleaveEvent:"pointerleave",pointermoveEvent:"pointermove",pointerupEvent:"pointerup",focusEvents:{in:"focusin",out:"focusout"},focusEvent:"focus",focusinEvent:"focusin",focusoutEvent:"focusout",gesturechangeEvent:"gesturechange",gestureendEvent:"gestureend",gesturestartEvent:"gesturestart",bezierEasings:{linear:"linear",easingSinusoidalIn:"cubic-bezier(0.47,0,0.745,0.715)",easingSinusoidalOut:"cubic-bezier(0.39,0.575,0.565,1)",easingSinusoidalInOut:"cubic-bezier(0.445,0.05,0.55,0.95)",easingQuadraticIn:"cubic-bezier(0.550,0.085,0.680,0.530)",easingQuadraticOut:"cubic-bezier(0.250,0.460,0.450,0.940)",easingQuadraticInOut:"cubic-bezier(0.455,0.030,0.515,0.955)",easingCubicIn:"cubic-bezier(0.55,0.055,0.675,0.19)",easingCubicOut:"cubic-bezier(0.215,0.61,0.355,1)",easingCubicInOut:"cubic-bezier(0.645,0.045,0.355,1)",easingQuarticIn:"cubic-bezier(0.895,0.03,0.685,0.22)",easingQuarticOut:"cubic-bezier(0.165,0.84,0.44,1)",easingQuarticInOut:"cubic-bezier(0.77,0,0.175,1)",easingQuinticIn:"cubic-bezier(0.755,0.05,0.855,0.06)",easingQuinticOut:"cubic-bezier(0.23,1,0.32,1)",easingQuinticInOut:"cubic-bezier(0.86,0,0.07,1)",easingExponentialIn:"cubic-bezier(0.95,0.05,0.795,0.035)",easingExponentialOut:"cubic-bezier(0.19,1,0.22,1)",easingExponentialInOut:"cubic-bezier(1,0,0,1)",easingCircularIn:"cubic-bezier(0.6,0.04,0.98,0.335)",easingCircularOut:"cubic-bezier(0.075,0.82,0.165,1)",easingCircularInOut:"cubic-bezier(0.785,0.135,0.15,0.86)",easingBackIn:"cubic-bezier(0.6,-0.28,0.735,0.045)",easingBackOut:"cubic-bezier(0.175,0.885,0.32,1.275)",easingBackInOut:"cubic-bezier(0.68,-0.55,0.265,1.55)"},animationDuration:"animationDuration",animationDurationLegacy:t,animationDelay:"animationDelay",animationDelayLegacy:n,animationName:"animationName",animationNameLegacy:i,animationEndEvent:"animationend",animationEndEventLegacy:o,transitionDuration:"transitionDuration",transitionDurationLegacy:r,transitionDelay:"transitionDelay",transitionDelayLegacy:a,transitionEndEvent:"transitionend",transitionEndEventLegacy:u,transitionProperty:"transitionProperty",transitionPropertyLegacy:s,isMobile:d,isApple:v,isFirefox:g,support3DTransform:y,supportPassive:w,supportTransform:A,supportTouch:k,supportAnimation:L,supportTransition:D,addEventListener:"addEventListener",removeEventListener:"removeEventListener",keyboardEventKeys:{Backspace:"Backspace",Tab:"Tab",Enter:"Enter",Shift:"Shift",Control:"Control",Alt:"Alt",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Scape:"Space",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Insert:"Insert",Delete:"Delete",Meta:"Meta",ContextMenu:"ContextMenu",ScrollLock:"ScrollLock"},keydownEvent:"keydown",keypressEvent:"keypress",keyupEvent:"keyup",keyAlt:"Alt",keyArrowDown:"ArrowDown",keyArrowLeft:"ArrowLeft",keyArrowRight:"ArrowRight",keyArrowUp:"ArrowUp",keyBackspace:"Backspace",keyCapsLock:"CapsLock",keyControl:"Control",keyDelete:"Delete",keyEnter:"Enter",keyEscape:"Escape",keyInsert:"Insert",keyMeta:"Meta",keyPause:"Pause",keyScrollLock:"ScrollLock",keyShift:"Shift",keySpace:"Space",keyTab:"Tab",offsetHeight:"offsetHeight",offsetWidth:"offsetWidth",scrollHeight:"scrollHeight",scrollWidth:"scrollWidth",userAgentData:c,userAgent:l,addClass:function(e,t){e.classList.add(t)},removeClass:function(e,t){e.classList.remove(t)},hasClass:function(e,t){return e.classList.contains(t)},on:E,off:b,one:h,distinct:function(e,t,n){return n.indexOf(e)===t},Data:H,Timer:{set:function(e,t,n,i){var o=O(e);o&&(i&&i.length?(K.has(o)||K.set(o,new Map),K.get(o).set(i,setTimeout(t,n))):K.set(o,setTimeout(t,n)))},get:function(e,t){var n=O(e);if(!n)return null;if(t&&t.length){K.has(n)||K.set(n,new Map);var i=K.get(n);if(i.has(t))return i.get(t)}else if(K.has(n))return K.get(n);return null},clear:function(e,t){var n=O(e),i=n&&K.get(n);i&&(t&&t.length?i.has(t)&&(clearTimeout(i.get(t)),i.delete(t)):(clearTimeout(i),K.delete(n)))}},getInstance:function(e,t){return H.get(e,t)},emulateAnimationEnd:function(e,t){var n=0,i=new Event("animationend"),o=x(e),r=P(e);if(o){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener("animationend",a),n=1)};e.addEventListener("animationend",a),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},emulateAnimationEndLegacy:function(e,t){var n=0,i=new Event(o),r=B(e),a=F(e);if(L&&r){var u=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener(o,u),n=1)};e.addEventListener(o,u),setTimeout((function(){n||e.dispatchEvent(i)}),r+a+17)}else t.apply(e,[i])},emulateTransitionEnd:function(e,t){var n=0,i=new Event("transitionend"),o=W(e),r=R(e);if(o){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener("transitionend",a),n=1)};e.addEventListener("transitionend",a),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},emulateTransitionEndLegacy:function(e,t){var n=0,i=new Event(u),o=Q(e),r=j(e);if(D&&o){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener(u,a),n=1)};e.addEventListener(u,a),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},isElementInScrollRange:function(e){var t=Z(e),n=t.top,i=t.bottom;return n<=J(e).clientHeight&&i>=0},isElementInViewport:function(e){var t=Z(e,!0),n=t.top,i=t.left,o=t.bottom,r=t.right,a=J(e),u=a.clientWidth,s=a.clientHeight;return n>=0&&i>=0&&o<=s&&r<=u},passiveHandler:{passive:!0},passiveHandlerLegacy:G,getElementAnimationDuration:x,getElementAnimationDurationLegacy:B,getElementAnimationDelay:P,getElementAnimationDelayLegacy:F,getElementTransitionDuration:W,getElementTransitionDurationLegacy:Q,getElementTransitionDelay:R,getElementTransitionDelayLegacy:j,getNodeScroll:function(e){var t="scrollX"in e;return{x:t?e.scrollX:e.scrollLeft,y:t?e.scrollY:e.scrollTop}},getParentNode:function(e){return"HTML"===e.nodeName?e:e.assignedSlot||e.parentNode||(_(e)?e.host:null)||J(e)},getRectRelativeToOffsetParent:function(e,t,n){var i=t instanceof Window,o=Z(e,!i&&ee(t)),r={x:0,y:0};if(!i){var a=Z(t,!0);r.x=a.x+t.clientLeft,r.y=a.y+t.clientTop}return{x:o.left+n.x-r.x,y:o.top+n.y-r.y,width:o.width,height:o.height}},getWindow:$,isArray:function(e){return Array.isArray(e)},isString:function(e){return"string"==typeof e},isCustomElement:te,isElement:X,isNode:T,isHTMLElement:Y,isHTMLImageElement:function(e){return e instanceof HTMLImageElement},isSVGElement:function(e){return e instanceof SVGElement},isNodeList:function(e){return e instanceof NodeList},isHTMLCollection:function(e){return e instanceof HTMLCollection},isScaledElement:ee,isTableElement:function(e){return["TABLE","TD","TH"].includes(e.tagName)},isShadowRoot:_,isDocument:function(e){return e instanceof Document},isElementsArray:function(e){return Array.isArray(e)&&e.every((function(e){return Y(e)}))},isWindow:N,isMedia:function(e){return e&&[SVGElement,HTMLImageElement,HTMLVideoElement].some((function(t){return e instanceof t}))},isRTL:function(e){return"rtl"===J(e).dir},elementNodes:C,parentNodes:M,closest:function e(t,n){return t&&t.closest(n)||e(t.getRootNode().host,n)},querySelector:O,getCustomElements:function(e){var t=e&&M.some((function(t){return e instanceof t}))?e:S();return[].concat(t.querySelectorAll("*")).filter(te)},querySelectorAll:function(e,t){return(t&&M.some((function(e){return t instanceof e}))?t:S()).querySelectorAll(e)},getElementsByClassName:function(e,t){return(t&&M.some((function(e){return t instanceof e}))?t:S()).getElementsByClassName(e)},getElementsByTagName:function(e,t){return(t&&M.some((function(e){return t instanceof e}))?t:S()).getElementsByTagName(e)},normalizeValue:V,normalizeOptions:function(e,t,n,i){var o=Object.assign({},e.dataset),r={},a={};return q(o).forEach((function(e){var t=i&&e.includes(i)?e.replace(i,"").replace(/[A-Z]/,(function(e){return e.toLowerCase()})):e;a[t]=V(o[e])})),q(n).forEach((function(e){n[e]=V(n[e])})),q(t).forEach((function(e){r[e]=e in n?n[e]:e in a?a[e]:t[e]})),r},tryWrapper:function(e,t){try{e()}catch(e){throw TypeError(t+" "+e)}},reflow:function(e){return e.offsetHeight},focus:function(e){return e.focus()},ArrayFrom:function(e){return Array.from(e)},Float32ArrayFrom:function(e){return Float32Array.from(Array.from(e))},Float64ArrayFrom:function(e){return Float64Array.from(Array.from(e))},ObjectAssign:U,ObjectKeys:q,ObjectValues:function(e){return Object.values(e)},getBoundingClientRect:Z,getDocument:S,getDocumentBody:function(e){return S(e).body},getDocumentElement:J,getDocumentHead:function(e){return S(e).head},getElementStyle:I,setElementStyle:function(e,t){U(e.style,t)},hasAttribute:function(e,t){return e.hasAttribute(t)},hasAttributeNS:function(e,t,n){return e.hasAttributeNS(n||null,t)},getAttribute:function(e,t){return e.getAttribute(t)},getAttributeNS:function(e,t,n){return e.getAttributeNS(n||null,t)},setAttribute:function(e,t,n){return e.setAttribute(t,n)},setAttributeNS:function(e,t,n,i){return e.setAttributeNS(i||null,t,n)},removeAttribute:function(e,t){return e.removeAttribute(t)},removeAttributeNS:function(e,t,n){return e.removeAttributeNS(n||null,t)},Version:"0.3.0alpha9"}}));
// shorter-js v0.3.0 | dnp_theme © 2022 | MIT-License
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).SHORTER=t()}(this,(function(){"use strict";var e={DOMContentLoaded:"DOMContentLoaded",DOMMouseScroll:"DOMMouseScroll",abort:"abort",beforeunload:"beforeunload",blur:"blur",change:"change",click:"click",contextmenu:"contextmenu",dblclick:"dblclick",error:"error",focus:"focus",focusin:"focusin",focusout:"focusout",gesturechange:"gesturechange",gestureend:"gestureend",gesturestart:"gesturestart",hover:"hover",keydown:"keydown",keypress:"keypress",keyup:"keyup",load:"load",mousedown:"mousedown",mousemove:"mousemove",mousein:"mousein",mouseout:"mouseout",mouseenter:"mouseenter",mouseleave:"mouseleave",mouseover:"mouseover",mouseup:"mouseup",mousewheel:"mousewheel",move:"move",orientationchange:"orientationchange",pointercancel:"pointercancel",pointerdown:"pointerdown",pointerleave:"pointerleave",pointermove:"pointermove",pointerup:"pointerup",readystatechange:"readystatechange",reset:"reset",resize:"resize",scroll:"scroll",select:"select",selectend:"selectend",selectstart:"selectstart",submit:"submit",touchcancel:"touchcancel",touchend:"touchend",touchmove:"touchmove",touchstart:"touchstart",unload:"unload"},t="onmouseleave"in document?["mouseenter","mouseleave"]:["mouseover","mouseout"],n=document.head,i="webkitAnimation"in n.style?"webkitAnimationDuration":"animationDuration",o="webkitAnimation"in n.style?"webkitAnimationDelay":"animationDelay",r="webkitAnimation"in n.style?"webkitAnimationName":"animationName",a="webkitAnimation"in n.style?"webkitAnimationEnd":"animationend",u="webkitTransition"in n.style?"webkitTransitionDuration":"transitionDuration",s="webkitTransition"in n.style?"webkitTransitionDelay":"transitionDelay",c="webkitTransition"in n.style?"webkitTransitionEnd":"transitionend",l="webkitTransition"in n.style?"webkitTransitionProperty":"transitionProperty",m=navigator.userAgentData,f=navigator.userAgent,d=/iPhone|iPad|iPod|Android/i,v=m?m.brands.some((function(e){return d.test(e.brand)})):d.test(f),g=/(iPhone|iPod|iPad)/,p=m?m.brands.some((function(e){return g.test(e.brand)})):g.test(f),E=!!f&&f.includes("Firefox"),b="webkitPerspective"in n.style||"perspective"in n.style;function y(e,t,n,i){var o=i||!1;e.addEventListener(t,n,o)}function h(e,t,n,i){var o=i||!1;e.removeEventListener(t,n,o)}function w(e,t,n,i){var o=function(r){r.target===e&&(n.apply(e,[r]),h(e,t,o,i))};y(e,t,o,i)}var A=function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){return e=!0}});w(document,"DOMContentLoaded",(function(){}),t)}catch(e){throw Error("Passive events are not supported")}return e}(),k="webkitTransform"in n.style||"transform"in n.style,L="ontouchstart"in window||"msMaxTouchPoints"in navigator,N="webkitAnimation"in n.style||"animation"in n.style,D="webkitTransition"in n.style||"transition"in n.style,T=function(e,t){return e.getAttribute(t)};function S(e){return e instanceof HTMLElement?e.ownerDocument:e instanceof Window?e.document:window.document}var M=[Document,Element,HTMLElement],O=[Element,HTMLElement];function C(e,t){var n=M.some((function(e){return t instanceof e}))?t:S();return O.some((function(t){return e instanceof t}))?e:n.querySelector(e)}var z=new Map,H={set:function(e,t,n){var i=C(e);i&&(z.has(t)||z.set(t,new Map),z.get(t).set(i,n))},getAllFor:function(e){return z.get(e)||null},get:function(e,t){var n=C(e),i=H.getAllFor(t);return n&&i&&i.get(n)||null},remove:function(e,t){var n=C(e),i=z.get(t);i&&n&&(i.delete(n),0===i.size&&z.delete(t))}},I=function(e,t){return Object.assign(e,t)};function x(e,t){var n=getComputedStyle(e);return t in n?n[t]:""}function P(e){var t=x(e,"animationName"),n=x(e,"animationDelay"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function B(e){var t=x(e,"animationName"),n=x(e,"animationDuration"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function F(e){var t=x(e,r),n=x(e,o),i=n.includes("ms")?1:1e3,a=N&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(a)?0:a}function R(e){var t=x(e,r),n=x(e,i),o=n.includes("ms")?1:1e3,a=N&&t&&"none"!==t?parseFloat(n)*o:0;return Number.isNaN(a)?0:a}function W(e){var t=x(e,"transitionProperty"),n=x(e,"transitionDelay"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function j(e){var t=x(e,"transitionProperty"),n=x(e,"transitionDuration"),i=n.includes("ms")?1:1e3,o=t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function Q(e){var t=x(e,l),n=x(e,s),i=n.includes("ms")?1:1e3,o=D&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function V(e){var t=x(e,l),n=x(e,u),i=n.includes("ms")?1:1e3,o=D&&t&&"none"!==t?parseFloat(n)*i:0;return Number.isNaN(o)?0:o}function U(e){return"true"===e||"false"!==e&&(Number.isNaN(+e)?""===e||"null"===e?null:e:+e)}var q=function(e){return Object.keys(e)},G=function(e){return e.toLowerCase()};var K=!!A&&{passive:!0},X=new Map,Y={set:function(e,t,n,i){var o=C(e);o&&(i&&i.length?(X.has(o)||X.set(o,new Map),X.get(o).set(i,setTimeout(t,n))):X.set(o,setTimeout(t,n)))},get:function(e,t){var n=C(e);if(!n)return null;var i=X.get(n);return t&&t.length&&i&&i.get?i.get(t)||null:i||null},clear:function(e,t){var n=C(e);if(n)if(t&&t.length){var i=X.get(n);i&&i.get&&(clearTimeout(i.get(t)),i.delete(t),0===i.size&&X.delete(n))}else clearTimeout(X.get(n)),X.delete(n)}};function Z(e,t){var n=e.getBoundingClientRect(),i=n.width,o=n.height,r=n.top,a=n.right,u=n.bottom,s=n.left,c=1,l=1;if(t&&e instanceof HTMLElement){var m=e.offsetWidth,f=e.offsetHeight;c=m>0&&Math.round(i)/m||1,l=f>0&&Math.round(o)/f||1}return{width:i/c,height:o/l,top:r/l,right:a/c,bottom:u/l,left:s/c,x:s/c,y:r/l}}function J(e){return S(e).documentElement}function $(e){if(null==e)return window;if(!(e instanceof Window)){var t=e.ownerDocument;return t&&t.defaultView||window}return e}var _=function(e){return e instanceof $(e).ShadowRoot||e instanceof ShadowRoot};function ee(e){var t=Z(e),n=t.width,i=t.height,o=e.offsetWidth,r=e.offsetHeight;return Math.round(n)!==o||Math.round(i)!==r}var te=1,ne=new Map;var ie=function(e){return e&&!!e.shadowRoot};function oe(e,t){return(t&&M.some((function(e){return t instanceof e}))?t:S()).getElementsByTagName(e)}var re=oe("*");var ae=Element.prototype,ue=ae.matches||ae.matchesSelector||ae.webkitMatchesSelector||ae.mozMatchesSelector||ae.msMatchesSelector||ae.oMatchesSelector||function(){return!1};return{ariaChecked:"aria-checked",ariaDescribedBy:"aria-describedby",ariaExpanded:"aria-expanded",ariaHidden:"aria-hidden",ariaLabel:"aria-label",ariaLabelledBy:"aria-labelledby",ariaModal:"aria-modal",ariaPressed:"aria-pressed",ariaSelected:"aria-selected",nativeEvents:e,abortEvent:"abort",blurEvent:"blur",moveEvent:"move",changeEvent:"change",errorEvent:"error",resetEvent:"reset",resizeEvent:"resize",scrollEvent:"scroll",submitEvent:"submit",loadEvent:"load",loadstartEvent:"loadstart",unloadEvent:"unload",readystatechangeEvent:"readystatechange",beforeunloadEvent:"beforeunload",orientationchangeEvent:"orientationchange",contextmenuEvent:"contextmenu",DOMContentLoadedEvent:"DOMContentLoaded",DOMMouseScrollEvent:"DOMMouseScroll",selectEvent:"select",selectendEvent:"selectend",selectstartEvent:"selectstart",mouseClickEvents:{down:"mousedown",up:"mouseup"},mouseclickEvent:"click",mousedblclickEvent:"dblclick",mousedownEvent:"mousedown",mouseupEvent:"mouseup",mousehoverEvent:"hover",mouseHoverEvents:t,mouseenterEvent:"mouseenter",mouseleaveEvent:"mouseleave",mouseinEvent:"mousein",mouseoutEvent:"mouseout",mouseoverEvent:"mouseover",mousemoveEvent:"mousemove",mousewheelEvent:"mousewheel",mouseSwipeEvents:{start:"mousedown",end:"mouseup",move:"mousemove",cancel:"mouseleave"},touchEvents:{start:"touchstart",end:"touchend",move:"touchmove",cancel:"touchcancel"},touchstartEvent:"touchstart",touchmoveEvent:"touchmove",touchcancelEvent:"touchcancel",touchendEvent:"touchend",pointercancelEvent:"pointercancel",pointerdownEvent:"pointerdown",pointerleaveEvent:"pointerleave",pointermoveEvent:"pointermove",pointerupEvent:"pointerup",focusEvents:{in:"focusin",out:"focusout"},focusEvent:"focus",focusinEvent:"focusin",focusoutEvent:"focusout",gesturechangeEvent:"gesturechange",gestureendEvent:"gestureend",gesturestartEvent:"gesturestart",bezierEasings:{linear:"linear",easingSinusoidalIn:"cubic-bezier(0.47,0,0.745,0.715)",easingSinusoidalOut:"cubic-bezier(0.39,0.575,0.565,1)",easingSinusoidalInOut:"cubic-bezier(0.445,0.05,0.55,0.95)",easingQuadraticIn:"cubic-bezier(0.550,0.085,0.680,0.530)",easingQuadraticOut:"cubic-bezier(0.250,0.460,0.450,0.940)",easingQuadraticInOut:"cubic-bezier(0.455,0.030,0.515,0.955)",easingCubicIn:"cubic-bezier(0.55,0.055,0.675,0.19)",easingCubicOut:"cubic-bezier(0.215,0.61,0.355,1)",easingCubicInOut:"cubic-bezier(0.645,0.045,0.355,1)",easingQuarticIn:"cubic-bezier(0.895,0.03,0.685,0.22)",easingQuarticOut:"cubic-bezier(0.165,0.84,0.44,1)",easingQuarticInOut:"cubic-bezier(0.77,0,0.175,1)",easingQuinticIn:"cubic-bezier(0.755,0.05,0.855,0.06)",easingQuinticOut:"cubic-bezier(0.23,1,0.32,1)",easingQuinticInOut:"cubic-bezier(0.86,0,0.07,1)",easingExponentialIn:"cubic-bezier(0.95,0.05,0.795,0.035)",easingExponentialOut:"cubic-bezier(0.19,1,0.22,1)",easingExponentialInOut:"cubic-bezier(1,0,0,1)",easingCircularIn:"cubic-bezier(0.6,0.04,0.98,0.335)",easingCircularOut:"cubic-bezier(0.075,0.82,0.165,1)",easingCircularInOut:"cubic-bezier(0.785,0.135,0.15,0.86)",easingBackIn:"cubic-bezier(0.6,-0.28,0.735,0.045)",easingBackOut:"cubic-bezier(0.175,0.885,0.32,1.275)",easingBackInOut:"cubic-bezier(0.68,-0.55,0.265,1.55)"},animationDuration:"animationDuration",animationDurationLegacy:i,animationDelay:"animationDelay",animationDelayLegacy:o,animationName:"animationName",animationNameLegacy:r,animationEndEvent:"animationend",animationEndEventLegacy:a,transitionDuration:"transitionDuration",transitionDurationLegacy:u,transitionDelay:"transitionDelay",transitionDelayLegacy:s,transitionEndEvent:"transitionend",transitionEndEventLegacy:c,transitionProperty:"transitionProperty",transitionPropertyLegacy:l,isMobile:v,isApple:p,isFirefox:E,support3DTransform:b,supportPassive:A,supportTransform:k,supportTouch:L,supportAnimation:N,supportTransition:D,addEventListener:"addEventListener",removeEventListener:"removeEventListener",keyboardEventKeys:{Backspace:"Backspace",Tab:"Tab",Enter:"Enter",Shift:"Shift",Control:"Control",Alt:"Alt",Pause:"Pause",CapsLock:"CapsLock",Escape:"Escape",Scape:"Space",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",ArrowDown:"ArrowDown",Insert:"Insert",Delete:"Delete",Meta:"Meta",ContextMenu:"ContextMenu",ScrollLock:"ScrollLock"},keydownEvent:"keydown",keypressEvent:"keypress",keyupEvent:"keyup",keyAlt:"Alt",keyArrowDown:"ArrowDown",keyArrowLeft:"ArrowLeft",keyArrowRight:"ArrowRight",keyArrowUp:"ArrowUp",keyBackspace:"Backspace",keyCapsLock:"CapsLock",keyControl:"Control",keyDelete:"Delete",keyEnter:"Enter",keyEscape:"Escape",keyInsert:"Insert",keyMeta:"Meta",keyPause:"Pause",keyScrollLock:"ScrollLock",keyShift:"Shift",keySpace:"Space",keyTab:"Tab",offsetHeight:"offsetHeight",offsetWidth:"offsetWidth",scrollHeight:"scrollHeight",scrollWidth:"scrollWidth",userAgentData:m,userAgent:f,addClass:function(e,t){e.classList.add(t)},removeClass:function(e,t){e.classList.remove(t)},hasClass:function(e,t){return e.classList.contains(t)},on:y,off:h,one:w,dispatchEvent:function(e,t){return e.dispatchEvent(t)},distinct:function(e,t,n){return n.indexOf(e)===t},Data:H,getInstance:function(e,t){return H.get(e,t)},createElement:function e(t){if("string"==typeof t)return S().createElement(t);var n=t.tagName,i=Object.assign({},t),o=e(n);return delete i.tagName,I(o,i),o},createElementNS:function e(t,n){if("string"==typeof n)return S().createElementNS(t,n);var i=n.tagName,o=Object.assign({},n),r=e(t,i);return delete o.tagName,I(r,o),r},toUpperCase:function(e){return e.toUpperCase()},toLowerCase:G,Timer:Y,emulateAnimationEnd:function(e,t){var n=0,i=new Event("animationend"),o=B(e),r=P(e);if(o){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener("animationend",a),n=1)};e.addEventListener("animationend",a),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},emulateAnimationEndLegacy:function(e,t){var n=0,i=new Event(a),o=R(e),r=F(e);if(N&&o){var u=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener(a,u),n=1)};e.addEventListener(a,u),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},emulateTransitionEnd:function(e,t){var n=0,i=new Event("transitionend"),o=j(e),r=W(e);if(o){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener("transitionend",a),n=1)};e.addEventListener("transitionend",a),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},emulateTransitionEndLegacy:function(e,t){var n=0,i=new Event(c),o=V(e),r=Q(e);if(D&&o){var a=function(i){i.target===e&&(t.apply(e,[i]),e.removeEventListener(c,a),n=1)};e.addEventListener(c,a),setTimeout((function(){n||e.dispatchEvent(i)}),o+r+17)}else t.apply(e,[i])},isElementInScrollRange:function(e){var t=Z(e),n=t.top,i=t.bottom;return n<=J(e).clientHeight&&i>=0},isElementInViewport:function(e){var t=Z(e,!0),n=t.top,i=t.left,o=t.bottom,r=t.right,a=J(e),u=a.clientWidth,s=a.clientHeight;return n>=0&&i>=0&&o<=s&&r<=u},passiveHandler:{passive:!0},passiveHandlerLegacy:K,getElementAnimationDuration:B,getElementAnimationDurationLegacy:R,getElementAnimationDelay:P,getElementAnimationDelayLegacy:F,getElementTransitionDuration:j,getElementTransitionDurationLegacy:V,getElementTransitionDelay:W,getElementTransitionDelayLegacy:Q,getNodeScroll:function(e){var t="scrollX"in e;return{x:t?e.scrollX:e.scrollLeft,y:t?e.scrollY:e.scrollTop}},getParentNode:function(e){return"HTML"===e.nodeName?e:e.assignedSlot||e.parentNode||(_(e)?e.host:null)||J(e)},getRectRelativeToOffsetParent:function(e,t,n){var i=t instanceof HTMLElement,o=Z(e,i&&ee(t)),r={x:0,y:0};if(i){var a=Z(t,!0);r.x=a.x+t.clientLeft,r.y=a.y+t.clientTop}return{x:o.left+n.x-r.x,y:o.top+n.y-r.y,width:o.width,height:o.height}},getWindow:$,isArray:function(e){return Array.isArray(e)},isString:function(e){return"string"==typeof e},isCustomElement:ie,isElement:function(e){return e instanceof Element},isNode:function(e){return e instanceof Node},isHTMLElement:function(e){return e instanceof HTMLElement},isHTMLImageElement:function(e){return e instanceof HTMLImageElement},isSVGElement:function(e){return e instanceof SVGElement},isNodeList:function(e){return e instanceof NodeList},isHTMLCollection:function(e){return e instanceof HTMLCollection},isScaledElement:ee,isTableElement:function(e){return["TABLE","TD","TH"].includes(e.tagName)},isShadowRoot:_,isDocument:function(e){return e instanceof Document},isElementsArray:function(e){return Array.isArray(e)&&e.every((function(e){return[HTMLElement,Element].some((function(t){return e instanceof t}))}))},isWindow:function(e){return e instanceof Window},isMedia:function(e){return e&&[SVGElement,HTMLImageElement,HTMLVideoElement].some((function(t){return e instanceof t}))},isRTL:function(e){return"rtl"===J(e).dir},elementNodes:O,parentNodes:M,closest:function e(t,n){return t?t.closest(n)||e(t.getRootNode().host,n):null},documentAll:re,querySelector:C,getCustomElements:function(e){var t=e&&M.some((function(t){return e instanceof t}))?oe("*",e):re;return[].concat(t).filter(ie)},getElementById:function(e){return S().getElementById(e)},querySelectorAll:function(e,t){return(t&&M.some((function(e){return t instanceof e}))?t:S()).querySelectorAll(e)},getElementsByClassName:function(e,t){return(t&&M.some((function(e){return t instanceof e}))?t:S()).getElementsByClassName(e)},getElementsByTagName:oe,matches:function(e,t){return e.matches(t)},matchesLegacy:function(e,t){return ue.call(e,t)},normalizeValue:U,normalizeOptions:function(e,t,n,i){var o=Object.assign({},e.dataset),r={},a={};return q(o).forEach((function(e){var t=i&&e.includes(i)?e.replace(i,"").replace(/[A-Z]/,(function(e){return G(e)})):e;a[t]=U(o[e])})),q(n).forEach((function(e){n[e]=U(n[e])})),q(t).forEach((function(i){r[i]=i in n?n[i]:i in a?a[i]:"title"===i?T(e,"title"):t[i]})),r},tryWrapper:function(e,t){try{e()}catch(e){throw TypeError(t+" "+e)}},reflow:function(e){return e.offsetHeight},noop:function(){},focus:function(e){return e.focus()},getUID:function(e,t){te+=1;var n=ne.get(e),i=te;if(t&&t.length)if(n){var o=n.get(t);Number.isNaN(o)?n.set(t,i):i=o}else ne.set(e,new Map),(n=ne.get(e)).set(t,i);else Number.isNaN(n)?ne.set(e,i):i=n;return i},ArrayFrom:function(e){return Array.from(e)},Float32ArrayFrom:function(e){return Float32Array.from(Array.from(e))},Float64ArrayFrom:function(e){return Float64Array.from(Array.from(e))},ObjectAssign:I,ObjectKeys:q,ObjectValues:function(e){return Object.values(e)},OriginalEvent:function(e,t){var n=new CustomEvent(e,{cancelable:!0,bubbles:!0});return t instanceof Object&&I(n,t),n},getBoundingClientRect:Z,getDocument:S,getDocumentBody:function(e){return S(e).body},getDocumentElement:J,getDocumentHead:function(e){return S(e).head},getElementStyle:x,setElementStyle:function(e,t){I(e.style,t)},hasAttribute:function(e,t){return e.hasAttribute(t)},hasAttributeNS:function(e,t,n){return t.hasAttributeNS(e,n)},getAttribute:T,getAttributeNS:function(e,t,n){return t.getAttributeNS(e,n)},setAttribute:function(e,t,n){return e.setAttribute(t,n)},setAttributeNS:function(e,t,n,i){return t.setAttributeNS(e,n,i)},removeAttribute:function(e,t){return e.removeAttribute(t)},removeAttributeNS:function(e,t,n){return t.removeAttributeNS(e,n)},Version:"0.3.0"}}));
{
"name": "shorter-js",
"version": "0.3.0alpha9",
"description": "A small ES6+ library with various JavaScript tools useful for creating light libraries.",
"version": "0.3.0",
"description": "JavaScript shorties for the modern web.",
"main": "dist/shorter-js.min.js",

@@ -19,3 +19,2 @@ "module": "dist/shorter-js.esm.js",

"build:ts": "tsc -d",
"build": "npm run lint:js && npm-run-all --parallel umd umdmin esm esmmin",

@@ -48,3 +47,2 @@ "umd": "rollup --environment FORMAT:umd,MIN:false -c",

"@rollup/plugin-typescript": "^8.3.0",
"npm-run-all": "^4.1.5",
"eslint": "^7.22.0",

@@ -54,2 +52,3 @@ "eslint-config-airbnb-base": "^14.2.1",

"eslint-plugin-vue": "^7.7.0",
"npm-run-all": "^4.1.5",
"rollup": "^2.38.5",

@@ -56,0 +55,0 @@ "rollup-plugin-terser": "^5.3.1",

# shorter-js
A small ES6+ library with various JavaScript tools, all ESLint valid, useful for creating light libraries.
Featured in [KUTE.js](https://github.com/thednp/kute.js), [BSN](https://github.com/thednp/bootstrap.native), [Navbar.js](https://github.com/thednp/navbar.js) and other libraries.
A small ES6+ library with various JavaScript tools, all ESLint valid and with TypeScript definitions, everything useful for creating light libraries or web components. If there is anything that is consistently repeating itself, **shorter-js** can help you save up to 50% of the code required, with little to no performance cost.
* The purpose if the library is to speed up the development workflow, minimize the size of larger libraries by providing a shorter syntax for most used JavaScript API methods, most used strings or other helpful utilities.
* While the library comes with a working build in the `dist` folder, that is mainly for build consistency testing.
[![NPM Version](https://img.shields.io/npm/v/shorter-js.svg?style=flat-square)](https://www.npmjs.com/package/shorter-js)
[![NPM Downloads](https://img.shields.io/npm/dm/shorter-js.svg?style=flat-square)](http://npm-stat.com/charts.html?package=shorter-js)
[![jsDeliver](https://data.jsdelivr.com/v1/package/npm/shorter-js/badge)](https://www.jsdelivr.com/package/npm/shorter-js)
**shorter-js** is featured in [KUTE.js](https://github.com/thednp/kute.js), [BSN](https://github.com/thednp/bootstrap.native), [Navbar.js](https://github.com/thednp/navbar.js) and other libraries.
* The purpose of the library is to speed up the development workflow, minimize the size of larger libraries by providing a shorter syntax for most used JavaScript API methods, most used strings or other helpful utilities.
* While the library comes with a working build in the `dist` folder, that is mainly for build consistency testing. You can make use of "tree shaking" to import one or anything your code needs.
* On that note, all shorties are organized in folders inside the `src` root folder, the structure is key to understanding the purpose of each type of shortie, whether we have `boolean` for various basic browser detection or browser feature support, `attr` for all things *Element* attributes or `strings` for most common and most used *Element.prototype* methods.
# npm

@@ -16,26 +22,57 @@ ```

// import the tool you need
import {supportTransform} from 'shorter-js'
import { supportTransform } from 'shorter-js';
// use the tool in your ES6/ES7 sources
if (supportTransform) {
doSomeAction()
// have modern browsers do something about that
}
```
# attr
* ***getAttribute*** - returns the value of a specified *Element* attribute;
* ***getAttributeNS*** - returns the value of a specified namespaced *Element* attribute (eg: namespaced SVG attributes);
* ***hasAttribute*** - check if element has a specified attribute;
* ***hasAttributeNS*** - check if element has a specified namespaced attribute;
* ***removeAttribute*** - removes a specified attribute from an element;
* ***removeAttributeNS*** - removes a specified namespaced attribute from an element;
* ***setAttribute*** - set a new attribute value for a given element;
* ***setAttributeNS*** - set a new namespaced attribute value for a given element;
```js
// EXAMPLES
import { getAttribute, hasAttribute, setAttribute } from 'shorter-js';
// check target has certain attribute
if (!hasAttribute(myTarget, 'attribute-name')) {
setAttribute(myTarget, 'attribute-name', 'new-value');
}
// get attribute value
const currentAttrValue = getAttribute(myTarget, 'attribute-name');
```
# blocks
* ***documentBody*** - a shortie for `document.body`;
* ***documentElement*** - a shortie for `document.documentElement`;
* ***documentHead*** - a shortie for `document.head`;
# boolean
* ***isMobile*** - checks and preserves the client browser is a on Mobile device
* ***support3DTransform*** - checks and preserves the client browser capability for webKit `perspective`
* ***supportTouch*** - checks and preserves the client browser capability for `touch` events
* ***supportPassive*** - checks and preserves the client browser capability for `passive` event option
* ***supportTransform*** - checks and preserves the client browser capability for webKit `transform`
* ***supportAnimation*** - checks and preserves the client browser capability for webKit keyframe `animation`
* ***supportTransition*** - checks and preserves the client browser capability for webKit `transition`
* ***isApple*** - checks and preserves a `boolean` value for the client browser is either Apple **Safari** browser or not;
* ***isFirefox*** - checks and preserves a `boolean` value for the client browser is either **Firefox** or not;
* ***isMobile*** - checks and preserves a `boolean` value for the client browser is either a Mobile device or not;
* ***support3DTransform*** - checks and preserves a `boolean` value for the client browser capability for webKit `perspective`;
* ***supportTouch*** - checks and preserves a `boolean` value for the client browser capability for `touch` events;
* ***supportPassive*** - checks and preserves a `boolean` value for the client browser capability for `passive` event option;
* ***supportTransform*** - checks and preserves a `boolean` value for the client browser capability for webKit `transform`;
* ***supportAnimation*** - checks and preserves a `boolean` value for the client browser capability for webKit keyframe `animation`;
* ***supportTransition*** - checks and preserves a `boolean` value for the client browser capability for webKit `transition`;
```js
// EXAMPLES
import {support3DTransform} from 'shorter-js'
import { support3DTransform } from 'shorter-js';
// filter myAction to supported browsers
if (support3DTransform) {
myAction()
// do something with modern browsers
}

@@ -45,17 +82,19 @@ ```

# class
* ***addClass*** - add a class to a target *Element*
* ***removeClass*** - remove a class from a target *Element*
* ***hasClass*** - checks the existence of a class for a target *Element*
* ***addClass*** - add a class to a target *Element*;
* ***removeClass*** - remove a class from a target *Element*;
* ***hasClass*** - checks the existence of a class for a target *Element*;
```js
// EXAMPLES
import {addClass,removeClass,hasClass} from 'shorter-js'
import { addClass, removeClass, hasClass } from 'shorter-js'
// add a class
addClass(targetElement,'className')
addClass(targetElement, 'className');
// remove a class
removeClass(targetElement,'className')
removeClass(targetElement, 'className');
// check for a class
if (hasClass(targetElement,'className')) {
myAction()
if (hasClass(targetElement, 'className')) {
// do something about that
}

@@ -65,100 +104,240 @@ ```

# event
* ***on*** - attach an event handler to a specific target *Element*
* ***off*** - detach an event handler from a specific target *Element*
* ***one*** - attach an event handler to a specific target *Element*, and detach when complete
* ***on*** - attach an event listener to a specific target *Element*;
* ***off*** - detach an event listener from a specific target *Element*;
* ***one*** - attach an event listener to a specific target *Element*, and detach when complete;
```js
// EXAMPLES
import {on,off,one,passiveHandler} from 'shorter-js'
import { on, off, one, passiveHandler } from 'shorter-js';
// attach a passive mousedown eventHandler
on(targetElement,'click',eventHandler,passiveHandler)
on(targetElement, 'click', eventHandler, passiveHandler);
// detach a passive mouseup eventHandler
off(targetElement,'mouseup',eventHandler,passiveHandler)
off(targetElement, 'mouseup', eventHandler, passiveHandler);
// attach a single instance passive touchstart eventHandler
one(targetElement,'touchstart',eventHandler,passiveHandler)
one(targetElement, 'touchstart', eventHandler, passiveHandler);
```
For a more advanced method to handle event listeners, I recommend using the [event-listener.js](github.com/thednp/event-listener.js).
# get
* ***getBoundingClientRect*** - returns the bounding client rectangle of a given *Element*;
* ***getDocument*** - returns the containing `#Document` for a given *Element* or just any *Document*, useful when working with *iframe*s;
* ***getDocumentBody*** - returns the containing `<body>` for a given *Element* or just any;
* ***getDocumentElement*** - returns the containing `<html>` for a given *Element* or just any;
* ***getDocumentHead*** - returns the containing `<head>` for a given *Element* or just any;
* ***getElementAnimationDelay*** - returns the `animationDelay` property of an `animation` property;
* ***getElementAnimationDelayLegacy*** - for legacy browsers;
* ***getElementAnimationDuration*** - returns the `animationDuration` property of a `animation` property;
* ***getElementAnimationDurationLegacy*** - for legacy browsers;
* ***getElementTransitionDelay*** - returns the `transitionDelay` property of a `transition` property;
* ***getElementTransitionDelayLegacy*** - for legacy browsers;
* ***getElementTransitionDuration*** - returns the `transitionDuration` property of a `transition` property;
* ***getElementTransitionDurationLegacy*** - for legacy browsers;
* ***getElementStyle*** - returns the *Element* computed style for a given property;
* ***getNodeScroll*** - returns the *Element* / *Window* current `{ x, y }` scroll position;
* ***getParentNode*** - returns parent of a given *Element*;
* ***getRectRelativeToOffsetParent*** - returns the bounding client rectangle of a given *Element* relative to a given `offsetParent`;
* ***getUID*** - a nice utility that creates a unique ID for a given *Element* and returns it;
* ***getWindow*** - returns the containing `Window` for a given *Element* or just any *Window*;
```js
// EXAMPLES
import {
getElementAnimationDuration,
getElementAnimationDurationLegacy,
} from 'shorter-js'
// store the transition duration for target element on a modern browser
const duration = getElementAnimationDuration(target);
// or do the same with legacy browser fallback
const duration = getElementAnimationDurationLegacy(target);
```
# is
* ***isArray*** - check if a given value is an `Array`;
* ***isCustomElement*** - check if a given value is a `CustomElement` instance;
* ***isDocument*** - check if a given value is a `Document` instance;
* ***isElement*** - check if a given value is an `Element` instance;
* ***isElementInScrollRange*** - check if a given `Element` is partially visible in the viewport;
* ***isElementInViewport*** - check if a given `Element` is fully visible in the viewport;
* ***isElementsArray*** - check if a given value is an `Array` with `Element` instances;
* ***isFunction*** - check if a given value is a `Function` instance;
* ***isHTMLCollection*** - check if a given value is an `HTMLCollection` instance;
* ***isHTMLElement*** - check if a given value is an `HTMLElement` instance;
* ***isHTMLImageElement*** - check if a given value is an `HTMLImageElement` instance;
* ***isMedia*** - check if a given value is an `SVGElement`, `HTMLImageElement` or `HTMLVideoElement` instance;
* ***isNode*** - check if a given value is a `Node` instance;
* ***isNodeList*** - check if a given value is a `NodeList` instance;
* ***isRTL*** - check if a given node is contained in a `<html dir="rtl">`;
* ***isScaledElement*** - check if a given *Element* is affected by scale;
* ***isShadowRoot*** - check if a given *Node* is a `ShadowRoot` instance;
* ***isString*** - check if a given value is string;
* ***isSVGElement*** - check if a given value is `SVGElement` instance;
* ***isTableElement*** - check if a given value is `<table>`, `<td>` or `<th>` *Element*;
* ***isWindow*** - check if a given value is a `Window` instance;
```js
// EXAMPLES
import { isArray, isHTMLElement, isElementsArray } from 'shorter-js';
// check if a value is an `Array` of `Element` instances
if (isArray(myValue) && myValue.every(isHTMLElement)) {
// do something with these instances
}
// or use the dedicated shortie of the above
if (isElementsArray(myValue)) {
// do something with these instances
}
```
# misc
* ***emulateAnimationEnd*** - utility to execute a callback function when `animationend` event is triggered, or execute the callback right after for legacy browsers
* ***emulateTransitionEnd*** - utility to execute a callback function when `transitionend` event is triggered, or execute the callback right after for legacy browsers
* ***getElementAnimationDuration*** - returns the `animationDuration` property of a `animation` property
* ***getElementAnimationDelay*** - returns the `animationDelay` property of an `animation` property
* ***getElementTransitionDuration*** - returns the `transitionDuration` property of a `transition` property
* ***getElementTransitionDelay*** - returns the `transitionDelay` property of a `transition` property
* ***isElementInScrollRange*** - a quick utility that checks if a target *Element* surface is scrolled within the visible area of the window
* ***isElementInViewport*** - a quick utility that checks if a target *Element* is scrolled fully into visible window area, might not be useful for elements larger in size than the window itself, the above might be more useful
* ***passiveHandler*** - a constant that preserves a standard handler `options` with `passive: true event` option used
* ***queryElement*** - a simple utility to check if a certain item is an *Element* or a selector string, and if a selector string find the FIRST *Element* and return it
* ***ArrayFrom*** - a shortie for `Array.from()` method;
* ***Data*** - a small utility to store web components data that makes use of the native `Map`;
* ***dispatchEvent*** - a shortie for `Element.dispatchEvent()` method;
* ***distinct*** - a shortie you can use to filter duplicate values in an `Array`;
* ***emulateAnimationEnd*** - utility to execute a callback function when `animationend` event is triggered, or execute the callback right after for legacy browsers;
* ***emulateAnimationEndLegacy*** - for legacy browsers;
* ***emulateTransitionEnd*** - utility to execute a callback function when `transitionend` event is triggered, or execute the callback right after for legacy browsers;
* ***emulateTransitionEndLegacy*** - for legacy browsers;
* ***Float32ArrayFrom*** - a shortie for `Float32Array.from()` method;
* ***Float64ArrayFrom*** - a shortie for `Float64Array.from()` method;
* ***focus*** - a shortie for `Element.focus()` method;
* ***noop*** - is your regular `() => {}` NOOP;
* ***normalizeOptions*** - a cool utility to normalize and crosscheck JavaScript options and their DATA API counterparts for various web components; supports namespaced options like `data-NAMESPACE-option="value"`; priority: JavaScript options > DATA API options > default options
* ***tryWrapper*** - a simple `try()` and `catch()` wrapper for functions, with option to preffix the error logs, poiting out the source of the errors
* ***reflow*** - because `element.offsetHeight;` won't validate on ESLint.
* ***ObjectAssign*** - a shortie for `Object.assign()` method;
* ***ObjectKeys*** - a shortie for `Object.keys()` method;
* ***ObjectValues*** - a shortie for `Object.values()` method;
* ***OriginalEvent*** - a small utility that returns a synthetic `CustomEvent` with the added `relatedTarget` and other properties;
* ***passiveHandler*** - a constant that preserves a standard listener `options` with `passive: true` event option used;
* ***passiveHandlerLegacy*** - for legacy browsers;
* ***reflow*** - a small utility that force repaint of a given *Element* by "checking" its `offsetHeight` value, also because using just `element.offsetHeight;` won't validate on ESLint;
* ***setElementStyle*** - a small utility that allows you to set multiple CSS properties at once for a given *Element* target;
* ***Timer*** - a small but powerful utility that makes `setTimeout` have a meaning;
* ***toLowerCase*** - a shortie for `String.toLowerCase()` method;
* ***toUpperCase*** - a shortie for `String.toUpperCase()` method;
* ***tryWrapper*** - a simple `try()` and `catch()` wrapper for functions, with option to preffix the error logs, pointing out the context of the errors;
The ***Data*** and ***Timer*** utilities have their own specifics, you might want to check the [wiki](https://github.com/thednp/shorter-js/wiki).
```js
// EXAMPLES
import {queryElement,emulateTransitionEnd,normalizeOptions} from 'shorter-js'
import {
emulateTransitionEnd,
distinct,
} from 'shorter-js';
// get some target
let targetElement = queryElement('.mySelectorClass');
// execute a callback when transitionend is triggered for the target
emulateTransitionEnd(targetElement, callback);
// emulateTransitionEnd for the above
emulateTransitionEnd(targetElement,callback)
// define some arrays of numbers
const array1 = [0, 1, 3, 5, 7, 9];
const array2 = [0, 2, 4, 6, 8, 10];
// check if element is in scroll range
// emulateTransitionEnd for the above
if (isElementInScrollRange(targetElement)){
doSomeAction()
}
// merge them and filter them to make sure we have distinct values
const array3 = [...array1, ...array2].filter(distinct);
// [0, 1, 3, 5, 7, 9, 2, 4, 6, 8, 10]
```
// set component options
const options = normalizeOptions( element, defaultOptions, inputOptions, nameSpace )
// element - the component target, the owned of the DATA API attributes
// defaultOptions - the component default options
// inputOptions - the component JavaScript options
// namaSpace - the DATA API namespace
// ..required to get the value of `data-NAMESPACE-option="value"`
# selectors
* ***closest*** - a shortie for `Element.closest()` method;
* ***documentAll*** - a quick bit equivalent of the deprecated `document.all` collection;
* ***getCustomElements*** - returns an `Array` with all registered `CustomElement`;
* ***getElementById*** - a shortie for `document.getElementById()` method;
* ***getElementsByClassName*** - a shortie for `Element.getElementsByClassName()` method;
* ***getElementsByTagName*** - a shortie for `Element.getElementsByTagName()` method;
* ***matches*** - a shortie for `Element.matches()` method;
* ***matchesLegacy*** - for legacy browsers;
* ***querySelector*** - a simple utility to check if a given value is an *Element* or a selector string, and if a selector string find the FIRST *Element* and return it;
* ***querySelectorAll*** - a simple utility to check if a certain item is an *Element* or a selector string, and if a selector string find the FIRST *Element* and return it;
```js
// EXAMPLES
import { querySelector, querySelectorAll, documentAll, matches } from 'shorter-js';
// get first element that matches a certain selector
const element = querySelector('.my-class-name');
// get all elements that matches same selector
const elements = querySelectorAll('.my-class-name');
// now do the same as the above, but differently
const elements = [...documentAll].filter((x) => matches(x, '.my-class-name'));
```
# strings
* ***bezierEasing*** - an *Object* comprised or a set of valid CSS `transition-timing-function` based on Cubic Bezier; EG: `cubic-bezier(0.215,0.61,0.355,1)` for `bezierEasing.easingCubicOut`
* ***mouseSwipeEvents*** - preserves the pointer events from mouse actions: start: `mousedown`, end: `mouseup`, move: `mousemove`, cancel: `mouseout`
* ***mouseClickEvents*** - preserves the pointer events from mouse actions: down: `mousedown`, up: `mouseup`
* ***mouseHoverEvents*** - preserve browser specific mouse hover events: `mouseenter` and `mouseleave` OR `mouseover` and `mouseout`
* ***touchEvents*** - preserves the pointer events from touch actions: start: `touchstart`, end: `touchend`, move: `touchmove`, cancel: `touchcancel`
* ***animationDuration*** - preserves the `animationDuration` property name supported by the client browser
* ***animationDelay*** - preserves the `animationDelay` property name supported by the client browser
* ***animationEndEvent*** - preserves the `animationEndEvent` event name supported by the client browser
* ***animationName*** - preserves the `animationName` property name supported by the client browser
* ***transitionDuration*** - preserves the `transitionDuration` property name supported by the client browser
* ***transitionDelay*** - preserves the `transitionDelay` property name supported by the client browser
* ***transitionEndEvent*** - preserves the `transitionend` event name supported by the client browser
* ***transitionProperty*** - preserves the `transitionProperty` property name supported by the client browser
* ***addEventListener*** - preserves the `addEventListener` method name
* ***removeEventListener*** - preserves the `removeEventListener` method name
* ***bezierEasings*** - an *Object* comprised or a set of valid CSS `transition-timing-function` based on Cubic Bezier; EG: `cubic-bezier(0.215,0.61,0.355,1)` for `bezierEasings.easingCubicOut`;
* ***mouseSwipeEvents*** - preserves the pointer events from mouse actions: start: `mousedown`, end: `mouseup`, move: `mousemove`, cancel: `mouseout`;
* ***mouseClickEvents*** - preserves the pointer events from mouse actions: down: `mousedown`, up: `mouseup`;
* ***mouseHoverEvents*** - preserve browser specific mouse hover events: `mouseenter` and `mouseleave` OR `mouseover` and `mouseout`;
* ***touchEvents*** - preserves the pointer events from touch actions: start: `touchstart`, end: `touchend`, move: `touchmove`, cancel: `touchcancel`;
* ***animationDuration*** - preserves the `animationDuration` property for modern browsers;
* ***animationDurationLegacy*** - for legacy browsers fallback;
* ***animationDelay*** - preserves the `animationDelay` property for modern browsers;
* ***animationDelayLegacy*** - for legacy browsers fallback;
* ***animationEndEvent*** - preserves the `animationEndEvent` event for modern browsers;
* ***animationEndEventLegacy*** - for legacy browsers fallback;
* ***animationName*** - preserves the `animationName` property name for modern browsers;
* ***animationNameLegacy*** - for legacy browsers fallback;
* ***transitionDuration*** - preserves the `transitionDuration` property name for modern browsers;
* ***transitionDurationLegacy*** - for legacy browsers fallback;
* ***transitionDelay*** - preserves the `transitionDelay` property name for modern browsers;
* ***transitionDelayLegacy*** - for legacy browsers fallback;
* ***transitionEndEvent*** - preserves the `transitionend` event name for modern browsers;
* ***transitionEndEventLegacy*** - for legacy browsers fallback;
* ***transitionProperty*** - preserves the `transitionProperty` property name for modern browsers;
* ***transitionPropertyLegacy*** - for legacy browsers fallback;
* ***addEventListener*** - preserves the `addEventListener` method name;
* ***removeEventListener*** - preserves the `removeEventListener` method name;
There are lots more string constants available which include native event names, browser strings, keyboard key codes or ARIA specific attribute names. Be sure to check the `src/strings` folder for a complete list.
```js
// EXAMPLES
import {on,off,one,mouseClickEvents,touchEvents,passiveHandler} from 'shorter-js'
import {on, off, one, mouseClickEvents, touchEvents, passiveHandler} from 'shorter-js';
// attach a passive mousedown eventHandler
on(targetElement,mouseClickEvents.down,eventHandler,passiveHandler)
on(targetElement, mouseClickEvents.down, eventHandler, passiveHandler);
// detach a passive mousedown eventHandler
off(targetElement,mouseClickEvents.down,eventHandler,passiveHandler)
off(targetElement, mouseClickEvents.down, eventHandler, passiveHandler);
// attach a single instance passive touchstart eventHandler
one(targetElement,touchEvents.start,eventHandler,passiveHandler)
one(targetElement, touchEvents.start, eventHandler, passiveHandler);
```
# Advanced Use
To avoid adding un-necessary shorties into your code, you might want to import them directly from their location.
Here's a simple example to showcase the benefit of using ***shorter-js***.
```js
// This is your typical day to day scripting
const target = document.getElementById('my-element');
target.addEventListener('click', function(e) {
target.classList.add('my-className');
})
```
Now make it all shorter. You might want to import shorties directly from their location, something we like to call "tree shaking".
```js
// Example
import on from 'shorter-js/src/event/on.js'
import addClass from 'shorter-js/src/class/addClass.js'
import on from 'shorter-js/src/event/on';
import addClass from 'shorter-js/src/class/addClass';
import getElementById from 'shorter-js/src/selectors/getElementById';
import mouseclickEvent from 'shorter-js/src/strings/mouseclickEvent';
on(document.getElementById('my-elem'),'eventName',function(e){
addClass(document.getElementById('my-elem'),'my-className')
const target = getElementById('my-element');
on(target, mouseclickEvent, function(e) {
addClass(target, 'my-className')
})
```
# License
[MIT License](https://github.com/thednp/shorter-js/blob/master/LICENSE)
**shorter-js** is released under the [MIT License](https://github.com/thednp/shorter-js/blob/master/LICENSE)
/**
* Shortcut for `HTMLElement.getAttribute()` method.
* @param {SHORTER.ElementNodes} element target element
* @param {string} attribute attribute name
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @returns {string?} attribute value
*/

@@ -6,0 +7,0 @@ const getAttribute = (element, attribute) => element.getAttribute(attribute);

/**
* Shortcut for `SVGElement.getAttributeNS()` method.
* @param {SHORTER.ElementNodes} element target element
* @param {string} attribute attribute name
* @param {string=} ns attribute namespace
* Shortcut for `HTMLElement.getAttributeNS()` method.
* @param {string} ns attribute namespace
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @returns {string?} attribute value
*/
const getAttributeNS = (element, attribute, ns) => element.getAttributeNS(ns || null, attribute);
const getAttributeNS = (ns, element, attribute) => element.getAttributeNS(ns, attribute);
export default getAttributeNS;
/**
* Shortcut for `HTMLElement.hasAttribute()` method.
* @param {SHORTER.ElementNodes} element target element
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @returns {boolean} the query result
*/

@@ -6,0 +7,0 @@ const hasAttribute = (element, attribute) => element.hasAttribute(attribute);

/**
* Shortcut for `SVGElement.hasAttributeNS()` method.
* @param {SHORTER.ElementNodes} element target element
* Shortcut for `HTMLElement.hasAttributeNS()` method.
* @param {string} ns attribute namespace
* @param {HTMLElement | Element} element target element
* @param {string} att attribute name
* @param {string=} ns attribute namespace
* @returns {boolean} the query result
*/
const hasAttributeNS = (element, att, ns) => element.hasAttributeNS(ns || null, att);
const hasAttributeNS = (ns, element, att) => element.hasAttributeNS(ns, att);
export default hasAttributeNS;
/**
* Shortcut for `HTMLElement.removeAttribute()` method.
* @param {SHORTER.ElementNodes} element target element
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @returns {void}
*/

@@ -6,0 +7,0 @@ const removeAttribute = (element, attribute) => element.removeAttribute(attribute);

/**
* Shortcut for `HTMLElement.removeAttributeNS()` method.
* @param {SHORTER.ElementNodes} element target element
* @param {string} ns attribute namespace
* @param {HTMLElement | Element} element target element
* @param {string} att attribute name
* @param {string=} ns attribute namespace
* @returns {void}
*/
const removeAttributeNS = (element, att, ns) => element.removeAttributeNS(ns || null, att);
const removeAttributeNS = (ns, element, att) => element.removeAttributeNS(ns, att);
export default removeAttributeNS;
/**
* Shortcut for `HTMLElement.setAttribute()` method.
* @param {SHORTER.ElementNodes} element target element
* @param {HTMLElement | Element} element target element
* @param {string} attribute attribute name
* @param {string} value attribute value
* @returns {void}
*/

@@ -7,0 +8,0 @@ const setAttribute = (element, attribute, value) => element.setAttribute(attribute, value);

/**
* Shortcut for `SVGElement.setAttributeNS()` method.
* @param {SHORTER.ElementNodes} element target element
* @param {string} ns attribute namespace
* @param {HTMLElement | Element} element target element
* @param {string} att attribute name
* @param {string} value attribute value
* @param {string=} ns attribute namespace
* @returns {void}
*/
const setAttributeNS = (element, att, value, ns) => element.setAttributeNS(ns || null, att, value);
const setAttributeNS = (ns, element, att, value) => element.setAttributeNS(ns, att, value);
export default setAttributeNS;

@@ -6,4 +6,5 @@ import userAgent from '../strings/userAgent';

* Gecko was not supporting `userAgentData`.
* @type {boolean}
*/
const isFirefox = userAgent ? userAgent.includes('Firefox') : false;
export default isFirefox;

@@ -6,2 +6,3 @@ /**

* @param {string} classNAME to add
* @returns {void}
*/

@@ -8,0 +9,0 @@ export default function addClass(element, classNAME) {

@@ -6,3 +6,3 @@ /**

* @param {string} classNAME to check
* @return {boolean}
* @returns {boolean}
*/

@@ -9,0 +9,0 @@ export default function hasClass(element, classNAME) {

@@ -6,2 +6,3 @@ /**

* @param {string} classNAME to remove
* @returns {void}
*/

@@ -8,0 +9,0 @@ export default function removeClass(element, classNAME) {

/**
* Remove eventListener from an `Element` | `HTMLElement` | `Document` target.
* Remove eventListener from an `Element` | `HTMLElement` | `Document` | `Window` target.
*
* @param {SHORTER.ElementNodes | Document} element event.target
* @param {HTMLElement | Element | Document | Window} element event.target
* @param {string} eventName event.type
* @param {EventListener} handler callback
* @param {EventListenerOptions | boolean | undefined} options other event options
* @param {EventListener} listener callback
* @param {(EventListenerOptions | boolean)=} options other event options
* @returns {void}
*/
export default function off(element, eventName, handler, options) {
export default function off(element, eventName, listener, options) {
const ops = options || false;
element.removeEventListener(eventName, handler, ops);
element.removeEventListener(eventName, listener, ops);
}
/**
* Add eventListener to an `Element` | `HTMLElement` | `Document` target.
*
* @param {SHORTER.ElementNodes | Document} element event.target
* @param {HTMLElement | Element | Document | Window} element event.target
* @param {string} eventName event.type
* @param {EventListener} handler callback
* @param {EventListenerOptions | boolean | undefined} options other event options
* @param {EventListener} listener callback
* @param {(EventListenerOptions | boolean)=} options other event options
* @returns {void}
*/
export default function on(element, eventName, handler, options) {
export default function on(element, eventName, listener, options) {
const ops = options || false;
element.addEventListener(eventName, handler, ops);
element.addEventListener(eventName, listener, ops);
}

@@ -5,22 +5,23 @@ import on from './on';

/**
* Add an `eventListener` to an `Element` | `HTMLElement` | `Document` target
* and remove it once callback is called.
* Add an `eventListener` to an `Element` | `HTMLElement` | `Document` | `Window`
* target and remove it once callback is called.
*
* @param {SHORTER.ElementNodes | Document} element event.target
* @param {HTMLElement | Element | Document | Window} element event.target
* @param {string} eventName event.type
* @param {EventListener} handler callback
* @param {EventListenerOptions | boolean | undefined} options other event options
* @param {EventListener} listener callback
* @param {(EventListenerOptions | boolean)=} options other event options
* @returns {void}
*/
export default function one(element, eventName, handler, options) {
export default function one(element, eventName, listener, options) {
/**
* Wrap the handler for easy on -> off
* @param {Event} e the Event object
* Wrap the listener for easy on -> off
* @type {EventListener}
*/
function handlerWrapper(e) {
const handlerWrapper = (e) => {
if (e.target === element) {
handler.apply(element, [e]);
listener.apply(element, [e]);
off(element, eventName, handlerWrapper, options);
}
}
};
on(element, eventName, handlerWrapper, options);
}

@@ -1,4 +0,1 @@

import isElement from '../is/isElement';
import isHTMLElement from '../is/isHTMLElement';
/**

@@ -9,3 +6,3 @@ * Returns the bounding client rect of a target `HTMLElement`.

*
* @param {SHORTER.ElementNodes} element event.target
* @param {HTMLElement | Element} element event.target
* @param {boolean=} includeScale when *true*, the target scale is also computed

@@ -21,11 +18,6 @@ * @returns {SHORTER.BoundingClientRect} the bounding client rect object

if (includeScale && (isHTMLElement(element) || isElement(element))) {
// @ts-ignore
scaleX = element.offsetWidth > 0
// @ts-ignore
? Math.round(width) / element.offsetWidth || 1 : 1;
// @ts-ignore
scaleY = element.offsetHeight > 0
// @ts-ignore
? Math.round(height) / element.offsetHeight || 1 : 1;
if (includeScale && element instanceof HTMLElement) {
const { offsetWidth, offsetHeight } = element;
scaleX = offsetWidth > 0 ? Math.round(width) / offsetWidth || 1 : 1;
scaleY = offsetHeight > 0 ? Math.round(height) / offsetHeight || 1 : 1;
}

@@ -32,0 +24,0 @@

@@ -1,16 +0,11 @@

import isWindow from '../is/isWindow';
import isNode from '../is/isNode';
/**
* Returns the `document` or the `#document` element.
* @see https://github.com/floating-ui/floating-ui
* @param {(Node | SHORTER.ElementNodes | Window)=} node
* @param {(Node | HTMLElement | Element | globalThis)=} node
* @returns {Document}
*/
export default function getDocument(node) {
// @ts-ignore -- `isNode` checks that
if (isNode(node)) return node.ownerDocument;
// @ts-ignore -- `isWindow` checks that too
if (isWindow(node)) return node.document;
if (node instanceof HTMLElement) return node.ownerDocument;
if (node instanceof Window) return node.document;
return window.document;
}

@@ -5,3 +5,3 @@ import getDocument from './getDocument';

*
* @param {(Node | SHORTER.ElementNodes)=} node
* @param {(Node | HTMLElement | Element | globalThis)=} node
* @returns {HTMLElement | HTMLBodyElement}

@@ -8,0 +8,0 @@ */

@@ -6,3 +6,3 @@ import getDocument from './getDocument';

*
* @param {(Node | SHORTER.ElementNodes)=} node
* @param {(Node | HTMLElement | Element | globalThis)=} node
* @returns {HTMLElement | HTMLHtmlElement}

@@ -9,0 +9,0 @@ */

@@ -5,3 +5,3 @@ import getDocument from './getDocument';

*
* @param {(Node | SHORTER.ElementNodes)=} node
* @param {(Node | HTMLElement | Element | globalThis)=} node
* @returns {HTMLElement | HTMLHeadElement}

@@ -8,0 +8,0 @@ */

@@ -9,3 +9,3 @@ import animationDelay from '../strings/animationDelay';

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @return {number} the value in miliseconds

@@ -12,0 +12,0 @@ */

@@ -10,3 +10,3 @@ import supportAnimation from '../boolean/supportAnimation';

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @return {number} the value in miliseconds

@@ -13,0 +13,0 @@ */

@@ -9,3 +9,3 @@ import animationDuration from '../strings/animationDuration';

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @return {number} the value in miliseconds

@@ -12,0 +12,0 @@ */

@@ -10,3 +10,3 @@ import supportAnimation from '../boolean/supportAnimation';

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @return {number} the value in miliseconds

@@ -13,0 +13,0 @@ */

@@ -8,3 +8,3 @@ /**

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @param {string} property the css property

@@ -11,0 +11,0 @@ * @return {string} the css property value

@@ -9,3 +9,3 @@ import transitionDelay from '../strings/transitionDelay';

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @return {number} the value in miliseconds

@@ -12,0 +12,0 @@ */

@@ -10,3 +10,3 @@ import supportTransition from '../boolean/supportTransition';

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @return {number} the value in miliseconds

@@ -13,0 +13,0 @@ */

@@ -9,3 +9,3 @@ import transitionDuration from '../strings/transitionDuration';

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @return {number} the value in miliseconds

@@ -12,0 +12,0 @@ */

@@ -10,3 +10,3 @@ import supportTransition from '../boolean/supportTransition';

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @return {number} the value in miliseconds

@@ -13,0 +13,0 @@ */

/**
* Returns an `{x,y}` object with the target
* `Element` / `Node` scroll position.
* `HTMLElement` / `Node` scroll position.
*
* @see https://github.com/floating-ui/floating-ui
*
* @param {SHORTER.ElementNodes | Window} element target node / element
* @param {HTMLElement | Element | Window} element target node / element
* @returns {{x: number, y: number}} the scroll tuple

@@ -9,0 +9,0 @@ */

@@ -8,4 +8,4 @@ import getDocumentElement from './getDocumentElement';

*
* @param {Node | SHORTER.ElementNodes} node the target node
* @returns {Node | SHORTER.ElementNodes} the apropriate parent node
* @param {Node | HTMLElement | Element} node the target node
* @returns {Node | HTMLElement | Element} the apropriate parent node
*/

@@ -12,0 +12,0 @@ export default function getParentNode(node) {

@@ -8,4 +8,4 @@ import isScaledElement from '../is/isScaledElement';

*
* @param {SHORTER.ElementNodes} element target
* @param {SHORTER.ElementNodes | Window} offsetParent the container / offset parent
* @param {HTMLElement | Element} element target
* @param {HTMLElement | Element | Window} offsetParent the container / offset parent
* @param {{x: number, y: number}} scroll

@@ -15,7 +15,7 @@ * @returns {SHORTER.OffsetRect}

export default function getRectRelativeToOffsetParent(element, offsetParent, scroll) {
const isParentAWindow = offsetParent instanceof Window;
const rect = getBoundingClientRect(element, !isParentAWindow && isScaledElement(offsetParent));
const isParentAnElement = offsetParent instanceof HTMLElement;
const rect = getBoundingClientRect(element, isParentAnElement && isScaledElement(offsetParent));
const offsets = { x: 0, y: 0 };
if (!isParentAWindow) {
if (isParentAnElement) {
const offsetRect = getBoundingClientRect(offsetParent, true);

@@ -22,0 +22,0 @@ offsets.x = offsetRect.x + offsetParent.clientLeft;

@@ -5,3 +5,3 @@ /**

*
* @param {(Node | SHORTER.ElementNodes | Window)=} node target node
* @param {(Node | HTMLElement | Element | Window)=} node target node
* @returns {globalThis}

@@ -8,0 +8,0 @@ */

@@ -23,2 +23,3 @@ // strings

import loadEvent from './strings/loadEvent';
import loadstartEvent from './strings/loadstartEvent';
import unloadEvent from './strings/unloadEvent';

@@ -48,2 +49,3 @@ import readystatechangeEvent from './strings/readystatechangeEvent';

import mouseoutEvent from './strings/mouseoutEvent';
import mouseoverEvent from './strings/mouseoverEvent';
import mousemoveEvent from './strings/mousemoveEvent';

@@ -160,2 +162,5 @@ import mousewheelEvent from './strings/mousewheelEvent';

import Data, { getInstance } from './misc/data';
import createElement from './misc/createElement';
import createElementNS from './misc/createElementNS';
import dispatchEvent from './misc/dispatchEvent';
import distinct from './misc/distinct';

@@ -169,2 +174,3 @@ import emulateAnimationEnd from './misc/emulateAnimationEnd';

import focus from './misc/focus';
import noop from './misc/noop';
import normalizeOptions from './misc/normalizeOptions';

@@ -175,2 +181,3 @@ import normalizeValue from './misc/normalizeValue';

import ObjectValues from './misc/ObjectValues';
import OriginalEvent from './misc/OriginalEvent';
import passiveHandler from './misc/passiveHandler';

@@ -181,2 +188,4 @@ import passiveHandlerLegacy from './misc/passiveHandlerLegacy';

import Timer from './misc/timer';
import toLowerCase from './misc/toLowerCase';
import toUpperCase from './misc/toUpperCase';
import tryWrapper from './misc/tryWrapper';

@@ -202,2 +211,3 @@

import getRectRelativeToOffsetParent from './get/getRectRelativeToOffsetParent';
import getUID from './get/getUID';
import getWindow from './get/getWindow';

@@ -228,10 +238,14 @@

// selectors
import closest from './selectors/closest';
import documentAll from './selectors/documentAll';
import elementNodes from './selectors/elementNodes';
import parentNodes from './selectors/parentNodes';
import closest from './selectors/closest';
import querySelector from './selectors/querySelector';
import getCustomElements from './selectors/getCustomElements';
import getElementById from './selectors/getElementById';
import querySelectorAll from './selectors/querySelectorAll';
import getElementsByTagName from './selectors/getElementsByTagName';
import getElementsByClassName from './selectors/getElementsByClassName';
import matches from './selectors/matches';
import matchesLegacy from './selectors/matchesLegacy';

@@ -261,2 +275,3 @@ import Version from './misc/version';

loadEvent,
loadstartEvent,
unloadEvent,

@@ -283,2 +298,3 @@ readystatechangeEvent,

mouseoutEvent,
mouseoverEvent,
mousemoveEvent,

@@ -366,6 +382,11 @@ mousewheelEvent,

one,
dispatchEvent,
distinct,
Data,
getInstance,
createElement,
createElementNS,
toUpperCase,
toLowerCase,
Timer,
getInstance,
emulateAnimationEnd,

@@ -412,7 +433,11 @@ emulateAnimationEndLegacy,

closest,
documentAll,
querySelector,
getCustomElements,
getElementById,
querySelectorAll,
getElementsByClassName,
getElementsByTagName,
matches,
matchesLegacy,
normalizeValue,

@@ -422,3 +447,5 @@ normalizeOptions,

reflow,
noop,
focus,
getUID,
ArrayFrom,

@@ -430,2 +457,3 @@ Float32ArrayFrom,

ObjectValues,
OriginalEvent,
getBoundingClientRect,

@@ -432,0 +460,0 @@ getDocument,

@@ -8,3 +8,3 @@ import getBoundingClientRect from '../get/getBoundingClientRect';

*
* @param {HTMLElement} element target
* @param {HTMLElement | Element} element target
* @return {boolean} the query result

@@ -11,0 +11,0 @@ */

@@ -8,3 +8,3 @@ import getBoundingClientRect from '../get/getBoundingClientRect';

*
* @param {HTMLElement} element target
* @param {HTMLElement | Element} element target
* @return {boolean} the query result

@@ -11,0 +11,0 @@ */

@@ -1,3 +0,1 @@

import isHTMLElement from './isHTMLElement';
/**

@@ -10,4 +8,4 @@ * Checks if an object is an `Array` in which all items are `Element`.

const isElementsArray = (object) => Array.isArray(object)
&& object.every((el) => isHTMLElement(el));
&& object.every((el) => [HTMLElement, Element].some((x) => el instanceof x));
export default isElementsArray;

@@ -5,3 +5,3 @@ import getDocumentElement from '../get/getDocumentElement';

* Checks if a page is Right To Left.
* @param {SHORTER.ElementNodes=} node the target
* @param {(HTMLElement | Element)=} node the target
* @returns {boolean} the query result

@@ -8,0 +8,0 @@ */

@@ -7,3 +7,3 @@ import getBoundingClientRect from '../get/getBoundingClientRect';

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement} element target
* @returns {boolean} the query result

@@ -13,3 +13,2 @@ */

const { width, height } = getBoundingClientRect(element);
// @ts-ignore -- our elements usually have offset properties
const { offsetWidth, offsetHeight } = element;

@@ -16,0 +15,0 @@ return Math.round(width) !== offsetWidth

import querySelector from '../selectors/querySelector';
/** @type {Map<string, Map<SHORTER.ElementNodes, SHORTER.Component>>} */
/** @type {Map<string, Map<HTMLElement | Element, Record<string, any>>>} */
const componentData = new Map();

@@ -12,5 +12,5 @@ /**

* Sets web components data.
* @param {SHORTER.ElementNodes | string} target target element
* @param {HTMLElement | Element | string} target target element
* @param {string} component the component's name or a unique key
* @param {SHORTER.Component} instance the component instance
* @param {Record<string, any>} instance the component instance
*/

@@ -33,3 +33,3 @@ set: (target, component, instance) => {

* @param {string} component the component's name or a unique key
* @returns {Map<SHORTER.ElementNodes, SHORTER.Component>?} all the component instances
* @returns {Map<HTMLElement | Element, Record<string, any>>?} all the component instances
*/

@@ -44,5 +44,5 @@ getAllFor: (component) => {

* Returns the instance associated with the target.
* @param {SHORTER.ElementNodes | string} target target element
* @param {HTMLElement | Element | string} target target element
* @param {string} component the component's name or a unique key
* @returns {SHORTER.Component?} the instance
* @returns {Record<string, any>?} the instance
*/

@@ -59,3 +59,3 @@ get: (target, component) => {

* Removes web components data.
* @param {SHORTER.ElementNodes | string} target target element
* @param {HTMLElement | Element | string} target target element
* @param {string} component the component's name or a unique key

@@ -62,0 +62,0 @@ */

/**
* JavaScript `Array` distinct.
* @see https://codeburst.io/javascript-array-distinct-5edc93501dc4
* @param {*} value
* @param {any} value
* @param {number} index
* @param {*} self
* @param {any} self
* @returns {boolean}

@@ -8,0 +8,0 @@ */

@@ -9,3 +9,3 @@ import animationEndEvent from '../strings/animationEndEvent';

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @param {EventListener} handler `animationend` callback

@@ -22,3 +22,3 @@ */

* Wrap the handler in on -> off callback
* @param {Event} e Event object
* @type {EventListener}
*/

@@ -25,0 +25,0 @@ const animationEndWrapper = (e) => {

@@ -10,3 +10,3 @@ import supportAnimation from '../boolean/supportAnimation';

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @param {EventListener} handler `animationend` callback

@@ -13,0 +13,0 @@ */

@@ -9,3 +9,3 @@ import transitionEndEvent from '../strings/transitionEndEvent';

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @param {EventListener} handler `transitionend` callback

@@ -22,3 +22,3 @@ */

* Wrap the handler in on -> off callback
* @param {Event} e Event object
* @type {EventListener} e Event object
*/

@@ -25,0 +25,0 @@ const transitionEndWrapper = (e) => {

@@ -10,3 +10,3 @@ import supportTransition from '../boolean/supportTransition';

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @param {EventListener} handler `transitionend` callback

@@ -13,0 +13,0 @@ */

/**
* Utility to focus an `HTMLElement` target.
*
* @param {SHORTER.ElementNodes} element is the target
* @param {HTMLElement | Element} element is the target
*/

@@ -6,0 +6,0 @@ // @ts-ignore -- `Element`s resulted from querySelector can focus too

@@ -0,3 +1,5 @@

import getAttribute from '../attr/getAttribute';
import normalizeValue from './normalizeValue';
import ObjectKeys from './ObjectKeys';
import toLowerCase from './toLowerCase';

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

*
* @param {SHORTER.ElementNodes} element target
* @param {HTMLElement | Element} element target
* @param {Record<string, any>} defaultOps component default options

@@ -21,6 +23,7 @@ * @param {Record<string, any>} inputOps component instance options

const dataOps = {};
const title = 'title';
ObjectKeys(data).forEach((k) => {
const key = ns && k.includes(ns)
? k.replace(ns, '').replace(/[A-Z]/, (match) => match.toLowerCase())
? k.replace(ns, '').replace(/[A-Z]/, (match) => toLowerCase(match))
: k;

@@ -41,3 +44,5 @@

} else {
normalOps[k] = defaultOps[k];
normalOps[k] = k === title
? getAttribute(element, title)
: defaultOps[k];
}

@@ -44,0 +49,0 @@ });

/**
* A global namespace for most scroll event listeners.
* @type {Partial<AddEventListenerOptions>}
*/

@@ -4,0 +5,0 @@ const passiveHandler = { passive: true };

@@ -5,2 +5,3 @@ import supportPassive from '../boolean/supportPassive';

* A global namespace for most scroll event listeners in legacy browsers.
* @type {Partial<AddEventListenerOptions> | boolean}
*/

@@ -7,0 +8,0 @@ const passiveHandler = supportPassive ? { passive: true } : false;

/**
* Utility to force re-paint of an `HTMLElement` target.
*
* @param {SHORTER.ElementNodes} element is the target
* @param {HTMLElement | Element} element is the target
* @return {number} the `Element.offsetHeight` value

@@ -6,0 +6,0 @@ */

@@ -5,3 +5,3 @@ import ObjectAssign from './ObjectAssign';

* Shortcut for multiple uses of `HTMLElement.style.propertyName` method.
* @param {SHORTER.ElementNodes} element target element
* @param {HTMLElement | Element} element target element
* @param {Partial<CSSStyleDeclaration>} styles attribute value

@@ -8,0 +8,0 @@ */

import querySelector from '../selectors/querySelector';
/** @type {Map<SHORTER.ElementNodes, any>} */
/** @type {Map<HTMLElement | Element, any>} */
const TimeCache = new Map();

@@ -12,6 +12,6 @@ /**

* Sets a new timeout timer for an element, or element -> key association.
* @param {SHORTER.ElementNodes | string} target target element
* @param {HTMLElement | Element | string} target target element
* @param {ReturnType<TimerHandler>} callback the callback
* @param {number} delay the execution delay
* @param {string=} key a unique
* @param {string=} key a unique key
*/

@@ -36,5 +36,5 @@ set: (target, callback, delay, key) => {

* Returns the timer associated with the target.
* @param {SHORTER.ElementNodes | string} target target element
* @param {HTMLElement | Element | string} target target element
* @param {string=} key a unique
* @returns {ReturnType<TimerHandler>?} the timer
* @returns {number?} the timer
*/

@@ -45,15 +45,8 @@ get: (target, key) => {

if (!element) return null;
const keyTimers = TimeCache.get(element);
if (key && key.length) {
if (!TimeCache.has(element)) {
TimeCache.set(element, new Map());
}
const keyTimers = TimeCache.get(element);
if (keyTimers.has(key)) {
return keyTimers.get(key);
}
} else if (TimeCache.has(element)) {
return TimeCache.get(element);
if (key && key.length && keyTimers && keyTimers.get) {
return keyTimers.get(key) || null;
}
return null;
return keyTimers || null;
},

@@ -63,3 +56,3 @@

* Clears the element's timer.
* @param {SHORTER.ElementNodes | string} target target element
* @param {HTMLElement | Element | string} target target element
* @param {string=} key a unique key

@@ -69,13 +62,17 @@ */

const element = querySelector(target);
const timers = element && TimeCache.get(element);
if (!timers) return;
if (!element) return;
if (key && key.length) {
if (timers.has(key)) {
clearTimeout(timers.get(key));
timers.delete(key);
const keyTimers = TimeCache.get(element);
if (keyTimers && keyTimers.get) {
clearTimeout(keyTimers.get(key));
keyTimers.delete(key);
if (keyTimers.size === 0) {
TimeCache.delete(element);
}
}
} else {
clearTimeout(timers);
clearTimeout(TimeCache.get(element));
TimeCache.delete(element);

@@ -82,0 +79,0 @@ }

@@ -8,10 +8,10 @@ /**

*
* @param {SHORTER.ElementNodes} element Element to look into
* @param {HTMLElement | Element} element Element to look into
* @param {string} selector the selector name
* @return {SHORTER.ElementNodes?} the query result
* @return {(HTMLElement | Element)?} the query result
*/
export default function closest(element, selector) {
return (element && element.closest(selector))
return element ? (element.closest(selector)
// @ts-ignore -- break out of `ShadowRoot`
|| closest(element.getRootNode().host, selector);
|| closest(element.getRootNode().host, selector)) : null;
}

@@ -1,4 +0,5 @@

import getDocument from '../get/getDocument';
import documentAll from './documentAll';
import isCustomElement from '../is/isCustomElement';
import parentNodes from './parentNodes';
import getElementsByTagName from './getElementsByTagName';

@@ -10,10 +11,10 @@ /**

*
* @param {(SHORTER.ParentNodes)=} parent parent to look into
* @returns {SHORTER.ElementNodes[]} the query result
* @param {(HTMLElement | Element | Node | Document)=} parent parent to look into
* @returns {Array<(HTMLElement | Element)>} the query result
*/
export default function getCustomElements(parent) {
const lookUp = parent && parentNodes.some((x) => parent instanceof x)
? parent : getDocument();
// @ts-ignore -- look inside `shadowRoot` node too
return [...lookUp.querySelectorAll('*')].filter(isCustomElement);
const collection = parent && parentNodes.some((x) => parent instanceof x)
// @ts-ignore -- look inside `shadowRoot` node too
? getElementsByTagName('*', parent) : documentAll;
return [...collection].filter(isCustomElement);
}

@@ -9,4 +9,4 @@ import getDocument from '../get/getDocument';

* @param {string} selector the class name
* @param {(SHORTER.ElementNodes | Document)=} parent optional Element to look into
* @return {HTMLCollectionOf<SHORTER.ElementNodes>} the 'HTMLCollection'
* @param {(HTMLElement | Element | Document)=} parent optional Element to look into
* @return {HTMLCollectionOf<HTMLElement | Element>} the 'HTMLCollection'
*/

@@ -13,0 +13,0 @@ export default function getElementsByClassName(selector, parent) {

@@ -9,4 +9,4 @@ import getDocument from '../get/getDocument';

* @param {string} selector the tag name
* @param {(SHORTER.ElementNodes | Document)=} parent optional Element to look into
* @return {HTMLCollectionOf<SHORTER.ElementNodes>} the 'HTMLCollection'
* @param {(HTMLElement | Element | Document)=} parent optional Element to look into
* @return {HTMLCollectionOf<HTMLElement | Element>} the 'HTMLCollection'
*/

@@ -13,0 +13,0 @@ export default function getElementsByTagName(selector, parent) {

/**
* A global array of possible `ParentNode`.
*/
const parentNodes = [Document, Node, Element, HTMLElement];
const parentNodes = [Document, Element, HTMLElement];
export default parentNodes;

@@ -9,16 +9,14 @@ import getDocument from '../get/getDocument';

*
* @param {SHORTER.ElementNodes | string} selector the input selector or target element
* @param {SHORTER.ParentNodes=} parent optional node to look into
* @return {(SHORTER.ElementNodes)?} the `HTMLElement` or `querySelector` result
* @param {HTMLElement | Element | string} selector the input selector or target element
* @param {(HTMLElement | Element | Document)=} parent optional node to look into
* @return {(HTMLElement | Element)?} the `HTMLElement` or `querySelector` result
*/
export default function querySelector(selector, parent) {
const selectorIsString = typeof selector === 'string';
const lookUp = parent && parentNodes.some((x) => parent instanceof x)
const lookUp = parentNodes.some((x) => parent instanceof x)
? parent : getDocument();
if (!selectorIsString && [...elementNodes].some((x) => selector instanceof x)) {
return selector;
}
// @ts-ignore -- `ShadowRoot` is also a node
return selectorIsString ? lookUp.querySelector(selector) : null;
// @ts-ignore
return elementNodes.some((x) => selector instanceof x)
// @ts-ignore
? selector : lookUp.querySelector(selector);
}

@@ -8,4 +8,4 @@ import getDocument from '../get/getDocument';

* @param {string} selector the input selector
* @param {(SHORTER.ParentNodes)=} parent optional node to look into
* @return {NodeListOf<SHORTER.ElementNodes>} the query result
* @param {(HTMLElement | Element | Document | Node)=} parent optional node to look into
* @return {NodeListOf<HTMLElement | Element>} the query result
*/

@@ -12,0 +12,0 @@ export default function querySelectorAll(selector, parent) {

@@ -0,1 +1,3 @@

import documentHead from '../blocks/documentHead';
/**

@@ -5,3 +7,3 @@ * A global namespace for 'animationDelay' string.

*/
const animationDelay = 'webkitAnimation' in document.head.style ? 'webkitAnimationDelay' : 'animationDelay';
const animationDelay = 'webkitAnimation' in documentHead.style ? 'webkitAnimationDelay' : 'animationDelay';
export default animationDelay;

@@ -0,1 +1,3 @@

import documentHead from '../blocks/documentHead';
/**

@@ -5,3 +7,3 @@ * A global namespace for 'animationDuration' string.

*/
const animationDuration = 'webkitAnimation' in document.head.style ? 'webkitAnimationDuration' : 'animationDuration';
const animationDuration = 'webkitAnimation' in documentHead.style ? 'webkitAnimationDuration' : 'animationDuration';
export default animationDuration;

@@ -0,1 +1,3 @@

import documentHead from '../blocks/documentHead';
/**

@@ -5,3 +7,3 @@ * A global namespace for 'animationend' string.

*/
const animationEndEvent = 'webkitAnimation' in document.head.style ? 'webkitAnimationEnd' : 'animationend';
const animationEndEvent = 'webkitAnimation' in documentHead.style ? 'webkitAnimationEnd' : 'animationend';
export default animationEndEvent;

@@ -0,1 +1,3 @@

import documentHead from '../blocks/documentHead';
/**

@@ -5,3 +7,3 @@ * A global namespace for 'animationName' string.

*/
const animationName = 'webkitAnimation' in document.head.style ? 'webkitAnimationName' : 'animationName';
const animationName = 'webkitAnimation' in documentHead.style ? 'webkitAnimationName' : 'animationName';
export default animationName;

@@ -0,54 +1,108 @@

import abort from './abortEvent';
import beforeunload from './beforeunloadEvent';
import blur from './blurEvent';
import change from './changeEvent';
import contextmenu from './contextmenuEvent';
import DOMContentLoaded from './DOMContentLoadedEvent';
import DOMMouseScroll from './DOMMouseScrollEvent';
import error from './errorEvent';
import focus from './focusEvent';
import focusin from './focusinEvent';
import focusout from './focusoutEvent';
import gesturechange from './gesturechangeEvent';
import gestureend from './gestureendEvent';
import gesturestart from './gesturestartEvent';
import keydown from './keydownEvent';
import keypress from './keypressEvent';
import keyup from './keyupEvent';
import load from './loadEvent';
import click from './mouseclickEvent';
import dblclick from './mousedblclickEvent';
import mousedown from './mousedownEvent';
import mouseup from './mouseupEvent';
import hover from './mousehoverEvent';
import mouseenter from './mouseenterEvent';
import mouseleave from './mouseleaveEvent';
import mousein from './mouseinEvent';
import mouseout from './mouseoutEvent';
import mouseover from './mouseoverEvent';
import mousemove from './mousemoveEvent';
import mousewheel from './mousewheelEvent';
import move from './moveEvent';
import orientationchange from './orientationchangeEvent';
import pointercancel from './pointercancelEvent';
import pointerdown from './pointerdownEvent';
import pointerleave from './pointerleaveEvent';
import pointermove from './pointermoveEvent';
import pointerup from './pointerupEvent';
import readystatechange from './readystatechangeEvent';
import reset from './resetEvent';
import resize from './resizeEvent';
import select from './selectEvent';
import selectend from './selectendEvent';
import selectstart from './selectstartEvent';
import scroll from './scrollEvent';
import submit from './submitEvent';
import touchstart from './touchstartEvent';
import touchmove from './touchmoveEvent';
import touchcancel from './touchcancelEvent';
import touchend from './touchendEvent';
import unload from './unloadEvent';
/**
* A global namespace for all browser native events.
* @type {string[]}
*/
const nativeEvents = [
'click',
'dblclick',
'mouseup',
'mousedown',
'contextmenu',
'mousewheel',
'DOMMouseScroll',
'mouseover',
'mouseout',
'mousemove',
'selectstart',
'selectend',
'keydown',
'keypress',
'keyup',
'orientationchange',
'touchstart',
'touchmove',
'touchend',
'touchcancel',
'pointercancel',
'pointerdown',
'pointerleave',
'pointermove',
'pointerup',
'gesturestart',
'gesturechange',
'gestureend',
'focus',
'blur',
'change',
'reset',
'select',
'submit',
'focusin',
'focusout',
'load',
'unload',
'beforeunload',
'resize',
'move',
'DOMContentLoaded',
'readystatechange',
'error',
'abort',
'scroll',
];
const nativeEvents = {
DOMContentLoaded,
DOMMouseScroll,
abort,
beforeunload,
blur,
change,
click,
contextmenu,
dblclick,
error,
focus,
focusin,
focusout,
gesturechange,
gestureend,
gesturestart,
hover,
keydown,
keypress,
keyup,
load,
mousedown,
mousemove,
mousein,
mouseout,
mouseenter,
mouseleave,
mouseover,
mouseup,
mousewheel,
move,
orientationchange,
pointercancel,
pointerdown,
pointerleave,
pointermove,
pointerup,
readystatechange,
reset,
resize,
scroll,
select,
selectend,
selectstart,
submit,
touchcancel,
touchend,
touchmove,
touchstart,
unload,
};
export default nativeEvents;

@@ -0,1 +1,3 @@

import documentHead from '../blocks/documentHead';
/**

@@ -5,3 +7,3 @@ * A global namespace for 'transitionDelay' string.

*/
const transitionDelay = 'webkitTransition' in document.head.style ? 'webkitTransitionDelay' : 'transitionDelay';
const transitionDelay = 'webkitTransition' in documentHead.style ? 'webkitTransitionDelay' : 'transitionDelay';
export default transitionDelay;

@@ -0,1 +1,3 @@

import documentHead from '../blocks/documentHead';
/**

@@ -5,3 +7,3 @@ * A global namespace for 'transitionDuration' string.

*/
const transitionDuration = 'webkitTransition' in document.head.style ? 'webkitTransitionDuration' : 'transitionDuration';
const transitionDuration = 'webkitTransition' in documentHead.style ? 'webkitTransitionDuration' : 'transitionDuration';
export default transitionDuration;

@@ -0,1 +1,3 @@

import documentHead from '../blocks/documentHead';
/**

@@ -5,3 +7,3 @@ * A global namespace for 'transitionend' string.

*/
const transitionEndEvent = 'webkitTransition' in document.head.style ? 'webkitTransitionEnd' : 'transitionend';
const transitionEndEvent = 'webkitTransition' in documentHead.style ? 'webkitTransitionEnd' : 'transitionend';
export default transitionEndEvent;
/**
* A global namespace for:
* * `transitionProperty` string for Firefox,
* * `transition` property for all other browsers.
* A global namespace for `transitionProperty` string for modern browsers.
*

@@ -6,0 +4,0 @@ * @type {string}

@@ -0,10 +1,12 @@

import documentHead from '../blocks/documentHead';
/**
* A global namespace for:
* * `transitionProperty` string for Firefox,
* * `webkitTransition` for older Chrome / Safari browsers,
* * `transition` property for all other browsers.
* * `transitionProperty` string for modern brosers,
* * `webkitTransition` for legacy Chrome / Safari browsers
*
* @type {string}
*/
const transitionProperty = 'webkitTransition' in document.head.style ? 'webkitTransitionProperty' : 'transitionProperty';
const transitionProperty = 'webkitTransition' in documentHead.style ? 'webkitTransitionProperty' : 'transitionProperty';
export default transitionProperty;
// @ts-ignore
const { userAgentData: userAgentDATA } = navigator;
const { userAgentData: uaDATA } = navigator;
/**
* A global namespace for `userAgentData` event.
* A global namespace for `userAgentData` object.
*/
const userAgentData = userAgentDATA;
const userAgentData = uaDATA;
export default userAgentData;

@@ -13,24 +13,24 @@ export as namespace SHORTER;

export { default as ariaSelected } from 'shorter-js/src/strings/ariaSelected';
export { default as nativeEvents } from 'shorter-js/src/strings/nativeEvents';
export { default as abortEvent } from 'shorter-js/src/strings/abortEvent';
export { default as beforeunloadEvent } from 'shorter-js/src/strings/beforeunloadEvent';
export { default as blurEvent } from 'shorter-js/src/strings/blurEvent';
export { default as moveEvent } from 'shorter-js/src/strings/moveEvent';
export { default as changeEvent } from 'shorter-js/src/strings/changeEvent';
export { default as errorEvent } from 'shorter-js/src/strings/errorEvent';
export { default as resetEvent } from 'shorter-js/src/strings/resetEvent';
export { default as resizeEvent } from 'shorter-js/src/strings/resizeEvent';
export { default as scrollEvent } from 'shorter-js/src/strings/scrollEvent';
export { default as submitEvent } from 'shorter-js/src/strings/submitEvent';
export { default as loadEvent } from 'shorter-js/src/strings/loadEvent';
export { default as unloadEvent } from 'shorter-js/src/strings/unloadEvent';
export { default as readystatechangeEvent } from 'shorter-js/src/strings/readystatechangeEvent';
export { default as beforeunloadEvent } from 'shorter-js/src/strings/beforeunloadEvent';
export { default as orientationchangeEvent } from 'shorter-js/src/strings/orientationchangeEvent';
export { default as contextmenuEvent } from 'shorter-js/src/strings/contextmenuEvent';
export { default as DOMContentLoadedEvent } from 'shorter-js/src/strings/DOMContentLoadedEvent';
export { default as DOMMouseScrollEvent } from 'shorter-js/src/strings/DOMMouseScrollEvent';
export { default as selectEvent } from 'shorter-js/src/strings/selectEvent';
export { default as selectendEvent } from 'shorter-js/src/strings/selectendEvent';
export { default as selectstartEvent } from 'shorter-js/src/strings/selectstartEvent';
export { default as mouseSwipeEvents } from 'shorter-js/src/strings/mouseSwipeEvents';
export { default as errorEvent } from 'shorter-js/src/strings/errorEvent';
export { default as focusEvents } from 'shorter-js/src/strings/focusEvents';
export { default as focusEvent } from 'shorter-js/src/strings/focusEvent';
export { default as focusinEvent } from 'shorter-js/src/strings/focusinEvent';
export { default as focusoutEvent } from 'shorter-js/src/strings/focusoutEvent';
export { default as gesturechangeEvent } from 'shorter-js/src/strings/gesturechangeEvent';
export { default as gestureendEvent } from 'shorter-js/src/strings/gestureendEvent';
export { default as gesturestartEvent } from 'shorter-js/src/strings/gesturestartEvent';
export { default as keydownEvent } from 'shorter-js/src/strings/keydownEvent';
export { default as keypressEvent } from 'shorter-js/src/strings/keypressEvent';
export { default as keyupEvent } from 'shorter-js/src/strings/keyupEvent';
export { default as loadEvent } from 'shorter-js/src/strings/loadEvent';
export { default as loadstartEvent } from 'shorter-js/src/strings/loadstartEvent';
export { default as mouseClickEvents } from 'shorter-js/src/strings/mouseClickEvents';

@@ -47,4 +47,21 @@ export { default as mouseclickEvent } from 'shorter-js/src/strings/mouseclickEvent';

export { default as mouseoutEvent } from 'shorter-js/src/strings/mouseoutEvent';
export { default as mouseoverEvent } from 'shorter-js/src/strings/mouseoverEvent';
export { default as mousemoveEvent } from 'shorter-js/src/strings/mousemoveEvent';
export { default as mousewheelEvent } from 'shorter-js/src/strings/mousewheelEvent';
export { default as mouseSwipeEvents } from 'shorter-js/src/strings/mouseSwipeEvents';
export { default as moveEvent } from 'shorter-js/src/strings/moveEvent';
export { default as orientationchangeEvent } from 'shorter-js/src/strings/orientationchangeEvent';
export { default as pointercancelEvent } from 'shorter-js/src/strings/pointercancelEvent';
export { default as pointerdownEvent } from 'shorter-js/src/strings/pointerdownEvent';
export { default as pointerleaveEvent } from 'shorter-js/src/strings/pointerleaveEvent';
export { default as pointermoveEvent } from 'shorter-js/src/strings/pointermoveEvent';
export { default as pointerupEvent } from 'shorter-js/src/strings/pointerupEvent';
export { default as readystatechangeEvent } from 'shorter-js/src/strings/readystatechangeEvent';
export { default as resetEvent } from 'shorter-js/src/strings/resetEvent';
export { default as resizeEvent } from 'shorter-js/src/strings/resizeEvent';
export { default as selectEvent } from 'shorter-js/src/strings/selectEvent';
export { default as selectendEvent } from 'shorter-js/src/strings/selectendEvent';
export { default as selectstartEvent } from 'shorter-js/src/strings/selectstartEvent';
export { default as scrollEvent } from 'shorter-js/src/strings/scrollEvent';
export { default as submitEvent } from 'shorter-js/src/strings/submitEvent';
export { default as touchEvents } from 'shorter-js/src/strings/touchEvents';

@@ -55,18 +72,5 @@ export { default as touchstartEvent } from 'shorter-js/src/strings/touchstartEvent';

export { default as touchendEvent } from 'shorter-js/src/strings/touchendEvent';
export { default as pointercancelEvent } from 'shorter-js/src/strings/pointercancelEvent';
export { default as pointerdownEvent } from 'shorter-js/src/strings/pointerdownEvent';
export { default as pointerleaveEvent } from 'shorter-js/src/strings/pointerleaveEvent';
export { default as pointermoveEvent } from 'shorter-js/src/strings/pointermoveEvent';
export { default as pointerupEvent } from 'shorter-js/src/strings/pointerupEvent';
export { default as focusEvents } from 'shorter-js/src/strings/focusEvents';
export { default as focusEvent } from 'shorter-js/src/strings/focusEvent';
export { default as focusinEvent } from 'shorter-js/src/strings/focusinEvent';
export { default as focusoutEvent } from 'shorter-js/src/strings/focusoutEvent';
export { default as gesturechangeEvent } from 'shorter-js/src/strings/gesturechangeEvent';
export { default as gestureendEvent } from 'shorter-js/src/strings/gestureendEvent';
export { default as gesturestartEvent } from 'shorter-js/src/strings/gesturestartEvent';
export { default as unloadEvent } from 'shorter-js/src/strings/unloadEvent';
export { default as keyboardEventKeys } from 'shorter-js/src/strings/keyboardEventKeys';
export { default as keydownEvent } from 'shorter-js/src/strings/keydownEvent';
export { default as keyupEvent } from 'shorter-js/src/strings/keyupEvent';
export { default as keypressEvent } from 'shorter-js/src/strings/keypressEvent';
export { default as keyAlt } from 'shorter-js/src/strings/keyAlt';

@@ -124,2 +128,4 @@ export { default as keyArrowDown } from 'shorter-js/src/strings/keyArrowDown';

export { default as supportTransition } from 'shorter-js/src/boolean/supportTransition';
export { default as hasAttribute } from 'shorter-js/src/attr/hasAttribute';
export { default as hasAttributeNS } from 'shorter-js/src/attr/hasAttributeNS';
export { default as getAttribute } from 'shorter-js/src/attr/getAttribute';

@@ -148,2 +154,3 @@ export { default as getAttributeNS } from 'shorter-js/src/attr/getAttributeNS';

export { default as getRectRelativeToOffsetParent } from 'shorter-js/src/get/getRectRelativeToOffsetParent';
export { default as getUID } from 'shorter-js/src/get/getUID';
export { default as getWindow } from 'shorter-js/src/get/getWindow';

@@ -157,3 +164,6 @@ export { default as addClass } from 'shorter-js/src/class/addClass';

export { default as Data } from 'shorter-js/src/misc/data';
export { default as dispatchEvent } from 'shorter-js/src/misc/dispatchEvent';
export { default as distinct } from 'shorter-js/src/misc/distinct';
export { default as createElement } from 'shorter-js/src/misc/createElement';
export { default as createElementNS } from 'shorter-js/src/misc/createElementNS';
export { default as Timer } from 'shorter-js/src/misc/timer';

@@ -171,2 +181,3 @@ export { default as emulateAnimationEnd } from 'shorter-js/src/misc/emulateAnimationEnd';

export { default as focus } from 'shorter-js/src/misc/focus';
export { default as noop } from 'shorter-js/src/misc/noop';
export { default as ArrayFrom } from 'shorter-js/src/misc/ArrayFrom';

@@ -178,2 +189,5 @@ export { default as Float32ArrayFrom } from 'shorter-js/src/misc/Float32ArrayFrom';

export { default as ObjectAssign } from 'shorter-js/src/misc/ObjectAssign';
export { default as OriginalEvent } from 'shorter-js/src/misc/OriginalEvent';
export { default as toUpperCase } from 'shorter-js/src/misc/toUpperCase';
export { default as toLowerCase } from 'shorter-js/src/misc/toLowerCase';
export { default as isArray } from 'shorter-js/src/is/isArray';

@@ -186,2 +200,3 @@ export { default as isDocument } from 'shorter-js/src/is/isDocument';

export { default as isElementsArray } from 'shorter-js/src/is/isElementsArray';
export { default as isFunction } from 'shorter-js/src/is/isFunction';
export { default as isHTMLCollection } from 'shorter-js/src/is/isHTMLCollection';

@@ -203,3 +218,5 @@ export { default as isHTMLElement } from 'shorter-js/src/is/isHTMLElement';

export { default as closest } from 'shorter-js/src/selectors/closest';
export { default as documentAll } from 'shorter-js/src/selectors/documentAll';
export { default as getCustomElements } from 'shorter-js/src/selectors/getCustomElements';
export { default as getElementById } from 'shorter-js/src/selectors/getElementById';
export { default as querySelector } from 'shorter-js/src/selectors/querySelector';

@@ -209,6 +226,8 @@ export { default as querySelectorAll } from 'shorter-js/src/selectors/querySelectorAll';

export { default as getElementsByClassName } from 'shorter-js/src/selectors/getElementsByClassName';
export { default as matches } from 'shorter-js/src/selectors/matches';
export { default as matchesLegacy } from 'shorter-js/src/selectors/matchesLegacy';
export { default as Version } from 'shorter-js/src/misc/version';
export type Component = Record<string, any>;
export type getInstance<T> = (target: ElementNodes | string, component: string) => T | null;
export type getInstance<T> = (target: HTMLElement | Element | string, component: string) => T | null;

@@ -226,2 +245,6 @@ export interface BoundingClientRect {

export interface OriginalEvent extends CustomEvent {
relatedTarget?: HTMLElement | Element | null;
}
export interface OffsetRect {

@@ -235,2 +258,3 @@ width: number,

export type ElementNodes = HTMLElement | Element;
export type ParentNodes = Document | ElementNodes | Node; // ShadowRoot is a Node too
export type ParentNodes = Document | HTMLElement | Element | Node; // ShadowRoot is a Node too

@@ -14,24 +14,21 @@ // strings

export { default as abortEvent } from '../../src/strings/abortEvent';
export { default as beforeunloadEvent } from '../../src/strings/beforeunloadEvent';
export { default as blurEvent } from '../../src/strings/blurEvent';
export { default as moveEvent } from '../../src/strings/moveEvent';
export { default as changeEvent } from '../../src/strings/changeEvent';
export { default as errorEvent } from '../../src/strings/errorEvent';
export { default as resetEvent } from '../../src/strings/resetEvent';
export { default as resizeEvent } from '../../src/strings/resizeEvent';
export { default as scrollEvent } from '../../src/strings/scrollEvent';
export { default as submitEvent } from '../../src/strings/submitEvent';
export { default as loadEvent } from '../../src/strings/loadEvent';
export { default as unloadEvent } from '../../src/strings/unloadEvent';
export { default as readystatechangeEvent } from '../../src/strings/readystatechangeEvent';
export { default as beforeunloadEvent } from '../../src/strings/beforeunloadEvent';
export { default as orientationchangeEvent } from '../../src/strings/orientationchangeEvent';
export { default as contextmenuEvent } from '../../src/strings/contextmenuEvent';
export { default as DOMContentLoadedEvent } from '../../src/strings/DOMContentLoadedEvent';
export { default as DOMMouseScrollEvent } from '../../src/strings/DOMMouseScrollEvent';
export { default as selectEvent } from '../../src/strings/selectEvent';
export { default as selectendEvent } from '../../src/strings/selectendEvent';
export { default as selectstartEvent } from '../../src/strings/selectstartEvent';
export { default as mouseSwipeEvents } from '../../src/strings/mouseSwipeEvents';
export { default as errorEvent } from '../../src/strings/errorEvent';
export { default as focusEvents } from '../../src/strings/focusEvents';
export { default as focusEvent } from '../../src/strings/focusEvent';
export { default as focusinEvent } from '../../src/strings/focusinEvent';
export { default as focusoutEvent } from '../../src/strings/focusoutEvent';
export { default as gesturechangeEvent } from '../../src/strings/gesturechangeEvent';
export { default as gestureendEvent } from '../../src/strings/gestureendEvent';
export { default as gesturestartEvent } from '../../src/strings/gesturestartEvent';
export { default as keydownEvent } from '../../src/strings/keydownEvent';
export { default as keyupEvent } from '../../src/strings/keyupEvent';
export { default as keypressEvent } from '../../src/strings/keypressEvent';
export { default as loadEvent } from '../../src/strings/loadEvent';
export { default as loadstartEvent } from '../../src/strings/loadstartEvent';
export { default as mouseClickEvents } from '../../src/strings/mouseClickEvents';

@@ -48,5 +45,21 @@ export { default as mouseclickEvent } from '../../src/strings/mouseclickEvent';

export { default as mouseoutEvent } from '../../src/strings/mouseoutEvent';
export { default as mouseoverEvent } from '../../src/strings/mouseoverEvent';
export { default as mousemoveEvent } from '../../src/strings/mousemoveEvent';
export { default as mouseSwipeEvents } from '../../src/strings/mouseSwipeEvents';
export { default as mousewheelEvent } from '../../src/strings/mousewheelEvent';
export { default as moveEvent } from '../../src/strings/moveEvent';
export { default as orientationchangeEvent } from '../../src/strings/orientationchangeEvent';
export { default as pointercancelEvent } from '../../src/strings/pointercancelEvent';
export { default as pointerdownEvent } from '../../src/strings/pointerdownEvent';
export { default as pointerleaveEvent } from '../../src/strings/pointerleaveEvent';
export { default as pointermoveEvent } from '../../src/strings/pointermoveEvent';
export { default as pointerupEvent } from '../../src/strings/pointerupEvent';
export { default as readystatechangeEvent } from '../../src/strings/readystatechangeEvent';
export { default as resetEvent } from '../../src/strings/resetEvent';
export { default as resizeEvent } from '../../src/strings/resizeEvent';
export { default as selectEvent } from '../../src/strings/selectEvent';
export { default as selectendEvent } from '../../src/strings/selectendEvent';
export { default as selectstartEvent } from '../../src/strings/selectstartEvent';
export { default as scrollEvent } from '../../src/strings/scrollEvent';
export { default as submitEvent } from '../../src/strings/submitEvent';
export { default as touchEvents } from '../../src/strings/touchEvents';

@@ -57,22 +70,5 @@ export { default as touchstartEvent } from '../../src/strings/touchstartEvent';

export { default as touchendEvent } from '../../src/strings/touchendEvent';
export { default as unloadEvent } from '../../src/strings/unloadEvent';
export { default as pointercancelEvent } from '../../src/strings/pointercancelEvent';
export { default as pointerdownEvent } from '../../src/strings/pointerdownEvent';
export { default as pointerleaveEvent } from '../../src/strings/pointerleaveEvent';
export { default as pointermoveEvent } from '../../src/strings/pointermoveEvent';
export { default as pointerupEvent } from '../../src/strings/pointerupEvent';
export { default as focusEvents } from '../../src/strings/focusEvents';
export { default as focusEvent } from '../../src/strings/focusEvent';
export { default as focusinEvent } from '../../src/strings/focusinEvent';
export { default as focusoutEvent } from '../../src/strings/focusoutEvent';
export { default as gesturechangeEvent } from '../../src/strings/gesturechangeEvent';
export { default as gestureendEvent } from '../../src/strings/gestureendEvent';
export { default as gesturestartEvent } from '../../src/strings/gesturestartEvent';
export { default as keyboardEventKeys } from '../../src/strings/keyboardEventKeys';
export { default as keydownEvent } from '../../src/strings/keydownEvent';
export { default as keyupEvent } from '../../src/strings/keyupEvent';
export { default as keypressEvent } from '../../src/strings/keypressEvent';
export { default as keyAlt } from '../../src/strings/keyAlt';

@@ -139,2 +135,4 @@ export { default as keyArrowDown } from '../../src/strings/keyArrowDown';

// attributes
export { default as hasAttribute } from '../../src/attr/hasAttribute';
export { default as hasAttributeNS } from '../../src/attr/hasAttributeNS';
export { default as getAttribute } from '../../src/attr/getAttribute';

@@ -165,2 +163,3 @@ export { default as getAttributeNS } from '../../src/attr/getAttributeNS';

export { default as getRectRelativeToOffsetParent } from '../../src/get/getRectRelativeToOffsetParent';
export { default as getUID } from '../../src/get/getUID';
export { default as getWindow } from '../../src/get/getWindow';

@@ -181,2 +180,5 @@

export { default as Timer } from '../../src/misc/timer';
export { default as createElement } from '../../src/misc/createElement';
export { default as createElementNS } from '../../src/misc/createElementNS';
export { default as dispatchEvent } from '../../src/misc/dispatchEvent';
export { default as distinct } from '../../src/misc/distinct';

@@ -197,3 +199,7 @@

export { default as focus } from '../../src/misc/focus';
export { default as noop } from '../../src/misc/noop';
export { default as toLowerCase } from '../../src/misc/toLowerCase';
export { default as toUpperCase } from '../../src/misc/toUpperCase';
export { default as ArrayFrom } from '../../src/misc/ArrayFrom';

@@ -205,2 +211,3 @@ export { default as Float32ArrayFrom } from '../../src/misc/Float32ArrayFrom';

export { default as ObjectAssign } from '../../src/misc/ObjectAssign';
export { default as OriginalEvent } from '../../src/misc/OriginalEvent';

@@ -215,2 +222,3 @@ // is

export { default as isElementsArray } from '../../src/is/isElementsArray';
export { default as isFunction } from '../../src/is/isFunction';
export { default as isHTMLCollection } from '../../src/is/isHTMLCollection';

@@ -234,3 +242,5 @@ export { default as isHTMLElement } from '../../src/is/isHTMLElement';

export { default as closest } from '../../src/selectors/closest';
export { default as documentAll } from '../../src/selectors/documentAll';
export { default as getCustomElements } from '../../src/selectors/getCustomElements';
export { default as getElementById } from '../../src/selectors/getElementById';
export { default as querySelector } from '../../src/selectors/querySelector';

@@ -240,3 +250,5 @@ export { default as querySelectorAll } from '../../src/selectors/querySelectorAll';

export { default as getElementsByClassName } from '../../src/selectors/getElementsByClassName';
export { default as matches } from '../../src/selectors/matches';
export { default as matchesLegacy } from '../../src/selectors/matchesLegacy';
export { default as Version } from '../../src/misc/version';
export { default as Version } from '../../src/misc/version';

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc