{"version":3,"sources":["jsdelivr-header.js","/npm/serilogger@0.5.1/dist/serilogger.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA;AACA;AACA","file":"/npm/serilogger@0.5.1/dist/serilogger.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/serilogger@0.5.1/dist/serilogger.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","!function(e,t){\"object\"==typeof exports&&\"undefined\"!=typeof module?t(exports):\"function\"==typeof define&&define.amd?define([\"exports\"],t):t((e=\"undefined\"!=typeof globalThis?globalThis:e||self).serilogger={})}(this,(function(e){\"use strict\";var t;function r(e,t){return void 0===e||(e&t)===t}e.LogEventLevel=void 0,(t=e.LogEventLevel||(e.LogEventLevel={}))[t.off=0]=\"off\",t[t.fatal=1]=\"fatal\",t[t.error=3]=\"error\",t[t.warning=7]=\"warning\",t[t.information=15]=\"information\",t[t.debug=31]=\"debug\",t[t.verbose=63]=\"verbose\";var n=function(e,t,r,n,o){this.timestamp=e,this.level=t,this.messageTemplate=r,this.properties=n||{},this.error=o||void 0},o=function(){function e(e){this.enricher=e}return e.prototype.emit=function(e){for(var t=0;t<e.length;++t){var r=this.enricher instanceof Function?this.enricher((n=e[t].properties,JSON.parse(JSON.stringify(n)))):this.enricher;Object.assign(e[t].properties,r)}var n;return e},e.prototype.flush=function(){return Promise.resolve()},e}(),i=/{@?\\w+}/g,s=function(){function e(e){if(this.jsonTemplateStringMaxLength=70,null===e||!e.length)throw new Error('Argument \"messageTemplate\" is required.');this.raw=e,this.tokens=this.tokenize(e)}return e.prototype.render=function(e){if(!this.tokens.length)return this.raw;e=e||{};for(var t=[],r=0;r<this.tokens.length;++r){var n=this.tokens[r];\"string\"==typeof n.name?e.hasOwnProperty(n.name)?t.push(this.toText(e[n.name])):t.push(n.raw):t.push(n.text)}return t.join(\"\")},e.prototype.bindProperties=function(e){for(var t={},r=0,n=0;n<this.tokens.length&&r<e.length;++n){var o=this.tokens[n];if(\"string\"==typeof o.name){var i=e[r];t[o.name]=this.capture(i,o.destructure),r++}}for(;r<e.length;){var s=e[r];void 0!==s&&(t[\"a\"+r]=this.capture(s)),r++}return t},e.prototype.tokenize=function(e){for(var t,r=[],n=0;null!==(t=i.exec(e));){t.index!==n&&r.push({text:e.slice(n,t.index)});var o=!1,s=t[0].slice(1,-1);0===s.indexOf(\"@\")&&(s=s.slice(1),o=!0),r.push({name:s,destructure:o,raw:t[0]}),n=i.lastIndex}return n>=0&&n<e.length&&r.push({text:e.slice(n)}),r},e.prototype.toText=function(e){if(void 0===e)return\"undefined\";if(null===e)return\"null\";if(\"string\"==typeof e)return e;if(\"number\"==typeof e)return e.toString();if(\"boolean\"==typeof e)return e.toString();if(\"function\"==typeof e.toISOString)return e.toISOString();if(\"object\"==typeof e){var t=JSON.stringify(e);return-1===this.jsonTemplateStringMaxLength||t.length>this.jsonTemplateStringMaxLength&&(t=t.slice(0,67)+\"...\"),t}return e.toString()},e.prototype.capture=function(e,t){return\"function\"==typeof e?e.toString():\"object\"==typeof e?null===e||t||\"function\"==typeof e.toISOString?e:e.toString():e},e}(),u=function(){function e(){this.stages=[],this.eventQueue=[],this.flushInProgress=!1}return e.prototype.addStage=function(e){this.stages.push(e)},e.prototype.emit=function(e){var t=this;if(this.flushInProgress)return this.eventQueue=this.eventQueue.concat(e),this.flushPromise;if(!this.stages.length||!e.length)return Promise.resolve();for(var r=Promise.resolve(this.stages[0].emit(e)),n=function(e){r=r.then((function(r){return t.stages[e].emit(r)}))},o=1;o<this.stages.length;++o)n(o);return r},e.prototype.flush=function(){var e=this;return this.flushInProgress?this.flushPromise:(this.flushInProgress=!0,this.flushPromise=Promise.resolve().then((function(){if(0!==e.stages.length){for(var t=e.stages[0].flush(),r=function(r){t=t.then((function(){return e.stages[r].flush()}))},n=1;n<e.stages.length;++n)r(n);return t}})).then((function(){e.flushInProgress=!1;var t=e.eventQueue.slice();return e.eventQueue=[],e.emit(t)})))},e}(),a=function(){function e(e){this.sink=e}return e.prototype.emit=function(e){return this.sink.emit(e),e},e.prototype.flush=function(){return this.sink.flush()},e}(),l=function(){function t(e,t){this.suppressErrors=!0,this._jsonTemplateStringMaxLength=70,this.pipeline=e,this.suppressErrors=void 0===t||t}return t.prototype.setJSONTemplateStringMaxLength=function(e){this._jsonTemplateStringMaxLength=e},t.prototype.createChild=function(e){if(e instanceof Function||e instanceof Object){var r=this.pipeline.stages,n=[],i=[];r.forEach((function(e){e instanceof a?i.push(e):n.push(e)})),n.push(new o(e));var s=new u;return n.forEach((function(e){return s.addStage(e)})),i.forEach((function(e){return s.addStage(e)})),new t(s,this.suppressErrors)}throw new TypeError('Argument \"enricher\" must be either a function or an object.')},t.prototype.fatal=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];try{t instanceof Error?this.write(e.LogEventLevel.fatal,r[0],r.slice(1),t):this.write(e.LogEventLevel.fatal,t,r)}catch(e){if(!this.suppressErrors)throw e}},t.prototype.error=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];try{t instanceof Error?this.write(e.LogEventLevel.error,r[0],r.slice(1),t):this.write(e.LogEventLevel.error,t,r)}catch(e){if(!this.suppressErrors)throw e}},t.prototype.warn=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];try{t instanceof Error?this.write(e.LogEventLevel.warning,r[0],r.slice(1),t):this.write(e.LogEventLevel.warning,t,r)}catch(e){if(!this.suppressErrors)throw e}},t.prototype.info=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];try{t instanceof Error?this.write(e.LogEventLevel.information,r[0],r.slice(1),t):this.write(e.LogEventLevel.information,t,r)}catch(e){if(!this.suppressErrors)throw e}},t.prototype.debug=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];try{t instanceof Error?this.write(e.LogEventLevel.debug,r[0],r.slice(1),t):this.write(e.LogEventLevel.debug,t,r)}catch(e){if(!this.suppressErrors)throw e}},t.prototype.verbose=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];try{t instanceof Error?this.write(e.LogEventLevel.verbose,r[0],r.slice(1),t):this.write(e.LogEventLevel.verbose,t,r)}catch(e){if(!this.suppressErrors)throw e}},t.prototype.flush=function(){return this.suppressErrors?this.pipeline.flush().catch((function(){})):this.pipeline.flush()},t.prototype.emit=function(e){try{return this.pipeline.emit(e),e}catch(e){if(!this.suppressErrors)throw e;return[]}},t.prototype.write=function(e,t,r,o){var i=new s(t);i.jsonTemplateStringMaxLength=this._jsonTemplateStringMaxLength;var u=i.bindProperties(r),a=new n((new Date).toISOString(),e,i,u,o);this.pipeline.emit([a])},t}(),h=function(e,t){return h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},h(e,t)};function c(e,t){if(\"function\"!=typeof t&&null!==t)throw new TypeError(\"Class extends value \"+String(t)+\" is not a constructor or null\");function r(){this.constructor=e}h(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var p=function(){return p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},p.apply(this,arguments)};function f(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function u(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,u)}a((n=n.apply(e,t||[])).next())}))}function v(e,t){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},\"function\"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(u){return function(a){return function(u){if(r)throw new TypeError(\"Generator is already executing.\");for(;i&&(i=0,u[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,n=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==u[0]&&2!==u[0])){s=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){s.label=u[1];break}if(6===u[0]&&s.label<o[1]){s.label=o[1],o=u;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(u);break}o[2]&&s.ops.pop(),s.trys.pop();continue}u=t.call(e,s)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,a])}}}function g(e,t,r){if(r||2===arguments.length)for(var n,o=0,i=t.length;o<i;o++)!n&&o in t||(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var m={removeLogLevelPrefix:!1,includeTimestamps:!1,includeProperties:!1},d=function(){function t(e){this.options=p(p({},m),e||{});var t=this.options.console||\"undefined\"!=typeof console&&console||null,r=function(){},n=!this.options.console&&\"undefined\"!=typeof process&&process.versions&&process.versions.node;this.console={error:t&&(t.error||t.log)||r,warn:t&&(t.warn||t.log)||r,info:t&&(t.info||t.log)||r,debug:t&&(!n&&t.debug||t.log)||r,log:t&&t.log||r}}return t.prototype.emit=function(t){for(var n=0;n<t.length;++n){var o=t[n];if(r(this.options.restrictedToMinimumLevel,o.level))switch(o.level){case e.LogEventLevel.fatal:this.writeToConsole(this.console.error,\"Fatal\",o);break;case e.LogEventLevel.error:this.writeToConsole(this.console.error,\"Error\",o);break;case e.LogEventLevel.warning:this.writeToConsole(this.console.warn,\"Warning\",o);break;case e.LogEventLevel.information:this.writeToConsole(this.console.info,\"Information\",o);break;case e.LogEventLevel.debug:this.writeToConsole(this.console.debug,\"Debug\",o);break;case e.LogEventLevel.verbose:this.writeToConsole(this.console.debug,\"Verbose\",o);break;default:this.writeToConsole(this.console.log,\"Log\",o)}}return null},t.prototype.flush=function(){return Promise.resolve()},t.prototype.writeToConsole=function(e,t,r){var n=\"\"+r.messageTemplate.render(r.properties);this.options.removeLogLevelPrefix||(n=\"[\"+t+\"] \"+n),this.options.includeTimestamps&&(n=r.timestamp+\" \"+n);var o=[];if(this.options.includeProperties)for(var i in r.properties)r.properties.hasOwnProperty(i)&&o.push(r.properties[i]);r.error instanceof Error&&o.push(\"\\n\",r.error),e.apply(void 0,g([n],o))},t}(),w=function(t){function r(){return null!==t&&t.apply(this,arguments)||this}return c(r,t),r.prototype.writeToConsole=function(e,t,r){var n=\"\"+r.messageTemplate.render(r.properties);this.options.removeLogLevelPrefix||(n=\"[\"+t+\"] \"+n),n=\"\"+this.logLevelToColor(r.level)+n+\"\u001b[0m\",this.options.includeTimestamps&&(n=r.timestamp+\" \"+n);var o=[];if(this.options.includeProperties)for(var i in r.properties)r.properties.hasOwnProperty(i)&&o.push(r.properties[i]);r.error instanceof Error&&o.push(\"\\n\",r.error),e.apply(void 0,g([n],o))},r.prototype.logLevelToColor=function(t){switch(t){case e.LogEventLevel.verbose:case e.LogEventLevel.debug:return\"\u001b[2m\";case e.LogEventLevel.warning:return\"\u001b[31m\";case e.LogEventLevel.fatal:return\"\u001b[37m\u001b[41m\";default:return\"\"}},r}(d),y={maxSize:100,period:5,durableStore:void 0},L=function(){function e(e,t){if(this.durableStorageKey=\"serilogger-batched-sink-durable-cache\",this.batchKey=\"\",this.shouldCycleContinue=!0,this.innerSink=e||void 0,this.options=p(p({},y),t||{}),this.batchedEvents=[],this.cycleBatch(),this.options.durableStore){var r=[];for(var n in this.options.durableStore)if(0===n.indexOf(this.durableStorageKey)){var o=JSON.parse(this.options.durableStore.getItem(n)).map((function(e){return e.messageTemplate=new s(e.messageTemplate.raw),e}));r=r.concat(o),this.options.durableStore.removeItem(n)}this.emit(r)}}return e.prototype.emit=function(e){var t,r,n;if(this.batchedEvents.length+e.length<=this.options.maxSize)(t=this.batchedEvents).push.apply(t,e),this.storeEvents();else{var o=this.options.maxSize-this.batchedEvents.length<0?0:this.options.maxSize-this.batchedEvents.length;for((r=this.batchedEvents).push.apply(r,e.slice(0,o)),this.storeEvents();o<e.length;)this.cycleBatch(),(n=this.batchedEvents).push.apply(n,e.slice(o,o+=this.options.maxSize)),this.storeEvents()}return e},e.prototype.flush=function(){this.cycleBatch();var e=this.flushCore();return e instanceof Promise?e:Promise.resolve()},e.prototype.emitCore=function(e){return this.innerSink?this.innerSink.emit(e):null},e.prototype.flushCore=function(){return this.innerSink?this.innerSink.flush():Promise.resolve()},e.prototype.cycleBatch=function(){var e=this;if(this.batchTimeout&&clearTimeout(this.batchTimeout),this.shouldCycleContinue){if(this.batchedEvents.length){var t=this.batchedEvents.slice(0);this.batchedEvents.length=0;var r=this.batchKey,n=this.emitCore(t);(n instanceof Promise?n:Promise.resolve()).then((function(){if(e.options.durableStore)return e.options.durableStore.removeItem(r)})).catch((function(){var r;(r=e.batchedEvents).unshift.apply(r,t)}))}this.batchKey=this.durableStorageKey+\"-\"+(new Date).getTime(),!isNaN(this.options.period)&&this.options.period>0&&(this.batchTimeout=setTimeout((function(){return e.cycleBatch()}),1e3*this.options.period))}},e.prototype.storeEvents=function(){this.options.durableStore&&this.options.durableStore.setItem(this.batchKey,JSON.stringify(this.batchedEvents))},e}(),b=function(){function e(e){this.predicate=e}return e.prototype.emit=function(e){return e.filter(this.predicate)},e.prototype.flush=function(){return Promise.resolve()},e}(),E=function(){function t(e){this.flushDelegate=function(){return Promise.resolve()},this.minLevel=e}return t.prototype.fatal=function(){return f(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return[4,this.flushDelegate()];case 1:return t.sent(),[2,this.minLevel=e.LogEventLevel.fatal]}}))}))},t.prototype.error=function(){return f(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return[4,this.flushDelegate()];case 1:return t.sent(),[2,this.minLevel=e.LogEventLevel.error]}}))}))},t.prototype.warning=function(){return f(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return[4,this.flushDelegate()];case 1:return t.sent(),[2,this.minLevel=e.LogEventLevel.warning]}}))}))},t.prototype.information=function(){return f(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return[4,this.flushDelegate()];case 1:return t.sent(),[2,this.minLevel=e.LogEventLevel.information]}}))}))},t.prototype.debug=function(){return f(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return[4,this.flushDelegate()];case 1:return t.sent(),[2,this.minLevel=e.LogEventLevel.debug]}}))}))},t.prototype.verbose=function(){return f(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return[4,this.flushDelegate()];case 1:return t.sent(),[2,this.minLevel=e.LogEventLevel.verbose]}}))}))},t.prototype.off=function(){return f(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return[4,this.flushDelegate()];case 1:return t.sent(),[2,this.minLevel=e.LogEventLevel.off]}}))}))},t.prototype.set=function(e){return f(this,void 0,void 0,(function(){return v(this,(function(t){switch(t.label){case 0:return[4,this.flushDelegate()];case 1:return t.sent(),[2,this.minLevel=e]}}))}))},t.prototype.isEnabled=function(e){return void 0===this.minLevel||r(this.minLevel,e)},t}(),S=function(e){function t(t){var r=e.call(this,(function(e){return t.isEnabled(e.level)}))||this;return r.dynamicLevelSwitch=t,r}return c(t,e),t.prototype.setFlushDelegate=function(e){this.dynamicLevelSwitch.flushDelegate=e},t}(b),T=function(){function e(e){var t=this;if(this.url=null,this.headers=null,this.durable=!1,this.compact=!1,this.levelSwitch=null,this.refreshLevelSwitchTimeoutId=null,this.refreshLevelSwitchTimeoutInterval=12e4,this.suppressErrors=!0,!e)throw new Error(\"'options' parameter is required.\");if(!e.url||\"\"===e.url)throw new Error(\"'options.url' parameter is required.\");if(this.url=e.url.replace(/\\/$/,\"\"),this.levelSwitch=e.levelSwitch||null,this.suppressErrors=!1!==e.suppressErrors,e.durable&&\"undefined\"==typeof localStorage?(\"undefined\"!=typeof console&&console.warn&&console.warn(\"'options.durable' parameter was set to true, but 'localStorage' is not available.\"),this.durable=!1):this.durable=!!e.durable,this.compact=!!e.compact,this.durable)for(var r={},n=function(e){var n=localStorage.key(e);if(0!==n.indexOf(\"serilogger-\"+o.toString()))return\"continue\";var i=localStorage.getItem(n);r[n]=o.postToLogger(o.url,i).then((function(){return localStorage.removeItem(n)})).catch((function(e){throw t.suppressErrors&&t.logSuppressedError(e),new Error(e)}))},o=this,i=0;i<localStorage.length;++i)n(i);null!==this.levelSwitch&&(this.refreshLevelSwitchTimeoutId=setTimeout((function(){return t.sendToServer([])}),this.refreshLevelSwitchTimeoutInterval)),null!==this.headers&&(this.headers=e.headers)}return e.prototype.toString=function(){return\"ApiSink\"},e.prototype.emit=function(e){var t=this,r=this.levelSwitch?e.filter((function(e){return t.levelSwitch.isEnabled(e.level)})):e;return r.length?this.sendToServer(r):Promise.resolve()},e.prototype.flush=function(){return Promise.resolve()},e.prototype.sendToServer=function(e){return f(this,void 0,void 0,(function(){var t,r,n,o,i,s=this;return v(this,(function(u){switch(u.label){case 0:t=this.compact?e.reduce((function(e,t){var r=p({\"@l\":s.mapLogLevel(t.level),\"@mt\":t.messageTemplate.raw,\"@t\":t.timestamp},t.properties);return t.error instanceof Error&&t.error.stack&&(r[\"@x\"]=t.error.stack),\"\"+e+JSON.stringify(r)+\"\\n\"}),\"\").replace(/\\s+$/g,\"\"):e.map((function(e){var t={Level:s.mapLogLevel(e.level),MessageTemplate:e.messageTemplate.raw,Properties:e.properties,Timestamp:e.timestamp};return e.error instanceof Error&&e.error.stack&&(t.Exception=e.error.stack),t})),r=this.compact?t:JSON.stringify({Events:t}),this.durable&&(n=\"serilogger-\"+this.toString()+\"-\"+(new Date).getTime()+\"-\"+(Math.floor(1e6*Math.random())+1),localStorage.setItem(n,r)),u.label=1;case 1:return u.trys.push([1,4,,5]),[4,this.postToLogger(this.url,r)];case 2:return[4,u.sent().json()];case 3:return o=u.sent(),this.updateLogLevel(o),n&&localStorage.removeItem(n),[3,5];case 4:return i=u.sent(),[2,this.suppressErrors?this.logSuppressedError(i):Promise.reject(i)];case 5:return[2]}}))}))},e.prototype.updateLogLevel=function(e){var t=this;if(this.levelSwitch&&(this.refreshLevelSwitchTimeoutId&&(clearTimeout(this.refreshLevelSwitchTimeoutId),this.refreshLevelSwitchTimeoutId=setTimeout((function(){return t.sendToServer([])}),this.refreshLevelSwitchTimeoutInterval)),e&&e.MinimumLevelAccepted))switch(e.MinimumLevelAccepted){case\"Fatal\":this.levelSwitch.fatal();break;case\"Error\":this.levelSwitch.error();break;case\"Warning\":this.levelSwitch.warning();break;case\"Information\":this.levelSwitch.information();break;case\"Debug\":this.levelSwitch.debug();break;case\"Verbose\":this.levelSwitch.verbose()}},e.prototype.logSuppressedError=function(e){\"undefined\"!=typeof console&&console.warn&&console.warn(\"Suppressed error when logging to \"+this.toString()+\": \"+e)},e.prototype.mapLogLevel=function(e){return 1===e?\"Fatal\":3===e?\"Error\":7===e?\"Warning\":31===e?\"Debug\":63===e?\"Verbose\":\"Information\"},e.prototype.postToLogger=function(e,t){return fetch(\"\"+e,{headers:this.headers||{},method:\"POST\",body:t})},e}(),k=function(e){function t(t){var r=e.call(this,{compact:t.compact||!1,durable:t.durable||!1,levelSwitch:t.levelSwitch,suppressErrors:t.suppressErrors||!0,url:t.url,headers:null})||this;return r.apiKey=null,r.apiKey=t.apiKey,r}return c(t,e),t.prototype.toString=function(){return\"SeqSink\"},t.prototype.postToLogger=function(e,t){var r=this.apiKey?\"?apiKey=\"+this.apiKey:\"\";return fetch(e+\"/api/events/raw\"+r,{headers:{\"content-type\":this.compact?\"application/vnd.serilog.clef\":\"application/json\"},method:\"POST\",body:t})},t}(T),P=function(){function t(){var t=this;this.minLevel=Object.assign((function(n){if(null==n)throw new TypeError('Argument \"levelOrSwitch\" is not a valid LogEventLevel value or DynamicLevelSwitch instance.');if(n instanceof E){var o=new S(n);return o.setFlushDelegate((function(){return t._stages.flush()})),t._stages.addStage(o),t}if(\"string\"==typeof n){var i=e.LogEventLevel[n.toLowerCase()];if(null==i)throw new TypeError('Argument \"levelOrSwitch\" is not a valid LogEventLevel value.');return t.filter((function(e){return r(i,e.level)}))}return t.filter((function(e){return r(n,e.level)}))}),{fatal:function(){return t.minLevel(e.LogEventLevel.fatal)},error:function(){return t.minLevel(e.LogEventLevel.error)},warning:function(){return t.minLevel(e.LogEventLevel.warning)},information:function(){return t.minLevel(e.LogEventLevel.information)},debug:function(){return t.minLevel(e.LogEventLevel.debug)},verbose:function(){return t.minLevel(e.LogEventLevel.verbose)}}),this._stages=new u,this._sinks=[],this._suppressErrors=!0}return t.prototype.writeTo=function(e){return this._sinks.push(new a(e)),this},t.prototype.filter=function(e){if(!(e instanceof Function))throw new TypeError('Argument \"predicate\" must be a function.');return this._stages.addStage(new b(e)),this},t.prototype.enrich=function(e){if(!(e instanceof Function||e instanceof Object))throw new TypeError('Argument \"enricher\" must be either a function or an object.');return this._stages.addStage(new o(e)),this},t.prototype.suppressErrors=function(e){return this._suppressErrors=void 0===e||e,this},t.prototype.readFromConfiguration=function(e,t){var r,n;if(void 0===t&&(t=\"serilogger\"),null==e)throw new TypeError('Argument \"config\" cannot be null or undefined');if(!e[t])throw new TypeError('Argument \"config\" must contain a property of \"'+t+'\"');if(!(e=e[t]).writeTo)throw new TypeError('Argument \"config\" must contain a sub-property of \"writeTo\"');if(!(e.writeTo instanceof Array))throw new TypeError('\"writeTo\" property must be an Array');if(0===e.writeTo.length)throw new TypeError('\"writeTo\" property must have at least one element');for(var o=0,i=e.writeTo;o<i.length;o++){var s=i[o];if(s.name)switch(s.name.toLowerCase()){case\"console\":this._sinks.push(new a(new d(null!==(r=s.args)&&void 0!==r?r:null)));break;case\"coloredconsole\":this._sinks.push(new a(new w(null!==(n=s.args)&&void 0!==n?n:null)));break;case\"seq\":if(!s.args)throw new TypeError(\"Seq sink requires input arguments\");this._sinks.push(new a(new k(s.args)));break;default:throw new TypeError(\"Unknown WriteTo Type: \"+s.name)}}return this},t.prototype.create=function(){var e=this;return this._sinks.forEach((function(t){return e._stages.addStage(t)})),new l(this._stages,this._suppressErrors)},t}();e.ApiSink=T,e.BatchedSink=L,e.ColoredConsoleSink=w,e.ConsoleSink=d,e.DynamicLevelSwitch=E,e.LogEvent=n,e.Logger=l,e.LoggerConfiguration=P,e.SeqSink=k,e.configure=function(){return new P}}));\n\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6W10sInNvdXJjZXMiOltdLCJtYXBwaW5ncyI6IiIsImlnbm9yZUxpc3QiOltdfQ=="]}