Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@pluginjs/utils

Package Overview
Dependencies
Maintainers
2
Versions
54
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pluginjs/utils - npm Package Compare versions

Comparing version 0.8.3 to 0.8.4

8

dist/utils.common.js
/*!
* @pluginjs/utils v0.8.3 (https://pluginjs.com)
* @pluginjs/utils v0.8.4 (https://pluginjs.com)
* Copyright 2020 Creation Studio Limited

@@ -477,3 +477,3 @@ * Released under the GPL-3.0 License.

var [k, v] = _ref2;
return _objectSpread2({}, r, {
return _objectSpread2(_objectSpread2({}, r), {}, {
[k]: v

@@ -506,7 +506,7 @@ });

var content = JSON.parse("{\"data\": ".concat(v.replace(/'/g, '"'), "}")).data;
return _objectSpread2({}, result, {
return _objectSpread2(_objectSpread2({}, result), {}, {
[k]: content
});
} catch (err) {
return _objectSpread2({}, result, {
return _objectSpread2(_objectSpread2({}, result), {}, {
[k]: v

@@ -513,0 +513,0 @@ });

/*!
* @pluginjs/utils v0.8.3 (https://pluginjs.com)
* @pluginjs/utils v0.8.4 (https://pluginjs.com)
* Copyright 2020 Creation Studio Limited
* Released under the GPL-3.0 License.
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@pluginjs/is");function e(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function t(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function n(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var o=e=>{if(r.isElement(e))return e;if(r.isArray(e))return e.slice();if(r.isDate(e))return new e.constructor(Number(e));if(r.isMap(e))return new Map(e);if(r.isSet(e))return new Set(e);if(r.isSymbol(e))return Symbol.prototype.valueOf?Object(Symbol.prototype.valueOf.call(e)):{};if(r.isRegexp(e)){var t=new e.constructor(e.source,/\w+$/.exec(e));return t.lastIndex=e.lastIndex,t}return r.isError(e)?Object.create(e):r.isPlainObject(e)?Object.assign({},e):e},a=e=>r.isPlainObject(e)?i(e):r.isArray(e)?c(e):o(e),i=e=>{if(r.isPlainObject(e)){var t=new e.constructor;for(var n in e)t[n]=a(e[n]);return t}return e},c=r=>{for(var e=new r.constructor(r.length),t=0;t<r.length;t++)e[t]=a(r[t]);return e};function s(e,t){var n=r.isArray(t),a=r.isArray(e);return r.isUndefined(t)?e:n!==a?o(t):n?o(t):r.isPlainObject(e)&&r.isPlainObject(t)?(Object.keys(t).forEach(r=>{e[r]=s(e[r],t[r])}),e):o(t)}var u=(r,e)=>{if(r===e)return!0;if(void 0===r||void 0===e)return!1;if(r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0},l=(e,t)=>{var n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertyNames(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++){var i=n[a];if(r.isArray(e[i])&&r.isArray(t[i])){if(!u(e[i],t[i]))return!1}else if(r.isObject(e[i])&&r.isObject(t[i])){if(!l(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1}return!0};exports.SvgElement=(r,e)=>{var t=document.createElementNS("http://www.w3.org/2000/svg",r);if(!e)return t;for(var n in e)Object.hasOwnProperty.call(e,n)&&t.setAttribute(n,e[n]);return t},exports.arrayDiff=(r,e)=>r.filter(r=>e.indexOf(r)<0),exports.arrayEqual=u,exports.arrayIntersect=(r,e)=>{var t;return e.length>r.length&&(t=e,e=r,r=t),r.filter(r=>-1!==e.indexOf(r))},exports.camelize=function(r){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r=r.replace(/[_.\- ]+(\w|$)/g,(r,e)=>e.toUpperCase()),e&&(r=r.substring(0,1).toUpperCase()+r.substring(1)),r},exports.clone=o,exports.compose=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return e.reduceRight((r,t,n)=>Array.isArray(r)&&n===e.length-1?t(...r):t(r),t)};return n.currylen=e[e.curylen||e.length-1].length,n},exports.convertFloatToPercentage=r=>(r<0?r=0:r>1&&(r=1),"".concat(100*parseFloat(r).toFixed(4),"%")),exports.convertMatrixToArray=r=>!(!r||"matrix"!==r.substr(0,6))&&r.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/),exports.convertPercentageToFloat=r=>parseFloat(r.slice(0,-1)/100,10),exports.curry=function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n=e.currylen||e.length,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var c=t.concat(a);return c.length>=n?e(...c):r(e,c)}},exports.curryWith=function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var c=a.findIndex(t);if(c>=0){var s=n.concat(...a.slice(0,c+1));return e(...s)}var u=n.concat(...a);return r(e,t,u)}},exports.dasherize=r=>r.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),exports.debounce=function(r){var e,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var c=t;e&&(clearTimeout(e),e=null),e=setTimeout(()=>{r.apply(c,a)},n)}},exports.deepClone=a,exports.deepCloneArray=c,exports.deepCloneObject=i,exports.deepMerge=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(r.isObject).reduce(s,{})},exports.each=(e,t)=>{if(r.isArray(e))for(var n=0,o=e.length;n<o;n++)t(e[n],n);else Object.entries(e).map(r=>{var[e,n]=r;return t(e,n)});return e},exports.fromPairs=function(r){return r.reduce((r,e)=>{var[t,o]=e;return n({},r,{[t]:o})},{})},exports.getTime=()=>void 0!==window.performance&&window.performance.now?window.performance.now():Date.now(),exports.getUID=r=>{do{r+=~~(1e6*Math.random())}while(document.getElementById(r));return r},exports.getValueByPath=(r,e)=>{if(Object(r)!==r||void 0===e)return r;if(e in r)return r[e];var t=e.split("."),n=t.length;if(n){for(var o=-1;r&&++o<n;){for(var a=t[o];"\\"===a[a.length-1];)a="".concat(a.slice(0,-1),".").concat(t[++o]);r=r[a]}return r}},exports.merge=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.forEach(e=>{for(var t in e)r[t]=e[t]}),r},exports.nub=r=>Array.from(new Set(r)),exports.objectEqual=l,exports.parseDataOptions=function(r){return Object.entries(r).reduce((r,e)=>{var[t,o]=e;try{return n({},r,{[t]:JSON.parse('{"data": '.concat(o.replace(/'/g,'"'),"}")).data})}catch(e){return n({},r,{[t]:o})}},{})},exports.range=r=>Array.from({length:r},(r,e)=>e),exports.reflow=r=>r.offsetHeight,exports.throttle=function(r,e){var t=this,n=!1;function o(){n=!1}return void 0!==e||null!==e?function(){var a=t;if(!n){n=!0;for(var i=arguments.length,c=new Array(i),s=0;s<i;s++)c[s]=arguments[s];r.apply(a,c),window.setTimeout(o,e)}}:function(){for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];var c=t;n||(n=!0,window.requestAnimationFrame(()=>{r.apply(c,a),o()}))}},exports.triggerNative=function(r,e,t){var n=document.createEvent("HTMLEvents");void 0!==t?n.initCustomEvent(e,!0,!0,t):n.initEvent(e,!0,!1),r.dispatchEvent(n)};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("@pluginjs/is");function e(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function t(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function n(r){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{};n%2?t(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):t(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var o=e=>{if(r.isElement(e))return e;if(r.isArray(e))return e.slice();if(r.isDate(e))return new e.constructor(Number(e));if(r.isMap(e))return new Map(e);if(r.isSet(e))return new Set(e);if(r.isSymbol(e))return Symbol.prototype.valueOf?Object(Symbol.prototype.valueOf.call(e)):{};if(r.isRegexp(e)){var t=new e.constructor(e.source,/\w+$/.exec(e));return t.lastIndex=e.lastIndex,t}return r.isError(e)?Object.create(e):r.isPlainObject(e)?Object.assign({},e):e},a=e=>r.isPlainObject(e)?i(e):r.isArray(e)?c(e):o(e),i=e=>{if(r.isPlainObject(e)){var t=new e.constructor;for(var n in e)t[n]=a(e[n]);return t}return e},c=r=>{for(var e=new r.constructor(r.length),t=0;t<r.length;t++)e[t]=a(r[t]);return e};function s(e,t){var n=r.isArray(t),a=r.isArray(e);return r.isUndefined(t)?e:n!==a||n?o(t):r.isPlainObject(e)&&r.isPlainObject(t)?(Object.keys(t).forEach(r=>{e[r]=s(e[r],t[r])}),e):o(t)}var u=(r,e)=>{if(r===e)return!0;if(void 0===r||void 0===e)return!1;if(r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0},l=(e,t)=>{var n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertyNames(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++){var i=n[a];if(r.isArray(e[i])&&r.isArray(t[i])){if(!u(e[i],t[i]))return!1}else if(r.isObject(e[i])&&r.isObject(t[i])){if(!l(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1}return!0};exports.SvgElement=(r,e)=>{var t=document.createElementNS("http://www.w3.org/2000/svg",r);if(!e)return t;for(var n in e)Object.hasOwnProperty.call(e,n)&&t.setAttribute(n,e[n]);return t},exports.arrayDiff=(r,e)=>r.filter(r=>e.indexOf(r)<0),exports.arrayEqual=u,exports.arrayIntersect=(r,e)=>{var t;return e.length>r.length&&(t=e,e=r,r=t),r.filter(r=>-1!==e.indexOf(r))},exports.camelize=function(r){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r=r.replace(/[_.\- ]+(\w|$)/g,(r,e)=>e.toUpperCase()),e&&(r=r.substring(0,1).toUpperCase()+r.substring(1)),r},exports.clone=o,exports.compose=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return e.reduceRight((r,t,n)=>Array.isArray(r)&&n===e.length-1?t(...r):t(r),t)};return n.currylen=e[e.curylen||e.length-1].length,n},exports.convertFloatToPercentage=r=>(r<0?r=0:r>1&&(r=1),"".concat(100*parseFloat(r).toFixed(4),"%")),exports.convertMatrixToArray=r=>!(!r||"matrix"!==r.substr(0,6))&&r.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/),exports.convertPercentageToFloat=r=>parseFloat(r.slice(0,-1)/100,10),exports.curry=function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n=e.currylen||e.length,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var c=t.concat(a);return c.length>=n?e(...c):r(e,c)}},exports.curryWith=function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var c=a.findIndex(t);if(c>=0){var s=n.concat(...a.slice(0,c+1));return e(...s)}var u=n.concat(...a);return r(e,t,u)}},exports.dasherize=r=>r.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),exports.debounce=function(r){var e,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var c=t;e&&(clearTimeout(e),e=null),e=setTimeout(()=>{r.apply(c,a)},n)}},exports.deepClone=a,exports.deepCloneArray=c,exports.deepCloneObject=i,exports.deepMerge=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(r.isObject).reduce(s,{})},exports.each=(e,t)=>{if(r.isArray(e))for(var n=0,o=e.length;n<o;n++)t(e[n],n);else Object.entries(e).map(r=>{var[e,n]=r;return t(e,n)});return e},exports.fromPairs=function(r){return r.reduce((r,e)=>{var[t,o]=e;return n(n({},r),{},{[t]:o})},{})},exports.getTime=()=>void 0!==window.performance&&window.performance.now?window.performance.now():Date.now(),exports.getUID=r=>{do{r+=~~(1e6*Math.random())}while(document.getElementById(r));return r},exports.getValueByPath=(r,e)=>{if(Object(r)!==r||void 0===e)return r;if(e in r)return r[e];var t=e.split("."),n=t.length;if(n){for(var o=-1;r&&++o<n;){for(var a=t[o];"\\"===a[a.length-1];)a="".concat(a.slice(0,-1),".").concat(t[++o]);r=r[a]}return r}},exports.merge=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.forEach(e=>{for(var t in e)r[t]=e[t]}),r},exports.nub=r=>Array.from(new Set(r)),exports.objectEqual=l,exports.parseDataOptions=function(r){return Object.entries(r).reduce((r,e)=>{var[t,o]=e;try{var a=JSON.parse('{"data": '.concat(o.replace(/'/g,'"'),"}")).data;return n(n({},r),{},{[t]:a})}catch(e){return n(n({},r),{},{[t]:o})}},{})},exports.range=r=>Array.from({length:r},(r,e)=>e),exports.reflow=r=>r.offsetHeight,exports.throttle=function(r,e){var t=this,n=!1;function o(){n=!1}return void 0!==e||null!==e?function(){var a=t;if(!n){n=!0;for(var i=arguments.length,c=new Array(i),s=0;s<i;s++)c[s]=arguments[s];r.apply(a,c),window.setTimeout(o,e)}}:function(){for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];var c=t;n||(n=!0,window.requestAnimationFrame(()=>{r.apply(c,a),o()}))}},exports.triggerNative=function(r,e,t){var n=document.createEvent("HTMLEvents");void 0!==t?n.initCustomEvent(e,!0,!0,t):n.initEvent(e,!0,!1),r.dispatchEvent(n)};
/*!
* @pluginjs/utils v0.8.3 (https://pluginjs.com)
* @pluginjs/utils v0.8.4 (https://pluginjs.com)
* Copyright 2020 Creation Studio Limited

@@ -473,3 +473,3 @@ * Released under the GPL-3.0 License.

var [k, v] = _ref2;
return _objectSpread2({}, r, {
return _objectSpread2(_objectSpread2({}, r), {}, {
[k]: v

@@ -502,7 +502,7 @@ });

var content = JSON.parse("{\"data\": ".concat(v.replace(/'/g, '"'), "}")).data;
return _objectSpread2({}, result, {
return _objectSpread2(_objectSpread2({}, result), {}, {
[k]: content
});
} catch (err) {
return _objectSpread2({}, result, {
return _objectSpread2(_objectSpread2({}, result), {}, {
[k]: v

@@ -509,0 +509,0 @@ });

/*!
* @pluginjs/utils v0.8.3 (https://pluginjs.com)
* @pluginjs/utils v0.8.4 (https://pluginjs.com)
* Copyright 2020 Creation Studio Limited
* Released under the GPL-3.0 License.
*/
import{isArray as r,isElement as e,isDate as t,isMap as n,isSet as o,isSymbol as a,isRegexp as i,isError as u,isPlainObject as c,isObject as f,isUndefined as l}from"@pluginjs/is";function v(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function s(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function g(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?s(Object(t),!0).forEach((function(e){v(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}var p=r=>Array.from(new Set(r)),h=(e,t)=>{if(r(e))for(var n=0,o=e.length;n<o;n++)t(e[n],n);else Object.entries(e).map(r=>{var[e,n]=r;return t(e,n)});return e};function w(r,e,t){var n=document.createEvent("HTMLEvents");void 0!==t?n.initCustomEvent(e,!0,!0,t):n.initEvent(e,!0,!1),r.dispatchEvent(n)}var y=f=>{if(e(f))return f;if(r(f))return f.slice();if(t(f))return new f.constructor(Number(f));if(n(f))return new Map(f);if(o(f))return new Set(f);if(a(f))return Symbol.prototype.valueOf?Object(Symbol.prototype.valueOf.call(f)):{};if(i(f)){var l=new f.constructor(f.source,/\w+$/.exec(f));return l.lastIndex=f.lastIndex,l}return u(f)?Object.create(f):c(f)?Object.assign({},f):f},d=e=>c(e)?O(e):r(e)?b(e):y(e),O=r=>{if(c(r)){var e=new r.constructor;for(var t in r)e[t]=d(r[t]);return e}return r},b=r=>{for(var e=new r.constructor(r.length),t=0;t<r.length;t++)e[t]=d(r[t]);return e},m=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.forEach(e=>{for(var t in e)r[t]=e[t]}),r};function j(e,t){var n=r(t),o=r(e);return l(t)?e:n!==o?y(t):n?y(t):c(e)&&c(t)?(Object.keys(t).forEach(r=>{e[r]=j(e[r],t[r])}),e):y(t)}var A=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return e.filter(f).reduce(j,{})},P=function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n=e.currylen||e.length,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var u=t.concat(a);return u.length>=n?e(...u):r(e,u)}},E=function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var u=a.findIndex(t);if(u>=0){var c=n.concat(...a.slice(0,u+1));return e(...c)}var f=n.concat(...a);return r(e,t,f)}},x=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return e.reduceRight((r,t,n)=>Array.isArray(r)&&n===e.length-1?t(...r):t(r),t)};return n.currylen=e[e.curylen||e.length-1].length,n},S=r=>{do{r+=~~(1e6*Math.random())}while(document.getElementById(r));return r},$=r=>Array.from({length:r},(r,e)=>e),D=r=>r.offsetHeight,N=(r,e)=>{if(r===e)return!0;if(void 0===r||void 0===e)return!1;if(r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0},C=(e,t)=>{var n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertyNames(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++){var i=n[a];if(r(e[i])&&r(t[i])){if(!N(e[i],t[i]))return!1}else if(f(e[i])&&f(t[i])){if(!C(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1}return!0},F=(r,e)=>r.filter(r=>e.indexOf(r)<0),I=(r,e)=>{var t;return e.length>r.length&&(t=e,e=r,r=t),r.filter(r=>-1!==e.indexOf(r))},T=r=>parseFloat(r.slice(0,-1)/100,10),M=r=>(r<0?r=0:r>1&&(r=1),"".concat(100*parseFloat(r).toFixed(4),"%")),k=r=>!(!r||"matrix"!==r.substr(0,6))&&r.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/),H=()=>void 0!==window.performance&&window.performance.now?window.performance.now():Date.now(),L=function(r){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r=r.replace(/[_.\- ]+(\w|$)/g,(r,e)=>e.toUpperCase()),e&&(r=r.substring(0,1).toUpperCase()+r.substring(1)),r},U=r=>r.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),q=(r,e)=>{if(Object(r)!==r||void 0===e)return r;if(e in r)return r[e];var t=e.split("."),n=t.length;if(n){for(var o=-1;r&&++o<n;){for(var a=t[o];"\\"===a[a.length-1];)a="".concat(a.slice(0,-1),".").concat(t[++o]);r=r[a]}return r}};function z(r,e){var t=this,n=!1;function o(){n=!1}return void 0!==e||null!==e?function(){var a=t;if(!n){n=!0;for(var i=arguments.length,u=new Array(i),c=0;c<i;c++)u[c]=arguments[c];r.apply(a,u),window.setTimeout(o,e)}}:function(){for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];var u=t;n||(n=!0,window.requestAnimationFrame(()=>{r.apply(u,a),o()}))}}function B(r){var e,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var u=t;e&&(clearTimeout(e),e=null),e=setTimeout(()=>{r.apply(u,a)},n)}}function J(r){return r.reduce((r,e)=>{var[t,n]=e;return g({},r,{[t]:n})},{})}var R=(r,e)=>{var t=document.createElementNS("http://www.w3.org/2000/svg",r);if(!e)return t;for(var n in e)Object.hasOwnProperty.call(e,n)&&t.setAttribute(n,e[n]);return t};function Z(r){return Object.entries(r).reduce((r,e)=>{var[t,n]=e;try{return g({},r,{[t]:JSON.parse('{"data": '.concat(n.replace(/'/g,'"'),"}")).data})}catch(e){return g({},r,{[t]:n})}},{})}export{R as SvgElement,F as arrayDiff,N as arrayEqual,I as arrayIntersect,L as camelize,y as clone,x as compose,M as convertFloatToPercentage,k as convertMatrixToArray,T as convertPercentageToFloat,P as curry,E as curryWith,U as dasherize,B as debounce,d as deepClone,b as deepCloneArray,O as deepCloneObject,A as deepMerge,h as each,J as fromPairs,H as getTime,S as getUID,q as getValueByPath,m as merge,p as nub,C as objectEqual,Z as parseDataOptions,$ as range,D as reflow,z as throttle,w as triggerNative};
import{isArray as r,isElement as e,isDate as t,isMap as n,isSet as o,isSymbol as a,isRegexp as i,isError as u,isPlainObject as c,isObject as f,isUndefined as l}from"@pluginjs/is";function v(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function s(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function g(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?s(Object(t),!0).forEach((function(e){v(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):s(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}var p=r=>Array.from(new Set(r)),h=(e,t)=>{if(r(e))for(var n=0,o=e.length;n<o;n++)t(e[n],n);else Object.entries(e).map(r=>{var[e,n]=r;return t(e,n)});return e};function w(r,e,t){var n=document.createEvent("HTMLEvents");void 0!==t?n.initCustomEvent(e,!0,!0,t):n.initEvent(e,!0,!1),r.dispatchEvent(n)}var y=f=>{if(e(f))return f;if(r(f))return f.slice();if(t(f))return new f.constructor(Number(f));if(n(f))return new Map(f);if(o(f))return new Set(f);if(a(f))return Symbol.prototype.valueOf?Object(Symbol.prototype.valueOf.call(f)):{};if(i(f)){var l=new f.constructor(f.source,/\w+$/.exec(f));return l.lastIndex=f.lastIndex,l}return u(f)?Object.create(f):c(f)?Object.assign({},f):f},d=e=>c(e)?O(e):r(e)?b(e):y(e),O=r=>{if(c(r)){var e=new r.constructor;for(var t in r)e[t]=d(r[t]);return e}return r},b=r=>{for(var e=new r.constructor(r.length),t=0;t<r.length;t++)e[t]=d(r[t]);return e},m=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.forEach(e=>{for(var t in e)r[t]=e[t]}),r};function j(e,t){var n=r(t),o=r(e);return l(t)?e:n!==o||n?y(t):c(e)&&c(t)?(Object.keys(t).forEach(r=>{e[r]=j(e[r],t[r])}),e):y(t)}var A=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return e.filter(f).reduce(j,{})},P=function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n=e.currylen||e.length,o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var u=t.concat(a);return u.length>=n?e(...u):r(e,u)}},E=function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var u=a.findIndex(t);if(u>=0){var c=n.concat(...a.slice(0,u+1));return e(...c)}var f=n.concat(...a);return r(e,t,f)}},x=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return e.reduceRight((r,t,n)=>Array.isArray(r)&&n===e.length-1?t(...r):t(r),t)};return n.currylen=e[e.curylen||e.length-1].length,n},S=r=>{do{r+=~~(1e6*Math.random())}while(document.getElementById(r));return r},$=r=>Array.from({length:r},(r,e)=>e),D=r=>r.offsetHeight,N=(r,e)=>{if(r===e)return!0;if(void 0===r||void 0===e)return!1;if(r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0},C=(e,t)=>{var n=Object.getOwnPropertyNames(e),o=Object.getOwnPropertyNames(t);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++){var i=n[a];if(r(e[i])&&r(t[i])){if(!N(e[i],t[i]))return!1}else if(f(e[i])&&f(t[i])){if(!C(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1}return!0},F=(r,e)=>r.filter(r=>e.indexOf(r)<0),I=(r,e)=>{var t;return e.length>r.length&&(t=e,e=r,r=t),r.filter(r=>-1!==e.indexOf(r))},T=r=>parseFloat(r.slice(0,-1)/100,10),M=r=>(r<0?r=0:r>1&&(r=1),"".concat(100*parseFloat(r).toFixed(4),"%")),k=r=>!(!r||"matrix"!==r.substr(0,6))&&r.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/),H=()=>void 0!==window.performance&&window.performance.now?window.performance.now():Date.now(),L=function(r){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r=r.replace(/[_.\- ]+(\w|$)/g,(r,e)=>e.toUpperCase()),e&&(r=r.substring(0,1).toUpperCase()+r.substring(1)),r},U=r=>r.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase(),q=(r,e)=>{if(Object(r)!==r||void 0===e)return r;if(e in r)return r[e];var t=e.split("."),n=t.length;if(n){for(var o=-1;r&&++o<n;){for(var a=t[o];"\\"===a[a.length-1];)a="".concat(a.slice(0,-1),".").concat(t[++o]);r=r[a]}return r}};function z(r,e){var t=this,n=!1;function o(){n=!1}return void 0!==e||null!==e?function(){var a=t;if(!n){n=!0;for(var i=arguments.length,u=new Array(i),c=0;c<i;c++)u[c]=arguments[c];r.apply(a,u),window.setTimeout(o,e)}}:function(){for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];var u=t;n||(n=!0,window.requestAnimationFrame(()=>{r.apply(u,a),o()}))}}function B(r){var e,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var o=arguments.length,a=new Array(o),i=0;i<o;i++)a[i]=arguments[i];var u=t;e&&(clearTimeout(e),e=null),e=setTimeout(()=>{r.apply(u,a)},n)}}function J(r){return r.reduce((r,e)=>{var[t,n]=e;return g(g({},r),{},{[t]:n})},{})}var R=(r,e)=>{var t=document.createElementNS("http://www.w3.org/2000/svg",r);if(!e)return t;for(var n in e)Object.hasOwnProperty.call(e,n)&&t.setAttribute(n,e[n]);return t};function Z(r){return Object.entries(r).reduce((r,e)=>{var[t,n]=e;try{var o=JSON.parse('{"data": '.concat(n.replace(/'/g,'"'),"}")).data;return g(g({},r),{},{[t]:o})}catch(e){return g(g({},r),{},{[t]:n})}},{})}export{R as SvgElement,F as arrayDiff,N as arrayEqual,I as arrayIntersect,L as camelize,y as clone,x as compose,M as convertFloatToPercentage,k as convertMatrixToArray,T as convertPercentageToFloat,P as curry,E as curryWith,U as dasherize,B as debounce,d as deepClone,b as deepCloneArray,O as deepCloneObject,A as deepMerge,h as each,J as fromPairs,H as getTime,S as getUID,q as getValueByPath,m as merge,p as nub,C as objectEqual,Z as parseDataOptions,$ as range,D as reflow,z as throttle,w as triggerNative};
/*!
* @pluginjs/utils v0.8.3 (https://pluginjs.com)
* @pluginjs/utils v0.8.4 (https://pluginjs.com)
* Copyright 2020 Creation Studio Limited

@@ -62,15 +62,11 @@ * Released under the GPL-3.0 License.

function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
return arr2;
}
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
}

@@ -83,10 +79,7 @@

function _iterableToArray(iter) {
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter);
}
function _iterableToArrayLimit(arr, i) {
if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
return;
}
if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return;
var _arr = [];

@@ -117,8 +110,25 @@ var _n = true;

function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance");
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

@@ -564,3 +574,3 @@

return _objectSpread2({}, r, _defineProperty({}, k, v));
return _objectSpread2(_objectSpread2({}, r), {}, _defineProperty({}, k, v));
}, {});

@@ -593,5 +603,5 @@ }

var content = JSON.parse("{\"data\": ".concat(v.replace(/'/g, '"'), "}")).data;
return _objectSpread2({}, result, _defineProperty({}, k, content));
return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, k, content));
} catch (err) {
return _objectSpread2({}, result, _defineProperty({}, k, v));
return _objectSpread2(_objectSpread2({}, result), {}, _defineProperty({}, k, v));
}

@@ -598,0 +608,0 @@ }, {});

/*!
* @pluginjs/utils v0.8.3 (https://pluginjs.com)
* @pluginjs/utils v0.8.4 (https://pluginjs.com)
* Copyright 2020 Creation Studio Limited
* Released under the GPL-3.0 License.
*/
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@pluginjs/is")):"function"==typeof define&&define.amd?define(["exports","@pluginjs/is"],e):e((r=r||self)["@pluginjs/utils"]={},r["@pluginjs/is"])}(this,(function(r,e){"use strict";function t(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function n(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function i(r){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?n(Object(i),!0).forEach((function(e){t(r,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(i,e))}))}return r}function o(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){if(!(Symbol.iterator in Object(r)||"[object Arguments]"===Object.prototype.toString.call(r)))return;var t=[],n=!0,i=!1,o=void 0;try{for(var u,a=r[Symbol.iterator]();!(n=(u=a.next()).done)&&(t.push(u.value),!e||t.length!==e);n=!0);}catch(r){i=!0,o=r}finally{try{n||null==a.return||a.return()}finally{if(i)throw o}}return t}(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function u(r){return function(r){if(Array.isArray(r)){for(var e=0,t=new Array(r.length);e<r.length;e++)t[e]=r[e];return t}}(r)||function(r){if(Symbol.iterator in Object(r)||"[object Arguments]"===Object.prototype.toString.call(r))return Array.from(r)}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var a=function(r){if(e.isElement(r))return r;if(e.isArray(r))return r.slice();if(e.isDate(r))return new r.constructor(Number(r));if(e.isMap(r))return new Map(r);if(e.isSet(r))return new Set(r);if(e.isSymbol(r))return Symbol.prototype.valueOf?Object(Symbol.prototype.valueOf.call(r)):{};if(e.isRegexp(r)){var t=new r.constructor(r.source,/\w+$/.exec(r));return t.lastIndex=r.lastIndex,t}return e.isError(r)?Object.create(r):e.isPlainObject(r)?Object.assign({},r):r},c=function(r){return e.isPlainObject(r)?f(r):e.isArray(r)?l(r):a(r)},f=function(r){if(e.isPlainObject(r)){var t=new r.constructor;for(var n in r)t[n]=c(r[n]);return t}return r},l=function(r){for(var e=new r.constructor(r.length),t=0;t<r.length;t++)e[t]=c(r[t]);return e};function s(r,t){var n=e.isArray(t),i=e.isArray(r);return e.isUndefined(t)?r:n!==i?a(t):n?a(t):e.isPlainObject(r)&&e.isPlainObject(t)?(Object.keys(t).forEach((function(e){r[e]=s(r[e],t[e])})),r):a(t)}var p=function(r,e){if(r===e)return!0;if(void 0===r||void 0===e)return!1;if(r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0};r.SvgElement=function(r,e){var t=document.createElementNS("http://www.w3.org/2000/svg",r);if(!e)return t;for(var n in e)Object.hasOwnProperty.call(e,n)&&t.setAttribute(n,e[n]);return t},r.arrayDiff=function(r,e){return r.filter((function(r){return e.indexOf(r)<0}))},r.arrayEqual=p,r.arrayIntersect=function(r,e){var t;return e.length>r.length&&(t=e,e=r,r=t),r.filter((function(r){return-1!==e.indexOf(r)}))},r.camelize=function(r){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r=r.replace(/[_.\- ]+(\w|$)/g,(function(r,e){return e.toUpperCase()})),e&&(r=r.substring(0,1).toUpperCase()+r.substring(1)),r},r.clone=a,r.compose=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return e.reduceRight((function(r,t,n){return Array.isArray(r)&&n===e.length-1?t.apply(void 0,u(r)):t(r)}),t)};return n.currylen=e[e.curylen||e.length-1].length,n},r.convertFloatToPercentage=function(r){return r<0?r=0:r>1&&(r=1),"".concat(100*parseFloat(r).toFixed(4),"%")},r.convertMatrixToArray=function(r){return!(!r||"matrix"!==r.substr(0,6))&&r.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/)},r.convertPercentageToFloat=function(r){return parseFloat(r.slice(0,-1)/100,10)},r.curry=function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n=e.currylen||e.length,i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var c=t.concat(o);return c.length>=n?e.apply(void 0,u(c)):r(e,c)}},r.curryWith=function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];var c=o.findIndex(t);if(c>=0){var f=n.concat.apply(n,u(o.slice(0,c+1)));return e.apply(void 0,u(f))}var l=n.concat.apply(n,o);return r(e,t,l)}},r.dasherize=function(r){return r.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase()},r.debounce=function(r){var e,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var i=arguments.length,o=new Array(i),u=0;u<i;u++)o[u]=arguments[u];var a=t;e&&(clearTimeout(e),e=null),e=setTimeout((function(){r.apply(a,o)}),n)}},r.deepClone=c,r.deepCloneArray=l,r.deepCloneObject=f,r.deepMerge=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return t.filter(e.isObject).reduce(s,{})},r.each=function(r,t){if(e.isArray(r))for(var n=0,i=r.length;n<i;n++)t(r[n],n);else Object.entries(r).map((function(r){var e=o(r,2),n=e[0],i=e[1];return t(n,i)}));return r},r.fromPairs=function(r){return r.reduce((function(r,e){var n=o(e,2);return i({},r,t({},n[0],n[1]))}),{})},r.getTime=function(){return void 0!==window.performance&&window.performance.now?window.performance.now():Date.now()},r.getUID=function(r){do{r+=~~(1e6*Math.random())}while(document.getElementById(r));return r},r.getValueByPath=function(r,e){if(Object(r)!==r||void 0===e)return r;if(e in r)return r[e];var t=e.split("."),n=t.length;if(n){for(var i=-1;r&&++i<n;){for(var o=t[i];"\\"===o[o.length-1];)o="".concat(o.slice(0,-1),".").concat(t[++i]);r=r[o]}return r}},r.merge=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.forEach((function(e){for(var t in e)r[t]=e[t]})),r},r.nub=function(r){return Array.from(new Set(r))},r.objectEqual=function r(t,n){var i=Object.getOwnPropertyNames(t),o=Object.getOwnPropertyNames(n);if(i.length!==o.length)return!1;for(var u=0;u<i.length;u++){var a=i[u];if(e.isArray(t[a])&&e.isArray(n[a])){if(!p(t[a],n[a]))return!1}else if(e.isObject(t[a])&&e.isObject(n[a])){if(!r(t[a],n[a]))return!1}else if(t[a]!==n[a])return!1}return!0},r.parseDataOptions=function(r){return Object.entries(r).reduce((function(r,e){var n=o(e,2),u=n[0],a=n[1];try{return i({},r,t({},u,JSON.parse('{"data": '.concat(a.replace(/'/g,'"'),"}")).data))}catch(e){return i({},r,t({},u,a))}}),{})},r.range=function(r){return Array.from({length:r},(function(r,e){return e}))},r.reflow=function(r){return r.offsetHeight},r.throttle=function(r,e){var t=this,n=!1;function i(){n=!1}return void 0!==e||null!==e?function(){var o=t;if(!n){n=!0;for(var u=arguments.length,a=new Array(u),c=0;c<u;c++)a[c]=arguments[c];r.apply(o,a),window.setTimeout(i,e)}}:function(){for(var e=arguments.length,o=new Array(e),u=0;u<e;u++)o[u]=arguments[u];var a=t;n||(n=!0,window.requestAnimationFrame((function(){r.apply(a,o),i()})))}},r.triggerNative=function(r,e,t){var n=document.createEvent("HTMLEvents");void 0!==t?n.initCustomEvent(e,!0,!0,t):n.initEvent(e,!0,!1),r.dispatchEvent(n)},Object.defineProperty(r,"__esModule",{value:!0})}));
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@pluginjs/is")):"function"==typeof define&&define.amd?define(["exports","@pluginjs/is"],e):e((r=r||self)["@pluginjs/utils"]={},r["@pluginjs/is"])}(this,(function(r,e){"use strict";function t(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function n(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),t.push.apply(t,n)}return t}function o(r){for(var e=1;e<arguments.length;e++){var o=null!=arguments[e]?arguments[e]:{};e%2?n(Object(o),!0).forEach((function(e){t(r,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}function i(r,e){return function(r){if(Array.isArray(r))return r}(r)||function(r,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(r)))return;var t=[],n=!0,o=!1,i=void 0;try{for(var a,u=r[Symbol.iterator]();!(n=(a=u.next()).done)&&(t.push(a.value),!e||t.length!==e);n=!0);}catch(r){o=!0,i=r}finally{try{n||null==u.return||u.return()}finally{if(o)throw i}}return t}(r,e)||u(r,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(r){return function(r){if(Array.isArray(r))return c(r)}(r)||function(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}(r)||u(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(r,e){if(r){if("string"==typeof r)return c(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(r):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(r,e):void 0}}function c(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}var f=function(r){if(e.isElement(r))return r;if(e.isArray(r))return r.slice();if(e.isDate(r))return new r.constructor(Number(r));if(e.isMap(r))return new Map(r);if(e.isSet(r))return new Set(r);if(e.isSymbol(r))return Symbol.prototype.valueOf?Object(Symbol.prototype.valueOf.call(r)):{};if(e.isRegexp(r)){var t=new r.constructor(r.source,/\w+$/.exec(r));return t.lastIndex=r.lastIndex,t}return e.isError(r)?Object.create(r):e.isPlainObject(r)?Object.assign({},r):r},l=function(r){return e.isPlainObject(r)?s(r):e.isArray(r)?p(r):f(r)},s=function(r){if(e.isPlainObject(r)){var t=new r.constructor;for(var n in r)t[n]=l(r[n]);return t}return r},p=function(r){for(var e=new r.constructor(r.length),t=0;t<r.length;t++)e[t]=l(r[t]);return e};function y(r,t){var n=e.isArray(t),o=e.isArray(r);return e.isUndefined(t)?r:n!==o||n?f(t):e.isPlainObject(r)&&e.isPlainObject(t)?(Object.keys(t).forEach((function(e){r[e]=y(r[e],t[e])})),r):f(t)}var v=function(r,e){if(r===e)return!0;if(void 0===r||void 0===e)return!1;if(r.length!==e.length)return!1;for(var t=0;t<r.length;++t)if(r[t]!==e[t])return!1;return!0};r.SvgElement=function(r,e){var t=document.createElementNS("http://www.w3.org/2000/svg",r);if(!e)return t;for(var n in e)Object.hasOwnProperty.call(e,n)&&t.setAttribute(n,e[n]);return t},r.arrayDiff=function(r,e){return r.filter((function(r){return e.indexOf(r)<0}))},r.arrayEqual=v,r.arrayIntersect=function(r,e){var t;return e.length>r.length&&(t=e,e=r,r=t),r.filter((function(r){return-1!==e.indexOf(r)}))},r.camelize=function(r){var e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return r=r.replace(/[_.\- ]+(\w|$)/g,(function(r,e){return e.toUpperCase()})),e&&(r=r.substring(0,1).toUpperCase()+r.substring(1)),r},r.clone=f,r.compose=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];var n=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return e.reduceRight((function(r,t,n){return Array.isArray(r)&&n===e.length-1?t.apply(void 0,a(r)):t(r)}),t)};return n.currylen=e[e.curylen||e.length-1].length,n},r.convertFloatToPercentage=function(r){return r<0?r=0:r>1&&(r=1),"".concat(100*parseFloat(r).toFixed(4),"%")},r.convertMatrixToArray=function(r){return!(!r||"matrix"!==r.substr(0,6))&&r.replace(/^.*\((.*)\)$/g,"$1").replace(/px/g,"").split(/, +/)},r.convertPercentageToFloat=function(r){return parseFloat(r.slice(0,-1)/100,10)},r.curry=function r(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return function(){for(var n=e.currylen||e.length,o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];var c=t.concat(i);return c.length>=n?e.apply(void 0,a(c)):r(e,c)}},r.curryWith=function r(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return function(){for(var o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];var c=i.findIndex(t);if(c>=0){var f=n.concat.apply(n,a(i.slice(0,c+1)));return e.apply(void 0,a(f))}var l=n.concat.apply(n,i);return r(e,t,l)}},r.dasherize=function(r){return r.replace(/([a-z\d])([A-Z])/g,"$1-$2").toLowerCase()},r.debounce=function(r){var e,t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100;return function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];var u=t;e&&(clearTimeout(e),e=null),e=setTimeout((function(){r.apply(u,i)}),n)}},r.deepClone=l,r.deepCloneArray=p,r.deepCloneObject=s,r.deepMerge=function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];return t.filter(e.isObject).reduce(y,{})},r.each=function(r,t){if(e.isArray(r))for(var n=0,o=r.length;n<o;n++)t(r[n],n);else Object.entries(r).map((function(r){var e=i(r,2),n=e[0],o=e[1];return t(n,o)}));return r},r.fromPairs=function(r){return r.reduce((function(r,e){var n=i(e,2),a=n[0],u=n[1];return o(o({},r),{},t({},a,u))}),{})},r.getTime=function(){return void 0!==window.performance&&window.performance.now?window.performance.now():Date.now()},r.getUID=function(r){do{r+=~~(1e6*Math.random())}while(document.getElementById(r));return r},r.getValueByPath=function(r,e){if(Object(r)!==r||void 0===e)return r;if(e in r)return r[e];var t=e.split("."),n=t.length;if(n){for(var o=-1;r&&++o<n;){for(var i=t[o];"\\"===i[i.length-1];)i="".concat(i.slice(0,-1),".").concat(t[++o]);r=r[i]}return r}},r.merge=function(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return t.forEach((function(e){for(var t in e)r[t]=e[t]})),r},r.nub=function(r){return Array.from(new Set(r))},r.objectEqual=function r(t,n){var o=Object.getOwnPropertyNames(t),i=Object.getOwnPropertyNames(n);if(o.length!==i.length)return!1;for(var a=0;a<o.length;a++){var u=o[a];if(e.isArray(t[u])&&e.isArray(n[u])){if(!v(t[u],n[u]))return!1}else if(e.isObject(t[u])&&e.isObject(n[u])){if(!r(t[u],n[u]))return!1}else if(t[u]!==n[u])return!1}return!0},r.parseDataOptions=function(r){return Object.entries(r).reduce((function(r,e){var n=i(e,2),a=n[0],u=n[1];try{var c=JSON.parse('{"data": '.concat(u.replace(/'/g,'"'),"}")).data;return o(o({},r),{},t({},a,c))}catch(e){return o(o({},r),{},t({},a,u))}}),{})},r.range=function(r){return Array.from({length:r},(function(r,e){return e}))},r.reflow=function(r){return r.offsetHeight},r.throttle=function(r,e){var t=this,n=!1;function o(){n=!1}return void 0!==e||null!==e?function(){var i=t;if(!n){n=!0;for(var a=arguments.length,u=new Array(a),c=0;c<a;c++)u[c]=arguments[c];r.apply(i,u),window.setTimeout(o,e)}}:function(){for(var e=arguments.length,i=new Array(e),a=0;a<e;a++)i[a]=arguments[a];var u=t;n||(n=!0,window.requestAnimationFrame((function(){r.apply(u,i),o()})))}},r.triggerNative=function(r,e,t){var n=document.createEvent("HTMLEvents");void 0!==t?n.initCustomEvent(e,!0,!0,t):n.initEvent(e,!0,!1),r.dispatchEvent(n)},Object.defineProperty(r,"__esModule",{value:!0})}));

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

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

@@ -37,10 +37,10 @@ "main": "dist/utils.common.js",

"dependencies": {
"@pluginjs/is": "^0.8.3"
"@pluginjs/is": "^0.8.4"
},
"devDependencies": {
"@babel/core": "^7.8.4",
"@pluginjs/browserslist-config": "^1.3.0",
"@pluginjs/cli": "^0.8.0",
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-node-resolve": "^7.1.1",
"@babel/core": "^7.10.2",
"@pluginjs/browserslist-config": "^1.3.1",
"@pluginjs/cli": "^0.8.1",
"@rollup/plugin-commonjs": "^12.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
"babel-jest": "*",

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

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

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

],
"gitHead": "02c3afa7042f2cdee5fd639d3646320bd14e3587"
"gitHead": "c7a30bcc922362e40dbc35af4290a259c9b29566"
}
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