utilzify 1.1.6 → 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/extract-error-message.d.ts.map +1 -1
- package/lib/cjs/utils/extract-error-message.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/extract-error-message.d.ts.map +1 -1
- package/lib/esm/utils/extract-error-message.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),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,v=p||h||Function("return this")(),g=v.Symbol,y=g,m=Object.prototype,b=m.hasOwnProperty,_=m.toString,w=y?y.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=g?g.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 M=function(t){return"symbol"==typeof t||x(t)&&"[object Symbol]"==T(t)},P=d,z=M,A=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,E=/^\w*$/;var k=function(t,e){if(P(t))return!1;var r=typeof t;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=t&&!z(t))||(E.test(t)||!A.test(t)||null!=e&&t in Object(e))};var I=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},F=$,L=I;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=I,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},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,vt=ct,gt=lt,yt=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=gt,bt.prototype.has=yt,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,Mt=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)},Pt=function(t){var e=this.__data__,r=Ot(e,t);return r<0?void 0:e[r][1]},zt=function(t){return $t(this.__data__,t)>-1},At=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 Et(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])}}Et.prototype.clear=xt,Et.prototype.delete=Mt,Et.prototype.get=Pt,Et.prototype.has=zt,Et.prototype.set=At;var kt=Et,It=nt(v,"Map"),Ft=_t,Lt=kt,Ut=It;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=M,ce=g?g.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=k,pe=ne,he=function(t){return null==t?"":le(t)};var ve=M;var ge=function(t,e){return fe(t)?t:de(t,e)?[t]:pe(he(t))},ye=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=ge(e,t)).length;null!=t&&r<n;)t=t[ye(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"";console.log(t);let r="";if("object"==typeof t){const e=t?.response?.data?.errors;if(e)(e||[]).forEach((t=>{t.message&&(r+=t.message+"\n")}));else{const e=t?.response?.data,n="string"==typeof e?u(e):t?.response?.data?.error?.message||t.message||"";r+=n?n+"\n":""}const n=t.message||"";r+=n?n+"\n":"",t.errors&&t.errors.forEach((t=>{t.message&&(r+=t.message+"\n")}))}else r+=u(String(t))+"\n";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}),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(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("moment"),require("util"),require("child_process"),require("os")):"function"==typeof define&&define.amd?define(["exports","moment","util","child_process","os"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).apizum={},e.moment,e.util,e.child_process,e.os)}(this,(function(e,t,r,n,o){"use strict";function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=a(t),c=a(r),s=a(o);const u=e=>e.replace(/<[^>]*>/g,"").trim();var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function f(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}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")(),g=y.Symbol,v=g,m=Object.prototype,b=m.hasOwnProperty,_=m.toString,w=v?v.toStringTag:void 0;var j=function(e){var t=b.call(e,w),r=e[w];try{e[w]=void 0;var n=!0}catch(e){}var o=_.call(e);return n&&(t?e[w]=r:delete e[w]),o},S=Object.prototype.toString;var C=j,N=function(e){return S.call(e)},O=g?g.toStringTag:void 0;var $=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":O&&O in Object(e)?C(e):N(e)};var T=$,x=function(e){return null!=e&&"object"==typeof e};var M=function(e){return"symbol"==typeof e||x(e)&&"[object Symbol]"==T(e)},P=d,z=M,A=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,E=/^\w*$/;var k=function(e,t){if(P(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!z(e))||(E.test(e)||!A.test(e)||null!=t&&e in Object(t))};var I=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},F=$,L=I;var U,B=function(e){if(!L(e))return!1;var t=F(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},D=y["__core-js_shared__"],R=(U=/[^.]+$/.exec(D&&D.keys&&D.keys.IE_PROTO||""))?"Symbol(src)_1."+U:"";var q=function(e){return!!R&&R in e},Y=Function.prototype.toString;var H=B,V=q,G=I,Z=function(e){if(null!=e){try{return Y.call(e)}catch(e){}try{return e+""}catch(e){}}return""},J=/^\[object .+?Constructor\]$/,K=Function.prototype,Q=Object.prototype,W=K.toString,X=Q.hasOwnProperty,ee=RegExp("^"+W.call(X).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var te=function(e){return!(!G(e)||V(e))&&(H(e)?ee:J).test(Z(e))},re=function(e,t){return null==e?void 0:e[t]};var ne=function(e,t){var r=re(e,t);return te(r)?r:void 0},oe=ne(Object,"create"),ae=oe;var ie=function(){this.__data__=ae?ae(null):{},this.size=0};var ce=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},se=oe,ue=Object.prototype.hasOwnProperty;var le=function(e){var t=this.__data__;if(se){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return ue.call(t,e)?t[e]:void 0},fe=oe,de=Object.prototype.hasOwnProperty;var pe=oe;var he=ie,ye=ce,ge=le,ve=function(e){var t=this.__data__;return fe?void 0!==t[e]:de.call(t,e)},me=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=pe&&void 0===t?"__lodash_hash_undefined__":t,this};function be(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])}}be.prototype.clear=he,be.prototype.delete=ye,be.prototype.get=ge,be.prototype.has=ve,be.prototype.set=me;var _e=be;var we=function(){this.__data__=[],this.size=0};var je=function(e,t){return e===t||e!=e&&t!=t};var Se=function(e,t){for(var r=e.length;r--;)if(je(e[r][0],t))return r;return-1},Ce=Se,Ne=Array.prototype.splice;var Oe=Se;var $e=Se;var Te=Se;var xe=we,Me=function(e){var t=this.__data__,r=Ce(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ne.call(t,r,1),--this.size,!0)},Pe=function(e){var t=this.__data__,r=Oe(t,e);return r<0?void 0:t[r][1]},ze=function(e){return $e(this.__data__,e)>-1},Ae=function(e,t){var r=this.__data__,n=Te(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this};function Ee(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])}}Ee.prototype.clear=xe,Ee.prototype.delete=Me,Ee.prototype.get=Pe,Ee.prototype.has=ze,Ee.prototype.set=Ae;var ke=Ee,Ie=ne(y,"Map"),Fe=_e,Le=ke,Ue=Ie;var Be=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var De=function(e,t){var r=e.__data__;return Be(t)?r["string"==typeof t?"string":"hash"]:r.map},Re=De;var qe=De;var Ye=De;var He=De;var Ve=function(){this.size=0,this.__data__={hash:new Fe,map:new(Ue||Le),string:new Fe}},Ge=function(e){var t=Re(this,e).delete(e);return this.size-=t?1:0,t},Ze=function(e){return qe(this,e).get(e)},Je=function(e){return Ye(this,e).has(e)},Ke=function(e,t){var r=He(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this};function Qe(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])}}Qe.prototype.clear=Ve,Qe.prototype.delete=Ge,Qe.prototype.get=Ze,Qe.prototype.has=Je,Qe.prototype.set=Ke;var We=Qe;function Xe(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(Xe.Cache||We),r}Xe.Cache=We;var et=Xe;var tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rt=/\\(\\)?/g,nt=function(e){var t=et(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(tt,(function(e,r,n,o){t.push(n?o.replace(rt,"$1"):r||e)})),t}));var ot=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},at=d,it=M,ct=g?g.prototype:void 0,st=ct?ct.toString:void 0;var ut=function e(t){if("string"==typeof t)return t;if(at(t))return ot(t,e)+"";if(it(t))return st?st.call(t):"";var r=t+"";return"0"==r&&1/t==-1/0?"-0":r},lt=ut;var ft=d,dt=k,pt=nt,ht=function(e){return null==e?"":lt(e)};var yt=M;var gt=function(e,t){return ft(e)?e:dt(e,t)?[e]:pt(ht(e))},vt=function(e){if("string"==typeof e||yt(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=gt(t,e)).length;null!=e&&r<n;)e=e[vt(t[r++])];return r&&r==n?e:void 0};var bt=f((function(e,t,r){var n=null==e?void 0:mt(e,t);return void 0===n?r:n}));const _t={columnIndexCache:new Map,columnNameCache:new Map};function wt(e){const t=e.toUpperCase();if(_t.columnIndexCache.has(t))return _t.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 _t.columnIndexCache.set(t,n),n}const jt={getStr(e=[],t,r=""){const n=bt(e,`[${t}]`,"");return"number"==typeof n?String(n):String(n||r).trim()},getNum(e=[],t,r=0){const n=bt(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=bt(e,`[${t}]`,r);return"boolean"==typeof n?n:r}},St={getStr(e=[],t,r=""){const n=wt(t),o=bt(e,`[${n}]`,"");return"number"==typeof o?String(o):String(o||r).trim()},getNum(e=[],t,r=0){const n=wt(t),o=bt(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=wt(t);if(!Array.isArray(e))return r;const o=bt(e,`[${n}]`,r);return"boolean"==typeof o?o:r}};const Ct=()=>"undefined"!=typeof window&&"undefined"!=typeof document,Nt=()=>"undefined"!=typeof process&&Boolean(process.versions?.node),Ot=e=>{const t=Ct(),r=Nt();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};e.ColumnMapper=St,e.IndexMapper=jt,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(Ct())console.log(`%c[${e.toUpperCase()}] ${t}`,this.getStyle(e),...r);else{const n={log:"[34m",info:"[32m",warn:"[33m",error:"[31m",success:"[32m",debug:"[35m"};console.log(`${n[e]}[${e.toUpperCase()}] ${t}[0m`,...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=Ot,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=>{Ot("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"";console.log(e);let r="";if("object"==typeof e){const t=e?.response?.data?.errors;if(t)(t||[]).forEach((e=>{e.message&&(r+=e.message+"\n")}));else{const t=e?.response?.data,n="string"==typeof t?u(t):e?.response?.data?.error?.message||e.message||"";r+=n?n+"\n":""}const n=e.message||"";r+=n?n+"\n":"",e.errors&&e.errors.forEach((e=>{e.message&&(r+=e.message+"\n")}))}else r+=u(String(e))+"\n";return r.trim()||t},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=wt,e.getColumnName=function(e){if(_t.columnNameCache.has(e))return _t.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 _t.columnNameCache.set(e,t),t},e.getFormattedDate=(e=Date.now(),t="DD/MM/YYYY HH:mm:ss")=>{const r=i.default(e);return r.isValid()?r.format(t):""},e.getFunctionName=e=>e.name||null,e.getLocalIP=()=>{Ot("backend");const e=s.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=wt(t);return bt(e,`[${n}]`,r)},e.isBrowser=Ct,e.isNode=Nt,e.parseSeparatedNumber=e=>{const t=Number(e?.replace(/,/g,""));return isNaN(t)?0:t},e.runCommand=async e=>{Ot("backend");const t=c.default.promisify(n.exec),{stdout:r,stderr:o}=await t(e);if(o)throw new Error(o);return r.trim()},e.saveFile=(e,t)=>{if(Ot("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)}},e.scrollToElement=e=>{Ot("frontend");const t=document.querySelector(e);t&&t.scrollIntoView({behavior:"smooth"})},e.stripHtmlTags=u,Object.defineProperty(e,"__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
|
-
{"version":3,"file":"extract-error-message.d.ts","sourceRoot":"","sources":["../../../src/utils/extract-error-message.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,UAAW,GAAG,qBAAoB,MAAM,KAAwB,
|
|
1
|
+
{"version":3,"file":"extract-error-message.d.ts","sourceRoot":"","sources":["../../../src/utils/extract-error-message.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,UAAW,GAAG,qBAAoB,MAAM,KAAwB,MA6B/F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./tools.js");exports.extractErrorMessage=(s
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./tools.js");exports.extractErrorMessage=(r,s="Noma'lum xatolik")=>{if(!r)return s;let t="";if("object"==typeof r){const s=r?.response?.data?.errors;if(Array.isArray(s))t=s.map((e=>e.message)).filter(Boolean).join("\n");else{const s=r?.response?.data;t="string"==typeof s?e.stripHtmlTags(s):s?.error?.message||r.message||""}t||(t=r.message||"")}else t=e.stripHtmlTags(String(r));return t.trim()||s};
|
|
@@ -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
|
-
{"version":3,"file":"extract-error-message.d.ts","sourceRoot":"","sources":["../../../src/utils/extract-error-message.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,UAAW,GAAG,qBAAoB,MAAM,KAAwB,
|
|
1
|
+
{"version":3,"file":"extract-error-message.d.ts","sourceRoot":"","sources":["../../../src/utils/extract-error-message.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,UAAW,GAAG,qBAAoB,MAAM,KAAwB,MA6B/F,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{stripHtmlTags as e}from"./tools.js";const
|
|
1
|
+
import{stripHtmlTags as e}from"./tools.js";const r=(r,s="Noma'lum xatolik")=>{if(!r)return s;let o="";if("object"==typeof r){const s=r?.response?.data?.errors;if(Array.isArray(s))o=s.map((e=>e.message)).filter(Boolean).join("\n");else{const s=r?.response?.data;o="string"==typeof s?e(s):s?.error?.message||r.message||""}o||(o=r.message||"")}else o=e(String(r));return o.trim()||s};export{r as extractErrorMessage};
|
|
@@ -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};
|