Files
Nemia-Website/.next/build/chunks/node_modules_fe693df6._.js

6758 lines
250 KiB
JavaScript

module.exports = [
"[project]/node_modules/picocolors/picocolors.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
let p = process || {}, argv = p.argv || [], env = p.env || {};
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
let formatter = (open, close, replace = open)=>(input)=>{
let string = "" + input, index = string.indexOf(close, open.length);
return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
};
let replaceClose = (string, close, replace, index)=>{
let result = "", cursor = 0;
do {
result += string.substring(cursor, index) + replace;
cursor = index + close.length;
index = string.indexOf(close, cursor);
}while (~index)
return result + string.substring(cursor);
};
let createColors = (enabled = isColorSupported)=>{
let f = enabled ? formatter : ()=>String;
return {
isColorSupported: enabled,
reset: f("\x1b[0m", "\x1b[0m"),
bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
italic: f("\x1b[3m", "\x1b[23m"),
underline: f("\x1b[4m", "\x1b[24m"),
inverse: f("\x1b[7m", "\x1b[27m"),
hidden: f("\x1b[8m", "\x1b[28m"),
strikethrough: f("\x1b[9m", "\x1b[29m"),
black: f("\x1b[30m", "\x1b[39m"),
red: f("\x1b[31m", "\x1b[39m"),
green: f("\x1b[32m", "\x1b[39m"),
yellow: f("\x1b[33m", "\x1b[39m"),
blue: f("\x1b[34m", "\x1b[39m"),
magenta: f("\x1b[35m", "\x1b[39m"),
cyan: f("\x1b[36m", "\x1b[39m"),
white: f("\x1b[37m", "\x1b[39m"),
gray: f("\x1b[90m", "\x1b[39m"),
bgBlack: f("\x1b[40m", "\x1b[49m"),
bgRed: f("\x1b[41m", "\x1b[49m"),
bgGreen: f("\x1b[42m", "\x1b[49m"),
bgYellow: f("\x1b[43m", "\x1b[49m"),
bgBlue: f("\x1b[44m", "\x1b[49m"),
bgMagenta: f("\x1b[45m", "\x1b[49m"),
bgCyan: f("\x1b[46m", "\x1b[49m"),
bgWhite: f("\x1b[47m", "\x1b[49m"),
blackBright: f("\x1b[90m", "\x1b[39m"),
redBright: f("\x1b[91m", "\x1b[39m"),
greenBright: f("\x1b[92m", "\x1b[39m"),
yellowBright: f("\x1b[93m", "\x1b[39m"),
blueBright: f("\x1b[94m", "\x1b[39m"),
magentaBright: f("\x1b[95m", "\x1b[39m"),
cyanBright: f("\x1b[96m", "\x1b[39m"),
whiteBright: f("\x1b[97m", "\x1b[39m"),
bgBlackBright: f("\x1b[100m", "\x1b[49m"),
bgRedBright: f("\x1b[101m", "\x1b[49m"),
bgGreenBright: f("\x1b[102m", "\x1b[49m"),
bgYellowBright: f("\x1b[103m", "\x1b[49m"),
bgBlueBright: f("\x1b[104m", "\x1b[49m"),
bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
bgCyanBright: f("\x1b[106m", "\x1b[49m"),
bgWhiteBright: f("\x1b[107m", "\x1b[49m")
};
};
module.exports = createColors();
module.exports.createColors = createColors;
}),
"[project]/node_modules/postcss/lib/tokenize.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
const SINGLE_QUOTE = "'".charCodeAt(0);
const DOUBLE_QUOTE = '"'.charCodeAt(0);
const BACKSLASH = '\\'.charCodeAt(0);
const SLASH = '/'.charCodeAt(0);
const NEWLINE = '\n'.charCodeAt(0);
const SPACE = ' '.charCodeAt(0);
const FEED = '\f'.charCodeAt(0);
const TAB = '\t'.charCodeAt(0);
const CR = '\r'.charCodeAt(0);
const OPEN_SQUARE = '['.charCodeAt(0);
const CLOSE_SQUARE = ']'.charCodeAt(0);
const OPEN_PARENTHESES = '('.charCodeAt(0);
const CLOSE_PARENTHESES = ')'.charCodeAt(0);
const OPEN_CURLY = '{'.charCodeAt(0);
const CLOSE_CURLY = '}'.charCodeAt(0);
const SEMICOLON = ';'.charCodeAt(0);
const ASTERISK = '*'.charCodeAt(0);
const COLON = ':'.charCodeAt(0);
const AT = '@'.charCodeAt(0);
const RE_AT_END = /[\t\n\f\r "#'()/;[\\\]{}]/g;
const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g;
const RE_BAD_BRACKET = /.[\r\n"'(/\\]/;
const RE_HEX_ESCAPE = /[\da-f]/i;
module.exports = function tokenizer(input, options = {}) {
let css = input.css.valueOf();
let ignore = options.ignoreErrors;
let code, content, escape, next, quote;
let currentToken, escaped, escapePos, n, prev;
let length = css.length;
let pos = 0;
let buffer = [];
let returned = [];
function position() {
return pos;
}
function unclosed(what) {
throw input.error('Unclosed ' + what, pos);
}
function endOfFile() {
return returned.length === 0 && pos >= length;
}
function nextToken(opts) {
if (returned.length) return returned.pop();
if (pos >= length) return;
let ignoreUnclosed = opts ? opts.ignoreUnclosed : false;
code = css.charCodeAt(pos);
switch(code){
case NEWLINE:
case SPACE:
case TAB:
case CR:
case FEED:
{
next = pos;
do {
next += 1;
code = css.charCodeAt(next);
}while (code === SPACE || code === NEWLINE || code === TAB || code === CR || code === FEED)
currentToken = [
'space',
css.slice(pos, next)
];
pos = next - 1;
break;
}
case OPEN_SQUARE:
case CLOSE_SQUARE:
case OPEN_CURLY:
case CLOSE_CURLY:
case COLON:
case SEMICOLON:
case CLOSE_PARENTHESES:
{
let controlChar = String.fromCharCode(code);
currentToken = [
controlChar,
controlChar,
pos
];
break;
}
case OPEN_PARENTHESES:
{
prev = buffer.length ? buffer.pop()[1] : '';
n = css.charCodeAt(pos + 1);
if (prev === 'url' && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR) {
next = pos;
do {
escaped = false;
next = css.indexOf(')', next + 1);
if (next === -1) {
if (ignore || ignoreUnclosed) {
next = pos;
break;
} else {
unclosed('bracket');
}
}
escapePos = next;
while(css.charCodeAt(escapePos - 1) === BACKSLASH){
escapePos -= 1;
escaped = !escaped;
}
}while (escaped)
currentToken = [
'brackets',
css.slice(pos, next + 1),
pos,
next
];
pos = next;
} else {
next = css.indexOf(')', pos + 1);
content = css.slice(pos, next + 1);
if (next === -1 || RE_BAD_BRACKET.test(content)) {
currentToken = [
'(',
'(',
pos
];
} else {
currentToken = [
'brackets',
content,
pos,
next
];
pos = next;
}
}
break;
}
case SINGLE_QUOTE:
case DOUBLE_QUOTE:
{
quote = code === SINGLE_QUOTE ? "'" : '"';
next = pos;
do {
escaped = false;
next = css.indexOf(quote, next + 1);
if (next === -1) {
if (ignore || ignoreUnclosed) {
next = pos + 1;
break;
} else {
unclosed('string');
}
}
escapePos = next;
while(css.charCodeAt(escapePos - 1) === BACKSLASH){
escapePos -= 1;
escaped = !escaped;
}
}while (escaped)
currentToken = [
'string',
css.slice(pos, next + 1),
pos,
next
];
pos = next;
break;
}
case AT:
{
RE_AT_END.lastIndex = pos + 1;
RE_AT_END.test(css);
if (RE_AT_END.lastIndex === 0) {
next = css.length - 1;
} else {
next = RE_AT_END.lastIndex - 2;
}
currentToken = [
'at-word',
css.slice(pos, next + 1),
pos,
next
];
pos = next;
break;
}
case BACKSLASH:
{
next = pos;
escape = true;
while(css.charCodeAt(next + 1) === BACKSLASH){
next += 1;
escape = !escape;
}
code = css.charCodeAt(next + 1);
if (escape && code !== SLASH && code !== SPACE && code !== NEWLINE && code !== TAB && code !== CR && code !== FEED) {
next += 1;
if (RE_HEX_ESCAPE.test(css.charAt(next))) {
while(RE_HEX_ESCAPE.test(css.charAt(next + 1))){
next += 1;
}
if (css.charCodeAt(next + 1) === SPACE) {
next += 1;
}
}
}
currentToken = [
'word',
css.slice(pos, next + 1),
pos,
next
];
pos = next;
break;
}
default:
{
if (code === SLASH && css.charCodeAt(pos + 1) === ASTERISK) {
next = css.indexOf('*/', pos + 2) + 1;
if (next === 0) {
if (ignore || ignoreUnclosed) {
next = css.length;
} else {
unclosed('comment');
}
}
currentToken = [
'comment',
css.slice(pos, next + 1),
pos,
next
];
pos = next;
} else {
RE_WORD_END.lastIndex = pos + 1;
RE_WORD_END.test(css);
if (RE_WORD_END.lastIndex === 0) {
next = css.length - 1;
} else {
next = RE_WORD_END.lastIndex - 2;
}
currentToken = [
'word',
css.slice(pos, next + 1),
pos,
next
];
buffer.push(currentToken);
pos = next;
}
break;
}
}
pos++;
return currentToken;
}
function back(token) {
returned.push(token);
}
return {
back,
endOfFile,
nextToken,
position
};
};
}),
"[project]/node_modules/postcss/lib/terminal-highlight.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let pico = __turbopack_context__.r("[project]/node_modules/picocolors/picocolors.js [postcss] (ecmascript)");
let tokenizer = __turbopack_context__.r("[project]/node_modules/postcss/lib/tokenize.js [postcss] (ecmascript)");
let Input;
function registerInput(dependant) {
Input = dependant;
}
const HIGHLIGHT_THEME = {
';': pico.yellow,
':': pico.yellow,
'(': pico.cyan,
')': pico.cyan,
'[': pico.yellow,
']': pico.yellow,
'{': pico.yellow,
'}': pico.yellow,
'at-word': pico.cyan,
'brackets': pico.cyan,
'call': pico.cyan,
'class': pico.yellow,
'comment': pico.gray,
'hash': pico.magenta,
'string': pico.green
};
function getTokenType([type, value], processor) {
if (type === 'word') {
if (value[0] === '.') {
return 'class';
}
if (value[0] === '#') {
return 'hash';
}
}
if (!processor.endOfFile()) {
let next = processor.nextToken();
processor.back(next);
if (next[0] === 'brackets' || next[0] === '(') return 'call';
}
return type;
}
function terminalHighlight(css) {
let processor = tokenizer(new Input(css), {
ignoreErrors: true
});
let result = '';
while(!processor.endOfFile()){
let token = processor.nextToken();
let color = HIGHLIGHT_THEME[getTokenType(token, processor)];
if (color) {
result += token[1].split(/\r?\n/).map((i)=>color(i)).join('\n');
} else {
result += token[1];
}
}
return result;
}
terminalHighlight.registerInput = registerInput;
module.exports = terminalHighlight;
}),
"[project]/node_modules/postcss/lib/css-syntax-error.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let pico = __turbopack_context__.r("[project]/node_modules/picocolors/picocolors.js [postcss] (ecmascript)");
let terminalHighlight = __turbopack_context__.r("[project]/node_modules/postcss/lib/terminal-highlight.js [postcss] (ecmascript)");
class CssSyntaxError extends Error {
constructor(message, line, column, source, file, plugin){
super(message);
this.name = 'CssSyntaxError';
this.reason = message;
if (file) {
this.file = file;
}
if (source) {
this.source = source;
}
if (plugin) {
this.plugin = plugin;
}
if (typeof line !== 'undefined' && typeof column !== 'undefined') {
if (typeof line === 'number') {
this.line = line;
this.column = column;
} else {
this.line = line.line;
this.column = line.column;
this.endLine = column.line;
this.endColumn = column.column;
}
}
this.setMessage();
if (Error.captureStackTrace) {
Error.captureStackTrace(this, CssSyntaxError);
}
}
setMessage() {
this.message = this.plugin ? this.plugin + ': ' : '';
this.message += this.file ? this.file : '<css input>';
if (typeof this.line !== 'undefined') {
this.message += ':' + this.line + ':' + this.column;
}
this.message += ': ' + this.reason;
}
showSourceCode(color) {
if (!this.source) return '';
let css = this.source;
if (color == null) color = pico.isColorSupported;
let aside = (text)=>text;
let mark = (text)=>text;
let highlight = (text)=>text;
if (color) {
let { bold, gray, red } = pico.createColors(true);
mark = (text)=>bold(red(text));
aside = (text)=>gray(text);
if (terminalHighlight) {
highlight = (text)=>terminalHighlight(text);
}
}
let lines = css.split(/\r?\n/);
let start = Math.max(this.line - 3, 0);
let end = Math.min(this.line + 2, lines.length);
let maxWidth = String(end).length;
return lines.slice(start, end).map((line, index)=>{
let number = start + 1 + index;
let gutter = ' ' + (' ' + number).slice(-maxWidth) + ' | ';
if (number === this.line) {
if (line.length > 160) {
let padding = 20;
let subLineStart = Math.max(0, this.column - padding);
let subLineEnd = Math.max(this.column + padding, this.endColumn + padding);
let subLine = line.slice(subLineStart, subLineEnd);
let spacing = aside(gutter.replace(/\d/g, ' ')) + line.slice(0, Math.min(this.column - 1, padding - 1)).replace(/[^\t]/g, ' ');
return mark('>') + aside(gutter) + highlight(subLine) + '\n ' + spacing + mark('^');
}
let spacing = aside(gutter.replace(/\d/g, ' ')) + line.slice(0, this.column - 1).replace(/[^\t]/g, ' ');
return mark('>') + aside(gutter) + highlight(line) + '\n ' + spacing + mark('^');
}
return ' ' + aside(gutter) + highlight(line);
}).join('\n');
}
toString() {
let code = this.showSourceCode();
if (code) {
code = '\n\n' + code + '\n';
}
return this.name + ': ' + this.message + code;
}
}
module.exports = CssSyntaxError;
CssSyntaxError.default = CssSyntaxError;
}),
"[project]/node_modules/postcss/lib/stringifier.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
const DEFAULT_RAW = {
after: '\n',
beforeClose: '\n',
beforeComment: '\n',
beforeDecl: '\n',
beforeOpen: ' ',
beforeRule: '\n',
colon: ': ',
commentLeft: ' ',
commentRight: ' ',
emptyBody: '',
indent: ' ',
semicolon: false
};
function capitalize(str) {
return str[0].toUpperCase() + str.slice(1);
}
class Stringifier {
constructor(builder){
this.builder = builder;
}
atrule(node, semicolon) {
let name = '@' + node.name;
let params = node.params ? this.rawValue(node, 'params') : '';
if (typeof node.raws.afterName !== 'undefined') {
name += node.raws.afterName;
} else if (params) {
name += ' ';
}
if (node.nodes) {
this.block(node, name + params);
} else {
let end = (node.raws.between || '') + (semicolon ? ';' : '');
this.builder(name + params + end, node);
}
}
beforeAfter(node, detect) {
let value;
if (node.type === 'decl') {
value = this.raw(node, null, 'beforeDecl');
} else if (node.type === 'comment') {
value = this.raw(node, null, 'beforeComment');
} else if (detect === 'before') {
value = this.raw(node, null, 'beforeRule');
} else {
value = this.raw(node, null, 'beforeClose');
}
let buf = node.parent;
let depth = 0;
while(buf && buf.type !== 'root'){
depth += 1;
buf = buf.parent;
}
if (value.includes('\n')) {
let indent = this.raw(node, null, 'indent');
if (indent.length) {
for(let step = 0; step < depth; step++)value += indent;
}
}
return value;
}
block(node, start) {
let between = this.raw(node, 'between', 'beforeOpen');
this.builder(start + between + '{', node, 'start');
let after;
if (node.nodes && node.nodes.length) {
this.body(node);
after = this.raw(node, 'after');
} else {
after = this.raw(node, 'after', 'emptyBody');
}
if (after) this.builder(after);
this.builder('}', node, 'end');
}
body(node) {
let last = node.nodes.length - 1;
while(last > 0){
if (node.nodes[last].type !== 'comment') break;
last -= 1;
}
let semicolon = this.raw(node, 'semicolon');
for(let i = 0; i < node.nodes.length; i++){
let child = node.nodes[i];
let before = this.raw(child, 'before');
if (before) this.builder(before);
this.stringify(child, last !== i || semicolon);
}
}
comment(node) {
let left = this.raw(node, 'left', 'commentLeft');
let right = this.raw(node, 'right', 'commentRight');
this.builder('/*' + left + node.text + right + '*/', node);
}
decl(node, semicolon) {
let between = this.raw(node, 'between', 'colon');
let string = node.prop + between + this.rawValue(node, 'value');
if (node.important) {
string += node.raws.important || ' !important';
}
if (semicolon) string += ';';
this.builder(string, node);
}
document(node) {
this.body(node);
}
raw(node, own, detect) {
let value;
if (!detect) detect = own;
// Already had
if (own) {
value = node.raws[own];
if (typeof value !== 'undefined') return value;
}
let parent = node.parent;
if (detect === 'before') {
// Hack for first rule in CSS
if (!parent || parent.type === 'root' && parent.first === node) {
return '';
}
// `root` nodes in `document` should use only their own raws
if (parent && parent.type === 'document') {
return '';
}
}
// Floating child without parent
if (!parent) return DEFAULT_RAW[detect];
// Detect style by other nodes
let root = node.root();
if (!root.rawCache) root.rawCache = {};
if (typeof root.rawCache[detect] !== 'undefined') {
return root.rawCache[detect];
}
if (detect === 'before' || detect === 'after') {
return this.beforeAfter(node, detect);
} else {
let method = 'raw' + capitalize(detect);
if (this[method]) {
value = this[method](root, node);
} else {
root.walk((i)=>{
value = i.raws[own];
if (typeof value !== 'undefined') return false;
});
}
}
if (typeof value === 'undefined') value = DEFAULT_RAW[detect];
root.rawCache[detect] = value;
return value;
}
rawBeforeClose(root) {
let value;
root.walk((i)=>{
if (i.nodes && i.nodes.length > 0) {
if (typeof i.raws.after !== 'undefined') {
value = i.raws.after;
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '');
}
return false;
}
}
});
if (value) value = value.replace(/\S/g, '');
return value;
}
rawBeforeComment(root, node) {
let value;
root.walkComments((i)=>{
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before;
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '');
}
return false;
}
});
if (typeof value === 'undefined') {
value = this.raw(node, null, 'beforeDecl');
} else if (value) {
value = value.replace(/\S/g, '');
}
return value;
}
rawBeforeDecl(root, node) {
let value;
root.walkDecls((i)=>{
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before;
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '');
}
return false;
}
});
if (typeof value === 'undefined') {
value = this.raw(node, null, 'beforeRule');
} else if (value) {
value = value.replace(/\S/g, '');
}
return value;
}
rawBeforeOpen(root) {
let value;
root.walk((i)=>{
if (i.type !== 'decl') {
value = i.raws.between;
if (typeof value !== 'undefined') return false;
}
});
return value;
}
rawBeforeRule(root) {
let value;
root.walk((i)=>{
if (i.nodes && (i.parent !== root || root.first !== i)) {
if (typeof i.raws.before !== 'undefined') {
value = i.raws.before;
if (value.includes('\n')) {
value = value.replace(/[^\n]+$/, '');
}
return false;
}
}
});
if (value) value = value.replace(/\S/g, '');
return value;
}
rawColon(root) {
let value;
root.walkDecls((i)=>{
if (typeof i.raws.between !== 'undefined') {
value = i.raws.between.replace(/[^\s:]/g, '');
return false;
}
});
return value;
}
rawEmptyBody(root) {
let value;
root.walk((i)=>{
if (i.nodes && i.nodes.length === 0) {
value = i.raws.after;
if (typeof value !== 'undefined') return false;
}
});
return value;
}
rawIndent(root) {
if (root.raws.indent) return root.raws.indent;
let value;
root.walk((i)=>{
let p = i.parent;
if (p && p !== root && p.parent && p.parent === root) {
if (typeof i.raws.before !== 'undefined') {
let parts = i.raws.before.split('\n');
value = parts[parts.length - 1];
value = value.replace(/\S/g, '');
return false;
}
}
});
return value;
}
rawSemicolon(root) {
let value;
root.walk((i)=>{
if (i.nodes && i.nodes.length && i.last.type === 'decl') {
value = i.raws.semicolon;
if (typeof value !== 'undefined') return false;
}
});
return value;
}
rawValue(node, prop) {
let value = node[prop];
let raw = node.raws[prop];
if (raw && raw.value === value) {
return raw.raw;
}
return value;
}
root(node) {
this.body(node);
if (node.raws.after) this.builder(node.raws.after);
}
rule(node) {
this.block(node, this.rawValue(node, 'selector'));
if (node.raws.ownSemicolon) {
this.builder(node.raws.ownSemicolon, node, 'end');
}
}
stringify(node, semicolon) {
/* c8 ignore start */ if (!this[node.type]) {
throw new Error('Unknown AST node type ' + node.type + '. ' + 'Maybe you need to change PostCSS stringifier.');
}
/* c8 ignore stop */ this[node.type](node, semicolon);
}
}
module.exports = Stringifier;
Stringifier.default = Stringifier;
}),
"[project]/node_modules/postcss/lib/stringify.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let Stringifier = __turbopack_context__.r("[project]/node_modules/postcss/lib/stringifier.js [postcss] (ecmascript)");
function stringify(node, builder) {
let str = new Stringifier(builder);
str.stringify(node);
}
module.exports = stringify;
stringify.default = stringify;
}),
"[project]/node_modules/postcss/lib/symbols.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
module.exports.isClean = Symbol('isClean');
module.exports.my = Symbol('my');
}),
"[project]/node_modules/postcss/lib/node.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let CssSyntaxError = __turbopack_context__.r("[project]/node_modules/postcss/lib/css-syntax-error.js [postcss] (ecmascript)");
let Stringifier = __turbopack_context__.r("[project]/node_modules/postcss/lib/stringifier.js [postcss] (ecmascript)");
let stringify = __turbopack_context__.r("[project]/node_modules/postcss/lib/stringify.js [postcss] (ecmascript)");
let { isClean, my } = __turbopack_context__.r("[project]/node_modules/postcss/lib/symbols.js [postcss] (ecmascript)");
function cloneNode(obj, parent) {
let cloned = new obj.constructor();
for(let i in obj){
if (!Object.prototype.hasOwnProperty.call(obj, i)) {
continue;
}
if (i === 'proxyCache') continue;
let value = obj[i];
let type = typeof value;
if (i === 'parent' && type === 'object') {
if (parent) cloned[i] = parent;
} else if (i === 'source') {
cloned[i] = value;
} else if (Array.isArray(value)) {
cloned[i] = value.map((j)=>cloneNode(j, cloned));
} else {
if (type === 'object' && value !== null) value = cloneNode(value);
cloned[i] = value;
}
}
return cloned;
}
function sourceOffset(inputCSS, position) {
// Not all custom syntaxes support `offset` in `source.start` and `source.end`
if (position && typeof position.offset !== 'undefined') {
return position.offset;
}
let column = 1;
let line = 1;
let offset = 0;
for(let i = 0; i < inputCSS.length; i++){
if (line === position.line && column === position.column) {
offset = i;
break;
}
if (inputCSS[i] === '\n') {
column = 1;
line += 1;
} else {
column += 1;
}
}
return offset;
}
class Node {
get proxyOf() {
return this;
}
constructor(defaults = {}){
this.raws = {};
this[isClean] = false;
this[my] = true;
for(let name in defaults){
if (name === 'nodes') {
this.nodes = [];
for (let node of defaults[name]){
if (typeof node.clone === 'function') {
this.append(node.clone());
} else {
this.append(node);
}
}
} else {
this[name] = defaults[name];
}
}
}
addToError(error) {
error.postcssNode = this;
if (error.stack && this.source && /\n\s{4}at /.test(error.stack)) {
let s = this.source;
error.stack = error.stack.replace(/\n\s{4}at /, `$&${s.input.from}:${s.start.line}:${s.start.column}$&`);
}
return error;
}
after(add) {
this.parent.insertAfter(this, add);
return this;
}
assign(overrides = {}) {
for(let name in overrides){
this[name] = overrides[name];
}
return this;
}
before(add) {
this.parent.insertBefore(this, add);
return this;
}
cleanRaws(keepBetween) {
delete this.raws.before;
delete this.raws.after;
if (!keepBetween) delete this.raws.between;
}
clone(overrides = {}) {
let cloned = cloneNode(this);
for(let name in overrides){
cloned[name] = overrides[name];
}
return cloned;
}
cloneAfter(overrides = {}) {
let cloned = this.clone(overrides);
this.parent.insertAfter(this, cloned);
return cloned;
}
cloneBefore(overrides = {}) {
let cloned = this.clone(overrides);
this.parent.insertBefore(this, cloned);
return cloned;
}
error(message, opts = {}) {
if (this.source) {
let { end, start } = this.rangeBy(opts);
return this.source.input.error(message, {
column: start.column,
line: start.line
}, {
column: end.column,
line: end.line
}, opts);
}
return new CssSyntaxError(message);
}
getProxyProcessor() {
return {
get (node, prop) {
if (prop === 'proxyOf') {
return node;
} else if (prop === 'root') {
return ()=>node.root().toProxy();
} else {
return node[prop];
}
},
set (node, prop, value) {
if (node[prop] === value) return true;
node[prop] = value;
if (prop === 'prop' || prop === 'value' || prop === 'name' || prop === 'params' || prop === 'important' || /* c8 ignore next */ prop === 'text') {
node.markDirty();
}
return true;
}
};
}
/* c8 ignore next 3 */ markClean() {
this[isClean] = true;
}
markDirty() {
if (this[isClean]) {
this[isClean] = false;
let next = this;
while(next = next.parent){
next[isClean] = false;
}
}
}
next() {
if (!this.parent) return undefined;
let index = this.parent.index(this);
return this.parent.nodes[index + 1];
}
positionBy(opts = {}) {
let pos = this.source.start;
if (opts.index) {
pos = this.positionInside(opts.index);
} else if (opts.word) {
let inputString = 'document' in this.source.input ? this.source.input.document : this.source.input.css;
let stringRepresentation = inputString.slice(sourceOffset(inputString, this.source.start), sourceOffset(inputString, this.source.end));
let index = stringRepresentation.indexOf(opts.word);
if (index !== -1) pos = this.positionInside(index);
}
return pos;
}
positionInside(index) {
let column = this.source.start.column;
let line = this.source.start.line;
let inputString = 'document' in this.source.input ? this.source.input.document : this.source.input.css;
let offset = sourceOffset(inputString, this.source.start);
let end = offset + index;
for(let i = offset; i < end; i++){
if (inputString[i] === '\n') {
column = 1;
line += 1;
} else {
column += 1;
}
}
return {
column,
line,
offset: end
};
}
prev() {
if (!this.parent) return undefined;
let index = this.parent.index(this);
return this.parent.nodes[index - 1];
}
rangeBy(opts = {}) {
let inputString = 'document' in this.source.input ? this.source.input.document : this.source.input.css;
let start = {
column: this.source.start.column,
line: this.source.start.line,
offset: sourceOffset(inputString, this.source.start)
};
let end = this.source.end ? {
column: this.source.end.column + 1,
line: this.source.end.line,
offset: typeof this.source.end.offset === 'number' ? this.source.end.offset : // the `sourceOffset(... , this.source.end)` returns an inclusive offset.
// So, we add 1 to convert it to exclusive.
sourceOffset(inputString, this.source.end) + 1
} : {
column: start.column + 1,
line: start.line,
offset: start.offset + 1
};
if (opts.word) {
let stringRepresentation = inputString.slice(sourceOffset(inputString, this.source.start), sourceOffset(inputString, this.source.end));
let index = stringRepresentation.indexOf(opts.word);
if (index !== -1) {
start = this.positionInside(index);
end = this.positionInside(index + opts.word.length);
}
} else {
if (opts.start) {
start = {
column: opts.start.column,
line: opts.start.line,
offset: sourceOffset(inputString, opts.start)
};
} else if (opts.index) {
start = this.positionInside(opts.index);
}
if (opts.end) {
end = {
column: opts.end.column,
line: opts.end.line,
offset: sourceOffset(inputString, opts.end)
};
} else if (typeof opts.endIndex === 'number') {
end = this.positionInside(opts.endIndex);
} else if (opts.index) {
end = this.positionInside(opts.index + 1);
}
}
if (end.line < start.line || end.line === start.line && end.column <= start.column) {
end = {
column: start.column + 1,
line: start.line,
offset: start.offset + 1
};
}
return {
end,
start
};
}
raw(prop, defaultType) {
let str = new Stringifier();
return str.raw(this, prop, defaultType);
}
remove() {
if (this.parent) {
this.parent.removeChild(this);
}
this.parent = undefined;
return this;
}
replaceWith(...nodes) {
if (this.parent) {
let bookmark = this;
let foundSelf = false;
for (let node of nodes){
if (node === this) {
foundSelf = true;
} else if (foundSelf) {
this.parent.insertAfter(bookmark, node);
bookmark = node;
} else {
this.parent.insertBefore(bookmark, node);
}
}
if (!foundSelf) {
this.remove();
}
}
return this;
}
root() {
let result = this;
while(result.parent && result.parent.type !== 'document'){
result = result.parent;
}
return result;
}
toJSON(_, inputs) {
let fixed = {};
let emitInputs = inputs == null;
inputs = inputs || new Map();
let inputsNextIndex = 0;
for(let name in this){
if (!Object.prototype.hasOwnProperty.call(this, name)) {
continue;
}
if (name === 'parent' || name === 'proxyCache') continue;
let value = this[name];
if (Array.isArray(value)) {
fixed[name] = value.map((i)=>{
if (typeof i === 'object' && i.toJSON) {
return i.toJSON(null, inputs);
} else {
return i;
}
});
} else if (typeof value === 'object' && value.toJSON) {
fixed[name] = value.toJSON(null, inputs);
} else if (name === 'source') {
if (value == null) continue;
let inputId = inputs.get(value.input);
if (inputId == null) {
inputId = inputsNextIndex;
inputs.set(value.input, inputsNextIndex);
inputsNextIndex++;
}
fixed[name] = {
end: value.end,
inputId,
start: value.start
};
} else {
fixed[name] = value;
}
}
if (emitInputs) {
fixed.inputs = [
...inputs.keys()
].map((input)=>input.toJSON());
}
return fixed;
}
toProxy() {
if (!this.proxyCache) {
this.proxyCache = new Proxy(this, this.getProxyProcessor());
}
return this.proxyCache;
}
toString(stringifier = stringify) {
if (stringifier.stringify) stringifier = stringifier.stringify;
let result = '';
stringifier(this, (i)=>{
result += i;
});
return result;
}
warn(result, text, opts = {}) {
let data = {
node: this
};
for(let i in opts)data[i] = opts[i];
return result.warn(text, data);
}
}
module.exports = Node;
Node.default = Node;
}),
"[project]/node_modules/postcss/lib/comment.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let Node = __turbopack_context__.r("[project]/node_modules/postcss/lib/node.js [postcss] (ecmascript)");
class Comment extends Node {
constructor(defaults){
super(defaults);
this.type = 'comment';
}
}
module.exports = Comment;
Comment.default = Comment;
}),
"[project]/node_modules/postcss/lib/declaration.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let Node = __turbopack_context__.r("[project]/node_modules/postcss/lib/node.js [postcss] (ecmascript)");
class Declaration extends Node {
get variable() {
return this.prop.startsWith('--') || this.prop[0] === '$';
}
constructor(defaults){
if (defaults && typeof defaults.value !== 'undefined' && typeof defaults.value !== 'string') {
defaults = {
...defaults,
value: String(defaults.value)
};
}
super(defaults);
this.type = 'decl';
}
}
module.exports = Declaration;
Declaration.default = Declaration;
}),
"[project]/node_modules/postcss/lib/container.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let Comment = __turbopack_context__.r("[project]/node_modules/postcss/lib/comment.js [postcss] (ecmascript)");
let Declaration = __turbopack_context__.r("[project]/node_modules/postcss/lib/declaration.js [postcss] (ecmascript)");
let Node = __turbopack_context__.r("[project]/node_modules/postcss/lib/node.js [postcss] (ecmascript)");
let { isClean, my } = __turbopack_context__.r("[project]/node_modules/postcss/lib/symbols.js [postcss] (ecmascript)");
let AtRule, parse, Root, Rule;
function cleanSource(nodes) {
return nodes.map((i)=>{
if (i.nodes) i.nodes = cleanSource(i.nodes);
delete i.source;
return i;
});
}
function markTreeDirty(node) {
node[isClean] = false;
if (node.proxyOf.nodes) {
for (let i of node.proxyOf.nodes){
markTreeDirty(i);
}
}
}
class Container extends Node {
get first() {
if (!this.proxyOf.nodes) return undefined;
return this.proxyOf.nodes[0];
}
get last() {
if (!this.proxyOf.nodes) return undefined;
return this.proxyOf.nodes[this.proxyOf.nodes.length - 1];
}
append(...children) {
for (let child of children){
let nodes = this.normalize(child, this.last);
for (let node of nodes)this.proxyOf.nodes.push(node);
}
this.markDirty();
return this;
}
cleanRaws(keepBetween) {
super.cleanRaws(keepBetween);
if (this.nodes) {
for (let node of this.nodes)node.cleanRaws(keepBetween);
}
}
each(callback) {
if (!this.proxyOf.nodes) return undefined;
let iterator = this.getIterator();
let index, result;
while(this.indexes[iterator] < this.proxyOf.nodes.length){
index = this.indexes[iterator];
result = callback(this.proxyOf.nodes[index], index);
if (result === false) break;
this.indexes[iterator] += 1;
}
delete this.indexes[iterator];
return result;
}
every(condition) {
return this.nodes.every(condition);
}
getIterator() {
if (!this.lastEach) this.lastEach = 0;
if (!this.indexes) this.indexes = {};
this.lastEach += 1;
let iterator = this.lastEach;
this.indexes[iterator] = 0;
return iterator;
}
getProxyProcessor() {
return {
get (node, prop) {
if (prop === 'proxyOf') {
return node;
} else if (!node[prop]) {
return node[prop];
} else if (prop === 'each' || typeof prop === 'string' && prop.startsWith('walk')) {
return (...args)=>{
return node[prop](...args.map((i)=>{
if (typeof i === 'function') {
return (child, index)=>i(child.toProxy(), index);
} else {
return i;
}
}));
};
} else if (prop === 'every' || prop === 'some') {
return (cb)=>{
return node[prop]((child, ...other)=>cb(child.toProxy(), ...other));
};
} else if (prop === 'root') {
return ()=>node.root().toProxy();
} else if (prop === 'nodes') {
return node.nodes.map((i)=>i.toProxy());
} else if (prop === 'first' || prop === 'last') {
return node[prop].toProxy();
} else {
return node[prop];
}
},
set (node, prop, value) {
if (node[prop] === value) return true;
node[prop] = value;
if (prop === 'name' || prop === 'params' || prop === 'selector') {
node.markDirty();
}
return true;
}
};
}
index(child) {
if (typeof child === 'number') return child;
if (child.proxyOf) child = child.proxyOf;
return this.proxyOf.nodes.indexOf(child);
}
insertAfter(exist, add) {
let existIndex = this.index(exist);
let nodes = this.normalize(add, this.proxyOf.nodes[existIndex]).reverse();
existIndex = this.index(exist);
for (let node of nodes)this.proxyOf.nodes.splice(existIndex + 1, 0, node);
let index;
for(let id in this.indexes){
index = this.indexes[id];
if (existIndex < index) {
this.indexes[id] = index + nodes.length;
}
}
this.markDirty();
return this;
}
insertBefore(exist, add) {
let existIndex = this.index(exist);
let type = existIndex === 0 ? 'prepend' : false;
let nodes = this.normalize(add, this.proxyOf.nodes[existIndex], type).reverse();
existIndex = this.index(exist);
for (let node of nodes)this.proxyOf.nodes.splice(existIndex, 0, node);
let index;
for(let id in this.indexes){
index = this.indexes[id];
if (existIndex <= index) {
this.indexes[id] = index + nodes.length;
}
}
this.markDirty();
return this;
}
normalize(nodes, sample) {
if (typeof nodes === 'string') {
nodes = cleanSource(parse(nodes).nodes);
} else if (typeof nodes === 'undefined') {
nodes = [];
} else if (Array.isArray(nodes)) {
nodes = nodes.slice(0);
for (let i of nodes){
if (i.parent) i.parent.removeChild(i, 'ignore');
}
} else if (nodes.type === 'root' && this.type !== 'document') {
nodes = nodes.nodes.slice(0);
for (let i of nodes){
if (i.parent) i.parent.removeChild(i, 'ignore');
}
} else if (nodes.type) {
nodes = [
nodes
];
} else if (nodes.prop) {
if (typeof nodes.value === 'undefined') {
throw new Error('Value field is missed in node creation');
} else if (typeof nodes.value !== 'string') {
nodes.value = String(nodes.value);
}
nodes = [
new Declaration(nodes)
];
} else if (nodes.selector || nodes.selectors) {
nodes = [
new Rule(nodes)
];
} else if (nodes.name) {
nodes = [
new AtRule(nodes)
];
} else if (nodes.text) {
nodes = [
new Comment(nodes)
];
} else {
throw new Error('Unknown node type in node creation');
}
let processed = nodes.map((i)=>{
/* c8 ignore next */ if (!i[my]) Container.rebuild(i);
i = i.proxyOf;
if (i.parent) i.parent.removeChild(i);
if (i[isClean]) markTreeDirty(i);
if (!i.raws) i.raws = {};
if (typeof i.raws.before === 'undefined') {
if (sample && typeof sample.raws.before !== 'undefined') {
i.raws.before = sample.raws.before.replace(/\S/g, '');
}
}
i.parent = this.proxyOf;
return i;
});
return processed;
}
prepend(...children) {
children = children.reverse();
for (let child of children){
let nodes = this.normalize(child, this.first, 'prepend').reverse();
for (let node of nodes)this.proxyOf.nodes.unshift(node);
for(let id in this.indexes){
this.indexes[id] = this.indexes[id] + nodes.length;
}
}
this.markDirty();
return this;
}
push(child) {
child.parent = this;
this.proxyOf.nodes.push(child);
return this;
}
removeAll() {
for (let node of this.proxyOf.nodes)node.parent = undefined;
this.proxyOf.nodes = [];
this.markDirty();
return this;
}
removeChild(child) {
child = this.index(child);
this.proxyOf.nodes[child].parent = undefined;
this.proxyOf.nodes.splice(child, 1);
let index;
for(let id in this.indexes){
index = this.indexes[id];
if (index >= child) {
this.indexes[id] = index - 1;
}
}
this.markDirty();
return this;
}
replaceValues(pattern, opts, callback) {
if (!callback) {
callback = opts;
opts = {};
}
this.walkDecls((decl)=>{
if (opts.props && !opts.props.includes(decl.prop)) return;
if (opts.fast && !decl.value.includes(opts.fast)) return;
decl.value = decl.value.replace(pattern, callback);
});
this.markDirty();
return this;
}
some(condition) {
return this.nodes.some(condition);
}
walk(callback) {
return this.each((child, i)=>{
let result;
try {
result = callback(child, i);
} catch (e) {
throw child.addToError(e);
}
if (result !== false && child.walk) {
result = child.walk(callback);
}
return result;
});
}
walkAtRules(name, callback) {
if (!callback) {
callback = name;
return this.walk((child, i)=>{
if (child.type === 'atrule') {
return callback(child, i);
}
});
}
if (name instanceof RegExp) {
return this.walk((child, i)=>{
if (child.type === 'atrule' && name.test(child.name)) {
return callback(child, i);
}
});
}
return this.walk((child, i)=>{
if (child.type === 'atrule' && child.name === name) {
return callback(child, i);
}
});
}
walkComments(callback) {
return this.walk((child, i)=>{
if (child.type === 'comment') {
return callback(child, i);
}
});
}
walkDecls(prop, callback) {
if (!callback) {
callback = prop;
return this.walk((child, i)=>{
if (child.type === 'decl') {
return callback(child, i);
}
});
}
if (prop instanceof RegExp) {
return this.walk((child, i)=>{
if (child.type === 'decl' && prop.test(child.prop)) {
return callback(child, i);
}
});
}
return this.walk((child, i)=>{
if (child.type === 'decl' && child.prop === prop) {
return callback(child, i);
}
});
}
walkRules(selector, callback) {
if (!callback) {
callback = selector;
return this.walk((child, i)=>{
if (child.type === 'rule') {
return callback(child, i);
}
});
}
if (selector instanceof RegExp) {
return this.walk((child, i)=>{
if (child.type === 'rule' && selector.test(child.selector)) {
return callback(child, i);
}
});
}
return this.walk((child, i)=>{
if (child.type === 'rule' && child.selector === selector) {
return callback(child, i);
}
});
}
}
Container.registerParse = (dependant)=>{
parse = dependant;
};
Container.registerRule = (dependant)=>{
Rule = dependant;
};
Container.registerAtRule = (dependant)=>{
AtRule = dependant;
};
Container.registerRoot = (dependant)=>{
Root = dependant;
};
module.exports = Container;
Container.default = Container;
/* c8 ignore start */ Container.rebuild = (node)=>{
if (node.type === 'atrule') {
Object.setPrototypeOf(node, AtRule.prototype);
} else if (node.type === 'rule') {
Object.setPrototypeOf(node, Rule.prototype);
} else if (node.type === 'decl') {
Object.setPrototypeOf(node, Declaration.prototype);
} else if (node.type === 'comment') {
Object.setPrototypeOf(node, Comment.prototype);
} else if (node.type === 'root') {
Object.setPrototypeOf(node, Root.prototype);
}
node[my] = true;
if (node.nodes) {
node.nodes.forEach((child)=>{
Container.rebuild(child);
});
}
}; /* c8 ignore stop */
}),
"[project]/node_modules/postcss/lib/at-rule.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let Container = __turbopack_context__.r("[project]/node_modules/postcss/lib/container.js [postcss] (ecmascript)");
class AtRule extends Container {
constructor(defaults){
super(defaults);
this.type = 'atrule';
}
append(...children) {
if (!this.proxyOf.nodes) this.nodes = [];
return super.append(...children);
}
prepend(...children) {
if (!this.proxyOf.nodes) this.nodes = [];
return super.prepend(...children);
}
}
module.exports = AtRule;
AtRule.default = AtRule;
Container.registerAtRule(AtRule);
}),
"[project]/node_modules/postcss/lib/document.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let Container = __turbopack_context__.r("[project]/node_modules/postcss/lib/container.js [postcss] (ecmascript)");
let LazyResult, Processor;
class Document extends Container {
constructor(defaults){
// type needs to be passed to super, otherwise child roots won't be normalized correctly
super({
type: 'document',
...defaults
});
if (!this.nodes) {
this.nodes = [];
}
}
toResult(opts = {}) {
let lazy = new LazyResult(new Processor(), this, opts);
return lazy.stringify();
}
}
Document.registerLazyResult = (dependant)=>{
LazyResult = dependant;
};
Document.registerProcessor = (dependant)=>{
Processor = dependant;
};
module.exports = Document;
Document.default = Document;
}),
"[project]/node_modules/nanoid/non-secure/index.cjs [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
// This alphabet uses `A-Za-z0-9_-` symbols.
// The order of characters is optimized for better gzip and brotli compression.
// References to the same file (works both for gzip and brotli):
// `'use`, `andom`, and `rict'`
// References to the brotli default dictionary:
// `-26T`, `1983`, `40px`, `75px`, `bush`, `jack`, `mind`, `very`, and `wolf`
let urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
let customAlphabet = (alphabet, defaultSize = 21)=>{
return (size = defaultSize)=>{
let id = '';
// A compact alternative for `for (var i = 0; i < step; i++)`.
let i = size | 0;
while(i--){
// `| 0` is more compact and faster than `Math.floor()`.
id += alphabet[Math.random() * alphabet.length | 0];
}
return id;
};
};
let nanoid = (size = 21)=>{
let id = '';
// A compact alternative for `for (var i = 0; i < step; i++)`.
let i = size | 0;
while(i--){
// `| 0` is more compact and faster than `Math.floor()`.
id += urlAlphabet[Math.random() * 64 | 0];
}
return id;
};
module.exports = {
nanoid,
customAlphabet
};
}),
"[project]/node_modules/source-map-js/lib/base64.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
/* -*- Mode: js; js-indent-level: 2; -*- */ /*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/ var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');
/**
* Encode an integer in the range of 0 to 63 to a single base 64 digit.
*/ exports.encode = function(number) {
if (0 <= number && number < intToCharMap.length) {
return intToCharMap[number];
}
throw new TypeError("Must be between 0 and 63: " + number);
};
/**
* Decode a single base 64 character code digit to an integer. Returns -1 on
* failure.
*/ exports.decode = function(charCode) {
var bigA = 65; // 'A'
var bigZ = 90; // 'Z'
var littleA = 97; // 'a'
var littleZ = 122; // 'z'
var zero = 48; // '0'
var nine = 57; // '9'
var plus = 43; // '+'
var slash = 47; // '/'
var littleOffset = 26;
var numberOffset = 52;
// 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
if (bigA <= charCode && charCode <= bigZ) {
return charCode - bigA;
}
// 26 - 51: abcdefghijklmnopqrstuvwxyz
if (littleA <= charCode && charCode <= littleZ) {
return charCode - littleA + littleOffset;
}
// 52 - 61: 0123456789
if (zero <= charCode && charCode <= nine) {
return charCode - zero + numberOffset;
}
// 62: +
if (charCode == plus) {
return 62;
}
// 63: /
if (charCode == slash) {
return 63;
}
// Invalid base64 digit.
return -1;
};
}),
"[project]/node_modules/source-map-js/lib/base64-vlq.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
/* -*- Mode: js; js-indent-level: 2; -*- */ /*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*
* Based on the Base 64 VLQ implementation in Closure Compiler:
* https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
*
* Copyright 2011 The Closure Compiler Authors. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/ var base64 = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/base64.js [postcss] (ecmascript)");
// A single base 64 digit can contain 6 bits of data. For the base 64 variable
// length quantities we use in the source map spec, the first bit is the sign,
// the next four bits are the actual value, and the 6th bit is the
// continuation bit. The continuation bit tells us whether there are more
// digits in this value following this digit.
//
// Continuation
// | Sign
// | |
// V V
// 101011
var VLQ_BASE_SHIFT = 5;
// binary: 100000
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
// binary: 011111
var VLQ_BASE_MASK = VLQ_BASE - 1;
// binary: 100000
var VLQ_CONTINUATION_BIT = VLQ_BASE;
/**
* Converts from a two-complement value to a value where the sign bit is
* placed in the least significant bit. For example, as decimals:
* 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
* 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
*/ function toVLQSigned(aValue) {
return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
}
/**
* Converts to a two-complement value from a value where the sign bit is
* placed in the least significant bit. For example, as decimals:
* 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
* 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
*/ function fromVLQSigned(aValue) {
var isNegative = (aValue & 1) === 1;
var shifted = aValue >> 1;
return isNegative ? -shifted : shifted;
}
/**
* Returns the base 64 VLQ encoded value.
*/ exports.encode = function base64VLQ_encode(aValue) {
var encoded = "";
var digit;
var vlq = toVLQSigned(aValue);
do {
digit = vlq & VLQ_BASE_MASK;
vlq >>>= VLQ_BASE_SHIFT;
if (vlq > 0) {
// There are still more digits in this value, so we must make sure the
// continuation bit is marked.
digit |= VLQ_CONTINUATION_BIT;
}
encoded += base64.encode(digit);
}while (vlq > 0)
return encoded;
};
/**
* Decodes the next base 64 VLQ value from the given string and returns the
* value and the rest of the string via the out parameter.
*/ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
var strLen = aStr.length;
var result = 0;
var shift = 0;
var continuation, digit;
do {
if (aIndex >= strLen) {
throw new Error("Expected more digits in base 64 VLQ value.");
}
digit = base64.decode(aStr.charCodeAt(aIndex++));
if (digit === -1) {
throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
}
continuation = !!(digit & VLQ_CONTINUATION_BIT);
digit &= VLQ_BASE_MASK;
result = result + (digit << shift);
shift += VLQ_BASE_SHIFT;
}while (continuation)
aOutParam.value = fromVLQSigned(result);
aOutParam.rest = aIndex;
};
}),
"[project]/node_modules/source-map-js/lib/util.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
/* -*- Mode: js; js-indent-level: 2; -*- */ /*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/ /**
* This is a helper function for getting values from parameter/options
* objects.
*
* @param args The object we are extracting values from
* @param name The name of the property we are getting.
* @param defaultValue An optional value to return if the property is missing
* from the object. If this is not specified and the property is missing, an
* error will be thrown.
*/ function getArg(aArgs, aName, aDefaultValue) {
if (aName in aArgs) {
return aArgs[aName];
} else if (arguments.length === 3) {
return aDefaultValue;
} else {
throw new Error('"' + aName + '" is a required argument.');
}
}
exports.getArg = getArg;
var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
var dataUrlRegexp = /^data:.+\,.+$/;
function urlParse(aUrl) {
var match = aUrl.match(urlRegexp);
if (!match) {
return null;
}
return {
scheme: match[1],
auth: match[2],
host: match[3],
port: match[4],
path: match[5]
};
}
exports.urlParse = urlParse;
function urlGenerate(aParsedUrl) {
var url = '';
if (aParsedUrl.scheme) {
url += aParsedUrl.scheme + ':';
}
url += '//';
if (aParsedUrl.auth) {
url += aParsedUrl.auth + '@';
}
if (aParsedUrl.host) {
url += aParsedUrl.host;
}
if (aParsedUrl.port) {
url += ":" + aParsedUrl.port;
}
if (aParsedUrl.path) {
url += aParsedUrl.path;
}
return url;
}
exports.urlGenerate = urlGenerate;
var MAX_CACHED_INPUTS = 32;
/**
* Takes some function `f(input) -> result` and returns a memoized version of
* `f`.
*
* We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The
* memoization is a dumb-simple, linear least-recently-used cache.
*/ function lruMemoize(f) {
var cache = [];
return function(input) {
for(var i = 0; i < cache.length; i++){
if (cache[i].input === input) {
var temp = cache[0];
cache[0] = cache[i];
cache[i] = temp;
return cache[0].result;
}
}
var result = f(input);
cache.unshift({
input,
result
});
if (cache.length > MAX_CACHED_INPUTS) {
cache.pop();
}
return result;
};
}
/**
* Normalizes a path, or the path portion of a URL:
*
* - Replaces consecutive slashes with one slash.
* - Removes unnecessary '.' parts.
* - Removes unnecessary '<dir>/..' parts.
*
* Based on code in the Node.js 'path' core module.
*
* @param aPath The path or url to normalize.
*/ var normalize = lruMemoize(function normalize(aPath) {
var path = aPath;
var url = urlParse(aPath);
if (url) {
if (!url.path) {
return aPath;
}
path = url.path;
}
var isAbsolute = exports.isAbsolute(path);
// Split the path into parts between `/` characters. This is much faster than
// using `.split(/\/+/g)`.
var parts = [];
var start = 0;
var i = 0;
while(true){
start = i;
i = path.indexOf("/", start);
if (i === -1) {
parts.push(path.slice(start));
break;
} else {
parts.push(path.slice(start, i));
while(i < path.length && path[i] === "/"){
i++;
}
}
}
for(var part, up = 0, i = parts.length - 1; i >= 0; i--){
part = parts[i];
if (part === '.') {
parts.splice(i, 1);
} else if (part === '..') {
up++;
} else if (up > 0) {
if (part === '') {
// The first part is blank if the path is absolute. Trying to go
// above the root is a no-op. Therefore we can remove all '..' parts
// directly after the root.
parts.splice(i + 1, up);
up = 0;
} else {
parts.splice(i, 2);
up--;
}
}
}
path = parts.join('/');
if (path === '') {
path = isAbsolute ? '/' : '.';
}
if (url) {
url.path = path;
return urlGenerate(url);
}
return path;
});
exports.normalize = normalize;
/**
* Joins two paths/URLs.
*
* @param aRoot The root path or URL.
* @param aPath The path or URL to be joined with the root.
*
* - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
* scheme-relative URL: Then the scheme of aRoot, if any, is prepended
* first.
* - Otherwise aPath is a path. If aRoot is a URL, then its path portion
* is updated with the result and aRoot is returned. Otherwise the result
* is returned.
* - If aPath is absolute, the result is aPath.
* - Otherwise the two paths are joined with a slash.
* - Joining for example 'http://' and 'www.example.com' is also supported.
*/ function join(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
if (aPath === "") {
aPath = ".";
}
var aPathUrl = urlParse(aPath);
var aRootUrl = urlParse(aRoot);
if (aRootUrl) {
aRoot = aRootUrl.path || '/';
}
// `join(foo, '//www.example.org')`
if (aPathUrl && !aPathUrl.scheme) {
if (aRootUrl) {
aPathUrl.scheme = aRootUrl.scheme;
}
return urlGenerate(aPathUrl);
}
if (aPathUrl || aPath.match(dataUrlRegexp)) {
return aPath;
}
// `join('http://', 'www.example.com')`
if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
aRootUrl.host = aPath;
return urlGenerate(aRootUrl);
}
var joined = aPath.charAt(0) === '/' ? aPath : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
if (aRootUrl) {
aRootUrl.path = joined;
return urlGenerate(aRootUrl);
}
return joined;
}
exports.join = join;
exports.isAbsolute = function(aPath) {
return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
};
/**
* Make a path relative to a URL or another path.
*
* @param aRoot The root path or URL.
* @param aPath The path or URL to be made relative to aRoot.
*/ function relative(aRoot, aPath) {
if (aRoot === "") {
aRoot = ".";
}
aRoot = aRoot.replace(/\/$/, '');
// It is possible for the path to be above the root. In this case, simply
// checking whether the root is a prefix of the path won't work. Instead, we
// need to remove components from the root one by one, until either we find
// a prefix that fits, or we run out of components to remove.
var level = 0;
while(aPath.indexOf(aRoot + '/') !== 0){
var index = aRoot.lastIndexOf("/");
if (index < 0) {
return aPath;
}
// If the only part of the root that is left is the scheme (i.e. http://,
// file:///, etc.), one or more slashes (/), or simply nothing at all, we
// have exhausted all components, so the path is not relative to the root.
aRoot = aRoot.slice(0, index);
if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
return aPath;
}
++level;
}
// Make sure we add a "../" for each component we removed from the root.
return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
}
exports.relative = relative;
var supportsNullProto = function() {
var obj = Object.create(null);
return !('__proto__' in obj);
}();
function identity(s) {
return s;
}
/**
* Because behavior goes wacky when you set `__proto__` on objects, we
* have to prefix all the strings in our set with an arbitrary character.
*
* See https://github.com/mozilla/source-map/pull/31 and
* https://github.com/mozilla/source-map/issues/30
*
* @param String aStr
*/ function toSetString(aStr) {
if (isProtoString(aStr)) {
return '$' + aStr;
}
return aStr;
}
exports.toSetString = supportsNullProto ? identity : toSetString;
function fromSetString(aStr) {
if (isProtoString(aStr)) {
return aStr.slice(1);
}
return aStr;
}
exports.fromSetString = supportsNullProto ? identity : fromSetString;
function isProtoString(s) {
if (!s) {
return false;
}
var length = s.length;
if (length < 9 /* "__proto__".length */ ) {
return false;
}
if (s.charCodeAt(length - 1) !== 95 /* '_' */ || s.charCodeAt(length - 2) !== 95 /* '_' */ || s.charCodeAt(length - 3) !== 111 /* 'o' */ || s.charCodeAt(length - 4) !== 116 /* 't' */ || s.charCodeAt(length - 5) !== 111 /* 'o' */ || s.charCodeAt(length - 6) !== 114 /* 'r' */ || s.charCodeAt(length - 7) !== 112 /* 'p' */ || s.charCodeAt(length - 8) !== 95 /* '_' */ || s.charCodeAt(length - 9) !== 95 /* '_' */ ) {
return false;
}
for(var i = length - 10; i >= 0; i--){
if (s.charCodeAt(i) !== 36 /* '$' */ ) {
return false;
}
}
return true;
}
/**
* Comparator between two mappings where the original positions are compared.
*
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
* mappings with the same original source/line/column, but different generated
* line and column the same. Useful when searching for a mapping with a
* stubbed out mapping.
*/ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
var cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0 || onlyCompareOriginal) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByOriginalPositions = compareByOriginalPositions;
function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {
var cmp;
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0 || onlyCompareOriginal) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;
/**
* Comparator between two mappings with deflated source and name indices where
* the generated positions are compared.
*
* Optionally pass in `true` as `onlyCompareGenerated` to consider two
* mappings with the same generated line and column, but different
* source/name/original line and column the same. Useful when searching for a
* mapping with a stubbed out mapping.
*/ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0 || onlyCompareGenerated) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {
var cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0 || onlyCompareGenerated) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;
function strcmp(aStr1, aStr2) {
if (aStr1 === aStr2) {
return 0;
}
if (aStr1 === null) {
return 1; // aStr2 !== null
}
if (aStr2 === null) {
return -1; // aStr1 !== null
}
if (aStr1 > aStr2) {
return 1;
}
return -1;
}
/**
* Comparator between two mappings with inflated source and name strings where
* the generated positions are compared.
*/ function compareByGeneratedPositionsInflated(mappingA, mappingB) {
var cmp = mappingA.generatedLine - mappingB.generatedLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.generatedColumn - mappingB.generatedColumn;
if (cmp !== 0) {
return cmp;
}
cmp = strcmp(mappingA.source, mappingB.source);
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalLine - mappingB.originalLine;
if (cmp !== 0) {
return cmp;
}
cmp = mappingA.originalColumn - mappingB.originalColumn;
if (cmp !== 0) {
return cmp;
}
return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
/**
* Strip any JSON XSSI avoidance prefix from the string (as documented
* in the source maps specification), and then parse the string as
* JSON.
*/ function parseSourceMapInput(str) {
return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
}
exports.parseSourceMapInput = parseSourceMapInput;
/**
* Compute the URL of a source given the the source root, the source's
* URL, and the source map's URL.
*/ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
sourceURL = sourceURL || '';
if (sourceRoot) {
// This follows what Chrome does.
if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
sourceRoot += '/';
}
// The spec says:
// Line 4: An optional source root, useful for relocating source
// files on a server or removing repeated values in the
// “sources” entry. This value is prepended to the individual
// entries in the “source” field.
sourceURL = sourceRoot + sourceURL;
}
// Historically, SourceMapConsumer did not take the sourceMapURL as
// a parameter. This mode is still somewhat supported, which is why
// this code block is conditional. However, it's preferable to pass
// the source map URL to SourceMapConsumer, so that this function
// can implement the source URL resolution algorithm as outlined in
// the spec. This block is basically the equivalent of:
// new URL(sourceURL, sourceMapURL).toString()
// ... except it avoids using URL, which wasn't available in the
// older releases of node still supported by this library.
//
// The spec says:
// If the sources are not absolute URLs after prepending of the
// “sourceRoot”, the sources are resolved relative to the
// SourceMap (like resolving script src in a html document).
if (sourceMapURL) {
var parsed = urlParse(sourceMapURL);
if (!parsed) {
throw new Error("sourceMapURL could not be parsed");
}
if (parsed.path) {
// Strip the last path component, but keep the "/".
var index = parsed.path.lastIndexOf('/');
if (index >= 0) {
parsed.path = parsed.path.substring(0, index + 1);
}
}
sourceURL = join(urlGenerate(parsed), sourceURL);
}
return normalize(sourceURL);
}
exports.computeSourceURL = computeSourceURL;
}),
"[project]/node_modules/source-map-js/lib/array-set.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
/* -*- Mode: js; js-indent-level: 2; -*- */ /*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/ var util = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/util.js [postcss] (ecmascript)");
var has = Object.prototype.hasOwnProperty;
var hasNativeMap = typeof Map !== "undefined";
/**
* A data structure which is a combination of an array and a set. Adding a new
* member is O(1), testing for membership is O(1), and finding the index of an
* element is O(1). Removing elements from the set is not supported. Only
* strings are supported for membership.
*/ function ArraySet() {
this._array = [];
this._set = hasNativeMap ? new Map() : Object.create(null);
}
/**
* Static method for creating ArraySet instances from an existing array.
*/ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
var set = new ArraySet();
for(var i = 0, len = aArray.length; i < len; i++){
set.add(aArray[i], aAllowDuplicates);
}
return set;
};
/**
* Return how many unique items are in this ArraySet. If duplicates have been
* added, than those do not count towards the size.
*
* @returns Number
*/ ArraySet.prototype.size = function ArraySet_size() {
return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
};
/**
* Add the given string to this set.
*
* @param String aStr
*/ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
var idx = this._array.length;
if (!isDuplicate || aAllowDuplicates) {
this._array.push(aStr);
}
if (!isDuplicate) {
if (hasNativeMap) {
this._set.set(aStr, idx);
} else {
this._set[sStr] = idx;
}
}
};
/**
* Is the given string a member of this set?
*
* @param String aStr
*/ ArraySet.prototype.has = function ArraySet_has(aStr) {
if (hasNativeMap) {
return this._set.has(aStr);
} else {
var sStr = util.toSetString(aStr);
return has.call(this._set, sStr);
}
};
/**
* What is the index of the given string in the array?
*
* @param String aStr
*/ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
if (hasNativeMap) {
var idx = this._set.get(aStr);
if (idx >= 0) {
return idx;
}
} else {
var sStr = util.toSetString(aStr);
if (has.call(this._set, sStr)) {
return this._set[sStr];
}
}
throw new Error('"' + aStr + '" is not in the set.');
};
/**
* What is the element at the given index?
*
* @param Number aIdx
*/ ArraySet.prototype.at = function ArraySet_at(aIdx) {
if (aIdx >= 0 && aIdx < this._array.length) {
return this._array[aIdx];
}
throw new Error('No element indexed by ' + aIdx);
};
/**
* Returns the array representation of this set (which has the proper indices
* indicated by indexOf). Note that this is a copy of the internal array used
* for storing the members so that no one can mess with internal state.
*/ ArraySet.prototype.toArray = function ArraySet_toArray() {
return this._array.slice();
};
exports.ArraySet = ArraySet;
}),
"[project]/node_modules/source-map-js/lib/mapping-list.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
/* -*- Mode: js; js-indent-level: 2; -*- */ /*
* Copyright 2014 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/ var util = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/util.js [postcss] (ecmascript)");
/**
* Determine whether mappingB is after mappingA with respect to generated
* position.
*/ function generatedPositionAfter(mappingA, mappingB) {
// Optimized for most common case
var lineA = mappingA.generatedLine;
var lineB = mappingB.generatedLine;
var columnA = mappingA.generatedColumn;
var columnB = mappingB.generatedColumn;
return lineB > lineA || lineB == lineA && columnB >= columnA || util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
}
/**
* A data structure to provide a sorted view of accumulated mappings in a
* performance conscious manner. It trades a neglibable overhead in general
* case for a large speedup in case of mappings being added in order.
*/ function MappingList() {
this._array = [];
this._sorted = true;
// Serves as infimum
this._last = {
generatedLine: -1,
generatedColumn: 0
};
}
/**
* Iterate through internal items. This method takes the same arguments that
* `Array.prototype.forEach` takes.
*
* NOTE: The order of the mappings is NOT guaranteed.
*/ MappingList.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
this._array.forEach(aCallback, aThisArg);
};
/**
* Add the given source mapping.
*
* @param Object aMapping
*/ MappingList.prototype.add = function MappingList_add(aMapping) {
if (generatedPositionAfter(this._last, aMapping)) {
this._last = aMapping;
this._array.push(aMapping);
} else {
this._sorted = false;
this._array.push(aMapping);
}
};
/**
* Returns the flat, sorted array of mappings. The mappings are sorted by
* generated position.
*
* WARNING: This method returns internal data without copying, for
* performance. The return value must NOT be mutated, and should be treated as
* an immutable borrow. If you want to take ownership, you must make your own
* copy.
*/ MappingList.prototype.toArray = function MappingList_toArray() {
if (!this._sorted) {
this._array.sort(util.compareByGeneratedPositionsInflated);
this._sorted = true;
}
return this._array;
};
exports.MappingList = MappingList;
}),
"[project]/node_modules/source-map-js/lib/source-map-generator.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
/* -*- Mode: js; js-indent-level: 2; -*- */ /*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/ var base64VLQ = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/base64-vlq.js [postcss] (ecmascript)");
var util = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/util.js [postcss] (ecmascript)");
var ArraySet = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/array-set.js [postcss] (ecmascript)").ArraySet;
var MappingList = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/mapping-list.js [postcss] (ecmascript)").MappingList;
/**
* An instance of the SourceMapGenerator represents a source map which is
* being built incrementally. You may pass an object with the following
* properties:
*
* - file: The filename of the generated source.
* - sourceRoot: A root for all relative URLs in this source map.
*/ function SourceMapGenerator(aArgs) {
if (!aArgs) {
aArgs = {};
}
this._file = util.getArg(aArgs, 'file', null);
this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
this._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', false);
this._sources = new ArraySet();
this._names = new ArraySet();
this._mappings = new MappingList();
this._sourcesContents = null;
}
SourceMapGenerator.prototype._version = 3;
/**
* Creates a new SourceMapGenerator based on a SourceMapConsumer
*
* @param aSourceMapConsumer The SourceMap.
*/ SourceMapGenerator.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) {
var sourceRoot = aSourceMapConsumer.sourceRoot;
var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, {
file: aSourceMapConsumer.file,
sourceRoot: sourceRoot
}));
aSourceMapConsumer.eachMapping(function(mapping) {
var newMapping = {
generated: {
line: mapping.generatedLine,
column: mapping.generatedColumn
}
};
if (mapping.source != null) {
newMapping.source = mapping.source;
if (sourceRoot != null) {
newMapping.source = util.relative(sourceRoot, newMapping.source);
}
newMapping.original = {
line: mapping.originalLine,
column: mapping.originalColumn
};
if (mapping.name != null) {
newMapping.name = mapping.name;
}
}
generator.addMapping(newMapping);
});
aSourceMapConsumer.sources.forEach(function(sourceFile) {
var sourceRelative = sourceFile;
if (sourceRoot !== null) {
sourceRelative = util.relative(sourceRoot, sourceFile);
}
if (!generator._sources.has(sourceRelative)) {
generator._sources.add(sourceRelative);
}
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content != null) {
generator.setSourceContent(sourceFile, content);
}
});
return generator;
};
/**
* Add a single mapping from original source line and column to the generated
* source's line and column for this source map being created. The mapping
* object should have the following properties:
*
* - generated: An object with the generated line and column positions.
* - original: An object with the original line and column positions.
* - source: The original source file (relative to the sourceRoot).
* - name: An optional original token name for this mapping.
*/ SourceMapGenerator.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
var generated = util.getArg(aArgs, 'generated');
var original = util.getArg(aArgs, 'original', null);
var source = util.getArg(aArgs, 'source', null);
var name = util.getArg(aArgs, 'name', null);
if (!this._skipValidation) {
if (this._validateMapping(generated, original, source, name) === false) {
return;
}
}
if (source != null) {
source = String(source);
if (!this._sources.has(source)) {
this._sources.add(source);
}
}
if (name != null) {
name = String(name);
if (!this._names.has(name)) {
this._names.add(name);
}
}
this._mappings.add({
generatedLine: generated.line,
generatedColumn: generated.column,
originalLine: original != null && original.line,
originalColumn: original != null && original.column,
source: source,
name: name
});
};
/**
* Set the source content for a source file.
*/ SourceMapGenerator.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
var source = aSourceFile;
if (this._sourceRoot != null) {
source = util.relative(this._sourceRoot, source);
}
if (aSourceContent != null) {
// Add the source content to the _sourcesContents map.
// Create a new _sourcesContents map if the property is null.
if (!this._sourcesContents) {
this._sourcesContents = Object.create(null);
}
this._sourcesContents[util.toSetString(source)] = aSourceContent;
} else if (this._sourcesContents) {
// Remove the source file from the _sourcesContents map.
// If the _sourcesContents map is empty, set the property to null.
delete this._sourcesContents[util.toSetString(source)];
if (Object.keys(this._sourcesContents).length === 0) {
this._sourcesContents = null;
}
}
};
/**
* Applies the mappings of a sub-source-map for a specific source file to the
* source map being generated. Each mapping to the supplied source file is
* rewritten using the supplied source map. Note: The resolution for the
* resulting mappings is the minimium of this map and the supplied map.
*
* @param aSourceMapConsumer The source map to be applied.
* @param aSourceFile Optional. The filename of the source file.
* If omitted, SourceMapConsumer's file property will be used.
* @param aSourceMapPath Optional. The dirname of the path to the source map
* to be applied. If relative, it is relative to the SourceMapConsumer.
* This parameter is needed when the two source maps aren't in the same
* directory, and the source map to be applied contains relative source
* paths. If so, those relative source paths need to be rewritten
* relative to the SourceMapGenerator.
*/ SourceMapGenerator.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
var sourceFile = aSourceFile;
// If aSourceFile is omitted, we will use the file property of the SourceMap
if (aSourceFile == null) {
if (aSourceMapConsumer.file == null) {
throw new Error('SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + 'or the source map\'s "file" property. Both were omitted.');
}
sourceFile = aSourceMapConsumer.file;
}
var sourceRoot = this._sourceRoot;
// Make "sourceFile" relative if an absolute Url is passed.
if (sourceRoot != null) {
sourceFile = util.relative(sourceRoot, sourceFile);
}
// Applying the SourceMap can add and remove items from the sources and
// the names array.
var newSources = new ArraySet();
var newNames = new ArraySet();
// Find mappings for the "sourceFile"
this._mappings.unsortedForEach(function(mapping) {
if (mapping.source === sourceFile && mapping.originalLine != null) {
// Check if it can be mapped by the source map, then update the mapping.
var original = aSourceMapConsumer.originalPositionFor({
line: mapping.originalLine,
column: mapping.originalColumn
});
if (original.source != null) {
// Copy mapping
mapping.source = original.source;
if (aSourceMapPath != null) {
mapping.source = util.join(aSourceMapPath, mapping.source);
}
if (sourceRoot != null) {
mapping.source = util.relative(sourceRoot, mapping.source);
}
mapping.originalLine = original.line;
mapping.originalColumn = original.column;
if (original.name != null) {
mapping.name = original.name;
}
}
}
var source = mapping.source;
if (source != null && !newSources.has(source)) {
newSources.add(source);
}
var name = mapping.name;
if (name != null && !newNames.has(name)) {
newNames.add(name);
}
}, this);
this._sources = newSources;
this._names = newNames;
// Copy sourcesContents of applied map.
aSourceMapConsumer.sources.forEach(function(sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content != null) {
if (aSourceMapPath != null) {
sourceFile = util.join(aSourceMapPath, sourceFile);
}
if (sourceRoot != null) {
sourceFile = util.relative(sourceRoot, sourceFile);
}
this.setSourceContent(sourceFile, content);
}
}, this);
};
/**
* A mapping can have one of the three levels of data:
*
* 1. Just the generated position.
* 2. The Generated position, original position, and original source.
* 3. Generated and original position, original source, as well as a name
* token.
*
* To maintain consistency, we validate that any new mapping being added falls
* in to one of these categories.
*/ SourceMapGenerator.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
// When aOriginal is truthy but has empty values for .line and .column,
// it is most likely a programmer error. In this case we throw a very
// specific error message to try to guide them the right way.
// For example: https://github.com/Polymer/polymer-bundler/pull/519
if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
var message = '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 (this._ignoreInvalidMapping) {
if (typeof console !== 'undefined' && console.warn) {
console.warn(message);
}
return false;
} else {
throw new Error(message);
}
}
if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) {
// Case 1.
return;
} else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated && aOriginal && 'line' in aOriginal && 'column' in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) {
// Cases 2 and 3.
return;
} else {
var message = 'Invalid mapping: ' + JSON.stringify({
generated: aGenerated,
source: aSource,
original: aOriginal,
name: aName
});
if (this._ignoreInvalidMapping) {
if (typeof console !== 'undefined' && console.warn) {
console.warn(message);
}
return false;
} else {
throw new Error(message);
}
}
};
/**
* Serialize the accumulated mappings in to the stream of base 64 VLQs
* specified by the source map format.
*/ SourceMapGenerator.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
var previousGeneratedColumn = 0;
var previousGeneratedLine = 1;
var previousOriginalColumn = 0;
var previousOriginalLine = 0;
var previousName = 0;
var previousSource = 0;
var result = '';
var next;
var mapping;
var nameIdx;
var sourceIdx;
var mappings = this._mappings.toArray();
for(var i = 0, len = mappings.length; i < len; i++){
mapping = mappings[i];
next = '';
if (mapping.generatedLine !== previousGeneratedLine) {
previousGeneratedColumn = 0;
while(mapping.generatedLine !== previousGeneratedLine){
next += ';';
previousGeneratedLine++;
}
} else {
if (i > 0) {
if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
continue;
}
next += ',';
}
}
next += base64VLQ.encode(mapping.generatedColumn - previousGeneratedColumn);
previousGeneratedColumn = mapping.generatedColumn;
if (mapping.source != null) {
sourceIdx = this._sources.indexOf(mapping.source);
next += base64VLQ.encode(sourceIdx - previousSource);
previousSource = sourceIdx;
// lines are stored 0-based in SourceMap spec version 3
next += base64VLQ.encode(mapping.originalLine - 1 - previousOriginalLine);
previousOriginalLine = mapping.originalLine - 1;
next += base64VLQ.encode(mapping.originalColumn - previousOriginalColumn);
previousOriginalColumn = mapping.originalColumn;
if (mapping.name != null) {
nameIdx = this._names.indexOf(mapping.name);
next += base64VLQ.encode(nameIdx - previousName);
previousName = nameIdx;
}
}
result += next;
}
return result;
};
SourceMapGenerator.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
return aSources.map(function(source) {
if (!this._sourcesContents) {
return null;
}
if (aSourceRoot != null) {
source = util.relative(aSourceRoot, source);
}
var key = util.toSetString(source);
return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
}, this);
};
/**
* Externalize the source map.
*/ SourceMapGenerator.prototype.toJSON = function SourceMapGenerator_toJSON() {
var map = {
version: this._version,
sources: this._sources.toArray(),
names: this._names.toArray(),
mappings: this._serializeMappings()
};
if (this._file != null) {
map.file = this._file;
}
if (this._sourceRoot != null) {
map.sourceRoot = this._sourceRoot;
}
if (this._sourcesContents) {
map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
}
return map;
};
/**
* Render the source map being generated to a string.
*/ SourceMapGenerator.prototype.toString = function SourceMapGenerator_toString() {
return JSON.stringify(this.toJSON());
};
exports.SourceMapGenerator = SourceMapGenerator;
}),
"[project]/node_modules/source-map-js/lib/binary-search.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
/* -*- Mode: js; js-indent-level: 2; -*- */ /*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/ exports.GREATEST_LOWER_BOUND = 1;
exports.LEAST_UPPER_BOUND = 2;
/**
* Recursive implementation of binary search.
*
* @param aLow Indices here and lower do not contain the needle.
* @param aHigh Indices here and higher do not contain the needle.
* @param aNeedle The element being searched for.
* @param aHaystack The non-empty array being searched.
* @param aCompare Function which takes two elements and returns -1, 0, or 1.
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
* closest element that is smaller than or greater than the one we are
* searching for, respectively, if the exact element cannot be found.
*/ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
// This function terminates when one of the following is true:
//
// 1. We find the exact element we are looking for.
//
// 2. We did not find the exact element, but we can return the index of
// the next-closest element.
//
// 3. We did not find the exact element, and there is no next-closest
// element than the one we are searching for, so we return -1.
var mid = Math.floor((aHigh - aLow) / 2) + aLow;
var cmp = aCompare(aNeedle, aHaystack[mid], true);
if (cmp === 0) {
// Found the element we are looking for.
return mid;
} else if (cmp > 0) {
// Our needle is greater than aHaystack[mid].
if (aHigh - mid > 1) {
// The element is in the upper half.
return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
}
// The exact needle element was not found in this haystack. Determine if
// we are in termination case (3) or (2) and return the appropriate thing.
if (aBias == exports.LEAST_UPPER_BOUND) {
return aHigh < aHaystack.length ? aHigh : -1;
} else {
return mid;
}
} else {
// Our needle is less than aHaystack[mid].
if (mid - aLow > 1) {
// The element is in the lower half.
return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
}
// we are in termination case (3) or (2) and return the appropriate thing.
if (aBias == exports.LEAST_UPPER_BOUND) {
return mid;
} else {
return aLow < 0 ? -1 : aLow;
}
}
}
/**
* This is an implementation of binary search which will always try and return
* the index of the closest element if there is no exact hit. This is because
* mappings between original and generated line/col pairs are single points,
* and there is an implicit region between each of them, so a miss just means
* that you aren't on the very start of a region.
*
* @param aNeedle The element you are looking for.
* @param aHaystack The array that is being searched.
* @param aCompare A function which takes the needle and an element in the
* array and returns -1, 0, or 1 depending on whether the needle is less
* than, equal to, or greater than the element, respectively.
* @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
* 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
* closest element that is smaller than or greater than the one we are
* searching for, respectively, if the exact element cannot be found.
* Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
*/ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
if (aHaystack.length === 0) {
return -1;
}
var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND);
if (index < 0) {
return -1;
}
// We have found either the exact element, or the next-closest element than
// the one we are searching for. However, there may be more than one such
// element. Make sure we always return the smallest of these.
while(index - 1 >= 0){
if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
break;
}
--index;
}
return index;
};
}),
"[project]/node_modules/source-map-js/lib/quick-sort.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
/* -*- Mode: js; js-indent-level: 2; -*- */ /*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/ // It turns out that some (most?) JavaScript engines don't self-host
// `Array.prototype.sort`. This makes sense because C++ will likely remain
// faster than JS when doing raw CPU-intensive sorting. However, when using a
// custom comparator function, calling back and forth between the VM's C++ and
// JIT'd JS is rather slow *and* loses JIT type information, resulting in
// worse generated code for the comparator function than would be optimal. In
// fact, when sorting with a comparator, these costs outweigh the benefits of
// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
// a ~3500ms mean speed-up in `bench/bench.html`.
function SortTemplate(comparator) {
/**
* Swap the elements indexed by `x` and `y` in the array `ary`.
*
* @param {Array} ary
* The array.
* @param {Number} x
* The index of the first item.
* @param {Number} y
* The index of the second item.
*/ function swap(ary, x, y) {
var temp = ary[x];
ary[x] = ary[y];
ary[y] = temp;
}
/**
* Returns a random integer within the range `low .. high` inclusive.
*
* @param {Number} low
* The lower bound on the range.
* @param {Number} high
* The upper bound on the range.
*/ function randomIntInRange(low, high) {
return Math.round(low + Math.random() * (high - low));
}
/**
* The Quick Sort algorithm.
*
* @param {Array} ary
* An array to sort.
* @param {function} comparator
* Function to use to compare two items.
* @param {Number} p
* Start index of the array
* @param {Number} r
* End index of the array
*/ function doQuickSort(ary, comparator, p, r) {
// If our lower bound is less than our upper bound, we (1) partition the
// array into two pieces and (2) recurse on each half. If it is not, this is
// the empty array and our base case.
if (p < r) {
// (1) Partitioning.
//
// The partitioning chooses a pivot between `p` and `r` and moves all
// elements that are less than or equal to the pivot to the before it, and
// all the elements that are greater than it after it. The effect is that
// once partition is done, the pivot is in the exact place it will be when
// the array is put in sorted order, and it will not need to be moved
// again. This runs in O(n) time.
// Always choose a random pivot so that an input array which is reverse
// sorted does not cause O(n^2) running time.
var pivotIndex = randomIntInRange(p, r);
var i = p - 1;
swap(ary, pivotIndex, r);
var pivot = ary[r];
// Immediately after `j` is incremented in this loop, the following hold
// true:
//
// * Every element in `ary[p .. i]` is less than or equal to the pivot.
//
// * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
for(var j = p; j < r; j++){
if (comparator(ary[j], pivot, false) <= 0) {
i += 1;
swap(ary, i, j);
}
}
swap(ary, i + 1, j);
var q = i + 1;
// (2) Recurse on each half.
doQuickSort(ary, comparator, p, q - 1);
doQuickSort(ary, comparator, q + 1, r);
}
}
return doQuickSort;
}
function cloneSort(comparator) {
let template = SortTemplate.toString();
let templateFn = new Function(`return ${template}`)();
return templateFn(comparator);
}
/**
* Sort the given array in-place with the given comparator function.
*
* @param {Array} ary
* An array to sort.
* @param {function} comparator
* Function to use to compare two items.
*/ let sortCache = new WeakMap();
exports.quickSort = function(ary, comparator, start = 0) {
let doQuickSort = sortCache.get(comparator);
if (doQuickSort === void 0) {
doQuickSort = cloneSort(comparator);
sortCache.set(comparator, doQuickSort);
}
doQuickSort(ary, comparator, start, ary.length - 1);
};
}),
"[project]/node_modules/source-map-js/lib/source-map-consumer.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
/* -*- Mode: js; js-indent-level: 2; -*- */ /*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/ var util = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/util.js [postcss] (ecmascript)");
var binarySearch = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/binary-search.js [postcss] (ecmascript)");
var ArraySet = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/array-set.js [postcss] (ecmascript)").ArraySet;
var base64VLQ = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/base64-vlq.js [postcss] (ecmascript)");
var quickSort = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/quick-sort.js [postcss] (ecmascript)").quickSort;
function SourceMapConsumer(aSourceMap, aSourceMapURL) {
var sourceMap = aSourceMap;
if (typeof aSourceMap === 'string') {
sourceMap = util.parseSourceMapInput(aSourceMap);
}
return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
}
SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
};
/**
* The version of the source mapping spec that we are consuming.
*/ SourceMapConsumer.prototype._version = 3;
// `__generatedMappings` and `__originalMappings` are arrays that hold the
// parsed mapping coordinates from the source map's "mappings" attribute. They
// are lazily instantiated, accessed via the `_generatedMappings` and
// `_originalMappings` getters respectively, and we only parse the mappings
// and create these arrays once queried for a source location. We jump through
// these hoops because there can be many thousands of mappings, and parsing
// them is expensive, so we only want to do it if we must.
//
// Each object in the arrays is of the form:
//
// {
// generatedLine: The line number in the generated code,
// generatedColumn: The column number in the generated code,
// source: The path to the original source file that generated this
// chunk of code,
// originalLine: The line number in the original source that
// corresponds to this chunk of generated code,
// originalColumn: The column number in the original source that
// corresponds to this chunk of generated code,
// name: The name of the original symbol which generated this chunk of
// code.
// }
//
// All properties except for `generatedLine` and `generatedColumn` can be
// `null`.
//
// `_generatedMappings` is ordered by the generated positions.
//
// `_originalMappings` is ordered by the original positions.
SourceMapConsumer.prototype.__generatedMappings = null;
Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
configurable: true,
enumerable: true,
get: function() {
if (!this.__generatedMappings) {
this._parseMappings(this._mappings, this.sourceRoot);
}
return this.__generatedMappings;
}
});
SourceMapConsumer.prototype.__originalMappings = null;
Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
configurable: true,
enumerable: true,
get: function() {
if (!this.__originalMappings) {
this._parseMappings(this._mappings, this.sourceRoot);
}
return this.__originalMappings;
}
});
SourceMapConsumer.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
var c = aStr.charAt(index);
return c === ";" || c === ",";
};
/**
* Parse the mappings in a string in to a data structure which we can easily
* query (the ordered arrays in the `this.__generatedMappings` and
* `this.__originalMappings` properties).
*/ SourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
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;
/**
* Iterate over each mapping between an original source/line/column and a
* generated line/column in this source map.
*
* @param Function aCallback
* The function that is called with each mapping.
* @param Object aContext
* Optional. If specified, this object will be the value of `this` every
* time that `aCallback` is called.
* @param aOrder
* Either `SourceMapConsumer.GENERATED_ORDER` or
* `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
* iterate over the mappings sorted by the generated file's line/column
* order or the original's source/line/column order, respectively. Defaults to
* `SourceMapConsumer.GENERATED_ORDER`.
*/ SourceMapConsumer.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
var context = aContext || null;
var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
var mappings;
switch(order){
case SourceMapConsumer.GENERATED_ORDER:
mappings = this._generatedMappings;
break;
case SourceMapConsumer.ORIGINAL_ORDER:
mappings = this._originalMappings;
break;
default:
throw new Error("Unknown order of iteration.");
}
var sourceRoot = this.sourceRoot;
var boundCallback = aCallback.bind(context);
var names = this._names;
var sources = this._sources;
var sourceMapURL = this._sourceMapURL;
for(var i = 0, n = mappings.length; i < n; i++){
var mapping = mappings[i];
var source = mapping.source === null ? null : sources.at(mapping.source);
if (source !== null) {
source = util.computeSourceURL(sourceRoot, source, sourceMapURL);
}
boundCallback({
source: source,
generatedLine: mapping.generatedLine,
generatedColumn: mapping.generatedColumn,
originalLine: mapping.originalLine,
originalColumn: mapping.originalColumn,
name: mapping.name === null ? null : names.at(mapping.name)
});
}
};
/**
* Returns all generated line and column information for the original source,
* line, and column provided. If no column is provided, returns all mappings
* corresponding to a either the line we are searching for or the next
* closest line that has any mappings. Otherwise, returns all mappings
* corresponding to the given line and either the column we are searching for
* or the next closest column that has any offsets.
*
* The only argument is an object with the following properties:
*
* - source: The filename of the original source.
* - line: The line number in the original source. The line number is 1-based.
* - column: Optional. the column number in the original source.
* The column number is 0-based.
*
* and an array of objects is returned, each with the following properties:
*
* - line: The line number in the generated source, or null. The
* line number is 1-based.
* - column: The column number in the generated source, or null.
* The column number is 0-based.
*/ SourceMapConsumer.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
var line = util.getArg(aArgs, 'line');
// When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
// returns the index of the closest mapping less than the needle. By
// setting needle.originalColumn to 0, we thus find the last mapping for
// the given line, provided such a mapping exists.
var needle = {
source: util.getArg(aArgs, 'source'),
originalLine: line,
originalColumn: util.getArg(aArgs, 'column', 0)
};
needle.source = this._findSourceIndex(needle.source);
if (needle.source < 0) {
return [];
}
var mappings = [];
var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
if (index >= 0) {
var mapping = this._originalMappings[index];
if (aArgs.column === undefined) {
var originalLine = mapping.originalLine;
// Iterate until either we run out of mappings, or we run into
// a mapping for a different line than the one we found. Since
// mappings are sorted, this is guaranteed to find all mappings for
// the line we found.
while(mapping && mapping.originalLine === originalLine){
mappings.push({
line: util.getArg(mapping, 'generatedLine', null),
column: util.getArg(mapping, 'generatedColumn', null),
lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
});
mapping = this._originalMappings[++index];
}
} else {
var originalColumn = mapping.originalColumn;
// Iterate until either we run out of mappings, or we run into
// a mapping for a different line than the one we were searching for.
// Since mappings are sorted, this is guaranteed to find all mappings for
// the line we are searching for.
while(mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn){
mappings.push({
line: util.getArg(mapping, 'generatedLine', null),
column: util.getArg(mapping, 'generatedColumn', null),
lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
});
mapping = this._originalMappings[++index];
}
}
}
return mappings;
};
exports.SourceMapConsumer = SourceMapConsumer;
/**
* A BasicSourceMapConsumer instance represents a parsed source map which we can
* query for information about the original file positions by giving it a file
* position in the generated source.
*
* The first parameter is the raw source map (either as a JSON string, or
* already parsed to an object). According to the spec, source maps have the
* following attributes:
*
* - version: Which version of the source map spec this map is following.
* - sources: An array of URLs to the original source files.
* - names: An array of identifiers which can be referrenced by individual mappings.
* - sourceRoot: Optional. The URL root from which all sources are relative.
* - sourcesContent: Optional. An array of contents of the original source files.
* - mappings: A string of base64 VLQs which contain the actual mappings.
* - file: Optional. The generated file this source map is associated with.
*
* Here is an example source map, taken from the source map spec[0]:
*
* {
* version : 3,
* file: "out.js",
* sourceRoot : "",
* sources: ["foo.js", "bar.js"],
* names: ["src", "maps", "are", "fun"],
* mappings: "AA,AB;;ABCDE;"
* }
*
* The second parameter, if given, is a string whose value is the URL
* at which the source map was found. This URL is used to compute the
* sources array.
*
* [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
*/ function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
var sourceMap = aSourceMap;
if (typeof aSourceMap === 'string') {
sourceMap = util.parseSourceMapInput(aSourceMap);
}
var version = util.getArg(sourceMap, 'version');
var sources = util.getArg(sourceMap, 'sources');
// Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
// requires the array) to play nice here.
var names = util.getArg(sourceMap, 'names', []);
var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
var mappings = util.getArg(sourceMap, 'mappings');
var file = util.getArg(sourceMap, 'file', null);
// Once again, Sass deviates from the spec and supplies the version as a
// string rather than a number, so we use loose equality checking here.
if (version != this._version) {
throw new Error('Unsupported version: ' + version);
}
if (sourceRoot) {
sourceRoot = util.normalize(sourceRoot);
}
sources = sources.map(String)// Some source maps produce relative source paths like "./foo.js" instead of
// "foo.js". Normalize these first so that future comparisons will succeed.
// See bugzil.la/1090768.
.map(util.normalize)// Always ensure that absolute sources are internally stored relative to
// the source root, if the source root is absolute. Not doing this would
// be particularly problematic when the source root is a prefix of the
// source (valid, but why??). See github issue #199 and bugzil.la/1188982.
.map(function(source) {
return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) ? util.relative(sourceRoot, source) : source;
});
// Pass `true` below to allow duplicate names and sources. While source maps
// are intended to be compressed and deduplicated, the TypeScript compiler
// sometimes generates source maps with duplicates in them. See Github issue
// #72 and bugzil.la/889492.
this._names = ArraySet.fromArray(names.map(String), true);
this._sources = ArraySet.fromArray(sources, true);
this._absoluteSources = this._sources.toArray().map(function(s) {
return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
});
this.sourceRoot = sourceRoot;
this.sourcesContent = sourcesContent;
this._mappings = mappings;
this._sourceMapURL = aSourceMapURL;
this.file = file;
}
BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;
/**
* Utility function to find the index of a source. Returns -1 if not
* found.
*/ BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
var relativeSource = aSource;
if (this.sourceRoot != null) {
relativeSource = util.relative(this.sourceRoot, relativeSource);
}
if (this._sources.has(relativeSource)) {
return this._sources.indexOf(relativeSource);
}
// Maybe aSource is an absolute URL as returned by |sources|. In
// this case we can't simply undo the transform.
var i;
for(i = 0; i < this._absoluteSources.length; ++i){
if (this._absoluteSources[i] == aSource) {
return i;
}
}
return -1;
};
/**
* Create a BasicSourceMapConsumer from a SourceMapGenerator.
*
* @param SourceMapGenerator aSourceMap
* The source map that will be consumed.
* @param String aSourceMapURL
* The URL at which the source map can be found (optional)
* @returns BasicSourceMapConsumer
*/ BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
var smc = Object.create(BasicSourceMapConsumer.prototype);
var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
smc.sourceRoot = aSourceMap._sourceRoot;
smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot);
smc.file = aSourceMap._file;
smc._sourceMapURL = aSourceMapURL;
smc._absoluteSources = smc._sources.toArray().map(function(s) {
return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
});
// Because we are modifying the entries (by converting string sources and
// names to indices into the sources and names ArraySets), we have to make
// a copy of the entry or else bad things happen. Shared mutable state
// strikes again! See github issue #191.
var generatedMappings = aSourceMap._mappings.toArray().slice();
var destGeneratedMappings = smc.__generatedMappings = [];
var destOriginalMappings = smc.__originalMappings = [];
for(var i = 0, length = generatedMappings.length; i < length; i++){
var srcMapping = generatedMappings[i];
var destMapping = new Mapping;
destMapping.generatedLine = srcMapping.generatedLine;
destMapping.generatedColumn = srcMapping.generatedColumn;
if (srcMapping.source) {
destMapping.source = sources.indexOf(srcMapping.source);
destMapping.originalLine = srcMapping.originalLine;
destMapping.originalColumn = srcMapping.originalColumn;
if (srcMapping.name) {
destMapping.name = names.indexOf(srcMapping.name);
}
destOriginalMappings.push(destMapping);
}
destGeneratedMappings.push(destMapping);
}
quickSort(smc.__originalMappings, util.compareByOriginalPositions);
return smc;
};
/**
* The version of the source mapping spec that we are consuming.
*/ BasicSourceMapConsumer.prototype._version = 3;
/**
* The list of original sources.
*/ Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
get: function() {
return this._absoluteSources.slice();
}
});
/**
* Provide the JIT with a nice shape / hidden class.
*/ function Mapping() {
this.generatedLine = 0;
this.generatedColumn = 0;
this.source = null;
this.originalLine = null;
this.originalColumn = null;
this.name = null;
}
/**
* Parse the mappings in a string in to a data structure which we can easily
* query (the ordered arrays in the `this.__generatedMappings` and
* `this.__originalMappings` properties).
*/ const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine;
function sortGenerated(array, start) {
let l = array.length;
let n = array.length - start;
if (n <= 1) {
return;
} else if (n == 2) {
let a = array[start];
let b = array[start + 1];
if (compareGenerated(a, b) > 0) {
array[start] = b;
array[start + 1] = a;
}
} else if (n < 20) {
for(let i = start; i < l; i++){
for(let j = i; j > start; j--){
let a = array[j - 1];
let b = array[j];
if (compareGenerated(a, b) <= 0) {
break;
}
array[j - 1] = b;
array[j] = a;
}
}
} else {
quickSort(array, compareGenerated, start);
}
}
BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
var generatedLine = 1;
var previousGeneratedColumn = 0;
var previousOriginalLine = 0;
var previousOriginalColumn = 0;
var previousSource = 0;
var previousName = 0;
var length = aStr.length;
var index = 0;
var cachedSegments = {};
var temp = {};
var originalMappings = [];
var generatedMappings = [];
var mapping, str, segment, end, value;
let subarrayStart = 0;
while(index < length){
if (aStr.charAt(index) === ';') {
generatedLine++;
index++;
previousGeneratedColumn = 0;
sortGenerated(generatedMappings, subarrayStart);
subarrayStart = generatedMappings.length;
} else if (aStr.charAt(index) === ',') {
index++;
} else {
mapping = new Mapping();
mapping.generatedLine = generatedLine;
for(end = index; end < length; end++){
if (this._charIsMappingSeparator(aStr, end)) {
break;
}
}
str = aStr.slice(index, end);
segment = [];
while(index < end){
base64VLQ.decode(aStr, index, temp);
value = temp.value;
index = temp.rest;
segment.push(value);
}
if (segment.length === 2) {
throw new Error('Found a source, but no line and column');
}
if (segment.length === 3) {
throw new Error('Found a source and line, but no column');
}
// Generated column.
mapping.generatedColumn = previousGeneratedColumn + segment[0];
previousGeneratedColumn = mapping.generatedColumn;
if (segment.length > 1) {
// Original source.
mapping.source = previousSource + segment[1];
previousSource += segment[1];
// Original line.
mapping.originalLine = previousOriginalLine + segment[2];
previousOriginalLine = mapping.originalLine;
// Lines are stored 0-based
mapping.originalLine += 1;
// Original column.
mapping.originalColumn = previousOriginalColumn + segment[3];
previousOriginalColumn = mapping.originalColumn;
if (segment.length > 4) {
// Original name.
mapping.name = previousName + segment[4];
previousName += segment[4];
}
}
generatedMappings.push(mapping);
if (typeof mapping.originalLine === 'number') {
let currentSource = mapping.source;
while(originalMappings.length <= currentSource){
originalMappings.push(null);
}
if (originalMappings[currentSource] === null) {
originalMappings[currentSource] = [];
}
originalMappings[currentSource].push(mapping);
}
}
}
sortGenerated(generatedMappings, subarrayStart);
this.__generatedMappings = generatedMappings;
for(var i = 0; i < originalMappings.length; i++){
if (originalMappings[i] != null) {
quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource);
}
}
this.__originalMappings = [].concat(...originalMappings);
};
/**
* Find the mapping that best matches the hypothetical "needle" mapping that
* we are searching for in the given "haystack" of mappings.
*/ BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
// To return the position we are searching for, we must first find the
// mapping for the given position and then return the opposite position it
// points to. Because the mappings are sorted, we can use binary search to
// find the best mapping.
if (aNeedle[aLineName] <= 0) {
throw new TypeError('Line must be greater than or equal to 1, got ' + aNeedle[aLineName]);
}
if (aNeedle[aColumnName] < 0) {
throw new TypeError('Column must be greater than or equal to 0, got ' + aNeedle[aColumnName]);
}
return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
};
/**
* Compute the last column for each generated mapping. The last column is
* inclusive.
*/ BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
for(var index = 0; index < this._generatedMappings.length; ++index){
var mapping = this._generatedMappings[index];
// Mappings do not contain a field for the last generated columnt. We
// can come up with an optimistic estimate, however, by assuming that
// mappings are contiguous (i.e. given two consecutive mappings, the
// first mapping ends where the second one starts).
if (index + 1 < this._generatedMappings.length) {
var nextMapping = this._generatedMappings[index + 1];
if (mapping.generatedLine === nextMapping.generatedLine) {
mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
continue;
}
}
// The last mapping for each line spans the entire line.
mapping.lastGeneratedColumn = Infinity;
}
};
/**
* Returns the original source, line, and column information for the generated
* source's line and column positions provided. The only argument is an object
* with the following properties:
*
* - line: The line number in the generated source. The line number
* is 1-based.
* - column: The column number in the generated source. The column
* number is 0-based.
* - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
* 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
* closest element that is smaller than or greater than the one we are
* searching for, respectively, if the exact element cannot be found.
* Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
*
* and an object is returned with the following properties:
*
* - source: The original source file, or null.
* - line: The line number in the original source, or null. The
* line number is 1-based.
* - column: The column number in the original source, or null. The
* column number is 0-based.
* - name: The original identifier, or null.
*/ BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
var needle = {
generatedLine: util.getArg(aArgs, 'line'),
generatedColumn: util.getArg(aArgs, 'column')
};
var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util.compareByGeneratedPositionsDeflated, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND));
if (index >= 0) {
var mapping = this._generatedMappings[index];
if (mapping.generatedLine === needle.generatedLine) {
var source = util.getArg(mapping, 'source', null);
if (source !== null) {
source = this._sources.at(source);
source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
}
var name = util.getArg(mapping, 'name', null);
if (name !== null) {
name = this._names.at(name);
}
return {
source: source,
line: util.getArg(mapping, 'originalLine', null),
column: util.getArg(mapping, 'originalColumn', null),
name: name
};
}
}
return {
source: null,
line: null,
column: null,
name: null
};
};
/**
* Return true if we have the source content for every source in the source
* map, false otherwise.
*/ BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
if (!this.sourcesContent) {
return false;
}
return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
return sc == null;
});
};
/**
* Returns the original source content. The only argument is the url of the
* original source file. Returns null if no original source content is
* available.
*/ BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
if (!this.sourcesContent) {
return null;
}
var index = this._findSourceIndex(aSource);
if (index >= 0) {
return this.sourcesContent[index];
}
var relativeSource = aSource;
if (this.sourceRoot != null) {
relativeSource = util.relative(this.sourceRoot, relativeSource);
}
var url;
if (this.sourceRoot != null && (url = util.urlParse(this.sourceRoot))) {
// XXX: file:// URIs and absolute paths lead to unexpected behavior for
// many users. We can help them out when they expect file:// URIs to
// behave like it would if they were running a local HTTP server. See
// https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) {
return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
}
if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) {
return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
}
}
// This function is used recursively from
// IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
// don't want to throw if we can't find the source - we just want to
// return null, so we provide a flag to exit gracefully.
if (nullOnMissing) {
return null;
} else {
throw new Error('"' + relativeSource + '" is not in the SourceMap.');
}
};
/**
* Returns the generated line and column information for the original source,
* line, and column positions provided. The only argument is an object with
* the following properties:
*
* - source: The filename of the original source.
* - line: The line number in the original source. The line number
* is 1-based.
* - column: The column number in the original source. The column
* number is 0-based.
* - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
* 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
* closest element that is smaller than or greater than the one we are
* searching for, respectively, if the exact element cannot be found.
* Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
*
* and an object is returned with the following properties:
*
* - line: The line number in the generated source, or null. The
* line number is 1-based.
* - column: The column number in the generated source, or null.
* The column number is 0-based.
*/ BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
var source = util.getArg(aArgs, 'source');
source = this._findSourceIndex(source);
if (source < 0) {
return {
line: null,
column: null,
lastColumn: null
};
}
var needle = {
source: source,
originalLine: util.getArg(aArgs, 'line'),
originalColumn: util.getArg(aArgs, 'column')
};
var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util.compareByOriginalPositions, util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND));
if (index >= 0) {
var mapping = this._originalMappings[index];
if (mapping.source === needle.source) {
return {
line: util.getArg(mapping, 'generatedLine', null),
column: util.getArg(mapping, 'generatedColumn', null),
lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
};
}
}
return {
line: null,
column: null,
lastColumn: null
};
};
exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
/**
* An IndexedSourceMapConsumer instance represents a parsed source map which
* we can query for information. It differs from BasicSourceMapConsumer in
* that it takes "indexed" source maps (i.e. ones with a "sections" field) as
* input.
*
* The first parameter is a raw source map (either as a JSON string, or already
* parsed to an object). According to the spec for indexed source maps, they
* have the following attributes:
*
* - version: Which version of the source map spec this map is following.
* - file: Optional. The generated file this source map is associated with.
* - sections: A list of section definitions.
*
* Each value under the "sections" field has two fields:
* - offset: The offset into the original specified at which this section
* begins to apply, defined as an object with a "line" and "column"
* field.
* - map: A source map definition. This source map could also be indexed,
* but doesn't have to be.
*
* Instead of the "map" field, it's also possible to have a "url" field
* specifying a URL to retrieve a source map from, but that's currently
* unsupported.
*
* Here's an example source map, taken from the source map spec[0], but
* modified to omit a section which uses the "url" field.
*
* {
* version : 3,
* file: "app.js",
* sections: [{
* offset: {line:100, column:10},
* map: {
* version : 3,
* file: "section.js",
* sources: ["foo.js", "bar.js"],
* names: ["src", "maps", "are", "fun"],
* mappings: "AAAA,E;;ABCDE;"
* }
* }],
* }
*
* The second parameter, if given, is a string whose value is the URL
* at which the source map was found. This URL is used to compute the
* sources array.
*
* [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
*/ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
var sourceMap = aSourceMap;
if (typeof aSourceMap === 'string') {
sourceMap = util.parseSourceMapInput(aSourceMap);
}
var version = util.getArg(sourceMap, 'version');
var sections = util.getArg(sourceMap, 'sections');
if (version != this._version) {
throw new Error('Unsupported version: ' + version);
}
this._sources = new ArraySet();
this._names = new ArraySet();
var lastOffset = {
line: -1,
column: 0
};
this._sections = sections.map(function(s) {
if (s.url) {
// The url field will require support for asynchronicity.
// See https://github.com/mozilla/source-map/issues/16
throw new Error('Support for url field in sections not implemented.');
}
var offset = util.getArg(s, 'offset');
var offsetLine = util.getArg(offset, 'line');
var offsetColumn = util.getArg(offset, 'column');
if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
throw new Error('Section offsets must be ordered and non-overlapping.');
}
lastOffset = offset;
return {
generatedOffset: {
// The offset fields are 0-based, but we use 1-based indices when
// encoding/decoding from VLQ.
generatedLine: offsetLine + 1,
generatedColumn: offsetColumn + 1
},
consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)
};
});
}
IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
/**
* The version of the source mapping spec that we are consuming.
*/ IndexedSourceMapConsumer.prototype._version = 3;
/**
* The list of original sources.
*/ Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
get: function() {
var sources = [];
for(var i = 0; i < this._sections.length; i++){
for(var j = 0; j < this._sections[i].consumer.sources.length; j++){
sources.push(this._sections[i].consumer.sources[j]);
}
}
return sources;
}
});
/**
* Returns the original source, line, and column information for the generated
* source's line and column positions provided. The only argument is an object
* with the following properties:
*
* - line: The line number in the generated source. The line number
* is 1-based.
* - column: The column number in the generated source. The column
* number is 0-based.
*
* and an object is returned with the following properties:
*
* - source: The original source file, or null.
* - line: The line number in the original source, or null. The
* line number is 1-based.
* - column: The column number in the original source, or null. The
* column number is 0-based.
* - name: The original identifier, or null.
*/ IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
var needle = {
generatedLine: util.getArg(aArgs, 'line'),
generatedColumn: util.getArg(aArgs, 'column')
};
// Find the section containing the generated position we're trying to map
// to an original position.
var sectionIndex = binarySearch.search(needle, this._sections, function(needle, section) {
var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
if (cmp) {
return cmp;
}
return needle.generatedColumn - section.generatedOffset.generatedColumn;
});
var section = this._sections[sectionIndex];
if (!section) {
return {
source: null,
line: null,
column: null,
name: null
};
}
return section.consumer.originalPositionFor({
line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
bias: aArgs.bias
});
};
/**
* Return true if we have the source content for every source in the source
* map, false otherwise.
*/ IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
return this._sections.every(function(s) {
return s.consumer.hasContentsOfAllSources();
});
};
/**
* Returns the original source content. The only argument is the url of the
* original source file. Returns null if no original source content is
* available.
*/ IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
for(var i = 0; i < this._sections.length; i++){
var section = this._sections[i];
var content = section.consumer.sourceContentFor(aSource, true);
if (content || content === '') {
return content;
}
}
if (nullOnMissing) {
return null;
} else {
throw new Error('"' + aSource + '" is not in the SourceMap.');
}
};
/**
* Returns the generated line and column information for the original source,
* line, and column positions provided. The only argument is an object with
* the following properties:
*
* - source: The filename of the original source.
* - line: The line number in the original source. The line number
* is 1-based.
* - column: The column number in the original source. The column
* number is 0-based.
*
* and an object is returned with the following properties:
*
* - line: The line number in the generated source, or null. The
* line number is 1-based.
* - column: The column number in the generated source, or null.
* The column number is 0-based.
*/ IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
for(var i = 0; i < this._sections.length; i++){
var section = this._sections[i];
// Only consider this section if the requested source is in the list of
// sources of the consumer.
if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {
continue;
}
var generatedPosition = section.consumer.generatedPositionFor(aArgs);
if (generatedPosition) {
var ret = {
line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
};
return ret;
}
}
return {
line: null,
column: null
};
};
/**
* Parse the mappings in a string in to a data structure which we can easily
* query (the ordered arrays in the `this.__generatedMappings` and
* `this.__originalMappings` properties).
*/ IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
this.__generatedMappings = [];
this.__originalMappings = [];
for(var i = 0; i < this._sections.length; i++){
var section = this._sections[i];
var sectionMappings = section.consumer._generatedMappings;
for(var j = 0; j < sectionMappings.length; j++){
var mapping = sectionMappings[j];
var source = section.consumer._sources.at(mapping.source);
if (source !== null) {
source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
}
this._sources.add(source);
source = this._sources.indexOf(source);
var name = null;
if (mapping.name) {
name = section.consumer._names.at(mapping.name);
this._names.add(name);
name = this._names.indexOf(name);
}
// The mappings coming from the consumer for the section have
// generated positions relative to the start of the section, so we
// need to offset them to be relative to the start of the concatenated
// generated file.
var adjustedMapping = {
source: source,
generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
originalLine: mapping.originalLine,
originalColumn: mapping.originalColumn,
name: name
};
this.__generatedMappings.push(adjustedMapping);
if (typeof adjustedMapping.originalLine === 'number') {
this.__originalMappings.push(adjustedMapping);
}
}
}
quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
quickSort(this.__originalMappings, util.compareByOriginalPositions);
};
exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
}),
"[project]/node_modules/source-map-js/lib/source-node.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
/* -*- Mode: js; js-indent-level: 2; -*- */ /*
* Copyright 2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE or:
* http://opensource.org/licenses/BSD-3-Clause
*/ var SourceMapGenerator = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/source-map-generator.js [postcss] (ecmascript)").SourceMapGenerator;
var util = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/util.js [postcss] (ecmascript)");
// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
// operating systems these days (capturing the result).
var REGEX_NEWLINE = /(\r?\n)/;
// Newline character code for charCodeAt() comparisons
var NEWLINE_CODE = 10;
// Private symbol for identifying `SourceNode`s when multiple versions of
// the source-map library are loaded. This MUST NOT CHANGE across
// versions!
var isSourceNode = "$$$isSourceNode$$$";
/**
* SourceNodes provide a way to abstract over interpolating/concatenating
* snippets of generated JavaScript source code while maintaining the line and
* column information associated with the original source code.
*
* @param aLine The original line number.
* @param aColumn The original column number.
* @param aSource The original source's filename.
* @param aChunks Optional. An array of strings which are snippets of
* generated JS, or other SourceNodes.
* @param aName The original identifier.
*/ function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
this.children = [];
this.sourceContents = {};
this.line = aLine == null ? null : aLine;
this.column = aColumn == null ? null : aColumn;
this.source = aSource == null ? null : aSource;
this.name = aName == null ? null : aName;
this[isSourceNode] = true;
if (aChunks != null) this.add(aChunks);
}
/**
* Creates a SourceNode from generated code and a SourceMapConsumer.
*
* @param aGeneratedCode The generated code
* @param aSourceMapConsumer The SourceMap for the generated code
* @param aRelativePath Optional. The path that relative sources in the
* SourceMapConsumer should be relative to.
*/ SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
// The SourceNode we want to fill with the generated code
// and the SourceMap
var node = new SourceNode();
// All even indices of this array are one line of the generated code,
// while all odd indices are the newlines between two adjacent lines
// (since `REGEX_NEWLINE` captures its match).
// Processed fragments are accessed by calling `shiftNextLine`.
var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
var remainingLinesIndex = 0;
var shiftNextLine = function() {
var lineContents = getNextLine();
// The last line of a file might not have a newline.
var newLine = getNextLine() || "";
return lineContents + newLine;
//TURBOPACK unreachable
;
function getNextLine() {
return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : undefined;
}
};
// We need to remember the position of "remainingLines"
var lastGeneratedLine = 1, lastGeneratedColumn = 0;
// The generate SourceNodes we need a code range.
// To extract it current and last mapping is used.
// Here we store the last mapping.
var lastMapping = null;
aSourceMapConsumer.eachMapping(function(mapping) {
if (lastMapping !== null) {
// We add the code from "lastMapping" to "mapping":
// First check if there is a new line in between.
if (lastGeneratedLine < mapping.generatedLine) {
// Associate first line with "lastMapping"
addMappingWithCode(lastMapping, shiftNextLine());
lastGeneratedLine++;
lastGeneratedColumn = 0;
// The remaining code is added without mapping
} else {
// There is no new line in between.
// Associate the code between "lastGeneratedColumn" and
// "mapping.generatedColumn" with "lastMapping"
var nextLine = remainingLines[remainingLinesIndex] || '';
var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
lastGeneratedColumn = mapping.generatedColumn;
addMappingWithCode(lastMapping, code);
// No more remaining code, continue
lastMapping = mapping;
return;
}
}
// We add the generated code until the first mapping
// to the SourceNode without any mapping.
// Each line is added as separate string.
while(lastGeneratedLine < mapping.generatedLine){
node.add(shiftNextLine());
lastGeneratedLine++;
}
if (lastGeneratedColumn < mapping.generatedColumn) {
var nextLine = remainingLines[remainingLinesIndex] || '';
node.add(nextLine.substr(0, mapping.generatedColumn));
remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
lastGeneratedColumn = mapping.generatedColumn;
}
lastMapping = mapping;
}, this);
// We have processed all mappings.
if (remainingLinesIndex < remainingLines.length) {
if (lastMapping) {
// Associate the remaining code in the current line with "lastMapping"
addMappingWithCode(lastMapping, shiftNextLine());
}
// and add the remaining lines without any mapping
node.add(remainingLines.splice(remainingLinesIndex).join(""));
}
// Copy sourcesContent into SourceNode
aSourceMapConsumer.sources.forEach(function(sourceFile) {
var content = aSourceMapConsumer.sourceContentFor(sourceFile);
if (content != null) {
if (aRelativePath != null) {
sourceFile = util.join(aRelativePath, sourceFile);
}
node.setSourceContent(sourceFile, content);
}
});
return node;
//TURBOPACK unreachable
;
function addMappingWithCode(mapping, code) {
if (mapping === null || mapping.source === undefined) {
node.add(code);
} else {
var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name));
}
}
};
/**
* Add a chunk of generated JS to this source node.
*
* @param aChunk A string snippet of generated JS code, another instance of
* SourceNode, or an array where each member is one of those things.
*/ SourceNode.prototype.add = function SourceNode_add(aChunk) {
if (Array.isArray(aChunk)) {
aChunk.forEach(function(chunk) {
this.add(chunk);
}, this);
} else if (aChunk[isSourceNode] || typeof aChunk === "string") {
if (aChunk) {
this.children.push(aChunk);
}
} else {
throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
}
return this;
};
/**
* Add a chunk of generated JS to the beginning of this source node.
*
* @param aChunk A string snippet of generated JS code, another instance of
* SourceNode, or an array where each member is one of those things.
*/ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
if (Array.isArray(aChunk)) {
for(var i = aChunk.length - 1; i >= 0; i--){
this.prepend(aChunk[i]);
}
} else if (aChunk[isSourceNode] || typeof aChunk === "string") {
this.children.unshift(aChunk);
} else {
throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
}
return this;
};
/**
* Walk over the tree of JS snippets in this node and its children. The
* walking function is called once for each snippet of JS and is passed that
* snippet and the its original associated source's line/column location.
*
* @param aFn The traversal function.
*/ SourceNode.prototype.walk = function SourceNode_walk(aFn) {
var chunk;
for(var i = 0, len = this.children.length; i < len; i++){
chunk = this.children[i];
if (chunk[isSourceNode]) {
chunk.walk(aFn);
} else {
if (chunk !== '') {
aFn(chunk, {
source: this.source,
line: this.line,
column: this.column,
name: this.name
});
}
}
}
};
/**
* Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
* each of `this.children`.
*
* @param aSep The separator.
*/ SourceNode.prototype.join = function SourceNode_join(aSep) {
var newChildren;
var i;
var len = this.children.length;
if (len > 0) {
newChildren = [];
for(i = 0; i < len - 1; i++){
newChildren.push(this.children[i]);
newChildren.push(aSep);
}
newChildren.push(this.children[i]);
this.children = newChildren;
}
return this;
};
/**
* Call String.prototype.replace on the very right-most source snippet. Useful
* for trimming whitespace from the end of a source node, etc.
*
* @param aPattern The pattern to replace.
* @param aReplacement The thing to replace the pattern with.
*/ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
var lastChild = this.children[this.children.length - 1];
if (lastChild[isSourceNode]) {
lastChild.replaceRight(aPattern, aReplacement);
} else if (typeof lastChild === 'string') {
this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
} else {
this.children.push(''.replace(aPattern, aReplacement));
}
return this;
};
/**
* Set the source content for a source file. This will be added to the SourceMapGenerator
* in the sourcesContent field.
*
* @param aSourceFile The filename of the source file
* @param aSourceContent The content of the source file
*/ SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
};
/**
* Walk over the tree of SourceNodes. The walking function is called for each
* source file content and is passed the filename and source content.
*
* @param aFn The traversal function.
*/ SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
for(var i = 0, len = this.children.length; i < len; i++){
if (this.children[i][isSourceNode]) {
this.children[i].walkSourceContents(aFn);
}
}
var sources = Object.keys(this.sourceContents);
for(var i = 0, len = sources.length; i < len; i++){
aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
}
};
/**
* Return the string representation of this source node. Walks over the tree
* and concatenates all the various snippets together to one string.
*/ SourceNode.prototype.toString = function SourceNode_toString() {
var str = "";
this.walk(function(chunk) {
str += chunk;
});
return str;
};
/**
* Returns the string representation of this source node along with a source
* map.
*/ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
var generated = {
code: "",
line: 1,
column: 0
};
var map = new SourceMapGenerator(aArgs);
var sourceMappingActive = false;
var lastOriginalSource = null;
var lastOriginalLine = null;
var lastOriginalColumn = null;
var lastOriginalName = null;
this.walk(function(chunk, original) {
generated.code += chunk;
if (original.source !== null && original.line !== null && original.column !== null) {
if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) {
map.addMapping({
source: original.source,
original: {
line: original.line,
column: original.column
},
generated: {
line: generated.line,
column: generated.column
},
name: original.name
});
}
lastOriginalSource = original.source;
lastOriginalLine = original.line;
lastOriginalColumn = original.column;
lastOriginalName = original.name;
sourceMappingActive = true;
} else if (sourceMappingActive) {
map.addMapping({
generated: {
line: generated.line,
column: generated.column
}
});
lastOriginalSource = null;
sourceMappingActive = false;
}
for(var idx = 0, length = chunk.length; idx < length; idx++){
if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
generated.line++;
generated.column = 0;
// Mappings end at eol
if (idx + 1 === length) {
lastOriginalSource = null;
sourceMappingActive = false;
} else if (sourceMappingActive) {
map.addMapping({
source: original.source,
original: {
line: original.line,
column: original.column
},
generated: {
line: generated.line,
column: generated.column
},
name: original.name
});
}
} else {
generated.column++;
}
}
});
this.walkSourceContents(function(sourceFile, sourceContent) {
map.setSourceContent(sourceFile, sourceContent);
});
return {
code: generated.code,
map: map
};
};
exports.SourceNode = SourceNode;
}),
"[project]/node_modules/source-map-js/source-map.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
/*
* Copyright 2009-2011 Mozilla Foundation and contributors
* Licensed under the New BSD license. See LICENSE.txt or:
* http://opensource.org/licenses/BSD-3-Clause
*/ exports.SourceMapGenerator = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/source-map-generator.js [postcss] (ecmascript)").SourceMapGenerator;
exports.SourceMapConsumer = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/source-map-consumer.js [postcss] (ecmascript)").SourceMapConsumer;
exports.SourceNode = __turbopack_context__.r("[project]/node_modules/source-map-js/lib/source-node.js [postcss] (ecmascript)").SourceNode;
}),
"[project]/node_modules/postcss/lib/previous-map.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let { existsSync, readFileSync } = __turbopack_context__.r("[externals]/fs [external] (fs, cjs)");
let { dirname, join } = __turbopack_context__.r("[externals]/path [external] (path, cjs)");
let { SourceMapConsumer, SourceMapGenerator } = __turbopack_context__.r("[project]/node_modules/source-map-js/source-map.js [postcss] (ecmascript)");
function fromBase64(str) {
if ("TURBOPACK compile-time truthy", 1) {
return Buffer.from(str, 'base64').toString();
} else //TURBOPACK unreachable
;
}
class PreviousMap {
constructor(css, opts){
if (opts.map === false) return;
this.loadAnnotation(css);
this.inline = this.startWith(this.annotation, 'data:');
let prev = opts.map ? opts.map.prev : undefined;
let text = this.loadMap(opts.from, prev);
if (!this.mapFile && opts.from) {
this.mapFile = opts.from;
}
if (this.mapFile) this.root = dirname(this.mapFile);
if (text) this.text = text;
}
consumer() {
if (!this.consumerCache) {
this.consumerCache = new SourceMapConsumer(this.text);
}
return this.consumerCache;
}
decodeInline(text) {
let baseCharsetUri = /^data:application\/json;charset=utf-?8;base64,/;
let baseUri = /^data:application\/json;base64,/;
let charsetUri = /^data:application\/json;charset=utf-?8,/;
let uri = /^data:application\/json,/;
let uriMatch = text.match(charsetUri) || text.match(uri);
if (uriMatch) {
return decodeURIComponent(text.substr(uriMatch[0].length));
}
let baseUriMatch = text.match(baseCharsetUri) || text.match(baseUri);
if (baseUriMatch) {
return fromBase64(text.substr(baseUriMatch[0].length));
}
let encoding = text.match(/data:application\/json;([^,]+),/)[1];
throw new Error('Unsupported source map encoding ' + encoding);
}
getAnnotationURL(sourceMapString) {
return sourceMapString.replace(/^\/\*\s*# sourceMappingURL=/, '').trim();
}
isMap(map) {
if (typeof map !== 'object') return false;
return typeof map.mappings === 'string' || typeof map._mappings === 'string' || Array.isArray(map.sections);
}
loadAnnotation(css) {
let comments = css.match(/\/\*\s*# sourceMappingURL=/g);
if (!comments) return;
// sourceMappingURLs from comments, strings, etc.
let start = css.lastIndexOf(comments.pop());
let end = css.indexOf('*/', start);
if (start > -1 && end > -1) {
// Locate the last sourceMappingURL to avoid pickin
this.annotation = this.getAnnotationURL(css.substring(start, end));
}
}
loadFile(path) {
this.root = dirname(path);
if (existsSync(path)) {
this.mapFile = path;
return readFileSync(path, 'utf-8').toString().trim();
}
}
loadMap(file, prev) {
if (prev === false) return false;
if (prev) {
if (typeof prev === 'string') {
return prev;
} else if (typeof prev === 'function') {
let prevPath = prev(file);
if (prevPath) {
let map = this.loadFile(prevPath);
if (!map) {
throw new Error('Unable to load previous source map: ' + prevPath.toString());
}
return map;
}
} else if (prev instanceof SourceMapConsumer) {
return SourceMapGenerator.fromSourceMap(prev).toString();
} else if (prev instanceof SourceMapGenerator) {
return prev.toString();
} else if (this.isMap(prev)) {
return JSON.stringify(prev);
} else {
throw new Error('Unsupported previous source map format: ' + prev.toString());
}
} else if (this.inline) {
return this.decodeInline(this.annotation);
} else if (this.annotation) {
let map = this.annotation;
if (file) map = join(dirname(file), map);
return this.loadFile(map);
}
}
startWith(string, start) {
if (!string) return false;
return string.substr(0, start.length) === start;
}
withContent() {
return !!(this.consumer().sourcesContent && this.consumer().sourcesContent.length > 0);
}
}
module.exports = PreviousMap;
PreviousMap.default = PreviousMap;
}),
"[project]/node_modules/postcss/lib/input.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let { nanoid } = __turbopack_context__.r("[project]/node_modules/nanoid/non-secure/index.cjs [postcss] (ecmascript)");
let { isAbsolute, resolve } = __turbopack_context__.r("[externals]/path [external] (path, cjs)");
let { SourceMapConsumer, SourceMapGenerator } = __turbopack_context__.r("[project]/node_modules/source-map-js/source-map.js [postcss] (ecmascript)");
let { fileURLToPath, pathToFileURL } = __turbopack_context__.r("[externals]/url [external] (url, cjs)");
let CssSyntaxError = __turbopack_context__.r("[project]/node_modules/postcss/lib/css-syntax-error.js [postcss] (ecmascript)");
let PreviousMap = __turbopack_context__.r("[project]/node_modules/postcss/lib/previous-map.js [postcss] (ecmascript)");
let terminalHighlight = __turbopack_context__.r("[project]/node_modules/postcss/lib/terminal-highlight.js [postcss] (ecmascript)");
let lineToIndexCache = Symbol('lineToIndexCache');
let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
let pathAvailable = Boolean(resolve && isAbsolute);
function getLineToIndex(input) {
if (input[lineToIndexCache]) return input[lineToIndexCache];
let lines = input.css.split('\n');
let lineToIndex = new Array(lines.length);
let prevIndex = 0;
for(let i = 0, l = lines.length; i < l; i++){
lineToIndex[i] = prevIndex;
prevIndex += lines[i].length + 1;
}
input[lineToIndexCache] = lineToIndex;
return lineToIndex;
}
class Input {
get from() {
return this.file || this.id;
}
constructor(css, opts = {}){
if (css === null || typeof css === 'undefined' || typeof css === 'object' && !css.toString) {
throw new Error(`PostCSS received ${css} instead of CSS string`);
}
this.css = css.toString();
if (this.css[0] === '\uFEFF' || this.css[0] === '\uFFFE') {
this.hasBOM = true;
this.css = this.css.slice(1);
} else {
this.hasBOM = false;
}
this.document = this.css;
if (opts.document) this.document = opts.document.toString();
if (opts.from) {
if (!pathAvailable || /^\w+:\/\//.test(opts.from) || isAbsolute(opts.from)) {
this.file = opts.from;
} else {
this.file = resolve(opts.from);
}
}
if (pathAvailable && sourceMapAvailable) {
let map = new PreviousMap(this.css, opts);
if (map.text) {
this.map = map;
let file = map.consumer().file;
if (!this.file && file) this.file = this.mapResolve(file);
}
}
if (!this.file) {
this.id = '<input css ' + nanoid(6) + '>';
}
if (this.map) this.map.file = this.from;
}
error(message, line, column, opts = {}) {
let endColumn, endLine, endOffset, offset, result;
if (line && typeof line === 'object') {
let start = line;
let end = column;
if (typeof start.offset === 'number') {
offset = start.offset;
let pos = this.fromOffset(offset);
line = pos.line;
column = pos.col;
} else {
line = start.line;
column = start.column;
offset = this.fromLineAndColumn(line, column);
}
if (typeof end.offset === 'number') {
endOffset = end.offset;
let pos = this.fromOffset(endOffset);
endLine = pos.line;
endColumn = pos.col;
} else {
endLine = end.line;
endColumn = end.column;
endOffset = this.fromLineAndColumn(end.line, end.column);
}
} else if (!column) {
offset = line;
let pos = this.fromOffset(offset);
line = pos.line;
column = pos.col;
} else {
offset = this.fromLineAndColumn(line, column);
}
let origin = this.origin(line, column, endLine, endColumn);
if (origin) {
result = new CssSyntaxError(message, origin.endLine === undefined ? origin.line : {
column: origin.column,
line: origin.line
}, origin.endLine === undefined ? origin.column : {
column: origin.endColumn,
line: origin.endLine
}, origin.source, origin.file, opts.plugin);
} else {
result = new CssSyntaxError(message, endLine === undefined ? line : {
column,
line
}, endLine === undefined ? column : {
column: endColumn,
line: endLine
}, this.css, this.file, opts.plugin);
}
result.input = {
column,
endColumn,
endLine,
endOffset,
line,
offset,
source: this.css
};
if (this.file) {
if ("TURBOPACK compile-time truthy", 1) {
result.input.url = pathToFileURL(this.file).toString();
}
result.input.file = this.file;
}
return result;
}
fromLineAndColumn(line, column) {
let lineToIndex = getLineToIndex(this);
let index = lineToIndex[line - 1];
return index + column - 1;
}
fromOffset(offset) {
let lineToIndex = getLineToIndex(this);
let lastLine = lineToIndex[lineToIndex.length - 1];
let min = 0;
if (offset >= lastLine) {
min = lineToIndex.length - 1;
} else {
let max = lineToIndex.length - 2;
let mid;
while(min < max){
mid = min + (max - min >> 1);
if (offset < lineToIndex[mid]) {
max = mid - 1;
} else if (offset >= lineToIndex[mid + 1]) {
min = mid + 1;
} else {
min = mid;
break;
}
}
}
return {
col: offset - lineToIndex[min] + 1,
line: min + 1
};
}
mapResolve(file) {
if (/^\w+:\/\//.test(file)) {
return file;
}
return resolve(this.map.consumer().sourceRoot || this.map.root || '.', file);
}
origin(line, column, endLine, endColumn) {
if (!this.map) return false;
let consumer = this.map.consumer();
let from = consumer.originalPositionFor({
column,
line
});
if (!from.source) return false;
let to;
if (typeof endLine === 'number') {
to = consumer.originalPositionFor({
column: endColumn,
line: endLine
});
}
let fromUrl;
if (isAbsolute(from.source)) {
fromUrl = pathToFileURL(from.source);
} else {
fromUrl = new URL(from.source, this.map.consumer().sourceRoot || pathToFileURL(this.map.mapFile));
}
let result = {
column: from.column,
endColumn: to && to.column,
endLine: to && to.line,
line: from.line,
url: fromUrl.toString()
};
if (fromUrl.protocol === 'file:') {
if (fileURLToPath) {
result.file = fileURLToPath(fromUrl);
} else {
/* c8 ignore next 2 */ throw new Error(`file: protocol is not available in this PostCSS build`);
}
}
let source = consumer.sourceContentFor(from.source);
if (source) result.source = source;
return result;
}
toJSON() {
let json = {};
for (let name of [
'hasBOM',
'css',
'file',
'id'
]){
if (this[name] != null) {
json[name] = this[name];
}
}
if (this.map) {
json.map = {
...this.map
};
if (json.map.consumerCache) {
json.map.consumerCache = undefined;
}
}
return json;
}
}
module.exports = Input;
Input.default = Input;
if (terminalHighlight && terminalHighlight.registerInput) {
terminalHighlight.registerInput(Input);
}
}),
"[project]/node_modules/postcss/lib/root.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let Container = __turbopack_context__.r("[project]/node_modules/postcss/lib/container.js [postcss] (ecmascript)");
let LazyResult, Processor;
class Root extends Container {
constructor(defaults){
super(defaults);
this.type = 'root';
if (!this.nodes) this.nodes = [];
}
normalize(child, sample, type) {
let nodes = super.normalize(child);
if (sample) {
if (type === 'prepend') {
if (this.nodes.length > 1) {
sample.raws.before = this.nodes[1].raws.before;
} else {
delete sample.raws.before;
}
} else if (this.first !== sample) {
for (let node of nodes){
node.raws.before = sample.raws.before;
}
}
}
return nodes;
}
removeChild(child, ignore) {
let index = this.index(child);
if (!ignore && index === 0 && this.nodes.length > 1) {
this.nodes[1].raws.before = this.nodes[index].raws.before;
}
return super.removeChild(child);
}
toResult(opts = {}) {
let lazy = new LazyResult(new Processor(), this, opts);
return lazy.stringify();
}
}
Root.registerLazyResult = (dependant)=>{
LazyResult = dependant;
};
Root.registerProcessor = (dependant)=>{
Processor = dependant;
};
module.exports = Root;
Root.default = Root;
Container.registerRoot(Root);
}),
"[project]/node_modules/postcss/lib/list.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let list = {
comma (string) {
return list.split(string, [
','
], true);
},
space (string) {
let spaces = [
' ',
'\n',
'\t'
];
return list.split(string, spaces);
},
split (string, separators, last) {
let array = [];
let current = '';
let split = false;
let func = 0;
let inQuote = false;
let prevQuote = '';
let escape = false;
for (let letter of string){
if (escape) {
escape = false;
} else if (letter === '\\') {
escape = true;
} else if (inQuote) {
if (letter === prevQuote) {
inQuote = false;
}
} else if (letter === '"' || letter === "'") {
inQuote = true;
prevQuote = letter;
} else if (letter === '(') {
func += 1;
} else if (letter === ')') {
if (func > 0) func -= 1;
} else if (func === 0) {
if (separators.includes(letter)) split = true;
}
if (split) {
if (current !== '') array.push(current.trim());
current = '';
split = false;
} else {
current += letter;
}
}
if (last || current !== '') array.push(current.trim());
return array;
}
};
module.exports = list;
list.default = list;
}),
"[project]/node_modules/postcss/lib/rule.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let Container = __turbopack_context__.r("[project]/node_modules/postcss/lib/container.js [postcss] (ecmascript)");
let list = __turbopack_context__.r("[project]/node_modules/postcss/lib/list.js [postcss] (ecmascript)");
class Rule extends Container {
get selectors() {
return list.comma(this.selector);
}
set selectors(values) {
let match = this.selector ? this.selector.match(/,\s*/) : null;
let sep = match ? match[0] : ',' + this.raw('between', 'beforeOpen');
this.selector = values.join(sep);
}
constructor(defaults){
super(defaults);
this.type = 'rule';
if (!this.nodes) this.nodes = [];
}
}
module.exports = Rule;
Rule.default = Rule;
Container.registerRule(Rule);
}),
"[project]/node_modules/postcss/lib/fromJSON.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let AtRule = __turbopack_context__.r("[project]/node_modules/postcss/lib/at-rule.js [postcss] (ecmascript)");
let Comment = __turbopack_context__.r("[project]/node_modules/postcss/lib/comment.js [postcss] (ecmascript)");
let Declaration = __turbopack_context__.r("[project]/node_modules/postcss/lib/declaration.js [postcss] (ecmascript)");
let Input = __turbopack_context__.r("[project]/node_modules/postcss/lib/input.js [postcss] (ecmascript)");
let PreviousMap = __turbopack_context__.r("[project]/node_modules/postcss/lib/previous-map.js [postcss] (ecmascript)");
let Root = __turbopack_context__.r("[project]/node_modules/postcss/lib/root.js [postcss] (ecmascript)");
let Rule = __turbopack_context__.r("[project]/node_modules/postcss/lib/rule.js [postcss] (ecmascript)");
function fromJSON(json, inputs) {
if (Array.isArray(json)) return json.map((n)=>fromJSON(n));
let { inputs: ownInputs, ...defaults } = json;
if (ownInputs) {
inputs = [];
for (let input of ownInputs){
let inputHydrated = {
...input,
__proto__: Input.prototype
};
if (inputHydrated.map) {
inputHydrated.map = {
...inputHydrated.map,
__proto__: PreviousMap.prototype
};
}
inputs.push(inputHydrated);
}
}
if (defaults.nodes) {
defaults.nodes = json.nodes.map((n)=>fromJSON(n, inputs));
}
if (defaults.source) {
let { inputId, ...source } = defaults.source;
defaults.source = source;
if (inputId != null) {
defaults.source.input = inputs[inputId];
}
}
if (defaults.type === 'root') {
return new Root(defaults);
} else if (defaults.type === 'decl') {
return new Declaration(defaults);
} else if (defaults.type === 'rule') {
return new Rule(defaults);
} else if (defaults.type === 'comment') {
return new Comment(defaults);
} else if (defaults.type === 'atrule') {
return new AtRule(defaults);
} else {
throw new Error('Unknown node type: ' + json.type);
}
}
module.exports = fromJSON;
fromJSON.default = fromJSON;
}),
"[project]/node_modules/postcss/lib/map-generator.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let { dirname, relative, resolve, sep } = __turbopack_context__.r("[externals]/path [external] (path, cjs)");
let { SourceMapConsumer, SourceMapGenerator } = __turbopack_context__.r("[project]/node_modules/source-map-js/source-map.js [postcss] (ecmascript)");
let { pathToFileURL } = __turbopack_context__.r("[externals]/url [external] (url, cjs)");
let Input = __turbopack_context__.r("[project]/node_modules/postcss/lib/input.js [postcss] (ecmascript)");
let sourceMapAvailable = Boolean(SourceMapConsumer && SourceMapGenerator);
let pathAvailable = Boolean(dirname && resolve && relative && sep);
class MapGenerator {
constructor(stringify, root, opts, cssString){
this.stringify = stringify;
this.mapOpts = opts.map || {};
this.root = root;
this.opts = opts;
this.css = cssString;
this.originalCSS = cssString;
this.usesFileUrls = !this.mapOpts.from && this.mapOpts.absolute;
this.memoizedFileURLs = new Map();
this.memoizedPaths = new Map();
this.memoizedURLs = new Map();
}
addAnnotation() {
let content;
if (this.isInline()) {
content = 'data:application/json;base64,' + this.toBase64(this.map.toString());
} else if (typeof this.mapOpts.annotation === 'string') {
content = this.mapOpts.annotation;
} else if (typeof this.mapOpts.annotation === 'function') {
content = this.mapOpts.annotation(this.opts.to, this.root);
} else {
content = this.outputFile() + '.map';
}
let eol = '\n';
if (this.css.includes('\r\n')) eol = '\r\n';
this.css += eol + '/*# sourceMappingURL=' + content + ' */';
}
applyPrevMaps() {
for (let prev of this.previous()){
let from = this.toUrl(this.path(prev.file));
let root = prev.root || dirname(prev.file);
let map;
if (this.mapOpts.sourcesContent === false) {
map = new SourceMapConsumer(prev.text);
if (map.sourcesContent) {
map.sourcesContent = null;
}
} else {
map = prev.consumer();
}
this.map.applySourceMap(map, from, this.toUrl(this.path(root)));
}
}
clearAnnotation() {
if (this.mapOpts.annotation === false) return;
if (this.root) {
let node;
for(let i = this.root.nodes.length - 1; i >= 0; i--){
node = this.root.nodes[i];
if (node.type !== 'comment') continue;
if (node.text.startsWith('# sourceMappingURL=')) {
this.root.removeChild(i);
}
}
} else if (this.css) {
this.css = this.css.replace(/\n*\/\*#[\S\s]*?\*\/$/gm, '');
}
}
generate() {
this.clearAnnotation();
if (pathAvailable && sourceMapAvailable && this.isMap()) {
return this.generateMap();
} else {
let result = '';
this.stringify(this.root, (i)=>{
result += i;
});
return [
result
];
}
}
generateMap() {
if (this.root) {
this.generateString();
} else if (this.previous().length === 1) {
let prev = this.previous()[0].consumer();
prev.file = this.outputFile();
this.map = SourceMapGenerator.fromSourceMap(prev, {
ignoreInvalidMapping: true
});
} else {
this.map = new SourceMapGenerator({
file: this.outputFile(),
ignoreInvalidMapping: true
});
this.map.addMapping({
generated: {
column: 0,
line: 1
},
original: {
column: 0,
line: 1
},
source: this.opts.from ? this.toUrl(this.path(this.opts.from)) : '<no source>'
});
}
if (this.isSourcesContent()) this.setSourcesContent();
if (this.root && this.previous().length > 0) this.applyPrevMaps();
if (this.isAnnotation()) this.addAnnotation();
if (this.isInline()) {
return [
this.css
];
} else {
return [
this.css,
this.map
];
}
}
generateString() {
this.css = '';
this.map = new SourceMapGenerator({
file: this.outputFile(),
ignoreInvalidMapping: true
});
let line = 1;
let column = 1;
let noSource = '<no source>';
let mapping = {
generated: {
column: 0,
line: 0
},
original: {
column: 0,
line: 0
},
source: ''
};
let last, lines;
this.stringify(this.root, (str, node, type)=>{
this.css += str;
if (node && type !== 'end') {
mapping.generated.line = line;
mapping.generated.column = column - 1;
if (node.source && node.source.start) {
mapping.source = this.sourcePath(node);
mapping.original.line = node.source.start.line;
mapping.original.column = node.source.start.column - 1;
this.map.addMapping(mapping);
} else {
mapping.source = noSource;
mapping.original.line = 1;
mapping.original.column = 0;
this.map.addMapping(mapping);
}
}
lines = str.match(/\n/g);
if (lines) {
line += lines.length;
last = str.lastIndexOf('\n');
column = str.length - last;
} else {
column += str.length;
}
if (node && type !== 'start') {
let p = node.parent || {
raws: {}
};
let childless = node.type === 'decl' || node.type === 'atrule' && !node.nodes;
if (!childless || node !== p.last || p.raws.semicolon) {
if (node.source && node.source.end) {
mapping.source = this.sourcePath(node);
mapping.original.line = node.source.end.line;
mapping.original.column = node.source.end.column - 1;
mapping.generated.line = line;
mapping.generated.column = column - 2;
this.map.addMapping(mapping);
} else {
mapping.source = noSource;
mapping.original.line = 1;
mapping.original.column = 0;
mapping.generated.line = line;
mapping.generated.column = column - 1;
this.map.addMapping(mapping);
}
}
}
});
}
isAnnotation() {
if (this.isInline()) {
return true;
}
if (typeof this.mapOpts.annotation !== 'undefined') {
return this.mapOpts.annotation;
}
if (this.previous().length) {
return this.previous().some((i)=>i.annotation);
}
return true;
}
isInline() {
if (typeof this.mapOpts.inline !== 'undefined') {
return this.mapOpts.inline;
}
let annotation = this.mapOpts.annotation;
if (typeof annotation !== 'undefined' && annotation !== true) {
return false;
}
if (this.previous().length) {
return this.previous().some((i)=>i.inline);
}
return true;
}
isMap() {
if (typeof this.opts.map !== 'undefined') {
return !!this.opts.map;
}
return this.previous().length > 0;
}
isSourcesContent() {
if (typeof this.mapOpts.sourcesContent !== 'undefined') {
return this.mapOpts.sourcesContent;
}
if (this.previous().length) {
return this.previous().some((i)=>i.withContent());
}
return true;
}
outputFile() {
if (this.opts.to) {
return this.path(this.opts.to);
} else if (this.opts.from) {
return this.path(this.opts.from);
} else {
return 'to.css';
}
}
path(file) {
if (this.mapOpts.absolute) return file;
if (file.charCodeAt(0) === 60 /* `<` */ ) return file;
if (/^\w+:\/\//.test(file)) return file;
let cached = this.memoizedPaths.get(file);
if (cached) return cached;
let from = this.opts.to ? dirname(this.opts.to) : '.';
if (typeof this.mapOpts.annotation === 'string') {
from = dirname(resolve(from, this.mapOpts.annotation));
}
let path = relative(from, file);
this.memoizedPaths.set(file, path);
return path;
}
previous() {
if (!this.previousMaps) {
this.previousMaps = [];
if (this.root) {
this.root.walk((node)=>{
if (node.source && node.source.input.map) {
let map = node.source.input.map;
if (!this.previousMaps.includes(map)) {
this.previousMaps.push(map);
}
}
});
} else {
let input = new Input(this.originalCSS, this.opts);
if (input.map) this.previousMaps.push(input.map);
}
}
return this.previousMaps;
}
setSourcesContent() {
let already = {};
if (this.root) {
this.root.walk((node)=>{
if (node.source) {
let from = node.source.input.from;
if (from && !already[from]) {
already[from] = true;
let fromUrl = this.usesFileUrls ? this.toFileUrl(from) : this.toUrl(this.path(from));
this.map.setSourceContent(fromUrl, node.source.input.css);
}
}
});
} else if (this.css) {
let from = this.opts.from ? this.toUrl(this.path(this.opts.from)) : '<no source>';
this.map.setSourceContent(from, this.css);
}
}
sourcePath(node) {
if (this.mapOpts.from) {
return this.toUrl(this.mapOpts.from);
} else if (this.usesFileUrls) {
return this.toFileUrl(node.source.input.from);
} else {
return this.toUrl(this.path(node.source.input.from));
}
}
toBase64(str) {
if ("TURBOPACK compile-time truthy", 1) {
return Buffer.from(str).toString('base64');
} else //TURBOPACK unreachable
;
}
toFileUrl(path) {
let cached = this.memoizedFileURLs.get(path);
if (cached) return cached;
if ("TURBOPACK compile-time truthy", 1) {
let fileURL = pathToFileURL(path).toString();
this.memoizedFileURLs.set(path, fileURL);
return fileURL;
} else //TURBOPACK unreachable
;
}
toUrl(path) {
let cached = this.memoizedURLs.get(path);
if (cached) return cached;
if (sep === '\\') {
path = path.replace(/\\/g, '/');
}
let url = encodeURI(path).replace(/[#?]/g, encodeURIComponent);
this.memoizedURLs.set(path, url);
return url;
}
}
module.exports = MapGenerator;
}),
"[project]/node_modules/postcss/lib/parser.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let AtRule = __turbopack_context__.r("[project]/node_modules/postcss/lib/at-rule.js [postcss] (ecmascript)");
let Comment = __turbopack_context__.r("[project]/node_modules/postcss/lib/comment.js [postcss] (ecmascript)");
let Declaration = __turbopack_context__.r("[project]/node_modules/postcss/lib/declaration.js [postcss] (ecmascript)");
let Root = __turbopack_context__.r("[project]/node_modules/postcss/lib/root.js [postcss] (ecmascript)");
let Rule = __turbopack_context__.r("[project]/node_modules/postcss/lib/rule.js [postcss] (ecmascript)");
let tokenizer = __turbopack_context__.r("[project]/node_modules/postcss/lib/tokenize.js [postcss] (ecmascript)");
const SAFE_COMMENT_NEIGHBOR = {
empty: true,
space: true
};
function findLastWithPosition(tokens) {
for(let i = tokens.length - 1; i >= 0; i--){
let token = tokens[i];
let pos = token[3] || token[2];
if (pos) return pos;
}
}
class Parser {
constructor(input){
this.input = input;
this.root = new Root();
this.current = this.root;
this.spaces = '';
this.semicolon = false;
this.createTokenizer();
this.root.source = {
input,
start: {
column: 1,
line: 1,
offset: 0
}
};
}
atrule(token) {
let node = new AtRule();
node.name = token[1].slice(1);
if (node.name === '') {
this.unnamedAtrule(node, token);
}
this.init(node, token[2]);
let type;
let prev;
let shift;
let last = false;
let open = false;
let params = [];
let brackets = [];
while(!this.tokenizer.endOfFile()){
token = this.tokenizer.nextToken();
type = token[0];
if (type === '(' || type === '[') {
brackets.push(type === '(' ? ')' : ']');
} else if (type === '{' && brackets.length > 0) {
brackets.push('}');
} else if (type === brackets[brackets.length - 1]) {
brackets.pop();
}
if (brackets.length === 0) {
if (type === ';') {
node.source.end = this.getPosition(token[2]);
node.source.end.offset++;
this.semicolon = true;
break;
} else if (type === '{') {
open = true;
break;
} else if (type === '}') {
if (params.length > 0) {
shift = params.length - 1;
prev = params[shift];
while(prev && prev[0] === 'space'){
prev = params[--shift];
}
if (prev) {
node.source.end = this.getPosition(prev[3] || prev[2]);
node.source.end.offset++;
}
}
this.end(token);
break;
} else {
params.push(token);
}
} else {
params.push(token);
}
if (this.tokenizer.endOfFile()) {
last = true;
break;
}
}
node.raws.between = this.spacesAndCommentsFromEnd(params);
if (params.length) {
node.raws.afterName = this.spacesAndCommentsFromStart(params);
this.raw(node, 'params', params);
if (last) {
token = params[params.length - 1];
node.source.end = this.getPosition(token[3] || token[2]);
node.source.end.offset++;
this.spaces = node.raws.between;
node.raws.between = '';
}
} else {
node.raws.afterName = '';
node.params = '';
}
if (open) {
node.nodes = [];
this.current = node;
}
}
checkMissedSemicolon(tokens) {
let colon = this.colon(tokens);
if (colon === false) return;
let founded = 0;
let token;
for(let j = colon - 1; j >= 0; j--){
token = tokens[j];
if (token[0] !== 'space') {
founded += 1;
if (founded === 2) break;
}
}
// If the token is a word, e.g. `!important`, `red` or any other valid property's value.
// Then we need to return the colon after that word token. [3] is the "end" colon of that word.
// And because we need it after that one we do +1 to get the next one.
throw this.input.error('Missed semicolon', token[0] === 'word' ? token[3] + 1 : token[2]);
}
colon(tokens) {
let brackets = 0;
let prev, token, type;
for (let [i, element] of tokens.entries()){
token = element;
type = token[0];
if (type === '(') {
brackets += 1;
}
if (type === ')') {
brackets -= 1;
}
if (brackets === 0 && type === ':') {
if (!prev) {
this.doubleColon(token);
} else if (prev[0] === 'word' && prev[1] === 'progid') {
continue;
} else {
return i;
}
}
prev = token;
}
return false;
}
comment(token) {
let node = new Comment();
this.init(node, token[2]);
node.source.end = this.getPosition(token[3] || token[2]);
node.source.end.offset++;
let text = token[1].slice(2, -2);
if (/^\s*$/.test(text)) {
node.text = '';
node.raws.left = text;
node.raws.right = '';
} else {
let match = text.match(/^(\s*)([^]*\S)(\s*)$/);
node.text = match[2];
node.raws.left = match[1];
node.raws.right = match[3];
}
}
createTokenizer() {
this.tokenizer = tokenizer(this.input);
}
decl(tokens, customProperty) {
let node = new Declaration();
this.init(node, tokens[0][2]);
let last = tokens[tokens.length - 1];
if (last[0] === ';') {
this.semicolon = true;
tokens.pop();
}
node.source.end = this.getPosition(last[3] || last[2] || findLastWithPosition(tokens));
node.source.end.offset++;
while(tokens[0][0] !== 'word'){
if (tokens.length === 1) this.unknownWord(tokens);
node.raws.before += tokens.shift()[1];
}
node.source.start = this.getPosition(tokens[0][2]);
node.prop = '';
while(tokens.length){
let type = tokens[0][0];
if (type === ':' || type === 'space' || type === 'comment') {
break;
}
node.prop += tokens.shift()[1];
}
node.raws.between = '';
let token;
while(tokens.length){
token = tokens.shift();
if (token[0] === ':') {
node.raws.between += token[1];
break;
} else {
if (token[0] === 'word' && /\w/.test(token[1])) {
this.unknownWord([
token
]);
}
node.raws.between += token[1];
}
}
if (node.prop[0] === '_' || node.prop[0] === '*') {
node.raws.before += node.prop[0];
node.prop = node.prop.slice(1);
}
let firstSpaces = [];
let next;
while(tokens.length){
next = tokens[0][0];
if (next !== 'space' && next !== 'comment') break;
firstSpaces.push(tokens.shift());
}
this.precheckMissedSemicolon(tokens);
for(let i = tokens.length - 1; i >= 0; i--){
token = tokens[i];
if (token[1].toLowerCase() === '!important') {
node.important = true;
let string = this.stringFrom(tokens, i);
string = this.spacesFromEnd(tokens) + string;
if (string !== ' !important') node.raws.important = string;
break;
} else if (token[1].toLowerCase() === 'important') {
let cache = tokens.slice(0);
let str = '';
for(let j = i; j > 0; j--){
let type = cache[j][0];
if (str.trim().startsWith('!') && type !== 'space') {
break;
}
str = cache.pop()[1] + str;
}
if (str.trim().startsWith('!')) {
node.important = true;
node.raws.important = str;
tokens = cache;
}
}
if (token[0] !== 'space' && token[0] !== 'comment') {
break;
}
}
let hasWord = tokens.some((i)=>i[0] !== 'space' && i[0] !== 'comment');
if (hasWord) {
node.raws.between += firstSpaces.map((i)=>i[1]).join('');
firstSpaces = [];
}
this.raw(node, 'value', firstSpaces.concat(tokens), customProperty);
if (node.value.includes(':') && !customProperty) {
this.checkMissedSemicolon(tokens);
}
}
doubleColon(token) {
throw this.input.error('Double colon', {
offset: token[2]
}, {
offset: token[2] + token[1].length
});
}
emptyRule(token) {
let node = new Rule();
this.init(node, token[2]);
node.selector = '';
node.raws.between = '';
this.current = node;
}
end(token) {
if (this.current.nodes && this.current.nodes.length) {
this.current.raws.semicolon = this.semicolon;
}
this.semicolon = false;
this.current.raws.after = (this.current.raws.after || '') + this.spaces;
this.spaces = '';
if (this.current.parent) {
this.current.source.end = this.getPosition(token[2]);
this.current.source.end.offset++;
this.current = this.current.parent;
} else {
this.unexpectedClose(token);
}
}
endFile() {
if (this.current.parent) this.unclosedBlock();
if (this.current.nodes && this.current.nodes.length) {
this.current.raws.semicolon = this.semicolon;
}
this.current.raws.after = (this.current.raws.after || '') + this.spaces;
this.root.source.end = this.getPosition(this.tokenizer.position());
}
freeSemicolon(token) {
this.spaces += token[1];
if (this.current.nodes) {
let prev = this.current.nodes[this.current.nodes.length - 1];
if (prev && prev.type === 'rule' && !prev.raws.ownSemicolon) {
prev.raws.ownSemicolon = this.spaces;
this.spaces = '';
prev.source.end = this.getPosition(token[2]);
prev.source.end.offset += prev.raws.ownSemicolon.length;
}
}
}
// Helpers
getPosition(offset) {
let pos = this.input.fromOffset(offset);
return {
column: pos.col,
line: pos.line,
offset
};
}
init(node, offset) {
this.current.push(node);
node.source = {
input: this.input,
start: this.getPosition(offset)
};
node.raws.before = this.spaces;
this.spaces = '';
if (node.type !== 'comment') this.semicolon = false;
}
other(start) {
let end = false;
let type = null;
let colon = false;
let bracket = null;
let brackets = [];
let customProperty = start[1].startsWith('--');
let tokens = [];
let token = start;
while(token){
type = token[0];
tokens.push(token);
if (type === '(' || type === '[') {
if (!bracket) bracket = token;
brackets.push(type === '(' ? ')' : ']');
} else if (customProperty && colon && type === '{') {
if (!bracket) bracket = token;
brackets.push('}');
} else if (brackets.length === 0) {
if (type === ';') {
if (colon) {
this.decl(tokens, customProperty);
return;
} else {
break;
}
} else if (type === '{') {
this.rule(tokens);
return;
} else if (type === '}') {
this.tokenizer.back(tokens.pop());
end = true;
break;
} else if (type === ':') {
colon = true;
}
} else if (type === brackets[brackets.length - 1]) {
brackets.pop();
if (brackets.length === 0) bracket = null;
}
token = this.tokenizer.nextToken();
}
if (this.tokenizer.endOfFile()) end = true;
if (brackets.length > 0) this.unclosedBracket(bracket);
if (end && colon) {
if (!customProperty) {
while(tokens.length){
token = tokens[tokens.length - 1][0];
if (token !== 'space' && token !== 'comment') break;
this.tokenizer.back(tokens.pop());
}
}
this.decl(tokens, customProperty);
} else {
this.unknownWord(tokens);
}
}
parse() {
let token;
while(!this.tokenizer.endOfFile()){
token = this.tokenizer.nextToken();
switch(token[0]){
case 'space':
this.spaces += token[1];
break;
case ';':
this.freeSemicolon(token);
break;
case '}':
this.end(token);
break;
case 'comment':
this.comment(token);
break;
case 'at-word':
this.atrule(token);
break;
case '{':
this.emptyRule(token);
break;
default:
this.other(token);
break;
}
}
this.endFile();
}
precheckMissedSemicolon() {
// Hook for Safe Parser
}
raw(node, prop, tokens, customProperty) {
let token, type;
let length = tokens.length;
let value = '';
let clean = true;
let next, prev;
for(let i = 0; i < length; i += 1){
token = tokens[i];
type = token[0];
if (type === 'space' && i === length - 1 && !customProperty) {
clean = false;
} else if (type === 'comment') {
prev = tokens[i - 1] ? tokens[i - 1][0] : 'empty';
next = tokens[i + 1] ? tokens[i + 1][0] : 'empty';
if (!SAFE_COMMENT_NEIGHBOR[prev] && !SAFE_COMMENT_NEIGHBOR[next]) {
if (value.slice(-1) === ',') {
clean = false;
} else {
value += token[1];
}
} else {
clean = false;
}
} else {
value += token[1];
}
}
if (!clean) {
let raw = tokens.reduce((all, i)=>all + i[1], '');
node.raws[prop] = {
raw,
value
};
}
node[prop] = value;
}
rule(tokens) {
tokens.pop();
let node = new Rule();
this.init(node, tokens[0][2]);
node.raws.between = this.spacesAndCommentsFromEnd(tokens);
this.raw(node, 'selector', tokens);
this.current = node;
}
spacesAndCommentsFromEnd(tokens) {
let lastTokenType;
let spaces = '';
while(tokens.length){
lastTokenType = tokens[tokens.length - 1][0];
if (lastTokenType !== 'space' && lastTokenType !== 'comment') break;
spaces = tokens.pop()[1] + spaces;
}
return spaces;
}
// Errors
spacesAndCommentsFromStart(tokens) {
let next;
let spaces = '';
while(tokens.length){
next = tokens[0][0];
if (next !== 'space' && next !== 'comment') break;
spaces += tokens.shift()[1];
}
return spaces;
}
spacesFromEnd(tokens) {
let lastTokenType;
let spaces = '';
while(tokens.length){
lastTokenType = tokens[tokens.length - 1][0];
if (lastTokenType !== 'space') break;
spaces = tokens.pop()[1] + spaces;
}
return spaces;
}
stringFrom(tokens, from) {
let result = '';
for(let i = from; i < tokens.length; i++){
result += tokens[i][1];
}
tokens.splice(from, tokens.length - from);
return result;
}
unclosedBlock() {
let pos = this.current.source.start;
throw this.input.error('Unclosed block', pos.line, pos.column);
}
unclosedBracket(bracket) {
throw this.input.error('Unclosed bracket', {
offset: bracket[2]
}, {
offset: bracket[2] + 1
});
}
unexpectedClose(token) {
throw this.input.error('Unexpected }', {
offset: token[2]
}, {
offset: token[2] + 1
});
}
unknownWord(tokens) {
throw this.input.error('Unknown word ' + tokens[0][1], {
offset: tokens[0][2]
}, {
offset: tokens[0][2] + tokens[0][1].length
});
}
unnamedAtrule(node, token) {
throw this.input.error('At-rule without name', {
offset: token[2]
}, {
offset: token[2] + token[1].length
});
}
}
module.exports = Parser;
}),
"[project]/node_modules/postcss/lib/parse.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let Container = __turbopack_context__.r("[project]/node_modules/postcss/lib/container.js [postcss] (ecmascript)");
let Input = __turbopack_context__.r("[project]/node_modules/postcss/lib/input.js [postcss] (ecmascript)");
let Parser = __turbopack_context__.r("[project]/node_modules/postcss/lib/parser.js [postcss] (ecmascript)");
function parse(css, opts) {
let input = new Input(css, opts);
let parser = new Parser(input);
try {
parser.parse();
} catch (e) {
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
;
throw e;
}
return parser.root;
}
module.exports = parse;
parse.default = parse;
Container.registerParse(parse);
}),
"[project]/node_modules/postcss/lib/warning.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
class Warning {
constructor(text, opts = {}){
this.type = 'warning';
this.text = text;
if (opts.node && opts.node.source) {
let range = opts.node.rangeBy(opts);
this.line = range.start.line;
this.column = range.start.column;
this.endLine = range.end.line;
this.endColumn = range.end.column;
}
for(let opt in opts)this[opt] = opts[opt];
}
toString() {
if (this.node) {
return this.node.error(this.text, {
index: this.index,
plugin: this.plugin,
word: this.word
}).message;
}
if (this.plugin) {
return this.plugin + ': ' + this.text;
}
return this.text;
}
}
module.exports = Warning;
Warning.default = Warning;
}),
"[project]/node_modules/postcss/lib/result.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let Warning = __turbopack_context__.r("[project]/node_modules/postcss/lib/warning.js [postcss] (ecmascript)");
class Result {
get content() {
return this.css;
}
constructor(processor, root, opts){
this.processor = processor;
this.messages = [];
this.root = root;
this.opts = opts;
this.css = '';
this.map = undefined;
}
toString() {
return this.css;
}
warn(text, opts = {}) {
if (!opts.plugin) {
if (this.lastPlugin && this.lastPlugin.postcssPlugin) {
opts.plugin = this.lastPlugin.postcssPlugin;
}
}
let warning = new Warning(text, opts);
this.messages.push(warning);
return warning;
}
warnings() {
return this.messages.filter((i)=>i.type === 'warning');
}
}
module.exports = Result;
Result.default = Result;
}),
"[project]/node_modules/postcss/lib/warn-once.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
/* eslint-disable no-console */ let printed = {};
module.exports = function warnOnce(message) {
if (printed[message]) return;
printed[message] = true;
if (typeof console !== 'undefined' && console.warn) {
console.warn(message);
}
};
}),
"[project]/node_modules/postcss/lib/lazy-result.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let Container = __turbopack_context__.r("[project]/node_modules/postcss/lib/container.js [postcss] (ecmascript)");
let Document = __turbopack_context__.r("[project]/node_modules/postcss/lib/document.js [postcss] (ecmascript)");
let MapGenerator = __turbopack_context__.r("[project]/node_modules/postcss/lib/map-generator.js [postcss] (ecmascript)");
let parse = __turbopack_context__.r("[project]/node_modules/postcss/lib/parse.js [postcss] (ecmascript)");
let Result = __turbopack_context__.r("[project]/node_modules/postcss/lib/result.js [postcss] (ecmascript)");
let Root = __turbopack_context__.r("[project]/node_modules/postcss/lib/root.js [postcss] (ecmascript)");
let stringify = __turbopack_context__.r("[project]/node_modules/postcss/lib/stringify.js [postcss] (ecmascript)");
let { isClean, my } = __turbopack_context__.r("[project]/node_modules/postcss/lib/symbols.js [postcss] (ecmascript)");
let warnOnce = __turbopack_context__.r("[project]/node_modules/postcss/lib/warn-once.js [postcss] (ecmascript)");
const TYPE_TO_CLASS_NAME = {
atrule: 'AtRule',
comment: 'Comment',
decl: 'Declaration',
document: 'Document',
root: 'Root',
rule: 'Rule'
};
const PLUGIN_PROPS = {
AtRule: true,
AtRuleExit: true,
Comment: true,
CommentExit: true,
Declaration: true,
DeclarationExit: true,
Document: true,
DocumentExit: true,
Once: true,
OnceExit: true,
postcssPlugin: true,
prepare: true,
Root: true,
RootExit: true,
Rule: true,
RuleExit: true
};
const NOT_VISITORS = {
Once: true,
postcssPlugin: true,
prepare: true
};
const CHILDREN = 0;
function isPromise(obj) {
return typeof obj === 'object' && typeof obj.then === 'function';
}
function getEvents(node) {
let key = false;
let type = TYPE_TO_CLASS_NAME[node.type];
if (node.type === 'decl') {
key = node.prop.toLowerCase();
} else if (node.type === 'atrule') {
key = node.name.toLowerCase();
}
if (key && node.append) {
return [
type,
type + '-' + key,
CHILDREN,
type + 'Exit',
type + 'Exit-' + key
];
} else if (key) {
return [
type,
type + '-' + key,
type + 'Exit',
type + 'Exit-' + key
];
} else if (node.append) {
return [
type,
CHILDREN,
type + 'Exit'
];
} else {
return [
type,
type + 'Exit'
];
}
}
function toStack(node) {
let events;
if (node.type === 'document') {
events = [
'Document',
CHILDREN,
'DocumentExit'
];
} else if (node.type === 'root') {
events = [
'Root',
CHILDREN,
'RootExit'
];
} else {
events = getEvents(node);
}
return {
eventIndex: 0,
events,
iterator: 0,
node,
visitorIndex: 0,
visitors: []
};
}
function cleanMarks(node) {
node[isClean] = false;
if (node.nodes) node.nodes.forEach((i)=>cleanMarks(i));
return node;
}
let postcss = {};
class LazyResult {
get content() {
return this.stringify().content;
}
get css() {
return this.stringify().css;
}
get map() {
return this.stringify().map;
}
get messages() {
return this.sync().messages;
}
get opts() {
return this.result.opts;
}
get processor() {
return this.result.processor;
}
get root() {
return this.sync().root;
}
get [Symbol.toStringTag]() {
return 'LazyResult';
}
constructor(processor, css, opts){
this.stringified = false;
this.processed = false;
let root;
if (typeof css === 'object' && css !== null && (css.type === 'root' || css.type === 'document')) {
root = cleanMarks(css);
} else if (css instanceof LazyResult || css instanceof Result) {
root = cleanMarks(css.root);
if (css.map) {
if (typeof opts.map === 'undefined') opts.map = {};
if (!opts.map.inline) opts.map.inline = false;
opts.map.prev = css.map;
}
} else {
let parser = parse;
if (opts.syntax) parser = opts.syntax.parse;
if (opts.parser) parser = opts.parser;
if (parser.parse) parser = parser.parse;
try {
root = parser(css, opts);
} catch (error) {
this.processed = true;
this.error = error;
}
if (root && !root[my]) {
/* c8 ignore next 2 */ Container.rebuild(root);
}
}
this.result = new Result(processor, root, opts);
this.helpers = {
...postcss,
postcss,
result: this.result
};
this.plugins = this.processor.plugins.map((plugin)=>{
if (typeof plugin === 'object' && plugin.prepare) {
return {
...plugin,
...plugin.prepare(this.result)
};
} else {
return plugin;
}
});
}
async() {
if (this.error) return Promise.reject(this.error);
if (this.processed) return Promise.resolve(this.result);
if (!this.processing) {
this.processing = this.runAsync();
}
return this.processing;
}
catch(onRejected) {
return this.async().catch(onRejected);
}
finally(onFinally) {
return this.async().then(onFinally, onFinally);
}
getAsyncError() {
throw new Error('Use process(css).then(cb) to work with async plugins');
}
handleError(error, node) {
let plugin = this.result.lastPlugin;
try {
if (node) node.addToError(error);
this.error = error;
if (error.name === 'CssSyntaxError' && !error.plugin) {
error.plugin = plugin.postcssPlugin;
error.setMessage();
} else if (plugin.postcssVersion) {
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
;
}
} catch (err) {
/* c8 ignore next 3 */ // eslint-disable-next-line no-console
if (console && console.error) console.error(err);
}
return error;
}
prepareVisitors() {
this.listeners = {};
let add = (plugin, type, cb)=>{
if (!this.listeners[type]) this.listeners[type] = [];
this.listeners[type].push([
plugin,
cb
]);
};
for (let plugin of this.plugins){
if (typeof plugin === 'object') {
for(let event in plugin){
if (!PLUGIN_PROPS[event] && /^[A-Z]/.test(event)) {
throw new Error(`Unknown event ${event} in ${plugin.postcssPlugin}. ` + `Try to update PostCSS (${this.processor.version} now).`);
}
if (!NOT_VISITORS[event]) {
if (typeof plugin[event] === 'object') {
for(let filter in plugin[event]){
if (filter === '*') {
add(plugin, event, plugin[event][filter]);
} else {
add(plugin, event + '-' + filter.toLowerCase(), plugin[event][filter]);
}
}
} else if (typeof plugin[event] === 'function') {
add(plugin, event, plugin[event]);
}
}
}
}
}
this.hasListener = Object.keys(this.listeners).length > 0;
}
async runAsync() {
this.plugin = 0;
for(let i = 0; i < this.plugins.length; i++){
let plugin = this.plugins[i];
let promise = this.runOnRoot(plugin);
if (isPromise(promise)) {
try {
await promise;
} catch (error) {
throw this.handleError(error);
}
}
}
this.prepareVisitors();
if (this.hasListener) {
let root = this.result.root;
while(!root[isClean]){
root[isClean] = true;
let stack = [
toStack(root)
];
while(stack.length > 0){
let promise = this.visitTick(stack);
if (isPromise(promise)) {
try {
await promise;
} catch (e) {
let node = stack[stack.length - 1].node;
throw this.handleError(e, node);
}
}
}
}
if (this.listeners.OnceExit) {
for (let [plugin, visitor] of this.listeners.OnceExit){
this.result.lastPlugin = plugin;
try {
if (root.type === 'document') {
let roots = root.nodes.map((subRoot)=>visitor(subRoot, this.helpers));
await Promise.all(roots);
} else {
await visitor(root, this.helpers);
}
} catch (e) {
throw this.handleError(e);
}
}
}
}
this.processed = true;
return this.stringify();
}
runOnRoot(plugin) {
this.result.lastPlugin = plugin;
try {
if (typeof plugin === 'object' && plugin.Once) {
if (this.result.root.type === 'document') {
let roots = this.result.root.nodes.map((root)=>plugin.Once(root, this.helpers));
if (isPromise(roots[0])) {
return Promise.all(roots);
}
return roots;
}
return plugin.Once(this.result.root, this.helpers);
} else if (typeof plugin === 'function') {
return plugin(this.result.root, this.result);
}
} catch (error) {
throw this.handleError(error);
}
}
stringify() {
if (this.error) throw this.error;
if (this.stringified) return this.result;
this.stringified = true;
this.sync();
let opts = this.result.opts;
let str = stringify;
if (opts.syntax) str = opts.syntax.stringify;
if (opts.stringifier) str = opts.stringifier;
if (str.stringify) str = str.stringify;
let map = new MapGenerator(str, this.result.root, this.result.opts);
let data = map.generate();
this.result.css = data[0];
this.result.map = data[1];
return this.result;
}
sync() {
if (this.error) throw this.error;
if (this.processed) return this.result;
this.processed = true;
if (this.processing) {
throw this.getAsyncError();
}
for (let plugin of this.plugins){
let promise = this.runOnRoot(plugin);
if (isPromise(promise)) {
throw this.getAsyncError();
}
}
this.prepareVisitors();
if (this.hasListener) {
let root = this.result.root;
while(!root[isClean]){
root[isClean] = true;
this.walkSync(root);
}
if (this.listeners.OnceExit) {
if (root.type === 'document') {
for (let subRoot of root.nodes){
this.visitSync(this.listeners.OnceExit, subRoot);
}
} else {
this.visitSync(this.listeners.OnceExit, root);
}
}
}
return this.result;
}
then(onFulfilled, onRejected) {
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
;
return this.async().then(onFulfilled, onRejected);
}
toString() {
return this.css;
}
visitSync(visitors, node) {
for (let [plugin, visitor] of visitors){
this.result.lastPlugin = plugin;
let promise;
try {
promise = visitor(node, this.helpers);
} catch (e) {
throw this.handleError(e, node.proxyOf);
}
if (node.type !== 'root' && node.type !== 'document' && !node.parent) {
return true;
}
if (isPromise(promise)) {
throw this.getAsyncError();
}
}
}
visitTick(stack) {
let visit = stack[stack.length - 1];
let { node, visitors } = visit;
if (node.type !== 'root' && node.type !== 'document' && !node.parent) {
stack.pop();
return;
}
if (visitors.length > 0 && visit.visitorIndex < visitors.length) {
let [plugin, visitor] = visitors[visit.visitorIndex];
visit.visitorIndex += 1;
if (visit.visitorIndex === visitors.length) {
visit.visitors = [];
visit.visitorIndex = 0;
}
this.result.lastPlugin = plugin;
try {
return visitor(node.toProxy(), this.helpers);
} catch (e) {
throw this.handleError(e, node);
}
}
if (visit.iterator !== 0) {
let iterator = visit.iterator;
let child;
while(child = node.nodes[node.indexes[iterator]]){
node.indexes[iterator] += 1;
if (!child[isClean]) {
child[isClean] = true;
stack.push(toStack(child));
return;
}
}
visit.iterator = 0;
delete node.indexes[iterator];
}
let events = visit.events;
while(visit.eventIndex < events.length){
let event = events[visit.eventIndex];
visit.eventIndex += 1;
if (event === CHILDREN) {
if (node.nodes && node.nodes.length) {
node[isClean] = true;
visit.iterator = node.getIterator();
}
return;
} else if (this.listeners[event]) {
visit.visitors = this.listeners[event];
return;
}
}
stack.pop();
}
walkSync(node) {
node[isClean] = true;
let events = getEvents(node);
for (let event of events){
if (event === CHILDREN) {
if (node.nodes) {
node.each((child)=>{
if (!child[isClean]) this.walkSync(child);
});
}
} else {
let visitors = this.listeners[event];
if (visitors) {
if (this.visitSync(visitors, node.toProxy())) return;
}
}
}
}
warnings() {
return this.sync().warnings();
}
}
LazyResult.registerPostcss = (dependant)=>{
postcss = dependant;
};
module.exports = LazyResult;
LazyResult.default = LazyResult;
Root.registerLazyResult(LazyResult);
Document.registerLazyResult(LazyResult);
}),
"[project]/node_modules/postcss/lib/no-work-result.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let MapGenerator = __turbopack_context__.r("[project]/node_modules/postcss/lib/map-generator.js [postcss] (ecmascript)");
let parse = __turbopack_context__.r("[project]/node_modules/postcss/lib/parse.js [postcss] (ecmascript)");
const Result = __turbopack_context__.r("[project]/node_modules/postcss/lib/result.js [postcss] (ecmascript)");
let stringify = __turbopack_context__.r("[project]/node_modules/postcss/lib/stringify.js [postcss] (ecmascript)");
let warnOnce = __turbopack_context__.r("[project]/node_modules/postcss/lib/warn-once.js [postcss] (ecmascript)");
class NoWorkResult {
get content() {
return this.result.css;
}
get css() {
return this.result.css;
}
get map() {
return this.result.map;
}
get messages() {
return [];
}
get opts() {
return this.result.opts;
}
get processor() {
return this.result.processor;
}
get root() {
if (this._root) {
return this._root;
}
let root;
let parser = parse;
try {
root = parser(this._css, this._opts);
} catch (error) {
this.error = error;
}
if (this.error) {
throw this.error;
} else {
this._root = root;
return root;
}
}
get [Symbol.toStringTag]() {
return 'NoWorkResult';
}
constructor(processor, css, opts){
css = css.toString();
this.stringified = false;
this._processor = processor;
this._css = css;
this._opts = opts;
this._map = undefined;
let root;
let str = stringify;
this.result = new Result(this._processor, root, this._opts);
this.result.css = css;
let self = this;
Object.defineProperty(this.result, 'root', {
get () {
return self.root;
}
});
let map = new MapGenerator(str, root, this._opts, css);
if (map.isMap()) {
let [generatedCSS, generatedMap] = map.generate();
if (generatedCSS) {
this.result.css = generatedCSS;
}
if (generatedMap) {
this.result.map = generatedMap;
}
} else {
map.clearAnnotation();
this.result.css = map.css;
}
}
async() {
if (this.error) return Promise.reject(this.error);
return Promise.resolve(this.result);
}
catch(onRejected) {
return this.async().catch(onRejected);
}
finally(onFinally) {
return this.async().then(onFinally, onFinally);
}
sync() {
if (this.error) throw this.error;
return this.result;
}
then(onFulfilled, onRejected) {
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
;
return this.async().then(onFulfilled, onRejected);
}
toString() {
return this._css;
}
warnings() {
return [];
}
}
module.exports = NoWorkResult;
NoWorkResult.default = NoWorkResult;
}),
"[project]/node_modules/postcss/lib/processor.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let Document = __turbopack_context__.r("[project]/node_modules/postcss/lib/document.js [postcss] (ecmascript)");
let LazyResult = __turbopack_context__.r("[project]/node_modules/postcss/lib/lazy-result.js [postcss] (ecmascript)");
let NoWorkResult = __turbopack_context__.r("[project]/node_modules/postcss/lib/no-work-result.js [postcss] (ecmascript)");
let Root = __turbopack_context__.r("[project]/node_modules/postcss/lib/root.js [postcss] (ecmascript)");
class Processor {
constructor(plugins = []){
this.version = '8.5.6';
this.plugins = this.normalize(plugins);
}
normalize(plugins) {
let normalized = [];
for (let i of plugins){
if (i.postcss === true) {
i = i();
} else if (i.postcss) {
i = i.postcss;
}
if (typeof i === 'object' && Array.isArray(i.plugins)) {
normalized = normalized.concat(i.plugins);
} else if (typeof i === 'object' && i.postcssPlugin) {
normalized.push(i);
} else if (typeof i === 'function') {
normalized.push(i);
} else if (typeof i === 'object' && (i.parse || i.stringify)) {
if ("TURBOPACK compile-time falsy", 0) //TURBOPACK unreachable
;
} else {
throw new Error(i + ' is not a PostCSS plugin');
}
}
return normalized;
}
process(css, opts = {}) {
if (!this.plugins.length && !opts.parser && !opts.stringifier && !opts.syntax) {
return new NoWorkResult(this, css, opts);
} else {
return new LazyResult(this, css, opts);
}
}
use(plugin) {
this.plugins = this.plugins.concat(this.normalize([
plugin
]));
return this;
}
}
module.exports = Processor;
Processor.default = Processor;
Root.registerProcessor(Processor);
Document.registerProcessor(Processor);
}),
"[project]/node_modules/postcss/lib/postcss.js [postcss] (ecmascript)", ((__turbopack_context__, module, exports) => {
"use strict";
let AtRule = __turbopack_context__.r("[project]/node_modules/postcss/lib/at-rule.js [postcss] (ecmascript)");
let Comment = __turbopack_context__.r("[project]/node_modules/postcss/lib/comment.js [postcss] (ecmascript)");
let Container = __turbopack_context__.r("[project]/node_modules/postcss/lib/container.js [postcss] (ecmascript)");
let CssSyntaxError = __turbopack_context__.r("[project]/node_modules/postcss/lib/css-syntax-error.js [postcss] (ecmascript)");
let Declaration = __turbopack_context__.r("[project]/node_modules/postcss/lib/declaration.js [postcss] (ecmascript)");
let Document = __turbopack_context__.r("[project]/node_modules/postcss/lib/document.js [postcss] (ecmascript)");
let fromJSON = __turbopack_context__.r("[project]/node_modules/postcss/lib/fromJSON.js [postcss] (ecmascript)");
let Input = __turbopack_context__.r("[project]/node_modules/postcss/lib/input.js [postcss] (ecmascript)");
let LazyResult = __turbopack_context__.r("[project]/node_modules/postcss/lib/lazy-result.js [postcss] (ecmascript)");
let list = __turbopack_context__.r("[project]/node_modules/postcss/lib/list.js [postcss] (ecmascript)");
let Node = __turbopack_context__.r("[project]/node_modules/postcss/lib/node.js [postcss] (ecmascript)");
let parse = __turbopack_context__.r("[project]/node_modules/postcss/lib/parse.js [postcss] (ecmascript)");
let Processor = __turbopack_context__.r("[project]/node_modules/postcss/lib/processor.js [postcss] (ecmascript)");
let Result = __turbopack_context__.r("[project]/node_modules/postcss/lib/result.js [postcss] (ecmascript)");
let Root = __turbopack_context__.r("[project]/node_modules/postcss/lib/root.js [postcss] (ecmascript)");
let Rule = __turbopack_context__.r("[project]/node_modules/postcss/lib/rule.js [postcss] (ecmascript)");
let stringify = __turbopack_context__.r("[project]/node_modules/postcss/lib/stringify.js [postcss] (ecmascript)");
let Warning = __turbopack_context__.r("[project]/node_modules/postcss/lib/warning.js [postcss] (ecmascript)");
function postcss(...plugins) {
if (plugins.length === 1 && Array.isArray(plugins[0])) {
plugins = plugins[0];
}
return new Processor(plugins);
}
postcss.plugin = function plugin(name, initializer) {
let warningPrinted = false;
function creator(...args) {
// eslint-disable-next-line no-console
if (console && console.warn && !warningPrinted) {
warningPrinted = true;
// eslint-disable-next-line no-console
console.warn(name + ': postcss.plugin was deprecated. Migration guide:\n' + 'https://evilmartians.com/chronicles/postcss-8-plugin-migration');
if (process.env.LANG && process.env.LANG.startsWith('cn')) {
/* c8 ignore next 7 */ // eslint-disable-next-line no-console
console.warn(name + ': 里面 postcss.plugin 被弃用. 迁移指南:\n' + 'https://www.w3ctech.com/topic/2226');
}
}
let transformer = initializer(...args);
transformer.postcssPlugin = name;
transformer.postcssVersion = new Processor().version;
return transformer;
}
let cache;
Object.defineProperty(creator, 'postcss', {
get () {
if (!cache) cache = creator();
return cache;
}
});
creator.process = function(css, processOpts, pluginOpts) {
return postcss([
creator(pluginOpts)
]).process(css, processOpts);
};
return creator;
};
postcss.stringify = stringify;
postcss.parse = parse;
postcss.fromJSON = fromJSON;
postcss.list = list;
postcss.comment = (defaults)=>new Comment(defaults);
postcss.atRule = (defaults)=>new AtRule(defaults);
postcss.decl = (defaults)=>new Declaration(defaults);
postcss.rule = (defaults)=>new Rule(defaults);
postcss.root = (defaults)=>new Root(defaults);
postcss.document = (defaults)=>new Document(defaults);
postcss.CssSyntaxError = CssSyntaxError;
postcss.Declaration = Declaration;
postcss.Container = Container;
postcss.Processor = Processor;
postcss.Document = Document;
postcss.Comment = Comment;
postcss.Warning = Warning;
postcss.AtRule = AtRule;
postcss.Result = Result;
postcss.Input = Input;
postcss.Rule = Rule;
postcss.Root = Root;
postcss.Node = Node;
LazyResult.registerPostcss(postcss);
module.exports = postcss;
postcss.default = postcss;
}),
"[project]/node_modules/postcss/lib/postcss.mjs [postcss] (ecmascript)", ((__turbopack_context__) => {
"use strict";
__turbopack_context__.s([
"AtRule",
()=>AtRule,
"Comment",
()=>Comment,
"Container",
()=>Container,
"CssSyntaxError",
()=>CssSyntaxError,
"Declaration",
()=>Declaration,
"Document",
()=>Document,
"Input",
()=>Input,
"Node",
()=>Node,
"Processor",
()=>Processor,
"Result",
()=>Result,
"Root",
()=>Root,
"Rule",
()=>Rule,
"Warning",
()=>Warning,
"atRule",
()=>atRule,
"comment",
()=>comment,
"decl",
()=>decl,
"default",
()=>__TURBOPACK__default__export__,
"document",
()=>document,
"fromJSON",
()=>fromJSON,
"list",
()=>list,
"parse",
()=>parse,
"plugin",
()=>plugin,
"root",
()=>root,
"rule",
()=>rule,
"stringify",
()=>stringify
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/postcss/lib/postcss.js [postcss] (ecmascript)");
;
const __TURBOPACK__default__export__ = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"];
const stringify = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].stringify;
const fromJSON = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].fromJSON;
const plugin = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].plugin;
const parse = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].parse;
const list = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].list;
const document = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].document;
const comment = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].comment;
const atRule = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].atRule;
const rule = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].rule;
const decl = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].decl;
const root = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].root;
const CssSyntaxError = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].CssSyntaxError;
const Declaration = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].Declaration;
const Container = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].Container;
const Processor = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].Processor;
const Document = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].Document;
const Comment = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].Comment;
const Warning = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].Warning;
const AtRule = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].AtRule;
const Result = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].Result;
const Input = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].Input;
const Rule = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].Rule;
const Root = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].Root;
const Node = __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$postcss$2f$lib$2f$postcss$2e$js__$5b$postcss$5d$__$28$ecmascript$29$__["default"].Node;
}),
];
//# sourceMappingURL=node_modules_fe693df6._.js.map