import"./index.f2790301.js";class n{constructor(e,r,t){this.color=e,this.identifier=r||!1,this.flags={ERROR:{label:"\u{1F4A5} Error",hex:"#d50000"},WARNING:{label:"\u26A0\uFE0F Warning",hex:"#ffc107"},INFO:{label:"\u{1F4AC} Info",hex:"#00BCD4"},PERFORMANCE:{label:"\u{1F4CA} Performance",hex:"#673ab7"},SUCCESS:{label:"\u2714\uFE0F Success",hex:"#4caf50"},STANDARD:{label:"",hex:"#4caf50"}},this.initTime=Date.now(),this.enableOnProduction=t,this.performanceMonitoring=!0}prefixCssString(e,r){let t="margin-bottom: 0.25em; ";return t+=`color: ${r.color||this.color}; `,t+="font-size: 1.3em; ",t}bodyCssString(e){let r="margin-bottom: 0.25em; ";return e&&(r+=`border-color: ${e.hex}; `),r+="border-radius: 0 2px 2px 0; ",r+="border-left-width: 1.5em; ",r+="margin-left: 1em; ",r}suffixCssString(){let e="font-style: italic; font-size: 0.8em; border: 1px solid black; ";return e+=`border-bottom-color: ${this.color}; border-width: 0 0 1px; `,e}flagLevelIndicatorCssString(e){return`color: ${e.hex}; margin-left: 0.5rem; font-size: 1em; `}subHeadingCssString(e,r){return`
      color: ${r.subheadingColor||this.color};
      margin-left: 1em;
    `}loggingEnabled(){return!!this.enableOnProduction}log(e,r,t=[],i={}){if(Array.isArray(t)||(t=[t]),!this.loggingEnabled())return;r||(r=this.flags.STANDARD);const o="expand for more context";typeof console.groupCollapsed=="function"?(console.groupCollapsed(`%c${this.identifier}%c${r.label}%c${i.subheading||""}%c
> ${e}
%c${o}`,this.prefixCssString(r,i),this.flagLevelIndicatorCssString(r),this.subHeadingCssString(r,i),this.bodyCssString(r),this.suffixCssString(r)),t.forEach(s=>{Array.isArray(s)||(s=[s]),console.log(...s)}),console.trace(),console.groupEnd(),typeof e=="object"&&console.log(e)):console.log(`%c${this.identifier}:%c${e}`,this.prefixCssString(r),this.bodyCssString(r))}table(e,r){!this.loggingEnabled()||console.table(e,r)}mark(e){!this.performanceMonitoring||(this.observer||(this.createObserver(),performance.mark("loggerPerformanceMarkStart")),performance.mark(e))}measure(e){if(!this.performanceMonitoring)return!1;try{performance.measure(e,"loggerPerformanceMarkStart")}catch(r){return r}return!0}beginFrame(){!this.performanceMonitoring||(this.frameTime=performance.now())}createObserver(){!this.performanceMonitoring||(this.observer=new PerformanceObserver(e=>{const r=e.getEntries(),t=r[0].startTime,i={};for(let o=0,s=r.length;o<s;++o)i[r[o].name]=r[o].startTime-t;this.log("FRAME",this.flags.PERFORMANCE),this.table(i,["name","delta"]),performance.clearMarks()}),this.observer.observe({entryTypes:["mark","measure"]}))}}const c=n;export{c as L};
//# sourceMappingURL=logger.5c633fc9.js.map
