@@ -327,3 +327,3 @@ 'use strict'; | ||
var filter = function (fromArray, filterObject) { | ||
var filter$1 = function (fromArray, filterObject) { | ||
var newArray = Array.from(fromArray); | ||
@@ -586,3 +586,3 @@ var clearObject = removeBy(filterObject, '', 0); | ||
searchBy: searchBy, | ||
filter: filter, | ||
filter: filter$1, | ||
sortBy: sortBy, | ||
@@ -978,2 +978,37 @@ sort: sort, | ||
var filter = function (fromObject, propKey, valArray) { | ||
if (valArray === void 0) { valArray = false; } | ||
var newObject = {}; | ||
var filterObject = Object.entries(fromObject).filter(function (item) { | ||
return item[0].includes(propKey); | ||
}); | ||
newObject = Object.fromEntries(new Map(filterObject)); | ||
if (valArray === true) { | ||
newObject = filterObject.map(function (item) { | ||
return item[1]; | ||
}); | ||
} | ||
return newObject; | ||
}; | ||
var filterBy = function (fromObject, propVal, valArray) { | ||
if (valArray === void 0) { valArray = false; } | ||
var newObject = {}; | ||
var filterObject = Object.entries(fromObject).filter(function (item) { | ||
return item[1].includes(propVal); | ||
}); | ||
newObject = Object.fromEntries(new Map(filterObject)); | ||
if (valArray === true) { | ||
newObject = filterObject.map(function (item) { | ||
return item[1]; | ||
}); | ||
} | ||
return newObject; | ||
}; | ||
var filterByKey = filter; | ||
var filterByVal = filterBy; | ||
var count = function (fromObject) { | ||
return Number(Object.entries(fromObject).length); | ||
}; | ||
var object = /*#__PURE__*/Object.freeze({ | ||
@@ -984,3 +1019,8 @@ __proto__: null, | ||
removeByKey: removeByKey, | ||
removeByVal: removeByVal | ||
removeByVal: removeByVal, | ||
filter: filter, | ||
filterBy: filterBy, | ||
filterByKey: filterByKey, | ||
filterByVal: filterByVal, | ||
count: count | ||
}); | ||
@@ -987,0 +1027,0 @@ |
@@ -323,3 +323,3 @@ var uniq = function (fromArray, byProp) { | ||
var filter = function (fromArray, filterObject) { | ||
var filter$1 = function (fromArray, filterObject) { | ||
var newArray = Array.from(fromArray); | ||
@@ -582,3 +582,3 @@ var clearObject = removeBy(filterObject, '', 0); | ||
searchBy: searchBy, | ||
filter: filter, | ||
filter: filter$1, | ||
sortBy: sortBy, | ||
@@ -974,2 +974,37 @@ sort: sort, | ||
var filter = function (fromObject, propKey, valArray) { | ||
if (valArray === void 0) { valArray = false; } | ||
var newObject = {}; | ||
var filterObject = Object.entries(fromObject).filter(function (item) { | ||
return item[0].includes(propKey); | ||
}); | ||
newObject = Object.fromEntries(new Map(filterObject)); | ||
if (valArray === true) { | ||
newObject = filterObject.map(function (item) { | ||
return item[1]; | ||
}); | ||
} | ||
return newObject; | ||
}; | ||
var filterBy = function (fromObject, propVal, valArray) { | ||
if (valArray === void 0) { valArray = false; } | ||
var newObject = {}; | ||
var filterObject = Object.entries(fromObject).filter(function (item) { | ||
return item[1].includes(propVal); | ||
}); | ||
newObject = Object.fromEntries(new Map(filterObject)); | ||
if (valArray === true) { | ||
newObject = filterObject.map(function (item) { | ||
return item[1]; | ||
}); | ||
} | ||
return newObject; | ||
}; | ||
var filterByKey = filter; | ||
var filterByVal = filterBy; | ||
var count = function (fromObject) { | ||
return Number(Object.entries(fromObject).length); | ||
}; | ||
var object = /*#__PURE__*/Object.freeze({ | ||
@@ -980,3 +1015,8 @@ __proto__: null, | ||
removeByKey: removeByKey, | ||
removeByVal: removeByVal | ||
removeByVal: removeByVal, | ||
filter: filter, | ||
filterBy: filterBy, | ||
filterByKey: filterByKey, | ||
filterByVal: filterByVal, | ||
count: count | ||
}); | ||
@@ -983,0 +1023,0 @@ |
@@ -1,2 +0,2 @@ | ||
var date=function(e){"use strict";var r=function(e,r){void 0===r&&(r="");for(var t=[],n=Number(r),o=new Set,a=0,u=e;a<u.length;a++){var i=u[a];if("object"==typeof i&&null!==i&&"string"==typeof r&&""!==r&&!1===Array.isArray(i))o.has(i[r])||(t.push(i),o.add(i[r]));else if(Array.isArray(i)&&!1===isNaN(n)&&Number(i.length)>Number(r)){var l=Number(r);o.has(i[l])||(t.push(i),o.add(i[l]))}else o.has(JSON.stringify(i))||(t.push(i),o.add(JSON.stringify(i)))}return t}; | ||
var date=function(e){"use strict";var r=function(e,r){void 0===r&&(r="");for(var t=[],n=Number(r),o=new Set,a=0,u=e;a<u.length;a++){var i=u[a];if("object"==typeof i&&null!==i&&"string"==typeof r&&""!==r&&!1===Array.isArray(i))o.has(i[r])||(t.push(i),o.add(i[r]));else if(Array.isArray(i)&&!1===isNaN(n)&&Number(i.length)>Number(r)){var c=Number(r);o.has(i[c])||(t.push(i),o.add(i[c]))}else o.has(JSON.stringify(i))||(t.push(i),o.add(JSON.stringify(i)))}return t}; | ||
/*! ***************************************************************************** | ||
@@ -16,2 +16,2 @@ Copyright (c) Microsoft Corporation. | ||
***************************************************************************** */ | ||
function t(e,r,t,n){return new(t||(t=Promise))((function(o,a){function u(e){try{l(n.next(e))}catch(e){a(e)}}function i(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(u,i)}l((n=n.apply(e,r||[])).next())}))}function n(e,r){var t,n,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;u;)try{if(t=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,n=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=r.call(e,u)}catch(e){a=[6,e],n=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}}function o(e,r,t){if(t||2===arguments.length)for(var n,o=0,a=r.length;o<a;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}var a=function(e,r){void 0===r&&(r={prop:"id",parent:"parent",children:"children"});var t,n=Array.from(e),o=r,a=function(e){var r=e;return void 0!==e[o.children]&&null!==e[o.children]||(r[o.children]=u(e[o.prop]),r[o.children].length<=0&&delete r[o.children]),delete r[o.parent],r},u=function(e){var r=[];return i(e).length>=1&&i(e).forEach((function(e){r.push(a(e))})),r},i=function(e){return n.filter((function(r){return r[o.parent]===e}))};return(t=n).filter((function(e){return"object"==typeof e&&null!==e&&!t.map((function(e){return String(e[o.prop]).trim()})).includes(String(e[o.parent]).trim())})).map((function(e){return a(e)}))},u=function(e,r){void 0===r&&(r={prop:"id",parent:"parent",children:"children"});var t=[],n=r,o=function(e,r){e.length>=1&&Array.from(e).forEach((function(e){if("object"==typeof e&&null!==e){var a=e;a[n.parent]=r[n.prop],"object"==typeof a[n.children]&&Array.isArray(a[n.children])&&(o(a[n.children],e),delete a[n.children]),t.push(a)}}))};return Array.from(e).forEach((function(e){if("object"==typeof e&&null!==e){var r=e;r[n.parent]="0","object"==typeof r[n.children]&&Array.isArray(r[n.children])&&(o(r[n.children],e),delete r[n.children]),t.push(r)}})),t},i=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n=Object.assign({},e),o=0,a=r;o<a.length;o++){var u=a[o];u in n&&delete n[u]}return n},l=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n={},o=new Set(r.map((function(e){return String(e)}))),a=0,u=Object.keys(e);a<u.length;a++){var i=u[a];o.has(String(e[i]))||(n[i]=e[i])}return n},c=i,f=l,m=function(e,r,t){void 0===t&&(t="asc");var n=Array.from(e);return"asc"===t?n.sort((function(e,t){if(r in e&&r in t){if(!1===isNaN(e[r])&&!1===isNaN(t[r]))return Number(e[r])-Number(t[r]);if("string"==typeof e[r]&&"string"==typeof t[r]){var n=e[r].toLowerCase(),o=t[r].toLowerCase(),a=0;return n<o?a=-1:n>o&&(a=1),a}}})):"desc"===t&&n.sort((function(e,t){if(r in e&&r in t){if(!1===isNaN(e[r])&&!1===isNaN(t[r]))return Number(t[r])-Number(e[r]);if("string"==typeof e[r]&&"string"==typeof t[r]){var n=e[r].toLowerCase(),o=t[r].toLowerCase(),a=0;return o<n?a=-1:o>n&&(a=1),a}}})),n},s=m,v=Object.freeze({__proto__:null,uniq:r,take:function(e,r,t){void 0===t&&(t="");var n=[],o=Number(r);return Array.isArray(e)&&e.length>=1&&("object"==typeof e[0]&&null!==e[0]&&"string"==typeof r&&Object.keys(e[0]).includes(r)?(n=e.map((function(e){return e[r]})),"uniq"===t&&(n=Array.from(new Set(n)))):Array.isArray(e[0])&&!1===isNaN(o)?(n=e.map((function(e){return e[o]})),"uniq"===t&&(n=Array.from(new Set(n)))):"function"==typeof r&&(n=e.filter((function(e){return r(e)})),""!==t&&(n=n.map((function(e){return e[t]}))))),n},nested:a,nestedAsync:function(e,r){return void 0===r&&(r={}),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(a(t,r))]}}))}))},flatten:u,flattenAsync:function(e,r){return void 0===r&&(r={}),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(u(t,r))]}}))}))},search:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var a=[],u=function(t){var n=Array.from(e).filter((function(e){if(!1===isNaN(e)&&Number(e)===Number(t))return!0;if("string"==typeof e&&String(e).toLowerCase().includes(String(t).toLowerCase()))return!0;if("object"==typeof e&&null!==e)for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];if(!1===isNaN(e[o])&&Number(e[o])===Number(t))return!0;if("string"==typeof e[o]&&String(e[o]).toLowerCase().includes(String(t).toLowerCase()))return!0}return!1}));a=r(o(o([],a,!0),n,!0))},i=0,l=t.flat();i<l.length;i++){var c=l[i];u(c)}return a},searchBy:function(e,t,n){for(var a=[],u=function(t){var u=Array.from(e).filter((function(e){for(var r=0,o=Array.from(n);r<o.length;r++){var a=o[r];if(a in e){if(!1===isNaN(e[a])&&Number(e[a])===Number(t))return!0;if("string"==typeof e[a]&&-1!==String(e[a]).toLowerCase().indexOf(String(t).toLowerCase()))return!0}}return!1}));a=r(o(o([],a,!0),u,!0))},i=0,l=t;i<l.length;i++){u(l[i])}return a},filter:function(e,r){for(var t=Array.from(e),n=l(r,"",0),o=function(e){var r=t.filter((function(r){if(e in r){if(!1===isNaN(r[e])&&Number(r[e])===Number(n[e]))return!0;if("string"==typeof r[e]&&String(r[e]).toLowerCase().includes(String(n[e]).toLowerCase()))return!0}return!1}));t=r},a=0,u=Object.keys(n);a<u.length;a++){o(u[a])}return t},sortBy:m,sort:s,order:function(e,r){return void 0===r&&(r="order"),Array.from(e).map((function(e,t){return"object"==typeof e&&null!==e&&(e[r]=Number(t)+1),e}))},paginate:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=10);var n=Array.from(e),o=Number(t)*Number(r)-(Number(t)-1),a=Number(t)*Number(r);return n.slice(o-1,a<=n.length?a:n.length)},pages:function(e,r){void 0===r&&(r=10);var t=Array.isArray(e)?e.length:e,n=Number(t)/Number(r);return Math.ceil(n)},pageStart:function(e,r){return void 0===e&&(e=1),void 0===r&&(r=10),(Number(e)-1)*Number(r)},pageInfo:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=10);var n=Array.from(e),o=Number(t)*Number(r)-(Number(t)-1),a=Number(t)*Number(r);return{from:n.length>=1?o:0,start:n.length>=1?o:0,to:a<=n.length?a:n.length,end:a<=n.length?a:n.length,of:n.length,length:n.length}},pagination:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=0);var n=[],o=Number(e)<Number(r)?Number(e):Number(r),a=Number(r)<1?1:Number(r),u=o+Number(t),i=a-Number(t);if(0===Number(t))for(var l=1;l<=Number(e);l++)n.push(String(l));else{if(a>1)for(l=i;l<a;l++)n.push(String(l));for(l=o;l<=u;l++)n.push(String(l))}var c=n.filter((function(e){return Number(e)>0})).filter((function(r){return Number(r)<=Number(e)}));return u<Number(e)&&0!==Number(t)&&c.push("..."),i>1&&0!==Number(t)&&c.unshift("..."),c},duplication:function(e,r){void 0===r&&(r="");var t=[],n=Array.from(new Set(e));""!==r&&(n=Array.from(new Set(e.map((function(e){return e[r]})))));for(var o=function(n){var o=Array.from(e).filter((function(e){return""!==r?e[r]===n:e===n}));Number(o.length)>=2&&o.forEach((function(e){t.push(e)}))},a=0,u=n;a<u.length;a++){o(u[a])}return t},duplicationGroup:function(e,r){void 0===r&&(r="");var t={},n=new Set,o=Array.from(new Set(e));""!==r&&(o=Array.from(new Set(e.map((function(e){return e[r]})))));for(var a=function(o){var a=Array.from(e).filter((function(e){return""!==r?e[r]===o:e===o}));n.has(a.length)||(n.add(a.length),t[a.length]=[]),a.forEach((function(e){t[a.length].push(e)}))},u=0,i=o;u<i.length;u++){a(i[u])}return t},shuffle:function(e){for(var r,t=e,n=e.length,o=0;n>=1;)o=Math.floor(Math.random()*n),n--,r=[t[o],t[n]],t[n]=r[0],t[o]=r[1];return t},column:function(e,r){void 0===r&&(r=2);for(var t=[],n=Math.ceil(Number(Array.from(e).length)/Number(r)),o=0;o<Number(r);o++){var a=Number(o)*Number(n),u=(Number(o)+1)*Number(n),i=Array.from(e).slice(a,u);t.push(i)}return t}}),d=function(e){var r=String(e);return 1===r.length&&(r="0"+r),r},b=function(e,r,t,n){void 0===r&&(r=""),void 0===t&&(t=""),void 0===n&&(n={});var o=new Date(e||null),a="".concat(o.getFullYear(),"-").concat(d(Number(o.getMonth())+1),"-").concat(d(o.getDate())," ").concat(d(o.getHours()),":").concat(d(o.getMinutes()),":").concat(d(o.getSeconds()));return""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(a="".concat(o.getUTCFullYear(),"-").concat(d(Number(o.getUTCMonth())+1),"-").concat(d(o.getUTCDate())," ").concat(d(o.getUTCHours()),":").concat(d(o.getUTCMinutes()),":").concat(d(o.getUTCSeconds()))),"date"===r?(a="".concat(o.getFullYear(),"-").concat(d(Number(o.getMonth())+1),"-").concat(d(o.getDate())),""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(a="".concat(o.getUTCFullYear(),"-").concat(d(Number(o.getUTCMonth())+1),"-").concat(d(o.getUTCDate()))),""!==t&&(a=o.toLocaleDateString(t,n))):"time"===r?(a="".concat(d(o.getHours()),":").concat(d(o.getMinutes()),":").concat(d(o.getSeconds())),""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(a="".concat(d(o.getUTCHours()),":").concat(d(o.getUTCMinutes()),":").concat(d(o.getUTCSeconds()))),""!==t&&(a=o.toLocaleTimeString(t,n))):""!==t&&(a=new Intl.DateTimeFormat(t,n).format(o)),a},h=function(e,r){var t=new Date(e).toJSON().split(/T|\./);return"date"===r?Number(t[0].replaceAll("-","")):"time"===r?Number(t[1].replaceAll(":","")):new Date(e).valueOf()},p=function(){return Number((new Date).getFullYear())},N=function(){return Number((new Date).getMonth())},g=function(e,r){void 0===e&&(e=p()),void 0===r&&(r=N());var t=Number(new Date(e,r,0).getDate());return[28,29,30,31].includes(t)?t:31},y=function(e,r){void 0===e&&(e=p()),void 0===r&&(r=N());for(var t=[],n=Number(new Date(e,Number(r)-1,1).getDay()),o=Number(n)-1;o>=0;o--)t.push(Number(new Date(e,Number(r)-1,Number("-"+o)).getDate()));return t},w=function(e,r){var t=Number(new Date(r).getMonth())-Number(new Date(e).getMonth()),n=12*(Number(new Date(r).getFullYear())-Number(new Date(e).getFullYear()));return Math.floor(t+n)},A=Object.freeze({__proto__:null,now:function(e,r,t){void 0===e&&(e=""),void 0===r&&(r=""),void 0===t&&(t={});var n=new Date;return b(n,e,r,t)},format:b,isBefore:function(e,r,t){void 0===t&&(t="dateTime");var n=!1;return h(e,t)<h(r,t)&&(n=!0),n},isAfter:function(e,r,t){void 0===t&&(t="dateTime");var n=!1;return h(e,t)>h(r,t)&&(n=!0),n},isBetween:function(e,r,t,n){void 0===n&&(n="dateTime");var o=h(e,n),a=h(r,n),u=h(t,n),i=!1;return o>=a&&o<=u&&(i=!0),i},daysInMonth:g,daysOfPrevMonth:y,daysOfNextMonth:function(e,r){void 0===e&&(e=p()),void 0===r&&(r=N());var t=Number(new Date(e,Number(r)-1,g(e,r)).getDay()),n=6-Number(t),o=Number(g(e,r))+Number(y(e,r).length)+Number(n);return Number(n)+(42-Number(o))},daysInYear:function(e){return void 0===e&&(e=p()),Number(e)%400==0||Number(e)%100!=0&&Number(e)%4==0?366:365},daysInBetween:function(e,r,t){void 0===t&&(t="dateTime");var n=h(e,t),o=h(r,t),a=Number(o)-Number(n);return Math.floor(a/864e5)},monthsInBetween:w,yearsInBetween:function(e,r){return Math.floor(w(e,r)/12)},doubleFormat:d,month:function(e,r,t,n){void 0===e&&(e=p()),void 0===r&&(r=N()),void 0===t&&(t="en-US"),void 0===n&&(n="long");var o=new Date(e,Number(r)-1);return new Intl.DateTimeFormat(t,{month:n}).format(o)},months:function(e,r){void 0===e&&(e="en-US"),void 0===r&&(r="long");for(var t=[],n=Number((new Date).getFullYear()),o=0;o<=11;o++){var a={},u=new Date(n,o);a.value=d(Number(o)+1),a.text=new Intl.DateTimeFormat(e,{month:r}).format(u),t.push(a)}return t},years:function(e,r,t){void 0===e&&(e=(new Date).getFullYear()),void 0===r&&(r=5),void 0===t&&(t=!1);for(var n=[],o=Number(e)-(Number(r)+1),a=Number(e)+Number(r),u=o;u<=a;u++)if(t){var i={value:u,text:u};u===o?i.text="Prev":u===a&&(i.text="Next"),n.push(i)}else n.push(u);return n},add:function(e,r,t,n,o){void 0===t&&(t=""),void 0===n&&(n=""),void 0===o&&(o={});var a=new Date(e||null);return a.setDate(a.getDate()+(r||1)),b(a,t,n,o)},sub:function(e,r,t,n,o){void 0===t&&(t=""),void 0===n&&(n=""),void 0===o&&(o={});var a=new Date(e||null);return a.setDate(a.getDate()-(r||1)),b(a,t,n,o)}}),M=Object.freeze({__proto__:null,separator:function(e,r,t,n){void 0===r&&(r=","),void 0===t&&(t=!1),void 0===n&&(n=2);var o="."===r?"de-DE":"en-US",a=String(new Intl.NumberFormat(o).format(Number(e)));if(!0===t){var u=String(Number(e));u=u.includes(".")?(u=Number(u).toFixed(n)).split(".")[1]:new Array(n).fill(0).join("");var i="."===r?",":".";a=(a=a.split(i)[0].trim())+i+u}return a},percentage:function(e,r,t){void 0===t&&(t=!1);var n=String(Math.round(100*(Number(e)/Number(r)-1)));return!0===t&&(n+="%"),n},unit:function(e,r,t){void 0===r&&(r=2),void 0===t&&(t="normal");var n=[{id:1,value:1,symbol:""},{id:2,value:1e3,symbol:"K"},{id:3,value:1e6,symbol:"M"},{id:4,value:1e9,symbol:"G"},{id:5,value:1e12,symbol:"T"},{id:6,value:1e15,symbol:"P"},{id:7,value:1e18,symbol:"E"},{id:8,value:1e21,symbol:"Z"},{id:9,value:1e24,symbol:"Y"}];"normal"!==t&&(n=n.map((function(e){return"decimal"===t?2===e.id&&(e.symbol="k"):"money"===t?4===e.id&&(e.symbol="B"):"binary"===t?1!==e.id&&(e.value=e.value+24*(e.id-1),e.symbol=e.symbol+"i"):"byte"===t&&1!==e.id&&(e.value=e.value+24*(e.id-1),e.symbol=e.symbol+"B"),e})));var o=n.slice().reverse().find((function(r){return Number(e)>=r.value}));return o?(Number(e)/o.value).toFixed(r).replace(/\.0+$|(\.[0-9]*[1-9])0+$/,"$1")+""+o.symbol:"0"},spaceBetween:function(e){return String(e).replace(/\d{4}(?=.)/g,"$& ")},roundOf:function(e){var r=[1,1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24].slice().reverse().find((function(r){return Number(e)>=r}));return Math.round(Number(e)/r)*r},between:function(e,r,t){void 0===t&&(t=!0);var n=t?Number(e)+1:Number(e),o=t?Number(r)-1:Number(r),a=Math.floor(Math.random()*Number(o));return a<=n&&(a=Number(n)+Number(a)),a},isBetween:function(e,r,t){var n=Number(e),o=Number(r),a=Number(t),u=!1;return n>=o&&n<=a&&(u=!0),u}}),S=Object.freeze({__proto__:null,remove:i,removeBy:l,removeByKey:c,removeByVal:f}),D=function(e,r){void 0===r&&(r="raw");var t=encodeURI(e);return"param"===r&&(t=encodeURIComponent(e)),t},C=function(e,r){void 0===r&&(r="raw");var t=decodeURI(e);return"param"===r&&(t=decodeURIComponent(e)),t},T=function(e,r){void 0===r&&(r="");var t=e;return t="multiple"===r?t.toLowerCase().replace(/\w\S*/g,(function(e){return e.replace(/^\w/,(function(e){return e.toUpperCase()}))})):"single"===r?t.toLowerCase().trimStart().replace(/^\w/,(function(e){return e.toUpperCase()})):t.trimStart().replace(/^\w/,(function(e){return e.toUpperCase()}))},_=Object.freeze({__proto__:null,urlEncode:D,urlDecode:C,urlEncodeAsync:function(e,r){return void 0===r&&(r="raw"),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(D(t,r))]}}))}))},urlDecodeAsync:function(e,r){return void 0===r&&(r="raw"),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(C(t,r))]}}))}))},uniqid:function(e){void 0===e&&(e=0);var r="",t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=String(JSON.parse((new Date).toJSON().replace(/-|T|Z|:|\./g,"")));Number(e)>=1&&(r+=String(Number(e)+1));for(var o=0;o<n.length;o++)r+=t.charAt(Math.floor(Math.random()*t.length)),r+=n.charAt(o);return r},random:function(e,r){void 0===e&&(e=11),void 0===r&&(r="");var t="",n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_~!@#$%^&*()+={}[]|:;<>,./?";"alphadash"===r?n=n.slice(0,64):"alphanumeric"===r?n=n.slice(0,62):"alpha"===r?n=n.slice(10,62):"hex"===r?n=n.slice(0,16):"numeric"===r&&(n=n.slice(0,10));for(var o=0;o<e;o++)t+=n.charAt(Math.floor(Math.random()*n.length));return t},capitalize:T,camelCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=T(r,"multiple")).trimStart().replace(/^\w/,(function(e){return e.toLowerCase()})).replaceAll(" ","")},pascalCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=T(r,"multiple")).replaceAll(" ","")},snakeCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=T(r,"multiple")).replaceAll(" ","").replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,r){return(r>0?"_":"")+e.toLowerCase()}))},kebabCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=T(r,"multiple")).replaceAll(" ","").replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,r){return(r>0?"-":"")+e.toLowerCase()}))},slug:function(e,r,t){void 0===r&&(r=0),void 0===t&&(t=0);var n=e.trim();return n=(n=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")).replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-"),Number(r)>0&&(n=n.slice(0,Number(r))),Number(t)>0&&(n=n+"-"+t),n}}),U=Object.freeze({__proto__:null,relative:function(e,r,t,n,o){void 0===r&&(r="utc"),void 0===t&&(t="en-US"),void 0===n&&(n={}),void 0===o&&(o="long");var a=new Date,u=new Date(e);"utc"!==r&&(u=new Date(new Date(e).toJSON()));var i=Math.round((u.valueOf()-a.valueOf())/1e3),l=new Intl.RelativeTimeFormat(t,n).format(i,"second");"short"===o&&(l="".concat(Math.abs(Math.round(i)),"s"));var c=i/31536e3;if(Math.abs(c)>1){var f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"year"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"y"))}else if(c=i/2592e3,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"month"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"mo"))}else if(c=i/86400,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"day"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"d"))}else if(c=i/3600,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"hour"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"h"))}else if(c=i/60,Math.abs(c)>1){f=Math.round(c);l=new Intl.RelativeTimeFormat(t,n).format(f,"minute"),"short"===o&&(l="".concat(Math.abs(Math.round(f)),"m"))}return l},hoursInBetween:function(e,r){var t=new Date(e),n=new Date(r),o=Math.abs(Number(t.getTime())-Number(n.getTime()));return Number((o/36e5).toFixed(0))},reading:function(e,r,t){void 0===e&&(e=""),void 0===r&&(r=250),void 0===t&&(t="minute");var n=e.split(" ").length,o=Number(n)/Number(r);return"second"===t?o=60*Number(o):"millisecond"===t&&(o=6e4*Number(o)),Math.ceil(o)}});return e.array=v,e.date=A,e.number=M,e.object=S,e.string=_,e.time=U,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
function t(e,r,t,n){return new(t||(t=Promise))((function(o,a){function u(e){try{c(n.next(e))}catch(e){a(e)}}function i(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var r;e.done?o(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(u,i)}c((n=n.apply(e,r||[])).next())}))}function n(e,r){var t,n,o,a,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function i(a){return function(i){return function(a){if(t)throw new TypeError("Generator is already executing.");for(;u;)try{if(t=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return u.label++,{value:a[1],done:!1};case 5:u.label++,n=a[1],a=[0];continue;case 7:a=u.ops.pop(),u.trys.pop();continue;default:if(!(o=u.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){u=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){u.label=a[1];break}if(6===a[0]&&u.label<o[1]){u.label=o[1],o=a;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(a);break}o[2]&&u.ops.pop(),u.trys.pop();continue}a=r.call(e,u)}catch(e){a=[6,e],n=0}finally{t=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,i])}}}function o(e,r,t){if(t||2===arguments.length)for(var n,o=0,a=r.length;o<a;o++)!n&&o in r||(n||(n=Array.prototype.slice.call(r,0,o)),n[o]=r[o]);return e.concat(n||Array.prototype.slice.call(r))}var a=function(e,r){void 0===r&&(r={prop:"id",parent:"parent",children:"children"});var t,n=Array.from(e),o=r,a=function(e){var r=e;return void 0!==e[o.children]&&null!==e[o.children]||(r[o.children]=u(e[o.prop]),r[o.children].length<=0&&delete r[o.children]),delete r[o.parent],r},u=function(e){var r=[];return i(e).length>=1&&i(e).forEach((function(e){r.push(a(e))})),r},i=function(e){return n.filter((function(r){return r[o.parent]===e}))};return(t=n).filter((function(e){return"object"==typeof e&&null!==e&&!t.map((function(e){return String(e[o.prop]).trim()})).includes(String(e[o.parent]).trim())})).map((function(e){return a(e)}))},u=function(e,r){void 0===r&&(r={prop:"id",parent:"parent",children:"children"});var t=[],n=r,o=function(e,r){e.length>=1&&Array.from(e).forEach((function(e){if("object"==typeof e&&null!==e){var a=e;a[n.parent]=r[n.prop],"object"==typeof a[n.children]&&Array.isArray(a[n.children])&&(o(a[n.children],e),delete a[n.children]),t.push(a)}}))};return Array.from(e).forEach((function(e){if("object"==typeof e&&null!==e){var r=e;r[n.parent]="0","object"==typeof r[n.children]&&Array.isArray(r[n.children])&&(o(r[n.children],e),delete r[n.children]),t.push(r)}})),t},i=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n=Object.assign({},e),o=0,a=r;o<a.length;o++){var u=a[o];u in n&&delete n[u]}return n},c=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n={},o=new Set(r.map((function(e){return String(e)}))),a=0,u=Object.keys(e);a<u.length;a++){var i=u[a];o.has(String(e[i]))||(n[i]=e[i])}return n},l=i,f=c,m=function(e,r,t){void 0===t&&(t="asc");var n=Array.from(e);return"asc"===t?n.sort((function(e,t){if(r in e&&r in t){if(!1===isNaN(e[r])&&!1===isNaN(t[r]))return Number(e[r])-Number(t[r]);if("string"==typeof e[r]&&"string"==typeof t[r]){var n=e[r].toLowerCase(),o=t[r].toLowerCase(),a=0;return n<o?a=-1:n>o&&(a=1),a}}})):"desc"===t&&n.sort((function(e,t){if(r in e&&r in t){if(!1===isNaN(e[r])&&!1===isNaN(t[r]))return Number(t[r])-Number(e[r]);if("string"==typeof e[r]&&"string"==typeof t[r]){var n=e[r].toLowerCase(),o=t[r].toLowerCase(),a=0;return o<n?a=-1:o>n&&(a=1),a}}})),n},s=m,v=Object.freeze({__proto__:null,uniq:r,take:function(e,r,t){void 0===t&&(t="");var n=[],o=Number(r);return Array.isArray(e)&&e.length>=1&&("object"==typeof e[0]&&null!==e[0]&&"string"==typeof r&&Object.keys(e[0]).includes(r)?(n=e.map((function(e){return e[r]})),"uniq"===t&&(n=Array.from(new Set(n)))):Array.isArray(e[0])&&!1===isNaN(o)?(n=e.map((function(e){return e[o]})),"uniq"===t&&(n=Array.from(new Set(n)))):"function"==typeof r&&(n=e.filter((function(e){return r(e)})),""!==t&&(n=n.map((function(e){return e[t]}))))),n},nested:a,nestedAsync:function(e,r){return void 0===r&&(r={}),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(a(t,r))]}}))}))},flatten:u,flattenAsync:function(e,r){return void 0===r&&(r={}),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(u(t,r))]}}))}))},search:function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var a=[],u=function(t){var n=Array.from(e).filter((function(e){if(!1===isNaN(e)&&Number(e)===Number(t))return!0;if("string"==typeof e&&String(e).toLowerCase().includes(String(t).toLowerCase()))return!0;if("object"==typeof e&&null!==e)for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];if(!1===isNaN(e[o])&&Number(e[o])===Number(t))return!0;if("string"==typeof e[o]&&String(e[o]).toLowerCase().includes(String(t).toLowerCase()))return!0}return!1}));a=r(o(o([],a,!0),n,!0))},i=0,c=t.flat();i<c.length;i++){var l=c[i];u(l)}return a},searchBy:function(e,t,n){for(var a=[],u=function(t){var u=Array.from(e).filter((function(e){for(var r=0,o=Array.from(n);r<o.length;r++){var a=o[r];if(a in e){if(!1===isNaN(e[a])&&Number(e[a])===Number(t))return!0;if("string"==typeof e[a]&&-1!==String(e[a]).toLowerCase().indexOf(String(t).toLowerCase()))return!0}}return!1}));a=r(o(o([],a,!0),u,!0))},i=0,c=t;i<c.length;i++){u(c[i])}return a},filter:function(e,r){for(var t=Array.from(e),n=c(r,"",0),o=function(e){var r=t.filter((function(r){if(e in r){if(!1===isNaN(r[e])&&Number(r[e])===Number(n[e]))return!0;if("string"==typeof r[e]&&String(r[e]).toLowerCase().includes(String(n[e]).toLowerCase()))return!0}return!1}));t=r},a=0,u=Object.keys(n);a<u.length;a++){o(u[a])}return t},sortBy:m,sort:s,order:function(e,r){return void 0===r&&(r="order"),Array.from(e).map((function(e,t){return"object"==typeof e&&null!==e&&(e[r]=Number(t)+1),e}))},paginate:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=10);var n=Array.from(e),o=Number(t)*Number(r)-(Number(t)-1),a=Number(t)*Number(r);return n.slice(o-1,a<=n.length?a:n.length)},pages:function(e,r){void 0===r&&(r=10);var t=Array.isArray(e)?e.length:e,n=Number(t)/Number(r);return Math.ceil(n)},pageStart:function(e,r){return void 0===e&&(e=1),void 0===r&&(r=10),(Number(e)-1)*Number(r)},pageInfo:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=10);var n=Array.from(e),o=Number(t)*Number(r)-(Number(t)-1),a=Number(t)*Number(r);return{from:n.length>=1?o:0,start:n.length>=1?o:0,to:a<=n.length?a:n.length,end:a<=n.length?a:n.length,of:n.length,length:n.length}},pagination:function(e,r,t){void 0===r&&(r=1),void 0===t&&(t=0);var n=[],o=Number(e)<Number(r)?Number(e):Number(r),a=Number(r)<1?1:Number(r),u=o+Number(t),i=a-Number(t);if(0===Number(t))for(var c=1;c<=Number(e);c++)n.push(String(c));else{if(a>1)for(c=i;c<a;c++)n.push(String(c));for(c=o;c<=u;c++)n.push(String(c))}var l=n.filter((function(e){return Number(e)>0})).filter((function(r){return Number(r)<=Number(e)}));return u<Number(e)&&0!==Number(t)&&l.push("..."),i>1&&0!==Number(t)&&l.unshift("..."),l},duplication:function(e,r){void 0===r&&(r="");var t=[],n=Array.from(new Set(e));""!==r&&(n=Array.from(new Set(e.map((function(e){return e[r]})))));for(var o=function(n){var o=Array.from(e).filter((function(e){return""!==r?e[r]===n:e===n}));Number(o.length)>=2&&o.forEach((function(e){t.push(e)}))},a=0,u=n;a<u.length;a++){o(u[a])}return t},duplicationGroup:function(e,r){void 0===r&&(r="");var t={},n=new Set,o=Array.from(new Set(e));""!==r&&(o=Array.from(new Set(e.map((function(e){return e[r]})))));for(var a=function(o){var a=Array.from(e).filter((function(e){return""!==r?e[r]===o:e===o}));n.has(a.length)||(n.add(a.length),t[a.length]=[]),a.forEach((function(e){t[a.length].push(e)}))},u=0,i=o;u<i.length;u++){a(i[u])}return t},shuffle:function(e){for(var r,t=e,n=e.length,o=0;n>=1;)o=Math.floor(Math.random()*n),n--,r=[t[o],t[n]],t[n]=r[0],t[o]=r[1];return t},column:function(e,r){void 0===r&&(r=2);for(var t=[],n=Math.ceil(Number(Array.from(e).length)/Number(r)),o=0;o<Number(r);o++){var a=Number(o)*Number(n),u=(Number(o)+1)*Number(n),i=Array.from(e).slice(a,u);t.push(i)}return t}}),d=function(e){var r=String(e);return 1===r.length&&(r="0"+r),r},b=function(e,r,t,n){void 0===r&&(r=""),void 0===t&&(t=""),void 0===n&&(n={});var o=new Date(e||null),a="".concat(o.getFullYear(),"-").concat(d(Number(o.getMonth())+1),"-").concat(d(o.getDate())," ").concat(d(o.getHours()),":").concat(d(o.getMinutes()),":").concat(d(o.getSeconds()));return""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(a="".concat(o.getUTCFullYear(),"-").concat(d(Number(o.getUTCMonth())+1),"-").concat(d(o.getUTCDate())," ").concat(d(o.getUTCHours()),":").concat(d(o.getUTCMinutes()),":").concat(d(o.getUTCSeconds()))),"date"===r?(a="".concat(o.getFullYear(),"-").concat(d(Number(o.getMonth())+1),"-").concat(d(o.getDate())),""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(a="".concat(o.getUTCFullYear(),"-").concat(d(Number(o.getUTCMonth())+1),"-").concat(d(o.getUTCDate()))),""!==t&&(a=o.toLocaleDateString(t,n))):"time"===r?(a="".concat(d(o.getHours()),":").concat(d(o.getMinutes()),":").concat(d(o.getSeconds())),""===t&&"UTC"===(null==n?void 0:n.timeZone)&&(a="".concat(d(o.getUTCHours()),":").concat(d(o.getUTCMinutes()),":").concat(d(o.getUTCSeconds()))),""!==t&&(a=o.toLocaleTimeString(t,n))):""!==t&&(a=new Intl.DateTimeFormat(t,n).format(o)),a},h=function(e,r){var t=new Date(e).toJSON().split(/T|\./);return"date"===r?Number(t[0].replaceAll("-","")):"time"===r?Number(t[1].replaceAll(":","")):new Date(e).valueOf()},p=function(){return Number((new Date).getFullYear())},N=function(){return Number((new Date).getMonth())},g=function(e,r){void 0===e&&(e=p()),void 0===r&&(r=N());var t=Number(new Date(e,r,0).getDate());return[28,29,30,31].includes(t)?t:31},y=function(e,r){void 0===e&&(e=p()),void 0===r&&(r=N());for(var t=[],n=Number(new Date(e,Number(r)-1,1).getDay()),o=Number(n)-1;o>=0;o--)t.push(Number(new Date(e,Number(r)-1,Number("-"+o)).getDate()));return t},w=function(e,r){var t=Number(new Date(r).getMonth())-Number(new Date(e).getMonth()),n=12*(Number(new Date(r).getFullYear())-Number(new Date(e).getFullYear()));return Math.floor(t+n)},A=Object.freeze({__proto__:null,now:function(e,r,t){void 0===e&&(e=""),void 0===r&&(r=""),void 0===t&&(t={});var n=new Date;return b(n,e,r,t)},format:b,isBefore:function(e,r,t){void 0===t&&(t="dateTime");var n=!1;return h(e,t)<h(r,t)&&(n=!0),n},isAfter:function(e,r,t){void 0===t&&(t="dateTime");var n=!1;return h(e,t)>h(r,t)&&(n=!0),n},isBetween:function(e,r,t,n){void 0===n&&(n="dateTime");var o=h(e,n),a=h(r,n),u=h(t,n),i=!1;return o>=a&&o<=u&&(i=!0),i},daysInMonth:g,daysOfPrevMonth:y,daysOfNextMonth:function(e,r){void 0===e&&(e=p()),void 0===r&&(r=N());var t=Number(new Date(e,Number(r)-1,g(e,r)).getDay()),n=6-Number(t),o=Number(g(e,r))+Number(y(e,r).length)+Number(n);return Number(n)+(42-Number(o))},daysInYear:function(e){return void 0===e&&(e=p()),Number(e)%400==0||Number(e)%100!=0&&Number(e)%4==0?366:365},daysInBetween:function(e,r,t){void 0===t&&(t="dateTime");var n=h(e,t),o=h(r,t),a=Number(o)-Number(n);return Math.floor(a/864e5)},monthsInBetween:w,yearsInBetween:function(e,r){return Math.floor(w(e,r)/12)},doubleFormat:d,month:function(e,r,t,n){void 0===e&&(e=p()),void 0===r&&(r=N()),void 0===t&&(t="en-US"),void 0===n&&(n="long");var o=new Date(e,Number(r)-1);return new Intl.DateTimeFormat(t,{month:n}).format(o)},months:function(e,r){void 0===e&&(e="en-US"),void 0===r&&(r="long");for(var t=[],n=Number((new Date).getFullYear()),o=0;o<=11;o++){var a={},u=new Date(n,o);a.value=d(Number(o)+1),a.text=new Intl.DateTimeFormat(e,{month:r}).format(u),t.push(a)}return t},years:function(e,r,t){void 0===e&&(e=(new Date).getFullYear()),void 0===r&&(r=5),void 0===t&&(t=!1);for(var n=[],o=Number(e)-(Number(r)+1),a=Number(e)+Number(r),u=o;u<=a;u++)if(t){var i={value:u,text:u};u===o?i.text="Prev":u===a&&(i.text="Next"),n.push(i)}else n.push(u);return n},add:function(e,r,t,n,o){void 0===t&&(t=""),void 0===n&&(n=""),void 0===o&&(o={});var a=new Date(e||null);return a.setDate(a.getDate()+(r||1)),b(a,t,n,o)},sub:function(e,r,t,n,o){void 0===t&&(t=""),void 0===n&&(n=""),void 0===o&&(o={});var a=new Date(e||null);return a.setDate(a.getDate()-(r||1)),b(a,t,n,o)}}),M=Object.freeze({__proto__:null,separator:function(e,r,t,n){void 0===r&&(r=","),void 0===t&&(t=!1),void 0===n&&(n=2);var o="."===r?"de-DE":"en-US",a=String(new Intl.NumberFormat(o).format(Number(e)));if(!0===t){var u=String(Number(e));u=u.includes(".")?(u=Number(u).toFixed(n)).split(".")[1]:new Array(n).fill(0).join("");var i="."===r?",":".";a=(a=a.split(i)[0].trim())+i+u}return a},percentage:function(e,r,t){void 0===t&&(t=!1);var n=String(Math.round(100*(Number(e)/Number(r)-1)));return!0===t&&(n+="%"),n},unit:function(e,r,t){void 0===r&&(r=2),void 0===t&&(t="normal");var n=[{id:1,value:1,symbol:""},{id:2,value:1e3,symbol:"K"},{id:3,value:1e6,symbol:"M"},{id:4,value:1e9,symbol:"G"},{id:5,value:1e12,symbol:"T"},{id:6,value:1e15,symbol:"P"},{id:7,value:1e18,symbol:"E"},{id:8,value:1e21,symbol:"Z"},{id:9,value:1e24,symbol:"Y"}];"normal"!==t&&(n=n.map((function(e){return"decimal"===t?2===e.id&&(e.symbol="k"):"money"===t?4===e.id&&(e.symbol="B"):"binary"===t?1!==e.id&&(e.value=e.value+24*(e.id-1),e.symbol=e.symbol+"i"):"byte"===t&&1!==e.id&&(e.value=e.value+24*(e.id-1),e.symbol=e.symbol+"B"),e})));var o=n.slice().reverse().find((function(r){return Number(e)>=r.value}));return o?(Number(e)/o.value).toFixed(r).replace(/\.0+$|(\.[0-9]*[1-9])0+$/,"$1")+""+o.symbol:"0"},spaceBetween:function(e){return String(e).replace(/\d{4}(?=.)/g,"$& ")},roundOf:function(e){var r=[1,1e3,1e6,1e9,1e12,1e15,1e18,1e21,1e24].slice().reverse().find((function(r){return Number(e)>=r}));return Math.round(Number(e)/r)*r},between:function(e,r,t){void 0===t&&(t=!0);var n=t?Number(e)+1:Number(e),o=t?Number(r)-1:Number(r),a=Math.floor(Math.random()*Number(o));return a<=n&&(a=Number(n)+Number(a)),a},isBetween:function(e,r,t){var n=Number(e),o=Number(r),a=Number(t),u=!1;return n>=o&&n<=a&&(u=!0),u}}),S=function(e,r,t){void 0===t&&(t=!1);var n={},o=Object.entries(e).filter((function(e){return e[0].includes(r)}));return n=Object.fromEntries(new Map(o)),!0===t&&(n=o.map((function(e){return e[1]}))),n},D=function(e,r,t){void 0===t&&(t=!1);var n={},o=Object.entries(e).filter((function(e){return e[1].includes(r)}));return n=Object.fromEntries(new Map(o)),!0===t&&(n=o.map((function(e){return e[1]}))),n},C=S,T=D,O=Object.freeze({__proto__:null,remove:i,removeBy:c,removeByKey:l,removeByVal:f,filter:S,filterBy:D,filterByKey:C,filterByVal:T,count:function(e){return Number(Object.entries(e).length)}}),_=function(e,r){void 0===r&&(r="raw");var t=encodeURI(e);return"param"===r&&(t=encodeURIComponent(e)),t},j=function(e,r){void 0===r&&(r="raw");var t=decodeURI(e);return"param"===r&&(t=decodeURIComponent(e)),t},U=function(e,r){void 0===r&&(r="");var t=e;return t="multiple"===r?t.toLowerCase().replace(/\w\S*/g,(function(e){return e.replace(/^\w/,(function(e){return e.toUpperCase()}))})):"single"===r?t.toLowerCase().trimStart().replace(/^\w/,(function(e){return e.toUpperCase()})):t.trimStart().replace(/^\w/,(function(e){return e.toUpperCase()}))},F=Object.freeze({__proto__:null,urlEncode:_,urlDecode:j,urlEncodeAsync:function(e,r){return void 0===r&&(r="raw"),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(_(t,r))]}}))}))},urlDecodeAsync:function(e,r){return void 0===r&&(r="raw"),t(void 0,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return[4,Promise.resolve(e)];case 1:return t=n.sent(),[2,Promise.resolve(j(t,r))]}}))}))},uniqid:function(e){void 0===e&&(e=0);var r="",t="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",n=String(JSON.parse((new Date).toJSON().replace(/-|T|Z|:|\./g,"")));Number(e)>=1&&(r+=String(Number(e)+1));for(var o=0;o<n.length;o++)r+=t.charAt(Math.floor(Math.random()*t.length)),r+=n.charAt(o);return r},random:function(e,r){void 0===e&&(e=11),void 0===r&&(r="");var t="",n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_~!@#$%^&*()+={}[]|:;<>,./?";"alphadash"===r?n=n.slice(0,64):"alphanumeric"===r?n=n.slice(0,62):"alpha"===r?n=n.slice(10,62):"hex"===r?n=n.slice(0,16):"numeric"===r&&(n=n.slice(0,10));for(var o=0;o<e;o++)t+=n.charAt(Math.floor(Math.random()*n.length));return t},capitalize:U,camelCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=U(r,"multiple")).trimStart().replace(/^\w/,(function(e){return e.toLowerCase()})).replaceAll(" ","")},pascalCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=U(r,"multiple")).replaceAll(" ","")},snakeCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=U(r,"multiple")).replaceAll(" ","").replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,r){return(r>0?"_":"")+e.toLowerCase()}))},kebabCase:function(e){var r=e.replace(/-|_/g," ").replace(/[A-Z]/g," $&");return(r=U(r,"multiple")).replaceAll(" ","").replace(/[A-Z]+(?![a-z])|[A-Z]/g,(function(e,r){return(r>0?"-":"")+e.toLowerCase()}))},slug:function(e,r,t){void 0===r&&(r=0),void 0===t&&(t=0);var n=e.trim();return n=(n=n.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"")).replace(/[^a-z0-9 -]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-"),Number(r)>0&&(n=n.slice(0,Number(r))),Number(t)>0&&(n=n+"-"+t),n}}),I=Object.freeze({__proto__:null,relative:function(e,r,t,n,o){void 0===r&&(r="utc"),void 0===t&&(t="en-US"),void 0===n&&(n={}),void 0===o&&(o="long");var a=new Date,u=new Date(e);"utc"!==r&&(u=new Date(new Date(e).toJSON()));var i=Math.round((u.valueOf()-a.valueOf())/1e3),c=new Intl.RelativeTimeFormat(t,n).format(i,"second");"short"===o&&(c="".concat(Math.abs(Math.round(i)),"s"));var l=i/31536e3;if(Math.abs(l)>1){var f=Math.round(l);c=new Intl.RelativeTimeFormat(t,n).format(f,"year"),"short"===o&&(c="".concat(Math.abs(Math.round(f)),"y"))}else if(l=i/2592e3,Math.abs(l)>1){f=Math.round(l);c=new Intl.RelativeTimeFormat(t,n).format(f,"month"),"short"===o&&(c="".concat(Math.abs(Math.round(f)),"mo"))}else if(l=i/86400,Math.abs(l)>1){f=Math.round(l);c=new Intl.RelativeTimeFormat(t,n).format(f,"day"),"short"===o&&(c="".concat(Math.abs(Math.round(f)),"d"))}else if(l=i/3600,Math.abs(l)>1){f=Math.round(l);c=new Intl.RelativeTimeFormat(t,n).format(f,"hour"),"short"===o&&(c="".concat(Math.abs(Math.round(f)),"h"))}else if(l=i/60,Math.abs(l)>1){f=Math.round(l);c=new Intl.RelativeTimeFormat(t,n).format(f,"minute"),"short"===o&&(c="".concat(Math.abs(Math.round(f)),"m"))}return c},hoursInBetween:function(e,r){var t=new Date(e),n=new Date(r),o=Math.abs(Number(t.getTime())-Number(n.getTime()));return Number((o/36e5).toFixed(0))},reading:function(e,r,t){void 0===e&&(e=""),void 0===r&&(r=250),void 0===t&&(t="minute");var n=e.split(" ").length,o=Number(n)/Number(r);return"second"===t?o=60*Number(o):"millisecond"===t&&(o=6e4*Number(o)),Math.ceil(o)}});return e.array=v,e.date=A,e.number=M,e.object=O,e.string=F,e.time=I,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); |
@@ -37,2 +37,42 @@ 'use strict'; | ||
var filter = function (fromObject, propKey, valArray) { | ||
if (valArray === void 0) { valArray = false; } | ||
var newObject = {}; | ||
var filterObject = Object.entries(fromObject).filter(function (item) { | ||
return item[0].includes(propKey); | ||
}); | ||
newObject = Object.fromEntries(new Map(filterObject)); | ||
if (valArray === true) { | ||
newObject = filterObject.map(function (item) { | ||
return item[1]; | ||
}); | ||
} | ||
return newObject; | ||
}; | ||
var filterBy = function (fromObject, propVal, valArray) { | ||
if (valArray === void 0) { valArray = false; } | ||
var newObject = {}; | ||
var filterObject = Object.entries(fromObject).filter(function (item) { | ||
return item[1].includes(propVal); | ||
}); | ||
newObject = Object.fromEntries(new Map(filterObject)); | ||
if (valArray === true) { | ||
newObject = filterObject.map(function (item) { | ||
return item[1]; | ||
}); | ||
} | ||
return newObject; | ||
}; | ||
var filterByKey = filter; | ||
var filterByVal = filterBy; | ||
var count = function (fromObject) { | ||
return Number(Object.entries(fromObject).length); | ||
}; | ||
exports.count = count; | ||
exports.filter = filter; | ||
exports.filterBy = filterBy; | ||
exports.filterByKey = filterByKey; | ||
exports.filterByVal = filterByVal; | ||
exports.remove = remove; | ||
@@ -39,0 +79,0 @@ exports.removeBy = removeBy; |
@@ -33,2 +33,37 @@ var remove = function (fromObject) { | ||
export { remove, removeBy, removeByKey, removeByVal }; | ||
var filter = function (fromObject, propKey, valArray) { | ||
if (valArray === void 0) { valArray = false; } | ||
var newObject = {}; | ||
var filterObject = Object.entries(fromObject).filter(function (item) { | ||
return item[0].includes(propKey); | ||
}); | ||
newObject = Object.fromEntries(new Map(filterObject)); | ||
if (valArray === true) { | ||
newObject = filterObject.map(function (item) { | ||
return item[1]; | ||
}); | ||
} | ||
return newObject; | ||
}; | ||
var filterBy = function (fromObject, propVal, valArray) { | ||
if (valArray === void 0) { valArray = false; } | ||
var newObject = {}; | ||
var filterObject = Object.entries(fromObject).filter(function (item) { | ||
return item[1].includes(propVal); | ||
}); | ||
newObject = Object.fromEntries(new Map(filterObject)); | ||
if (valArray === true) { | ||
newObject = filterObject.map(function (item) { | ||
return item[1]; | ||
}); | ||
} | ||
return newObject; | ||
}; | ||
var filterByKey = filter; | ||
var filterByVal = filterBy; | ||
var count = function (fromObject) { | ||
return Number(Object.entries(fromObject).length); | ||
}; | ||
export { count, filter, filterBy, filterByKey, filterByVal, remove, removeBy, removeByKey, removeByVal }; |
@@ -1,1 +0,1 @@ | ||
var object=function(e){"use strict";var r=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n=Object.assign({},e),o=0,a=r;o<a.length;o++){var v=a[o];v in n&&delete n[v]}return n},t=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n={},o=new Set(r.map((function(e){return String(e)}))),a=0,v=Object.keys(e);a<v.length;a++){var u=v[a];o.has(String(e[u]))||(n[u]=e[u])}return n},n=r,o=t;return e.remove=r,e.removeBy=t,e.removeByKey=n,e.removeByVal=o,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); | ||
var object=function(e){"use strict";var r=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n=Object.assign({},e),i=0,u=r;i<u.length;i++){var o=u[i];o in n&&delete n[o]}return n},t=function(e){for(var r=[],t=1;t<arguments.length;t++)r[t-1]=arguments[t];for(var n={},i=new Set(r.map((function(e){return String(e)}))),u=0,o=Object.keys(e);u<o.length;u++){var c=o[u];i.has(String(e[c]))||(n[c]=e[c])}return n},n=r,i=t,u=function(e,r,t){void 0===t&&(t=!1);var n={},i=Object.entries(e).filter((function(e){return e[0].includes(r)}));return n=Object.fromEntries(new Map(i)),!0===t&&(n=i.map((function(e){return e[1]}))),n},o=function(e,r,t){void 0===t&&(t=!1);var n={},i=Object.entries(e).filter((function(e){return e[1].includes(r)}));return n=Object.fromEntries(new Map(i)),!0===t&&(n=i.map((function(e){return e[1]}))),n},c=u,f=o;return e.count=function(e){return Number(Object.entries(e).length)},e.filter=u,e.filterBy=o,e.filterByKey=c,e.filterByVal=f,e.remove=r,e.removeBy=t,e.removeByKey=n,e.removeByVal=i,Object.defineProperty(e,"__esModule",{value:!0}),e}({}); |
{ | ||
"name": "alga-js", | ||
"version": "0.1.0-beta-6", | ||
"version": "0.1.0-beta-7", | ||
"description": "Alga.js is a JavaScript helper to help build UI components by using any of modern web frameworks or libraries", | ||
@@ -5,0 +5,0 @@ "module": "./lib/alga.es.js", |
export * from './removeObject.js' | ||
export * from './filterObject.js' | ||
export * from './countObject.js' |
export * from './removeObject.js'; | ||
export * from './filterObject.js'; | ||
export * from './countObject.js'; |
304519
2.54%118
3.51%6246
3.15%