utilzify 1.1.17 → 1.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- var apizum=function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t),a=n(r);const i=e=>e.replace(/<[^>]*>/g,"").trim();var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u=Array.isArray,l="object"==typeof c&&c&&c.Object===Object&&c,f="object"==typeof self&&self&&self.Object===Object&&self,p=l||f||Function("return this")(),d=p.Symbol,h=d,m=Object.prototype,y=m.hasOwnProperty,g=m.toString,v=h?h.toStringTag:void 0;var b=function(e){var t=y.call(e,v),r=e[v];try{e[v]=void 0;var n=!0}catch(e){}var o=g.call(e);return n&&(t?e[v]=r:delete e[v]),o},_=Object.prototype.toString;var w=b,j=function(e){return _.call(e)},T=d?d.toStringTag:void 0;var S=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":T&&T in Object(e)?w(e):j(e)};var x=S,C=function(e){return null!=e&&"object"==typeof e};var E=function(e){return"symbol"==typeof e||C(e)&&"[object Symbol]"==x(e)},N=u,O=E,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/;var P=function(e,t){if(N(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!O(e))||(A.test(e)||!$.test(e)||null!=t&&e in Object(t))};var F=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},M=S,z=F;var I,U=function(e){if(!z(e))return!1;var t=M(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},k=p["__core-js_shared__"],L=(I=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"";var R=function(e){return!!L&&L in e},D=Function.prototype.toString;var B=U,G=R,X=F,Y=function(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""},H=/^\[object .+?Constructor\]$/,V=Function.prototype,J=Object.prototype,W=V.toString,q=J.hasOwnProperty,Z=RegExp("^"+W.call(q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var K=function(e){return!(!X(e)||G(e))&&(B(e)?Z:H).test(Y(e))},Q=function(e,t){return null==e?void 0:e[t]};var ee=function(e,t){var r=Q(e,t);return K(r)?r:void 0},te=ee(Object,"create"),re=te;var ne=function(){this.__data__=re?re(null):{},this.size=0};var oe=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ae=te,ie=Object.prototype.hasOwnProperty;var ce=function(e){var t=this.__data__;if(ae){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return ie.call(t,e)?t[e]:void 0},se=te,ue=Object.prototype.hasOwnProperty;var le=te;var fe=ne,pe=oe,de=ce,he=function(e){var t=this.__data__;return se?void 0!==t[e]:ue.call(t,e)},me=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=le&&void 0===t?"__lodash_hash_undefined__":t,this};function ye(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ye.prototype.clear=fe,ye.prototype.delete=pe,ye.prototype.get=de,ye.prototype.has=he,ye.prototype.set=me;var ge=ye;var ve=function(){this.__data__=[],this.size=0};var be=function(e,t){return e===t||e!=e&&t!=t};var _e=function(e,t){for(var r=e.length;r--;)if(be(e[r][0],t))return r;return-1},we=_e,je=Array.prototype.splice;var Te=_e;var Se=_e;var xe=_e;var Ce=ve,Ee=function(e){var t=this.__data__,r=we(t,e);return!(r<0)&&(r==t.length-1?t.pop():je.call(t,r,1),--this.size,!0)},Ne=function(e){var t=this.__data__,r=Te(t,e);return r<0?void 0:t[r][1]},Oe=function(e){return Se(this.__data__,e)>-1},$e=function(e,t){var r=this.__data__,n=xe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ae.prototype.clear=Ce,Ae.prototype.delete=Ee,Ae.prototype.get=Ne,Ae.prototype.has=Oe,Ae.prototype.set=$e;var Pe=Ae,Fe=ee(p,"Map"),Me=ge,ze=Pe,Ie=Fe;var Ue=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ke=function(e,t){var r=e.__data__;return Ue(t)?r["string"==typeof t?"string":"hash"]:r.map},Le=ke;var Re=ke;var De=ke;var Be=ke;var Ge=function(){this.size=0,this.__data__={hash:new Me,map:new(Ie||ze),string:new Me}},Xe=function(e){var t=Le(this,e).delete(e);return this.size-=t?1:0,t},Ye=function(e){return Re(this,e).get(e)},He=function(e){return De(this,e).has(e)},Ve=function(e,t){var r=Be(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function Je(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Je.prototype.clear=Ge,Je.prototype.delete=Xe,Je.prototype.get=Ye,Je.prototype.has=He,Je.prototype.set=Ve;var We=Je;function qe(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(qe.Cache||We),r}qe.Cache=We;var Ze=qe;var Ke=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qe=/\\(\\)?/g,et=function(e){var t=Ze(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ke,(function(e,r,n,o){t.push(n?o.replace(Qe,"$1"):r||e)})),t}));var tt=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},rt=u,nt=E,ot=d?d.prototype:void 0,at=ot?ot.toString:void 0;var it=function e(t){if("string"==typeof t)return t;if(rt(t))return tt(t,e)+"";if(nt(t))return at?at.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},ct=it;var st=u,ut=P,lt=et,ft=function(e){return null==e?"":ct(e)};var pt=E;var dt=function(e,t){return st(e)?e:ut(e,t)?[e]:lt(ft(e))},ht=function(e){if("string"==typeof e||pt(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};var mt=function(e,t){for(var r=0,n=(t=dt(t,e)).length;null!=e&&r<n;)e=e[ht(t[r++])];return r&&r==n?e:void 0};var yt=s((function(e,t,r){var n=null==e?void 0:mt(e,t);return void 0===n?r:n}));const gt={columnIndexCache:new Map,columnNameCache:new Map};function vt(e){const t=e.toUpperCase();if(gt.columnIndexCache.has(t))return gt.columnIndexCache.get(t);let r=0;for(let e=0;e<t.length;e++)r=26*r+(t.charCodeAt(e)-65+1);const n=r-1;return gt.columnIndexCache.set(t,n),n}const bt={getStr(e=[],t,r=""){const n=yt(e,`[${t}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(e=[],t,r=0){const n=yt(e,`[${t}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(e=[],t,r=!1){if(!Array.isArray(e))return r;const n=yt(e,`[${t}]`,r);return["TRUE","FALSE"].includes(n)?"TRUE"===n:"boolean"==typeof n?n:r}},_t={getStr(e=[],t,r=""){const n=vt(t),o=yt(e,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(e=[],t,r=0){const n=vt(t),o=yt(e,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(e=[],t,r=!1){const n=vt(t);if(!Array.isArray(e))return r;const o=yt(e,`[${n}]`,r);return["TRUE","FALSE"].includes(o)?"TRUE"===o:"boolean"==typeof o?o:r}},wt=(e,t)=>{if(St("frontend"),window.navigator){const r=window.URL.createObjectURL(e),n=document.createElement("a");n.style.display="none",n.href=r,n.download=t,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}};const jt=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Tt=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),St=e=>{const t=jt(),r=Tt();if("frontend"===e&&!t)throw new Error("This function can only be used in a frontend environment.");if("backend"===e&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===e?t:r},xt={PDF:"pdf",PNG:"image/png",JPEG:"image/jpeg",EXCEL:"excel",WORD:"word",TEXT:"text"},Ct={[xt.PDF]:{mimeType:"application/pdf",extension:"pdf"},[xt.PNG]:{mimeType:"image/png",extension:"png"},[xt.JPEG]:{mimeType:"image/jpeg",extension:"jpg"},[xt.EXCEL]:{mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",extension:"xlsx"},[xt.WORD]:{mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extension:"docx"},[xt.TEXT]:{mimeType:"text/plain",extension:"txt"}};return e.ColumnMapper=_t,e.FileType=xt,e.IndexMapper=bt,e.StyledLogger=class{static getStyle(e){switch(e){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(e,t="",...r){if(jt())console.log(`%c[${e.toUpperCase()}] ${t}`,this.getStyle(e),...r);else{const n={log:"",info:"",warn:"",error:"",success:"",debug:""};console.log(`${n[e]}[${e.toUpperCase()}] ${t}`,...r)}}static info(e,...t){this.log("info",e,...t)}static warn(e,...t){this.log("warn",e,...t)}static error(e,...t){this.log("error",e,...t)}static success(e,...t){this.log("success",e,...t)}static debug(e,...t){this.log("debug",e,...t)}},e.checkEnvironment=St,e.convertBase64ToFile=(e,t="converted_file",r)=>{St("frontend");const n=Ct[xt[r]];if(!n)throw new Error(`Invalid file type: ${r}`);const{mimeType:o,extension:a}=n,i=e.replace(/^data:.*;base64,/,""),c=window.atob(i),s=c.length,u=new Uint8Array(s);for(let e=0;e<s;e++)u[e]=c.charCodeAt(e);const l=new Blob([u],{type:o});wt(l,`${t}.${a}`)},e.convertDigitalSize=(e,t,r)=>{if(r<=0)return 0;const n={bit:1,byte:8,kb:8192,mb:8388608,gb:8*1024**3,tb:8*1024**4};if(!n[e]||!n[t])throw new Error("Invalid unit");return parseFloat((r*n[e]/n[t]).toFixed(2))},e.copyToClipboard=async e=>{St("frontend"),await navigator.clipboard.writeText(e)},e.debounce=(e,t=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(e(...o))}),t),i&&a(e(...o))}))},e.delay=e=>new Promise((t=>setTimeout(t,e))),e.extractErrorMessage=(e,t="Noma'lum xatolik")=>{if(!e)return t;let r="";if("object"==typeof e){const t=e?.response?.data?.errors;if(Array.isArray(t))r=t.map((e=>e.message)).filter(Boolean).join("\n");else{const t=e?.response?.data;r="string"==typeof t?i(t):t?.message&&"string"==typeof t?.message?t.message:t?.error?.message}r||(r=e.message||"")}else r=i(String(e));return r.trim()||t},e.fileConfigs=Ct,e.formatCurrencyPrice=(e,t,r="en-US")=>e?.toLocaleString(r,{style:"currency",currency:t}),e.formatDateLocaleString=(e,t="en-GB",r="Asia/Tashkent")=>new Date(e).toLocaleString(t,{timeZone:r}),e.formatPrice=e=>e.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),e.formatStringToFloat=e=>{(e=(e=e.toString()).replace(/\s/g,"")).includes(",")&&e.includes(".")?e=e.replace(/,/g,""):e.includes(",")&&(e=e.replace(/,/g,"."));const t=Number(e);return isNaN(t)?0:t},e.getColumnIndex=vt,e.getColumnName=function(e){if(gt.columnNameCache.has(e))return gt.columnNameCache.get(e);let t="";for(;e>=0;){const r=e%26;t=String.fromCharCode(65+r)+t,e=Math.floor(e/26)-1}return gt.columnNameCache.set(e,t),t},e.getFormattedDate=(e=Date.now(),t="DD/MM/YYYY HH:mm:ss")=>{const r=o.default(e);return r.isValid()?r.format(t):""},e.getFunctionName=e=>e.name||null,e.getLocalIP=()=>{St("backend");const e=a.default.networkInterfaces();for(const t in e)for(const r of e[t]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},e.getRandomInt=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),e.getValueByName=function(e=[],t,r=null){if(!Array.isArray(e))return r;const n=vt(t);return yt(e,`[${n}]`,r)},e.isBrowser=jt,e.isNode=Tt,e.objectToArray=(e,t,r=[],n="")=>{const o=[];return r.length>0&&o.push(r.map((e=>e.trim()||n))),e.forEach((e=>{const r=t.map((t=>{const r=e[t];return("string"==typeof r||"number"==typeof r?String(r).trim():"")||n}));o.push(r)})),o},e.parseSeparatedNumber=e=>{const t=Number(e?.replace(/,/g,""));return isNaN(t)?0:t},e.saveFile=wt,e.scrollToElement=e=>{St("frontend");const t=document.querySelector(e);t&&t.scrollIntoView({behavior:"smooth"})},e.stripHtmlTags=i,e.toMilliseconds=e=>{const{milliseconds:t=0,seconds:r=0,minutes:n=0,hours:o=0,days:a=0,weeks:i=0,months:c=0,years:s=0}=e,u=36e5,l=864e5;return t+1e3*r+6e4*n+o*u+a*l+6048e5*i+2630016e3*c+315576e5*s},Object.defineProperty(e,"__esModule",{value:!0}),e}({},moment,os);
1
+ var apizum=function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t),a=n(r);const i=e=>e.replace(/<[^>]*>/g,"").trim();var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u=Array.isArray,l="object"==typeof c&&c&&c.Object===Object&&c,f="object"==typeof self&&self&&self.Object===Object&&self,p=l||f||Function("return this")(),d=p.Symbol,h=d,m=Object.prototype,g=m.hasOwnProperty,y=m.toString,v=h?h.toStringTag:void 0;var b=function(e){var t=g.call(e,v),r=e[v];try{e[v]=void 0;var n=!0}catch(e){}var o=y.call(e);return n&&(t?e[v]=r:delete e[v]),o},_=Object.prototype.toString;var w=b,j=function(e){return _.call(e)},T=d?d.toStringTag:void 0;var S=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":T&&T in Object(e)?w(e):j(e)};var x=S,C=function(e){return null!=e&&"object"==typeof e};var E=function(e){return"symbol"==typeof e||C(e)&&"[object Symbol]"==x(e)},N=u,O=E,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/;var P=function(e,t){if(N(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!O(e))||(A.test(e)||!$.test(e)||null!=t&&e in Object(t))};var F=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},M=S,z=F;var I,U=function(e){if(!z(e))return!1;var t=M(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},k=p["__core-js_shared__"],L=(I=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"";var R=function(e){return!!L&&L in e},D=Function.prototype.toString;var B=U,G=R,X=F,Y=function(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""},H=/^\[object .+?Constructor\]$/,V=Function.prototype,J=Object.prototype,W=V.toString,q=J.hasOwnProperty,Z=RegExp("^"+W.call(q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var K=function(e){return!(!X(e)||G(e))&&(B(e)?Z:H).test(Y(e))},Q=function(e,t){return null==e?void 0:e[t]};var ee=function(e,t){var r=Q(e,t);return K(r)?r:void 0},te=ee(Object,"create"),re=te;var ne=function(){this.__data__=re?re(null):{},this.size=0};var oe=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ae=te,ie=Object.prototype.hasOwnProperty;var ce=function(e){var t=this.__data__;if(ae){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return ie.call(t,e)?t[e]:void 0},se=te,ue=Object.prototype.hasOwnProperty;var le=te;var fe=ne,pe=oe,de=ce,he=function(e){var t=this.__data__;return se?void 0!==t[e]:ue.call(t,e)},me=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=le&&void 0===t?"__lodash_hash_undefined__":t,this};function ge(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ge.prototype.clear=fe,ge.prototype.delete=pe,ge.prototype.get=de,ge.prototype.has=he,ge.prototype.set=me;var ye=ge;var ve=function(){this.__data__=[],this.size=0};var be=function(e,t){return e===t||e!=e&&t!=t};var _e=function(e,t){for(var r=e.length;r--;)if(be(e[r][0],t))return r;return-1},we=_e,je=Array.prototype.splice;var Te=_e;var Se=_e;var xe=_e;var Ce=ve,Ee=function(e){var t=this.__data__,r=we(t,e);return!(r<0)&&(r==t.length-1?t.pop():je.call(t,r,1),--this.size,!0)},Ne=function(e){var t=this.__data__,r=Te(t,e);return r<0?void 0:t[r][1]},Oe=function(e){return Se(this.__data__,e)>-1},$e=function(e,t){var r=this.__data__,n=xe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ae.prototype.clear=Ce,Ae.prototype.delete=Ee,Ae.prototype.get=Ne,Ae.prototype.has=Oe,Ae.prototype.set=$e;var Pe=Ae,Fe=ee(p,"Map"),Me=ye,ze=Pe,Ie=Fe;var Ue=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ke=function(e,t){var r=e.__data__;return Ue(t)?r["string"==typeof t?"string":"hash"]:r.map},Le=ke;var Re=ke;var De=ke;var Be=ke;var Ge=function(){this.size=0,this.__data__={hash:new Me,map:new(Ie||ze),string:new Me}},Xe=function(e){var t=Le(this,e).delete(e);return this.size-=t?1:0,t},Ye=function(e){return Re(this,e).get(e)},He=function(e){return De(this,e).has(e)},Ve=function(e,t){var r=Be(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function Je(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Je.prototype.clear=Ge,Je.prototype.delete=Xe,Je.prototype.get=Ye,Je.prototype.has=He,Je.prototype.set=Ve;var We=Je;function qe(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(qe.Cache||We),r}qe.Cache=We;var Ze=qe;var Ke=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qe=/\\(\\)?/g,et=function(e){var t=Ze(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ke,(function(e,r,n,o){t.push(n?o.replace(Qe,"$1"):r||e)})),t}));var tt=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},rt=u,nt=E,ot=d?d.prototype:void 0,at=ot?ot.toString:void 0;var it=function e(t){if("string"==typeof t)return t;if(rt(t))return tt(t,e)+"";if(nt(t))return at?at.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},ct=it;var st=u,ut=P,lt=et,ft=function(e){return null==e?"":ct(e)};var pt=E;var dt=function(e,t){return st(e)?e:ut(e,t)?[e]:lt(ft(e))},ht=function(e){if("string"==typeof e||pt(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};var mt=function(e,t){for(var r=0,n=(t=dt(t,e)).length;null!=e&&r<n;)e=e[ht(t[r++])];return r&&r==n?e:void 0};var gt=s((function(e,t,r){var n=null==e?void 0:mt(e,t);return void 0===n?r:n}));const yt={columnIndexCache:new Map,columnNameCache:new Map};function vt(e){const t=e.toUpperCase();if(yt.columnIndexCache.has(t))return yt.columnIndexCache.get(t);let r=0;for(let e=0;e<t.length;e++)r=26*r+(t.charCodeAt(e)-65+1);const n=r-1;return yt.columnIndexCache.set(t,n),n}const bt={getStr(e=[],t,r=""){const n=gt(e,`[${t}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(e=[],t,r=0){const n=gt(e,`[${t}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(e=[],t,r=!1){if(!Array.isArray(e))return r;const n=gt(e,`[${t}]`,r);return["TRUE","FALSE"].includes(n)?"TRUE"===n:"boolean"==typeof n?n:r}},_t={getStr(e=[],t,r=""){const n=vt(t),o=gt(e,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(e=[],t,r=0){const n=vt(t),o=gt(e,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(e=[],t,r=!1){const n=vt(t);if(!Array.isArray(e))return r;const o=gt(e,`[${n}]`,r);return["TRUE","FALSE"].includes(o)?"TRUE"===o:"boolean"==typeof o?o:r}},wt=(e,t)=>{if(St("frontend"),window.navigator){const r=window.URL.createObjectURL(e),n=document.createElement("a");n.style.display="none",n.href=r,n.download=t,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}};const jt=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Tt=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),St=e=>{const t=jt(),r=Tt();if("frontend"===e&&!t)throw new Error("This function can only be used in a frontend environment.");if("backend"===e&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===e?t:r},xt={PDF:"pdf",PNG:"image/png",JPEG:"image/jpeg",EXCEL:"excel",WORD:"word",TEXT:"text"},Ct={[xt.PDF]:{mimeType:"application/pdf",extension:"pdf"},[xt.PNG]:{mimeType:"image/png",extension:"png"},[xt.JPEG]:{mimeType:"image/jpeg",extension:"jpg"},[xt.EXCEL]:{mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",extension:"xlsx"},[xt.WORD]:{mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extension:"docx"},[xt.TEXT]:{mimeType:"text/plain",extension:"txt"}};return e.ColumnMapper=_t,e.FileType=xt,e.IndexMapper=bt,e.StyledLogger=class{static getStyle(e){switch(e){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(e,t="",...r){if(jt())console.log(`%c[${e.toUpperCase()}] ${t}`,this.getStyle(e),...r);else{const n={log:"",info:"",warn:"",error:"",success:"",debug:""};console.log(`${n[e]}[${e.toUpperCase()}] ${t}`,...r)}}static info(e,...t){this.log("info",e,...t)}static warn(e,...t){this.log("warn",e,...t)}static error(e,...t){this.log("error",e,...t)}static success(e,...t){this.log("success",e,...t)}static debug(e,...t){this.log("debug",e,...t)}},e.checkEnvironment=St,e.convertBase64ToFile=(e,t="converted_file",r)=>{St("frontend");const n=Ct[xt[r]];if(!n)throw new Error(`Invalid file type: ${r}`);const{mimeType:o,extension:a}=n,i=e.replace(/^data:.*;base64,/,""),c=window.atob(i),s=c.length,u=new Uint8Array(s);for(let e=0;e<s;e++)u[e]=c.charCodeAt(e);const l=new Blob([u],{type:o});wt(l,`${t}.${a}`)},e.convertDigitalSize=(e,t,r)=>{if(r<=0)return 0;const n={bit:1,byte:8,kb:8192,mb:8388608,gb:8*1024**3,tb:8*1024**4};if(!n[e]||!n[t])throw new Error("Invalid unit");return parseFloat((r*n[e]/n[t]).toFixed(2))},e.copyToClipboard=async e=>{St("frontend"),await navigator.clipboard.writeText(e)},e.debounce=(e,t=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(e(...o))}),t),i&&a(e(...o))}))},e.delay=e=>new Promise((t=>setTimeout(t,e))),e.extractErrorMessage=(e,t="Noma'lum xatolik")=>{if(!e)return t;let r="";if("object"==typeof e){const t=e?.response?.data?.errors;if(Array.isArray(t))r=t.map((e=>e.message)).filter(Boolean).join("\n");else{const t=e?.response?.data;r="string"==typeof t?i(t):t?.message&&"string"==typeof t?.message?t.message:t?.error?.message}r||(r=e.message||"")}else r=i(String(e));return r.trim()||t},e.fileConfigs=Ct,e.formatCurrencyPrice=(e,t,r="en-US")=>e?.toLocaleString(r,{style:"currency",currency:t}),e.formatDateLocaleString=(e,t="en-GB",r="Asia/Tashkent")=>new Date(e).toLocaleString(t,{timeZone:r}),e.formatPrice=e=>e.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),e.formatStringToFloat=e=>{(e=(e=e.toString()).replace(/\s/g,"")).includes(",")&&e.includes(".")?e=e.replace(/,/g,""):e.includes(",")&&(e=e.replace(/,/g,"."));const t=Number(e);return isNaN(t)?0:t},e.getColumnIndex=vt,e.getColumnName=function(e){if(yt.columnNameCache.has(e))return yt.columnNameCache.get(e);let t="";for(;e>=0;){const r=e%26;t=String.fromCharCode(65+r)+t,e=Math.floor(e/26)-1}return yt.columnNameCache.set(e,t),t},e.getFormattedDate=(e=Date.now(),t="DD/MM/YYYY HH:mm:ss")=>{const r=o.default(e);return r.isValid()?r.format(t):""},e.getFunctionName=e=>e.name||null,e.getLocalIP=()=>{St("backend");const e=a.default.networkInterfaces();for(const t in e)for(const r of e[t]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},e.getRandomInt=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),e.getValueByName=function(e=[],t,r=null){if(!Array.isArray(e))return r;const n=vt(t);return gt(e,`[${n}]`,r)},e.isBrowser=jt,e.isNode=Tt,e.objectToArray=(e,t,r=[],n="")=>{const o=[];return r.length>0?o.push(r.map((e=>e.trim()||n))):o.push(t.map((e=>String(e).trim()||n))),e.forEach((e=>{const r=t.map((t=>{const r=e[t];return("string"==typeof r||"number"==typeof r?String(r).trim():"")||n}));o.push(r)})),o},e.parseSeparatedNumber=e=>{const t=Number(e?.replace(/,/g,""));return isNaN(t)?0:t},e.saveFile=wt,e.scrollToElement=e=>{St("frontend");const t=document.querySelector(e);t&&t.scrollIntoView({behavior:"smooth"})},e.stripHtmlTags=i,e.toMilliseconds=e=>{const{milliseconds:t=0,seconds:r=0,minutes:n=0,hours:o=0,days:a=0,weeks:i=0,months:c=0,years:s=0}=e,u=36e5,l=864e5;return t+1e3*r+6e4*n+o*u+a*l+6048e5*i+2630016e3*c+315576e5*s},Object.defineProperty(e,"__esModule",{value:!0}),e}({},moment,os);
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("moment"),require("os")):"function"==typeof define&&define.amd?define(["exports","moment","os"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).apizum={},e.moment,e.os)}(this,(function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t),i=n(r);const a=e=>e.replace(/<[^>]*>/g,"").trim();var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u=Array.isArray,l="object"==typeof s&&s&&s.Object===Object&&s,f="object"==typeof self&&self&&self.Object===Object&&self,p=l||f||Function("return this")(),d=p.Symbol,h=d,m=Object.prototype,y=m.hasOwnProperty,g=m.toString,v=h?h.toStringTag:void 0;var b=function(e){var t=y.call(e,v),r=e[v];try{e[v]=void 0;var n=!0}catch(e){}var o=g.call(e);return n&&(t?e[v]=r:delete e[v]),o},_=Object.prototype.toString;var w=b,T=function(e){return _.call(e)},j=d?d.toStringTag:void 0;var S=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?w(e):T(e)};var x=S,C=function(e){return null!=e&&"object"==typeof e};var E=function(e){return"symbol"==typeof e||C(e)&&"[object Symbol]"==x(e)},N=u,O=E,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/;var P=function(e,t){if(N(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!O(e))||(A.test(e)||!$.test(e)||null!=t&&e in Object(t))};var F=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},M=S,z=F;var I,U=function(e){if(!z(e))return!1;var t=M(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},k=p["__core-js_shared__"],L=(I=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"";var R=function(e){return!!L&&L in e},D=Function.prototype.toString;var B=U,G=R,X=F,Y=function(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""},q=/^\[object .+?Constructor\]$/,H=Function.prototype,V=Object.prototype,J=H.toString,W=V.hasOwnProperty,Z=RegExp("^"+J.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var K=function(e){return!(!X(e)||G(e))&&(B(e)?Z:q).test(Y(e))},Q=function(e,t){return null==e?void 0:e[t]};var ee=function(e,t){var r=Q(e,t);return K(r)?r:void 0},te=ee(Object,"create"),re=te;var ne=function(){this.__data__=re?re(null):{},this.size=0};var oe=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ie=te,ae=Object.prototype.hasOwnProperty;var se=function(e){var t=this.__data__;if(ie){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return ae.call(t,e)?t[e]:void 0},ce=te,ue=Object.prototype.hasOwnProperty;var le=te;var fe=ne,pe=oe,de=se,he=function(e){var t=this.__data__;return ce?void 0!==t[e]:ue.call(t,e)},me=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=le&&void 0===t?"__lodash_hash_undefined__":t,this};function ye(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ye.prototype.clear=fe,ye.prototype.delete=pe,ye.prototype.get=de,ye.prototype.has=he,ye.prototype.set=me;var ge=ye;var ve=function(){this.__data__=[],this.size=0};var be=function(e,t){return e===t||e!=e&&t!=t};var _e=function(e,t){for(var r=e.length;r--;)if(be(e[r][0],t))return r;return-1},we=_e,Te=Array.prototype.splice;var je=_e;var Se=_e;var xe=_e;var Ce=ve,Ee=function(e){var t=this.__data__,r=we(t,e);return!(r<0)&&(r==t.length-1?t.pop():Te.call(t,r,1),--this.size,!0)},Ne=function(e){var t=this.__data__,r=je(t,e);return r<0?void 0:t[r][1]},Oe=function(e){return Se(this.__data__,e)>-1},$e=function(e,t){var r=this.__data__,n=xe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ae.prototype.clear=Ce,Ae.prototype.delete=Ee,Ae.prototype.get=Ne,Ae.prototype.has=Oe,Ae.prototype.set=$e;var Pe=Ae,Fe=ee(p,"Map"),Me=ge,ze=Pe,Ie=Fe;var Ue=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ke=function(e,t){var r=e.__data__;return Ue(t)?r["string"==typeof t?"string":"hash"]:r.map},Le=ke;var Re=ke;var De=ke;var Be=ke;var Ge=function(){this.size=0,this.__data__={hash:new Me,map:new(Ie||ze),string:new Me}},Xe=function(e){var t=Le(this,e).delete(e);return this.size-=t?1:0,t},Ye=function(e){return Re(this,e).get(e)},qe=function(e){return De(this,e).has(e)},He=function(e,t){var r=Be(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function Ve(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ve.prototype.clear=Ge,Ve.prototype.delete=Xe,Ve.prototype.get=Ye,Ve.prototype.has=qe,Ve.prototype.set=He;var Je=Ve;function We(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(We.Cache||Je),r}We.Cache=Je;var Ze=We;var Ke=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qe=/\\(\\)?/g,et=function(e){var t=Ze(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ke,(function(e,r,n,o){t.push(n?o.replace(Qe,"$1"):r||e)})),t}));var tt=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},rt=u,nt=E,ot=d?d.prototype:void 0,it=ot?ot.toString:void 0;var at=function e(t){if("string"==typeof t)return t;if(rt(t))return tt(t,e)+"";if(nt(t))return it?it.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},st=at;var ct=u,ut=P,lt=et,ft=function(e){return null==e?"":st(e)};var pt=E;var dt=function(e,t){return ct(e)?e:ut(e,t)?[e]:lt(ft(e))},ht=function(e){if("string"==typeof e||pt(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};var mt=function(e,t){for(var r=0,n=(t=dt(t,e)).length;null!=e&&r<n;)e=e[ht(t[r++])];return r&&r==n?e:void 0};var yt=c((function(e,t,r){var n=null==e?void 0:mt(e,t);return void 0===n?r:n}));const gt={columnIndexCache:new Map,columnNameCache:new Map};function vt(e){const t=e.toUpperCase();if(gt.columnIndexCache.has(t))return gt.columnIndexCache.get(t);let r=0;for(let e=0;e<t.length;e++)r=26*r+(t.charCodeAt(e)-65+1);const n=r-1;return gt.columnIndexCache.set(t,n),n}const bt={getStr(e=[],t,r=""){const n=yt(e,`[${t}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(e=[],t,r=0){const n=yt(e,`[${t}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(e=[],t,r=!1){if(!Array.isArray(e))return r;const n=yt(e,`[${t}]`,r);return["TRUE","FALSE"].includes(n)?"TRUE"===n:"boolean"==typeof n?n:r}},_t={getStr(e=[],t,r=""){const n=vt(t),o=yt(e,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(e=[],t,r=0){const n=vt(t),o=yt(e,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const i=Number(o);return isNaN(i)?r:i},getBool(e=[],t,r=!1){const n=vt(t);if(!Array.isArray(e))return r;const o=yt(e,`[${n}]`,r);return["TRUE","FALSE"].includes(o)?"TRUE"===o:"boolean"==typeof o?o:r}},wt=(e,t)=>{if(St("frontend"),window.navigator){const r=window.URL.createObjectURL(e),n=document.createElement("a");n.style.display="none",n.href=r,n.download=t,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}};const Tt=()=>"undefined"!=typeof window&&"undefined"!=typeof document,jt=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),St=e=>{const t=Tt(),r=jt();if("frontend"===e&&!t)throw new Error("This function can only be used in a frontend environment.");if("backend"===e&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===e?t:r},xt={PDF:"pdf",PNG:"image/png",JPEG:"image/jpeg",EXCEL:"excel",WORD:"word",TEXT:"text"},Ct={[xt.PDF]:{mimeType:"application/pdf",extension:"pdf"},[xt.PNG]:{mimeType:"image/png",extension:"png"},[xt.JPEG]:{mimeType:"image/jpeg",extension:"jpg"},[xt.EXCEL]:{mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",extension:"xlsx"},[xt.WORD]:{mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extension:"docx"},[xt.TEXT]:{mimeType:"text/plain",extension:"txt"}};e.ColumnMapper=_t,e.FileType=xt,e.IndexMapper=bt,e.StyledLogger=class{static getStyle(e){switch(e){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(e,t="",...r){if(Tt())console.log(`%c[${e.toUpperCase()}] ${t}`,this.getStyle(e),...r);else{const n={log:"",info:"",warn:"",error:"",success:"",debug:""};console.log(`${n[e]}[${e.toUpperCase()}] ${t}`,...r)}}static info(e,...t){this.log("info",e,...t)}static warn(e,...t){this.log("warn",e,...t)}static error(e,...t){this.log("error",e,...t)}static success(e,...t){this.log("success",e,...t)}static debug(e,...t){this.log("debug",e,...t)}},e.checkEnvironment=St,e.convertBase64ToFile=(e,t="converted_file",r)=>{St("frontend");const n=Ct[xt[r]];if(!n)throw new Error(`Invalid file type: ${r}`);const{mimeType:o,extension:i}=n,a=e.replace(/^data:.*;base64,/,""),s=window.atob(a),c=s.length,u=new Uint8Array(c);for(let e=0;e<c;e++)u[e]=s.charCodeAt(e);const l=new Blob([u],{type:o});wt(l,`${t}.${i}`)},e.convertDigitalSize=(e,t,r)=>{if(r<=0)return 0;const n={bit:1,byte:8,kb:8192,mb:8388608,gb:8*1024**3,tb:8*1024**4};if(!n[e]||!n[t])throw new Error("Invalid unit");return parseFloat((r*n[e]/n[t]).toFixed(2))},e.copyToClipboard=async e=>{St("frontend"),await navigator.clipboard.writeText(e)},e.debounce=(e,t=300,r=!1)=>{let n=null;return(...o)=>new Promise((i=>{const a=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||i(e(...o))}),t),a&&i(e(...o))}))},e.delay=e=>new Promise((t=>setTimeout(t,e))),e.extractErrorMessage=(e,t="Noma'lum xatolik")=>{if(!e)return t;let r="";if("object"==typeof e){const t=e?.response?.data?.errors;if(Array.isArray(t))r=t.map((e=>e.message)).filter(Boolean).join("\n");else{const t=e?.response?.data;r="string"==typeof t?a(t):t?.message&&"string"==typeof t?.message?t.message:t?.error?.message}r||(r=e.message||"")}else r=a(String(e));return r.trim()||t},e.fileConfigs=Ct,e.formatCurrencyPrice=(e,t,r="en-US")=>e?.toLocaleString(r,{style:"currency",currency:t}),e.formatDateLocaleString=(e,t="en-GB",r="Asia/Tashkent")=>new Date(e).toLocaleString(t,{timeZone:r}),e.formatPrice=e=>e.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),e.formatStringToFloat=e=>{(e=(e=e.toString()).replace(/\s/g,"")).includes(",")&&e.includes(".")?e=e.replace(/,/g,""):e.includes(",")&&(e=e.replace(/,/g,"."));const t=Number(e);return isNaN(t)?0:t},e.getColumnIndex=vt,e.getColumnName=function(e){if(gt.columnNameCache.has(e))return gt.columnNameCache.get(e);let t="";for(;e>=0;){const r=e%26;t=String.fromCharCode(65+r)+t,e=Math.floor(e/26)-1}return gt.columnNameCache.set(e,t),t},e.getFormattedDate=(e=Date.now(),t="DD/MM/YYYY HH:mm:ss")=>{const r=o.default(e);return r.isValid()?r.format(t):""},e.getFunctionName=e=>e.name||null,e.getLocalIP=()=>{St("backend");const e=i.default.networkInterfaces();for(const t in e)for(const r of e[t]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},e.getRandomInt=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),e.getValueByName=function(e=[],t,r=null){if(!Array.isArray(e))return r;const n=vt(t);return yt(e,`[${n}]`,r)},e.isBrowser=Tt,e.isNode=jt,e.objectToArray=(e,t,r=[],n="")=>{const o=[];return r.length>0&&o.push(r.map((e=>e.trim()||n))),e.forEach((e=>{const r=t.map((t=>{const r=e[t];return("string"==typeof r||"number"==typeof r?String(r).trim():"")||n}));o.push(r)})),o},e.parseSeparatedNumber=e=>{const t=Number(e?.replace(/,/g,""));return isNaN(t)?0:t},e.saveFile=wt,e.scrollToElement=e=>{St("frontend");const t=document.querySelector(e);t&&t.scrollIntoView({behavior:"smooth"})},e.stripHtmlTags=a,e.toMilliseconds=e=>{const{milliseconds:t=0,seconds:r=0,minutes:n=0,hours:o=0,days:i=0,weeks:a=0,months:s=0,years:c=0}=e,u=36e5,l=864e5;return t+1e3*r+6e4*n+o*u+i*l+6048e5*a+2630016e3*s+315576e5*c},Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("moment"),require("os")):"function"==typeof define&&define.amd?define(["exports","moment","os"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).apizum={},e.moment,e.os)}(this,(function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t),i=n(r);const a=e=>e.replace(/<[^>]*>/g,"").trim();var s="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function c(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var u=Array.isArray,l="object"==typeof s&&s&&s.Object===Object&&s,f="object"==typeof self&&self&&self.Object===Object&&self,p=l||f||Function("return this")(),d=p.Symbol,h=d,m=Object.prototype,y=m.hasOwnProperty,g=m.toString,v=h?h.toStringTag:void 0;var b=function(e){var t=y.call(e,v),r=e[v];try{e[v]=void 0;var n=!0}catch(e){}var o=g.call(e);return n&&(t?e[v]=r:delete e[v]),o},_=Object.prototype.toString;var w=b,T=function(e){return _.call(e)},j=d?d.toStringTag:void 0;var S=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":j&&j in Object(e)?w(e):T(e)};var x=S,C=function(e){return null!=e&&"object"==typeof e};var E=function(e){return"symbol"==typeof e||C(e)&&"[object Symbol]"==x(e)},N=u,O=E,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,A=/^\w*$/;var P=function(e,t){if(N(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!O(e))||(A.test(e)||!$.test(e)||null!=t&&e in Object(t))};var F=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},M=S,z=F;var I,U=function(e){if(!z(e))return!1;var t=M(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},k=p["__core-js_shared__"],L=(I=/[^.]+$/.exec(k&&k.keys&&k.keys.IE_PROTO||""))?"Symbol(src)_1."+I:"";var R=function(e){return!!L&&L in e},D=Function.prototype.toString;var B=U,G=R,X=F,Y=function(e){if(null!=e){try{return D.call(e)}catch(e){}try{return e+""}catch(e){}}return""},q=/^\[object .+?Constructor\]$/,H=Function.prototype,V=Object.prototype,J=H.toString,W=V.hasOwnProperty,Z=RegExp("^"+J.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var K=function(e){return!(!X(e)||G(e))&&(B(e)?Z:q).test(Y(e))},Q=function(e,t){return null==e?void 0:e[t]};var ee=function(e,t){var r=Q(e,t);return K(r)?r:void 0},te=ee(Object,"create"),re=te;var ne=function(){this.__data__=re?re(null):{},this.size=0};var oe=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ie=te,ae=Object.prototype.hasOwnProperty;var se=function(e){var t=this.__data__;if(ie){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return ae.call(t,e)?t[e]:void 0},ce=te,ue=Object.prototype.hasOwnProperty;var le=te;var fe=ne,pe=oe,de=se,he=function(e){var t=this.__data__;return ce?void 0!==t[e]:ue.call(t,e)},me=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=le&&void 0===t?"__lodash_hash_undefined__":t,this};function ye(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}ye.prototype.clear=fe,ye.prototype.delete=pe,ye.prototype.get=de,ye.prototype.has=he,ye.prototype.set=me;var ge=ye;var ve=function(){this.__data__=[],this.size=0};var be=function(e,t){return e===t||e!=e&&t!=t};var _e=function(e,t){for(var r=e.length;r--;)if(be(e[r][0],t))return r;return-1},we=_e,Te=Array.prototype.splice;var je=_e;var Se=_e;var xe=_e;var Ce=ve,Ee=function(e){var t=this.__data__,r=we(t,e);return!(r<0)&&(r==t.length-1?t.pop():Te.call(t,r,1),--this.size,!0)},Ne=function(e){var t=this.__data__,r=je(t,e);return r<0?void 0:t[r][1]},Oe=function(e){return Se(this.__data__,e)>-1},$e=function(e,t){var r=this.__data__,n=xe(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Ae(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ae.prototype.clear=Ce,Ae.prototype.delete=Ee,Ae.prototype.get=Ne,Ae.prototype.has=Oe,Ae.prototype.set=$e;var Pe=Ae,Fe=ee(p,"Map"),Me=ge,ze=Pe,Ie=Fe;var Ue=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var ke=function(e,t){var r=e.__data__;return Ue(t)?r["string"==typeof t?"string":"hash"]:r.map},Le=ke;var Re=ke;var De=ke;var Be=ke;var Ge=function(){this.size=0,this.__data__={hash:new Me,map:new(Ie||ze),string:new Me}},Xe=function(e){var t=Le(this,e).delete(e);return this.size-=t?1:0,t},Ye=function(e){return Re(this,e).get(e)},qe=function(e){return De(this,e).has(e)},He=function(e,t){var r=Be(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function Ve(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}Ve.prototype.clear=Ge,Ve.prototype.delete=Xe,Ve.prototype.get=Ye,Ve.prototype.has=qe,Ve.prototype.set=He;var Je=Ve;function We(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=t?t.apply(this,n):n[0],i=r.cache;if(i.has(o))return i.get(o);var a=e.apply(this,n);return r.cache=i.set(o,a)||i,a};return r.cache=new(We.Cache||Je),r}We.Cache=Je;var Ze=We;var Ke=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Qe=/\\(\\)?/g,et=function(e){var t=Ze(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(Ke,(function(e,r,n,o){t.push(n?o.replace(Qe,"$1"):r||e)})),t}));var tt=function(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o},rt=u,nt=E,ot=d?d.prototype:void 0,it=ot?ot.toString:void 0;var at=function e(t){if("string"==typeof t)return t;if(rt(t))return tt(t,e)+"";if(nt(t))return it?it.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},st=at;var ct=u,ut=P,lt=et,ft=function(e){return null==e?"":st(e)};var pt=E;var dt=function(e,t){return ct(e)?e:ut(e,t)?[e]:lt(ft(e))},ht=function(e){if("string"==typeof e||pt(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t};var mt=function(e,t){for(var r=0,n=(t=dt(t,e)).length;null!=e&&r<n;)e=e[ht(t[r++])];return r&&r==n?e:void 0};var yt=c((function(e,t,r){var n=null==e?void 0:mt(e,t);return void 0===n?r:n}));const gt={columnIndexCache:new Map,columnNameCache:new Map};function vt(e){const t=e.toUpperCase();if(gt.columnIndexCache.has(t))return gt.columnIndexCache.get(t);let r=0;for(let e=0;e<t.length;e++)r=26*r+(t.charCodeAt(e)-65+1);const n=r-1;return gt.columnIndexCache.set(t,n),n}const bt={getStr(e=[],t,r=""){const n=yt(e,`[${t}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(e=[],t,r=0){const n=yt(e,`[${t}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(e=[],t,r=!1){if(!Array.isArray(e))return r;const n=yt(e,`[${t}]`,r);return["TRUE","FALSE"].includes(n)?"TRUE"===n:"boolean"==typeof n?n:r}},_t={getStr(e=[],t,r=""){const n=vt(t),o=yt(e,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(e=[],t,r=0){const n=vt(t),o=yt(e,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const i=Number(o);return isNaN(i)?r:i},getBool(e=[],t,r=!1){const n=vt(t);if(!Array.isArray(e))return r;const o=yt(e,`[${n}]`,r);return["TRUE","FALSE"].includes(o)?"TRUE"===o:"boolean"==typeof o?o:r}},wt=(e,t)=>{if(St("frontend"),window.navigator){const r=window.URL.createObjectURL(e),n=document.createElement("a");n.style.display="none",n.href=r,n.download=t,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}};const Tt=()=>"undefined"!=typeof window&&"undefined"!=typeof document,jt=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),St=e=>{const t=Tt(),r=jt();if("frontend"===e&&!t)throw new Error("This function can only be used in a frontend environment.");if("backend"===e&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===e?t:r},xt={PDF:"pdf",PNG:"image/png",JPEG:"image/jpeg",EXCEL:"excel",WORD:"word",TEXT:"text"},Ct={[xt.PDF]:{mimeType:"application/pdf",extension:"pdf"},[xt.PNG]:{mimeType:"image/png",extension:"png"},[xt.JPEG]:{mimeType:"image/jpeg",extension:"jpg"},[xt.EXCEL]:{mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",extension:"xlsx"},[xt.WORD]:{mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",extension:"docx"},[xt.TEXT]:{mimeType:"text/plain",extension:"txt"}};e.ColumnMapper=_t,e.FileType=xt,e.IndexMapper=bt,e.StyledLogger=class{static getStyle(e){switch(e){case"log":return"color: #3498db; font-weight: bold;";case"info":return"color: #2ecc71; font-weight: bold;";case"warn":return"color: #f39c12; font-weight: bold;";case"error":return"color: #e74c3c; font-weight: bold;";case"success":return"color: #27ae60; font-weight: bold;";case"debug":return"color: #9b59b6; font-weight: bold;";default:return""}}static log(e,t="",...r){if(Tt())console.log(`%c[${e.toUpperCase()}] ${t}`,this.getStyle(e),...r);else{const n={log:"",info:"",warn:"",error:"",success:"",debug:""};console.log(`${n[e]}[${e.toUpperCase()}] ${t}`,...r)}}static info(e,...t){this.log("info",e,...t)}static warn(e,...t){this.log("warn",e,...t)}static error(e,...t){this.log("error",e,...t)}static success(e,...t){this.log("success",e,...t)}static debug(e,...t){this.log("debug",e,...t)}},e.checkEnvironment=St,e.convertBase64ToFile=(e,t="converted_file",r)=>{St("frontend");const n=Ct[xt[r]];if(!n)throw new Error(`Invalid file type: ${r}`);const{mimeType:o,extension:i}=n,a=e.replace(/^data:.*;base64,/,""),s=window.atob(a),c=s.length,u=new Uint8Array(c);for(let e=0;e<c;e++)u[e]=s.charCodeAt(e);const l=new Blob([u],{type:o});wt(l,`${t}.${i}`)},e.convertDigitalSize=(e,t,r)=>{if(r<=0)return 0;const n={bit:1,byte:8,kb:8192,mb:8388608,gb:8*1024**3,tb:8*1024**4};if(!n[e]||!n[t])throw new Error("Invalid unit");return parseFloat((r*n[e]/n[t]).toFixed(2))},e.copyToClipboard=async e=>{St("frontend"),await navigator.clipboard.writeText(e)},e.debounce=(e,t=300,r=!1)=>{let n=null;return(...o)=>new Promise((i=>{const a=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||i(e(...o))}),t),a&&i(e(...o))}))},e.delay=e=>new Promise((t=>setTimeout(t,e))),e.extractErrorMessage=(e,t="Noma'lum xatolik")=>{if(!e)return t;let r="";if("object"==typeof e){const t=e?.response?.data?.errors;if(Array.isArray(t))r=t.map((e=>e.message)).filter(Boolean).join("\n");else{const t=e?.response?.data;r="string"==typeof t?a(t):t?.message&&"string"==typeof t?.message?t.message:t?.error?.message}r||(r=e.message||"")}else r=a(String(e));return r.trim()||t},e.fileConfigs=Ct,e.formatCurrencyPrice=(e,t,r="en-US")=>e?.toLocaleString(r,{style:"currency",currency:t}),e.formatDateLocaleString=(e,t="en-GB",r="Asia/Tashkent")=>new Date(e).toLocaleString(t,{timeZone:r}),e.formatPrice=e=>e.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),e.formatStringToFloat=e=>{(e=(e=e.toString()).replace(/\s/g,"")).includes(",")&&e.includes(".")?e=e.replace(/,/g,""):e.includes(",")&&(e=e.replace(/,/g,"."));const t=Number(e);return isNaN(t)?0:t},e.getColumnIndex=vt,e.getColumnName=function(e){if(gt.columnNameCache.has(e))return gt.columnNameCache.get(e);let t="";for(;e>=0;){const r=e%26;t=String.fromCharCode(65+r)+t,e=Math.floor(e/26)-1}return gt.columnNameCache.set(e,t),t},e.getFormattedDate=(e=Date.now(),t="DD/MM/YYYY HH:mm:ss")=>{const r=o.default(e);return r.isValid()?r.format(t):""},e.getFunctionName=e=>e.name||null,e.getLocalIP=()=>{St("backend");const e=i.default.networkInterfaces();for(const t in e)for(const r of e[t]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},e.getRandomInt=(e,t)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e),e.getValueByName=function(e=[],t,r=null){if(!Array.isArray(e))return r;const n=vt(t);return yt(e,`[${n}]`,r)},e.isBrowser=Tt,e.isNode=jt,e.objectToArray=(e,t,r=[],n="")=>{const o=[];return r.length>0?o.push(r.map((e=>e.trim()||n))):o.push(t.map((e=>String(e).trim()||n))),e.forEach((e=>{const r=t.map((t=>{const r=e[t];return("string"==typeof r||"number"==typeof r?String(r).trim():"")||n}));o.push(r)})),o},e.parseSeparatedNumber=e=>{const t=Number(e?.replace(/,/g,""));return isNaN(t)?0:t},e.saveFile=wt,e.scrollToElement=e=>{St("frontend");const t=document.querySelector(e);t&&t.scrollIntoView({behavior:"smooth"})},e.stripHtmlTags=a,e.toMilliseconds=e=>{const{milliseconds:t=0,seconds:r=0,minutes:n=0,hours:o=0,days:i=0,weeks:a=0,months:s=0,years:c=0}=e,u=36e5,l=864e5;return t+1e3*r+6e4*n+o*u+i*l+6048e5*a+2630016e3*s+315576e5*c},Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -1 +1 @@
1
- {"version":3,"file":"objecters.d.ts","sourceRoot":"","sources":["../../../src/utils/objecters.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,EAAE,YAAW,MAAM,EAAE,wBAAuB,MAAM,EAAE,EAkB9H,CAAC"}
1
+ {"version":3,"file":"objecters.d.ts","sourceRoot":"","sources":["../../../src/utils/objecters.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,EAAE,YAAW,MAAM,EAAE,wBAAuB,MAAM,EAAE,EAoB9H,CAAC"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.objectToArray=(t,e,r=[],o="")=>{const s=[];return r.length>0&&s.push(r.map((t=>t.trim()||o))),t.forEach((t=>{const r=e.map((e=>{const r=t[e];return("string"==typeof r||"number"==typeof r?String(r).trim():"")||o}));s.push(r)})),s};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});exports.objectToArray=(t,r,e=[],o="")=>{const s=[];return e.length>0?s.push(e.map((t=>t.trim()||o))):s.push(r.map((t=>String(t).trim()||o))),t.forEach((t=>{const e=r.map((r=>{const e=t[r];return("string"==typeof e||"number"==typeof e?String(e).trim():"")||o}));s.push(e)})),s};
@@ -1 +1 @@
1
- {"version":3,"file":"objecters.d.ts","sourceRoot":"","sources":["../../../src/utils/objecters.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,EAAE,YAAW,MAAM,EAAE,wBAAuB,MAAM,EAAE,EAkB9H,CAAC"}
1
+ {"version":3,"file":"objecters.d.ts","sourceRoot":"","sources":["../../../src/utils/objecters.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,GAAI,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,EAAE,YAAW,MAAM,EAAE,wBAAuB,MAAM,EAAE,EAoB9H,CAAC"}
@@ -1 +1 @@
1
- const t=(t,r,n=[],o="")=>{const e=[];return n.length>0&&e.push(n.map((t=>t.trim()||o))),t.forEach((t=>{const n=r.map((r=>{const n=t[r];return("string"==typeof n||"number"==typeof n?String(n).trim():"")||o}));e.push(n)})),e};export{t as objectToArray};
1
+ const t=(t,r,n=[],p="")=>{const o=[];return n.length>0?o.push(n.map((t=>t.trim()||p))):o.push(r.map((t=>String(t).trim()||p))),t.forEach((t=>{const n=r.map((r=>{const n=t[r];return("string"==typeof n||"number"==typeof n?String(n).trim():"")||p}));o.push(n)})),o};export{t as objectToArray};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utilzify",
3
- "version": "1.1.17",
3
+ "version": "1.1.18",
4
4
  "outputDir": "./lib",
5
5
  "exports": {
6
6
  "import": {