Comparing version 0.0.8 to 0.0.9
@@ -1,1 +0,1 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).$={})}(this,(function(e){"use strict";var r=Object.freeze({__proto__:null,random:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:255,r=Number(e)+1;return Math.floor(Math.random()*r)}}),t=function(e){return!isNaN(e)&&"number"==typeof Number(e)},n=function(e){if("number"!=typeof e&&"string"!=typeof e)throw new Error("You must input only number format here");return 1===Math.sign(e)},o=function(e){if("number"!=typeof e&&"string"!=typeof e)throw new Error("You must input only number format here");return-1===Math.sign(e)},a=function(e){return"string"==typeof e};function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function f(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?l(Object(t),!0).forEach((function(r){u(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function h(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return t}(e,r)||s(e,r)||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 c(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,r){if(e){if("string"==typeof e)return m(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?m(e,r):void 0}}function m(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function g(e,r){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=s(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(u)throw a}}}}var w=function(e){return"object"===i(e)&&null!==e&&"[object Object]"===Object.prototype.toString.call(e)},d=Object.freeze({__proto__:null,random:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if("number"!=typeof e&&e<=0)throw new Error("You have to add a number at least 1");for(var r="",t="0123456789",n=0;n<e;n++)r+=t.charAt(Math.floor(Math.random()*t.length));return r},loop:function(e,r){if("number"!=typeof e&e<=-1)throw new Error("Only accept number here, start from 0");if("number"!=typeof r&r<=0)throw new Error("Only accept number here, start from 1");for(var t=[];e<=r;)t.push(e++);return t},isNumber:t,isPositive:n,isNegative:o,calc:function(e,r,n){if(!t(e))throw new Error("This is left operand and must be in number type");if(!t(r))throw new Error("This is left operand and must be in number type");if(!a(n))throw new Error("Operator must be one of these: add, subtract, multiply, divide, reminder or exponent");var o=0;return"add"===n||"addition"===n||"plus"===n||"+"===n?o=Number(e)+Number(r):"subtract"===n||"subtraction"===n||"minus"===n||"-"===n?o=Number(e)-Number(r):"multiply"===n||"multiplication"===n||"×"===n||"*"===n?o=Number(e)*Number(r):"divide"===n||"division"===n||"÷"===n||"/"===n?o=Number(e)/Number(r):"remainder"===n||"modulo"===n||"%"===n?o=Number(e)%Number(r):"exponent"!==n&&"exponentiation"!==n&&"**"!==n||(o=Math.pow(Number(e),Number(r))),o},currency:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!t(e))throw new Error("Amount must be in a number type");if(!a(r)&&3===r.length)throw new Error("Currency code must have at least 3 uppercase character");if(!a(n))throw new Error("Locale code must contain 2 languages and 2 country code and separated by dash (-)");if(!w(o))throw new Error("Currency options must be in object type");return new Intl.NumberFormat(n,f({style:"currency",currency:r.toUpperCase()},o)).format(e)}}),v=Object.freeze({__proto__:null,random:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:11,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long",t="",n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_~!@#$%^&*()+={}[]|:;<>,./?";"short"===r||"alphadash"===r?n=n.slice(0,64):"narrow"===r||"alphanumeric"===r?n=n.slice(0,62):"alpha"===r?n=n.slice(10,62):"hex"===r?n=n.slice(0,16):"number"!==r&&"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}}),y=Object.freeze({__proto__:null,split:function(e){return function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=[];return"string"==typeof e&&(r>=1&&n.push(e.slice(0,r)),null!==t?(n.push(e.slice(r,t)),n.push(e.slice(t))):n.push(e.slice(r))),n}},capitalize:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"single";if("string"==typeof e){var t=e;return t="multiple"===r?t.toLowerCase().replace(/\w\S*/g,(function(e){return e.replace(/^\w/,(function(e){return e.toUpperCase()}))})):t.trimStart().replace(/^\w/,(function(e){return e.toUpperCase()}))}},includes:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return-1!==e.indexOf(r,t)},isString:a}),p=function(e){return!("object"!==i(e)||null===e||!Array.isArray(e))},b=function(e){if(!p(e))throw new Error("On the first argument must be in array type");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("On the next arguments, you have to provide at least one argument");var o=Array.from(e);return o.unshift.apply(o,t),o},N=function(e){if(!p(e))throw new Error("On the first argument must be in array type");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("On the next arguments, you have to provide at least one argument");var o=Array.from(e);return o.push.apply(o,t),o},E=function(e,r){if(!p(e))throw new Error("On the first argument, here only accept array type");if(!t(r))throw new Error("On the second argument, accept only numeric or number type");for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];if(o.length<1)throw new Error("On the next arguments, you have to enter at least one value");var i=Array.from(e),u=isNaN(r)?1:r;return i.splice.apply(i,[Number(u)-1,0].concat(o)),i},D=function(e,r){if(!p(e))throw new Error("On the first argument, here only accept array type");if(!t(r))throw new Error("On the second argument, accept only numeric or number type");for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];if(o.length<1)throw new Error("On the next arguments, you have to enter at least one value");var i=Array.from(e),u=isNaN(r)?0:r;return i.splice.apply(i,[Number(u)+1,0].concat(o)),i},A=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{key:"id",value:0};if(!p(e))throw new Error("You must enter the first argument in array only");var t=Array.from(e),n=-1;return"key"in r&&"value"in r?n=t.length>=1?t.findIndex((function(e){return e[r.key]===r.value})):-1:t.length>=1&&(n=t.findIndex((function(e){for(var t=0,n=Object.entries(r);t<n.length;t++){var o=h(n[t],2),a=o[0],i=o[1];if(a in e&&e[a]===i)return!0}}))),n},Y=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dense";if(!p(e))throw new Error("You must enter the first argument in array only");return"sparse"===r?Object.keys(e).map((function(e){return Number(e)})):c(e.keys())},O=function(e){if(!p(e))throw new Error("You must enter the argument in array only");var r=Y(e);return Number(r[Math.floor(Math.random()*r.length)])},S=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r){for(var n={},o=0,a=r;o<a.length;o++)for(var i=a[o],u=0,l=Object.entries(i);u<l.length;u++){var f=h(l[u],2),c=f[0],s=f[1];n[c]=s}return n}},j=function(e){if(!p(e))throw new Error("Please provide array that you want to remove its element");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("On the last of argument, you have to enter at least one argument");for(var o=Array.from(e),a=[],u=function(){var e=f[l];if("string"==typeof e&&"first"===e)o=o.map((function(e,r){return 0===r?null:e})),a=o;else if("string"==typeof e&&"last"===e)o=o.map((function(e,r){return r===o.length-1?null:e})),a=o;else if("number"==typeof e)o=o.map((function(r,t){return t===e?null:r})),a=o;else if("object"===i(e)&&null!==e){var r=A(o,e);o=o.map((function(e,t){return t===r?null:e})),a=o}},l=0,f=t;l<f.length;l++)u();return a.filter((function(e){return null!==e}))},M=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!p(e))throw new Error("");var t=Array.from(e),n=[];if("string"==typeof r){var o,a=new Set,i=g(t);try{for(i.s();!(o=i.n()).done;){var u=o.value;a.has(u[r])||a.add(u[r])}}catch(e){i.e(e)}finally{i.f()}n=c(a)}else n=Array.from(new Set(t));return n},T=function(e){if(!w(e))throw new Error("This is object helper, you must provide the first argument in an object");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("The next arguments must be in a string or in a number and at least one argument");for(var o={},a=new Set(t),i=0,u=Object.entries(e);i<u.length;i++){var l=h(u[i],1),f=l[0];a.has(e[f])||(o[f]=e[f])}return o},x=function(e,r){if(!p(e))throw new Error("The first argument must be in array of objects");if(!w(r))throw new Error("The second argument must be in object type and must have at least one property");for(var n=Array.from(e),o=function(){var e=h(u[i],2),r=e[0],o=e[1],l=n.filter((function(e){if(r in e){if(t(e[r])&&Number(e[r])===Number(o))return!0;if(a(e[r])&&e[r].toLowerCase().includes(o.toLowerCase()))return!0}return!1}));n=l},i=0,u=Object.entries(T(r,"",0));i<u.length;i++)o();return n},C=function(e){return"function"==typeof e},k=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";if(!p(e))throw new Error("Only array of objects accepted");if(!a(r))throw new Error("The second argument must be in a string and a value must be object property key or name");if(!a(n))throw new Error('The third argument must be in a string and a value either "", "asc" or "desc"');var o=Array.from(e);return"asc"===n?o.sort((function(e,n){if(r in e&&r in n){if(t(e[r])&&t(n[r]))return Number(e[r])-Number(n[r]);if(a(e[r])&&a(n[r])){var o=e[r].toLowerCase(),i=n[r].toLowerCase(),u=0;return o<i?u=-1:o>i&&(u=1),u}}})):"desc"===n&&o.sort((function(e,n){if(r in e&&r in n){if(t(e[r])&&t(n[r]))return Number(n[r])-Number(e[r]);if(a(e[r])&&a(n[r])){var o=e[r].toLowerCase(),i=n[r].toLowerCase(),u=0;return i<o?u=-1:i>o&&(u=1),u}}})),o},_=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!p(e))throw new Error("On the first argument, here only accept array");if(!t(r))throw new Error("This is the page active number, please enter number only");if(!t(n))throw new Error("This is the limit of entries in one page in a number, please enter number only");var o=Array.from(e),a=Number(n)*Number(r)-(Number(n)-1),i=Number(n)*Number(r);return{from:a,to:i<=o.length?i:o.length,of:o.length}},B=function(e){if(!p(e))throw new Error("This argument only accept array");var r,t={},n=new Set,o=g(new Set(e));try{var a=function(){var o=r.value,a=Array.from(e).filter((function(e){return e===o}));n.has(a.length)||(n.add(a.length),t[a.length]=[]),a.forEach((function(e){t[a.length].push(e)}))};for(o.s();!(r=o.n()).done;)a()}catch(e){o.e(e)}finally{o.f()}return t},I=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(!r&&r.length<=1)throw new Error("You have to provide here at least 2 arguments");var n=[],o={};r.forEach((function(e,r){if(p(e)?o[r]=new Set(e):o[r]=(new Set).add(e),0!==r){var t,a=g(e);try{for(a.s();!(t=a.n()).done;){var i=t.value;o[r-1].has(i)&&n.push(i)}}catch(e){a.e(e)}finally{a.f()}}}));var a=B(n);return Array.from(new Set(a[r.length-1]))},P=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(!p(e)&&e.length<=0)throw new Error("You need to provide more values to your array");if(!t&&t.length<=0)throw new Error("You have to provide here at least 1 value");var o,a=[],i=g(e);try{for(i.s();!(o=i.n()).done;){var u=o.value;t.flat().includes(u)||a.push(u)}}catch(e){i.e(e)}finally{i.f()}return a},L=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length<2&&!p(r[0])&&!p(r[1])&&Number(r[0].length)!==Number(r[1].length))throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var n=Array.from(r[0]).map((function(e){return[]})),o=0,a=r;o<a.length;o++){var i=a[o];i.forEach((function(e,r){r in n&&n[r].push(e)}))}return n},U=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length<2)throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var n=Array.from(r),o=[],a=n.shift(),i=function(){var e=l[u],r=new Map;e.forEach((function(e,t){a[t]&&r.set(a[t],e)})),o.push(Object.fromEntries(r))},u=0,l=n;u<l.length;u++)i();return o},F=function(){if(0===arguments.length||arguments.length>=4)throw new Error("Here only accept 3 arguments, so you have to provide at least 1 argument");var e=1===arguments.length?0:Number(arguments.length<=0?void 0:arguments[0]),r=Number(arguments.length>=2?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0]),t=3===arguments.length?Number(arguments.length<=2?void 0:arguments[2]):1;arguments.length<3&&o(r)&&(t=-1);var a=[],i=0,u=0;if(o(e)&&n(r)?i=e-1:n(e)&&o(r)?i=e+1:n(e)&&n(r)?i=e-1:o(e)&&o(r)&&(i=e+1),i<r){for(;i<r;)i++,t>1?(u+=t)<r&&a.push(u):i<r&&a.push(i);0!==e||a.includes(0)||a.unshift(0)}else if(i>r){for(;i>r;)i--,t<-1?(u-=t)>r&&a.unshift(u):i>r&&a.unshift(i);0!==e||a.includes(0)||a.push(0)}return 1===a.length&&0===a[0]?[]:a},H=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(0===r.length)throw new Error("Accept index of array elements only and you add at least one index in number");return function(e){if(!p(e))throw new Error("Please enter array only here");for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if(0===n.length&&n.length!==r.length&&0!==I(r,n).length)throw new Error("Only accept index of array elements and the number of the first indexes must be the same as the second indexes and also, both indexes must be different");for(var a=Array.from(e),i=Array.from(e),u=0;u<r.length;u++)void 0!==r[u]&&void 0!==n[u]&&(i.splice(r[u],1,a[n[u]]),i.splice(n[u],1,a[r[u]]));return i}},z=function(e,r,t){if(!p(e))throw new Error("On the first argument, you have to provide array only");if(!a(r))throw new Error("New property must be in string type");if(!C(t))throw new Error("Callback must be in function or method");return Array.from(e).map((function(e){return e[r]=t.apply(void 0,c(Object.values(e).filter((function(e){return!1===isNaN(e)})))),e}))},R=Object.freeze({__proto__:null,insert:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{position:null,index:null};if(!p(e))throw new Error("On the first argument, only array accept here");if(!w(r))throw new Error("On the second argument, only object with 2 properties (position and index property) accepted");for(var t=arguments.length,n=new Array(t>2?t-2:0),o=2;o<t;o++)n[o-2]=arguments[o];if(n.length<1)throw new Error("On the third or the next arguments, you have to enter at least one argument");var a=[];return"first"===r.position?a=b.apply(void 0,[e].concat(n)):"last"===r.position?a=N.apply(void 0,[e].concat(n)):"before"===r.position?a=E.apply(void 0,[e,r.index].concat(n)):"after"===r.position&&(a=D.apply(void 0,[e,r.index].concat(n))),a},insertFirst:b,insertLast:N,insertBefore:E,insertAfter:D,update:function(e,r,n){if(!p(e))throw new Error("You have to enter array only on the first argument");if(!w(r))throw new Error("You must enter object only here on the second argument");if(!w(n)&&!t(n))throw new Error("You must enter object only on the second argument");var o=Array.from(e),a=w(n)?A(o,n):Number(n);return o.map((function(e,t){var n=e;return t===a&&(n=S(e,r)),n}))},updateBy:function(e,r,t){if(!p(e))throw new Error("You have to enter array only on the first argument");if(!w(r))throw new Error("You must enter object only here on the second argument");if(!p(t))throw new Error("You must enter array of objects or numbers on the second argument");var n=Array.from(e);return n.map((function(e,o){var a,i=e,u=g(t);try{for(u.s();!(a=u.n()).done;){var l=a.value;o===(w(l)?A(n,l):Number(l))&&(i=S(e,r))}}catch(e){u.e(e)}finally{u.f()}return i}))},destroy:j,select:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(!p(e))throw new Error("On the first argument, you have to provide array only");if(t.length<1)throw new Error("On the second argument, you must enter at least one value");var o=Array.from(e);return o.map((function(e){var r,n={},o=g(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;a in e&&(n[a]=e[a])}}catch(e){o.e(e)}finally{o.f()}return n}))},hidden:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(!p(e))throw new Error("On the first argument, you have to provide array only");if(t.length<1)throw new Error("On the second argument, you must enter at least one value");var o=Array.from(e);return o.map((function(e){var r,n=e,o=g(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;a in e&&delete n[a]}}catch(e){o.e(e)}finally{o.f()}return n}))},toggle:function(e){return function(r){var t=Array.from(r);if(t.includes(e)){var n=t.findIndex((function(r){return r===e}));t.splice(n,1)}else t.push(e);return t}},flatten:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=[],n={};n.id=r.id||"id",n.parent=r.parent||"parent",n.children=r.children||"children";var o=function(){Array.from(e).forEach((function(e){if("object"===i(e)&&null!==e){var r=e;r[n.parent]="0","object"===i(r[n.children])&&Array.isArray(r[n.children])&&(a(r[n.children],e),delete r[n.children]),t.push(r)}}))},a=function e(r,o){r.length>=1&&Array.from(r).forEach((function(r){if("object"===i(r)&&null!==r){var a=r;a[n.parent]=o[n.id],"object"===i(a[n.children])&&Array.isArray(a[n.children])&&(e(a[n.children],r),delete a[n.children]),t.push(a)}}))};return o(),t},nested:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=[],n=Array.from(e),o={};o.id=r.id||"id",o.parent=r.parent||"parent",o.children=r.children||"children";var a=function(e){e.forEach((function(e){if("object"===i(e)&&null!==e){var r=null;("string"==typeof e[o.parent]&&"0"===e[o.parent]||"number"==typeof e[o.parent]&&0===e[o.parent])&&(r=u(e)),null!==r&&t.push(r)}}))},u=function(e){var r=e;return void 0!==e[o.children]&&null!==e[o.children]||(r[o.children]=l(e[o.id]),r[o.children].length<=0&&delete r[o.children]),delete r[o.parent],r},l=function(e){var r=[];return f(e).length>=1&&f(e).forEach((function(e){r.push(u(e))})),r},f=function(e){return n.filter((function(r){return r.parent===e}))};return a(n),t},index:A,toIndex:Y,randomIndex:O,search:function(e){if(!p)throw new Error("The first argument must be in array");for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];if(n.length<1)throw new Error("On the next arguments, you must provide at least one argument in either string or number");for(var i=[],u=function(){var r=f[l],n=Array.from(e).filter((function(e){if(t(e)&&Number(e)===Number(r))return!0;if(a(e)&&e.toLowerCase().includes(r.toLowerCase()))return!0;if(w(e))for(var n=0,o=Object.entries(e);n<o.length;n++){var i=h(o[n],2),u=i[0],l=i[1];if(t(e[u])&&Number(l)===Number(r))return!0;if(a(e[u])&&l.toLowerCase().includes(r.toLowerCase()))return!0}return!1}));i=M(i.concat(n))},l=0,f=n;l<f.length;l++)u();return i},searchBy:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(r.length<1)throw new Error("This argument must have at least one argument in either string or number");return function(e){for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];if(!p(e))throw new Error("Array of objects is needed in order to be searched");if(o.length<1)throw new Error("The last argument required at least one argument in either string or number");var u,l=[],f=g(r);try{var h=function(){var r=u.value,n=Array.from(e).filter((function(e){for(var n=0,i=Array.from(o);n<i.length;n++){var u=i[n];if(u in e){if(t(e[u])&&Number(e[u])===Number(r))return!0;if(a(e[u])&&-1!==e[u].toLowerCase().indexOf(r.toLowerCase()))return!0}}return!1}));l=M(l.concat(n))};for(f.s();!(u=f.n()).done;)h()}catch(e){f.e(e)}finally{f.f()}return l}},filter:x,filtered:x,sort:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc";if(!p(e))throw new Error("Only array of strings or numbers accepted");if(!a(r))throw new Error('The second argument must be in a string and a value either "", "asc" or "desc"');var n=Array.from(e);return"asc"===r?n.sort((function(e,r){if(t(e)&&t(r))return Number(e)-Number(r);if(a(e)&&a(r)){var n=e.toLowerCase(),o=r.toLowerCase(),i=0;return n<o?i=-1:n>o&&(i=1),i}})):"desc"===r&&n.sort((function(e,r){if(t(e)&&t(r))return Number(r)-Number(e);if(a(e)&&a(r)){var n=e.toLowerCase(),o=r.toLowerCase(),i=0;return o<n?i=-1:o>n&&(i=1),i}})),n},sortBy:k,sorted:k,sortWith:function(e,r){if(!p(e))throw new Error("The first argument must be in an array type");if(!C(r))throw new Error("The second argument is a compare or callback function");var t=Array.from(e);return t.sort((function(e,t){return-1===Math.sign(r(e,t))?-1:1})),t},paginate:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!p(e))throw new Error("On the first argument, here only accept array");if(!t(r))throw new Error("This is the page active number, please enter number only");if(!t(n))throw new Error("This is the limit of entries in one page in a number, please enter number only");var o=Array.from(e),a=Number(n)*Number(r)-(Number(n)-1),i=Number(n)*Number(r);return o.slice(a-1,i<=o.length?i:o.length)},pages:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if(!p(e))throw new Error("On the first argument, here only accept array");if(!t(r))throw new Error("This is the limit of entries in one page in a number, please enter number only");var n=Array.from(e),o=n.length/Number(r),a=Math.ceil(o);return a},pageInfo:_,show:_,pagination:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t(e))throw new Error("This is the total or all pages in numbers, please enter number only");if(!t(r))throw new Error("This is the page active number, please enter number only");if(!t(n))throw new Error("This is the position of ellipsis [...], please enter number only");var o=[],a=Number(e)<Number(r)?Number(e):Number(r),i=Number(r)<1?1:Number(r),u=a+Number(n),l=i-Number(n);if(0===Number(n))for(var f=1;f<=Number(e);f++)o.push(f);else{if(i>1)for(var h=l;h<i;h++)o.push(h);for(var c=a;c<=u;c++)o.push(c)}var s=o.filter((function(e){return e>0})),m=s.filter((function(r){return r<=Number(e)}));return u<Number(e)&&0!==Number(n)&&m.push("..."),l>1&&0!==Number(n)&&m.unshift("..."),m},sum:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!p(e))throw new Error("In the first argument, you must enter a data in array");var t=Array.from(e),n=0;if(t.length>=1)if("string"==typeof r&&""!==r){var o=t.map((function(e){return r in e?Number(e[r]):0}));n=o.reduce((function(e,r){return Number(e)+Number(r)}))}else n=t.reduce((function(e,r){return Number(e)+Number(r)}));return n},calculate:z,calc:z,unique:M,isArray:p,isSuperset:function(e,r){if(!p(e)&&!p(r))throw new Error("The both of arguments must be in arrays");var t,n=new Set(e),o=g(r);try{for(o.s();!(t=o.n()).done;){var a=t.value;if(!n.has(a))return!1}}catch(e){o.e(e)}finally{o.f()}return!0},union:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return Array.from(new Set(r.flat()))},intersection:I,difference:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(!r&&r.length<=1)throw new Error("You have to provide here at least 2 arguments");var n=new Set,o=I.apply(void 0,r);return r.forEach((function(e){if(!p(e))throw new Error("Here only accept arrays from all arguments");var r,t=g(e);try{for(t.s();!(r=t.n()).done;){var a=r.value;o.includes(a)||n.has(a)||n.add(a)}}catch(e){t.e(e)}finally{t.f()}})),Array.from(n)},asymmetricDifference:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(!r&&r.length<=1)throw new Error("You have to provide here at least 2 arguments");for(var n=new Set,o=[],a=0,i=r;a<i.length;a++){var u=i[a];if(!p(u))throw new Error("Here only accept arrays from all arguments");u.forEach((function(e){n.has(e)?(n.delete(e),o.push(e)):o.includes(e)||n.add(e)}))}return Array.from(n)},complement:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(!r&&r.length<=1)throw new Error("You have to provide here at least 1 value");var n=Array.from(r);n.shift();var o=new Set(P.apply(void 0,[r[0]].concat(c(n))));return Array.from(o)},without:P,transpose:L,zip:U,unzip:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length<2)throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var n=Array.from(r),o=Object.keys(n[0]),a={},i=0,u=o;i<u.length;i++){var l=u[i];a[l]=[]}for(var f=0,h=n;f<h.length;f++){var s=h[f];for(var m in s)a[m].push(s[m])}return[o].concat(c(L.apply(void 0,c(Object.values(a)))))},range:F,move:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(0===r.length)throw new Error("Only accept index of array elements and you must input at least one index in number type");return function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!p(e))throw new Error("Please enter array only here");if(!t(n))throw new Error("Input only index number here");var a,i=Array.from(e),u=[],l=g(r);try{for(l.s();!(a=l.n()).done;){var f=a.value;void 0!==i[Number(f)]&&u.push(i[Number(f)])}}catch(e){l.e(e)}finally{l.f()}var h=j.apply(void 0,[i].concat(r));return h.splice.apply(h,[n,o].concat(u)),h}},switched:H,transfer:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(0===r.length)throw new Error("Only accept index of array elements and you must enter at least one index in number type");return function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!p(e))throw new Error("Accept array only here");if(!p(n))throw new Error("Accept array only here");if(!t(o))throw new Error("Input only index number here");var a,i=Array.from(e),u=Array.from(n),l=[],f=g(r);try{for(f.s();!(a=f.n()).done;){var h=a.value;void 0!==i[Number(h)]&&l.push(i[Number(h)])}}catch(e){f.e(e)}finally{f.f()}var c=null===o?Number(u.length):o;u.splice.apply(u,[c,0].concat(l));var s=j.apply(void 0,[i].concat(r));return{from:s,to:u}}},compact:function(e){if(!p(e))throw new Error("Enter only array type here");return Array.from(e).filter((function(e){return null!=e&&!1!==e&&!isNaN(e)&&""!==e&&e>0}))},chunk:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!p(e)&&e.length<=2)throw new Error("Please insert array only on the first argument and must have 3 values at least");if("number"!=typeof r)throw new Error("On the second argument, you must input in a number type only");var t,n=F(r,e.length,r),o=[],a=g(n);try{for(a.s();!(t=a.n()).done;){var i=t.value,u=e.slice(Number(i)-Number(r),i);o.push(u)}}catch(e){a.e(e)}finally{a.f()}return n[Number(n.length)-1]<=e.length&&o.push(e.slice(n[Number(n.length)-1],e.length)),o},shuffle:function(e){if(!p(e)&&e.length<=2)throw new Error("This shuffle method only work on data in array type");for(var r=Array.from(e),t=Number(r.length)-1;t>2;t--){var n=r.slice(0,Number(t)+1);r=H(t)(r,O(n))}return r},group:function(e,r){if(!p(e))throw new Error("You must enter array literal here");if(!C(r))throw new Error("You have to enter a function or callback on the second argument");var t,n={},o=g(e);try{for(o.s();!(t=o.n()).done;){var a=t.value;void 0===n[r(a).toString()]&&(n[r(a).toString()]=[]),n[r(a).toString()].push(a)}}catch(e){o.e(e)}finally{o.f()}return n},countDuplication:B,countBy:function(e,r){if(!p(e))throw new Error("The first paramenter only accept array");if(!C(r))throw new Error("The second paramenter only accept callback function");return e.filter((function(e){return r(e)})).length}}),Z=Object.freeze({__proto__:null,remove:function(e){if(!w(e))throw new Error("This is object helper, you must provide the first argument in an object");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("The next arguments must be in a string and at least one argument");for(var o=Object.assign({},e),a=0,i=t;a<i.length;a++){var u=i[a];u in o&&delete o[u]}return o},removeBy:T,merge:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r){for(var n={},o=new Map,a=0,i=r;a<i.length;a++)for(var u=i[a],l=0,f=Object.entries(u);l<f.length;l++){var c=h(f[l],2),s=c[0],m=c[1];o.has(s)||(o.set(s,m),n[s]=m)}return n}},replace:S,isObject:w,isObjectValues:function(e){return!!Object.values(e).filter((function(e){return""!==e&&0!==e&&e!=={}&&e!==[]})).join("")},invert:function(e){if(!w(e))throw new Error("You have to input object only here");var r=Object.keys(e),t=Object.values(e);return U(t,r)[0]},clone:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length<1)throw new Error("In this argument must have at least one argument and please provide it in object type");return Object.assign.apply(Object,[{}].concat(r))}}),G=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|T|H{1,2}|h{1,2}|a|A|i{1,2}|s{1,2}|Z{1,2}|SSS/g,W=function(e){return"number"==typeof e||"string"==typeof e},J=function(e){return"number"==typeof e||"string"==typeof e},K=function(e){return"number"==typeof e||"string"==typeof e},$=function(e){return!!("object"===i(new Date(e))&&null!==e||"string"==typeof e&&new RegExp(G).test(e))},V=function(e){return!("string"!=typeof e||!new RegExp(q).test(e))},Q=function(e){return e%400==0||e%100!=0&&e%4==0},X="Year must be in a number or a string type, the length of year either 4 or 2",ee="Month must be in a number or a string type, the month number start from 1 to 12",re="Date must be in a number or a string type, the date number start from 1 to 31",te="Full date must be in string or array type",ne=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long",t=[],n=4;n<=10;n++){var o=new Date(Date.UTC(2021,3,n));t.push(new Intl.DateTimeFormat(e,{weekday:r}).format(o))}return t},oe=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);var t=[28,29,30,31],n=new Date(Date.UTC(Number(e),Number(r),0)).getUTCDate();return t.includes(n)?n:31},ae=function(e){if(!W(e))throw new Error(X);return Q(e)?366:365},ie=function(e,r){if(!$(e))throw new Error("Error in the first argument: "+te);if(!$(r))throw new Error("Error in the second argument: "+te);var t=new Date(e),n=new Date(r);return(Number(n.getTime())-Number(t.getTime()))/864e5},ue=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long",t=[],n=0;n<=11;n++){var o=Date.UTC(2021,n);t.push(new Intl.DateTimeFormat(e,{month:r}).format(new Date(o)))}return t},le=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"long";if(!$(e))throw new Error('You\'re entering the wrong date string, please use this statement "new Date(\'yourdateParam\').toString()" instead or array "[year, monthIndex, dateNumber]"');if(!V(r))throw new Error("Please enter the correct date format");var o,a=new Date(e),i=r,u=r,l={YY:function(){var e=a.getFullYear().toString().slice(-2),r=a.getFullYear();return"00"!==e&&(r=Number(e)),r},YYYY:a.getFullYear(),M:Number(a.getMonth())+1,MM:function(){var e=Number(Number(a.getMonth())+1).toString();return 1===e.length?"0"+e:e},m:ue(t,n)[a.getMonth()].slice(0,3),mm:ue(t,n)[a.getMonth()],D:a.getDate,DD:function(){var e=a.getDate().toString(),r=e;1===e.length&&(r="0"+e);return r},d:ne(t,n)[a.getDay()].slice(0,3),dd:ne(t,n)[a.getDay()],H:a.getHours(),HH:function(){var e=a.getHours().toString();return 1===e.length?"0"+e:e},h:function(){var e=Number(a.getHours()+1),r=e;return e>12&&(r=e-(e-1)),r},hh:function(){var e=Number(a.getHours()+1),r=e;e>12&&(r=e-(e-1));var t=r.toString();return 1===t.length?"0"+t:t},k:function(){return 0===Number(a.getHours())?24:a.getHours()},kk:function(){var e=Number(a.getHours()).toString();if(1===e.length){var r="0"+e;return 0===Number(r)?24:r}return 0===Number(e)?24:e},i:a.getMinutes(),ii:function(){var e=a.getMinutes().toString();return 1===e.length?"0"+e:e},s:a.getSeconds(),ss:function(){var e=a.getSeconds().toString();return 1===e.length?"0"+e:e},uuu:a.getMilliseconds(),A:a.getHours()<12?"AM":"PM",a:a.getHours()<12?"am":"pm",Do:a.getDate().toString()+"st"},f=i.split(/-|\/|\.|:|\s/),h=g(f);try{for(h.s();!(o=h.n()).done;){var c=o.value;"YY"===c?u=u.replace(c,l.YY()):"YYYY"===c?u=u.replace(c,l.YYYY):"M"===c?u=u.replace(c,l.M):"MM"===c?u=u.replace(c,l.MM()):"m"===c?u=u.replace(c,l.m):"mm"===c?u=u.replace(c,l.mm):"D"===c?u=u.replace(c,l.D):"DD"===c?u=u.replace(c,l.DD()):"d"===c?u=u.replace(c,l.d):"dd"===c?u=u.replace(c,l.dd):"H"===c?u=u.replace(c,l.H):"HH"===c?u=u.replace(c,l.HH()):"h"===c?u=u.replace(c,l.h()):"hh"===c?u=u.replace(c,l.hh()):"k"===c?u=u.replace(c,l.k()):"kk"===c?u=u.replace(c,l.kk()):"i"===c?u=u.replace(c,l.i):"ii"===c?u=u.replace(c,l.ii()):"s"===c?u=u.replace(c,l.s):"ss"===c?u=u.replace(c,l.ss()):"uuu"===c?u=u.replace(c,l.uuu):"A"===c?u=u.replace(c,l.A):"a"===c?u=u.replace(c,l.a):"Do"===c&&(u=u.replace(c,l.Do))}}catch(e){h.e(e)}finally{h.f()}return u},fe=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"long";if(!$(e))throw new Error("On the first argument, you have to input only the correct date");if(!V(r))throw new Error("For format date, you must always input the correct one by using characters like these: Y, M, m, D, d, H, h, k, i, S, s, A, a or Do");var o=e.split(/-|\/|\.|T|Z|:|\s/).filter((function(e){return e.length>=1&&" "!==e})).map((function(e){return e.trim()})),a=r.split(/-|\/|\.|T|Z|:|\s/).filter((function(e){return e.length>=1&&" "!==e})).map((function(e){return e.trim()})),i={year:(new Date).getFullYear(),month:Number((new Date).getMonth())+1,day:(new Date).getDate(),hour:(new Date).getHours(),minute:(new Date).getMinutes(),second:(new Date).getSeconds(),millisecond:(new Date).getMilliseconds()};if(o.length!==a.length)throw new Error("The numbers and the formats must be in place, so when we check the length of both of these arguments then the result will be the same");for(var u=0;u<o.length;u++)4===o[u].length&&!1===isNaN(o[u])&&"YYYY"===a[u]||2===o[u].length&&!1===isNaN(o[u])&&"YY"===a[u]?i.year=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"M"===a[u]||"MM"===a[u]?i.month=Number(o[u])-1:3===o[u].length&&ue(t,n).map((function(e){return e.slice(0,3)})).includes(o[u])&&"m"===a[u]?i.month=ue(t,n).map((function(e){return e.slice(0,3)})).findIndex(o[u]):o[u].length>=3&&ue(t,n).includes(o[u])&&"mm"===a[u]?i.month=ue(t,n).findIndex(o[u]):1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"D"===a[u]||"DD"===a[u]?i.day=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"H"===a[u]||"HH"===a[u]?i.hour=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"h"===a[u]||"hh"===a[u]?i.hour=o[u]>12?Number(o[u])-(Number(o[u])-1):o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"k"===a[u]||"kk"===a[u]?i.hour=24===Number(o[u])?0:o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"i"===a[u]||"ii"===a[u]?i.minute=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"s"===a[u]||"ss"===a[u]?i.second=o[u]:o[u].length>=3&&!1===isNaN(o[u])&&"uuu"===a[u]?i.millisecond=o[u]:("st"===o[u].slice(-2)||"nd"===o[u].slice(-2)||"th"===o[u].slice(-2)&&"Do"===a[u])&&(i.second=Number(o[u].slice(0,-2)));return new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond).toString()},he=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!$(e))throw new Error("Please enter a date in correct way, either in string or array type");if(!t(r))throw new Error("Only accept number type on second argument");var o=new Date(e),a=Number(o.getDate())+Number(r),i=Number(oe(Number(o.getFullYear()),o.getMonth()+1));if(a>i){var u=a-i;o=11===Number(o.getMonth())?new Date(Number(o.getFullYear())+1,0,u):new Date(Number(o.getFullYear()),Number(o.getMonth())+1,u)}else o=new Date(Number(o.getFullYear()),Number(o.getMonth()),a);var l=null!==n&&!1!==V(n)?le(o,n):o;return l},ce=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!$(n))throw new Error("Error in the first argument: "+te);if(!$(o))throw new Error("Error in the second argument: "+te);for(var n=new Date(e),o=new Date(r),a=[],i=n;i<=o;){var u=null!==t&&!1!==V(t)?le(i,t):i;a.push(u),i=he(i,1)}return a},se=function(e,r,t){if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!K(t))throw new Error(re);var n=ie(new Date(Number(e),0,1),new Date(Number(e),Number(r)-1,Number(t))),o=Number(new Date(e,0,1).getDay()),a=0;o>0&&(a=6-(o-1));var i=Number(new Date(Number(e),Number(r)-1,Number(t)).getDay()),u=0;return i<6&&(u=6-i),Math.ceil((Number(n)+u-a)/7)},me=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!W(e))throw new Error(X);if(!t(r))throw new Error("You have to enter a number");if(!V(n))throw new Error("Please enter a format of date correctly");var o=Number(new Date(Number(e),0,1).getDay()),a=0;o>0&&(a=6-(o-1));for(var i=[],u=a+1,l=0,f=e,h=1;h<=Number(r);h++){if(h===Number(r)){i.push(le(new Date(f,l,u),n));for(var c=0;c<6;)c++,i.push(le(he(new Date(f,l,u),c),n))}u+=7,l<12&&u>Number(oe(e,l+1))&&(u-=Number(oe(e,l+1)),11!==l?l+=1:(l=1,f+=1))}return i},ge=function(e,r){if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);for(var t=we(e,52,"M"),n=[],o=0,a=Object.entries(t);o<a.length;o++){var i=h(a[o],2),u=i[0];i[1].includes(r.toString())&&n.push(u)}return 1===Number(r)?n.filter((function(e){return"52"!==e})):n},we=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!W(e))throw new Error(X);if(!t(r))throw new Error("You have to enter a number");if(!V(n))throw new Error("Please enter a format of date correctly");var o=Number(new Date(Number(e),0,1).getDay()),a=0;o>0&&(a=6-(o-1));for(var i={},u=a+1,l=0,f=e,h=1;h<=r;h++)i[h.toString()]=[le(new Date(f,l,u),n),le(he(new Date(f,l,u),6),n)],u+=7,l<12&&u>Number(oe(e,l+1))&&(u-=Number(oe(e,l+1)),11!==l?l+=1:(l=1,f+=1));return i},de=Object.freeze({__proto__:null,now:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=(new Date).toString();return"string"==typeof e&&(r=le(r,e)),r},nowHijri:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",r=Date.UTC(Number((new Date).getFullYear()),Number((new Date).getMonth()),Number((new Date).getDate()),Number((new Date).getHours()),Number((new Date).getMinutes()),Number((new Date).getSeconds()),Number((new Date).getMilliseconds())),t=new Intl.DateTimeFormat(e,{calendar:"islamic",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h24"}).format(new Date(r));return t},parse:fe,parseDate:fe,utc:function(){return new Date(Date.UTC.apply(Date,arguments))},addDate:he,subtractDate:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!$(e))throw new Error("Please enter a date in correct way, either in string or array type");if(!t(r))throw new Error("Only accept number type on second argument");var o=new Date(e),a=Number(o.getDate())-Number(r),i=Number(oe(Number(o.getFullYear()),o.getMonth()));if(a<1){var u=i+(a-1);o=0===Number(o.getMonth())?new Date(Number(o.getFullYear())-1,0,u):new Date(Number(o.getFullYear()),Number(o.getMonth())+1,u)}else o=new Date(Number(o.getFullYear()),Number(o.getMonth()),a);var l=null!==n&&!1!==V(n)?le(o,n):o;return l},rangeDate:ce,day:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"en-US",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"long";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!K(t))throw new Error(re);var a=new Date(Date.UTC(Number(e),Number(r)-1,Number(t)));return new Intl.DateTimeFormat(n,{weekday:o}).format(a)},days:ne,daysInMonth:oe,daysInYear:ae,daysInBetween:ie,week:se,weeks:me,weeksInMonth:ge,weeksInYear:function(e){if(!W(e))throw new Error(X);var r=Number(new Date(Number(e),0,1).getDay()),t=0;r>0&&(t=6-(r-1));var n=Number(new Date(Number(e),11,31).getDay()),o=0;return n<6&&(o=6-n),Math.ceil((Number(ae(e))+o-t)/7)},month:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"long";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);var o=Date.UTC(e,Number(r)-1);return new Intl.DateTimeFormat(t,{month:n}).format(new Date(o))},months:ue,isYear:W,isMonth:J,isDate:K,isFullDate:$,isFormatDate:V,isLeapYear:Q,calendar:function(e,r){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YYYY-MM-DD",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"en-US";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!V(n))throw new Error("Please enter a format of date correctly");var a=ne(o),i=ce(new Date(e,Number(r)-1,1),new Date(e,Number(r)-1,oe(e,r)),n),u=Number(new Date(e,Number(r)-1,1).getDay()),l=[];if(u>0){var f=u-1;l=ce(new Date(e,Number(r)-2,Number(oe(e,Number(r)-1))-f),new Date(e,Number(r)-2,oe(e,Number(r)-1)),n)}var h=Number(new Date(e,Number(r)-1,oe(e,r)).getDay()),c=[];if(h<6){var s=6-(h+1);c=ce(new Date(e,Number(r),1),new Date(e,Number(r),1+s),n)}var m=[a,l,i,c];return!0===t?m.flat():m},daysInCalendar:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!V(t))throw new Error("Please enter a format of date correctly");return ce(new Date(e,Number(r)-1,1),new Date(e,Number(r)-1,oe(e,r)),t)},prevDaysInCalendar:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!V(t))throw new Error("Please enter a format of date correctly");var n=Number(new Date(e,Number(r)-1,1).getDay()),o=[];if(n>0){var a=n-1;o=ce(new Date(e,Number(r)-2,Number(oe(e,Number(r)-1))-a),new Date(e,Number(r)-2,oe(e,Number(r)-1)),t)}return o},nextDaysInCalendar:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!V(t))throw new Error("Please enter a format of date correctly");var n=Number(new Date(e,Number(r)-1,oe(e,r)).getDay()),o=[];if(n<6){var a=6-(n+1);o=ce(new Date(e,Number(r),1),new Date(e,Number(r),1+a),t)}return o},weeklyCalendar:function(e,r,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YYYY-MM-DD",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"en-US";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!K(t))throw new Error(re);if(!V(n))throw new Error("Please enter a format of date correctly");var a=ne(o),i=se(e,r,t),u=me(e,i,n);return U(a,u)[0]},calendarWithWeeks:function(e,r){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YYYY-MM-DD",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"en-US";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!V(n))throw new Error("Please enter a format of date correctly");var a=ne(o),i=ge(e,r),u=[];0!==Number(new Date(e,Number(r)-1,1).getDay())&&1===Number(r)&&(u.push("52"),u.push(me(Number(e)-1,52,n)));var l,f=g(i);try{for(f.s();!(l=f.n()).done;){var h=l.value;u.push(h),u.push(me(e,h,n))}}catch(e){f.e(e)}finally{f.f()}var c=["Week",a].concat(u);return!0===t?c.flat():c},dateToArray:function(e){if(!$(e))throw new Error("Please enter a valid date");return new Date(e).toJSON().replace("Z","").split(/-|:|\s|\.|T/g)}}),ve=Object.freeze({__proto__:null,size:function(e,r){if(0===e)return"0 Bytes";var t=r||1,n=Math.floor(Math.log(e)/Math.log(1e3));return parseFloat((e/Math.pow(1e3,n)).toFixed(t))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][n]},name:function(e){if("string"==typeof e)return e.indexOf("",41)>40?e.slice(0,41)+"...":e},type:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type",t=e.split("/");return"format"==r?t.shift():t.pop(),t.join("")},image:function(e){if("name"in e&&"string"==typeof e.name)return URL.createObjectURL(e)},date:function(e){return new Date(e).toDateString()},loadImage:function(e){"name"in e&&"string"==typeof e.name&&URL.revokeObjectURL(e)},formatSize:function(e){for(var r=0,t=e,n=t.length,o=0;o<n;o++)r+=t[o].size;for(var a=r+" bytes",i=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],u=0,l=r/1024;l>1;l/=1024,u++)a=l.toFixed(3)+" "+i[u]+" ("+r+" bytes)";return a},humanSize:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=r?1e3:1024;if(Math.abs(e)<n)return e+" B";var o=r?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],a=-1,i=Math.pow(10,t);do{e/=n,++a}while(Math.round(Math.abs(e)*i)/i>=n&&a<o.length-1);return e.toFixed(t)+" "+o[a]},exported:function(e,r){if("object"===i(e)&&"string"==typeof r){var t=Array.from(e),n="";if("json"===r.toLowerCase())n="data:application/json;charset=utf-8,"+JSON.stringify(t,null,2);else if("csv"===r.toLowerCase()){var o,a="",u=g(t);try{for(u.s();!(o=u.n()).done;){var l=o.value;for(var f in l)a+=l[f]+",";a=a.trim().substring(0,a.length-1),a+="\n"}}catch(e){u.e(e)}finally{u.f()}n="data:text/csv;charset=utf-8,"+(a=a.trim().substring(0,a.length-1))}else if("sql"===r.toLowerCase()){var h="INSERT INTO `export_table` (";for(var c in t[0])h+="`"+c+"`,";h=h.trim().substring(0,h.length-1),h+=") VALUES ";var s,m=g(t);try{for(m.s();!(s=m.n()).done;){var w=s.value;for(var d in h+="(",w)h+="`"+w[d]+"`,";h=h.trim().substring(0,h.length-1),h+="),"}}catch(e){m.e(e)}finally{m.f()}h=h.trim().substring(0,h.length-1),n="data:application/sql;charset=utf-8,"+(h+=";")}else if("xml"===r.toLowerCase()){var v='<?xml version="1.0" encoding="UTF-8"?>\n<data>';for(var y in t){for(var p in v+="\n <entry>",y)v+="\n <"+p+"`>"+y[p]+"</"+p+"`>";v+="\n </entry>"}n="data:application/xml;charset=utf-8,"+(v+="\n</data>")}else if("vhs"===r.toLowerCase()){var b,N='//visit official site: http://vhs-file-format.glitch.me \n("data", [',E=g(t);try{for(E.s();!(b=E.n()).done;){var D=b.value;for(var A in N+='\n ("entry", [',D)N+='\n ("'+A+'", ',N+=D[A]+"),";N=N.trim().substring(0,N.length-1),N+="]),"}}catch(e){E.e(e)}finally{E.f()}N=N.trim().substring(0,N.length-1),n="data:application/vhs;charset=utf-8,"+(N="])")}return n}},download:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"txt",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"export-to";if("string"==typeof e){var n=t+"."+r.toLowerCase(),o=encodeURI(e),a=document.createElement("a");a.href=o,a.download=n,document.body.appendChild(a),a.click(),document.body.removeChild(a)}},printed:function(e){if("object"===i(e)){var r=Array.from(e),t=document.createElement("table"),n=document.createElement("thead"),o=document.createElement("tbody");t.appendChild(n),t.appendChild(o);var a=document.createElement("tr");for(var u in r[0]){var l=document.createElement("th");l.textContent=u.replace(/^\w/,(function(e){return e.toUpperCase()})),a.appendChild(l)}n.appendChild(a);for(var f=0,h=r;f<h.length;f++){var c=h[f],s=document.createElement("tr");for(var m in c){var g=document.createElement("td");g.textContent=c[m],s.appendChild(g)}o.appendChild(s)}var w=window.open();w.document.body.appendChild(t),w.focus(),w.print()}}}),ye=function(e,r,t){var n;if(t){var o=new Date;o.setTime(o.getTime()+24*t*60*60*1e3),n="expires="+o.toGMTString()}else n="";document.cookie=e+"="+r+"; SameSite=Lax;"+n+"; path=/"},pe=function(e){for(var r=e+"=",t=document.cookie.split(";"),n=0;n<t.length;n++){for(var o=t[n];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(r))return o.substring(r.length,o.length)}return null},be=function(e){return"object"===("undefined"==typeof window?"undefined":i(window))&&"".concat(e,"Storage")in window},Ne=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"local";if(be(r))return!!window["".concat(r,"Storage")].getItem(e)},Ee=Object.freeze({__proto__:null,setCookie:ye,getCookie:pe,hasCookie:function(e){return!!pe(e)},removeCookie:function(e){ye(e,"",-1)},clearCookie:function(){for(var e=document.cookie.split(";"),r=0;r<e.length;r++){var t=e[r],n=t.indexOf("="),o=n>-1?t.substr(0,n):t;document.cookie=o+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"}},isStorage:be,isCookie:function(){return"object"===("undefined"==typeof document?"undefined":i(document))&&"cookie"in document},setStorage:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local";be(t)&&window["".concat(t,"Storage")].setItem(e,r)},getStorage:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"local";if(be(r))return window["".concat(r,"Storage")].getItem(e)},hasStorage:Ne,removeStorage:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"local";be(r)&&Ne(e,r)&&window["".concat(r,"Storage")].removeItem(e)},clearStorage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"local";be(e)&&window["".concat(e,"Storage")].clear()}}),De=Object.freeze({__proto__:null,ternary:function(e,r,t){if(!C(e)&&!C(r)&&!C(t))throw new Error("All arguments here only accept value in function");return e()?r():t()}});e.array=R,e.char=v,e.date=de,e.file=ve,e.func=De,e.int=r,e.number=d,e.object=Z,e.storage=Ee,e.string=y,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).$={})}(this,(function(e){"use strict";var r=Object.freeze({__proto__:null,random:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:255,r=Number(e)+1;return Math.floor(Math.random()*r)}}),t=function(e){return!isNaN(e)&&"number"==typeof Number(e)},n=function(e){if("number"!=typeof e&&"string"!=typeof e)throw new Error("You must input only number format here");return 1===Math.sign(e)},o=function(e){if("number"!=typeof e&&"string"!=typeof e)throw new Error("You must input only number format here");return-1===Math.sign(e)},a=function(e){return"string"==typeof e};function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function f(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?l(Object(t),!0).forEach((function(r){u(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function h(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return t}(e,r)||s(e,r)||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 c(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e,r){if(e){if("string"==typeof e)return m(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?m(e,r):void 0}}function m(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function g(e,r){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=s(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(u)throw a}}}}var d=function(e){return"object"===i(e)&&null!==e&&"[object Object]"===Object.prototype.toString.call(e)},w=Object.freeze({__proto__:null,random:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if("number"!=typeof e&&e<=0)throw new Error("You have to add a number at least 1");for(var r="",t="0123456789",n=0;n<e;n++)r+=t.charAt(Math.floor(Math.random()*t.length));return r},loop:function(e,r){if("number"!=typeof e&e<=-1)throw new Error("Only accept number here, start from 0");if("number"!=typeof r&r<=0)throw new Error("Only accept number here, start from 1");for(var t=[];e<=r;)t.push(e++);return t},isNumber:t,isPositive:n,isNegative:o,calc:function(e,r,n){if(!t(e))throw new Error("This is left operand and must be in number type");if(!t(r))throw new Error("This is left operand and must be in number type");if(!a(n))throw new Error("Operator must be one of these: add, subtract, multiply, divide, reminder or exponent");var o=0;return"add"===n||"addition"===n||"plus"===n||"+"===n?o=Number(e)+Number(r):"subtract"===n||"subtraction"===n||"minus"===n||"-"===n?o=Number(e)-Number(r):"multiply"===n||"multiplication"===n||"×"===n||"*"===n?o=Number(e)*Number(r):"divide"===n||"division"===n||"÷"===n||"/"===n?o=Number(e)/Number(r):"remainder"===n||"modulo"===n||"%"===n?o=Number(e)%Number(r):"exponent"!==n&&"exponentiation"!==n&&"**"!==n||(o=Math.pow(Number(e),Number(r))),o},currency:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!t(e))throw new Error("Amount must be in a number type");if(!a(r)&&3===r.length)throw new Error("Currency code must have at least 3 uppercase character");if(!a(n))throw new Error("Locale code must contain 2 languages and 2 country code and separated by dash (-)");if(!d(o))throw new Error("Currency options must be in object type");return new Intl.NumberFormat(n,f({style:"currency",currency:r.toUpperCase()},o)).format(e)}}),v=Object.freeze({__proto__:null,random:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:11,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long",t="",n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_~!@#$%^&*()+={}[]|:;<>,./?";"short"===r||"alphadash"===r?n=n.slice(0,64):"narrow"===r||"alphanumeric"===r?n=n.slice(0,62):"alpha"===r?n=n.slice(10,62):"hex"===r?n=n.slice(0,16):"number"!==r&&"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}}),y=Object.freeze({__proto__:null,split:function(e){return function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=[];return"string"==typeof e&&(r>=1&&n.push(e.slice(0,r)),null!==t?(n.push(e.slice(r,t)),n.push(e.slice(t))):n.push(e.slice(r))),n}},capitalize:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"single";if("string"==typeof e){var t=e;return t="multiple"===r?t.toLowerCase().replace(/\w\S*/g,(function(e){return e.replace(/^\w/,(function(e){return e.toUpperCase()}))})):t.trimStart().replace(/^\w/,(function(e){return e.toUpperCase()}))}},includes:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return-1!==e.indexOf(r,t)},isString:a}),p=function(e){return!("object"!==i(e)||null===e||!Array.isArray(e))},b=function(e){if(!p(e))throw new Error("On the first argument must be in array type");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("On the next arguments, you have to provide at least one argument");var o=Array.from(e);return o.unshift.apply(o,t),o},N=function(e){if(!p(e))throw new Error("On the first argument must be in array type");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("On the next arguments, you have to provide at least one argument");var o=Array.from(e);return o.push.apply(o,t),o},E=function(e,r){if(!p(e))throw new Error("On the first argument, here only accept array type");if(!t(r))throw new Error("On the second argument, accept only numeric or number type");for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];if(o.length<1)throw new Error("On the next arguments, you have to enter at least one value");var i=Array.from(e),u=isNaN(r)?1:r;return i.splice.apply(i,[Number(u)-1,0].concat(o)),i},D=function(e,r){if(!p(e))throw new Error("On the first argument, here only accept array type");if(!t(r))throw new Error("On the second argument, accept only numeric or number type");for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];if(o.length<1)throw new Error("On the next arguments, you have to enter at least one value");var i=Array.from(e),u=isNaN(r)?0:r;return i.splice.apply(i,[Number(u)+1,0].concat(o)),i},A=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{key:"id",value:0};if(!p(e))throw new Error("You must enter the first argument in array only");var t=Array.from(e),n=-1;return"key"in r&&"value"in r?n=t.length>=1?t.findIndex((function(e){return e[r.key]===r.value})):-1:t.length>=1&&(n=t.findIndex((function(e){for(var t=0,n=Object.entries(r);t<n.length;t++){var o=h(n[t],2),a=o[0],i=o[1];if(a in e&&e[a]===i)return!0}}))),n},Y=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dense";if(!p(e))throw new Error("You must enter the first argument in array only");return"sparse"===r?Object.keys(e).map((function(e){return Number(e)})):c(e.keys())},O=function(e){if(!p(e))throw new Error("You must enter the argument in array only");var r=Y(e);return Number(r[Math.floor(Math.random()*r.length)])},S=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r){for(var n={},o=0,a=r;o<a.length;o++)for(var i=a[o],u=0,l=Object.entries(i);u<l.length;u++){var f=h(l[u],2),c=f[0],s=f[1];n[c]=s}return n}},j=function(e){if(!p(e))throw new Error("Please provide array that you want to remove its element");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("On the last of argument, you have to enter at least one argument");for(var o=Array.from(e),a=[],u=function(){var e=f[l];if("string"==typeof e&&"first"===e)o=o.map((function(e,r){return 0===r?null:e})),a=o;else if("string"==typeof e&&"last"===e)o=o.map((function(e,r){return r===o.length-1?null:e})),a=o;else if("number"==typeof e)o=o.map((function(r,t){return t===e?null:r})),a=o;else if("object"===i(e)&&null!==e){var r=A(o,e);o=o.map((function(e,t){return t===r?null:e})),a=o}},l=0,f=t;l<f.length;l++)u();return a.filter((function(e){return null!==e}))},M=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!p(e))throw new Error("");var t=Array.from(e),n=[];if("string"==typeof r){var o,a=new Set,i=g(t);try{for(i.s();!(o=i.n()).done;){var u=o.value;a.has(u[r])||a.add(u[r])}}catch(e){i.e(e)}finally{i.f()}n=c(a)}else n=Array.from(new Set(t));return n},x=function(e){if(!d(e))throw new Error("This is object helper, you must provide the first argument in an object");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("The next arguments must be in a string or in a number and at least one argument");for(var o={},a=new Set(t),i=0,u=Object.entries(e);i<u.length;i++){var l=h(u[i],1),f=l[0];a.has(e[f])||(o[f]=e[f])}return o},T=function(e,r){if(!p(e))throw new Error("The first argument must be in array of objects");if(!d(r))throw new Error("The second argument must be in object type and must have at least one property");for(var n=Array.from(e),o=function(){var e=h(u[i],2),r=e[0],o=e[1],l=n.filter((function(e){if(r in e){if(t(e[r])&&Number(e[r])===Number(o))return!0;if(a(e[r])&&e[r].toLowerCase().includes(o.toLowerCase()))return!0}return!1}));n=l},i=0,u=Object.entries(x(r,"",0));i<u.length;i++)o();return n},C=function(e){return"function"==typeof e},k=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";if(!p(e))throw new Error("Only array of objects accepted");if(!a(r))throw new Error("The second argument must be in a string and a value must be object property key or name");if(!a(n))throw new Error('The third argument must be in a string and a value either "", "asc" or "desc"');var o=Array.from(e);return"asc"===n?o.sort((function(e,n){if(r in e&&r in n){if(t(e[r])&&t(n[r]))return Number(e[r])-Number(n[r]);if(a(e[r])&&a(n[r])){var o=e[r].toLowerCase(),i=n[r].toLowerCase(),u=0;return o<i?u=-1:o>i&&(u=1),u}}})):"desc"===n&&o.sort((function(e,n){if(r in e&&r in n){if(t(e[r])&&t(n[r]))return Number(n[r])-Number(e[r]);if(a(e[r])&&a(n[r])){var o=e[r].toLowerCase(),i=n[r].toLowerCase(),u=0;return i<o?u=-1:i>o&&(u=1),u}}})),o},_=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!p(e))throw new Error("On the first argument, here only accept array");if(!t(r))throw new Error("This is the page active number, please enter number only");if(!t(n))throw new Error("This is the limit of entries in one page in a number, please enter number only");var o=Array.from(e),a=Number(n)*Number(r)-(Number(n)-1),i=Number(n)*Number(r);return{from:o.length>=1?a:0,start:o.length>=1?a:0,to:i<=o.length?i:o.length,end:i<=o.length?i:o.length,of:o.length,length:o.length}},B=function(e){if(!p(e))throw new Error("This argument only accept array");var r,t={},n=new Set,o=g(new Set(e));try{var a=function(){var o=r.value,a=Array.from(e).filter((function(e){return e===o}));n.has(a.length)||(n.add(a.length),t[a.length]=[]),a.forEach((function(e){t[a.length].push(e)}))};for(o.s();!(r=o.n()).done;)a()}catch(e){o.e(e)}finally{o.f()}return t},I=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(!r&&r.length<=1)throw new Error("You have to provide here at least 2 arguments");var n=[],o={};r.forEach((function(e,r){if(p(e)?o[r]=new Set(e):o[r]=(new Set).add(e),0!==r){var t,a=g(e);try{for(a.s();!(t=a.n()).done;){var i=t.value;o[r-1].has(i)&&n.push(i)}}catch(e){a.e(e)}finally{a.f()}}}));var a=B(n);return Array.from(new Set(a[r.length-1]))},P=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(!p(e)&&e.length<=0)throw new Error("You need to provide more values to your array");if(!t&&t.length<=0)throw new Error("You have to provide here at least 1 value");var o,a=[],i=g(e);try{for(i.s();!(o=i.n()).done;){var u=o.value;t.flat().includes(u)||a.push(u)}}catch(e){i.e(e)}finally{i.f()}return a},L=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length<2&&!p(r[0])&&!p(r[1])&&Number(r[0].length)!==Number(r[1].length))throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var n=Array.from(r[0]).map((function(e){return[]})),o=0,a=r;o<a.length;o++){var i=a[o];i.forEach((function(e,r){r in n&&n[r].push(e)}))}return n},U=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length<2)throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var n=Array.from(r),o=[],a=n.shift(),i=function(){var e=l[u],r=new Map;e.forEach((function(e,t){a[t]&&r.set(a[t],e)})),o.push(Object.fromEntries(r))},u=0,l=n;u<l.length;u++)i();return o},F=function(){if(0===arguments.length||arguments.length>=4)throw new Error("Here only accept 3 arguments, so you have to provide at least 1 argument");var e=1===arguments.length?0:Number(arguments.length<=0?void 0:arguments[0]),r=Number(arguments.length>=2?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0]),t=3===arguments.length?Number(arguments.length<=2?void 0:arguments[2]):1;arguments.length<3&&o(r)&&(t=-1);var a=[],i=0,u=0;if(o(e)&&n(r)?i=e-1:n(e)&&o(r)?i=e+1:n(e)&&n(r)?i=e-1:o(e)&&o(r)&&(i=e+1),i<r){for(;i<r;)i++,t>1?(u+=t)<r&&a.push(u):i<r&&a.push(i);0!==e||a.includes(0)||a.unshift(0)}else if(i>r){for(;i>r;)i--,t<-1?(u-=t)>r&&a.unshift(u):i>r&&a.unshift(i);0!==e||a.includes(0)||a.push(0)}return 1===a.length&&0===a[0]?[]:a},H=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(0===r.length)throw new Error("Accept index of array elements only and you add at least one index in number");return function(e){if(!p(e))throw new Error("Please enter array only here");for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if(0===n.length&&n.length!==r.length&&0!==I(r,n).length)throw new Error("Only accept index of array elements and the number of the first indexes must be the same as the second indexes and also, both indexes must be different");for(var a=Array.from(e),i=Array.from(e),u=0;u<r.length;u++)void 0!==r[u]&&void 0!==n[u]&&(i.splice(r[u],1,a[n[u]]),i.splice(n[u],1,a[r[u]]));return i}},z=function(e,r,t){if(!p(e))throw new Error("On the first argument, you have to provide array only");if(!a(r))throw new Error("New property must be in string type");if(!C(t))throw new Error("Callback must be in function or method");return Array.from(e).map((function(e){return e[r]=t.apply(void 0,c(Object.values(e).filter((function(e){return!1===isNaN(e)})))),e}))},R=Object.freeze({__proto__:null,insert:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{position:null,index:null};if(!p(e))throw new Error("On the first argument, only array accept here");if(!d(r))throw new Error("On the second argument, only object with 2 properties (position and index property) accepted");for(var t=arguments.length,n=new Array(t>2?t-2:0),o=2;o<t;o++)n[o-2]=arguments[o];if(n.length<1)throw new Error("On the third or the next arguments, you have to enter at least one argument");var a=[];return"first"===r.position?a=b.apply(void 0,[e].concat(n)):"last"===r.position?a=N.apply(void 0,[e].concat(n)):"before"===r.position?a=E.apply(void 0,[e,r.index].concat(n)):"after"===r.position&&(a=D.apply(void 0,[e,r.index].concat(n))),a},insertFirst:b,insertLast:N,insertBefore:E,insertAfter:D,update:function(e,r,n){if(!p(e))throw new Error("You have to enter array only on the first argument");if(!d(r))throw new Error("You must enter object only here on the second argument");if(!d(n)&&!t(n))throw new Error("You must enter object only on the second argument");var o=Array.from(e),a=d(n)?A(o,n):Number(n);return o.map((function(e,t){var n=e;return t===a&&(n=S(e,r)),n}))},updateBy:function(e,r,t){if(!p(e))throw new Error("You have to enter array only on the first argument");if(!d(r))throw new Error("You must enter object only here on the second argument");if(!p(t))throw new Error("You must enter array of objects or numbers on the second argument");var n=Array.from(e);return n.map((function(e,o){var a,i=e,u=g(t);try{for(u.s();!(a=u.n()).done;){var l=a.value;o===(d(l)?A(n,l):Number(l))&&(i=S(e,r))}}catch(e){u.e(e)}finally{u.f()}return i}))},destroy:j,select:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(!p(e))throw new Error("On the first argument, you have to provide array only");if(t.length<1)throw new Error("On the second argument, you must enter at least one value");var o=Array.from(e);return o.map((function(e){var r,n={},o=g(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;a in e&&(n[a]=e[a])}}catch(e){o.e(e)}finally{o.f()}return n}))},hidden:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(!p(e))throw new Error("On the first argument, you have to provide array only");if(t.length<1)throw new Error("On the second argument, you must enter at least one value");var o=Array.from(e);return o.map((function(e){var r,n=e,o=g(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;a in e&&delete n[a]}}catch(e){o.e(e)}finally{o.f()}return n}))},toggle:function(e){return function(r){var t=Array.from(r);if(t.includes(e)){var n=t.findIndex((function(r){return r===e}));t.splice(n,1)}else t.push(e);return t}},flatten:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=[],n={};n.id=r.id||"id",n.parent=r.parent||"parent",n.children=r.children||"children";var o=function(){Array.from(e).forEach((function(e){if("object"===i(e)&&null!==e){var r=e;r[n.parent]="0","object"===i(r[n.children])&&Array.isArray(r[n.children])&&(a(r[n.children],e),delete r[n.children]),t.push(r)}}))},a=function e(r,o){r.length>=1&&Array.from(r).forEach((function(r){if("object"===i(r)&&null!==r){var a=r;a[n.parent]=o[n.id],"object"===i(a[n.children])&&Array.isArray(a[n.children])&&(e(a[n.children],r),delete a[n.children]),t.push(a)}}))};return o(),t},nested:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=[],n=Array.from(e),o={};o.id=r.id||"id",o.parent=r.parent||"parent",o.children=r.children||"children";var a=function(e){e.forEach((function(e){if("object"===i(e)&&null!==e){var r=null;("string"==typeof e[o.parent]&&"0"===e[o.parent]||"number"==typeof e[o.parent]&&0===e[o.parent])&&(r=u(e)),null!==r&&t.push(r)}}))},u=function(e){var r=e;return void 0!==e[o.children]&&null!==e[o.children]||(r[o.children]=l(e[o.id]),r[o.children].length<=0&&delete r[o.children]),delete r[o.parent],r},l=function(e){var r=[];return f(e).length>=1&&f(e).forEach((function(e){r.push(u(e))})),r},f=function(e){return n.filter((function(r){return r.parent===e}))};return a(n),t},index:A,toIndex:Y,randomIndex:O,search:function(e){if(!p)throw new Error("The first argument must be in array");for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];if(n.length<1)throw new Error("On the next arguments, you must provide at least one argument in either string or number");for(var i=[],u=function(){var r=f[l],n=Array.from(e).filter((function(e){if(t(e)&&Number(e)===Number(r))return!0;if(a(e)&&e.toLowerCase().includes(r.toLowerCase()))return!0;if(d(e))for(var n=0,o=Object.entries(e);n<o.length;n++){var i=h(o[n],2),u=i[0],l=i[1];if(t(e[u])&&Number(l)===Number(r))return!0;if(a(e[u])&&l.toLowerCase().includes(r.toLowerCase()))return!0}return!1}));i=M(i.concat(n))},l=0,f=n;l<f.length;l++)u();return i},searchBy:function(e,r,n){if(!p(e))throw new Error("The first argument must be in array of objects and it is needed in order to be searched");if(!p(r)&&r.length<1)throw new Error("The second argument must have at least one argument either in a string or in a number");if(!p(n)&&n.length<1)throw new Error("The last argument required at least one argument either in a string or in a number");var o,i=[],u=g(r);try{var l=function(){var r=o.value,u=Array.from(e).filter((function(e){for(var o=0,i=Array.from(n);o<i.length;o++){var u=i[o];if(u in e){if(t(e[u])&&Number(e[u])===Number(r))return!0;if(a(e[u])&&-1!==e[u].toLowerCase().indexOf(r.toLowerCase()))return!0}}return!1}));i=M(i.concat(u))};for(u.s();!(o=u.n()).done;)l()}catch(e){u.e(e)}finally{u.f()}return i},filter:T,filtered:T,sort:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc";if(!p(e))throw new Error("Only array of strings or numbers accepted");if(!a(r))throw new Error('The second argument must be in a string and a value either "", "asc" or "desc"');var n=Array.from(e);return"asc"===r?n.sort((function(e,r){if(t(e)&&t(r))return Number(e)-Number(r);if(a(e)&&a(r)){var n=e.toLowerCase(),o=r.toLowerCase(),i=0;return n<o?i=-1:n>o&&(i=1),i}})):"desc"===r&&n.sort((function(e,r){if(t(e)&&t(r))return Number(r)-Number(e);if(a(e)&&a(r)){var n=e.toLowerCase(),o=r.toLowerCase(),i=0;return o<n?i=-1:o>n&&(i=1),i}})),n},sortBy:k,sorted:k,sortWith:function(e,r){if(!p(e))throw new Error("The first argument must be in an array type");if(!C(r))throw new Error("The second argument is a compare or callback function");var t=Array.from(e);return t.sort((function(e,t){return-1===Math.sign(r(e,t))?-1:1})),t},paginate:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!p(e))throw new Error("On the first argument, here only accept array");if(!t(r))throw new Error("This is the page active number, please enter number only");if(!t(n))throw new Error("This is the limit of entries in one page in a number, please enter number only");var o=Array.from(e),a=Number(n)*Number(r)-(Number(n)-1),i=Number(n)*Number(r);return o.slice(a-1,i<=o.length?i:o.length)},pages:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if(!p(e))throw new Error("On the first argument, here only accept array");if(!t(r))throw new Error("This is the limit of entries in one page in a number, please enter number only");var n=Array.from(e),o=n.length/Number(r),a=Math.ceil(o);return a},pageInfo:_,show:_,pagination:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!t(e))throw new Error("This is the total or all pages in numbers, please enter number only");if(!t(r))throw new Error("This is the page active number, please enter number only");if(!t(n))throw new Error("This is the position of ellipsis [...], please enter number only");var o=[],a=Number(e)<Number(r)?Number(e):Number(r),i=Number(r)<1?1:Number(r),u=a+Number(n),l=i-Number(n);if(0===Number(n))for(var f=1;f<=Number(e);f++)o.push(f);else{if(i>1)for(var h=l;h<i;h++)o.push(h);for(var c=a;c<=u;c++)o.push(c)}var s=o.filter((function(e){return e>0})),m=s.filter((function(r){return r<=Number(e)}));return u<Number(e)&&0!==Number(n)&&m.push("..."),l>1&&0!==Number(n)&&m.unshift("..."),m},sum:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!p(e))throw new Error("In the first argument, you must enter a data in array");var t=Array.from(e),n=0;if(t.length>=1)if("string"==typeof r&&""!==r){var o=t.map((function(e){return r in e?Number(e[r]):0}));n=o.reduce((function(e,r){return Number(e)+Number(r)}))}else n=t.reduce((function(e,r){return Number(e)+Number(r)}));return n},calculate:z,calc:z,unique:M,isArray:p,isSuperset:function(e,r){if(!p(e)&&!p(r))throw new Error("The both of arguments must be in arrays");var t,n=new Set(e),o=g(r);try{for(o.s();!(t=o.n()).done;){var a=t.value;if(!n.has(a))return!1}}catch(e){o.e(e)}finally{o.f()}return!0},union:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return Array.from(new Set(r.flat()))},intersection:I,difference:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(!r&&r.length<=1)throw new Error("You have to provide here at least 2 arguments");var n=new Set,o=I.apply(void 0,r);return r.forEach((function(e){if(!p(e))throw new Error("Here only accept arrays from all arguments");var r,t=g(e);try{for(t.s();!(r=t.n()).done;){var a=r.value;o.includes(a)||n.has(a)||n.add(a)}}catch(e){t.e(e)}finally{t.f()}})),Array.from(n)},asymmetricDifference:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(!r&&r.length<=1)throw new Error("You have to provide here at least 2 arguments");for(var n=new Set,o=[],a=0,i=r;a<i.length;a++){var u=i[a];if(!p(u))throw new Error("Here only accept arrays from all arguments");u.forEach((function(e){n.has(e)?(n.delete(e),o.push(e)):o.includes(e)||n.add(e)}))}return Array.from(n)},complement:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(!r&&r.length<=1)throw new Error("You have to provide here at least 1 value");var n=Array.from(r);n.shift();var o=new Set(P.apply(void 0,[r[0]].concat(c(n))));return Array.from(o)},without:P,transpose:L,zip:U,unzip:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length<2)throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var n=Array.from(r),o=Object.keys(n[0]),a={},i=0,u=o;i<u.length;i++){var l=u[i];a[l]=[]}for(var f=0,h=n;f<h.length;f++){var s=h[f];for(var m in s)a[m].push(s[m])}return[o].concat(c(L.apply(void 0,c(Object.values(a)))))},range:F,move:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(0===r.length)throw new Error("Only accept index of array elements and you must input at least one index in number type");return function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!p(e))throw new Error("Please enter array only here");if(!t(n))throw new Error("Input only index number here");var a,i=Array.from(e),u=[],l=g(r);try{for(l.s();!(a=l.n()).done;){var f=a.value;void 0!==i[Number(f)]&&u.push(i[Number(f)])}}catch(e){l.e(e)}finally{l.f()}var h=j.apply(void 0,[i].concat(r));return h.splice.apply(h,[n,o].concat(u)),h}},switched:H,transfer:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(0===r.length)throw new Error("Only accept index of array elements and you must enter at least one index in number type");return function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!p(e))throw new Error("Accept array only here");if(!p(n))throw new Error("Accept array only here");if(!t(o))throw new Error("Input only index number here");var a,i=Array.from(e),u=Array.from(n),l=[],f=g(r);try{for(f.s();!(a=f.n()).done;){var h=a.value;void 0!==i[Number(h)]&&l.push(i[Number(h)])}}catch(e){f.e(e)}finally{f.f()}var c=null===o?Number(u.length):o;u.splice.apply(u,[c,0].concat(l));var s=j.apply(void 0,[i].concat(r));return{from:s,to:u}}},compact:function(e){if(!p(e))throw new Error("Enter only array type here");return Array.from(e).filter((function(e){return null!=e&&!1!==e&&!isNaN(e)&&""!==e&&e>0}))},chunk:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!p(e)&&e.length<=2)throw new Error("Please insert array only on the first argument and must have 3 values at least");if("number"!=typeof r)throw new Error("On the second argument, you must input in a number type only");var t,n=F(r,e.length,r),o=[],a=g(n);try{for(a.s();!(t=a.n()).done;){var i=t.value,u=e.slice(Number(i)-Number(r),i);o.push(u)}}catch(e){a.e(e)}finally{a.f()}return n[Number(n.length)-1]<=e.length&&o.push(e.slice(n[Number(n.length)-1],e.length)),o},shuffle:function(e){if(!p(e)&&e.length<=2)throw new Error("This shuffle method only work on data in array type");for(var r=Array.from(e),t=Number(r.length)-1;t>2;t--){var n=r.slice(0,Number(t)+1);r=H(t)(r,O(n))}return r},group:function(e,r){if(!p(e))throw new Error("You must enter array literal here");if(!C(r))throw new Error("You have to enter a function or callback on the second argument");var t,n={},o=g(e);try{for(o.s();!(t=o.n()).done;){var a=t.value;void 0===n[r(a).toString()]&&(n[r(a).toString()]=[]),n[r(a).toString()].push(a)}}catch(e){o.e(e)}finally{o.f()}return n},countDuplication:B,countBy:function(e,r){if(!p(e))throw new Error("The first paramenter only accept array");if(!C(r))throw new Error("The second paramenter only accept callback function");return e.filter((function(e){return r(e)})).length}}),Z=Object.freeze({__proto__:null,remove:function(e){if(!d(e))throw new Error("This is object helper, you must provide the first argument in an object");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("The next arguments must be in a string and at least one argument");for(var o=Object.assign({},e),a=0,i=t;a<i.length;a++){var u=i[a];u in o&&delete o[u]}return o},removeBy:x,merge:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r){for(var n={},o=new Map,a=0,i=r;a<i.length;a++)for(var u=i[a],l=0,f=Object.entries(u);l<f.length;l++){var c=h(f[l],2),s=c[0],m=c[1];o.has(s)||(o.set(s,m),n[s]=m)}return n}},replace:S,isObject:d,isObjectValues:function(e){return!!Object.values(e).filter((function(e){return""!==e&&0!==e&&e!=={}&&e!==[]})).join("")},invert:function(e){if(!d(e))throw new Error("You have to input object only here");var r=Object.keys(e),t=Object.values(e);return U(t,r)[0]},clone:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length<1)throw new Error("In this argument must have at least one argument and please provide it in object type");return Object.assign.apply(Object,[{}].concat(r))}}),G=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,q=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|T|H{1,2}|h{1,2}|a|A|i{1,2}|s{1,2}|Z{1,2}|SSS/g,W=function(e){return"number"==typeof e||"string"==typeof e},J=function(e){return"number"==typeof e||"string"==typeof e},K=function(e){return"number"==typeof e||"string"==typeof e},$=function(e){return!!("object"===i(new Date(e))&&null!==e||"string"==typeof e&&new RegExp(G).test(e))},V=function(e){return!("string"!=typeof e||!new RegExp(q).test(e))},Q=function(e){return e%400==0||e%100!=0&&e%4==0},X="Year must be in a number or a string type, the length of year either 4 or 2",ee="Month must be in a number or a string type, the month number start from 1 to 12",re="Date must be in a number or a string type, the date number start from 1 to 31",te="Full date must be in string or array type",ne=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long",t=[],n=4;n<=10;n++){var o=new Date(Date.UTC(2021,3,n));t.push(new Intl.DateTimeFormat(e,{weekday:r}).format(o))}return t},oe=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);var t=[28,29,30,31],n=new Date(Date.UTC(Number(e),Number(r),0)).getUTCDate();return t.includes(n)?n:31},ae=function(e){if(!W(e))throw new Error(X);return Q(e)?366:365},ie=function(e,r){if(!$(e))throw new Error("Error in the first argument: "+te);if(!$(r))throw new Error("Error in the second argument: "+te);var t=new Date(e),n=new Date(r);return(Number(n.getTime())-Number(t.getTime()))/864e5},ue=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long",t=[],n=0;n<=11;n++){var o=Date.UTC(2021,n);t.push(new Intl.DateTimeFormat(e,{month:r}).format(new Date(o)))}return t},le=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"long";if(!$(e))throw new Error('You\'re entering the wrong date string, please use this statement "new Date(\'yourdateParam\').toString()" instead or array "[year, monthIndex, dateNumber]"');if(!V(r))throw new Error("Please enter the correct date format");var o,a=new Date(e),i=r,u=r,l={YY:function(){var e=a.getFullYear().toString().slice(-2),r=a.getFullYear();return"00"!==e&&(r=Number(e)),r},YYYY:a.getFullYear(),M:Number(a.getMonth())+1,MM:function(){var e=Number(Number(a.getMonth())+1).toString();return 1===e.length?"0"+e:e},m:ue(t,n)[a.getMonth()].slice(0,3),mm:ue(t,n)[a.getMonth()],D:a.getDate,DD:function(){var e=a.getDate().toString(),r=e;1===e.length&&(r="0"+e);return r},d:ne(t,n)[a.getDay()].slice(0,3),dd:ne(t,n)[a.getDay()],H:a.getHours(),HH:function(){var e=a.getHours().toString();return 1===e.length?"0"+e:e},h:function(){var e=Number(a.getHours()+1),r=e;return e>12&&(r=e-(e-1)),r},hh:function(){var e=Number(a.getHours()+1),r=e;e>12&&(r=e-(e-1));var t=r.toString();return 1===t.length?"0"+t:t},k:function(){return 0===Number(a.getHours())?24:a.getHours()},kk:function(){var e=Number(a.getHours()).toString();if(1===e.length){var r="0"+e;return 0===Number(r)?24:r}return 0===Number(e)?24:e},i:a.getMinutes(),ii:function(){var e=a.getMinutes().toString();return 1===e.length?"0"+e:e},s:a.getSeconds(),ss:function(){var e=a.getSeconds().toString();return 1===e.length?"0"+e:e},uuu:a.getMilliseconds(),A:a.getHours()<12?"AM":"PM",a:a.getHours()<12?"am":"pm",Do:a.getDate().toString()+"st"},f=i.split(/-|\/|\.|:|\s/),h=g(f);try{for(h.s();!(o=h.n()).done;){var c=o.value;"YY"===c?u=u.replace(c,l.YY()):"YYYY"===c?u=u.replace(c,l.YYYY):"M"===c?u=u.replace(c,l.M):"MM"===c?u=u.replace(c,l.MM()):"m"===c?u=u.replace(c,l.m):"mm"===c?u=u.replace(c,l.mm):"D"===c?u=u.replace(c,l.D):"DD"===c?u=u.replace(c,l.DD()):"d"===c?u=u.replace(c,l.d):"dd"===c?u=u.replace(c,l.dd):"H"===c?u=u.replace(c,l.H):"HH"===c?u=u.replace(c,l.HH()):"h"===c?u=u.replace(c,l.h()):"hh"===c?u=u.replace(c,l.hh()):"k"===c?u=u.replace(c,l.k()):"kk"===c?u=u.replace(c,l.kk()):"i"===c?u=u.replace(c,l.i):"ii"===c?u=u.replace(c,l.ii()):"s"===c?u=u.replace(c,l.s):"ss"===c?u=u.replace(c,l.ss()):"uuu"===c?u=u.replace(c,l.uuu):"A"===c?u=u.replace(c,l.A):"a"===c?u=u.replace(c,l.a):"Do"===c&&(u=u.replace(c,l.Do))}}catch(e){h.e(e)}finally{h.f()}return u},fe=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"long";if(!$(e))throw new Error("On the first argument, you have to input only the correct date");if(!V(r))throw new Error("For format date, you must always input the correct one by using characters like these: Y, M, m, D, d, H, h, k, i, S, s, A, a or Do");var o=e.split(/-|\/|\.|T|Z|:|\s/).filter((function(e){return e.length>=1&&" "!==e})).map((function(e){return e.trim()})),a=r.split(/-|\/|\.|T|Z|:|\s/).filter((function(e){return e.length>=1&&" "!==e})).map((function(e){return e.trim()})),i={year:(new Date).getFullYear(),month:Number((new Date).getMonth())+1,day:(new Date).getDate(),hour:(new Date).getHours(),minute:(new Date).getMinutes(),second:(new Date).getSeconds(),millisecond:(new Date).getMilliseconds()};if(o.length!==a.length)throw new Error("The numbers and the formats must be in place, so when we check the length of both of these arguments then the result will be the same");for(var u=0;u<o.length;u++)4===o[u].length&&!1===isNaN(o[u])&&"YYYY"===a[u]||2===o[u].length&&!1===isNaN(o[u])&&"YY"===a[u]?i.year=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"M"===a[u]||"MM"===a[u]?i.month=Number(o[u])-1:3===o[u].length&&ue(t,n).map((function(e){return e.slice(0,3)})).includes(o[u])&&"m"===a[u]?i.month=ue(t,n).map((function(e){return e.slice(0,3)})).findIndex(o[u]):o[u].length>=3&&ue(t,n).includes(o[u])&&"mm"===a[u]?i.month=ue(t,n).findIndex(o[u]):1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"D"===a[u]||"DD"===a[u]?i.day=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"H"===a[u]||"HH"===a[u]?i.hour=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"h"===a[u]||"hh"===a[u]?i.hour=o[u]>12?Number(o[u])-(Number(o[u])-1):o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"k"===a[u]||"kk"===a[u]?i.hour=24===Number(o[u])?0:o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"i"===a[u]||"ii"===a[u]?i.minute=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"s"===a[u]||"ss"===a[u]?i.second=o[u]:o[u].length>=3&&!1===isNaN(o[u])&&"uuu"===a[u]?i.millisecond=o[u]:("st"===o[u].slice(-2)||"nd"===o[u].slice(-2)||"th"===o[u].slice(-2)&&"Do"===a[u])&&(i.second=Number(o[u].slice(0,-2)));return new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond).toString()},he=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!$(e))throw new Error("Please enter a date in correct way, either in string or array type");if(!t(r))throw new Error("Only accept number type on second argument");var o=new Date(e),a=Number(o.getDate())+Number(r),i=Number(oe(Number(o.getFullYear()),o.getMonth()+1));if(a>i){var u=a-i;o=11===Number(o.getMonth())?new Date(Number(o.getFullYear())+1,0,u):new Date(Number(o.getFullYear()),Number(o.getMonth())+1,u)}else o=new Date(Number(o.getFullYear()),Number(o.getMonth()),a);var l=null!==n&&!1!==V(n)?le(o,n):o;return l},ce=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!$(n))throw new Error("Error in the first argument: "+te);if(!$(o))throw new Error("Error in the second argument: "+te);for(var n=new Date(e),o=new Date(r),a=[],i=n;i<=o;){var u=null!==t&&!1!==V(t)?le(i,t):i;a.push(u),i=he(i,1)}return a},se=function(e,r,t){if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!K(t))throw new Error(re);var n=ie(new Date(Number(e),0,1),new Date(Number(e),Number(r)-1,Number(t))),o=Number(new Date(e,0,1).getDay()),a=0;o>0&&(a=6-(o-1));var i=Number(new Date(Number(e),Number(r)-1,Number(t)).getDay()),u=0;return i<6&&(u=6-i),Math.ceil((Number(n)+u-a)/7)},me=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!W(e))throw new Error(X);if(!t(r))throw new Error("You have to enter a number");if(!V(n))throw new Error("Please enter a format of date correctly");var o=Number(new Date(Number(e),0,1).getDay()),a=0;o>0&&(a=6-(o-1));for(var i=[],u=a+1,l=0,f=e,h=1;h<=Number(r);h++){if(h===Number(r)){i.push(le(new Date(f,l,u),n));for(var c=0;c<6;)c++,i.push(le(he(new Date(f,l,u),c),n))}u+=7,l<12&&u>Number(oe(e,l+1))&&(u-=Number(oe(e,l+1)),11!==l?l+=1:(l=1,f+=1))}return i},ge=function(e,r){if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);for(var t=de(e,52,"M"),n=[],o=0,a=Object.entries(t);o<a.length;o++){var i=h(a[o],2),u=i[0];i[1].includes(r.toString())&&n.push(u)}return 1===Number(r)?n.filter((function(e){return"52"!==e})):n},de=function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!W(e))throw new Error(X);if(!t(r))throw new Error("You have to enter a number");if(!V(n))throw new Error("Please enter a format of date correctly");var o=Number(new Date(Number(e),0,1).getDay()),a=0;o>0&&(a=6-(o-1));for(var i={},u=a+1,l=0,f=e,h=1;h<=r;h++)i[h.toString()]=[le(new Date(f,l,u),n),le(he(new Date(f,l,u),6),n)],u+=7,l<12&&u>Number(oe(e,l+1))&&(u-=Number(oe(e,l+1)),11!==l?l+=1:(l=1,f+=1));return i},we=Object.freeze({__proto__:null,now:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=(new Date).toString();return"string"==typeof e&&(r=le(r,e)),r},nowHijri:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",r=Date.UTC(Number((new Date).getFullYear()),Number((new Date).getMonth()),Number((new Date).getDate()),Number((new Date).getHours()),Number((new Date).getMinutes()),Number((new Date).getSeconds()),Number((new Date).getMilliseconds())),t=new Intl.DateTimeFormat(e,{calendar:"islamic",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h24"}).format(new Date(r));return t},parse:fe,parseDate:fe,utc:function(){return new Date(Date.UTC.apply(Date,arguments))},addDate:he,subtractDate:function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!$(e))throw new Error("Please enter a date in correct way, either in string or array type");if(!t(r))throw new Error("Only accept number type on second argument");var o=new Date(e),a=Number(o.getDate())-Number(r),i=Number(oe(Number(o.getFullYear()),o.getMonth()));if(a<1){var u=i+(a-1);o=0===Number(o.getMonth())?new Date(Number(o.getFullYear())-1,0,u):new Date(Number(o.getFullYear()),Number(o.getMonth())+1,u)}else o=new Date(Number(o.getFullYear()),Number(o.getMonth()),a);var l=null!==n&&!1!==V(n)?le(o,n):o;return l},rangeDate:ce,day:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"en-US",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"long";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!K(t))throw new Error(re);var a=new Date(Date.UTC(Number(e),Number(r)-1,Number(t)));return new Intl.DateTimeFormat(n,{weekday:o}).format(a)},days:ne,daysInMonth:oe,daysInYear:ae,daysInBetween:ie,week:se,weeks:me,weeksInMonth:ge,weeksInYear:function(e){if(!W(e))throw new Error(X);var r=Number(new Date(Number(e),0,1).getDay()),t=0;r>0&&(t=6-(r-1));var n=Number(new Date(Number(e),11,31).getDay()),o=0;return n<6&&(o=6-n),Math.ceil((Number(ae(e))+o-t)/7)},month:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"long";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);var o=Date.UTC(e,Number(r)-1);return new Intl.DateTimeFormat(t,{month:n}).format(new Date(o))},months:ue,isYear:W,isMonth:J,isDate:K,isFullDate:$,isFormatDate:V,isLeapYear:Q,calendar:function(e,r){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YYYY-MM-DD",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"en-US";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!V(n))throw new Error("Please enter a format of date correctly");var a=ne(o),i=ce(new Date(e,Number(r)-1,1),new Date(e,Number(r)-1,oe(e,r)),n),u=Number(new Date(e,Number(r)-1,1).getDay()),l=[];if(u>0){var f=u-1;l=ce(new Date(e,Number(r)-2,Number(oe(e,Number(r)-1))-f),new Date(e,Number(r)-2,oe(e,Number(r)-1)),n)}var h=Number(new Date(e,Number(r)-1,oe(e,r)).getDay()),c=[];if(h<6){var s=6-(h+1);c=ce(new Date(e,Number(r),1),new Date(e,Number(r),1+s),n)}var m=[a,l,i,c];return!0===t?m.flat():m},daysInCalendar:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!V(t))throw new Error("Please enter a format of date correctly");return ce(new Date(e,Number(r)-1,1),new Date(e,Number(r)-1,oe(e,r)),t)},prevDaysInCalendar:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!V(t))throw new Error("Please enter a format of date correctly");var n=Number(new Date(e,Number(r)-1,1).getDay()),o=[];if(n>0){var a=n-1;o=ce(new Date(e,Number(r)-2,Number(oe(e,Number(r)-1))-a),new Date(e,Number(r)-2,oe(e,Number(r)-1)),t)}return o},nextDaysInCalendar:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!V(t))throw new Error("Please enter a format of date correctly");var n=Number(new Date(e,Number(r)-1,oe(e,r)).getDay()),o=[];if(n<6){var a=6-(n+1);o=ce(new Date(e,Number(r),1),new Date(e,Number(r),1+a),t)}return o},weeklyCalendar:function(e,r,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YYYY-MM-DD",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"en-US";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!K(t))throw new Error(re);if(!V(n))throw new Error("Please enter a format of date correctly");var a=ne(o),i=se(e,r,t),u=me(e,i,n);return U(a,u)[0]},calendarWithWeeks:function(e,r){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YYYY-MM-DD",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"en-US";if(!W(e))throw new Error(X);if(!J(r))throw new Error(ee);if(!V(n))throw new Error("Please enter a format of date correctly");var a=ne(o),i=ge(e,r),u=[];0!==Number(new Date(e,Number(r)-1,1).getDay())&&1===Number(r)&&(u.push("52"),u.push(me(Number(e)-1,52,n)));var l,f=g(i);try{for(f.s();!(l=f.n()).done;){var h=l.value;u.push(h),u.push(me(e,h,n))}}catch(e){f.e(e)}finally{f.f()}var c=["Week",a].concat(u);return!0===t?c.flat():c},dateToArray:function(e){if(!$(e))throw new Error("Please enter a valid date");return new Date(e).toJSON().replace("Z","").split(/-|:|\s|\.|T/g)}}),ve=Object.freeze({__proto__:null,size:function(e,r){if(0===e)return"0 Bytes";var t=r||1,n=Math.floor(Math.log(e)/Math.log(1e3));return parseFloat((e/Math.pow(1e3,n)).toFixed(t))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][n]},name:function(e){if("string"==typeof e)return e.indexOf("",41)>40?e.slice(0,41)+"...":e},type:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type",t=e.split("/");return"format"==r?t.shift():t.pop(),t.join("")},image:function(e){if("name"in e&&"string"==typeof e.name)return URL.createObjectURL(e)},date:function(e){return new Date(e).toDateString()},loadImage:function(e){"name"in e&&"string"==typeof e.name&&URL.revokeObjectURL(e)},formatSize:function(e){for(var r=0,t=e,n=t.length,o=0;o<n;o++)r+=t[o].size;for(var a=r+" bytes",i=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],u=0,l=r/1024;l>1;l/=1024,u++)a=l.toFixed(3)+" "+i[u]+" ("+r+" bytes)";return a},humanSize:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=r?1e3:1024;if(Math.abs(e)<n)return e+" B";var o=r?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],a=-1,i=Math.pow(10,t);do{e/=n,++a}while(Math.round(Math.abs(e)*i)/i>=n&&a<o.length-1);return e.toFixed(t)+" "+o[a]},exported:function(e,r){if("object"===i(e)&&"string"==typeof r){var t=Array.from(e),n="";if("json"===r.toLowerCase())n="data:application/json;charset=utf-8,"+JSON.stringify(t,null,2);else if("csv"===r.toLowerCase()){var o,a="",u=g(t);try{for(u.s();!(o=u.n()).done;){var l=o.value;for(var f in l)a+=l[f]+",";a=a.trim().substring(0,a.length-1),a+="\n"}}catch(e){u.e(e)}finally{u.f()}n="data:text/csv;charset=utf-8,"+(a=a.trim().substring(0,a.length-1))}else if("sql"===r.toLowerCase()){var h="INSERT INTO `export_table` (";for(var c in t[0])h+="`"+c+"`,";h=h.trim().substring(0,h.length-1),h+=") VALUES ";var s,m=g(t);try{for(m.s();!(s=m.n()).done;){var d=s.value;for(var w in h+="(",d)h+="`"+d[w]+"`,";h=h.trim().substring(0,h.length-1),h+="),"}}catch(e){m.e(e)}finally{m.f()}h=h.trim().substring(0,h.length-1),n="data:application/sql;charset=utf-8,"+(h+=";")}else if("xml"===r.toLowerCase()){var v='<?xml version="1.0" encoding="UTF-8"?>\n<data>';for(var y in t){for(var p in v+="\n <entry>",y)v+="\n <"+p+"`>"+y[p]+"</"+p+"`>";v+="\n </entry>"}n="data:application/xml;charset=utf-8,"+(v+="\n</data>")}else if("xhs"===r.toLowerCase()){var b,N='//visit official site: http://xhs.glitch.me \n("data", [',E=g(t);try{for(E.s();!(b=E.n()).done;){var D=b.value;for(var A in N+='\n ("entry", [',D)N+='\n ("'+A+'", ',N+=D[A]+"),";N=N.trim().substring(0,N.length-1),N+="]),"}}catch(e){E.e(e)}finally{E.f()}N=N.trim().substring(0,N.length-1),n="data:application/xhs;charset=utf-8,"+(N="])")}return n}},download:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"txt",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"export-to";if("string"==typeof e){var n=t+"."+r.toLowerCase(),o=encodeURI(e),a=document.createElement("a");a.href=o,a.download=n,document.body.appendChild(a),a.click(),document.body.removeChild(a)}},printed:function(e){if("object"===i(e)){var r=Array.from(e),t=document.createElement("table"),n=document.createElement("thead"),o=document.createElement("tbody");t.appendChild(n),t.appendChild(o);var a=document.createElement("tr");for(var u in r[0]){var l=document.createElement("th");l.textContent=u.replace(/^\w/,(function(e){return e.toUpperCase()})),a.appendChild(l)}n.appendChild(a);for(var f=0,h=r;f<h.length;f++){var c=h[f],s=document.createElement("tr");for(var m in c){var g=document.createElement("td");g.textContent=c[m],s.appendChild(g)}o.appendChild(s)}var d=window.open();d.document.body.appendChild(t),d.focus(),d.print()}}}),ye=function(e,r,t){var n;if(t){var o=new Date;o.setTime(o.getTime()+24*t*60*60*1e3),n="expires="+o.toGMTString()}else n="";document.cookie=e+"="+r+"; SameSite=Lax;"+n+"; path=/"},pe=function(e){for(var r=e+"=",t=document.cookie.split(";"),n=0;n<t.length;n++){for(var o=t[n];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(r))return o.substring(r.length,o.length)}return null},be=function(e){return"object"===("undefined"==typeof window?"undefined":i(window))&&"".concat(e,"Storage")in window},Ne=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"local";if(be(r))return!!window["".concat(r,"Storage")].getItem(e)},Ee=Object.freeze({__proto__:null,setCookie:ye,getCookie:pe,hasCookie:function(e){return!!pe(e)},removeCookie:function(e){ye(e,"",-1)},clearCookie:function(){for(var e=document.cookie.split(";"),r=0;r<e.length;r++){var t=e[r],n=t.indexOf("="),o=n>-1?t.substr(0,n):t;document.cookie=o+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"}},isStorage:be,isCookie:function(){return"object"===("undefined"==typeof document?"undefined":i(document))&&"cookie"in document},setStorage:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local";be(t)&&window["".concat(t,"Storage")].setItem(e,r)},getStorage:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"local";if(be(r))return window["".concat(r,"Storage")].getItem(e)},hasStorage:Ne,removeStorage:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"local";be(r)&&Ne(e,r)&&window["".concat(r,"Storage")].removeItem(e)},clearStorage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"local";be(e)&&window["".concat(e,"Storage")].clear()}}),De=Object.freeze({__proto__:null,ternary:function(e,r,t){if(!C(e)&&!C(r)&&!C(t))throw new Error("All arguments here only accept value in function");return e()?r():t()}});e.array=R,e.char=v,e.date=we,e.file=ve,e.func=De,e.int=r,e.number=w,e.object=Z,e.storage=Ee,e.string=y,Object.defineProperty(e,"__esModule",{value:!0})})); |
@@ -1,1 +0,1 @@ | ||
var r=Object.freeze({__proto__:null,random:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:255,e=Number(r)+1;return Math.floor(Math.random()*e)}}),e=function(r){return!isNaN(r)&&"number"==typeof Number(r)},t=function(r){if("number"!=typeof r&&"string"!=typeof r)throw new Error("You must input only number format here");return 1===Math.sign(r)},n=function(r){if("number"!=typeof r&&"string"!=typeof r)throw new Error("You must input only number format here");return-1===Math.sign(r)},o=function(r){return"string"==typeof r};function a(r){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function i(r,e,t){return e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function u(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 l(r){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?u(Object(t),!0).forEach((function(e){i(r,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(t,e))}))}return r}function f(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,a=void 0;try{for(var i,u=r[Symbol.iterator]();!(n=(i=u.next()).done)&&(t.push(i.value),!e||t.length!==e);n=!0);}catch(r){o=!0,a=r}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return t}(r,e)||c(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 h(r){return function(r){if(Array.isArray(r))return s(r)}(r)||function(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}(r)||c(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 c(r,e){if(r){if("string"==typeof r)return s(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)?s(r,e):void 0}}function s(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}function m(r,e){var t;if("undefined"==typeof Symbol||null==r[Symbol.iterator]){if(Array.isArray(r)||(t=c(r))||e&&r&&"number"==typeof r.length){t&&(r=t);var n=0,o=function(){};return{s:o,n:function(){return n>=r.length?{done:!0}:{done:!1,value:r[n++]}},e:function(r){throw r},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){t=r[Symbol.iterator]()},n:function(){var r=t.next();return i=r.done,r},e:function(r){u=!0,a=r},f:function(){try{i||null==t.return||t.return()}finally{if(u)throw a}}}}var g=function(r){return"object"===a(r)&&null!==r&&"[object Object]"===Object.prototype.toString.call(r)},w=Object.freeze({__proto__:null,random:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if("number"!=typeof r&&r<=0)throw new Error("You have to add a number at least 1");for(var e="",t="0123456789",n=0;n<r;n++)e+=t.charAt(Math.floor(Math.random()*t.length));return e},loop:function(r,e){if("number"!=typeof r&r<=-1)throw new Error("Only accept number here, start from 0");if("number"!=typeof e&e<=0)throw new Error("Only accept number here, start from 1");for(var t=[];r<=e;)t.push(r++);return t},isNumber:e,isPositive:t,isNegative:n,calc:function(r,t,n){if(!e(r))throw new Error("This is left operand and must be in number type");if(!e(t))throw new Error("This is left operand and must be in number type");if(!o(n))throw new Error("Operator must be one of these: add, subtract, multiply, divide, reminder or exponent");var a=0;return"add"===n||"addition"===n||"plus"===n||"+"===n?a=Number(r)+Number(t):"subtract"===n||"subtraction"===n||"minus"===n||"-"===n?a=Number(r)-Number(t):"multiply"===n||"multiplication"===n||"×"===n||"*"===n?a=Number(r)*Number(t):"divide"===n||"division"===n||"÷"===n||"/"===n?a=Number(r)/Number(t):"remainder"===n||"modulo"===n||"%"===n?a=Number(r)%Number(t):"exponent"!==n&&"exponentiation"!==n&&"**"!==n||(a=Math.pow(Number(r),Number(t))),a},currency:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!e(r))throw new Error("Amount must be in a number type");if(!o(t)&&3===t.length)throw new Error("Currency code must have at least 3 uppercase character");if(!o(n))throw new Error("Locale code must contain 2 languages and 2 country code and separated by dash (-)");if(!g(a))throw new Error("Currency options must be in object type");return new Intl.NumberFormat(n,l({style:"currency",currency:t.toUpperCase()},a)).format(r)}}),v=Object.freeze({__proto__:null,random:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:11,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long",t="",n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_~!@#$%^&*()+={}[]|:;<>,./?";"short"===e||"alphadash"===e?n=n.slice(0,64):"narrow"===e||"alphanumeric"===e?n=n.slice(0,62):"alpha"===e?n=n.slice(10,62):"hex"===e?n=n.slice(0,16):"number"!==e&&"numeric"!==e||(n=n.slice(0,10));for(var o=0;o<r;o++)t+=n.charAt(Math.floor(Math.random()*n.length));return t}}),d=Object.freeze({__proto__:null,split:function(r){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=[];return"string"==typeof r&&(e>=1&&n.push(r.slice(0,e)),null!==t?(n.push(r.slice(e,t)),n.push(r.slice(t))):n.push(r.slice(e))),n}},capitalize:function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"single";if("string"==typeof r){var t=r;return t="multiple"===e?t.toLowerCase().replace(/\w\S*/g,(function(r){return r.replace(/^\w/,(function(r){return r.toUpperCase()}))})):t.trimStart().replace(/^\w/,(function(r){return r.toUpperCase()}))}},includes:function(r,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return-1!==r.indexOf(e,t)},isString:o}),y=function(r){return!("object"!==a(r)||null===r||!Array.isArray(r))},p=function(r){if(!y(r))throw new Error("On the first argument must be in array type");for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("On the next arguments, you have to provide at least one argument");var o=Array.from(r);return o.unshift.apply(o,t),o},b=function(r){if(!y(r))throw new Error("On the first argument must be in array type");for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("On the next arguments, you have to provide at least one argument");var o=Array.from(r);return o.push.apply(o,t),o},N=function(r,t){if(!y(r))throw new Error("On the first argument, here only accept array type");if(!e(t))throw new Error("On the second argument, accept only numeric or number type");for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];if(o.length<1)throw new Error("On the next arguments, you have to enter at least one value");var i=Array.from(r),u=isNaN(t)?1:t;return i.splice.apply(i,[Number(u)-1,0].concat(o)),i},E=function(r,t){if(!y(r))throw new Error("On the first argument, here only accept array type");if(!e(t))throw new Error("On the second argument, accept only numeric or number type");for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];if(o.length<1)throw new Error("On the next arguments, you have to enter at least one value");var i=Array.from(r),u=isNaN(t)?0:t;return i.splice.apply(i,[Number(u)+1,0].concat(o)),i},D=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{key:"id",value:0};if(!y(r))throw new Error("You must enter the first argument in array only");var t=Array.from(r),n=-1;return"key"in e&&"value"in e?n=t.length>=1?t.findIndex((function(r){return r[e.key]===e.value})):-1:t.length>=1&&(n=t.findIndex((function(r){for(var t=0,n=Object.entries(e);t<n.length;t++){var o=f(n[t],2),a=o[0],i=o[1];if(a in r&&r[a]===i)return!0}}))),n},A=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dense";if(!y(r))throw new Error("You must enter the first argument in array only");return"sparse"===e?Object.keys(r).map((function(r){return Number(r)})):h(r.keys())},Y=function(r){if(!y(r))throw new Error("You must enter the argument in array only");var e=A(r);return Number(e[Math.floor(Math.random()*e.length)])},O=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(e){for(var n={},o=0,a=e;o<a.length;o++)for(var i=a[o],u=0,l=Object.entries(i);u<l.length;u++){var h=f(l[u],2),c=h[0],s=h[1];n[c]=s}return n}},S=function(r){if(!y(r))throw new Error("Please provide array that you want to remove its element");for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("On the last of argument, you have to enter at least one argument");for(var o=Array.from(r),i=[],u=function(){var r=f[l];if("string"==typeof r&&"first"===r)o=o.map((function(r,e){return 0===e?null:r})),i=o;else if("string"==typeof r&&"last"===r)o=o.map((function(r,e){return e===o.length-1?null:r})),i=o;else if("number"==typeof r)o=o.map((function(e,t){return t===r?null:e})),i=o;else if("object"===a(r)&&null!==r){var e=D(o,r);o=o.map((function(r,t){return t===e?null:r})),i=o}},l=0,f=t;l<f.length;l++)u();return i.filter((function(r){return null!==r}))},j=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!y(r))throw new Error("");var t=Array.from(r),n=[];if("string"==typeof e){var o,a=new Set,i=m(t);try{for(i.s();!(o=i.n()).done;){var u=o.value;a.has(u[e])||a.add(u[e])}}catch(r){i.e(r)}finally{i.f()}n=h(a)}else n=Array.from(new Set(t));return n},M=function(r){if(!g(r))throw new Error("This is object helper, you must provide the first argument in an object");for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("The next arguments must be in a string or in a number and at least one argument");for(var o={},a=new Set(t),i=0,u=Object.entries(r);i<u.length;i++){var l=f(u[i],1),h=l[0];a.has(r[h])||(o[h]=r[h])}return o},T=function(r,t){if(!y(r))throw new Error("The first argument must be in array of objects");if(!g(t))throw new Error("The second argument must be in object type and must have at least one property");for(var n=Array.from(r),a=function(){var r=f(u[i],2),t=r[0],a=r[1],l=n.filter((function(r){if(t in r){if(e(r[t])&&Number(r[t])===Number(a))return!0;if(o(r[t])&&r[t].toLowerCase().includes(a.toLowerCase()))return!0}return!1}));n=l},i=0,u=Object.entries(M(t,"",0));i<u.length;i++)a();return n},x=function(r){return"function"==typeof r},C=function(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";if(!y(r))throw new Error("Only array of objects accepted");if(!o(t))throw new Error("The second argument must be in a string and a value must be object property key or name");if(!o(n))throw new Error('The third argument must be in a string and a value either "", "asc" or "desc"');var a=Array.from(r);return"asc"===n?a.sort((function(r,n){if(t in r&&t in n){if(e(r[t])&&e(n[t]))return Number(r[t])-Number(n[t]);if(o(r[t])&&o(n[t])){var a=r[t].toLowerCase(),i=n[t].toLowerCase(),u=0;return a<i?u=-1:a>i&&(u=1),u}}})):"desc"===n&&a.sort((function(r,n){if(t in r&&t in n){if(e(r[t])&&e(n[t]))return Number(n[t])-Number(r[t]);if(o(r[t])&&o(n[t])){var a=r[t].toLowerCase(),i=n[t].toLowerCase(),u=0;return i<a?u=-1:i>a&&(u=1),u}}})),a},k=function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!y(r))throw new Error("On the first argument, here only accept array");if(!e(t))throw new Error("This is the page active number, please enter number only");if(!e(n))throw new Error("This is the limit of entries in one page in a number, please enter number only");var o=Array.from(r),a=Number(n)*Number(t)-(Number(n)-1),i=Number(n)*Number(t);return{from:a,to:i<=o.length?i:o.length,of:o.length}},B=function(r){if(!y(r))throw new Error("This argument only accept array");var e,t={},n=new Set,o=m(new Set(r));try{var a=function(){var o=e.value,a=Array.from(r).filter((function(r){return r===o}));n.has(a.length)||(n.add(a.length),t[a.length]=[]),a.forEach((function(r){t[a.length].push(r)}))};for(o.s();!(e=o.n()).done;)a()}catch(r){o.e(r)}finally{o.f()}return t},I=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(!e&&e.length<=1)throw new Error("You have to provide here at least 2 arguments");var n=[],o={};e.forEach((function(r,e){if(y(r)?o[e]=new Set(r):o[e]=(new Set).add(r),0!==e){var t,a=m(r);try{for(a.s();!(t=a.n()).done;){var i=t.value;o[e-1].has(i)&&n.push(i)}}catch(r){a.e(r)}finally{a.f()}}}));var a=B(n);return Array.from(new Set(a[e.length-1]))},_=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];if(!y(r)&&r.length<=0)throw new Error("You need to provide more values to your array");if(!t&&t.length<=0)throw new Error("You have to provide here at least 1 value");var o,a=[],i=m(r);try{for(i.s();!(o=i.n()).done;){var u=o.value;t.flat().includes(u)||a.push(u)}}catch(r){i.e(r)}finally{i.f()}return a},L=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(e.length<2&&!y(e[0])&&!y(e[1])&&Number(e[0].length)!==Number(e[1].length))throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var n=Array.from(e[0]).map((function(r){return[]})),o=0,a=e;o<a.length;o++){var i=a[o];i.forEach((function(r,e){e in n&&n[e].push(r)}))}return n},P=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(e.length<2)throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var n=Array.from(e),o=[],a=n.shift(),i=function(){var r=l[u],e=new Map;r.forEach((function(r,t){a[t]&&e.set(a[t],r)})),o.push(Object.fromEntries(e))},u=0,l=n;u<l.length;u++)i();return o},U=function(){if(0===arguments.length||arguments.length>=4)throw new Error("Here only accept 3 arguments, so you have to provide at least 1 argument");var r=1===arguments.length?0:Number(arguments.length<=0?void 0:arguments[0]),e=Number(arguments.length>=2?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0]),o=3===arguments.length?Number(arguments.length<=2?void 0:arguments[2]):1;arguments.length<3&&n(e)&&(o=-1);var a=[],i=0,u=0;if(n(r)&&t(e)?i=r-1:t(r)&&n(e)?i=r+1:t(r)&&t(e)?i=r-1:n(r)&&n(e)&&(i=r+1),i<e){for(;i<e;)i++,o>1?(u+=o)<e&&a.push(u):i<e&&a.push(i);0!==r||a.includes(0)||a.unshift(0)}else if(i>e){for(;i>e;)i--,o<-1?(u-=o)>e&&a.unshift(u):i>e&&a.unshift(i);0!==r||a.includes(0)||a.push(0)}return 1===a.length&&0===a[0]?[]:a},F=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(0===e.length)throw new Error("Accept index of array elements only and you add at least one index in number");return function(r){if(!y(r))throw new Error("Please enter array only here");for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if(0===n.length&&n.length!==e.length&&0!==I(e,n).length)throw new Error("Only accept index of array elements and the number of the first indexes must be the same as the second indexes and also, both indexes must be different");for(var a=Array.from(r),i=Array.from(r),u=0;u<e.length;u++)void 0!==e[u]&&void 0!==n[u]&&(i.splice(e[u],1,a[n[u]]),i.splice(n[u],1,a[e[u]]));return i}},H=function(r,e,t){if(!y(r))throw new Error("On the first argument, you have to provide array only");if(!o(e))throw new Error("New property must be in string type");if(!x(t))throw new Error("Callback must be in function or method");return Array.from(r).map((function(r){return r[e]=t.apply(void 0,h(Object.values(r).filter((function(r){return!1===isNaN(r)})))),r}))},z=Object.freeze({__proto__:null,insert:function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{position:null,index:null};if(!y(r))throw new Error("On the first argument, only array accept here");if(!g(e))throw new Error("On the second argument, only object with 2 properties (position and index property) accepted");for(var t=arguments.length,n=new Array(t>2?t-2:0),o=2;o<t;o++)n[o-2]=arguments[o];if(n.length<1)throw new Error("On the third or the next arguments, you have to enter at least one argument");var a=[];return"first"===e.position?a=p.apply(void 0,[r].concat(n)):"last"===e.position?a=b.apply(void 0,[r].concat(n)):"before"===e.position?a=N.apply(void 0,[r,e.index].concat(n)):"after"===e.position&&(a=E.apply(void 0,[r,e.index].concat(n))),a},insertFirst:p,insertLast:b,insertBefore:N,insertAfter:E,update:function(r,t,n){if(!y(r))throw new Error("You have to enter array only on the first argument");if(!g(t))throw new Error("You must enter object only here on the second argument");if(!g(n)&&!e(n))throw new Error("You must enter object only on the second argument");var o=Array.from(r),a=g(n)?D(o,n):Number(n);return o.map((function(r,e){var n=r;return e===a&&(n=O(r,t)),n}))},updateBy:function(r,e,t){if(!y(r))throw new Error("You have to enter array only on the first argument");if(!g(e))throw new Error("You must enter object only here on the second argument");if(!y(t))throw new Error("You must enter array of objects or numbers on the second argument");var n=Array.from(r);return n.map((function(r,o){var a,i=r,u=m(t);try{for(u.s();!(a=u.n()).done;){var l=a.value;o===(g(l)?D(n,l):Number(l))&&(i=O(r,e))}}catch(r){u.e(r)}finally{u.f()}return i}))},destroy:S,select: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];if(!y(r))throw new Error("On the first argument, you have to provide array only");if(t.length<1)throw new Error("On the second argument, you must enter at least one value");var o=Array.from(r);return o.map((function(r){var e,n={},o=m(t);try{for(o.s();!(e=o.n()).done;){var a=e.value;a in r&&(n[a]=r[a])}}catch(r){o.e(r)}finally{o.f()}return n}))},hidden: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];if(!y(r))throw new Error("On the first argument, you have to provide array only");if(t.length<1)throw new Error("On the second argument, you must enter at least one value");var o=Array.from(r);return o.map((function(r){var e,n=r,o=m(t);try{for(o.s();!(e=o.n()).done;){var a=e.value;a in r&&delete n[a]}}catch(r){o.e(r)}finally{o.f()}return n}))},toggle:function(r){return function(e){var t=Array.from(e);if(t.includes(r)){var n=t.findIndex((function(e){return e===r}));t.splice(n,1)}else t.push(r);return t}},flatten:function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=[],n={};n.id=e.id||"id",n.parent=e.parent||"parent",n.children=e.children||"children";var o=function(){Array.from(r).forEach((function(r){if("object"===a(r)&&null!==r){var e=r;e[n.parent]="0","object"===a(e[n.children])&&Array.isArray(e[n.children])&&(i(e[n.children],r),delete e[n.children]),t.push(e)}}))},i=function r(e,o){e.length>=1&&Array.from(e).forEach((function(e){if("object"===a(e)&&null!==e){var i=e;i[n.parent]=o[n.id],"object"===a(i[n.children])&&Array.isArray(i[n.children])&&(r(i[n.children],e),delete i[n.children]),t.push(i)}}))};return o(),t},nested:function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=[],n=Array.from(r),o={};o.id=e.id||"id",o.parent=e.parent||"parent",o.children=e.children||"children";var i=function(r){r.forEach((function(r){if("object"===a(r)&&null!==r){var e=null;("string"==typeof r[o.parent]&&"0"===r[o.parent]||"number"==typeof r[o.parent]&&0===r[o.parent])&&(e=u(r)),null!==e&&t.push(e)}}))},u=function(r){var e=r;return void 0!==r[o.children]&&null!==r[o.children]||(e[o.children]=l(r[o.id]),e[o.children].length<=0&&delete e[o.children]),delete e[o.parent],e},l=function(r){var e=[];return f(r).length>=1&&f(r).forEach((function(r){e.push(u(r))})),e},f=function(r){return n.filter((function(e){return e.parent===r}))};return i(n),t},index:D,toIndex:A,randomIndex:Y,search:function(r){if(!y)throw new Error("The first argument must be in array");for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];if(n.length<1)throw new Error("On the next arguments, you must provide at least one argument in either string or number");for(var i=[],u=function(){var t=h[l],n=Array.from(r).filter((function(r){if(e(r)&&Number(r)===Number(t))return!0;if(o(r)&&r.toLowerCase().includes(t.toLowerCase()))return!0;if(g(r))for(var n=0,a=Object.entries(r);n<a.length;n++){var i=f(a[n],2),u=i[0],l=i[1];if(e(r[u])&&Number(l)===Number(t))return!0;if(o(r[u])&&l.toLowerCase().includes(t.toLowerCase()))return!0}return!1}));i=j(i.concat(n))},l=0,h=n;l<h.length;l++)u();return i},searchBy:function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];if(t.length<1)throw new Error("This argument must have at least one argument in either string or number");return function(r){for(var n=arguments.length,a=new Array(n>1?n-1:0),i=1;i<n;i++)a[i-1]=arguments[i];if(!y(r))throw new Error("Array of objects is needed in order to be searched");if(a.length<1)throw new Error("The last argument required at least one argument in either string or number");var u,l=[],f=m(t);try{var h=function(){var t=u.value,n=Array.from(r).filter((function(r){for(var n=0,i=Array.from(a);n<i.length;n++){var u=i[n];if(u in r){if(e(r[u])&&Number(r[u])===Number(t))return!0;if(o(r[u])&&-1!==r[u].toLowerCase().indexOf(t.toLowerCase()))return!0}}return!1}));l=j(l.concat(n))};for(f.s();!(u=f.n()).done;)h()}catch(r){f.e(r)}finally{f.f()}return l}},filter:T,filtered:T,sort:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc";if(!y(r))throw new Error("Only array of strings or numbers accepted");if(!o(t))throw new Error('The second argument must be in a string and a value either "", "asc" or "desc"');var n=Array.from(r);return"asc"===t?n.sort((function(r,t){if(e(r)&&e(t))return Number(r)-Number(t);if(o(r)&&o(t)){var n=r.toLowerCase(),a=t.toLowerCase(),i=0;return n<a?i=-1:n>a&&(i=1),i}})):"desc"===t&&n.sort((function(r,t){if(e(r)&&e(t))return Number(t)-Number(r);if(o(r)&&o(t)){var n=r.toLowerCase(),a=t.toLowerCase(),i=0;return a<n?i=-1:a>n&&(i=1),i}})),n},sortBy:C,sorted:C,sortWith:function(r,e){if(!y(r))throw new Error("The first argument must be in an array type");if(!x(e))throw new Error("The second argument is a compare or callback function");var t=Array.from(r);return t.sort((function(r,t){return-1===Math.sign(e(r,t))?-1:1})),t},paginate:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!y(r))throw new Error("On the first argument, here only accept array");if(!e(t))throw new Error("This is the page active number, please enter number only");if(!e(n))throw new Error("This is the limit of entries in one page in a number, please enter number only");var o=Array.from(r),a=Number(n)*Number(t)-(Number(n)-1),i=Number(n)*Number(t);return o.slice(a-1,i<=o.length?i:o.length)},pages:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if(!y(r))throw new Error("On the first argument, here only accept array");if(!e(t))throw new Error("This is the limit of entries in one page in a number, please enter number only");var n=Array.from(r),o=n.length/Number(t),a=Math.ceil(o);return a},pageInfo:k,show:k,pagination:function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!e(r))throw new Error("This is the total or all pages in numbers, please enter number only");if(!e(t))throw new Error("This is the page active number, please enter number only");if(!e(n))throw new Error("This is the position of ellipsis [...], please enter number only");var o=[],a=Number(r)<Number(t)?Number(r):Number(t),i=Number(t)<1?1:Number(t),u=a+Number(n),l=i-Number(n);if(0===Number(n))for(var f=1;f<=Number(r);f++)o.push(f);else{if(i>1)for(var h=l;h<i;h++)o.push(h);for(var c=a;c<=u;c++)o.push(c)}var s=o.filter((function(r){return r>0})),m=s.filter((function(e){return e<=Number(r)}));return u<Number(r)&&0!==Number(n)&&m.push("..."),l>1&&0!==Number(n)&&m.unshift("..."),m},sum:function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!y(r))throw new Error("In the first argument, you must enter a data in array");var t=Array.from(r),n=0;if(t.length>=1)if("string"==typeof e&&""!==e){var o=t.map((function(r){return e in r?Number(r[e]):0}));n=o.reduce((function(r,e){return Number(r)+Number(e)}))}else n=t.reduce((function(r,e){return Number(r)+Number(e)}));return n},calculate:H,calc:H,unique:j,isArray:y,isSuperset:function(r,e){if(!y(r)&&!y(e))throw new Error("The both of arguments must be in arrays");var t,n=new Set(r),o=m(e);try{for(o.s();!(t=o.n()).done;){var a=t.value;if(!n.has(a))return!1}}catch(r){o.e(r)}finally{o.f()}return!0},union:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];return Array.from(new Set(e.flat()))},intersection:I,difference:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(!e&&e.length<=1)throw new Error("You have to provide here at least 2 arguments");var n=new Set,o=I.apply(void 0,e);return e.forEach((function(r){if(!y(r))throw new Error("Here only accept arrays from all arguments");var e,t=m(r);try{for(t.s();!(e=t.n()).done;){var a=e.value;o.includes(a)||n.has(a)||n.add(a)}}catch(r){t.e(r)}finally{t.f()}})),Array.from(n)},asymmetricDifference:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(!e&&e.length<=1)throw new Error("You have to provide here at least 2 arguments");for(var n=new Set,o=[],a=0,i=e;a<i.length;a++){var u=i[a];if(!y(u))throw new Error("Here only accept arrays from all arguments");u.forEach((function(r){n.has(r)?(n.delete(r),o.push(r)):o.includes(r)||n.add(r)}))}return Array.from(n)},complement:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(!e&&e.length<=1)throw new Error("You have to provide here at least 1 value");var n=Array.from(e);n.shift();var o=new Set(_.apply(void 0,[e[0]].concat(h(n))));return Array.from(o)},without:_,transpose:L,zip:P,unzip:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(e.length<2)throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var n=Array.from(e),o=Object.keys(n[0]),a={},i=0,u=o;i<u.length;i++){var l=u[i];a[l]=[]}for(var f=0,c=n;f<c.length;f++){var s=c[f];for(var m in s)a[m].push(s[m])}return[o].concat(h(L.apply(void 0,h(Object.values(a)))))},range:U,move:function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Only accept index of array elements and you must input at least one index in number type");return function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!y(r))throw new Error("Please enter array only here");if(!e(n))throw new Error("Input only index number here");var a,i=Array.from(r),u=[],l=m(t);try{for(l.s();!(a=l.n()).done;){var f=a.value;void 0!==i[Number(f)]&&u.push(i[Number(f)])}}catch(r){l.e(r)}finally{l.f()}var h=S.apply(void 0,[i].concat(t));return h.splice.apply(h,[n,o].concat(u)),h}},switched:F,transfer:function(){for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Only accept index of array elements and you must enter at least one index in number type");return function(r,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!y(r))throw new Error("Accept array only here");if(!y(n))throw new Error("Accept array only here");if(!e(o))throw new Error("Input only index number here");var a,i=Array.from(r),u=Array.from(n),l=[],f=m(t);try{for(f.s();!(a=f.n()).done;){var h=a.value;void 0!==i[Number(h)]&&l.push(i[Number(h)])}}catch(r){f.e(r)}finally{f.f()}var c=null===o?Number(u.length):o;u.splice.apply(u,[c,0].concat(l));var s=S.apply(void 0,[i].concat(t));return{from:s,to:u}}},compact:function(r){if(!y(r))throw new Error("Enter only array type here");return Array.from(r).filter((function(r){return null!=r&&!1!==r&&!isNaN(r)&&""!==r&&r>0}))},chunk:function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!y(r)&&r.length<=2)throw new Error("Please insert array only on the first argument and must have 3 values at least");if("number"!=typeof e)throw new Error("On the second argument, you must input in a number type only");var t,n=U(e,r.length,e),o=[],a=m(n);try{for(a.s();!(t=a.n()).done;){var i=t.value,u=r.slice(Number(i)-Number(e),i);o.push(u)}}catch(r){a.e(r)}finally{a.f()}return n[Number(n.length)-1]<=r.length&&o.push(r.slice(n[Number(n.length)-1],r.length)),o},shuffle:function(r){if(!y(r)&&r.length<=2)throw new Error("This shuffle method only work on data in array type");for(var e=Array.from(r),t=Number(e.length)-1;t>2;t--){var n=e.slice(0,Number(t)+1);e=F(t)(e,Y(n))}return e},group:function(r,e){if(!y(r))throw new Error("You must enter array literal here");if(!x(e))throw new Error("You have to enter a function or callback on the second argument");var t,n={},o=m(r);try{for(o.s();!(t=o.n()).done;){var a=t.value;void 0===n[e(a).toString()]&&(n[e(a).toString()]=[]),n[e(a).toString()].push(a)}}catch(r){o.e(r)}finally{o.f()}return n},countDuplication:B,countBy:function(r,e){if(!y(r))throw new Error("The first paramenter only accept array");if(!x(e))throw new Error("The second paramenter only accept callback function");return r.filter((function(r){return e(r)})).length}}),$=Object.freeze({__proto__:null,remove:function(r){if(!g(r))throw new Error("This is object helper, you must provide the first argument in an object");for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("The next arguments must be in a string and at least one argument");for(var o=Object.assign({},r),a=0,i=t;a<i.length;a++){var u=i[a];u in o&&delete o[u]}return o},removeBy:M,merge:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(e){for(var n={},o=new Map,a=0,i=e;a<i.length;a++)for(var u=i[a],l=0,h=Object.entries(u);l<h.length;l++){var c=f(h[l],2),s=c[0],m=c[1];o.has(s)||(o.set(s,m),n[s]=m)}return n}},replace:O,isObject:g,isObjectValues:function(r){return!!Object.values(r).filter((function(r){return""!==r&&0!==r&&r!=={}&&r!==[]})).join("")},invert:function(r){if(!g(r))throw new Error("You have to input object only here");var e=Object.keys(r),t=Object.values(r);return P(t,e)[0]},clone:function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(e.length<1)throw new Error("In this argument must have at least one argument and please provide it in object type");return Object.assign.apply(Object,[{}].concat(e))}}),R=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Z=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|T|H{1,2}|h{1,2}|a|A|i{1,2}|s{1,2}|Z{1,2}|SSS/g,G=function(r){return"number"==typeof r||"string"==typeof r},q=function(r){return"number"==typeof r||"string"==typeof r},W=function(r){return"number"==typeof r||"string"==typeof r},J=function(r){return!!("object"===a(new Date(r))&&null!==r||"string"==typeof r&&new RegExp(R).test(r))},K=function(r){return!("string"!=typeof r||!new RegExp(Z).test(r))},V=function(r){return r%400==0||r%100!=0&&r%4==0},Q="Year must be in a number or a string type, the length of year either 4 or 2",X="Month must be in a number or a string type, the month number start from 1 to 12",rr="Date must be in a number or a string type, the date number start from 1 to 31",er="Full date must be in string or array type",tr=function(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long",t=[],n=4;n<=10;n++){var o=new Date(Date.UTC(2021,3,n));t.push(new Intl.DateTimeFormat(r,{weekday:e}).format(o))}return t},nr=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!G(r))throw new Error(Q);if(!q(e))throw new Error(X);var t=[28,29,30,31],n=new Date(Date.UTC(Number(r),Number(e),0)).getUTCDate();return t.includes(n)?n:31},or=function(r){if(!G(r))throw new Error(Q);return V(r)?366:365},ar=function(r,e){if(!J(r))throw new Error("Error in the first argument: "+er);if(!J(e))throw new Error("Error in the second argument: "+er);var t=new Date(r),n=new Date(e);return(Number(n.getTime())-Number(t.getTime()))/864e5},ir=function(){for(var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long",t=[],n=0;n<=11;n++){var o=Date.UTC(2021,n);t.push(new Intl.DateTimeFormat(r,{month:e}).format(new Date(o)))}return t},ur=function(r,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"long";if(!J(r))throw new Error('You\'re entering the wrong date string, please use this statement "new Date(\'yourdateParam\').toString()" instead or array "[year, monthIndex, dateNumber]"');if(!K(e))throw new Error("Please enter the correct date format");var o,a=new Date(r),i=e,u=e,l={YY:function(){var r=a.getFullYear().toString().slice(-2),e=a.getFullYear();return"00"!==r&&(e=Number(r)),e},YYYY:a.getFullYear(),M:Number(a.getMonth())+1,MM:function(){var r=Number(Number(a.getMonth())+1).toString();return 1===r.length?"0"+r:r},m:ir(t,n)[a.getMonth()].slice(0,3),mm:ir(t,n)[a.getMonth()],D:a.getDate,DD:function(){var r=a.getDate().toString(),e=r;1===r.length&&(e="0"+r);return e},d:tr(t,n)[a.getDay()].slice(0,3),dd:tr(t,n)[a.getDay()],H:a.getHours(),HH:function(){var r=a.getHours().toString();return 1===r.length?"0"+r:r},h:function(){var r=Number(a.getHours()+1),e=r;return r>12&&(e=r-(r-1)),e},hh:function(){var r=Number(a.getHours()+1),e=r;r>12&&(e=r-(r-1));var t=e.toString();return 1===t.length?"0"+t:t},k:function(){return 0===Number(a.getHours())?24:a.getHours()},kk:function(){var r=Number(a.getHours()).toString();if(1===r.length){var e="0"+r;return 0===Number(e)?24:e}return 0===Number(r)?24:r},i:a.getMinutes(),ii:function(){var r=a.getMinutes().toString();return 1===r.length?"0"+r:r},s:a.getSeconds(),ss:function(){var r=a.getSeconds().toString();return 1===r.length?"0"+r:r},uuu:a.getMilliseconds(),A:a.getHours()<12?"AM":"PM",a:a.getHours()<12?"am":"pm",Do:a.getDate().toString()+"st"},f=i.split(/-|\/|\.|:|\s/),h=m(f);try{for(h.s();!(o=h.n()).done;){var c=o.value;"YY"===c?u=u.replace(c,l.YY()):"YYYY"===c?u=u.replace(c,l.YYYY):"M"===c?u=u.replace(c,l.M):"MM"===c?u=u.replace(c,l.MM()):"m"===c?u=u.replace(c,l.m):"mm"===c?u=u.replace(c,l.mm):"D"===c?u=u.replace(c,l.D):"DD"===c?u=u.replace(c,l.DD()):"d"===c?u=u.replace(c,l.d):"dd"===c?u=u.replace(c,l.dd):"H"===c?u=u.replace(c,l.H):"HH"===c?u=u.replace(c,l.HH()):"h"===c?u=u.replace(c,l.h()):"hh"===c?u=u.replace(c,l.hh()):"k"===c?u=u.replace(c,l.k()):"kk"===c?u=u.replace(c,l.kk()):"i"===c?u=u.replace(c,l.i):"ii"===c?u=u.replace(c,l.ii()):"s"===c?u=u.replace(c,l.s):"ss"===c?u=u.replace(c,l.ss()):"uuu"===c?u=u.replace(c,l.uuu):"A"===c?u=u.replace(c,l.A):"a"===c?u=u.replace(c,l.a):"Do"===c&&(u=u.replace(c,l.Do))}}catch(r){h.e(r)}finally{h.f()}return u},lr=function(r,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"long";if(!J(r))throw new Error("On the first argument, you have to input only the correct date");if(!K(e))throw new Error("For format date, you must always input the correct one by using characters like these: Y, M, m, D, d, H, h, k, i, S, s, A, a or Do");var o=r.split(/-|\/|\.|T|Z|:|\s/).filter((function(r){return r.length>=1&&" "!==r})).map((function(r){return r.trim()})),a=e.split(/-|\/|\.|T|Z|:|\s/).filter((function(r){return r.length>=1&&" "!==r})).map((function(r){return r.trim()})),i={year:(new Date).getFullYear(),month:Number((new Date).getMonth())+1,day:(new Date).getDate(),hour:(new Date).getHours(),minute:(new Date).getMinutes(),second:(new Date).getSeconds(),millisecond:(new Date).getMilliseconds()};if(o.length!==a.length)throw new Error("The numbers and the formats must be in place, so when we check the length of both of these arguments then the result will be the same");for(var u=0;u<o.length;u++)4===o[u].length&&!1===isNaN(o[u])&&"YYYY"===a[u]||2===o[u].length&&!1===isNaN(o[u])&&"YY"===a[u]?i.year=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"M"===a[u]||"MM"===a[u]?i.month=Number(o[u])-1:3===o[u].length&&ir(t,n).map((function(r){return r.slice(0,3)})).includes(o[u])&&"m"===a[u]?i.month=ir(t,n).map((function(r){return r.slice(0,3)})).findIndex(o[u]):o[u].length>=3&&ir(t,n).includes(o[u])&&"mm"===a[u]?i.month=ir(t,n).findIndex(o[u]):1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"D"===a[u]||"DD"===a[u]?i.day=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"H"===a[u]||"HH"===a[u]?i.hour=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"h"===a[u]||"hh"===a[u]?i.hour=o[u]>12?Number(o[u])-(Number(o[u])-1):o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"k"===a[u]||"kk"===a[u]?i.hour=24===Number(o[u])?0:o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"i"===a[u]||"ii"===a[u]?i.minute=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"s"===a[u]||"ss"===a[u]?i.second=o[u]:o[u].length>=3&&!1===isNaN(o[u])&&"uuu"===a[u]?i.millisecond=o[u]:("st"===o[u].slice(-2)||"nd"===o[u].slice(-2)||"th"===o[u].slice(-2)&&"Do"===a[u])&&(i.second=Number(o[u].slice(0,-2)));return new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond).toString()},fr=function(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!J(r))throw new Error("Please enter a date in correct way, either in string or array type");if(!e(t))throw new Error("Only accept number type on second argument");var o=new Date(r),a=Number(o.getDate())+Number(t),i=Number(nr(Number(o.getFullYear()),o.getMonth()+1));if(a>i){var u=a-i;o=11===Number(o.getMonth())?new Date(Number(o.getFullYear())+1,0,u):new Date(Number(o.getFullYear()),Number(o.getMonth())+1,u)}else o=new Date(Number(o.getFullYear()),Number(o.getMonth()),a);var l=null!==n&&!1!==K(n)?ur(o,n):o;return l},hr=function(r,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!J(n))throw new Error("Error in the first argument: "+er);if(!J(o))throw new Error("Error in the second argument: "+er);for(var n=new Date(r),o=new Date(e),a=[],i=n;i<=o;){var u=null!==t&&!1!==K(t)?ur(i,t):i;a.push(u),i=fr(i,1)}return a},cr=function(r,e,t){if(!G(r))throw new Error(Q);if(!q(e))throw new Error(X);if(!W(t))throw new Error(rr);var n=ar(new Date(Number(r),0,1),new Date(Number(r),Number(e)-1,Number(t))),o=Number(new Date(r,0,1).getDay()),a=0;o>0&&(a=6-(o-1));var i=Number(new Date(Number(r),Number(e)-1,Number(t)).getDay()),u=0;return i<6&&(u=6-i),Math.ceil((Number(n)+u-a)/7)},sr=function(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!G(r))throw new Error(Q);if(!e(t))throw new Error("You have to enter a number");if(!K(n))throw new Error("Please enter a format of date correctly");var o=Number(new Date(Number(r),0,1).getDay()),a=0;o>0&&(a=6-(o-1));for(var i=[],u=a+1,l=0,f=r,h=1;h<=Number(t);h++){if(h===Number(t)){i.push(ur(new Date(f,l,u),n));for(var c=0;c<6;)c++,i.push(ur(fr(new Date(f,l,u),c),n))}u+=7,l<12&&u>Number(nr(r,l+1))&&(u-=Number(nr(r,l+1)),11!==l?l+=1:(l=1,f+=1))}return i},mr=function(r,e){if(!G(r))throw new Error(Q);if(!q(e))throw new Error(X);for(var t=gr(r,52,"M"),n=[],o=0,a=Object.entries(t);o<a.length;o++){var i=f(a[o],2),u=i[0];i[1].includes(e.toString())&&n.push(u)}return 1===Number(e)?n.filter((function(r){return"52"!==r})):n},gr=function(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!G(r))throw new Error(Q);if(!e(t))throw new Error("You have to enter a number");if(!K(n))throw new Error("Please enter a format of date correctly");var o=Number(new Date(Number(r),0,1).getDay()),a=0;o>0&&(a=6-(o-1));for(var i={},u=a+1,l=0,f=r,h=1;h<=t;h++)i[h.toString()]=[ur(new Date(f,l,u),n),ur(fr(new Date(f,l,u),6),n)],u+=7,l<12&&u>Number(nr(r,l+1))&&(u-=Number(nr(r,l+1)),11!==l?l+=1:(l=1,f+=1));return i},wr=Object.freeze({__proto__:null,now:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,e=(new Date).toString();return"string"==typeof r&&(e=ur(e,r)),e},nowHijri:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",e=Date.UTC(Number((new Date).getFullYear()),Number((new Date).getMonth()),Number((new Date).getDate()),Number((new Date).getHours()),Number((new Date).getMinutes()),Number((new Date).getSeconds()),Number((new Date).getMilliseconds())),t=new Intl.DateTimeFormat(r,{calendar:"islamic",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h24"}).format(new Date(e));return t},parse:lr,parseDate:lr,utc:function(){return new Date(Date.UTC.apply(Date,arguments))},addDate:fr,subtractDate:function(r,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!J(r))throw new Error("Please enter a date in correct way, either in string or array type");if(!e(t))throw new Error("Only accept number type on second argument");var o=new Date(r),a=Number(o.getDate())-Number(t),i=Number(nr(Number(o.getFullYear()),o.getMonth()));if(a<1){var u=i+(a-1);o=0===Number(o.getMonth())?new Date(Number(o.getFullYear())-1,0,u):new Date(Number(o.getFullYear()),Number(o.getMonth())+1,u)}else o=new Date(Number(o.getFullYear()),Number(o.getMonth()),a);var l=null!==n&&!1!==K(n)?ur(o,n):o;return l},rangeDate:hr,day:function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"en-US",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"long";if(!G(r))throw new Error(Q);if(!q(e))throw new Error(X);if(!W(t))throw new Error(rr);var a=new Date(Date.UTC(Number(r),Number(e)-1,Number(t)));return new Intl.DateTimeFormat(n,{weekday:o}).format(a)},days:tr,daysInMonth:nr,daysInYear:or,daysInBetween:ar,week:cr,weeks:sr,weeksInMonth:mr,weeksInYear:function(r){if(!G(r))throw new Error(Q);var e=Number(new Date(Number(r),0,1).getDay()),t=0;e>0&&(t=6-(e-1));var n=Number(new Date(Number(r),11,31).getDay()),o=0;return n<6&&(o=6-n),Math.ceil((Number(or(r))+o-t)/7)},month:function(r,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"long";if(!G(r))throw new Error(Q);if(!q(e))throw new Error(X);var o=Date.UTC(r,Number(e)-1);return new Intl.DateTimeFormat(t,{month:n}).format(new Date(o))},months:ir,isYear:G,isMonth:q,isDate:W,isFullDate:J,isFormatDate:K,isLeapYear:V,calendar:function(r,e){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YYYY-MM-DD",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"en-US";if(!G(r))throw new Error(Q);if(!q(e))throw new Error(X);if(!K(n))throw new Error("Please enter a format of date correctly");var a=tr(o),i=hr(new Date(r,Number(e)-1,1),new Date(r,Number(e)-1,nr(r,e)),n),u=Number(new Date(r,Number(e)-1,1).getDay()),l=[];if(u>0){var f=u-1;l=hr(new Date(r,Number(e)-2,Number(nr(r,Number(e)-1))-f),new Date(r,Number(e)-2,nr(r,Number(e)-1)),n)}var h=Number(new Date(r,Number(e)-1,nr(r,e)).getDay()),c=[];if(h<6){var s=6-(h+1);c=hr(new Date(r,Number(e),1),new Date(r,Number(e),1+s),n)}var m=[a,l,i,c];return!0===t?m.flat():m},daysInCalendar:function(r,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!G(r))throw new Error(Q);if(!q(e))throw new Error(X);if(!K(t))throw new Error("Please enter a format of date correctly");return hr(new Date(r,Number(e)-1,1),new Date(r,Number(e)-1,nr(r,e)),t)},prevDaysInCalendar:function(r,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!G(r))throw new Error(Q);if(!q(e))throw new Error(X);if(!K(t))throw new Error("Please enter a format of date correctly");var n=Number(new Date(r,Number(e)-1,1).getDay()),o=[];if(n>0){var a=n-1;o=hr(new Date(r,Number(e)-2,Number(nr(r,Number(e)-1))-a),new Date(r,Number(e)-2,nr(r,Number(e)-1)),t)}return o},nextDaysInCalendar:function(r,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!G(r))throw new Error(Q);if(!q(e))throw new Error(X);if(!K(t))throw new Error("Please enter a format of date correctly");var n=Number(new Date(r,Number(e)-1,nr(r,e)).getDay()),o=[];if(n<6){var a=6-(n+1);o=hr(new Date(r,Number(e),1),new Date(r,Number(e),1+a),t)}return o},weeklyCalendar:function(r,e,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YYYY-MM-DD",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"en-US";if(!G(r))throw new Error(Q);if(!q(e))throw new Error(X);if(!W(t))throw new Error(rr);if(!K(n))throw new Error("Please enter a format of date correctly");var a=tr(o),i=cr(r,e,t),u=sr(r,i,n);return P(a,u)[0]},calendarWithWeeks:function(r,e){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YYYY-MM-DD",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"en-US";if(!G(r))throw new Error(Q);if(!q(e))throw new Error(X);if(!K(n))throw new Error("Please enter a format of date correctly");var a=tr(o),i=mr(r,e),u=[];0!==Number(new Date(r,Number(e)-1,1).getDay())&&1===Number(e)&&(u.push("52"),u.push(sr(Number(r)-1,52,n)));var l,f=m(i);try{for(f.s();!(l=f.n()).done;){var h=l.value;u.push(h),u.push(sr(r,h,n))}}catch(r){f.e(r)}finally{f.f()}var c=["Week",a].concat(u);return!0===t?c.flat():c},dateToArray:function(r){if(!J(r))throw new Error("Please enter a valid date");return new Date(r).toJSON().replace("Z","").split(/-|:|\s|\.|T/g)}}),vr=Object.freeze({__proto__:null,size:function(r,e){if(0===r)return"0 Bytes";var t=e||1,n=Math.floor(Math.log(r)/Math.log(1e3));return parseFloat((r/Math.pow(1e3,n)).toFixed(t))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][n]},name:function(r){if("string"==typeof r)return r.indexOf("",41)>40?r.slice(0,41)+"...":r},type:function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type",t=r.split("/");return"format"==e?t.shift():t.pop(),t.join("")},image:function(r){if("name"in r&&"string"==typeof r.name)return URL.createObjectURL(r)},date:function(r){return new Date(r).toDateString()},loadImage:function(r){"name"in r&&"string"==typeof r.name&&URL.revokeObjectURL(r)},formatSize:function(r){for(var e=0,t=r,n=t.length,o=0;o<n;o++)e+=t[o].size;for(var a=e+" bytes",i=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],u=0,l=e/1024;l>1;l/=1024,u++)a=l.toFixed(3)+" "+i[u]+" ("+e+" bytes)";return a},humanSize:function(r){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=e?1e3:1024;if(Math.abs(r)<n)return r+" B";var o=e?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],a=-1,i=Math.pow(10,t);do{r/=n,++a}while(Math.round(Math.abs(r)*i)/i>=n&&a<o.length-1);return r.toFixed(t)+" "+o[a]},exported:function(r,e){if("object"===a(r)&&"string"==typeof e){var t=Array.from(r),n="";if("json"===e.toLowerCase())n="data:application/json;charset=utf-8,"+JSON.stringify(t,null,2);else if("csv"===e.toLowerCase()){var o,i="",u=m(t);try{for(u.s();!(o=u.n()).done;){var l=o.value;for(var f in l)i+=l[f]+",";i=i.trim().substring(0,i.length-1),i+="\n"}}catch(r){u.e(r)}finally{u.f()}n="data:text/csv;charset=utf-8,"+(i=i.trim().substring(0,i.length-1))}else if("sql"===e.toLowerCase()){var h="INSERT INTO `export_table` (";for(var c in t[0])h+="`"+c+"`,";h=h.trim().substring(0,h.length-1),h+=") VALUES ";var s,g=m(t);try{for(g.s();!(s=g.n()).done;){var w=s.value;for(var v in h+="(",w)h+="`"+w[v]+"`,";h=h.trim().substring(0,h.length-1),h+="),"}}catch(r){g.e(r)}finally{g.f()}h=h.trim().substring(0,h.length-1),n="data:application/sql;charset=utf-8,"+(h+=";")}else if("xml"===e.toLowerCase()){var d='<?xml version="1.0" encoding="UTF-8"?>\n<data>';for(var y in t){for(var p in d+="\n <entry>",y)d+="\n <"+p+"`>"+y[p]+"</"+p+"`>";d+="\n </entry>"}n="data:application/xml;charset=utf-8,"+(d+="\n</data>")}else if("vhs"===e.toLowerCase()){var b,N='//visit official site: http://vhs-file-format.glitch.me \n("data", [',E=m(t);try{for(E.s();!(b=E.n()).done;){var D=b.value;for(var A in N+='\n ("entry", [',D)N+='\n ("'+A+'", ',N+=D[A]+"),";N=N.trim().substring(0,N.length-1),N+="]),"}}catch(r){E.e(r)}finally{E.f()}N=N.trim().substring(0,N.length-1),n="data:application/vhs;charset=utf-8,"+(N="])")}return n}},download:function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"txt",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"export-to";if("string"==typeof r){var n=t+"."+e.toLowerCase(),o=encodeURI(r),a=document.createElement("a");a.href=o,a.download=n,document.body.appendChild(a),a.click(),document.body.removeChild(a)}},printed:function(r){if("object"===a(r)){var e=Array.from(r),t=document.createElement("table"),n=document.createElement("thead"),o=document.createElement("tbody");t.appendChild(n),t.appendChild(o);var i=document.createElement("tr");for(var u in e[0]){var l=document.createElement("th");l.textContent=u.replace(/^\w/,(function(r){return r.toUpperCase()})),i.appendChild(l)}n.appendChild(i);for(var f=0,h=e;f<h.length;f++){var c=h[f],s=document.createElement("tr");for(var m in c){var g=document.createElement("td");g.textContent=c[m],s.appendChild(g)}o.appendChild(s)}var w=window.open();w.document.body.appendChild(t),w.focus(),w.print()}}}),dr=function(r,e,t){var n;if(t){var o=new Date;o.setTime(o.getTime()+24*t*60*60*1e3),n="expires="+o.toGMTString()}else n="";document.cookie=r+"="+e+"; SameSite=Lax;"+n+"; path=/"},yr=function(r){for(var e=r+"=",t=document.cookie.split(";"),n=0;n<t.length;n++){for(var o=t[n];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(e))return o.substring(e.length,o.length)}return null},pr=function(r){return"object"===("undefined"==typeof window?"undefined":a(window))&&"".concat(r,"Storage")in window},br=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"local";if(pr(e))return!!window["".concat(e,"Storage")].getItem(r)},Nr=Object.freeze({__proto__:null,setCookie:dr,getCookie:yr,hasCookie:function(r){return!!yr(r)},removeCookie:function(r){dr(r,"",-1)},clearCookie:function(){for(var r=document.cookie.split(";"),e=0;e<r.length;e++){var t=r[e],n=t.indexOf("="),o=n>-1?t.substr(0,n):t;document.cookie=o+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"}},isStorage:pr,isCookie:function(){return"object"===("undefined"==typeof document?"undefined":a(document))&&"cookie"in document},setStorage:function(r,e){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local";pr(t)&&window["".concat(t,"Storage")].setItem(r,e)},getStorage:function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"local";if(pr(e))return window["".concat(e,"Storage")].getItem(r)},hasStorage:br,removeStorage:function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"local";pr(e)&&br(r,e)&&window["".concat(e,"Storage")].removeItem(r)},clearStorage:function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"local";pr(r)&&window["".concat(r,"Storage")].clear()}}),Er=Object.freeze({__proto__:null,ternary:function(r,e,t){if(!x(r)&&!x(e)&&!x(t))throw new Error("All arguments here only accept value in function");return r()?e():t()}});export{z as $array,v as $char,wr as $date,vr as $file,r as $int,w as $number,$ as $object,d as $string,z as array,v as char,wr as date,vr as file,Er as func,r as int,w as number,$ as object,Nr as storage,d as string}; | ||
var e=Object.freeze({__proto__:null,random:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:255,r=Number(e)+1;return Math.floor(Math.random()*r)}}),r=function(e){return!isNaN(e)&&"number"==typeof Number(e)},t=function(e){if("number"!=typeof e&&"string"!=typeof e)throw new Error("You must input only number format here");return 1===Math.sign(e)},n=function(e){if("number"!=typeof e&&"string"!=typeof e)throw new Error("You must input only number format here");return-1===Math.sign(e)},o=function(e){return"string"==typeof e};function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function u(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?u(Object(t),!0).forEach((function(r){i(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):u(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function f(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var t=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(t.push(i.value),!r||t.length!==r);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return t}(e,r)||c(e,r)||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 h(e){return function(e){if(Array.isArray(e))return s(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,r){if(e){if("string"==typeof e)return s(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s(e,r):void 0}}function s(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function m(e,r){var t;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(t=c(e))||r&&e&&"number"==typeof e.length){t&&(e=t);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){t=e[Symbol.iterator]()},n:function(){var e=t.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==t.return||t.return()}finally{if(u)throw a}}}}var g=function(e){return"object"===a(e)&&null!==e&&"[object Object]"===Object.prototype.toString.call(e)},w=Object.freeze({__proto__:null,random:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3;if("number"!=typeof e&&e<=0)throw new Error("You have to add a number at least 1");for(var r="",t="0123456789",n=0;n<e;n++)r+=t.charAt(Math.floor(Math.random()*t.length));return r},loop:function(e,r){if("number"!=typeof e&e<=-1)throw new Error("Only accept number here, start from 0");if("number"!=typeof r&r<=0)throw new Error("Only accept number here, start from 1");for(var t=[];e<=r;)t.push(e++);return t},isNumber:r,isPositive:t,isNegative:n,calc:function(e,t,n){if(!r(e))throw new Error("This is left operand and must be in number type");if(!r(t))throw new Error("This is left operand and must be in number type");if(!o(n))throw new Error("Operator must be one of these: add, subtract, multiply, divide, reminder or exponent");var a=0;return"add"===n||"addition"===n||"plus"===n||"+"===n?a=Number(e)+Number(t):"subtract"===n||"subtraction"===n||"minus"===n||"-"===n?a=Number(e)-Number(t):"multiply"===n||"multiplication"===n||"×"===n||"*"===n?a=Number(e)*Number(t):"divide"===n||"division"===n||"÷"===n||"/"===n?a=Number(e)/Number(t):"remainder"===n||"modulo"===n||"%"===n?a=Number(e)%Number(t):"exponent"!==n&&"exponentiation"!==n&&"**"!==n||(a=Math.pow(Number(e),Number(t))),a},currency:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!r(e))throw new Error("Amount must be in a number type");if(!o(t)&&3===t.length)throw new Error("Currency code must have at least 3 uppercase character");if(!o(n))throw new Error("Locale code must contain 2 languages and 2 country code and separated by dash (-)");if(!g(a))throw new Error("Currency options must be in object type");return new Intl.NumberFormat(n,l({style:"currency",currency:t.toUpperCase()},a)).format(e)}}),d=Object.freeze({__proto__:null,random:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:11,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long",t="",n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_~!@#$%^&*()+={}[]|:;<>,./?";"short"===r||"alphadash"===r?n=n.slice(0,64):"narrow"===r||"alphanumeric"===r?n=n.slice(0,62):"alpha"===r?n=n.slice(10,62):"hex"===r?n=n.slice(0,16):"number"!==r&&"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}}),v=Object.freeze({__proto__:null,split:function(e){return function(r){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=[];return"string"==typeof e&&(r>=1&&n.push(e.slice(0,r)),null!==t?(n.push(e.slice(r,t)),n.push(e.slice(t))):n.push(e.slice(r))),n}},capitalize:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"single";if("string"==typeof e){var t=e;return t="multiple"===r?t.toLowerCase().replace(/\w\S*/g,(function(e){return e.replace(/^\w/,(function(e){return e.toUpperCase()}))})):t.trimStart().replace(/^\w/,(function(e){return e.toUpperCase()}))}},includes:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return-1!==e.indexOf(r,t)},isString:o}),y=function(e){return!("object"!==a(e)||null===e||!Array.isArray(e))},p=function(e){if(!y(e))throw new Error("On the first argument must be in array type");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("On the next arguments, you have to provide at least one argument");var o=Array.from(e);return o.unshift.apply(o,t),o},b=function(e){if(!y(e))throw new Error("On the first argument must be in array type");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("On the next arguments, you have to provide at least one argument");var o=Array.from(e);return o.push.apply(o,t),o},N=function(e,t){if(!y(e))throw new Error("On the first argument, here only accept array type");if(!r(t))throw new Error("On the second argument, accept only numeric or number type");for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];if(o.length<1)throw new Error("On the next arguments, you have to enter at least one value");var i=Array.from(e),u=isNaN(t)?1:t;return i.splice.apply(i,[Number(u)-1,0].concat(o)),i},E=function(e,t){if(!y(e))throw new Error("On the first argument, here only accept array type");if(!r(t))throw new Error("On the second argument, accept only numeric or number type");for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];if(o.length<1)throw new Error("On the next arguments, you have to enter at least one value");var i=Array.from(e),u=isNaN(t)?0:t;return i.splice.apply(i,[Number(u)+1,0].concat(o)),i},D=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{key:"id",value:0};if(!y(e))throw new Error("You must enter the first argument in array only");var t=Array.from(e),n=-1;return"key"in r&&"value"in r?n=t.length>=1?t.findIndex((function(e){return e[r.key]===r.value})):-1:t.length>=1&&(n=t.findIndex((function(e){for(var t=0,n=Object.entries(r);t<n.length;t++){var o=f(n[t],2),a=o[0],i=o[1];if(a in e&&e[a]===i)return!0}}))),n},A=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dense";if(!y(e))throw new Error("You must enter the first argument in array only");return"sparse"===r?Object.keys(e).map((function(e){return Number(e)})):h(e.keys())},Y=function(e){if(!y(e))throw new Error("You must enter the argument in array only");var r=A(e);return Number(r[Math.floor(Math.random()*r.length)])},O=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r){for(var n={},o=0,a=r;o<a.length;o++)for(var i=a[o],u=0,l=Object.entries(i);u<l.length;u++){var h=f(l[u],2),c=h[0],s=h[1];n[c]=s}return n}},S=function(e){if(!y(e))throw new Error("Please provide array that you want to remove its element");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("On the last of argument, you have to enter at least one argument");for(var o=Array.from(e),i=[],u=function(){var e=f[l];if("string"==typeof e&&"first"===e)o=o.map((function(e,r){return 0===r?null:e})),i=o;else if("string"==typeof e&&"last"===e)o=o.map((function(e,r){return r===o.length-1?null:e})),i=o;else if("number"==typeof e)o=o.map((function(r,t){return t===e?null:r})),i=o;else if("object"===a(e)&&null!==e){var r=D(o,e);o=o.map((function(e,t){return t===r?null:e})),i=o}},l=0,f=t;l<f.length;l++)u();return i.filter((function(e){return null!==e}))},j=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!y(e))throw new Error("");var t=Array.from(e),n=[];if("string"==typeof r){var o,a=new Set,i=m(t);try{for(i.s();!(o=i.n()).done;){var u=o.value;a.has(u[r])||a.add(u[r])}}catch(e){i.e(e)}finally{i.f()}n=h(a)}else n=Array.from(new Set(t));return n},M=function(e){if(!g(e))throw new Error("This is object helper, you must provide the first argument in an object");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("The next arguments must be in a string or in a number and at least one argument");for(var o={},a=new Set(t),i=0,u=Object.entries(e);i<u.length;i++){var l=f(u[i],1),h=l[0];a.has(e[h])||(o[h]=e[h])}return o},x=function(e,t){if(!y(e))throw new Error("The first argument must be in array of objects");if(!g(t))throw new Error("The second argument must be in object type and must have at least one property");for(var n=Array.from(e),a=function(){var e=f(u[i],2),t=e[0],a=e[1],l=n.filter((function(e){if(t in e){if(r(e[t])&&Number(e[t])===Number(a))return!0;if(o(e[t])&&e[t].toLowerCase().includes(a.toLowerCase()))return!0}return!1}));n=l},i=0,u=Object.entries(M(t,"",0));i<u.length;i++)a();return n},T=function(e){return"function"==typeof e},C=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";if(!y(e))throw new Error("Only array of objects accepted");if(!o(t))throw new Error("The second argument must be in a string and a value must be object property key or name");if(!o(n))throw new Error('The third argument must be in a string and a value either "", "asc" or "desc"');var a=Array.from(e);return"asc"===n?a.sort((function(e,n){if(t in e&&t in n){if(r(e[t])&&r(n[t]))return Number(e[t])-Number(n[t]);if(o(e[t])&&o(n[t])){var a=e[t].toLowerCase(),i=n[t].toLowerCase(),u=0;return a<i?u=-1:a>i&&(u=1),u}}})):"desc"===n&&a.sort((function(e,n){if(t in e&&t in n){if(r(e[t])&&r(n[t]))return Number(n[t])-Number(e[t]);if(o(e[t])&&o(n[t])){var a=e[t].toLowerCase(),i=n[t].toLowerCase(),u=0;return i<a?u=-1:i>a&&(u=1),u}}})),a},k=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!y(e))throw new Error("On the first argument, here only accept array");if(!r(t))throw new Error("This is the page active number, please enter number only");if(!r(n))throw new Error("This is the limit of entries in one page in a number, please enter number only");var o=Array.from(e),a=Number(n)*Number(t)-(Number(n)-1),i=Number(n)*Number(t);return{from:o.length>=1?a:0,start:o.length>=1?a:0,to:i<=o.length?i:o.length,end:i<=o.length?i:o.length,of:o.length,length:o.length}},B=function(e){if(!y(e))throw new Error("This argument only accept array");var r,t={},n=new Set,o=m(new Set(e));try{var a=function(){var o=r.value,a=Array.from(e).filter((function(e){return e===o}));n.has(a.length)||(n.add(a.length),t[a.length]=[]),a.forEach((function(e){t[a.length].push(e)}))};for(o.s();!(r=o.n()).done;)a()}catch(e){o.e(e)}finally{o.f()}return t},I=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(!r&&r.length<=1)throw new Error("You have to provide here at least 2 arguments");var n=[],o={};r.forEach((function(e,r){if(y(e)?o[r]=new Set(e):o[r]=(new Set).add(e),0!==r){var t,a=m(e);try{for(a.s();!(t=a.n()).done;){var i=t.value;o[r-1].has(i)&&n.push(i)}}catch(e){a.e(e)}finally{a.f()}}}));var a=B(n);return Array.from(new Set(a[r.length-1]))},_=function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(!y(e)&&e.length<=0)throw new Error("You need to provide more values to your array");if(!t&&t.length<=0)throw new Error("You have to provide here at least 1 value");var o,a=[],i=m(e);try{for(i.s();!(o=i.n()).done;){var u=o.value;t.flat().includes(u)||a.push(u)}}catch(e){i.e(e)}finally{i.f()}return a},L=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length<2&&!y(r[0])&&!y(r[1])&&Number(r[0].length)!==Number(r[1].length))throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var n=Array.from(r[0]).map((function(e){return[]})),o=0,a=r;o<a.length;o++){var i=a[o];i.forEach((function(e,r){r in n&&n[r].push(e)}))}return n},P=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length<2)throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var n=Array.from(r),o=[],a=n.shift(),i=function(){var e=l[u],r=new Map;e.forEach((function(e,t){a[t]&&r.set(a[t],e)})),o.push(Object.fromEntries(r))},u=0,l=n;u<l.length;u++)i();return o},U=function(){if(0===arguments.length||arguments.length>=4)throw new Error("Here only accept 3 arguments, so you have to provide at least 1 argument");var e=1===arguments.length?0:Number(arguments.length<=0?void 0:arguments[0]),r=Number(arguments.length>=2?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0]),o=3===arguments.length?Number(arguments.length<=2?void 0:arguments[2]):1;arguments.length<3&&n(r)&&(o=-1);var a=[],i=0,u=0;if(n(e)&&t(r)?i=e-1:t(e)&&n(r)?i=e+1:t(e)&&t(r)?i=e-1:n(e)&&n(r)&&(i=e+1),i<r){for(;i<r;)i++,o>1?(u+=o)<r&&a.push(u):i<r&&a.push(i);0!==e||a.includes(0)||a.unshift(0)}else if(i>r){for(;i>r;)i--,o<-1?(u-=o)>r&&a.unshift(u):i>r&&a.unshift(i);0!==e||a.includes(0)||a.push(0)}return 1===a.length&&0===a[0]?[]:a},F=function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(0===r.length)throw new Error("Accept index of array elements only and you add at least one index in number");return function(e){if(!y(e))throw new Error("Please enter array only here");for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];if(0===n.length&&n.length!==r.length&&0!==I(r,n).length)throw new Error("Only accept index of array elements and the number of the first indexes must be the same as the second indexes and also, both indexes must be different");for(var a=Array.from(e),i=Array.from(e),u=0;u<r.length;u++)void 0!==r[u]&&void 0!==n[u]&&(i.splice(r[u],1,a[n[u]]),i.splice(n[u],1,a[r[u]]));return i}},H=function(e,r,t){if(!y(e))throw new Error("On the first argument, you have to provide array only");if(!o(r))throw new Error("New property must be in string type");if(!T(t))throw new Error("Callback must be in function or method");return Array.from(e).map((function(e){return e[r]=t.apply(void 0,h(Object.values(e).filter((function(e){return!1===isNaN(e)})))),e}))},z=Object.freeze({__proto__:null,insert:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{position:null,index:null};if(!y(e))throw new Error("On the first argument, only array accept here");if(!g(r))throw new Error("On the second argument, only object with 2 properties (position and index property) accepted");for(var t=arguments.length,n=new Array(t>2?t-2:0),o=2;o<t;o++)n[o-2]=arguments[o];if(n.length<1)throw new Error("On the third or the next arguments, you have to enter at least one argument");var a=[];return"first"===r.position?a=p.apply(void 0,[e].concat(n)):"last"===r.position?a=b.apply(void 0,[e].concat(n)):"before"===r.position?a=N.apply(void 0,[e,r.index].concat(n)):"after"===r.position&&(a=E.apply(void 0,[e,r.index].concat(n))),a},insertFirst:p,insertLast:b,insertBefore:N,insertAfter:E,update:function(e,t,n){if(!y(e))throw new Error("You have to enter array only on the first argument");if(!g(t))throw new Error("You must enter object only here on the second argument");if(!g(n)&&!r(n))throw new Error("You must enter object only on the second argument");var o=Array.from(e),a=g(n)?D(o,n):Number(n);return o.map((function(e,r){var n=e;return r===a&&(n=O(e,t)),n}))},updateBy:function(e,r,t){if(!y(e))throw new Error("You have to enter array only on the first argument");if(!g(r))throw new Error("You must enter object only here on the second argument");if(!y(t))throw new Error("You must enter array of objects or numbers on the second argument");var n=Array.from(e);return n.map((function(e,o){var a,i=e,u=m(t);try{for(u.s();!(a=u.n()).done;){var l=a.value;o===(g(l)?D(n,l):Number(l))&&(i=O(e,r))}}catch(e){u.e(e)}finally{u.f()}return i}))},destroy:S,select:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(!y(e))throw new Error("On the first argument, you have to provide array only");if(t.length<1)throw new Error("On the second argument, you must enter at least one value");var o=Array.from(e);return o.map((function(e){var r,n={},o=m(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;a in e&&(n[a]=e[a])}}catch(e){o.e(e)}finally{o.f()}return n}))},hidden:function(e){for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(!y(e))throw new Error("On the first argument, you have to provide array only");if(t.length<1)throw new Error("On the second argument, you must enter at least one value");var o=Array.from(e);return o.map((function(e){var r,n=e,o=m(t);try{for(o.s();!(r=o.n()).done;){var a=r.value;a in e&&delete n[a]}}catch(e){o.e(e)}finally{o.f()}return n}))},toggle:function(e){return function(r){var t=Array.from(r);if(t.includes(e)){var n=t.findIndex((function(r){return r===e}));t.splice(n,1)}else t.push(e);return t}},flatten:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=[],n={};n.id=r.id||"id",n.parent=r.parent||"parent",n.children=r.children||"children";var o=function(){Array.from(e).forEach((function(e){if("object"===a(e)&&null!==e){var r=e;r[n.parent]="0","object"===a(r[n.children])&&Array.isArray(r[n.children])&&(i(r[n.children],e),delete r[n.children]),t.push(r)}}))},i=function e(r,o){r.length>=1&&Array.from(r).forEach((function(r){if("object"===a(r)&&null!==r){var i=r;i[n.parent]=o[n.id],"object"===a(i[n.children])&&Array.isArray(i[n.children])&&(e(i[n.children],r),delete i[n.children]),t.push(i)}}))};return o(),t},nested:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=[],n=Array.from(e),o={};o.id=r.id||"id",o.parent=r.parent||"parent",o.children=r.children||"children";var i=function(e){e.forEach((function(e){if("object"===a(e)&&null!==e){var r=null;("string"==typeof e[o.parent]&&"0"===e[o.parent]||"number"==typeof e[o.parent]&&0===e[o.parent])&&(r=u(e)),null!==r&&t.push(r)}}))},u=function(e){var r=e;return void 0!==e[o.children]&&null!==e[o.children]||(r[o.children]=l(e[o.id]),r[o.children].length<=0&&delete r[o.children]),delete r[o.parent],r},l=function(e){var r=[];return f(e).length>=1&&f(e).forEach((function(e){r.push(u(e))})),r},f=function(e){return n.filter((function(r){return r.parent===e}))};return i(n),t},index:D,toIndex:A,randomIndex:Y,search:function(e){if(!y)throw new Error("The first argument must be in array");for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];if(n.length<1)throw new Error("On the next arguments, you must provide at least one argument in either string or number");for(var i=[],u=function(){var t=h[l],n=Array.from(e).filter((function(e){if(r(e)&&Number(e)===Number(t))return!0;if(o(e)&&e.toLowerCase().includes(t.toLowerCase()))return!0;if(g(e))for(var n=0,a=Object.entries(e);n<a.length;n++){var i=f(a[n],2),u=i[0],l=i[1];if(r(e[u])&&Number(l)===Number(t))return!0;if(o(e[u])&&l.toLowerCase().includes(t.toLowerCase()))return!0}return!1}));i=j(i.concat(n))},l=0,h=n;l<h.length;l++)u();return i},searchBy:function(e,t,n){if(!y(e))throw new Error("The first argument must be in array of objects and it is needed in order to be searched");if(!y(t)&&t.length<1)throw new Error("The second argument must have at least one argument either in a string or in a number");if(!y(n)&&n.length<1)throw new Error("The last argument required at least one argument either in a string or in a number");var a,i=[],u=m(t);try{var l=function(){var t=a.value,u=Array.from(e).filter((function(e){for(var a=0,i=Array.from(n);a<i.length;a++){var u=i[a];if(u in e){if(r(e[u])&&Number(e[u])===Number(t))return!0;if(o(e[u])&&-1!==e[u].toLowerCase().indexOf(t.toLowerCase()))return!0}}return!1}));i=j(i.concat(u))};for(u.s();!(a=u.n()).done;)l()}catch(e){u.e(e)}finally{u.f()}return i},filter:x,filtered:x,sort:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc";if(!y(e))throw new Error("Only array of strings or numbers accepted");if(!o(t))throw new Error('The second argument must be in a string and a value either "", "asc" or "desc"');var n=Array.from(e);return"asc"===t?n.sort((function(e,t){if(r(e)&&r(t))return Number(e)-Number(t);if(o(e)&&o(t)){var n=e.toLowerCase(),a=t.toLowerCase(),i=0;return n<a?i=-1:n>a&&(i=1),i}})):"desc"===t&&n.sort((function(e,t){if(r(e)&&r(t))return Number(t)-Number(e);if(o(e)&&o(t)){var n=e.toLowerCase(),a=t.toLowerCase(),i=0;return a<n?i=-1:a>n&&(i=1),i}})),n},sortBy:C,sorted:C,sortWith:function(e,r){if(!y(e))throw new Error("The first argument must be in an array type");if(!T(r))throw new Error("The second argument is a compare or callback function");var t=Array.from(e);return t.sort((function(e,t){return-1===Math.sign(r(e,t))?-1:1})),t},paginate:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!y(e))throw new Error("On the first argument, here only accept array");if(!r(t))throw new Error("This is the page active number, please enter number only");if(!r(n))throw new Error("This is the limit of entries in one page in a number, please enter number only");var o=Array.from(e),a=Number(n)*Number(t)-(Number(n)-1),i=Number(n)*Number(t);return o.slice(a-1,i<=o.length?i:o.length)},pages:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if(!y(e))throw new Error("On the first argument, here only accept array");if(!r(t))throw new Error("This is the limit of entries in one page in a number, please enter number only");var n=Array.from(e),o=n.length/Number(t),a=Math.ceil(o);return a},pageInfo:k,show:k,pagination:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!r(e))throw new Error("This is the total or all pages in numbers, please enter number only");if(!r(t))throw new Error("This is the page active number, please enter number only");if(!r(n))throw new Error("This is the position of ellipsis [...], please enter number only");var o=[],a=Number(e)<Number(t)?Number(e):Number(t),i=Number(t)<1?1:Number(t),u=a+Number(n),l=i-Number(n);if(0===Number(n))for(var f=1;f<=Number(e);f++)o.push(f);else{if(i>1)for(var h=l;h<i;h++)o.push(h);for(var c=a;c<=u;c++)o.push(c)}var s=o.filter((function(e){return e>0})),m=s.filter((function(r){return r<=Number(e)}));return u<Number(e)&&0!==Number(n)&&m.push("..."),l>1&&0!==Number(n)&&m.unshift("..."),m},sum:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!y(e))throw new Error("In the first argument, you must enter a data in array");var t=Array.from(e),n=0;if(t.length>=1)if("string"==typeof r&&""!==r){var o=t.map((function(e){return r in e?Number(e[r]):0}));n=o.reduce((function(e,r){return Number(e)+Number(r)}))}else n=t.reduce((function(e,r){return Number(e)+Number(r)}));return n},calculate:H,calc:H,unique:j,isArray:y,isSuperset:function(e,r){if(!y(e)&&!y(r))throw new Error("The both of arguments must be in arrays");var t,n=new Set(e),o=m(r);try{for(o.s();!(t=o.n()).done;){var a=t.value;if(!n.has(a))return!1}}catch(e){o.e(e)}finally{o.f()}return!0},union:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];return Array.from(new Set(r.flat()))},intersection:I,difference:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(!r&&r.length<=1)throw new Error("You have to provide here at least 2 arguments");var n=new Set,o=I.apply(void 0,r);return r.forEach((function(e){if(!y(e))throw new Error("Here only accept arrays from all arguments");var r,t=m(e);try{for(t.s();!(r=t.n()).done;){var a=r.value;o.includes(a)||n.has(a)||n.add(a)}}catch(e){t.e(e)}finally{t.f()}})),Array.from(n)},asymmetricDifference:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(!r&&r.length<=1)throw new Error("You have to provide here at least 2 arguments");for(var n=new Set,o=[],a=0,i=r;a<i.length;a++){var u=i[a];if(!y(u))throw new Error("Here only accept arrays from all arguments");u.forEach((function(e){n.has(e)?(n.delete(e),o.push(e)):o.includes(e)||n.add(e)}))}return Array.from(n)},complement:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(!r&&r.length<=1)throw new Error("You have to provide here at least 1 value");var n=Array.from(r);n.shift();var o=new Set(_.apply(void 0,[r[0]].concat(h(n))));return Array.from(o)},without:_,transpose:L,zip:P,unzip:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length<2)throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var n=Array.from(r),o=Object.keys(n[0]),a={},i=0,u=o;i<u.length;i++){var l=u[i];a[l]=[]}for(var f=0,c=n;f<c.length;f++){var s=c[f];for(var m in s)a[m].push(s[m])}return[o].concat(h(L.apply(void 0,h(Object.values(a)))))},range:U,move:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Only accept index of array elements and you must input at least one index in number type");return function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!y(e))throw new Error("Please enter array only here");if(!r(n))throw new Error("Input only index number here");var a,i=Array.from(e),u=[],l=m(t);try{for(l.s();!(a=l.n()).done;){var f=a.value;void 0!==i[Number(f)]&&u.push(i[Number(f)])}}catch(e){l.e(e)}finally{l.f()}var h=S.apply(void 0,[i].concat(t));return h.splice.apply(h,[n,o].concat(u)),h}},switched:F,transfer:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(0===t.length)throw new Error("Only accept index of array elements and you must enter at least one index in number type");return function(e,n){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!y(e))throw new Error("Accept array only here");if(!y(n))throw new Error("Accept array only here");if(!r(o))throw new Error("Input only index number here");var a,i=Array.from(e),u=Array.from(n),l=[],f=m(t);try{for(f.s();!(a=f.n()).done;){var h=a.value;void 0!==i[Number(h)]&&l.push(i[Number(h)])}}catch(e){f.e(e)}finally{f.f()}var c=null===o?Number(u.length):o;u.splice.apply(u,[c,0].concat(l));var s=S.apply(void 0,[i].concat(t));return{from:s,to:u}}},compact:function(e){if(!y(e))throw new Error("Enter only array type here");return Array.from(e).filter((function(e){return null!=e&&!1!==e&&!isNaN(e)&&""!==e&&e>0}))},chunk:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!y(e)&&e.length<=2)throw new Error("Please insert array only on the first argument and must have 3 values at least");if("number"!=typeof r)throw new Error("On the second argument, you must input in a number type only");var t,n=U(r,e.length,r),o=[],a=m(n);try{for(a.s();!(t=a.n()).done;){var i=t.value,u=e.slice(Number(i)-Number(r),i);o.push(u)}}catch(e){a.e(e)}finally{a.f()}return n[Number(n.length)-1]<=e.length&&o.push(e.slice(n[Number(n.length)-1],e.length)),o},shuffle:function(e){if(!y(e)&&e.length<=2)throw new Error("This shuffle method only work on data in array type");for(var r=Array.from(e),t=Number(r.length)-1;t>2;t--){var n=r.slice(0,Number(t)+1);r=F(t)(r,Y(n))}return r},group:function(e,r){if(!y(e))throw new Error("You must enter array literal here");if(!T(r))throw new Error("You have to enter a function or callback on the second argument");var t,n={},o=m(e);try{for(o.s();!(t=o.n()).done;){var a=t.value;void 0===n[r(a).toString()]&&(n[r(a).toString()]=[]),n[r(a).toString()].push(a)}}catch(e){o.e(e)}finally{o.f()}return n},countDuplication:B,countBy:function(e,r){if(!y(e))throw new Error("The first paramenter only accept array");if(!T(r))throw new Error("The second paramenter only accept callback function");return e.filter((function(e){return r(e)})).length}}),$=Object.freeze({__proto__:null,remove:function(e){if(!g(e))throw new Error("This is object helper, you must provide the first argument in an object");for(var r=arguments.length,t=new Array(r>1?r-1:0),n=1;n<r;n++)t[n-1]=arguments[n];if(t.length<1)throw new Error("The next arguments must be in a string and at least one argument");for(var o=Object.assign({},e),a=0,i=t;a<i.length;a++){var u=i[a];u in o&&delete o[u]}return o},removeBy:M,merge:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r){for(var n={},o=new Map,a=0,i=r;a<i.length;a++)for(var u=i[a],l=0,h=Object.entries(u);l<h.length;l++){var c=f(h[l],2),s=c[0],m=c[1];o.has(s)||(o.set(s,m),n[s]=m)}return n}},replace:O,isObject:g,isObjectValues:function(e){return!!Object.values(e).filter((function(e){return""!==e&&0!==e&&e!=={}&&e!==[]})).join("")},invert:function(e){if(!g(e))throw new Error("You have to input object only here");var r=Object.keys(e),t=Object.values(e);return P(t,r)[0]},clone:function(){for(var e=arguments.length,r=new Array(e),t=0;t<e;t++)r[t]=arguments[t];if(r.length<1)throw new Error("In this argument must have at least one argument and please provide it in object type");return Object.assign.apply(Object,[{}].concat(r))}}),R=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,Z=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|T|H{1,2}|h{1,2}|a|A|i{1,2}|s{1,2}|Z{1,2}|SSS/g,G=function(e){return"number"==typeof e||"string"==typeof e},q=function(e){return"number"==typeof e||"string"==typeof e},W=function(e){return"number"==typeof e||"string"==typeof e},J=function(e){return!!("object"===a(new Date(e))&&null!==e||"string"==typeof e&&new RegExp(R).test(e))},K=function(e){return!("string"!=typeof e||!new RegExp(Z).test(e))},V=function(e){return e%400==0||e%100!=0&&e%4==0},Q="Year must be in a number or a string type, the length of year either 4 or 2",X="Month must be in a number or a string type, the month number start from 1 to 12",ee="Date must be in a number or a string type, the date number start from 1 to 31",re="Full date must be in string or array type",te=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long",t=[],n=4;n<=10;n++){var o=new Date(Date.UTC(2021,3,n));t.push(new Intl.DateTimeFormat(e,{weekday:r}).format(o))}return t},ne=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;if(!G(e))throw new Error(Q);if(!q(r))throw new Error(X);var t=[28,29,30,31],n=new Date(Date.UTC(Number(e),Number(r),0)).getUTCDate();return t.includes(n)?n:31},oe=function(e){if(!G(e))throw new Error(Q);return V(e)?366:365},ae=function(e,r){if(!J(e))throw new Error("Error in the first argument: "+re);if(!J(r))throw new Error("Error in the second argument: "+re);var t=new Date(e),n=new Date(r);return(Number(n.getTime())-Number(t.getTime()))/864e5},ie=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"long",t=[],n=0;n<=11;n++){var o=Date.UTC(2021,n);t.push(new Intl.DateTimeFormat(e,{month:r}).format(new Date(o)))}return t},ue=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"long";if(!J(e))throw new Error('You\'re entering the wrong date string, please use this statement "new Date(\'yourdateParam\').toString()" instead or array "[year, monthIndex, dateNumber]"');if(!K(r))throw new Error("Please enter the correct date format");var o,a=new Date(e),i=r,u=r,l={YY:function(){var e=a.getFullYear().toString().slice(-2),r=a.getFullYear();return"00"!==e&&(r=Number(e)),r},YYYY:a.getFullYear(),M:Number(a.getMonth())+1,MM:function(){var e=Number(Number(a.getMonth())+1).toString();return 1===e.length?"0"+e:e},m:ie(t,n)[a.getMonth()].slice(0,3),mm:ie(t,n)[a.getMonth()],D:a.getDate,DD:function(){var e=a.getDate().toString(),r=e;1===e.length&&(r="0"+e);return r},d:te(t,n)[a.getDay()].slice(0,3),dd:te(t,n)[a.getDay()],H:a.getHours(),HH:function(){var e=a.getHours().toString();return 1===e.length?"0"+e:e},h:function(){var e=Number(a.getHours()+1),r=e;return e>12&&(r=e-(e-1)),r},hh:function(){var e=Number(a.getHours()+1),r=e;e>12&&(r=e-(e-1));var t=r.toString();return 1===t.length?"0"+t:t},k:function(){return 0===Number(a.getHours())?24:a.getHours()},kk:function(){var e=Number(a.getHours()).toString();if(1===e.length){var r="0"+e;return 0===Number(r)?24:r}return 0===Number(e)?24:e},i:a.getMinutes(),ii:function(){var e=a.getMinutes().toString();return 1===e.length?"0"+e:e},s:a.getSeconds(),ss:function(){var e=a.getSeconds().toString();return 1===e.length?"0"+e:e},uuu:a.getMilliseconds(),A:a.getHours()<12?"AM":"PM",a:a.getHours()<12?"am":"pm",Do:a.getDate().toString()+"st"},f=i.split(/-|\/|\.|:|\s/),h=m(f);try{for(h.s();!(o=h.n()).done;){var c=o.value;"YY"===c?u=u.replace(c,l.YY()):"YYYY"===c?u=u.replace(c,l.YYYY):"M"===c?u=u.replace(c,l.M):"MM"===c?u=u.replace(c,l.MM()):"m"===c?u=u.replace(c,l.m):"mm"===c?u=u.replace(c,l.mm):"D"===c?u=u.replace(c,l.D):"DD"===c?u=u.replace(c,l.DD()):"d"===c?u=u.replace(c,l.d):"dd"===c?u=u.replace(c,l.dd):"H"===c?u=u.replace(c,l.H):"HH"===c?u=u.replace(c,l.HH()):"h"===c?u=u.replace(c,l.h()):"hh"===c?u=u.replace(c,l.hh()):"k"===c?u=u.replace(c,l.k()):"kk"===c?u=u.replace(c,l.kk()):"i"===c?u=u.replace(c,l.i):"ii"===c?u=u.replace(c,l.ii()):"s"===c?u=u.replace(c,l.s):"ss"===c?u=u.replace(c,l.ss()):"uuu"===c?u=u.replace(c,l.uuu):"A"===c?u=u.replace(c,l.A):"a"===c?u=u.replace(c,l.a):"Do"===c&&(u=u.replace(c,l.Do))}}catch(e){h.e(e)}finally{h.f()}return u},le=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"long";if(!J(e))throw new Error("On the first argument, you have to input only the correct date");if(!K(r))throw new Error("For format date, you must always input the correct one by using characters like these: Y, M, m, D, d, H, h, k, i, S, s, A, a or Do");var o=e.split(/-|\/|\.|T|Z|:|\s/).filter((function(e){return e.length>=1&&" "!==e})).map((function(e){return e.trim()})),a=r.split(/-|\/|\.|T|Z|:|\s/).filter((function(e){return e.length>=1&&" "!==e})).map((function(e){return e.trim()})),i={year:(new Date).getFullYear(),month:Number((new Date).getMonth())+1,day:(new Date).getDate(),hour:(new Date).getHours(),minute:(new Date).getMinutes(),second:(new Date).getSeconds(),millisecond:(new Date).getMilliseconds()};if(o.length!==a.length)throw new Error("The numbers and the formats must be in place, so when we check the length of both of these arguments then the result will be the same");for(var u=0;u<o.length;u++)4===o[u].length&&!1===isNaN(o[u])&&"YYYY"===a[u]||2===o[u].length&&!1===isNaN(o[u])&&"YY"===a[u]?i.year=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"M"===a[u]||"MM"===a[u]?i.month=Number(o[u])-1:3===o[u].length&&ie(t,n).map((function(e){return e.slice(0,3)})).includes(o[u])&&"m"===a[u]?i.month=ie(t,n).map((function(e){return e.slice(0,3)})).findIndex(o[u]):o[u].length>=3&&ie(t,n).includes(o[u])&&"mm"===a[u]?i.month=ie(t,n).findIndex(o[u]):1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"D"===a[u]||"DD"===a[u]?i.day=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"H"===a[u]||"HH"===a[u]?i.hour=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"h"===a[u]||"hh"===a[u]?i.hour=o[u]>12?Number(o[u])-(Number(o[u])-1):o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"k"===a[u]||"kk"===a[u]?i.hour=24===Number(o[u])?0:o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"i"===a[u]||"ii"===a[u]?i.minute=o[u]:1===o[u].length||2===o[u].length&&!1===isNaN(o[u])&&"s"===a[u]||"ss"===a[u]?i.second=o[u]:o[u].length>=3&&!1===isNaN(o[u])&&"uuu"===a[u]?i.millisecond=o[u]:("st"===o[u].slice(-2)||"nd"===o[u].slice(-2)||"th"===o[u].slice(-2)&&"Do"===a[u])&&(i.second=Number(o[u].slice(0,-2)));return new Date(i.year,i.month,i.day,i.hour,i.minute,i.second,i.millisecond).toString()},fe=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!J(e))throw new Error("Please enter a date in correct way, either in string or array type");if(!r(t))throw new Error("Only accept number type on second argument");var o=new Date(e),a=Number(o.getDate())+Number(t),i=Number(ne(Number(o.getFullYear()),o.getMonth()+1));if(a>i){var u=a-i;o=11===Number(o.getMonth())?new Date(Number(o.getFullYear())+1,0,u):new Date(Number(o.getFullYear()),Number(o.getMonth())+1,u)}else o=new Date(Number(o.getFullYear()),Number(o.getMonth()),a);var l=null!==n&&!1!==K(n)?ue(o,n):o;return l},he=function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!J(n))throw new Error("Error in the first argument: "+re);if(!J(o))throw new Error("Error in the second argument: "+re);for(var n=new Date(e),o=new Date(r),a=[],i=n;i<=o;){var u=null!==t&&!1!==K(t)?ue(i,t):i;a.push(u),i=fe(i,1)}return a},ce=function(e,r,t){if(!G(e))throw new Error(Q);if(!q(r))throw new Error(X);if(!W(t))throw new Error(ee);var n=ae(new Date(Number(e),0,1),new Date(Number(e),Number(r)-1,Number(t))),o=Number(new Date(e,0,1).getDay()),a=0;o>0&&(a=6-(o-1));var i=Number(new Date(Number(e),Number(r)-1,Number(t)).getDay()),u=0;return i<6&&(u=6-i),Math.ceil((Number(n)+u-a)/7)},se=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!G(e))throw new Error(Q);if(!r(t))throw new Error("You have to enter a number");if(!K(n))throw new Error("Please enter a format of date correctly");var o=Number(new Date(Number(e),0,1).getDay()),a=0;o>0&&(a=6-(o-1));for(var i=[],u=a+1,l=0,f=e,h=1;h<=Number(t);h++){if(h===Number(t)){i.push(ue(new Date(f,l,u),n));for(var c=0;c<6;)c++,i.push(ue(fe(new Date(f,l,u),c),n))}u+=7,l<12&&u>Number(ne(e,l+1))&&(u-=Number(ne(e,l+1)),11!==l?l+=1:(l=1,f+=1))}return i},me=function(e,r){if(!G(e))throw new Error(Q);if(!q(r))throw new Error(X);for(var t=ge(e,52,"M"),n=[],o=0,a=Object.entries(t);o<a.length;o++){var i=f(a[o],2),u=i[0];i[1].includes(r.toString())&&n.push(u)}return 1===Number(r)?n.filter((function(e){return"52"!==e})):n},ge=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!G(e))throw new Error(Q);if(!r(t))throw new Error("You have to enter a number");if(!K(n))throw new Error("Please enter a format of date correctly");var o=Number(new Date(Number(e),0,1).getDay()),a=0;o>0&&(a=6-(o-1));for(var i={},u=a+1,l=0,f=e,h=1;h<=t;h++)i[h.toString()]=[ue(new Date(f,l,u),n),ue(fe(new Date(f,l,u),6),n)],u+=7,l<12&&u>Number(ne(e,l+1))&&(u-=Number(ne(e,l+1)),11!==l?l+=1:(l=1,f+=1));return i},we=Object.freeze({__proto__:null,now:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0,r=(new Date).toString();return"string"==typeof e&&(r=ue(r,e)),r},nowHijri:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"en-US",r=Date.UTC(Number((new Date).getFullYear()),Number((new Date).getMonth()),Number((new Date).getDate()),Number((new Date).getHours()),Number((new Date).getMinutes()),Number((new Date).getSeconds()),Number((new Date).getMilliseconds())),t=new Intl.DateTimeFormat(e,{calendar:"islamic",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hourCycle:"h24"}).format(new Date(r));return t},parse:le,parseDate:le,utc:function(){return new Date(Date.UTC.apply(Date,arguments))},addDate:fe,subtractDate:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!J(e))throw new Error("Please enter a date in correct way, either in string or array type");if(!r(t))throw new Error("Only accept number type on second argument");var o=new Date(e),a=Number(o.getDate())-Number(t),i=Number(ne(Number(o.getFullYear()),o.getMonth()));if(a<1){var u=i+(a-1);o=0===Number(o.getMonth())?new Date(Number(o.getFullYear())-1,0,u):new Date(Number(o.getFullYear()),Number(o.getMonth())+1,u)}else o=new Date(Number(o.getFullYear()),Number(o.getMonth()),a);var l=null!==n&&!1!==K(n)?ue(o,n):o;return l},rangeDate:he,day:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"en-US",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"long";if(!G(e))throw new Error(Q);if(!q(r))throw new Error(X);if(!W(t))throw new Error(ee);var a=new Date(Date.UTC(Number(e),Number(r)-1,Number(t)));return new Intl.DateTimeFormat(n,{weekday:o}).format(a)},days:te,daysInMonth:ne,daysInYear:oe,daysInBetween:ae,week:ce,weeks:se,weeksInMonth:me,weeksInYear:function(e){if(!G(e))throw new Error(Q);var r=Number(new Date(Number(e),0,1).getDay()),t=0;r>0&&(t=6-(r-1));var n=Number(new Date(Number(e),11,31).getDay()),o=0;return n<6&&(o=6-n),Math.ceil((Number(oe(e))+o-t)/7)},month:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"en-US",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"long";if(!G(e))throw new Error(Q);if(!q(r))throw new Error(X);var o=Date.UTC(e,Number(r)-1);return new Intl.DateTimeFormat(t,{month:n}).format(new Date(o))},months:ie,isYear:G,isMonth:q,isDate:W,isFullDate:J,isFormatDate:K,isLeapYear:V,calendar:function(e,r){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YYYY-MM-DD",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"en-US";if(!G(e))throw new Error(Q);if(!q(r))throw new Error(X);if(!K(n))throw new Error("Please enter a format of date correctly");var a=te(o),i=he(new Date(e,Number(r)-1,1),new Date(e,Number(r)-1,ne(e,r)),n),u=Number(new Date(e,Number(r)-1,1).getDay()),l=[];if(u>0){var f=u-1;l=he(new Date(e,Number(r)-2,Number(ne(e,Number(r)-1))-f),new Date(e,Number(r)-2,ne(e,Number(r)-1)),n)}var h=Number(new Date(e,Number(r)-1,ne(e,r)).getDay()),c=[];if(h<6){var s=6-(h+1);c=he(new Date(e,Number(r),1),new Date(e,Number(r),1+s),n)}var m=[a,l,i,c];return!0===t?m.flat():m},daysInCalendar:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!G(e))throw new Error(Q);if(!q(r))throw new Error(X);if(!K(t))throw new Error("Please enter a format of date correctly");return he(new Date(e,Number(r)-1,1),new Date(e,Number(r)-1,ne(e,r)),t)},prevDaysInCalendar:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!G(e))throw new Error(Q);if(!q(r))throw new Error(X);if(!K(t))throw new Error("Please enter a format of date correctly");var n=Number(new Date(e,Number(r)-1,1).getDay()),o=[];if(n>0){var a=n-1;o=he(new Date(e,Number(r)-2,Number(ne(e,Number(r)-1))-a),new Date(e,Number(r)-2,ne(e,Number(r)-1)),t)}return o},nextDaysInCalendar:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"YYYY-MM-DD";if(!G(e))throw new Error(Q);if(!q(r))throw new Error(X);if(!K(t))throw new Error("Please enter a format of date correctly");var n=Number(new Date(e,Number(r)-1,ne(e,r)).getDay()),o=[];if(n<6){var a=6-(n+1);o=he(new Date(e,Number(r),1),new Date(e,Number(r),1+a),t)}return o},weeklyCalendar:function(e,r,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YYYY-MM-DD",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"en-US";if(!G(e))throw new Error(Q);if(!q(r))throw new Error(X);if(!W(t))throw new Error(ee);if(!K(n))throw new Error("Please enter a format of date correctly");var a=te(o),i=ce(e,r,t),u=se(e,i,n);return P(a,u)[0]},calendarWithWeeks:function(e,r){var t=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"YYYY-MM-DD",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"en-US";if(!G(e))throw new Error(Q);if(!q(r))throw new Error(X);if(!K(n))throw new Error("Please enter a format of date correctly");var a=te(o),i=me(e,r),u=[];0!==Number(new Date(e,Number(r)-1,1).getDay())&&1===Number(r)&&(u.push("52"),u.push(se(Number(e)-1,52,n)));var l,f=m(i);try{for(f.s();!(l=f.n()).done;){var h=l.value;u.push(h),u.push(se(e,h,n))}}catch(e){f.e(e)}finally{f.f()}var c=["Week",a].concat(u);return!0===t?c.flat():c},dateToArray:function(e){if(!J(e))throw new Error("Please enter a valid date");return new Date(e).toJSON().replace("Z","").split(/-|:|\s|\.|T/g)}}),de=Object.freeze({__proto__:null,size:function(e,r){if(0===e)return"0 Bytes";var t=r||1,n=Math.floor(Math.log(e)/Math.log(1e3));return parseFloat((e/Math.pow(1e3,n)).toFixed(t))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][n]},name:function(e){if("string"==typeof e)return e.indexOf("",41)>40?e.slice(0,41)+"...":e},type:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"type",t=e.split("/");return"format"==r?t.shift():t.pop(),t.join("")},image:function(e){if("name"in e&&"string"==typeof e.name)return URL.createObjectURL(e)},date:function(e){return new Date(e).toDateString()},loadImage:function(e){"name"in e&&"string"==typeof e.name&&URL.revokeObjectURL(e)},formatSize:function(e){for(var r=0,t=e,n=t.length,o=0;o<n;o++)r+=t[o].size;for(var a=r+" bytes",i=["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],u=0,l=r/1024;l>1;l/=1024,u++)a=l.toFixed(3)+" "+i[u]+" ("+r+" bytes)";return a},humanSize:function(e){var r=arguments.length>1&&void 0!==arguments[1]&&arguments[1],t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,n=r?1e3:1024;if(Math.abs(e)<n)return e+" B";var o=r?["kB","MB","GB","TB","PB","EB","ZB","YB"]:["KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],a=-1,i=Math.pow(10,t);do{e/=n,++a}while(Math.round(Math.abs(e)*i)/i>=n&&a<o.length-1);return e.toFixed(t)+" "+o[a]},exported:function(e,r){if("object"===a(e)&&"string"==typeof r){var t=Array.from(e),n="";if("json"===r.toLowerCase())n="data:application/json;charset=utf-8,"+JSON.stringify(t,null,2);else if("csv"===r.toLowerCase()){var o,i="",u=m(t);try{for(u.s();!(o=u.n()).done;){var l=o.value;for(var f in l)i+=l[f]+",";i=i.trim().substring(0,i.length-1),i+="\n"}}catch(e){u.e(e)}finally{u.f()}n="data:text/csv;charset=utf-8,"+(i=i.trim().substring(0,i.length-1))}else if("sql"===r.toLowerCase()){var h="INSERT INTO `export_table` (";for(var c in t[0])h+="`"+c+"`,";h=h.trim().substring(0,h.length-1),h+=") VALUES ";var s,g=m(t);try{for(g.s();!(s=g.n()).done;){var w=s.value;for(var d in h+="(",w)h+="`"+w[d]+"`,";h=h.trim().substring(0,h.length-1),h+="),"}}catch(e){g.e(e)}finally{g.f()}h=h.trim().substring(0,h.length-1),n="data:application/sql;charset=utf-8,"+(h+=";")}else if("xml"===r.toLowerCase()){var v='<?xml version="1.0" encoding="UTF-8"?>\n<data>';for(var y in t){for(var p in v+="\n <entry>",y)v+="\n <"+p+"`>"+y[p]+"</"+p+"`>";v+="\n </entry>"}n="data:application/xml;charset=utf-8,"+(v+="\n</data>")}else if("xhs"===r.toLowerCase()){var b,N='//visit official site: http://xhs.glitch.me \n("data", [',E=m(t);try{for(E.s();!(b=E.n()).done;){var D=b.value;for(var A in N+='\n ("entry", [',D)N+='\n ("'+A+'", ',N+=D[A]+"),";N=N.trim().substring(0,N.length-1),N+="]),"}}catch(e){E.e(e)}finally{E.f()}N=N.trim().substring(0,N.length-1),n="data:application/xhs;charset=utf-8,"+(N="])")}return n}},download:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"txt",t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"export-to";if("string"==typeof e){var n=t+"."+r.toLowerCase(),o=encodeURI(e),a=document.createElement("a");a.href=o,a.download=n,document.body.appendChild(a),a.click(),document.body.removeChild(a)}},printed:function(e){if("object"===a(e)){var r=Array.from(e),t=document.createElement("table"),n=document.createElement("thead"),o=document.createElement("tbody");t.appendChild(n),t.appendChild(o);var i=document.createElement("tr");for(var u in r[0]){var l=document.createElement("th");l.textContent=u.replace(/^\w/,(function(e){return e.toUpperCase()})),i.appendChild(l)}n.appendChild(i);for(var f=0,h=r;f<h.length;f++){var c=h[f],s=document.createElement("tr");for(var m in c){var g=document.createElement("td");g.textContent=c[m],s.appendChild(g)}o.appendChild(s)}var w=window.open();w.document.body.appendChild(t),w.focus(),w.print()}}}),ve=function(e,r,t){var n;if(t){var o=new Date;o.setTime(o.getTime()+24*t*60*60*1e3),n="expires="+o.toGMTString()}else n="";document.cookie=e+"="+r+"; SameSite=Lax;"+n+"; path=/"},ye=function(e){for(var r=e+"=",t=document.cookie.split(";"),n=0;n<t.length;n++){for(var o=t[n];" "===o.charAt(0);)o=o.substring(1,o.length);if(0===o.indexOf(r))return o.substring(r.length,o.length)}return null},pe=function(e){return"object"===("undefined"==typeof window?"undefined":a(window))&&"".concat(e,"Storage")in window},be=function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"local";if(pe(r))return!!window["".concat(r,"Storage")].getItem(e)},Ne=Object.freeze({__proto__:null,setCookie:ve,getCookie:ye,hasCookie:function(e){return!!ye(e)},removeCookie:function(e){ve(e,"",-1)},clearCookie:function(){for(var e=document.cookie.split(";"),r=0;r<e.length;r++){var t=e[r],n=t.indexOf("="),o=n>-1?t.substr(0,n):t;document.cookie=o+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"}},isStorage:pe,isCookie:function(){return"object"===("undefined"==typeof document?"undefined":a(document))&&"cookie"in document},setStorage:function(e,r){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"local";pe(t)&&window["".concat(t,"Storage")].setItem(e,r)},getStorage:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"local";if(pe(r))return window["".concat(r,"Storage")].getItem(e)},hasStorage:be,removeStorage:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"local";pe(r)&&be(e,r)&&window["".concat(r,"Storage")].removeItem(e)},clearStorage:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"local";pe(e)&&window["".concat(e,"Storage")].clear()}}),Ee=Object.freeze({__proto__:null,ternary:function(e,r,t){if(!T(e)&&!T(r)&&!T(t))throw new Error("All arguments here only accept value in function");return e()?r():t()}});export{z as $array,d as $char,we as $date,de as $file,e as $int,w as $number,$ as $object,v as $string,z as array,d as char,we as date,de as file,Ee as func,e as int,w as number,$ as object,Ne as storage,v as string}; |
@@ -52,3 +52,10 @@ import { isArray } from './isArray.js' | ||
return { from: startPaginate, to: (endPaginate <= newArr.length) ? endPaginate : newArr.length, of: newArr.length} | ||
return { | ||
from: (newArr.length >= 1) ? startPaginate : 0, | ||
start: (newArr.length >= 1) ? startPaginate : 0, | ||
to: (endPaginate <= newArr.length) ? endPaginate : newArr.length, | ||
end: (endPaginate <= newArr.length) ? endPaginate : newArr.length, | ||
of: newArr.length, | ||
length: newArr.length | ||
} | ||
} | ||
@@ -55,0 +62,0 @@ |
@@ -39,34 +39,31 @@ import { isArray } from './isArray.js' | ||
export const searchBy = (...filterStr) => { | ||
if(filterStr.length < 1) { | ||
throw new Error('This argument must have at least one argument in either string or number') | ||
export const searchBy = (fromArr, queryArr, propArr) => { | ||
if(!isArray(fromArr)) { | ||
throw new Error('The first argument must be in array of objects and it is needed in order to be searched') | ||
} | ||
if(!isArray(queryArr) && queryArr.length < 1) { | ||
throw new Error('The second argument must have at least one argument either in a string or in a number') | ||
} | ||
if(!isArray(propArr) && propArr.length < 1) { | ||
throw new Error('The last argument required at least one argument either in a string or in a number') | ||
} | ||
return (fromArr, ...whereArr) => { | ||
if(!isArray(fromArr)) { | ||
throw new Error('Array of objects is needed in order to be searched') | ||
} | ||
if(whereArr.length < 1) { | ||
throw new Error('The last argument required at least one argument in either string or number') | ||
} | ||
let filteredArray = [] | ||
for(let filterString of filterStr) { | ||
const filterFromArr = Array.from(fromArr).filter(obj => { | ||
for(const val of Array.from(whereArr)) { | ||
if(val in obj) { | ||
if(isNumber(obj[val]) && Number(obj[val]) === Number(filterString)) { | ||
return true | ||
} else if(isString(obj[val]) && obj[val].toLowerCase().indexOf(filterString.toLowerCase()) !== -1) { | ||
return true | ||
} | ||
let filteredArray = [] | ||
for(let query of queryArr) { | ||
const filterFromArr = Array.from(fromArr).filter(obj => { | ||
for(const val of Array.from(propArr)) { | ||
if(val in obj) { | ||
if(isNumber(obj[val]) && Number(obj[val]) === Number(query)) { | ||
return true | ||
} else if(isString(obj[val]) && obj[val].toLowerCase().indexOf(query.toLowerCase()) !== -1) { | ||
return true | ||
} | ||
} | ||
return false | ||
}) | ||
filteredArray = unique(filteredArray.concat(filterFromArr)) | ||
} | ||
} | ||
return false | ||
}) | ||
filteredArray = unique(filteredArray.concat(filterFromArr)) | ||
} | ||
return filteredArray | ||
} | ||
return filteredArray | ||
} |
@@ -50,16 +50,16 @@ const exported = (oriArr, toFile) => { | ||
toStringFile = 'data:application/xml;charset=utf-8,' + xmlStr | ||
} else if(toFile.toLowerCase() === 'vhs') { | ||
let vhsStr = '//visit official site: http://vhs-file-format.glitch.me \n("data", [' | ||
for(const vhsObj of oriArray) { | ||
vhsStr += '\n ("entry", [' | ||
for(const vhsKey in vhsObj) { | ||
vhsStr += '\n ("'+ vhsKey +'", ' | ||
vhsStr += vhsObj[vhsKey] +'),' | ||
} else if(toFile.toLowerCase() === 'xhs') { | ||
let xhsStr = '//visit official site: http://xhs.glitch.me \n("data", [' | ||
for(const xhsObj of oriArray) { | ||
xhsStr += '\n ("entry", [' | ||
for(const xhsKey in xhsObj) { | ||
xhsStr += '\n ("'+ xhsKey +'", ' | ||
xhsStr += xhsObj[xhsKey] +'),' | ||
} | ||
vhsStr = vhsStr.trim().substring(0, vhsStr.length - 1) | ||
vhsStr += ']),' | ||
xhsStr = xhsStr.trim().substring(0, xhsStr.length - 1) | ||
xhsStr += ']),' | ||
} | ||
vhsStr = vhsStr.trim().substring(0, vhsStr.length - 1) | ||
vhsStr = '])' | ||
toStringFile = 'data:application/vhs;charset=utf-8,' + vhsStr | ||
xhsStr = xhsStr.trim().substring(0, xhsStr.length - 1) | ||
xhsStr = '])' | ||
toStringFile = 'data:application/xhs;charset=utf-8,' + xhsStr | ||
} | ||
@@ -66,0 +66,0 @@ |
@@ -1,1 +0,1 @@ | ||
function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(e)}function e(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 n=[],t=!0,o=!1,a=void 0;try{for(var i,u=r[Symbol.iterator]();!(t=(i=u.next()).done)&&(n.push(i.value),!e||n.length!==e);t=!0);}catch(r){o=!0,a=r}finally{try{t||null==u.return||u.return()}finally{if(o)throw a}}return n}(r,e)||t(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 n(r){return function(r){if(Array.isArray(r))return o(r)}(r)||function(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}(r)||t(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 t(r,e){if(r){if("string"==typeof r)return o(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(r,e):void 0}}function o(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n<e;n++)t[n]=r[n];return t}function a(r,e){var n;if("undefined"==typeof Symbol||null==r[Symbol.iterator]){if(Array.isArray(r)||(n=t(r))||e&&r&&"number"==typeof r.length){n&&(r=n);var o=0,a=function(){};return{s:a,n:function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}},e:function(r){throw r},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,f=!1;return{s:function(){n=r[Symbol.iterator]()},n:function(){var r=n.next();return u=r.done,r},e:function(r){f=!0,i=r},f:function(){try{u||null==n.return||n.return()}finally{if(f)throw i}}}}var i=function(e){return!("object"!==r(e)||null===e||!Array.isArray(e))},u=function(r,e){if(!i(r)&&!i(e))throw new Error("The both of arguments must be in arrays");var n,t=new Set(r),o=a(e);try{for(o.s();!(n=o.n()).done;){var u=n.value;if(!t.has(u))return!1}}catch(r){o.e(r)}finally{o.f()}return!0},f=function(r){return!isNaN(r)&&"number"==typeof Number(r)},l=function(r){if("number"!=typeof r&&"string"!=typeof r)throw new Error("You must input only number format here");return 1===Math.sign(r)},h=function(r){if("number"!=typeof r&&"string"!=typeof r)throw new Error("You must input only number format here");return-1===Math.sign(r)},c=function(e){return"object"===r(e)&&null!==e&&"[object Object]"===Object.prototype.toString.call(e)},s=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{position:null,index:null};if(!i(r))throw new Error("On the first argument, only array accept here");if(!c(e))throw new Error("On the second argument, only object with 2 properties (position and index property) accepted");for(var n=arguments.length,t=new Array(n>2?n-2:0),o=2;o<n;o++)t[o-2]=arguments[o];if(t.length<1)throw new Error("On the third or the next arguments, you have to enter at least one argument");var a=[];return"first"===e.position?a=y.apply(void 0,[r].concat(t)):"last"===e.position?a=m.apply(void 0,[r].concat(t)):"before"===e.position?a=v.apply(void 0,[r,e.index].concat(t)):"after"===e.position&&(a=w.apply(void 0,[r,e.index].concat(t))),a},y=function(r){if(!i(r))throw new Error("On the first argument must be in array type");for(var e=arguments.length,n=new Array(e>1?e-1:0),t=1;t<e;t++)n[t-1]=arguments[t];if(n.length<1)throw new Error("On the next arguments, you have to provide at least one argument");var o=Array.from(r);return o.unshift.apply(o,n),o},m=function(r){if(!i(r))throw new Error("On the first argument must be in array type");for(var e=arguments.length,n=new Array(e>1?e-1:0),t=1;t<e;t++)n[t-1]=arguments[t];if(n.length<1)throw new Error("On the next arguments, you have to provide at least one argument");var o=Array.from(r);return o.push.apply(o,n),o},v=function(r,e){if(!i(r))throw new Error("On the first argument, here only accept array type");if(!f(e))throw new Error("On the second argument, accept only numeric or number type");for(var n=arguments.length,t=new Array(n>2?n-2:0),o=2;o<n;o++)t[o-2]=arguments[o];if(t.length<1)throw new Error("On the next arguments, you have to enter at least one value");var a=Array.from(r),u=isNaN(e)?1:e;return a.splice.apply(a,[Number(u)-1,0].concat(t)),a},w=function(r,e){if(!i(r))throw new Error("On the first argument, here only accept array type");if(!f(e))throw new Error("On the second argument, accept only numeric or number type");for(var n=arguments.length,t=new Array(n>2?n-2:0),o=2;o<n;o++)t[o-2]=arguments[o];if(t.length<1)throw new Error("On the next arguments, you have to enter at least one value");var a=Array.from(r),u=isNaN(e)?0:e;return a.splice.apply(a,[Number(u)+1,0].concat(t)),a},g=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{key:"id",value:0};if(!i(r))throw new Error("You must enter the first argument in array only");var t=Array.from(r),o=-1;return"key"in n&&"value"in n?o=t.length>=1?t.findIndex((function(r){return r[n.key]===n.value})):-1:t.length>=1&&(o=t.findIndex((function(r){for(var t=0,o=Object.entries(n);t<o.length;t++){var a=e(o[t],2),i=a[0],u=a[1];if(i in r&&r[i]===u)return!0}}))),o},p=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dense";if(!i(r))throw new Error("You must enter the first argument in array only");return"sparse"===e?Object.keys(r).map((function(r){return Number(r)})):n(r.keys())},d=function(r){if(!i(r))throw new Error("You must enter the argument in array only");var e=p(r);return Number(e[Math.floor(Math.random()*e.length)])},b=function(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];if(n){for(var o={},a=0,i=n;a<i.length;a++)for(var u=i[a],f=0,l=Object.entries(u);f<l.length;f++){var h=e(l[f],2),c=h[0],s=h[1];o[c]=s}return o}},E=function(r,e,n){if(!i(r))throw new Error("You have to enter array only on the first argument");if(!c(e))throw new Error("You must enter object only here on the second argument");if(!c(n)&&!f(n))throw new Error("You must enter object only on the second argument");var t=Array.from(r),o=c(n)?g(t,n):Number(n);return t.map((function(r,n){var t=r;return n===o&&(t=b(r,e)),t}))},A=function(r,e,n){if(!i(r))throw new Error("You have to enter array only on the first argument");if(!c(e))throw new Error("You must enter object only here on the second argument");if(!i(n))throw new Error("You must enter array of objects or numbers on the second argument");var t=Array.from(r);return t.map((function(r,o){var i,u=r,f=a(n);try{for(f.s();!(i=f.n()).done;){var l=i.value;o===(c(l)?g(t,l):Number(l))&&(u=b(r,e))}}catch(r){f.e(r)}finally{f.f()}return u}))},N=function(e){if(!i(e))throw new Error("Please provide array that you want to remove its element");for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];if(t.length<1)throw new Error("On the last of argument, you have to enter at least one argument");for(var a=Array.from(e),u=[],f=function(){var e=h[l];if("string"==typeof e&&"first"===e)a=a.map((function(r,e){return 0===e?null:r})),u=a;else if("string"==typeof e&&"last"===e)a=a.map((function(r,e){return e===a.length-1?null:r})),u=a;else if("number"==typeof e)a=a.map((function(r,n){return n===e?null:r})),u=a;else if("object"===r(e)&&null!==e){var n=g(a,e);a=a.map((function(r,e){return e===n?null:r})),u=a}},l=0,h=t;l<h.length;l++)f();return u.filter((function(r){return null!==r}))},O=function(r){for(var e=arguments.length,n=new Array(e>1?e-1:0),t=1;t<e;t++)n[t-1]=arguments[t];if(!i(r))throw new Error("On the first argument, you have to provide array only");if(n.length<1)throw new Error("On the second argument, you must enter at least one value");var o=Array.from(r);return o.map((function(r){var e,t={},o=a(n);try{for(o.s();!(e=o.n()).done;){var i=e.value;i in r&&(t[i]=r[i])}}catch(r){o.e(r)}finally{o.f()}return t}))},j=function(r){for(var e=arguments.length,n=new Array(e>1?e-1:0),t=1;t<e;t++)n[t-1]=arguments[t];if(!i(r))throw new Error("On the first argument, you have to provide array only");if(n.length<1)throw new Error("On the second argument, you must enter at least one value");var o=Array.from(r);return o.map((function(r){var e,t=r,o=a(n);try{for(o.s();!(e=o.n()).done;){var i=e.value;i in r&&delete t[i]}}catch(r){o.e(r)}finally{o.f()}return t}))},S=function(r){return function(e){var n=Array.from(e);if(n.includes(r)){var t=n.findIndex((function(e){return e===r}));n.splice(t,1)}else n.push(r);return n}},x=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=[],o={};o.id=n.id||"id",o.parent=n.parent||"parent",o.children=n.children||"children";var a=function(){Array.from(e).forEach((function(e){if("object"===r(e)&&null!==e){var n=e;n[o.parent]="0","object"===r(n[o.children])&&Array.isArray(n[o.children])&&(i(n[o.children],e),delete n[o.children]),t.push(n)}}))},i=function e(n,a){n.length>=1&&Array.from(n).forEach((function(n){if("object"===r(n)&&null!==n){var i=n;i[o.parent]=a[o.id],"object"===r(i[o.children])&&Array.isArray(i[o.children])&&(e(i[o.children],n),delete i[o.children]),t.push(i)}}))};return a(),t},T=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=[],o=Array.from(e),a={};a.id=n.id||"id",a.parent=n.parent||"parent",a.children=n.children||"children";var i=function(e){e.forEach((function(e){if("object"===r(e)&&null!==e){var n=null;("string"==typeof e[a.parent]&&"0"===e[a.parent]||"number"==typeof e[a.parent]&&0===e[a.parent])&&(n=u(e)),null!==n&&t.push(n)}}))},u=function(r){var e=r;return void 0!==r[a.children]&&null!==r[a.children]||(e[a.children]=f(r[a.id]),e[a.children].length<=0&&delete e[a.children]),delete e[a.parent],e},f=function(r){var e=[];return l(r).length>=1&&l(r).forEach((function(r){e.push(u(r))})),e},l=function(r){return o.filter((function(e){return e.parent===r}))};return i(o),t},Y=function(r){return"string"==typeof r},C=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!i(r))throw new Error("");var t=Array.from(r),o=[];if("string"==typeof e){var u,f=new Set,l=a(t);try{for(l.s();!(u=l.n()).done;){var h=u.value;f.has(h[e])||f.add(h[e])}}catch(r){l.e(r)}finally{l.f()}o=n(f)}else o=Array.from(new Set(t));return o},L=function(r){if(!i)throw new Error("The first argument must be in array");for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];if(t.length<1)throw new Error("On the next arguments, you must provide at least one argument in either string or number");for(var a=[],u=function(){var n=h[l],t=Array.from(r).filter((function(r){if(f(r)&&Number(r)===Number(n))return!0;if(Y(r)&&r.toLowerCase().includes(n.toLowerCase()))return!0;if(c(r))for(var t=0,o=Object.entries(r);t<o.length;t++){var a=e(o[t],2),i=a[0],u=a[1];if(f(r[i])&&Number(u)===Number(n))return!0;if(Y(r[i])&&u.toLowerCase().includes(n.toLowerCase()))return!0}return!1}));a=C(a.concat(t))},l=0,h=t;l<h.length;l++)u();return a},I=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(e.length<1)throw new Error("This argument must have at least one argument in either string or number");return function(r){for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];if(!i(r))throw new Error("Array of objects is needed in order to be searched");if(t.length<1)throw new Error("The last argument required at least one argument in either string or number");var u,l=[],h=a(e);try{var c=function(){var e=u.value,n=Array.from(r).filter((function(r){for(var n=0,o=Array.from(t);n<o.length;n++){var a=o[n];if(a in r){if(f(r[a])&&Number(r[a])===Number(e))return!0;if(Y(r[a])&&-1!==r[a].toLowerCase().indexOf(e.toLowerCase()))return!0}}return!1}));l=C(l.concat(n))};for(h.s();!(u=h.n()).done;)c()}catch(r){h.e(r)}finally{h.f()}return l}},k=function(r,n){if(!i(r))throw new Error("The first argument must be in array of objects");if(!c(n))throw new Error("The second argument must be in object type and must have at least one property");for(var t=Array.from(r),o=function(){var r=e(u[a],2),n=r[0],o=r[1],i=t.filter((function(r){if(n in r){if(f(r[n])&&Number(r[n])===Number(o))return!0;if(Y(r[n])&&r[n].toLowerCase().includes(o.toLowerCase()))return!0}return!1}));t=i},a=0,u=Object.entries(function(r){if(!c(r))throw new Error("This is object helper, you must provide the first argument in an object");for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];if(t.length<1)throw new Error("The next arguments must be in a string or in a number and at least one argument");for(var a={},i=new Set(t),u=0,f=Object.entries(r);u<f.length;u++){var l=e(f[u],1)[0];i.has(r[l])||(a[l]=r[l])}return a}(n,"",0));a<u.length;a++)o();return t},M=function(r){return"function"==typeof r},P=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc";if(!i(r))throw new Error("Only array of strings or numbers accepted");if(!Y(e))throw new Error('The second argument must be in a string and a value either "", "asc" or "desc"');var n=Array.from(r);return"asc"===e?n.sort((function(r,e){if(f(r)&&f(e))return Number(r)-Number(e);if(Y(r)&&Y(e)){var n=r.toLowerCase(),t=e.toLowerCase(),o=0;return n<t?o=-1:n>t&&(o=1),o}})):"desc"===e&&n.sort((function(r,e){if(f(r)&&f(e))return Number(e)-Number(r);if(Y(r)&&Y(e)){var n=r.toLowerCase(),t=e.toLowerCase(),o=0;return t<n?o=-1:t>n&&(o=1),o}})),n},H=function(r,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";if(!i(r))throw new Error("Only array of objects accepted");if(!Y(e))throw new Error("The second argument must be in a string and a value must be object property key or name");if(!Y(n))throw new Error('The third argument must be in a string and a value either "", "asc" or "desc"');var t=Array.from(r);return"asc"===n?t.sort((function(r,n){if(e in r&&e in n){if(f(r[e])&&f(n[e]))return Number(r[e])-Number(n[e]);if(Y(r[e])&&Y(n[e])){var t=r[e].toLowerCase(),o=n[e].toLowerCase(),a=0;return t<o?a=-1:t>o&&(a=1),a}}})):"desc"===n&&t.sort((function(r,n){if(e in r&&e in n){if(f(r[e])&&f(n[e]))return Number(n[e])-Number(r[e]);if(Y(r[e])&&Y(n[e])){var t=r[e].toLowerCase(),o=n[e].toLowerCase(),a=0;return o<t?a=-1:o>t&&(a=1),a}}})),t},q=function(r,e){if(!i(r))throw new Error("The first argument must be in an array type");if(!M(e))throw new Error("The second argument is a compare or callback function");var n=Array.from(r);return n.sort((function(r,n){return-1===Math.sign(e(r,n))?-1:1})),n},U=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!i(r))throw new Error("On the first argument, here only accept array");if(!f(e))throw new Error("This is the page active number, please enter number only");if(!f(n))throw new Error("This is the limit of entries in one page in a number, please enter number only");var t=Array.from(r),o=Number(n)*Number(e)-(Number(n)-1),a=Number(n)*Number(e);return t.slice(o-1,a<=t.length?a:t.length)},$=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if(!i(r))throw new Error("On the first argument, here only accept array");if(!f(e))throw new Error("This is the limit of entries in one page in a number, please enter number only");var n=Array.from(r),t=n.length/Number(e),o=Math.ceil(t);return o},z=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!i(r))throw new Error("On the first argument, here only accept array");if(!f(e))throw new Error("This is the page active number, please enter number only");if(!f(n))throw new Error("This is the limit of entries in one page in a number, please enter number only");var t=Array.from(r),o=Number(n)*Number(e)-(Number(n)-1),a=Number(n)*Number(e);return{from:o,to:a<=t.length?a:t.length,of:t.length}},B=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!f(r))throw new Error("This is the total or all pages in numbers, please enter number only");if(!f(e))throw new Error("This is the page active number, please enter number only");if(!f(n))throw new Error("This is the position of ellipsis [...], please enter number only");var t=[],o=Number(r)<Number(e)?Number(r):Number(e),a=Number(e)<1?1:Number(e),i=o+Number(n),u=a-Number(n);if(0===Number(n))for(var l=1;l<=Number(r);l++)t.push(l);else{if(a>1)for(var h=u;h<a;h++)t.push(h);for(var c=o;c<=i;c++)t.push(c)}var s=t.filter((function(r){return r>0})),y=s.filter((function(e){return e<=Number(r)}));return i<Number(r)&&0!==Number(n)&&y.push("..."),u>1&&0!==Number(n)&&y.unshift("..."),y},D=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!i(r))throw new Error("In the first argument, you must enter a data in array");var n=Array.from(r),t=0;if(n.length>=1)if("string"==typeof e&&""!==e){var o=n.map((function(r){return e in r?Number(r[e]):0}));t=o.reduce((function(r,e){return Number(r)+Number(e)}))}else t=n.reduce((function(r,e){return Number(r)+Number(e)}));return t},F=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];return Array.from(new Set(e.flat()))},G=function(r){if(!i(r))throw new Error("This argument only accept array");var e,n={},t=new Set,o=a(new Set(r));try{var u=function(){var o=e.value,a=Array.from(r).filter((function(r){return r===o}));t.has(a.length)||(t.add(a.length),n[a.length]=[]),a.forEach((function(r){n[a.length].push(r)}))};for(o.s();!(e=o.n()).done;)u()}catch(r){o.e(r)}finally{o.f()}return n},J=function(r,e){if(!i(r))throw new Error("The first paramenter only accept array");if(!M(e))throw new Error("The second paramenter only accept callback function");return r.filter((function(r){return e(r)})).length},K=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(!e&&e.length<=1)throw new Error("You have to provide here at least 2 arguments");var t=[],o={};e.forEach((function(r,e){if(i(r)?o[e]=new Set(r):o[e]=(new Set).add(r),0!==e){var n,u=a(r);try{for(u.s();!(n=u.n()).done;){var f=n.value;o[e-1].has(f)&&t.push(f)}}catch(r){u.e(r)}finally{u.f()}}}));var u=G(t);return Array.from(new Set(u[e.length-1]))},Q=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(!e&&e.length<=1)throw new Error("You have to provide here at least 2 arguments");var t=new Set,o=K.apply(void 0,e);return e.forEach((function(r){if(!i(r))throw new Error("Here only accept arrays from all arguments");var e,n=a(r);try{for(n.s();!(e=n.n()).done;){var u=e.value;o.includes(u)||t.has(u)||t.add(u)}}catch(r){n.e(r)}finally{n.f()}})),Array.from(t)},R=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(!e&&e.length<=1)throw new Error("You have to provide here at least 2 arguments");for(var t=new Set,o=[],a=0,u=e;a<u.length;a++){var f=u[a];if(!i(f))throw new Error("Here only accept arrays from all arguments");f.forEach((function(r){t.has(r)?(t.delete(r),o.push(r)):o.includes(r)||t.add(r)}))}return Array.from(t)},V=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(!e&&e.length<=1)throw new Error("You have to provide here at least 1 value");var o=Array.from(e);o.shift();var a=new Set(W.apply(void 0,[e[0]].concat(n(o))));return Array.from(a)},W=function(r){for(var e=arguments.length,n=new Array(e>1?e-1:0),t=1;t<e;t++)n[t-1]=arguments[t];if(!i(r)&&r.length<=0)throw new Error("You need to provide more values to your array");if(!n&&n.length<=0)throw new Error("You have to provide here at least 1 value");var o,u=[],f=a(r);try{for(f.s();!(o=f.n()).done;){var l=o.value;n.flat().includes(l)||u.push(l)}}catch(r){f.e(r)}finally{f.f()}return u},X=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(e.length<2&&!i(e[0])&&!i(e[1])&&Number(e[0].length)!==Number(e[1].length))throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var t=Array.from(e[0]).map((function(r){return[]})),o=0,a=e;o<a.length;o++){var u=a[o];u.forEach((function(r,e){e in t&&t[e].push(r)}))}return t},Z=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(e.length<2)throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var t=Array.from(e),o=[],a=t.shift(),i=function(){var r=f[u],e=new Map;r.forEach((function(r,n){a[n]&&e.set(a[n],r)})),o.push(Object.fromEntries(e))},u=0,f=t;u<f.length;u++)i();return o},_=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(e.length<2)throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var o=Array.from(e),a=Object.keys(o[0]),i={},u=0,f=a;u<f.length;u++){var l=f[u];i[l]=[]}for(var h=0,c=o;h<c.length;h++){var s=c[h];for(var y in s)i[y].push(s[y])}return[a].concat(n(X.apply(void 0,n(Object.values(i)))))},rr=function(){if(0===arguments.length||arguments.length>=4)throw new Error("Here only accept 3 arguments, so you have to provide at least 1 argument");var r=1===arguments.length?0:Number(arguments.length<=0?void 0:arguments[0]),e=Number(arguments.length>=2?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0]),n=3===arguments.length?Number(arguments.length<=2?void 0:arguments[2]):1;arguments.length<3&&h(e)&&(n=-1);var t=[],o=0,a=0;if(h(r)&&l(e)?o=r-1:l(r)&&h(e)?o=r+1:l(r)&&l(e)?o=r-1:h(r)&&h(e)&&(o=r+1),o<e){for(;o<e;)o++,n>1?(a+=n)<e&&t.push(a):o<e&&t.push(o);0!==r||t.includes(0)||t.unshift(0)}else if(o>e){for(;o>e;)o--,n<-1?(a-=n)>e&&t.unshift(a):o>e&&t.unshift(o);0!==r||t.includes(0)||t.push(0)}return 1===t.length&&0===t[0]?[]:t},er=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Only accept index of array elements and you must input at least one index in number type");return function(r,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!i(r))throw new Error("Please enter array only here");if(!f(n))throw new Error("Input only index number here");var o,u=Array.from(r),l=[],h=a(e);try{for(h.s();!(o=h.n()).done;){var c=o.value;void 0!==u[Number(c)]&&l.push(u[Number(c)])}}catch(r){h.e(r)}finally{h.f()}var s=N.apply(void 0,[u].concat(e));return s.splice.apply(s,[n,t].concat(l)),s}},nr=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Accept index of array elements only and you add at least one index in number");return function(r){if(!i(r))throw new Error("Please enter array only here");for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];if(0===t.length&&t.length!==e.length&&0!==K(e,t).length)throw new Error("Only accept index of array elements and the number of the first indexes must be the same as the second indexes and also, both indexes must be different");for(var a=Array.from(r),u=Array.from(r),f=0;f<e.length;f++)void 0!==e[f]&&void 0!==t[f]&&(u.splice(e[f],1,a[t[f]]),u.splice(t[f],1,a[e[f]]));return u}},tr=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Only accept index of array elements and you must enter at least one index in number type");return function(r,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!i(r))throw new Error("Accept array only here");if(!i(n))throw new Error("Accept array only here");if(!f(t))throw new Error("Input only index number here");var o,u=Array.from(r),l=Array.from(n),h=[],c=a(e);try{for(c.s();!(o=c.n()).done;){var s=o.value;void 0!==u[Number(s)]&&h.push(u[Number(s)])}}catch(r){c.e(r)}finally{c.f()}var y=null===t?Number(l.length):t;l.splice.apply(l,[y,0].concat(h));var m=N.apply(void 0,[u].concat(e));return{from:m,to:l}}},or=function(r){if(!i(r))throw new Error("Enter only array type here");return Array.from(r).filter((function(r){return null!=r&&!1!==r&&!isNaN(r)&&""!==r&&r>0}))},ar=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!i(r)&&r.length<=2)throw new Error("Please insert array only on the first argument and must have 3 values at least");if("number"!=typeof e)throw new Error("On the second argument, you must input in a number type only");var n,t=rr(e,r.length,e),o=[],u=a(t);try{for(u.s();!(n=u.n()).done;){var f=n.value,l=r.slice(Number(f)-Number(e),f);o.push(l)}}catch(r){u.e(r)}finally{u.f()}return t[Number(t.length)-1]<=r.length&&o.push(r.slice(t[Number(t.length)-1],r.length)),o},ir=function(r){if(!i(r)&&r.length<=2)throw new Error("This shuffle method only work on data in array type");for(var e=Array.from(r),n=Number(e.length)-1;n>2;n--){var t=e.slice(0,Number(n)+1);e=nr(n)(e,d(t))}return e},ur=function(r,e){if(!i(r))throw new Error("You must enter array literal here");if(!M(e))throw new Error("You have to enter a function or callback on the second argument");var n,t={},o=a(r);try{for(o.s();!(n=o.n()).done;){var u=n.value;void 0===t[e(u).toString()]&&(t[e(u).toString()]=[]),t[e(u).toString()].push(u)}}catch(r){o.e(r)}finally{o.f()}return t},fr=function(r,e,t){if(!i(r))throw new Error("On the first argument, you have to provide array only");if(!Y(e))throw new Error("New property must be in string type");if(!M(t))throw new Error("Callback must be in function or method");return Array.from(r).map((function(r){return r[e]=t.apply(void 0,n(Object.values(r).filter((function(r){return!1===isNaN(r)})))),r}))};export{R as asymmetricDifference,fr as calc,fr as calculate,ar as chunk,or as compact,V as complement,J as countBy,G as countDuplication,N as destroy,Q as difference,k as filter,k as filtered,x as flatten,ur as group,j as hidden,g as index,s as insert,w as insertAfter,v as insertBefore,y as insertFirst,m as insertLast,K as intersection,i as isArray,u as isSuperset,er as move,T as nested,z as pageInfo,$ as pages,U as paginate,B as pagination,d as randomIndex,rr as range,L as search,I as searchBy,O as select,z as show,ir as shuffle,P as sort,H as sortBy,q as sortWith,H as sorted,D as sum,nr as switched,p as toIndex,S as toggle,tr as transfer,X as transpose,F as union,C as unique,_ as unzip,E as update,A as updateBy,W as without,Z as zip}; | ||
function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(e)}function e(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 n=[],t=!0,o=!1,a=void 0;try{for(var i,u=r[Symbol.iterator]();!(t=(i=u.next()).done)&&(n.push(i.value),!e||n.length!==e);t=!0);}catch(r){o=!0,a=r}finally{try{t||null==u.return||u.return()}finally{if(o)throw a}}return n}(r,e)||t(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 n(r){return function(r){if(Array.isArray(r))return o(r)}(r)||function(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}(r)||t(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 t(r,e){if(r){if("string"==typeof r)return o(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(r,e):void 0}}function o(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n<e;n++)t[n]=r[n];return t}function a(r,e){var n;if("undefined"==typeof Symbol||null==r[Symbol.iterator]){if(Array.isArray(r)||(n=t(r))||e&&r&&"number"==typeof r.length){n&&(r=n);var o=0,a=function(){};return{s:a,n:function(){return o>=r.length?{done:!0}:{done:!1,value:r[o++]}},e:function(r){throw r},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,f=!1;return{s:function(){n=r[Symbol.iterator]()},n:function(){var r=n.next();return u=r.done,r},e:function(r){f=!0,i=r},f:function(){try{u||null==n.return||n.return()}finally{if(f)throw i}}}}var i=function(e){return!("object"!==r(e)||null===e||!Array.isArray(e))},u=function(r,e){if(!i(r)&&!i(e))throw new Error("The both of arguments must be in arrays");var n,t=new Set(r),o=a(e);try{for(o.s();!(n=o.n()).done;){var u=n.value;if(!t.has(u))return!1}}catch(r){o.e(r)}finally{o.f()}return!0},f=function(r){return!isNaN(r)&&"number"==typeof Number(r)},l=function(r){if("number"!=typeof r&&"string"!=typeof r)throw new Error("You must input only number format here");return 1===Math.sign(r)},h=function(r){if("number"!=typeof r&&"string"!=typeof r)throw new Error("You must input only number format here");return-1===Math.sign(r)},s=function(e){return"object"===r(e)&&null!==e&&"[object Object]"===Object.prototype.toString.call(e)},c=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{position:null,index:null};if(!i(r))throw new Error("On the first argument, only array accept here");if(!s(e))throw new Error("On the second argument, only object with 2 properties (position and index property) accepted");for(var n=arguments.length,t=new Array(n>2?n-2:0),o=2;o<n;o++)t[o-2]=arguments[o];if(t.length<1)throw new Error("On the third or the next arguments, you have to enter at least one argument");var a=[];return"first"===e.position?a=m.apply(void 0,[r].concat(t)):"last"===e.position?a=y.apply(void 0,[r].concat(t)):"before"===e.position?a=v.apply(void 0,[r,e.index].concat(t)):"after"===e.position&&(a=w.apply(void 0,[r,e.index].concat(t))),a},m=function(r){if(!i(r))throw new Error("On the first argument must be in array type");for(var e=arguments.length,n=new Array(e>1?e-1:0),t=1;t<e;t++)n[t-1]=arguments[t];if(n.length<1)throw new Error("On the next arguments, you have to provide at least one argument");var o=Array.from(r);return o.unshift.apply(o,n),o},y=function(r){if(!i(r))throw new Error("On the first argument must be in array type");for(var e=arguments.length,n=new Array(e>1?e-1:0),t=1;t<e;t++)n[t-1]=arguments[t];if(n.length<1)throw new Error("On the next arguments, you have to provide at least one argument");var o=Array.from(r);return o.push.apply(o,n),o},v=function(r,e){if(!i(r))throw new Error("On the first argument, here only accept array type");if(!f(e))throw new Error("On the second argument, accept only numeric or number type");for(var n=arguments.length,t=new Array(n>2?n-2:0),o=2;o<n;o++)t[o-2]=arguments[o];if(t.length<1)throw new Error("On the next arguments, you have to enter at least one value");var a=Array.from(r),u=isNaN(e)?1:e;return a.splice.apply(a,[Number(u)-1,0].concat(t)),a},w=function(r,e){if(!i(r))throw new Error("On the first argument, here only accept array type");if(!f(e))throw new Error("On the second argument, accept only numeric or number type");for(var n=arguments.length,t=new Array(n>2?n-2:0),o=2;o<n;o++)t[o-2]=arguments[o];if(t.length<1)throw new Error("On the next arguments, you have to enter at least one value");var a=Array.from(r),u=isNaN(e)?0:e;return a.splice.apply(a,[Number(u)+1,0].concat(t)),a},g=function(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{key:"id",value:0};if(!i(r))throw new Error("You must enter the first argument in array only");var t=Array.from(r),o=-1;return"key"in n&&"value"in n?o=t.length>=1?t.findIndex((function(r){return r[n.key]===n.value})):-1:t.length>=1&&(o=t.findIndex((function(r){for(var t=0,o=Object.entries(n);t<o.length;t++){var a=e(o[t],2),i=a[0],u=a[1];if(i in r&&r[i]===u)return!0}}))),o},d=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dense";if(!i(r))throw new Error("You must enter the first argument in array only");return"sparse"===e?Object.keys(r).map((function(r){return Number(r)})):n(r.keys())},p=function(r){if(!i(r))throw new Error("You must enter the argument in array only");var e=d(r);return Number(e[Math.floor(Math.random()*e.length)])},b=function(){for(var r=arguments.length,n=new Array(r),t=0;t<r;t++)n[t]=arguments[t];if(n){for(var o={},a=0,i=n;a<i.length;a++)for(var u=i[a],f=0,l=Object.entries(u);f<l.length;f++){var h=e(l[f],2),s=h[0],c=h[1];o[s]=c}return o}},E=function(r,e,n){if(!i(r))throw new Error("You have to enter array only on the first argument");if(!s(e))throw new Error("You must enter object only here on the second argument");if(!s(n)&&!f(n))throw new Error("You must enter object only on the second argument");var t=Array.from(r),o=s(n)?g(t,n):Number(n);return t.map((function(r,n){var t=r;return n===o&&(t=b(r,e)),t}))},A=function(r,e,n){if(!i(r))throw new Error("You have to enter array only on the first argument");if(!s(e))throw new Error("You must enter object only here on the second argument");if(!i(n))throw new Error("You must enter array of objects or numbers on the second argument");var t=Array.from(r);return t.map((function(r,o){var i,u=r,f=a(n);try{for(f.s();!(i=f.n()).done;){var l=i.value;o===(s(l)?g(t,l):Number(l))&&(u=b(r,e))}}catch(r){f.e(r)}finally{f.f()}return u}))},N=function(e){if(!i(e))throw new Error("Please provide array that you want to remove its element");for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];if(t.length<1)throw new Error("On the last of argument, you have to enter at least one argument");for(var a=Array.from(e),u=[],f=function(){var e=h[l];if("string"==typeof e&&"first"===e)a=a.map((function(r,e){return 0===e?null:r})),u=a;else if("string"==typeof e&&"last"===e)a=a.map((function(r,e){return e===a.length-1?null:r})),u=a;else if("number"==typeof e)a=a.map((function(r,n){return n===e?null:r})),u=a;else if("object"===r(e)&&null!==e){var n=g(a,e);a=a.map((function(r,e){return e===n?null:r})),u=a}},l=0,h=t;l<h.length;l++)f();return u.filter((function(r){return null!==r}))},O=function(r){for(var e=arguments.length,n=new Array(e>1?e-1:0),t=1;t<e;t++)n[t-1]=arguments[t];if(!i(r))throw new Error("On the first argument, you have to provide array only");if(n.length<1)throw new Error("On the second argument, you must enter at least one value");var o=Array.from(r);return o.map((function(r){var e,t={},o=a(n);try{for(o.s();!(e=o.n()).done;){var i=e.value;i in r&&(t[i]=r[i])}}catch(r){o.e(r)}finally{o.f()}return t}))},j=function(r){for(var e=arguments.length,n=new Array(e>1?e-1:0),t=1;t<e;t++)n[t-1]=arguments[t];if(!i(r))throw new Error("On the first argument, you have to provide array only");if(n.length<1)throw new Error("On the second argument, you must enter at least one value");var o=Array.from(r);return o.map((function(r){var e,t=r,o=a(n);try{for(o.s();!(e=o.n()).done;){var i=e.value;i in r&&delete t[i]}}catch(r){o.e(r)}finally{o.f()}return t}))},S=function(r){return function(e){var n=Array.from(e);if(n.includes(r)){var t=n.findIndex((function(e){return e===r}));n.splice(t,1)}else n.push(r);return n}},x=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=[],o={};o.id=n.id||"id",o.parent=n.parent||"parent",o.children=n.children||"children";var a=function(){Array.from(e).forEach((function(e){if("object"===r(e)&&null!==e){var n=e;n[o.parent]="0","object"===r(n[o.children])&&Array.isArray(n[o.children])&&(i(n[o.children],e),delete n[o.children]),t.push(n)}}))},i=function e(n,a){n.length>=1&&Array.from(n).forEach((function(n){if("object"===r(n)&&null!==n){var i=n;i[o.parent]=a[o.id],"object"===r(i[o.children])&&Array.isArray(i[o.children])&&(e(i[o.children],n),delete i[o.children]),t.push(i)}}))};return a(),t},T=function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=[],o=Array.from(e),a={};a.id=n.id||"id",a.parent=n.parent||"parent",a.children=n.children||"children";var i=function(e){e.forEach((function(e){if("object"===r(e)&&null!==e){var n=null;("string"==typeof e[a.parent]&&"0"===e[a.parent]||"number"==typeof e[a.parent]&&0===e[a.parent])&&(n=u(e)),null!==n&&t.push(n)}}))},u=function(r){var e=r;return void 0!==r[a.children]&&null!==r[a.children]||(e[a.children]=f(r[a.id]),e[a.children].length<=0&&delete e[a.children]),delete e[a.parent],e},f=function(r){var e=[];return l(r).length>=1&&l(r).forEach((function(r){e.push(u(r))})),e},l=function(r){return o.filter((function(e){return e.parent===r}))};return i(o),t},Y=function(r){return"string"==typeof r},C=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!i(r))throw new Error("");var t=Array.from(r),o=[];if("string"==typeof e){var u,f=new Set,l=a(t);try{for(l.s();!(u=l.n()).done;){var h=u.value;f.has(h[e])||f.add(h[e])}}catch(r){l.e(r)}finally{l.f()}o=n(f)}else o=Array.from(new Set(t));return o},L=function(r){if(!i)throw new Error("The first argument must be in array");for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];if(t.length<1)throw new Error("On the next arguments, you must provide at least one argument in either string or number");for(var a=[],u=function(){var n=h[l],t=Array.from(r).filter((function(r){if(f(r)&&Number(r)===Number(n))return!0;if(Y(r)&&r.toLowerCase().includes(n.toLowerCase()))return!0;if(s(r))for(var t=0,o=Object.entries(r);t<o.length;t++){var a=e(o[t],2),i=a[0],u=a[1];if(f(r[i])&&Number(u)===Number(n))return!0;if(Y(r[i])&&u.toLowerCase().includes(n.toLowerCase()))return!0}return!1}));a=C(a.concat(t))},l=0,h=t;l<h.length;l++)u();return a},I=function(r,e,n){if(!i(r))throw new Error("The first argument must be in array of objects and it is needed in order to be searched");if(!i(e)&&e.length<1)throw new Error("The second argument must have at least one argument either in a string or in a number");if(!i(n)&&n.length<1)throw new Error("The last argument required at least one argument either in a string or in a number");var t,o=[],u=a(e);try{var l=function(){var e=t.value,a=Array.from(r).filter((function(r){for(var t=0,o=Array.from(n);t<o.length;t++){var a=o[t];if(a in r){if(f(r[a])&&Number(r[a])===Number(e))return!0;if(Y(r[a])&&-1!==r[a].toLowerCase().indexOf(e.toLowerCase()))return!0}}return!1}));o=C(o.concat(a))};for(u.s();!(t=u.n()).done;)l()}catch(r){u.e(r)}finally{u.f()}return o},k=function(r,n){if(!i(r))throw new Error("The first argument must be in array of objects");if(!s(n))throw new Error("The second argument must be in object type and must have at least one property");for(var t=Array.from(r),o=function(){var r=e(u[a],2),n=r[0],o=r[1],i=t.filter((function(r){if(n in r){if(f(r[n])&&Number(r[n])===Number(o))return!0;if(Y(r[n])&&r[n].toLowerCase().includes(o.toLowerCase()))return!0}return!1}));t=i},a=0,u=Object.entries(function(r){if(!s(r))throw new Error("This is object helper, you must provide the first argument in an object");for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];if(t.length<1)throw new Error("The next arguments must be in a string or in a number and at least one argument");for(var a={},i=new Set(t),u=0,f=Object.entries(r);u<f.length;u++){var l=e(f[u],1)[0];i.has(r[l])||(a[l]=r[l])}return a}(n,"",0));a<u.length;a++)o();return t},M=function(r){return"function"==typeof r},P=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"asc";if(!i(r))throw new Error("Only array of strings or numbers accepted");if(!Y(e))throw new Error('The second argument must be in a string and a value either "", "asc" or "desc"');var n=Array.from(r);return"asc"===e?n.sort((function(r,e){if(f(r)&&f(e))return Number(r)-Number(e);if(Y(r)&&Y(e)){var n=r.toLowerCase(),t=e.toLowerCase(),o=0;return n<t?o=-1:n>t&&(o=1),o}})):"desc"===e&&n.sort((function(r,e){if(f(r)&&f(e))return Number(e)-Number(r);if(Y(r)&&Y(e)){var n=r.toLowerCase(),t=e.toLowerCase(),o=0;return t<n?o=-1:t>n&&(o=1),o}})),n},H=function(r,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"asc";if(!i(r))throw new Error("Only array of objects accepted");if(!Y(e))throw new Error("The second argument must be in a string and a value must be object property key or name");if(!Y(n))throw new Error('The third argument must be in a string and a value either "", "asc" or "desc"');var t=Array.from(r);return"asc"===n?t.sort((function(r,n){if(e in r&&e in n){if(f(r[e])&&f(n[e]))return Number(r[e])-Number(n[e]);if(Y(r[e])&&Y(n[e])){var t=r[e].toLowerCase(),o=n[e].toLowerCase(),a=0;return t<o?a=-1:t>o&&(a=1),a}}})):"desc"===n&&t.sort((function(r,n){if(e in r&&e in n){if(f(r[e])&&f(n[e]))return Number(n[e])-Number(r[e]);if(Y(r[e])&&Y(n[e])){var t=r[e].toLowerCase(),o=n[e].toLowerCase(),a=0;return o<t?a=-1:o>t&&(a=1),a}}})),t},q=function(r,e){if(!i(r))throw new Error("The first argument must be in an array type");if(!M(e))throw new Error("The second argument is a compare or callback function");var n=Array.from(r);return n.sort((function(r,n){return-1===Math.sign(e(r,n))?-1:1})),n},U=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!i(r))throw new Error("On the first argument, here only accept array");if(!f(e))throw new Error("This is the page active number, please enter number only");if(!f(n))throw new Error("This is the limit of entries in one page in a number, please enter number only");var t=Array.from(r),o=Number(n)*Number(e)-(Number(n)-1),a=Number(n)*Number(e);return t.slice(o-1,a<=t.length?a:t.length)},$=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10;if(!i(r))throw new Error("On the first argument, here only accept array");if(!f(e))throw new Error("This is the limit of entries in one page in a number, please enter number only");var n=Array.from(r),t=n.length/Number(e),o=Math.ceil(t);return o},z=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(!i(r))throw new Error("On the first argument, here only accept array");if(!f(e))throw new Error("This is the page active number, please enter number only");if(!f(n))throw new Error("This is the limit of entries in one page in a number, please enter number only");var t=Array.from(r),o=Number(n)*Number(e)-(Number(n)-1),a=Number(n)*Number(e);return{from:t.length>=1?o:0,start:t.length>=1?o:0,to:a<=t.length?a:t.length,end:a<=t.length?a:t.length,of:t.length,length:t.length}},B=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!f(r))throw new Error("This is the total or all pages in numbers, please enter number only");if(!f(e))throw new Error("This is the page active number, please enter number only");if(!f(n))throw new Error("This is the position of ellipsis [...], please enter number only");var t=[],o=Number(r)<Number(e)?Number(r):Number(e),a=Number(e)<1?1:Number(e),i=o+Number(n),u=a-Number(n);if(0===Number(n))for(var l=1;l<=Number(r);l++)t.push(l);else{if(a>1)for(var h=u;h<a;h++)t.push(h);for(var s=o;s<=i;s++)t.push(s)}var c=t.filter((function(r){return r>0})),m=c.filter((function(e){return e<=Number(r)}));return i<Number(r)&&0!==Number(n)&&m.push("..."),u>1&&0!==Number(n)&&m.unshift("..."),m},D=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(!i(r))throw new Error("In the first argument, you must enter a data in array");var n=Array.from(r),t=0;if(n.length>=1)if("string"==typeof e&&""!==e){var o=n.map((function(r){return e in r?Number(r[e]):0}));t=o.reduce((function(r,e){return Number(r)+Number(e)}))}else t=n.reduce((function(r,e){return Number(r)+Number(e)}));return t},F=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];return Array.from(new Set(e.flat()))},G=function(r){if(!i(r))throw new Error("This argument only accept array");var e,n={},t=new Set,o=a(new Set(r));try{var u=function(){var o=e.value,a=Array.from(r).filter((function(r){return r===o}));t.has(a.length)||(t.add(a.length),n[a.length]=[]),a.forEach((function(r){n[a.length].push(r)}))};for(o.s();!(e=o.n()).done;)u()}catch(r){o.e(r)}finally{o.f()}return n},J=function(r,e){if(!i(r))throw new Error("The first paramenter only accept array");if(!M(e))throw new Error("The second paramenter only accept callback function");return r.filter((function(r){return e(r)})).length},K=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(!e&&e.length<=1)throw new Error("You have to provide here at least 2 arguments");var t=[],o={};e.forEach((function(r,e){if(i(r)?o[e]=new Set(r):o[e]=(new Set).add(r),0!==e){var n,u=a(r);try{for(u.s();!(n=u.n()).done;){var f=n.value;o[e-1].has(f)&&t.push(f)}}catch(r){u.e(r)}finally{u.f()}}}));var u=G(t);return Array.from(new Set(u[e.length-1]))},Q=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(!e&&e.length<=1)throw new Error("You have to provide here at least 2 arguments");var t=new Set,o=K.apply(void 0,e);return e.forEach((function(r){if(!i(r))throw new Error("Here only accept arrays from all arguments");var e,n=a(r);try{for(n.s();!(e=n.n()).done;){var u=e.value;o.includes(u)||t.has(u)||t.add(u)}}catch(r){n.e(r)}finally{n.f()}})),Array.from(t)},R=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(!e&&e.length<=1)throw new Error("You have to provide here at least 2 arguments");for(var t=new Set,o=[],a=0,u=e;a<u.length;a++){var f=u[a];if(!i(f))throw new Error("Here only accept arrays from all arguments");f.forEach((function(r){t.has(r)?(t.delete(r),o.push(r)):o.includes(r)||t.add(r)}))}return Array.from(t)},V=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(!e&&e.length<=1)throw new Error("You have to provide here at least 1 value");var o=Array.from(e);o.shift();var a=new Set(W.apply(void 0,[e[0]].concat(n(o))));return Array.from(a)},W=function(r){for(var e=arguments.length,n=new Array(e>1?e-1:0),t=1;t<e;t++)n[t-1]=arguments[t];if(!i(r)&&r.length<=0)throw new Error("You need to provide more values to your array");if(!n&&n.length<=0)throw new Error("You have to provide here at least 1 value");var o,u=[],f=a(r);try{for(f.s();!(o=f.n()).done;){var l=o.value;n.flat().includes(l)||u.push(l)}}catch(r){f.e(r)}finally{f.f()}return u},X=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(e.length<2&&!i(e[0])&&!i(e[1])&&Number(e[0].length)!==Number(e[1].length))throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var t=Array.from(e[0]).map((function(r){return[]})),o=0,a=e;o<a.length;o++){var u=a[o];u.forEach((function(r,e){e in t&&t[e].push(r)}))}return t},Z=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(e.length<2)throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var t=Array.from(e),o=[],a=t.shift(),i=function(){var r=f[u],e=new Map;r.forEach((function(r,n){a[n]&&e.set(a[n],r)})),o.push(Object.fromEntries(e))},u=0,f=t;u<f.length;u++)i();return o},_=function(){for(var r=arguments.length,e=new Array(r),t=0;t<r;t++)e[t]=arguments[t];if(e.length<2)throw new Error("You have to provide at least 2 arguments, both in arrays with the same length");for(var o=Array.from(e),a=Object.keys(o[0]),i={},u=0,f=a;u<f.length;u++){var l=f[u];i[l]=[]}for(var h=0,s=o;h<s.length;h++){var c=s[h];for(var m in c)i[m].push(c[m])}return[a].concat(n(X.apply(void 0,n(Object.values(i)))))},rr=function(){if(0===arguments.length||arguments.length>=4)throw new Error("Here only accept 3 arguments, so you have to provide at least 1 argument");var r=1===arguments.length?0:Number(arguments.length<=0?void 0:arguments[0]),e=Number(arguments.length>=2?arguments.length<=1?void 0:arguments[1]:arguments.length<=0?void 0:arguments[0]),n=3===arguments.length?Number(arguments.length<=2?void 0:arguments[2]):1;arguments.length<3&&h(e)&&(n=-1);var t=[],o=0,a=0;if(h(r)&&l(e)?o=r-1:l(r)&&h(e)?o=r+1:l(r)&&l(e)?o=r-1:h(r)&&h(e)&&(o=r+1),o<e){for(;o<e;)o++,n>1?(a+=n)<e&&t.push(a):o<e&&t.push(o);0!==r||t.includes(0)||t.unshift(0)}else if(o>e){for(;o>e;)o--,n<-1?(a-=n)>e&&t.unshift(a):o>e&&t.unshift(o);0!==r||t.includes(0)||t.push(0)}return 1===t.length&&0===t[0]?[]:t},er=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Only accept index of array elements and you must input at least one index in number type");return function(r,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(!i(r))throw new Error("Please enter array only here");if(!f(n))throw new Error("Input only index number here");var o,u=Array.from(r),l=[],h=a(e);try{for(h.s();!(o=h.n()).done;){var s=o.value;void 0!==u[Number(s)]&&l.push(u[Number(s)])}}catch(r){h.e(r)}finally{h.f()}var c=N.apply(void 0,[u].concat(e));return c.splice.apply(c,[n,t].concat(l)),c}},nr=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Accept index of array elements only and you add at least one index in number");return function(r){if(!i(r))throw new Error("Please enter array only here");for(var n=arguments.length,t=new Array(n>1?n-1:0),o=1;o<n;o++)t[o-1]=arguments[o];if(0===t.length&&t.length!==e.length&&0!==K(e,t).length)throw new Error("Only accept index of array elements and the number of the first indexes must be the same as the second indexes and also, both indexes must be different");for(var a=Array.from(r),u=Array.from(r),f=0;f<e.length;f++)void 0!==e[f]&&void 0!==t[f]&&(u.splice(e[f],1,a[t[f]]),u.splice(t[f],1,a[e[f]]));return u}},tr=function(){for(var r=arguments.length,e=new Array(r),n=0;n<r;n++)e[n]=arguments[n];if(0===e.length)throw new Error("Only accept index of array elements and you must enter at least one index in number type");return function(r,n){var t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!i(r))throw new Error("Accept array only here");if(!i(n))throw new Error("Accept array only here");if(!f(t))throw new Error("Input only index number here");var o,u=Array.from(r),l=Array.from(n),h=[],s=a(e);try{for(s.s();!(o=s.n()).done;){var c=o.value;void 0!==u[Number(c)]&&h.push(u[Number(c)])}}catch(r){s.e(r)}finally{s.f()}var m=null===t?Number(l.length):t;l.splice.apply(l,[m,0].concat(h));var y=N.apply(void 0,[u].concat(e));return{from:y,to:l}}},or=function(r){if(!i(r))throw new Error("Enter only array type here");return Array.from(r).filter((function(r){return null!=r&&!1!==r&&!isNaN(r)&&""!==r&&r>0}))},ar=function(r){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;if(!i(r)&&r.length<=2)throw new Error("Please insert array only on the first argument and must have 3 values at least");if("number"!=typeof e)throw new Error("On the second argument, you must input in a number type only");var n,t=rr(e,r.length,e),o=[],u=a(t);try{for(u.s();!(n=u.n()).done;){var f=n.value,l=r.slice(Number(f)-Number(e),f);o.push(l)}}catch(r){u.e(r)}finally{u.f()}return t[Number(t.length)-1]<=r.length&&o.push(r.slice(t[Number(t.length)-1],r.length)),o},ir=function(r){if(!i(r)&&r.length<=2)throw new Error("This shuffle method only work on data in array type");for(var e=Array.from(r),n=Number(e.length)-1;n>2;n--){var t=e.slice(0,Number(n)+1);e=nr(n)(e,p(t))}return e},ur=function(r,e){if(!i(r))throw new Error("You must enter array literal here");if(!M(e))throw new Error("You have to enter a function or callback on the second argument");var n,t={},o=a(r);try{for(o.s();!(n=o.n()).done;){var u=n.value;void 0===t[e(u).toString()]&&(t[e(u).toString()]=[]),t[e(u).toString()].push(u)}}catch(r){o.e(r)}finally{o.f()}return t},fr=function(r,e,t){if(!i(r))throw new Error("On the first argument, you have to provide array only");if(!Y(e))throw new Error("New property must be in string type");if(!M(t))throw new Error("Callback must be in function or method");return Array.from(r).map((function(r){return r[e]=t.apply(void 0,n(Object.values(r).filter((function(r){return!1===isNaN(r)})))),r}))};export{R as asymmetricDifference,fr as calc,fr as calculate,ar as chunk,or as compact,V as complement,J as countBy,G as countDuplication,N as destroy,Q as difference,k as filter,k as filtered,x as flatten,ur as group,j as hidden,g as index,c as insert,w as insertAfter,v as insertBefore,m as insertFirst,y as insertLast,K as intersection,i as isArray,u as isSuperset,er as move,T as nested,z as pageInfo,$ as pages,U as paginate,B as pagination,p as randomIndex,rr as range,L as search,I as searchBy,O as select,z as show,ir as shuffle,P as sort,H as sortBy,q as sortWith,H as sorted,D as sum,nr as switched,d as toIndex,S as toggle,tr as transfer,X as transpose,F as union,C as unique,_ as unzip,E as update,A as updateBy,W as without,Z as zip}; |
{ | ||
"name": "alga-js", | ||
"version": "0.0.8", | ||
"version": "0.0.9", | ||
"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": "dist/alga.min.js", |
@@ -15,3 +15,3 @@ <p align="center" style="text-align: center"> | ||
# Alga.js | ||
Alga.js is a JavaScript helper to help build UI components by using any of modern web frameworks or libraries, especially the frameworks that we currently use like Vue, Petite-Vue, Alpine.js and Vanilla Web Components to produce our custom elements, see [the demo here](https://tedirghazali.gitbook.io/algajs/). | ||
Alga.js is a JavaScript helper to help build UI components by using any of modern web frameworks or libraries, especially the frameworks that we currently use like Vue, Petite-Vue, Alpine.js and Vanilla Web Components to produce our custom elements, see [the documentation here](https://tedirghazali.gitbook.io/algajs/) or visit this link `tedirghazali.gitbook.io/algajs`. | ||
@@ -18,0 +18,0 @@ ## Installation |
@@ -5,5 +5,8 @@ export function paginate(fromArr: any, pageActive?: number, limitPerPage?: number): any[]; | ||
from: number; | ||
start: number; | ||
to: number; | ||
end: number; | ||
of: number; | ||
length: number; | ||
}; | ||
export function pagination(totalPages: any, pageActive?: number, positionOfEllipsis?: number): number[]; |
export function search(fromArr: any, ...searchStr: any[]): any[]; | ||
export function searchBy(...filterStr: any[]): (fromArr: any, ...whereArr: any[]) => any[]; | ||
export function searchBy(fromArr: any, queryArr: any, propArr: any): any[]; |
276059
3718