Socket
Socket
Sign inDemoInstall

prism-console

Package Overview
Dependencies
14
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.1 to 1.0.2

cjs/utils.d.ts

5

cjs/index.d.ts
import { Grammar } from "prismjs";
import { Platform } from "./utils";
import { Theme } from "./theme";

@@ -7,5 +8,7 @@ /**

* @param theme The theme to highlight the code with
* @param platform The platform
* @returns The arguments to pass to `console.*`
*/
export declare function highlight(code: string, grammar: Grammar, { textColor, tokens }: Theme): string[];
export declare function highlight(code: string, grammar: Grammar, theme: Theme, platform?: Platform): string[];
export * from "./theme";
export { Platform } from "./utils";

17

cjs/index.js

@@ -1,1 +0,16 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var prismjs=require("prismjs");function tokenStreamToString(e){return"string"==typeof e?e:Array.isArray(e)?e.map(tokenStreamToString).join(""):tokenStreamToString(e.content)}function escapePercent(e){return e.replace(/%+/g,e=>"%".repeat(2*e.length))}var commentre=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,parse=function(e,t){t=t||{};var r=1,n=1;function o(e){var t=e.match(/\n/g);t&&(r+=t.length);var o=e.lastIndexOf("\n");n=~o?e.length-o:n+e.length}function i(){var e={line:r,column:n};return function(t){return t.position=new s(e),h(),t}}function s(e){this.start=e,this.end={line:r,column:n},this.source=t.source}s.prototype.content=e;var a=[];function u(o){var i=new Error(t.source+":"+r+":"+n+": "+o);if(i.reason=o,i.filename=t.source,i.line=r,i.column=n,i.source=e,!t.silent)throw i;a.push(i)}function l(){return m(/^{\s*/)}function c(){return m(/^}/)}function p(){var t,r=[];for(h(),g(r);e.length&&"}"!=e.charAt(0)&&(t=E()||R());)!1!==t&&(r.push(t),g(r));return r}function m(t){var r=t.exec(e);if(r){var n=r[0];return o(n),e=e.slice(n.length),r}}function h(){m(/^\s*/)}function g(e){var t;for(e=e||[];t=f();)!1!==t&&e.push(t);return e}function f(){var t=i();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var r=2;""!=e.charAt(r)&&("*"!=e.charAt(r)||"/"!=e.charAt(r+1));)++r;if(r+=2,""===e.charAt(r-1))return u("End of comment missing");var s=e.slice(2,r-2);return n+=2,o(s),e=e.slice(r),n+=2,t({type:"comment",comment:s})}}function d(){var e=m(/^([^{]+)/);if(e)return trim(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function S(){var e=i(),t=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){if(t=trim(t[0]),!m(/^:\s*/))return u("property missing ':'");var r=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),n=e({type:"declaration",property:t.replace(commentre,""),value:r?trim(r[0]).replace(commentre,""):""});return m(/^[;\s]*/),n}}function y(){var e,t=[];if(!l())return u("missing '{'");for(g(t);e=S();)!1!==e&&(t.push(e),g(t));return c()?t:u("missing '}'")}function v(){for(var e,t=[],r=i();e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return r({type:"keyframe",values:t,declarations:y()})}var _,C=L("import"),M=L("charset"),A=L("namespace");function L(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var r=i(),n=m(t);if(n){var o={type:e};return o[e]=n[1].trim(),r(o)}}}function E(){if("@"==e[0])return function(){var e=i();if(t=m(/^@([-\w]+)?keyframes\s*/)){var t,r=t[1];if(!(t=m(/^([-\w]+)\s*/)))return u("@keyframes missing name");var n,o=t[1];if(!l())return u("@keyframes missing '{'");for(var s=g();n=v();)s.push(n),s=s.concat(g());return c()?e({type:"keyframes",name:o,vendor:r,keyframes:s}):u("@keyframes missing '}'")}}()||function(){var e=i(),t=m(/^@media *([^{]+)/);if(t){var r=trim(t[1]);if(!l())return u("@media missing '{'");var n=g().concat(p());return c()?e({type:"media",media:r,rules:n}):u("@media missing '}'")}}()||function(){var e=i(),t=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:trim(t[1]),media:trim(t[2])})}()||function(){var e=i(),t=m(/^@supports *([^{]+)/);if(t){var r=trim(t[1]);if(!l())return u("@supports missing '{'");var n=g().concat(p());return c()?e({type:"supports",supports:r,rules:n}):u("@supports missing '}'")}}()||C()||M()||A()||function(){var e=i(),t=m(/^@([-\w]+)?document *([^{]+)/);if(t){var r=trim(t[1]),n=trim(t[2]);if(!l())return u("@document missing '{'");var o=g().concat(p());return c()?e({type:"document",document:n,vendor:r,rules:o}):u("@document missing '}'")}}()||function(){var e=i();if(m(/^@page */)){var t=d()||[];if(!l())return u("@page missing '{'");for(var r,n=g();r=S();)n.push(r),n=n.concat(g());return c()?e({type:"page",selectors:t,declarations:n}):u("@page missing '}'")}}()||function(){var e=i();if(m(/^@host\s*/)){if(!l())return u("@host missing '{'");var t=g().concat(p());return c()?e({type:"host",rules:t}):u("@host missing '}'")}}()||function(){var e=i();if(m(/^@font-face\s*/)){if(!l())return u("@font-face missing '{'");for(var t,r=g();t=S();)r.push(t),r=r.concat(g());return c()?e({type:"font-face",declarations:r}):u("@font-face missing '}'")}}()}function R(){var e=i(),t=d();return t?(g(),e({type:"rule",selectors:t,declarations:y()})):u("selector missing")}return addParent((_=p(),{type:"stylesheet",stylesheet:{source:t.source,rules:_,parsingErrors:a}}))};function trim(e){return e?e.replace(/^\s+|\s+$/g,""):""}function addParent(e,t){var r=e&&"string"==typeof e.type,n=r?e:t;for(var o in e){var i=e[o];Array.isArray(i)?i.forEach((function(e){addParent(e,n)})):i&&"object"==typeof i&&addParent(i,n)}return r&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var compiler=Compiler;function Compiler(e){this.options=e||{}}Compiler.prototype.emit=function(e){return e},Compiler.prototype.visit=function(e){return this[e.type](e)},Compiler.prototype.mapVisit=function(e,t){var r="";t=t||"";for(var n=0,o=e.length;n<o;n++)r+=this.visit(e[n]),t&&n<o-1&&(r+=this.emit(t));return r};var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}function getCjsExportFromNamespace(e){return e&&e.default||e}var _rollupPluginShim3=Object.freeze({__proto__:null}),inherits_browser=createCommonjsModule((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),require$$0=getCjsExportFromNamespace(_rollupPluginShim3),inherits=createCommonjsModule((function(e){try{var t=require$$0;if("function"!=typeof t.inherits)throw"";e.exports=t.inherits}catch(t){e.exports=inherits_browser}}));function Compiler$1(e){compiler.call(this,e)}function Compiler$2(e){e=e||{},compiler.call(this,e),this.indentation=e.indent}inherits(Compiler$1,compiler),Compiler$1.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Compiler$1.prototype.comment=function(e){return this.emit("",e.position)},Compiler$1.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Compiler$1.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Compiler$1.prototype.document=function(e){var t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Compiler$1.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Compiler$1.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Compiler$1.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Compiler$1.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Compiler$1.prototype.keyframe=function(e){var t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Compiler$1.prototype.page=function(e){var t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Compiler$1.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Compiler$1.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Compiler$1.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Compiler$1.prototype.rule=function(e){var t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},Compiler$1.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")},inherits(Compiler$2,compiler),Compiler$2.prototype.compile=function(e){return this.stylesheet(e)},Compiler$2.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Compiler$2.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Compiler$2.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Compiler$2.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Compiler$2.prototype.document=function(e){var t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Compiler$2.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Compiler$2.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Compiler$2.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Compiler$2.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},Compiler$2.prototype.keyframe=function(e){var t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},Compiler$2.prototype.page=function(e){var t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},Compiler$2.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},Compiler$2.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Compiler$2.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Compiler$2.prototype.rule=function(e){var t=this.indent(),r=e.declarations;return r.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(r,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},Compiler$2.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Compiler$2.prototype.indent=function(e){return this.level=this.level||1,null!=e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var intToCharMap="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),encode=function(e){if(0<=e&&e<intToCharMap.length)return intToCharMap[e];throw new TypeError("Must be between 0 and 63: "+e)},decode=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1},base64={encode:encode,decode:decode},VLQ_BASE_SHIFT=5,VLQ_BASE=1<<VLQ_BASE_SHIFT,VLQ_BASE_MASK=VLQ_BASE-1,VLQ_CONTINUATION_BIT=VLQ_BASE;function toVLQSigned(e){return e<0?1+(-e<<1):0+(e<<1)}function fromVLQSigned(e){var t=e>>1;return 1==(1&e)?-t:t}var encode$1=function(e){var t,r="",n=toVLQSigned(e);do{t=n&VLQ_BASE_MASK,(n>>>=VLQ_BASE_SHIFT)>0&&(t|=VLQ_CONTINUATION_BIT),r+=base64.encode(t)}while(n>0);return r},decode$1=function(e,t,r){var n,o,i=e.length,s=0,a=0;do{if(t>=i)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(o=base64.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));n=!!(o&VLQ_CONTINUATION_BIT),s+=(o&=VLQ_BASE_MASK)<<a,a+=VLQ_BASE_SHIFT}while(n);r.value=fromVLQSigned(s),r.rest=t},base64Vlq={encode:encode$1,decode:decode$1},util=createCommonjsModule((function(e,t){t.getArg=function(e,t,r){if(t in e)return e[t];if(3===arguments.length)return r;throw new Error('"'+t+'" is a required argument.')};var r=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,n=/^data:.+\,.+$/;function o(e){var t=e.match(r);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function s(e){var r=e,n=o(e);if(n){if(!n.path)return e;r=n.path}for(var s,a=t.isAbsolute(r),u=r.split(/\/+/),l=0,c=u.length-1;c>=0;c--)"."===(s=u[c])?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return""===(r=u.join("/"))&&(r=a?"/":"."),n?(n.path=r,i(n)):r}function a(e,t){""===e&&(e="."),""===t&&(t=".");var r=o(t),a=o(e);if(a&&(e=a.path||"/"),r&&!r.scheme)return a&&(r.scheme=a.scheme),i(r);if(r||t.match(n))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var u="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=u,i(a)):u}t.urlParse=o,t.urlGenerate=i,t.normalize=s,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||r.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var r=0;0!==t.indexOf(e+"/");){var n=e.lastIndexOf("/");if(n<0)return t;if((e=e.slice(0,n)).match(/^([^\/]+:\/)?\/*$/))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)};var u=!("__proto__"in Object.create(null));function l(e){return e}function c(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var r=t-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function p(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=u?l:function(e){return c(e)?"$"+e:e},t.fromSetString=u?l:function(e){return c(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,r){var n=p(e.source,t.source);return 0!==n?n:0!==(n=e.originalLine-t.originalLine)?n:0!==(n=e.originalColumn-t.originalColumn)||r?n:0!==(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=e.generatedLine-t.generatedLine)?n:p(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,r){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!==(n=e.generatedColumn-t.generatedColumn)||r?n:0!==(n=p(e.source,t.source))?n:0!==(n=e.originalLine-t.originalLine)?n:0!==(n=e.originalColumn-t.originalColumn)?n:p(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!==(r=e.generatedColumn-t.generatedColumn)?r:0!==(r=p(e.source,t.source))?r:0!==(r=e.originalLine-t.originalLine)?r:0!==(r=e.originalColumn-t.originalColumn)?r:p(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,r){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),r){var n=o(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var u=n.path.lastIndexOf("/");u>=0&&(n.path=n.path.substring(0,u+1))}t=a(i(n),t)}return s(t)}})),util_1=util.getArg,util_2=util.urlParse,util_3=util.urlGenerate,util_4=util.normalize,util_5=util.join,util_6=util.isAbsolute,util_7=util.relative,util_8=util.toSetString,util_9=util.fromSetString,util_10=util.compareByOriginalPositions,util_11=util.compareByGeneratedPositionsDeflated,util_12=util.compareByGeneratedPositionsInflated,util_13=util.parseSourceMapInput,util_14=util.computeSourceURL,has=Object.prototype.hasOwnProperty,hasNativeMap="undefined"!=typeof Map;function ArraySet(){this._array=[],this._set=hasNativeMap?new Map:Object.create(null)}ArraySet.fromArray=function(e,t){for(var r=new ArraySet,n=0,o=e.length;n<o;n++)r.add(e[n],t);return r},ArraySet.prototype.size=function(){return hasNativeMap?this._set.size:Object.getOwnPropertyNames(this._set).length},ArraySet.prototype.add=function(e,t){var r=hasNativeMap?e:util.toSetString(e),n=hasNativeMap?this.has(e):has.call(this._set,r),o=this._array.length;n&&!t||this._array.push(e),n||(hasNativeMap?this._set.set(e,o):this._set[r]=o)},ArraySet.prototype.has=function(e){if(hasNativeMap)return this._set.has(e);var t=util.toSetString(e);return has.call(this._set,t)},ArraySet.prototype.indexOf=function(e){if(hasNativeMap){var t=this._set.get(e);if(t>=0)return t}else{var r=util.toSetString(e);if(has.call(this._set,r))return this._set[r]}throw new Error('"'+e+'" is not in the set.')},ArraySet.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},ArraySet.prototype.toArray=function(){return this._array.slice()};var ArraySet_1=ArraySet,arraySet={ArraySet:ArraySet_1};function generatedPositionAfter(e,t){var r=e.generatedLine,n=t.generatedLine,o=e.generatedColumn,i=t.generatedColumn;return n>r||n==r&&i>=o||util.compareByGeneratedPositionsInflated(e,t)<=0}function MappingList(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}MappingList.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},MappingList.prototype.add=function(e){generatedPositionAfter(this._last,e)?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},MappingList.prototype.toArray=function(){return this._sorted||(this._array.sort(util.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};var MappingList_1=MappingList,mappingList={MappingList:MappingList_1},ArraySet$1=arraySet.ArraySet,MappingList$1=mappingList.MappingList;function SourceMapGenerator(e){e||(e={}),this._file=util.getArg(e,"file",null),this._sourceRoot=util.getArg(e,"sourceRoot",null),this._skipValidation=util.getArg(e,"skipValidation",!1),this._sources=new ArraySet$1,this._names=new ArraySet$1,this._mappings=new MappingList$1,this._sourcesContents=null}SourceMapGenerator.prototype._version=3,SourceMapGenerator.fromSourceMap=function(e){var t=e.sourceRoot,r=new SourceMapGenerator({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var n={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(n.source=e.source,null!=t&&(n.source=util.relative(t,n.source)),n.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(n.name=e.name)),r.addMapping(n)})),e.sources.forEach((function(n){var o=n;null!==t&&(o=util.relative(t,n)),r._sources.has(o)||r._sources.add(o);var i=e.sourceContentFor(n);null!=i&&r.setSourceContent(n,i)})),r},SourceMapGenerator.prototype.addMapping=function(e){var t=util.getArg(e,"generated"),r=util.getArg(e,"original",null),n=util.getArg(e,"source",null),o=util.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,r,n,o),null!=n&&(n=String(n),this._sources.has(n)||this._sources.add(n)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=r&&r.line,originalColumn:null!=r&&r.column,source:n,name:o})},SourceMapGenerator.prototype.setSourceContent=function(e,t){var r=e;null!=this._sourceRoot&&(r=util.relative(this._sourceRoot,r)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[util.toSetString(r)]=t):this._sourcesContents&&(delete this._sourcesContents[util.toSetString(r)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},SourceMapGenerator.prototype.applySourceMap=function(e,t,r){var n=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');n=e.file}var o=this._sourceRoot;null!=o&&(n=util.relative(o,n));var i=new ArraySet$1,s=new ArraySet$1;this._mappings.unsortedForEach((function(t){if(t.source===n&&null!=t.originalLine){var a=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=a.source&&(t.source=a.source,null!=r&&(t.source=util.join(r,t.source)),null!=o&&(t.source=util.relative(o,t.source)),t.originalLine=a.line,t.originalColumn=a.column,null!=a.name&&(t.name=a.name))}var u=t.source;null==u||i.has(u)||i.add(u);var l=t.name;null==l||s.has(l)||s.add(l)}),this),this._sources=i,this._names=s,e.sources.forEach((function(t){var n=e.sourceContentFor(t);null!=n&&(null!=r&&(t=util.join(r,t)),null!=o&&(t=util.relative(o,t)),this.setSourceContent(t,n))}),this)},SourceMapGenerator.prototype._validateMapping=function(e,t,r,n){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||r||n)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&r))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:r,original:t,name:n}))},SourceMapGenerator.prototype._serializeMappings=function(){for(var e,t,r,n,o=0,i=1,s=0,a=0,u=0,l=0,c="",p=this._mappings.toArray(),m=0,h=p.length;m<h;m++){if(e="",(t=p[m]).generatedLine!==i)for(o=0;t.generatedLine!==i;)e+=";",i++;else if(m>0){if(!util.compareByGeneratedPositionsInflated(t,p[m-1]))continue;e+=","}e+=base64Vlq.encode(t.generatedColumn-o),o=t.generatedColumn,null!=t.source&&(n=this._sources.indexOf(t.source),e+=base64Vlq.encode(n-l),l=n,e+=base64Vlq.encode(t.originalLine-1-a),a=t.originalLine-1,e+=base64Vlq.encode(t.originalColumn-s),s=t.originalColumn,null!=t.name&&(r=this._names.indexOf(t.name),e+=base64Vlq.encode(r-u),u=r)),c+=e}return c},SourceMapGenerator.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=util.relative(t,e));var r=util.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,r)?this._sourcesContents[r]:null}),this)},SourceMapGenerator.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},SourceMapGenerator.prototype.toString=function(){return JSON.stringify(this.toJSON())};var SourceMapGenerator_1=SourceMapGenerator,sourceMapGenerator={SourceMapGenerator:SourceMapGenerator_1},binarySearch=createCommonjsModule((function(e,t){t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,r,n,o){if(0===r.length)return-1;var i=function e(r,n,o,i,s,a){var u=Math.floor((n-r)/2)+r,l=s(o,i[u],!0);return 0===l?u:l>0?n-u>1?e(u,n,o,i,s,a):a==t.LEAST_UPPER_BOUND?n<i.length?n:-1:u:u-r>1?e(r,u,o,i,s,a):a==t.LEAST_UPPER_BOUND?u:r<0?-1:r}(-1,r.length,e,r,n,o||t.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===n(r[i],r[i-1],!0);)--i;return i}})),binarySearch_1=binarySearch.GREATEST_LOWER_BOUND,binarySearch_2=binarySearch.LEAST_UPPER_BOUND,binarySearch_3=binarySearch.search;function swap(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function randomIntInRange(e,t){return Math.round(e+Math.random()*(t-e))}function doQuickSort(e,t,r,n){if(r<n){var o=r-1;swap(e,randomIntInRange(r,n),n);for(var i=e[n],s=r;s<n;s++)t(e[s],i)<=0&&swap(e,o+=1,s);swap(e,o+1,s);var a=o+1;doQuickSort(e,t,r,a-1),doQuickSort(e,t,a+1,n)}}var quickSort_1=function(e,t){doQuickSort(e,t,0,e.length-1)},quickSort={quickSort:quickSort_1},ArraySet$2=arraySet.ArraySet,quickSort$1=quickSort.quickSort;function SourceMapConsumer(e,t){var r=e;return"string"==typeof e&&(r=util.parseSourceMapInput(e)),null!=r.sections?new IndexedSourceMapConsumer(r,t):new BasicSourceMapConsumer(r,t)}SourceMapConsumer.fromSourceMap=function(e,t){return BasicSourceMapConsumer.fromSourceMap(e,t)},SourceMapConsumer.prototype._version=3,SourceMapConsumer.prototype.__generatedMappings=null,Object.defineProperty(SourceMapConsumer.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),SourceMapConsumer.prototype.__originalMappings=null,Object.defineProperty(SourceMapConsumer.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),SourceMapConsumer.prototype._charIsMappingSeparator=function(e,t){var r=e.charAt(t);return";"===r||","===r},SourceMapConsumer.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},SourceMapConsumer.GENERATED_ORDER=1,SourceMapConsumer.ORIGINAL_ORDER=2,SourceMapConsumer.GREATEST_LOWER_BOUND=1,SourceMapConsumer.LEAST_UPPER_BOUND=2,SourceMapConsumer.prototype.eachMapping=function(e,t,r){var n,o=t||null;switch(r||SourceMapConsumer.GENERATED_ORDER){case SourceMapConsumer.GENERATED_ORDER:n=this._generatedMappings;break;case SourceMapConsumer.ORIGINAL_ORDER:n=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var i=this.sourceRoot;n.map((function(e){var t=null===e.source?null:this._sources.at(e.source);return{source:t=util.computeSourceURL(i,t,this._sourceMapURL),generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}}),this).forEach(e,o)},SourceMapConsumer.prototype.allGeneratedPositionsFor=function(e){var t=util.getArg(e,"line"),r={source:util.getArg(e,"source"),originalLine:t,originalColumn:util.getArg(e,"column",0)};if(r.source=this._findSourceIndex(r.source),r.source<0)return[];var n=[],o=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",util.compareByOriginalPositions,binarySearch.LEAST_UPPER_BOUND);if(o>=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)n.push({line:util.getArg(i,"generatedLine",null),column:util.getArg(i,"generatedColumn",null),lastColumn:util.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var a=i.originalColumn;i&&i.originalLine===t&&i.originalColumn==a;)n.push({line:util.getArg(i,"generatedLine",null),column:util.getArg(i,"generatedColumn",null),lastColumn:util.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return n};var SourceMapConsumer_1=SourceMapConsumer;function BasicSourceMapConsumer(e,t){var r=e;"string"==typeof e&&(r=util.parseSourceMapInput(e));var n=util.getArg(r,"version"),o=util.getArg(r,"sources"),i=util.getArg(r,"names",[]),s=util.getArg(r,"sourceRoot",null),a=util.getArg(r,"sourcesContent",null),u=util.getArg(r,"mappings"),l=util.getArg(r,"file",null);if(n!=this._version)throw new Error("Unsupported version: "+n);s&&(s=util.normalize(s)),o=o.map(String).map(util.normalize).map((function(e){return s&&util.isAbsolute(s)&&util.isAbsolute(e)?util.relative(s,e):e})),this._names=ArraySet$2.fromArray(i.map(String),!0),this._sources=ArraySet$2.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map((function(e){return util.computeSourceURL(s,e,t)})),this.sourceRoot=s,this.sourcesContent=a,this._mappings=u,this._sourceMapURL=t,this.file=l}function Mapping(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}BasicSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype),BasicSourceMapConsumer.prototype.consumer=SourceMapConsumer,BasicSourceMapConsumer.prototype._findSourceIndex=function(e){var t,r=e;if(null!=this.sourceRoot&&(r=util.relative(this.sourceRoot,r)),this._sources.has(r))return this._sources.indexOf(r);for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==e)return t;return-1},BasicSourceMapConsumer.fromSourceMap=function(e,t){var r=Object.create(BasicSourceMapConsumer.prototype),n=r._names=ArraySet$2.fromArray(e._names.toArray(),!0),o=r._sources=ArraySet$2.fromArray(e._sources.toArray(),!0);r.sourceRoot=e._sourceRoot,r.sourcesContent=e._generateSourcesContent(r._sources.toArray(),r.sourceRoot),r.file=e._file,r._sourceMapURL=t,r._absoluteSources=r._sources.toArray().map((function(e){return util.computeSourceURL(r.sourceRoot,e,t)}));for(var i=e._mappings.toArray().slice(),s=r.__generatedMappings=[],a=r.__originalMappings=[],u=0,l=i.length;u<l;u++){var c=i[u],p=new Mapping;p.generatedLine=c.generatedLine,p.generatedColumn=c.generatedColumn,c.source&&(p.source=o.indexOf(c.source),p.originalLine=c.originalLine,p.originalColumn=c.originalColumn,c.name&&(p.name=n.indexOf(c.name)),a.push(p)),s.push(p)}return quickSort$1(r.__originalMappings,util.compareByOriginalPositions),r},BasicSourceMapConsumer.prototype._version=3,Object.defineProperty(BasicSourceMapConsumer.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),BasicSourceMapConsumer.prototype._parseMappings=function(e,t){for(var r,n,o,i,s,a=1,u=0,l=0,c=0,p=0,m=0,h=e.length,g=0,f={},d={},S=[],y=[];g<h;)if(";"===e.charAt(g))a++,g++,u=0;else if(","===e.charAt(g))g++;else{for((r=new Mapping).generatedLine=a,i=g;i<h&&!this._charIsMappingSeparator(e,i);i++);if(o=f[n=e.slice(g,i)])g+=n.length;else{for(o=[];g<i;)base64Vlq.decode(e,g,d),s=d.value,g=d.rest,o.push(s);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");f[n]=o}r.generatedColumn=u+o[0],u=r.generatedColumn,o.length>1&&(r.source=p+o[1],p+=o[1],r.originalLine=l+o[2],l=r.originalLine,r.originalLine+=1,r.originalColumn=c+o[3],c=r.originalColumn,o.length>4&&(r.name=m+o[4],m+=o[4])),y.push(r),"number"==typeof r.originalLine&&S.push(r)}quickSort$1(y,util.compareByGeneratedPositionsDeflated),this.__generatedMappings=y,quickSort$1(S,util.compareByOriginalPositions),this.__originalMappings=S},BasicSourceMapConsumer.prototype._findMapping=function(e,t,r,n,o,i){if(e[r]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[r]);if(e[n]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[n]);return binarySearch.search(e,t,o,i)},BasicSourceMapConsumer.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var r=this._generatedMappings[e+1];if(t.generatedLine===r.generatedLine){t.lastGeneratedColumn=r.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},BasicSourceMapConsumer.prototype.originalPositionFor=function(e){var t={generatedLine:util.getArg(e,"line"),generatedColumn:util.getArg(e,"column")},r=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",util.compareByGeneratedPositionsDeflated,util.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(r>=0){var n=this._generatedMappings[r];if(n.generatedLine===t.generatedLine){var o=util.getArg(n,"source",null);null!==o&&(o=this._sources.at(o),o=util.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var i=util.getArg(n,"name",null);return null!==i&&(i=this._names.at(i)),{source:o,line:util.getArg(n,"originalLine",null),column:util.getArg(n,"originalColumn",null),name:i}}}return{source:null,line:null,column:null,name:null}},BasicSourceMapConsumer.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e})))},BasicSourceMapConsumer.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var r=this._findSourceIndex(e);if(r>=0)return this.sourcesContent[r];var n,o=e;if(null!=this.sourceRoot&&(o=util.relative(this.sourceRoot,o)),null!=this.sourceRoot&&(n=util.urlParse(this.sourceRoot))){var i=o.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!n.path||"/"==n.path)&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(t)return null;throw new Error('"'+o+'" is not in the SourceMap.')},BasicSourceMapConsumer.prototype.generatedPositionFor=function(e){var t=util.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var r={source:t,originalLine:util.getArg(e,"line"),originalColumn:util.getArg(e,"column")},n=this._findMapping(r,this._originalMappings,"originalLine","originalColumn",util.compareByOriginalPositions,util.getArg(e,"bias",SourceMapConsumer.GREATEST_LOWER_BOUND));if(n>=0){var o=this._originalMappings[n];if(o.source===r.source)return{line:util.getArg(o,"generatedLine",null),column:util.getArg(o,"generatedColumn",null),lastColumn:util.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};var BasicSourceMapConsumer_1=BasicSourceMapConsumer;function IndexedSourceMapConsumer(e,t){var r=e;"string"==typeof e&&(r=util.parseSourceMapInput(e));var n=util.getArg(r,"version"),o=util.getArg(r,"sections");if(n!=this._version)throw new Error("Unsupported version: "+n);this._sources=new ArraySet$2,this._names=new ArraySet$2;var i={line:-1,column:0};this._sections=o.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var r=util.getArg(e,"offset"),n=util.getArg(r,"line"),o=util.getArg(r,"column");if(n<i.line||n===i.line&&o<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=r,{generatedOffset:{generatedLine:n+1,generatedColumn:o+1},consumer:new SourceMapConsumer(util.getArg(e,"map"),t)}}))}IndexedSourceMapConsumer.prototype=Object.create(SourceMapConsumer.prototype),IndexedSourceMapConsumer.prototype.constructor=SourceMapConsumer,IndexedSourceMapConsumer.prototype._version=3,Object.defineProperty(IndexedSourceMapConsumer.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var r=0;r<this._sections[t].consumer.sources.length;r++)e.push(this._sections[t].consumer.sources[r]);return e}}),IndexedSourceMapConsumer.prototype.originalPositionFor=function(e){var t={generatedLine:util.getArg(e,"line"),generatedColumn:util.getArg(e,"column")},r=binarySearch.search(t,this._sections,(function(e,t){var r=e.generatedLine-t.generatedOffset.generatedLine;return r||e.generatedColumn-t.generatedOffset.generatedColumn})),n=this._sections[r];return n?n.consumer.originalPositionFor({line:t.generatedLine-(n.generatedOffset.generatedLine-1),column:t.generatedColumn-(n.generatedOffset.generatedLine===t.generatedLine?n.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},IndexedSourceMapConsumer.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))},IndexedSourceMapConsumer.prototype.sourceContentFor=function(e,t){for(var r=0;r<this._sections.length;r++){var n=this._sections[r].consumer.sourceContentFor(e,!0);if(n)return n}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},IndexedSourceMapConsumer.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var r=this._sections[t];if(-1!==r.consumer._findSourceIndex(util.getArg(e,"source"))){var n=r.consumer.generatedPositionFor(e);if(n)return{line:n.line+(r.generatedOffset.generatedLine-1),column:n.column+(r.generatedOffset.generatedLine===n.line?r.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},IndexedSourceMapConsumer.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var r=0;r<this._sections.length;r++)for(var n=this._sections[r],o=n.consumer._generatedMappings,i=0;i<o.length;i++){var s=o[i],a=n.consumer._sources.at(s.source);a=util.computeSourceURL(n.consumer.sourceRoot,a,this._sourceMapURL),this._sources.add(a),a=this._sources.indexOf(a);var u=null;s.name&&(u=n.consumer._names.at(s.name),this._names.add(u),u=this._names.indexOf(u));var l={source:a,generatedLine:s.generatedLine+(n.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(n.generatedOffset.generatedLine===s.generatedLine?n.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:u};this.__generatedMappings.push(l),"number"==typeof l.originalLine&&this.__originalMappings.push(l)}quickSort$1(this.__generatedMappings,util.compareByGeneratedPositionsDeflated),quickSort$1(this.__originalMappings,util.compareByOriginalPositions)};var IndexedSourceMapConsumer_1=IndexedSourceMapConsumer,sourceMapConsumer={SourceMapConsumer:SourceMapConsumer_1,BasicSourceMapConsumer:BasicSourceMapConsumer_1,IndexedSourceMapConsumer:IndexedSourceMapConsumer_1},SourceMapGenerator$1=sourceMapGenerator.SourceMapGenerator,REGEX_NEWLINE=/(\r?\n)/,NEWLINE_CODE=10,isSourceNode="$$$isSourceNode$$$";function SourceNode(e,t,r,n,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==r?null:r,this.name=null==o?null:o,this[isSourceNode]=!0,null!=n&&this.add(n)}SourceNode.fromStringWithSourceMap=function(e,t,r){var n=new SourceNode,o=e.split(REGEX_NEWLINE),i=0,s=function(){return e()+(e()||"");function e(){return i<o.length?o[i++]:void 0}},a=1,u=0,l=null;return t.eachMapping((function(e){if(null!==l){if(!(a<e.generatedLine)){var t=(r=o[i]||"").substr(0,e.generatedColumn-u);return o[i]=r.substr(e.generatedColumn-u),u=e.generatedColumn,c(l,t),void(l=e)}c(l,s()),a++,u=0}for(;a<e.generatedLine;)n.add(s()),a++;if(u<e.generatedColumn){var r=o[i]||"";n.add(r.substr(0,e.generatedColumn)),o[i]=r.substr(e.generatedColumn),u=e.generatedColumn}l=e}),this),i<o.length&&(l&&c(l,s()),n.add(o.splice(i).join(""))),t.sources.forEach((function(e){var o=t.sourceContentFor(e);null!=o&&(null!=r&&(e=util.join(r,e)),n.setSourceContent(e,o))})),n;function c(e,t){if(null===e||void 0===e.source)n.add(t);else{var o=r?util.join(r,e.source):e.source;n.add(new SourceNode(e.originalLine,e.originalColumn,o,t,e.name))}}},SourceNode.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[isSourceNode]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},SourceNode.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[isSourceNode]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},SourceNode.prototype.walk=function(e){for(var t,r=0,n=this.children.length;r<n;r++)(t=this.children[r])[isSourceNode]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},SourceNode.prototype.join=function(e){var t,r,n=this.children.length;if(n>0){for(t=[],r=0;r<n-1;r++)t.push(this.children[r]),t.push(e);t.push(this.children[r]),this.children=t}return this},SourceNode.prototype.replaceRight=function(e,t){var r=this.children[this.children.length-1];return r[isSourceNode]?r.replaceRight(e,t):"string"==typeof r?this.children[this.children.length-1]=r.replace(e,t):this.children.push("".replace(e,t)),this},SourceNode.prototype.setSourceContent=function(e,t){this.sourceContents[util.toSetString(e)]=t},SourceNode.prototype.walkSourceContents=function(e){for(var t=0,r=this.children.length;t<r;t++)this.children[t][isSourceNode]&&this.children[t].walkSourceContents(e);var n=Object.keys(this.sourceContents);for(t=0,r=n.length;t<r;t++)e(util.fromSetString(n[t]),this.sourceContents[n[t]])},SourceNode.prototype.toString=function(){var e="";return this.walk((function(t){e+=t})),e},SourceNode.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},r=new SourceMapGenerator$1(e),n=!1,o=null,i=null,s=null,a=null;return this.walk((function(e,u){t.code+=e,null!==u.source&&null!==u.line&&null!==u.column?(o===u.source&&i===u.line&&s===u.column&&a===u.name||r.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:t.line,column:t.column},name:u.name}),o=u.source,i=u.line,s=u.column,a=u.name,n=!0):n&&(r.addMapping({generated:{line:t.line,column:t.column}}),o=null,n=!1);for(var l=0,c=e.length;l<c;l++)e.charCodeAt(l)===NEWLINE_CODE?(t.line++,t.column=0,l+1===c?(o=null,n=!1):n&&r.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:t.line,column:t.column},name:u.name})):t.column++})),this.walkSourceContents((function(e,t){r.setSourceContent(e,t)})),{code:t.code,map:r}};var SourceNode_1=SourceNode,sourceNode={SourceNode:SourceNode_1},SourceMapGenerator$2=sourceMapGenerator.SourceMapGenerator,SourceMapConsumer$1=sourceMapConsumer.SourceMapConsumer,SourceNode$1=sourceNode.SourceNode,sourceMap={SourceMapGenerator:SourceMapGenerator$2,SourceMapConsumer:SourceMapConsumer$1,SourceNode:SourceNode$1},sourceMapUrl=createCommonjsModule((function(e,t){var r,n;e.exports=(r=/[#@] sourceMappingURL=([^\s'"]*)/,{regex:n=RegExp("(?:/\\*(?:\\s*\r?\n(?://)?)?(?:"+r.source+")\\s*\\*/|//(?:"+r.source+"))\\s*"),_innerRegex:r,getFrom:function(e){var t=e.match(n);return t?t[1]||t[2]||"":null},existsIn:function(e){return n.test(e)},removeFrom:function(e){return e.replace(n,"")},insertBefore:function(e,t){var r=e.match(n);return r?e.slice(0,r.index)+t+e.slice(r.index):e+t}})})),_rollupPluginShim4=Object.freeze({__proto__:null}),url=getCjsExportFromNamespace(_rollupPluginShim4);function resolveUrl(){return Array.prototype.reduce.call(arguments,(function(e,t){return url.resolve(e,t)}))}var resolveUrl_1=resolveUrl,token="%[a-f0-9]{2}",singleMatcher=new RegExp(token,"gi"),multiMatcher=new RegExp("("+token+")+","gi");function decodeComponents(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],decodeComponents(r),decodeComponents(n))}function decode$2(e){try{return decodeURIComponent(e)}catch(n){for(var t=e.match(singleMatcher),r=1;r<t.length;r++)t=(e=decodeComponents(t,r).join("")).match(singleMatcher);return e}}function customDecodeURIComponent(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=multiMatcher.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=decode$2(r[0]);n!==r[0]&&(t[r[0]]=n)}r=multiMatcher.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),i=0;i<o.length;i++){var s=o[i];e=e.replace(new RegExp(s,"g"),t[s])}return e}var decodeUriComponent=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return customDecodeURIComponent(e)}};function customDecodeUriComponent(e){return decodeUriComponent(e.replace(/\+/g,"%2B"))}var decodeUriComponent_1=customDecodeUriComponent,_rollupPluginShim2=Object.freeze({__proto__:null}),path=getCjsExportFromNamespace(_rollupPluginShim2);function urix(e){return"\\"===path.sep?e.replace(/\\/g,"/").replace(/^[a-z]:\/?/i,"/"):e}var urix_1=urix;function atob(e){return Buffer.from(e,"base64").toString("binary")}var nodeAtob=atob.atob=atob;function callbackAsync(e,t,r){setImmediate((function(){e(t,r)}))}function parseMapToJSON(e,t){try{return JSON.parse(e.replace(/^\)\]\}'/,""))}catch(e){throw e.sourceMapData=t,e}}function readSync(e,t,r){var n=decodeUriComponent_1(t);try{return String(e(n))}catch(e){throw e.sourceMapData=r,e}}function resolveSourceMap(e,t,r,n){var o;try{o=resolveSourceMapHelper(e,t)}catch(e){return callbackAsync(n,e)}if(!o||o.map)return callbackAsync(n,null,o);r(decodeUriComponent_1(o.url),(function(e,t){if(e)return e.sourceMapData=o,n(e);o.map=String(t);try{o.map=parseMapToJSON(o.map,o)}catch(e){return n(e)}n(null,o)}))}function resolveSourceMapSync(e,t,r){var n=resolveSourceMapHelper(e,t);return!n||n.map?n:(n.map=readSync(r,n.url,n),n.map=parseMapToJSON(n.map,n),n)}var dataUriRegex=/^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/,jsonMimeTypeRegex=/^(?:application|text)\/json$/,jsonCharacterEncoding="utf-8";function base64ToBuf(e){for(var t=nodeAtob(e),r=t.length,n=new Uint8Array(r),o=0;o<r;o++)n[o]=t.charCodeAt(o);return n}function decodeBase64String(e){if("undefined"==typeof TextDecoder||"undefined"==typeof Uint8Array)return nodeAtob(e);var t=base64ToBuf(e);return new TextDecoder(jsonCharacterEncoding,{fatal:!0}).decode(t)}function resolveSourceMapHelper(e,t){t=urix_1(t);var r=sourceMapUrl.getFrom(e);if(!r)return null;var n=r.match(dataUriRegex);if(n){var o=n[1]||"text/plain",i=n[2]||"",s=n[3]||"",a={sourceMappingURL:r,url:null,sourcesRelativeTo:t,map:s};if(!jsonMimeTypeRegex.test(o)){var u=new Error("Unuseful data uri mime type: "+o);throw u.sourceMapData=a,u}try{a.map=parseMapToJSON(";base64"===i?decodeBase64String(s):decodeURIComponent(s),a)}catch(u){throw u.sourceMapData=a,u}return a}var l=resolveUrl_1(t,r);return{sourceMappingURL:r,url:l,sourcesRelativeTo:l,map:null}}function resolveSources(e,t,r,n,o){"function"==typeof n&&(o=n,n={});var i=e.sources?e.sources.length:0,s={sourcesResolved:[],sourcesContent:[]};if(0!==i){var a=function(){0===--i&&o(null,s)};resolveSourcesHelper(e,t,n,(function(e,t,n){if(s.sourcesResolved[n]=e,"string"==typeof t)s.sourcesContent[n]=t,callbackAsync(a,null);else{var o=decodeUriComponent_1(e);r(o,(function(e,t){s.sourcesContent[n]=e||String(t),a()}))}}))}else callbackAsync(o,null,s)}function resolveSourcesSync(e,t,r,n){var o={sourcesResolved:[],sourcesContent:[]};return e.sources&&0!==e.sources.length?(resolveSourcesHelper(e,t,n,(function(e,t,n){if(o.sourcesResolved[n]=e,null!==r)if("string"==typeof t)o.sourcesContent[n]=t;else{var i=decodeUriComponent_1(e);try{o.sourcesContent[n]=String(r(i))}catch(e){o.sourcesContent[n]=e}}})),o):o}var endingSlash=/\/?$/;function resolveSourcesHelper(e,t,r,n){var o;r=r||{},t=urix_1(t);for(var i=0,s=e.sources.length;i<s;i++)o=null,"string"==typeof r.sourceRoot?o=r.sourceRoot:"string"==typeof e.sourceRoot&&!1!==r.sourceRoot&&(o=e.sourceRoot),n(null===o||""===o?resolveUrl_1(t,e.sources[i]):resolveUrl_1(t,o.replace(endingSlash,"/"),e.sources[i]),(e.sourcesContent||[])[i],i)}function resolve(e,t,r,n,o){if("function"==typeof n&&(o=n,n={}),null===e){var i={sourceMappingURL:null,url:t,sourcesRelativeTo:t,map:null},s=decodeUriComponent_1(t);r(s,(function(e,t){if(e)return e.sourceMapData=i,o(e);i.map=String(t);try{i.map=parseMapToJSON(i.map,i)}catch(e){return o(e)}a(i)}))}else resolveSourceMap(e,t,r,(function(e,t){return e?o(e):t?void a(t):o(null,null)}));function a(e){resolveSources(e.map,e.sourcesRelativeTo,r,n,(function(t,r){if(t)return o(t);e.sourcesResolved=r.sourcesResolved,e.sourcesContent=r.sourcesContent,o(null,e)}))}}function resolveSync(e,t,r,n){var o;if(null===e){(o={sourceMappingURL:null,url:t,sourcesRelativeTo:t,map:null}).map=readSync(r,t,o),o.map=parseMapToJSON(o.map,o)}else if(!(o=resolveSourceMapSync(e,t,r)))return null;var i=resolveSourcesSync(o.map,o.sourcesRelativeTo,r,n);return o.sourcesResolved=i.sourcesResolved,o.sourcesContent=i.sourcesContent,o}var sourceMapResolveNode={resolveSourceMap:resolveSourceMap,resolveSourceMapSync:resolveSourceMapSync,resolveSources:resolveSources,resolveSourcesSync:resolveSourcesSync,resolve:resolve,resolveSync:resolveSync,parseMapToJSON:parseMapToJSON},_rollupPluginShim1=Object.freeze({__proto__:null}),fs=getCjsExportFromNamespace(_rollupPluginShim1),sourceMapSupport=createCommonjsModule((function(e,t){var r=sourceMap.SourceMapGenerator,n=sourceMap.SourceMapConsumer;e.exports=function(e){for(var n in e._comment=e.comment,e.map=new r,e.position={line:1,column:1},e.files={},t)e[n]=t[n]},t.updatePosition=function(e){var t=e.match(/\n/g);t&&(this.position.line+=t.length);var r=e.lastIndexOf("\n");this.position.column=~r?e.length-r:this.position.column+e.length},t.emit=function(e,t){if(t){var r=urix_1(t.source||"source.css");this.map.addMapping({source:r,generated:{line:this.position.line,column:Math.max(this.position.column-1,0)},original:{line:t.start.line,column:t.start.column-1}}),this.addFile(r,t)}return this.updatePosition(e),e},t.addFile=function(e,t){"string"==typeof t.content&&(Object.prototype.hasOwnProperty.call(this.files,e)||(this.files[e]=t.content))},t.applySourceMaps=function(){Object.keys(this.files).forEach((function(e){var t=this.files[e];if(this.map.setSourceContent(e,t),!1!==this.options.inputSourcemaps){var r=sourceMapResolveNode.resolveSync(t,e,fs.readFileSync);if(r){var o=new n(r.map),i=r.sourcesRelativeTo;this.map.applySourceMap(o,e,urix_1(path.dirname(i)))}}}),this)},t.comment=function(e){return/^# sourceMappingURL=/.test(e.comment)?this.emit("",e.position):this._comment(e)}})),sourceMapSupport_1=sourceMapSupport.updatePosition,sourceMapSupport_2=sourceMapSupport.emit,sourceMapSupport_3=sourceMapSupport.addFile,sourceMapSupport_4=sourceMapSupport.applySourceMaps,sourceMapSupport_5=sourceMapSupport.comment,parse$1=parse;function generateTheme(e){const t=new Map;let r=null;return parse$1(e).stylesheet.rules.filter(({type:e})=>"rule"===e).forEach(({declarations:e,selectors:n})=>{n.forEach(n=>{var o,i;'code[class*="language-"]'===n&&(i=null===(o=e.filter(({type:e})=>"declaration"===e).filter(({property:e})=>"color"===e)[0])||void 0===o?void 0:o.value,r=null!=i?i:null);const s=n.split(".").slice(1);-1!==s.indexOf("token")&&2===s.length&&t.set(s.filter(e=>"token"!==e)[0],e.filter(({type:e})=>"declaration"===e).map(({property:e,value:t})=>`${e}:${t}`).join(";"))})}),{textColor:r,tokens:t}}function highlight(e,t,{textColor:r,tokens:n}){const o=[],i=[];return prismjs.tokenize(e,t).forEach(e=>{var t;"string"==typeof e?(o.push(`%c${escapePercent(e)}`),i.push(null===r?"":`color:${r}`)):(o.push(`%c${escapePercent(tokenStreamToString(e))}`),i.push(null!=(t=n.get(e.type))?t:""))}),[o.join(""),...i]}exports.generateTheme=generateTheme,exports.highlight=highlight;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var r=require("prismjs"),e=require("color-string"),o=require("css");function t(r){return"string"==typeof r?r:Array.isArray(r)?r.map(t).join(""):t(r.content)}function n(r){return r.replace(/%+/g,(function(r){return"%".repeat(2*r.length)}))}var l;(l=exports.Platform||(exports.Platform={}))[l.Browser=0]="Browser",l[l.Node=1]="Node",exports.generateTheme=function(r){var e,t=new Map,n=null;return(null===(e=o.parse(r).stylesheet)||void 0===e?void 0:e.rules.filter((function(r){return"rule"===r.type}))).forEach((function(r){var e=r.declarations,o=r.selectors;null==o||o.forEach((function(r){var o,l;'code[class*="language-"]'===r&&(n=null!==(l=null===(o=(null==e?void 0:e.filter((function(r){return"declaration"===r.type}))).filter((function(r){return"color"===r.property}))[0])||void 0===o?void 0:o.value)&&void 0!==l?l:null);var i=r.split(".").slice(1);i.includes("token")&&2===i.length&&t.set(i.filter((function(r){return"token"!==r}))[0],(null==e?void 0:e.filter((function(r){return"declaration"===r.type}))).filter((function(r){return void 0!==r.property&&void 0!==r.value})).map((function(r){return{property:r.property,value:r.value}})))}))})),{textColor:n,tokens:t}},exports.highlight=function(o,l,i,u){var s;void 0===u&&(u="undefined"==typeof process||"browser"in process||void 0===(null===(s=null===process||void 0===process?void 0:process.versions)||void 0===s?void 0:s.node)?exports.Platform.Browser:exports.Platform.Node);var a=r.tokenize(o,l);if(u===exports.Platform.Browser){var p=[],c=[];return a.forEach((function(r){var e,o;"string"==typeof r?(p.push("%c"+n(r)),c.push(null===i.textColor?"":"color:"+i.textColor)):(p.push("%c"+n(t(r.content))),c.push(null!==(o=null===(e=i.tokens.get(r.type))||void 0===e?void 0:e.map((function(r){return r.property+":"+r.value})).join(";"))&&void 0!==o?o:""))})),
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
function(){for(var r=0,e=0,o=arguments.length;e<o;e++)r+=arguments[e].length;var t=Array(r),n=0;for(e=0;e<o;e++)for(var l=arguments[e],i=0,u=l.length;i<u;i++,n++)t[n]=l[i];return t}([p.join("")],c)}return u===exports.Platform.Node?[a.map((function(r){var o,n,l=null;if("string"==typeof r)l=null===i.textColor?null:e.get.rgb(i.textColor);else{var u=null===(n=null===(o=i.tokens.get(r.type))||void 0===o?void 0:o.find((function(r){return"color"===r.property.toLowerCase()})))||void 0===n?void 0:n.value;l=void 0===u?null:e.get.rgb(u)}return null===l?""+t(r):function(r,e,o){return"["+[38,2,r,e,o].join(";")+"m"}(l[0],l[1],l[2])+t(r)})).join("")+""]:u};
export interface Theme {
textColor: string | null;
tokens: Map<string, string>;
tokens: Map<string, Array<{
property: string;
value: string;
}>>;
}

@@ -5,0 +8,0 @@ /**

import { Grammar } from "prismjs";
import { Platform } from "./utils";
import { Theme } from "./theme";

@@ -7,5 +8,7 @@ /**

* @param theme The theme to highlight the code with
* @param platform The platform
* @returns The arguments to pass to `console.*`
*/
export declare function highlight(code: string, grammar: Grammar, { textColor, tokens }: Theme): string[];
export declare function highlight(code: string, grammar: Grammar, theme: Theme, platform?: Platform): string[];
export * from "./theme";
export { Platform } from "./utils";

@@ -1,1 +0,15 @@

import{tokenize as e}from"prismjs";function t(e){return"string"==typeof e?e:Array.isArray(e)?e.map(t).join(""):t(e.content)}function n(e){return e.replace(/%+/g,e=>"%".repeat(2*e.length))}var r=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function o(e){return e?e.replace(/^\s+|\s+$/g,""):""}var i=s;function s(e){this.options=e||{}}s.prototype.emit=function(e){return e},s.prototype.visit=function(e){return this[e.type](e)},s.prototype.mapVisit=function(e,t){var n="";t=t||"";for(var r=0,o=e.length;r<o;r++)n+=this.visit(e[r]),t&&r<o-1&&(n+=this.emit(t));return n};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function a(e,t){return e(t={exports:{}},t.exports),t.exports}function u(e){return e&&e.default||e}var l=Object.freeze({__proto__:null}),c=a((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}})),p=u(l),h=a((function(e){try{var t=p;if("function"!=typeof t.inherits)throw"";e.exports=t.inherits}catch(t){e.exports=c}}));function f(e){i.call(this,e)}function m(e){e=e||{},i.call(this,e),this.indentation=e.indent}h(f,i),f.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},f.prototype.comment=function(e){return this.emit("",e.position)},f.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},f.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},f.prototype.document=function(e){var t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},f.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},f.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},f.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},f.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},f.prototype.keyframe=function(e){var t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},f.prototype.page=function(e){var t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},f.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},f.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},f.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},f.prototype.rule=function(e){var t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},f.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")},h(m,i),m.prototype.compile=function(e){return this.stylesheet(e)},m.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},m.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},m.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},m.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},m.prototype.document=function(e){var t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},m.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},m.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},m.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},m.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},m.prototype.keyframe=function(e){var t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},m.prototype.page=function(e){var t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},m.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},m.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},m.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},m.prototype.rule=function(e){var t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},m.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},m.prototype.indent=function(e){return this.level=this.level||1,null!=e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),d=function(e){if(0<=e&&e<g.length)return g[e];throw new TypeError("Must be between 0 and 63: "+e)},v=function(e){return 65<=e&&e<=90?e-65:97<=e&&e<=122?e-97+26:48<=e&&e<=57?e-48+52:43==e?62:47==e?63:-1};var y=function(e){var t,n="",r=function(e){return e<0?1+(-e<<1):0+(e<<1)}(e);do{t=31&r,(r>>>=5)>0&&(t|=32),n+=d(t)}while(r>0);return n},_=function(e,t,n){var r,o,i,s,a=e.length,u=0,l=0;do{if(t>=a)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(o=v(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));r=!!(32&o),u+=(o&=31)<<l,l+=5}while(r);n.value=(s=(i=u)>>1,1==(1&i)?-s:s),n.rest=t},C=a((function(e,t){t.getArg=function(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')};var n=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,r=/^data:.+\,.+$/;function o(e){var t=e.match(n);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function s(e){var n=e,r=o(e);if(r){if(!r.path)return e;n=r.path}for(var s,a=t.isAbsolute(n),u=n.split(/\/+/),l=0,c=u.length-1;c>=0;c--)"."===(s=u[c])?u.splice(c,1):".."===s?l++:l>0&&(""===s?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return""===(n=u.join("/"))&&(n=a?"/":"."),r?(r.path=n,i(r)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),a=o(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(r))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var u="/"===t.charAt(0)?t:s(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=u,i(a)):u}t.urlParse=o,t.urlGenerate=i,t.normalize=s,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||n.test(e)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var u=!("__proto__"in Object.create(null));function l(e){return e}function c(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function p(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}t.toSetString=u?l:function(e){return c(e)?"$"+e:e},t.fromSetString=u?l:function(e){return c(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=p(e.source,t.source);return 0!==r?r:0!==(r=e.originalLine-t.originalLine)?r:0!==(r=e.originalColumn-t.originalColumn)||n?r:0!==(r=e.generatedColumn-t.generatedColumn)?r:0!==(r=e.generatedLine-t.generatedLine)?r:p(e.name,t.name)},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!==(r=e.generatedColumn-t.generatedColumn)||n?r:0!==(r=p(e.source,t.source))?r:0!==(r=e.originalLine-t.originalLine)?r:0!==(r=e.originalColumn-t.originalColumn)?r:p(e.name,t.name)},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!==(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=p(e.source,t.source))?n:0!==(n=e.originalLine-t.originalLine)?n:0!==(n=e.originalColumn-t.originalColumn)?n:p(e.name,t.name)},t.parseSourceMapInput=function(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))},t.computeSourceURL=function(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var r=o(n);if(!r)throw new Error("sourceMapURL could not be parsed");if(r.path){var u=r.path.lastIndexOf("/");u>=0&&(r.path=r.path.substring(0,u+1))}t=a(i(r),t)}return s(t)}})),S=(C.getArg,C.urlParse,C.urlGenerate,C.normalize,C.join,C.isAbsolute,C.relative,C.toSetString,C.fromSetString,C.compareByOriginalPositions,C.compareByGeneratedPositionsDeflated,C.compareByGeneratedPositionsInflated,C.parseSourceMapInput,C.computeSourceURL,Object.prototype.hasOwnProperty),A="undefined"!=typeof Map;function M(){this._array=[],this._set=A?new Map:Object.create(null)}M.fromArray=function(e,t){for(var n=new M,r=0,o=e.length;r<o;r++)n.add(e[r],t);return n},M.prototype.size=function(){return A?this._set.size:Object.getOwnPropertyNames(this._set).length},M.prototype.add=function(e,t){var n=A?e:C.toSetString(e),r=A?this.has(e):S.call(this._set,n),o=this._array.length;r&&!t||this._array.push(e),r||(A?this._set.set(e,o):this._set[n]=o)},M.prototype.has=function(e){if(A)return this._set.has(e);var t=C.toSetString(e);return S.call(this._set,t)},M.prototype.indexOf=function(e){if(A){var t=this._set.get(e);if(t>=0)return t}else{var n=C.toSetString(e);if(S.call(this._set,n))return this._set[n]}throw new Error('"'+e+'" is not in the set.')},M.prototype.at=function(e){if(e>=0&&e<this._array.length)return this._array[e];throw new Error("No element indexed by "+e)},M.prototype.toArray=function(){return this._array.slice()};var w={ArraySet:M};function L(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}L.prototype.unsortedForEach=function(e,t){this._array.forEach(e,t)},L.prototype.add=function(e){var t,n,r,o,i,s;t=this._last,n=e,r=t.generatedLine,o=n.generatedLine,i=t.generatedColumn,s=n.generatedColumn,o>r||o==r&&s>=i||C.compareByGeneratedPositionsInflated(t,n)<=0?(this._last=e,this._array.push(e)):(this._sorted=!1,this._array.push(e))},L.prototype.toArray=function(){return this._sorted||(this._array.sort(C.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};var R=w.ArraySet,O={MappingList:L}.MappingList;function E(e){e||(e={}),this._file=C.getArg(e,"file",null),this._sourceRoot=C.getArg(e,"sourceRoot",null),this._skipValidation=C.getArg(e,"skipValidation",!1),this._sources=new R,this._names=new R,this._mappings=new O,this._sourcesContents=null}E.prototype._version=3,E.fromSourceMap=function(e){var t=e.sourceRoot,n=new E({file:e.file,sourceRoot:t});return e.eachMapping((function(e){var r={generated:{line:e.generatedLine,column:e.generatedColumn}};null!=e.source&&(r.source=e.source,null!=t&&(r.source=C.relative(t,r.source)),r.original={line:e.originalLine,column:e.originalColumn},null!=e.name&&(r.name=e.name)),n.addMapping(r)})),e.sources.forEach((function(r){var o=r;null!==t&&(o=C.relative(t,r)),n._sources.has(o)||n._sources.add(o);var i=e.sourceContentFor(r);null!=i&&n.setSourceContent(r,i)})),n},E.prototype.addMapping=function(e){var t=C.getArg(e,"generated"),n=C.getArg(e,"original",null),r=C.getArg(e,"source",null),o=C.getArg(e,"name",null);this._skipValidation||this._validateMapping(t,n,r,o),null!=r&&(r=String(r),this._sources.has(r)||this._sources.add(r)),null!=o&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:t.line,generatedColumn:t.column,originalLine:null!=n&&n.line,originalColumn:null!=n&&n.column,source:r,name:o})},E.prototype.setSourceContent=function(e,t){var n=e;null!=this._sourceRoot&&(n=C.relative(this._sourceRoot,n)),null!=t?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[C.toSetString(n)]=t):this._sourcesContents&&(delete this._sourcesContents[C.toSetString(n)],0===Object.keys(this._sourcesContents).length&&(this._sourcesContents=null))},E.prototype.applySourceMap=function(e,t,n){var r=t;if(null==t){if(null==e.file)throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map\'s "file" property. Both were omitted.');r=e.file}var o=this._sourceRoot;null!=o&&(r=C.relative(o,r));var i=new R,s=new R;this._mappings.unsortedForEach((function(t){if(t.source===r&&null!=t.originalLine){var a=e.originalPositionFor({line:t.originalLine,column:t.originalColumn});null!=a.source&&(t.source=a.source,null!=n&&(t.source=C.join(n,t.source)),null!=o&&(t.source=C.relative(o,t.source)),t.originalLine=a.line,t.originalColumn=a.column,null!=a.name&&(t.name=a.name))}var u=t.source;null==u||i.has(u)||i.add(u);var l=t.name;null==l||s.has(l)||s.add(l)}),this),this._sources=i,this._names=s,e.sources.forEach((function(t){var r=e.sourceContentFor(t);null!=r&&(null!=n&&(t=C.join(n,t)),null!=o&&(t=C.relative(o,t)),this.setSourceContent(t,r))}),this)},E.prototype._validateMapping=function(e,t,n,r){if(t&&"number"!=typeof t.line&&"number"!=typeof t.column)throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if((!(e&&"line"in e&&"column"in e&&e.line>0&&e.column>=0)||t||n||r)&&!(e&&"line"in e&&"column"in e&&t&&"line"in t&&"column"in t&&e.line>0&&e.column>=0&&t.line>0&&t.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:e,source:n,original:t,name:r}))},E.prototype._serializeMappings=function(){for(var e,t,n,r,o=0,i=1,s=0,a=0,u=0,l=0,c="",p=this._mappings.toArray(),h=0,f=p.length;h<f;h++){if(e="",(t=p[h]).generatedLine!==i)for(o=0;t.generatedLine!==i;)e+=";",i++;else if(h>0){if(!C.compareByGeneratedPositionsInflated(t,p[h-1]))continue;e+=","}e+=y(t.generatedColumn-o),o=t.generatedColumn,null!=t.source&&(r=this._sources.indexOf(t.source),e+=y(r-l),l=r,e+=y(t.originalLine-1-a),a=t.originalLine-1,e+=y(t.originalColumn-s),s=t.originalColumn,null!=t.name&&(n=this._names.indexOf(t.name),e+=y(n-u),u=n)),c+=e}return c},E.prototype._generateSourcesContent=function(e,t){return e.map((function(e){if(!this._sourcesContents)return null;null!=t&&(e=C.relative(t,e));var n=C.toSetString(e);return Object.prototype.hasOwnProperty.call(this._sourcesContents,n)?this._sourcesContents[n]:null}),this)},E.prototype.toJSON=function(){var e={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return null!=this._file&&(e.file=this._file),null!=this._sourceRoot&&(e.sourceRoot=this._sourceRoot),this._sourcesContents&&(e.sourcesContent=this._generateSourcesContent(e.sources,e.sourceRoot)),e},E.prototype.toString=function(){return JSON.stringify(this.toJSON())};var b={SourceMapGenerator:E},x=a((function(e,t){t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,n,r,o){if(0===n.length)return-1;var i=function e(n,r,o,i,s,a){var u=Math.floor((r-n)/2)+n,l=s(o,i[u],!0);return 0===l?u:l>0?r-u>1?e(u,r,o,i,s,a):a==t.LEAST_UPPER_BOUND?r<i.length?r:-1:u:u-n>1?e(n,u,o,i,s,a):a==t.LEAST_UPPER_BOUND?u:n<0?-1:n}(-1,n.length,e,n,r,o||t.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===r(n[i],n[i-1],!0);)--i;return i}}));x.GREATEST_LOWER_BOUND,x.LEAST_UPPER_BOUND,x.search;function j(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function P(e,t,n,r){if(n<r){var o=n-1;j(e,(u=n,l=r,Math.round(u+Math.random()*(l-u))),r);for(var i=e[r],s=n;s<r;s++)t(e[s],i)<=0&&j(e,o+=1,s);j(e,o+1,s);var a=o+1;P(e,t,n,a-1),P(e,t,a+1,r)}var u,l}var U=w.ArraySet,T=function(e,t){P(e,t,0,e.length-1)};function G(e,t){var n=e;return"string"==typeof e&&(n=C.parseSourceMapInput(e)),null!=n.sections?new D(n,t):new k(n,t)}G.fromSourceMap=function(e,t){return k.fromSourceMap(e,t)},G.prototype._version=3,G.prototype.__generatedMappings=null,Object.defineProperty(G.prototype,"_generatedMappings",{configurable:!0,enumerable:!0,get:function(){return this.__generatedMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__generatedMappings}}),G.prototype.__originalMappings=null,Object.defineProperty(G.prototype,"_originalMappings",{configurable:!0,enumerable:!0,get:function(){return this.__originalMappings||this._parseMappings(this._mappings,this.sourceRoot),this.__originalMappings}}),G.prototype._charIsMappingSeparator=function(e,t){var n=e.charAt(t);return";"===n||","===n},G.prototype._parseMappings=function(e,t){throw new Error("Subclasses must implement _parseMappings")},G.GENERATED_ORDER=1,G.ORIGINAL_ORDER=2,G.GREATEST_LOWER_BOUND=1,G.LEAST_UPPER_BOUND=2,G.prototype.eachMapping=function(e,t,n){var r,o=t||null;switch(n||G.GENERATED_ORDER){case G.GENERATED_ORDER:r=this._generatedMappings;break;case G.ORIGINAL_ORDER:r=this._originalMappings;break;default:throw new Error("Unknown order of iteration.")}var i=this.sourceRoot;r.map((function(e){var t=null===e.source?null:this._sources.at(e.source);return{source:t=C.computeSourceURL(i,t,this._sourceMapURL),generatedLine:e.generatedLine,generatedColumn:e.generatedColumn,originalLine:e.originalLine,originalColumn:e.originalColumn,name:null===e.name?null:this._names.at(e.name)}}),this).forEach(e,o)},G.prototype.allGeneratedPositionsFor=function(e){var t=C.getArg(e,"line"),n={source:C.getArg(e,"source"),originalLine:t,originalColumn:C.getArg(e,"column",0)};if(n.source=this._findSourceIndex(n.source),n.source<0)return[];var r=[],o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",C.compareByOriginalPositions,x.LEAST_UPPER_BOUND);if(o>=0){var i=this._originalMappings[o];if(void 0===e.column)for(var s=i.originalLine;i&&i.originalLine===s;)r.push({line:C.getArg(i,"generatedLine",null),column:C.getArg(i,"generatedColumn",null),lastColumn:C.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o];else for(var a=i.originalColumn;i&&i.originalLine===t&&i.originalColumn==a;)r.push({line:C.getArg(i,"generatedLine",null),column:C.getArg(i,"generatedColumn",null),lastColumn:C.getArg(i,"lastGeneratedColumn",null)}),i=this._originalMappings[++o]}return r};var I=G;function k(e,t){var n=e;"string"==typeof e&&(n=C.parseSourceMapInput(e));var r=C.getArg(n,"version"),o=C.getArg(n,"sources"),i=C.getArg(n,"names",[]),s=C.getArg(n,"sourceRoot",null),a=C.getArg(n,"sourcesContent",null),u=C.getArg(n,"mappings"),l=C.getArg(n,"file",null);if(r!=this._version)throw new Error("Unsupported version: "+r);s&&(s=C.normalize(s)),o=o.map(String).map(C.normalize).map((function(e){return s&&C.isAbsolute(s)&&C.isAbsolute(e)?C.relative(s,e):e})),this._names=U.fromArray(i.map(String),!0),this._sources=U.fromArray(o,!0),this._absoluteSources=this._sources.toArray().map((function(e){return C.computeSourceURL(s,e,t)})),this.sourceRoot=s,this.sourcesContent=a,this._mappings=u,this._sourceMapURL=t,this.file=l}function B(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}k.prototype=Object.create(G.prototype),k.prototype.consumer=G,k.prototype._findSourceIndex=function(e){var t,n=e;if(null!=this.sourceRoot&&(n=C.relative(this.sourceRoot,n)),this._sources.has(n))return this._sources.indexOf(n);for(t=0;t<this._absoluteSources.length;++t)if(this._absoluteSources[t]==e)return t;return-1},k.fromSourceMap=function(e,t){var n=Object.create(k.prototype),r=n._names=U.fromArray(e._names.toArray(),!0),o=n._sources=U.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file,n._sourceMapURL=t,n._absoluteSources=n._sources.toArray().map((function(e){return C.computeSourceURL(n.sourceRoot,e,t)}));for(var i=e._mappings.toArray().slice(),s=n.__generatedMappings=[],a=n.__originalMappings=[],u=0,l=i.length;u<l;u++){var c=i[u],p=new B;p.generatedLine=c.generatedLine,p.generatedColumn=c.generatedColumn,c.source&&(p.source=o.indexOf(c.source),p.originalLine=c.originalLine,p.originalColumn=c.originalColumn,c.name&&(p.name=r.indexOf(c.name)),a.push(p)),s.push(p)}return T(n.__originalMappings,C.compareByOriginalPositions),n},k.prototype._version=3,Object.defineProperty(k.prototype,"sources",{get:function(){return this._absoluteSources.slice()}}),k.prototype._parseMappings=function(e,t){for(var n,r,o,i,s,a=1,u=0,l=0,c=0,p=0,h=0,f=e.length,m=0,g={},d={},v=[],y=[];m<f;)if(";"===e.charAt(m))a++,m++,u=0;else if(","===e.charAt(m))m++;else{for((n=new B).generatedLine=a,i=m;i<f&&!this._charIsMappingSeparator(e,i);i++);if(o=g[r=e.slice(m,i)])m+=r.length;else{for(o=[];m<i;)_(e,m,d),s=d.value,m=d.rest,o.push(s);if(2===o.length)throw new Error("Found a source, but no line and column");if(3===o.length)throw new Error("Found a source and line, but no column");g[r]=o}n.generatedColumn=u+o[0],u=n.generatedColumn,o.length>1&&(n.source=p+o[1],p+=o[1],n.originalLine=l+o[2],l=n.originalLine,n.originalLine+=1,n.originalColumn=c+o[3],c=n.originalColumn,o.length>4&&(n.name=h+o[4],h+=o[4])),y.push(n),"number"==typeof n.originalLine&&v.push(n)}T(y,C.compareByGeneratedPositionsDeflated),this.__generatedMappings=y,T(v,C.compareByOriginalPositions),this.__originalMappings=v},k.prototype._findMapping=function(e,t,n,r,o,i){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return x.search(e,t,o,i)},k.prototype.computeColumnSpans=function(){for(var e=0;e<this._generatedMappings.length;++e){var t=this._generatedMappings[e];if(e+1<this._generatedMappings.length){var n=this._generatedMappings[e+1];if(t.generatedLine===n.generatedLine){t.lastGeneratedColumn=n.generatedColumn-1;continue}}t.lastGeneratedColumn=1/0}},k.prototype.originalPositionFor=function(e){var t={generatedLine:C.getArg(e,"line"),generatedColumn:C.getArg(e,"column")},n=this._findMapping(t,this._generatedMappings,"generatedLine","generatedColumn",C.compareByGeneratedPositionsDeflated,C.getArg(e,"bias",G.GREATEST_LOWER_BOUND));if(n>=0){var r=this._generatedMappings[n];if(r.generatedLine===t.generatedLine){var o=C.getArg(r,"source",null);null!==o&&(o=this._sources.at(o),o=C.computeSourceURL(this.sourceRoot,o,this._sourceMapURL));var i=C.getArg(r,"name",null);return null!==i&&(i=this._names.at(i)),{source:o,line:C.getArg(r,"originalLine",null),column:C.getArg(r,"originalColumn",null),name:i}}}return{source:null,line:null,column:null,name:null}},k.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some((function(e){return null==e})))},k.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;var n=this._findSourceIndex(e);if(n>=0)return this.sourcesContent[n];var r,o=e;if(null!=this.sourceRoot&&(o=C.relative(this.sourceRoot,o)),null!=this.sourceRoot&&(r=C.urlParse(this.sourceRoot))){var i=o.replace(/^file:\/\//,"");if("file"==r.scheme&&this._sources.has(i))return this.sourcesContent[this._sources.indexOf(i)];if((!r.path||"/"==r.path)&&this._sources.has("/"+o))return this.sourcesContent[this._sources.indexOf("/"+o)]}if(t)return null;throw new Error('"'+o+'" is not in the SourceMap.')},k.prototype.generatedPositionFor=function(e){var t=C.getArg(e,"source");if((t=this._findSourceIndex(t))<0)return{line:null,column:null,lastColumn:null};var n={source:t,originalLine:C.getArg(e,"line"),originalColumn:C.getArg(e,"column")},r=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",C.compareByOriginalPositions,C.getArg(e,"bias",G.GREATEST_LOWER_BOUND));if(r>=0){var o=this._originalMappings[r];if(o.source===n.source)return{line:C.getArg(o,"generatedLine",null),column:C.getArg(o,"generatedColumn",null),lastColumn:C.getArg(o,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}};var N=k;function D(e,t){var n=e;"string"==typeof e&&(n=C.parseSourceMapInput(e));var r=C.getArg(n,"version"),o=C.getArg(n,"sections");if(r!=this._version)throw new Error("Unsupported version: "+r);this._sources=new U,this._names=new U;var i={line:-1,column:0};this._sections=o.map((function(e){if(e.url)throw new Error("Support for url field in sections not implemented.");var n=C.getArg(e,"offset"),r=C.getArg(n,"line"),o=C.getArg(n,"column");if(r<i.line||r===i.line&&o<i.column)throw new Error("Section offsets must be ordered and non-overlapping.");return i=n,{generatedOffset:{generatedLine:r+1,generatedColumn:o+1},consumer:new G(C.getArg(e,"map"),t)}}))}D.prototype=Object.create(G.prototype),D.prototype.constructor=G,D.prototype._version=3,Object.defineProperty(D.prototype,"sources",{get:function(){for(var e=[],t=0;t<this._sections.length;t++)for(var n=0;n<this._sections[t].consumer.sources.length;n++)e.push(this._sections[t].consumer.sources[n]);return e}}),D.prototype.originalPositionFor=function(e){var t={generatedLine:C.getArg(e,"line"),generatedColumn:C.getArg(e,"column")},n=x.search(t,this._sections,(function(e,t){var n=e.generatedLine-t.generatedOffset.generatedLine;return n||e.generatedColumn-t.generatedOffset.generatedColumn})),r=this._sections[n];return r?r.consumer.originalPositionFor({line:t.generatedLine-(r.generatedOffset.generatedLine-1),column:t.generatedColumn-(r.generatedOffset.generatedLine===t.generatedLine?r.generatedOffset.generatedColumn-1:0),bias:e.bias}):{source:null,line:null,column:null,name:null}},D.prototype.hasContentsOfAllSources=function(){return this._sections.every((function(e){return e.consumer.hasContentsOfAllSources()}))},D.prototype.sourceContentFor=function(e,t){for(var n=0;n<this._sections.length;n++){var r=this._sections[n].consumer.sourceContentFor(e,!0);if(r)return r}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},D.prototype.generatedPositionFor=function(e){for(var t=0;t<this._sections.length;t++){var n=this._sections[t];if(-1!==n.consumer._findSourceIndex(C.getArg(e,"source"))){var r=n.consumer.generatedPositionFor(e);if(r)return{line:r.line+(n.generatedOffset.generatedLine-1),column:r.column+(n.generatedOffset.generatedLine===r.line?n.generatedOffset.generatedColumn-1:0)}}}return{line:null,column:null}},D.prototype._parseMappings=function(e,t){this.__generatedMappings=[],this.__originalMappings=[];for(var n=0;n<this._sections.length;n++)for(var r=this._sections[n],o=r.consumer._generatedMappings,i=0;i<o.length;i++){var s=o[i],a=r.consumer._sources.at(s.source);a=C.computeSourceURL(r.consumer.sourceRoot,a,this._sourceMapURL),this._sources.add(a),a=this._sources.indexOf(a);var u=null;s.name&&(u=r.consumer._names.at(s.name),this._names.add(u),u=this._names.indexOf(u));var l={source:a,generatedLine:s.generatedLine+(r.generatedOffset.generatedLine-1),generatedColumn:s.generatedColumn+(r.generatedOffset.generatedLine===s.generatedLine?r.generatedOffset.generatedColumn-1:0),originalLine:s.originalLine,originalColumn:s.originalColumn,name:u};this.__generatedMappings.push(l),"number"==typeof l.originalLine&&this.__originalMappings.push(l)}T(this.__generatedMappings,C.compareByGeneratedPositionsDeflated),T(this.__originalMappings,C.compareByOriginalPositions)};var F={SourceMapConsumer:I,BasicSourceMapConsumer:N,IndexedSourceMapConsumer:D},V=b.SourceMapGenerator,$=/(\r?\n)/,z="$$$isSourceNode$$$";function W(e,t,n,r,o){this.children=[],this.sourceContents={},this.line=null==e?null:e,this.column=null==t?null:t,this.source=null==n?null:n,this.name=null==o?null:o,this[z]=!0,null!=r&&this.add(r)}W.fromStringWithSourceMap=function(e,t,n){var r=new W,o=e.split($),i=0,s=function(){return e()+(e()||"");function e(){return i<o.length?o[i++]:void 0}},a=1,u=0,l=null;return t.eachMapping((function(e){if(null!==l){if(!(a<e.generatedLine)){var t=(n=o[i]||"").substr(0,e.generatedColumn-u);return o[i]=n.substr(e.generatedColumn-u),u=e.generatedColumn,c(l,t),void(l=e)}c(l,s()),a++,u=0}for(;a<e.generatedLine;)r.add(s()),a++;if(u<e.generatedColumn){var n=o[i]||"";r.add(n.substr(0,e.generatedColumn)),o[i]=n.substr(e.generatedColumn),u=e.generatedColumn}l=e}),this),i<o.length&&(l&&c(l,s()),r.add(o.splice(i).join(""))),t.sources.forEach((function(e){var o=t.sourceContentFor(e);null!=o&&(null!=n&&(e=C.join(n,e)),r.setSourceContent(e,o))})),r;function c(e,t){if(null===e||void 0===e.source)r.add(t);else{var o=n?C.join(n,e.source):e.source;r.add(new W(e.originalLine,e.originalColumn,o,t,e.name))}}},W.prototype.add=function(e){if(Array.isArray(e))e.forEach((function(e){this.add(e)}),this);else{if(!e[z]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);e&&this.children.push(e)}return this},W.prototype.prepend=function(e){if(Array.isArray(e))for(var t=e.length-1;t>=0;t--)this.prepend(e[t]);else{if(!e[z]&&"string"!=typeof e)throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+e);this.children.unshift(e)}return this},W.prototype.walk=function(e){for(var t,n=0,r=this.children.length;n<r;n++)(t=this.children[n])[z]?t.walk(e):""!==t&&e(t,{source:this.source,line:this.line,column:this.column,name:this.name})},W.prototype.join=function(e){var t,n,r=this.children.length;if(r>0){for(t=[],n=0;n<r-1;n++)t.push(this.children[n]),t.push(e);t.push(this.children[n]),this.children=t}return this},W.prototype.replaceRight=function(e,t){var n=this.children[this.children.length-1];return n[z]?n.replaceRight(e,t):"string"==typeof n?this.children[this.children.length-1]=n.replace(e,t):this.children.push("".replace(e,t)),this},W.prototype.setSourceContent=function(e,t){this.sourceContents[C.toSetString(e)]=t},W.prototype.walkSourceContents=function(e){for(var t=0,n=this.children.length;t<n;t++)this.children[t][z]&&this.children[t].walkSourceContents(e);var r=Object.keys(this.sourceContents);for(t=0,n=r.length;t<n;t++)e(C.fromSetString(r[t]),this.sourceContents[r[t]])},W.prototype.toString=function(){var e="";return this.walk((function(t){e+=t})),e},W.prototype.toStringWithSourceMap=function(e){var t={code:"",line:1,column:0},n=new V(e),r=!1,o=null,i=null,s=null,a=null;return this.walk((function(e,u){t.code+=e,null!==u.source&&null!==u.line&&null!==u.column?(o===u.source&&i===u.line&&s===u.column&&a===u.name||n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:t.line,column:t.column},name:u.name}),o=u.source,i=u.line,s=u.column,a=u.name,r=!0):r&&(n.addMapping({generated:{line:t.line,column:t.column}}),o=null,r=!1);for(var l=0,c=e.length;l<c;l++)10===e.charCodeAt(l)?(t.line++,t.column=0,l+1===c?(o=null,r=!1):r&&n.addMapping({source:u.source,original:{line:u.line,column:u.column},generated:{line:t.line,column:t.column},name:u.name})):t.column++})),this.walkSourceContents((function(e,t){n.setSourceContent(e,t)})),{code:t.code,map:n}};var J={SourceMapGenerator:b.SourceMapGenerator,SourceMapConsumer:F.SourceMapConsumer,SourceNode:{SourceNode:W}.SourceNode},q=a((function(e,t){var n,r;e.exports=(n=/[#@] sourceMappingURL=([^\s'"]*)/,{regex:r=RegExp("(?:/\\*(?:\\s*\r?\n(?://)?)?(?:"+n.source+")\\s*\\*/|//(?:"+n.source+"))\\s*"),_innerRegex:n,getFrom:function(e){var t=e.match(r);return t?t[1]||t[2]||"":null},existsIn:function(e){return r.test(e)},removeFrom:function(e){return e.replace(r,"")},insertBefore:function(e,t){var n=e.match(r);return n?e.slice(0,n.index)+t+e.slice(n.index):e+t}})})),Q=u(Object.freeze({__proto__:null}));var H=function(){return Array.prototype.reduce.call(arguments,(function(e,t){return Q.resolve(e,t)}))},K=new RegExp("%[a-f0-9]{2}","gi"),X=new RegExp("(%[a-f0-9]{2})+","gi");function Y(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],Y(n),Y(r))}function Z(e){try{return decodeURIComponent(e)}catch(r){for(var t=e.match(K),n=1;n<t.length;n++)t=(e=Y(t,n).join("")).match(K);return e}}var ee=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},n=X.exec(e);n;){try{t[n[0]]=decodeURIComponent(n[0])}catch(e){var r=Z(n[0]);r!==n[0]&&(t[n[0]]=r)}n=X.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),i=0;i<o.length;i++){var s=o[i];e=e.replace(new RegExp(s,"g"),t[s])}return e}(e)}};var te=function(e){return ee(e.replace(/\+/g,"%2B"))},ne=u(Object.freeze({__proto__:null}));var re=function(e){return"\\"===ne.sep?e.replace(/\\/g,"/").replace(/^[a-z]:\/?/i,"/"):e};function oe(e){return Buffer.from(e,"base64").toString("binary")}var ie=oe.atob=oe;function se(e,t,n){setImmediate((function(){e(t,n)}))}function ae(e,t){try{return JSON.parse(e.replace(/^\)\]\}'/,""))}catch(e){throw e.sourceMapData=t,e}}function ue(e,t,n){var r=te(t);try{return String(e(r))}catch(e){throw e.sourceMapData=n,e}}function le(e,t,n,r){var o;try{o=me(e,t)}catch(e){return se(r,e)}if(!o||o.map)return se(r,null,o);n(te(o.url),(function(e,t){if(e)return e.sourceMapData=o,r(e);o.map=String(t);try{o.map=ae(o.map,o)}catch(e){return r(e)}r(null,o)}))}function ce(e,t,n){var r=me(e,t);return!r||r.map?r:(r.map=ue(n,r.url,r),r.map=ae(r.map,r),r)}var pe=/^data:([^,;]*)(;[^,;]*)*(?:,(.*))?$/,he=/^(?:application|text)\/json$/;function fe(e){if("undefined"==typeof TextDecoder||"undefined"==typeof Uint8Array)return ie(e);var t=function(e){for(var t=ie(e),n=t.length,r=new Uint8Array(n),o=0;o<n;o++)r[o]=t.charCodeAt(o);return r}(e);return new TextDecoder("utf-8",{fatal:!0}).decode(t)}function me(e,t){t=re(t);var n=q.getFrom(e);if(!n)return null;var r=n.match(pe);if(r){var o=r[1]||"text/plain",i=r[2]||"",s=r[3]||"",a={sourceMappingURL:n,url:null,sourcesRelativeTo:t,map:s};if(!he.test(o)){var u=new Error("Unuseful data uri mime type: "+o);throw u.sourceMapData=a,u}try{a.map=ae(";base64"===i?fe(s):decodeURIComponent(s),a)}catch(u){throw u.sourceMapData=a,u}return a}var l=H(t,n);return{sourceMappingURL:n,url:l,sourcesRelativeTo:l,map:null}}function ge(e,t,n,r,o){"function"==typeof r&&(o=r,r={});var i=e.sources?e.sources.length:0,s={sourcesResolved:[],sourcesContent:[]};if(0!==i){var a=function(){0===--i&&o(null,s)};ye(e,t,r,(function(e,t,r){if(s.sourcesResolved[r]=e,"string"==typeof t)s.sourcesContent[r]=t,se(a,null);else{var o=te(e);n(o,(function(e,t){s.sourcesContent[r]=e||String(t),a()}))}}))}else se(o,null,s)}function de(e,t,n,r){var o={sourcesResolved:[],sourcesContent:[]};return e.sources&&0!==e.sources.length?(ye(e,t,r,(function(e,t,r){if(o.sourcesResolved[r]=e,null!==n)if("string"==typeof t)o.sourcesContent[r]=t;else{var i=te(e);try{o.sourcesContent[r]=String(n(i))}catch(e){o.sourcesContent[r]=e}}})),o):o}var ve=/\/?$/;function ye(e,t,n,r){var o;n=n||{},t=re(t);for(var i=0,s=e.sources.length;i<s;i++)o=null,"string"==typeof n.sourceRoot?o=n.sourceRoot:"string"==typeof e.sourceRoot&&!1!==n.sourceRoot&&(o=e.sourceRoot),r(null===o||""===o?H(t,e.sources[i]):H(t,o.replace(ve,"/"),e.sources[i]),(e.sourcesContent||[])[i],i)}var _e={resolveSourceMap:le,resolveSourceMapSync:ce,resolveSources:ge,resolveSourcesSync:de,resolve:function(e,t,n,r,o){if("function"==typeof r&&(o=r,r={}),null===e){var i={sourceMappingURL:null,url:t,sourcesRelativeTo:t,map:null},s=te(t);n(s,(function(e,t){if(e)return e.sourceMapData=i,o(e);i.map=String(t);try{i.map=ae(i.map,i)}catch(e){return o(e)}a(i)}))}else le(e,t,n,(function(e,t){return e?o(e):t?void a(t):o(null,null)}));function a(e){ge(e.map,e.sourcesRelativeTo,n,r,(function(t,n){if(t)return o(t);e.sourcesResolved=n.sourcesResolved,e.sourcesContent=n.sourcesContent,o(null,e)}))}},resolveSync:function(e,t,n,r){var o;if(null===e){(o={sourceMappingURL:null,url:t,sourcesRelativeTo:t,map:null}).map=ue(n,t,o),o.map=ae(o.map,o)}else if(!(o=ce(e,t,n)))return null;var i=de(o.map,o.sourcesRelativeTo,n,r);return o.sourcesResolved=i.sourcesResolved,o.sourcesContent=i.sourcesContent,o},parseMapToJSON:ae},Ce=u(Object.freeze({__proto__:null})),Se=a((function(e,t){var n=J.SourceMapGenerator,r=J.SourceMapConsumer;e.exports=function(e){for(var r in e._comment=e.comment,e.map=new n,e.position={line:1,column:1},e.files={},t)e[r]=t[r]},t.updatePosition=function(e){var t=e.match(/\n/g);t&&(this.position.line+=t.length);var n=e.lastIndexOf("\n");this.position.column=~n?e.length-n:this.position.column+e.length},t.emit=function(e,t){if(t){var n=re(t.source||"source.css");this.map.addMapping({source:n,generated:{line:this.position.line,column:Math.max(this.position.column-1,0)},original:{line:t.start.line,column:t.start.column-1}}),this.addFile(n,t)}return this.updatePosition(e),e},t.addFile=function(e,t){"string"==typeof t.content&&(Object.prototype.hasOwnProperty.call(this.files,e)||(this.files[e]=t.content))},t.applySourceMaps=function(){Object.keys(this.files).forEach((function(e){var t=this.files[e];if(this.map.setSourceContent(e,t),!1!==this.options.inputSourcemaps){var n=_e.resolveSync(t,e,Ce.readFileSync);if(n){var o=new r(n.map),i=n.sourcesRelativeTo;this.map.applySourceMap(o,e,re(ne.dirname(i)))}}}),this)},t.comment=function(e){return/^# sourceMappingURL=/.test(e.comment)?this.emit("",e.position):this._comment(e)}})),Ae=(Se.updatePosition,Se.emit,Se.addFile,Se.applySourceMaps,Se.comment,function(e,t){t=t||{};var n=1,i=1;function s(e){var t=e.match(/\n/g);t&&(n+=t.length);var r=e.lastIndexOf("\n");i=~r?e.length-r:i+e.length}function a(){var e={line:n,column:i};return function(t){return t.position=new u(e),g(),t}}function u(e){this.start=e,this.end={line:n,column:i},this.source=t.source}u.prototype.content=e;var l=[];function c(r){var o=new Error(t.source+":"+n+":"+i+": "+r);if(o.reason=r,o.filename=t.source,o.line=n,o.column=i,o.source=e,!t.silent)throw o;l.push(o)}function p(){return m(/^{\s*/)}function h(){return m(/^}/)}function f(){var t,n=[];for(g(),d(n);e.length&&"}"!=e.charAt(0)&&(t=O()||E());)!1!==t&&(n.push(t),d(n));return n}function m(t){var n=t.exec(e);if(n){var r=n[0];return s(r),e=e.slice(r.length),n}}function g(){m(/^\s*/)}function d(e){var t;for(e=e||[];t=v();)!1!==t&&e.push(t);return e}function v(){var t=a();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;""!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return c("End of comment missing");var r=e.slice(2,n-2);return i+=2,s(r),e=e.slice(n),i+=2,t({type:"comment",comment:r})}}function y(){var e=m(/^([^{]+)/);if(e)return o(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"‌")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function _(){var e=a(),t=m(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(t){if(t=o(t[0]),!m(/^:\s*/))return c("property missing ':'");var n=m(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),i=e({type:"declaration",property:t.replace(r,""),value:n?o(n[0]).replace(r,""):""});return m(/^[;\s]*/),i}}function C(){var e,t=[];if(!p())return c("missing '{'");for(d(t);e=_();)!1!==e&&(t.push(e),d(t));return h()?t:c("missing '}'")}function S(){for(var e,t=[],n=a();e=m(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),m(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:C()})}var A,M=R("import"),w=R("charset"),L=R("namespace");function R(e){var t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){var n=a(),r=m(t);if(r){var o={type:e};return o[e]=r[1].trim(),n(o)}}}function O(){if("@"==e[0])return function(){var e=a();if(t=m(/^@([-\w]+)?keyframes\s*/)){var t,n=t[1];if(!(t=m(/^([-\w]+)\s*/)))return c("@keyframes missing name");var r,o=t[1];if(!p())return c("@keyframes missing '{'");for(var i=d();r=S();)i.push(r),i=i.concat(d());return h()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):c("@keyframes missing '}'")}}()||function(){var e=a(),t=m(/^@media *([^{]+)/);if(t){var n=o(t[1]);if(!p())return c("@media missing '{'");var r=d().concat(f());return h()?e({type:"media",media:n,rules:r}):c("@media missing '}'")}}()||function(){var e=a(),t=m(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:o(t[1]),media:o(t[2])})}()||function(){var e=a(),t=m(/^@supports *([^{]+)/);if(t){var n=o(t[1]);if(!p())return c("@supports missing '{'");var r=d().concat(f());return h()?e({type:"supports",supports:n,rules:r}):c("@supports missing '}'")}}()||M()||w()||L()||function(){var e=a(),t=m(/^@([-\w]+)?document *([^{]+)/);if(t){var n=o(t[1]),r=o(t[2]);if(!p())return c("@document missing '{'");var i=d().concat(f());return h()?e({type:"document",document:r,vendor:n,rules:i}):c("@document missing '}'")}}()||function(){var e=a();if(m(/^@page */)){var t=y()||[];if(!p())return c("@page missing '{'");for(var n,r=d();n=_();)r.push(n),r=r.concat(d());return h()?e({type:"page",selectors:t,declarations:r}):c("@page missing '}'")}}()||function(){var e=a();if(m(/^@host\s*/)){if(!p())return c("@host missing '{'");var t=d().concat(f());return h()?e({type:"host",rules:t}):c("@host missing '}'")}}()||function(){var e=a();if(m(/^@font-face\s*/)){if(!p())return c("@font-face missing '{'");for(var t,n=d();t=_();)n.push(t),n=n.concat(d());return h()?e({type:"font-face",declarations:n}):c("@font-face missing '}'")}}()}function E(){var e=a(),t=y();return t?(d(),e({type:"rule",selectors:t,declarations:C()})):c("selector missing")}return function e(t,n){var r=t&&"string"==typeof t.type,o=r?t:n;for(var i in t){var s=t[i];Array.isArray(s)?s.forEach((function(t){e(t,o)})):s&&"object"==typeof s&&e(s,o)}r&&Object.defineProperty(t,"parent",{configurable:!0,writable:!0,enumerable:!1,value:n||null});return t}((A=f(),{type:"stylesheet",stylesheet:{source:t.source,rules:A,parsingErrors:l}}))});function Me(e){const t=new Map;let n=null;return Ae(e).stylesheet.rules.filter(({type:e})=>"rule"===e).forEach(({declarations:e,selectors:r})=>{r.forEach(r=>{var o,i;'code[class*="language-"]'===r&&(i=null===(o=e.filter(({type:e})=>"declaration"===e).filter(({property:e})=>"color"===e)[0])||void 0===o?void 0:o.value,n=null!=i?i:null);const s=r.split(".").slice(1);-1!==s.indexOf("token")&&2===s.length&&t.set(s.filter(e=>"token"!==e)[0],e.filter(({type:e})=>"declaration"===e).map(({property:e,value:t})=>`${e}:${t}`).join(";"))})}),{textColor:n,tokens:t}}function we(r,o,{textColor:i,tokens:s}){const a=[],u=[];return e(r,o).forEach(e=>{var r;"string"==typeof e?(a.push(`%c${n(e)}`),u.push(null===i?"":`color:${i}`)):(a.push(`%c${n(t(e))}`),u.push(null!=(r=s.get(e.type))?r:""))}),[a.join(""),...u]}export{Me as generateTheme,we as highlight};
import{tokenize as r}from"prismjs";import{get as o}from"color-string";import{parse as n}from"css";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */function e(r){return"string"==typeof r?r:Array.isArray(r)?r.map(e).join(""):e(r.content)}function t(r){return r.replace(/%+/g,(function(r){return"%".repeat(2*r.length)}))}var l;function i(r){var o,e=new Map,t=null;return(null===(o=n(r).stylesheet)||void 0===o?void 0:o.rules.filter((function(r){return"rule"===r.type}))).forEach((function(r){var o=r.declarations,n=r.selectors;null==n||n.forEach((function(r){var n,l;'code[class*="language-"]'===r&&(t=null!==(l=null===(n=(null==o?void 0:o.filter((function(r){return"declaration"===r.type}))).filter((function(r){return"color"===r.property}))[0])||void 0===n?void 0:n.value)&&void 0!==l?l:null);var i=r.split(".").slice(1);i.includes("token")&&2===i.length&&e.set(i.filter((function(r){return"token"!==r}))[0],(null==o?void 0:o.filter((function(r){return"declaration"===r.type}))).filter((function(r){return void 0!==r.property&&void 0!==r.value})).map((function(r){return{property:r.property,value:r.value}})))}))})),{textColor:t,tokens:e}}function u(n,i,u,c){var s;void 0===c&&(c="undefined"==typeof process||"browser"in process||void 0===(null===(s=null===process||void 0===process?void 0:process.versions)||void 0===s?void 0:s.node)?l.Browser:l.Node);var f=r(n,i);if(c===l.Browser){var v=[],a=[];return f.forEach((function(r){var o,n;"string"==typeof r?(v.push("%c"+t(r)),a.push(null===u.textColor?"":"color:"+u.textColor)):(v.push("%c"+t(e(r.content))),a.push(null!==(n=null===(o=u.tokens.get(r.type))||void 0===o?void 0:o.map((function(r){return r.property+":"+r.value})).join(";"))&&void 0!==n?n:""))})),function(){for(var r=0,o=0,n=arguments.length;o<n;o++)r+=arguments[o].length;var e=Array(r),t=0;for(o=0;o<n;o++)for(var l=arguments[o],i=0,u=l.length;i<u;i++,t++)e[t]=l[i];return e}([v.join("")],a)}return c===l.Node?[f.map((function(r){var n,t,l=null;if("string"==typeof r)l=null===u.textColor?null:o.rgb(u.textColor);else{var i=null===(t=null===(n=u.tokens.get(r.type))||void 0===n?void 0:n.find((function(r){return"color"===r.property.toLowerCase()})))||void 0===t?void 0:t.value;l=void 0===i?null:o.rgb(i)}return null===l?""+e(r):function(r,o,n){return"["+[38,2,r,o,n].join(";")+"m"}(l[0],l[1],l[2])+e(r)})).join("")+""]:c}!function(r){r[r.Browser=0]="Browser",r[r.Node=1]="Node"}(l||(l={}));export{l as Platform,i as generateTheme,u as highlight};
export interface Theme {
textColor: string | null;
tokens: Map<string, string>;
tokens: Map<string, Array<{
property: string;
value: string;
}>>;
}

@@ -5,0 +8,0 @@ /**

{
"name": "prism-console",
"version": "1.0.1",
"description": "Prism but outputs to the browser console",
"version": "1.0.2",
"description": "Output syntax highlighted code to the console",
"keywords": [

@@ -23,5 +23,7 @@ "browser",

"cjs/theme.d.ts",
"cjs/utils.d.ts",
"esm/index.js",
"esm/index.d.ts",
"esm/theme.d.ts"
"esm/theme.d.ts",
"esm/utils.d.ts"
],

@@ -35,23 +37,28 @@ "main": "cjs/index.js",

},
"dependencies": {},
"dependencies": {
"color-string": "^1.5.3",
"css": "^2.2.4"
},
"devDependencies": {
"@istanbuljs/nyc-config-typescript": "^1.0.1",
"@rollup/plugin-commonjs": "^11.0.0",
"@rollup/plugin-node-resolve": "^6.0.0",
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-node-resolve": "^6.1.0",
"@types/color-string": "^1.5.0",
"@types/css": "0.0.31",
"@types/prismjs": "^1.16.0",
"@typescript-eslint/eslint-plugin": "^2.27.0",
"@typescript-eslint/parser": "^2.27.0",
"ava": "^2.4.0",
"css": "^2.2.4",
"nyc": "^15.0.0",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.1",
"eslint-plugin-prettier": "^3.1.2",
"nyc": "^15.0.1",
"prettier": "^1.19.1",
"prismjs": "^1.17.1",
"rollup": "^1.27.14",
"prismjs": "^1.20.0",
"rollup": "^1.32.1",
"rollup-plugin-shim": "^1.0.0",
"rollup-plugin-terser": "^5.1.3",
"rollup-plugin-terser": "^5.3.0",
"rollup-plugin-typescript2": "^0.25.3",
"ts-node": "^8.5.4",
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0",
"tslint-plugin-prettier": "^2.1.0",
"typescript": "^3.7.4"
"ts-node": "^8.8.2",
"typescript": "^3.8.3"
},

@@ -58,0 +65,0 @@ "peerDependencies": {

@@ -9,31 +9,23 @@ # prism-console

The following code, when run in a browser, displays the output in this image in the browser console:
The following code, when run in a browser, displays the console:
```javascript
import { generateTheme, highlight } from "prism-console";
import Prism from "prismjs";
import Prismjs from "prismjs";
const theme = generateTheme(...);
console.log(
...highlight(
`import { generateTheme, highlight } from "prism-console"`,
Prism.languages.javascript,
theme
)
);
const code = `var x = console.log("test");`;
console.log(
...highlight(
`.token.deleted {
color: red;
}`,
Prism.languages.css,
theme
)
);
console.log(...highlight(code, Prismjs.languages.javascript, theme));
```
![syntax highlighted code](https://raw.githubusercontent.com/tomblcode/prism-console/master/example.png)
![syntax highlighted code](https://raw.githubusercontent.com/tomblcode/prism-console/master/example/terminal.png)
<center><i>in the terminal</i></center>
![syntax highlighted code](https://raw.githubusercontent.com/tomblcode/prism-console/master/example/browser.png)
<center><i>in the browser</i></center>
## API

@@ -45,10 +37,12 @@

### `highlight(code: string, grammar: Prism.Grammar, theme: Theme): string[]`
### `highlight(code: string, grammar: Prismjs.Grammar, theme: Theme, platform?: Platform): string[]`
`code` is the code to be highlighted.
`grammar` A [Prism](https://prismjs.com) language grammar, typically taken from `Prism.languages`.
`grammar` A [Prism](https://prismjs.com) language grammar, typically taken from `Prismjs.languages`.
`theme` is the theme to highlight the code with, generated by `generateTheme`.
`platform` is an instance of the enum `Platform`, which is either `Browser` or `Node`. This is auto-detected if not passed.
`highlight` returns an array of arguments to be passed to any function in the `console.log` family.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc