utilzify 1.1.7 → 1.1.8
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.
- package/lib/browser/bundle.iife.js +1 -1
- package/lib/browser/bundle.umd.js +1 -1
- package/lib/cjs/utils/clipboard.js +1 -1
- package/lib/cjs/utils/dom.js +1 -1
- package/lib/cjs/utils/get-local-ip.js +1 -1
- package/lib/cjs/utils/run-command.d.ts.map +1 -1
- package/lib/cjs/utils/run-command.js +1 -1
- package/lib/cjs/utils/save-file.js +1 -1
- package/lib/cjs/utils/styled-logger.js +1 -1
- package/lib/esm/utils/clipboard.js +1 -1
- package/lib/esm/utils/dom.js +1 -1
- package/lib/esm/utils/get-local-ip.js +1 -1
- package/lib/esm/utils/run-command.d.ts.map +1 -1
- package/lib/esm/utils/run-command.js +1 -1
- package/lib/esm/utils/save-file.js +1 -1
- package/lib/esm/utils/styled-logger.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var apizum=function(t,e,r,n,o){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=a(e),c=a(r),u=a(o);const s=t=>t.replace(/<[^>]*>/g,"").trim();var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d=Array.isArray,p="object"==typeof l&&l&&l.Object===Object&&l,h="object"==typeof self&&self&&self.Object===Object&&self,v=p||h||Function("return this")(),y=v.Symbol,g=y,m=Object.prototype,b=m.hasOwnProperty,_=m.toString,w=g?g.toStringTag:void 0;var j=function(t){var e=b.call(t,w),r=t[w];try{t[w]=void 0;var n=!0}catch(t){}var o=_.call(t);return n&&(e?t[w]=r:delete t[w]),o},S=Object.prototype.toString;var C=j,N=function(t){return S.call(t)},O=y?y.toStringTag:void 0;var $=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?C(t):N(t)};var T=$,A=function(t){return null!=t&&"object"==typeof t};var x=function(t){return"symbol"==typeof t||A(t)&&"[object Symbol]"==T(t)},M=d,P=x,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k=/^\w*$/;var I=function(t,e){if(M(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!P(t))||(k.test(t)||!z.test(t)||null!=e&&t in Object(e))};var E=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},F=$,L=E;var U,B=function(t){if(!L(t))return!1;var e=F(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},D=v["__core-js_shared__"],R=(U=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var Y=function(t){return!!R&&R in t},H=Function.prototype.toString;var V=B,G=Y,q=E,Z=function(t){if(null!=t){try{return H.call(t)}catch(t){}try{return t+""}catch(t){}}return""},J=/^\[object .+?Constructor\]$/,K=Function.prototype,Q=Object.prototype,W=K.toString,X=Q.hasOwnProperty,tt=RegExp("^"+W.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var et=function(t){return!(!q(t)||G(t))&&(V(t)?tt:J).test(Z(t))},rt=function(t,e){return null==t?void 0:t[e]};var nt=function(t,e){var r=rt(t,e);return et(r)?r:void 0},ot=nt(Object,"create"),at=ot;var it=function(){this.__data__=at?at(null):{},this.size=0};var ct=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},ut=ot,st=Object.prototype.hasOwnProperty;var lt=function(t){var e=this.__data__;if(ut){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return st.call(e,t)?e[t]:void 0},ft=ot,dt=Object.prototype.hasOwnProperty;var pt=ot;var ht=it,vt=ct,yt=lt,gt=function(t){var e=this.__data__;return ft?void 0!==e[t]:dt.call(e,t)},mt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=pt&&void 0===e?"__lodash_hash_undefined__":e,this};function bt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}bt.prototype.clear=ht,bt.prototype.delete=vt,bt.prototype.get=yt,bt.prototype.has=gt,bt.prototype.set=mt;var _t=bt;var wt=function(){this.__data__=[],this.size=0};var jt=function(t,e){return t===e||t!=t&&e!=e};var St=function(t,e){for(var r=t.length;r--;)if(jt(t[r][0],e))return r;return-1},Ct=St,Nt=Array.prototype.splice;var Ot=St;var $t=St;var Tt=St;var At=wt,xt=function(t){var e=this.__data__,r=Ct(e,t);return!(r<0)&&(r==e.length-1?e.pop():Nt.call(e,r,1),--this.size,!0)},Mt=function(t){var e=this.__data__,r=Ot(e,t);return r<0?void 0:e[r][1]},Pt=function(t){return $t(this.__data__,t)>-1},zt=function(t,e){var r=this.__data__,n=Tt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function kt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}kt.prototype.clear=At,kt.prototype.delete=xt,kt.prototype.get=Mt,kt.prototype.has=Pt,kt.prototype.set=zt;var It=kt,Et=nt(v,"Map"),Ft=_t,Lt=It,Ut=Et;var Bt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Dt=function(t,e){var r=t.__data__;return Bt(e)?r["string"==typeof e?"string":"hash"]:r.map},Rt=Dt;var Yt=Dt;var Ht=Dt;var Vt=Dt;var Gt=function(){this.size=0,this.__data__={hash:new Ft,map:new(Ut||Lt),string:new Ft}},qt=function(t){var e=Rt(this,t).delete(t);return this.size-=e?1:0,e},Zt=function(t){return Yt(this,t).get(t)},Jt=function(t){return Ht(this,t).has(t)},Kt=function(t,e){var r=Vt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Qt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Qt.prototype.clear=Gt,Qt.prototype.delete=qt,Qt.prototype.get=Zt,Qt.prototype.has=Jt,Qt.prototype.set=Kt;var Wt=Qt;function Xt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Xt.Cache||Wt),r}Xt.Cache=Wt;var te=Xt;var ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/\\(\\)?/g,ne=function(t){var e=te(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ee,(function(t,r,n,o){e.push(n?o.replace(re,"$1"):r||t)})),e}));var oe=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},ae=d,ie=x,ce=y?y.prototype:void 0,ue=ce?ce.toString:void 0;var se=function t(e){if("string"==typeof e)return e;if(ae(e))return oe(e,t)+"";if(ie(e))return ue?ue.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r},le=se;var fe=d,de=I,pe=ne,he=function(t){return null==t?"":le(t)};var ve=x;var ye=function(t,e){return fe(t)?t:de(t,e)?[t]:pe(he(t))},ge=function(t){if("string"==typeof t||ve(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var me=function(t,e){for(var r=0,n=(e=ye(e,t)).length;null!=t&&r<n;)t=t[ge(e[r++])];return r&&r==n?t:void 0};var be=f((function(t,e,r){var n=null==t?void 0:me(t,e);return void 0===n?r:n}));const _e={columnIndexCache:new Map,columnNameCache:new Map};function we(t){const e=t.toUpperCase();if(_e.columnIndexCache.has(e))return _e.columnIndexCache.get(e);let r=0;for(let t=0;t<e.length;t++)r=26*r+(e.charCodeAt(t)-65+1);const n=r-1;return _e.columnIndexCache.set(e,n),n}const je={getStr(t=[],e,r=""){const n=be(t,`[${e}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(t=[],e,r=0){const n=be(t,`[${e}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(t=[],e,r=!1){if(!Array.isArray(t))return r;const n=be(t,`[${e}]`,r);return"boolean"==typeof n?n:r}},Se={getStr(t=[],e,r=""){const n=we(e),o=be(t,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(t=[],e,r=0){const n=we(e),o=be(t,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(t=[],e,r=!1){const n=we(e);if(!Array.isArray(t))return r;const o=be(t,`[${n}]`,r);return"boolean"==typeof o?o:r}};const Ce=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Ne=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),Oe=t=>{const e=Ce(),r=Ne();if("frontend"===t&&!e)throw new Error("This function can only be used in a frontend environment.");if("backend"===t&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===t?e:r};return t.ColumnMapper=Se,t.IndexMapper=je,t.StyledLogger=class{static getStyle(t){switch(t){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(t,e="",...r){if(Ce())console.log(`%c[${t.toUpperCase()}] ${e}`,this.getStyle(t),...r);else{const n={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${n[t]}[${t.toUpperCase()}] ${e}[0m`,...r)}}static info(t,...e){this.log("info",t,...e)}static warn(t,...e){this.log("warn",t,...e)}static error(t,...e){this.log("error",t,...e)}static success(t,...e){this.log("success",t,...e)}static debug(t,...e){this.log("debug",t,...e)}},t.checkEnvironment=Oe,t.convertDigitalSize=(t,e,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[t]||!n[e])throw new Error("Invalid unit");return parseFloat((r*n[t]/n[e]).toFixed(2))},t.copyToClipboard=async t=>{Oe("frontend"),await navigator.clipboard.writeText(t)},t.debounce=(t,e=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(t(...o))}),e),i&&a(t(...o))}))},t.delay=t=>new Promise((e=>setTimeout(e,t))),t.extractErrorMessage=(t,e="Noma'lum xatolik")=>{if(!t)return e;let r="";if("object"==typeof t){const e=t?.response?.data?.errors;if(Array.isArray(e))r=e.map((t=>t.message)).filter(Boolean).join("\n");else{const e=t?.response?.data;r="string"==typeof e?s(e):e?.error?.message||t.message||""}r||(r=t.message||"")}else r=s(String(t));return r.trim()||e},t.formatCurrencyPrice=(t,e,r="en-US")=>t?.toLocaleString(r,{style:"currency",currency:e}),t.formatDateLocaleString=(t,e="en-GB",r="Asia/Tashkent")=>new Date(t).toLocaleString(e,{timeZone:r}),t.formatPrice=t=>t.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),t.formatStringToFloat=t=>{(t=(t=t.toString()).replace(/\s/g,"")).includes(",")&&t.includes(".")?t=t.replace(/,/g,""):t.includes(",")&&(t=t.replace(/,/g,"."));const e=Number(t);return isNaN(e)?0:e},t.getColumnIndex=we,t.getColumnName=function(t){if(_e.columnNameCache.has(t))return _e.columnNameCache.get(t);let e="";for(;t>=0;){const r=t%26;e=String.fromCharCode(65+r)+e,t=Math.floor(t/26)-1}return _e.columnNameCache.set(t,e),e},t.getFormattedDate=(t=Date.now(),e="DD/MM/YYYY HH:mm:ss")=>{const r=i.default(t);return r.isValid()?r.format(e):""},t.getFunctionName=t=>t.name||null,t.getLocalIP=()=>{Oe("backend");const t=u.default.networkInterfaces();for(const e in t)for(const r of t[e]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},t.getRandomInt=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),t.getValueByName=function(t=[],e,r=null){if(!Array.isArray(t))return r;const n=we(e);return be(t,`[${n}]`,r)},t.isBrowser=Ce,t.isNode=Ne,t.parseSeparatedNumber=t=>{const e=Number(t?.replace(/,/g,""));return isNaN(e)?0:e},t.runCommand=async t=>{Oe("backend");const e=c.default.promisify(n.exec),{stdout:r,stderr:o}=await e(t);if(o)throw new Error(o);return r.trim()},t.saveFile=(t,e)=>{if(Oe("frontend"),window.navigator){const r=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=r,n.download=e,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},t.scrollToElement=t=>{Oe("frontend");const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})},t.stripHtmlTags=s,Object.defineProperty(t,"__esModule",{value:!0}),t}({},moment,util,child_process,os);
|
|
1
|
+
var apizum=function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=n(e),a=n(r);const i=t=>t.replace(/<[^>]*>/g,"").trim();var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function u(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var s=Array.isArray,l="object"==typeof c&&c&&c.Object===Object&&c,f="object"==typeof self&&self&&self.Object===Object&&self,d=l||f||Function("return this")(),p=d.Symbol,h=p,v=Object.prototype,y=v.hasOwnProperty,g=v.toString,m=h?h.toStringTag:void 0;var b=function(t){var e=y.call(t,m),r=t[m];try{t[m]=void 0;var n=!0}catch(t){}var o=g.call(t);return n&&(e?t[m]=r:delete t[m]),o},_=Object.prototype.toString;var w=b,j=function(t){return _.call(t)},S=p?p.toStringTag:void 0;var C=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":S&&S in Object(t)?w(t):j(t)};var N=C,O=function(t){return null!=t&&"object"==typeof t};var $=function(t){return"symbol"==typeof t||O(t)&&"[object Symbol]"==N(t)},T=s,A=$,x=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M=/^\w*$/;var P=function(t,e){if(T(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!A(t))||(M.test(t)||!x.test(t)||null!=e&&t in Object(e))};var z=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},k=C,I=z;var E,F=function(t){if(!I(t))return!1;var e=k(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},L=d["__core-js_shared__"],U=(E=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"";var B=function(t){return!!U&&U in t},D=Function.prototype.toString;var R=F,Y=B,H=z,V=function(t){if(null!=t){try{return D.call(t)}catch(t){}try{return t+""}catch(t){}}return""},G=/^\[object .+?Constructor\]$/,q=Function.prototype,Z=Object.prototype,J=q.toString,K=Z.hasOwnProperty,Q=RegExp("^"+J.call(K).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var W=function(t){return!(!H(t)||Y(t))&&(R(t)?Q:G).test(V(t))},X=function(t,e){return null==t?void 0:t[e]};var tt=function(t,e){var r=X(t,e);return W(r)?r:void 0},et=tt(Object,"create"),rt=et;var nt=function(){this.__data__=rt?rt(null):{},this.size=0};var ot=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},at=et,it=Object.prototype.hasOwnProperty;var ct=function(t){var e=this.__data__;if(at){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return it.call(e,t)?e[t]:void 0},ut=et,st=Object.prototype.hasOwnProperty;var lt=et;var ft=nt,dt=ot,pt=ct,ht=function(t){var e=this.__data__;return ut?void 0!==e[t]:st.call(e,t)},vt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=lt&&void 0===e?"__lodash_hash_undefined__":e,this};function yt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}yt.prototype.clear=ft,yt.prototype.delete=dt,yt.prototype.get=pt,yt.prototype.has=ht,yt.prototype.set=vt;var gt=yt;var mt=function(){this.__data__=[],this.size=0};var bt=function(t,e){return t===e||t!=t&&e!=e};var _t=function(t,e){for(var r=t.length;r--;)if(bt(t[r][0],e))return r;return-1},wt=_t,jt=Array.prototype.splice;var St=_t;var Ct=_t;var Nt=_t;var Ot=mt,$t=function(t){var e=this.__data__,r=wt(e,t);return!(r<0)&&(r==e.length-1?e.pop():jt.call(e,r,1),--this.size,!0)},Tt=function(t){var e=this.__data__,r=St(e,t);return r<0?void 0:e[r][1]},At=function(t){return Ct(this.__data__,t)>-1},xt=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Mt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Mt.prototype.clear=Ot,Mt.prototype.delete=$t,Mt.prototype.get=Tt,Mt.prototype.has=At,Mt.prototype.set=xt;var Pt=Mt,zt=tt(d,"Map"),kt=gt,It=Pt,Et=zt;var Ft=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Lt=function(t,e){var r=t.__data__;return Ft(e)?r["string"==typeof e?"string":"hash"]:r.map},Ut=Lt;var Bt=Lt;var Dt=Lt;var Rt=Lt;var Yt=function(){this.size=0,this.__data__={hash:new kt,map:new(Et||It),string:new kt}},Ht=function(t){var e=Ut(this,t).delete(t);return this.size-=e?1:0,e},Vt=function(t){return Bt(this,t).get(t)},Gt=function(t){return Dt(this,t).has(t)},qt=function(t,e){var r=Rt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Zt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Zt.prototype.clear=Yt,Zt.prototype.delete=Ht,Zt.prototype.get=Vt,Zt.prototype.has=Gt,Zt.prototype.set=qt;var Jt=Zt;function Kt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Kt.Cache||Jt),r}Kt.Cache=Jt;var Qt=Kt;var Wt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xt=/\\(\\)?/g,te=function(t){var e=Qt(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Wt,(function(t,r,n,o){e.push(n?o.replace(Xt,"$1"):r||t)})),e}));var ee=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},re=s,ne=$,oe=p?p.prototype:void 0,ae=oe?oe.toString:void 0;var ie=function t(e){if("string"==typeof e)return e;if(re(e))return ee(e,t)+"";if(ne(e))return ae?ae.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r},ce=ie;var ue=s,se=P,le=te,fe=function(t){return null==t?"":ce(t)};var de=$;var pe=function(t,e){return ue(t)?t:se(t,e)?[t]:le(fe(t))},he=function(t){if("string"==typeof t||de(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var ve=function(t,e){for(var r=0,n=(e=pe(e,t)).length;null!=t&&r<n;)t=t[he(e[r++])];return r&&r==n?t:void 0};var ye=u((function(t,e,r){var n=null==t?void 0:ve(t,e);return void 0===n?r:n}));const ge={columnIndexCache:new Map,columnNameCache:new Map};function me(t){const e=t.toUpperCase();if(ge.columnIndexCache.has(e))return ge.columnIndexCache.get(e);let r=0;for(let t=0;t<e.length;t++)r=26*r+(e.charCodeAt(t)-65+1);const n=r-1;return ge.columnIndexCache.set(e,n),n}const be={getStr(t=[],e,r=""){const n=ye(t,`[${e}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(t=[],e,r=0){const n=ye(t,`[${e}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(t=[],e,r=!1){if(!Array.isArray(t))return r;const n=ye(t,`[${e}]`,r);return"boolean"==typeof n?n:r}},_e={getStr(t=[],e,r=""){const n=me(e),o=ye(t,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(t=[],e,r=0){const n=me(e),o=ye(t,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(t=[],e,r=!1){const n=me(e);if(!Array.isArray(t))return r;const o=ye(t,`[${n}]`,r);return"boolean"==typeof o?o:r}};const we=()=>"undefined"!=typeof window&&"undefined"!=typeof document,je=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),Se=t=>{const e=we(),r=je();if("frontend"===t&&!e)throw new Error("This function can only be used in a frontend environment.");if("backend"===t&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===t?e:r};return t.ColumnMapper=_e,t.IndexMapper=be,t.StyledLogger=class{static getStyle(t){switch(t){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(t,e="",...r){if(we())console.log(`%c[${t.toUpperCase()}] ${e}`,this.getStyle(t),...r);else{const n={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${n[t]}[${t.toUpperCase()}] ${e}[0m`,...r)}}static info(t,...e){this.log("info",t,...e)}static warn(t,...e){this.log("warn",t,...e)}static error(t,...e){this.log("error",t,...e)}static success(t,...e){this.log("success",t,...e)}static debug(t,...e){this.log("debug",t,...e)}},t.checkEnvironment=Se,t.convertDigitalSize=(t,e,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[t]||!n[e])throw new Error("Invalid unit");return parseFloat((r*n[t]/n[e]).toFixed(2))},t.copyToClipboard=async t=>{Se("frontend"),await navigator.clipboard.writeText(t)},t.debounce=(t,e=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(t(...o))}),e),i&&a(t(...o))}))},t.delay=t=>new Promise((e=>setTimeout(e,t))),t.extractErrorMessage=(t,e="Noma'lum xatolik")=>{if(!t)return e;let r="";if("object"==typeof t){const e=t?.response?.data?.errors;if(Array.isArray(e))r=e.map((t=>t.message)).filter(Boolean).join("\n");else{const e=t?.response?.data;r="string"==typeof e?i(e):e?.error?.message||t.message||""}r||(r=t.message||"")}else r=i(String(t));return r.trim()||e},t.formatCurrencyPrice=(t,e,r="en-US")=>t?.toLocaleString(r,{style:"currency",currency:e}),t.formatDateLocaleString=(t,e="en-GB",r="Asia/Tashkent")=>new Date(t).toLocaleString(e,{timeZone:r}),t.formatPrice=t=>t.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),t.formatStringToFloat=t=>{(t=(t=t.toString()).replace(/\s/g,"")).includes(",")&&t.includes(".")?t=t.replace(/,/g,""):t.includes(",")&&(t=t.replace(/,/g,"."));const e=Number(t);return isNaN(e)?0:e},t.getColumnIndex=me,t.getColumnName=function(t){if(ge.columnNameCache.has(t))return ge.columnNameCache.get(t);let e="";for(;t>=0;){const r=t%26;e=String.fromCharCode(65+r)+e,t=Math.floor(t/26)-1}return ge.columnNameCache.set(t,e),e},t.getFormattedDate=(t=Date.now(),e="DD/MM/YYYY HH:mm:ss")=>{const r=o.default(t);return r.isValid()?r.format(e):""},t.getFunctionName=t=>t.name||null,t.getLocalIP=()=>{Se("backend");const t=a.default.networkInterfaces();for(const e in t)for(const r of t[e]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},t.getRandomInt=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),t.getValueByName=function(t=[],e,r=null){if(!Array.isArray(t))return r;const n=me(e);return ye(t,`[${n}]`,r)},t.isBrowser=we,t.isNode=je,t.parseSeparatedNumber=t=>{const e=Number(t?.replace(/,/g,""));return isNaN(e)?0:e},t.runCommand=async t=>{if(Se("backend")){const e=await import("util"),{exec:r}=await import("child_process"),n=e.promisify(r),{stdout:o,stderr:a}=await n(t);if(a)throw new Error(a);return o.trim()}return""},t.saveFile=(t,e)=>{if(Se("frontend"),window.navigator){const r=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=r,n.download=e,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},t.scrollToElement=t=>{Se("frontend");const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})},t.stripHtmlTags=i,Object.defineProperty(t,"__esModule",{value:!0}),t}({},moment,os);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("moment"),require("util"),require("child_process"),require("os")):"function"==typeof define&&define.amd?define(["exports","moment","util","child_process","os"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).apizum={},t.moment,t.util,t.child_process,t.os)}(this,(function(t,e,r,n,o){"use strict";function a(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var i=a(e),c=a(r),s=a(o);const u=t=>t.replace(/<[^>]*>/g,"").trim();var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var d=Array.isArray,p="object"==typeof l&&l&&l.Object===Object&&l,h="object"==typeof self&&self&&self.Object===Object&&self,y=p||h||Function("return this")(),v=y.Symbol,g=v,m=Object.prototype,b=m.hasOwnProperty,_=m.toString,w=g?g.toStringTag:void 0;var j=function(t){var e=b.call(t,w),r=t[w];try{t[w]=void 0;var n=!0}catch(t){}var o=_.call(t);return n&&(e?t[w]=r:delete t[w]),o},S=Object.prototype.toString;var C=j,N=function(t){return S.call(t)},O=v?v.toStringTag:void 0;var $=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":O&&O in Object(t)?C(t):N(t)};var T=$,x=function(t){return null!=t&&"object"==typeof t};var A=function(t){return"symbol"==typeof t||x(t)&&"[object Symbol]"==T(t)},M=d,P=A,z=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,k=/^\w*$/;var I=function(t,e){if(M(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!P(t))||(k.test(t)||!z.test(t)||null!=e&&t in Object(e))};var E=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},F=$,L=E;var U,B=function(t){if(!L(t))return!1;var e=F(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},D=y["__core-js_shared__"],R=(U=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var q=function(t){return!!R&&R in t},Y=Function.prototype.toString;var H=B,V=q,G=E,Z=function(t){if(null!=t){try{return Y.call(t)}catch(t){}try{return t+""}catch(t){}}return""},J=/^\[object .+?Constructor\]$/,K=Function.prototype,Q=Object.prototype,W=K.toString,X=Q.hasOwnProperty,tt=RegExp("^"+W.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var et=function(t){return!(!G(t)||V(t))&&(H(t)?tt:J).test(Z(t))},rt=function(t,e){return null==t?void 0:t[e]};var nt=function(t,e){var r=rt(t,e);return et(r)?r:void 0},ot=nt(Object,"create"),at=ot;var it=function(){this.__data__=at?at(null):{},this.size=0};var ct=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},st=ot,ut=Object.prototype.hasOwnProperty;var lt=function(t){var e=this.__data__;if(st){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return ut.call(e,t)?e[t]:void 0},ft=ot,dt=Object.prototype.hasOwnProperty;var pt=ot;var ht=it,yt=ct,vt=lt,gt=function(t){var e=this.__data__;return ft?void 0!==e[t]:dt.call(e,t)},mt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=pt&&void 0===e?"__lodash_hash_undefined__":e,this};function bt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}bt.prototype.clear=ht,bt.prototype.delete=yt,bt.prototype.get=vt,bt.prototype.has=gt,bt.prototype.set=mt;var _t=bt;var wt=function(){this.__data__=[],this.size=0};var jt=function(t,e){return t===e||t!=t&&e!=e};var St=function(t,e){for(var r=t.length;r--;)if(jt(t[r][0],e))return r;return-1},Ct=St,Nt=Array.prototype.splice;var Ot=St;var $t=St;var Tt=St;var xt=wt,At=function(t){var e=this.__data__,r=Ct(e,t);return!(r<0)&&(r==e.length-1?e.pop():Nt.call(e,r,1),--this.size,!0)},Mt=function(t){var e=this.__data__,r=Ot(e,t);return r<0?void 0:e[r][1]},Pt=function(t){return $t(this.__data__,t)>-1},zt=function(t,e){var r=this.__data__,n=Tt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function kt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}kt.prototype.clear=xt,kt.prototype.delete=At,kt.prototype.get=Mt,kt.prototype.has=Pt,kt.prototype.set=zt;var It=kt,Et=nt(y,"Map"),Ft=_t,Lt=It,Ut=Et;var Bt=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Dt=function(t,e){var r=t.__data__;return Bt(e)?r["string"==typeof e?"string":"hash"]:r.map},Rt=Dt;var qt=Dt;var Yt=Dt;var Ht=Dt;var Vt=function(){this.size=0,this.__data__={hash:new Ft,map:new(Ut||Lt),string:new Ft}},Gt=function(t){var e=Rt(this,t).delete(t);return this.size-=e?1:0,e},Zt=function(t){return qt(this,t).get(t)},Jt=function(t){return Yt(this,t).has(t)},Kt=function(t,e){var r=Ht(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Qt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Qt.prototype.clear=Vt,Qt.prototype.delete=Gt,Qt.prototype.get=Zt,Qt.prototype.has=Jt,Qt.prototype.set=Kt;var Wt=Qt;function Xt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Xt.Cache||Wt),r}Xt.Cache=Wt;var te=Xt;var ee=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,re=/\\(\\)?/g,ne=function(t){var e=te(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(ee,(function(t,r,n,o){e.push(n?o.replace(re,"$1"):r||t)})),e}));var oe=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},ae=d,ie=A,ce=v?v.prototype:void 0,se=ce?ce.toString:void 0;var ue=function t(e){if("string"==typeof e)return e;if(ae(e))return oe(e,t)+"";if(ie(e))return se?se.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r},le=ue;var fe=d,de=I,pe=ne,he=function(t){return null==t?"":le(t)};var ye=A;var ve=function(t,e){return fe(t)?t:de(t,e)?[t]:pe(he(t))},ge=function(t){if("string"==typeof t||ye(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var me=function(t,e){for(var r=0,n=(e=ve(e,t)).length;null!=t&&r<n;)t=t[ge(e[r++])];return r&&r==n?t:void 0};var be=f((function(t,e,r){var n=null==t?void 0:me(t,e);return void 0===n?r:n}));const _e={columnIndexCache:new Map,columnNameCache:new Map};function we(t){const e=t.toUpperCase();if(_e.columnIndexCache.has(e))return _e.columnIndexCache.get(e);let r=0;for(let t=0;t<e.length;t++)r=26*r+(e.charCodeAt(t)-65+1);const n=r-1;return _e.columnIndexCache.set(e,n),n}const je={getStr(t=[],e,r=""){const n=be(t,`[${e}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(t=[],e,r=0){const n=be(t,`[${e}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(t=[],e,r=!1){if(!Array.isArray(t))return r;const n=be(t,`[${e}]`,r);return"boolean"==typeof n?n:r}},Se={getStr(t=[],e,r=""){const n=we(e),o=be(t,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(t=[],e,r=0){const n=we(e),o=be(t,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(t=[],e,r=!1){const n=we(e);if(!Array.isArray(t))return r;const o=be(t,`[${n}]`,r);return"boolean"==typeof o?o:r}};const Ce=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Ne=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),Oe=t=>{const e=Ce(),r=Ne();if("frontend"===t&&!e)throw new Error("This function can only be used in a frontend environment.");if("backend"===t&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===t?e:r};t.ColumnMapper=Se,t.IndexMapper=je,t.StyledLogger=class{static getStyle(t){switch(t){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(t,e="",...r){if(Ce())console.log(`%c[${t.toUpperCase()}] ${e}`,this.getStyle(t),...r);else{const n={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${n[t]}[${t.toUpperCase()}] ${e}[0m`,...r)}}static info(t,...e){this.log("info",t,...e)}static warn(t,...e){this.log("warn",t,...e)}static error(t,...e){this.log("error",t,...e)}static success(t,...e){this.log("success",t,...e)}static debug(t,...e){this.log("debug",t,...e)}},t.checkEnvironment=Oe,t.convertDigitalSize=(t,e,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[t]||!n[e])throw new Error("Invalid unit");return parseFloat((r*n[t]/n[e]).toFixed(2))},t.copyToClipboard=async t=>{Oe("frontend"),await navigator.clipboard.writeText(t)},t.debounce=(t,e=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(t(...o))}),e),i&&a(t(...o))}))},t.delay=t=>new Promise((e=>setTimeout(e,t))),t.extractErrorMessage=(t,e="Noma'lum xatolik")=>{if(!t)return e;let r="";if("object"==typeof t){const e=t?.response?.data?.errors;if(Array.isArray(e))r=e.map((t=>t.message)).filter(Boolean).join("\n");else{const e=t?.response?.data;r="string"==typeof e?u(e):e?.error?.message||t.message||""}r||(r=t.message||"")}else r=u(String(t));return r.trim()||e},t.formatCurrencyPrice=(t,e,r="en-US")=>t?.toLocaleString(r,{style:"currency",currency:e}),t.formatDateLocaleString=(t,e="en-GB",r="Asia/Tashkent")=>new Date(t).toLocaleString(e,{timeZone:r}),t.formatPrice=t=>t.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),t.formatStringToFloat=t=>{(t=(t=t.toString()).replace(/\s/g,"")).includes(",")&&t.includes(".")?t=t.replace(/,/g,""):t.includes(",")&&(t=t.replace(/,/g,"."));const e=Number(t);return isNaN(e)?0:e},t.getColumnIndex=we,t.getColumnName=function(t){if(_e.columnNameCache.has(t))return _e.columnNameCache.get(t);let e="";for(;t>=0;){const r=t%26;e=String.fromCharCode(65+r)+e,t=Math.floor(t/26)-1}return _e.columnNameCache.set(t,e),e},t.getFormattedDate=(t=Date.now(),e="DD/MM/YYYY HH:mm:ss")=>{const r=i.default(t);return r.isValid()?r.format(e):""},t.getFunctionName=t=>t.name||null,t.getLocalIP=()=>{Oe("backend");const t=s.default.networkInterfaces();for(const e in t)for(const r of t[e]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},t.getRandomInt=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),t.getValueByName=function(t=[],e,r=null){if(!Array.isArray(t))return r;const n=we(e);return be(t,`[${n}]`,r)},t.isBrowser=Ce,t.isNode=Ne,t.parseSeparatedNumber=t=>{const e=Number(t?.replace(/,/g,""));return isNaN(e)?0:e},t.runCommand=async t=>{Oe("backend");const e=c.default.promisify(n.exec),{stdout:r,stderr:o}=await e(t);if(o)throw new Error(o);return r.trim()},t.saveFile=(t,e)=>{if(Oe("frontend"),window.navigator){const r=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=r,n.download=e,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},t.scrollToElement=t=>{Oe("frontend");const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})},t.stripHtmlTags=u,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("moment"),require("os")):"function"==typeof define&&define.amd?define(["exports","moment","os"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).apizum={},t.moment,t.os)}(this,(function(t,e,r){"use strict";function n(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var o=n(e),a=n(r);const i=t=>t.replace(/<[^>]*>/g,"").trim();var c="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function s(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var u=Array.isArray,l="object"==typeof c&&c&&c.Object===Object&&c,f="object"==typeof self&&self&&self.Object===Object&&self,d=l||f||Function("return this")(),p=d.Symbol,h=p,y=Object.prototype,v=y.hasOwnProperty,g=y.toString,m=h?h.toStringTag:void 0;var b=function(t){var e=v.call(t,m),r=t[m];try{t[m]=void 0;var n=!0}catch(t){}var o=g.call(t);return n&&(e?t[m]=r:delete t[m]),o},_=Object.prototype.toString;var w=b,j=function(t){return _.call(t)},S=p?p.toStringTag:void 0;var C=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":S&&S in Object(t)?w(t):j(t)};var N=C,O=function(t){return null!=t&&"object"==typeof t};var $=function(t){return"symbol"==typeof t||O(t)&&"[object Symbol]"==N(t)},T=u,x=$,A=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,M=/^\w*$/;var P=function(t,e){if(T(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!x(t))||(M.test(t)||!A.test(t)||null!=e&&t in Object(e))};var z=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},k=C,I=z;var E,F=function(t){if(!I(t))return!1;var e=k(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e},L=d["__core-js_shared__"],U=(E=/[^.]+$/.exec(L&&L.keys&&L.keys.IE_PROTO||""))?"Symbol(src)_1."+E:"";var B=function(t){return!!U&&U in t},D=Function.prototype.toString;var R=F,Y=B,q=z,H=function(t){if(null!=t){try{return D.call(t)}catch(t){}try{return t+""}catch(t){}}return""},V=/^\[object .+?Constructor\]$/,G=Function.prototype,Z=Object.prototype,J=G.toString,K=Z.hasOwnProperty,Q=RegExp("^"+J.call(K).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var W=function(t){return!(!q(t)||Y(t))&&(R(t)?Q:V).test(H(t))},X=function(t,e){return null==t?void 0:t[e]};var tt=function(t,e){var r=X(t,e);return W(r)?r:void 0},et=tt(Object,"create"),rt=et;var nt=function(){this.__data__=rt?rt(null):{},this.size=0};var ot=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},at=et,it=Object.prototype.hasOwnProperty;var ct=function(t){var e=this.__data__;if(at){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return it.call(e,t)?e[t]:void 0},st=et,ut=Object.prototype.hasOwnProperty;var lt=et;var ft=nt,dt=ot,pt=ct,ht=function(t){var e=this.__data__;return st?void 0!==e[t]:ut.call(e,t)},yt=function(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=lt&&void 0===e?"__lodash_hash_undefined__":e,this};function vt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}vt.prototype.clear=ft,vt.prototype.delete=dt,vt.prototype.get=pt,vt.prototype.has=ht,vt.prototype.set=yt;var gt=vt;var mt=function(){this.__data__=[],this.size=0};var bt=function(t,e){return t===e||t!=t&&e!=e};var _t=function(t,e){for(var r=t.length;r--;)if(bt(t[r][0],e))return r;return-1},wt=_t,jt=Array.prototype.splice;var St=_t;var Ct=_t;var Nt=_t;var Ot=mt,$t=function(t){var e=this.__data__,r=wt(e,t);return!(r<0)&&(r==e.length-1?e.pop():jt.call(e,r,1),--this.size,!0)},Tt=function(t){var e=this.__data__,r=St(e,t);return r<0?void 0:e[r][1]},xt=function(t){return Ct(this.__data__,t)>-1},At=function(t,e){var r=this.__data__,n=Nt(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this};function Mt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Mt.prototype.clear=Ot,Mt.prototype.delete=$t,Mt.prototype.get=Tt,Mt.prototype.has=xt,Mt.prototype.set=At;var Pt=Mt,zt=tt(d,"Map"),kt=gt,It=Pt,Et=zt;var Ft=function(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t};var Lt=function(t,e){var r=t.__data__;return Ft(e)?r["string"==typeof e?"string":"hash"]:r.map},Ut=Lt;var Bt=Lt;var Dt=Lt;var Rt=Lt;var Yt=function(){this.size=0,this.__data__={hash:new kt,map:new(Et||It),string:new kt}},qt=function(t){var e=Ut(this,t).delete(t);return this.size-=e?1:0,e},Ht=function(t){return Bt(this,t).get(t)},Vt=function(t){return Dt(this,t).has(t)},Gt=function(t,e){var r=Rt(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this};function Zt(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Zt.prototype.clear=Yt,Zt.prototype.delete=qt,Zt.prototype.get=Ht,Zt.prototype.has=Vt,Zt.prototype.set=Gt;var Jt=Zt;function Kt(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new TypeError("Expected a function");var r=function(){var n=arguments,o=e?e.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=t.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(Kt.Cache||Jt),r}Kt.Cache=Jt;var Qt=Kt;var Wt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Xt=/\\(\\)?/g,te=function(t){var e=Qt(t,(function(t){return 500===r.size&&r.clear(),t})),r=e.cache;return e}((function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Wt,(function(t,r,n,o){e.push(n?o.replace(Xt,"$1"):r||t)})),e}));var ee=function(t,e){for(var r=-1,n=null==t?0:t.length,o=Array(n);++r<n;)o[r]=e(t[r],r,t);return o},re=u,ne=$,oe=p?p.prototype:void 0,ae=oe?oe.toString:void 0;var ie=function t(e){if("string"==typeof e)return e;if(re(e))return ee(e,t)+"";if(ne(e))return ae?ae.call(e):"";var r=e+"";return"0"==r&&1/e==-1/0?"-0":r},ce=ie;var se=u,ue=P,le=te,fe=function(t){return null==t?"":ce(t)};var de=$;var pe=function(t,e){return se(t)?t:ue(t,e)?[t]:le(fe(t))},he=function(t){if("string"==typeof t||de(t))return t;var e=t+"";return"0"==e&&1/t==-1/0?"-0":e};var ye=function(t,e){for(var r=0,n=(e=pe(e,t)).length;null!=t&&r<n;)t=t[he(e[r++])];return r&&r==n?t:void 0};var ve=s((function(t,e,r){var n=null==t?void 0:ye(t,e);return void 0===n?r:n}));const ge={columnIndexCache:new Map,columnNameCache:new Map};function me(t){const e=t.toUpperCase();if(ge.columnIndexCache.has(e))return ge.columnIndexCache.get(e);let r=0;for(let t=0;t<e.length;t++)r=26*r+(e.charCodeAt(t)-65+1);const n=r-1;return ge.columnIndexCache.set(e,n),n}const be={getStr(t=[],e,r=""){const n=ve(t,`[${e}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(t=[],e,r=0){const n=ve(t,`[${e}]`,"");if(""===n)return r;if("number"==typeof n)return n;const o=Number(n);return isNaN(o)?r:o},getBool(t=[],e,r=!1){if(!Array.isArray(t))return r;const n=ve(t,`[${e}]`,r);return"boolean"==typeof n?n:r}},_e={getStr(t=[],e,r=""){const n=me(e),o=ve(t,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(t=[],e,r=0){const n=me(e),o=ve(t,`[${n}]`,"");if(""===o)return r;if("number"==typeof o)return o;const a=Number(o);return isNaN(a)?r:a},getBool(t=[],e,r=!1){const n=me(e);if(!Array.isArray(t))return r;const o=ve(t,`[${n}]`,r);return"boolean"==typeof o?o:r}};const we=()=>"undefined"!=typeof window&&"undefined"!=typeof document,je=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),Se=t=>{const e=we(),r=je();if("frontend"===t&&!e)throw new Error("This function can only be used in a frontend environment.");if("backend"===t&&!r)throw new Error("This function can only be used in a backend environment.");return"frontend"===t?e:r};t.ColumnMapper=_e,t.IndexMapper=be,t.StyledLogger=class{static getStyle(t){switch(t){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(t,e="",...r){if(we())console.log(`%c[${t.toUpperCase()}] ${e}`,this.getStyle(t),...r);else{const n={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${n[t]}[${t.toUpperCase()}] ${e}[0m`,...r)}}static info(t,...e){this.log("info",t,...e)}static warn(t,...e){this.log("warn",t,...e)}static error(t,...e){this.log("error",t,...e)}static success(t,...e){this.log("success",t,...e)}static debug(t,...e){this.log("debug",t,...e)}},t.checkEnvironment=Se,t.convertDigitalSize=(t,e,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[t]||!n[e])throw new Error("Invalid unit");return parseFloat((r*n[t]/n[e]).toFixed(2))},t.copyToClipboard=async t=>{Se("frontend"),await navigator.clipboard.writeText(t)},t.debounce=(t,e=300,r=!1)=>{let n=null;return(...o)=>new Promise((a=>{const i=r&&!n;n&&clearTimeout(n),n=setTimeout((()=>{n=null,r||a(t(...o))}),e),i&&a(t(...o))}))},t.delay=t=>new Promise((e=>setTimeout(e,t))),t.extractErrorMessage=(t,e="Noma'lum xatolik")=>{if(!t)return e;let r="";if("object"==typeof t){const e=t?.response?.data?.errors;if(Array.isArray(e))r=e.map((t=>t.message)).filter(Boolean).join("\n");else{const e=t?.response?.data;r="string"==typeof e?i(e):e?.error?.message||t.message||""}r||(r=t.message||"")}else r=i(String(t));return r.trim()||e},t.formatCurrencyPrice=(t,e,r="en-US")=>t?.toLocaleString(r,{style:"currency",currency:e}),t.formatDateLocaleString=(t,e="en-GB",r="Asia/Tashkent")=>new Date(t).toLocaleString(e,{timeZone:r}),t.formatPrice=t=>t.toString()?.replace(/\B(?=(\d{3})+(?!\d))/g," "),t.formatStringToFloat=t=>{(t=(t=t.toString()).replace(/\s/g,"")).includes(",")&&t.includes(".")?t=t.replace(/,/g,""):t.includes(",")&&(t=t.replace(/,/g,"."));const e=Number(t);return isNaN(e)?0:e},t.getColumnIndex=me,t.getColumnName=function(t){if(ge.columnNameCache.has(t))return ge.columnNameCache.get(t);let e="";for(;t>=0;){const r=t%26;e=String.fromCharCode(65+r)+e,t=Math.floor(t/26)-1}return ge.columnNameCache.set(t,e),e},t.getFormattedDate=(t=Date.now(),e="DD/MM/YYYY HH:mm:ss")=>{const r=o.default(t);return r.isValid()?r.format(e):""},t.getFunctionName=t=>t.name||null,t.getLocalIP=()=>{Se("backend");const t=a.default.networkInterfaces();for(const e in t)for(const r of t[e]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"},t.getRandomInt=(t,e)=>(t=Math.ceil(t),e=Math.floor(e),Math.floor(Math.random()*(e-t+1))+t),t.getValueByName=function(t=[],e,r=null){if(!Array.isArray(t))return r;const n=me(e);return ve(t,`[${n}]`,r)},t.isBrowser=we,t.isNode=je,t.parseSeparatedNumber=t=>{const e=Number(t?.replace(/,/g,""));return isNaN(e)?0:e},t.runCommand=async t=>{if(Se("backend")){const e=await import("util"),{exec:r}=await import("child_process"),n=e.promisify(r),{stdout:o,stderr:a}=await n(t);if(a)throw new Error(a);return o.trim()}return""},t.saveFile=(t,e)=>{if(Se("frontend"),window.navigator){const r=window.URL.createObjectURL(t),n=document.createElement("a");n.style.display="none",n.href=r,n.download=e,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(r),document.body.removeChild(n)}),1e3)}},t.scrollToElement=t=>{Se("frontend");const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})},t.stripHtmlTags=i,Object.defineProperty(t,"__esModule",{value:!0})}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("os");var e=require("./check-environment.js");exports.copyToClipboard=async r=>{e.checkEnvironment("frontend"),await navigator.clipboard.writeText(r)};
|
package/lib/cjs/utils/dom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("os");var e=require("./check-environment.js");exports.scrollToElement=r=>{e.checkEnvironment("frontend");const o=document.querySelector(r);o&&o.scrollIntoView({behavior:"smooth"})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("os");require("moment"),require("lodash/get")
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("os");require("moment"),require("lodash/get");var r=require("./check-environment.js");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=t(e);exports.getLocalIP=()=>{r.checkEnvironment("backend");const e=n.default.networkInterfaces();for(const r in e)for(const t of e[r]||[])if("IPv4"===t.family&&!t.internal)return t.address;return"127.0.0.1"};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-command.d.ts","sourceRoot":"","sources":["../../../src/utils/run-command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-command.d.ts","sourceRoot":"","sources":["../../../src/utils/run-command.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,YAAmB,MAAM,KAAG,OAAO,CAAC,MAAM,CAYhE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0})
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("os");var e=require("./check-environment.js");function r(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}exports.runCommand=async t=>{if(e.checkEnvironment("backend")){const e=await Promise.resolve().then((function(){return r(require("util"))})),{exec:n}=await Promise.resolve().then((function(){return r(require("child_process"))})),i=e.promisify(n),{stdout:o,stderr:u}=await i(t);if(u)throw new Error(u);return o.trim()}return""};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("os");var e=require("./check-environment.js");exports.saveFile=(o,t)=>{if(e.checkEnvironment("frontend"),window.navigator){const e=window.URL.createObjectURL(o),n=document.createElement("a");n.style.display="none",n.href=e,n.download=t,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(e),document.body.removeChild(n)}),1e3)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("moment"),require("lodash/get"),require("os");var e=require("./check-environment.js");exports.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(o,t="",...r){if(e.isBrowser())console.log(`%c[${o.toUpperCase()}] ${t}`,this.getStyle(o),...r);else{const e={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${e[o]}[${o.toUpperCase()}] ${t}[0m`,...r)}}static info(e,...o){this.log("info",e,...o)}static warn(e,...o){this.log("warn",e,...o)}static error(e,...o){this.log("error",e,...o)}static success(e,...o){this.log("success",e,...o)}static debug(e,...o){this.log("debug",e,...o)}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"moment";import"lodash/get";import"
|
|
1
|
+
import"moment";import"lodash/get";import"os";import{checkEnvironment as o}from"./check-environment.js";const t=async t=>{o("frontend"),await navigator.clipboard.writeText(t)};export{t as copyToClipboard};
|
package/lib/esm/utils/dom.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"moment";import"lodash/get";import"
|
|
1
|
+
import"moment";import"lodash/get";import"os";import{checkEnvironment as o}from"./check-environment.js";const t=t=>{o("frontend");const e=document.querySelector(t);e&&e.scrollIntoView({behavior:"smooth"})};export{t as scrollToElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import o from"os";import"moment";import"lodash/get";import
|
|
1
|
+
import o from"os";import"moment";import"lodash/get";import{checkEnvironment as r}from"./check-environment.js";const t=()=>{r("backend");const t=o.networkInterfaces();for(const o in t)for(const r of t[o]||[])if("IPv4"===r.family&&!r.internal)return r.address;return"127.0.0.1"};export{t as getLocalIP};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-command.d.ts","sourceRoot":"","sources":["../../../src/utils/run-command.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-command.d.ts","sourceRoot":"","sources":["../../../src/utils/run-command.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,UAAU,YAAmB,MAAM,KAAG,OAAO,CAAC,MAAM,CAYhE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"moment";import"lodash/get";import"os";import{checkEnvironment as t}from"./check-environment.js";const r=async r=>{if(t("backend")){const t=await import("util"),{exec:o}=await import("child_process"),i=t.promisify(o),{stdout:e,stderr:m}=await i(r);if(m)throw new Error(m);return e.trim()}return""};export{r as runCommand};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"moment";import"lodash/get";import"
|
|
1
|
+
import"moment";import"lodash/get";import"os";import{checkEnvironment as e}from"./check-environment.js";const o=(o,t)=>{if(e("frontend"),window.navigator){const e=window.URL.createObjectURL(o),n=document.createElement("a");n.style.display="none",n.href=e,n.download=t,document.body.appendChild(n),n.click(),setTimeout((()=>{window.URL.revokeObjectURL(e),document.body.removeChild(n)}),1e3)}};export{o as saveFile};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"moment";import"lodash/get";import"
|
|
1
|
+
import"moment";import"lodash/get";import"os";import{isBrowser as o}from"./check-environment.js";class t{static getStyle(o){switch(o){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(t,e="",...r){if(o())console.log(`%c[${t.toUpperCase()}] ${e}`,this.getStyle(t),...r);else{const o={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${o[t]}[${t.toUpperCase()}] ${e}[0m`,...r)}}static info(o,...t){this.log("info",o,...t)}static warn(o,...t){this.log("warn",o,...t)}static error(o,...t){this.log("error",o,...t)}static success(o,...t){this.log("success",o,...t)}static debug(o,...t){this.log("debug",o,...t)}}export{t as StyledLogger};
|